diff --git a/apps/ios/EdgeEver/Editor/SystemImagePicker.swift b/apps/ios/EdgeEver/Editor/SystemImagePicker.swift index 97a0b867..f22caf2a 100644 --- a/apps/ios/EdgeEver/Editor/SystemImagePicker.swift +++ b/apps/ios/EdgeEver/Editor/SystemImagePicker.swift @@ -10,6 +10,7 @@ enum ImagePickerResult { case cancelled case failed(String) case picked(Data, filename: String) + case pickedImages([(data: Data, filename: String)]) } enum CameraCaptureNextStep: Equatable { @@ -45,7 +46,8 @@ struct SystemImagePicker: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> PHPickerViewController { var config = PHPickerConfiguration(photoLibrary: .shared()) config.filter = .images - config.selectionLimit = 1 + config.selectionLimit = 20 + config.selection = .ordered config.preferredAssetRepresentationMode = .current let picker = PHPickerViewController(configuration: config) picker.delegate = context.coordinator @@ -68,18 +70,22 @@ struct SystemImagePicker: UIViewControllerRepresentable { func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { guard !settled else { return } - guard let provider = results.first?.itemProvider else { + guard !results.isEmpty else { settled = true DispatchQueue.main.async { self.onFinish(.cancelled) } return } Task { do { - let (data, name) = try await Self.loadImage(from: provider) + var images: [(data: Data, filename: String)] = [] + for result in results { + let (data, name) = try await Self.loadImage(from: result.itemProvider) + images.append((data: data, filename: name)) + } await MainActor.run { guard !self.settled else { return } self.settled = true - self.onFinish(.picked(data, filename: name)) + self.onFinish(.pickedImages(images)) } } catch { await MainActor.run { diff --git a/apps/ios/EdgeEver/Editor/TipTapWarmPool.swift b/apps/ios/EdgeEver/Editor/TipTapWarmPool.swift index cef9f0ee..0380198c 100644 --- a/apps/ios/EdgeEver/Editor/TipTapWarmPool.swift +++ b/apps/ios/EdgeEver/Editor/TipTapWarmPool.swift @@ -383,6 +383,24 @@ final class SharedTipTapRuntime: NSObject, WKScriptMessageHandler, WKNavigationD return true } + /// Group only successfully inserted images from this picker batch. + func groupImages(sources: [String]) async -> Bool { + guard ready, session?.mode == .editor, + let json = try? JSONEncoder().encode(sources) else { return false } + let encoded = json.base64EncodedString() + let js = """ + (function(){ + const bytes = Uint8Array.from(atob('\(encoded)'), c => c.charCodeAt(0)); + return window.EdgeEverEditor.groupImages(JSON.parse(new TextDecoder().decode(bytes))); + })(); + """ + return await withCheckedContinuation { continuation in + webView.evaluateJavaScript(js) { result, _ in + continuation.resume(returning: (result as? Bool) ?? false) + } + } + } + /// Read current editor markdown + JSON after a mutation (avoids racing the async bridge onChange). func snapshotContent() async -> (markdown: String, json: String)? { guard ready else { return nil } diff --git a/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift b/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift index ed24111f..09cb680c 100644 --- a/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift +++ b/apps/ios/EdgeEver/Features/Workspace/MemoEditView.swift @@ -39,6 +39,7 @@ struct MemoEditView: View { @State private var showTagPicker = false @State private var showImageSourcePicker = false @State private var imagePickerRoute: ImagePickerRoute? + @State private var isImportingImageBatch = false @State private var showCameraAccessAlert = false @State private var cameraAccessCanOpenSettings = false @State private var cameraAccessMessage = "" @@ -72,7 +73,7 @@ struct MemoEditView: View { private var isDirty: Bool { get { viewModel.isDirty } nonmutating set { viewModel.isDirty = newValue } } private var isSaving: Bool { get { viewModel.isSaving } nonmutating set { viewModel.isSaving = newValue } } private var isCreating: Bool { get { viewModel.isCreating } nonmutating set { viewModel.isCreating = newValue } } - private var isUploading: Bool { get { viewModel.isUploading } nonmutating set { viewModel.isUploading = newValue } } + private var isUploading: Bool { get { viewModel.isUploading || isImportingImageBatch } nonmutating set { viewModel.isUploading = newValue } } private var editorReady: Bool { get { viewModel.editorReady } nonmutating set { viewModel.editorReady = newValue } } private var suppressPersistence: Bool { get { viewModel.suppressPersistence } nonmutating set { viewModel.suppressPersistence = newValue } } private var contentHydrated: Bool { get { viewModel.contentHydrated } nonmutating set { viewModel.contentHydrated = newValue } } @@ -677,6 +678,8 @@ struct MemoEditView: View { showUploadError = true case .picked(let data, let filename): Task { _ = await insertImageData(data, filename: filename) } + case .pickedImages(let images): + Task { await insertImageBatch(images) } } } @@ -1190,7 +1193,27 @@ struct MemoEditView: View { } /// Upload bytes from the system PHPicker and insert into TipTap. - private func insertImageData(_ data: Data, filename: String) async -> Bool { + private func insertImageBatch(_ images: [(data: Data, filename: String)]) async { + guard !isUploading, !images.isEmpty else { return } + isImportingImageBatch = true + var sources: [String] = [] + for image in images { + let succeeded = await insertImageData(image.data, filename: image.filename) { sources.append($0) } + if !succeeded { break } + } + if sources.count > 1 { + _ = await SharedTipTapRuntime.editor.groupImages(sources: sources) + await pullEditorSnapshotIfPossible() + } + isImportingImageBatch = false + if !sources.isEmpty { + editGeneration &+= 1 + isDirty = true + await drainPendingSave() + } + } + + private func insertImageData(_ data: Data, filename: String, onInserted: ((String) -> Void)? = nil) async -> Bool { let succeeded = await viewModel.performUpload { NSLog("MemoEditView insertImageData: start bytes=%d name=%@", data.count, filename) let compress = env.preferences.useCompression @@ -1242,6 +1265,7 @@ struct MemoEditView: View { ) ) } + onInserted?(imageSrc) // Snapshot TipTap JSON (order is authoritative). Only inject if the resource // is truly missing — never append a second image node at document end. await pullEditorSnapshotIfPossible() diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.html index 87c07e65..24029d68 100644 --- a/apps/ios/EdgeEver/Resources/EditorBundle/index.html +++ b/apps/ios/EdgeEver/Resources/EditorBundle/index.html @@ -7,38 +7,32 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> EdgeEver Editor - - +`},"getStyles"),dT,Wc=(dT=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()}},w(dT,"PathBuilder"),dT),fT,Fyr=(fT=class{constructor(e,r=Tie()){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 Wc,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,x,s,d+(x?s:-s)).lineTo(s,g-(x?s:-s)).arcTo(s,s,0,!1,!x,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new Wc,T=m+f.dimensions.width,k=l-s*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(k,g).arcTo(s,s,0,!1,!x,l-s,g+(x?-s:s)).lineTo(l-s,d+(x?s:-s)).arcTo(s,s,0,!1,x,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 Wc().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Wc().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Wc().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 Wc().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Wc().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new Wc().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 Wc().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 Wc().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Wc().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}}},w(fT,"RailroadRenderer"),fT),Uye=w((t,e,r)=>{_a(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),zyr=w((t,e,r)=>{he.debug(`[Railroad] Rendering diagram +`+t);try{const n=Po(e);n.attr("class","railroad-diagram");const i=pr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=Wi.getRules();if(he.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){he.warn("[Railroad] No rules to render"),Uye(n,{height:100,width:200},a);return}const l=new Fyr(n,Tie()).renderDiagram(s);Uye(n,l,a),he.debug("[Railroad] Render complete")}catch(n){throw he.error("[Railroad] Render error:",n),n}},"draw"),zO={draw:zyr},Hyr=bne().Railroad.parser.LangiumParser,$2=w(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($2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map($2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:$2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:$2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:$2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),Vyr=w(t=>({name:t.name,definition:$2(t.definition)}),"transformRule"),Wyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Vyr(e)))},"populateDb"),qyr={parse:w(t=>{Wi.clear(),he.debug("[Railroad Parser] Starting Langium parse");const e=Hyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[Railroad Parser] Parsed rules:",r.rules.length),Wyr(r),he.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Wi}},Gyr={parser:qyr,db:Wi,renderer:zO,styles:FO};const Uyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gyr},Symbol.toStringTag,{value:"Module"}));var Yyr=xne().RailroadEbnf.parser.LangiumParser,C_=w(t=>{const e=t.alternatives.map(jyr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),jyr=w(t=>{const e=t.elements.map(Kyr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),eje=w(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 C_(t.element);case"EbnfOptional":return{type:"optional",element:C_(t.element)};case"EbnfRepetition":return{type:"repetition",element:C_(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),Xyr=w((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:"-"},eje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Kyr=w(t=>t.postfixes.reduce((e,r)=>Xyr(e,r),eje(t.base)),"transformTerm"),Zyr=w(t=>({name:t.name,definition:C_(t.definition)}),"transformRule"),Qyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Zyr(e)))},"populateDb"),Jyr={parse:w(t=>{Wi.clear(),he.debug("[EBNF Parser] Starting Langium parse");const e=Yyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[EBNF Parser] Parsed rules:",r.rules.length),Qyr(r),he.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},evr={parser:Jyr,db:Wi,renderer:zO,styles:FO};const tvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:evr},Symbol.toStringTag,{value:"Module"}));var rvr=wne().RailroadAbnf.parser.LangiumParser,hX=w(t=>{const e=t.alternatives.map(nvr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),nvr=w(t=>{const e=t.elements.map(avr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),ivr=w(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"),avr=w(t=>{const e=svr(t.primary);if(!t.repeat)return e;const{min:r,max:n}=ivr(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),svr=w(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 hX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:hX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),ovr=w(t=>({name:t.name,definition:hX(t.definition)}),"transformRule"),lvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(ovr(e)))},"populateDb"),cvr={parse:w(t=>{Wi.clear(),he.debug("[ABNF Parser] Starting Langium parse");const e=rvr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[ABNF Parser] Parsed rules:",r.rules.length),lvr(r),he.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},uvr={parser:cvr,db:Wi,renderer:zO,styles:FO};const hvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:uvr},Symbol.toStringTag,{value:"Module"}));var dvr=Tne().RailroadPeg.parser.LangiumParser,tje=w(t=>{const e=t.alternatives.map(fvr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),fvr=w(t=>{const e=t.elements.map(pvr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),pvr=w(t=>{const e=gvr(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Yye(e)}`:`!${Yye(e)}`}:e},"transformPrefix"),Yye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),gvr=w(t=>{const e=mvr(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"),mvr=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return tje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),yvr=w(t=>({name:t.name,definition:tje(t.definition)}),"transformRule"),vvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(yvr(e)))},"populateDb"),bvr={parse:w(t=>{Wi.clear(),he.debug("[PEG Parser] Starting Langium parse");const e=dvr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[PEG Parser] Parsed rules:",r.rules.length),vvr(r),he.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Wi}},xvr={parser:bvr,db:Wi,renderer:zO,styles:FO};const wvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xvr},Symbol.toStringTag,{value:"Module"}));var Tvr=1;function kie(){if(!(typeof globalThis>"u"))return globalThis}w(kie,"getCaptureGlobal");function rje(){var t;return!!((t=kie())!=null&&t.mermaidCaptureSizes)}w(rje,"shouldCaptureSizes");function nje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(nje,"capturedFromLocation");function ije(t,e){const r=kie();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}w(ije,"emitCapturedSizes");function aje(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&&ije({metadata:{captureVersion:Tvr,capturedAt:new Date().toISOString(),capturedFrom:nje()},nodes:r},t)}w(aje,"captureNodeSizes");const kvr=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:aje,shouldCaptureSizes:rje},Symbol.toStringTag,{value:"Module"})),Cvr=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:bWe,createInfoServices:xWe},Symbol.toStringTag,{value:"Module"})),Svr=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:wWe,createPacketServices:TWe},Symbol.toStringTag,{value:"Module"})),Evr=Object.freeze(Object.defineProperty({__proto__:null,PieModule:kWe,createPieServices:CWe},Symbol.toStringTag,{value:"Module"})),Avr=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:SWe,createTreeViewServices:EWe},Symbol.toStringTag,{value:"Module"})),Rvr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:AWe,createArchitectureServices:RWe},Symbol.toStringTag,{value:"Module"})),_vr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:yWe,createGitGraphServices:vWe},Symbol.toStringTag,{value:"Module"})),Mvr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:MWe,createEventModelingServices:LWe},Symbol.toStringTag,{value:"Module"})),Lvr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:iWe,createRadarServices:aWe},Symbol.toStringTag,{value:"Module"})),Ivr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:sWe,createRailroadServices:bne},Symbol.toStringTag,{value:"Module"})),$vr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:oWe,createRailroadEbnfServices:xne},Symbol.toStringTag,{value:"Module"})),Nvr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:lWe,createRailroadAbnfServices:wne},Symbol.toStringTag,{value:"Module"})),Dvr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:cWe,createRailroadPegServices:Tne},Symbol.toStringTag,{value:"Module"})),Ovr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:hWe,createTreemapServices:dWe},Symbol.toStringTag,{value:"Module"})),Pvr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:fWe,createWardleyServices:pWe},Symbol.toStringTag,{value:"Module"})),Bvr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:gWe,createCynefinServices:mWe},Symbol.toStringTag,{value:"Module"})); + |$))/,$nt=In("^ {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",QX).replace("tag",f$).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bxe=In(KX).replace("hr",sE).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",f$).getRegex(),Nnt=In(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bxe).getRegex(),JX={blockquote:Nnt,code:Ent,def:Lnt,fences:Ant,heading:Rnt,hr:sE,html:$nt,lheading:vxe,list:Int,newline:Snt,paragraph:bxe,table:Sm,text:Mnt},vse=In("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sE).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",f$).getRegex(),Dnt={...JX,lheading:_nt,table:vse,paragraph:In(KX).replace("hr",sE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vse).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",f$).getRegex()},Ont={...JX,html:In(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",QX).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:Sm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:In(KX).replace("hr",sE).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",vxe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pnt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bnt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xxe=/^( {2,}|\\)\n(?!\s*$)/,Fnt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Cnt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Txe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qnt=In(Txe,"u").replace(/punct/g,E3).getRegex(),Gnt=In(Txe,"u").replace(/punct/g,wxe).getRegex(),kxe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Unt=In(kxe,"gu").replace(/notPunctSpace/g,eK).replace(/punctSpace/g,p$).replace(/punct/g,E3).getRegex(),Ynt=In(kxe,"gu").replace(/notPunctSpace/g,Vnt).replace(/punctSpace/g,Hnt).replace(/punct/g,wxe).getRegex(),jnt=In("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eK).replace(/punctSpace/g,p$).replace(/punct/g,E3).getRegex(),Xnt=In(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,E3).getRegex(),Knt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Znt=In(Knt,"gu").replace(/notPunctSpace/g,eK).replace(/punctSpace/g,p$).replace(/punct/g,E3).getRegex(),Qnt=In(/\\(punct)/,"gu").replace(/punct/g,E3).getRegex(),Jnt=In(/^<(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(),eit=In(QX).replace("(?:-->|$)","-->").getRegex(),tit=In("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",eit).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),d9=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,rit=In(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",d9).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Cxe=In(/^!?\[(label)\]\[(ref)\]/).replace("label",d9).replace("ref",ZX).getRegex(),Sxe=In(/^!?\[(ref)\](?:\[\])?/).replace("ref",ZX).getRegex(),nit=In("reflink|nolink(?!\\()","g").replace("reflink",Cxe).replace("nolink",Sxe).getRegex(),bse=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tK={_backpedal:Sm,anyPunctuation:Qnt,autolink:Jnt,blockSkip:Wnt,br:xxe,code:Bnt,del:Sm,delLDelim:Sm,delRDelim:Sm,emStrongLDelim:qnt,emStrongRDelimAst:Unt,emStrongRDelimUnd:jnt,escape:Pnt,link:rit,nolink:Sxe,punctuation:znt,reflink:Cxe,reflinkSearch:nit,tag:tit,text:Fnt,url:Sm},iit={...tK,link:In(/^!?\[(label)\]\((.*?)\)/).replace("label",d9).getRegex(),reflink:In(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",d9).getRegex()},EV={...tK,emStrongRDelimAst:Ynt,emStrongLDelim:Gnt,delLDelim:Xnt,delRDelim:Znt,url:In(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bse).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:In(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},xse=t=>sit[t];function bh(t,e){if(e){if(il.escapeTest.test(t))return t.replace(il.escapeReplace,xse)}else if(il.escapeTestNoEncode.test(t))return t.replace(il.escapeReplaceNoEncode,xse);return t}function wse(t){try{t=encodeURI(t).replace(il.percentDecode,"%")}catch{return null}return t}function Tse(t,e){var a;let r=t.replace(il.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(il.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 lit(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 kse(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 cit(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +`);return{...l,raw:h}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const s=bnt(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})=>Art(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Rrt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=pS(t.selection.$from,n=>n.type.name==="table");return Mrt(t,e&&(n=>{r&&bse(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>Irt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>$rt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=pS(t.selection.$from,n=>n.type.name==="table");return Drt(t,e&&(n=>{r&&bse(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>Vrt(t,e),mergeCells:()=>({state:t,dispatch:e})=>sse(t,e),splitCell:()=>({state:t,dispatch:e})=>ose(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>vS("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>vS("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>zrt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>sse(t,e)?!0:ose(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>Brt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>cse(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>cse(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&lxe(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Mi.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:z7,"Mod-Backspace":z7,Delete:z7,"Mod-Delete":z7}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Qrt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],lnt({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=ai(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:qn(dr(t,"tableRole",e))}}}),Ent=Ui.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(Snt.configure(this.options.table)),this.options.tableCell!==!1&&t.push(fnt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(pnt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(gnt.configure(this.options.tableRow)),t}});function KX(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ty=KX();function yxe(t){Ty=t}var Sm={exec:()=>null};function In(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(il.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var Ant=(()=>{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)}}>`)},Rnt=/^(?:[ \t]*(?:\n|$))+/,_nt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mnt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Lnt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ZX=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vxe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bxe=In(vxe).replace(/bull/g,ZX).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(),Int=In(vxe).replace(/bull/g,ZX).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(),QX=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$nt=/^[^\n]+/,JX=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Nnt=In(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",JX).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Dnt=In(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ZX).getRegex(),g$="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",eK=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,Ont=In("^ {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",eK).replace("tag",g$).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xxe=In(QX).replace("hr",oE).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",g$).getRegex(),Pnt=In(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xxe).getRegex(),tK={blockquote:Pnt,code:_nt,def:Nnt,fences:Mnt,heading:Lnt,hr:oE,html:Ont,lheading:bxe,list:Dnt,newline:Rnt,paragraph:xxe,table:Sm,text:$nt},xse=In("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",oE).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",g$).getRegex(),Bnt={...tK,lheading:Int,table:xse,paragraph:In(QX).replace("hr",oE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xse).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",g$).getRegex()},Fnt={...tK,html:In(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",eK).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:Sm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:In(QX).replace("hr",oE).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",bxe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},znt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Hnt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wxe=/^( {2,}|\\)\n(?!\s*$)/,Vnt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ant?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kxe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ynt=In(kxe,"u").replace(/punct/g,E3).getRegex(),jnt=In(kxe,"u").replace(/punct/g,Txe).getRegex(),Cxe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xnt=In(Cxe,"gu").replace(/notPunctSpace/g,rK).replace(/punctSpace/g,m$).replace(/punct/g,E3).getRegex(),Knt=In(Cxe,"gu").replace(/notPunctSpace/g,Gnt).replace(/punctSpace/g,qnt).replace(/punct/g,Txe).getRegex(),Znt=In("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rK).replace(/punctSpace/g,m$).replace(/punct/g,E3).getRegex(),Qnt=In(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,E3).getRegex(),Jnt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",eit=In(Jnt,"gu").replace(/notPunctSpace/g,rK).replace(/punctSpace/g,m$).replace(/punct/g,E3).getRegex(),tit=In(/\\(punct)/,"gu").replace(/punct/g,E3).getRegex(),rit=In(/^<(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(),nit=In(eK).replace("(?:-->|$)","-->").getRegex(),iit=In("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",nit).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),f9=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ait=In(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",f9).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Sxe=In(/^!?\[(label)\]\[(ref)\]/).replace("label",f9).replace("ref",JX).getRegex(),Exe=In(/^!?\[(ref)\](?:\[\])?/).replace("ref",JX).getRegex(),sit=In("reflink|nolink(?!\\()","g").replace("reflink",Sxe).replace("nolink",Exe).getRegex(),wse=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nK={_backpedal:Sm,anyPunctuation:tit,autolink:rit,blockSkip:Unt,br:wxe,code:Hnt,del:Sm,delLDelim:Sm,delRDelim:Sm,emStrongLDelim:Ynt,emStrongRDelimAst:Xnt,emStrongRDelimUnd:Znt,escape:znt,link:ait,nolink:Exe,punctuation:Wnt,reflink:Sxe,reflinkSearch:sit,tag:iit,text:Vnt,url:Sm},oit={...nK,link:In(/^!?\[(label)\]\((.*?)\)/).replace("label",f9).getRegex(),reflink:In(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",f9).getRegex()},RV={...nK,emStrongRDelimAst:Knt,emStrongLDelim:jnt,delLDelim:Qnt,delRDelim:eit,url:In(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wse).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:In(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Tse=t=>cit[t];function bh(t,e){if(e){if(il.escapeTest.test(t))return t.replace(il.escapeReplace,Tse)}else if(il.escapeTestNoEncode.test(t))return t.replace(il.escapeReplaceNoEncode,Tse);return t}function kse(t){try{t=encodeURI(t).replace(il.percentDecode,"%")}catch{return null}return t}function Cse(t,e){var a;let r=t.replace(il.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(il.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 hit(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 Sse(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 dit(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 f9=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||Ty}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:pk(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=cit(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=pk(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:pk(r[0],` +`)}var p9=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||Ty}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:pk(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=dit(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=pk(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:pk(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=pk(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=lit(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=hit(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 x=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),T=this.rules.other.fencesBeginRegex(v),k=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),C=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(` `,1)[0],A;if(m=E,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),A=m):A=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||k.test(m)||S.test(m)||C.test(m)||x.test(m)||b.test(m))break;if(A.search(this.rules.other.nonSpaceChar)>=v||!m.trim())p+=` `+A.slice(v);else{if(y||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||k.test(g)||b.test(g))break;p+=` `+m}y=!m.trim(),f+=E+` -`,e=e.substring(E.length+1),g=A.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=Tse(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=pk(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=oit(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)),kse(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 kse(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}}}},Mu=class AV{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"inlineQueue");Ut(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ty,this.options.tokenizer=this.options.tokenizer||new f9,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:il,block:z7.normal,inline:fk.normal};this.options.pedantic?(r.block=z7.pedantic,r.inline=fk.pedantic):this.options.gfm&&(r.block=z7.gfm,this.options.breaks?r.inline=fk.breaks:r.inline=fk.gfm),this.tokenizer.rules=r}static get rules(){return{block:z7,inline:fk}}static lex(e,r){return new AV(r).lex(e)}static lexInline(e,r){return new AV(r).inlineTokens(e)}lex(e){e=e.replace(il.carriageReturn,` +`,e=e.substring(E.length+1),g=A.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=Cse(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=pk(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=uit(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)),Sse(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 Sse(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}}}},Mu=class _V{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"inlineQueue");Ut(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ty,this.options.tokenizer=this.options.tokenizer||new p9,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:il,block:H7.normal,inline:fk.normal};this.options.pedantic?(r.block=H7.pedantic,r.inline=fk.pedantic):this.options.gfm&&(r.block=H7.gfm,this.options.breaks?r.inline=fk.breaks:r.inline=fk.gfm),this.tokenizer.rules=r}static get rules(){return{block:H7,inline:fk}}static lex(e,r){return new _V(r).lex(e)}static lexInline(e,r){return new _V(r).inlineTokens(e)}lex(e){e=e.replace(il.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(` `)?"":` @@ -197,7 +197,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},p9=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||Ty}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(il.notSpaceStart))==null?void 0:s[0],a=e.replace(il.endingNewline,"")+` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},g9=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||Ty}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(il.notSpaceStart))==null?void 0:s[0],a=e.replace(il.endingNewline,"")+` `;return i?'
'+(n?a:bh(a,!0))+`
`:"
"+(n?a:bh(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -215,19 +215,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`${bh(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=wse(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=wse(e);if(a===null)return bh(n);e=a;let s=`${bh(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 p9(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 f9(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 m5;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];m5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&m5.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 Mu.lex(e,r??this.defaults)}parser(e,r){return Lu.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?Mu.lex:Mu.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?Lu.parse:Lu.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?Mu.lex:Mu.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?Lu.parse:Lu.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:

"+bh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},F1=new uit;function oi(t,e){return F1.parse(t,e)}oi.options=oi.setOptions=function(t){return F1.setOptions(t),oi.defaults=F1.defaults,mxe(oi.defaults),oi};oi.getDefaults=jX;oi.defaults=Ty;oi.use=function(...t){return F1.use(...t),oi.defaults=F1.defaults,mxe(oi.defaults),oi};oi.walkTokens=function(t,e){return F1.walkTokens(t,e)};oi.parseInline=F1.parseInline;oi.Parser=Lu;oi.parser=Lu.parse;oi.Renderer=p9;oi.TextRenderer=rK;oi.Lexer=Mu;oi.lexer=Mu.lex;oi.Tokenizer=f9;oi.Hooks=m5;oi.parse=oi;oi.options;oi.setOptions;oi.use;oi.walkTokens;oi.parseInline;Lu.parse;Mu.lex;const hit=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function dit(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(hit);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function fit(t,e){const r=e.split(` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${bh(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=kse(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=kse(e);if(a===null)return bh(n);e=a;let s=`${bh(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 g9(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 p9(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 m5;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];m5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&m5.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 Mu.lex(e,r??this.defaults)}parser(e,r){return Lu.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?Mu.lex:Mu.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?Lu.parse:Lu.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?Mu.lex:Mu.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?Lu.parse:Lu.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:

"+bh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},F1=new fit;function oi(t,e){return F1.parse(t,e)}oi.options=oi.setOptions=function(t){return F1.setOptions(t),oi.defaults=F1.defaults,yxe(oi.defaults),oi};oi.getDefaults=KX;oi.defaults=Ty;oi.use=function(...t){return F1.use(...t),oi.defaults=F1.defaults,yxe(oi.defaults),oi};oi.walkTokens=function(t,e){return F1.walkTokens(t,e)};oi.parseInline=F1.parseInline;oi.Parser=Lu;oi.parser=Lu.parse;oi.Renderer=g9;oi.TextRenderer=iK;oi.Lexer=Mu;oi.lexer=Mu.lex;oi.Tokenizer=p9;oi.Hooks=m5;oi.parse=oi;oi.options;oi.setOptions;oi.use;oi.walkTokens;oi.parseInline;Lu.parse;Mu.lex;const pit=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function git(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(pit);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function mit(t,e){const r=e.split(` `).flatMap(n=>[n,""]).map(n=>`${t}${n}`).join(` -`);return r.slice(0,r.length-1)}function Cse(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(a=>a.type===n&&wT(a.attrs,i.attrs))||r.push(n)}),r}function pit(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!wT(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function git(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(h=>h.type===l&&wT(h.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function mit(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function yit(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 pP(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function H7(t,e){return typeof t!="string"?"json":e}const vit=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"]),bit=/<\/?([a-zA-Z][\w-]*)/g;function xit(t){const e=[];let r;for(;(r=bit.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function wit(t){const e=t.toLowerCase();return e.includes("-")?!1:!vit.has(e)}function Tit(t,e){return xit(t).some(r=>wit(r)?!e.has(r):!1)}var Sse=class{constructor(e){var r,n,i,a,s;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(r=e==null?void 0:e.marked)!==null&&r!==void 0?r:oi,this.indentStyle=(n=e==null||(i=e.indentation)===null||i===void 0?void 0:i.style)!==null&&n!==void 0?n:"space",this.indentSize=(a=e==null||(s=e.indentation)===null||s===void 0?void 0:s.size)!==null&&a!==void 0?a:2,this.baseExtensions=(e==null?void 0:e.extensions)||[],e!=null&&e.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e!=null&&e.extensions&&(this.baseExtensions=e.extensions,nb(s$(e.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(e){var r,n;this.extensions.push(e);const i=qn(dr(e,"code")),a=e.name;i&&this.codeTypes.add(a),this.extensionRanks.has(a)||this.extensionRanks.set(a,this.extensionRanks.size);const s=dr(e,"markdownTokenName")||a,o=dr(e,"parseMarkdown"),l=dr(e,"renderMarkdown"),u=dr(e,"markdownTokenizer"),h=(r=dr(e,"markdownOptions"))!==null&&r!==void 0?r:null,d={tokenName:s,nodeName:a,parseMarkdown:o,renderMarkdown:l,isIndenting:(n=h==null?void 0:h.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:h==null?void 0:h.htmlReopen,tokenizer:u};if(s&&o){const f=this.registry.get(s)||[];f.push(d),this.registry.set(s,f)}if(l){const f=this.nodeTypeRegistry.get(a)||[];f.push(d),this.nodeTypeRegistry.set(a,f)}u&&this.hasMarked()&&this.registerTokenizer(u)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:r=>e.inlineTokens(r),blockTokens:r=>e.blockTokens(r)}}tokenizeInline(e){var r;return((r=this.activeParseLexer)!==null&&r!==void 0?r:this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;const{name:r,start:n,level:i="inline",tokenize:a}=e,s=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:h=>h.indexOf(n):l=h=>{const d=a(h,[],this.createTokenizerHelpers(this.createLexer()));return d&&d.raw?h.indexOf(d.raw):-1};const u={name:r,level:i,start:l,tokenizer(h,d){const f=this.lexer?s(this.lexer):s(o()),p=a(h,d,f);if(p&&p.type)return{...p,type:p.type||r,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[u]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){const r=this.getHandlersForToken(e);if(r.length>0)return r[0];const n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return"";const r=this.renderNodes(e,e);return this.isEmptyOutput(r)?"":r}isEmptyOutput(e){return!e||e.trim()===""?!0:e.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(e){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const r=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const i=n.lex(e);return{type:"doc",content:this.parseTokens(i,!0)}}finally{this.activeParseLexer=r}}parseTokens(e,r=!1){const n=r?dit(e):e,i=n.reduce((o,l,u)=>(l.type!=="space"&&o.push(u),o),[]);let a=-1,s=0;return n.flatMap((o,l)=>{for(;s({type:"paragraph",content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,` -`).match(/\n\n/g)||[]).length}parseToken(e,r=!1){if(!e.type)return null;if(e.type==="list")return this.parseListToken(e);const n=this.getHandlersForToken(e.type),i=this.createParseHelpers();if(n.find(a=>{if(!a.parseMarkdown)return!1;const s=a.parseMarkdown(e,i),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(e,r)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);const r=e.items.some(l=>pP(l).isTask),n=e.items.some(l=>!pP(l).isTask);if(!r||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(e);const i=[];let a=[],s=null;for(let l=0;l{if(!e){r.push(n);return}(e.marks||[]).find(a=>a.type===n&&wT(a.attrs,i.attrs))||r.push(n)}),r}function yit(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!wT(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function vit(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(h=>h.type===l&&wT(h.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function bit(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function xit(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 mP(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function V7(t,e){return typeof t!="string"?"json":e}const wit=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"]),Tit=/<\/?([a-zA-Z][\w-]*)/g;function kit(t){const e=[];let r;for(;(r=Tit.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function Cit(t){const e=t.toLowerCase();return e.includes("-")?!1:!wit.has(e)}function Sit(t,e){return kit(t).some(r=>Cit(r)?!e.has(r):!1)}var Ase=class{constructor(e){var r,n,i,a,s;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(r=e==null?void 0:e.marked)!==null&&r!==void 0?r:oi,this.indentStyle=(n=e==null||(i=e.indentation)===null||i===void 0?void 0:i.style)!==null&&n!==void 0?n:"space",this.indentSize=(a=e==null||(s=e.indentation)===null||s===void 0?void 0:s.size)!==null&&a!==void 0?a:2,this.baseExtensions=(e==null?void 0:e.extensions)||[],e!=null&&e.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e!=null&&e.extensions&&(this.baseExtensions=e.extensions,nb(l$(e.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(e){var r,n;this.extensions.push(e);const i=qn(dr(e,"code")),a=e.name;i&&this.codeTypes.add(a),this.extensionRanks.has(a)||this.extensionRanks.set(a,this.extensionRanks.size);const s=dr(e,"markdownTokenName")||a,o=dr(e,"parseMarkdown"),l=dr(e,"renderMarkdown"),u=dr(e,"markdownTokenizer"),h=(r=dr(e,"markdownOptions"))!==null&&r!==void 0?r:null,d={tokenName:s,nodeName:a,parseMarkdown:o,renderMarkdown:l,isIndenting:(n=h==null?void 0:h.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:h==null?void 0:h.htmlReopen,tokenizer:u};if(s&&o){const f=this.registry.get(s)||[];f.push(d),this.registry.set(s,f)}if(l){const f=this.nodeTypeRegistry.get(a)||[];f.push(d),this.nodeTypeRegistry.set(a,f)}u&&this.hasMarked()&&this.registerTokenizer(u)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:r=>e.inlineTokens(r),blockTokens:r=>e.blockTokens(r)}}tokenizeInline(e){var r;return((r=this.activeParseLexer)!==null&&r!==void 0?r:this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;const{name:r,start:n,level:i="inline",tokenize:a}=e,s=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this);let l;n?l=typeof n=="function"?n:h=>h.indexOf(n):l=h=>{const d=a(h,[],this.createTokenizerHelpers(this.createLexer()));return d&&d.raw?h.indexOf(d.raw):-1};const u={name:r,level:i,start:l,tokenizer(h,d){const f=this.lexer?s(this.lexer):s(o()),p=a(h,d,f);if(p&&p.type)return{...p,type:p.type||r,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[u]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){const r=this.getHandlersForToken(e);if(r.length>0)return r[0];const n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return"";const r=this.renderNodes(e,e);return this.isEmptyOutput(r)?"":r}isEmptyOutput(e){return!e||e.trim()===""?!0:e.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(e){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const r=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const i=n.lex(e);return{type:"doc",content:this.parseTokens(i,!0)}}finally{this.activeParseLexer=r}}parseTokens(e,r=!1){const n=r?git(e):e,i=n.reduce((o,l,u)=>(l.type!=="space"&&o.push(u),o),[]);let a=-1,s=0;return n.flatMap((o,l)=>{for(;s({type:"paragraph",content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,` +`).match(/\n\n/g)||[]).length}parseToken(e,r=!1){if(!e.type)return null;if(e.type==="list")return this.parseListToken(e);const n=this.getHandlersForToken(e.type),i=this.createParseHelpers();if(n.find(a=>{if(!a.parseMarkdown)return!1;const s=a.parseMarkdown(e,i),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(e,r)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);const r=e.items.some(l=>mP(l).isTask),n=e.items.some(l=>!mP(l).isTask);if(!r||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(e);const i=[];let a=[],s=null;for(let l=0;l1&&m.slice(1).join(` `).trim()){const b=m.slice(1),T=b.filter(k=>k.trim());if(T.length>0){const k=Math.min(...T.map(C=>C.length-C.trimStart().length)),S=b.map(C=>C.trim()?C.slice(k):"").join(` `).trim();S&&(x=this.markedInstance.lexer(`${S} -`))}}p={type:"taskItem",raw:"",mainContent:v,indentLevel:f,checked:d??!1,text:v,tokens:this.tokenizeInline(v),nestedTokens:x}}const g=h?"taskList":"list";s!==g?(a.length>0&&i.push({type:s,items:a}),a=[p],s=g):a.push(p)}a.length>0&&i.push({type:s,items:a});const o=[];for(let l=0;l0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;const r=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(r.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(e,n),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(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,r)=>({type:"text",text:e,marks:r||void 0}),createNode:(e,r,n)=>{const i={type:e,attrs:r||void 0,content:n||void 0};return(!r||Object.keys(r).length===0)&&delete i.attrs,i},applyMark:(e,r,n)=>({mark:e,content:r,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){const r=[];for(let o=0;o|\/|$)/i);if(!h&&d&&!/\/>$/.test(u)){const p=d[1],g=this.escapeRegex(p),m=new RegExp(`^<\\/\\s*${g}\\b`,"i");let y=-1;const v=[u];for(let x=o+1;x0;o-=1){const l=r[o],u=r[o-1];if(l.type==="text"&&u.type==="text"){const h=l.marks||[],d=u.marks||[];uJe(h,d)&&(u.text=(u.text||"")+(l.text||""),r.splice(o,1))}}return r}applyMarkToContent(e,r,n){return r.map(i=>{if(i.type==="text"){const a=i.marks||[],s=n?{type:e,attrs:n}:{type:e};return{...i,marks:[...a,s]}}return{...i,content:i.content?this.applyMarkToContent(e,i.content,n):void 0}})}isMarkResult(e){return e&&typeof e=="object"&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,r=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:Nae(e.text||"")};case"html":return this.parseHTMLToken(e);case"escape":return{type:"text",text:e.text||""};case"space":return null;default:return e.tokens?this.parseTokens(e.tokens,r):null}}parseHTMLToken(e){const r=e.text||e.raw||"";if(!r.trim())return null;if(this.isUnrecognizedHtml(r))return this.htmlAsLiteralText(r,!!e.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(r,!!e.block);try{const n=cQe(r,this.baseExtensions);if(n.type==="doc"&&n.content){if(e.block)return n.content;const i=this.toInlineContent(n.content);return i.length>0?i:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(e){const r=this.getInlineNodeTypes();return e.flatMap(n=>n.type&&r.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const e=new Set(["text"]);try{const r=sV(this.baseExtensions);Object.values(r.nodes).forEach(n=>{n.isInline&&e.add(n.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Tit(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const e=new Set;try{const r=sV(this.baseExtensions),n=i=>{const a=i==null?void 0:i.parseDOM;Array.isArray(a)&&a.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const o=s.tag.match(/^[a-zA-Z][\w-]*/);o&&e.add(o[0].toLowerCase())}})};Object.values(r.nodes).forEach(i=>n(i.spec)),Object.values(r.marks).forEach(i=>n(i.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,r){const n=e.replace(/\s+$/,"");return n?r?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(e,r,n){return(n==null?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(r.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?e:this.escapeMarkdownSyntax(oJe(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(e,r,n=0,i=0,a={}){var s;if(e.type==="text")return this.encodeTextForMarkdown(e.text||"",e,r);if(!e.type)return"";const o=this.getHandlerForToken(e.type);if(!o)return"";const l=Array.isArray(r==null?void 0:r.content)&&n>0?r.content[n-1]:void 0,u={renderChildren:(d,f)=>{const p=o.isIndenting?i+1:i;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,e,f||"",n,p):this.renderNodes(d,e,f||"",n,p)},renderChild:(d,f)=>{const p=o.isIndenting?i+1:i;return this.renderNodeToMarkdown(d,e,f,p)},indent:d=>this.indentString+d,wrapInBlock:fit},h={index:n,level:i,parentType:r==null?void 0:r.type,previousNode:l,meta:{parentAttrs:r==null?void 0:r.attrs,...a}};return((s=o.renderMarkdown)===null||s===void 0?void 0:s.call(o,e,u,h))||""}renderNodes(e,r,n="",i=0,a=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,r,n,a):e.type?this.renderNodeToMarkdown(e,r,i,a):""}renderNodesWithMarkBoundaries(e,r,n="",i=0){const a=[],s=new Map,o=new Set,l=new Map;return e.forEach((u,h)=>{const d=h[S.type,S])),g=this.getMarksToOpenForSerialization(s,p,d),m=Cse(p,d);if(f.length>0&&f.trim().length===0&&p.size>0){const S=new Set(m.filter(C=>!s.has(C)));S.size>0&&(p=new Map(Array.from(p).filter(([C])=>!S.has(C))),g=this.getMarksToOpenForSerialization(s,p,d),m=Cse(p,d))}const y=m.filter(S=>s.has(S)),v=y.length>0&&g.length>0;let x="";if(m.length>0&&!v){const S=f.match(/(\s+)$/);S&&(x=S[1],f=f.slice(0,-x.length))}v||m.slice().reverse().forEach(S=>{if(!s.has(S))return;const C=p.get(S),E=this.getMarkClosing(S,C,l.get(S));E&&(f+=E),s.has(S)&&(s.delete(S),l.delete(S))});let b="";if(g.length>0){const S=f.match(/^(\s+)/);S&&(b=S[1],f=f.slice(b.length))}g.forEach(({type:S,mark:C})=>{const E=o.has(S)?"html":"markdown",A=this.getMarkOpening(S,C,E);A&&(f=A+f),l.set(S,E),o.delete(S)}),v||g.slice().reverse().forEach(({type:S,mark:C})=>{s.set(S,C)}),f=b+f;let T;if(v){const S=new Set(((d==null?void 0:d.marks)||[]).map(A=>A.type));g.forEach(({type:A})=>{S.has(A)&&this.getHtmlReopenTags(A)&&o.add(A)});const C=Array.from(s.keys()),E=y.slice().sort((A,M)=>C.indexOf(M)-C.indexOf(A));T=[...g.map(A=>A.type),...E]}else T=git(s,p,d,this.markSetsEqual.bind(this));let k="";if(T.length>0){const S=f.match(/(\s+)$/);S&&(k=S[1],f=f.slice(0,-k.length))}T.forEach(S=>{var C;const E=(C=s.get(S))!==null&&C!==void 0?C:p.get(S),A=this.getMarkClosing(S,E,l.get(S));A&&(f+=A),s.delete(S),l.delete(S)}),f+=k,f+=x,a.push(f)}else{const f=new Set((u.marks||[]).map(x=>x.type)),p=new Map,g=new Map;s.forEach((x,b)=>{if(f.has(b)){var T;p.set(b,x),g.set(b,(T=l.get(b))!==null&&T!==void 0?T:"markdown")}});const m=mit(s,(x,b)=>this.getMarkClosing(x,b,l.get(x)));l.clear();const y=this.renderNodeToMarkdown(u,r,h,i),v=u.type==="hardBreak"?"":yit(p,s,(x,b)=>{var T;const k=(T=g.get(x))!==null&&T!==void 0?T:"markdown";return l.set(x,k),this.getMarkOpening(x,b,k)});a.push(m+y+v)}}),a.join(n)}getMarkOpening(e,r,n="markdown"){if(n==="html"){var i;return((i=this.getHtmlReopenTags(e))===null||i===void 0?void 0:i.open)||""}const a=this.getHandlersForNodeType(e),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:r.attrs||{},content:[{type:"text",text:o}]};try{const u=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),h=u.indexOf(o);return h>=0?u.substring(0,h):""}catch(u){throw new Error(`Failed to get mark opening for ${e}: ${u}`)}}getMarkClosing(e,r,n="markdown"){if(n==="html"){var i;return((i=this.getHtmlReopenTags(e))===null||i===void 0?void 0:i.close)||""}const a=this.getHandlersForNodeType(e),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:r.attrs||{},content:[{type:"text",text:o}]};try{const u=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:f=>f,wrapInBlock:(f,p)=>f+p},{index:0,level:0,parentType:"text",meta:{}}),h=u.indexOf(o),d=h+33;return h>=0?u.substring(d):""}catch(u){throw new Error(`Failed to get mark closing for ${e}: ${u}`)}}getHtmlReopenTags(e){const r=this.getHandlersForNodeType(e),n=r.length>0?r[0]:void 0;return n==null?void 0:n.htmlReopen}markSetsEqual(e,r){return e.size!==r.size?!1:Array.from(e.entries()).every(([n,i])=>{const a=r.get(n);return a&&wT(i.attrs,a.attrs)})}getMarksToOpenForSerialization(e,r,n){const i=pit(e,r);if(i.length<=1)return i;const a=(n==null?void 0:n.marks)||[],s=(h,d)=>a.some(f=>f.type===h&&wT(f.attrs,d)),o=(h,d)=>{var f,p;const g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER,m=(p=this.extensionRanks.get(d.type))!==null&&p!==void 0?p:Number.MAX_SAFE_INTEGER;return g!==m?m-g:h.type.localeCompare(d.type)},l=i.filter(h=>!s(h.type,h.mark.attrs)).sort(o),u=i.filter(h=>s(h.type,h.mark.attrs)).sort(o);return[...l,...u]}};const kit=Ui.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||H7(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vh.setContent(t,e);const r=this.editor.markdown.parse(t);return vh.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||H7(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vh.insertContent(t,e);const r=this.editor.markdown.parse(t);return vh.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||H7(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return vh.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return vh.insertContentAt(t,n,r)}}},addStorage(){return{manager:new Sse({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 Sse({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||H7(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 e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),Cit="modulepreload",Sit=function(t,e){return new URL(t,e).href},Ese={},xr=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=Sit(h,n),h in Ese)return;Ese[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":Cit,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 Exe=Object.defineProperty,w=(t,e)=>Exe(t,"name",{value:e,configurable:!0}),g$=(t,e)=>{for(var r in e)Exe(t,r,{get:e[r],enumerable:!0})};function ky(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var G8={exports:{}},Eit=G8.exports,Ase;function Ait(){return Ase||(Ase=1,(function(t,e){(function(r,n){t.exports=n()})(Eit,(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,x={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(_){var I=["th","st","nd","rd"],O=_%100;return"["+_+(I[(O-20)%10]||I[O]||I[0])+"]"}},b=function(_,I,O){var D=String(_);return!D||D.length>=I?_:""+Array(I+1-D.length).join(O)+_},T={s:b,z:function(_){var I=-_.utcOffset(),O=Math.abs(I),D=Math.floor(O/60),$=O%60;return(I<=0?"+":"-")+b(D,2,"0")+":"+b($,2,"0")},m:function _(I,O){if(I.date()1)return _(z[0])}else{var H=I.name;S[H]=I,$=H}return!D&&$&&(k=$),$||!D&&k},M=function(_,I){if(E(_))return _.clone();var O=typeof I=="object"?I:{};return O.date=_,O.args=arguments,new P(O)},L=T;L.l=A,L.i=E,L.w=function(_,I){return M(_,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function _(O){this.$L=A(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[C]=!0}var I=_.prototype;return I.parse=function(O){this.$d=(function(D){var $=D.date,F=D.utc;if($===null)return new Date(NaN);if(L.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var z=$.match(y);if(z){var H=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],H,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],H,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date($)})(O),this.init()},I.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(O,D){var $=M(O);return this.startOf(D)<=$&&$<=this.endOf(D)},I.isAfter=function(O,D){return M(O){},"trace"),debug:w((...t)=>{},"debug"),info:w((...t)=>{},"info"),warn:w((...t)=>{},"warn"),error:w((...t)=>{},"error"),fatal:w((...t)=>{},"fatal")},nK=w(function(t="fatal"){let e=Fd.fatal;typeof t=="string"?t.toLowerCase()in Fd&&(e=Fd[t]):typeof t=="number"&&(e=t),he.trace=()=>{},he.debug=()=>{},he.info=()=>{},he.warn=()=>{},he.error=()=>{},he.fatal=()=>{},e<=Fd.fatal&&(he.fatal=console.error?console.error.bind(console,Fc("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Fc("FATAL"))),e<=Fd.error&&(he.error=console.error?console.error.bind(console,Fc("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Fc("ERROR"))),e<=Fd.warn&&(he.warn=console.warn?console.warn.bind(console,Fc("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Fc("WARN"))),e<=Fd.info&&(he.info=console.info?console.info.bind(console,Fc("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Fc("INFO"))),e<=Fd.debug&&(he.debug=console.debug?console.debug.bind(console,Fc("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Fc("DEBUG"))),e<=Fd.trace&&(he.trace=console.debug?console.debug.bind(console,Fc("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Fc("TRACE")))},"setLogLevel"),Fc=w(t=>`%c${_s().format("ss.SSS")} : ${t} : `,"format");const U8={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 U8.hue2rgb(a,i,t+1/3)*255;case"g":return U8.hue2rgb(a,i,t)*255;case"b":return U8.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},Mit={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},en={channel:U8,lang:_it,unit:Mit},U0={};for(let t=0;t<=255;t++)U0[t]=en.unit.dec2hex(t);const wo={ALL:0,RGB:1,HSL:2};let Lit=class{constructor(){this.type=wo.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=wo.ALL}is(e){return this.type===e}};class Iit{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Lit}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=wo.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=en.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=en.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=en.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=en.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=en.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=en.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(wo.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(wo.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(wo.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(wo.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(wo.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(wo.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const m$=new Iit({r:0,g:0,b:0,a:0},"transparent"),ib={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(ib.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 m$.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?`#${U0[Math.round(e)]}${U0[Math.round(r)]}${U0[Math.round(n)]}${U0[Math.round(i*255)]}`:`#${U0[Math.round(e)]}${U0[Math.round(r)]}${U0[Math.round(n)]}`}},Jm={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(Jm.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return en.channel.clamp.h(parseFloat(r)*.9);case"rad":return en.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return en.channel.clamp.h(parseFloat(r)*360)}}return en.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Jm.re);if(!r)return;const[,n,i,a,s,o]=r;return m$.set({h:Jm._hue2deg(n),s:en.channel.clamp.s(parseFloat(i)),l:en.channel.clamp.l(parseFloat(a)),a:s?en.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(${en.lang.round(e)}, ${en.lang.round(r)}%, ${en.lang.round(n)}%, ${i})`:`hsl(${en.lang.round(e)}, ${en.lang.round(r)}%, ${en.lang.round(n)}%)`}},vC={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=vC.colors[t];if(e)return ib.parse(e)},stringify:t=>{const e=ib.stringify(t);for(const r in vC.colors)if(vC.colors[r]===e)return r}},y5={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(y5.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return m$.set({r:en.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:en.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:en.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?en.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(${en.lang.round(e)}, ${en.lang.round(r)}, ${en.lang.round(n)}, ${en.lang.round(i)})`:`rgb(${en.lang.round(e)}, ${en.lang.round(r)}, ${en.lang.round(n)})`}},rh={format:{keyword:vC,hex:ib,rgb:y5,rgba:y5,hsl:Jm,hsla:Jm},parse:t=>{if(typeof t!="string")return t;const e=ib.parse(t)||y5.parse(t)||Jm.parse(t)||vC.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(wo.HSL)||t.data.r===void 0?Jm.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?y5.stringify(t):ib.stringify(t)},Axe=(t,e)=>{const r=rh.parse(t);for(const n in e)r[n]=en.channel.clamp[n](e[n]);return rh.stringify(r)},qu=(t,e,r=0,n=1)=>{if(typeof t!="number")return Axe(t,{a:e});const i=m$.set({r:en.channel.clamp.r(t),g:en.channel.clamp.g(e),b:en.channel.clamp.b(r),a:en.channel.clamp.a(n)});return rh.stringify(i)},iK=(t,e)=>en.lang.round(rh.parse(t)[e]),$it=t=>{const{r:e,g:r,b:n}=rh.parse(t),i=.2126*en.channel.toLinear(e)+.7152*en.channel.toLinear(r)+.0722*en.channel.toLinear(n);return en.lang.round(i)},Nit=t=>$it(t)>=.5,kl=t=>!Nit(t),aK=(t,e,r)=>{const n=rh.parse(t),i=n[e],a=en.channel.clamp[e](i+r);return i!==a&&(n[e]=a),rh.stringify(n)},lt=(t,e)=>aK(t,"l",e),ct=(t,e)=>aK(t,"l",-e),Rse=(t,e)=>aK(t,"a",-e),ve=(t,e)=>{const r=rh.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Axe(t,n)},Dit=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=rh.parse(t),{r:o,g:l,b:u,a:h}=rh.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,x=i*m+l*y,b=a*m+u*y,T=s*d+h*(1-d);return qu(v,x,b,T)},tt=(t,e=100)=>{const r=rh.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Dit(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 _se(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:es(BigInt.prototype.toString),Dse=typeof Symbol>"u"?null:es(Symbol.prototype.toString),Cs=es(Object.prototype.hasOwnProperty),mk=es(Object.prototype.toString),ks=es(RegExp.prototype.test),Hg=Xit(TypeError);function es(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]:v5;if(Mse&&Mse(t,null),!cp(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(Hit(e)||(e[n]=a),i=a)}t[i]=!0}return t}function Kit(t){for(let e=0;e/g),nat=fo(/\${[\w\W]*/g),iat=fo(/^data-[\-\w.\u00B7-\uFFFF]+$/),aat=fo(/^aria-[\-\w]+$/),zse=fo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sat=fo(/^(?:\w+script|data):/i),oat=fo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lat=fo(/^html$/i),cat=fo(/^[a-z][.\w]*(-[.\w]+)+$/i),Hse=fo(/<[/\w!]/g),Vse=fo(/<[/\w]/g),uat=fo(/<\/no(script|embed|frames)/i),hat=fo(/\/>/i),sc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},dat=function(){return typeof window>"u"?null:window},fat=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}},Wse=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M0=function(e,r,n,i){return Cs(e,r)&&cp(e[r])?Ln(i.base?xo(i.base):{},e[r],i.transform):n};function Mxe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dat();const e=It=>Mxe(It);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==sc.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=Tu(f,"cloneNode"),g=Tu(f,"remove"),m=Tu(f,"nextSibling"),y=Tu(f,"childNodes"),v=Tu(f,"parentNode"),x=Tu(f,"shadowRoot"),b=Tu(f,"attributes"),T=s&&s.prototype?Tu(s.prototype,"nodeType"):null,k=s&&s.prototype?Tu(s.prototype,"nodeName"):null,S=s&&s.prototype?Tu(s.prototype,"ownerDocument"):null;if(typeof a=="function"){const It=r.createElement("template");It.content&&It.content.ownerDocument&&(r=It.content.ownerDocument)}let C,E="",A,M=!1,L=0;const P=function(){if(L>0)throw Hg('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.')},N=function(Ne){P(),L++;try{return C.createHTML(Ne)}finally{L--}},_=function(Ne){P(),L++;try{return C.createScriptURL(Ne)}finally{L--}},I=function(){return M||(A=fat(d,i),M=!0),A},O=r,D=O.implementation,$=O.createNodeIterator,F=O.createDocumentFragment,z=O.getElementsByTagName,H=n.importNode;let B=Wse();e.isSupported=typeof Rxe=="function"&&typeof v=="function"&&D&&D.createHTMLDocument!==void 0;const V=tat,q=rat,G=nat,Q=iat,j=aat,ae=sat,Z=oat,J=cat;let re=zse,ee=null;const me=Ln({},[...Ose,...mP,...yP,...vP,...Pse]);let te=null;const $e=Ln({},[...Bse,...bP,...Fse,...V7]);let Oe=Object.seal(i2(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}})),He=null,ue=null;const ce=Object.seal(i2(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,ge=!0,Ve=!1,we=!0,Ae=!1,Ue=!0,le=!1,pe=!1,Ce=null,oe=null,fe=!1,W=!1,se=!1,K=!1,de=!0,X=!1;const Fe="user-content-";let ke=!0,Ye=!1,Ie={},ze=null;const De=Ln({},["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 Ke=null;const Be=Ln({},["audio","video","img","source","image","track"]);let nt=null;const Le=Ln({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",Me="http://www.w3.org/2000/svg",Ct="http://www.w3.org/1999/xhtml";let wt=Ct,ht=!1,Bt=null;const At=Ln({},[pt,Me,Ct],gP),mt=so(["mi","mo","mn","ms","mtext"]);let ye=Ln({},mt);const Nt=so(["annotation-xml"]);let yt=Ln({},Nt);const gt=Ln({},["title","style","font","a","script"]);let St=null;const tn=["application/xhtml+xml","text/html"],_e="text/html";let Je=null,ut=null;const Dt=r.createElement("form"),Kt=function(Ne){return Ne instanceof RegExp||Ne instanceof Function},Sr=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ut&&ut===Ne)return;(!Ne||typeof Ne!="object")&&(Ne={}),Ne=xo(Ne),St=tn.indexOf(Ne.PARSER_MEDIA_TYPE)===-1?_e:Ne.PARSER_MEDIA_TYPE,Je=St==="application/xhtml+xml"?gP:v5,ee=M0(Ne,"ALLOWED_TAGS",me,{transform:Je}),te=M0(Ne,"ALLOWED_ATTR",$e,{transform:Je}),Bt=M0(Ne,"ALLOWED_NAMESPACES",At,{transform:gP}),nt=M0(Ne,"ADD_URI_SAFE_ATTR",Le,{transform:Je,base:Le}),Ke=M0(Ne,"ADD_DATA_URI_TAGS",Be,{transform:Je,base:Be}),ze=M0(Ne,"FORBID_CONTENTS",De,{transform:Je}),He=M0(Ne,"FORBID_TAGS",xo({}),{transform:Je}),ue=M0(Ne,"FORBID_ATTR",xo({}),{transform:Je}),Ie=Cs(Ne,"USE_PROFILES")?Ne.USE_PROFILES&&typeof Ne.USE_PROFILES=="object"?xo(Ne.USE_PROFILES):Ne.USE_PROFILES:!1,Te=Ne.ALLOW_ARIA_ATTR!==!1,ge=Ne.ALLOW_DATA_ATTR!==!1,Ve=Ne.ALLOW_UNKNOWN_PROTOCOLS||!1,we=Ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=Ne.SAFE_FOR_TEMPLATES||!1,Ue=Ne.SAFE_FOR_XML!==!1,le=Ne.WHOLE_DOCUMENT||!1,W=Ne.RETURN_DOM||!1,se=Ne.RETURN_DOM_FRAGMENT||!1,K=Ne.RETURN_TRUSTED_TYPE||!1,fe=Ne.FORCE_BODY||!1,de=Ne.SANITIZE_DOM!==!1,X=Ne.SANITIZE_NAMED_PROPS||!1,ke=Ne.KEEP_CONTENT!==!1,Ye=Ne.IN_PLACE||!1,re=Qit(Ne.ALLOWED_URI_REGEXP)?Ne.ALLOWED_URI_REGEXP:zse,wt=typeof Ne.NAMESPACE=="string"?Ne.NAMESPACE:Ct,ye=Cs(Ne,"MATHML_TEXT_INTEGRATION_POINTS")&&Ne.MATHML_TEXT_INTEGRATION_POINTS&&typeof Ne.MATHML_TEXT_INTEGRATION_POINTS=="object"?xo(Ne.MATHML_TEXT_INTEGRATION_POINTS):Ln({},mt),yt=Cs(Ne,"HTML_INTEGRATION_POINTS")&&Ne.HTML_INTEGRATION_POINTS&&typeof Ne.HTML_INTEGRATION_POINTS=="object"?xo(Ne.HTML_INTEGRATION_POINTS):Ln({},Nt);const rt=Cs(Ne,"CUSTOM_ELEMENT_HANDLING")&&Ne.CUSTOM_ELEMENT_HANDLING&&typeof Ne.CUSTOM_ELEMENT_HANDLING=="object"?xo(Ne.CUSTOM_ELEMENT_HANDLING):i2(null);if(Oe=i2(null),Cs(rt,"tagNameCheck")&&Kt(rt.tagNameCheck)&&(Oe.tagNameCheck=rt.tagNameCheck),Cs(rt,"attributeNameCheck")&&Kt(rt.attributeNameCheck)&&(Oe.attributeNameCheck=rt.attributeNameCheck),Cs(rt,"allowCustomizedBuiltInElements")&&typeof rt.allowCustomizedBuiltInElements=="boolean"&&(Oe.allowCustomizedBuiltInElements=rt.allowCustomizedBuiltInElements),fo(Oe),Ae&&(ge=!1),se&&(W=!0),Ie&&(ee=Ln({},Pse),te=i2(null),Ie.html===!0&&(Ln(ee,Ose),Ln(te,Bse)),Ie.svg===!0&&(Ln(ee,mP),Ln(te,bP),Ln(te,V7)),Ie.svgFilters===!0&&(Ln(ee,yP),Ln(te,bP),Ln(te,V7)),Ie.mathMl===!0&&(Ln(ee,vP),Ln(te,Fse),Ln(te,V7))),ce.tagCheck=null,ce.attributeCheck=null,Cs(Ne,"ADD_TAGS")&&(typeof Ne.ADD_TAGS=="function"?ce.tagCheck=Ne.ADD_TAGS:cp(Ne.ADD_TAGS)&&(ee===me&&(ee=xo(ee)),Ln(ee,Ne.ADD_TAGS,Je))),Cs(Ne,"ADD_ATTR")&&(typeof Ne.ADD_ATTR=="function"?ce.attributeCheck=Ne.ADD_ATTR:cp(Ne.ADD_ATTR)&&(te===$e&&(te=xo(te)),Ln(te,Ne.ADD_ATTR,Je))),Cs(Ne,"ADD_URI_SAFE_ATTR")&&cp(Ne.ADD_URI_SAFE_ATTR)&&Ln(nt,Ne.ADD_URI_SAFE_ATTR,Je),Cs(Ne,"FORBID_CONTENTS")&&cp(Ne.FORBID_CONTENTS)&&(ze===De&&(ze=xo(ze)),Ln(ze,Ne.FORBID_CONTENTS,Je)),Cs(Ne,"ADD_FORBID_CONTENTS")&&cp(Ne.ADD_FORBID_CONTENTS)&&(ze===De&&(ze=xo(ze)),Ln(ze,Ne.ADD_FORBID_CONTENTS,Je)),ke&&(ee["#text"]=!0),le&&Ln(ee,["html","head","body"]),ee.table&&(Ln(ee,["tbody"]),delete He.tbody),Ne.TRUSTED_TYPES_POLICY){if(typeof Ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hg('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hg('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Tt=C;C=Ne.TRUSTED_TYPES_POLICY;try{E=N("")}catch(ir){throw C=Tt,ir}}else Ne.TRUSTED_TYPES_POLICY===null?(C=void 0,E=""):(C===void 0&&(C=I()),C&&typeof E=="string"&&(E=N("")));so&&so(Ne),ut=Ne},yr=Ln({},[...mP,...yP,...Jit]),qr=Ln({},[...vP,...eat]),Tr=function(Ne,rt,Tt){return rt.namespaceURI===Ct?Ne==="svg":rt.namespaceURI===pt?Ne==="svg"&&(Tt==="annotation-xml"||ye[Tt]):!!yr[Ne]},rn=function(Ne,rt,Tt){return rt.namespaceURI===Ct?Ne==="math":rt.namespaceURI===Me?Ne==="math"&&yt[Tt]:!!qr[Ne]},mr=function(Ne,rt,Tt){return rt.namespaceURI===Me&&!yt[Tt]||rt.namespaceURI===pt&&!ye[Tt]?!1:!qr[Ne]&&(gt[Ne]||!yr[Ne])},zr=function(Ne){let rt=v(Ne);(!rt||!rt.tagName)&&(rt={namespaceURI:wt,tagName:"template"});const Tt=v5(Ne.tagName),ir=v5(rt.tagName);return Bt[Ne.namespaceURI]?Ne.namespaceURI===Me?Tr(Tt,rt,ir):Ne.namespaceURI===pt?rn(Tt,rt,ir):Ne.namespaceURI===Ct?mr(Tt,rt,ir):!!(St==="application/xhtml+xml"&&Bt[Ne.namespaceURI]):!1},hn=function(Ne){bv(e.removed,{element:Ne});try{v(Ne).removeChild(Ne)}catch{if(g(Ne),!v(Ne))throw Hg("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},st=function(Ne){Mr(Ne);const rt=y(Ne);if(rt){const ir=[];vv(rt,br=>{bv(ir,br)}),vv(ir,br=>{try{g(br)}catch{}})}const Tt=b(Ne);if(Tt)for(let ir=Tt.length-1;ir>=0;--ir){const br=Tt[ir],$r=br&&br.name;if(typeof $r=="string")try{Ne.removeAttribute($r)}catch{}}},vt=function(Ne,rt){try{bv(e.removed,{attribute:rt.getAttributeNode(Ne),from:rt})}catch{bv(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Ne),Ne==="is")if(W||se)try{hn(rt)}catch{}else try{rt.setAttribute(Ne,"")}catch{}},jt=function(Ne){const rt=b(Ne);if(rt)for(let Tt=rt.length-1;Tt>=0;--Tt){const ir=rt[Tt],br=ir&&ir.name;if(!(typeof br!="string"||te[Je(br)]))try{Ne.removeAttribute(br)}catch{}}},Mr=function(Ne){const rt=[Ne];for(;rt.length>0;){const Tt=rt.pop();(T?T(Tt):Tt.nodeType)===sc.element&&jt(Tt);const br=y(Tt);if(br)for(let $r=br.length-1;$r>=0;--$r)rt.push(br[$r])}},dn=function(Ne){if(!Ue)return;const rt=[Ne];for(;rt.length>0;){const Tt=rt.pop(),ir=T?T(Tt):Tt.nodeType;if(ir===sc.processingInstruction||ir===sc.comment&&ks(Vse,Tt.data)){try{g(Tt)}catch{}continue}if(ir===sc.element){const $r=Tt,Xn=Je(k?k(Tt):Tt.nodeName);try{$r.hasAttribute&&$r.hasAttribute("patchsrc")&&$r.removeAttribute("patchsrc"),$r.hasAttribute&&$r.hasAttribute("for")&&Xn!=="label"&&Xn!=="output"&&$r.removeAttribute("for")}catch{}}const br=y(Tt);if(br)for(let $r=br.length-1;$r>=0;--$r)rt.push(br[$r])}},Et=function(Ne){let rt=null,Tt=null;if(fe)Ne=""+Ne;else{const $r=Ise(Ne,/^[\r\n\t ]+/);Tt=$r&&$r[0]}St==="application/xhtml+xml"&&wt===Ct&&(Ne=''+Ne+"");const ir=C?N(Ne):Ne;if(wt===Ct)try{rt=new h().parseFromString(ir,St)}catch{}if(!rt||!rt.documentElement){rt=D.createDocument(wt,"template",null);try{rt.documentElement.innerHTML=ht?E:ir}catch{}}const br=rt.body||rt.documentElement;return Ne&&Tt&&br.insertBefore(r.createTextNode(Tt),br.childNodes[0]||null),wt===Ct?z.call(rt,le?"html":"body")[0]:le?rt.documentElement:br},ft=function(Ne){const rt=S?S(Ne):Ne.ownerDocument;return $.call(rt||Ne,Ne,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Mt=function(Ne){return Ne=gk(Ne,V," "),Ne=gk(Ne,q," "),Ne=gk(Ne,G," "),Ne},dt=function(Ne){var rt;Ne.normalize();const Tt=S?S(Ne):Ne.ownerDocument,ir=$.call(Tt||Ne,Ne,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let br=ir.nextNode();for(;br;)br.data=Mt(br.data),br=ir.nextNode();const $r=(rt=Ne.querySelectorAll)===null||rt===void 0?void 0:rt.call(Ne,"template");$r&&vv($r,Xn=>{Re(Xn.content)&&dt(Xn.content)})},ur=function(Ne){const rt=k?k(Ne):null;return typeof rt!="string"||Je(rt)!=="form"?!1:typeof Ne.nodeName!="string"||typeof Ne.textContent!="string"||typeof Ne.removeChild!="function"||Ne.attributes!==b(Ne)||typeof Ne.removeAttribute!="function"||typeof Ne.setAttribute!="function"||typeof Ne.namespaceURI!="string"||typeof Ne.insertBefore!="function"||typeof Ne.hasChildNodes!="function"||Ne.nodeType!==T(Ne)||Ne.childNodes!==y(Ne)},Re=function(Ne){if(!T||typeof Ne!="object"||Ne===null)return!1;try{return T(Ne)===sc.documentFragment}catch{return!1}},Dn=function(Ne){if(!T||typeof Ne!="object"||Ne===null)return!1;try{return typeof T(Ne)=="number"}catch{return!1}};function Pe(It,Ne,rt){It.length!==0&&vv(It,Tt=>{Tt.call(e,Ne,rt,ut)})}const on=function(Ne,rt){return!!(Ue&&Ne.hasChildNodes()&&!Dn(Ne.firstElementChild)&&ks(Hse,Ne.textContent)&&ks(Hse,Ne.innerHTML)||Ue&&Ne.namespaceURI===Ct&&rt==="style"&&Dn(Ne.firstElementChild)||Ne.nodeType===sc.processingInstruction||Ue&&Ne.nodeType===sc.comment&&ks(Vse,Ne.data))},On=function(Ne,rt,Tt){if(!He[rt]&&qs(rt)&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,rt)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(rt)))return!1;if(ke&&!ze[rt]){const ir=v(Ne),br=y(Ne);if(br&&ir){const $r=br.length;for(let Xn=$r-1;Xn>=0;--Xn){const ui=Ne===Tt?p(br[Xn],!0):br[Xn];ir.insertBefore(ui,m(Ne))}}}return hn(Ne),!0},Wa=function(Ne,rt,Tt,ir){return Ne.length===0?rt:rt===Tt||rt===ir?xo(rt):rt},Mn=function(Ne,rt){if(Pe(B.beforeSanitizeElements,Ne,null),Ne!==rt&&v(Ne)===null)return Ye&&Mr(Ne),!0;if(ur(Ne))return hn(Ne),!0;const Tt=Je(k?k(Ne):Ne.nodeName);if(ee=Wa(B.uponSanitizeElement,ee,me,Ce),Pe(B.uponSanitizeElement,Ne,{tagName:Tt,allowedTags:ee}),Ne!==rt&&v(Ne)===null)return Ye&&Mr(Ne),!0;if(on(Ne,Tt))return hn(Ne),!0;if(He[Tt]||!(ce.tagCheck instanceof Function&&ce.tagCheck(Tt))&&!ee[Tt]){const br=On(Ne,Tt,rt);return br===!1&&Pe(B.afterSanitizeElements,Ne,null),br}if((T?T(Ne):Ne.nodeType)===sc.element&&!zr(Ne)||(Tt==="noscript"||Tt==="noembed"||Tt==="noframes")&&ks(uat,Ne.innerHTML))return hn(Ne),!0;if(Ae&&Ne.nodeType===sc.text){const br=Mt(Ne.textContent);Ne.textContent!==br&&(bv(e.removed,{element:Ne.cloneNode()}),Ne.textContent=br)}return Pe(B.afterSanitizeElements,Ne,null),!1},Jn=function(Ne,rt,Tt){if(ue[rt]||Ue&&rt==="patchsrc"||Ue&&rt==="for"&&Ne!=="label"&&Ne!=="output"||de&&(rt==="id"||rt==="name")&&(Tt in r||Tt in Dt))return!1;const ir=te[rt]||ce.attributeCheck instanceof Function&&ce.attributeCheck(rt,Ne);if(!(ge&&ks(Q,rt))){if(!(Te&&ks(j,rt))){if(ir){if(!nt[rt]){if(!ks(re,gk(Tt,Z,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Ne!=="script"&&$se(Tt,"data:")===0&&Ke[Ne])){if(!(Ve&&!ks(ae,gk(Tt,Z,"")))){if(Tt)return!1}}}}}else if(!(qs(Ne)&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,Ne)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(Ne))&&(Oe.attributeNameCheck instanceof RegExp&&ks(Oe.attributeNameCheck,rt)||Oe.attributeNameCheck instanceof Function&&Oe.attributeNameCheck(rt,Ne))||rt==="is"&&Oe.allowCustomizedBuiltInElements&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,Tt)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(Tt))))return!1}}return!0},En=Ln({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),qs=function(Ne){return!En[v5(Ne)]&&ks(J,Ne)},fh=function(Ne,rt,Tt,ir){if(C&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Tt)switch(d.getAttributeType(Ne,rt)){case"TrustedHTML":return N(ir);case"TrustedScriptURL":return _(ir)}return ir},Id=function(Ne,rt,Tt,ir){try{Tt?Ne.setAttributeNS(Tt,rt,ir):Ne.setAttribute(rt,ir),ur(Ne)?hn(Ne):Lse(e.removed)}catch{vt(rt,Ne)}},Fg=function(Ne){Pe(B.beforeSanitizeAttributes,Ne,null);const rt=Ne.attributes;if(!rt||ur(Ne))return;te=Wa(B.uponSanitizeAttribute,te,$e,oe);const Tt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let ir=rt.length;const br=Je(Ne.nodeName);for(;ir--;){const $r=rt[ir],Xn=$r.name,ui=$r.namespaceURI,Ts=$r.value,hi=Je(Xn),FO=Ts;let Wo=Xn==="value"?FO:Uit(FO);if(Tt.attrName=hi,Tt.attrValue=Wo,Tt.keepAttr=!0,Tt.forceKeepAttr=void 0,Pe(B.uponSanitizeAttribute,Ne,Tt),Wo=Tt.attrValue,X&&(hi==="id"||hi==="name")&&$se(Wo,Fe)!==0&&(vt(Xn,Ne),Wo=Fe+Wo),Ue&&ks(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wo)){vt(Xn,Ne);continue}if(hi==="attributename"&&Ise(Wo,"href")){vt(Xn,Ne);continue}if(!Tt.forceKeepAttr){if(!Tt.keepAttr){vt(Xn,Ne);continue}if(!we&&ks(hat,Wo)){vt(Xn,Ne);continue}if(Ae&&(Wo=Mt(Wo)),!Jn(br,hi,Wo)){vt(Xn,Ne);continue}Wo=fh(br,hi,ui,Wo),Wo!==FO&&Id(Ne,Xn,ui,Wo)}}Pe(B.afterSanitizeAttributes,Ne,null)},$d=function(Ne){let rt=null;const Tt=ft(Ne);for(Pe(B.beforeSanitizeShadowDOM,Ne,null);rt=Tt.nextNode();)if(Pe(B.uponSanitizeShadowNode,rt,null),Mn(rt,Ne),Fg(rt),Re(rt.content)&&$d(rt.content),(T?T(rt):rt.nodeType)===sc.element){const br=x(rt);Re(br)&&(Nd(br),$d(br))}Pe(B.afterSanitizeShadowDOM,Ne,null)},Nd=function(Ne){const rt=[{node:Ne,shadow:null}];for(;rt.length>0;){const Tt=rt.pop();if(Tt.shadow){$d(Tt.shadow);continue}const ir=Tt.node,$r=(T?T(ir):ir.nodeType)===sc.element,Xn=y(ir);if(Xn)for(let ui=Xn.length-1;ui>=0;--ui)rt.push({node:Xn[ui],shadow:null});if($r){const ui=k?k(ir):null;if(typeof ui=="string"&&Je(ui)==="template"){const Ts=ir.content;Re(Ts)&&rt.push({node:Ts,shadow:null})}}if($r){const ui=x(ir);Re(ui)&&rt.push({node:null,shadow:ui},{node:ui,shadow:null})}}};return e.sanitize=function(It){let Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,Tt=null,ir=null,br=null;if(ht=!It,ht&&(It="\x3C!-->"),typeof It!="string"&&!Dn(It)&&(It=Zit(It),typeof It!="string"))throw Hg("dirty is not a string, aborting");if(!e.isSupported)return It;pe?(ee=Ce,te=oe):Sr(Ne),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(ee=xo(ee)),B.uponSanitizeAttribute.length>0&&(te=xo(te)),e.removed=[];const $r=Ye&&typeof It!="string"&&Dn(It);if($r){dn(It);const Ts=k?k(It):It.nodeName;if(typeof Ts=="string"){const hi=Je(Ts);if(!ee[hi]||He[hi])throw st(It),Hg("root node is forbidden and cannot be sanitized in-place")}if(ur(It))throw st(It),Hg("root node is clobbered and cannot be sanitized in-place");try{Nd(It)}catch(hi){throw st(It),hi}}else if(Dn(It))rt=Et("\x3C!---->"),Tt=rt.ownerDocument.importNode(It,!0),Tt.nodeType===sc.element&&Tt.nodeName==="BODY"||Tt.nodeName==="HTML"?rt=Tt:rt.appendChild(Tt),Nd(Tt);else{if(!W&&!Ae&&!le&&It.indexOf("<")===-1)return C&&K?N(It):It;if(rt=Et(It),!rt)return W?null:K?E:""}rt&&fe&&hn(rt.firstChild);const Xn=$r?It:rt;try{const Ts=ft(Xn);for(;ir=Ts.nextNode();)Mn(ir,Xn),Fg(ir),Re(ir.content)&&$d(ir.content)}catch(Ts){throw $r&&(st(It),vv(e.removed,hi=>{hi.element&&Mr(hi.element)})),Ts}if($r)return vv(e.removed,Ts=>{Ts.element&&Mr(Ts.element)}),Ae&&dt(It),It;if(W){if(Ae&&dt(rt),se)for(br=F.call(rt.ownerDocument);rt.firstChild;)br.appendChild(rt.firstChild);else br=rt;return(te.shadowroot||te.shadowrootmode)&&(br=H.call(n,br,!0)),br}let ui=le?rt.outerHTML:rt.innerHTML;return le&&ee["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&ks(lat,rt.ownerDocument.doctype.name)&&(ui=" -`+ui),Ae&&(ui=Mt(ui)),C&&K?N(ui):ui},e.setConfig=function(){let It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(It),pe=!0,Ce=ee,oe=te},e.clearConfig=function(){ut=null,pe=!1,Ce=null,oe=null,C=A,E=""},e.isValidAttribute=function(It,Ne,rt){ut||Sr({});const Tt=Je(It),ir=Je(Ne);return Jn(Tt,ir,rt)},e.addHook=function(It,Ne){typeof Ne=="function"&&Cs(B,It)&&bv(B[It],Ne)},e.removeHook=function(It,Ne){if(Cs(B,It)){if(Ne!==void 0){const rt=qit(B[It],Ne);return rt===-1?void 0:Git(B[It],rt,1)[0]}return Lse(B[It])}},e.removeHooks=function(It){Cs(B,It)&&(B[It]=[])},e.removeAllHooks=function(){B=Wse()},e}var Ff=Mxe(),LV=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>LV(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]=LV(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"),ja=LV,dd="#ffffff",fd="#f2f2f2",Zr=w((t,e)=>e?ve(t,{s:-40,l:10}):ve(t,{s:-40,l:-10}),"mkBorder"),Lb,pat=(Lb=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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ct(this.mainBkg,10)):(this.rowOdd=this.rowOdd||lt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let $e=0;$e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Lb,"Theme"),Lb),gat=w(t=>{const e=new pat;return e.calculate(t),e},"getThemeVariables"),Ib,mat=(Ib=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=qu(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=ct("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ct(this.sectionBkgColor,10),this.taskBorderColor=qu(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=qu(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||lt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ct(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.secondBkg=lt(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=lt(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=lt(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=tt(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=ve(this.primaryColor,{h:64}),this.fillType3=ve(this.secondaryColor,{h:64}),this.fillType4=ve(this.primaryColor,{h:-64}),this.fillType5=ve(this.secondaryColor,{h:-64}),this.fillType6=ve(this.primaryColor,{h:128}),this.fillType7=ve(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Ib,"Theme"),Ib),yat=w(t=>{const e=new mat;return e.calculate(t),e},"getThemeVariables"),$b,vat=($b=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ve(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Zr(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=qu(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ct(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ct(this.tertiaryColor,40);for(let te=0;te{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]})}},w($b,"Theme"),$b),l0=w(t=>{const e=new vat;return e.calculate(t),e},"getThemeVariables"),Nb,bat=(Nb=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=lt("#cde498",10),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.primaryColor),this.lineColor=tt(this.background),this.textColor=tt(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.actorBorder=ct(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ct(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ct(this.tertiaryColor,40);for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Nb,"Theme"),Nb),xat=w(t=>{const e=new bat;return e.calculate(t),e},"getThemeVariables"),Db,wat=(Db=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=lt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(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||lt(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.secondBkg=lt(this.contrast,55),this.border2=this.contrast,this.actorBorder=lt(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 te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Db,"Theme"),Db),Tat=w(t=>{const e=new wat;return e.calculate(t),e},"getThemeVariables"),Ob,kat=(Ob=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=Zr(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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||ve(e,{h:30}),this.cScale4=this.cScale4||ve(e,{h:60}),this.cScale5=this.cScale5||ve(e,{h:90}),this.cScale6=this.cScale6||ve(e,{h:120}),this.cScale7=this.cScale7||ve(e,{h:150}),this.cScale8=this.cScale8||ve(e,{h:210,l:150}),this.cScale9=this.cScale9||ve(e,{h:270}),this.cScale10=this.cScale10||ve(e,{h:300}),this.cScale11=this.cScale11||ve(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Ob,"Theme"),Ob),Cat=w(t=>{const e=new kat;return e.calculate(t),e},"getThemeVariables"),Pb,Sat=(Pb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Pb,"Theme"),Pb),Eat=w(t=>{const e=new Sat;return e.calculate(t),e},"getThemeVariables"),Bb,Aat=(Bb=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=Zr("#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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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]})}},w(Bb,"Theme"),Bb),Rat=w(t=>{const e=new Aat;return e.calculate(t),e},"getThemeVariables"),Fb,_at=(Fb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Fb,"Theme"),Fb),Mat=w(t=>{const e=new _at;return e.calculate(t),e},"getThemeVariables"),zb,Lat=(zb=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=Zr(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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]})}},w(zb,"Theme"),zb),Iat=w(t=>{const e=new Lat;return e.calculate(t),e},"getThemeVariables"),Hb,$at=(Hb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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]})}},w(Hb,"Theme"),Hb),Nat=w(t=>{const e=new $at;return e.calculate(t),e},"getThemeVariables"),Mf={base:{getThemeVariables:gat},dark:{getThemeVariables:yat},default:{getThemeVariables:l0},forest:{getThemeVariables:xat},neutral:{getThemeVariables:Tat},neo:{getThemeVariables:Cat},"neo-dark":{getThemeVariables:Eat},redux:{getThemeVariables:Rat},"redux-dark":{getThemeVariables:Mat},"redux-color":{getThemeVariables:Iat},"redux-dark-color":{getThemeVariables:Nat}},Gs={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},Lxe={...Gs,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Mf.default.getThemeVariables(),sequence:{...Gs.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Gs.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Gs.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Gs.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Gs.pie,useWidth:984},xyChart:{...Gs.xyChart,useWidth:void 0},requirement:{...Gs.requirement,useWidth:void 0},packet:{...Gs.packet},eventmodeling:{...Gs.eventmodeling},treeView:{...Gs.treeView,useWidth:void 0},radar:{...Gs.radar},railroad:{...Gs.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:{...Gs.ishikawa},sankey:{...Gs.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:{...Gs.venn},cynefin:{...Gs.cynefin}},Ixe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Ixe(t[n],"")]:[...r,e+n],[]),"keyify"),Dat=new Set(Ixe(Lxe,"")),xn=Lxe,Oat={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Pat=w((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))&&(he.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),g9=w(t=>{if(he.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>g9(e));return}for(const e of Object.keys(t)){if(he.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Dat.has(e)||t[e]==null){he.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Oat[e];n?Pat(t[e],n):(he.debug("sanitizing object",e),g9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(he.debug("sanitizing css option",e),t[e]=$xe(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]="")}he.debug("After sanitization",t)}},"sanitizeDirective"),$xe=w(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Fl=ja({},kT),m9,z1=[],bC=ja({},kT),oE=w((t,e)=>{let r=ja({},t),n={};for(const i of e)Oxe(i),n=ja(n,i);if(r=ja(r,n),n.theme&&n.theme in Mf){const i=ja({},m9),a=ja(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Mf&&(r.themeVariables=Mf[r.theme].getThemeVariables(a))}return bC=r,Wat(bC),bC},"updateCurrentConfig"),Bat=w(t=>(Fl=ja({},kT),Fl=ja(Fl,t),t.theme&&Mf[t.theme]&&(Fl.themeVariables=Mf[t.theme].getThemeVariables(t.themeVariables)),oE(Fl,z1),Fl),"setSiteConfig"),Fat=w(t=>{m9=ja({},t)},"saveConfigFromInitialize"),zat=w(t=>(Fl=ja(Fl,t),oE(Fl,z1),Fl),"updateSiteConfig"),Nxe=w(()=>ja({},Fl),"getSiteConfig"),Dxe=w(t=>(oE(bC,[t]),pr()),"setConfig"),pr=w(()=>ja({},bC),"getConfig"),Oxe=w(t=>{t&&(["secure",...Fl.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(he.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"&&Oxe(t[e])}))},"sanitize"),Hat=w(t=>{var e;g9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),z1.push(t),oE(Fl,z1)},"addDirective"),y9=w((t=Fl)=>{z1=[],oE(t,z1)},"reset"),Vat={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."},qse={},Pxe=w(t=>{qse[t]||(he.warn(Vat[t]),qse[t]=!0)},"issueWarning"),Wat=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Pxe("LAZY_LOAD_DEPRECATED")},"checkConfig"),Bxe=w(()=>{let t={};m9&&(t=ja(t,m9));for(const e of z1)t=ja(t,e);return t},"getUserDefinedConfig"),ti=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Pxe("FLOWCHART_HTML_LABELS_DEPRECATED"),pd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),Fxe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,xC=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,qat=/\s*%%.*\n/gm,Vb,zxe=(Vb=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(Vb,"UnknownDiagramError"),Vb),H1={},sK=w(function(t,e){t=t.replace(Fxe,"").replace(xC,"").replace(qat,` -`);for(const[r,{detector:n}]of Object.entries(H1))if(n(t,e))return r;throw new zxe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),IV=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)Hxe(e,r,n)},"registerLazyLoadedDiagrams"),Hxe=w((t,e,r)=>{H1[t]&&he.warn(`Detector with key ${t} already exists. Overwriting.`),H1[t]={detector:e,loader:r},he.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Gat=w(t=>H1[t].loader,"getDiagramLoader"),A3=//gi,Uat=w(t=>t?qxe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Yat=(()=>{let t=!1;return()=>{t||(Vxe(),t=!0)}})();function Vxe(){const t="data-temp-href-target";Ff.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Ff.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"))})}w(Vxe,"setupDompurifyHooks");var Wxe=w(t=>(Yat(),Ff.sanitize(t)),"removeScript"),Gse=w((t,e)=>{if(ti(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=Wxe(t):r!=="loose"&&(t=qxe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=Zat(t))}return t},"sanitizeMore"),Tn=w((t,e)=>t&&(e.dompurifyConfig?t=Ff.sanitize(Gse(t,e),e.dompurifyConfig).toString():t=Ff.sanitize(Gse(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),jat=w((t,e)=>typeof t=="string"?Tn(t,e):t.flat().map(r=>Tn(r,e)),"sanitizeTextOrArray"),Xat=w(t=>A3.test(t),"hasBreaks"),Kat=w(t=>t.split(A3),"splitBreaks"),Zat=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),qxe=w(t=>t.replace(A3,"#br#"),"breakToPlaceholder"),y$=w(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Qat=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Jat=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),K0=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),est=w((t,e)=>{const r=$V(t,"~"),n=$V(e,"~");return r===1&&n===1},"shouldCombineSets"),tst=w(t=>{const e=$V(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"),Use=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),NV=/\$\$(.*?)\$\$/g,Ha=w(t=>{var e;return(((e=t.match(NV))==null?void 0:e.length)??0)>0},"hasKatex"),lE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await v$(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"),rst=w(async(t,e)=>{if(!Ha(t))return t;if(!(Use()||e.legacyMathML||e.forceLegacyMathML))return t.replace(NV,"MathML is unsupported in this environment.");{const{default:r}=await xr(async()=>{const{default:i}=await Promise.resolve().then(()=>LMt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Use()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(A3).map(i=>Ha(i)?`
${i}
`:`
${i}
`).join("").replace(NV,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),v$=w(async(t,e)=>Tn(await rst(t,e),e),"renderKatexSanitized"),Ft={getRows:Uat,sanitizeText:Tn,sanitizeTextOrArray:jat,hasBreaks:Xat,splitBreaks:Kat,lineBreakRegex:A3,removeScript:Wxe,getUrl:y$,evaluate:pd,getMax:Qat,getMin:Jat},nst=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),ist=w(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"),_a=w(function(t,e,r,n){const i=ist(e,r,n);nst(t,i)},"configureSvgSize"),R3=w(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;he.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;he.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,he.info(`Calculated bounds: ${o}x${l}`),_a(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"),Y8={};function DV(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}w(DV,"cssStyleSheetToString");var ast=w((t,e,r,n)=>{let i="";return t in Y8&&Y8[t]?i=Y8[t]({...r,svgId:n}):he.warn(`No theme found for ${t}`),`& { +`))}}p={type:"taskItem",raw:"",mainContent:v,indentLevel:f,checked:d??!1,text:v,tokens:this.tokenizeInline(v),nestedTokens:x}}const g=h?"taskList":"list";s!==g?(a.length>0&&i.push({type:s,items:a}),a=[p],s=g):a.push(p)}a.length>0&&i.push({type:s,items:a});const o=[];for(let l=0;l0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;const r=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(r.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(e,n),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(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,r)=>({type:"text",text:e,marks:r||void 0}),createNode:(e,r,n)=>{const i={type:e,attrs:r||void 0,content:n||void 0};return(!r||Object.keys(r).length===0)&&delete i.attrs,i},applyMark:(e,r,n)=>({mark:e,content:r,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){const r=[];for(let o=0;o|\/|$)/i);if(!h&&d&&!/\/>$/.test(u)){const p=d[1],g=this.escapeRegex(p),m=new RegExp(`^<\\/\\s*${g}\\b`,"i");let y=-1;const v=[u];for(let x=o+1;x0;o-=1){const l=r[o],u=r[o-1];if(l.type==="text"&&u.type==="text"){const h=l.marks||[],d=u.marks||[];fJe(h,d)&&(u.text=(u.text||"")+(l.text||""),r.splice(o,1))}}return r}applyMarkToContent(e,r,n){return r.map(i=>{if(i.type==="text"){const a=i.marks||[],s=n?{type:e,attrs:n}:{type:e};return{...i,marks:[...a,s]}}return{...i,content:i.content?this.applyMarkToContent(e,i.content,n):void 0}})}isMarkResult(e){return e&&typeof e=="object"&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,r=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:Oae(e.text||"")};case"html":return this.parseHTMLToken(e);case"escape":return{type:"text",text:e.text||""};case"space":return null;default:return e.tokens?this.parseTokens(e.tokens,r):null}}parseHTMLToken(e){const r=e.text||e.raw||"";if(!r.trim())return null;if(this.isUnrecognizedHtml(r))return this.htmlAsLiteralText(r,!!e.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(r,!!e.block);try{const n=dQe(r,this.baseExtensions);if(n.type==="doc"&&n.content){if(e.block)return n.content;const i=this.toInlineContent(n.content);return i.length>0?i:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(e){const r=this.getInlineNodeTypes();return e.flatMap(n=>n.type&&r.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const e=new Set(["text"]);try{const r=lV(this.baseExtensions);Object.values(r.nodes).forEach(n=>{n.isInline&&e.add(n.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Sit(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const e=new Set;try{const r=lV(this.baseExtensions),n=i=>{const a=i==null?void 0:i.parseDOM;Array.isArray(a)&&a.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const o=s.tag.match(/^[a-zA-Z][\w-]*/);o&&e.add(o[0].toLowerCase())}})};Object.values(r.nodes).forEach(i=>n(i.spec)),Object.values(r.marks).forEach(i=>n(i.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,r){const n=e.replace(/\s+$/,"");return n?r?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(e,r,n){return(n==null?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(r.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?e:this.escapeMarkdownSyntax(uJe(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(e,r,n=0,i=0,a={}){var s;if(e.type==="text")return this.encodeTextForMarkdown(e.text||"",e,r);if(!e.type)return"";const o=this.getHandlerForToken(e.type);if(!o)return"";const l=Array.isArray(r==null?void 0:r.content)&&n>0?r.content[n-1]:void 0,u={renderChildren:(d,f)=>{const p=o.isIndenting?i+1:i;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,e,f||"",n,p):this.renderNodes(d,e,f||"",n,p)},renderChild:(d,f)=>{const p=o.isIndenting?i+1:i;return this.renderNodeToMarkdown(d,e,f,p)},indent:d=>this.indentString+d,wrapInBlock:mit},h={index:n,level:i,parentType:r==null?void 0:r.type,previousNode:l,meta:{parentAttrs:r==null?void 0:r.attrs,...a}};return((s=o.renderMarkdown)===null||s===void 0?void 0:s.call(o,e,u,h))||""}renderNodes(e,r,n="",i=0,a=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,r,n,a):e.type?this.renderNodeToMarkdown(e,r,i,a):""}renderNodesWithMarkBoundaries(e,r,n="",i=0){const a=[],s=new Map,o=new Set,l=new Map;return e.forEach((u,h)=>{const d=h[S.type,S])),g=this.getMarksToOpenForSerialization(s,p,d),m=Ese(p,d);if(f.length>0&&f.trim().length===0&&p.size>0){const S=new Set(m.filter(C=>!s.has(C)));S.size>0&&(p=new Map(Array.from(p).filter(([C])=>!S.has(C))),g=this.getMarksToOpenForSerialization(s,p,d),m=Ese(p,d))}const y=m.filter(S=>s.has(S)),v=y.length>0&&g.length>0;let x="";if(m.length>0&&!v){const S=f.match(/(\s+)$/);S&&(x=S[1],f=f.slice(0,-x.length))}v||m.slice().reverse().forEach(S=>{if(!s.has(S))return;const C=p.get(S),E=this.getMarkClosing(S,C,l.get(S));E&&(f+=E),s.has(S)&&(s.delete(S),l.delete(S))});let b="";if(g.length>0){const S=f.match(/^(\s+)/);S&&(b=S[1],f=f.slice(b.length))}g.forEach(({type:S,mark:C})=>{const E=o.has(S)?"html":"markdown",A=this.getMarkOpening(S,C,E);A&&(f=A+f),l.set(S,E),o.delete(S)}),v||g.slice().reverse().forEach(({type:S,mark:C})=>{s.set(S,C)}),f=b+f;let T;if(v){const S=new Set(((d==null?void 0:d.marks)||[]).map(A=>A.type));g.forEach(({type:A})=>{S.has(A)&&this.getHtmlReopenTags(A)&&o.add(A)});const C=Array.from(s.keys()),E=y.slice().sort((A,M)=>C.indexOf(M)-C.indexOf(A));T=[...g.map(A=>A.type),...E]}else T=vit(s,p,d,this.markSetsEqual.bind(this));let k="";if(T.length>0){const S=f.match(/(\s+)$/);S&&(k=S[1],f=f.slice(0,-k.length))}T.forEach(S=>{var C;const E=(C=s.get(S))!==null&&C!==void 0?C:p.get(S),A=this.getMarkClosing(S,E,l.get(S));A&&(f+=A),s.delete(S),l.delete(S)}),f+=k,f+=x,a.push(f)}else{const f=new Set((u.marks||[]).map(x=>x.type)),p=new Map,g=new Map;s.forEach((x,b)=>{if(f.has(b)){var T;p.set(b,x),g.set(b,(T=l.get(b))!==null&&T!==void 0?T:"markdown")}});const m=bit(s,(x,b)=>this.getMarkClosing(x,b,l.get(x)));l.clear();const y=this.renderNodeToMarkdown(u,r,h,i),v=u.type==="hardBreak"?"":xit(p,s,(x,b)=>{var T;const k=(T=g.get(x))!==null&&T!==void 0?T:"markdown";return l.set(x,k),this.getMarkOpening(x,b,k)});a.push(m+y+v)}}),a.join(n)}getMarkOpening(e,r,n="markdown"){if(n==="html"){var i;return((i=this.getHtmlReopenTags(e))===null||i===void 0?void 0:i.open)||""}const a=this.getHandlersForNodeType(e),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:r.attrs||{},content:[{type:"text",text:o}]};try{const u=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),h=u.indexOf(o);return h>=0?u.substring(0,h):""}catch(u){throw new Error(`Failed to get mark opening for ${e}: ${u}`)}}getMarkClosing(e,r,n="markdown"){if(n==="html"){var i;return((i=this.getHtmlReopenTags(e))===null||i===void 0?void 0:i.close)||""}const a=this.getHandlersForNodeType(e),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:r.attrs||{},content:[{type:"text",text:o}]};try{const u=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:f=>f,wrapInBlock:(f,p)=>f+p},{index:0,level:0,parentType:"text",meta:{}}),h=u.indexOf(o),d=h+33;return h>=0?u.substring(d):""}catch(u){throw new Error(`Failed to get mark closing for ${e}: ${u}`)}}getHtmlReopenTags(e){const r=this.getHandlersForNodeType(e),n=r.length>0?r[0]:void 0;return n==null?void 0:n.htmlReopen}markSetsEqual(e,r){return e.size!==r.size?!1:Array.from(e.entries()).every(([n,i])=>{const a=r.get(n);return a&&wT(i.attrs,a.attrs)})}getMarksToOpenForSerialization(e,r,n){const i=yit(e,r);if(i.length<=1)return i;const a=(n==null?void 0:n.marks)||[],s=(h,d)=>a.some(f=>f.type===h&&wT(f.attrs,d)),o=(h,d)=>{var f,p;const g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?f:Number.MAX_SAFE_INTEGER,m=(p=this.extensionRanks.get(d.type))!==null&&p!==void 0?p:Number.MAX_SAFE_INTEGER;return g!==m?m-g:h.type.localeCompare(d.type)},l=i.filter(h=>!s(h.type,h.mark.attrs)).sort(o),u=i.filter(h=>s(h.type,h.mark.attrs)).sort(o);return[...l,...u]}};const Eit=Ui.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||V7(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vh.setContent(t,e);const r=this.editor.markdown.parse(t);return vh.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||V7(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return vh.insertContent(t,e);const r=this.editor.markdown.parse(t);return vh.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||V7(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return vh.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return vh.insertContentAt(t,n,r)}}},addStorage(){return{manager:new Ase({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 Ase({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||V7(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 e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),Ait="modulepreload",Rit=function(t,e){return new URL(t,e).href},Rse={},wr=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=Rit(h,n),h in Rse)return;Rse[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":Ait,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 Axe=Object.defineProperty,w=(t,e)=>Axe(t,"name",{value:e,configurable:!0}),y$=(t,e)=>{for(var r in e)Axe(t,r,{get:e[r],enumerable:!0})};function ky(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var U8={exports:{}},_it=U8.exports,_se;function Mit(){return _se||(_se=1,(function(t,e){(function(r,n){t.exports=n()})(_it,(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,x={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(_){var I=["th","st","nd","rd"],O=_%100;return"["+_+(I[(O-20)%10]||I[O]||I[0])+"]"}},b=function(_,I,O){var D=String(_);return!D||D.length>=I?_:""+Array(I+1-D.length).join(O)+_},T={s:b,z:function(_){var I=-_.utcOffset(),O=Math.abs(I),D=Math.floor(O/60),$=O%60;return(I<=0?"+":"-")+b(D,2,"0")+":"+b($,2,"0")},m:function _(I,O){if(I.date()1)return _(z[0])}else{var H=I.name;S[H]=I,$=H}return!D&&$&&(k=$),$||!D&&k},M=function(_,I){if(E(_))return _.clone();var O=typeof I=="object"?I:{};return O.date=_,O.args=arguments,new P(O)},L=T;L.l=A,L.i=E,L.w=function(_,I){return M(_,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function _(O){this.$L=A(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[C]=!0}var I=_.prototype;return I.parse=function(O){this.$d=(function(D){var $=D.date,F=D.utc;if($===null)return new Date(NaN);if(L.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var z=$.match(y);if(z){var H=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],H,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],H,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date($)})(O),this.init()},I.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(O,D){var $=M(O);return this.startOf(D)<=$&&$<=this.endOf(D)},I.isAfter=function(O,D){return M(O){},"trace"),debug:w((...t)=>{},"debug"),info:w((...t)=>{},"info"),warn:w((...t)=>{},"warn"),error:w((...t)=>{},"error"),fatal:w((...t)=>{},"fatal")},aK=w(function(t="fatal"){let e=zd.fatal;typeof t=="string"?t.toLowerCase()in zd&&(e=zd[t]):typeof t=="number"&&(e=t),he.trace=()=>{},he.debug=()=>{},he.info=()=>{},he.warn=()=>{},he.error=()=>{},he.fatal=()=>{},e<=zd.fatal&&(he.fatal=console.error?console.error.bind(console,Fc("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Fc("FATAL"))),e<=zd.error&&(he.error=console.error?console.error.bind(console,Fc("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Fc("ERROR"))),e<=zd.warn&&(he.warn=console.warn?console.warn.bind(console,Fc("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Fc("WARN"))),e<=zd.info&&(he.info=console.info?console.info.bind(console,Fc("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Fc("INFO"))),e<=zd.debug&&(he.debug=console.debug?console.debug.bind(console,Fc("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Fc("DEBUG"))),e<=zd.trace&&(he.trace=console.debug?console.debug.bind(console,Fc("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Fc("TRACE")))},"setLogLevel"),Fc=w(t=>`%c${_s().format("ss.SSS")} : ${t} : `,"format");const Y8={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 Y8.hue2rgb(a,i,t+1/3)*255;case"g":return Y8.hue2rgb(a,i,t)*255;case"b":return Y8.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},$it={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},en={channel:Y8,lang:Iit,unit:$it},U0={};for(let t=0;t<=255;t++)U0[t]=en.unit.dec2hex(t);const wo={ALL:0,RGB:1,HSL:2};let Nit=class{constructor(){this.type=wo.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=wo.ALL}is(e){return this.type===e}};class Dit{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Nit}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=wo.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=en.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=en.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=en.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=en.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=en.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=en.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(wo.HSL)&&r!==void 0?r:(this._ensureHSL(),en.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(wo.RGB)&&r!==void 0?r:(this._ensureRGB(),en.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(wo.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(wo.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(wo.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(wo.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(wo.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(wo.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const v$=new Dit({r:0,g:0,b:0,a:0},"transparent"),ib={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(ib.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 v$.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?`#${U0[Math.round(e)]}${U0[Math.round(r)]}${U0[Math.round(n)]}${U0[Math.round(i*255)]}`:`#${U0[Math.round(e)]}${U0[Math.round(r)]}${U0[Math.round(n)]}`}},Jm={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(Jm.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return en.channel.clamp.h(parseFloat(r)*.9);case"rad":return en.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return en.channel.clamp.h(parseFloat(r)*360)}}return en.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Jm.re);if(!r)return;const[,n,i,a,s,o]=r;return v$.set({h:Jm._hue2deg(n),s:en.channel.clamp.s(parseFloat(i)),l:en.channel.clamp.l(parseFloat(a)),a:s?en.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(${en.lang.round(e)}, ${en.lang.round(r)}%, ${en.lang.round(n)}%, ${i})`:`hsl(${en.lang.round(e)}, ${en.lang.round(r)}%, ${en.lang.round(n)}%)`}},vC={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=vC.colors[t];if(e)return ib.parse(e)},stringify:t=>{const e=ib.stringify(t);for(const r in vC.colors)if(vC.colors[r]===e)return r}},y5={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(y5.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return v$.set({r:en.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:en.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:en.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?en.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(${en.lang.round(e)}, ${en.lang.round(r)}, ${en.lang.round(n)}, ${en.lang.round(i)})`:`rgb(${en.lang.round(e)}, ${en.lang.round(r)}, ${en.lang.round(n)})`}},rh={format:{keyword:vC,hex:ib,rgb:y5,rgba:y5,hsl:Jm,hsla:Jm},parse:t=>{if(typeof t!="string")return t;const e=ib.parse(t)||y5.parse(t)||Jm.parse(t)||vC.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(wo.HSL)||t.data.r===void 0?Jm.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?y5.stringify(t):ib.stringify(t)},Rxe=(t,e)=>{const r=rh.parse(t);for(const n in e)r[n]=en.channel.clamp[n](e[n]);return rh.stringify(r)},qu=(t,e,r=0,n=1)=>{if(typeof t!="number")return Rxe(t,{a:e});const i=v$.set({r:en.channel.clamp.r(t),g:en.channel.clamp.g(e),b:en.channel.clamp.b(r),a:en.channel.clamp.a(n)});return rh.stringify(i)},sK=(t,e)=>en.lang.round(rh.parse(t)[e]),Oit=t=>{const{r:e,g:r,b:n}=rh.parse(t),i=.2126*en.channel.toLinear(e)+.7152*en.channel.toLinear(r)+.0722*en.channel.toLinear(n);return en.lang.round(i)},Pit=t=>Oit(t)>=.5,kl=t=>!Pit(t),oK=(t,e,r)=>{const n=rh.parse(t),i=n[e],a=en.channel.clamp[e](i+r);return i!==a&&(n[e]=a),rh.stringify(n)},lt=(t,e)=>oK(t,"l",e),ct=(t,e)=>oK(t,"l",-e),Mse=(t,e)=>oK(t,"a",-e),ve=(t,e)=>{const r=rh.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Rxe(t,n)},Bit=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=rh.parse(t),{r:o,g:l,b:u,a:h}=rh.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,x=i*m+l*y,b=a*m+u*y,T=s*d+h*(1-d);return qu(v,x,b,T)},tt=(t,e=100)=>{const r=rh.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Bit(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 Lse(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:es(BigInt.prototype.toString),Pse=typeof Symbol>"u"?null:es(Symbol.prototype.toString),Cs=es(Object.prototype.hasOwnProperty),mk=es(Object.prototype.toString),ks=es(RegExp.prototype.test),Hg=Qit(TypeError);function es(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]:v5;if(Ise&&Ise(t,null),!cp(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(qit(e)||(e[n]=a),i=a)}t[i]=!0}return t}function Jit(t){for(let e=0;e/g),sat=fo(/\${[\w\W]*/g),oat=fo(/^data-[\-\w.\u00B7-\uFFFF]+$/),lat=fo(/^aria-[\-\w]+$/),Vse=fo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cat=fo(/^(?:\w+script|data):/i),uat=fo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hat=fo(/^html$/i),dat=fo(/^[a-z][.\w]*(-[.\w]+)+$/i),Wse=fo(/<[/\w!]/g),qse=fo(/<[/\w]/g),fat=fo(/<\/no(script|embed|frames)/i),pat=fo(/\/>/i),ac={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gat=function(){return typeof window>"u"?null:window},mat=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}},Gse=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M0=function(e,r,n,i){return Cs(e,r)&&cp(e[r])?Ln(i.base?xo(i.base):{},e[r],i.transform):n};function Lxe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gat();const e=It=>Lxe(It);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==ac.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=Tu(f,"cloneNode"),g=Tu(f,"remove"),m=Tu(f,"nextSibling"),y=Tu(f,"childNodes"),v=Tu(f,"parentNode"),x=Tu(f,"shadowRoot"),b=Tu(f,"attributes"),T=s&&s.prototype?Tu(s.prototype,"nodeType"):null,k=s&&s.prototype?Tu(s.prototype,"nodeName"):null,S=s&&s.prototype?Tu(s.prototype,"ownerDocument"):null;if(typeof a=="function"){const It=r.createElement("template");It.content&&It.content.ownerDocument&&(r=It.content.ownerDocument)}let C,E="",A,M=!1,L=0;const P=function(){if(L>0)throw Hg('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.')},N=function(Ne){P(),L++;try{return C.createHTML(Ne)}finally{L--}},_=function(Ne){P(),L++;try{return C.createScriptURL(Ne)}finally{L--}},I=function(){return M||(A=mat(d,i),M=!0),A},O=r,D=O.implementation,$=O.createNodeIterator,F=O.createDocumentFragment,z=O.getElementsByTagName,H=n.importNode;let B=Gse();e.isSupported=typeof _xe=="function"&&typeof v=="function"&&D&&D.createHTMLDocument!==void 0;const V=iat,q=aat,G=sat,Q=oat,j=lat,ae=cat,Z=uat,J=dat;let re=Vse,ee=null;const me=Ln({},[...Bse,...vP,...bP,...xP,...Fse]);let te=null;const $e=Ln({},[...zse,...wP,...Hse,...W7]);let Oe=Object.seal(i2(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}})),He=null,ue=null;const ce=Object.seal(i2(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,ge=!0,Ve=!1,we=!0,Ae=!1,Ue=!0,le=!1,pe=!1,Ce=null,oe=null,fe=!1,W=!1,se=!1,K=!1,de=!0,X=!1;const Fe="user-content-";let ke=!0,Ye=!1,Ie={},ze=null;const De=Ln({},["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 Ke=null;const Be=Ln({},["audio","video","img","source","image","track"]);let nt=null;const Le=Ln({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",Me="http://www.w3.org/2000/svg",Ct="http://www.w3.org/1999/xhtml";let wt=Ct,ht=!1,Bt=null;const At=Ln({},[pt,Me,Ct],yP),mt=so(["mi","mo","mn","ms","mtext"]);let ye=Ln({},mt);const Nt=so(["annotation-xml"]);let yt=Ln({},Nt);const gt=Ln({},["title","style","font","a","script"]);let St=null;const tn=["application/xhtml+xml","text/html"],_e="text/html";let Je=null,ut=null;const Dt=r.createElement("form"),Kt=function(Ne){return Ne instanceof RegExp||Ne instanceof Function},Er=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ut&&ut===Ne)return;(!Ne||typeof Ne!="object")&&(Ne={}),Ne=xo(Ne),St=tn.indexOf(Ne.PARSER_MEDIA_TYPE)===-1?_e:Ne.PARSER_MEDIA_TYPE,Je=St==="application/xhtml+xml"?yP:v5,ee=M0(Ne,"ALLOWED_TAGS",me,{transform:Je}),te=M0(Ne,"ALLOWED_ATTR",$e,{transform:Je}),Bt=M0(Ne,"ALLOWED_NAMESPACES",At,{transform:yP}),nt=M0(Ne,"ADD_URI_SAFE_ATTR",Le,{transform:Je,base:Le}),Ke=M0(Ne,"ADD_DATA_URI_TAGS",Be,{transform:Je,base:Be}),ze=M0(Ne,"FORBID_CONTENTS",De,{transform:Je}),He=M0(Ne,"FORBID_TAGS",xo({}),{transform:Je}),ue=M0(Ne,"FORBID_ATTR",xo({}),{transform:Je}),Ie=Cs(Ne,"USE_PROFILES")?Ne.USE_PROFILES&&typeof Ne.USE_PROFILES=="object"?xo(Ne.USE_PROFILES):Ne.USE_PROFILES:!1,Te=Ne.ALLOW_ARIA_ATTR!==!1,ge=Ne.ALLOW_DATA_ATTR!==!1,Ve=Ne.ALLOW_UNKNOWN_PROTOCOLS||!1,we=Ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=Ne.SAFE_FOR_TEMPLATES||!1,Ue=Ne.SAFE_FOR_XML!==!1,le=Ne.WHOLE_DOCUMENT||!1,W=Ne.RETURN_DOM||!1,se=Ne.RETURN_DOM_FRAGMENT||!1,K=Ne.RETURN_TRUSTED_TYPE||!1,fe=Ne.FORCE_BODY||!1,de=Ne.SANITIZE_DOM!==!1,X=Ne.SANITIZE_NAMED_PROPS||!1,ke=Ne.KEEP_CONTENT!==!1,Ye=Ne.IN_PLACE||!1,re=tat(Ne.ALLOWED_URI_REGEXP)?Ne.ALLOWED_URI_REGEXP:Vse,wt=typeof Ne.NAMESPACE=="string"?Ne.NAMESPACE:Ct,ye=Cs(Ne,"MATHML_TEXT_INTEGRATION_POINTS")&&Ne.MATHML_TEXT_INTEGRATION_POINTS&&typeof Ne.MATHML_TEXT_INTEGRATION_POINTS=="object"?xo(Ne.MATHML_TEXT_INTEGRATION_POINTS):Ln({},mt),yt=Cs(Ne,"HTML_INTEGRATION_POINTS")&&Ne.HTML_INTEGRATION_POINTS&&typeof Ne.HTML_INTEGRATION_POINTS=="object"?xo(Ne.HTML_INTEGRATION_POINTS):Ln({},Nt);const rt=Cs(Ne,"CUSTOM_ELEMENT_HANDLING")&&Ne.CUSTOM_ELEMENT_HANDLING&&typeof Ne.CUSTOM_ELEMENT_HANDLING=="object"?xo(Ne.CUSTOM_ELEMENT_HANDLING):i2(null);if(Oe=i2(null),Cs(rt,"tagNameCheck")&&Kt(rt.tagNameCheck)&&(Oe.tagNameCheck=rt.tagNameCheck),Cs(rt,"attributeNameCheck")&&Kt(rt.attributeNameCheck)&&(Oe.attributeNameCheck=rt.attributeNameCheck),Cs(rt,"allowCustomizedBuiltInElements")&&typeof rt.allowCustomizedBuiltInElements=="boolean"&&(Oe.allowCustomizedBuiltInElements=rt.allowCustomizedBuiltInElements),fo(Oe),Ae&&(ge=!1),se&&(W=!0),Ie&&(ee=Ln({},Fse),te=i2(null),Ie.html===!0&&(Ln(ee,Bse),Ln(te,zse)),Ie.svg===!0&&(Ln(ee,vP),Ln(te,wP),Ln(te,W7)),Ie.svgFilters===!0&&(Ln(ee,bP),Ln(te,wP),Ln(te,W7)),Ie.mathMl===!0&&(Ln(ee,xP),Ln(te,Hse),Ln(te,W7))),ce.tagCheck=null,ce.attributeCheck=null,Cs(Ne,"ADD_TAGS")&&(typeof Ne.ADD_TAGS=="function"?ce.tagCheck=Ne.ADD_TAGS:cp(Ne.ADD_TAGS)&&(ee===me&&(ee=xo(ee)),Ln(ee,Ne.ADD_TAGS,Je))),Cs(Ne,"ADD_ATTR")&&(typeof Ne.ADD_ATTR=="function"?ce.attributeCheck=Ne.ADD_ATTR:cp(Ne.ADD_ATTR)&&(te===$e&&(te=xo(te)),Ln(te,Ne.ADD_ATTR,Je))),Cs(Ne,"ADD_URI_SAFE_ATTR")&&cp(Ne.ADD_URI_SAFE_ATTR)&&Ln(nt,Ne.ADD_URI_SAFE_ATTR,Je),Cs(Ne,"FORBID_CONTENTS")&&cp(Ne.FORBID_CONTENTS)&&(ze===De&&(ze=xo(ze)),Ln(ze,Ne.FORBID_CONTENTS,Je)),Cs(Ne,"ADD_FORBID_CONTENTS")&&cp(Ne.ADD_FORBID_CONTENTS)&&(ze===De&&(ze=xo(ze)),Ln(ze,Ne.ADD_FORBID_CONTENTS,Je)),ke&&(ee["#text"]=!0),le&&Ln(ee,["html","head","body"]),ee.table&&(Ln(ee,["tbody"]),delete He.tbody),Ne.TRUSTED_TYPES_POLICY){if(typeof Ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hg('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hg('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Tt=C;C=Ne.TRUSTED_TYPES_POLICY;try{E=N("")}catch(ir){throw C=Tt,ir}}else Ne.TRUSTED_TYPES_POLICY===null?(C=void 0,E=""):(C===void 0&&(C=I()),C&&typeof E=="string"&&(E=N("")));so&&so(Ne),ut=Ne},yr=Ln({},[...vP,...bP,...rat]),qr=Ln({},[...xP,...nat]),kr=function(Ne,rt,Tt){return rt.namespaceURI===Ct?Ne==="svg":rt.namespaceURI===pt?Ne==="svg"&&(Tt==="annotation-xml"||ye[Tt]):!!yr[Ne]},rn=function(Ne,rt,Tt){return rt.namespaceURI===Ct?Ne==="math":rt.namespaceURI===Me?Ne==="math"&&yt[Tt]:!!qr[Ne]},mr=function(Ne,rt,Tt){return rt.namespaceURI===Me&&!yt[Tt]||rt.namespaceURI===pt&&!ye[Tt]?!1:!qr[Ne]&&(gt[Ne]||!yr[Ne])},zr=function(Ne){let rt=v(Ne);(!rt||!rt.tagName)&&(rt={namespaceURI:wt,tagName:"template"});const Tt=v5(Ne.tagName),ir=v5(rt.tagName);return Bt[Ne.namespaceURI]?Ne.namespaceURI===Me?kr(Tt,rt,ir):Ne.namespaceURI===pt?rn(Tt,rt,ir):Ne.namespaceURI===Ct?mr(Tt,rt,ir):!!(St==="application/xhtml+xml"&&Bt[Ne.namespaceURI]):!1},hn=function(Ne){bv(e.removed,{element:Ne});try{v(Ne).removeChild(Ne)}catch{if(g(Ne),!v(Ne))throw Hg("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},st=function(Ne){Mr(Ne);const rt=y(Ne);if(rt){const ir=[];vv(rt,xr=>{bv(ir,xr)}),vv(ir,xr=>{try{g(xr)}catch{}})}const Tt=b(Ne);if(Tt)for(let ir=Tt.length-1;ir>=0;--ir){const xr=Tt[ir],$r=xr&&xr.name;if(typeof $r=="string")try{Ne.removeAttribute($r)}catch{}}},vt=function(Ne,rt){try{bv(e.removed,{attribute:rt.getAttributeNode(Ne),from:rt})}catch{bv(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Ne),Ne==="is")if(W||se)try{hn(rt)}catch{}else try{rt.setAttribute(Ne,"")}catch{}},jt=function(Ne){const rt=b(Ne);if(rt)for(let Tt=rt.length-1;Tt>=0;--Tt){const ir=rt[Tt],xr=ir&&ir.name;if(!(typeof xr!="string"||te[Je(xr)]))try{Ne.removeAttribute(xr)}catch{}}},Mr=function(Ne){const rt=[Ne];for(;rt.length>0;){const Tt=rt.pop();(T?T(Tt):Tt.nodeType)===ac.element&&jt(Tt);const xr=y(Tt);if(xr)for(let $r=xr.length-1;$r>=0;--$r)rt.push(xr[$r])}},dn=function(Ne){if(!Ue)return;const rt=[Ne];for(;rt.length>0;){const Tt=rt.pop(),ir=T?T(Tt):Tt.nodeType;if(ir===ac.processingInstruction||ir===ac.comment&&ks(qse,Tt.data)){try{g(Tt)}catch{}continue}if(ir===ac.element){const $r=Tt,Xn=Je(k?k(Tt):Tt.nodeName);try{$r.hasAttribute&&$r.hasAttribute("patchsrc")&&$r.removeAttribute("patchsrc"),$r.hasAttribute&&$r.hasAttribute("for")&&Xn!=="label"&&Xn!=="output"&&$r.removeAttribute("for")}catch{}}const xr=y(Tt);if(xr)for(let $r=xr.length-1;$r>=0;--$r)rt.push(xr[$r])}},Et=function(Ne){let rt=null,Tt=null;if(fe)Ne=""+Ne;else{const $r=Nse(Ne,/^[\r\n\t ]+/);Tt=$r&&$r[0]}St==="application/xhtml+xml"&&wt===Ct&&(Ne=''+Ne+"");const ir=C?N(Ne):Ne;if(wt===Ct)try{rt=new h().parseFromString(ir,St)}catch{}if(!rt||!rt.documentElement){rt=D.createDocument(wt,"template",null);try{rt.documentElement.innerHTML=ht?E:ir}catch{}}const xr=rt.body||rt.documentElement;return Ne&&Tt&&xr.insertBefore(r.createTextNode(Tt),xr.childNodes[0]||null),wt===Ct?z.call(rt,le?"html":"body")[0]:le?rt.documentElement:xr},ft=function(Ne){const rt=S?S(Ne):Ne.ownerDocument;return $.call(rt||Ne,Ne,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Mt=function(Ne){return Ne=gk(Ne,V," "),Ne=gk(Ne,q," "),Ne=gk(Ne,G," "),Ne},dt=function(Ne){var rt;Ne.normalize();const Tt=S?S(Ne):Ne.ownerDocument,ir=$.call(Tt||Ne,Ne,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let xr=ir.nextNode();for(;xr;)xr.data=Mt(xr.data),xr=ir.nextNode();const $r=(rt=Ne.querySelectorAll)===null||rt===void 0?void 0:rt.call(Ne,"template");$r&&vv($r,Xn=>{Re(Xn.content)&&dt(Xn.content)})},ur=function(Ne){const rt=k?k(Ne):null;return typeof rt!="string"||Je(rt)!=="form"?!1:typeof Ne.nodeName!="string"||typeof Ne.textContent!="string"||typeof Ne.removeChild!="function"||Ne.attributes!==b(Ne)||typeof Ne.removeAttribute!="function"||typeof Ne.setAttribute!="function"||typeof Ne.namespaceURI!="string"||typeof Ne.insertBefore!="function"||typeof Ne.hasChildNodes!="function"||Ne.nodeType!==T(Ne)||Ne.childNodes!==y(Ne)},Re=function(Ne){if(!T||typeof Ne!="object"||Ne===null)return!1;try{return T(Ne)===ac.documentFragment}catch{return!1}},Dn=function(Ne){if(!T||typeof Ne!="object"||Ne===null)return!1;try{return typeof T(Ne)=="number"}catch{return!1}};function Pe(It,Ne,rt){It.length!==0&&vv(It,Tt=>{Tt.call(e,Ne,rt,ut)})}const on=function(Ne,rt){return!!(Ue&&Ne.hasChildNodes()&&!Dn(Ne.firstElementChild)&&ks(Wse,Ne.textContent)&&ks(Wse,Ne.innerHTML)||Ue&&Ne.namespaceURI===Ct&&rt==="style"&&Dn(Ne.firstElementChild)||Ne.nodeType===ac.processingInstruction||Ue&&Ne.nodeType===ac.comment&&ks(qse,Ne.data))},On=function(Ne,rt,Tt){if(!He[rt]&&qs(rt)&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,rt)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(rt)))return!1;if(ke&&!ze[rt]){const ir=v(Ne),xr=y(Ne);if(xr&&ir){const $r=xr.length;for(let Xn=$r-1;Xn>=0;--Xn){const ui=Ne===Tt?p(xr[Xn],!0):xr[Xn];ir.insertBefore(ui,m(Ne))}}}return hn(Ne),!0},Wa=function(Ne,rt,Tt,ir){return Ne.length===0?rt:rt===Tt||rt===ir?xo(rt):rt},Mn=function(Ne,rt){if(Pe(B.beforeSanitizeElements,Ne,null),Ne!==rt&&v(Ne)===null)return Ye&&Mr(Ne),!0;if(ur(Ne))return hn(Ne),!0;const Tt=Je(k?k(Ne):Ne.nodeName);if(ee=Wa(B.uponSanitizeElement,ee,me,Ce),Pe(B.uponSanitizeElement,Ne,{tagName:Tt,allowedTags:ee}),Ne!==rt&&v(Ne)===null)return Ye&&Mr(Ne),!0;if(on(Ne,Tt))return hn(Ne),!0;if(He[Tt]||!(ce.tagCheck instanceof Function&&ce.tagCheck(Tt))&&!ee[Tt]){const xr=On(Ne,Tt,rt);return xr===!1&&Pe(B.afterSanitizeElements,Ne,null),xr}if((T?T(Ne):Ne.nodeType)===ac.element&&!zr(Ne)||(Tt==="noscript"||Tt==="noembed"||Tt==="noframes")&&ks(fat,Ne.innerHTML))return hn(Ne),!0;if(Ae&&Ne.nodeType===ac.text){const xr=Mt(Ne.textContent);Ne.textContent!==xr&&(bv(e.removed,{element:Ne.cloneNode()}),Ne.textContent=xr)}return Pe(B.afterSanitizeElements,Ne,null),!1},Jn=function(Ne,rt,Tt){if(ue[rt]||Ue&&rt==="patchsrc"||Ue&&rt==="for"&&Ne!=="label"&&Ne!=="output"||de&&(rt==="id"||rt==="name")&&(Tt in r||Tt in Dt))return!1;const ir=te[rt]||ce.attributeCheck instanceof Function&&ce.attributeCheck(rt,Ne);if(!(ge&&ks(Q,rt))){if(!(Te&&ks(j,rt))){if(ir){if(!nt[rt]){if(!ks(re,gk(Tt,Z,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Ne!=="script"&&Dse(Tt,"data:")===0&&Ke[Ne])){if(!(Ve&&!ks(ae,gk(Tt,Z,"")))){if(Tt)return!1}}}}}else if(!(qs(Ne)&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,Ne)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(Ne))&&(Oe.attributeNameCheck instanceof RegExp&&ks(Oe.attributeNameCheck,rt)||Oe.attributeNameCheck instanceof Function&&Oe.attributeNameCheck(rt,Ne))||rt==="is"&&Oe.allowCustomizedBuiltInElements&&(Oe.tagNameCheck instanceof RegExp&&ks(Oe.tagNameCheck,Tt)||Oe.tagNameCheck instanceof Function&&Oe.tagNameCheck(Tt))))return!1}}return!0},En=Ln({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),qs=function(Ne){return!En[v5(Ne)]&&ks(J,Ne)},fh=function(Ne,rt,Tt,ir){if(C&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Tt)switch(d.getAttributeType(Ne,rt)){case"TrustedHTML":return N(ir);case"TrustedScriptURL":return _(ir)}return ir},$d=function(Ne,rt,Tt,ir){try{Tt?Ne.setAttributeNS(Tt,rt,ir):Ne.setAttribute(rt,ir),ur(Ne)?hn(Ne):$se(e.removed)}catch{vt(rt,Ne)}},Fg=function(Ne){Pe(B.beforeSanitizeAttributes,Ne,null);const rt=Ne.attributes;if(!rt||ur(Ne))return;te=Wa(B.uponSanitizeAttribute,te,$e,oe);const Tt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let ir=rt.length;const xr=Je(Ne.nodeName);for(;ir--;){const $r=rt[ir],Xn=$r.name,ui=$r.namespaceURI,Ts=$r.value,hi=Je(Xn),HO=Ts;let Wo=Xn==="value"?HO:Xit(HO);if(Tt.attrName=hi,Tt.attrValue=Wo,Tt.keepAttr=!0,Tt.forceKeepAttr=void 0,Pe(B.uponSanitizeAttribute,Ne,Tt),Wo=Tt.attrValue,X&&(hi==="id"||hi==="name")&&Dse(Wo,Fe)!==0&&(vt(Xn,Ne),Wo=Fe+Wo),Ue&&ks(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wo)){vt(Xn,Ne);continue}if(hi==="attributename"&&Nse(Wo,"href")){vt(Xn,Ne);continue}if(!Tt.forceKeepAttr){if(!Tt.keepAttr){vt(Xn,Ne);continue}if(!we&&ks(pat,Wo)){vt(Xn,Ne);continue}if(Ae&&(Wo=Mt(Wo)),!Jn(xr,hi,Wo)){vt(Xn,Ne);continue}Wo=fh(xr,hi,ui,Wo),Wo!==HO&&$d(Ne,Xn,ui,Wo)}}Pe(B.afterSanitizeAttributes,Ne,null)},Nd=function(Ne){let rt=null;const Tt=ft(Ne);for(Pe(B.beforeSanitizeShadowDOM,Ne,null);rt=Tt.nextNode();)if(Pe(B.uponSanitizeShadowNode,rt,null),Mn(rt,Ne),Fg(rt),Re(rt.content)&&Nd(rt.content),(T?T(rt):rt.nodeType)===ac.element){const xr=x(rt);Re(xr)&&(Dd(xr),Nd(xr))}Pe(B.afterSanitizeShadowDOM,Ne,null)},Dd=function(Ne){const rt=[{node:Ne,shadow:null}];for(;rt.length>0;){const Tt=rt.pop();if(Tt.shadow){Nd(Tt.shadow);continue}const ir=Tt.node,$r=(T?T(ir):ir.nodeType)===ac.element,Xn=y(ir);if(Xn)for(let ui=Xn.length-1;ui>=0;--ui)rt.push({node:Xn[ui],shadow:null});if($r){const ui=k?k(ir):null;if(typeof ui=="string"&&Je(ui)==="template"){const Ts=ir.content;Re(Ts)&&rt.push({node:Ts,shadow:null})}}if($r){const ui=x(ir);Re(ui)&&rt.push({node:null,shadow:ui},{node:ui,shadow:null})}}};return e.sanitize=function(It){let Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,Tt=null,ir=null,xr=null;if(ht=!It,ht&&(It="\x3C!-->"),typeof It!="string"&&!Dn(It)&&(It=eat(It),typeof It!="string"))throw Hg("dirty is not a string, aborting");if(!e.isSupported)return It;pe?(ee=Ce,te=oe):Er(Ne),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(ee=xo(ee)),B.uponSanitizeAttribute.length>0&&(te=xo(te)),e.removed=[];const $r=Ye&&typeof It!="string"&&Dn(It);if($r){dn(It);const Ts=k?k(It):It.nodeName;if(typeof Ts=="string"){const hi=Je(Ts);if(!ee[hi]||He[hi])throw st(It),Hg("root node is forbidden and cannot be sanitized in-place")}if(ur(It))throw st(It),Hg("root node is clobbered and cannot be sanitized in-place");try{Dd(It)}catch(hi){throw st(It),hi}}else if(Dn(It))rt=Et("\x3C!---->"),Tt=rt.ownerDocument.importNode(It,!0),Tt.nodeType===ac.element&&Tt.nodeName==="BODY"||Tt.nodeName==="HTML"?rt=Tt:rt.appendChild(Tt),Dd(Tt);else{if(!W&&!Ae&&!le&&It.indexOf("<")===-1)return C&&K?N(It):It;if(rt=Et(It),!rt)return W?null:K?E:""}rt&&fe&&hn(rt.firstChild);const Xn=$r?It:rt;try{const Ts=ft(Xn);for(;ir=Ts.nextNode();)Mn(ir,Xn),Fg(ir),Re(ir.content)&&Nd(ir.content)}catch(Ts){throw $r&&(st(It),vv(e.removed,hi=>{hi.element&&Mr(hi.element)})),Ts}if($r)return vv(e.removed,Ts=>{Ts.element&&Mr(Ts.element)}),Ae&&dt(It),It;if(W){if(Ae&&dt(rt),se)for(xr=F.call(rt.ownerDocument);rt.firstChild;)xr.appendChild(rt.firstChild);else xr=rt;return(te.shadowroot||te.shadowrootmode)&&(xr=H.call(n,xr,!0)),xr}let ui=le?rt.outerHTML:rt.innerHTML;return le&&ee["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&ks(hat,rt.ownerDocument.doctype.name)&&(ui=" +`+ui),Ae&&(ui=Mt(ui)),C&&K?N(ui):ui},e.setConfig=function(){let It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Er(It),pe=!0,Ce=ee,oe=te},e.clearConfig=function(){ut=null,pe=!1,Ce=null,oe=null,C=A,E=""},e.isValidAttribute=function(It,Ne,rt){ut||Er({});const Tt=Je(It),ir=Je(Ne);return Jn(Tt,ir,rt)},e.addHook=function(It,Ne){typeof Ne=="function"&&Cs(B,It)&&bv(B[It],Ne)},e.removeHook=function(It,Ne){if(Cs(B,It)){if(Ne!==void 0){const rt=Yit(B[It],Ne);return rt===-1?void 0:jit(B[It],rt,1)[0]}return $se(B[It])}},e.removeHooks=function(It){Cs(B,It)&&(B[It]=[])},e.removeAllHooks=function(){B=Gse()},e}var Ff=Lxe(),$V=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>$V(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]=$V(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"),ja=$V,fd="#ffffff",pd="#f2f2f2",Zr=w((t,e)=>e?ve(t,{s:-40,l:10}):ve(t,{s:-40,l:-10}),"mkBorder"),Lb,yat=(Lb=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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ct(this.mainBkg,10)):(this.rowOdd=this.rowOdd||lt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let $e=0;$e{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Lb,"Theme"),Lb),vat=w(t=>{const e=new yat;return e.calculate(t),e},"getThemeVariables"),Ib,bat=(Ib=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=qu(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=ct("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ct(this.sectionBkgColor,10),this.taskBorderColor=qu(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=qu(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||lt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ct(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.secondBkg=lt(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=lt(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=lt(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=tt(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=ve(this.primaryColor,{h:64}),this.fillType3=ve(this.secondaryColor,{h:64}),this.fillType4=ve(this.primaryColor,{h:-64}),this.fillType5=ve(this.secondaryColor,{h:-64}),this.fillType6=ve(this.primaryColor,{h:128}),this.fillType7=ve(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Ib,"Theme"),Ib),xat=w(t=>{const e=new bat;return e.calculate(t),e},"getThemeVariables"),$b,wat=($b=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ve(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Zr(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=qu(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ct(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ct(this.tertiaryColor,40);for(let te=0;te{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]})}},w($b,"Theme"),$b),l0=w(t=>{const e=new wat;return e.calculate(t),e},"getThemeVariables"),Nb,Tat=(Nb=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=lt("#cde498",10),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.primaryColor),this.lineColor=tt(this.background),this.textColor=tt(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.actorBorder=ct(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ct(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ct(this.tertiaryColor,40);for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Nb,"Theme"),Nb),kat=w(t=>{const e=new Tat;return e.calculate(t),e},"getThemeVariables"),Db,Cat=(Db=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=lt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.lineColor=tt(this.background),this.textColor=tt(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||lt(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,x,b,T,k,S,C,E,A,M,L,P,N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me;this.secondBkg=lt(this.contrast,55),this.border2=this.contrast,this.actorBorder=lt(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 te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Db,"Theme"),Db),Sat=w(t=>{const e=new Cat;return e.calculate(t),e},"getThemeVariables"),Ob,Eat=(Ob=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=Zr(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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||ve(e,{h:30}),this.cScale4=this.cScale4||ve(e,{h:60}),this.cScale5=this.cScale5||ve(e,{h:90}),this.cScale6=this.cScale6||ve(e,{h:120}),this.cScale7=this.cScale7||ve(e,{h:150}),this.cScale8=this.cScale8||ve(e,{h:210,l:150}),this.cScale9=this.cScale9||ve(e,{h:270}),this.cScale10=this.cScale10||ve(e,{h:300}),this.cScale11=this.cScale11||ve(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Ob,"Theme"),Ob),Aat=w(t=>{const e=new Eat;return e.calculate(t),e},"getThemeVariables"),Pb,Rat=(Pb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Pb,"Theme"),Pb),_at=w(t=>{const e=new Rat;return e.calculate(t),e},"getThemeVariables"),Bb,Mat=(Bb=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=Zr("#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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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]})}},w(Bb,"Theme"),Bb),Lat=w(t=>{const e=new Mat;return e.calculate(t),e},"getThemeVariables"),Fb,Iat=(Fb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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||ve(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ve(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ve(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ve(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ve(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ve(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ve(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ve(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ve(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Fb,"Theme"),Fb),$at=w(t=>{const e=new Iat;return e.calculate(t),e},"getThemeVariables"),zb,Nat=(zb=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=Zr(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ve(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||lt(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]})}},w(zb,"Theme"),zb),Dat=w(t=>{const e=new Nat;return e.calculate(t),e},"getThemeVariables"),Hb,Oat=(Hb=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ve(this.primaryColor,{h:-160}),this.primaryBorderColor=tt(this.background),this.secondaryBorderColor=Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Zr(this.tertiaryColor,this.darkMode),this.primaryTextColor=tt(this.primaryColor),this.secondaryTextColor=tt(this.secondaryColor),this.tertiaryTextColor=tt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(tt("#323D47"),10),this.border1="#ccc",this.border2=qu(255,255,255,.25),this.arrowheadColor=tt(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||ve(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ve(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Zr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Zr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Zr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Zr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||tt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||tt(this.tertiaryColor),this.lineColor=this.lineColor||tt(this.background),this.arrowheadColor=this.arrowheadColor||tt(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?ct(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||ct(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||tt(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||lt(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]})}},w(Hb,"Theme"),Hb),Pat=w(t=>{const e=new Oat;return e.calculate(t),e},"getThemeVariables"),Mf={base:{getThemeVariables:vat},dark:{getThemeVariables:xat},default:{getThemeVariables:l0},forest:{getThemeVariables:kat},neutral:{getThemeVariables:Sat},neo:{getThemeVariables:Aat},"neo-dark":{getThemeVariables:_at},redux:{getThemeVariables:Lat},"redux-dark":{getThemeVariables:$at},"redux-color":{getThemeVariables:Dat},"redux-dark-color":{getThemeVariables:Pat}},Gs={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},Ixe={...Gs,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Mf.default.getThemeVariables(),sequence:{...Gs.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Gs.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Gs.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Gs.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Gs.pie,useWidth:984},xyChart:{...Gs.xyChart,useWidth:void 0},requirement:{...Gs.requirement,useWidth:void 0},packet:{...Gs.packet},eventmodeling:{...Gs.eventmodeling},treeView:{...Gs.treeView,useWidth:void 0},radar:{...Gs.radar},railroad:{...Gs.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:{...Gs.ishikawa},sankey:{...Gs.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:{...Gs.venn},cynefin:{...Gs.cynefin}},$xe=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...$xe(t[n],"")]:[...r,e+n],[]),"keyify"),Bat=new Set($xe(Ixe,"")),xn=Ixe,Fat={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},zat=w((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))&&(he.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),m9=w(t=>{if(he.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>m9(e));return}for(const e of Object.keys(t)){if(he.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Bat.has(e)||t[e]==null){he.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Fat[e];n?zat(t[e],n):(he.debug("sanitizing object",e),m9(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(he.debug("sanitizing css option",e),t[e]=Nxe(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]="")}he.debug("After sanitization",t)}},"sanitizeDirective"),Nxe=w(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Fl=ja({},kT),y9,z1=[],bC=ja({},kT),lE=w((t,e)=>{let r=ja({},t),n={};for(const i of e)Pxe(i),n=ja(n,i);if(r=ja(r,n),n.theme&&n.theme in Mf){const i=ja({},y9),a=ja(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Mf&&(r.themeVariables=Mf[r.theme].getThemeVariables(a))}return bC=r,Uat(bC),bC},"updateCurrentConfig"),Hat=w(t=>(Fl=ja({},kT),Fl=ja(Fl,t),t.theme&&Mf[t.theme]&&(Fl.themeVariables=Mf[t.theme].getThemeVariables(t.themeVariables)),lE(Fl,z1),Fl),"setSiteConfig"),Vat=w(t=>{y9=ja({},t)},"saveConfigFromInitialize"),Wat=w(t=>(Fl=ja(Fl,t),lE(Fl,z1),Fl),"updateSiteConfig"),Dxe=w(()=>ja({},Fl),"getSiteConfig"),Oxe=w(t=>(lE(bC,[t]),pr()),"setConfig"),pr=w(()=>ja({},bC),"getConfig"),Pxe=w(t=>{t&&(["secure",...Fl.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(he.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"&&Pxe(t[e])}))},"sanitize"),qat=w(t=>{var e;m9(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),z1.push(t),lE(Fl,z1)},"addDirective"),v9=w((t=Fl)=>{z1=[],lE(t,z1)},"reset"),Gat={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."},Use={},Bxe=w(t=>{Use[t]||(he.warn(Gat[t]),Use[t]=!0)},"issueWarning"),Uat=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Bxe("LAZY_LOAD_DEPRECATED")},"checkConfig"),Fxe=w(()=>{let t={};y9&&(t=ja(t,y9));for(const e of z1)t=ja(t,e);return t},"getUserDefinedConfig"),ti=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Bxe("FLOWCHART_HTML_LABELS_DEPRECATED"),gd(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),zxe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,xC=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Yat=/\s*%%.*\n/gm,Vb,Hxe=(Vb=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(Vb,"UnknownDiagramError"),Vb),H1={},lK=w(function(t,e){t=t.replace(zxe,"").replace(xC,"").replace(Yat,` +`);for(const[r,{detector:n}]of Object.entries(H1))if(n(t,e))return r;throw new Hxe(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),NV=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)Vxe(e,r,n)},"registerLazyLoadedDiagrams"),Vxe=w((t,e,r)=>{H1[t]&&he.warn(`Detector with key ${t} already exists. Overwriting.`),H1[t]={detector:e,loader:r},he.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),jat=w(t=>H1[t].loader,"getDiagramLoader"),A3=//gi,Xat=w(t=>t?Gxe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Kat=(()=>{let t=!1;return()=>{t||(Wxe(),t=!0)}})();function Wxe(){const t="data-temp-href-target";Ff.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Ff.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"))})}w(Wxe,"setupDompurifyHooks");var qxe=w(t=>(Kat(),Ff.sanitize(t)),"removeScript"),Yse=w((t,e)=>{if(ti(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=qxe(t):r!=="loose"&&(t=Gxe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=est(t))}return t},"sanitizeMore"),Tn=w((t,e)=>t&&(e.dompurifyConfig?t=Ff.sanitize(Yse(t,e),e.dompurifyConfig).toString():t=Ff.sanitize(Yse(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Zat=w((t,e)=>typeof t=="string"?Tn(t,e):t.flat().map(r=>Tn(r,e)),"sanitizeTextOrArray"),Qat=w(t=>A3.test(t),"hasBreaks"),Jat=w(t=>t.split(A3),"splitBreaks"),est=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),Gxe=w(t=>t.replace(A3,"#br#"),"breakToPlaceholder"),b$=w(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),tst=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),rst=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),K0=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),nst=w((t,e)=>{const r=DV(t,"~"),n=DV(e,"~");return r===1&&n===1},"shouldCombineSets"),ist=w(t=>{const e=DV(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"),jse=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),OV=/\$\$(.*?)\$\$/g,Ha=w(t=>{var e;return(((e=t.match(OV))==null?void 0:e.length)??0)>0},"hasKatex"),cE=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await x$(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"),ast=w(async(t,e)=>{if(!Ha(t))return t;if(!(jse()||e.legacyMathML||e.forceLegacyMathML))return t.replace(OV,"MathML is unsupported in this environment.");{const{default:r}=await wr(async()=>{const{default:i}=await Promise.resolve().then(()=>PMt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!jse()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(A3).map(i=>Ha(i)?`
${i}
`:`
${i}
`).join("").replace(OV,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),x$=w(async(t,e)=>Tn(await ast(t,e),e),"renderKatexSanitized"),Ft={getRows:Xat,sanitizeText:Tn,sanitizeTextOrArray:Zat,hasBreaks:Qat,splitBreaks:Jat,lineBreakRegex:A3,removeScript:qxe,getUrl:b$,evaluate:gd,getMax:tst,getMin:rst},sst=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),ost=w(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"),_a=w(function(t,e,r,n){const i=ost(e,r,n);sst(t,i)},"configureSvgSize"),R3=w(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;he.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;he.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,he.info(`Calculated bounds: ${o}x${l}`),_a(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"),j8={};function PV(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}w(PV,"cssStyleSheetToString");var lst=w((t,e,r,n)=>{let i="";return t in j8&&j8[t]?i=j8[t]({...r,svgId:n}):he.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -348,48 +348,48 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),sst=w((t,e)=>{e!==void 0&&(Y8[t]=e)},"addStylesForDiagram"),ost=ast,oK={};g$(oK,{clear:()=>wi,getAccDescription:()=>Xi,getAccTitle:()=>Yi,getDiagramTitle:()=>Di,setAccDescription:()=>ji,setAccTitle:()=>$i,setDiagramTitle:()=>qi});var lK="",cK="",uK="",hK=w(t=>Tn(t,pr()),"sanitizeText"),wi=w(()=>{lK="",uK="",cK=""},"clear"),$i=w(t=>{lK=hK(t).replace(/^\s+/g,"")},"setAccTitle"),Yi=w(()=>lK,"getAccTitle"),ji=w(t=>{uK=hK(t).replace(/\n\s+/g,` -`)},"setAccDescription"),Xi=w(()=>uK,"getAccDescription"),qi=w(t=>{cK=hK(t)},"setDiagramTitle"),Di=w(()=>cK,"getDiagramTitle"),Yse=he,lst=nK,We=pr,OV=Dxe,Gxe=kT,dK=w(t=>Tn(t,We()),"sanitizeText"),fK=R3,cst=w(()=>oK,"getCommonDb"),v9={},b9=w((t,e,r)=>{var n;v9[t]&&Yse.warn(`Diagram with id ${t} already registered. Overwriting.`),v9[t]=e,r&&Hxe(t,r),sst(t,e.styles),(n=e.injectUtils)==null||n.call(e,Yse,lst,We,dK,fK,cst(),()=>{})},"registerDiagram"),PV=w(t=>{if(t in v9)return v9[t];throw new ust(t)},"getDiagram"),Wb,ust=(Wb=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(Wb,"DiagramNotFoundError"),Wb);function j8(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function hst(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function pK(t){let e,r,n;t.length!==2?(e=j8,r=(o,l)=>j8(t(o),l),n=(o,l)=>t(o)-l):(e=t===j8||t===hst?t:dst,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 dst(){return 0}function fst(t){return t===null?NaN:+t}const pst=pK(j8),gst=pst.right;pK(fst).center;class jse extends Map{constructor(e,r=vst){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(Xse(this,e))}has(e){return super.has(Xse(this,e))}set(e,r){return super.set(mst(this,e),r)}delete(e){return super.delete(yst(this,e))}}function Xse({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function mst({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function yst({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function vst(t){return t!==null&&typeof t=="object"?t.valueOf():t}const bst=Math.sqrt(50),xst=Math.sqrt(10),wst=Math.sqrt(2);function x9(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>=bst?10:a>=xst?5:a>=wst?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 Cst(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 Sst(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 Mst(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Lst(){return!this.__axis}function Uxe(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===X8||t===W7?-1:1,h=t===W7||t===xP?"x":"y",d=t===X8||t===zV?Ast:Rst;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):Est),y=Math.max(a,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?Mst:_st)(e.copy(),l),k=p.selection?p.selection():p,S=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),E=C.exit(),A=C.enter().append("g").attr("class","tick"),M=C.select("line"),L=C.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(A),M=M.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(A.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===X8?"0em":t===zV?"0.71em":"0.32em")),p!==k&&(S=S.transition(p),C=C.transition(p),M=M.transition(p),L=L.transition(p),E=E.transition(p).attr("opacity",Kse).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",Kse).attr("transform",function(P){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(P))?N:T(P))+l)})),E.remove(),S.attr("d",t===W7||t===xP?s?"M"+u*s+","+x+"H"+l+"V"+b+"H"+u*s:"M"+l+","+x+"V"+b:s?"M"+x+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+x+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(P){return d(T(P)+l)}),M.attr(h+"2",u*a),L.attr(h,u*y).text(m),k.filter(Lst).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===xP?"start":t===W7?"end":"middle"),k.each(function(){this.__axis=T})}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 Ist(t){return Uxe(X8,t)}function $st(t){return Uxe(zV,t)}var Nst={value:()=>{}};function Yxe(){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}})}K8.prototype=Yxe.prototype={constructor:K8,on:function(t,e){var r=this._,n=Dst(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)),Qse.hasOwnProperty(e)?{space:Qse[e],local:t}:t}function Pst(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===HV&&e.documentElement.namespaceURI===HV?e.createElement(t):e.createElementNS(r,t)}}function Bst(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jxe(t){var e=b$(t);return(e.local?Bst:Pst)(e)}function Fst(){}function gK(t){return t==null?Fst:function(){return this.querySelector(t)}}function zst(t){typeof t!="function"&&(t=gK(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function hot(t){t||(t=dot);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 fot(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function pot(){return Array.from(this)}function got(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Eot:typeof e=="function"?Rot:Aot)(t,e,r??"")):CT(this.node(),t)}function CT(t,e){return t.style.getPropertyValue(e)||Jxe(t).getComputedStyle(t,null).getPropertyValue(e)}function Mot(t){return function(){delete this[t]}}function Lot(t,e){return function(){this[t]=e}}function Iot(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function $ot(t,e){return arguments.length>1?this.each((e==null?Mot:typeof e=="function"?Iot:Lot)(t,e)):this.node()[t]}function e4e(t){return t.trim().split(/^|\s+/)}function mK(t){return t.classList||new t4e(t)}function t4e(t){this._node=t,this._names=e4e(t.getAttribute("class")||"")}t4e.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 r4e(t,e){for(var r=mK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function olt(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?q7(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?q7(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=mlt.exec(t))?new So(e[1],e[2],e[3],1):(e=ylt.exec(t))?new So(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=vlt.exec(t))?q7(e[1],e[2],e[3],e[4]):(e=blt.exec(t))?q7(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=xlt.exec(t))?aoe(e[1],e[2]/100,e[3]/100,1):(e=wlt.exec(t))?aoe(e[1],e[2]/100,e[3]/100,e[4]):Jse.hasOwnProperty(t)?roe(Jse[t]):t==="transparent"?new So(NaN,NaN,NaN,0):null}function roe(t){return new So(t>>16&255,t>>8&255,t&255,1)}function q7(t,e,r,n){return n<=0&&(t=e=r=NaN),new So(t,e,r,n)}function s4e(t){return t instanceof Cy||(t=V1(t)),t?(t=t.rgb(),new So(t.r,t.g,t.b,t.opacity)):new So}function VV(t,e,r,n){return arguments.length===1?s4e(t):new So(t,e,r,n??1)}function So(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}uE(So,VV,x$(Cy,{brighter(t){return t=t==null?T9:Math.pow(T9,t),new So(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bS:Math.pow(bS,t),new So(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new So(x1(this.r),x1(this.g),x1(this.b),k9(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:noe,formatHex:noe,formatHex8:Clt,formatRgb:ioe,toString:ioe}));function noe(){return`#${e1(this.r)}${e1(this.g)}${e1(this.b)}`}function Clt(){return`#${e1(this.r)}${e1(this.g)}${e1(this.b)}${e1((isNaN(this.opacity)?1:this.opacity)*255)}`}function ioe(){const t=k9(this.opacity);return`${t===1?"rgb(":"rgba("}${x1(this.r)}, ${x1(this.g)}, ${x1(this.b)}${t===1?")":`, ${t})`}`}function k9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function x1(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function e1(t){return t=x1(t),(t<16?"0":"")+t.toString(16)}function aoe(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Fu(t,e,r,n)}function o4e(t){if(t instanceof Fu)return new Fu(t.h,t.s,t.l,t.opacity);if(t instanceof Cy||(t=V1(t)),!t)return new Fu;if(t instanceof Fu)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 Fu(s,o,l,t.opacity)}function Slt(t,e,r,n){return arguments.length===1?o4e(t):new Fu(t,e,r,n??1)}function Fu(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}uE(Fu,Slt,x$(Cy,{brighter(t){return t=t==null?T9:Math.pow(T9,t),new Fu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bS:Math.pow(bS,t),new Fu(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 So(wP(t>=240?t-240:t+120,i,n),wP(t,i,n),wP(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Fu(soe(this.h),G7(this.s),G7(this.l),k9(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=k9(this.opacity);return`${t===1?"hsl(":"hsla("}${soe(this.h)}, ${G7(this.s)*100}%, ${G7(this.l)*100}%${t===1?")":`, ${t})`}`}}));function soe(t){return t=(t||0)%360,t<0?t+360:t}function G7(t){return Math.max(0,Math.min(1,t||0))}function wP(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 Elt=Math.PI/180,Alt=180/Math.PI,C9=18,l4e=.96422,c4e=1,u4e=.82521,h4e=4/29,sb=6/29,d4e=3*sb*sb,Rlt=sb*sb*sb;function f4e(t){if(t instanceof Zh)return new Zh(t.l,t.a,t.b,t.opacity);if(t instanceof yf)return p4e(t);t instanceof So||(t=s4e(t));var e=SP(t.r),r=SP(t.g),n=SP(t.b),i=TP((.2225045*e+.7168786*r+.0606169*n)/c4e),a,s;return e===r&&r===n?a=s=i:(a=TP((.4360747*e+.3850649*r+.1430804*n)/l4e),s=TP((.0139322*e+.0971045*r+.7141733*n)/u4e)),new Zh(116*i-16,500*(a-i),200*(i-s),t.opacity)}function _lt(t,e,r,n){return arguments.length===1?f4e(t):new Zh(t,e,r,n??1)}function Zh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}uE(Zh,_lt,x$(Cy,{brighter(t){return new Zh(this.l+C9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Zh(this.l-C9*(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=l4e*kP(e),t=c4e*kP(t),r=u4e*kP(r),new So(CP(3.1338561*e-1.6168667*t-.4906146*r),CP(-.9787684*e+1.9161415*t+.033454*r),CP(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function TP(t){return t>Rlt?Math.pow(t,1/3):t/d4e+h4e}function kP(t){return t>sb?t*t*t:d4e*(t-h4e)}function CP(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function SP(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mlt(t){if(t instanceof yf)return new yf(t.h,t.c,t.l,t.opacity);if(t instanceof Zh||(t=f4e(t)),t.a===0&&t.b===0)return new yf(NaN,0()=>t;function g4e(t,e){return function(r){return t+r*e}}function Llt(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 Ilt(t,e){var r=e-t;return r?g4e(t,r>180||r<-180?r-360*Math.round(r/360):r):w$(isNaN(t)?e:t)}function $lt(t){return(t=+t)==1?wC:function(e,r){return r-e?Llt(e,r,t):w$(isNaN(e)?r:e)}}function wC(t,e){var r=e-t;return r?g4e(t,r):w$(isNaN(t)?e:t)}const S9=(function t(e){var r=$lt(e);function n(i,a){var s=r((i=VV(i)).r,(a=VV(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=wC(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 Nlt(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:Iu(n,i)})),r=EP.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Iu(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:Iu(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:Iu(u,d)},{i:m-2,x:Iu(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;--ST}function loe(){W1=(A9=wS.now())+T$,ST=b5=0;try{Xlt()}finally{ST=0,Zlt(),W1=0}}function Klt(){var t=wS.now(),e=t-A9;e>b4e&&(T$-=e,A9=t)}function Zlt(){for(var t,e=E9,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:E9=r);x5=t,UV(n)}function UV(t){if(!ST){b5&&(b5=clearTimeout(b5));var e=t-W1;e>24?(t<1/0&&(b5=setTimeout(loe,t-wS.now()-T$)),yk&&(yk=clearInterval(yk))):(yk||(A9=wS.now(),yk=setInterval(Klt,b4e)),ST=1,x4e(loe))}}function coe(t,e,r){var n=new R9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Qlt=Yxe("start","end","cancel","interrupt"),Jlt=[],T4e=0,uoe=1,YV=2,Z8=3,hoe=4,jV=5,Q8=6;function k$(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;ect(t,r,{name:e,index:n,group:i,on:Qlt,tween:Jlt,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:T4e})}function bK(t,e){var r=lh(t,e);if(r.state>T4e)throw new Error("too late; already scheduled");return r}function gd(t,e){var r=lh(t,e);if(r.state>Z8)throw new Error("too late; already running");return r}function lh(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function ect(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=w4e(a,0,r.time);function a(u){r.state=uoe,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!==uoe)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Z8)return coe(s);p.state===hoe?(p.state=Q8,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hYV&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Lct(t,e,r){var n,i,a=Mct(e)?bK:gd;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function Ict(t,e){var r=this._id;return arguments.length<2?lh(this.node(),r).on.on(t):this.each(Lct(r,t,e))}function $ct(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Nct(){return this.on("end.remove",$ct(this._id))}function Dct(t){var e=this._name,r=this._id;typeof t!="function"&&(t=gK(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 E4e;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ilm)if(!(Math.abs(d*l-u*h)>lm)||!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),x=Math.sqrt(f),b=a*Math.tan((XV-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,k=b/v;Math.abs(T-1)>lm&&this._append`L${e+T*h},${r+T*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*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)>lm||Math.abs(this._y1-h)>lm)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%KV+KV),f>sut?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>lm&&this._append`A${n},${n},0,${+(f>=XV)},${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 cut(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function _9(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 ET(t){return t=_9(Math.abs(t)),t?t[1]:NaN}function uut(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 hut(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var dut=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function M9(t){if(!(e=dut.exec(t)))throw new Error("invalid format: "+t);var e;return new wK({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]})}M9.prototype=wK.prototype;function wK(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+""}wK.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 fut(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 L9;function put(t,e){var r=_9(t,e);if(!r)return L9=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(L9=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")+_9(t,Math.max(0,e+a-1))[0]}function doe(t,e){var r=_9(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 foe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:cut,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)=>doe(t*100,e),r:doe,s:put,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function poe(t){return t}var goe=Array.prototype.map,moe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gut(t){var e=t.grouping===void 0||t.thousands===void 0?poe:uut(goe.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?poe:hut(goe.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=M9(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,T=d.precision,k=d.trim,S=d.type;S==="n"?(b=!0,S="g"):foe[S]||(T===void 0&&(T=12),k=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(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:""),A=foe[S],M=/[defgprs%]/.test(S);T=T===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function L(P){var N=C,_=E,I,O,D;if(S==="c")_=A(P)+_,P="";else{P=+P;var $=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),T),k&&(P=fut(P)),$&&+P==0&&m!=="+"&&($=!1),N=($?m==="("?m:o:m==="-"||m==="("?"":m)+N,_=(S==="s"&&!isNaN(P)&&L9!==void 0?moe[8+L9/3]:"")+_+($&&m==="("?")":""),M){for(I=-1,O=P.length;++ID||D>57){_=(D===46?i+P.slice(I+1):P.slice(I))+_,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=N.length+P.length+_.length,z=F>1)+N+P+_+z.slice(F);break;default:P=z+N+P+_;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(ET(f)/3)))*3,g=Math.pow(10,-p),m=u((d=M9(d),d.type="f",d),{suffix:moe[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var Y7,Em,A4e;mut({thousands:",",grouping:[3],currency:["$",""]});function mut(t){return Y7=gut(t),Em=Y7.format,A4e=Y7.formatPrefix,Y7}function yut(t){return Math.max(0,-ET(Math.abs(t)))}function vut(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ET(e)/3)))*3-ET(Math.abs(t)))}function but(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ET(e)-ET(t))+1}function xut(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 wut(){return this.eachAfter(xut)}function Tut(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function kut(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 Cut(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 Aut(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Rut(t){for(var e=this,r=_ut(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 _ut(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 Mut(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Lut(){return Array.from(this)}function Iut(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function $ut(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*Nut(){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 I9(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Fut)}function Dut(){return TK(this).eachBefore(But)}function Out(t){return t.children}function Put(t){return Array.isArray(t)?t[1]:null}function But(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Fut(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function I9(t){this.data=t,this.depth=this.height=0,this.parent=null}I9.prototype=TK.prototype={constructor:I9,count:wut,each:Tut,eachAfter:Cut,eachBefore:kut,find:Sut,sum:Eut,sort:Aut,path:Rut,ancestors:Mut,descendants:Lut,leaves:Iut,links:$ut,copy:Dut,[Symbol.iterator]:Nut};function zut(t){if(typeof t!="function")throw new Error;return t}function vk(){return 0}function bk(t){return function(){return t}}function Hut(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 Vut(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*k,b=Math.max(x/S,S/v),b>T){y-=u;break}T=b}s.push(l={value:y,dice:p1?n:1)},r})(qut);function Yut(){var t=Uut,e=!1,r=1,n=1,i=[0],a=vk,s=vk,o=vk,l=vk,u=vk;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Hut),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 Zut(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?Qut:Zut,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),Iu)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,Xut),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=Hlt,h()},d.clamp=function(f){return arguments.length?(s=f?!0:N2,h()):s!==N2},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 _4e(){return Jut()(N2,N2)}function eht(t,e,r,n){var i=FV(t,e,r),a;switch(n=M9(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=vut(i,s))&&(n.precision=a),A4e(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=but(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=yut(i))&&(n.precision=a-(n.type==="%")*2);break}}return Em(n)}function tht(t){var e=t.domain;return t.ticks=function(r){var n=e();return Tst(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return eht(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=BV(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 AT(){var t=_4e();return t.copy=function(){return R4e(t,AT())},C$.apply(t,arguments),tht(t)}function rht(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(uxs(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)=>(AP.setTime(+a),RP.setTime(+s),t(AP),t(RP),Math.floor(r(AP,RP))),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 RT=xs(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);RT.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?xs(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):RT);RT.range;const vf=1e3,tu=vf*60,bf=tu*60,Hf=bf*24,kK=Hf*7,boe=Hf*30,_P=Hf*365,dp=xs(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*vf)},(t,e)=>(e-t)/vf,t=>t.getUTCSeconds());dp.range;const TS=xs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*vf)},(t,e)=>{t.setTime(+t+e*tu)},(t,e)=>(e-t)/tu,t=>t.getMinutes());TS.range;const nht=xs(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*tu)},(t,e)=>(e-t)/tu,t=>t.getUTCMinutes());nht.range;const kS=xs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*vf-t.getMinutes()*tu)},(t,e)=>{t.setTime(+t+e*bf)},(t,e)=>(e-t)/bf,t=>t.getHours());kS.range;const iht=xs(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*bf)},(t,e)=>(e-t)/bf,t=>t.getUTCHours());iht.range;const q1=xs(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*tu)/Hf,t=>t.getDate()-1);q1.range;const CK=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hf,t=>t.getUTCDate()-1);CK.range;const aht=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hf,t=>Math.floor(t/Hf));aht.range;function Sy(t){return xs(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())*tu)/kK)}const hE=Sy(0),CS=Sy(1),M4e=Sy(2),L4e=Sy(3),G1=Sy(4),I4e=Sy(5),$4e=Sy(6);hE.range;CS.range;M4e.range;L4e.range;G1.range;I4e.range;$4e.range;function Ey(t){return xs(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)/kK)}const N4e=Ey(0),$9=Ey(1),sht=Ey(2),oht=Ey(3),_T=Ey(4),lht=Ey(5),cht=Ey(6);N4e.range;$9.range;sht.range;oht.range;_T.range;lht.range;cht.range;const SS=xs(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());SS.range;const uht=xs(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());uht.range;const Vf=xs(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());Vf.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});Vf.range;const U1=xs(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());U1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});U1.range;function hht(t,e,r,n,i,a){const s=[[dp,1,vf],[dp,5,5*vf],[dp,15,15*vf],[dp,30,30*vf],[a,1,tu],[a,5,5*tu],[a,15,15*tu],[a,30,30*tu],[i,1,bf],[i,3,3*bf],[i,6,6*bf],[i,12,12*bf],[n,1,Hf],[n,2,2*Hf],[r,1,kK],[e,1,boe],[e,3,3*boe],[t,1,_P]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(FV(u/_P,h/_P,d));if(p===0)return RT.every(Math.max(FV(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(te=LP(xk(ee.y,0,1)),$e=te.getUTCDay(),te=$e>4||$e===0?$9.ceil(te):$9(te),te=CK.offset(te,(ee.V-1)*7),ee.y=te.getUTCFullYear(),ee.m=te.getUTCMonth(),ee.d=te.getUTCDate()+(ee.w+6)%7):(te=MP(xk(ee.y,0,1)),$e=te.getDay(),te=$e>4||$e===0?CS.ceil(te):CS(te),te=q1.offset(te,(ee.V-1)*7),ee.y=te.getFullYear(),ee.m=te.getMonth(),ee.d=te.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),$e="Z"in ee?LP(xk(ee.y,0,1)).getUTCDay():MP(xk(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-($e+5)%7:ee.w+ee.U*7-($e+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,LP(ee)):MP(ee)}}function E(Z,J,re,ee){for(var me=0,te=J.length,$e=re.length,Oe,He;me=$e)return-1;if(Oe=J.charCodeAt(me++),Oe===37){if(Oe=J.charAt(me++),He=k[Oe in xoe?J.charAt(me++):Oe],!He||(ee=He(Z,re,ee))<0)return-1}else if(Oe!=re.charCodeAt(ee++))return-1}return ee}function A(Z,J,re){var ee=u.exec(J.slice(re));return ee?(Z.p=h.get(ee[0].toLowerCase()),re+ee[0].length):-1}function M(Z,J,re){var ee=p.exec(J.slice(re));return ee?(Z.w=g.get(ee[0].toLowerCase()),re+ee[0].length):-1}function L(Z,J,re){var ee=d.exec(J.slice(re));return ee?(Z.w=f.get(ee[0].toLowerCase()),re+ee[0].length):-1}function P(Z,J,re){var ee=v.exec(J.slice(re));return ee?(Z.m=x.get(ee[0].toLowerCase()),re+ee[0].length):-1}function N(Z,J,re){var ee=m.exec(J.slice(re));return ee?(Z.m=y.get(ee[0].toLowerCase()),re+ee[0].length):-1}function _(Z,J,re){return E(Z,e,J,re)}function I(Z,J,re){return E(Z,r,J,re)}function O(Z,J,re){return E(Z,n,J,re)}function D(Z){return s[Z.getDay()]}function $(Z){return a[Z.getDay()]}function F(Z){return l[Z.getMonth()]}function z(Z){return o[Z.getMonth()]}function H(Z){return i[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function V(Z){return s[Z.getUTCDay()]}function q(Z){return a[Z.getUTCDay()]}function G(Z){return l[Z.getUTCMonth()]}function Q(Z){return o[Z.getUTCMonth()]}function j(Z){return i[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var J=S(Z+="",b);return J.toString=function(){return Z},J},parse:function(Z){var J=C(Z+="",!1);return J.toString=function(){return Z},J},utcFormat:function(Z){var J=S(Z+="",T);return J.toString=function(){return Z},J},utcParse:function(Z){var J=C(Z+="",!0);return J.toString=function(){return Z},J}}}var xoe={"-":"",_:" ",0:"0"},Bs=/^\s*\d+/,ght=/^%/,mht=/[\\^$*+?|[\]().{}]/g;function Yn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function vht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function bht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function xht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function wht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Tht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function woe(t,e,r){var n=Bs.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Toe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function kht(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 Cht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Sht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function koe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Eht(t,e,r){var n=Bs.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Coe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Aht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Rht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function _ht(t,e,r){var n=Bs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Mht(t,e,r){var n=Bs.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Lht(t,e,r){var n=ght.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Iht(t,e,r){var n=Bs.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function $ht(t,e,r){var n=Bs.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Soe(t,e){return Yn(t.getDate(),e,2)}function Nht(t,e){return Yn(t.getHours(),e,2)}function Dht(t,e){return Yn(t.getHours()%12||12,e,2)}function Oht(t,e){return Yn(1+q1.count(Vf(t),t),e,3)}function D4e(t,e){return Yn(t.getMilliseconds(),e,3)}function Pht(t,e){return D4e(t,e)+"000"}function Bht(t,e){return Yn(t.getMonth()+1,e,2)}function Fht(t,e){return Yn(t.getMinutes(),e,2)}function zht(t,e){return Yn(t.getSeconds(),e,2)}function Hht(t){var e=t.getDay();return e===0?7:e}function Vht(t,e){return Yn(hE.count(Vf(t)-1,t),e,2)}function O4e(t){var e=t.getDay();return e>=4||e===0?G1(t):G1.ceil(t)}function Wht(t,e){return t=O4e(t),Yn(G1.count(Vf(t),t)+(Vf(t).getDay()===4),e,2)}function qht(t){return t.getDay()}function Ght(t,e){return Yn(CS.count(Vf(t)-1,t),e,2)}function Uht(t,e){return Yn(t.getFullYear()%100,e,2)}function Yht(t,e){return t=O4e(t),Yn(t.getFullYear()%100,e,2)}function jht(t,e){return Yn(t.getFullYear()%1e4,e,4)}function Xht(t,e){var r=t.getDay();return t=r>=4||r===0?G1(t):G1.ceil(t),Yn(t.getFullYear()%1e4,e,4)}function Kht(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Yn(e/60|0,"0",2)+Yn(e%60,"0",2)}function Eoe(t,e){return Yn(t.getUTCDate(),e,2)}function Zht(t,e){return Yn(t.getUTCHours(),e,2)}function Qht(t,e){return Yn(t.getUTCHours()%12||12,e,2)}function Jht(t,e){return Yn(1+CK.count(U1(t),t),e,3)}function P4e(t,e){return Yn(t.getUTCMilliseconds(),e,3)}function edt(t,e){return P4e(t,e)+"000"}function tdt(t,e){return Yn(t.getUTCMonth()+1,e,2)}function rdt(t,e){return Yn(t.getUTCMinutes(),e,2)}function ndt(t,e){return Yn(t.getUTCSeconds(),e,2)}function idt(t){var e=t.getUTCDay();return e===0?7:e}function adt(t,e){return Yn(N4e.count(U1(t)-1,t),e,2)}function B4e(t){var e=t.getUTCDay();return e>=4||e===0?_T(t):_T.ceil(t)}function sdt(t,e){return t=B4e(t),Yn(_T.count(U1(t),t)+(U1(t).getUTCDay()===4),e,2)}function odt(t){return t.getUTCDay()}function ldt(t,e){return Yn($9.count(U1(t)-1,t),e,2)}function cdt(t,e){return Yn(t.getUTCFullYear()%100,e,2)}function udt(t,e){return t=B4e(t),Yn(t.getUTCFullYear()%100,e,2)}function hdt(t,e){return Yn(t.getUTCFullYear()%1e4,e,4)}function ddt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?_T(t):_T.ceil(t),Yn(t.getUTCFullYear()%1e4,e,4)}function fdt(){return"+0000"}function Aoe(){return"%"}function Roe(t){return+t}function _oe(t){return Math.floor(+t/1e3)}var xv,N9;pdt({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 pdt(t){return xv=pht(t),N9=xv.format,xv.parse,xv.utcFormat,xv.utcParse,xv}function gdt(t){return new Date(t)}function mdt(t){return t instanceof Date?+t:+new Date(+t)}function F4e(t,e,r,n,i,a,s,o,l,u){var h=_4e(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),T=u("%Y");function k(S){return(l(S)1?0:t<-1?ES:Math.acos(t)}function Loe(t){return t>=1?D9:t<=-1?-D9:Math.asin(t)}function z4e(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 lut(e)}function Tdt(t){return t.innerRadius}function kdt(t){return t.outerRadius}function Cdt(t){return t.startAngle}function Sdt(t){return t.endAngle}function Edt(t){return t&&t.padAngle}function Adt(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*f_*_+I*I&&(E=M,A=L),{cx:E,cy:A,x01:-h,y01:-d,x11:E*(i/k-1),y11:A*(i/k-1)}}function MT(){var t=Tdt,e=kdt,r=Da(0),n=null,i=Cdt,a=Sdt,s=Edt,o=null,l=z4e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-D9,m=a.apply(this,arguments)-D9,y=Moe(m-g),v=m>g;if(o||(o=h=l()),pTo))o.moveTo(0,0);else if(y>J8-To)o.moveTo(p*Vg(g),p*ph(g)),o.arc(0,0,p,g,m,!v),f>To&&(o.moveTo(f*Vg(m),f*ph(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,T=g,k=m,S=y,C=y,E=s.apply(this,arguments)/2,A=E>To&&(n?+n.apply(this,arguments):D2(f*f+p*p)),M=IP(Moe(p-f)/2,+r.apply(this,arguments)),L=M,P=M,N,_;if(A>To){var I=Loe(A/f*ph(E)),O=Loe(A/p*ph(E));(S-=I*2)>To?(I*=v?1:-1,T+=I,k-=I):(S=0,T=k=(g+m)/2),(C-=O*2)>To?(O*=v?1:-1,x+=O,b-=O):(C=0,x=b=(g+m)/2)}var D=p*Vg(x),$=p*ph(x),F=f*Vg(k),z=f*ph(k);if(M>To){var H=p*Vg(b),B=p*ph(b),V=f*Vg(T),q=f*ph(T),G;if(yTo?P>To?(N=j7(V,q,D,$,p,P,v),_=j7(H,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),PTo)||!(S>To)?o.lineTo(F,z):L>To?(N=j7(F,z,H,B,f,-L,v),_=j7(D,$,V,q,f,-L,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),Lt?1:e>=t?0:NaN}function Ldt(t){return t}function Idt(){var t=Ldt,e=Mdt,r=null,n=Da(0),i=Da(J8),a=Da(0);function s(o){var l,u=(o=H4e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(J8,Math.max(-J8,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=x*(y<0?-1:1),T;for(l=0;l0&&(f+=T);for(e!=null?p.sort(function(k,S){return e(g[k],g[S])}):r!=null&&p.sort(function(k,S){return r(o[k],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?T*d:0)+b,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:v,padAngle:x};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Da(+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:Da(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Da(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Da(+o),s):a},s}class W4e{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 q4e(t){return new W4e(t,!0)}function G4e(t){return new W4e(t,!1)}function zp(){}function O9(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 S$(t){this._context=t}S$.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:O9(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:O9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function RS(t){return new S$(t)}function U4e(t){this._context=t}U4e.prototype={areaStart:zp,areaEnd:zp,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:O9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $dt(t){return new U4e(t)}function Y4e(t){this._context=t}Y4e.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:O9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ndt(t){return new Y4e(t)}function j4e(t,e){this._basis=new S$(t),this._beta=e}j4e.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 Ddt=(function t(e){function r(n){return e===1?new S$(n):new j4e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function P9(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 SK(t,e){this._context=t,this._k=(1-e)/6}SK.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:P9(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:P9(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 X4e=(function t(e){function r(n){return new SK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function EK(t,e){this._context=t,this._k=(1-e)/6}EK.prototype={areaStart:zp,areaEnd:zp,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:P9(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 Odt=(function t(e){function r(n){return new EK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function AK(t,e){this._context=t,this._k=(1-e)/6}AK.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:P9(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 Pdt=(function t(e){function r(n){return new AK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function RK(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>To){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>To){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 K4e(t,e){this._context=t,this._alpha=e}K4e.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:RK(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 Z4e=(function t(e){function r(n){return e?new K4e(n,e):new SK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function Q4e(t,e){this._context=t,this._alpha=e}Q4e.prototype={areaStart:zp,areaEnd:zp,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:RK(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 Bdt=(function t(e){function r(n){return e?new Q4e(n,e):new EK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function J4e(t,e){this._context=t,this._alpha=e}J4e.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:RK(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 Fdt=(function t(e){function r(n){return e?new J4e(n,e):new AK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function ewe(t){this._context=t}ewe.prototype={areaStart:zp,areaEnd:zp,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 zdt(t){return new ewe(t)}function Ioe(t){return t<0?-1:1}function $oe(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(Ioe(a)+Ioe(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Noe(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function $P(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 B9(t){this._context=t}B9.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:$P(this,this._t0,Noe(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,$P(this,Noe(this,r=$oe(this,t,e)),r);break;default:$P(this,this._t0,r=$oe(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function twe(t){this._context=new rwe(t)}(twe.prototype=Object.create(B9.prototype)).point=function(t,e){B9.prototype.point.call(this,e,t)};function rwe(t){this._context=t}rwe.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 nwe(t){return new B9(t)}function iwe(t){return new twe(t)}function awe(t){this._context=t}awe.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=Doe(t),i=Doe(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 owe(t){return new E$(t,.5)}function lwe(t){return new E$(t,0)}function cwe(t){return new E$(t,1)}function w5(t,e,r){this.k=t,this.x=e,this.y=r}w5.prototype={constructor:w5,scale:function(t){return t===1?this:new w5(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new w5(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+")"}};w5.prototype;var Po=w(t=>{var i;const{securityLevel:e}=We();let r=bt("body");if(e==="sandbox"){const s=((i=bt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=bt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function _K(t){return typeof t>"u"||t===null}w(_K,"isNothing");function uwe(t){return typeof t=="object"&&t!==null}w(uwe,"isObject");function hwe(t){return Array.isArray(t)?t:_K(t)?[]:[t]}w(hwe,"toArray");function dwe(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r{e!==void 0&&(j8[t]=e)},"addStylesForDiagram"),ust=lst,cK={};y$(cK,{clear:()=>wi,getAccDescription:()=>Xi,getAccTitle:()=>Yi,getDiagramTitle:()=>Di,setAccDescription:()=>ji,setAccTitle:()=>$i,setDiagramTitle:()=>qi});var uK="",hK="",dK="",fK=w(t=>Tn(t,pr()),"sanitizeText"),wi=w(()=>{uK="",dK="",hK=""},"clear"),$i=w(t=>{uK=fK(t).replace(/^\s+/g,"")},"setAccTitle"),Yi=w(()=>uK,"getAccTitle"),ji=w(t=>{dK=fK(t).replace(/\n\s+/g,` +`)},"setAccDescription"),Xi=w(()=>dK,"getAccDescription"),qi=w(t=>{hK=fK(t)},"setDiagramTitle"),Di=w(()=>hK,"getDiagramTitle"),Xse=he,hst=aK,We=pr,BV=Oxe,Uxe=kT,pK=w(t=>Tn(t,We()),"sanitizeText"),gK=R3,dst=w(()=>cK,"getCommonDb"),b9={},x9=w((t,e,r)=>{var n;b9[t]&&Xse.warn(`Diagram with id ${t} already registered. Overwriting.`),b9[t]=e,r&&Vxe(t,r),cst(t,e.styles),(n=e.injectUtils)==null||n.call(e,Xse,hst,We,pK,gK,dst(),()=>{})},"registerDiagram"),FV=w(t=>{if(t in b9)return b9[t];throw new fst(t)},"getDiagram"),Wb,fst=(Wb=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(Wb,"DiagramNotFoundError"),Wb);function X8(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function pst(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function mK(t){let e,r,n;t.length!==2?(e=X8,r=(o,l)=>X8(t(o),l),n=(o,l)=>t(o)-l):(e=t===X8||t===pst?t:gst,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 gst(){return 0}function mst(t){return t===null?NaN:+t}const yst=mK(X8),vst=yst.right;mK(mst).center;class Kse extends Map{constructor(e,r=wst){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(Zse(this,e))}has(e){return super.has(Zse(this,e))}set(e,r){return super.set(bst(this,e),r)}delete(e){return super.delete(xst(this,e))}}function Zse({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function bst({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function xst({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function wst(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Tst=Math.sqrt(50),kst=Math.sqrt(10),Cst=Math.sqrt(2);function w9(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>=Tst?10:a>=kst?5:a>=Cst?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 Ast(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 Rst(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 $st(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Nst(){return!this.__axis}function Yxe(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===K8||t===q7?-1:1,h=t===q7||t===TP?"x":"y",d=t===K8||t===VV?Mst:Lst;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):_st),y=Math.max(a,0)+o,v=e.range(),x=+v[0]+l,b=+v[v.length-1]+l,T=(e.bandwidth?$st:Ist)(e.copy(),l),k=p.selection?p.selection():p,S=k.selectAll(".domain").data([null]),C=k.selectAll(".tick").data(g,e).order(),E=C.exit(),A=C.enter().append("g").attr("class","tick"),M=C.select("line"),L=C.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(A),M=M.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(A.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===K8?"0em":t===VV?"0.71em":"0.32em")),p!==k&&(S=S.transition(p),C=C.transition(p),M=M.transition(p),L=L.transition(p),E=E.transition(p).attr("opacity",Qse).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",Qse).attr("transform",function(P){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(P))?N:T(P))+l)})),E.remove(),S.attr("d",t===q7||t===TP?s?"M"+u*s+","+x+"H"+l+"V"+b+"H"+u*s:"M"+l+","+x+"V"+b:s?"M"+x+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+x+","+l+"H"+b),C.attr("opacity",1).attr("transform",function(P){return d(T(P)+l)}),M.attr(h+"2",u*a),L.attr(h,u*y).text(m),k.filter(Nst).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===TP?"start":t===q7?"end":"middle"),k.each(function(){this.__axis=T})}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 Dst(t){return Yxe(K8,t)}function Ost(t){return Yxe(VV,t)}var Pst={value:()=>{}};function jxe(){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}})}Z8.prototype=jxe.prototype={constructor:Z8,on:function(t,e){var r=this._,n=Bst(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)),eoe.hasOwnProperty(e)?{space:eoe[e],local:t}:t}function zst(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===WV&&e.documentElement.namespaceURI===WV?e.createElement(t):e.createElementNS(r,t)}}function Hst(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Xxe(t){var e=w$(t);return(e.local?Hst:zst)(e)}function Vst(){}function yK(t){return t==null?Vst:function(){return this.querySelector(t)}}function Wst(t){typeof t!="function"&&(t=yK(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=b&&(b=x+1);!(k=y[b])&&++b=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function pot(t){t||(t=got);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 mot(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function yot(){return Array.from(this)}function vot(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?_ot:typeof e=="function"?Lot:Mot)(t,e,r??"")):CT(this.node(),t)}function CT(t,e){return t.style.getPropertyValue(e)||e4e(t).getComputedStyle(t,null).getPropertyValue(e)}function $ot(t){return function(){delete this[t]}}function Not(t,e){return function(){this[t]=e}}function Dot(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Oot(t,e){return arguments.length>1?this.each((e==null?$ot:typeof e=="function"?Dot:Not)(t,e)):this.node()[t]}function t4e(t){return t.trim().split(/^|\s+/)}function vK(t){return t.classList||new r4e(t)}function r4e(t){this._node=t,this._names=t4e(t.getAttribute("class")||"")}r4e.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 n4e(t,e){for(var r=vK(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function ult(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?G7(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?G7(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=blt.exec(t))?new So(e[1],e[2],e[3],1):(e=xlt.exec(t))?new So(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wlt.exec(t))?G7(e[1],e[2],e[3],e[4]):(e=Tlt.exec(t))?G7(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=klt.exec(t))?ooe(e[1],e[2]/100,e[3]/100,1):(e=Clt.exec(t))?ooe(e[1],e[2]/100,e[3]/100,e[4]):toe.hasOwnProperty(t)?ioe(toe[t]):t==="transparent"?new So(NaN,NaN,NaN,0):null}function ioe(t){return new So(t>>16&255,t>>8&255,t&255,1)}function G7(t,e,r,n){return n<=0&&(t=e=r=NaN),new So(t,e,r,n)}function o4e(t){return t instanceof Cy||(t=V1(t)),t?(t=t.rgb(),new So(t.r,t.g,t.b,t.opacity)):new So}function qV(t,e,r,n){return arguments.length===1?o4e(t):new So(t,e,r,n??1)}function So(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}hE(So,qV,T$(Cy,{brighter(t){return t=t==null?k9:Math.pow(k9,t),new So(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bS:Math.pow(bS,t),new So(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new So(x1(this.r),x1(this.g),x1(this.b),C9(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:aoe,formatHex:aoe,formatHex8:Alt,formatRgb:soe,toString:soe}));function aoe(){return`#${e1(this.r)}${e1(this.g)}${e1(this.b)}`}function Alt(){return`#${e1(this.r)}${e1(this.g)}${e1(this.b)}${e1((isNaN(this.opacity)?1:this.opacity)*255)}`}function soe(){const t=C9(this.opacity);return`${t===1?"rgb(":"rgba("}${x1(this.r)}, ${x1(this.g)}, ${x1(this.b)}${t===1?")":`, ${t})`}`}function C9(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function x1(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function e1(t){return t=x1(t),(t<16?"0":"")+t.toString(16)}function ooe(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Fu(t,e,r,n)}function l4e(t){if(t instanceof Fu)return new Fu(t.h,t.s,t.l,t.opacity);if(t instanceof Cy||(t=V1(t)),!t)return new Fu;if(t instanceof Fu)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 Fu(s,o,l,t.opacity)}function Rlt(t,e,r,n){return arguments.length===1?l4e(t):new Fu(t,e,r,n??1)}function Fu(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}hE(Fu,Rlt,T$(Cy,{brighter(t){return t=t==null?k9:Math.pow(k9,t),new Fu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bS:Math.pow(bS,t),new Fu(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 So(kP(t>=240?t-240:t+120,i,n),kP(t,i,n),kP(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Fu(loe(this.h),U7(this.s),U7(this.l),C9(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=C9(this.opacity);return`${t===1?"hsl(":"hsla("}${loe(this.h)}, ${U7(this.s)*100}%, ${U7(this.l)*100}%${t===1?")":`, ${t})`}`}}));function loe(t){return t=(t||0)%360,t<0?t+360:t}function U7(t){return Math.max(0,Math.min(1,t||0))}function kP(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 _lt=Math.PI/180,Mlt=180/Math.PI,S9=18,c4e=.96422,u4e=1,h4e=.82521,d4e=4/29,sb=6/29,f4e=3*sb*sb,Llt=sb*sb*sb;function p4e(t){if(t instanceof Qh)return new Qh(t.l,t.a,t.b,t.opacity);if(t instanceof yf)return g4e(t);t instanceof So||(t=o4e(t));var e=AP(t.r),r=AP(t.g),n=AP(t.b),i=CP((.2225045*e+.7168786*r+.0606169*n)/u4e),a,s;return e===r&&r===n?a=s=i:(a=CP((.4360747*e+.3850649*r+.1430804*n)/c4e),s=CP((.0139322*e+.0971045*r+.7141733*n)/h4e)),new Qh(116*i-16,500*(a-i),200*(i-s),t.opacity)}function Ilt(t,e,r,n){return arguments.length===1?p4e(t):new Qh(t,e,r,n??1)}function Qh(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}hE(Qh,Ilt,T$(Cy,{brighter(t){return new Qh(this.l+S9*(t??1),this.a,this.b,this.opacity)},darker(t){return new Qh(this.l-S9*(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=c4e*SP(e),t=u4e*SP(t),r=h4e*SP(r),new So(EP(3.1338561*e-1.6168667*t-.4906146*r),EP(-.9787684*e+1.9161415*t+.033454*r),EP(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function CP(t){return t>Llt?Math.pow(t,1/3):t/f4e+d4e}function SP(t){return t>sb?t*t*t:f4e*(t-d4e)}function EP(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function AP(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $lt(t){if(t instanceof yf)return new yf(t.h,t.c,t.l,t.opacity);if(t instanceof Qh||(t=p4e(t)),t.a===0&&t.b===0)return new yf(NaN,0()=>t;function m4e(t,e){return function(r){return t+r*e}}function Nlt(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 Dlt(t,e){var r=e-t;return r?m4e(t,r>180||r<-180?r-360*Math.round(r/360):r):k$(isNaN(t)?e:t)}function Olt(t){return(t=+t)==1?wC:function(e,r){return r-e?Nlt(e,r,t):k$(isNaN(e)?r:e)}}function wC(t,e){var r=e-t;return r?m4e(t,r):k$(isNaN(t)?e:t)}const E9=(function t(e){var r=Olt(e);function n(i,a){var s=r((i=qV(i)).r,(a=qV(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=wC(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 Plt(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:Iu(n,i)})),r=RP.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Iu(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:Iu(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:Iu(u,d)},{i:m-2,x:Iu(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;--ST}function uoe(){W1=(R9=wS.now())+C$,ST=b5=0;try{Qlt()}finally{ST=0,ect(),W1=0}}function Jlt(){var t=wS.now(),e=t-R9;e>x4e&&(C$-=e,R9=t)}function ect(){for(var t,e=A9,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:A9=r);x5=t,jV(n)}function jV(t){if(!ST){b5&&(b5=clearTimeout(b5));var e=t-W1;e>24?(t<1/0&&(b5=setTimeout(uoe,t-wS.now()-C$)),yk&&(yk=clearInterval(yk))):(yk||(R9=wS.now(),yk=setInterval(Jlt,x4e)),ST=1,w4e(uoe))}}function hoe(t,e,r){var n=new _9;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var tct=jxe("start","end","cancel","interrupt"),rct=[],k4e=0,doe=1,XV=2,Q8=3,foe=4,KV=5,J8=6;function S$(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;nct(t,r,{name:e,index:n,group:i,on:tct,tween:rct,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:k4e})}function wK(t,e){var r=lh(t,e);if(r.state>k4e)throw new Error("too late; already scheduled");return r}function md(t,e){var r=lh(t,e);if(r.state>Q8)throw new Error("too late; already running");return r}function lh(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function nct(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=T4e(a,0,r.time);function a(u){r.state=doe,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!==doe)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Q8)return hoe(s);p.state===foe?(p.state=J8,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hXV&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Nct(t,e,r){var n,i,a=$ct(e)?wK:md;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function Dct(t,e){var r=this._id;return arguments.length<2?lh(this.node(),r).on.on(t):this.each(Nct(r,t,e))}function Oct(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Pct(){return this.on("end.remove",Oct(this._id))}function Bct(t){var e=this._name,r=this._id;typeof t!="function"&&(t=yK(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 A4e;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ilm)if(!(Math.abs(d*l-u*h)>lm)||!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),x=Math.sqrt(f),b=a*Math.tan((ZV-Math.acos((m+f-y)/(2*v*x)))/2),T=b/x,k=b/v;Math.abs(T-1)>lm&&this._append`L${e+T*h},${r+T*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+k*l},${this._y1=r+k*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)>lm||Math.abs(this._y1-h)>lm)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%QV+QV),f>cut?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>lm&&this._append`A${n},${n},0,${+(f>=ZV)},${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 dut(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function M9(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 ET(t){return t=M9(Math.abs(t)),t?t[1]:NaN}function fut(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 put(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var gut=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function L9(t){if(!(e=gut.exec(t)))throw new Error("invalid format: "+t);var e;return new kK({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]})}L9.prototype=kK.prototype;function kK(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+""}kK.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 mut(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 I9;function yut(t,e){var r=M9(t,e);if(!r)return I9=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(I9=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")+M9(t,Math.max(0,e+a-1))[0]}function poe(t,e){var r=M9(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 goe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:dut,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)=>poe(t*100,e),r:poe,s:yut,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function moe(t){return t}var yoe=Array.prototype.map,voe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vut(t){var e=t.grouping===void 0||t.thousands===void 0?moe:fut(yoe.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?moe:put(yoe.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=L9(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,x=d.width,b=d.comma,T=d.precision,k=d.trim,S=d.type;S==="n"?(b=!0,S="g"):goe[S]||(T===void 0&&(T=12),k=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var C=(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:""),A=goe[S],M=/[defgprs%]/.test(S);T=T===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function L(P){var N=C,_=E,I,O,D;if(S==="c")_=A(P)+_,P="";else{P=+P;var $=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),T),k&&(P=mut(P)),$&&+P==0&&m!=="+"&&($=!1),N=($?m==="("?m:o:m==="-"||m==="("?"":m)+N,_=(S==="s"&&!isNaN(P)&&I9!==void 0?voe[8+I9/3]:"")+_+($&&m==="("?")":""),M){for(I=-1,O=P.length;++ID||D>57){_=(D===46?i+P.slice(I+1):P.slice(I))+_,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=N.length+P.length+_.length,z=F>1)+N+P+_+z.slice(F);break;default:P=z+N+P+_;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(ET(f)/3)))*3,g=Math.pow(10,-p),m=u((d=L9(d),d.type="f",d),{suffix:voe[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var j7,Em,R4e;but({thousands:",",grouping:[3],currency:["$",""]});function but(t){return j7=vut(t),Em=j7.format,R4e=j7.formatPrefix,j7}function xut(t){return Math.max(0,-ET(Math.abs(t)))}function wut(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ET(e)/3)))*3-ET(Math.abs(t)))}function Tut(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ET(e)-ET(t))+1}function kut(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 Cut(){return this.eachAfter(kut)}function Sut(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function Eut(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 Aut(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 Mut(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Lut(t){for(var e=this,r=Iut(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 Iut(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 $ut(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Nut(){return Array.from(this)}function Dut(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Out(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*Put(){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 $9(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Vut)}function But(){return CK(this).eachBefore(Hut)}function Fut(t){return t.children}function zut(t){return Array.isArray(t)?t[1]:null}function Hut(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Vut(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function $9(t){this.data=t,this.depth=this.height=0,this.parent=null}$9.prototype=CK.prototype={constructor:$9,count:Cut,each:Sut,eachAfter:Aut,eachBefore:Eut,find:Rut,sum:_ut,sort:Mut,path:Lut,ancestors:$ut,descendants:Nut,leaves:Dut,links:Out,copy:But,[Symbol.iterator]:Put};function Wut(t){if(typeof t!="function")throw new Error;return t}function vk(){return 0}function bk(t){return function(){return t}}function qut(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 Gut(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ox&&(x=u),S=y*y*k,b=Math.max(x/S,S/v),b>T){y-=u;break}T=b}s.push(l={value:y,dice:p1?n:1)},r})(Yut);function Kut(){var t=Xut,e=!1,r=1,n=1,i=[0],a=vk,s=vk,o=vk,l=vk,u=vk;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(qut),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 eht(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?tht:eht,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),Iu)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,Qut),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=qlt,h()},d.clamp=function(f){return arguments.length?(s=f?!0:N2,h()):s!==N2},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 M4e(){return rht()(N2,N2)}function nht(t,e,r,n){var i=HV(t,e,r),a;switch(n=L9(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=wut(i,s))&&(n.precision=a),R4e(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Tut(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=xut(i))&&(n.precision=a-(n.type==="%")*2);break}}return Em(n)}function iht(t){var e=t.domain;return t.ticks=function(r){var n=e();return Sst(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return nht(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=zV(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 AT(){var t=M4e();return t.copy=function(){return _4e(t,AT())},E$.apply(t,arguments),iht(t)}function aht(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(uxs(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)=>(_P.setTime(+a),MP.setTime(+s),t(_P),t(MP),Math.floor(r(_P,MP))),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 RT=xs(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);RT.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?xs(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):RT);RT.range;const vf=1e3,tu=vf*60,bf=tu*60,Hf=bf*24,SK=Hf*7,woe=Hf*30,LP=Hf*365,dp=xs(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*vf)},(t,e)=>(e-t)/vf,t=>t.getUTCSeconds());dp.range;const TS=xs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*vf)},(t,e)=>{t.setTime(+t+e*tu)},(t,e)=>(e-t)/tu,t=>t.getMinutes());TS.range;const sht=xs(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*tu)},(t,e)=>(e-t)/tu,t=>t.getUTCMinutes());sht.range;const kS=xs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*vf-t.getMinutes()*tu)},(t,e)=>{t.setTime(+t+e*bf)},(t,e)=>(e-t)/bf,t=>t.getHours());kS.range;const oht=xs(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*bf)},(t,e)=>(e-t)/bf,t=>t.getUTCHours());oht.range;const q1=xs(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*tu)/Hf,t=>t.getDate()-1);q1.range;const EK=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hf,t=>t.getUTCDate()-1);EK.range;const lht=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Hf,t=>Math.floor(t/Hf));lht.range;function Sy(t){return xs(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())*tu)/SK)}const dE=Sy(0),CS=Sy(1),L4e=Sy(2),I4e=Sy(3),G1=Sy(4),$4e=Sy(5),N4e=Sy(6);dE.range;CS.range;L4e.range;I4e.range;G1.range;$4e.range;N4e.range;function Ey(t){return xs(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)/SK)}const D4e=Ey(0),N9=Ey(1),cht=Ey(2),uht=Ey(3),_T=Ey(4),hht=Ey(5),dht=Ey(6);D4e.range;N9.range;cht.range;uht.range;_T.range;hht.range;dht.range;const SS=xs(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());SS.range;const fht=xs(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());fht.range;const Vf=xs(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());Vf.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});Vf.range;const U1=xs(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());U1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});U1.range;function pht(t,e,r,n,i,a){const s=[[dp,1,vf],[dp,5,5*vf],[dp,15,15*vf],[dp,30,30*vf],[a,1,tu],[a,5,5*tu],[a,15,15*tu],[a,30,30*tu],[i,1,bf],[i,3,3*bf],[i,6,6*bf],[i,12,12*bf],[n,1,Hf],[n,2,2*Hf],[r,1,SK],[e,1,woe],[e,3,3*woe],[t,1,LP]];function o(u,h,d){const f=hy).right(s,f);if(p===s.length)return t.every(HV(u/LP,h/LP,d));if(p===0)return RT.every(Math.max(HV(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(te=$P(xk(ee.y,0,1)),$e=te.getUTCDay(),te=$e>4||$e===0?N9.ceil(te):N9(te),te=EK.offset(te,(ee.V-1)*7),ee.y=te.getUTCFullYear(),ee.m=te.getUTCMonth(),ee.d=te.getUTCDate()+(ee.w+6)%7):(te=IP(xk(ee.y,0,1)),$e=te.getDay(),te=$e>4||$e===0?CS.ceil(te):CS(te),te=q1.offset(te,(ee.V-1)*7),ee.y=te.getFullYear(),ee.m=te.getMonth(),ee.d=te.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),$e="Z"in ee?$P(xk(ee.y,0,1)).getUTCDay():IP(xk(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-($e+5)%7:ee.w+ee.U*7-($e+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,$P(ee)):IP(ee)}}function E(Z,J,re,ee){for(var me=0,te=J.length,$e=re.length,Oe,He;me=$e)return-1;if(Oe=J.charCodeAt(me++),Oe===37){if(Oe=J.charAt(me++),He=k[Oe in Toe?J.charAt(me++):Oe],!He||(ee=He(Z,re,ee))<0)return-1}else if(Oe!=re.charCodeAt(ee++))return-1}return ee}function A(Z,J,re){var ee=u.exec(J.slice(re));return ee?(Z.p=h.get(ee[0].toLowerCase()),re+ee[0].length):-1}function M(Z,J,re){var ee=p.exec(J.slice(re));return ee?(Z.w=g.get(ee[0].toLowerCase()),re+ee[0].length):-1}function L(Z,J,re){var ee=d.exec(J.slice(re));return ee?(Z.w=f.get(ee[0].toLowerCase()),re+ee[0].length):-1}function P(Z,J,re){var ee=v.exec(J.slice(re));return ee?(Z.m=x.get(ee[0].toLowerCase()),re+ee[0].length):-1}function N(Z,J,re){var ee=m.exec(J.slice(re));return ee?(Z.m=y.get(ee[0].toLowerCase()),re+ee[0].length):-1}function _(Z,J,re){return E(Z,e,J,re)}function I(Z,J,re){return E(Z,r,J,re)}function O(Z,J,re){return E(Z,n,J,re)}function D(Z){return s[Z.getDay()]}function $(Z){return a[Z.getDay()]}function F(Z){return l[Z.getMonth()]}function z(Z){return o[Z.getMonth()]}function H(Z){return i[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function V(Z){return s[Z.getUTCDay()]}function q(Z){return a[Z.getUTCDay()]}function G(Z){return l[Z.getUTCMonth()]}function Q(Z){return o[Z.getUTCMonth()]}function j(Z){return i[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var J=S(Z+="",b);return J.toString=function(){return Z},J},parse:function(Z){var J=C(Z+="",!1);return J.toString=function(){return Z},J},utcFormat:function(Z){var J=S(Z+="",T);return J.toString=function(){return Z},J},utcParse:function(Z){var J=C(Z+="",!0);return J.toString=function(){return Z},J}}}var Toe={"-":"",_:" ",0:"0"},Bs=/^\s*\d+/,vht=/^%/,bht=/[\\^$*+?|[\]().{}]/g;function Yn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function wht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Tht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function kht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Cht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Sht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function koe(t,e,r){var n=Bs.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Coe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Eht(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 Aht(t,e,r){var n=Bs.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Rht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Soe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function _ht(t,e,r){var n=Bs.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Eoe(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Mht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Lht(t,e,r){var n=Bs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Iht(t,e,r){var n=Bs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function $ht(t,e,r){var n=Bs.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Nht(t,e,r){var n=vht.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Dht(t,e,r){var n=Bs.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Oht(t,e,r){var n=Bs.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Aoe(t,e){return Yn(t.getDate(),e,2)}function Pht(t,e){return Yn(t.getHours(),e,2)}function Bht(t,e){return Yn(t.getHours()%12||12,e,2)}function Fht(t,e){return Yn(1+q1.count(Vf(t),t),e,3)}function O4e(t,e){return Yn(t.getMilliseconds(),e,3)}function zht(t,e){return O4e(t,e)+"000"}function Hht(t,e){return Yn(t.getMonth()+1,e,2)}function Vht(t,e){return Yn(t.getMinutes(),e,2)}function Wht(t,e){return Yn(t.getSeconds(),e,2)}function qht(t){var e=t.getDay();return e===0?7:e}function Ght(t,e){return Yn(dE.count(Vf(t)-1,t),e,2)}function P4e(t){var e=t.getDay();return e>=4||e===0?G1(t):G1.ceil(t)}function Uht(t,e){return t=P4e(t),Yn(G1.count(Vf(t),t)+(Vf(t).getDay()===4),e,2)}function Yht(t){return t.getDay()}function jht(t,e){return Yn(CS.count(Vf(t)-1,t),e,2)}function Xht(t,e){return Yn(t.getFullYear()%100,e,2)}function Kht(t,e){return t=P4e(t),Yn(t.getFullYear()%100,e,2)}function Zht(t,e){return Yn(t.getFullYear()%1e4,e,4)}function Qht(t,e){var r=t.getDay();return t=r>=4||r===0?G1(t):G1.ceil(t),Yn(t.getFullYear()%1e4,e,4)}function Jht(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Yn(e/60|0,"0",2)+Yn(e%60,"0",2)}function Roe(t,e){return Yn(t.getUTCDate(),e,2)}function edt(t,e){return Yn(t.getUTCHours(),e,2)}function tdt(t,e){return Yn(t.getUTCHours()%12||12,e,2)}function rdt(t,e){return Yn(1+EK.count(U1(t),t),e,3)}function B4e(t,e){return Yn(t.getUTCMilliseconds(),e,3)}function ndt(t,e){return B4e(t,e)+"000"}function idt(t,e){return Yn(t.getUTCMonth()+1,e,2)}function adt(t,e){return Yn(t.getUTCMinutes(),e,2)}function sdt(t,e){return Yn(t.getUTCSeconds(),e,2)}function odt(t){var e=t.getUTCDay();return e===0?7:e}function ldt(t,e){return Yn(D4e.count(U1(t)-1,t),e,2)}function F4e(t){var e=t.getUTCDay();return e>=4||e===0?_T(t):_T.ceil(t)}function cdt(t,e){return t=F4e(t),Yn(_T.count(U1(t),t)+(U1(t).getUTCDay()===4),e,2)}function udt(t){return t.getUTCDay()}function hdt(t,e){return Yn(N9.count(U1(t)-1,t),e,2)}function ddt(t,e){return Yn(t.getUTCFullYear()%100,e,2)}function fdt(t,e){return t=F4e(t),Yn(t.getUTCFullYear()%100,e,2)}function pdt(t,e){return Yn(t.getUTCFullYear()%1e4,e,4)}function gdt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?_T(t):_T.ceil(t),Yn(t.getUTCFullYear()%1e4,e,4)}function mdt(){return"+0000"}function _oe(){return"%"}function Moe(t){return+t}function Loe(t){return Math.floor(+t/1e3)}var xv,D9;ydt({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 ydt(t){return xv=yht(t),D9=xv.format,xv.parse,xv.utcFormat,xv.utcParse,xv}function vdt(t){return new Date(t)}function bdt(t){return t instanceof Date?+t:+new Date(+t)}function z4e(t,e,r,n,i,a,s,o,l,u){var h=M4e(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),x=u("%b %d"),b=u("%B"),T=u("%Y");function k(S){return(l(S)1?0:t<-1?ES:Math.acos(t)}function $oe(t){return t>=1?O9:t<=-1?-O9:Math.asin(t)}function H4e(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 hut(e)}function Sdt(t){return t.innerRadius}function Edt(t){return t.outerRadius}function Adt(t){return t.startAngle}function Rdt(t){return t.endAngle}function _dt(t){return t&&t.padAngle}function Mdt(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*f_*_+I*I&&(E=M,A=L),{cx:E,cy:A,x01:-h,y01:-d,x11:E*(i/k-1),y11:A*(i/k-1)}}function MT(){var t=Sdt,e=Edt,r=Da(0),n=null,i=Adt,a=Rdt,s=_dt,o=null,l=H4e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-O9,m=a.apply(this,arguments)-O9,y=Ioe(m-g),v=m>g;if(o||(o=h=l()),pTo))o.moveTo(0,0);else if(y>eR-To)o.moveTo(p*Vg(g),p*ph(g)),o.arc(0,0,p,g,m,!v),f>To&&(o.moveTo(f*Vg(m),f*ph(m)),o.arc(0,0,f,m,g,v));else{var x=g,b=m,T=g,k=m,S=y,C=y,E=s.apply(this,arguments)/2,A=E>To&&(n?+n.apply(this,arguments):D2(f*f+p*p)),M=NP(Ioe(p-f)/2,+r.apply(this,arguments)),L=M,P=M,N,_;if(A>To){var I=$oe(A/f*ph(E)),O=$oe(A/p*ph(E));(S-=I*2)>To?(I*=v?1:-1,T+=I,k-=I):(S=0,T=k=(g+m)/2),(C-=O*2)>To?(O*=v?1:-1,x+=O,b-=O):(C=0,x=b=(g+m)/2)}var D=p*Vg(x),$=p*ph(x),F=f*Vg(k),z=f*ph(k);if(M>To){var H=p*Vg(b),B=p*ph(b),V=f*Vg(T),q=f*ph(T),G;if(yTo?P>To?(N=X7(V,q,D,$,p,P,v),_=X7(H,B,F,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),PTo)||!(S>To)?o.lineTo(F,z):L>To?(N=X7(F,z,H,B,f,-L,v),_=X7(D,$,V,q,f,-L,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),Lt?1:e>=t?0:NaN}function Ndt(t){return t}function Ddt(){var t=Ndt,e=$dt,r=null,n=Da(0),i=Da(eR),a=Da(0);function s(o){var l,u=(o=V4e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(eR,Math.max(-eR,i.apply(this,arguments)-m)),v,x=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=x*(y<0?-1:1),T;for(l=0;l0&&(f+=T);for(e!=null?p.sort(function(k,S){return e(g[k],g[S])}):r!=null&&p.sort(function(k,S){return r(o[k],o[S])}),l=0,d=f?(y-u*b)/f:0;l0?T*d:0)+b,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:v,padAngle:x};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Da(+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:Da(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Da(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Da(+o),s):a},s}class q4e{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 G4e(t){return new q4e(t,!0)}function U4e(t){return new q4e(t,!1)}function zp(){}function P9(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 A$(t){this._context=t}A$.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:P9(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:P9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function RS(t){return new A$(t)}function Y4e(t){this._context=t}Y4e.prototype={areaStart:zp,areaEnd:zp,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:P9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Odt(t){return new Y4e(t)}function j4e(t){this._context=t}j4e.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:P9(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pdt(t){return new j4e(t)}function X4e(t,e){this._basis=new A$(t),this._beta=e}X4e.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 Bdt=(function t(e){function r(n){return e===1?new A$(n):new X4e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function B9(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 AK(t,e){this._context=t,this._k=(1-e)/6}AK.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:B9(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:B9(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 K4e=(function t(e){function r(n){return new AK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function RK(t,e){this._context=t,this._k=(1-e)/6}RK.prototype={areaStart:zp,areaEnd:zp,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:B9(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 Fdt=(function t(e){function r(n){return new RK(n,e)}return r.tension=function(n){return t(+n)},r})(0);function _K(t,e){this._context=t,this._k=(1-e)/6}_K.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:B9(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 zdt=(function t(e){function r(n){return new _K(n,e)}return r.tension=function(n){return t(+n)},r})(0);function MK(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>To){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>To){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 Z4e(t,e){this._context=t,this._alpha=e}Z4e.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:MK(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 Q4e=(function t(e){function r(n){return e?new Z4e(n,e):new AK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function J4e(t,e){this._context=t,this._alpha=e}J4e.prototype={areaStart:zp,areaEnd:zp,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:MK(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 Hdt=(function t(e){function r(n){return e?new J4e(n,e):new RK(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function ewe(t,e){this._context=t,this._alpha=e}ewe.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:MK(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 Vdt=(function t(e){function r(n){return e?new ewe(n,e):new _K(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function twe(t){this._context=t}twe.prototype={areaStart:zp,areaEnd:zp,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 Wdt(t){return new twe(t)}function Noe(t){return t<0?-1:1}function Doe(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(Noe(a)+Noe(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Ooe(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function DP(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 F9(t){this._context=t}F9.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:DP(this,this._t0,Ooe(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,DP(this,Ooe(this,r=Doe(this,t,e)),r);break;default:DP(this,this._t0,r=Doe(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function rwe(t){this._context=new nwe(t)}(rwe.prototype=Object.create(F9.prototype)).point=function(t,e){F9.prototype.point.call(this,e,t)};function nwe(t){this._context=t}nwe.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 iwe(t){return new F9(t)}function awe(t){return new rwe(t)}function swe(t){this._context=t}swe.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=Poe(t),i=Poe(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 lwe(t){return new R$(t,.5)}function cwe(t){return new R$(t,0)}function uwe(t){return new R$(t,1)}function w5(t,e,r){this.k=t,this.x=e,this.y=r}w5.prototype={constructor:w5,scale:function(t){return t===1?this:new w5(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new w5(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+")"}};w5.prototype;var Po=w(t=>{var i;const{securityLevel:e}=We();let r=bt("body");if(e==="sandbox"){const s=((i=bt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=bt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function LK(t){return typeof t>"u"||t===null}w(LK,"isNothing");function hwe(t){return typeof t=="object"&&t!==null}w(hwe,"isObject");function dwe(t){return Array.isArray(t)?t:LK(t)?[]:[t]}w(dwe,"toArray");function fwe(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}}w(eR,"getLine");function tR(t,e){return hs.repeat(" ",e-t.length)+t}w(tR,"padStart");function gwe(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=eR(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=hs.repeat(" ",e.indent)+tR((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=eR(t.buffer,n[s],i[s],t.position,d),o+=hs.repeat(" ",e.indent)+tR((t.line+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}w(IK,"formatError");function LT(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=IK(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}w(LT,"YAMLException$1");LT.prototype=Object.create(Error.prototype);LT.prototype.constructor=LT;LT.prototype.toString=w(function(e){return this.name+": "+IK(this,e)},"toString");var Vl=LT;function tR(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}}w(tR,"getLine");function rR(t,e){return hs.repeat(" ",e-t.length)+t}w(rR,"padStart");function mwe(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=tR(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=hs.repeat(" ",e.indent)+rR((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=tR(t.buffer,n[s],i[s],t.position,d),o+=hs.repeat(" ",e.indent)+rR((t.line+1).toString(),h)+" | "+u.str+` `,o+=hs.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=eR(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=hs.repeat(" ",e.indent)+tR((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}w(gwe,"makeSnippet");var Ydt=gwe,jdt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Xdt=["scalar","sequence","mapping"];function mwe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(mwe,"compileStyleAliases");function ywe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(jdt.indexOf(r)===-1)throw new Vl('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=mwe(e.styleAliases||null),Xdt.indexOf(this.kind)===-1)throw new Vl('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w(ywe,"Type$1");var Ao=ywe;function JV(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}w(JV,"compileList");function vwe(){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(w(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:w(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:w(function(t){return t.toString(10)},"decimal"),hexadecimal:w(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"]}}),ift=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Lwe(t){return!(t===null||!ift.test(t)||t[t.length-1]==="_")}w(Lwe,"resolveYamlFloat");function Iwe(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)}w(Iwe,"constructYamlFloat");var aft=/^[-+]?[0-9]+e/;function $we(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(hs.isNegativeZero(t))return"-0.0";return r=t.toString(10),aft.test(r)?r.replace("e",".e"):r}w($we,"representYamlFloat");function Nwe(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||hs.isNegativeZero(t))}w(Nwe,"isFloat");var sft=new Ao("tag:yaml.org,2002:float",{kind:"scalar",resolve:Lwe,construct:Iwe,predicate:Nwe,represent:$we,defaultStyle:"lowercase"}),Dwe=eft.extend({implicit:[tft,rft,nft,sft]}),oft=Dwe,Owe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Pwe=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 Bwe(t){return t===null?!1:Owe.exec(t)!==null||Pwe.exec(t)!==null}w(Bwe,"resolveYamlTimestamp");function Fwe(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=Owe.exec(t),e===null&&(e=Pwe.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}w(Fwe,"constructYamlTimestamp");function zwe(t){return t.toISOString()}w(zwe,"representYamlTimestamp");var lft=new Ao("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Bwe,construct:Fwe,instanceOf:Date,represent:zwe});function Hwe(t){return t==="<<"||t===null}w(Hwe,"resolveYamlMerge");var cft=new Ao("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Hwe}),LK=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function Vwe(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=LK;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(Vwe,"resolveYamlBinary");function Wwe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=LK,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)}w(Wwe,"constructYamlBinary");function qwe(t){var e="",r=0,n,i,a=t.length,s=LK;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}w(qwe,"representYamlBinary");function Gwe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(Gwe,"isBinary");var uft=new Ao("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Vwe,construct:Wwe,predicate:Gwe,represent:qwe}),hft=Object.prototype.hasOwnProperty,dft=Object.prototype.toString;function Uwe(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)}w(sTe,"charFromCodepoint");function IK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(IK,"setProperty");var oTe=new Array(256),lTe=new Array(256);for(Wg=0;Wg<256;Wg++)oTe[Wg]=tW(Wg)?1:0,lTe[Wg]=tW(Wg);var Wg;function cTe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Qwe,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=[]}w(cTe,"State$1");function $K(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=Ydt(r),new Vl(e,r)}w($K,"generateError");function Cr(t,e){throw $K(t,e)}w(Cr,"throwError");function _S(t,e){t.onWarning&&t.onWarning.call(null,$K(t,e))}w(_S,"throwWarning");var Poe={YAML:w(function(e,r,n){var i,a,s;e.version!==null&&Cr(e,"duplication of %YAML directive"),n.length!==1&&Cr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Cr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Cr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&_S(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(e,r,n){var i,a;n.length!==2&&Cr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],tTe.test(i)||Cr(e,"ill-formed tag handle (first argument) of the TAG directive"),Hp.call(e.tagMap,i)&&Cr(e,'there is a previously declared suffix for "'+i+'" tag handle'),rTe.test(a)||Cr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Cr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Lf(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=hs.repeat(` -`,e-1))}w(R$,"writeFoldedLines");function uTe(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),al(p)||t1(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),al(i)||r&&t1(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),al(i)||r&&t1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),al(n))break}else{if(t.position===t.lineStart&&dE(t)||r&&t1(p))break;if(Gu(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Pa(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&&(Lf(t,a,s,!1),R$(t,t.line-l),a=s=t.position,o=!1),Rp(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Lf(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}w(uTe,"readPlainScalar");function hTe(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(Lf(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 Gu(r)?(Lf(t,n,i,!0),R$(t,Pa(t,!1,e)),n=i=t.position):t.position===t.lineStart&&dE(t)?Cr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Cr(t,"unexpected end of the stream within a single quoted scalar")}w(hTe,"readSingleQuotedScalar");function dTe(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 Lf(t,r,t.position,!0),t.position++,!0;if(o===92){if(Lf(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Gu(o))Pa(t,!1,e);else if(o<256&&oTe[o])t.result+=lTe[o],t.position++;else if((s=iTe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=nTe(o))>=0?a=(a<<4)+s:Cr(t,"expected hexadecimal character");t.result+=sTe(a),t.position++}else Cr(t,"unknown escape sequence");r=n=t.position}else Gu(o)?(Lf(t,r,n,!0),R$(t,Pa(t,!1,e)),r=n=t.position):t.position===t.lineStart&&dE(t)?Cr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Cr(t,"unexpected end of the stream within a double quoted scalar")}w(dTe,"readDoubleQuotedScalar");function fTe(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,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(Pa(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&Cr(t,"expected the node content, but found ','"):Cr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),al(u)&&(d=f=!0,t.position++,Pa(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,Y1(t,e,z9,!1,!0),y=t.tag,m=t.result,Pa(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),Pa(t,!0,e),Y1(t,e,z9,!1,!0),v=t.result),p?r1(t,o,g,y,m,v,n,i,a):d?o.push(r1(t,null,g,y,m,v,n,i,a)):o.push(m),Pa(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}Cr(t,"unexpected end of the stream within a flow collection")}w(fTe,"readFlowCollection");function pTe(t,e){var r,n,i=NP,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)NP===i?i=d===43?Ooe:vft:Cr(t,"repeat of a chomping mode identifier");else if((h=aTe(d))>=0)h===0?Cr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Cr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Rp(d)){do d=t.input.charCodeAt(++t.position);while(Rp(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Gu(d)&&d!==0)}for(;d!==0;){for(A$(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Gu(d)){l++;continue}if(t.lineIndent=i.length);l++)u=tR(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=hs.repeat(" ",e.indent)+rR((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}w(mwe,"makeSnippet");var Kdt=mwe,Zdt=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Qdt=["scalar","sequence","mapping"];function ywe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(ywe,"compileStyleAliases");function vwe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(Zdt.indexOf(r)===-1)throw new Vl('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=ywe(e.styleAliases||null),Qdt.indexOf(this.kind)===-1)throw new Vl('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w(vwe,"Type$1");var Ao=vwe;function tW(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}w(tW,"compileList");function bwe(){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(w(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:w(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:w(function(t){return t.toString(10)},"decimal"),hexadecimal:w(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"]}}),oft=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Iwe(t){return!(t===null||!oft.test(t)||t[t.length-1]==="_")}w(Iwe,"resolveYamlFloat");function $we(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)}w($we,"constructYamlFloat");var lft=/^[-+]?[0-9]+e/;function Nwe(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(hs.isNegativeZero(t))return"-0.0";return r=t.toString(10),lft.test(r)?r.replace("e",".e"):r}w(Nwe,"representYamlFloat");function Dwe(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||hs.isNegativeZero(t))}w(Dwe,"isFloat");var cft=new Ao("tag:yaml.org,2002:float",{kind:"scalar",resolve:Iwe,construct:$we,predicate:Dwe,represent:Nwe,defaultStyle:"lowercase"}),Owe=nft.extend({implicit:[ift,aft,sft,cft]}),uft=Owe,Pwe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Bwe=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 Fwe(t){return t===null?!1:Pwe.exec(t)!==null||Bwe.exec(t)!==null}w(Fwe,"resolveYamlTimestamp");function zwe(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=Pwe.exec(t),e===null&&(e=Bwe.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}w(zwe,"constructYamlTimestamp");function Hwe(t){return t.toISOString()}w(Hwe,"representYamlTimestamp");var hft=new Ao("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Fwe,construct:zwe,instanceOf:Date,represent:Hwe});function Vwe(t){return t==="<<"||t===null}w(Vwe,"resolveYamlMerge");var dft=new Ao("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Vwe}),$K=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function Wwe(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=$K;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(Wwe,"resolveYamlBinary");function qwe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=$K,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)}w(qwe,"constructYamlBinary");function Gwe(t){var e="",r=0,n,i,a=t.length,s=$K;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}w(Gwe,"representYamlBinary");function Uwe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(Uwe,"isBinary");var fft=new Ao("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Wwe,construct:qwe,predicate:Uwe,represent:Gwe}),pft=Object.prototype.hasOwnProperty,gft=Object.prototype.toString;function Ywe(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)}w(oTe,"charFromCodepoint");function NK(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(NK,"setProperty");var lTe=new Array(256),cTe=new Array(256);for(Wg=0;Wg<256;Wg++)lTe[Wg]=nW(Wg)?1:0,cTe[Wg]=nW(Wg);var Wg;function uTe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Jwe,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=[]}w(uTe,"State$1");function DK(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=Kdt(r),new Vl(e,r)}w(DK,"generateError");function Sr(t,e){throw DK(t,e)}w(Sr,"throwError");function _S(t,e){t.onWarning&&t.onWarning.call(null,DK(t,e))}w(_S,"throwWarning");var Foe={YAML:w(function(e,r,n){var i,a,s;e.version!==null&&Sr(e,"duplication of %YAML directive"),n.length!==1&&Sr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Sr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Sr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&_S(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(e,r,n){var i,a;n.length!==2&&Sr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],rTe.test(i)||Sr(e,"ill-formed tag handle (first argument) of the TAG directive"),Hp.call(e.tagMap,i)&&Sr(e,'there is a previously declared suffix for "'+i+'" tag handle'),nTe.test(a)||Sr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Sr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function Lf(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=hs.repeat(` +`,e-1))}w(M$,"writeFoldedLines");function hTe(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),al(p)||t1(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),al(i)||r&&t1(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),al(i)||r&&t1(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),al(n))break}else{if(t.position===t.lineStart&&fE(t)||r&&t1(p))break;if(Gu(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Pa(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&&(Lf(t,a,s,!1),M$(t,t.line-l),a=s=t.position,o=!1),Rp(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return Lf(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}w(hTe,"readPlainScalar");function dTe(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(Lf(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 Gu(r)?(Lf(t,n,i,!0),M$(t,Pa(t,!1,e)),n=i=t.position):t.position===t.lineStart&&fE(t)?Sr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Sr(t,"unexpected end of the stream within a single quoted scalar")}w(dTe,"readSingleQuotedScalar");function fTe(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 Lf(t,r,t.position,!0),t.position++,!0;if(o===92){if(Lf(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Gu(o))Pa(t,!1,e);else if(o<256&&lTe[o])t.result+=cTe[o],t.position++;else if((s=aTe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=iTe(o))>=0?a=(a<<4)+s:Sr(t,"expected hexadecimal character");t.result+=oTe(a),t.position++}else Sr(t,"unknown escape sequence");r=n=t.position}else Gu(o)?(Lf(t,r,n,!0),M$(t,Pa(t,!1,e)),r=n=t.position):t.position===t.lineStart&&fE(t)?Sr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Sr(t,"unexpected end of the stream within a double quoted scalar")}w(fTe,"readDoubleQuotedScalar");function pTe(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,x;if(x=t.input.charCodeAt(t.position),x===91)h=93,p=!1,o=[];else if(x===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),x=t.input.charCodeAt(++t.position);x!==0;){if(Pa(t,!0,e),x=t.input.charCodeAt(t.position),x===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?x===44&&Sr(t,"expected the node content, but found ','"):Sr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,x===63&&(u=t.input.charCodeAt(t.position+1),al(u)&&(d=f=!0,t.position++,Pa(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,Y1(t,e,H9,!1,!0),y=t.tag,m=t.result,Pa(t,!0,e),x=t.input.charCodeAt(t.position),(f||t.line===n)&&x===58&&(d=!0,x=t.input.charCodeAt(++t.position),Pa(t,!0,e),Y1(t,e,H9,!1,!0),v=t.result),p?r1(t,o,g,y,m,v,n,i,a):d?o.push(r1(t,null,g,y,m,v,n,i,a)):o.push(m),Pa(t,!0,e),x=t.input.charCodeAt(t.position),x===44?(r=!0,x=t.input.charCodeAt(++t.position)):r=!1}Sr(t,"unexpected end of the stream within a flow collection")}w(pTe,"readFlowCollection");function gTe(t,e){var r,n,i=OP,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)OP===i?i=d===43?Boe:wft:Sr(t,"repeat of a chomping mode identifier");else if((h=sTe(d))>=0)h===0?Sr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Sr(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Rp(d)){do d=t.input.charCodeAt(++t.position);while(Rp(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Gu(d)&&d!==0)}for(;d!==0;){for(_$(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Gu(d)){l++;continue}if(t.lineIndente)&&l!==0)Cr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),Y1(t,e,H9,!0,i)&&(y?g=t.result:m=t.result),y||(r1(t,d,f,p,g,m,s,o,l),p=g=m=null),Pa(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&x!==0)Cr(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&&Cr(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)):Cr(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}w(Y1,"composeNode");function bTe(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&&(Pa(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&&!al(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Cr(t,"directive name must not be less than one character in length");s!==0;){for(;Rp(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Gu(s));break}if(Gu(s))break;for(r=t.position;s!==0&&!al(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&A$(t),Hp.call(Poe,n)?Poe[n](t,n,i):_S(t,'unknown document directive "'+n+'"')}if(Pa(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,Pa(t,!0,-1)):a&&Cr(t,"directives end mark is expected"),Y1(t,t.lineIndent-1,H9,!1,!0),Pa(t,!0,-1),t.checkLineBreaks&&xft.test(t.input.slice(e,t.position))&&_S(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&dE(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Pa(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=NK(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;ie)&&l!==0)Sr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,l=t.position),Y1(t,e,V9,!0,i)&&(y?g=t.result:m=t.result),y||(r1(t,d,f,p,g,m,s,o,l),p=g=m=null),Pa(t,!0,-1),x=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&x!==0)Sr(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&&Sr(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)):Sr(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}w(Y1,"composeNode");function xTe(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&&(Pa(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&&!al(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Sr(t,"directive name must not be less than one character in length");s!==0;){for(;Rp(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Gu(s));break}if(Gu(s))break;for(r=t.position;s!==0&&!al(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&_$(t),Hp.call(Foe,n)?Foe[n](t,n,i):_S(t,'unknown document directive "'+n+'"')}if(Pa(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,Pa(t,!0,-1)):a&&Sr(t,"directives end mark is expected"),Y1(t,t.lineIndent-1,V9,!1,!0),Pa(t,!0,-1),t.checkLineBreaks&&kft.test(t.input.slice(e,t.position))&&_S(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&fE(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Pa(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=OK(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}w(O2,"codePointAt");function OK(t){var e=/^\n* /;return e.test(t)}w(OK,"needIndentIndicator");var NTe=1,lW=2,DTe=3,OTe=4,a2=5;function PTe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=ITe(O2(t,0))&&$Te(O2(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=O2(t,l),!IT(u))return a2;m=m&&oW(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=O2(t,l),u===MS)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!IT(u))return a2;m=m&&oW(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?NTe:a===LS?a2:lW:r>9&&OK(t)?a2:s?a===LS?a2:lW:f?OTe:DTe}w(PTe,"chooseScalarStyle");function BTe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===LS?'""':"''";if(!t.noCompatMode&&(Hft.indexOf(e)!==-1||Vft.test(e)))return t.quotingType===LS?'"'+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 LTe(t,u)}switch(w(l,"testAmbiguity"),PTe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case NTe:return e;case lW:return"'"+e.replace(/'/g,"''")+"'";case DTe:return"|"+cW(e,t.indent)+uW(aW(e,a));case OTe:return">"+cW(e,t.indent)+uW(aW(FTe(e,s),a));case a2:return'"'+zTe(e)+'"';default:throw new Vl("impossible error: invalid scalar style")}})()}w(BTe,"writeScalar");function cW(t,e){var r=OK(t)?String(e):"",n=t[t.length-1]===` +`&&(a+=r),a+=s;return a}w(oW,"indentString");function q9(t,e){return` +`+hs.repeat(" ",t.indent*e)}w(q9,"generateNextLine");function ITe(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}w(O2,"codePointAt");function BK(t){var e=/^\n* /;return e.test(t)}w(BK,"needIndentIndicator");var DTe=1,uW=2,OTe=3,PTe=4,a2=5;function BTe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=$Te(O2(t,0))&&NTe(O2(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=O2(t,l),!IT(u))return a2;m=m&&cW(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=O2(t,l),u===MS)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!IT(u))return a2;m=m&&cW(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?DTe:a===LS?a2:uW:r>9&&BK(t)?a2:s?a===LS?a2:uW:f?PTe:OTe}w(BTe,"chooseScalarStyle");function FTe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===LS?'""':"''";if(!t.noCompatMode&&(qft.indexOf(e)!==-1||Gft.test(e)))return t.quotingType===LS?'"'+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 ITe(t,u)}switch(w(l,"testAmbiguity"),BTe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case DTe:return e;case uW:return"'"+e.replace(/'/g,"''")+"'";case OTe:return"|"+hW(e,t.indent)+dW(oW(e,a));case PTe:return">"+hW(e,t.indent)+dW(oW(zTe(e,s),a));case a2:return'"'+HTe(e)+'"';default:throw new Vl("impossible error: invalid scalar style")}})()}w(FTe,"writeScalar");function hW(t,e){var r=BK(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` -`}w(cW,"blockHeader");function uW(t){return t[t.length-1]===` -`?t.slice(0,-1):t}w(uW,"dropEndingNewline");function FTe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,hW(t.slice(0,u),e)})(),i=t[0]===` +`}w(hW,"blockHeader");function dW(t){return t[t.length-1]===` +`?t.slice(0,-1):t}w(dW,"dropEndingNewline");function zTe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` +`);return u=u!==-1?u:t.length,r.lastIndex=u,fW(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!==""?` -`:"")+hW(l,e),i=a}return n}w(FTe,"foldString");function hW(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+=` +`:"")+fW(l,e),i=a}return n}w(zTe,"foldString");function fW(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)}w(hW,"foldLine");function zTe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=O2(t,i),n=Bo[r],!n&&IT(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||_Te(r);return e}w(zTe,"escapeString");function HTe(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&nd(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}w(HTe,"writeFlowSequence");function dW(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&nd(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=W9(t,e)),t.dump&&MS===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}w(dW,"writeBlockSequence");function VTe(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?"":" "),nd(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}w(VTe,"writeFlowMapping");function WTe(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 Vl("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&MS===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=W9(t,e)),nd(t,e+1,h,!0,d)&&(t.dump&&MS===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}w(WTe,"writeBlockMapping");function fW(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}w(fW,"detectType");function nd(t,e,r,n,i,a,s){t.tag=null,t.dump=r,fW(t,r,!1)||fW(t,r,!0);var o=wTe.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?(WTe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(VTe(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?dW(t,e-1,t.dump,i):dW(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(HTe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&BTe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Vl("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}w(nd,"writeNode");function qTe(t,e){var r=[],n=[],i,a;for(q9(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=O2(t,i),n=Bo[r],!n&&IT(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||MTe(r);return e}w(HTe,"escapeString");function VTe(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&id(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}w(VTe,"writeFlowSequence");function pW(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&id(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=q9(t,e)),t.dump&&MS===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}w(pW,"writeBlockSequence");function WTe(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?"":" "),id(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}w(WTe,"writeFlowMapping");function qTe(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 Vl("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&MS===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=q9(t,e)),id(t,e+1,h,!0,d)&&(t.dump&&MS===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}w(qTe,"writeBlockMapping");function gW(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}w(gW,"detectType");function id(t,e,r,n,i,a,s){t.tag=null,t.dump=r,gW(t,r,!1)||gW(t,r,!0);var o=TTe.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?(qTe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(WTe(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?pW(t,e-1,t.dump,i):pW(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(VTe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&FTe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Vl("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}w(id,"writeNode");function GTe(t,e){var r=[],n=[],i,a;for(G9(t,r,n),i=0,a=n.length;i{const{handDrawnSeed:e}=We();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),_3=w(t=>{const e=Yft([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Yft=w(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"),PK=w(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"),ar=w(t=>{const{stylesArray:e}=_3(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];PK(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"),cr=w((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=We(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=_3(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:jft(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),jft=w(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"),X7={},is={},Boe;function Xft(){return Boe||(Boe=1,Object.defineProperty(is,"__esModule",{value:!0}),is.BLANK_URL=is.relativeFirstCharacters=is.whitespaceEscapeCharsRegex=is.urlSchemeRegex=is.ctrlCharactersRegex=is.htmlCtrlEntityRegex=is.htmlEntitiesRegex=is.invalidProtocolRegex=void 0,is.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,is.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,is.htmlCtrlEntityRegex=/&(newline|tab);/gi,is.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,is.urlSchemeRegex=/^.+(:|:)/gim,is.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,is.relativeFirstCharacters=[".","/"],is.BLANK_URL="about:blank"),is}var Foe;function Kft(){if(Foe)return X7;Foe=1,Object.defineProperty(X7,"__esModule",{value:!0}),X7.sanitizeUrl=a;var t=Xft();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 X7}var Ay=Kft();function Zft(t){return Array.isArray(t)}function DP(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 Qft(){}function GTe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function fE(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const UTe="[object RegExp]",BK="[object String]",FK="[object Number]",zK="[object Boolean]",HK="[object Arguments]",YTe="[object Symbol]",jTe="[object Date]",XTe="[object Map]",KTe="[object Set]",ZTe="[object Array]",QTe="[object ArrayBuffer]",JTe="[object Object]",e3e="[object DataView]",t3e="[object Uint8Array]",r3e="[object Uint8ClampedArray]",n3e="[object Uint16Array]",i3e="[object Uint32Array]",a3e="[object Int8Array]",s3e="[object Int16Array]",o3e="[object Int32Array]",l3e="[object Float32Array]",c3e="[object Float64Array]",zoe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function VK(t){return typeof zoe.Buffer<"u"&&zoe.Buffer.isBuffer(t)}function Jft(t){return Number.isSafeInteger(t)&&t>=0}function u3e(t){return t!=null&&typeof t!="function"&&Jft(t.length)}function e0t(t){return t==="__proto__"}function L$(t){return t==null||typeof t!="object"&&typeof t!="function"}function WK(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function t0t(t,e){return P2(t,void 0,t,new Map,e)}function P2(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(L$(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(fE(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Su(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case FK:case BK:case zK:{const s=new t.constructor(t==null?void 0:t.valueOf());return Su(s,t),s}case HK:{const s={};return Su(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Hoe(t){return n0t(t)}function pW(t){return t!==null&&typeof t=="object"&&fE(t)==="[object Arguments]"}function gW(t){return typeof t=="object"&&t!==null}function i0t(t){return gW(t)&&u3e(t)}function kC(t){return WK(t)}function a0t(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function pE(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(pE.Cache||Map),r}pE.Cache=Map;function s0t(t){if(L$(t))return t;const e=fE(t);if(!o0t(t))return{};if(Zft(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(kC(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]"?c0t(i,t):OP(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 OP(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return u0t(r,t),OP(r,t),l0t(r,t),r}function o0t(t){switch(fE(t)){case HK:case ZTe:case QTe:case e3e:case zK:case jTe:case l3e:case c3e:case a3e:case s3e:case o3e:case XTe:case FK:case JTe:case UTe:case KTe:case BK:case YTe:case t3e:case r3e:case n3e:case i3e:return!0;default:return!1}}function OP(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function l0t(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function u0t(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function h0t(t){if(L$(t))return t;if(Array.isArray(t)||WK(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 d0t(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 h3e="​",p0t={curveBasis:RS,curveBasisClosed:$dt,curveBasisOpen:Ndt,curveBumpX:q4e,curveBumpY:G4e,curveBundle:Ddt,curveCardinalClosed:Odt,curveCardinalOpen:Pdt,curveCardinal:X4e,curveCatmullRomClosed:Bdt,curveCatmullRomOpen:Fdt,curveCatmullRom:Z4e,curveLinear:TC,curveLinearClosed:zdt,curveMonotoneX:nwe,curveMonotoneY:iwe,curveNatural:swe,curveStep:owe,curveStepAfter:cwe,curveStepBefore:lwe},g0t=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,m0t=w(function(t,e){const r=d3e(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);g9(s),n=ja(n,[...s])}else n=r.args;if(!n)return;let i=sK(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),d3e=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${g0t.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),he.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=xC.exec(t))!==null;)if(a.index===xC.lastIndex&&xC.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 he.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),y0t=w(function(t){return t.replace(xC,"")},"removeDirectives"),v0t=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function qK(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return p0t[r]??e}w(qK,"interpolateToCurve");function f3e(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Ay.sanitizeUrl(r):r}w(f3e,"formatUrl");var b0t=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=GK(i,e),e=i});const n=r/2;return UK(t,n)}w(p3e,"traverseEdge");function g3e(t){return t.length===1?t[0]:p3e(t)}w(g3e,"calcLabelPosition");var Woe=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),UK=w((t,e)=>{let r,n=e;for(const i of t){if(r){const a=GK(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:Woe((1-s)*r.x+s*i.x,5),y:Woe((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),x0t=w((t,e,r)=>{he.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=UK(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 m3e(t,e,r){const n=structuredClone(r);he.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=UK(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}w(m3e,"calcTerminalLabelPosition");function YK(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}}w(YK,"getStylesFromArray");var qoe=0,y3e=w(()=>(qoe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+qoe),"generateId");function v3e(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iv3e(t.length),"random"),w0t=w(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"),T0t=w(function(t,e){const r=e.text.replace(Ft.lineBreakRegex," "),[,n]=c0(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"),CC=pE((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Ft.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=dl(`${s} `,r),u=dl(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=k0t(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}`),k0t=pE((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(dl(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 G9(t,e){return I$(t,e).height}w(G9,"calculateTextHeight");function dl(t,e){return I$(t,e).width}w(dl,"calculateTextWidth");var I$=pE((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=c0(r),s=["sans-serif",n],o=t.split(Ft.lineBreakRegex),l=[],u=bt("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=w0t();y.text=m||h3e;const v=T0t(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.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}`),qb,C0t=(qb=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(qb,"InitIDGenerator"),qb),K7,S0t=w(function(t){return K7=K7||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),K7.innerHTML=t,unescape(K7.textContent)},"entityDecode");function jK(t){return"str"in t}w(jK,"isDetailedError");var E0t=w((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"),c0=w(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 Gi(t,e){return f0t({},t,e)}w(Gi,"cleanAndMerge");var Vr={assignWithDepth:ja,wrapLabel:CC,calculateTextHeight:G9,calculateTextWidth:dl,calculateTextDimensions:I$,cleanAndMerge:Gi,detectInit:m0t,detectDirective:d3e,isSubstringInArray:v0t,interpolateToCurve:qK,calcLabelPosition:g3e,calcCardinalityPosition:x0t,calcTerminalLabelPosition:m3e,formatUrl:f3e,getStylesFromArray:YK,generateId:y3e,random:b3e,runFunc:b0t,entityDecode:S0t,insertTitle:E0t,isLabelCoordinateInPath:x3e,parseFontSize:c0,InitIDGenerator:C0t},A0t=w(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"),Wf=w(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),ob=w((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Ls(t){return t??null}w(Ls,"handleUndefinedAttr");function x3e(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())}w(x3e,"isLabelCoordinateInPath");var M3=w(({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 XK(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=We().fontSize?We().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=xn.fontSize]=c0(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}w(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}w(XK,"configureLabelImages");const R0t=Object.freeze({left:0,top:0,width:16,height:16}),U9=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w3e=Object.freeze({...R0t,...U9}),_0t=Object.freeze({...w3e,body:"",hidden:!1}),M0t=Object.freeze({width:null,height:null}),L0t=Object.freeze({...M0t,...U9}),I0t=(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 PP(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 PP(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return PP(o,r)?o:null}return null},PP=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function $0t(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 Goe(t,e){const r=$0t(t,e);for(const n in _0t)n in U9?n in t&&!(n in r)&&(r[n]=U9[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function N0t(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 Uoe(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=Goe(n[o]||i[o],a)}return s(e),r.forEach(s),Goe(t,a)}function D0t(t,e){if(t.icons[e])return Uoe(t,e,[]);const r=N0t(t,[e])[e];return r?Uoe(t,e,r):null}const O0t=/(-?[0-9.]*[0-9]+[0-9.]*)/g,P0t=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Yoe(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(O0t);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=P0t.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 B0t(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 F0t(t,e){return t?""+t+""+e:e}function z0t(t,e,r){const n=B0t(t);return F0t(n.defs,e+n.content+r)}const H0t=t=>t==="unset"||t==="undefined"||t==="none";function V0t(t,e){const r={...w3e,...t},n={...L0t,...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,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let T;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:T=i.height/2+i.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}b%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),y.length&&(a=z0t(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=Yoe(d,l/u)):(h=s==="auto"?l:s,d=o===null?Yoe(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{H0t(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 W0t=/\sid="(\S+)"/g,joe=new Map;function q0t(t){t=t.replace(/[0-9]+$/,"")||"a";const e=joe.get(t)||0;return joe.set(t,e+1),e?`${t}${e}`:t}function G0t(t){const e=[];let r;for(;r=W0t.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=q0t(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 U0t(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 T3e={body:'?',height:80,width:80},mW=new Map,k3e=new Map,KK=w(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(he.debug("Registering icon pack:",e.name),"loader"in e)k3e.set(e.name,e.loader);else if("icons"in e)mW.set(e.name,e.icons);else throw he.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),C3e=w(async(t,e)=>{const r=I0t(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=mW.get(n);if(!i){const s=k3e.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},mW.set(n,i)}catch(o){throw he.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=D0t(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),Y0t=w(async t=>{try{return await C3e(t),!0}catch{return!1}},"isIconAvailable"),qf=w(async(t,e,r)=>{let n;try{n=await C3e(t,e==null?void 0:e.fallbackPrefix)}catch(s){he.error(s),n=T3e}const i=V0t(n,e),a=U0t(G0t(i.body),{...i.attributes,...r});return Tn(a,pr())},"getIconSVG");function ZK(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ry=ZK();function S3e(t){Ry=t}var SC={exec:()=>null};function jn(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(sl.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var j0t=(()=>{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")},X0t=/^(?:[ \t]*(?:\n|$))+/,K0t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Z0t=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Q0t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,QK=/(?:[*+-]|\d{1,9}[.)])/,E3e=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,A3e=jn(E3e).replace(/bull/g,QK).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(),J0t=jn(E3e).replace(/bull/g,QK).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(),JK=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ept=/^[^\n]+/,eZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tpt=jn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",eZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rpt=jn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,QK).getRegex(),$$="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",tZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,npt=jn("^ {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",tZ).replace("tag",$$).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R3e=jn(JK).replace("hr",gE).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",$$).getRegex(),ipt=jn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",R3e).getRegex(),rZ={blockquote:ipt,code:K0t,def:tpt,fences:Z0t,heading:Q0t,hr:gE,html:npt,lheading:A3e,list:rpt,newline:X0t,paragraph:R3e,table:SC,text:ept},Xoe=jn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gE).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",$$).getRegex(),apt={...rZ,lheading:J0t,table:Xoe,paragraph:jn(JK).replace("hr",gE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xoe).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",$$).getRegex()},spt={...rZ,html:jn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",tZ).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:SC,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jn(JK).replace("hr",gE).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",A3e).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},opt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lpt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_3e=/^( {2,}|\\)\n(?!\s*$)/,cpt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",j0t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),I3e=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ppt=jn(I3e,"u").replace(/punct/g,N$).getRegex(),gpt=jn(I3e,"u").replace(/punct/g,L3e).getRegex(),$3e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mpt=jn($3e,"gu").replace(/notPunctSpace/g,M3e).replace(/punctSpace/g,nZ).replace(/punct/g,N$).getRegex(),ypt=jn($3e,"gu").replace(/notPunctSpace/g,dpt).replace(/punctSpace/g,hpt).replace(/punct/g,L3e).getRegex(),vpt=jn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,M3e).replace(/punctSpace/g,nZ).replace(/punct/g,N$).getRegex(),bpt=jn(/\\(punct)/,"gu").replace(/punct/g,N$).getRegex(),xpt=jn(/^<(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(),wpt=jn(tZ).replace("(?:-->|$)","-->").getRegex(),Tpt=jn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",wpt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Y9=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,kpt=jn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Y9).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N3e=jn(/^!?\[(label)\]\[(ref)\]/).replace("label",Y9).replace("ref",eZ).getRegex(),D3e=jn(/^!?\[(ref)\](?:\[\])?/).replace("ref",eZ).getRegex(),Cpt=jn("reflink|nolink(?!\\()","g").replace("reflink",N3e).replace("nolink",D3e).getRegex(),Koe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,iZ={_backpedal:SC,anyPunctuation:bpt,autolink:xpt,blockSkip:fpt,br:_3e,code:lpt,del:SC,emStrongLDelim:ppt,emStrongRDelimAst:mpt,emStrongRDelimUnd:vpt,escape:opt,link:kpt,nolink:D3e,punctuation:upt,reflink:N3e,reflinkSearch:Cpt,tag:Tpt,text:cpt,url:SC},Spt={...iZ,link:jn(/^!?\[(label)\]\((.*?)\)/).replace("label",Y9).getRegex(),reflink:jn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y9).getRegex()},yW={...iZ,emStrongRDelimAst:ypt,emStrongLDelim:gpt,url:jn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Koe).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:jn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Zoe=t=>Apt[t];function xh(t,e){if(e){if(sl.escapeTest.test(t))return t.replace(sl.escapeReplace,Zoe)}else if(sl.escapeTestNoEncode.test(t))return t.replace(sl.escapeReplaceNoEncode,Zoe);return t}function Qoe(t){try{t=encodeURI(t).replace(sl.percentDecode,"%")}catch{return null}return t}function Joe(t,e){var a;let r=t.replace(sl.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(sl.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 ele(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 _pt(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +*/var Xft=w(t=>{const{handDrawnSeed:e}=We();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),_3=w(t=>{const e=Kft([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Kft=w(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"),FK=w(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"),ar=w(t=>{const{stylesArray:e}=_3(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];FK(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"),cr=w((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=We(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=_3(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:Zft(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),Zft=w(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"),K7={},is={},zoe;function Qft(){return zoe||(zoe=1,Object.defineProperty(is,"__esModule",{value:!0}),is.BLANK_URL=is.relativeFirstCharacters=is.whitespaceEscapeCharsRegex=is.urlSchemeRegex=is.ctrlCharactersRegex=is.htmlCtrlEntityRegex=is.htmlEntitiesRegex=is.invalidProtocolRegex=void 0,is.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,is.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,is.htmlCtrlEntityRegex=/&(newline|tab);/gi,is.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,is.urlSchemeRegex=/^.+(:|:)/gim,is.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,is.relativeFirstCharacters=[".","/"],is.BLANK_URL="about:blank"),is}var Hoe;function Jft(){if(Hoe)return K7;Hoe=1,Object.defineProperty(K7,"__esModule",{value:!0}),K7.sanitizeUrl=a;var t=Qft();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 K7}var Ay=Jft();function e0t(t){return Array.isArray(t)}function PP(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 t0t(){}function UTe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function pE(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const YTe="[object RegExp]",zK="[object String]",HK="[object Number]",VK="[object Boolean]",WK="[object Arguments]",jTe="[object Symbol]",XTe="[object Date]",KTe="[object Map]",ZTe="[object Set]",QTe="[object Array]",JTe="[object ArrayBuffer]",e3e="[object Object]",t3e="[object DataView]",r3e="[object Uint8Array]",n3e="[object Uint8ClampedArray]",i3e="[object Uint16Array]",a3e="[object Uint32Array]",s3e="[object Int8Array]",o3e="[object Int16Array]",l3e="[object Int32Array]",c3e="[object Float32Array]",u3e="[object Float64Array]",Voe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function qK(t){return typeof Voe.Buffer<"u"&&Voe.Buffer.isBuffer(t)}function r0t(t){return Number.isSafeInteger(t)&&t>=0}function h3e(t){return t!=null&&typeof t!="function"&&r0t(t.length)}function n0t(t){return t==="__proto__"}function $$(t){return t==null||typeof t!="object"&&typeof t!="function"}function GK(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function i0t(t,e){return P2(t,void 0,t,new Map,e)}function P2(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($$(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(pE(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Su(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case HK:case zK:case VK:{const s=new t.constructor(t==null?void 0:t.valueOf());return Su(s,t),s}case WK:{const s={};return Su(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function Woe(t){return s0t(t)}function mW(t){return t!==null&&typeof t=="object"&&pE(t)==="[object Arguments]"}function yW(t){return typeof t=="object"&&t!==null}function o0t(t){return yW(t)&&h3e(t)}function kC(t){return GK(t)}function l0t(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function gE(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(gE.Cache||Map),r}gE.Cache=Map;function c0t(t){if($$(t))return t;const e=pE(t);if(!u0t(t))return{};if(e0t(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(kC(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]"?d0t(i,t):BP(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 BP(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return f0t(r,t),BP(r,t),h0t(r,t),r}function u0t(t){switch(pE(t)){case WK:case QTe:case JTe:case t3e:case VK:case XTe:case c3e:case u3e:case s3e:case o3e:case l3e:case KTe:case HK:case e3e:case YTe:case ZTe:case zK:case jTe:case r3e:case n3e:case i3e:case a3e:return!0;default:return!1}}function BP(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function h0t(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function f0t(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function p0t(t){if($$(t))return t;if(Array.isArray(t)||GK(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 g0t(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 d3e="​",y0t={curveBasis:RS,curveBasisClosed:Odt,curveBasisOpen:Pdt,curveBumpX:G4e,curveBumpY:U4e,curveBundle:Bdt,curveCardinalClosed:Fdt,curveCardinalOpen:zdt,curveCardinal:K4e,curveCatmullRomClosed:Hdt,curveCatmullRomOpen:Vdt,curveCatmullRom:Q4e,curveLinear:TC,curveLinearClosed:Wdt,curveMonotoneX:iwe,curveMonotoneY:awe,curveNatural:owe,curveStep:lwe,curveStepAfter:uwe,curveStepBefore:cwe},v0t=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,b0t=w(function(t,e){const r=f3e(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);m9(s),n=ja(n,[...s])}else n=r.args;if(!n)return;let i=lK(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),f3e=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${v0t.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),he.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=xC.exec(t))!==null;)if(a.index===xC.lastIndex&&xC.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 he.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),x0t=w(function(t){return t.replace(xC,"")},"removeDirectives"),w0t=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function UK(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return y0t[r]??e}w(UK,"interpolateToCurve");function p3e(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?Ay.sanitizeUrl(r):r}w(p3e,"formatUrl");var T0t=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=YK(i,e),e=i});const n=r/2;return jK(t,n)}w(g3e,"traverseEdge");function m3e(t){return t.length===1?t[0]:g3e(t)}w(m3e,"calcLabelPosition");var Goe=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),jK=w((t,e)=>{let r,n=e;for(const i of t){if(r){const a=YK(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:Goe((1-s)*r.x+s*i.x,5),y:Goe((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),k0t=w((t,e,r)=>{he.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=jK(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 y3e(t,e,r){const n=structuredClone(r);he.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=jK(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}w(y3e,"calcTerminalLabelPosition");function XK(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}}w(XK,"getStylesFromArray");var Uoe=0,v3e=w(()=>(Uoe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Uoe),"generateId");function b3e(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ib3e(t.length),"random"),C0t=w(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"),S0t=w(function(t,e){const r=e.text.replace(Ft.lineBreakRegex," "),[,n]=c0(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"),CC=gE((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Ft.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=dl(`${s} `,r),u=dl(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=E0t(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}`),E0t=gE((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(dl(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 U9(t,e){return N$(t,e).height}w(U9,"calculateTextHeight");function dl(t,e){return N$(t,e).width}w(dl,"calculateTextWidth");var N$=gE((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=c0(r),s=["sans-serif",n],o=t.split(Ft.lineBreakRegex),l=[],u=bt("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=C0t();y.text=m||d3e;const v=S0t(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),x=(v._groups||v)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),p=Math.round(x.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}`),qb,A0t=(qb=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(qb,"InitIDGenerator"),qb),Z7,R0t=w(function(t){return Z7=Z7||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Z7.innerHTML=t,unescape(Z7.textContent)},"entityDecode");function KK(t){return"str"in t}w(KK,"isDetailedError");var _0t=w((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"),c0=w(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 Gi(t,e){return m0t({},t,e)}w(Gi,"cleanAndMerge");var Vr={assignWithDepth:ja,wrapLabel:CC,calculateTextHeight:U9,calculateTextWidth:dl,calculateTextDimensions:N$,cleanAndMerge:Gi,detectInit:b0t,detectDirective:f3e,isSubstringInArray:w0t,interpolateToCurve:UK,calcLabelPosition:m3e,calcCardinalityPosition:k0t,calcTerminalLabelPosition:y3e,formatUrl:p3e,getStylesFromArray:XK,generateId:v3e,random:x3e,runFunc:T0t,entityDecode:R0t,insertTitle:_0t,isLabelCoordinateInPath:w3e,parseFontSize:c0,InitIDGenerator:A0t},M0t=w(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"),Wf=w(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),ob=w((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Ls(t){return t??null}w(Ls,"handleUndefinedAttr");function w3e(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())}w(w3e,"isLabelCoordinateInPath");var M3=w(({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 ZK(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=We().fontSize?We().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=xn.fontSize]=c0(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}w(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}w(ZK,"configureLabelImages");const L0t=Object.freeze({left:0,top:0,width:16,height:16}),Y9=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),T3e=Object.freeze({...L0t,...Y9}),I0t=Object.freeze({...T3e,body:"",hidden:!1}),$0t=Object.freeze({width:null,height:null}),N0t=Object.freeze({...$0t,...Y9}),D0t=(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 FP(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 FP(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return FP(o,r)?o:null}return null},FP=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function O0t(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 Yoe(t,e){const r=O0t(t,e);for(const n in I0t)n in Y9?n in t&&!(n in r)&&(r[n]=Y9[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function P0t(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 joe(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=Yoe(n[o]||i[o],a)}return s(e),r.forEach(s),Yoe(t,a)}function B0t(t,e){if(t.icons[e])return joe(t,e,[]);const r=P0t(t,[e])[e];return r?joe(t,e,r):null}const F0t=/(-?[0-9.]*[0-9]+[0-9.]*)/g,z0t=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Xoe(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(F0t);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=z0t.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 H0t(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 V0t(t,e){return t?""+t+""+e:e}function W0t(t,e,r){const n=H0t(t);return V0t(n.defs,e+n.content+r)}const q0t=t=>t==="unset"||t==="undefined"||t==="none";function G0t(t,e){const r={...T3e,...t},n={...N0t,...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,x=m.vFlip;let b=m.rotate;v?x?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):x&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let T;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:T=i.height/2+i.top,y.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:T=i.width/2+i.left,y.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}b%2===1&&(i.left!==i.top&&(T=i.left,i.left=i.top,i.top=T),i.width!==i.height&&(T=i.width,i.width=i.height,i.height=T)),y.length&&(a=W0t(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=Xoe(d,l/u)):(h=s==="auto"?l:s,d=o===null?Xoe(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{q0t(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 U0t=/\sid="(\S+)"/g,Koe=new Map;function Y0t(t){t=t.replace(/[0-9]+$/,"")||"a";const e=Koe.get(t)||0;return Koe.set(t,e+1),e?`${t}${e}`:t}function j0t(t){const e=[];let r;for(;r=U0t.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=Y0t(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 X0t(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 k3e={body:'?',height:80,width:80},vW=new Map,C3e=new Map,QK=w(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(he.debug("Registering icon pack:",e.name),"loader"in e)C3e.set(e.name,e.loader);else if("icons"in e)vW.set(e.name,e.icons);else throw he.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),S3e=w(async(t,e)=>{const r=D0t(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=vW.get(n);if(!i){const s=C3e.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},vW.set(n,i)}catch(o){throw he.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=B0t(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),K0t=w(async t=>{try{return await S3e(t),!0}catch{return!1}},"isIconAvailable"),qf=w(async(t,e,r)=>{let n;try{n=await S3e(t,e==null?void 0:e.fallbackPrefix)}catch(s){he.error(s),n=k3e}const i=G0t(n,e),a=X0t(j0t(i.body),{...i.attributes,...r});return Tn(a,pr())},"getIconSVG");function JK(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ry=JK();function E3e(t){Ry=t}var SC={exec:()=>null};function jn(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(sl.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var Z0t=(()=>{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")},Q0t=/^(?:[ \t]*(?:\n|$))+/,J0t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ept=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tpt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,eZ=/(?:[*+-]|\d{1,9}[.)])/,A3e=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,R3e=jn(A3e).replace(/bull/g,eZ).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(),rpt=jn(A3e).replace(/bull/g,eZ).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(),tZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,npt=/^[^\n]+/,rZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ipt=jn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),apt=jn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,eZ).getRegex(),D$="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",nZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,spt=jn("^ {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",nZ).replace("tag",D$).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_3e=jn(tZ).replace("hr",mE).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",D$).getRegex(),opt=jn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_3e).getRegex(),iZ={blockquote:opt,code:J0t,def:ipt,fences:ept,heading:tpt,hr:mE,html:spt,lheading:R3e,list:apt,newline:Q0t,paragraph:_3e,table:SC,text:npt},Zoe=jn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mE).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",D$).getRegex(),lpt={...iZ,lheading:rpt,table:Zoe,paragraph:jn(tZ).replace("hr",mE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zoe).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",D$).getRegex()},cpt={...iZ,html:jn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nZ).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:SC,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jn(tZ).replace("hr",mE).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",R3e).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},upt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hpt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,M3e=/^( {2,}|\\)\n(?!\s*$)/,dpt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Z0t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$3e=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ypt=jn($3e,"u").replace(/punct/g,O$).getRegex(),vpt=jn($3e,"u").replace(/punct/g,I3e).getRegex(),N3e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bpt=jn(N3e,"gu").replace(/notPunctSpace/g,L3e).replace(/punctSpace/g,aZ).replace(/punct/g,O$).getRegex(),xpt=jn(N3e,"gu").replace(/notPunctSpace/g,gpt).replace(/punctSpace/g,ppt).replace(/punct/g,I3e).getRegex(),wpt=jn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,L3e).replace(/punctSpace/g,aZ).replace(/punct/g,O$).getRegex(),Tpt=jn(/\\(punct)/,"gu").replace(/punct/g,O$).getRegex(),kpt=jn(/^<(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(),Cpt=jn(nZ).replace("(?:-->|$)","-->").getRegex(),Spt=jn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Cpt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),j9=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ept=jn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",j9).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),D3e=jn(/^!?\[(label)\]\[(ref)\]/).replace("label",j9).replace("ref",rZ).getRegex(),O3e=jn(/^!?\[(ref)\](?:\[\])?/).replace("ref",rZ).getRegex(),Apt=jn("reflink|nolink(?!\\()","g").replace("reflink",D3e).replace("nolink",O3e).getRegex(),Qoe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sZ={_backpedal:SC,anyPunctuation:Tpt,autolink:kpt,blockSkip:mpt,br:M3e,code:hpt,del:SC,emStrongLDelim:ypt,emStrongRDelimAst:bpt,emStrongRDelimUnd:wpt,escape:upt,link:Ept,nolink:O3e,punctuation:fpt,reflink:D3e,reflinkSearch:Apt,tag:Spt,text:dpt,url:SC},Rpt={...sZ,link:jn(/^!?\[(label)\]\((.*?)\)/).replace("label",j9).getRegex(),reflink:jn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j9).getRegex()},bW={...sZ,emStrongRDelimAst:xpt,emStrongLDelim:vpt,url:jn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qoe).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:jn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Joe=t=>Mpt[t];function xh(t,e){if(e){if(sl.escapeTest.test(t))return t.replace(sl.escapeReplace,Joe)}else if(sl.escapeTestNoEncode.test(t))return t.replace(sl.escapeReplaceNoEncode,Joe);return t}function ele(t){try{t=encodeURI(t).replace(sl.percentDecode,"%")}catch{return null}return t}function tle(t,e){var a;let r=t.replace(sl.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(sl.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 rle(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 Ipt(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 j9=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||Ry}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:Ck(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=_pt(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=Ck(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:Ck(r[0],` +`)}var X9=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||Ry}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:Ck(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Ipt(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=Ck(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:Ck(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Ck(r[0],` `).split(` `),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u=m||!p.trim())d+=` `+E.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||k.test(f)||b.test(f))break;d+=` `+p}!g&&!p.trim()&&(g=!0),h+=C+` -`,e=e.substring(C.length+1),f=E.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let 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=Ck(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Rpt(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)),ele(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 ele(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}}}},$u=class vW{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"tokenizer");Ut(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ry,this.options.tokenizer=this.options.tokenizer||new j9,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:sl,block:Z7.normal,inline:kk.normal};this.options.pedantic?(r.block=Z7.pedantic,r.inline=kk.pedantic):this.options.gfm&&(r.block=Z7.gfm,this.options.breaks?r.inline=kk.breaks:r.inline=kk.gfm),this.tokenizer.rules=r}static get rules(){return{block:Z7,inline:kk}}static lex(e,r){return new vW(r).lex(e)}static lexInline(e,r){return new vW(r).inlineTokens(e)}lex(e){e=e.replace(sl.carriageReturn,` +`,e=e.substring(C.length+1),f=E.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let 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=Ck(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Lpt(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)),rle(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 rle(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}}}},$u=class xW{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"tokenizer");Ut(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ry,this.options.tokenizer=this.options.tokenizer||new X9,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:sl,block:Q7.normal,inline:kk.normal};this.options.pedantic?(r.block=Q7.pedantic,r.inline=kk.pedantic):this.options.gfm&&(r.block=Q7.gfm,this.options.breaks?r.inline=kk.breaks:r.inline=kk.gfm),this.tokenizer.rules=r}static get rules(){return{block:Q7,inline:kk}}static lex(e,r){return new xW(r).lex(e)}static lexInline(e,r){return new xW(r).inlineTokens(e)}lex(e){e=e.replace(sl.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(` `)?"":` @@ -424,7 +424,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},X9=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||Ry}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(sl.notSpaceStart))==null?void 0:s[0],a=e.replace(sl.endingNewline,"")+` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},K9=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||Ry}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(sl.notSpaceStart))==null?void 0:s[0],a=e.replace(sl.endingNewline,"")+` `;return i?'
'+(n?a:xh(a,!0))+`
`:"
"+(n?a:xh(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -442,28 +442,28 @@ ${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`${xh(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=Qoe(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=Qoe(e);if(a===null)return xh(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 X9(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 j9(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 T5;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];T5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&T5.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 $u.lex(e,r??this.defaults)}parser(e,r){return Nu.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?$u.lex:$u.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?Nu.parse:Nu.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?$u.lex:$u.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?Nu.parse:Nu.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:

"+xh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},j1=new Mpt;function ni(t,e){return j1.parse(t,e)}ni.options=ni.setOptions=function(t){return j1.setOptions(t),ni.defaults=j1.defaults,S3e(ni.defaults),ni};ni.getDefaults=ZK;ni.defaults=Ry;ni.use=function(...t){return j1.use(...t),ni.defaults=j1.defaults,S3e(ni.defaults),ni};ni.walkTokens=function(t,e){return j1.walkTokens(t,e)};ni.parseInline=j1.parseInline;ni.Parser=Nu;ni.parser=Nu.parse;ni.Renderer=X9;ni.TextRenderer=aZ;ni.Lexer=$u;ni.lexer=$u.lex;ni.Tokenizer=j9;ni.Hooks=T5;ni.parse=ni;ni.options;ni.setOptions;ni.use;ni.walkTokens;ni.parseInline;Nu.parse;$u.lex;function O3e(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${xh(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=ele(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=ele(e);if(a===null)return xh(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 K9(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 X9(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 T5;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];T5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&T5.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 $u.lex(e,r??this.defaults)}parser(e,r){return Nu.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?$u.lex:$u.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?Nu.parse:Nu.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?$u.lex:$u.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?Nu.parse:Nu.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:

"+xh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},j1=new $pt;function ni(t,e){return j1.parse(t,e)}ni.options=ni.setOptions=function(t){return j1.setOptions(t),ni.defaults=j1.defaults,E3e(ni.defaults),ni};ni.getDefaults=JK;ni.defaults=Ry;ni.use=function(...t){return j1.use(...t),ni.defaults=j1.defaults,E3e(ni.defaults),ni};ni.walkTokens=function(t,e){return j1.walkTokens(t,e)};ni.parseInline=j1.parseInline;ni.Parser=Nu;ni.parser=Nu.parse;ni.Renderer=K9;ni.TextRenderer=oZ;ni.Lexer=$u;ni.lexer=$u.lex;ni.Tokenizer=X9;ni.Hooks=T5;ni.parse=ni;ni.options;ni.setOptions;ni.use;ni.walkTokens;ni.parseInline;Nu.parse;$u.lex;function P3e(t){for(var e=[],r=1;r/g,` +`)),s+=d+n[l+1]}),s}function B3e(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return O3e(n)}w(P3e,"preprocessMarkdown");function B3e(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"})))??[]})}w(B3e,"nonMarkdownToLines");function F3e(t,e={}){const r=P3e(t,e),n=ni.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 w(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}w(F3e,"markdownToLines");function z3e(t){return t?`

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

`:""}w(z3e,"nonMarkdownToHTML");function H3e(t,{markdownAutoWrap:e}={}){const r=ni.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:(he.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(H3e,"markdownToHTML");function V3e(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(V3e,"splitTextToChars");function W3e(t,e){const r=V3e(e.content);return sZ(t,[],r,e.type)}w(W3e,"splitWordToFitWidth");function sZ(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}])?sZ(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(sZ,"splitWordToFitWidthRecursion");function q3e(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return K9(t,e)}w(q3e,"splitLineToFitWidth");function K9(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 K9(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=W3e(e,a);r.push([o]),l.content&&t.unshift(l)}return K9(t,e,r)}w(K9,"splitLineToFitWidthRecursion");function xW(t,e){e&&t.attr("style",e)}w(xW,"applyStyle");var tle=16384;async function G3e(t,e,r,n,i=!1,a=pr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,tle)}px`),s.attr("height",`${Math.min(10*r,tle)}px`);const o=s.append("xhtml:div"),l=Ha(e.label)?await v$(e.label.replace(Ft.lineBreakRegex,` -`),a):Tn(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),xW(h,e.labelStyle),h.attr("class",`${u} ${n}`),xW(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()}w(G3e,"addHtmlSpan");function D$(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}w(D$,"createTspan");function U3e(t,e,r){const n=t.append("text"),i=D$(n,1,e);O$(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}w(U3e,"computeWidthOfText");function Y3e(t,e,r){var s;const n=t.append("text"),i=D$(n,1,e);O$(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}w(Y3e,"computeDimensionOfText");function j3e(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=w(p=>U3e(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:q3e(h,d);for(const p of f){const g=D$(l,u,1.1,i);O$(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()}w(j3e,"createFormattedText");function wW(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}})}w(wW,"decodeHTMLEntities");function O$(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(wW(r.content)):i.text(" "+wW(r.content))})}w(O$,"updateTextContentAndStyles");async function X3e(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await Y0t(o)?await qf(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(X3e,"replaceIconSubstring");var Fo=w(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(he.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?H3e(e,h):z3e(e),f=await X3e(Wf(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ha(e)?p:f,labelStyle:r.replace("fill:","color:")};return await G3e(t,g,l,i,u,h)}else{const d=Wf(e.replace(//g,"
")),f=s?F3e(d.replace("
","
"),h):B3e(d),p=j3e(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:");bt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");bt(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:");bt(p).select("text").attr("style",m)}return n?bt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):bt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function BP(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 Lpt(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ipt(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)BP(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];Lpt(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 x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const T=m[x].edge,k=m[b].edge;p.push([[Math.round(T.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)BP(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),BP(f,h,d)})(l,o,-i)}return l}function mE(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),Ipt(t,i,n,a||1)}class oZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=mE(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 P$(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))}let $pt=class extends oZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=mE(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)P$([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 Npt extends oZ{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 Dpt=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=mE(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=P$(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=P$(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=P$(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 Z3e(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,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,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,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,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)&&(Q3e(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function Sk(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Q3e(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]=Sk(t,e,-h),[r,n]=Sk(r,n,-h);const N=(t-r)/2,_=(e-n)/2;let I=N*N/(i*i)+_*_/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const O=i*i,D=a*a,$=O*D-O*_*_-D*N*N,F=O*_*_+D*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs($/F));m=z*i*_/a+(t+r)/2,y=z*-a*N/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 N=g,_=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=Q3e(r=m+i*Math.cos(g),n=y+a*Math.sin(g),_,I,i,a,s,0,l,[g,N,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),T=Math.cos(g),k=Math.sin(g),S=Math.tan(v/4),C=4/3*i*S,E=4/3*a*S,A=[t,e],M=[t+C*b,e-E*x],L=[r+C*k,n-E*T],P=[r,n];if(M[0]=2*A[0]-M[0],M[1]=2*A[1]-M[1],u)return[M,L,P].concat(f);{f=[M,L,P].concat(f);const N=[];for(let _=0;_2){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=lle(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=lle(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return s&&(o?v.push(...Vp(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Vp(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 ale(t,e){const r=Z3e(K3e(lZ(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(...Vp(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(...Vpt(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Vp(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function HP(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]+jr(i,e),n[0][1]+jr(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*tke(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=jr(p,i,u),g=jr(g,i,u);const m=[],y=()=>jr(d,i,u),v=()=>jr(h,i,u),x=i.preserveVertices;return s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:jr(h,i,u)),e+(x?0:jr(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+(x?0:y()),n+(x?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+(x?0:v()),n+(x?0:v())]}),m}function J7(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+jr(e,r),t[0][1]+jr(e,r)]),n.push([t[0][0]+jr(e,r),t[0][1]+jr(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=cm(l,u,.5),p=cm(u,h,.5),g=cm(h,d,.5),m=cm(f,p,.5),y=cm(p,g,.5),v=cm(m,y,.5);CW([l,f,m,v],0,r,i),CW([v,y,g,d],0,r,i)}var a,s;return i}function qpt(t,e){return J9(t,0,t.length,e)}function J9(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?(J9(t,e,u+1,n,a),J9(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function VP(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?J9(n,0,n.length,r):n}const oc="none";let eM=class{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",[J3e(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=Hpt(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(HP([u],s)):o.push(wv([u],s))}return s.stroke!==oc&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=eke(n,i,s),u=TW(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=TW(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(wv([u.estimatedPoints],s));return s.stroke!==oc&&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",[nR(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=ile(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=ile(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,x){const b=f,T=p;let k=Math.abs(g/2),S=Math.abs(m/2);k+=jr(.01*k,x),S+=jr(.01*S,x);let C=y,E=v;for(;C<0;)C+=2*Math.PI,E+=2*Math.PI;E-C>2*Math.PI&&(C=0,E=2*Math.PI);const A=(E-C)/x.curveStepCount,M=[];for(let L=C;L<=E;L+=A)M.push([b+k*Math.cos(L),T+S*Math.sin(L)]);return M.push([b+k*Math.cos(E),T+S*Math.sin(E)]),M.push([b,T]),wv([M],x)})(e,r,n,i,a,s,u));return u.stroke!==oc&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=nle(e,n);if(n.fill&&n.fill!==oc)if(n.fillStyle==="solid"){const s=nle(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(...VP(cle([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...VP(cle(u),10,(1+n.roughness)/2))}s.length&&i.push(wv([s],n))}return n.stroke!==oc&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=nR(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(HP([e],n)):i.push(wv([e],n))),n.stroke!==oc&&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!==oc,s=n.stroke!==oc,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Z3e(K3e(lZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...VP(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:k,data:S}of p)switch(k){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const T=[];for(const k of g){const S=qpt(k,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=ale(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=ale(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(HP(l,n));else i.push(wv(l,n));return s&&(o?l.forEach((h=>{i.push(nR(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:oc};break;case"fillPath":s={d:this.opsToPath(a),stroke:oc,strokeWidth:0,fill:n.fill||oc};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||oc,strokeWidth:n,fill:oc}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class Gpt{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new eM(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 eA="http://www.w3.org/2000/svg";class Upt{constructor(e,r){this.svg=e,this.gen=new eM(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(eA,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(eA,"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(eA,"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(eA,"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 lr={canvas:(t,e)=>new Gpt(t,e),svg:(t,e)=>new Upt(t,e),generator:t=>new eM(t),newSeed:()=>eM.newSeed()},Ur=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||pd((p=We())==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",Ls(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 Fo(s,Tn(Wf(o),We()),{useHtmlLabels:i,width:e.width||((g=We().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},We());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=bt(h);await XK(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"),WP=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??ti(We()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Fo(i,Tn(Wf(e),We()),{useHtmlLabels:n,width:r.width||((u=(l=We())==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(ti(We())){const h=a.children[0],d=bt(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"),gr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Br=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function _n(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(_n,"createPathFromPoints");function Wp(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}w(Wp,"generateFullSineWavePoints");function $S(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=w((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}w(SW,"mergePaths");var Ypt=w((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"),_y=Ypt,jpt=w(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=We(),o=ti(s);return await Fo(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),fp=jpt,pg=w((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"),Xpt=w(async(t,e)=>{const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ar(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=pd(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Fo(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],_=bt(y);v=N.getBoundingClientRect(),_.attr("width",v.width),_.attr("height",v.height)}const x=e.padding??0,b=e.width<=v.width+x?v.width+x:e.width;e.width<=v.width+x?e.diff=(b-e.width)/2-x:e.diff=-x;const T=e.height,k=e.y-T/2,S=e.y+T/2,C=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:k+T/3,A=g?4:0,M=v.height+2*A;let L,P;if(g){const N=Math.max(M,v.height+2*A),_=C+N,I=Math.max(0,b-N);if(e.look==="handDrawn"){const $=lr.svg(f),F=cr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=cr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=$.rectangle(C,k,N,T,F);L=f.insert(()=>H,":first-child");const B=$.rectangle(_,k,I,T,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",C).attr("y",k).attr("width",N).attr("height",T).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",_).attr("y",k).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const O=C+N/2,D=e.y;m.attr("transform",`translate(${O}, ${D}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-k),_=Math.min(M,N),I=k+_,O=Math.max(0,S-I),D=e.x-b/2;if(e.look==="handDrawn"){const z=lr.svg(f),H=cr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=cr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=z.rectangle(D,k,b,_,H);L=f.insert(()=>V,":first-child");const q=z.rectangle(D,I,b,O,B);P=f.insert(()=>q,":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",D).attr("y",k).attr("width",b).attr("height",_).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",D).attr("y",I).attr("width",b).attr("height",O).attr("fill","none").attr("stroke",o);const $=e.x-v.width/2,F=k+(_-v.height)/2;m.attr("transform",`translate(${$}, ${F})`)}if(he.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=b,e.height=T,e.offsetY=v.height-x/2,e.intersect=function(N){return _y(e,N)},{cluster:f,labelBBox:v}},"swimlane"),rke=w(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ar(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ti(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Fo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await fp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(ti(r)){const C=g.children[0],E=bt(g);m=C.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,x=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const C=lr.svg(d),E=cr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),A=C.path(pg(x,b,y,v,0),E);T=d.insert(()=>(he.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=M3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return _y(e,C)},{cluster:d,labelBBox:m}},"rect"),Kpt=w((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 _y(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Zpt=w(async(t,e)=>{const r=We(),{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 fp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(ti(r)){const A=p.children[0],M=bt(p);g=A.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 x=e.height+m,b=e.height+m-g.height-6,T=e.x-v/2,k=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),M=lr.svg(u),L=e.rx||e.ry?M.path(pg(T,k,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(T,k,v,x,{seed:i});C=u.insert(()=>L,":first-child");const P=M.rectangle(T,S,v,b,{fill:A?a:s,fillStyle:A?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>L,":first-child"),f=u.insert(()=>P)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",T).attr("y",k).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(ti(r)?0:3)})`);const E=C.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return _y(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),Qpt=w(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ar(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ti(r),p=d.insert("g").attr("class","cluster-label "),g=await Fo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(ti(r)){const C=g.children[0],E=bt(g);m=C.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,x=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const C=lr.svg(d),E=cr(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),A=C.path(pg(x,b,y,v,e.rx),E);T=d.insert(()=>(he.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=M3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return _y(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),Jpt=w((t,e)=>{const r=We(),{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=lr.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 _y(e,m)},{cluster:s,labelBBox:{}}},"divider"),egt=rke,tgt={rect:rke,squareRect:egt,roundedWithTitle:Zpt,noteGroup:Kpt,divider:Jpt,kanbanSection:Qpt,swimlane:Xpt},nke=new Map,B$=w(async(t,e)=>{const r=e.shape||"rect",n=await tgt[r](t,e);return nke.set(e.id,n),n},"insertCluster"),ike=w(()=>{nke=new Map},"clear");function ake(t,e){return t.intersect(e)}w(ake,"intersectNode");var rgt=ake;function ske(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}w(EW,"sameSign");var igt=cke;function uke(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",Ls(o)),gr(e,d),e.intersect=function(f){return he.info("Circle intersect",e,s,f),nr.circle(e,s,f)},a}w(hke,"anchor");function AW(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),x=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/a,(t-v)/i);let k=Math.atan2((n-x)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const S=[];for(let C=0;C<20;C++){const E=C/19,A=b+E*k,M=v+i*Math.cos(A),L=x+a*Math.sin(A);S.push({x:M,y:L})}return S}w(AW,"generateArcPoints");function dke(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(dke,"calculateArcSagitta");async function fke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=w(A=>A+s,"calcTotalHeight"),l=w(A=>{const M=A/2;return[M/(2.5+A/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Ur(t,e,Br(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=dke(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...AW(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...AW(y/2,v/2,y/2,-v/2,f,p,!0)],T=lr.svg(u),k=cr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=_n(b),C=T.path(S,k),E=u.insert(()=>C,":first-child");return E.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),gr(e,E),e.intersect=function(A){return nr.polygon(e,b,A)},u}w(fke,"bowTieRect");function u0(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+")")}w(u0,"insertPolygonShape");var tA=12;async function pke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+tA),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+tA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+tA},{x:d+tA,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=lr.svg(o),b=cr(e,{}),T=_n(m),k=x.path(T,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=u0(o,u,h,m);return n&&y.attr("style",n),gr(e,y),e.intersect=function(x){return nr.polygon(e,m,x)},o}w(pke,"card");function gke(t,e){const{nodeStyles:r}=ar(e);e.label="";const n=t.insert("g").attr("class",Br(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=lr.svg(n),l=cr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=_n(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 nr.polygon(e,s,f)},n}w(gke,"choice");async function cZ(t,e,r){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Ur(t,e,Br(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=lr.svg(a),g=cr(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ls(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 gr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return nr.circle(p,m,g)},e.intersect=function(p){return he.info("Circle intersect",e,h,p),nr.circle(e,h,p)},a}w(cZ,"circle");function mke(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}`}w(mke,"createLine");function yke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Br(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=lr.svg(i),l=cr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=mke(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),gr(e,f),e.intersect=function(p){return he.info("crossedCircle intersect",e,{radius:a,point:p}),nr.circle(e,a,p)},i}w(yke,"crossedCircle");function Jd(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;dk,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,g,C)},i}w(vke,"curlyBraceLeft");function ef(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;dk,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,g,C)},i}w(bke,"curlyBraceRight");function Ys(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;dA,":first-child").attr("stroke-opacity",0),M.insert(()=>T,":first-child"),M.insert(()=>C,":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))})`),gr(e,M),e.intersect=function(L){return nr.polygon(e,m,L)},i}w(xke,"curlyBraces");async function wke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(u),y=cr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,T=x/4,k=[{x:b,y:0},{x:T,y:0},{x:0,y:x/2},{x:T,y:x},{x:b,y:x},...$S(-b,-x/2,p,50,270,90)],S=_n(k),C=m.path(S,y),E=u.insert(()=>C,":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})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,k,A)},u}w(wke,"curvedTrapezoid");var sgt=w((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"),ogt=w((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"),lgt=w((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ule=8,hle=8;async function Tke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.widthk,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=sgt(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ls(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),gr(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=nr.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(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}w(Tke,"cylinder");async function L3(t,e,r){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Ur(t,e,Br(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=lr.svg(a),y=cr(e,{}),v=f||p?m.path(pg(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",Ls(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Ls(f)).attr("ry",Ls(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return gr(e,d),e.calcIntersect=function(m,y){return nr.rect(m,y)},e.intersect=function(m){return nr.rect(e,m)},a}w(L3,"drawRect");async function kke(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 L3(t,e,l);if(e.look==="handDrawn"){const p=lr.svg(u),g=cr(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}w(kke,"datastore");async function Cke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=lr.svg(s),y=cr(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}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=s.insert(()=>x,":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))})`),gr(e,b),e.intersect=function(T){return nr.rect(e,T)},s}w(Cke,"dividedRectangle");async function Ske(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),y=cr(e,{roughness:.2,strokeWidth:2.5}),v=cr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Ls(e.cssClasses)).attr("style",Ls(f)),(p=d.node())==null||p.appendChild(x),(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 gr(e,d),e.intersect=function(m){return he.info("DoubleCircle intersect",e,u,m),nr.circle(e,u,m)},o}w(Ske,"doublecircle");function Eke(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ar(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",Br(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=lr.svg(a),{nodeBorder:u}=r,h=cr(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),gr(e,f),e.intersect=function(p){return he.info("filledCircle intersect",e,{radius:s,point:p}),nr.circle(e,s,p)},a}w(Eke,"filledCircle");var dle=10,fle=10;async function Ake(t,e){const{labelStyles:r,nodeStyles:n}=ar(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"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,gr(e,x),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 he.info("Triangle intersect",e,f,b),nr.polygon(e,f,b)},s}w(Ake,"flippedTriangle");function Rke(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=ar(e);e.label="";const s=t.insert("g").attr("class",Br(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=lr.svg(s),p=cr(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),gr(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 nr.rect(e,v)},s}w(Rke,"forkJoin");async function _ke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.heightx,":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),gr(e,b),e.intersect=function(T){return he.info("Pill intersect",e,{radius:f,point:T}),nr.polygon(e,y,T)},l}w(_ke,"halfRoundedRectangle");var cgt=w((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 Mke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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 x=lr.svg(h),b=cr(e,{}),T=cgt(0,0,g,f,p),k=x.path(T,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=u0(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,gr(e,y),e.intersect=function(x){return nr.polygon(e,m,x)},h}w(Mke,"hexagon");async function Lke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Ur(t,e,Br(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=lr.svg(i),u=cr(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=_n(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})`),gr(e,p),e.intersect=function(g){return he.info("Pill intersect",e,{points:h}),nr.polygon(e,h,g)},i}w(Lke,"hourglass");async function Ike(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=_3(e),v=-g/2,x=-p/2,b=e.label?8:0,T=lr.svg(u),k=cr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=T.rectangle(v,x,g,p,k),C=Math.max(g,h.width),E=p+h.height+b,A=T.rectangle(-C/2,-E/2,C,E,{...k,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),L=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),_=N.width,I=N.height,O=N.x,D=N.y;P.attr("transform",`translate(${-_/2-O},${f?h.height/2+b/2-I/2-D:-h.height/2-b/2-I/2-D})`),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})`),gr(e,L),e.intersect=function(P){if(he.info("iconSquare intersect",e,P),!e.label)return nr.rect(e,P);const N=e.x??0,_=e.y??0,I=e.height??0;let O=[];return f?O=[{x:N-h.width/2,y:_-I/2},{x:N+h.width/2,y:_-I/2},{x:N+h.width/2,y:_-I/2+h.height+b},{x:N+g/2,y:_-I/2+h.height+b},{x:N+g/2,y:_+I/2},{x:N-g/2,y:_+I/2},{x:N-g/2,y:_-I/2+h.height+b},{x:N-h.width/2,y:_-I/2+h.height+b}]:O=[{x:N-g/2,y:_-I/2},{x:N+g/2,y:_-I/2},{x:N+g/2,y:_-I/2+p},{x:N+h.width/2,y:_-I/2+p},{x:N+h.width/2/2,y:_+I/2},{x:N-h.width/2,y:_+I/2},{x:N-h.width/2,y:_-I/2+p},{x:N-g/2,y:_-I/2+p}],nr.polygon(e,O,P)},u}w(Ike,"icon");async function $ke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=_3(e),x=lr.svg(u),b=cr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=v.get("fill");b.stroke=T??y;const k=u.append("g");e.icon&&k.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=k.node().getBBox(),C=S.width,E=S.height,A=S.x,M=S.y,L=Math.max(C,E)*Math.SQRT2+f*2,P=x.circle(0,0,L,b),N=Math.max(L,h.width),_=L+h.height+p,I=x.rectangle(-N/2,-_/2,N,_,{...b,fill:"transparent",stroke:"none"}),O=u.insert(()=>P,":first-child"),D=u.insert(()=>I);return k.attr("transform",`translate(${-C/2-A},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),gr(e,D),e.intersect=function($){return he.info("iconSquare intersect",e,$),nr.rect(e,$)},u}w($ke,"iconCircle");async function Nke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=_3(e),b=-m/2,T=-g/2,k=e.label?8:0,S=lr.svg(u),C=cr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=x.get("fill");C.stroke=E??v;const A=S.path(pg(b,T,m,g,5),C),M=Math.max(m,h.width),L=g+h.height+k,P=S.rectangle(-M/2,-L/2,M,L,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),_=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),D=O.width,$=O.height,F=O.x,z=O.y;I.attr("transform",`translate(${-D/2-F},${p?h.height/2+k/2-$/2-z:-h.height/2-k/2-$/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),gr(e,_),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return nr.rect(e,I);const O=e.x??0,D=e.y??0,$=e.height??0;let F=[];return p?F=[{x:O-h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2+h.height+k},{x:O+m/2,y:D-$/2+h.height+k},{x:O+m/2,y:D+$/2},{x:O-m/2,y:D+$/2},{x:O-m/2,y:D-$/2+h.height+k},{x:O-h.width/2,y:D-$/2+h.height+k}]:F=[{x:O-m/2,y:D-$/2},{x:O+m/2,y:D-$/2},{x:O+m/2,y:D-$/2+g},{x:O+h.width/2,y:D-$/2+g},{x:O+h.width/2/2,y:D+$/2},{x:O-h.width/2,y:D+$/2},{x:O-h.width/2,y:D-$/2+g},{x:O-m/2,y:D-$/2+g}],nr.polygon(e,F,I)},u}w(Nke,"iconRounded");async function Dke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=_3(e),b=-m/2,T=-g/2,k=e.label?8:0,S=lr.svg(u),C=cr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=x.get("fill");C.stroke=E??v;const A=S.path(pg(b,T,m,g,.1),C),M=Math.max(m,h.width),L=g+h.height+k,P=S.rectangle(-M/2,-L/2,M,L,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),_=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),D=O.width,$=O.height,F=O.x,z=O.y;I.attr("transform",`translate(${-D/2-F},${p?h.height/2+k/2-$/2-z:-h.height/2-k/2-$/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),gr(e,_),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return nr.rect(e,I);const O=e.x??0,D=e.y??0,$=e.height??0;let F=[];return p?F=[{x:O-h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2+h.height+k},{x:O+m/2,y:D-$/2+h.height+k},{x:O+m/2,y:D+$/2},{x:O-m/2,y:D+$/2},{x:O-m/2,y:D-$/2+h.height+k},{x:O-h.width/2,y:D-$/2+h.height+k}]:F=[{x:O-m/2,y:D-$/2},{x:O+m/2,y:D-$/2},{x:O+m/2,y:D-$/2+g},{x:O+h.width/2,y:D-$/2+g},{x:O+h.width/2/2,y:D+$/2},{x:O-h.width/2,y:D+$/2},{x:O-h.width/2,y:D-$/2+g},{x:O-m/2,y:D-$/2+g}],nr.polygon(e,F,I)},u}w(Dke,"iconSquare");async function Oke(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}=ar(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 Ur(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=lr.svg(d),b=cr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=x.rectangle(m,y,u,h,b),k=Math.max(u,f.width),S=h+f.height+v,C=x.rectangle(-k/2,-S/2,k,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>C);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})`),gr(e,A),e.intersect=function(M){if(he.info("iconSquare intersect",e,M),!e.label)return nr.rect(e,M);const L=e.x??0,P=e.y??0,N=e.height??0;let _=[];return g?_=[{x:L-f.width/2,y:P-N/2},{x:L+f.width/2,y:P-N/2},{x:L+f.width/2,y:P-N/2+f.height+v},{x:L+u/2,y:P-N/2+f.height+v},{x:L+u/2,y:P+N/2},{x:L-u/2,y:P+N/2},{x:L-u/2,y:P-N/2+f.height+v},{x:L-f.width/2,y:P-N/2+f.height+v}]:_=[{x:L-u/2,y:P-N/2},{x:L+u/2,y:P-N/2},{x:L+u/2,y:P-N/2+h},{x:L+f.width/2,y:P-N/2+h},{x:L+f.width/2/2,y:P+N/2},{x:L-f.width/2,y:P+N/2},{x:L-f.width/2,y:P-N/2+h},{x:L-u/2,y:P-N/2+h}],nr.polygon(e,_,M)},d}w(Oke,"imageSquare");async function Pke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(Pke,"inv_trapezoid");async function Bke(t,e){const{shapeSvg:r,bbox:n,label:i}=await Ur(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))})`),gr(e,a),e.intersect=function(l){return nr.rect(e,l)},r}w(Bke,"labelRect");async function Fke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(Fke,"lean_left");async function zke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(zke,"lean_right");function Hke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Br(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=lr.svg(i),d=cr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=_n(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})`),gr(e,g),e.intersect=function(m){return he.info("lightningBolt intersect",e,m),nr.polygon(e,u,m)},i}w(Hke,"lightningBolt");var ugt=w((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"),hgt=w((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"),dgt=w((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ple=10,gle=10;async function Vke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=ugt(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",Ls(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),gr(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 x=nr.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},o}w(Vke,"linedCylinder");async function Wke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 T=e.width;e.width=(T??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 Ur(t,e,Br(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=lr.svg(o),y=cr(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},...Wp(-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}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=o.insert(()=>x,":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))})`),gr(e,b),e.intersect=function(T){return nr.polygon(e,v,T)},o}w(Wke,"linedWaveEdgedRect");async function qke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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,x=lr.svg(l),b=cr(e,{}),T=[{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}],k=[{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=_n(T);let C=x.path(S,b);const E=_n(k);let A=x.path(E,b);e.look!=="handDrawn"&&(C=SW(C),A=SW(A));const M=l.insert("g",":first-child");return M.insert(()=>C),M.insert(()=>A),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))})`),gr(e,M),e.intersect=function(L){return nr.polygon(e,T,L)},l}w(qke,"multiRect");async function Gke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ur(t,e,Br(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:x}=e,b=Wp(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y:T.y-2*v},{x:m+d+v,y:T.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:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y},{x:m,y}],C=lr.svg(i),E=cr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=_n(k),M=C.path(A,E),L=_n(S),P=C.path(L,E),N=i.insert(()=>M,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.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))})`),gr(e,N),e.intersect=function(_){return nr.polygon(e,k,_)},i}w(Gke,"multiWaveEdgedRectangle");async function Uke(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n,e.useHtmlLabels||ti(pr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Ur(t,e,Br(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=lr.svg(s),m=cr(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))})`),gr(e,v),e.intersect=function(x){return nr.rect(e,x)},s}w(Uke,"note");var fgt=w((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 Yke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ur(t,e,Br(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=lr.svg(i),g=cr(e,{}),m=fgt(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=u0(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),gr(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=nr.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(Yke,"question");async function jke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),x=cr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=_n(m),T=v.path(b,x),k=o.insert(()=>T,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.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))})`),gr(e,k),e.intersect=function(S){return nr.polygon(e,m,S)},o}w(jke,"rect_left_inv_arrow");async function Xke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 fp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(ti(We())){const E=h.children[0],A=bt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}he.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await fp(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=bt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;bt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),bt(h).attr("transform","translate( "+(d.width(he.debug("Rough node insert CXC",M),L),":first-child"),S=a.insert(()=>(he.debug("Rough node insert CXC",M),M),":first-child")}else S=s.insert("rect",":first-child"),C=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)),C.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 gr(e,S),e.intersect=function(E){return nr.rect(e,E)},a}w(Xke,"rectWithTitle");async function Kke(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 L3(t,e,i)}w(Kke,"roundedRect");var qg=8;async function Zke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?qg:qg*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-qg,f=h,p=qg-u/2,g=-h/2,{cssStyles:m}=e,y=lr.svg(s),v=cr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-qg,y:g+f},{x:p-qg,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(k=>[k.x,k.y]),v),T=s.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path").attr("style",Ls(m)),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${qg/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),gr(e,T),e.intersect=function(k){return nr.rect(e,k)},s}w(Zke,"shadedProcess");async function Qke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),x=cr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.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}],T=_n(b),k=v.path(T,x),S=o.insert(()=>k,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,b,C)},o}w(Qke,"slopedRect");async function Jke(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 L3(t,e,a)}w(Jke,"squareRect");async function e5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),g=cr(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},...$S(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...$S(h/2-d,0,d,50,270,450)],y=_n(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),gr(e,x),e.intersect=function(b){return nr.polygon(e,m,b)},o}w(e5e,"stadium");async function t5e(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return L3(t,e,r)}w(t5e,"state");function r5e(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=ar(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=lr.svg(h),f=cr(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 T=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",k=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return gr(e,v),e.intersect=function(T){return nr.circle(e,(e.width??0)/2,T)},h}w(r5e,"stateEnd");function n5e(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=lr.svg(a).circle(0,0,e.width,Uft(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 gr(e,s),e.intersect=function(u){return nr.circle(e,(e.width??7)/2,u)},a}w(n5e,"stateStart");var Tv=8;async function i5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??l.width)+2*Tv+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Tv,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=lr.svg(o),v=cr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Tv,g,p+Tv,g+f,v),T=y.line(p+Tv+d,g,p+Tv+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>T,":first-child");const k=o.insert(()=>x,":first-child"),{cssStyles:S}=e;k.attr("class","basic label-container").attr("style",Ls(S)),gr(e,k)}else{const y=u0(o,d,f,m);n&&y.attr("style",n),gr(e,y)}return e.intersect=function(y){return nr.polygon(e,m,y)},o}w(i5e,"subroutine");var qP=.2;async function a5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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-qP*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Ur(t,e,Br(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=qP*u,d=qP*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,x=lr.svg(o),b=cr(e,{}),T=[{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}],k=[{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=_n(T),C=x.path(S,b),E=_n(k),A=x.path(E,{...b,fillStyle:"solid"}),M=o.insert(()=>A,":first-child");return M.insert(()=>C,":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),gr(e,M),e.intersect=function(L){return nr.polygon(e,T,L)},o}w(a5e,"taggedRect");async function s5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ur(t,e,Br(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=lr.svg(i),m=cr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Wp(-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,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...Wp(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],T=_n(y),k=g.path(T,m),S=_n(b),C=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>C,":first-child");return E.insert(()=>k,":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))})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,y,A)},i}w(s5e,"taggedWaveEdgedRectangle");async function o5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ur(t,e,Br(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),gr(e,h),e.intersect=function(d){return nr.rect(e,d)},i}w(o5e,"text");var pgt=w((t,e,r,n,i,a)=>`M${t},${e} +`);return P3e(n)}w(B3e,"preprocessMarkdown");function F3e(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"})))??[]})}w(F3e,"nonMarkdownToLines");function z3e(t,e={}){const r=B3e(t,e),n=ni.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 w(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}w(z3e,"markdownToLines");function H3e(t){return t?`

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

`:""}w(H3e,"nonMarkdownToHTML");function V3e(t,{markdownAutoWrap:e}={}){const r=ni.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:(he.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(V3e,"markdownToHTML");function W3e(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(W3e,"splitTextToChars");function q3e(t,e){const r=W3e(e.content);return lZ(t,[],r,e.type)}w(q3e,"splitWordToFitWidth");function lZ(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}])?lZ(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(lZ,"splitWordToFitWidthRecursion");function G3e(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Z9(t,e)}w(G3e,"splitLineToFitWidth");function Z9(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 Z9(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=q3e(e,a);r.push([o]),l.content&&t.unshift(l)}return Z9(t,e,r)}w(Z9,"splitLineToFitWidthRecursion");function TW(t,e){e&&t.attr("style",e)}w(TW,"applyStyle");var nle=16384;async function U3e(t,e,r,n,i=!1,a=pr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,nle)}px`),s.attr("height",`${Math.min(10*r,nle)}px`);const o=s.append("xhtml:div"),l=Ha(e.label)?await x$(e.label.replace(Ft.lineBreakRegex,` +`),a):Tn(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),TW(h,e.labelStyle),h.attr("class",`${u} ${n}`),TW(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()}w(U3e,"addHtmlSpan");function P$(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}w(P$,"createTspan");function Y3e(t,e,r){const n=t.append("text"),i=P$(n,1,e);B$(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}w(Y3e,"computeWidthOfText");function j3e(t,e,r){var s;const n=t.append("text"),i=P$(n,1,e);B$(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}w(j3e,"computeDimensionOfText");function X3e(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=w(p=>Y3e(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:G3e(h,d);for(const p of f){const g=P$(l,u,1.1,i);B$(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()}w(X3e,"createFormattedText");function kW(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}})}w(kW,"decodeHTMLEntities");function B$(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(kW(r.content)):i.text(" "+kW(r.content))})}w(B$,"updateTextContentAndStyles");async function K3e(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await K0t(o)?await qf(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(K3e,"replaceIconSubstring");var Fo=w(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(he.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?V3e(e,h):H3e(e),f=await K3e(Wf(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Ha(e)?p:f,labelStyle:r.replace("fill:","color:")};return await U3e(t,g,l,i,u,h)}else{const d=Wf(e.replace(//g,"
")),f=s?z3e(d.replace("
","
"),h):F3e(d),p=X3e(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:");bt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");bt(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:");bt(p).select("text").attr("style",m)}return n?bt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):bt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function zP(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 Npt(t,e){return t[0]===e[0]&&t[1]===e[1]}function Dpt(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)zP(u,o,i);const l=(function(u,h,d){const f=[];for(const x of u){const b=[...x];Npt(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 x of f)for(let b=0;bx.yminb.ymin?1:x.xb.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let x=-1;for(let b=0;by);b++)x=b;g.splice(0,x+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((x=>!(x.edge.ymax<=y))),m.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let x=0;x=m.length)break;const T=m[x].edge,k=m[b].edge;p.push([[Math.round(T.x),y],[Math.round(k.x),y]])}y+=d,m.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)zP(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),zP(f,h,d)})(l,o,-i)}return l}function yE(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),Dpt(t,i,n,a||1)}class cZ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=yE(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 F$(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))}let Opt=class extends cZ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=yE(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)F$([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 Ppt extends cZ{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 Bpt=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=yE(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=F$(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=F$(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=F$(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 Q3e(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,x=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,x,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,x=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,x,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)&&(J3e(n,i,y,v,d,f,p,g,m).forEach((function(x){e.push({key:"C",data:x})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function Sk(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function J3e(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]=Sk(t,e,-h),[r,n]=Sk(r,n,-h);const N=(t-r)/2,_=(e-n)/2;let I=N*N/(i*i)+_*_/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const O=i*i,D=a*a,$=O*D-O*_*_-D*N*N,F=O*_*_+D*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs($/F));m=z*i*_/a+(t+r)/2,y=z*-a*N/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 N=g,_=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=J3e(r=m+i*Math.cos(g),n=y+a*Math.sin(g),_,I,i,a,s,0,l,[g,N,m,y])}v=g-p;const x=Math.cos(p),b=Math.sin(p),T=Math.cos(g),k=Math.sin(g),S=Math.tan(v/4),C=4/3*i*S,E=4/3*a*S,A=[t,e],M=[t+C*b,e-E*x],L=[r+C*k,n-E*T],P=[r,n];if(M[0]=2*A[0]-M[0],M[1]=2*A[1]-M[1],u)return[M,L,P].concat(f);{f=[M,L,P].concat(f);const N=[];for(let _=0;_2){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=ule(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const x=ule(y,u,h,d,f,p,g,1.5,l);v.push(...x)}return s&&(o?v.push(...Vp(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Vp(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 ole(t,e){const r=Q3e(Z3e(uZ(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(...Vp(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(...Gpt(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Vp(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function WP(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]+jr(i,e),n[0][1]+jr(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*rke(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=jr(p,i,u),g=jr(g,i,u);const m=[],y=()=>jr(d,i,u),v=()=>jr(h,i,u),x=i.preserveVertices;return s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:jr(h,i,u)),e+(x?0:jr(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+(x?0:y()),n+(x?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+(x?0:v()),n+(x?0:v())]}),m}function eA(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+jr(e,r),t[0][1]+jr(e,r)]),n.push([t[0][0]+jr(e,r),t[0][1]+jr(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=cm(l,u,.5),p=cm(u,h,.5),g=cm(h,d,.5),m=cm(f,p,.5),y=cm(p,g,.5),v=cm(m,y,.5);EW([l,f,m,v],0,r,i),EW([v,y,g,d],0,r,i)}var a,s;return i}function Ypt(t,e){return eM(t,0,t.length,e)}function eM(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?(eM(t,e,u+1,n,a),eM(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function qP(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?eM(n,0,n.length,r):n}const sc="none";let tM=class{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",[eke(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=qpt(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(WP([u],s)):o.push(wv([u],s))}return s.stroke!==sc&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=tke(n,i,s),u=CW(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=CW(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(wv([u.estimatedPoints],s));return s.stroke!==sc&&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",[iR(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=sle(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=sle(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,x){const b=f,T=p;let k=Math.abs(g/2),S=Math.abs(m/2);k+=jr(.01*k,x),S+=jr(.01*S,x);let C=y,E=v;for(;C<0;)C+=2*Math.PI,E+=2*Math.PI;E-C>2*Math.PI&&(C=0,E=2*Math.PI);const A=(E-C)/x.curveStepCount,M=[];for(let L=C;L<=E;L+=A)M.push([b+k*Math.cos(L),T+S*Math.sin(L)]);return M.push([b+k*Math.cos(E),T+S*Math.sin(E)]),M.push([b,T]),wv([M],x)})(e,r,n,i,a,s,u));return u.stroke!==sc&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=ale(e,n);if(n.fill&&n.fill!==sc)if(n.fillStyle==="solid"){const s=ale(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(...qP(hle([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...qP(hle(u),10,(1+n.roughness)/2))}s.length&&i.push(wv([s],n))}return n.stroke!==sc&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=iR(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(WP([e],n)):i.push(wv([e],n))),n.stroke!==sc&&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!==sc,s=n.stroke!==sc,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=Q3e(Z3e(uZ(h))),g=[];let m=[],y=[0,0],v=[];const x=()=>{v.length>=4&&m.push(...qP(v,d)),v=[]},b=()=>{x(),m.length&&(g.push(m),m=[])};for(const{key:k,data:S}of p)switch(k){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":x(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const C=m.length?m[m.length-1]:y;v.push([C[0],C[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":x(),m.push([y[0],y[1]])}if(b(),!f)return g;const T=[];for(const k of g){const S=Ypt(k,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=ole(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=ole(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(WP(l,n));else i.push(wv(l,n));return s&&(o?l.forEach((h=>{i.push(iR(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:sc};break;case"fillPath":s={d:this.opsToPath(a),stroke:sc,strokeWidth:0,fill:n.fill||sc};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||sc,strokeWidth:n,fill:sc}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class jpt{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new tM(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 tA="http://www.w3.org/2000/svg";class Xpt{constructor(e,r){this.svg=e,this.gen=new tM(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(tA,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(tA,"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(tA,"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(tA,"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 lr={canvas:(t,e)=>new jpt(t,e),svg:(t,e)=>new Xpt(t,e),generator:t=>new tM(t),newSeed:()=>tM.newSeed()},Ur=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||gd((p=We())==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",Ls(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 Fo(s,Tn(Wf(o),We()),{useHtmlLabels:i,width:e.width||((g=We().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},We());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=bt(h);await ZK(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"),GP=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??ti(We()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Fo(i,Tn(Wf(e),We()),{useHtmlLabels:n,width:r.width||((u=(l=We())==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(ti(We())){const h=a.children[0],d=bt(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"),gr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Br=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function _n(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(_n,"createPathFromPoints");function Wp(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}w(Wp,"generateFullSineWavePoints");function $S(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=w((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}w(AW,"mergePaths");var Kpt=w((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"),_y=Kpt,Zpt=w(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=We(),o=ti(s);return await Fo(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),fp=Zpt,pg=w((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"),Qpt=w(async(t,e)=>{const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ar(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=gd(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Fo(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],_=bt(y);v=N.getBoundingClientRect(),_.attr("width",v.width),_.attr("height",v.height)}const x=e.padding??0,b=e.width<=v.width+x?v.width+x:e.width;e.width<=v.width+x?e.diff=(b-e.width)/2-x:e.diff=-x;const T=e.height,k=e.y-T/2,S=e.y+T/2,C=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:k+T/3,A=g?4:0,M=v.height+2*A;let L,P;if(g){const N=Math.max(M,v.height+2*A),_=C+N,I=Math.max(0,b-N);if(e.look==="handDrawn"){const $=lr.svg(f),F=cr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=cr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=$.rectangle(C,k,N,T,F);L=f.insert(()=>H,":first-child");const B=$.rectangle(_,k,I,T,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",C).attr("y",k).attr("width",N).attr("height",T).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",_).attr("y",k).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const O=C+N/2,D=e.y;m.attr("transform",`translate(${O}, ${D}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-k),_=Math.min(M,N),I=k+_,O=Math.max(0,S-I),D=e.x-b/2;if(e.look==="handDrawn"){const z=lr.svg(f),H=cr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=cr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=z.rectangle(D,k,b,_,H);L=f.insert(()=>V,":first-child");const q=z.rectangle(D,I,b,O,B);P=f.insert(()=>q,":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",D).attr("y",k).attr("width",b).attr("height",_).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",D).attr("y",I).attr("width",b).attr("height",O).attr("fill","none").attr("stroke",o);const $=e.x-v.width/2,F=k+(_-v.height)/2;m.attr("transform",`translate(${$}, ${F})`)}if(he.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=b,e.height=T,e.offsetY=v.height-x/2,e.intersect=function(N){return _y(e,N)},{cluster:f,labelBBox:v}},"swimlane"),nke=w(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ar(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ti(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await Fo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await fp(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(ti(r)){const C=g.children[0],E=bt(g);m=C.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,x=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const C=lr.svg(d),E=cr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),A=C.path(pg(x,b,y,v,0),E);T=d.insert(()=>(he.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=M3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return _y(e,C)},{cluster:d,labelBBox:m}},"rect"),Jpt=w((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 _y(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),egt=w(async(t,e)=>{const r=We(),{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 fp(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(ti(r)){const A=p.children[0],M=bt(p);g=A.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 x=e.height+m,b=e.height+m-g.height-6,T=e.x-v/2,k=e.y-x/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let C;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),M=lr.svg(u),L=e.rx||e.ry?M.path(pg(T,k,v,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(T,k,v,x,{seed:i});C=u.insert(()=>L,":first-child");const P=M.rectangle(T,S,v,b,{fill:A?a:s,fillStyle:A?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>L,":first-child"),f=u.insert(()=>P)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",T).attr("y",k).attr("width",v).attr("height",x).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${k+1-(ti(r)?0:3)})`);const E=C.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return _y(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),tgt=w(async(t,e)=>{he.info("Creating subgraph rect for ",e.id,e);const r=We(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ar(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=ti(r),p=d.insert("g").attr("class","cluster-label "),g=await Fo(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(ti(r)){const C=g.children[0],E=bt(g);m=C.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,x=e.x-y/2,b=e.y-v/2;he.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const C=lr.svg(d),E=cr(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),A=C.path(pg(x,b,y,v,e.rx),E);T=d.insert(()=>(he.debug("Rough node insert CXC",A),A),":first-child"),T.select("path:nth-child(2)").attr("style",u.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:k}=M3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+k})`),o){const C=p.select("span");C&&C.attr("style",o)}const S=T.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return _y(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),rgt=w((t,e)=>{const r=We(),{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=lr.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 _y(e,m)},{cluster:s,labelBBox:{}}},"divider"),ngt=nke,igt={rect:nke,squareRect:ngt,roundedWithTitle:egt,noteGroup:Jpt,divider:rgt,kanbanSection:tgt,swimlane:Qpt},ike=new Map,z$=w(async(t,e)=>{const r=e.shape||"rect",n=await igt[r](t,e);return ike.set(e.id,n),n},"insertCluster"),ake=w(()=>{ike=new Map},"clear");function ske(t,e){return t.intersect(e)}w(ske,"intersectNode");var agt=ske;function oke(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}w(RW,"sameSign");var ogt=uke;function hke(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",Ls(o)),gr(e,d),e.intersect=function(f){return he.info("Circle intersect",e,s,f),nr.circle(e,s,f)},a}w(dke,"anchor");function _W(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),x=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/a,(t-v)/i);let k=Math.atan2((n-x)/a,(r-v)/i)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);const S=[];for(let C=0;C<20;C++){const E=C/19,A=b+E*k,M=v+i*Math.cos(A),L=x+a*Math.sin(A);S.push({x:M,y:L})}return S}w(_W,"generateArcPoints");function fke(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(fke,"calculateArcSagitta");async function pke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=w(A=>A+s,"calcTotalHeight"),l=w(A=>{const M=A/2;return[M/(2.5+A/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Ur(t,e,Br(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=fke(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:x}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},..._W(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},..._W(y/2,v/2,y/2,-v/2,f,p,!0)],T=lr.svg(u),k=cr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=_n(b),C=T.path(S,k),E=u.insert(()=>C,":first-child");return E.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),gr(e,E),e.intersect=function(A){return nr.polygon(e,b,A)},u}w(pke,"bowTieRect");function u0(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+")")}w(u0,"insertPolygonShape");var rA=12;async function gke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+rA),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+rA,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+rA},{x:d+rA,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const x=lr.svg(o),b=cr(e,{}),T=_n(m),k=x.path(T,b);y=o.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=u0(o,u,h,m);return n&&y.attr("style",n),gr(e,y),e.intersect=function(x){return nr.polygon(e,m,x)},o}w(gke,"card");function mke(t,e){const{nodeStyles:r}=ar(e);e.label="";const n=t.insert("g").attr("class",Br(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=lr.svg(n),l=cr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=_n(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 nr.polygon(e,s,f)},n}w(mke,"choice");async function hZ(t,e,r){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Ur(t,e,Br(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=lr.svg(a),g=cr(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ls(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 gr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return nr.circle(p,m,g)},e.intersect=function(p){return he.info("Circle intersect",e,h,p),nr.circle(e,h,p)},a}w(hZ,"circle");function yke(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}`}w(yke,"createLine");function vke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Br(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=lr.svg(i),l=cr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=yke(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),gr(e,f),e.intersect=function(p){return he.info("crossedCircle intersect",e,{radius:a,point:p}),nr.circle(e,a,p)},i}w(vke,"crossedCircle");function ef(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;dk,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,g,C)},i}w(bke,"curlyBraceLeft");function tf(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;dk,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,g,C)},i}w(xke,"curlyBraceRight");function Ys(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;dA,":first-child").attr("stroke-opacity",0),M.insert(()=>T,":first-child"),M.insert(()=>C,":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))})`),gr(e,M),e.intersect=function(L){return nr.polygon(e,m,L)},i}w(wke,"curlyBraces");async function Tke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(u),y=cr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,x=f,b=v-p,T=x/4,k=[{x:b,y:0},{x:T,y:0},{x:0,y:x/2},{x:T,y:x},{x:b,y:x},...$S(-b,-x/2,p,50,270,90)],S=_n(k),C=m.path(S,y),E=u.insert(()=>C,":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})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,k,A)},u}w(Tke,"curvedTrapezoid");var cgt=w((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"),ugt=w((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"),hgt=w((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),dle=8,fle=8;async function kke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.widthk,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=cgt(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ls(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),gr(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=nr.rect(e,y),x=v.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-x*x/(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}w(kke,"cylinder");async function L3(t,e,r){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Ur(t,e,Br(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=lr.svg(a),y=cr(e,{}),v=f||p?m.path(pg(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",Ls(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Ls(f)).attr("ry",Ls(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return gr(e,d),e.calcIntersect=function(m,y){return nr.rect(m,y)},e.intersect=function(m){return nr.rect(e,m)},a}w(L3,"drawRect");async function Cke(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 L3(t,e,l);if(e.look==="handDrawn"){const p=lr.svg(u),g=cr(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}w(Cke,"datastore");async function Ske(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=lr.svg(s),y=cr(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}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=s.insert(()=>x,":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))})`),gr(e,b),e.intersect=function(T){return nr.rect(e,T)},s}w(Ske,"dividedRectangle");async function Eke(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),y=cr(e,{roughness:.2,strokeWidth:2.5}),v=cr(e,{roughness:.2,strokeWidth:1.5}),x=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Ls(e.cssClasses)).attr("style",Ls(f)),(p=d.node())==null||p.appendChild(x),(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 gr(e,d),e.intersect=function(m){return he.info("DoubleCircle intersect",e,u,m),nr.circle(e,u,m)},o}w(Eke,"doublecircle");function Ake(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ar(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",Br(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=lr.svg(a),{nodeBorder:u}=r,h=cr(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),gr(e,f),e.intersect=function(p){return he.info("filledCircle intersect",e,{radius:s,point:p}),nr.circle(e,s,p)},a}w(Ake,"filledCircle");var ple=10,gle=10;async function Rke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,gr(e,x),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 he.info("Triangle intersect",e,f,b),nr.polygon(e,f,b)},s}w(Rke,"flippedTriangle");function _ke(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=ar(e);e.label="";const s=t.insert("g").attr("class",Br(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=lr.svg(s),p=cr(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),gr(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 nr.rect(e,v)},s}w(_ke,"forkJoin");async function Mke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.heightx,":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),gr(e,b),e.intersect=function(T){return he.info("Pill intersect",e,{radius:f,point:T}),nr.polygon(e,y,T)},l}w(Mke,"halfRoundedRectangle");var dgt=w((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 Lke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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 x=lr.svg(h),b=cr(e,{}),T=dgt(0,0,g,f,p),k=x.path(T,b);y=h.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=u0(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,gr(e,y),e.intersect=function(x){return nr.polygon(e,m,x)},h}w(Lke,"hexagon");async function Ike(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Ur(t,e,Br(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=lr.svg(i),u=cr(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=_n(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})`),gr(e,p),e.intersect=function(g){return he.info("Pill intersect",e,{points:h}),nr.polygon(e,h,g)},i}w(Ike,"hourglass");async function $ke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=_3(e),v=-g/2,x=-p/2,b=e.label?8:0,T=lr.svg(u),k=cr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=T.rectangle(v,x,g,p,k),C=Math.max(g,h.width),E=p+h.height+b,A=T.rectangle(-C/2,-E/2,C,E,{...k,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),L=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),_=N.width,I=N.height,O=N.x,D=N.y;P.attr("transform",`translate(${-_/2-O},${f?h.height/2+b/2-I/2-D:-h.height/2-b/2-I/2-D})`),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})`),gr(e,L),e.intersect=function(P){if(he.info("iconSquare intersect",e,P),!e.label)return nr.rect(e,P);const N=e.x??0,_=e.y??0,I=e.height??0;let O=[];return f?O=[{x:N-h.width/2,y:_-I/2},{x:N+h.width/2,y:_-I/2},{x:N+h.width/2,y:_-I/2+h.height+b},{x:N+g/2,y:_-I/2+h.height+b},{x:N+g/2,y:_+I/2},{x:N-g/2,y:_+I/2},{x:N-g/2,y:_-I/2+h.height+b},{x:N-h.width/2,y:_-I/2+h.height+b}]:O=[{x:N-g/2,y:_-I/2},{x:N+g/2,y:_-I/2},{x:N+g/2,y:_-I/2+p},{x:N+h.width/2,y:_-I/2+p},{x:N+h.width/2/2,y:_+I/2},{x:N-h.width/2,y:_+I/2},{x:N-h.width/2,y:_-I/2+p},{x:N-g/2,y:_-I/2+p}],nr.polygon(e,O,P)},u}w($ke,"icon");async function Nke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=_3(e),x=lr.svg(u),b=cr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=v.get("fill");b.stroke=T??y;const k=u.append("g");e.icon&&k.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=k.node().getBBox(),C=S.width,E=S.height,A=S.x,M=S.y,L=Math.max(C,E)*Math.SQRT2+f*2,P=x.circle(0,0,L,b),N=Math.max(L,h.width),_=L+h.height+p,I=x.rectangle(-N/2,-_/2,N,_,{...b,fill:"transparent",stroke:"none"}),O=u.insert(()=>P,":first-child"),D=u.insert(()=>I);return k.attr("transform",`translate(${-C/2-A},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),k.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),gr(e,D),e.intersect=function($){return he.info("iconSquare intersect",e,$),nr.rect(e,$)},u}w(Nke,"iconCircle");async function Dke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=_3(e),b=-m/2,T=-g/2,k=e.label?8:0,S=lr.svg(u),C=cr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=x.get("fill");C.stroke=E??v;const A=S.path(pg(b,T,m,g,5),C),M=Math.max(m,h.width),L=g+h.height+k,P=S.rectangle(-M/2,-L/2,M,L,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),_=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),D=O.width,$=O.height,F=O.x,z=O.y;I.attr("transform",`translate(${-D/2-F},${p?h.height/2+k/2-$/2-z:-h.height/2-k/2-$/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),gr(e,_),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return nr.rect(e,I);const O=e.x??0,D=e.y??0,$=e.height??0;let F=[];return p?F=[{x:O-h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2+h.height+k},{x:O+m/2,y:D-$/2+h.height+k},{x:O+m/2,y:D+$/2},{x:O-m/2,y:D+$/2},{x:O-m/2,y:D-$/2+h.height+k},{x:O-h.width/2,y:D-$/2+h.height+k}]:F=[{x:O-m/2,y:D-$/2},{x:O+m/2,y:D-$/2},{x:O+m/2,y:D-$/2+g},{x:O+h.width/2,y:D-$/2+g},{x:O+h.width/2/2,y:D+$/2},{x:O-h.width/2,y:D+$/2},{x:O-h.width/2,y:D-$/2+g},{x:O-m/2,y:D-$/2+g}],nr.polygon(e,F,I)},u}w(Dke,"iconRounded");async function Oke(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ar(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 Ur(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=_3(e),b=-m/2,T=-g/2,k=e.label?8:0,S=lr.svg(u),C=cr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=x.get("fill");C.stroke=E??v;const A=S.path(pg(b,T,m,g,.1),C),M=Math.max(m,h.width),L=g+h.height+k,P=S.rectangle(-M/2,-L/2,M,L,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),_=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await qf(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const O=I.node().getBBox(),D=O.width,$=O.height,F=O.x,z=O.y;I.attr("transform",`translate(${-D/2-F},${p?h.height/2+k/2-$/2-z:-h.height/2-k/2-$/2-z})`),I.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+k/2:-h.height/2-k/2})`),gr(e,_),e.intersect=function(I){if(he.info("iconSquare intersect",e,I),!e.label)return nr.rect(e,I);const O=e.x??0,D=e.y??0,$=e.height??0;let F=[];return p?F=[{x:O-h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2},{x:O+h.width/2,y:D-$/2+h.height+k},{x:O+m/2,y:D-$/2+h.height+k},{x:O+m/2,y:D+$/2},{x:O-m/2,y:D+$/2},{x:O-m/2,y:D-$/2+h.height+k},{x:O-h.width/2,y:D-$/2+h.height+k}]:F=[{x:O-m/2,y:D-$/2},{x:O+m/2,y:D-$/2},{x:O+m/2,y:D-$/2+g},{x:O+h.width/2,y:D-$/2+g},{x:O+h.width/2/2,y:D+$/2},{x:O-h.width/2,y:D+$/2},{x:O-h.width/2,y:D-$/2+g},{x:O-m/2,y:D-$/2+g}],nr.polygon(e,F,I)},u}w(Oke,"iconSquare");async function Pke(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}=ar(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 Ur(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,x=lr.svg(d),b=cr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=x.rectangle(m,y,u,h,b),k=Math.max(u,f.width),S=h+f.height+v,C=x.rectangle(-k/2,-S/2,k,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>C);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})`),gr(e,A),e.intersect=function(M){if(he.info("iconSquare intersect",e,M),!e.label)return nr.rect(e,M);const L=e.x??0,P=e.y??0,N=e.height??0;let _=[];return g?_=[{x:L-f.width/2,y:P-N/2},{x:L+f.width/2,y:P-N/2},{x:L+f.width/2,y:P-N/2+f.height+v},{x:L+u/2,y:P-N/2+f.height+v},{x:L+u/2,y:P+N/2},{x:L-u/2,y:P+N/2},{x:L-u/2,y:P-N/2+f.height+v},{x:L-f.width/2,y:P-N/2+f.height+v}]:_=[{x:L-u/2,y:P-N/2},{x:L+u/2,y:P-N/2},{x:L+u/2,y:P-N/2+h},{x:L+f.width/2,y:P-N/2+h},{x:L+f.width/2/2,y:P+N/2},{x:L-f.width/2,y:P+N/2},{x:L-f.width/2,y:P-N/2+h},{x:L-u/2,y:P-N/2+h}],nr.polygon(e,_,M)},d}w(Pke,"imageSquare");async function Bke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(Bke,"inv_trapezoid");async function Fke(t,e){const{shapeSvg:r,bbox:n,label:i}=await Ur(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))})`),gr(e,a),e.intersect=function(l){return nr.rect(e,l)},r}w(Fke,"labelRect");async function zke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(zke,"lean_left");async function Hke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(Hke,"lean_right");function Vke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Br(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=lr.svg(i),d=cr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=_n(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})`),gr(e,g),e.intersect=function(m){return he.info("lightningBolt intersect",e,m),nr.polygon(e,u,m)},i}w(Vke,"lightningBolt");var fgt=w((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"),pgt=w((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"),ggt=w((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),mle=10,yle=10;async function Wke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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(()=>k,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=fgt(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",Ls(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),gr(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 x=nr.rect(e,v),b=x.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(x.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-b*b/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),x.y+=T}return x},o}w(Wke,"linedCylinder");async function qke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 T=e.width;e.width=(T??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 Ur(t,e,Br(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=lr.svg(o),y=cr(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},...Wp(-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}],x=m.polygon(v.map(T=>[T.x,T.y]),y),b=o.insert(()=>x,":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))})`),gr(e,b),e.intersect=function(T){return nr.polygon(e,v,T)},o}w(qke,"linedWaveEdgedRect");async function Gke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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,x=lr.svg(l),b=cr(e,{}),T=[{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}],k=[{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=_n(T);let C=x.path(S,b);const E=_n(k);let A=x.path(E,b);e.look!=="handDrawn"&&(C=AW(C),A=AW(A));const M=l.insert("g",":first-child");return M.insert(()=>C),M.insert(()=>A),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))})`),gr(e,M),e.intersect=function(L){return nr.polygon(e,T,L)},l}w(Gke,"multiRect");async function Uke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ur(t,e,Br(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:x}=e,b=Wp(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=b==null?void 0:b[b.length-1],k=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y:T.y-2*v},{x:m+d+v,y:T.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:T.y-v},{x:m+d,y:T.y-v},{x:m+d,y},{x:m,y}],C=lr.svg(i),E=cr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=_n(k),M=C.path(A,E),L=_n(S),P=C.path(L,E),N=i.insert(()=>M,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",x),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.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))})`),gr(e,N),e.intersect=function(_){return nr.polygon(e,k,_)},i}w(Uke,"multiWaveEdgedRectangle");async function Yke(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n,e.useHtmlLabels||ti(pr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Ur(t,e,Br(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=lr.svg(s),m=cr(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))})`),gr(e,v),e.intersect=function(x){return nr.rect(e,x)},s}w(Yke,"note");var mgt=w((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 jke(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ur(t,e,Br(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=lr.svg(i),g=cr(e,{}),m=mgt(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=u0(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),gr(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=nr.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(jke,"question");async function Xke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),x=cr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=_n(m),T=v.path(b,x),k=o.insert(()=>T,":first-child");return k.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.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))})`),gr(e,k),e.intersect=function(S){return nr.polygon(e,m,S)},o}w(Xke,"rect_left_inv_arrow");async function Kke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 fp(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(ti(We())){const E=h.children[0],A=bt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}he.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await fp(o,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],y=bt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;bt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),bt(h).attr("transform","translate( "+(d.width(he.debug("Rough node insert CXC",M),L),":first-child"),S=a.insert(()=>(he.debug("Rough node insert CXC",M),M),":first-child")}else S=s.insert("rect",":first-child"),C=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)),C.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 gr(e,S),e.intersect=function(E){return nr.rect(e,E)},a}w(Kke,"rectWithTitle");async function Zke(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 L3(t,e,i)}w(Zke,"roundedRect");var qg=8;async function Qke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?qg:qg*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-qg,f=h,p=qg-u/2,g=-h/2,{cssStyles:m}=e,y=lr.svg(s),v=cr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const x=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-qg,y:g+f},{x:p-qg,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(x.map(k=>[k.x,k.y]),v),T=s.insert(()=>b,":first-child");return T.attr("class","basic label-container outer-path").attr("style",Ls(m)),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${qg/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),gr(e,T),e.intersect=function(k){return nr.rect(e,k)},s}w(Qke,"shadedProcess");async function Jke(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),x=cr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.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}],T=_n(b),k=v.path(T,x),S=o.insert(()=>k,":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))})`),gr(e,S),e.intersect=function(C){return nr.polygon(e,b,C)},o}w(Jke,"slopedRect");async function e5e(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 L3(t,e,a)}w(e5e,"squareRect");async function t5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),g=cr(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},...$S(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...$S(h/2-d,0,d,50,270,450)],y=_n(m),v=p.path(y,g),x=o.insert(()=>v,":first-child");return x.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),gr(e,x),e.intersect=function(b){return nr.polygon(e,m,b)},o}w(t5e,"stadium");async function r5e(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return L3(t,e,r)}w(r5e,"state");function n5e(t,e,{config:{themeVariables:r}}){var x,b;const{labelStyles:n,nodeStyles:i}=ar(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=lr.svg(h),f=cr(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 T=((b=(x=t.node())==null?void 0:x.ownerSVGElement)==null?void 0:b.id)??"",k=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${k})`)}return gr(e,v),e.intersect=function(T){return nr.circle(e,(e.width??0)/2,T)},h}w(n5e,"stateEnd");function i5e(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=lr.svg(a).circle(0,0,e.width,Xft(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 gr(e,s),e.intersect=function(u){return nr.circle(e,(e.width??7)/2,u)},a}w(i5e,"stateStart");var Tv=8;async function a5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(e)),u=((e==null?void 0:e.width)??l.width)+2*Tv+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Tv,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=lr.svg(o),v=cr(e,{}),x=y.rectangle(p,g,d+16,f,v),b=y.line(p+Tv,g,p+Tv,g+f,v),T=y.line(p+Tv+d,g,p+Tv+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>T,":first-child");const k=o.insert(()=>x,":first-child"),{cssStyles:S}=e;k.attr("class","basic label-container").attr("style",Ls(S)),gr(e,k)}else{const y=u0(o,d,f,m);n&&y.attr("style",n),gr(e,y)}return e.intersect=function(y){return nr.polygon(e,m,y)},o}w(a5e,"subroutine");var UP=.2;async function s5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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-UP*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Ur(t,e,Br(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=UP*u,d=UP*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,x=lr.svg(o),b=cr(e,{}),T=[{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}],k=[{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=_n(T),C=x.path(S,b),E=_n(k),A=x.path(E,{...b,fillStyle:"solid"}),M=o.insert(()=>A,":first-child");return M.insert(()=>C,":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),gr(e,M),e.intersect=function(L){return nr.polygon(e,T,L)},o}w(s5e,"taggedRect");async function o5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Ur(t,e,Br(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=lr.svg(i),m=cr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Wp(-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,x=-f/2-d*.4,b=[{x:v+o-h,y:(x+l)*1.3},{x:v+o,y:x+l-d},{x:v+o,y:(x+l)*.9},...Wp(v+o,(x+l)*1.25,v+o-h,(x+l)*1.3,-l*.02,.5)],T=_n(y),k=g.path(T,m),S=_n(b),C=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>C,":first-child");return E.insert(()=>k,":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))})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,y,A)},i}w(o5e,"taggedWaveEdgedRectangle");async function l5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Ur(t,e,Br(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),gr(e,h),e.intersect=function(d){return nr.rect(e,d)},i}w(l5e,"text");var ygt=w((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"),ggt=w((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"),mgt=w((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),mle=5,yle=10;async function l5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=pgt(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ls(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))})`),gr(e,g),e.intersect=function(m){const y=nr.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 x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},s}w(l5e,"tiltedCylinder");async function c5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(c5e,"trapezoid");async function u5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.heightx,":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),gr(e,b),e.intersect=function(T){return nr.polygon(e,y,T)},u}w(u5e,"trapezoidalPentagon");var vle=10,ble=10;async function h5e(t,e){var T;const{labelStyles:r,nodeStyles:n}=ar(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.widthx,":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,gr(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(k){return he.info("Triangle intersect",e,p,k),nr.polygon(e,p,k)},s}w(h5e,"triangle");async function d5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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,x=v>0?v/2:0,b=lr.svg(l),T=cr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=[{x:-d/2-x,y:g/2},...Wp(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=_n(k),C=b.path(S,T),E=l.insert(()=>C,":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))})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,k,A)},l}w(d5e,"waveEdgedRectangle");async function f5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-T*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Wp(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Wp(u/2,-f/2,-u/2,-f/2,d,-1)],v=_n(y),x=g.path(v,m),b=o.insert(()=>x,":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),gr(e,b),e.intersect=function(T){return nr.polygon(e,y,T)},o}w(f5e,"waveRectangle");var ya=10;async function p5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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-ya,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ya,10));const{shapeSvg:s,bbox:o,label:l}=await Ur(t,e,Br(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ya,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ya,d=u-ya,f=h-ya,p=-d/2,g=-f/2,{cssStyles:m}=e,y=lr.svg(s),v=cr(e,{}),x=[{x:p-ya,y:g-ya},{x:p-ya,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ya}],b=`M${p-ya},${g-ya} L${p+d},${g-ya} L${p+d},${g+f} L${p-ya},${g+f} L${p-ya},${g-ya} + l${-r},0`,"createCylinderPathD"),vgt=w((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"),bgt=w((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),vle=5,ble=10;async function c5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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(()=>x,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=ygt(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ls(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))})`),gr(e,g),e.intersect=function(m){const y=nr.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 x=d*d*(1-v*v/(h*h));x!=0&&(x=Math.sqrt(Math.abs(x))),x=d-x,m.x-(e.x??0)>0&&(x=-x),y.x+=x}return y},s}w(c5e,"tiltedCylinder");async function u5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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=lr.svg(o),m=cr(e,{}),y=_n(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=u0(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,gr(e,f),e.intersect=function(g){return nr.polygon(e,d,g)},o}w(u5e,"trapezoid");async function h5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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.heightx,":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),gr(e,b),e.intersect=function(T){return nr.polygon(e,y,T)},u}w(h5e,"trapezoidalPentagon");var xle=10,wle=10;async function d5e(t,e){var T;const{labelStyles:r,nodeStyles:n}=ar(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.widthx,":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,gr(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(k){return he.info("Triangle intersect",e,p,k),nr.polygon(e,p,k)},s}w(d5e,"triangle");async function f5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 Ur(t,e,Br(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,x=v>0?v/2:0,b=lr.svg(l),T=cr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=[{x:-d/2-x,y:g/2},...Wp(-d/2-x,g/2,d/2+x,g/2,p,.8),{x:d/2+x,y:-g/2},{x:-d/2-x,y:-g/2}],S=_n(k),C=b.path(S,T),E=l.insert(()=>C,":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))})`),gr(e,E),e.intersect=function(A){return nr.polygon(e,k,A)},l}w(f5e,"waveEdgedRectangle");async function p5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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 T=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-T*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Ur(t,e,Br(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=lr.svg(o),m=cr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Wp(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Wp(u/2,-f/2,-u/2,-f/2,d,-1)],v=_n(y),x=g.path(v,m),b=o.insert(()=>x,":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),gr(e,b),e.intersect=function(T){return nr.polygon(e,y,T)},o}w(p5e,"waveRectangle");var ya=10;async function g5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(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-ya,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-ya,10));const{shapeSvg:s,bbox:o,label:l}=await Ur(t,e,Br(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+ya,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+ya,d=u-ya,f=h-ya,p=-d/2,g=-f/2,{cssStyles:m}=e,y=lr.svg(s),v=cr(e,{}),x=[{x:p-ya,y:g-ya},{x:p-ya,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-ya}],b=`M${p-ya},${g-ya} L${p+d},${g-ya} L${p+d},${g+f} L${p-ya},${g+f} L${p-ya},${g-ya} M${p-ya},${g} L${p+d},${g} - M${p},${g-ya} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),k=s.insert(()=>T,":first-child");return k.attr("transform",`translate(${ya/2}, ${ya/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ya/2-(o.x-(o.left??0))}, ${-(o.height/2)+ya/2-(o.y-(o.top??0))})`),gr(e,k),e.intersect=function(S){return nr.polygon(e,x,S)},s}w(p5e,"windowPane");var xle=new Set(["redux-color","redux-dark-color"]),ygt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function uZ(t,e){var Q,j,ae,Z;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=pr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:J}=pr(),{background:re}=J,ee={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await uZ(t,ee)}const u=pr();e.useHtmlLabels=u.htmlLabels;let h=((Q=u.er)==null?void 0:Q.diagramPadding)??10,d=((j=u.er)==null?void 0:j.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=ar(e);if(r.attributes.length===0&&e.label){const J={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};dl(e.label,u)+J.labelPaddingX*20){const J=v.width+h*2-(k+S+C+E);k+=J/L,S+=J/L,C>0&&(C+=J/L),E>0&&(E+=J/L)}const N=k+S+C+E,_=lr.svg(y),I=cr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let O=0;T.length>0&&(O=T.reduce((J,re)=>J+((re==null?void 0:re.rowHeight)??0),0));const D=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),$=Math.max((O??0)+v.height,(e==null?void 0:e.height)||0),F=-D/2,z=-$/2;if(y.selectAll("g:not(:first-child)").each((J,re,ee)=>{const me=bt(ee[re]),te=me.attr("transform");let $e=0,Oe=0;if(te){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ue&&($e=parseFloat(ue[1]),Oe=parseFloat(ue[2]),me.attr("class").includes("attribute-name")?$e+=k:me.attr("class").includes("attribute-keys")?$e+=k+S:me.attr("class").includes("attribute-comment")&&($e+=k+S+C))}me.attr("transform",`translate(${F+h/2+$e}, ${Oe+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&xle.has(n)){const J=r.colorIndex??0;y.attr("data-color-id",`color-${J%l.length}`)}const H=_.rectangle(F,z,D,$,I),B=y.insert(()=>H,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[J,re]of T.entries()){const me=(J+1)%2===0&&re.yOffset!==0,te=_.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),D,re==null?void 0:re.rowHeight,{...I,fill:me?a:s,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const V=1e-4;let q=o2(F,v.height+z,D+F,v.height+z,V),G=_.polygon(q.map(J=>[J.x,J.y]),I);if(y.insert(()=>G).attr("class","divider"),q=o2(k+F,v.height+z,k+F,$+z,V),G=_.polygon(q.map(J=>[J.x,J.y]),I),y.insert(()=>G).attr("class","divider"),A){const J=k+S+F;q=o2(J,v.height+z,J,$+z,V),G=_.polygon(q.map(re=>[re.x,re.y]),I),y.insert(()=>G).attr("class","divider")}if(M){const J=k+S+C+F;q=o2(J,v.height+z,J,$+z,V),G=_.polygon(q.map(re=>[re.x,re.y]),I),y.insert(()=>G).attr("class","divider")}for(const J of b){const re=v.height+z+J;q=o2(F,re,D+F,re,V),G=_.polygon(q.map(ee=>[ee.x,ee.y]),I),y.insert(()=>G).attr("class","divider")}if(gr(e,B),g&&e.look!=="handDrawn")if(n!=null&&ygt.has(n))y.selectAll("path").attr("style",g);else{const J=g.split(";"),re=(Z=J==null?void 0:J.filter(ee=>ee.includes("stroke")))==null?void 0:Z.map(ee=>`${ee}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(J){return nr.rect(e,J)},y}w(uZ,"erBox");async function s2(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!==K0(e)&&(e=K0(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Fo(o,e,{width:dl(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(pd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=bt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(s2,"addText");function o2(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}]}w(o2,"lineToPolygon");async function g5e(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",Br(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 x=e.annotations[0];await k5(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await k5(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 x of e.members){const b=await k5(u,x,m,[x.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 x of e.methods){const b=await k5(h,x,y,[x.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.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}}w(g5e,"textHelper");async function k5(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=pr();let s="useHtmlLabels"in e?e.useHtmlLabels:pd(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Ha(o)&&(s=!0);const l=await Fo(i,dK(Wf(o)),{width:dl(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=bt(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 x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}w(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")&&bt(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}w(k5,"addText");async function m5e(t,e){var _,I;const r=We(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??pd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await g5e(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=ar(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((_=l.styles)==null?void 0:_.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=lr.svg(u),y=cr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=s:l.members.length>0&&l.methods.length===0&&(x+=s*2);const T=-v/2,k=-x/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const C=m.rectangle(T-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,x+2*a+S,y),E=u.insert(()=>C,":first-child");E.attr("class","basic label-container outer-path");const A=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,N=(M+L+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((O,D,$)=>{var q,G;const F=bt($[D]),z=F.attr("transform");let H=0;if(z){const j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);j&&(H=parseFloat(j[2]))}let B=H+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const Q=Math.max(P,s/2);b?B=Math.max(N,M+L+Q+k+s*2+a)+s*2:B=M+L+Q+k+s*4+a}l.members.length===0&&l.methods.length===0&&((q=r.class)!=null&&q.hideEmptyMembersBox)&&(l.annotations.length>0?B=H-s:B=H),o||(B-=4);let V=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(V=-((G=F.node())==null?void 0:G.getBBox().width)/2||0,u.selectAll("text").each(function(Q,j,ae){window.getComputedStyle(ae[j]).textAnchor==="middle"&&(V=0)})),F.attr("transform",`translate(${V}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const O=M+L+k+a,D=m.line(A.x,O,A.x+A.width,O+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const O=M+L+P+k+s*2+a,D=m.line(A.x,b?Math.max(N,O):O,A.x+A.width,(b?Math.max(N,O):O)+.001,y);u.insert(()=>D).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 O=RegExp(/color\s*:\s*([^;]*)/),D=O.exec(p);if(D){const $=D[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}else if(d){const $=O.exec(d);if($){const F=$[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return gr(e,E),e.intersect=function(O){return nr.rect(e,O)},u}w(m5e,"classBox");async function y5e(t,e){var A,M;const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=Br(e),{themeVariables:h}=We(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await wh(p,`<<${i.type}>>`,0,e.labelStyle):g=await wh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await wh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const L=await wh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=L;const P=await wh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await wh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await wh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const L=await wh(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=L,await wh(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+s,x=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,b=-v/2,T=-x/2,k=lr.svg(p),S=cr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=k.rectangle(b,T,v,x,S),E=p.insert(()=>C,":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,N)=>{const _=bt(N[P]),I=_.attr("transform");let O=0,D=0;if(I){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);H&&(O=parseFloat(H[1]),D=parseFloat(H[2]))}const $=D-x/2;let F=b+s/2;(P===0||P===1)&&(F=O),_.attr("transform",`translate(${F}, ${$+s})`)}),m>g+y+o){const L=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,L],[b+v,L],[b+v,L+.001],[b,L+.001]];P=k.polygon(I,S)}else P=k.line(b,L,b+v,L,S);p.insert(()=>P).attr("class","divider")}return gr(e,E),e.intersect=function(L){return nr.rect(e,L)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(y5e,"requirementBox");async function wh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=We(),s=a.htmlLabels??!0,o=await Fo(i,dK(Wf(e)),{width:dl(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=bt(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}w(wh,"addText");var vgt=w(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 v5e(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Ur(t,e,Br(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.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 WP(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await WP(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await WP(o,"assigned"in e&&e.assigned||"",p);e.width=s;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,k=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:M}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const _=lr.svg(o),I=cr(e,{}),O=A||M?_.path(pg(S,C,b,k,A||0),I):_.rectangle(S,C,b,k,I);E=o.insert(()=>O,":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",A??5).attr("ry",M??5).attr("x",S).attr("y",C).attr("width",b).attr("height",k);const _="priority"in e&&e.priority;if(_){const I=o.append("line"),O=S+2,D=C+Math.floor((A??0)/2),$=C+k-Math.floor((A??0)/2);I.attr("x1",O).attr("y1",D).attr("x2",O).attr("y2",$).attr("stroke-width","4").attr("stroke",vgt(_))}}return gr(e,E),e.height=k,e.intersect=function(_){return nr.rect(e,_)},o}w(v5e,"kanbanItem");async function b5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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-ya} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(b,v),k=s.insert(()=>T,":first-child");return k.attr("transform",`translate(${ya/2}, ${ya/2})`),k.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+ya/2-(o.x-(o.left??0))}, ${-(o.height/2)+ya/2-(o.y-(o.top??0))})`),gr(e,k),e.intersect=function(S){return nr.polygon(e,x,S)},s}w(g5e,"windowPane");var Tle=new Set(["redux-color","redux-dark-color"]),xgt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function dZ(t,e){var Q,j,ae,Z;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=pr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:J}=pr(),{background:re}=J,ee={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${re}`]};await dZ(t,ee)}const u=pr();e.useHtmlLabels=u.htmlLabels;let h=((Q=u.er)==null?void 0:Q.diagramPadding)??10,d=((j=u.er)==null?void 0:j.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=ar(e);if(r.attributes.length===0&&e.label){const J={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};dl(e.label,u)+J.labelPaddingX*20){const J=v.width+h*2-(k+S+C+E);k+=J/L,S+=J/L,C>0&&(C+=J/L),E>0&&(E+=J/L)}const N=k+S+C+E,_=lr.svg(y),I=cr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let O=0;T.length>0&&(O=T.reduce((J,re)=>J+((re==null?void 0:re.rowHeight)??0),0));const D=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),$=Math.max((O??0)+v.height,(e==null?void 0:e.height)||0),F=-D/2,z=-$/2;if(y.selectAll("g:not(:first-child)").each((J,re,ee)=>{const me=bt(ee[re]),te=me.attr("transform");let $e=0,Oe=0;if(te){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ue&&($e=parseFloat(ue[1]),Oe=parseFloat(ue[2]),me.attr("class").includes("attribute-name")?$e+=k:me.attr("class").includes("attribute-keys")?$e+=k+S:me.attr("class").includes("attribute-comment")&&($e+=k+S+C))}me.attr("transform",`translate(${F+h/2+$e}, ${Oe+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&Tle.has(n)){const J=r.colorIndex??0;y.attr("data-color-id",`color-${J%l.length}`)}const H=_.rectangle(F,z,D,$,I),B=y.insert(()=>H,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[J,re]of T.entries()){const me=(J+1)%2===0&&re.yOffset!==0,te=_.rectangle(F,v.height+z+(re==null?void 0:re.yOffset),D,re==null?void 0:re.rowHeight,{...I,fill:me?a:s,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const V=1e-4;let q=o2(F,v.height+z,D+F,v.height+z,V),G=_.polygon(q.map(J=>[J.x,J.y]),I);if(y.insert(()=>G).attr("class","divider"),q=o2(k+F,v.height+z,k+F,$+z,V),G=_.polygon(q.map(J=>[J.x,J.y]),I),y.insert(()=>G).attr("class","divider"),A){const J=k+S+F;q=o2(J,v.height+z,J,$+z,V),G=_.polygon(q.map(re=>[re.x,re.y]),I),y.insert(()=>G).attr("class","divider")}if(M){const J=k+S+C+F;q=o2(J,v.height+z,J,$+z,V),G=_.polygon(q.map(re=>[re.x,re.y]),I),y.insert(()=>G).attr("class","divider")}for(const J of b){const re=v.height+z+J;q=o2(F,re,D+F,re,V),G=_.polygon(q.map(ee=>[ee.x,ee.y]),I),y.insert(()=>G).attr("class","divider")}if(gr(e,B),g&&e.look!=="handDrawn")if(n!=null&&xgt.has(n))y.selectAll("path").attr("style",g);else{const J=g.split(";"),re=(Z=J==null?void 0:J.filter(ee=>ee.includes("stroke")))==null?void 0:Z.map(ee=>`${ee}`).join("; ");y.selectAll("path").attr("style",re??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(J){return nr.rect(e,J)},y}w(dZ,"erBox");async function s2(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!==K0(e)&&(e=K0(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await Fo(o,e,{width:dl(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(gd(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=bt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(s2,"addText");function o2(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}]}w(o2,"lineToPolygon");async function m5e(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",Br(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 x=e.annotations[0];await k5(o,{text:`«${x}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await k5(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 x of e.members){const b=await k5(u,x,m,[x.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 x of e.methods){const b=await k5(h,x,y,[x.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const x=o.node().getBBox();o.attr("transform",`translate(${-x.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}}w(m5e,"textHelper");async function k5(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=pr();let s="useHtmlLabels"in e?e.useHtmlLabels:gd(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Ha(o)&&(s=!0);const l=await Fo(i,pK(Wf(o)),{width:dl(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=bt(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 x;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((x=a.fontSize)==null?void 0:x.toString())??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}w(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")&&bt(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}w(k5,"addText");async function y5e(t,e){var _,I;const r=We(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??gd(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await m5e(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=ar(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((_=l.styles)==null?void 0:_.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=lr.svg(u),y=cr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let x=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=s:l.members.length>0&&l.methods.length===0&&(x+=s*2);const T=-v/2,k=-x/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const C=m.rectangle(T-a,k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,x+2*a+S,y),E=u.insert(()=>C,":first-child");E.attr("class","basic label-container outer-path");const A=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,N=(M+L+k+a-(k-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((O,D,$)=>{var q,G;const F=bt($[D]),z=F.attr("transform");let H=0;if(z){const j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);j&&(H=parseFloat(j[2]))}let B=H+k+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const Q=Math.max(P,s/2);b?B=Math.max(N,M+L+Q+k+s*2+a)+s*2:B=M+L+Q+k+s*4+a}l.members.length===0&&l.methods.length===0&&((q=r.class)!=null&&q.hideEmptyMembersBox)&&(l.annotations.length>0?B=H-s:B=H),o||(B-=4);let V=T;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(V=-((G=F.node())==null?void 0:G.getBBox().width)/2||0,u.selectAll("text").each(function(Q,j,ae){window.getComputedStyle(ae[j]).textAnchor==="middle"&&(V=0)})),F.attr("transform",`translate(${V}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const O=M+L+k+a,D=m.line(A.x,O,A.x+A.width,O+.001,y);u.insert(()=>D).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const O=M+L+P+k+s*2+a,D=m.line(A.x,b?Math.max(N,O):O,A.x+A.width,(b?Math.max(N,O):O)+.001,y);u.insert(()=>D).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 O=RegExp(/color\s*:\s*([^;]*)/),D=O.exec(p);if(D){const $=D[0].replace("color","fill");u.selectAll("tspan").attr("style",$)}else if(d){const $=O.exec(d);if($){const F=$[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return gr(e,E),e.intersect=function(O){return nr.rect(e,O)},u}w(y5e,"classBox");async function v5e(t,e){var A,M;const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=Br(e),{themeVariables:h}=We(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await wh(p,`<<${i.type}>>`,0,e.labelStyle):g=await wh(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await wh(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const L=await wh(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=L;const P=await wh(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await wh(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await wh(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const L=await wh(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=L,await wh(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+s,x=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,b=-v/2,T=-x/2,k=lr.svg(p),S=cr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=k.rectangle(b,T,v,x,S),E=p.insert(()=>C,":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,N)=>{const _=bt(N[P]),I=_.attr("transform");let O=0,D=0;if(I){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);H&&(O=parseFloat(H[1]),D=parseFloat(H[2]))}const $=D-x/2;let F=b+s/2;(P===0||P===1)&&(F=O),_.attr("transform",`translate(${F}, ${$+s})`)}),m>g+y+o){const L=T+g+y+o;let P;if(e.look==="neo"){const I=[[b,L],[b+v,L],[b+v,L+.001],[b,L+.001]];P=k.polygon(I,S)}else P=k.line(b,L,b+v,L,S);p.insert(()=>P).attr("class","divider")}return gr(e,E),e.intersect=function(L){return nr.rect(e,L)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(v5e,"requirementBox");async function wh(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=We(),s=a.htmlLabels??!0,o=await Fo(i,pK(Wf(e)),{width:dl(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=bt(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}w(wh,"addText");var wgt=w(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 b5e(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=ar(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Ur(t,e,Br(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(N=r==null?void 0:r.kanban)==null?void 0:N.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 GP(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await GP(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await GP(o,"assigned"in e&&e.assigned||"",p);e.width=s;const x=10,b=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,k=Math.max(l.height+x*2,(e==null?void 0:e.height)||0)+T,S=-b/2,C=-k/2;u.attr("transform","translate("+(h-b/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:M}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const _=lr.svg(o),I=cr(e,{}),O=A||M?_.path(pg(S,C,b,k,A||0),I):_.rectangle(S,C,b,k,I);E=o.insert(()=>O,":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",A??5).attr("ry",M??5).attr("x",S).attr("y",C).attr("width",b).attr("height",k);const _="priority"in e&&e.priority;if(_){const I=o.append("line"),O=S+2,D=C+Math.floor((A??0)/2),$=C+k-Math.floor((A??0)/2);I.attr("x1",O).attr("y1",D).attr("x2",O).attr("y2",$).attr("stroke-width","4").attr("stroke",wgt(_))}}return gr(e,E),e.height=k,e.intersect=function(_){return nr.rect(e,_)},o}w(b5e,"kanbanItem");async function x5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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 @@ -481,7 +481,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 x=lr.svg(i),b=cr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Ls(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})`),gr(e,y),e.calcIntersect=function(x,b){return nr.rect(x,b)},e.intersect=function(x){return he.info("Bang intersect",e,x),nr.rect(e,x)},i}w(b5e,"bang");async function x5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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 x=lr.svg(i),b=cr(e,{}),T=x.path(v,b);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Ls(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})`),gr(e,y),e.calcIntersect=function(x,b){return nr.rect(x,b)},e.intersect=function(x){return he.info("Bang intersect",e,x),nr.rect(e,x)},i}w(x5e,"bang");async function w5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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} @@ -495,7 +495,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=lr.svg(i),x=cr(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Ls(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})`),gr(e,m),e.calcIntersect=function(v,x){return nr.rect(v,x)},e.intersect=function(v){return he.info("Cloud intersect",e,v),nr.rect(e,v)},i}w(x5e,"cloud");async function w5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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=lr.svg(i),x=cr(e,{}),b=v.path(y,x);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Ls(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})`),gr(e,m),e.calcIntersect=function(v,x){return nr.rect(v,x)},e.intersect=function(v){return he.info("Cloud intersect",e,v),nr.rect(e,v)},i}w(w5e,"cloud");async function T5e(t,e){const{labelStyles:r,nodeStyles:n}=ar(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Ur(t,e,Br(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} @@ -515,80 +515,80 @@ 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()),gr(e,f),e.calcIntersect=function(p,g){return nr.rect(p,g)},e.intersect=function(p){return nr.rect(e,p)},i}w(w5e,"defaultMindmapNode");async function T5e(t,e){const r={padding:e.padding??0};return cZ(t,e,r)}w(T5e,"mindmapCircle");var bgt=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Jke},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Kke},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:e5e},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:i5e},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Tke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:kke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:cZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:b5e},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:x5e},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Yke},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Mke},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:zke},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Fke},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:c5e},{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:Pke},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ske},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:o5e},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:pke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Zke},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:n5e},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:r5e},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Rke},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Lke},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:vke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:bke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:xke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Hke},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:d5e},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:_ke},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:l5e},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Vke},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:wke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Cke},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:h5e},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:p5e},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Eke},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:u5e},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Ake},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Qke},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Gke},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:qke},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:fke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:yke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:s5e},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:a5e},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:f5e},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:jke},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Wke}],xgt=w(()=>{const e=[...Object.entries({state:t5e,choice:gke,note:Uke,rectWithTitle:Xke,labelRect:Bke,iconSquare:Dke,iconCircle:$ke,icon:Ike,iconRounded:Nke,imageSquare:Oke,anchor:hke,kanbanItem:v5e,mindmapCircle:T5e,defaultMindmapNode:w5e,classBox:m5e,erBox:uZ,requirementBox:y5e}),...bgt.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),k5e=xgt();function C5e(t){return t in k5e}w(C5e,"isValidShape");var F$=new Map;async function yE(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?k5e[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",Ls(e.look)),e.tooltip&&i.attr("title",e.tooltip),F$.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(yE,"insertNode");var wgt=w((t,e)=>{F$.set(e.id,t)},"setNodeElem"),S5e=w(()=>{F$.clear()},"clear"),tM=w(t=>{const e=F$.get(t.id);he.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"),Hh=w((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"),Es={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},wle={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function C5(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Zi(t),e=Zi(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}}w(C5,"calculateDeltaAndAngle");var Zi=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),E5e=w(t=>({x:w(function(e,r,n){let i=0;const a=Zi(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Es,t.arrowTypeEnd)){const{angle:p,deltaX:g}=C5(n[n.length-1],n[n.length-2]);i=Es[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Zi(e).x-Zi(n[n.length-1]).x),o=Math.abs(Zi(e).y-Zi(n[n.length-1]).y),l=Math.abs(Zi(e).x-Zi(n[0]).x),u=Math.abs(Zi(e).y-Zi(n[0]).y),h=Es[t.arrowTypeStart],d=Es[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Es,t.arrowTypeEnd)){const{angle:p,deltaY:g}=C5(n[n.length-1],n[n.length-2]);i=Es[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Zi(e).y-Zi(n[n.length-1]).y),o=Math.abs(Zi(e).x-Zi(n[n.length-1]).x),l=Math.abs(Zi(e).y-Zi(n[0]).y),u=Math.abs(Zi(e).x-Zi(n[0]).x),h=Es[t.arrowTypeStart],d=Es[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&Tle(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&Tle(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),kgt={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}},Cgt=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Tle=w((t,e,r,n,i,a,s=!1,o)=>{var g;const l=kgt[r],u=l&&Cgt.includes(l.type);if(!l){he.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 x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",o),l.fill&&T.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),Sgt=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=We())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),NS=new Map,Na=new Map,A5e=w(()=>{NS.clear(),Na.clear()},"clear"),Ak=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),rM=w(async(t,e)=>{const r=We();let n=ti(r);const{labelStyles:i}=ar(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 Fo(t,e.label,{style:Ak(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),he.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=bt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=bt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Hh(d,n)),NS.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 fp(g,e.startLabelLeft,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Hh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).startLeft=p,S5(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(g,e.startLabelRight,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Hh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).startRight=p,S5(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(p,e.endLabelLeft,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Hh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).endLeft=p,S5(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(p,e.endLabelRight,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Hh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).endRight=p,S5(f,e.endLabelRight)}return u},"insertEdgeLabel");function S5(t,e){ti(We())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(S5,"setTerminalWidth");var R5e=w((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,NS.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=We(),{subGraphTitleTotalMargin:i}=M3(n);if(t.label){const a=NS.get(t.id);let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=Na.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Egt=w((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"),Agt=w((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"),Rgt=w((t,e,r)=>{he.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()),gr(e,f),e.calcIntersect=function(p,g){return nr.rect(p,g)},e.intersect=function(p){return nr.rect(e,p)},i}w(T5e,"defaultMindmapNode");async function k5e(t,e){const r={padding:e.padding??0};return hZ(t,e,r)}w(k5e,"mindmapCircle");var Tgt=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:e5e},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Zke},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:t5e},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:a5e},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:kke},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Cke},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:hZ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:x5e},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:w5e},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:jke},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Lke},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Hke},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:zke},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:u5e},{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:Bke},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Eke},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:l5e},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:gke},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Qke},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:i5e},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:n5e},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:_ke},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Ike},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:bke},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:xke},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:wke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Vke},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:f5e},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Mke},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:c5e},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Wke},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Tke},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Ske},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:d5e},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:g5e},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ake},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:h5e},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Rke},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Jke},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Uke},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Gke},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:pke},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:vke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:o5e},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:s5e},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:p5e},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Xke},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:qke}],kgt=w(()=>{const e=[...Object.entries({state:r5e,choice:mke,note:Yke,rectWithTitle:Kke,labelRect:Fke,iconSquare:Oke,iconCircle:Nke,icon:$ke,iconRounded:Dke,imageSquare:Pke,anchor:dke,kanbanItem:b5e,mindmapCircle:k5e,defaultMindmapNode:T5e,classBox:y5e,erBox:dZ,requirementBox:v5e}),...Tgt.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),C5e=kgt();function S5e(t){return t in C5e}w(S5e,"isValidShape");var H$=new Map;async function vE(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?C5e[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",Ls(e.look)),e.tooltip&&i.attr("title",e.tooltip),H$.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(vE,"insertNode");var Cgt=w((t,e)=>{H$.set(e.id,t)},"setNodeElem"),E5e=w(()=>{H$.clear()},"clear"),rM=w(t=>{const e=H$.get(t.id);he.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"),Vh=w((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"),Es={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},kle={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function C5(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Zi(t),e=Zi(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}}w(C5,"calculateDeltaAndAngle");var Zi=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),A5e=w(t=>({x:w(function(e,r,n){let i=0;const a=Zi(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Es,t.arrowTypeEnd)){const{angle:p,deltaX:g}=C5(n[n.length-1],n[n.length-2]);i=Es[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(Zi(e).x-Zi(n[n.length-1]).x),o=Math.abs(Zi(e).y-Zi(n[n.length-1]).y),l=Math.abs(Zi(e).x-Zi(n[0]).x),u=Math.abs(Zi(e).y-Zi(n[0]).y),h=Es[t.arrowTypeStart],d=Es[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Es,t.arrowTypeEnd)){const{angle:p,deltaY:g}=C5(n[n.length-1],n[n.length-2]);i=Es[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(Zi(e).y-Zi(n[n.length-1]).y),o=Math.abs(Zi(e).x-Zi(n[n.length-1]).x),l=Math.abs(Zi(e).y-Zi(n[0]).y),u=Math.abs(Zi(e).x-Zi(n[0]).x),h=Es[t.arrowTypeStart],d=Es[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&Cle(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&Cle(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),Egt={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}},Agt=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Cle=w((t,e,r,n,i,a,s=!1,o)=>{var g;const l=Egt[r],u=l&&Agt.includes(l.type);if(!l){he.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 x=v.cloneNode(!0);x.id=y,x.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",o),l.fill&&T.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(x)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),Rgt=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=We())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),NS=new Map,Na=new Map,R5e=w(()=>{NS.clear(),Na.clear()},"clear"),Ak=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),nM=w(async(t,e)=>{const r=We();let n=ti(r);const{labelStyles:i}=ar(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 Fo(t,e.label,{style:Ak(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),he.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=bt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=bt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Vh(d,n)),NS.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 fp(g,e.startLabelLeft,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Vh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).startLeft=p,S5(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(g,e.startLabelRight,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Vh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).startRight=p,S5(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(p,e.endLabelLeft,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Vh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).endLeft=p,S5(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await fp(p,e.endLabelRight,Ak(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],x=bt(m);y=v.getBoundingClientRect(),x.attr("width",y.width),x.attr("height",y.height)}g.attr("transform",Vh(y,n)),Na.get(e.id)||Na.set(e.id,{}),Na.get(e.id).endRight=p,S5(f,e.endLabelRight)}return u},"insertEdgeLabel");function S5(t,e){ti(We())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(S5,"setTerminalWidth");var _5e=w((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,NS.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=We(),{subGraphTitleTotalMargin:i}=M3(n);if(t.label){const a=NS.get(t.id);let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=Na.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),_gt=w((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"),Mgt=w((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"),Lgt=w((t,e,r)=>{he.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{he.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(he.info("abc88 checking point",a,e),!Agt(e,a)&&!i){const s=Rgt(e,n,a);he.debug("abc88 inside",a,n,s),he.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)?he.warn("abc88 no intersect",s,r):r.push(s),i=!0}else he.warn("abc88 outside",a,n),n=a,i||r.push(a)}),he.debug("returning points",r),r},"cutPathAtIntersect");function _5e(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}}w(_5e,"extractCornerPoints");var Cle=w(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"),_gt=w(function(t){const{cornerPointPositions:e}=_5e(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){he.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 he.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"),Mgt=w((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"),hZ=w(function(t,e,r,n,i,a,s,o=!1){var $;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}=We();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)PK(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],H=F[F.length-1],B=.5,V=Math.abs(h[h.length-1].x-H.x)!Number.isNaN(F.y));const v=Sgt(e.curve);v!=="rounded"&&(y=_gt(y));let x=TC;switch(v){case"linear":x=TC;break;case"basis":x=RS;break;case"cardinal":x=X4e;break;case"bumpX":x=q4e;break;case"bumpY":x=G4e;break;case"catmullRom":x=Z4e;break;case"monotoneX":x=nwe;break;case"monotoneY":x=iwe;break;case"natural":x=swe;break;case"step":x=owe;break;case"stepAfter":x=cwe;break;case"stepBefore":x=lwe;break;case"rounded":x=TC;break;default:x=RS}const{x:b,y:T}=E5e(e),k=AS().x(b).y(T).curve(x);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 C,E=v==="rounded"?M5e(L5e(y,e),5):k(y);const A=Array.isArray(e.style)?e.style:[e.style];let M=A.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=lr.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",C=bt(z).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",A?A.reduce((B,V)=>B+";"+V,""):"");let H=C.attr("d");C.attr("d",H),t.node().appendChild(C.node())}else{const F=g.join(";"),z=A?A.reduce((Q,j)=>Q+j+";",""):"",H=(F?F+";"+z+";":z)+";"+(A?A.reduce((Q,j)=>Q+";"+j,""):"");C=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",H),M=($=H.match(/stroke:([^;]+)/))==null?void 0:$[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=C.node(),V=typeof B.getTotalLength=="function"?B.getTotalLength():0,q=wle[e.arrowTypeStart]||0,G=wle[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const j=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Mgt(V,q,G):`0 ${q} ${V-q-G} ${G}`}; stroke-dashoffset: 0;`;C.attr("style",j+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",e.id),C.attr("data-points",m),C.attr("data-look",Ls(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 N="";(We().flowchart.arrowMarkerAbsolute||We().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),he.info("arrowTypeStart",e.arrowTypeStart),he.info("arrowTypeEnd",e.arrowTypeEnd);const _=!P&&(e==null?void 0:e.look)==="neo";Tgt(C,e,N,s,n,_,M);const I=Math.floor(h.length/2),O=h[I];Vr.isLabelCoordinateInPath(O,C.attr("d"))||(d=!0);let D={};return d&&(D.updatedPath=h),D.originalPath=e.points,D},"insertEdge");function M5e(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&&Es[e.arrowTypeStart]){const i=Es[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=RW(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&&Es[e.arrowTypeEnd]){const i=Es[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=RW(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}w(L5e,"applyMarkerOffsetsToPoints");var Lgt=w((t,e,r,n)=>{e.forEach(i=>{emt[i](t,r,n)})},"insertMarkers"),Igt=w((t,e,r)=>{he.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"),$gt=w((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"),Ngt=w((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"),Dgt=w((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"),Ogt=w((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"),Pgt=w((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"),Bgt=w((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"),Fgt=w((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"),zgt=w((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"),Hgt=w((t,e,r)=>{const n=pr(),{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"),Vgt=w((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"),Wgt=w((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"),qgt=w((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"),Ggt=w((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"),Ugt=w((t,e,r)=>{const n=pr(),{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"),Ygt=w((t,e,r)=>{const n=pr(),{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"),jgt=w((t,e,r)=>{const n=pr(),{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"),Xgt=w((t,e,r)=>{const n=pr(),{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"),Kgt=w((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{he.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(he.info("abc88 checking point",a,e),!Mgt(e,a)&&!i){const s=Lgt(e,n,a);he.debug("abc88 inside",a,n,s),he.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)?he.warn("abc88 no intersect",s,r):r.push(s),i=!0}else he.warn("abc88 outside",a,n),n=a,i||r.push(a)}),he.debug("returning points",r),r},"cutPathAtIntersect");function M5e(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}}w(M5e,"extractCornerPoints");var Ele=w(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"),Igt=w(function(t){const{cornerPointPositions:e}=M5e(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){he.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 he.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"),$gt=w((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"),fZ=w(function(t,e,r,n,i,a,s,o=!1){var $;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}=We();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)FK(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],H=F[F.length-1],B=.5,V=Math.abs(h[h.length-1].x-H.x)!Number.isNaN(F.y));const v=Rgt(e.curve);v!=="rounded"&&(y=Igt(y));let x=TC;switch(v){case"linear":x=TC;break;case"basis":x=RS;break;case"cardinal":x=K4e;break;case"bumpX":x=G4e;break;case"bumpY":x=U4e;break;case"catmullRom":x=Q4e;break;case"monotoneX":x=iwe;break;case"monotoneY":x=awe;break;case"natural":x=owe;break;case"step":x=lwe;break;case"stepAfter":x=uwe;break;case"stepBefore":x=cwe;break;case"rounded":x=TC;break;default:x=RS}const{x:b,y:T}=A5e(e),k=AS().x(b).y(T).curve(x);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 C,E=v==="rounded"?L5e(I5e(y,e),5):k(y);const A=Array.isArray(e.style)?e.style:[e.style];let M=A.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=lr.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",C=bt(z).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",A?A.reduce((B,V)=>B+";"+V,""):"");let H=C.attr("d");C.attr("d",H),t.node().appendChild(C.node())}else{const F=g.join(";"),z=A?A.reduce((Q,j)=>Q+j+";",""):"",H=(F?F+";"+z+";":z)+";"+(A?A.reduce((Q,j)=>Q+";"+j,""):"");C=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",H),M=($=H.match(/stroke:([^;]+)/))==null?void 0:$[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=C.node(),V=typeof B.getTotalLength=="function"?B.getTotalLength():0,q=kle[e.arrowTypeStart]||0,G=kle[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const j=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?$gt(V,q,G):`0 ${q} ${V-q-G} ${G}`}; stroke-dashoffset: 0;`;C.attr("style",j+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",e.id),C.attr("data-points",m),C.attr("data-look",Ls(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 N="";(We().flowchart.arrowMarkerAbsolute||We().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),he.info("arrowTypeStart",e.arrowTypeStart),he.info("arrowTypeEnd",e.arrowTypeEnd);const _=!P&&(e==null?void 0:e.look)==="neo";Sgt(C,e,N,s,n,_,M);const I=Math.floor(h.length/2),O=h[I];Vr.isLabelCoordinateInPath(O,C.attr("d"))||(d=!0);let D={};return d&&(D.updatedPath=h),D.originalPath=e.points,D},"insertEdge");function L5e(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&&Es[e.arrowTypeStart]){const i=Es[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=MW(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&&Es[e.arrowTypeEnd]){const i=Es[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=MW(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}w(I5e,"applyMarkerOffsetsToPoints");var Ngt=w((t,e,r,n)=>{e.forEach(i=>{nmt[i](t,r,n)})},"insertMarkers"),Dgt=w((t,e,r)=>{he.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"),Ogt=w((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"),Pgt=w((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"),Bgt=w((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"),Fgt=w((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"),zgt=w((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"),Hgt=w((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"),Vgt=w((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"),Wgt=w((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"),qgt=w((t,e,r)=>{const n=pr(),{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"),Ggt=w((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"),Ugt=w((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"),Ygt=w((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"),jgt=w((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"),Xgt=w((t,e,r)=>{const n=pr(),{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"),Kgt=w((t,e,r)=>{const n=pr(),{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"),Zgt=w((t,e,r)=>{const n=pr(),{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"),Qgt=w((t,e,r)=>{const n=pr(),{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"),Jgt=w((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"),Zgt=w((t,e,r)=>{const n=pr(),{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"),emt=w((t,e,r)=>{const n=pr(),{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"),Qgt=w((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"),Jgt=w((t,e,r)=>{const n=pr(),{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"),emt={extension:Igt,composition:$gt,aggregation:Ngt,dependency:Dgt,lollipop:Ogt,point:Pgt,circle:Bgt,cross:Fgt,barb:zgt,barbNeo:Hgt,only_one:Vgt,zero_or_one:Wgt,one_or_more:qgt,zero_or_more:Ggt,only_one_neo:Ugt,zero_or_one_neo:Ygt,one_or_more_neo:jgt,zero_or_more_neo:Xgt,requirement_arrow:Kgt,requirement_contains:Qgt,requirement_arrow_neo:Zgt,requirement_contains_neo:Jgt},dZ=Lgt,tmt={common:Ft,getConfig:pr,insertCluster:B$,insertEdge:hZ,insertEdgeLabel:rM,insertMarkers:dZ,insertNode:yE,interpolateToCurve:qK,labelHelper:Ur,log:he,positionEdgeLabel:R5e},DS={},I5e=w(t=>{for(const e of t)DS[e.name]=e},"registerLayoutLoaders"),rmt=w(()=>{I5e([{name:"dagre",loader:w(async()=>await xr(()=>Promise.resolve().then(()=>gBt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await xr(()=>Promise.resolve().then(()=>ABt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await xr(()=>Promise.resolve().then(()=>yGt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");rmt();var I3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in DS))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=DS[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,tmt,{algorithm:n.algorithm},r)},"render"),vE=w((t="",{fallback:e="dagre"}={})=>{if(t in DS)return t;if(e in DS)return he.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"),fZ="comm",$5e="rule",N5e="decl",nmt="@media",imt="@import",amt="@supports",smt="@namespace",_W="@keyframes",D5e="@layer",omt="@scope",lmt=Math.abs,EC=String.fromCharCode;function O5e(t){return t.trim()}function MW(t,e,r){return t.replace(e,r)}function lb(t,e){return t.charCodeAt(e)|0}function $T(t,e,r){return t.slice(e,r)}function $h(t){return t.length}function P5e(t){return t.length}function rA(t,e){return e.push(t),t}var z$=1,NT=1,B5e=0,cu=0,Ya=0,$3="";function pZ(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:z$,column:NT,length:s,return:"",siblings:o}}function cmt(){return Ya}function umt(){return Ya=cu>0?lb($3,--cu):0,NT--,Ya===10&&(NT=1,z$--),Ya}function Uu(){return Ya=cu2||OS(Ya)>3?"":" "}function pmt(t,e){for(;--e&&Uu()&&!(Ya<48||Ya>102||Ya>57&&Ya<65||Ya>70&&Ya<97););return H$(t,aR()+(e<6&&pp()==32&&Uu()==32))}function LW(t){for(;Uu();)switch(Ya){case t:return cu;case 34:case 39:t!==34&&t!==39&&LW(Ya);break;case 40:t===41&&LW(t);break;case 92:Uu();break}return cu}function gmt(t,e){for(;Uu()&&t+Ya!==57;)if(t+Ya===84&&pp()===47)break;return"/*"+H$(e,cu-1)+"*"+EC(t===47?t:Uu())}function mmt(t){for(;!OS(pp());)Uu();return H$(t,cu)}function ymt(t){return dmt(sR("",null,null,null,[""],t=hmt(t),0,[0],t))}function sR(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,x=0,b=0,T="",k=i,S=a,C=n,E=T;y;)switch(g=b,b=Uu()){case 40:g!=108&&lb(E,d-1)==58?(x++,E+="("):E+=GP(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=GP(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=EC(b);break}E+=fmt(g);break;case 92:E+=pmt(aR()-1,7);continue;case 47:switch(pp()){case 42:case 47:rA(vmt(gmt(Uu(),aR()),e,r,l),l),(OS(g||1)==5||OS(pp()||1)==5)&&$h(E)&&$T(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=$h(E)*v;case 125*m:case 59:case 0:if(x>0&&b){E+=EC(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=MW(E,/\f/g,"")),p>0&&($h(E)-d||m===0)&&rA(p>32?Ele(E+";",n,r,d-1,l):Ele(MW(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(rA(C=Sle(E,e,r,u,h,i,o,T,k=[],S=[],d,a),a),b===123)if(h===0)sR(E,e,C,C,k,a,d,o,S);else{switch(f){case 99:if(lb(E,3)===110)break;case 108:if(lb(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?sR(t,C,C,n&&rA(Sle(t,C,C,0,0,i,o,T,i,k=[],d,S),S),i,S,d,o,n?k:S):sR(E,C,C,C,[""],S,0,o,S)}}u=h=p=0,m=v=1,T=E="",d=s;break;case 58:d=1+$h(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&umt()==125)continue}switch(E+=EC(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(x>0)break;o[u++]=($h(E)-1)*v,v=1;break;case 64:pp()===45&&(E+=GP(Uu())),f=pp(),h=d=$h(T=E+=mmt(aR())),b++;break;case 45:g===45&&$h(E)==2&&(m=0)}}return a}function Sle(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=P5e(p),m=0,y=0,v=0;m0?p[x]+" "+b:MW(b,/&\f/g,p[x])))&&(l[v++]=T);return pZ(t,e,r,i===0?$5e:o,l,u,h,d)}function vmt(t,e,r,n){return pZ(t,e,r,fZ,EC(cmt()),$T(t,2,-2),0,n)}function Ele(t,e,r,n,i){return pZ(t,e,r,N5e,$T(t,0,n),$T(t,n+1,-1),n,i)}function IW(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Tmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dUt);return{diagram:e}},void 0,import.meta.url);return{id:F5e,diagram:t}},"loader"),kmt={id:F5e,detector:wmt,loader:Tmt},Cmt=kmt,z5e="flowchart",Smt=w((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"),Emt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_ee);return{diagram:e}},void 0,import.meta.url);return{id:z5e,diagram:t}},"loader"),Amt={id:z5e,detector:Smt,loader:Emt},Rmt=Amt,H5e="flowchart-v2",_mt=w((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"),Mmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_ee);return{diagram:e}},void 0,import.meta.url);return{id:H5e,diagram:t}},"loader"),Lmt={id:H5e,detector:_mt,loader:Mmt},Imt=Lmt,V5e="swimlane",$mt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),Nmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>AUt);return{diagram:e}},void 0,import.meta.url);return{id:V5e,diagram:t}},"loader"),Dmt={id:V5e,detector:$mt,loader:Nmt},Omt=Dmt,W5e="er",Pmt=w(t=>/^\s*erDiagram/.test(t),"detector"),Bmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DUt);return{diagram:e}},void 0,import.meta.url);return{id:W5e,diagram:t}},"loader"),Fmt={id:W5e,detector:Pmt,loader:Bmt},zmt=Fmt,q5e="gitGraph",Hmt=w(t=>/^\s*gitGraph/.test(t),"detector"),Vmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>zor);return{diagram:e}},void 0,import.meta.url);return{id:q5e,diagram:t}},"loader"),Wmt={id:q5e,detector:Hmt,loader:Vmt},qmt=Wmt,G5e="gantt",Gmt=w(t=>/^\s*gantt/.test(t),"detector"),Umt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>jlr);return{diagram:e}},void 0,import.meta.url);return{id:G5e,diagram:t}},"loader"),Ymt={id:G5e,detector:Gmt,loader:Umt},jmt=Ymt,U5e="info",Xmt=w(t=>/^\s*info/.test(t),"detector"),Kmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>rcr);return{diagram:e}},void 0,import.meta.url);return{id:U5e,diagram:t}},"loader"),Zmt={id:U5e,detector:Xmt,loader:Kmt},Y5e="pie",Qmt=w(t=>/^\s*pie/.test(t),"detector"),Jmt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bcr);return{diagram:e}},void 0,import.meta.url);return{id:Y5e,diagram:t}},"loader"),e1t={id:Y5e,detector:Qmt,loader:Jmt},j5e="quadrantChart",t1t=w(t=>/^\s*quadrantChart/.test(t),"detector"),r1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Acr);return{diagram:e}},void 0,import.meta.url);return{id:j5e,diagram:t}},"loader"),n1t={id:j5e,detector:t1t,loader:r1t},i1t=n1t,X5e="xychart",a1t=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),s1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Vcr);return{diagram:e}},void 0,import.meta.url);return{id:X5e,diagram:t}},"loader"),o1t={id:X5e,detector:a1t,loader:s1t},l1t=o1t,K5e="requirement",c1t=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),u1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Kcr);return{diagram:e}},void 0,import.meta.url);return{id:K5e,diagram:t}},"loader"),h1t={id:K5e,detector:c1t,loader:u1t},d1t=h1t,Z5e="sequence",f1t=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),p1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Gur);return{diagram:e}},void 0,import.meta.url);return{id:Z5e,diagram:t}},"loader"),g1t={id:Z5e,detector:f1t,loader:p1t},m1t=g1t,Q5e="class",y1t=w((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"),v1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zur);return{diagram:e}},void 0,import.meta.url);return{id:Q5e,diagram:t}},"loader"),b1t={id:Q5e,detector:y1t,loader:v1t},x1t=b1t,J5e="classDiagram",w1t=w((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"),T1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Jur);return{diagram:e}},void 0,import.meta.url);return{id:J5e,diagram:t}},"loader"),k1t={id:J5e,detector:w1t,loader:T1t},C1t=k1t,eCe="state",S1t=w((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"),E1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Vhr);return{diagram:e}},void 0,import.meta.url);return{id:eCe,diagram:t}},"loader"),A1t={id:eCe,detector:S1t,loader:E1t},R1t=A1t,tCe="stateDiagram",_1t=w((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"),M1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>qhr);return{diagram:e}},void 0,import.meta.url);return{id:tCe,diagram:t}},"loader"),L1t={id:tCe,detector:_1t,loader:M1t},I1t=L1t,rCe="journey",$1t=w(t=>/^\s*journey/.test(t),"detector"),N1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ddr);return{diagram:e}},void 0,import.meta.url);return{id:rCe,diagram:t}},"loader"),D1t={id:rCe,detector:$1t,loader:N1t},O1t=D1t,P1t=w((t,e,r)=>{he.debug(`rendering svg for syntax error -`);const n=Po(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),_a(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"),nCe={draw:P1t},B1t=nCe,F1t={db:{},renderer:nCe,parser:{parse:w(()=>{},"parse")}},z1t=F1t,iCe="flowchart-elk",H1t=w((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"),V1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_ee);return{diagram:e}},void 0,import.meta.url);return{id:iCe,diagram:t}},"loader"),W1t={id:iCe,detector:H1t,loader:V1t},q1t=W1t,aCe="timeline",G1t=w(t=>/^\s*timeline/.test(t),"detector"),U1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hdr);return{diagram:e}},void 0,import.meta.url);return{id:aCe,diagram:t}},"loader"),Y1t={id:aCe,detector:G1t,loader:U1t},j1t=Y1t,sCe="mindmap",X1t=w(t=>/^\s*mindmap/.test(t),"detector"),K1t=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nfr);return{diagram:e}},void 0,import.meta.url);return{id:sCe,diagram:t}},"loader"),Z1t={id:sCe,detector:X1t,loader:K1t},Q1t=Z1t,oCe="kanban",J1t=w(t=>/^\s*kanban/.test(t),"detector"),eyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>kfr);return{diagram:e}},void 0,import.meta.url);return{id:oCe,diagram:t}},"loader"),tyt={id:oCe,detector:J1t,loader:eyt},ryt=tyt,lCe="sankey",nyt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),iyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>l0r);return{diagram:e}},void 0,import.meta.url);return{id:lCe,diagram:t}},"loader"),ayt={id:lCe,detector:nyt,loader:iyt},syt=ayt,cCe="packet",oyt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),lyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>b0r);return{diagram:e}},void 0,import.meta.url);return{id:cCe,diagram:t}},"loader"),cyt={id:cCe,detector:oyt,loader:lyt},uCe="radar",uyt=w(t=>/^\s*radar-beta/.test(t),"detector"),hyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>z0r);return{diagram:e}},void 0,import.meta.url);return{id:uCe,diagram:t}},"loader"),dyt={id:uCe,detector:uyt,loader:hyt},hCe="block",fyt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),pyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fgr);return{diagram:e}},void 0,import.meta.url);return{id:hCe,diagram:t}},"loader"),gyt={id:hCe,detector:fyt,loader:pyt},myt=gyt,dCe="treeView",yyt=w(t=>/^\s*treeView-beta/.test(t),"detector"),vyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pgr);return{diagram:e}},void 0,import.meta.url);return{id:dCe,diagram:t}},"loader"),byt={id:dCe,detector:yyt,loader:vyt},xyt=byt,fCe="architecture",wyt=w(t=>/^\s*architecture/.test(t),"detector"),Tyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hmr);return{diagram:e}},void 0,import.meta.url);return{id:fCe,diagram:t}},"loader"),kyt={id:fCe,detector:wyt,loader:Tyt},Cyt=kyt,pCe="eventmodeling",Syt=w(t=>/^\s*eventmodeling/.test(t),"detector"),Eyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Amr);return{diagram:e}},void 0,import.meta.url);return{id:pCe,diagram:t}},"loader"),Ayt={id:pCe,detector:Syt,loader:Eyt},Ryt=Ayt,gCe="ishikawa",_yt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),Myt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>qmr);return{diagram:e}},void 0,import.meta.url);return{id:gCe,diagram:t}},"loader"),Lyt={id:gCe,detector:_yt,loader:Myt},mCe="venn",Iyt=w(t=>/^\s*venn-beta/.test(t),"detector"),$yt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_1r);return{diagram:e}},void 0,import.meta.url);return{id:mCe,diagram:t}},"loader"),Nyt={id:mCe,detector:Iyt,loader:$yt},Dyt=Nyt,yCe="treemap",Oyt=w(t=>/^\s*treemap/.test(t),"detector"),Pyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>z1r);return{diagram:e}},void 0,import.meta.url);return{id:yCe,diagram:t}},"loader"),Byt={id:yCe,detector:Oyt,loader:Pyt},vCe="wardley",Fyt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),zyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Q1r);return{diagram:e}},void 0,import.meta.url);return{id:vCe,diagram:t}},"loader"),Hyt={id:vCe,detector:Fyt,loader:zyt},Vyt=Hyt,bCe="cynefin",Wyt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),qyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gyr);return{diagram:e}},void 0,import.meta.url);return{id:bCe,diagram:t}},"loader"),Gyt={id:bCe,detector:Wyt,loader:qyt},xCe="railroad",Uyt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),Yyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>zyr);return{diagram:e}},void 0,import.meta.url);return{id:xCe,diagram:t}},"loader"),jyt={id:xCe,detector:Uyt,loader:Yyt},wCe="railroadEbnf",Xyt=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),Kyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Xyr);return{diagram:e}},void 0,import.meta.url);return{id:wCe,diagram:t}},"loader"),Zyt={id:wCe,detector:Xyt,loader:Kyt},TCe="railroadAbnf",Qyt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),Jyt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>avr);return{diagram:e}},void 0,import.meta.url);return{id:TCe,diagram:t}},"loader"),evt={id:TCe,detector:Qyt,loader:Jyt},kCe="railroadPeg",tvt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),rvt=w(async()=>{const{diagram:t}=await xr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gvr);return{diagram:e}},void 0,import.meta.url);return{id:kCe,diagram:t}},"loader"),nvt={id:kCe,detector:tvt,loader:rvt},Ale=!1,V$=w(()=>{Ale||(Ale=!0,b9("error",z1t,t=>t.toLowerCase().trim()==="error"),b9("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{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:w(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),IV(q1t,Q1t,Cyt),IV(Cmt,ryt,C1t,x1t,zmt,jmt,Zmt,e1t,d1t,m1t,Omt,Imt,Rmt,j1t,qmt,I1t,R1t,O1t,i1t,syt,cyt,l1t,myt,Ryt,xyt,dyt,Lyt,Byt,jyt,Zyt,evt,nvt,Dyt,Vyt,Gyt))},"addDiagrams"),ivt=w(async()=>{he.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(H1).map(async([r,{detector:n,loader:i}])=>{if(i)try{PV(r)}catch{try{const{diagram:a,id:s}=await i();b9(s,a,n)}catch(a){throw he.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete H1[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){he.error(`Failed to load ${e.length} external diagrams`);for(const r of e)he.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),avt="graphics-document document";function CCe(t,e){t.attr("role",avt),e!==""&&t.attr("aria-roledescription",e)}w(CCe,"setA11yDiagramInfo");function SCe(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)}}}w(SCe,"addSVGa11yTitleDescription");var M1,$W=(M1=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=pr(),i=sK(e,n);e=A0t(e)+` -`;try{PV(i)}catch{const d=Gat(i);if(!d)throw new zxe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();b9(f,p)}const{db:a,parser:s,renderer:o,init:l}=PV(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 M1(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}},w(M1,"Diagram"),M1),Rle=[],svt=w(()=>{Rle.forEach(t=>{t()}),Rle=[]},"attachFunctions"),ovt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ECe(t){const e=t.match(Fxe);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),tmt=w((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"),rmt=w((t,e,r)=>{const n=pr(),{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"),nmt={extension:Dgt,composition:Ogt,aggregation:Pgt,dependency:Bgt,lollipop:Fgt,point:zgt,circle:Hgt,cross:Vgt,barb:Wgt,barbNeo:qgt,only_one:Ggt,zero_or_one:Ugt,one_or_more:Ygt,zero_or_more:jgt,only_one_neo:Xgt,zero_or_one_neo:Kgt,one_or_more_neo:Zgt,zero_or_more_neo:Qgt,requirement_arrow:Jgt,requirement_contains:tmt,requirement_arrow_neo:emt,requirement_contains_neo:rmt},pZ=Ngt,imt={common:Ft,getConfig:pr,insertCluster:z$,insertEdge:fZ,insertEdgeLabel:nM,insertMarkers:pZ,insertNode:vE,interpolateToCurve:UK,labelHelper:Ur,log:he,positionEdgeLabel:_5e},DS={},$5e=w(t=>{for(const e of t)DS[e.name]=e},"registerLayoutLoaders"),amt=w(()=>{$5e([{name:"dagre",loader:w(async()=>await wr(()=>Promise.resolve().then(()=>wBt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await wr(()=>Promise.resolve().then(()=>$Bt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await wr(()=>Promise.resolve().then(()=>kGt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");amt();var I3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in DS))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=DS[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,imt,{algorithm:n.algorithm},r)},"render"),bE=w((t="",{fallback:e="dagre"}={})=>{if(t in DS)return t;if(e in DS)return he.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"),gZ="comm",N5e="rule",D5e="decl",smt="@media",omt="@import",lmt="@supports",cmt="@namespace",LW="@keyframes",O5e="@layer",umt="@scope",hmt=Math.abs,EC=String.fromCharCode;function P5e(t){return t.trim()}function IW(t,e,r){return t.replace(e,r)}function lb(t,e){return t.charCodeAt(e)|0}function $T(t,e,r){return t.slice(e,r)}function Nh(t){return t.length}function B5e(t){return t.length}function nA(t,e){return e.push(t),t}var V$=1,NT=1,F5e=0,cu=0,Ya=0,$3="";function mZ(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:V$,column:NT,length:s,return:"",siblings:o}}function dmt(){return Ya}function fmt(){return Ya=cu>0?lb($3,--cu):0,NT--,Ya===10&&(NT=1,V$--),Ya}function Uu(){return Ya=cu2||OS(Ya)>3?"":" "}function ymt(t,e){for(;--e&&Uu()&&!(Ya<48||Ya>102||Ya>57&&Ya<65||Ya>70&&Ya<97););return W$(t,sR()+(e<6&&pp()==32&&Uu()==32))}function $W(t){for(;Uu();)switch(Ya){case t:return cu;case 34:case 39:t!==34&&t!==39&&$W(Ya);break;case 40:t===41&&$W(t);break;case 92:Uu();break}return cu}function vmt(t,e){for(;Uu()&&t+Ya!==57;)if(t+Ya===84&&pp()===47)break;return"/*"+W$(e,cu-1)+"*"+EC(t===47?t:Uu())}function bmt(t){for(;!OS(pp());)Uu();return W$(t,cu)}function xmt(t){return gmt(oR("",null,null,null,[""],t=pmt(t),0,[0],t))}function oR(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,x=0,b=0,T="",k=i,S=a,C=n,E=T;y;)switch(g=b,b=Uu()){case 40:g!=108&&lb(E,d-1)==58?(x++,E+="("):E+=YP(b);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=YP(b);break;case 9:case 10:case 13:case 32:if(x>0){E+=EC(b);break}E+=mmt(g);break;case 92:E+=ymt(sR()-1,7);continue;case 47:switch(pp()){case 42:case 47:nA(wmt(vmt(Uu(),sR()),e,r,l),l),(OS(g||1)==5||OS(pp()||1)==5)&&Nh(E)&&$T(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=Nh(E)*v;case 125*m:case 59:case 0:if(x>0&&b){E+=EC(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=IW(E,/\f/g,"")),p>0&&(Nh(E)-d||m===0)&&nA(p>32?Rle(E+";",n,r,d-1,l):Rle(IW(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(nA(C=Ale(E,e,r,u,h,i,o,T,k=[],S=[],d,a),a),b===123)if(h===0)oR(E,e,C,C,k,a,d,o,S);else{switch(f){case 99:if(lb(E,3)===110)break;case 108:if(lb(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?oR(t,C,C,n&&nA(Ale(t,C,C,0,0,i,o,T,i,k=[],d,S),S),i,S,d,o,n?k:S):oR(E,C,C,C,[""],S,0,o,S)}}u=h=p=0,m=v=1,T=E="",d=s;break;case 58:d=1+Nh(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&fmt()==125)continue}switch(E+=EC(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(x>0)break;o[u++]=(Nh(E)-1)*v,v=1;break;case 64:pp()===45&&(E+=YP(Uu())),f=pp(),h=d=Nh(T=E+=bmt(sR())),b++;break;case 45:g===45&&Nh(E)==2&&(m=0)}}return a}function Ale(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=B5e(p),m=0,y=0,v=0;m0?p[x]+" "+b:IW(b,/&\f/g,p[x])))&&(l[v++]=T);return mZ(t,e,r,i===0?N5e:o,l,u,h,d)}function wmt(t,e,r,n){return mZ(t,e,r,gZ,EC(dmt()),$T(t,2,-2),0,n)}function Rle(t,e,r,n,i){return mZ(t,e,r,D5e,$T(t,0,n),$T(t,n+1,-1),n,i)}function NW(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Smt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vUt);return{diagram:e}},void 0,import.meta.url);return{id:z5e,diagram:t}},"loader"),Emt={id:z5e,detector:Cmt,loader:Smt},Amt=Emt,H5e="flowchart",Rmt=w((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"),_mt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lee);return{diagram:e}},void 0,import.meta.url);return{id:H5e,diagram:t}},"loader"),Mmt={id:H5e,detector:Rmt,loader:_mt},Lmt=Mmt,V5e="flowchart-v2",Imt=w((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"),$mt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lee);return{diagram:e}},void 0,import.meta.url);return{id:V5e,diagram:t}},"loader"),Nmt={id:V5e,detector:Imt,loader:$mt},Dmt=Nmt,W5e="swimlane",Omt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),Pmt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$Ut);return{diagram:e}},void 0,import.meta.url);return{id:W5e,diagram:t}},"loader"),Bmt={id:W5e,detector:Omt,loader:Pmt},Fmt=Bmt,q5e="er",zmt=w(t=>/^\s*erDiagram/.test(t),"detector"),Hmt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>HUt);return{diagram:e}},void 0,import.meta.url);return{id:q5e,diagram:t}},"loader"),Vmt={id:q5e,detector:zmt,loader:Hmt},Wmt=Vmt,G5e="gitGraph",qmt=w(t=>/^\s*gitGraph/.test(t),"detector"),Gmt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Uor);return{diagram:e}},void 0,import.meta.url);return{id:G5e,diagram:t}},"loader"),Umt={id:G5e,detector:qmt,loader:Gmt},Ymt=Umt,U5e="gantt",jmt=w(t=>/^\s*gantt/.test(t),"detector"),Xmt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ecr);return{diagram:e}},void 0,import.meta.url);return{id:U5e,diagram:t}},"loader"),Kmt={id:U5e,detector:jmt,loader:Xmt},Zmt=Kmt,Y5e="info",Qmt=w(t=>/^\s*info/.test(t),"detector"),Jmt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lcr);return{diagram:e}},void 0,import.meta.url);return{id:Y5e,diagram:t}},"loader"),e1t={id:Y5e,detector:Qmt,loader:Jmt},j5e="pie",t1t=w(t=>/^\s*pie/.test(t),"detector"),r1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Scr);return{diagram:e}},void 0,import.meta.url);return{id:j5e,diagram:t}},"loader"),n1t={id:j5e,detector:t1t,loader:r1t},X5e="quadrantChart",i1t=w(t=>/^\s*quadrantChart/.test(t),"detector"),a1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$cr);return{diagram:e}},void 0,import.meta.url);return{id:X5e,diagram:t}},"loader"),s1t={id:X5e,detector:i1t,loader:a1t},o1t=s1t,K5e="xychart",l1t=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),c1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>jcr);return{diagram:e}},void 0,import.meta.url);return{id:K5e,diagram:t}},"loader"),u1t={id:K5e,detector:l1t,loader:c1t},h1t=u1t,Z5e="requirement",d1t=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),f1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>rur);return{diagram:e}},void 0,import.meta.url);return{id:Z5e,diagram:t}},"loader"),p1t={id:Z5e,detector:d1t,loader:f1t},g1t=p1t,Q5e="sequence",m1t=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),y1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zur);return{diagram:e}},void 0,import.meta.url);return{id:Q5e,diagram:t}},"loader"),v1t={id:Q5e,detector:m1t,loader:y1t},b1t=v1t,J5e="class",x1t=w((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"),w1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nhr);return{diagram:e}},void 0,import.meta.url);return{id:J5e,diagram:t}},"loader"),T1t={id:J5e,detector:x1t,loader:w1t},k1t=T1t,eCe="classDiagram",C1t=w((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"),S1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ahr);return{diagram:e}},void 0,import.meta.url);return{id:eCe,diagram:t}},"loader"),E1t={id:eCe,detector:C1t,loader:S1t},A1t=E1t,tCe="state",R1t=w((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"),_1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>jhr);return{diagram:e}},void 0,import.meta.url);return{id:tCe,diagram:t}},"loader"),M1t={id:tCe,detector:R1t,loader:_1t},L1t=M1t,rCe="stateDiagram",I1t=w((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"),$1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Khr);return{diagram:e}},void 0,import.meta.url);return{id:rCe,diagram:t}},"loader"),N1t={id:rCe,detector:I1t,loader:$1t},D1t=N1t,nCe="journey",O1t=w(t=>/^\s*journey/.test(t),"detector"),P1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vdr);return{diagram:e}},void 0,import.meta.url);return{id:nCe,diagram:t}},"loader"),B1t={id:nCe,detector:O1t,loader:P1t},F1t=B1t,z1t=w((t,e,r)=>{he.debug(`rendering svg for syntax error +`);const n=Po(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),_a(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"),iCe={draw:z1t},H1t=iCe,V1t={db:{},renderer:iCe,parser:{parse:w(()=>{},"parse")}},W1t=V1t,aCe="flowchart-elk",q1t=w((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"),G1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Lee);return{diagram:e}},void 0,import.meta.url);return{id:aCe,diagram:t}},"loader"),U1t={id:aCe,detector:q1t,loader:G1t},Y1t=U1t,sCe="timeline",j1t=w(t=>/^\s*timeline/.test(t),"detector"),X1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ydr);return{diagram:e}},void 0,import.meta.url);return{id:sCe,diagram:t}},"loader"),K1t={id:sCe,detector:j1t,loader:X1t},Z1t=K1t,oCe="mindmap",Q1t=w(t=>/^\s*mindmap/.test(t),"detector"),J1t=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>cfr);return{diagram:e}},void 0,import.meta.url);return{id:oCe,diagram:t}},"loader"),eyt={id:oCe,detector:Q1t,loader:J1t},tyt=eyt,lCe="kanban",ryt=w(t=>/^\s*kanban/.test(t),"detector"),nyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>_fr);return{diagram:e}},void 0,import.meta.url);return{id:lCe,diagram:t}},"loader"),iyt={id:lCe,detector:ryt,loader:nyt},ayt=iyt,cCe="sankey",syt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),oyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>p0r);return{diagram:e}},void 0,import.meta.url);return{id:cCe,diagram:t}},"loader"),lyt={id:cCe,detector:syt,loader:oyt},cyt=lyt,uCe="packet",uyt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),hyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>S0r);return{diagram:e}},void 0,import.meta.url);return{id:uCe,diagram:t}},"loader"),dyt={id:uCe,detector:uyt,loader:hyt},hCe="radar",fyt=w(t=>/^\s*radar-beta/.test(t),"detector"),pyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>U0r);return{diagram:e}},void 0,import.meta.url);return{id:hCe,diagram:t}},"loader"),gyt={id:hCe,detector:fyt,loader:pyt},dCe="block",myt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),yyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bgr);return{diagram:e}},void 0,import.meta.url);return{id:dCe,diagram:t}},"loader"),vyt={id:dCe,detector:myt,loader:yyt},byt=vyt,fCe="treeView",xyt=w(t=>/^\s*treeView-beta/.test(t),"detector"),wyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wgr);return{diagram:e}},void 0,import.meta.url);return{id:fCe,diagram:t}},"loader"),Tyt={id:fCe,detector:xyt,loader:wyt},kyt=Tyt,pCe="architecture",Cyt=w(t=>/^\s*architecture/.test(t),"detector"),Syt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ymr);return{diagram:e}},void 0,import.meta.url);return{id:pCe,diagram:t}},"loader"),Eyt={id:pCe,detector:Cyt,loader:Syt},Ayt=Eyt,gCe="eventmodeling",Ryt=w(t=>/^\s*eventmodeling/.test(t),"detector"),_yt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>$mr);return{diagram:e}},void 0,import.meta.url);return{id:gCe,diagram:t}},"loader"),Myt={id:gCe,detector:Ryt,loader:_yt},Lyt=Myt,mCe="ishikawa",Iyt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),$yt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Kmr);return{diagram:e}},void 0,import.meta.url);return{id:mCe,diagram:t}},"loader"),Nyt={id:mCe,detector:Iyt,loader:$yt},yCe="venn",Dyt=w(t=>/^\s*venn-beta/.test(t),"detector"),Oyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>D1r);return{diagram:e}},void 0,import.meta.url);return{id:yCe,diagram:t}},"loader"),Pyt={id:yCe,detector:Dyt,loader:Oyt},Byt=Pyt,vCe="treemap",Fyt=w(t=>/^\s*treemap/.test(t),"detector"),zyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>U1r);return{diagram:e}},void 0,import.meta.url);return{id:vCe,diagram:t}},"loader"),Hyt={id:vCe,detector:Fyt,loader:zyt},bCe="wardley",Vyt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),Wyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>iyr);return{diagram:e}},void 0,import.meta.url);return{id:bCe,diagram:t}},"loader"),qyt={id:bCe,detector:Vyt,loader:Wyt},Gyt=qyt,xCe="cynefin",Uyt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),Yyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wyr);return{diagram:e}},void 0,import.meta.url);return{id:xCe,diagram:t}},"loader"),jyt={id:xCe,detector:Uyt,loader:Yyt},wCe="railroad",Xyt=w(t=>/^\s*railroad-beta/i.test(t),"detector"),Kyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Uyr);return{diagram:e}},void 0,import.meta.url);return{id:wCe,diagram:t}},"loader"),Zyt={id:wCe,detector:Xyt,loader:Kyt},TCe="railroadEbnf",Qyt=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),Jyt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>tvr);return{diagram:e}},void 0,import.meta.url);return{id:TCe,diagram:t}},"loader"),evt={id:TCe,detector:Qyt,loader:Jyt},kCe="railroadAbnf",tvt=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),rvt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hvr);return{diagram:e}},void 0,import.meta.url);return{id:kCe,diagram:t}},"loader"),nvt={id:kCe,detector:tvt,loader:rvt},CCe="railroadPeg",ivt=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),avt=w(async()=>{const{diagram:t}=await wr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wvr);return{diagram:e}},void 0,import.meta.url);return{id:CCe,diagram:t}},"loader"),svt={id:CCe,detector:ivt,loader:avt},_le=!1,q$=w(()=>{_le||(_le=!0,x9("error",W1t,t=>t.toLowerCase().trim()==="error"),x9("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{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:w(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),NV(Y1t,tyt,Ayt),NV(Amt,ayt,A1t,k1t,Wmt,Zmt,e1t,n1t,g1t,b1t,Fmt,Dmt,Lmt,Z1t,Ymt,D1t,L1t,F1t,o1t,cyt,dyt,h1t,byt,Lyt,kyt,gyt,Nyt,Hyt,Zyt,evt,nvt,svt,Byt,Gyt,jyt))},"addDiagrams"),ovt=w(async()=>{he.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(H1).map(async([r,{detector:n,loader:i}])=>{if(i)try{FV(r)}catch{try{const{diagram:a,id:s}=await i();x9(s,a,n)}catch(a){throw he.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete H1[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){he.error(`Failed to load ${e.length} external diagrams`);for(const r of e)he.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),lvt="graphics-document document";function SCe(t,e){t.attr("role",lvt),e!==""&&t.attr("aria-roledescription",e)}w(SCe,"setA11yDiagramInfo");function ECe(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)}}}w(ECe,"addSVGa11yTitleDescription");var M1,DW=(M1=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=pr(),i=lK(e,n);e=M0t(e)+` +`;try{FV(i)}catch{const d=jat(i);if(!d)throw new Hxe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();x9(f,p)}const{db:a,parser:s,renderer:o,init:l}=FV(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 M1(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}},w(M1,"Diagram"),M1),Mle=[],cvt=w(()=>{Mle.forEach(t=>{t()}),Mle=[]},"attachFunctions"),uvt=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ACe(t){const e=t.match(zxe);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=M$(n,{schema:_$})??{};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}}w(ECe,"extractFrontMatter");var lvt=w(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),cvt=w(t=>{const{text:e,metadata:r}=ECe(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"),uvt=w(t=>{const e=Vr.detectInit(t)??{},r=Vr.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:y0t(t),directive:e}},"processDirectives");function gZ(t){const e=lvt(t),r=cvt(e),n=uvt(r.text),i=Gi(r.config,n.directive);return t=ovt(n.text),{code:t,title:r.title,config:i}}w(gZ,"preprocessDiagram");function ACe(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(ACe,"toBase64");var hvt=5e4,dvt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",fvt="sandbox",pvt="loose",gvt="http://www.w3.org/2000/svg",mvt="http://www.w3.org/1999/xlink",yvt="http://www.w3.org/1999/xhtml",vvt="100%",bvt="100%",xvt="border:0;margin:0;",wvt="margin:0",Tvt="allow-top-navigation-by-user-activation allow-popups",kvt='The "iframe" tag is not supported by your browser.',Cvt=["foreignobject"],Svt=["dominant-baseline"];function mZ(t){const e=gZ(t);return y9(),Hat(e.config??{}),e}w(mZ,"processAndSetConfigs");async function RCe(t,e){V$();try{const{code:r,config:n}=mZ(t);return{diagramType:(await MCe(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(RCe,"parse");var _le=w((t,e,r=[])=>{const n=$xe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),Evt=w((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=ti(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{Voe(l.styles)||o.forEach(u=>{r.insertRule(_le(l.id,u,l.styles),r.cssRules.length)}),Voe(l.textStyles)||r.insertRule(_le(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=DV(i)+` +`):e[2];let i=I$(n,{schema:L$})??{};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}}w(ACe,"extractFrontMatter");var hvt=w(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),dvt=w(t=>{const{text:e,metadata:r}=ACe(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"),fvt=w(t=>{const e=Vr.detectInit(t)??{},r=Vr.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:x0t(t),directive:e}},"processDirectives");function yZ(t){const e=hvt(t),r=dvt(e),n=fvt(r.text),i=Gi(r.config,n.directive);return t=uvt(n.text),{code:t,title:r.title,config:i}}w(yZ,"preprocessDiagram");function RCe(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(RCe,"toBase64");var pvt=5e4,gvt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",mvt="sandbox",yvt="loose",vvt="http://www.w3.org/2000/svg",bvt="http://www.w3.org/1999/xlink",xvt="http://www.w3.org/1999/xhtml",wvt="100%",Tvt="100%",kvt="border:0;margin:0;",Cvt="margin:0",Svt="allow-top-navigation-by-user-activation allow-popups",Evt='The "iframe" tag is not supported by your browser.',Avt=["foreignobject"],Rvt=["dominant-baseline"];function vZ(t){const e=yZ(t);return v9(),qat(e.config??{}),e}w(vZ,"processAndSetConfigs");async function _Ce(t,e){q$();try{const{code:r,config:n}=vZ(t);return{diagramType:(await LCe(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(_Ce,"parse");var Lle=w((t,e,r=[])=>{const n=Nxe(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),_vt=w((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=ti(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{qoe(l.styles)||o.forEach(u=>{r.insertRule(Lle(l.id,u,l.styles),r.cssRules.length)}),qoe(l.textStyles)||r.insertRule(Lle(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=PV(i)+` `}else n+=`${t.themeCSS} -`;return n+DV(r)},"createCssStyles"),Avt=w((t,e)=>IW(ymt(`${t}{${e}}`),xmt([w(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===_W)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("@")&&([...[nmt,amt,D5e,omt,"@container","@starting-style"],_W].includes(n.type)||(he.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=fZ))},"addNamespace"),bmt])),"compileCSS"),Rvt=w((t,e,r,n)=>{const i=Evt(t,r),a=ost(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return Avt(n,a)},"createUserStyles"),_vt=w((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Wf(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),Mvt=w((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":bvt,n=ACe(`${t}`);return``},"putIntoIFrame"),Mle=w((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",gvt);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function NW(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(NW,"sandboxedIframe");var Lvt=w((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"),Ivt=w(async function(t,e,r){var P,N,_,I,O,D;V$();const n=mZ(e);e=n.code;const i=pr();he.debug(i),e.length>((i==null?void 0:i.maxTextSize)??hvt)&&(e=dvt);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=w(()=>{const F=bt(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=bt(document.body);const f=i.securityLevel===fvt,p=i.securityLevel===pvt,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const $=NW(bt(r),s);d=bt($.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=bt(r);Mle(d,t,l,`font-family: ${g}`,mvt)}else{if(Lvt(document,t,l,s),f){const $=NW(bt(document.body),s);d=bt($.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=bt("body");Mle(d,t,l)}let m,y;try{m=await $W.fromText(e,{title:n.title})}catch($){if(i.suppressErrorRendering)throw h(),$;m=await $W.fromText("error"),y=$}const v=d.select(u).node(),x=m.type,b=v.firstChild,T=b.firstChild,k=(N=(P=m.renderer).getClasses)==null?void 0:N.call(P,e,m),S=Rvt(i,x,k,a),C=document.createElement("style");C.innerHTML=S,b.insertBefore(C,T);try{await m.renderer.draw(e,t,"11.16.1",m)}catch($){throw i.suppressErrorRendering?h():B1t.draw(e,t,"11.16.1"),$}const E=d.select(`${u} svg`),A=(I=(_=m.db).getAccTitle)==null?void 0:I.call(_),M=(D=(O=m.db).getAccDescription)==null?void 0:D.call(O);LCe(x,E,A,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",yvt);let L=d.select(u).node().innerHTML;if(he.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=_vt(L,f,pd(i.arrowMarkerAbsolute)),f){const $=d.select(u+" svg").node();L=Mvt(L,$)}else p||(L=Ff.sanitize(L,{ADD_TAGS:Cvt,ADD_ATTR:Svt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(svt(),y)throw y;return h(),{diagramType:x,svg:L,bindFunctions:m.db.bindFunctions}},"render");function _Ce(t={}){var n;const e=ja({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Fat(e),e!=null&&e.theme&&e.theme in Mf?e.themeVariables=Mf[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Mf.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Bat(e):Nxe();nK(r.logLevel),V$()}w(_Ce,"initialize");var MCe=w((t,e={})=>{const{code:r}=gZ(t);return $W.fromText(r,e)},"getDiagramFromText");function LCe(t,e,r,n){CCe(e,t),SCe(e,r,n,e.attr("id"))}w(LCe,"addA11yInfo");var X1=Object.freeze({render:Ivt,parse:RCe,getDiagramFromText:MCe,initialize:_Ce,getConfig:pr,setConfig:Dxe,getSiteConfig:Nxe,updateSiteConfig:zat,reset:w(()=>{y9()},"reset"),globalReset:w(()=>{y9(kT)},"globalReset"),defaultConfig:kT});nK(pr().logLevel);y9(pr());var $vt=w((t,e,r)=>{he.warn(t),jK(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"),ICe=w(async function(t={querySelector:".mermaid"}){try{await Nvt(t)}catch(e){if(jK(e)&&he.error(e.str),yc.parseError&&yc.parseError(e),!t.suppressErrors)throw he.error("Use the suppressErrors option to suppress these errors"),e}},"run"),Nvt=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=X1.getConfig();he.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");he.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(he.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),X1.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Vr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(he.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=O3e(Vr.entityDecode(s)).trim().replace(//gi,"
");const h=Vr.detectInit(s);h&&he.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await OCe(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){$vt(d,o,yc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),$Ce=w(function(t){X1.initialize(t)},"initialize"),Dvt=w(async function(t,e,r){he.warn("mermaid.init is deprecated. Please use run instead."),t&&$Ce(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await ICe(n)},"init"),Ovt=w(async(t,{lazyLoad:e=!0}={})=>{V$(),IV(...t),e===!1&&await ivt()},"registerExternalDiagrams"),NCe=w(function(){if(yc.startOnLoad){const{startOnLoad:t}=X1.getConfig();t&&yc.run().catch(e=>he.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",NCe,!1);var Pvt=w(function(t){yc.parseError=t},"setParseErrorHandler"),nM=[],UP=!1,DCe=w(async()=>{if(!UP){for(UP=!0;nM.length>0;){const t=nM.shift();if(t)try{await t()}catch(e){he.error("Error executing queue",e)}}UP=!1}},"executeQueue"),Bvt=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((a,s)=>{X1.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;he.error("Error parsing",o),(l=yc.parseError)==null||l.call(yc,o),s(o),n(o)})}),"performCall");nM.push(i),DCe().catch(n)}),"parse"),OCe=w((t,e,r)=>new Promise((n,i)=>{const a=w(()=>new Promise((s,o)=>{X1.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;he.error("Error parsing",l),(u=yc.parseError)==null||u.call(yc,l),o(l),i(l)})}),"performCall");nM.push(a),DCe().catch(i)}),"render"),Fvt=w(()=>Object.keys(H1).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),yc={startOnLoad:!0,mermaidAPI:X1,parse:Bvt,render:OCe,init:Dvt,run:ICe,registerExternalDiagrams:Ovt,registerLayoutLoaders:I5e,initialize:$Ce,parseError:void 0,contentLoaded:NCe,setParseErrorHandler:Pvt,detectType:sK,registerIconPacks:KK,getRegisteredDiagramsMetadata:Fvt},Lle=yc;/*! Check if previously processed *//*! +`;return n+PV(r)},"createCssStyles"),Mvt=w((t,e)=>NW(xmt(`${t}{${e}}`),kmt([w(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===LW)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("@")&&([...[smt,lmt,O5e,umt,"@container","@starting-style"],LW].includes(n.type)||(he.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=gZ))},"addNamespace"),Tmt])),"compileCSS"),Lvt=w((t,e,r,n)=>{const i=_vt(t,r),a=ust(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return Mvt(n,a)},"createUserStyles"),Ivt=w((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Wf(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),$vt=w((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":Tvt,n=RCe(`${t}`);return``},"putIntoIFrame"),Ile=w((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",vvt);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function OW(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(OW,"sandboxedIframe");var Nvt=w((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"),Dvt=w(async function(t,e,r){var P,N,_,I,O,D;q$();const n=vZ(e);e=n.code;const i=pr();he.debug(i),e.length>((i==null?void 0:i.maxTextSize)??pvt)&&(e=gvt);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=w(()=>{const F=bt(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=bt(document.body);const f=i.securityLevel===mvt,p=i.securityLevel===yvt,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const $=OW(bt(r),s);d=bt($.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=bt(r);Ile(d,t,l,`font-family: ${g}`,bvt)}else{if(Nvt(document,t,l,s),f){const $=OW(bt(document.body),s);d=bt($.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=bt("body");Ile(d,t,l)}let m,y;try{m=await DW.fromText(e,{title:n.title})}catch($){if(i.suppressErrorRendering)throw h(),$;m=await DW.fromText("error"),y=$}const v=d.select(u).node(),x=m.type,b=v.firstChild,T=b.firstChild,k=(N=(P=m.renderer).getClasses)==null?void 0:N.call(P,e,m),S=Lvt(i,x,k,a),C=document.createElement("style");C.innerHTML=S,b.insertBefore(C,T);try{await m.renderer.draw(e,t,"11.16.1",m)}catch($){throw i.suppressErrorRendering?h():H1t.draw(e,t,"11.16.1"),$}const E=d.select(`${u} svg`),A=(I=(_=m.db).getAccTitle)==null?void 0:I.call(_),M=(D=(O=m.db).getAccDescription)==null?void 0:D.call(O);ICe(x,E,A,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",xvt);let L=d.select(u).node().innerHTML;if(he.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=Ivt(L,f,gd(i.arrowMarkerAbsolute)),f){const $=d.select(u+" svg").node();L=$vt(L,$)}else p||(L=Ff.sanitize(L,{ADD_TAGS:Avt,ADD_ATTR:Rvt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(cvt(),y)throw y;return h(),{diagramType:x,svg:L,bindFunctions:m.db.bindFunctions}},"render");function MCe(t={}){var n;const e=ja({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Vat(e),e!=null&&e.theme&&e.theme in Mf?e.themeVariables=Mf[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Mf.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Hat(e):Dxe();aK(r.logLevel),q$()}w(MCe,"initialize");var LCe=w((t,e={})=>{const{code:r}=yZ(t);return DW.fromText(r,e)},"getDiagramFromText");function ICe(t,e,r,n){SCe(e,t),ECe(e,r,n,e.attr("id"))}w(ICe,"addA11yInfo");var X1=Object.freeze({render:Dvt,parse:_Ce,getDiagramFromText:LCe,initialize:MCe,getConfig:pr,setConfig:Oxe,getSiteConfig:Dxe,updateSiteConfig:Wat,reset:w(()=>{v9()},"reset"),globalReset:w(()=>{v9(kT)},"globalReset"),defaultConfig:kT});aK(pr().logLevel);v9(pr());var Ovt=w((t,e,r)=>{he.warn(t),KK(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"),$Ce=w(async function(t={querySelector:".mermaid"}){try{await Pvt(t)}catch(e){if(KK(e)&&he.error(e.str),yc.parseError&&yc.parseError(e),!t.suppressErrors)throw he.error("Use the suppressErrors option to suppress these errors"),e}},"run"),Pvt=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=X1.getConfig();he.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");he.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(he.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),X1.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Vr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(he.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=P3e(Vr.entityDecode(s)).trim().replace(//gi,"
");const h=Vr.detectInit(s);h&&he.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await PCe(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){Ovt(d,o,yc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),NCe=w(function(t){X1.initialize(t)},"initialize"),Bvt=w(async function(t,e,r){he.warn("mermaid.init is deprecated. Please use run instead."),t&&NCe(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await $Ce(n)},"init"),Fvt=w(async(t,{lazyLoad:e=!0}={})=>{q$(),NV(...t),e===!1&&await ovt()},"registerExternalDiagrams"),DCe=w(function(){if(yc.startOnLoad){const{startOnLoad:t}=X1.getConfig();t&&yc.run().catch(e=>he.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",DCe,!1);var zvt=w(function(t){yc.parseError=t},"setParseErrorHandler"),iM=[],jP=!1,OCe=w(async()=>{if(!jP){for(jP=!0;iM.length>0;){const t=iM.shift();if(t)try{await t()}catch(e){he.error("Error executing queue",e)}}jP=!1}},"executeQueue"),Hvt=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((a,s)=>{X1.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;he.error("Error parsing",o),(l=yc.parseError)==null||l.call(yc,o),s(o),n(o)})}),"performCall");iM.push(i),OCe().catch(n)}),"parse"),PCe=w((t,e,r)=>new Promise((n,i)=>{const a=w(()=>new Promise((s,o)=>{X1.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;he.error("Error parsing",l),(u=yc.parseError)==null||u.call(yc,l),o(l),i(l)})}),"performCall");iM.push(a),OCe().catch(i)}),"render"),Vvt=w(()=>Object.keys(H1).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),yc={startOnLoad:!0,mermaidAPI:X1,parse:Hvt,render:PCe,init:Bvt,run:$Ce,registerExternalDiagrams:Fvt,registerLayoutLoaders:$5e,initialize:NCe,parseError:void 0,contentLoaded:DCe,setParseErrorHandler:zvt,detectType:lK,registerIconPacks:QK,getRegisteredDiagramsMetadata:Vvt},$le=yc;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */function zvt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const Hvt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function _p(t){const e=[];for(let r=0,n=t.length;rlc||t.height>lc)&&(t.width>lc&&t.height>lc?t.width>t.height?(t.height*=lc/t.width,t.width=lc):(t.width*=lc/t.height,t.height=lc):t.width>lc?(t.height*=lc/t.width,t.width=lc):(t.width*=lc/t.height,t.height=lc))}function aM(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function Uvt(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Yvt(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(t),Uvt(i)}const jl=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||jl(r,e)};function jvt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Xvt(t,e){return PCe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function Kvt(t,e,r,n){const i=`.${t}:${e}`,a=r.cssText?jvt(r):Xvt(r,n);return document.createTextNode(`${i}{${a}}`)}function Ile(t,e,r,n){const i=window.getComputedStyle(t,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const s=Hvt();try{e.className=`${e.className} ${s}`}catch{return}const o=document.createElement("style");o.appendChild(Kvt(s,r,i,n)),e.appendChild(o)}function Zvt(t,e,r){Ile(t,e,":before",r),Ile(t,e,":after",r)}const $le="application/font-woff",Nle="image/jpeg",Qvt={woff:$le,woff2:$le,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Nle,jpeg:Nle,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Jvt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function yZ(t){const e=Jvt(t).toLowerCase();return Qvt[e]||""}function e2t(t){return t.split(/,/)[1]}function DW(t){return t.search(/^(data:)/)!==-1}function t2t(t,e){return`data:${e};base64,${t}`}async function FCe(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(l){s(l)}},o.readAsDataURL(i)})}const YP={};function r2t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function vZ(t,e,r){const n=r2t(t,e,r.includeQueryParams);if(YP[n]!=null)return YP[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const a=await FCe(t,r.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),e2t(o)));i=t2t(a,e)}catch(a){i=r.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;a&&(s=typeof a=="string"?a:a.message),s&&console.warn(s)}return YP[n]=i,i}async function n2t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):aM(e)}async function i2t(t,e){if(t.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");a.width=t.clientWidth,a.height=t.clientHeight,s==null||s.drawImage(t,0,0,a.width,a.height);const o=a.toDataURL();return aM(o)}const r=t.poster,n=yZ(r),i=await vZ(r,n,e);return aM(i)}async function a2t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await W$(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function s2t(t,e){return jl(t,HTMLCanvasElement)?n2t(t):jl(t,HTMLVideoElement)?i2t(t,e):jl(t,HTMLIFrameElement)?a2t(t,e):t.cloneNode(zCe(t))}const o2t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",zCe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function l2t(t,e,r){var n,i;if(zCe(e))return e;let a=[];return o2t(t)&&t.assignedNodes?a=_p(t.assignedNodes()):jl(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?a=_p(t.contentDocument.body.childNodes):a=_p(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),a.length===0||jl(t,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>W$(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function c2t(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):PCe(r).forEach(a=>{let s=i.getPropertyValue(a);a==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),jl(t,HTMLIFrameElement)&&a==="display"&&s==="inline"&&(s="block"),a==="d"&&e.getAttribute("d")&&(s=`path(${e.getAttribute("d")})`),n.setProperty(a,s,i.getPropertyPriority(a))})}function u2t(t,e){jl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),jl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function h2t(t,e){if(jl(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function d2t(t,e,r){return jl(e,Element)&&(c2t(t,e,r),Zvt(t,e,r),u2t(t,e),h2t(t,e)),e}async function f2t(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let a=0;as2t(n,e)).then(n=>l2t(t,n,e)).then(n=>d2t(t,n,e)).then(n=>f2t(n,e))}const HCe=/url\((['"]?)([^'"]+?)\1\)/g,p2t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,g2t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function m2t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function y2t(t){const e=[];return t.replace(HCe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!DW(r))}async function v2t(t,e,r,n,i){try{const a=r?zvt(e,r):e,s=yZ(e);let o;return i||(o=await vZ(a,s,n)),t.replace(m2t(e),`$1${o}$3`)}catch{}return t}function b2t(t,{preferredFontFormat:e}){return e?t.replace(g2t,r=>{for(;;){const[n,,i]=p2t.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function VCe(t){return t.search(HCe)!==-1}async function WCe(t,e,r){if(!VCe(t))return t;const n=b2t(t,r);return y2t(n).reduce((a,s)=>a.then(o=>v2t(o,s,e,r)),Promise.resolve(n))}async function Cv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const a=await WCe(i,null,r);return e.style.setProperty(t,a,e.style.getPropertyPriority(t)),!0}return!1}async function x2t(t,e){await Cv("background",t,e)||await Cv("background-image",t,e),await Cv("mask",t,e)||await Cv("-webkit-mask",t,e)||await Cv("mask-image",t,e)||await Cv("-webkit-mask-image",t,e)}async function w2t(t,e){const r=jl(t,HTMLImageElement);if(!(r&&!DW(t.src))&&!(jl(t,SVGImageElement)&&!DW(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await vZ(n,yZ(n),e);await new Promise((a,s)=>{t.onload=a,t.onerror=e.onImageErrorHandler?(...l)=>{try{a(e.onImageErrorHandler(...l))}catch(u){s(u)}}:s;const o=t;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function T2t(t,e){const n=_p(t.childNodes).map(i=>qCe(i,e));await Promise.all(n).then(()=>t)}async function qCe(t,e){jl(t,Element)&&(await x2t(t,e),await w2t(t,e),await T2t(t,e))}function k2t(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const Dle={};async function Ole(t){let e=Dle[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},Dle[t]=e,e}async function Ple(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async s=>{let o=s.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),FCe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(s,`url(${l})`),[s,l]))});return Promise.all(a).then(()=>r)}function Ble(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(n);if(l===null)break;e.push(l[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let l=a.exec(n);if(l===null){if(l=o.exec(n),l===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;e.push(l[0])}return e}async function C2t(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{_p(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,u=Ole(l).then(h=>Ple(h,e)).then(h=>Ble(h).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:d,error:f})}})).catch(h=>{console.error("Error loading remote css",h.toString())});n.push(u)}})}catch(a){const s=t.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Ole(i.href).then(o=>Ple(o,e)).then(o=>Ble(o).forEach(l=>{s.insertRule(l,s.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{_p(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function S2t(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>VCe(e.style.getPropertyValue("src")))}async function E2t(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=_p(t.ownerDocument.styleSheets),n=await C2t(r,e);return S2t(n)}function GCe(t){return t.trim().replace(/["']/g,"")}function A2t(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{e.add(GCe(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(t),e}async function R2t(t,e){const r=await E2t(t,e),n=A2t(t);return(await Promise.all(r.filter(a=>n.has(GCe(a.style.fontFamily))).map(a=>{const s=a.parentStyleSheet?a.parentStyleSheet.href:null;return WCe(a.cssText,s,e)}))).join(` -`)}async function _2t(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await R2t(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function M2t(t,e={}){const{width:r,height:n}=BCe(t,e),i=await W$(t,e,!0);return await _2t(i,e),await qCe(i,e),k2t(i,e),await Yvt(i,r,n)}async function L2t(t,e={}){const{width:r,height:n}=BCe(t,e),i=await M2t(t,e),a=await aM(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=e.pixelRatio||qvt(),u=e.canvasWidth||r,h=e.canvasHeight||n;return s.width=u*l,s.height=h*l,e.skipAutoScale||Gvt(s),s.style.width=`${u}`,s.style.height=`${h}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(a,0,0,s.width,s.height),s}var Fle=Object.defineProperty,I2t=(t,e)=>{let r={};for(var n in t)Fle(r,n,{get:t[n],enumerable:!0});return Fle(r,Symbol.toStringTag,{value:"Module"}),r};function eo(t){this.content=t}eo.prototype={constructor:eo,find:function(t){for(var e=0;e>1}};eo.from=function(t){if(t instanceof eo)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new eo(e)};function UCe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){let s=i.text,o=a.text,l=0;for(;s[l]==o[l];l++)r++;return l&&l0&&f>0&&u[d-1]==h[f-1];)d--,f--,r--,n--;return d&&f&&d=56320&&t<57344}function XCe(t){return t>=55296&&t<56320}class Rt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;ne&&n(l,i+o,a||null,s)!==!1&&l.content.size){let h=o+1;l.nodesBetween(Math.max(0,e-h),Math.min(l.content.size,r-h),n,i+h)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",s=!0;return this.nodesBetween(e,r,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,r-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&n&&(s?s=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);ae)for(let a=0,s=0;se&&((sr)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,r-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,r-s-1))),n.push(o),i+=o.nodeSize),s=l}return new Rt(n,i)}cutByIndex(e,r){return e==r?Rt.empty:e==0&&r==this.content.length?this:new Rt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Rt(i,a)}addToStart(e){return new Rt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;rthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?nA(r+1,a):nA(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Rt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return Rt.fromArray(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rt.empty;let r,n=0;for(let i=0;ithis.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;rn.type.rank-i.type.rank),r}};Qi.none=[];class PS extends Error{}class Jt{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=ZCe(this.content,e+this.openStart,r,this.openStart+1,this.openEnd+1);return n&&new Jt(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Jt(KCe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Jt.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Jt(Rt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Jt(e,n,i)}}Jt.empty=new Jt(Rt.empty,0,0);function KCe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:s,offset:o}=t.findIndex(r);if(i==e||a.isText){if(o!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(KCe(a.content,e-i-1,r-i-1)))}function ZCe(t,e,r,n,i,a){let{index:s,offset:o}=t.findIndex(e),l=t.maybeChild(s);if(o==e||l.isText)return a&&n<=0&&i<=0&&!a.canReplace(s,s,r)?null:t.cut(0,e).append(r).append(t.cut(e));let u=ZCe(l.content,e-o-1,r,s==0?n-1:0,s==t.childCount-1?i-1:0,l);return u&&t.replaceChild(s,l.copy(u))}function $2t(t,e,r){if(r.openStart>t.depth)throw new PS("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new PS("Inconsistent open depths");return QCe(t,e,r,0)}function QCe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function AC(t,e,r,n){let i=(e||t).node(r),a=0,s=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(T1(t.nodeAfter,n),a++));for(let o=a;oi&&PW(t,e,i+1),s=n.depth>i&&PW(r,n,i+1),o=[];return AC(null,t,i,o),a&&s&&e.index(i)==r.index(i)?(JCe(a,s),T1(k1(a,eSe(t,e,r,n,i+1)),o)):(a&&T1(k1(a,oM(t,e,i+1)),o),AC(e,r,i,o),s&&T1(k1(s,oM(r,n,i+1)),o)),AC(n,null,i,o),new Rt(o)}function oM(t,e,r){let n=[];if(AC(null,t,r,n),t.depth>r){let i=PW(t,e,r+1);T1(k1(i,oM(t,e,r+1)),n)}return AC(e,null,r,n),new Rt(n)}function N2t(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Rt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class BS{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new lM(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(n.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new BS(r,n,a)}static resolveCached(e,r){let n=zle.get(e);if(n)for(let a=0;ae&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tSe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Rt.empty,i=0,a=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,a),o=s&&s.matchFragment(this.content,r);if(!o||!o.validEnd)return!1;for(let l=i;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Rt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};cb.prototype.text=void 0;let B2t=class FW extends cb{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tSe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new FW(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new FW(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function tSe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class K1{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new F2t(e,r);if(n.next==null)return K1.empty;let i=rSe(n);n.next&&n.err("Unexpected trailing text");let a=U2t(G2t(i));return Y2t(a,n),a}matchType(e){for(let r=0;ru.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i{let a=i+(n.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(n.next[s].next);return a}).join(` -`)}}K1.empty=new K1(!0);class F2t{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rSe(t){let e=[];do e.push(z2t(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function z2t(t){let e=[];do e.push(H2t(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function H2t(t){let e=q2t(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=V2t(t,e);else break;return e}function Hle(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function V2t(t,e){let r=Hle(t),n=r;return t.eat(",")&&(t.next!="}"?n=Hle(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function W2t(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let s=r[a];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function q2t(t){if(t.eat("(")){let e=rSe(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=W2t(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function G2t(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(a(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=a(s.exprs[l],o);if(l==s.exprs.length-1)return u;i(u,o=r())}else if(s.type=="star"){let l=r();return n(o,l),i(a(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return i(a(s.expr,o),l),i(a(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let h=0;h{u||i.push([o,u=[]]),u.indexOf(h)==-1&&u.push(h)})})});let a=e[n.join(",")]=new K1(n.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:aSe(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new cb(this,this.computeAttrs(e),Rt.from(r),Qi.setFrom(n))}createChecked(e=null,r,n){return r=Rt.from(r),this.checkContent(r),new cb(this,this.computeAttrs(e),r,Qi.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Rt.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(Rt.empty,!0);return a?new cb(this,e,r.append(a),Qi.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;rn[a]=new lSe(a,r,s));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function j2t(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class X2t{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?j2t(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class q${constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=oSe(e,i.attrs),this.excluded=null;let a=iSe(this.attrs);this.instance=a?new Qi(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Qi(this,aSe(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,s)=>n[a]=new q$(a,i++,r,s)),n}removeFromSet(e){for(var r=0;r-1}}class cSe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=eo.from(e.nodes),r.marks=eo.from(e.marks||{}),this.nodes=Wle.compile(this.spec.nodes,this),this.marks=q$.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=n[s]||(n[s]=K1.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?qle(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:qle(this,s.split(" "))}this.nodeFromJSON=i=>cb.fromJSON(this,i),this.markFromJSON=i=>Qi.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wle){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new B2t(n,n.defaultAttrs,e,Qi.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function qle(t,e){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function K2t(t){return t.tag!=null}function Z2t(t){return t.style!=null}class Mp{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(K2t(i))this.tags.push(i);else if(Z2t(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new Ule(this,r,!1);return n.addAll(e,Qi.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new Ule(this,r,!0);return n.addAll(e,Qi.none,r.from,r.to),Jt.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,s=0;for(;s{n(s=Yle(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(s=>{n(s=Yle(s)),s.node||s.ignore||s.mark||(s.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mp(e,Mp.schemaRules(e)))}}const uSe={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Q2t={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hSe={ol:!0,ul:!0},FS=1,zW=2,RC=4;function Gle(t,e,r){return e!=null?(e?FS:0)|(e==="full"?zW:0):t&&t.whitespace=="pre"?FS|zW:r&~RC}class iA{constructor(e,r,n,i,a,s){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=s,this.content=[],this.activeMarks=Qi.none,this.match=a||(s&RC?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Rt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&FS)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=Rt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Rt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!uSe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ule{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,s=Gle(null,r.preserveWhitespace,0)|(n?RC:0);i?a=new iA(i.type,i.attrs,Qi.none,!0,r.topMatch||i.type.contentMatch,s):n?a=new iA(null,null,Qi.none,!0,null,s):a=new iA(e.schema.topNodeType,null,Qi.none,!0,null,s),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&zW?"full":this.localPreserveWS||(i.options&FS)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)if(a==="full")n=n.replace(/\r\n?/g,` -`);else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return r}addElementByRule(e,r,n,i){let a,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(s,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(o)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=i==null?null:e.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(s,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+o)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s(s.type?s.type.allowsMarkType(u.type):jle(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new iA(e,r,l,i,null,o)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=FS)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let u=r[o];if(u==""){if(o==r.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let h=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!h||h.name!=u&&!h.isInGroup(u))return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function J2t(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&hSe.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function ebt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Yle(t){let e={};for(let r in t)e[r]=t[r];return e}function jle(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],s=o=>{a.push(o);for(let l=0;l{if(a.length||s.marks.length){let o=0,l=0;for(;o=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&oR(aA(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return typeof r=="string"?{dom:e.createTextNode(r)}:oR(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new G$(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=Xle(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return Xle(e.marks)}}function Xle(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function aA(t){return t.document||window.document}const Kle=new WeakMap;function tbt(t){let e=Kle.get(t);return e===void 0&&Kle.set(t,e=rbt(t)),e}function rbt(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],h=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){h=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=h;dh)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:g}=oR(t,f,r,n);if(l.appendChild(p),g){if(o)throw new RangeError("Multiple content holes");o=g}}}return{dom:l,contentDOM:o}}const dSe=65535,fSe=Math.pow(2,16);function nbt(t,e){return t+e*fSe}function Zle(t){return t&dSe}function ibt(t){return(t-(t&dSe))/fSe}const pSe=1,gSe=2,lR=4,mSe=8;class HW{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&mSe)>0}get deletedBefore(){return(this.delInfo&(pSe|lR))>0}get deletedAfter(){return(this.delInfo&(gSe|lR))>0}get deletedAcross(){return(this.delInfo&lR)>0}}class pc{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&pc.empty)return pc.empty}recover(e){let r=0,n=Zle(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[o+a],h=this.ranges[o+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:r:r,p=l+i+(f<0?0:h);if(n)return p;let g=e==(r<0?l:d)?null:nbt(o/3,e-l),m=e==l?gSe:e==d?pSe:lR;return(r<0?e!=l:e!=d)&&(m|=mSe),new HW(p,m,g)}i+=h-u}return n?e+i:new HW(e+i,0,null)}touches(e,r){let n=0,i=Zle(r),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;oe)break;let u=this.ranges[o+a],h=l+u;if(e<=h&&o==i*3)return!0;n+=this.ranges[o+s]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new zS;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;na&&l!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),r.openStart,r.openEnd);return Ka.fromReplace(e,this.from,this.to,a)}invert(){return new Hu(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new gp(r.pos,n.pos,this.mark)}merge(e){return e instanceof gp&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new gp(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gp(r.from,r.to,e.markFromJSON(r.mark))}}zo.jsonID("addMark",gp);class Hu extends zo{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Jt(bZ(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Ka.fromReplace(e,this.from,this.to,n)}invert(){return new gp(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Hu(r.pos,n.pos,this.mark)}merge(e){return e instanceof Hu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hu(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Hu(r.from,r.to,e.markFromJSON(r.mark))}}zo.jsonID("removeMark",Hu);class mp extends zo{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ka.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Ka.fromReplace(e,this.pos,this.pos+1,new Jt(Rt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;in.pos?null:new Is(r.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Is(r.from,r.to,r.gapFrom,r.gapTo,Jt.fromJSON(e,r.slice),r.insert,!!r.structure)}}zo.jsonID("replaceAround",Is);function VW(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let s=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function abt(t,e,r,n){let i=[],a=[],s,o;t.doc.nodesBetween(e,r,(l,u,h)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&h.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),g=n.addToSet(d);for(let m=0;mt.step(l)),a.forEach(l=>t.step(l))}function sbt(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(n instanceof q$){let u=s.marks,h;for(;h=n.isInSet(u);)(l||(l=[])).push(h),u=h.removeFromSet(u)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,r);for(let h=0;ht.step(new Hu(s.from,s.to,s.style)))}function xZ(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l=0;l--)t.step(s[l])}function obt(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function N3(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,i=0,a=0;;--n){let s=t.$from.node(n),o=t.$from.index(n)+i,l=t.$to.indexAfter(n)-a;if(nr;g--)m||n.index(g)>0?(m=!0,h=Rt.from(n.node(g).copy(h)),d++):l--;let f=Rt.empty,p=0;for(let g=a,m=!1;g>r;g--)m||i.after(g+1)=0;s--){if(n.size){let o=r[s].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Rt.from(r[s].type.create(r[s].attrs,n))}let i=e.start,a=e.end;t.step(new Is(i,a,i,a,new Jt(n,0,0),r.length,!0))}function dbt(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(n,l)&&fbt(t.doc,t.mapping.slice(a).map(o),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?u=!1:!p&&g&&(u=!0)}u===!1&&vSe(t,s,o,a),xZ(t,t.mapping.slice(a).map(o,1),n,void 0,u===null);let h=t.mapping.slice(a),d=h.map(o,1),f=h.map(o+s.nodeSize,1);return t.step(new Is(d,f,d+1,f-1,new Jt(Rt.from(n.create(l,null,s.marks)),0,0),1,!0)),u===!0&&ySe(t,s,o,a),!1}})}function ySe(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function vSe(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+a);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function fbt(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function pbt(t,e,r,n,i){let a=t.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");r||(r=a.type);let s=r.create(n,null,i||a.marks);if(a.isLeaf)return t.replaceWith(e,e+a.nodeSize,s);if(!r.validContent(a.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Is(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new Jt(Rt.from(s),0,0),1,!0))}function If(t,e,r=1,n){let i=t.resolve(e),a=i.depth-r,s=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,h=r-2;u>a;u--,h--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),g=n&&n[h+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let m=n&&n[h]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let o=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(o,o,l?l.type:i.node(a+1).type)}function gbt(t,e,r=1,n){let i=t.doc.resolve(e),a=Rt.empty,s=Rt.empty;for(let o=i.depth,l=i.depth-r,u=r-1;o>l;o--,u--){a=Rt.from(i.node(o).copy(a));let h=n&&n[u];s=Rt.from(h?h.type.create(h.attrs,s):i.node(o).copy(s))}t.step(new Ua(e,e,new Jt(a.append(s),r,r),!0))}function gg(t,e){let r=t.resolve(e),n=r.index();return bSe(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function mbt(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i0?(a=n.node(i+1),o++,s=n.node(i).maybeChild(o)):(a=n.node(i).maybeChild(o-1),s=n.node(i+1)),a&&!a.isTextblock&&bSe(a,s)&&n.node(i).canReplace(o,o+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function ybt(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,a=t.doc.resolve(e-r),s=a.node().type;if(i&&s.inlineContent){let h=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);h&&!d?n=!1:!h&&d&&(n=!0)}let o=t.steps.length;if(n===!1){let h=t.doc.resolve(e+r);vSe(t,h.node(),h.before(),o)}s.inlineContent&&xZ(t,e+r-1,s,a.node().contentMatchAt(a.index()),n==null);let l=t.mapping.slice(o),u=l.map(e-r);if(t.step(new Ua(u,l.map(e+r,-1),Jt.empty,!0)),n===!0){let h=t.doc.resolve(u);ySe(t,h.node(),h.before(),t.steps.length)}return t}function vbt(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,r))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,r))return n.after(i+1);if(a=0;s--){let o=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(o>0?1:0),u=n.node(s),h=!1;if(a==1)h=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);h=d&&u.canReplaceWith(l,l,d[0])}if(h)return o==0?n.pos:o<0?n.before(s+1):n.after(s+1)}return null}function Y$(t,e,r=e,n=Jt.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),a=t.resolve(r);return wSe(i,a,n)?new Ua(e,r,n):new bbt(i,a,n).fit()}function wSe(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class bbt{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Rt.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Rt.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,s=n.depth,o=i.depth;for(;s&&o&&a.childCount==1;)a=a.firstChild.content,s--,o--;let l=new Jt(a,s,o);return e>-1?new Is(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Ua(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}r=a.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=KP(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let s=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:u}=this.frontier[o],h,d=null;if(r==1&&(s?u.matchType(s.type)||(d=u.fillBefore(Rt.from(s),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:o,parent:a,inject:d};if(r==2&&s&&(h=u.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:o,parent:a,wrap:h};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=KP(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Jt(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=KP(e,r);if(i.childCount<=1&&r>0){let a=e.size-r<=r+i.size;this.unplaced=new Jt(E5(e,r-1,1),r-1,a?r-1:n)}else this.unplaced=new Jt(E5(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:a}){for(;this.depth>r;)this.closeFrontierNode();if(a)for(let m=0;m1||l==0||m.content.size)&&(d=y,h.push(TSe(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==o.childCount?p:-1)))}let g=u==o.childCount;g||(p=-1),this.placed=A5(this.placed,r,Rt.from(h)),this.frontier[r].match=d,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=o;m1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],a=r=0;o--){let{match:l,type:u}=this.frontier[o],h=ZP(e,o,u,l,!0);if(!h||h.childCount)continue e}return{depth:r,fit:s,move:a?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=A5(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=A5(this.placed,this.depth,Rt.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Rt.empty,!0);r.childCount&&(this.placed=A5(this.placed,this.frontier.length,r))}}function E5(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(E5(t.firstChild.content,e-1,r)))}function A5(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(A5(t.lastChild.content,e-1,r)))}function KP(t,e){for(let r=0;r1&&(n=n.replaceChild(0,TSe(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(Rt.empty,!0)))),t.copy(n)}function ZP(t,e,r,n,i){let a=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==a.childCount&&!r.compatibleContent(a.type))return null;let o=n.fillBefore(a.content,!0,s);return o&&!xbt(r,a.content,s)?o:null}function xbt(t,e,r){for(let n=r;n0;f--,p--){let g=i.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(f)>-1?o=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(o),u=[],h=n.openStart;for(let f=n.content,p=0;;p++){let g=f.firstChild;if(u.push(g),p==n.openStart)break;f=g.content}for(let f=h-1;f>=0;f--){let p=u[f],g=wbt(p.type);if(g&&!p.sameMarkup(i.node(Math.abs(o)-1)))h=f;else if(g||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+h+1)%(n.openStart+1),g=u[p];if(g)for(let m=0;m=0&&(t.replace(e,r,n),!(t.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),r=a.after(p))}}function kSe(t,e,r,n,i){if(en){let a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(Rt.empty,!0))}return t}function kbt(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=vbt(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new Jt(Rt.from(n),0,0))}function Cbt(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let s=n.sharedDepth(r),o=!1;for(let l=n.depth;l>s;l--)n.node(l).type.spec.isolating&&(o=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(o=!0);if(!o){for(let l=n.depth;l>0&&e==n.start(l);l--)e=n.before(l);for(let l=i.depth;l>0&&r==i.start(l);l--)r=i.before(l);n=t.doc.resolve(e),i=t.doc.resolve(r)}}let a=CSe(n,i);for(let s=0;s0&&(l||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return t.delete(n.before(o),i.after(o))}for(let s=1;s<=n.depth&&s<=i.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&i.end(s)-r!=i.depth-s&&n.start(s-1)==i.start(s-1)&&n.node(s-1).canReplace(n.index(s-1),i.index(s-1)))return t.delete(n.before(s),r);t.delete(e,r)}function CSe(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let a=t.start(i);if(ae.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&r.push(i)}return r}class ub extends zo{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ka.fail("No node at attribute step's position");let n=Object.create(null);for(let a in r.attrs)n[a]=r.attrs[a];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return Ka.fromReplace(e,this.pos,this.pos+1,new Jt(Rt.from(i),0,r.isLeaf?0:1))}getMap(){return pc.empty}invert(e){return new ub(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ub(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ub(r.pos,r.attr,r.value)}}zo.jsonID("attr",ub);class HS extends zo{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return Ka.ok(n)}getMap(){return pc.empty}invert(e){return new HS(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new HS(r.attr,r.value)}}zo.jsonID("docAttr",HS);let DT=class extends Error{};DT=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};DT.prototype=Object.create(Error.prototype);DT.prototype.constructor=DT;DT.prototype.name="TransformError";class SSe{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zS}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new DT(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,r=-1e9;for(let n=0;n{e=Math.min(e,o),r=Math.max(r,l)})}return e==1e9?null:{from:e,to:r}}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=Jt.empty){let i=Y$(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new Jt(Rt.from(n),0,0))}delete(e,r){return this.replace(e,r,Jt.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return Tbt(this,e,r,n),this}replaceRangeWith(e,r,n){return kbt(this,e,r,n),this}deleteRange(e,r){return Cbt(this,e,r),this}lift(e,r){return lbt(this,e,r),this}join(e,r=1){return ybt(this,e,r),this}wrap(e,r){return hbt(this,e,r),this}setBlockType(e,r=e,n,i=null){return dbt(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return pbt(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new ub(e,r,n)),this}setDocAttribute(e,r){return this.step(new HS(e,r)),this}addNodeMark(e,r){return this.step(new mp(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof Qi)r.isInSet(n.marks)&&this.step(new Z1(e,r));else{let i=n.marks,a,s=[];for(;a=r.isInSet(i);)s.push(new Z1(e,a)),i=a.removeFromSet(i);for(let o=s.length-1;o>=0;o--)this.step(s[o])}return this}split(e,r=1,n){return gbt(this,e,r,n),this}addMark(e,r,n){return abt(this,e,r,n),this}removeMark(e,r,n){return sbt(this,e,r,n),this}clearIncompatible(e,r,n){return xZ(this,e,r,n),this}}const QP=Object.create(null);class sn{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new ESe(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r=0;a--){let s=r<0?l2(e.node(0),e.node(a),e.before(a+1),e.index(a),r,n):l2(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new vc(e.node(0))}static atStart(e){return l2(e,e,0,0,1)||new vc(e)}static atEnd(e){return l2(e,e,e.content.size,e.childCount,-1)||new vc(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=QP[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in QP)throw new RangeError("Duplicate use of selection JSON ID "+e);return QP[e]=r,r.prototype.jsonID=e,r}getBookmark(){return wr.between(this.$anchor,this.$head).getBookmark()}}sn.prototype.visible=!0;let ESe=class{constructor(e,r){this.$from=e,this.$to=r}},Jle=!1;function ece(t){!Jle&&!t.parent.inlineContent&&(Jle=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class wr extends sn{constructor(e,r=e){ece(e),ece(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return sn.near(n);let i=e.resolve(r.map(this.anchor));return new wr(i.parent.inlineContent?i:n,n)}replace(e,r=Jt.empty){if(super.replace(e,r),r==Jt.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof wr&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new j$(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new wr(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let a=sn.findFrom(r,n,!0)||sn.findFrom(r,-n,!0);if(a)r=a.$head;else return sn.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(sn.findFrom(e,-n,!0)||sn.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let o=e.child(s);if(o.isAtom){if(!a&&Ir.isSelectable(o))return Ir.create(t,r-(i<0?o.nodeSize:0))}else{let l=l2(t,o,r+i,i<0?o.childCount:0,i,a);if(l)return l}r+=o.nodeSize*i}return null}function tce(t,e,r){let n=t.steps.length-1;if(n{s==null&&(s=h)}),t.setSelection(sn.near(t.doc.resolve(s),r))}function rce(t,e){return!e||!t?t:t.bind(e)}class sA{constructor(e,r,n){this.name=e,this.init=rce(r.init,n),this.apply=rce(r.apply,n)}}new sA("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new sA("selection",{init(t,e){return t.selection||sn.atStart(e.doc)},apply(t){return t.selection}}),new sA("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new sA("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function ASe(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=ASe(i,e,{})),r[n]=i}return r}class da{constructor(e){this.spec=e,this.props={},e.props&&ASe(e.props,this,this.props),this.key=e.key?e.key.key:RSe("plugin")}getState(e){return e[this.key]}}const JP=Object.create(null);function RSe(t){return t in JP?t+"$"+ ++JP[t]:(JP[t]=0,t+"$")}class fa{constructor(e="key"){this.key=RSe(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const _Se=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function MSe(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const LSe=(t,e,r)=>{let n=MSe(t,r);if(!n)return!1;let i=kZ(n);if(!i){let s=n.blockRange(),o=s&&N3(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)}let a=i.nodeBefore;if(zSe(t,i,e,-1))return!0;if(n.parent.content.size==0&&(OT(a,"end")||Ir.isSelectable(a)))for(let s=n.depth;;s--){let o=Y$(t.doc,n.before(s),n.after(s),Jt.empty);if(o&&o.slice.size1)break}return a.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Ebt=(t,e,r)=>{let n=MSe(t,r);if(!n)return!1;let i=kZ(n);return i?ISe(t,i,e):!1},Abt=(t,e,r)=>{let n=NSe(t,r);if(!n)return!1;let i=CZ(n);return i?ISe(t,i,e):!1};function ISe(t,e,r){let n=e.nodeBefore,i=n,a=e.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let s=e.nodeAfter,o=s,l=e.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let h=o.firstChild;if(!h)return!1;o=h}let u=Y$(t.doc,a,l,Jt.empty);if(!u||u.from!=a||u instanceof Ua&&u.slice.size>=l-a)return!1;if(r){let h=t.tr.step(u);h.setSelection(wr.create(h.doc,a)),r(h.scrollIntoView())}return!0}function OT(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const $Se=(t,e,r)=>{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;a=kZ(n)}let s=a&&a.nodeBefore;return!s||!Ir.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ir.create(t.doc,a.pos-s.nodeSize)).scrollIntoView()),!0)};function kZ(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NSe(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset{let n=NSe(t,r);if(!n)return!1;let i=CZ(n);if(!i)return!1;let a=i.nodeAfter;if(zSe(t,i,e,1))return!0;if(n.parent.content.size==0&&(OT(a,"start")||Ir.isSelectable(a))){let s=Y$(t.doc,n.before(),n.after(),Jt.empty);if(s&&s.slice.size{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset=0;e--){let r=t.node(e);if(t.index(e)+1{let r=t.selection,n=r instanceof Ir,i;if(n){if(r.node.isTextblock||!gg(t.doc,r.from))return!1;i=r.from}else if(i=U$(t.doc,r.from,-1),i==null)return!1;if(e){let a=t.tr.join(i);n&&a.setSelection(Ir.create(a.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(a.scrollIntoView())}return!0},_bt=(t,e)=>{let r=t.selection,n;if(r instanceof Ir){if(r.node.isTextblock||!gg(t.doc,r.to))return!1;n=r.to}else if(n=U$(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},Mbt=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),a=i&&N3(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)},PSe=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function SZ(t){for(let e=0;e{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),a=r.indexAfter(-1),s=SZ(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(e){let o=r.after(),l=t.tr.replaceWith(o,o,s.createAndFill());l.setSelection(sn.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},BSe=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof vc||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=SZ(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let s=(!n.parentOffset&&i.index(){let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let a=r.before();if(If(t.doc,a))return e&&e(t.tr.split(a).scrollIntoView()),!0}let n=r.blockRange(),i=n&&N3(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function Ibt(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof Ir&&e.selection.node.isBlock)return!n.parentOffset||!If(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let a=[],s,o,l=!1,u=!1;for(let p=n.depth;;p--)if(n.node(p).isBlock){l=n.end(p)==n.pos+(n.depth-p),u=n.start(p)==n.pos-(n.depth-p),o=SZ(n.node(p-1).contentMatchAt(n.indexAfter(p-1))),a.unshift(l&&o?{type:o}:null),s=p;break}else{if(p==1)return!1;a.unshift(null)}let h=e.tr;(e.selection instanceof wr||e.selection instanceof vc)&&h.deleteSelection();let d=h.mapping.map(n.pos),f=If(h.doc,d,a.length,a);if(f||(a[0]=o?{type:o}:null,f=If(h.doc,d,a.length,a)),!f)return!1;if(h.split(d,a.length,a),!l&&u&&n.node(s).type!=o){let p=h.mapping.map(n.before(s)),g=h.doc.resolve(p);o&&n.node(s-1).canReplaceWith(g.index(),g.index()+1,o)&&h.setNodeMarkup(h.mapping.map(n.before(s)),o)}return r&&r(h.scrollIntoView()),!0}}const $bt=Ibt(),Nbt=(t,e)=>{let{$from:r,to:n}=t.selection,i,a=r.sharedDepth(n);return a==0?!1:(i=r.before(a),e&&e(t.tr.setSelection(Ir.create(t.doc,i))),!0)};function Dbt(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||gg(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function zSe(t,e,r,n){let i=e.nodeBefore,a=e.nodeAfter,s,o,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&Dbt(t,e,r))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(s[0]||a.type).validEnd){if(r){let p=e.pos+a.nodeSize,g=Rt.empty;for(let v=s.length-1;v>=0;v--)g=Rt.from(s[v].create(null,g));g=Rt.from(i.copy(g));let m=t.tr.step(new Is(e.pos-1,p,e.pos,p,new Jt(g,1,0),s.length,!0)),y=m.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&gg(m.doc,y.pos)&&m.join(y.pos),r(m.scrollIntoView())}return!0}let h=a.type.spec.isolating||n>0&&l?null:sn.findFrom(e,1),d=h&&h.$from.blockRange(h.$to),f=d&&N3(d);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&OT(a,"start",!0)&&OT(i,"end")){let p=i,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let m=a,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(r){let v=Rt.empty;for(let b=g.length-1;b>=0;b--)v=Rt.from(g[b].copy(v));let x=t.tr.step(new Is(e.pos-g.length,e.pos+a.nodeSize,e.pos+y,e.pos+a.nodeSize-y,new Jt(v,g.length,0),0,!0));r(x.scrollIntoView())}return!0}}return!1}function HSe(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(r&&r(e.tr.setSelection(wr.create(e.doc,t<0?i.start(a):i.end(a)))),!0):!1}}const Obt=HSe(-1),Pbt=HSe(1);function Bbt(t,e=null){return function(r,n){let{$from:i,$to:a}=r.selection,s=i.blockRange(a),o=s&&wZ(s,t,e);return o?(n&&n(r.tr.wrap(s,o).scrollIntoView()),!0):!1}}function nce(t,e=null){return function(r,n){let i=!1;for(let a=0;a{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let h=r.doc.resolve(u),d=h.index();i=h.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(n){let a=r.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);a=new lM(l,l,e.depth),e.endIndex=0;h--)a=Rt.from(r[h].type.create(r[h].attrs,a));t.step(new Is(e.start-(n?2:0),e.end,e.start,e.end,new Jt(a,0,0),r.length,!0));let s=0;for(let h=0;hs.childCount>0&&s.firstChild.type==t);return a?r?n.node(a.depth-1).type==t?Wbt(e,r,t,a):qbt(e,r,a):!0:!1}}function Wbt(t,e,r,n){let i=t.tr,a=n.end,s=n.$to.end(n.depth);am;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let a=n.doc.resolve(r.start),s=a.nodeAfter;if(n.mapping.map(r.end)!=r.start+a.nodeAfter.nodeSize)return!1;let o=r.startIndex==0,l=r.endIndex==i.childCount,u=a.node(-1),h=a.index(-1);if(!u.canReplace(h+(o?0:1),h+1,s.content.append(l?Rt.empty:Rt.from(i))))return!1;let d=a.pos,f=d+s.nodeSize;return n.step(new Is(d-(o?1:0),f+(l?1:0),d+1,f-1,new Jt((o?Rt.empty:Rt.from(i.copy(Rt.empty))).append(l?Rt.empty:Rt.from(i.copy(Rt.empty))),o?0:1,l?0:1),o?0:1)),e(n.scrollIntoView()),!0}function Gbt(t){return function(e,r){let{$from:n,$to:i}=e.selection,a=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!a)return!1;let s=a.startIndex;if(s==0)return!1;let o=a.parent,l=o.child(s-1);if(l.type!=t)return!1;if(r){let u=l.lastChild&&l.lastChild.type==o.type,h=Rt.from(u?t.create():null),d=new Jt(Rt.from(t.create(null,Rt.from(o.type.create(null,h)))),u?3:1,0),f=a.start,p=a.end;r(e.tr.step(new Is(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const My=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},VSe=function(t,e,r,n){return r&&(ice(t,e,r,n,-1)||ice(t,e,r,n,1))},Ubt=/^(img|br|input|textarea|hr)$/i;function ice(t,e,r,n,i){for(var a;;){if(t==r&&e==n)return!0;if(e==(i<0?0:cM(t))){let s=t.parentNode;if(!s||s.nodeType!=1||AZ(t)||Ubt.test(t.nodeName)||t.contentEditable=="false")return!1;e=My(t)+(i<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((a=s.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?cM(t):0}else return!1}}function cM(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ybt(t,e,r){for(let n=e==0,i=e==cM(t);n||i;){if(t==r)return!0;let a=My(t);if(t=t.parentNode,!t)return!1;n=n&&a==0,i=i&&a==cM(t)}}function AZ(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const WSe=function(t){return t.focusNode&&VSe(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function qSe(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}const id=typeof navigator<"u"?navigator:null,ace=typeof document<"u"?document:null,mg=id&&id.userAgent||"",WW=/Edge\/(\d+)/.exec(mg),GSe=/MSIE \d/.exec(mg),qW=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mg),bE=!!(GSe||qW||WW),USe=GSe?document.documentMode:qW?+qW[1]:WW?+WW[1]:0,X$=!bE&&/gecko\/(\d+)/i.test(mg);X$&&+(/Firefox\/(\d+)/.exec(mg)||[0,0])[1];const GW=!bE&&/Chrome\/(\d+)/.exec(mg),h0=!!GW,YSe=GW?+GW[1]:0,Ly=!bE&&!!id&&/Apple Computer/.test(id.vendor),RZ=Ly&&(/Mobile\/\w+/.test(mg)||!!id&&id.maxTouchPoints>2),Xc=RZ||(id?/Mac/.test(id.platform):!1),jSe=id?/Win/.test(id.platform):!1,xE=/Android \d/.test(mg),_Z=!!ace&&"webkitFontSmoothing"in ace.documentElement.style,jbt=_Z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xbt(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),a=i&&i.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let o=n.resolve(s),l,u;if(WSe(r)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Ir.isSelectable(d)&&i.parent&&!(d.isInline&&Ybt(r.focusNode,r.focusOffset,i.dom))){let f=i.posBefore;u=new Ir(s==f?o:n.resolve(f))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let d=s,f=s;for(let p=0;p{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!XSe(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Zbt(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,My(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&bE&&USe<=11&&(r.disabled=!0,r.disabled=!1)}function Qbt(t,e){if(e instanceof Ir){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(cce(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else cce(t)}function cce(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function KSe(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||wr.between(e,r,n)}function Jbt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function UW(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&sn.findFrom(a,e)}function Z0(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function uce(t,e,r){let n=t.state.selection;if(n instanceof wr)if(r.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return Z0(t,new wr(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=UW(t.state,e);return i&&i instanceof Ir?Z0(t,i):!1}else if(!(Xc&&r.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!a||a.isText)return!1;let o=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(s=t.docView.descAt(o))&&!s.contentDOM?Ir.isSelectable(a)?Z0(t,new Ir(e<0?t.state.doc.resolve(i.pos-a.nodeSize):i)):_Z?Z0(t,new wr(t.state.doc.resolve(e<0?o:o+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Ir&&n.node.isInline)return Z0(t,new wr(e>0?n.$to:n.$from));{let i=UW(t.state,e);return i?Z0(t,i):!1}}}function uM(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _C(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Sv(t,e){return e<0?ext(t):txt(t)}function ext(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,a,s=!1;for(X$&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(_C(o,-1))i=r,a=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(ZSe(r))break;{let o=r.previousSibling;for(;o&&_C(o,-1);)i=r.parentNode,a=My(o),o=o.previousSibling;if(o)r=o,n=uM(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}s?YW(t,r,n):i&&YW(t,i,a)}function txt(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=uM(r),a,s;for(;;)if(n{t.state==i&&MZ(t)},50)}function hce(t,e){let r=t.state.doc.resolve(e);if(!(h0||jSe)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let a=t.coordsAtPos(e-1),s=(a.top+a.bottom)/2;if(s>i.top&&s1)return a.lefti.top&&s1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function dce(t,e,r){let n=t.state.selection;if(n instanceof wr&&!n.empty||r.indexOf("s")>-1||Xc&&r.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=UW(t.state,e);if(s&&s instanceof Ir)return Z0(t,s)}if(!i.parent.inlineContent){let s=e<0?i:a,o=n instanceof vc?sn.near(s,e):sn.findFrom(s,e);return o?Z0(t,o):!1}return!1}function fce(t,e){if(!(t.state.selection instanceof wr))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function pce(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function ixt(t){if(!Ly||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;pce(t,n,"true"),setTimeout(()=>pce(t,n,"false"),20)}return!1}function axt(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function sxt(t,e){let r=e.keyCode,n=axt(e);if(r==8||Xc&&r==72&&n=="c")return fce(t,-1)||Sv(t,-1);if(r==46&&!e.shiftKey||Xc&&r==68&&n=="c")return fce(t,1)||Sv(t,1);if(r==13||r==27)return!0;if(r==37||Xc&&r==66&&n=="c"){let i=r==37?hce(t,t.state.selection.from)=="ltr"?-1:1:-1;return uce(t,i,n)||Sv(t,i)}else if(r==39||Xc&&r==70&&n=="c"){let i=r==39?hce(t,t.state.selection.from)=="ltr"?1:-1:1;return uce(t,i,n)||Sv(t,i)}else{if(r==38||Xc&&r==80&&n=="c")return dce(t,-1,n)||Sv(t,-1);if(r==40||Xc&&r==78&&n=="c")return ixt(t)||dce(t,1,n)||Sv(t,1);if(n==(Xc?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function QSe(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let r=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=t.someProp("clipboardSerializer")||G$.fromSchema(t.state.schema),o=i6e(),l=o.createElement("div");l.appendChild(s.serializeFragment(n,{document:o}));let u=l.firstChild,h,d=0;for(;u&&u.nodeType==1&&(h=n6e[u.nodeName.toLowerCase()]);){for(let p=h.length-1;p>=0;p--){let g=o.createElement(h[p]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` + */function Wvt(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),i=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(i),e&&(n.href=e),i.href=t,i.href}const qvt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function _p(t){const e=[];for(let r=0,n=t.length;roc||t.height>oc)&&(t.width>oc&&t.height>oc?t.width>t.height?(t.height*=oc/t.width,t.width=oc):(t.width*=oc/t.height,t.height=oc):t.width>oc?(t.height*=oc/t.width,t.width=oc):(t.width*=oc/t.height,t.height=oc))}function sM(t){return new Promise((e,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>e(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=t})}async function Xvt(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Kvt(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(t),Xvt(i)}const Yl=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||Yl(r,e)};function Zvt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Qvt(t,e){return BCe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function Jvt(t,e,r,n){const i=`.${t}:${e}`,a=r.cssText?Zvt(r):Qvt(r,n);return document.createTextNode(`${i}{${a}}`)}function Nle(t,e,r,n){const i=window.getComputedStyle(t,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const s=qvt();try{e.className=`${e.className} ${s}`}catch{return}const o=document.createElement("style");o.appendChild(Jvt(s,r,i,n)),e.appendChild(o)}function e2t(t,e,r){Nle(t,e,":before",r),Nle(t,e,":after",r)}const Dle="application/font-woff",Ole="image/jpeg",t2t={woff:Dle,woff2:Dle,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ole,jpeg:Ole,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function r2t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function bZ(t){const e=r2t(t).toLowerCase();return t2t[e]||""}function n2t(t){return t.split(/,/)[1]}function PW(t){return t.search(/^(data:)/)!==-1}function i2t(t,e){return`data:${e};base64,${t}`}async function zCe(t,e,r){const n=await fetch(t,e);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const i=await n.blob();return new Promise((a,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{a(r({res:n,result:o.result}))}catch(l){s(l)}},o.readAsDataURL(i)})}const XP={};function a2t(t,e,r){let n=t.replace(/\?.*/,"");return r&&(n=t),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),e?`[${e}]${n}`:n}async function xZ(t,e,r){const n=a2t(t,e,r.includeQueryParams);if(XP[n]!=null)return XP[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const a=await zCe(t,r.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),n2t(o)));i=i2t(a,e)}catch(a){i=r.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;a&&(s=typeof a=="string"?a:a.message),s&&console.warn(s)}return XP[n]=i,i}async function s2t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):sM(e)}async function o2t(t,e){if(t.currentSrc){const a=document.createElement("canvas"),s=a.getContext("2d");a.width=t.clientWidth,a.height=t.clientHeight,s==null||s.drawImage(t,0,0,a.width,a.height);const o=a.toDataURL();return sM(o)}const r=t.poster,n=bZ(r),i=await xZ(r,n,e);return sM(i)}async function l2t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await G$(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function c2t(t,e){return Yl(t,HTMLCanvasElement)?s2t(t):Yl(t,HTMLVideoElement)?o2t(t,e):Yl(t,HTMLIFrameElement)?l2t(t,e):t.cloneNode(HCe(t))}const u2t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",HCe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function h2t(t,e,r){var n,i;if(HCe(e))return e;let a=[];return u2t(t)&&t.assignedNodes?a=_p(t.assignedNodes()):Yl(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?a=_p(t.contentDocument.body.childNodes):a=_p(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),a.length===0||Yl(t,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>G$(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function d2t(t,e,r){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):BCe(r).forEach(a=>{let s=i.getPropertyValue(a);a==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),Yl(t,HTMLIFrameElement)&&a==="display"&&s==="inline"&&(s="block"),a==="d"&&e.getAttribute("d")&&(s=`path(${e.getAttribute("d")})`),n.setProperty(a,s,i.getPropertyPriority(a))})}function f2t(t,e){Yl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),Yl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function p2t(t,e){if(Yl(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function g2t(t,e,r){return Yl(e,Element)&&(d2t(t,e,r),e2t(t,e,r),f2t(t,e),p2t(t,e)),e}async function m2t(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let a=0;ac2t(n,e)).then(n=>h2t(t,n,e)).then(n=>g2t(t,n,e)).then(n=>m2t(n,e))}const VCe=/url\((['"]?)([^'"]+?)\1\)/g,y2t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,v2t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function b2t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function x2t(t){const e=[];return t.replace(VCe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!PW(r))}async function w2t(t,e,r,n,i){try{const a=r?Wvt(e,r):e,s=bZ(e);let o;return i||(o=await xZ(a,s,n)),t.replace(b2t(e),`$1${o}$3`)}catch{}return t}function T2t(t,{preferredFontFormat:e}){return e?t.replace(v2t,r=>{for(;;){const[n,,i]=y2t.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function WCe(t){return t.search(VCe)!==-1}async function qCe(t,e,r){if(!WCe(t))return t;const n=T2t(t,r);return x2t(n).reduce((a,s)=>a.then(o=>w2t(o,s,e,r)),Promise.resolve(n))}async function Cv(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const a=await qCe(i,null,r);return e.style.setProperty(t,a,e.style.getPropertyPriority(t)),!0}return!1}async function k2t(t,e){await Cv("background",t,e)||await Cv("background-image",t,e),await Cv("mask",t,e)||await Cv("-webkit-mask",t,e)||await Cv("mask-image",t,e)||await Cv("-webkit-mask-image",t,e)}async function C2t(t,e){const r=Yl(t,HTMLImageElement);if(!(r&&!PW(t.src))&&!(Yl(t,SVGImageElement)&&!PW(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await xZ(n,bZ(n),e);await new Promise((a,s)=>{t.onload=a,t.onerror=e.onImageErrorHandler?(...l)=>{try{a(e.onImageErrorHandler(...l))}catch(u){s(u)}}:s;const o=t;o.decode&&(o.decode=a),o.loading==="lazy"&&(o.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function S2t(t,e){const n=_p(t.childNodes).map(i=>GCe(i,e));await Promise.all(n).then(()=>t)}async function GCe(t,e){Yl(t,Element)&&(await k2t(t,e),await C2t(t,e),await S2t(t,e))}function E2t(t,e){const{style:r}=t;e.backgroundColor&&(r.backgroundColor=e.backgroundColor),e.width&&(r.width=`${e.width}px`),e.height&&(r.height=`${e.height}px`);const n=e.style;return n!=null&&Object.keys(n).forEach(i=>{r[i]=n[i]}),t}const Ple={};async function Ble(t){let e=Ple[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},Ple[t]=e,e}async function Fle(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async s=>{let o=s.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),zCe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(s,`url(${l})`),[s,l]))});return Promise.all(a).then(()=>r)}function zle(t){if(t==null)return[];const e=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=t.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(n);if(l===null)break;e.push(l[0])}n=n.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let l=a.exec(n);if(l===null){if(l=o.exec(n),l===null)break;a.lastIndex=o.lastIndex}else o.lastIndex=a.lastIndex;e.push(l[0])}return e}async function A2t(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{_p(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,u=Ble(l).then(h=>Fle(h,e)).then(h=>zle(h).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:d,error:f})}})).catch(h=>{console.error("Error loading remote css",h.toString())});n.push(u)}})}catch(a){const s=t.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(Ble(i.href).then(o=>Fle(o,e)).then(o=>zle(o).forEach(l=>{s.insertRule(l,s.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",a)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{_p(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function R2t(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>WCe(e.style.getPropertyValue("src")))}async function _2t(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=_p(t.ownerDocument.styleSheets),n=await A2t(r,e);return R2t(n)}function UCe(t){return t.trim().replace(/["']/g,"")}function M2t(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{e.add(UCe(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(t),e}async function L2t(t,e){const r=await _2t(t,e),n=M2t(t);return(await Promise.all(r.filter(a=>n.has(UCe(a.style.fontFamily))).map(a=>{const s=a.parentStyleSheet?a.parentStyleSheet.href:null;return qCe(a.cssText,s,e)}))).join(` +`)}async function I2t(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await L2t(t,e);if(r){const n=document.createElement("style"),i=document.createTextNode(r);n.appendChild(i),t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}}async function $2t(t,e={}){const{width:r,height:n}=FCe(t,e),i=await G$(t,e,!0);return await I2t(i,e),await GCe(i,e),E2t(i,e),await Kvt(i,r,n)}async function N2t(t,e={}){const{width:r,height:n}=FCe(t,e),i=await $2t(t,e),a=await sM(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=e.pixelRatio||Yvt(),u=e.canvasWidth||r,h=e.canvasHeight||n;return s.width=u*l,s.height=h*l,e.skipAutoScale||jvt(s),s.style.width=`${u}`,s.style.height=`${h}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(a,0,0,s.width,s.height),s}var Hle=Object.defineProperty,D2t=(t,e)=>{let r={};for(var n in t)Hle(r,n,{get:t[n],enumerable:!0});return Hle(r,Symbol.toStringTag,{value:"Module"}),r};function eo(t){this.content=t}eo.prototype={constructor:eo,find:function(t){for(var e=0;e>1}};eo.from=function(t){if(t instanceof eo)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new eo(e)};function YCe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){let s=i.text,o=a.text,l=0;for(;s[l]==o[l];l++)r++;return l&&l0&&f>0&&u[d-1]==h[f-1];)d--,f--,r--,n--;return d&&f&&d=56320&&t<57344}function KCe(t){return t>=55296&&t<56320}class Rt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;ne&&n(l,i+o,a||null,s)!==!1&&l.content.size){let h=o+1;l.nodesBetween(Math.max(0,e-h),Math.min(l.content.size,r-h),n,i+h)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",s=!0;return this.nodesBetween(e,r,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,r-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&n&&(s?s=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);ae)for(let a=0,s=0;se&&((sr)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,r-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,r-s-1))),n.push(o),i+=o.nodeSize),s=l}return new Rt(n,i)}cutByIndex(e,r){return e==r?Rt.empty:e==0&&r==this.content.length?this:new Rt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Rt(i,a)}addToStart(e){return new Rt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;rthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?iA(r+1,a):iA(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Rt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return Rt.fromArray(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rt.empty;let r,n=0;for(let i=0;ithis.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;rn.type.rank-i.type.rank),r}};Qi.none=[];class PS extends Error{}class Jt{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=QCe(this.content,e+this.openStart,r,this.openStart+1,this.openEnd+1);return n&&new Jt(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Jt(ZCe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Jt.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Jt(Rt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Jt(e,n,i)}}Jt.empty=new Jt(Rt.empty,0,0);function ZCe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:s,offset:o}=t.findIndex(r);if(i==e||a.isText){if(o!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(ZCe(a.content,e-i-1,r-i-1)))}function QCe(t,e,r,n,i,a){let{index:s,offset:o}=t.findIndex(e),l=t.maybeChild(s);if(o==e||l.isText)return a&&n<=0&&i<=0&&!a.canReplace(s,s,r)?null:t.cut(0,e).append(r).append(t.cut(e));let u=QCe(l.content,e-o-1,r,s==0?n-1:0,s==t.childCount-1?i-1:0,l);return u&&t.replaceChild(s,l.copy(u))}function O2t(t,e,r){if(r.openStart>t.depth)throw new PS("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new PS("Inconsistent open depths");return JCe(t,e,r,0)}function JCe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function AC(t,e,r,n){let i=(e||t).node(r),a=0,s=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(T1(t.nodeAfter,n),a++));for(let o=a;oi&&FW(t,e,i+1),s=n.depth>i&&FW(r,n,i+1),o=[];return AC(null,t,i,o),a&&s&&e.index(i)==r.index(i)?(eSe(a,s),T1(k1(a,tSe(t,e,r,n,i+1)),o)):(a&&T1(k1(a,lM(t,e,i+1)),o),AC(e,r,i,o),s&&T1(k1(s,lM(r,n,i+1)),o)),AC(n,null,i,o),new Rt(o)}function lM(t,e,r){let n=[];if(AC(null,t,r,n),t.depth>r){let i=FW(t,e,r+1);T1(k1(i,lM(t,e,r+1)),n)}return AC(e,null,r,n),new Rt(n)}function P2t(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Rt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class BS{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new cM(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(n.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new BS(r,n,a)}static resolveCached(e,r){let n=Vle.get(e);if(n)for(let a=0;ae&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),rSe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Rt.empty,i=0,a=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,a),o=s&&s.matchFragment(this.content,r);if(!o||!o.validEnd)return!1;for(let l=i;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Rt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};cb.prototype.text=void 0;let H2t=class HW extends cb{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):rSe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new HW(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new HW(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function rSe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class K1{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new V2t(e,r);if(n.next==null)return K1.empty;let i=nSe(n);n.next&&n.err("Unexpected trailing text");let a=X2t(j2t(i));return K2t(a,n),a}matchType(e){for(let r=0;ru.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i{let a=i+(n.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(n.next[s].next);return a}).join(` +`)}}K1.empty=new K1(!0);class V2t{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function nSe(t){let e=[];do e.push(W2t(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function W2t(t){let e=[];do e.push(q2t(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function q2t(t){let e=Y2t(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=G2t(t,e);else break;return e}function Wle(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function G2t(t,e){let r=Wle(t),n=r;return t.eat(",")&&(t.next!="}"?n=Wle(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function U2t(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let s=r[a];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Y2t(t){if(t.eat("(")){let e=nSe(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=U2t(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function j2t(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(a(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=a(s.exprs[l],o);if(l==s.exprs.length-1)return u;i(u,o=r())}else if(s.type=="star"){let l=r();return n(o,l),i(a(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return i(a(s.expr,o),l),i(a(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let h=0;h{u||i.push([o,u=[]]),u.indexOf(h)==-1&&u.push(h)})})});let a=e[n.join(",")]=new K1(n.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:sSe(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new cb(this,this.computeAttrs(e),Rt.from(r),Qi.setFrom(n))}createChecked(e=null,r,n){return r=Rt.from(r),this.checkContent(r),new cb(this,this.computeAttrs(e),r,Qi.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Rt.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(Rt.empty,!0);return a?new cb(this,e,r.append(a),Qi.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;rn[a]=new cSe(a,r,s));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Z2t(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class Q2t{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Z2t(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class U${constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=lSe(e,i.attrs),this.excluded=null;let a=aSe(this.attrs);this.instance=a?new Qi(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Qi(this,sSe(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,s)=>n[a]=new U$(a,i++,r,s)),n}removeFromSet(e){for(var r=0;r-1}}class uSe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=eo.from(e.nodes),r.marks=eo.from(e.marks||{}),this.nodes=Gle.compile(this.spec.nodes,this),this.marks=U$.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=n[s]||(n[s]=K1.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?Ule(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:Ule(this,s.split(" "))}this.nodeFromJSON=i=>cb.fromJSON(this,i),this.markFromJSON=i=>Qi.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Gle){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new H2t(n,n.defaultAttrs,e,Qi.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function Ule(t,e){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function J2t(t){return t.tag!=null}function ebt(t){return t.style!=null}class Mp{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(J2t(i))this.tags.push(i);else if(ebt(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new jle(this,r,!1);return n.addAll(e,Qi.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new jle(this,r,!0);return n.addAll(e,Qi.none,r.from,r.to),Jt.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,s=0;for(;s{n(s=Xle(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(s=>{n(s=Xle(s)),s.node||s.ignore||s.mark||(s.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mp(e,Mp.schemaRules(e)))}}const hSe={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tbt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},dSe={ol:!0,ul:!0},FS=1,VW=2,RC=4;function Yle(t,e,r){return e!=null?(e?FS:0)|(e==="full"?VW:0):t&&t.whitespace=="pre"?FS|VW:r&~RC}class aA{constructor(e,r,n,i,a,s){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=s,this.content=[],this.activeMarks=Qi.none,this.match=a||(s&RC?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Rt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&FS)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=Rt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Rt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hSe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class jle{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,s=Yle(null,r.preserveWhitespace,0)|(n?RC:0);i?a=new aA(i.type,i.attrs,Qi.none,!0,r.topMatch||i.type.contentMatch,s):n?a=new aA(null,null,Qi.none,!0,null,s):a=new aA(e.schema.topNodeType,null,Qi.none,!0,null,s),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&VW?"full":this.localPreserveWS||(i.options&FS)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)if(a==="full")n=n.replace(/\r\n?/g,` +`);else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return r}addElementByRule(e,r,n,i){let a,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(s,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(o)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=i==null?null:e.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(s,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+o)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s(s.type?s.type.allowsMarkType(u.type):Kle(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new aA(e,r,l,i,null,o)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=FS)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let u=r[o];if(u==""){if(o==r.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let h=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!h||h.name!=u&&!h.isInGroup(u))return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function rbt(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&dSe.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function nbt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Xle(t){let e={};for(let r in t)e[r]=t[r];return e}function Kle(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],s=o=>{a.push(o);for(let l=0;l{if(a.length||s.marks.length){let o=0,l=0;for(;o=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&lR(sA(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return typeof r=="string"?{dom:e.createTextNode(r)}:lR(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Y$(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=Zle(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return Zle(e.marks)}}function Zle(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function sA(t){return t.document||window.document}const Qle=new WeakMap;function ibt(t){let e=Qle.get(t);return e===void 0&&Qle.set(t,e=abt(t)),e}function abt(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],h=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){h=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=h;dh)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:g}=lR(t,f,r,n);if(l.appendChild(p),g){if(o)throw new RangeError("Multiple content holes");o=g}}}return{dom:l,contentDOM:o}}const fSe=65535,pSe=Math.pow(2,16);function sbt(t,e){return t+e*pSe}function Jle(t){return t&fSe}function obt(t){return(t-(t&fSe))/pSe}const gSe=1,mSe=2,cR=4,ySe=8;class WW{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&ySe)>0}get deletedBefore(){return(this.delInfo&(gSe|cR))>0}get deletedAfter(){return(this.delInfo&(mSe|cR))>0}get deletedAcross(){return(this.delInfo&cR)>0}}class fc{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&fc.empty)return fc.empty}recover(e){let r=0,n=Jle(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[o+a],h=this.ranges[o+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:r:r,p=l+i+(f<0?0:h);if(n)return p;let g=e==(r<0?l:d)?null:sbt(o/3,e-l),m=e==l?mSe:e==d?gSe:cR;return(r<0?e!=l:e!=d)&&(m|=ySe),new WW(p,m,g)}i+=h-u}return n?e+i:new WW(e+i,0,null)}touches(e,r){let n=0,i=Jle(r),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;oe)break;let u=this.ranges[o+a],h=l+u;if(e<=h&&o==i*3)return!0;n+=this.ranges[o+s]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new zS;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;na&&l!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),r.openStart,r.openEnd);return Ka.fromReplace(e,this.from,this.to,a)}invert(){return new Hu(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new gp(r.pos,n.pos,this.mark)}merge(e){return e instanceof gp&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new gp(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gp(r.from,r.to,e.markFromJSON(r.mark))}}zo.jsonID("addMark",gp);class Hu extends zo{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Jt(wZ(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Ka.fromReplace(e,this.from,this.to,n)}invert(){return new gp(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Hu(r.pos,n.pos,this.mark)}merge(e){return e instanceof Hu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hu(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Hu(r.from,r.to,e.markFromJSON(r.mark))}}zo.jsonID("removeMark",Hu);class mp extends zo{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ka.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Ka.fromReplace(e,this.pos,this.pos+1,new Jt(Rt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;in.pos?null:new Is(r.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Is(r.from,r.to,r.gapFrom,r.gapTo,Jt.fromJSON(e,r.slice),r.insert,!!r.structure)}}zo.jsonID("replaceAround",Is);function qW(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let s=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function lbt(t,e,r,n){let i=[],a=[],s,o;t.doc.nodesBetween(e,r,(l,u,h)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&h.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),g=n.addToSet(d);for(let m=0;mt.step(l)),a.forEach(l=>t.step(l))}function cbt(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(n instanceof U$){let u=s.marks,h;for(;h=n.isInSet(u);)(l||(l=[])).push(h),u=h.removeFromSet(u)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,r);for(let h=0;ht.step(new Hu(s.from,s.to,s.style)))}function TZ(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l=0;l--)t.step(s[l])}function ubt(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function N3(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,i=0,a=0;;--n){let s=t.$from.node(n),o=t.$from.index(n)+i,l=t.$to.indexAfter(n)-a;if(nr;g--)m||n.index(g)>0?(m=!0,h=Rt.from(n.node(g).copy(h)),d++):l--;let f=Rt.empty,p=0;for(let g=a,m=!1;g>r;g--)m||i.after(g+1)=0;s--){if(n.size){let o=r[s].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Rt.from(r[s].type.create(r[s].attrs,n))}let i=e.start,a=e.end;t.step(new Is(i,a,i,a,new Jt(n,0,0),r.length,!0))}function gbt(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(n,l)&&mbt(t.doc,t.mapping.slice(a).map(o),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?u=!1:!p&&g&&(u=!0)}u===!1&&bSe(t,s,o,a),TZ(t,t.mapping.slice(a).map(o,1),n,void 0,u===null);let h=t.mapping.slice(a),d=h.map(o,1),f=h.map(o+s.nodeSize,1);return t.step(new Is(d,f,d+1,f-1,new Jt(Rt.from(n.create(l,null,s.marks)),0,0),1,!0)),u===!0&&vSe(t,s,o,a),!1}})}function vSe(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function bSe(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+a);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function mbt(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function ybt(t,e,r,n,i){let a=t.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");r||(r=a.type);let s=r.create(n,null,i||a.marks);if(a.isLeaf)return t.replaceWith(e,e+a.nodeSize,s);if(!r.validContent(a.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Is(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new Jt(Rt.from(s),0,0),1,!0))}function If(t,e,r=1,n){let i=t.resolve(e),a=i.depth-r,s=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,h=r-2;u>a;u--,h--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),g=n&&n[h+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let m=n&&n[h]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let o=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(o,o,l?l.type:i.node(a+1).type)}function vbt(t,e,r=1,n){let i=t.doc.resolve(e),a=Rt.empty,s=Rt.empty;for(let o=i.depth,l=i.depth-r,u=r-1;o>l;o--,u--){a=Rt.from(i.node(o).copy(a));let h=n&&n[u];s=Rt.from(h?h.type.create(h.attrs,s):i.node(o).copy(s))}t.step(new Ua(e,e,new Jt(a.append(s),r,r),!0))}function gg(t,e){let r=t.resolve(e),n=r.index();return xSe(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function bbt(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i0?(a=n.node(i+1),o++,s=n.node(i).maybeChild(o)):(a=n.node(i).maybeChild(o-1),s=n.node(i+1)),a&&!a.isTextblock&&xSe(a,s)&&n.node(i).canReplace(o,o+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function xbt(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,a=t.doc.resolve(e-r),s=a.node().type;if(i&&s.inlineContent){let h=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);h&&!d?n=!1:!h&&d&&(n=!0)}let o=t.steps.length;if(n===!1){let h=t.doc.resolve(e+r);bSe(t,h.node(),h.before(),o)}s.inlineContent&&TZ(t,e+r-1,s,a.node().contentMatchAt(a.index()),n==null);let l=t.mapping.slice(o),u=l.map(e-r);if(t.step(new Ua(u,l.map(e+r,-1),Jt.empty,!0)),n===!0){let h=t.doc.resolve(u);vSe(t,h.node(),h.before(),t.steps.length)}return t}function wbt(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,r))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,r))return n.after(i+1);if(a=0;s--){let o=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(o>0?1:0),u=n.node(s),h=!1;if(a==1)h=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);h=d&&u.canReplaceWith(l,l,d[0])}if(h)return o==0?n.pos:o<0?n.before(s+1):n.after(s+1)}return null}function X$(t,e,r=e,n=Jt.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),a=t.resolve(r);return TSe(i,a,n)?new Ua(e,r,n):new Tbt(i,a,n).fit()}function TSe(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class Tbt{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Rt.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Rt.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,s=n.depth,o=i.depth;for(;s&&o&&a.childCount==1;)a=a.firstChild.content,s--,o--;let l=new Jt(a,s,o);return e>-1?new Is(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Ua(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}r=a.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=QP(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let s=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:u}=this.frontier[o],h,d=null;if(r==1&&(s?u.matchType(s.type)||(d=u.fillBefore(Rt.from(s),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:o,parent:a,inject:d};if(r==2&&s&&(h=u.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:o,parent:a,wrap:h};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=QP(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Jt(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=QP(e,r);if(i.childCount<=1&&r>0){let a=e.size-r<=r+i.size;this.unplaced=new Jt(E5(e,r-1,1),r-1,a?r-1:n)}else this.unplaced=new Jt(E5(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:a}){for(;this.depth>r;)this.closeFrontierNode();if(a)for(let m=0;m1||l==0||m.content.size)&&(d=y,h.push(kSe(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==o.childCount?p:-1)))}let g=u==o.childCount;g||(p=-1),this.placed=A5(this.placed,r,Rt.from(h)),this.frontier[r].match=d,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=o;m1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],a=r=0;o--){let{match:l,type:u}=this.frontier[o],h=JP(e,o,u,l,!0);if(!h||h.childCount)continue e}return{depth:r,fit:s,move:a?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=A5(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=A5(this.placed,this.depth,Rt.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Rt.empty,!0);r.childCount&&(this.placed=A5(this.placed,this.frontier.length,r))}}function E5(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(E5(t.firstChild.content,e-1,r)))}function A5(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(A5(t.lastChild.content,e-1,r)))}function QP(t,e){for(let r=0;r1&&(n=n.replaceChild(0,kSe(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(Rt.empty,!0)))),t.copy(n)}function JP(t,e,r,n,i){let a=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==a.childCount&&!r.compatibleContent(a.type))return null;let o=n.fillBefore(a.content,!0,s);return o&&!kbt(r,a.content,s)?o:null}function kbt(t,e,r){for(let n=r;n0;f--,p--){let g=i.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(f)>-1?o=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(o),u=[],h=n.openStart;for(let f=n.content,p=0;;p++){let g=f.firstChild;if(u.push(g),p==n.openStart)break;f=g.content}for(let f=h-1;f>=0;f--){let p=u[f],g=Cbt(p.type);if(g&&!p.sameMarkup(i.node(Math.abs(o)-1)))h=f;else if(g||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+h+1)%(n.openStart+1),g=u[p];if(g)for(let m=0;m=0&&(t.replace(e,r,n),!(t.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),r=a.after(p))}}function CSe(t,e,r,n,i){if(en){let a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(Rt.empty,!0))}return t}function Ebt(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=wbt(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new Jt(Rt.from(n),0,0))}function Abt(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let s=n.sharedDepth(r),o=!1;for(let l=n.depth;l>s;l--)n.node(l).type.spec.isolating&&(o=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(o=!0);if(!o){for(let l=n.depth;l>0&&e==n.start(l);l--)e=n.before(l);for(let l=i.depth;l>0&&r==i.start(l);l--)r=i.before(l);n=t.doc.resolve(e),i=t.doc.resolve(r)}}let a=SSe(n,i);for(let s=0;s0&&(l||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return t.delete(n.before(o),i.after(o))}for(let s=1;s<=n.depth&&s<=i.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&i.end(s)-r!=i.depth-s&&n.start(s-1)==i.start(s-1)&&n.node(s-1).canReplace(n.index(s-1),i.index(s-1)))return t.delete(n.before(s),r);t.delete(e,r)}function SSe(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let a=t.start(i);if(ae.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&r.push(i)}return r}class ub extends zo{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ka.fail("No node at attribute step's position");let n=Object.create(null);for(let a in r.attrs)n[a]=r.attrs[a];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return Ka.fromReplace(e,this.pos,this.pos+1,new Jt(Rt.from(i),0,r.isLeaf?0:1))}getMap(){return fc.empty}invert(e){return new ub(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ub(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ub(r.pos,r.attr,r.value)}}zo.jsonID("attr",ub);class HS extends zo{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return Ka.ok(n)}getMap(){return fc.empty}invert(e){return new HS(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new HS(r.attr,r.value)}}zo.jsonID("docAttr",HS);let DT=class extends Error{};DT=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};DT.prototype=Object.create(Error.prototype);DT.prototype.constructor=DT;DT.prototype.name="TransformError";class ESe{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zS}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new DT(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,r=-1e9;for(let n=0;n{e=Math.min(e,o),r=Math.max(r,l)})}return e==1e9?null:{from:e,to:r}}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=Jt.empty){let i=X$(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new Jt(Rt.from(n),0,0))}delete(e,r){return this.replace(e,r,Jt.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return Sbt(this,e,r,n),this}replaceRangeWith(e,r,n){return Ebt(this,e,r,n),this}deleteRange(e,r){return Abt(this,e,r),this}lift(e,r){return hbt(this,e,r),this}join(e,r=1){return xbt(this,e,r),this}wrap(e,r){return pbt(this,e,r),this}setBlockType(e,r=e,n,i=null){return gbt(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return ybt(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new ub(e,r,n)),this}setDocAttribute(e,r){return this.step(new HS(e,r)),this}addNodeMark(e,r){return this.step(new mp(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof Qi)r.isInSet(n.marks)&&this.step(new Z1(e,r));else{let i=n.marks,a,s=[];for(;a=r.isInSet(i);)s.push(new Z1(e,a)),i=a.removeFromSet(i);for(let o=s.length-1;o>=0;o--)this.step(s[o])}return this}split(e,r=1,n){return vbt(this,e,r,n),this}addMark(e,r,n){return lbt(this,e,r,n),this}removeMark(e,r,n){return cbt(this,e,r,n),this}clearIncompatible(e,r,n){return TZ(this,e,r,n),this}}const eB=Object.create(null);class sn{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new ASe(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r=0;a--){let s=r<0?l2(e.node(0),e.node(a),e.before(a+1),e.index(a),r,n):l2(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new vc(e.node(0))}static atStart(e){return l2(e,e,0,0,1)||new vc(e)}static atEnd(e){return l2(e,e,e.content.size,e.childCount,-1)||new vc(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=eB[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in eB)throw new RangeError("Duplicate use of selection JSON ID "+e);return eB[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Tr.between(this.$anchor,this.$head).getBookmark()}}sn.prototype.visible=!0;let ASe=class{constructor(e,r){this.$from=e,this.$to=r}},tce=!1;function rce(t){!tce&&!t.parent.inlineContent&&(tce=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Tr extends sn{constructor(e,r=e){rce(e),rce(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return sn.near(n);let i=e.resolve(r.map(this.anchor));return new Tr(i.parent.inlineContent?i:n,n)}replace(e,r=Jt.empty){if(super.replace(e,r),r==Jt.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Tr&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new K$(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Tr(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let a=sn.findFrom(r,n,!0)||sn.findFrom(r,-n,!0);if(a)r=a.$head;else return sn.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(sn.findFrom(e,-n,!0)||sn.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let o=e.child(s);if(o.isAtom){if(!a&&Ir.isSelectable(o))return Ir.create(t,r-(i<0?o.nodeSize:0))}else{let l=l2(t,o,r+i,i<0?o.childCount:0,i,a);if(l)return l}r+=o.nodeSize*i}return null}function nce(t,e,r){let n=t.steps.length-1;if(n{s==null&&(s=h)}),t.setSelection(sn.near(t.doc.resolve(s),r))}function ice(t,e){return!e||!t?t:t.bind(e)}class oA{constructor(e,r,n){this.name=e,this.init=ice(r.init,n),this.apply=ice(r.apply,n)}}new oA("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new oA("selection",{init(t,e){return t.selection||sn.atStart(e.doc)},apply(t){return t.selection}}),new oA("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new oA("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function RSe(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=RSe(i,e,{})),r[n]=i}return r}class da{constructor(e){this.spec=e,this.props={},e.props&&RSe(e.props,this,this.props),this.key=e.key?e.key.key:_Se("plugin")}getState(e){return e[this.key]}}const tB=Object.create(null);function _Se(t){return t in tB?t+"$"+ ++tB[t]:(tB[t]=0,t+"$")}class fa{constructor(e="key"){this.key=_Se(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const MSe=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function LSe(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const ISe=(t,e,r)=>{let n=LSe(t,r);if(!n)return!1;let i=SZ(n);if(!i){let s=n.blockRange(),o=s&&N3(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)}let a=i.nodeBefore;if(HSe(t,i,e,-1))return!0;if(n.parent.content.size==0&&(OT(a,"end")||Ir.isSelectable(a)))for(let s=n.depth;;s--){let o=X$(t.doc,n.before(s),n.after(s),Jt.empty);if(o&&o.slice.size1)break}return a.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},_bt=(t,e,r)=>{let n=LSe(t,r);if(!n)return!1;let i=SZ(n);return i?$Se(t,i,e):!1},Mbt=(t,e,r)=>{let n=DSe(t,r);if(!n)return!1;let i=EZ(n);return i?$Se(t,i,e):!1};function $Se(t,e,r){let n=e.nodeBefore,i=n,a=e.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let s=e.nodeAfter,o=s,l=e.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let h=o.firstChild;if(!h)return!1;o=h}let u=X$(t.doc,a,l,Jt.empty);if(!u||u.from!=a||u instanceof Ua&&u.slice.size>=l-a)return!1;if(r){let h=t.tr.step(u);h.setSelection(Tr.create(h.doc,a)),r(h.scrollIntoView())}return!0}function OT(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const NSe=(t,e,r)=>{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;a=SZ(n)}let s=a&&a.nodeBefore;return!s||!Ir.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ir.create(t.doc,a.pos-s.nodeSize)).scrollIntoView()),!0)};function SZ(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function DSe(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset{let n=DSe(t,r);if(!n)return!1;let i=EZ(n);if(!i)return!1;let a=i.nodeAfter;if(HSe(t,i,e,1))return!0;if(n.parent.content.size==0&&(OT(a,"start")||Ir.isSelectable(a))){let s=X$(t.doc,n.before(),n.after(),Jt.empty);if(s&&s.slice.size{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset=0;e--){let r=t.node(e);if(t.index(e)+1{let r=t.selection,n=r instanceof Ir,i;if(n){if(r.node.isTextblock||!gg(t.doc,r.from))return!1;i=r.from}else if(i=j$(t.doc,r.from,-1),i==null)return!1;if(e){let a=t.tr.join(i);n&&a.setSelection(Ir.create(a.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(a.scrollIntoView())}return!0},Ibt=(t,e)=>{let r=t.selection,n;if(r instanceof Ir){if(r.node.isTextblock||!gg(t.doc,r.to))return!1;n=r.to}else if(n=j$(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},$bt=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),a=i&&N3(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)},BSe=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function AZ(t){for(let e=0;e{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),a=r.indexAfter(-1),s=AZ(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(e){let o=r.after(),l=t.tr.replaceWith(o,o,s.createAndFill());l.setSelection(sn.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},FSe=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof vc||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=AZ(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let s=(!n.parentOffset&&i.index(){let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let a=r.before();if(If(t.doc,a))return e&&e(t.tr.split(a).scrollIntoView()),!0}let n=r.blockRange(),i=n&&N3(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function Dbt(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof Ir&&e.selection.node.isBlock)return!n.parentOffset||!If(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let a=[],s,o,l=!1,u=!1;for(let p=n.depth;;p--)if(n.node(p).isBlock){l=n.end(p)==n.pos+(n.depth-p),u=n.start(p)==n.pos-(n.depth-p),o=AZ(n.node(p-1).contentMatchAt(n.indexAfter(p-1))),a.unshift(l&&o?{type:o}:null),s=p;break}else{if(p==1)return!1;a.unshift(null)}let h=e.tr;(e.selection instanceof Tr||e.selection instanceof vc)&&h.deleteSelection();let d=h.mapping.map(n.pos),f=If(h.doc,d,a.length,a);if(f||(a[0]=o?{type:o}:null,f=If(h.doc,d,a.length,a)),!f)return!1;if(h.split(d,a.length,a),!l&&u&&n.node(s).type!=o){let p=h.mapping.map(n.before(s)),g=h.doc.resolve(p);o&&n.node(s-1).canReplaceWith(g.index(),g.index()+1,o)&&h.setNodeMarkup(h.mapping.map(n.before(s)),o)}return r&&r(h.scrollIntoView()),!0}}const Obt=Dbt(),Pbt=(t,e)=>{let{$from:r,to:n}=t.selection,i,a=r.sharedDepth(n);return a==0?!1:(i=r.before(a),e&&e(t.tr.setSelection(Ir.create(t.doc,i))),!0)};function Bbt(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||gg(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function HSe(t,e,r,n){let i=e.nodeBefore,a=e.nodeAfter,s,o,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&Bbt(t,e,r))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(s[0]||a.type).validEnd){if(r){let p=e.pos+a.nodeSize,g=Rt.empty;for(let v=s.length-1;v>=0;v--)g=Rt.from(s[v].create(null,g));g=Rt.from(i.copy(g));let m=t.tr.step(new Is(e.pos-1,p,e.pos,p,new Jt(g,1,0),s.length,!0)),y=m.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&gg(m.doc,y.pos)&&m.join(y.pos),r(m.scrollIntoView())}return!0}let h=a.type.spec.isolating||n>0&&l?null:sn.findFrom(e,1),d=h&&h.$from.blockRange(h.$to),f=d&&N3(d);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&OT(a,"start",!0)&&OT(i,"end")){let p=i,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let m=a,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(r){let v=Rt.empty;for(let b=g.length-1;b>=0;b--)v=Rt.from(g[b].copy(v));let x=t.tr.step(new Is(e.pos-g.length,e.pos+a.nodeSize,e.pos+y,e.pos+a.nodeSize-y,new Jt(v,g.length,0),0,!0));r(x.scrollIntoView())}return!0}}return!1}function VSe(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(r&&r(e.tr.setSelection(Tr.create(e.doc,t<0?i.start(a):i.end(a)))),!0):!1}}const Fbt=VSe(-1),zbt=VSe(1);function Hbt(t,e=null){return function(r,n){let{$from:i,$to:a}=r.selection,s=i.blockRange(a),o=s&&kZ(s,t,e);return o?(n&&n(r.tr.wrap(s,o).scrollIntoView()),!0):!1}}function ace(t,e=null){return function(r,n){let i=!1;for(let a=0;a{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let h=r.doc.resolve(u),d=h.index();i=h.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(n){let a=r.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);a=new cM(l,l,e.depth),e.endIndex=0;h--)a=Rt.from(r[h].type.create(r[h].attrs,a));t.step(new Is(e.start-(n?2:0),e.end,e.start,e.end,new Jt(a,0,0),r.length,!0));let s=0;for(let h=0;hs.childCount>0&&s.firstChild.type==t);return a?r?n.node(a.depth-1).type==t?Ubt(e,r,t,a):Ybt(e,r,a):!0:!1}}function Ubt(t,e,r,n){let i=t.tr,a=n.end,s=n.$to.end(n.depth);am;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let a=n.doc.resolve(r.start),s=a.nodeAfter;if(n.mapping.map(r.end)!=r.start+a.nodeAfter.nodeSize)return!1;let o=r.startIndex==0,l=r.endIndex==i.childCount,u=a.node(-1),h=a.index(-1);if(!u.canReplace(h+(o?0:1),h+1,s.content.append(l?Rt.empty:Rt.from(i))))return!1;let d=a.pos,f=d+s.nodeSize;return n.step(new Is(d-(o?1:0),f+(l?1:0),d+1,f-1,new Jt((o?Rt.empty:Rt.from(i.copy(Rt.empty))).append(l?Rt.empty:Rt.from(i.copy(Rt.empty))),o?0:1,l?0:1),o?0:1)),e(n.scrollIntoView()),!0}function jbt(t){return function(e,r){let{$from:n,$to:i}=e.selection,a=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!a)return!1;let s=a.startIndex;if(s==0)return!1;let o=a.parent,l=o.child(s-1);if(l.type!=t)return!1;if(r){let u=l.lastChild&&l.lastChild.type==o.type,h=Rt.from(u?t.create():null),d=new Jt(Rt.from(t.create(null,Rt.from(o.type.create(null,h)))),u?3:1,0),f=a.start,p=a.end;r(e.tr.step(new Is(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const My=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},WSe=function(t,e,r,n){return r&&(sce(t,e,r,n,-1)||sce(t,e,r,n,1))},Xbt=/^(img|br|input|textarea|hr)$/i;function sce(t,e,r,n,i){for(var a;;){if(t==r&&e==n)return!0;if(e==(i<0?0:uM(t))){let s=t.parentNode;if(!s||s.nodeType!=1||_Z(t)||Xbt.test(t.nodeName)||t.contentEditable=="false")return!1;e=My(t)+(i<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((a=s.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?uM(t):0}else return!1}}function uM(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kbt(t,e,r){for(let n=e==0,i=e==uM(t);n||i;){if(t==r)return!0;let a=My(t);if(t=t.parentNode,!t)return!1;n=n&&a==0,i=i&&a==uM(t)}}function _Z(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const qSe=function(t){return t.focusNode&&WSe(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function GSe(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}const ad=typeof navigator<"u"?navigator:null,oce=typeof document<"u"?document:null,mg=ad&&ad.userAgent||"",GW=/Edge\/(\d+)/.exec(mg),USe=/MSIE \d/.exec(mg),UW=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mg),xE=!!(USe||UW||GW),YSe=USe?document.documentMode:UW?+UW[1]:GW?+GW[1]:0,Z$=!xE&&/gecko\/(\d+)/i.test(mg);Z$&&+(/Firefox\/(\d+)/.exec(mg)||[0,0])[1];const YW=!xE&&/Chrome\/(\d+)/.exec(mg),h0=!!YW,jSe=YW?+YW[1]:0,Ly=!xE&&!!ad&&/Apple Computer/.test(ad.vendor),MZ=Ly&&(/Mobile\/\w+/.test(mg)||!!ad&&ad.maxTouchPoints>2),Xc=MZ||(ad?/Mac/.test(ad.platform):!1),XSe=ad?/Win/.test(ad.platform):!1,wE=/Android \d/.test(mg),LZ=!!oce&&"webkitFontSmoothing"in oce.documentElement.style,Zbt=LZ?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qbt(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),a=i&&i.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let o=n.resolve(s),l,u;if(qSe(r)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Ir.isSelectable(d)&&i.parent&&!(d.isInline&&Kbt(r.focusNode,r.focusOffset,i.dom))){let f=i.posBefore;u=new Ir(s==f?o:n.resolve(f))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let d=s,f=s;for(let p=0;p{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!KSe(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ext(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,My(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&xE&&YSe<=11&&(r.disabled=!0,r.disabled=!1)}function txt(t,e){if(e instanceof Ir){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(hce(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else hce(t)}function hce(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ZSe(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||Tr.between(e,r,n)}function rxt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function jW(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&sn.findFrom(a,e)}function Z0(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function dce(t,e,r){let n=t.state.selection;if(n instanceof Tr)if(r.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return Z0(t,new Tr(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=jW(t.state,e);return i&&i instanceof Ir?Z0(t,i):!1}else if(!(Xc&&r.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!a||a.isText)return!1;let o=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(s=t.docView.descAt(o))&&!s.contentDOM?Ir.isSelectable(a)?Z0(t,new Ir(e<0?t.state.doc.resolve(i.pos-a.nodeSize):i)):LZ?Z0(t,new Tr(t.state.doc.resolve(e<0?o:o+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Ir&&n.node.isInline)return Z0(t,new Tr(e>0?n.$to:n.$from));{let i=jW(t.state,e);return i?Z0(t,i):!1}}}function hM(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _C(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Sv(t,e){return e<0?nxt(t):ixt(t)}function nxt(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,a,s=!1;for(Z$&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(_C(o,-1))i=r,a=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(QSe(r))break;{let o=r.previousSibling;for(;o&&_C(o,-1);)i=r.parentNode,a=My(o),o=o.previousSibling;if(o)r=o,n=hM(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}s?XW(t,r,n):i&&XW(t,i,a)}function ixt(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=hM(r),a,s;for(;;)if(n{t.state==i&&IZ(t)},50)}function fce(t,e){let r=t.state.doc.resolve(e);if(!(h0||XSe)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let a=t.coordsAtPos(e-1),s=(a.top+a.bottom)/2;if(s>i.top&&s1)return a.lefti.top&&s1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function pce(t,e,r){let n=t.state.selection;if(n instanceof Tr&&!n.empty||r.indexOf("s")>-1||Xc&&r.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=jW(t.state,e);if(s&&s instanceof Ir)return Z0(t,s)}if(!i.parent.inlineContent){let s=e<0?i:a,o=n instanceof vc?sn.near(s,e):sn.findFrom(s,e);return o?Z0(t,o):!1}return!1}function gce(t,e){if(!(t.state.selection instanceof Tr))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function mce(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function oxt(t){if(!Ly||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;mce(t,n,"true"),setTimeout(()=>mce(t,n,"false"),20)}return!1}function lxt(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function cxt(t,e){let r=e.keyCode,n=lxt(e);if(r==8||Xc&&r==72&&n=="c")return gce(t,-1)||Sv(t,-1);if(r==46&&!e.shiftKey||Xc&&r==68&&n=="c")return gce(t,1)||Sv(t,1);if(r==13||r==27)return!0;if(r==37||Xc&&r==66&&n=="c"){let i=r==37?fce(t,t.state.selection.from)=="ltr"?-1:1:-1;return dce(t,i,n)||Sv(t,i)}else if(r==39||Xc&&r==70&&n=="c"){let i=r==39?fce(t,t.state.selection.from)=="ltr"?1:-1:1;return dce(t,i,n)||Sv(t,i)}else{if(r==38||Xc&&r==80&&n=="c")return pce(t,-1,n)||Sv(t,-1);if(r==40||Xc&&r==78&&n=="c")return oxt(t)||pce(t,1,n)||Sv(t,1);if(n==(Xc?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function JSe(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let r=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=t.someProp("clipboardSerializer")||Y$.fromSchema(t.state.schema),o=a6e(),l=o.createElement("div");l.appendChild(s.serializeFragment(n,{document:o}));let u=l.firstChild,h,d=0;for(;u&&u.nodeType==1&&(h=i6e[u.nodeName.toLowerCase()]);){for(let p=h.length-1;p>=0;p--){let g=o.createElement(h[p]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` -`);return{dom:l,text:f,slice:e}}function JSe(t,e,r,n,i){let a=i.parent.type.spec.code,s,o;if(!r&&!e)return null;let l=!!e&&(n||a||!r);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,a||n,t)}),a)return o=new Jt(Rt.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),t.someProp("transformPasted",f=>{o=f(o,t,!0)}),o;let d=t.someProp("clipboardTextParser",f=>f(e,i,n,t));if(d)o=d;else{let f=i.marks(),{schema:p}=t.state,g=G$.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(g.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{r=d(r,t)}),s=uxt(r),_Z&&hxt(s);let u=s&&s.querySelector("[data-pm-slice]"),h=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let d=+h[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Mp.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||h),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!oxt.test(f.parentNode.nodeName)?{ignore:!0}:null}})),h)o=dxt(gce(o,+h[1],+h[2]),h[4]);else if(o=Jt.maxOpen(lxt(o.content,i),!0),o.openStart||o.openEnd){let d=0,f=0;for(let p=o.content.firstChild;d{o=d(o,t,l)}),o}const oxt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function lxt(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),a,s=[];if(t.forEach(o=>{if(!s)return;let l=i.findWrapping(o.type),u;if(!l)return s=null;if(u=s.length&&a.length&&t6e(l,a,o,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=r6e(s[s.length-1],a.length));let h=e6e(o,l);s.push(h),i=i.matchType(h.type),a=l}}),s)return Rt.from(s)}return t}function e6e(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,Rt.from(t));return t}function t6e(t,e,r,n,i){if(i1&&(a=0),i=r&&(o=e<0?s.contentMatchAt(0).fillBefore(o,a<=i).append(o):o.append(s.contentMatchAt(s.childCount).fillBefore(Rt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(o))}function gce(t,e,r){return er})),tB.createHTML(t)):t}function uxt(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=i6e().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&n6e[n[1].toLowerCase()])&&(t=i.map(a=>"<"+a+">").join("")+t+i.map(a=>"").reverse().join("")),r.innerHTML=cxt(t),i)for(let a=0;a=0;o-=2){let l=r.nodes[n[o]];if(!l||l.hasRequiredAttrs())break;i=Rt.from(l.create(n[o+1],i)),a++,s++}return new Jt(i,a,s)}const ch={},Sc={};function xf(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}Sc.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!l6e(t)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(xE&&h0&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),RZ&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,qSe(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||sxt(t,r)?r.preventDefault():xf(t,"key")};Sc.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Sc.keypress=(t,e)=>{let r=e;if(l6e(t)||!r.charCode||r.ctrlKey&&!r.altKey||Xc&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof wr)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),a=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,n.$from.pos,n.$to.pos,i,a))&&t.dispatch(a()),r.preventDefault()}};function wE(t){return{left:t.clientX,top:t.clientY}}function fxt(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function LZ(t,e,r,n,i){if(n==-1)return!1;let a=t.state.doc.resolve(n);for(let s=a.depth+1;s>0;s--)if(t.someProp(e,o=>s>a.depth?o(t,r,a.nodeAfter,a.before(s),i,!0):o(t,r,a.node(s),a.before(s),i,!1)))return!0;return!1}function TE(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function pxt(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&Ir.isSelectable(n)?(TE(t,new Ir(r)),!0):!1}function gxt(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof Ir&&(n=r.node);let a=t.state.doc.resolve(e);for(let s=a.depth+1;s>0;s--){let o=s>a.depth?a.nodeAfter:a.node(s);if(Ir.isSelectable(o)){n&&r.$from.depth>0&&s>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?i=a.before(r.$from.depth):i=a.before(s);break}}return i!=null?(TE(t,Ir.create(t.state.doc,i)),!0):!1}function mxt(t,e,r,n,i){return LZ(t,"handleClickOn",e,r,n)||t.someProp("handleClick",a=>a(t,e,n))||(i?gxt(t,r):pxt(t,r))}function yxt(t,e,r,n){return LZ(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function vxt(t,e,r,n){return LZ(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||bxt(t,r,n)}function bxt(t,e,r){if(r.button!=0)return!1;let n=a6e(t,e,!0),i=t.state.doc;return n?(TE(t,n),n instanceof wr&&i.eq(t.state.doc)&&(t.input.mouseDown=new wxt(t,n)),!0):!1}function a6e(t,e,r){let n=t.state.doc;if(e==-1)return n.inlineContent?wr.create(n,0,n.content.size):null;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a),o=i.before(a);if(s.inlineContent)return wr.create(n,o+1,o+1+s.content.size);if(r&&Ir.isSelectable(s))return Ir.create(n,o)}return null}function IZ(t){return hM(t)}const s6e=Xc?"metaKey":"ctrlKey";ch.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=IZ(t),i=Date.now(),a="singleClick";i-t.input.lastClick.time<500&&fxt(r,t.input.lastClick)&&!r[s6e]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?a="doubleClick":t.input.lastClick.type=="doubleClick"&&(a="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:a,button:r.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(wE(r));s&&(a=="singleClick"?t.input.mouseDown=new xxt(t,s,r,!!n):(a=="doubleClick"?yxt:vxt)(t,s.pos,s.inside,r)?r.preventDefault():xf(t,"pointer"))};class o6e{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class xxt extends o6e{constructor(e,r,n,i){super(e),this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[s6e],this.allowDefault=n.shiftKey;let a,s;if(r.inside>-1)a=e.state.doc.nodeAt(r.inside),s=r.inside;else{let h=e.state.doc.resolve(r.pos);a=h.parent,s=h.depth?h.before():0}const o=i?null:n.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof Ir&&u.from<=s&&u.to>s)&&(this.mightDrag={node:a,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&X$&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),xf(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||MZ(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(wE(e))),this.updateAllowDefault(e),this.allowDefault||!r?xf(this.view,"pointer"):mxt(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ly&&this.mightDrag&&!this.mightDrag.node.isAtom||h0&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(TE(this.view,sn.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):xf(this.view,"pointer")}move(e){this.updateAllowDefault(e),xf(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class wxt extends o6e{constructor(e,r){super(e),this.startSelection=r,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),xf(this.view,"pointer");let r=this.view.posAtCoords(wE(e)),n=r&&a6e(this.view,r.inside,!1);if(!n)return;let{doc:i}=this.view.state,a=this.startSelection,[s,o]=n.from{t.input.lastTouch=Date.now(),IZ(t),xf(t,"pointer")};ch.touchmove=t=>{t.input.lastTouch=Date.now(),xf(t,"pointer")};ch.contextmenu=t=>IZ(t);function l6e(t,e){return t.composing?!0:Ly&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Txt=xE?5e3:-1;Sc.compositionstart=Sc.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof wr&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||h0&&jSe&&kxt(t)))t.markCursor=t.state.storedMarks||r.marks(),hM(t,!0),t.markCursor=null;else if(hM(t,!e.selection.empty),X$&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let s=a<0?i.lastChild:i.childNodes[a-1];if(!s)break;if(s.nodeType==3){let o=t.domSelection();o&&o.collapse(s,s.nodeValue.length);break}else i=s,a=-1}}t.input.composing=!0}c6e(t,Txt)};function kxt(t){let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(!e||e.nodeType!=1||r>=e.childNodes.length)return!1;let n=e.childNodes[r];return n.nodeType==1&&n.contentEditable=="false"}Sc.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,c6e(t,20))};function c6e(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>hM(t),e))}function Cxt(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function hM(t,e=!1){if(!(xE&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Cxt(t),e||t.docView&&t.docView.dirty){let r=Xbt(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Sxt(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const VS=bE&&USe<15||RZ&&jbt<604;ch.copy=Sc.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let a=VS?null:r.clipboardData,s=n.content(),{dom:o,text:l}=QSe(t,s);a?(r.preventDefault(),a.clearData(),a.setData("text/html",o.innerHTML),a.setData("text/plain",l)):Sxt(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Ext(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Axt(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?XW(t,n.value,null,i,e):XW(t,n.textContent,n.innerHTML,i,e)},50)}function XW(t,e,r,n,i){let a=JSe(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,a||Jt.empty)))return!0;if(!a)return!1;let s=Ext(a),o=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(a);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function u6e(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Sc.paste=(t,e)=>{let r=e;if(t.composing&&!xE)return;let n=VS?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&XW(t,u6e(n),n.getData("text/html"),i,r)?r.preventDefault():Axt(t,r)};class Rxt{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const _xt=Xc?"altKey":"ctrlKey";function h6e(t,e){let r;return t.someProp("dragCopies",n=>{r=r||n(e)}),r!=null?!r:!e[_xt]}ch.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,a=i.empty?null:t.posAtCoords(wE(r)),s;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ir?i.to-1:i.to))){if(n&&n.mightDrag)s=Ir.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let d=t.docView.nearestDesc(r.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ir.create(t.state.doc,d.posBefore))}}let o=(s||t.state.selection).content(),{dom:l,text:u,slice:h}=QSe(t,o);(!r.dataTransfer.files.length||!h0||YSe>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(VS?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",VS||r.dataTransfer.setData("text/plain",u),t.dragging=new Rxt(h,h6e(t,r),s)};ch.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Sc.dragover=Sc.dragenter=(t,e)=>e.preventDefault();Sc.drop=(t,e)=>{try{Mxt(t,e,t.dragging)}finally{t.dragging=null}};function Mxt(t,e,r){if(!e.dataTransfer)return;let n=t.posAtCoords(wE(e));if(!n)return;let i=t.state.doc.resolve(n.pos),a=r&&r.slice;a?t.someProp("transformPasted",p=>{a=p(a,t,!1)}):a=JSe(t,u6e(e.dataTransfer),VS?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(r&&h6e(t,e));if(t.someProp("handleDrop",p=>p(t,e,a||Jt.empty,s))){e.preventDefault();return}if(!a)return;e.preventDefault();let o=a?xSe(t.state.doc,i.pos,a):i.pos;o==null&&(o=i.pos);let l=t.state.tr;if(s){let{node:p}=r;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(o),h=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=l.doc;if(h?l.replaceRangeWith(u,u,a.content.firstChild):l.replaceRange(u,u,a),l.doc.eq(d))return;let f=l.doc.resolve(u);if(h&&Ir.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new Ir(f));else{let p=l.mapping.map(o);l.mapping.maps[l.mapping.maps.length-1].forEach((g,m,y,v)=>p=v),l.setSelection(KSe(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}ch.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&MZ(t)},20))};ch.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ch.beforeinput=(t,e)=>{if(h0&&xE&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",a=>a(t,qSe(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Sc)ch[t]=Sc[t];function WS(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class dM{constructor(e,r){this.toDOM=e,this.spec=r||C1,this.side=this.spec.side||0}map(e,r,n,i){let{pos:a,deleted:s}=e.mapResult(r.from+i,this.side<0?-1:1);return s?null:new Eo(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof dM&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&WS(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Lp{constructor(e,r){this.attrs=e,this.spec=r||C1}map(e,r,n,i){let a=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=s?null:new Eo(a,s,this)}valid(e,r){return r.from=e&&(!a||a(o.spec))&&n.push(o.copy(o.from+i,o.to+i))}for(let s=0;se){let o=this.children[s]+1;this.children[s+2].findInner(e-o,r-o,n,i+o,a)}}map(e,r,n){return this==Zo||e.maps.length==0?this:this.mapInner(e,r,0,0,n||C1)}mapInner(e,r,n,i,a){let s;for(let o=0;o{let u=l+n,h;if(h=f6e(r,o,u)){for(i||(i=this.children.slice());ao&&d.to=e){this.children[o]==e&&(n=this.children[o+2]);break}let a=e+1,s=a+r.content.size;for(let o=0;oa&&l.type instanceof Lp){let u=Math.max(a,l.from)-a,h=Math.min(s,l.to)-a;ui.map(e,r,C1));return Am.from(n)}forChild(e,r){if(r.isLeaf)return pi.empty;let n=[];for(let i=0;ir instanceof pi)?e:e.reduce((r,n)=>r.concat(n instanceof pi?n:n.members),[]))}}forEachSet(e){for(let r=0;r{let y=m-g-(p-f);for(let v=0;vx+h-d)continue;let b=o[v]+h-d;p>=b?o[v+1]=f<=b?-2:-1:f>=h&&y&&(o[v]+=y,o[v+1]+=y)}d+=y}),h=r.maps[u].map(h,-1)}let l=!1;for(let u=0;u=n.content.size){l=!0;continue}let f=r.map(t[u+1]+a,-1),p=f-i,{index:g,offset:m}=n.content.findIndex(d),y=n.maybeChild(g);if(y&&m==d&&m+y.nodeSize==p){let v=o[u+2].mapInner(r,y,h+1,t[u]+a+1,s);v!=Zo?(o[u]=d,o[u+1]=p,o[u+2]=v):(o[u+1]=-2,l=!0)}else l=!0}if(l){let u=Ixt(o,t,e,r,i,a,s),h=fM(u,n,0,s);e=h.local;for(let d=0;dr&&s.to{let u=f6e(t,o,l+r);if(u){a=!0;let h=fM(u,o,r+l+1,n);h!=Zo&&i.push(l,l+o.nodeSize,h)}});let s=d6e(a?p6e(t):t,-r).sort(S1);for(let o=0;o0;)e++;t.splice(e,0,r)}var qp={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},pM={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$xt=typeof navigator<"u"&&/Mac/.test(navigator.platform),Nxt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var io=0;io<10;io++)qp[48+io]=qp[96+io]=String(io);for(var io=1;io<=24;io++)qp[io+111]="F"+io;for(var io=65;io<=90;io++)qp[io]=String.fromCharCode(io+32),pM[io]=String.fromCharCode(io);for(var rB in qp)pM.hasOwnProperty(rB)||(pM[rB]=qp[rB]);function Dxt(t){var e=$xt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Nxt&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?pM:qp)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const Oxt=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Pxt=typeof navigator<"u"&&/Win/.test(navigator.platform);function Bxt(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,a,s;for(let o=0;o[o,(...h)=>{const d=l(...h)(s);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:i,state:a}=this,{view:s}=i,o=[],l=!!e,u=e||a.tr,h=()=>(!l&&r&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),o.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,p])=>[f,(...m)=>{const y=this.buildProps(u,r),v=p(...m)(y);return o.push(v),d}])),run:h};return d}static createFakeChain(){const e=new Proxy({},{get:(r,n)=>{if(n!=="then")return n==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:r,state:n}=this,i=!1,a=e||n.tr,s=this.buildProps(a,i);return{...Object.fromEntries(Object.entries(r).map(([o,l])=>[o,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(a,i)}}static createFallbackCan(){const e=y6e.createFakeChain();return new Proxy({chain:()=>e},{get:(r,n)=>{if(n!=="then")return n==="chain"?r.chain:()=>!1}})}buildProps(e,r=!0){const{rawCommands:n,editor:i,state:a}=this,{view:s}=i,o={tr:e,editor:i,view:s,state:m6e({state:a,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...h)=>u(...h)(o)]))}};return o}};const Hxt=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var r;e.dom.blur(),(r=window)===null||r===void 0||(r=r.getSelection())===null||r===void 0||r.removeAllRanges()}}),!0),Vxt=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Wxt=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:a,$to:s})=>{t.doc.nodesBetween(a.pos,s.pos,(o,l)=>{if(o.type.isText)return;const{doc:u,mapping:h}=e,d=u.resolve(h.map(l)),f=u.resolve(h.map(l+o.nodeSize)),p=d.blockRange(f);if(!p)return;const g=N3(p);if(o.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(g||g===0)&&e.lift(p,g)})}),!0},qxt=t=>e=>t(e),Gxt=()=>({state:t,dispatch:e})=>BSe(t,e),Uxt=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,a=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const s=n.mapping.map(e);return n.insert(s,a.content),n.setSelection(new wr(n.doc.resolve(Math.max(s-1,0)))),!0},Yxt=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===n.type){if(e){const s=i.before(a),o=i.after(a);t.delete(s,o).scrollIntoView()}return!0}return!1};function Os(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}const jxt=t=>({tr:e,state:r,dispatch:n})=>{const i=Os(t,r.schema),a=e.selection.$anchor;for(let s=a.depth;s>0;s-=1)if(a.node(s).type===i){if(n){const o=a.before(s),l=a.after(s);e.delete(o,l).scrollIntoView()}return!0}return!1},Xxt=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},Kxt=t=>t.content?/^text(\*|\+)/.test(t.content):!1,vce=(t,e,r)=>{if(!t.parent.isInline||r==="left"&&t.pos>t.start()||r==="right"&&t.pos({from:vce(t,r,"left"),to:vce(e,r,"right")}),Qxt=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const r=t.tr,{ranges:n}=t.selection,i=r.steps.length;n.forEach(a=>{const s=r.mapping.slice(i),o=r.doc.resolve(s.map(a.$from.pos)),l=r.doc.resolve(s.map(a.$to.pos)),{from:u,to:h}=Zxt(o,l,t.schema);r.deleteRange(u,h)}),r.selection.empty||r.setSelection(wr.near(r.doc.resolve(r.selection.from))),r.scrollIntoView(),e(r)}return!0},Jxt=()=>({commands:t})=>t.keyboardShortcut("Enter"),e4t=()=>({state:t,dispatch:e})=>Lbt(t,e);function t4t(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function gM(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:t4t(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function v6e(t,e,r={}){return t.find(n=>n.type===e&&gM(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function bce(t,e,r={}){return!!v6e(t,e,r)}function DZ(t,e,r){if(!t||!e)return;let n=t.parent.childAfter(t.parentOffset);if((!n.node||!n.node.marks.some(l=>l.type===e))&&(n=t.parent.childBefore(t.parentOffset)),!n.node||!n.node.marks.some(l=>l.type===e))return;if(!r){const l=n.node.marks.find(u=>u.type===e);l&&(r=l.attrs)}if(!v6e([...n.node.marks],e,r))return;let i=n.index,a=t.start()+n.offset,s=i+1,o=a+n.node.nodeSize;for(;i>0&&bce([...t.parent.child(i-1).marks],e,r);)i-=1,a-=t.parent.child(i).nodeSize;for(;s({tr:r,state:n,dispatch:i})=>{const a=yg(t,n.schema),{doc:s,selection:o}=r,{$from:l,from:u,to:h}=o;if(i){const d=DZ(l,a,e);if(d&&d.from<=u&&d.to>=h){const f=wr.create(s,d.from,d.to);r.setSelection(f)}}return!0},n4t=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n({editor:r,view:n,tr:i,dispatch:a})=>{e={scrollIntoView:!0,...e};const s=()=>{(mM()||xce())&&n.dom.focus(),a4t()&&!mM()&&!xce()&&n.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&r.commands.scrollIntoView())})};try{if(n.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(a&&t===null&&!b6e(r.state.selection))return s(),!0;const o=i4t(i.doc,t)||r.state.selection,l=r.state.selection.eq(o);return a&&(l||i.setSelection(o),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},o4t=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),l4t=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),x6e=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&x6e(n)}return t};function R5(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${t}`,r=new window.DOMParser().parseFromString(e,"text/html").body;return x6e(r)}function w6e(t){return typeof(t==null?void 0:t.nodesBetween)=="function"}function PT(t,e,r){if(w6e(t))return t;const n=typeof t=="object"&&t!==null;r={slice:!0,parseOptions:{},...r};const i=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return Rt.fromArray(t.map(s=>e.nodeFromJSON(s)));const a=e.nodeFromJSON(t);return r.errorOnInvalidContent&&a.check(),a}catch(a){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",a),PT("",e,r)}if(i){if(r.errorOnInvalidContent){let s=!1,o="";const l=new cSe({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?Mp.fromSchema(l).parseSlice(R5(t),r.parseOptions):Mp.fromSchema(l).parse(R5(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const a=Mp.fromSchema(e);return r.slice?a.parseSlice(R5(t),r.parseOptions).content:a.parse(R5(t),r.parseOptions)}return PT("",e,r)}function T6e(t){return!("type"in t)}function k6e(t,e,r){const n=t.steps.length-1;if(n{s===0&&(s=h)}),t.setSelection(sn.near(t.doc.resolve(s),r))}const c4t=(t,e,r)=>({tr:n,dispatch:i,editor:a})=>{if(i){r={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let o;const l=y=>{a.emit("contentError",{editor:a,error:y,disableCollaboration:()=>{"collaboration"in a.storage&&typeof a.storage.collaboration=="object"&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{PT(e,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{var s;o=PT(e,a.schema,{parseOptions:u,errorOnInvalidContent:(s=r.errorOnInvalidContent)!==null&&s!==void 0?s:a.options.enableContentCheck})}catch(y){return l(y),!1}let{from:h,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;const g=T6e(o)?o.content:[o];if(g.forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),h===d&&p){const{parent:y}=n.doc.resolve(h);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(h-=1,d+=1)}let m;if(f)Array.isArray(e)?m=e.map(y=>y.text||"").join(""):w6e(e)?m=g.map(y=>{var v;return(v=y.text)!==null&&v!==void 0?v:""}).join(""):typeof e=="object"&&e&&e.text?m=e.text:m=e,n.insertText(m,h,d);else{m=Rt.from(g);const y=n.doc.resolve(h),v=y.node(),x=y.parentOffset===0,b=v.isText||v.isTextblock,T=v.content.size>0;x&&b&&T&&p&&(h=Math.max(0,h-1)),n.replaceWith(h,d,g)}r.updateSelection&&k6e(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:h,text:m}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:h,text:m})}return!0};function C6e(t){for(let e=0;e({tr:e,dispatch:r,editor:n})=>{const{pos:i,attrs:a,content:s,updateSelection:o=!0}=t;let l;typeof i=="number"?l=e.doc.resolve(i):i?l=i:l=e.selection.$from;const u=C6e(l.parent.contentMatchAt(l.index()));if(!u)return!1;const h=Object.keys(u.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([p])=>h.includes(p))):{};let f;if(s){const p=PT(s,n.schema);f=u.createAndFill(d,p)}else f=u.createAndFill(d);return f?(r&&(e.insert(l.pos,f),o&&k6e(e,e.steps.length-1,-1)),!0):!1},h4t=()=>({state:t,dispatch:e})=>Rbt(t,e),d4t=()=>({state:t,dispatch:e})=>_bt(t,e),f4t=()=>({state:t,dispatch:e})=>LSe(t,e),p4t=()=>({state:t,dispatch:e})=>DSe(t,e),g4t=()=>({state:t,dispatch:e,tr:r})=>{try{const n=U$(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},m4t=()=>({state:t,dispatch:e,tr:r})=>{try{const n=U$(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},y4t=()=>({state:t,dispatch:e})=>Ebt(t,e),v4t=()=>({state:t,dispatch:e})=>Abt(t,e);function S6e(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function b4t(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,a,s;for(let o=0;o({editor:e,view:r,tr:n,dispatch:i})=>{const a=b4t(t).split(/-(?!$)/),s=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,o))});return l==null||l.steps.forEach(u=>{const h=u.map(n.mapping);h&&i&&n.maybeStep(h)}),!0};function Q1(t,e,r={}){const{from:n,to:i,empty:a}=t.selection,s=e?Os(e,t.schema):null,o=[];t.doc.nodesBetween(n,i,(h,d)=>{if(h.isText)return;const f=Math.max(n,d),p=Math.min(i,d+h.nodeSize);o.push({node:h,from:f,to:p})});const l=i-n,u=o.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>gM(h.node.attrs,r,{strict:!1}));return a?!!u.length:u.reduce((h,d)=>h+d.to-d.from,0)>=l}const w4t=(t,e={})=>({state:r,dispatch:n})=>Q1(r,Os(t,r.schema),e)?Mbt(r,n):!1,T4t=()=>({state:t,dispatch:e})=>FSe(t,e),k4t=t=>({state:e,dispatch:r})=>{const n=Os(t,e.schema);return Vbt(n)(e,r)},C4t=()=>({state:t,dispatch:e})=>PSe(t,e);function OZ(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function wce(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}const S4t=(t,e)=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=OZ(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=Os(t,n.schema)),o==="mark"&&(s=yg(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{n.doc.nodesBetween(u.$from.pos,u.$to.pos,(h,d)=>{a&&a===h.type&&(l=!0,i&&r.setNodeMarkup(d,void 0,wce(h.attrs,e))),s&&h.marks.length&&h.marks.forEach(f=>{s===f.type&&(l=!0,i&&r.addMark(d,d+h.nodeSize,s.create(wce(f.attrs,e))))})})}),l},E4t=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),A4t=()=>({tr:t,dispatch:e})=>{if(e){const r=new vc(t.doc);t.setSelection(r)}return!0},R4t=()=>({state:t,dispatch:e})=>$Se(t,e),_4t=()=>({state:t,dispatch:e})=>OSe(t,e),M4t=()=>({state:t,dispatch:e})=>Nbt(t,e),L4t=()=>({state:t,dispatch:e})=>Pbt(t,e),I4t=()=>({state:t,dispatch:e})=>Obt(t,e);function $4t(t,e,r={},n={}){return PT(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const N4t=(t,{errorOnInvalidContent:e,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:i,tr:a,dispatch:s,commands:o})=>{const{doc:l}=a;if(n.preserveWhitespace!=="full"){const u=$4t(t,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});if(s){const h=T6e(u)?u.content:[u];a.replaceWith(0,l.content.size,h).setMeta("preventUpdate",!r)}return!0}return s&&a.setMeta("preventUpdate",!r),o.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function E6e(t,e){const r=yg(e,t.schema),{from:n,to:i,empty:a}=t.selection,s=[];a?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,l=>{s.push(...l.marks)});const o=s.find(l=>l.type.name===r.name);return o?{...o.attrs}:{}}function A6e(t,e){const r=new SSe(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function D4t(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,a)=>{r(i)&&n.push({node:i,pos:a})}),n}function qS(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function K$(t){return e=>qS(e.$from,t)}function un(t,e,r){return t.config[e]===void 0&&t.parent?un(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?un(t.parent,e,r):null}):t.config[e]}function PZ(t){return t.map(e=>{const r=un(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return r?[e,...PZ(r())]:e}).flat(10)}function O4t(t){return typeof t=="function"}function ei(t,e=void 0,...r){return O4t(t)?e?t.bind(e)(...r):t(...r):t}function P4t(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Z$(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function B4t(t){const e=[],{nodeExtensions:r,markExtensions:n}=Z$(t),i=[...r,...n],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=r.filter(u=>u.name!=="text").map(u=>u.name),o=n.map(u=>u.name),l=[...s,...o];return t.forEach(u=>{const h=un(u,"addGlobalAttributes",{name:u.name,options:u.options,storage:u.storage,extensions:i});h&&h().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types==="*"?f=l:d.types==="nodes"?f=s:d.types==="marks"?f=o:f=[],f.forEach(p=>{Object.entries(d.attributes).forEach(([g,m])=>{e.push({type:p,name:g,attribute:{...a,...m}})})})})}),i.forEach(u=>{const h=un(u,"addAttributes",{name:u.name,options:u.options,storage:u.storage});if(!h)return;const d=h();Object.entries(d).forEach(([f,p])=>{const g={...a,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:u.name,name:f,attribute:g})})}),e}function F4t(t){const e=[];let r="",n=!1,i=!1,a=0;const s=t.length;for(let o=0;o0){a-=1,r+=l;continue}if(l===";"&&a===0){e.push(r),r="";continue}}r+=l}return r&&e.push(r),e}function Tce(t){const e=[],r=F4t(t||""),n=r.length;for(let i=0;i!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,a])=>{if(i==="__proto__"){Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:a,writable:!0});return}if(!n[i]){n[i]=a;return}if(i==="class"){const s=a?String(a).split(" "):[],o=n[i]?n[i].split(" "):[],l=s.filter(u=>!o.includes(u));n[i]=[...o,...l].join(" ")}else if(i==="style"){const s=new Map([...Tce(n[i]),...Tce(a)]);n[i]=Array.from(s.entries()).map(([o,l])=>`${o}: ${l}`).join("; ")}else n[i]=a}),n},{})}function yM(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Wn(r,n),{})}function z4t(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function kce(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((a,s)=>{const o=s.attribute.parseHTML?s.attribute.parseHTML(r):z4t(r.getAttribute(s.name));return o==null?a:{...a,[s.name]:o}},{});return{...n,...i}}}}function Cce(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&P4t(r)?!1:r!=null))}function Sce(t){var e,r;const n={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(n.default=t.attribute.default),(t==null||(r=t.attribute)===null||r===void 0?void 0:r.validate)!==void 0&&(n.validate=t.attribute.validate),[t.name,n]}function H4t(t,e){var r;const n=B4t(t),{nodeExtensions:i,markExtensions:a}=Z$(t),s=(r=i.find(u=>un(u,"topNode")))===null||r===void 0?void 0:r.name,o=Object.fromEntries(i.map(u=>{const h=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=Cce({...t.reduce((y,v)=>{const x=un(v,"extendNodeSchema",d);return{...y,...x?x(u):{}}},{}),content:ei(un(u,"content",d)),marks:ei(un(u,"marks",d)),group:ei(un(u,"group",d)),inline:ei(un(u,"inline",d)),atom:ei(un(u,"atom",d)),selectable:ei(un(u,"selectable",d)),draggable:ei(un(u,"draggable",d)),code:ei(un(u,"code",d)),whitespace:ei(un(u,"whitespace",d)),linebreakReplacement:ei(un(u,"linebreakReplacement",d)),defining:ei(un(u,"defining",d)),isolating:ei(un(u,"isolating",d)),attrs:Object.fromEntries(h.map(Sce))}),p=ei(un(u,"parseHTML",d));p&&(f.parseDOM=p.map(y=>kce(y,h)));const g=un(u,"renderHTML",d);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:yM(y,h)}));const m=un(u,"renderText",d);return m&&(f.toText=m),[u.name,f]})),l=Object.fromEntries(a.map(u=>{const h=n.filter(m=>m.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=Cce({...t.reduce((m,y)=>{const v=un(y,"extendMarkSchema",d);return{...m,...v?v(u):{}}},{}),inclusive:ei(un(u,"inclusive",d)),excludes:ei(un(u,"excludes",d)),group:ei(un(u,"group",d)),spanning:ei(un(u,"spanning",d)),code:ei(un(u,"code",d)),attrs:Object.fromEntries(h.map(Sce))}),p=ei(un(u,"parseHTML",d));p&&(f.parseDOM=p.map(m=>kce(m,h)));const g=un(u,"renderHTML",d);return g&&(f.toDOM=m=>g({mark:m,HTMLAttributes:yM(m,h)})),[u.name,f]}));return new cSe({topNode:s,nodes:o,marks:l})}function V4t(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}function R6e(t){return t.sort((r,n)=>{const i=un(r,"priority")||100,a=un(n,"priority")||100;return i>a?-1:in.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function KW(t,e){return H4t(W4t(t),e)}function q4t(t,e){const r=KW(e),n=R5(t);return Mp.fromSchema(r).parse(n).toJSON()}function G4t(t,e,r){const{from:n,to:i}=e,{blockSeparator:a=` +`);return{dom:l,text:f,slice:e}}function e6e(t,e,r,n,i){let a=i.parent.type.spec.code,s,o;if(!r&&!e)return null;let l=!!e&&(n||a||!r);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,a||n,t)}),a)return o=new Jt(Rt.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),t.someProp("transformPasted",f=>{o=f(o,t,!0)}),o;let d=t.someProp("clipboardTextParser",f=>f(e,i,n,t));if(d)o=d;else{let f=i.marks(),{schema:p}=t.state,g=Y$.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(g.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{r=d(r,t)}),s=fxt(r),LZ&&pxt(s);let u=s&&s.querySelector("[data-pm-slice]"),h=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let d=+h[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Mp.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||h),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!uxt.test(f.parentNode.nodeName)?{ignore:!0}:null}})),h)o=gxt(yce(o,+h[1],+h[2]),h[4]);else if(o=Jt.maxOpen(hxt(o.content,i),!0),o.openStart||o.openEnd){let d=0,f=0;for(let p=o.content.firstChild;d{o=d(o,t,l)}),o}const uxt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function hxt(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),a,s=[];if(t.forEach(o=>{if(!s)return;let l=i.findWrapping(o.type),u;if(!l)return s=null;if(u=s.length&&a.length&&r6e(l,a,o,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=n6e(s[s.length-1],a.length));let h=t6e(o,l);s.push(h),i=i.matchType(h.type),a=l}}),s)return Rt.from(s)}return t}function t6e(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,Rt.from(t));return t}function r6e(t,e,r,n,i){if(i1&&(a=0),i=r&&(o=e<0?s.contentMatchAt(0).fillBefore(o,a<=i).append(o):o.append(s.contentMatchAt(s.childCount).fillBefore(Rt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(o))}function yce(t,e,r){return er})),nB.createHTML(t)):t}function fxt(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=a6e().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&i6e[n[1].toLowerCase()])&&(t=i.map(a=>"<"+a+">").join("")+t+i.map(a=>"").reverse().join("")),r.innerHTML=dxt(t),i)for(let a=0;a=0;o-=2){let l=r.nodes[n[o]];if(!l||l.hasRequiredAttrs())break;i=Rt.from(l.create(n[o+1],i)),a++,s++}return new Jt(i,a,s)}const ch={},Sc={};function xf(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}Sc.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!c6e(t)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(wE&&h0&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),MZ&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,GSe(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||cxt(t,r)?r.preventDefault():xf(t,"key")};Sc.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Sc.keypress=(t,e)=>{let r=e;if(c6e(t)||!r.charCode||r.ctrlKey&&!r.altKey||Xc&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof Tr)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),a=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,n.$from.pos,n.$to.pos,i,a))&&t.dispatch(a()),r.preventDefault()}};function TE(t){return{left:t.clientX,top:t.clientY}}function mxt(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function $Z(t,e,r,n,i){if(n==-1)return!1;let a=t.state.doc.resolve(n);for(let s=a.depth+1;s>0;s--)if(t.someProp(e,o=>s>a.depth?o(t,r,a.nodeAfter,a.before(s),i,!0):o(t,r,a.node(s),a.before(s),i,!1)))return!0;return!1}function kE(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function yxt(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&Ir.isSelectable(n)?(kE(t,new Ir(r)),!0):!1}function vxt(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof Ir&&(n=r.node);let a=t.state.doc.resolve(e);for(let s=a.depth+1;s>0;s--){let o=s>a.depth?a.nodeAfter:a.node(s);if(Ir.isSelectable(o)){n&&r.$from.depth>0&&s>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?i=a.before(r.$from.depth):i=a.before(s);break}}return i!=null?(kE(t,Ir.create(t.state.doc,i)),!0):!1}function bxt(t,e,r,n,i){return $Z(t,"handleClickOn",e,r,n)||t.someProp("handleClick",a=>a(t,e,n))||(i?vxt(t,r):yxt(t,r))}function xxt(t,e,r,n){return $Z(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function wxt(t,e,r,n){return $Z(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||Txt(t,r,n)}function Txt(t,e,r){if(r.button!=0)return!1;let n=s6e(t,e,!0),i=t.state.doc;return n?(kE(t,n),n instanceof Tr&&i.eq(t.state.doc)&&(t.input.mouseDown=new Cxt(t,n)),!0):!1}function s6e(t,e,r){let n=t.state.doc;if(e==-1)return n.inlineContent?Tr.create(n,0,n.content.size):null;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a),o=i.before(a);if(s.inlineContent)return Tr.create(n,o+1,o+1+s.content.size);if(r&&Ir.isSelectable(s))return Ir.create(n,o)}return null}function NZ(t){return dM(t)}const o6e=Xc?"metaKey":"ctrlKey";ch.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=NZ(t),i=Date.now(),a="singleClick";i-t.input.lastClick.time<500&&mxt(r,t.input.lastClick)&&!r[o6e]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?a="doubleClick":t.input.lastClick.type=="doubleClick"&&(a="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:a,button:r.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(TE(r));s&&(a=="singleClick"?t.input.mouseDown=new kxt(t,s,r,!!n):(a=="doubleClick"?xxt:wxt)(t,s.pos,s.inside,r)?r.preventDefault():xf(t,"pointer"))};class l6e{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class kxt extends l6e{constructor(e,r,n,i){super(e),this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[o6e],this.allowDefault=n.shiftKey;let a,s;if(r.inside>-1)a=e.state.doc.nodeAt(r.inside),s=r.inside;else{let h=e.state.doc.resolve(r.pos);a=h.parent,s=h.depth?h.before():0}const o=i?null:n.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof Ir&&u.from<=s&&u.to>s)&&(this.mightDrag={node:a,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Z$&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),xf(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||IZ(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(TE(e))),this.updateAllowDefault(e),this.allowDefault||!r?xf(this.view,"pointer"):bxt(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ly&&this.mightDrag&&!this.mightDrag.node.isAtom||h0&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(kE(this.view,sn.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):xf(this.view,"pointer")}move(e){this.updateAllowDefault(e),xf(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class Cxt extends l6e{constructor(e,r){super(e),this.startSelection=r,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),xf(this.view,"pointer");let r=this.view.posAtCoords(TE(e)),n=r&&s6e(this.view,r.inside,!1);if(!n)return;let{doc:i}=this.view.state,a=this.startSelection,[s,o]=n.from{t.input.lastTouch=Date.now(),NZ(t),xf(t,"pointer")};ch.touchmove=t=>{t.input.lastTouch=Date.now(),xf(t,"pointer")};ch.contextmenu=t=>NZ(t);function c6e(t,e){return t.composing?!0:Ly&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Sxt=wE?5e3:-1;Sc.compositionstart=Sc.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof Tr&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||h0&&XSe&&Ext(t)))t.markCursor=t.state.storedMarks||r.marks(),dM(t,!0),t.markCursor=null;else if(dM(t,!e.selection.empty),Z$&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let s=a<0?i.lastChild:i.childNodes[a-1];if(!s)break;if(s.nodeType==3){let o=t.domSelection();o&&o.collapse(s,s.nodeValue.length);break}else i=s,a=-1}}t.input.composing=!0}u6e(t,Sxt)};function Ext(t){let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(!e||e.nodeType!=1||r>=e.childNodes.length)return!1;let n=e.childNodes[r];return n.nodeType==1&&n.contentEditable=="false"}Sc.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,u6e(t,20))};function u6e(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>dM(t),e))}function Axt(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function dM(t,e=!1){if(!(wE&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Axt(t),e||t.docView&&t.docView.dirty){let r=Qbt(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Rxt(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const VS=xE&&YSe<15||MZ&&Zbt<604;ch.copy=Sc.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let a=VS?null:r.clipboardData,s=n.content(),{dom:o,text:l}=JSe(t,s);a?(r.preventDefault(),a.clearData(),a.setData("text/html",o.innerHTML),a.setData("text/plain",l)):Rxt(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function _xt(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Mxt(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?ZW(t,n.value,null,i,e):ZW(t,n.textContent,n.innerHTML,i,e)},50)}function ZW(t,e,r,n,i){let a=e6e(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,a||Jt.empty)))return!0;if(!a)return!1;let s=_xt(a),o=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(a);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function h6e(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Sc.paste=(t,e)=>{let r=e;if(t.composing&&!wE)return;let n=VS?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&ZW(t,h6e(n),n.getData("text/html"),i,r)?r.preventDefault():Mxt(t,r)};class Lxt{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const Ixt=Xc?"altKey":"ctrlKey";function d6e(t,e){let r;return t.someProp("dragCopies",n=>{r=r||n(e)}),r!=null?!r:!e[Ixt]}ch.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,a=i.empty?null:t.posAtCoords(TE(r)),s;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ir?i.to-1:i.to))){if(n&&n.mightDrag)s=Ir.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let d=t.docView.nearestDesc(r.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ir.create(t.state.doc,d.posBefore))}}let o=(s||t.state.selection).content(),{dom:l,text:u,slice:h}=JSe(t,o);(!r.dataTransfer.files.length||!h0||jSe>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(VS?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",VS||r.dataTransfer.setData("text/plain",u),t.dragging=new Lxt(h,d6e(t,r),s)};ch.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Sc.dragover=Sc.dragenter=(t,e)=>e.preventDefault();Sc.drop=(t,e)=>{try{$xt(t,e,t.dragging)}finally{t.dragging=null}};function $xt(t,e,r){if(!e.dataTransfer)return;let n=t.posAtCoords(TE(e));if(!n)return;let i=t.state.doc.resolve(n.pos),a=r&&r.slice;a?t.someProp("transformPasted",p=>{a=p(a,t,!1)}):a=e6e(t,h6e(e.dataTransfer),VS?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(r&&d6e(t,e));if(t.someProp("handleDrop",p=>p(t,e,a||Jt.empty,s))){e.preventDefault();return}if(!a)return;e.preventDefault();let o=a?wSe(t.state.doc,i.pos,a):i.pos;o==null&&(o=i.pos);let l=t.state.tr;if(s){let{node:p}=r;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(o),h=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=l.doc;if(h?l.replaceRangeWith(u,u,a.content.firstChild):l.replaceRange(u,u,a),l.doc.eq(d))return;let f=l.doc.resolve(u);if(h&&Ir.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new Ir(f));else{let p=l.mapping.map(o);l.mapping.maps[l.mapping.maps.length-1].forEach((g,m,y,v)=>p=v),l.setSelection(ZSe(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}ch.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&IZ(t)},20))};ch.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ch.beforeinput=(t,e)=>{if(h0&&wE&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",a=>a(t,GSe(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Sc)ch[t]=Sc[t];function WS(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class fM{constructor(e,r){this.toDOM=e,this.spec=r||C1,this.side=this.spec.side||0}map(e,r,n,i){let{pos:a,deleted:s}=e.mapResult(r.from+i,this.side<0?-1:1);return s?null:new Eo(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof fM&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&WS(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Lp{constructor(e,r){this.attrs=e,this.spec=r||C1}map(e,r,n,i){let a=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=s?null:new Eo(a,s,this)}valid(e,r){return r.from=e&&(!a||a(o.spec))&&n.push(o.copy(o.from+i,o.to+i))}for(let s=0;se){let o=this.children[s]+1;this.children[s+2].findInner(e-o,r-o,n,i+o,a)}}map(e,r,n){return this==Zo||e.maps.length==0?this:this.mapInner(e,r,0,0,n||C1)}mapInner(e,r,n,i,a){let s;for(let o=0;o{let u=l+n,h;if(h=p6e(r,o,u)){for(i||(i=this.children.slice());ao&&d.to=e){this.children[o]==e&&(n=this.children[o+2]);break}let a=e+1,s=a+r.content.size;for(let o=0;oa&&l.type instanceof Lp){let u=Math.max(a,l.from)-a,h=Math.min(s,l.to)-a;ui.map(e,r,C1));return Am.from(n)}forChild(e,r){if(r.isLeaf)return pi.empty;let n=[];for(let i=0;ir instanceof pi)?e:e.reduce((r,n)=>r.concat(n instanceof pi?n:n.members),[]))}}forEachSet(e){for(let r=0;r{let y=m-g-(p-f);for(let v=0;vx+h-d)continue;let b=o[v]+h-d;p>=b?o[v+1]=f<=b?-2:-1:f>=h&&y&&(o[v]+=y,o[v+1]+=y)}d+=y}),h=r.maps[u].map(h,-1)}let l=!1;for(let u=0;u=n.content.size){l=!0;continue}let f=r.map(t[u+1]+a,-1),p=f-i,{index:g,offset:m}=n.content.findIndex(d),y=n.maybeChild(g);if(y&&m==d&&m+y.nodeSize==p){let v=o[u+2].mapInner(r,y,h+1,t[u]+a+1,s);v!=Zo?(o[u]=d,o[u+1]=p,o[u+2]=v):(o[u+1]=-2,l=!0)}else l=!0}if(l){let u=Dxt(o,t,e,r,i,a,s),h=pM(u,n,0,s);e=h.local;for(let d=0;dr&&s.to{let u=p6e(t,o,l+r);if(u){a=!0;let h=pM(u,o,r+l+1,n);h!=Zo&&i.push(l,l+o.nodeSize,h)}});let s=f6e(a?g6e(t):t,-r).sort(S1);for(let o=0;o0;)e++;t.splice(e,0,r)}var qp={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},gM={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Oxt=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pxt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var io=0;io<10;io++)qp[48+io]=qp[96+io]=String(io);for(var io=1;io<=24;io++)qp[io+111]="F"+io;for(var io=65;io<=90;io++)qp[io]=String.fromCharCode(io+32),gM[io]=String.fromCharCode(io);for(var iB in qp)gM.hasOwnProperty(iB)||(gM[iB]=qp[iB]);function Bxt(t){var e=Oxt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Pxt&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?gM:qp)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const Fxt=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zxt=typeof navigator<"u"&&/Win/.test(navigator.platform);function Hxt(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,a,s;for(let o=0;o[o,(...h)=>{const d=l(...h)(s);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:i,state:a}=this,{view:s}=i,o=[],l=!!e,u=e||a.tr,h=()=>(!l&&r&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),o.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,p])=>[f,(...m)=>{const y=this.buildProps(u,r),v=p(...m)(y);return o.push(v),d}])),run:h};return d}static createFakeChain(){const e=new Proxy({},{get:(r,n)=>{if(n!=="then")return n==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:r,state:n}=this,i=!1,a=e||n.tr,s=this.buildProps(a,i);return{...Object.fromEntries(Object.entries(r).map(([o,l])=>[o,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(a,i)}}static createFallbackCan(){const e=v6e.createFakeChain();return new Proxy({chain:()=>e},{get:(r,n)=>{if(n!=="then")return n==="chain"?r.chain:()=>!1}})}buildProps(e,r=!0){const{rawCommands:n,editor:i,state:a}=this,{view:s}=i,o={tr:e,editor:i,view:s,state:y6e({state:a,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...h)=>u(...h)(o)]))}};return o}};const qxt=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var r;e.dom.blur(),(r=window)===null||r===void 0||(r=r.getSelection())===null||r===void 0||r.removeAllRanges()}}),!0),Gxt=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Uxt=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:a,$to:s})=>{t.doc.nodesBetween(a.pos,s.pos,(o,l)=>{if(o.type.isText)return;const{doc:u,mapping:h}=e,d=u.resolve(h.map(l)),f=u.resolve(h.map(l+o.nodeSize)),p=d.blockRange(f);if(!p)return;const g=N3(p);if(o.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(g||g===0)&&e.lift(p,g)})}),!0},Yxt=t=>e=>t(e),jxt=()=>({state:t,dispatch:e})=>FSe(t,e),Xxt=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,a=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const s=n.mapping.map(e);return n.insert(s,a.content),n.setSelection(new Tr(n.doc.resolve(Math.max(s-1,0)))),!0},Kxt=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===n.type){if(e){const s=i.before(a),o=i.after(a);t.delete(s,o).scrollIntoView()}return!0}return!1};function Os(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}const Zxt=t=>({tr:e,state:r,dispatch:n})=>{const i=Os(t,r.schema),a=e.selection.$anchor;for(let s=a.depth;s>0;s-=1)if(a.node(s).type===i){if(n){const o=a.before(s),l=a.after(s);e.delete(o,l).scrollIntoView()}return!0}return!1},Qxt=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},Jxt=t=>t.content?/^text(\*|\+)/.test(t.content):!1,xce=(t,e,r)=>{if(!t.parent.isInline||r==="left"&&t.pos>t.start()||r==="right"&&t.pos({from:xce(t,r,"left"),to:xce(e,r,"right")}),t4t=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const r=t.tr,{ranges:n}=t.selection,i=r.steps.length;n.forEach(a=>{const s=r.mapping.slice(i),o=r.doc.resolve(s.map(a.$from.pos)),l=r.doc.resolve(s.map(a.$to.pos)),{from:u,to:h}=e4t(o,l,t.schema);r.deleteRange(u,h)}),r.selection.empty||r.setSelection(Tr.near(r.doc.resolve(r.selection.from))),r.scrollIntoView(),e(r)}return!0},r4t=()=>({commands:t})=>t.keyboardShortcut("Enter"),n4t=()=>({state:t,dispatch:e})=>Nbt(t,e);function i4t(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function mM(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:i4t(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function b6e(t,e,r={}){return t.find(n=>n.type===e&&mM(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function wce(t,e,r={}){return!!b6e(t,e,r)}function PZ(t,e,r){if(!t||!e)return;let n=t.parent.childAfter(t.parentOffset);if((!n.node||!n.node.marks.some(l=>l.type===e))&&(n=t.parent.childBefore(t.parentOffset)),!n.node||!n.node.marks.some(l=>l.type===e))return;if(!r){const l=n.node.marks.find(u=>u.type===e);l&&(r=l.attrs)}if(!b6e([...n.node.marks],e,r))return;let i=n.index,a=t.start()+n.offset,s=i+1,o=a+n.node.nodeSize;for(;i>0&&wce([...t.parent.child(i-1).marks],e,r);)i-=1,a-=t.parent.child(i).nodeSize;for(;s({tr:r,state:n,dispatch:i})=>{const a=yg(t,n.schema),{doc:s,selection:o}=r,{$from:l,from:u,to:h}=o;if(i){const d=PZ(l,a,e);if(d&&d.from<=u&&d.to>=h){const f=Tr.create(s,d.from,d.to);r.setSelection(f)}}return!0},s4t=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n({editor:r,view:n,tr:i,dispatch:a})=>{e={scrollIntoView:!0,...e};const s=()=>{(yM()||Tce())&&n.dom.focus(),l4t()&&!yM()&&!Tce()&&n.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&r.commands.scrollIntoView())})};try{if(n.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(a&&t===null&&!x6e(r.state.selection))return s(),!0;const o=o4t(i.doc,t)||r.state.selection,l=r.state.selection.eq(o);return a&&(l||i.setSelection(o),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},u4t=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),h4t=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),w6e=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&w6e(n)}return t};function R5(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${t}`,r=new window.DOMParser().parseFromString(e,"text/html").body;return w6e(r)}function T6e(t){return typeof(t==null?void 0:t.nodesBetween)=="function"}function PT(t,e,r){if(T6e(t))return t;const n=typeof t=="object"&&t!==null;r={slice:!0,parseOptions:{},...r};const i=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return Rt.fromArray(t.map(s=>e.nodeFromJSON(s)));const a=e.nodeFromJSON(t);return r.errorOnInvalidContent&&a.check(),a}catch(a){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",a),PT("",e,r)}if(i){if(r.errorOnInvalidContent){let s=!1,o="";const l=new uSe({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?Mp.fromSchema(l).parseSlice(R5(t),r.parseOptions):Mp.fromSchema(l).parse(R5(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const a=Mp.fromSchema(e);return r.slice?a.parseSlice(R5(t),r.parseOptions).content:a.parse(R5(t),r.parseOptions)}return PT("",e,r)}function k6e(t){return!("type"in t)}function C6e(t,e,r){const n=t.steps.length-1;if(n{s===0&&(s=h)}),t.setSelection(sn.near(t.doc.resolve(s),r))}const d4t=(t,e,r)=>({tr:n,dispatch:i,editor:a})=>{if(i){r={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let o;const l=y=>{a.emit("contentError",{editor:a,error:y,disableCollaboration:()=>{"collaboration"in a.storage&&typeof a.storage.collaboration=="object"&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{PT(e,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{var s;o=PT(e,a.schema,{parseOptions:u,errorOnInvalidContent:(s=r.errorOnInvalidContent)!==null&&s!==void 0?s:a.options.enableContentCheck})}catch(y){return l(y),!1}let{from:h,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;const g=k6e(o)?o.content:[o];if(g.forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),h===d&&p){const{parent:y}=n.doc.resolve(h);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(h-=1,d+=1)}let m;if(f)Array.isArray(e)?m=e.map(y=>y.text||"").join(""):T6e(e)?m=g.map(y=>{var v;return(v=y.text)!==null&&v!==void 0?v:""}).join(""):typeof e=="object"&&e&&e.text?m=e.text:m=e,n.insertText(m,h,d);else{m=Rt.from(g);const y=n.doc.resolve(h),v=y.node(),x=y.parentOffset===0,b=v.isText||v.isTextblock,T=v.content.size>0;x&&b&&T&&p&&(h=Math.max(0,h-1)),n.replaceWith(h,d,g)}r.updateSelection&&C6e(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:h,text:m}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:h,text:m})}return!0};function S6e(t){for(let e=0;e({tr:e,dispatch:r,editor:n})=>{const{pos:i,attrs:a,content:s,updateSelection:o=!0}=t;let l;typeof i=="number"?l=e.doc.resolve(i):i?l=i:l=e.selection.$from;const u=S6e(l.parent.contentMatchAt(l.index()));if(!u)return!1;const h=Object.keys(u.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([p])=>h.includes(p))):{};let f;if(s){const p=PT(s,n.schema);f=u.createAndFill(d,p)}else f=u.createAndFill(d);return f?(r&&(e.insert(l.pos,f),o&&C6e(e,e.steps.length-1,-1)),!0):!1},p4t=()=>({state:t,dispatch:e})=>Lbt(t,e),g4t=()=>({state:t,dispatch:e})=>Ibt(t,e),m4t=()=>({state:t,dispatch:e})=>ISe(t,e),y4t=()=>({state:t,dispatch:e})=>OSe(t,e),v4t=()=>({state:t,dispatch:e,tr:r})=>{try{const n=j$(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},b4t=()=>({state:t,dispatch:e,tr:r})=>{try{const n=j$(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},x4t=()=>({state:t,dispatch:e})=>_bt(t,e),w4t=()=>({state:t,dispatch:e})=>Mbt(t,e);function E6e(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function T4t(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,a,s;for(let o=0;o({editor:e,view:r,tr:n,dispatch:i})=>{const a=T4t(t).split(/-(?!$)/),s=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,o))});return l==null||l.steps.forEach(u=>{const h=u.map(n.mapping);h&&i&&n.maybeStep(h)}),!0};function Q1(t,e,r={}){const{from:n,to:i,empty:a}=t.selection,s=e?Os(e,t.schema):null,o=[];t.doc.nodesBetween(n,i,(h,d)=>{if(h.isText)return;const f=Math.max(n,d),p=Math.min(i,d+h.nodeSize);o.push({node:h,from:f,to:p})});const l=i-n,u=o.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>mM(h.node.attrs,r,{strict:!1}));return a?!!u.length:u.reduce((h,d)=>h+d.to-d.from,0)>=l}const C4t=(t,e={})=>({state:r,dispatch:n})=>Q1(r,Os(t,r.schema),e)?$bt(r,n):!1,S4t=()=>({state:t,dispatch:e})=>zSe(t,e),E4t=t=>({state:e,dispatch:r})=>{const n=Os(t,e.schema);return Gbt(n)(e,r)},A4t=()=>({state:t,dispatch:e})=>BSe(t,e);function BZ(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function kce(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}const R4t=(t,e)=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=BZ(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=Os(t,n.schema)),o==="mark"&&(s=yg(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{n.doc.nodesBetween(u.$from.pos,u.$to.pos,(h,d)=>{a&&a===h.type&&(l=!0,i&&r.setNodeMarkup(d,void 0,kce(h.attrs,e))),s&&h.marks.length&&h.marks.forEach(f=>{s===f.type&&(l=!0,i&&r.addMark(d,d+h.nodeSize,s.create(kce(f.attrs,e))))})})}),l},_4t=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),M4t=()=>({tr:t,dispatch:e})=>{if(e){const r=new vc(t.doc);t.setSelection(r)}return!0},L4t=()=>({state:t,dispatch:e})=>NSe(t,e),I4t=()=>({state:t,dispatch:e})=>PSe(t,e),$4t=()=>({state:t,dispatch:e})=>Pbt(t,e),N4t=()=>({state:t,dispatch:e})=>zbt(t,e),D4t=()=>({state:t,dispatch:e})=>Fbt(t,e);function O4t(t,e,r={},n={}){return PT(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const P4t=(t,{errorOnInvalidContent:e,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:i,tr:a,dispatch:s,commands:o})=>{const{doc:l}=a;if(n.preserveWhitespace!=="full"){const u=O4t(t,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});if(s){const h=k6e(u)?u.content:[u];a.replaceWith(0,l.content.size,h).setMeta("preventUpdate",!r)}return!0}return s&&a.setMeta("preventUpdate",!r),o.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function A6e(t,e){const r=yg(e,t.schema),{from:n,to:i,empty:a}=t.selection,s=[];a?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,l=>{s.push(...l.marks)});const o=s.find(l=>l.type.name===r.name);return o?{...o.attrs}:{}}function R6e(t,e){const r=new ESe(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function B4t(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,a)=>{r(i)&&n.push({node:i,pos:a})}),n}function qS(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function Q$(t){return e=>qS(e.$from,t)}function un(t,e,r){return t.config[e]===void 0&&t.parent?un(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?un(t.parent,e,r):null}):t.config[e]}function FZ(t){return t.map(e=>{const r=un(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return r?[e,...FZ(r())]:e}).flat(10)}function F4t(t){return typeof t=="function"}function ei(t,e=void 0,...r){return F4t(t)?e?t.bind(e)(...r):t(...r):t}function z4t(t={}){return Object.keys(t).length===0&&t.constructor===Object}function J$(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function H4t(t){const e=[],{nodeExtensions:r,markExtensions:n}=J$(t),i=[...r,...n],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=r.filter(u=>u.name!=="text").map(u=>u.name),o=n.map(u=>u.name),l=[...s,...o];return t.forEach(u=>{const h=un(u,"addGlobalAttributes",{name:u.name,options:u.options,storage:u.storage,extensions:i});h&&h().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types==="*"?f=l:d.types==="nodes"?f=s:d.types==="marks"?f=o:f=[],f.forEach(p=>{Object.entries(d.attributes).forEach(([g,m])=>{e.push({type:p,name:g,attribute:{...a,...m}})})})})}),i.forEach(u=>{const h=un(u,"addAttributes",{name:u.name,options:u.options,storage:u.storage});if(!h)return;const d=h();Object.entries(d).forEach(([f,p])=>{const g={...a,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:u.name,name:f,attribute:g})})}),e}function V4t(t){const e=[];let r="",n=!1,i=!1,a=0;const s=t.length;for(let o=0;o0){a-=1,r+=l;continue}if(l===";"&&a===0){e.push(r),r="";continue}}r+=l}return r&&e.push(r),e}function Cce(t){const e=[],r=V4t(t||""),n=r.length;for(let i=0;i!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,a])=>{if(i==="__proto__"){Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:a,writable:!0});return}if(!n[i]){n[i]=a;return}if(i==="class"){const s=a?String(a).split(" "):[],o=n[i]?n[i].split(" "):[],l=s.filter(u=>!o.includes(u));n[i]=[...o,...l].join(" ")}else if(i==="style"){const s=new Map([...Cce(n[i]),...Cce(a)]);n[i]=Array.from(s.entries()).map(([o,l])=>`${o}: ${l}`).join("; ")}else n[i]=a}),n},{})}function vM(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Wn(r,n),{})}function W4t(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Sce(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((a,s)=>{const o=s.attribute.parseHTML?s.attribute.parseHTML(r):W4t(r.getAttribute(s.name));return o==null?a:{...a,[s.name]:o}},{});return{...n,...i}}}}function Ece(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&z4t(r)?!1:r!=null))}function Ace(t){var e,r;const n={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(n.default=t.attribute.default),(t==null||(r=t.attribute)===null||r===void 0?void 0:r.validate)!==void 0&&(n.validate=t.attribute.validate),[t.name,n]}function q4t(t,e){var r;const n=H4t(t),{nodeExtensions:i,markExtensions:a}=J$(t),s=(r=i.find(u=>un(u,"topNode")))===null||r===void 0?void 0:r.name,o=Object.fromEntries(i.map(u=>{const h=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=Ece({...t.reduce((y,v)=>{const x=un(v,"extendNodeSchema",d);return{...y,...x?x(u):{}}},{}),content:ei(un(u,"content",d)),marks:ei(un(u,"marks",d)),group:ei(un(u,"group",d)),inline:ei(un(u,"inline",d)),atom:ei(un(u,"atom",d)),selectable:ei(un(u,"selectable",d)),draggable:ei(un(u,"draggable",d)),code:ei(un(u,"code",d)),whitespace:ei(un(u,"whitespace",d)),linebreakReplacement:ei(un(u,"linebreakReplacement",d)),defining:ei(un(u,"defining",d)),isolating:ei(un(u,"isolating",d)),attrs:Object.fromEntries(h.map(Ace))}),p=ei(un(u,"parseHTML",d));p&&(f.parseDOM=p.map(y=>Sce(y,h)));const g=un(u,"renderHTML",d);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:vM(y,h)}));const m=un(u,"renderText",d);return m&&(f.toText=m),[u.name,f]})),l=Object.fromEntries(a.map(u=>{const h=n.filter(m=>m.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=Ece({...t.reduce((m,y)=>{const v=un(y,"extendMarkSchema",d);return{...m,...v?v(u):{}}},{}),inclusive:ei(un(u,"inclusive",d)),excludes:ei(un(u,"excludes",d)),group:ei(un(u,"group",d)),spanning:ei(un(u,"spanning",d)),code:ei(un(u,"code",d)),attrs:Object.fromEntries(h.map(Ace))}),p=ei(un(u,"parseHTML",d));p&&(f.parseDOM=p.map(m=>Sce(m,h)));const g=un(u,"renderHTML",d);return g&&(f.toDOM=m=>g({mark:m,HTMLAttributes:vM(m,h)})),[u.name,f]}));return new uSe({topNode:s,nodes:o,marks:l})}function G4t(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}function _6e(t){return t.sort((r,n)=>{const i=un(r,"priority")||100,a=un(n,"priority")||100;return i>a?-1:in.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function QW(t,e){return q4t(U4t(t),e)}function Y4t(t,e){const r=QW(e),n=R5(t);return Mp.fromSchema(r).parse(n).toJSON()}function j4t(t,e,r){const{from:n,to:i}=e,{blockSeparator:a=` -`,textSerializers:s={}}=r||{};let o="";return t.nodesBetween(n,i,(l,u,h,d)=>{l.isBlock&&u>n&&(o+=a);const f=s==null?void 0:s[l.type.name];if(f)return h&&(o+=f({node:l,pos:u,parent:h,index:d,range:e})),!1;if(l.isText){var p;o+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(n,u)-u,i-u)}}),o}function U4t(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}function Y4t(t,e){const r=Os(e,t.schema),{from:n,to:i}=t.selection,a=[];t.doc.nodesBetween(n,i,o=>{a.push(o)});const s=a.reverse().find(o=>o.type.name===r.name);return s?{...s.attrs}:{}}function j4t(t,e){const r=OZ(typeof e=="string"?e:e.name,t.schema);return r==="node"?Y4t(t,e):r==="mark"?E6e(t,e):{}}function X4t(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function K4t(t){const e=X4t(t);return e.length===1?e:e.filter((r,n)=>!e.filter((i,a)=>a!==n).some(i=>r.oldRange.from>=i.oldRange.from&&r.oldRange.to<=i.oldRange.to&&r.newRange.from>=i.newRange.from&&r.newRange.to<=i.newRange.to))}function BZ(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,a)=>{const s=[];if(i.ranges.length)i.forEach((o,l)=>{s.push({from:o,to:l})});else{const{from:o,to:l}=r[a];if(o===void 0||l===void 0)return;s.push({from:o,to:l})}s.forEach(({from:o,to:l})=>{const u=e.slice(a).map(o,-1),h=e.slice(a).map(l),d=e.invert().map(u,-1),f=e.invert().map(h);n.push({oldRange:{from:d,to:f},newRange:{from:u,to:h}})})}),K4t(n)}function FZ(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const a=DZ(r.resolve(t),i.type);a&&n.push({mark:i,...a})}):r.nodesBetween(t,e,(i,a)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(s=>({from:a,to:a+i.nodeSize,mark:s})))}),n}const Z4t=(t,e,r,n=20)=>{const i=t.doc.resolve(r);let a=n,s=null;for(;a>0&&s===null;){const o=i.node(a);(o==null?void 0:o.type.name)===e?s=o:a-=1}return[s,a]},Q4t=t=>{const e=t.depth-1;if(e<0)return null;const r=t.index(e);return r===0?null:t.node(e).child(r-1)};function cR(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(a=>a.type===e&&a.name===n);return i?i.attribute.keepOnSplit:!1}))}function J4t(t,e,r={}){const{empty:n,ranges:i}=t.selection,a=e?yg(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>a?a.name===h.type.name:!0).find(h=>gM(h.attrs,r,{strict:!1}));let s=0;const o=[];if(i.forEach(({$from:h,$to:d})=>{const f=h.pos,p=d.pos;t.doc.nodesBetween(f,p,(g,m)=>{if(a&&g.inlineContent&&!g.type.allowsMarkType(a))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(f,m),v=Math.min(p,m+g.nodeSize),x=v-y;s+=x,o.push(...g.marks.map(b=>({mark:b,from:y,to:v})))})}),s===0)return!1;const l=o.filter(h=>a?a.name===h.mark.type.name:!0).filter(h=>gM(h.mark.attrs,r,{strict:!1})).reduce((h,d)=>h+d.to-d.from,0),u=o.filter(h=>a?h.mark.type!==a&&h.mark.type.excludes(a):!0).reduce((h,d)=>h+d.to-d.from,0);return(l>0?l+u:l)>=s}const ewt=(t,e)=>{const{$from:r,$to:n,$anchor:i}=t.selection;if(e){const a=K$(o=>o.type.name===e)(t.selection);if(!a)return!1;const s=t.doc.resolve(a.pos+1);return i.pos+1===s.end()}return!(n.parentOffset{const{$from:e,$to:r}=t.selection;return!(e.parentOffset>0||e.pos!==r.pos)};function iB(t,e){const{nodeExtensions:r}=Z$(e),n=r.find(a=>a.name===t);if(!n)return!1;const i=ei(un(n,"group",{name:n.name,options:n.options,storage:n.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function Q$(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){if(r){if(t.type.name==="hardBreak")return!0;if(t.isText){var n;return!/\S/.test((n=t.text)!==null&&n!==void 0?n:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(a=>{i!==!1&&(Q$(a,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function _6e(t){return t instanceof Ir}function rwt(t,e,r){const{selection:n}=e;let i=null;if(b6e(n)&&(i=n.$cursor),i){var a;const o=(a=t.storedMarks)!==null&&a!==void 0?a:i.marks();return i.parent.type.allowsMarkType(r)&&(!!r.isInSet(o)||!o.some(l=>l.type.excludes(r)))}const{ranges:s}=n;return s.some(({$from:o,$to:l})=>{let u=o.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(o.pos,l.pos,(h,d,f)=>{if(u)return!1;if(h.isInline){const p=!f||f.type.allowsMarkType(r),g=!!r.isInSet(h.marks)||!h.marks.some(m=>m.type.excludes(r));u=p&&g}return!u}),u})}const nwt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=r,{empty:s,ranges:o}=a,l=yg(t,n.schema);if(i)if(s){const u=E6e(n,l);r.addStoredMark(l.create({...u,...e}))}else o.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(h,d,(f,p)=>{const g=Math.max(p,h),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&r.addMark(g,m,l.create({...y.attrs,...e}))}):r.addMark(g,m,l.create(e))})});return rwt(n,r,l)},iwt=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),awt=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const a=Os(t,r.schema);let s;return r.selection.$anchor.sameParent(r.selection.$head)&&(s=r.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:o})=>nce(a,{...s,...e})(r)?!0:o.clearNodes()).command(({state:o})=>nce(a,{...s,...e})(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},swt=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=n1(t,0,n.content.size),a=Ir.create(n,i);e.setSelection(a)}return!0},owt=(t,e)=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=n;let s,o;return typeof e=="number"?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=a.from,o=a.to),i&&r.doc.nodesBetween(s,o,(l,u)=>{l.isText||r.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},lwt=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:a}=typeof t=="number"?{from:t,to:t}:t,s=wr.atStart(n).from,o=wr.atEnd(n).to,l=n1(i,s,o),u=n1(a,s,o),h=wr.create(n,l,u);e.setSelection(h)}return!0},cwt=t=>({state:e,dispatch:r})=>{const n=Os(t,e.schema);return Gbt(n)(e,r)};function Ece(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}const uwt=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:a,doc:s}=e,{$from:o,$to:l}=a,u=i.extensionManager.attributes,h=cR(u,o.node().type.name,o.node().attrs);if(a instanceof Ir&&a.node.isBlock)return!o.parentOffset||!If(s,o.pos)?!1:(n&&(t&&Ece(r,i.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=o.depth===0?void 0:C6e(o.node(-1).contentMatchAt(o.indexAfter(-1)));let p=d&&f?[{type:f,attrs:h}]:void 0,g=If(e.doc,e.mapping.map(o.pos),1,p);if(!p&&!g&&If(e.doc,e.mapping.map(o.pos),1,f?[{type:f}]:void 0)&&(g=!0,p=f?[{type:f,attrs:h}]:void 0),n){if(g&&(a instanceof wr&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,p),f&&!d&&!o.parentOffset&&o.parent.type!==f)){const m=e.mapping.map(o.before()),y=e.doc.resolve(m);o.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(o.before()),f)}t&&Ece(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},hwt=(t,e={})=>({tr:r,state:n,dispatch:i,editor:a})=>{const s=Os(t,n.schema),{$from:o,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||o.depth<2||!o.sameParent(l))return!1;const h=o.node(-1);if(h.type!==s)return!1;const d=a.extensionManager.attributes;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){if(o.depth===2||o.node(-3).type!==s||o.index(-2)!==o.node(-2).childCount-1)return!1;if(i){var f;let v=Rt.empty;const x=o.index(-1)?1:o.index(-2)?2:3;for(let E=o.depth-x;E>=o.depth-3;E-=1)v=Rt.from(o.node(E).copy(v));const b=o.indexAfter(-1){if(C>-1)return!1;E.isTextblock&&E.content.size===0&&(C=A+1)}),C>-1&&r.setSelection(wr.near(r.doc.resolve(C))),r.scrollIntoView()}return!0}const p=l.pos===o.end()?h.contentMatchAt(0).defaultType:null,g={...cR(d,h.type.name,h.attrs),...e},m={...cR(d,o.node().type.name,o.node().attrs),...e};r.delete(o.pos,l.pos);const y=p?[{type:s,attrs:g},{type:p,attrs:m}]:[{type:s,attrs:g}];if(!If(r.doc,o.pos,2))return!1;if(i){const{selection:v,storedMarks:x}=n,{splittableMarks:b}=a.extensionManager,T=x||v.$to.parentOffset&&v.$from.marks();if(r.split(o.pos,2,y).scrollIntoView(),!T||!i)return!0;const k=T.filter(S=>b.includes(S.type.name));r.ensureMarks(k)}return!0};function Ace(t){return!t||t==="1"?null:t}function M6e(t,e){return Ace(t)===Ace(e)}const aB=(t,e)=>{const r=K$(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&gg(t.doc,r.pos))||!M6e(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(r.pos),!0},sB=(t,e)=>{const r=K$(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&gg(t.doc,n))||!M6e(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n),!0};function dwt(t){const e=t.doc,r=e.firstChild;if(!r)return null;const n=e.resolve(1),i=e.resolve(r.nodeSize-1);return wr.between(n,i)}const fwt=(t,e,r,n={})=>({editor:i,tr:a,state:s,dispatch:o,chain:l,commands:u,can:h})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=Os(t,s.schema),g=Os(e,s.schema),{selection:m,storedMarks:y}=s,{$from:v,$to:x}=m,b=v.blockRange(x),T=y||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const k=K$(N=>iB(N.type.name,d))(m),S=m.from===0&&m.to===s.doc.content.size,C=s.doc.content.content,E=C.length===1?C[0]:null,A=S&&E&&iB(E.type.name,d)?{node:E,pos:0}:null,M=k??A,L=!!k&&b.depth>=1&&b.depth-k.depth<=1,P=!!A;if((L||P)&&M){if(M.node.type===p)return S&&P?l().command(({tr:N,dispatch:_})=>{const I=dwt(N);return I?(N.setSelection(I),_&&_(N),!0):!1}).liftListItem(g).run():u.liftListItem(g);if(iB(M.node.type.name,d)&&p.validContent(M.node.content))return l().command(()=>(a.setNodeMarkup(M.pos,p),!0)).command(()=>aB(a,p)).command(()=>sB(a,p)).run()}return!r||!T||!o?l().command(()=>h().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>aB(a,p)).command(()=>sB(a,p)).run():l().command(()=>{const N=h().wrapInList(p,n),_=T.filter(I=>f.includes(I.type.name));return a.ensureMarks(_),N?!0:u.clearNodes()}).wrapInList(p,n).command(()=>aB(a,p)).command(()=>sB(a,p)).run()},pwt=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:a=!1}=r,s=yg(t,n.schema);return J4t(n,s,e)?i.unsetMark(s,{extendEmptyMarkRange:a}):i.setMark(s,e)},gwt=(t,e,r={})=>({state:n,commands:i})=>{const a=Os(t,n.schema),s=Os(e,n.schema),o=Q1(n,a,r);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),o?i.setNode(s,l):i.setNode(a,{...l,...r})},mwt=(t,e={})=>({state:r,commands:n})=>{const i=Os(t,r.schema);return Q1(r,i,e)?n.lift(i):n.wrapIn(i,e)},ywt=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n=0;l-=1)s.step(o.steps[l].invert(o.docs[l]));if(a.text){const l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1},vwt=(t={})=>({tr:e,dispatch:r,editor:n})=>{const{ignoreClearable:i=!1}=t,{selection:a}=e,{empty:s,ranges:o}=a;if(s)return!0;const{nonClearableMarks:l}=n.extensionManager;if(r){const u=Object.values(n.schema.marks).filter(h=>i||!l.includes(h.name));o.forEach(h=>{for(const d of u)e.removeMark(h.$from.pos,h.$to.pos,d)})}return!0},bwt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{extendEmptyMarkRange:a=!1}=e,{selection:s}=r,o=yg(t,n.schema),{$from:l,empty:u,ranges:h}=s;if(!i)return!0;if(u&&a){var d;let{from:f,to:p}=s;const g=DZ(l,o,(d=l.marks().find(m=>m.type===o))===null||d===void 0?void 0:d.attrs);g&&(f=g.from,p=g.to),r.removeMark(f,p,o)}else h.forEach(f=>{r.removeMark(f.$from.pos,f.$to.pos,o)});return r.removeStoredMark(o),!0},xwt=t=>({tr:e,state:r,dispatch:n})=>{const{selection:i}=r;let a,s;return typeof t=="number"?(a=t,s=t):t&&"from"in t&&"to"in t?(a=t.from,s=t.to):(a=i.from,s=i.to),n&&e.doc.nodesBetween(a,s,(o,l)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},wwt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=OZ(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=Os(t,n.schema)),o==="mark"&&(s=yg(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;let f,p,g,m;r.selection.empty?n.doc.nodesBetween(h,d,(y,v)=>{a&&a===y.type&&(l=!0,g=Math.max(v,h),m=Math.min(v+y.nodeSize,d),f=v,p=y)}):n.doc.nodesBetween(h,d,(y,v)=>{v=h&&v<=d&&(a&&a===y.type&&(l=!0,i&&r.setNodeMarkup(v,void 0,{...y.attrs,...e})),s&&y.marks.length&&y.marks.forEach(x=>{if(s===x.type&&(l=!0,i)){const b=Math.max(v,h),T=Math.min(v+y.nodeSize,d);r.addMark(b,T,s.create({...x.attrs,...e}))}}))}),p&&(f!==void 0&&i&&r.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&r.addMark(g,m,s.create({...y.attrs,...e}))}))}),l},Twt=new fa("__tiptap_decorations__"),kwt=t=>({tr:e,dispatch:r})=>(r&&e.setMeta(Twt,{type:"force",name:t}),!0),Cwt=(t,e={})=>({state:r,dispatch:n})=>{const i=Os(t,r.schema);return Bbt(i,e)(r,n)},Swt=(t,e={})=>({state:r,dispatch:n})=>{const i=Os(t,r.schema);return Fbt(i,e)(r,n)};var Th=I2t({blur:()=>Hxt,clearContent:()=>Vxt,clearNodes:()=>Wxt,command:()=>qxt,createParagraphNear:()=>Gxt,cut:()=>Uxt,deleteCurrentNode:()=>Yxt,deleteNode:()=>jxt,deleteRange:()=>Xxt,deleteSelection:()=>Qxt,enter:()=>Jxt,exitCode:()=>e4t,extendMarkRange:()=>r4t,first:()=>n4t,focus:()=>s4t,forEach:()=>o4t,insertContent:()=>l4t,insertContentAt:()=>c4t,insertDefaultBlock:()=>u4t,joinBackward:()=>f4t,joinDown:()=>d4t,joinForward:()=>p4t,joinItemBackward:()=>g4t,joinItemForward:()=>m4t,joinTextblockBackward:()=>y4t,joinTextblockForward:()=>v4t,joinUp:()=>h4t,keyboardShortcut:()=>x4t,lift:()=>w4t,liftEmptyBlock:()=>T4t,liftListItem:()=>k4t,newlineInCode:()=>C4t,resetAttributes:()=>S4t,scrollIntoView:()=>E4t,selectAll:()=>A4t,selectNodeBackward:()=>R4t,selectNodeForward:()=>_4t,selectParentNode:()=>M4t,selectTextblockEnd:()=>L4t,selectTextblockStart:()=>I4t,setContent:()=>N4t,setMark:()=>nwt,setMeta:()=>iwt,setNode:()=>awt,setNodeSelection:()=>swt,setTextDirection:()=>owt,setTextSelection:()=>lwt,sinkListItem:()=>cwt,splitBlock:()=>uwt,splitListItem:()=>hwt,toggleList:()=>fwt,toggleMark:()=>pwt,toggleNode:()=>gwt,toggleWrap:()=>mwt,undoInputRule:()=>ywt,unsetAllMarks:()=>vwt,unsetMark:()=>bwt,unsetTextDirection:()=>xwt,updateAttributes:()=>wwt,updateDecorations:()=>kwt,wrapIn:()=>Cwt,wrapInList:()=>Swt});function BT(t,e){if(t===e)return!0;if(!t||!e)return!1;const r=Object.keys(t),n=Object.keys(e);return r.length!==n.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(e,i)&&Object.is(t[i],e[i]))}function Ewt(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof Ir){const a=n.index();return n.parent.canReplaceWith(a,a+1,e)}let i=n.depth;for(;i>=0;){const a=n.index(i);if(n.node(i).contentMatchAt(a).matchType(e))return!0;i-=1}return!1}function Rce(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function Awt(t){return t.replace(/&/g,"&").replace(//g,">")}function Rwt(t){return Object.prototype.toString.call(t).slice(8,-1)}function oA(t){return Rwt(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _ce(t,e,r){const n=t.split(` +`,textSerializers:s={}}=r||{};let o="";return t.nodesBetween(n,i,(l,u,h,d)=>{l.isBlock&&u>n&&(o+=a);const f=s==null?void 0:s[l.type.name];if(f)return h&&(o+=f({node:l,pos:u,parent:h,index:d,range:e})),!1;if(l.isText){var p;o+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(n,u)-u,i-u)}}),o}function X4t(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}function K4t(t,e){const r=Os(e,t.schema),{from:n,to:i}=t.selection,a=[];t.doc.nodesBetween(n,i,o=>{a.push(o)});const s=a.reverse().find(o=>o.type.name===r.name);return s?{...s.attrs}:{}}function Z4t(t,e){const r=BZ(typeof e=="string"?e:e.name,t.schema);return r==="node"?K4t(t,e):r==="mark"?A6e(t,e):{}}function Q4t(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function J4t(t){const e=Q4t(t);return e.length===1?e:e.filter((r,n)=>!e.filter((i,a)=>a!==n).some(i=>r.oldRange.from>=i.oldRange.from&&r.oldRange.to<=i.oldRange.to&&r.newRange.from>=i.newRange.from&&r.newRange.to<=i.newRange.to))}function zZ(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,a)=>{const s=[];if(i.ranges.length)i.forEach((o,l)=>{s.push({from:o,to:l})});else{const{from:o,to:l}=r[a];if(o===void 0||l===void 0)return;s.push({from:o,to:l})}s.forEach(({from:o,to:l})=>{const u=e.slice(a).map(o,-1),h=e.slice(a).map(l),d=e.invert().map(u,-1),f=e.invert().map(h);n.push({oldRange:{from:d,to:f},newRange:{from:u,to:h}})})}),J4t(n)}function HZ(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const a=PZ(r.resolve(t),i.type);a&&n.push({mark:i,...a})}):r.nodesBetween(t,e,(i,a)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(s=>({from:a,to:a+i.nodeSize,mark:s})))}),n}const ewt=(t,e,r,n=20)=>{const i=t.doc.resolve(r);let a=n,s=null;for(;a>0&&s===null;){const o=i.node(a);(o==null?void 0:o.type.name)===e?s=o:a-=1}return[s,a]},twt=t=>{const e=t.depth-1;if(e<0)return null;const r=t.index(e);return r===0?null:t.node(e).child(r-1)};function uR(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(a=>a.type===e&&a.name===n);return i?i.attribute.keepOnSplit:!1}))}function rwt(t,e,r={}){const{empty:n,ranges:i}=t.selection,a=e?yg(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>a?a.name===h.type.name:!0).find(h=>mM(h.attrs,r,{strict:!1}));let s=0;const o=[];if(i.forEach(({$from:h,$to:d})=>{const f=h.pos,p=d.pos;t.doc.nodesBetween(f,p,(g,m)=>{if(a&&g.inlineContent&&!g.type.allowsMarkType(a))return!1;if(!g.isText&&!g.marks.length)return;const y=Math.max(f,m),v=Math.min(p,m+g.nodeSize),x=v-y;s+=x,o.push(...g.marks.map(b=>({mark:b,from:y,to:v})))})}),s===0)return!1;const l=o.filter(h=>a?a.name===h.mark.type.name:!0).filter(h=>mM(h.mark.attrs,r,{strict:!1})).reduce((h,d)=>h+d.to-d.from,0),u=o.filter(h=>a?h.mark.type!==a&&h.mark.type.excludes(a):!0).reduce((h,d)=>h+d.to-d.from,0);return(l>0?l+u:l)>=s}const nwt=(t,e)=>{const{$from:r,$to:n,$anchor:i}=t.selection;if(e){const a=Q$(o=>o.type.name===e)(t.selection);if(!a)return!1;const s=t.doc.resolve(a.pos+1);return i.pos+1===s.end()}return!(n.parentOffset{const{$from:e,$to:r}=t.selection;return!(e.parentOffset>0||e.pos!==r.pos)};function sB(t,e){const{nodeExtensions:r}=J$(e),n=r.find(a=>a.name===t);if(!n)return!1;const i=ei(un(n,"group",{name:n.name,options:n.options,storage:n.storage}));return typeof i!="string"?!1:i.split(" ").includes("list")}function eN(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){if(r){if(t.type.name==="hardBreak")return!0;if(t.isText){var n;return!/\S/.test((n=t.text)!==null&&n!==void 0?n:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(a=>{i!==!1&&(eN(a,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function M6e(t){return t instanceof Ir}function awt(t,e,r){const{selection:n}=e;let i=null;if(x6e(n)&&(i=n.$cursor),i){var a;const o=(a=t.storedMarks)!==null&&a!==void 0?a:i.marks();return i.parent.type.allowsMarkType(r)&&(!!r.isInSet(o)||!o.some(l=>l.type.excludes(r)))}const{ranges:s}=n;return s.some(({$from:o,$to:l})=>{let u=o.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(o.pos,l.pos,(h,d,f)=>{if(u)return!1;if(h.isInline){const p=!f||f.type.allowsMarkType(r),g=!!r.isInSet(h.marks)||!h.marks.some(m=>m.type.excludes(r));u=p&&g}return!u}),u})}const swt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=r,{empty:s,ranges:o}=a,l=yg(t,n.schema);if(i)if(s){const u=A6e(n,l);r.addStoredMark(l.create({...u,...e}))}else o.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(h,d,(f,p)=>{const g=Math.max(p,h),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&r.addMark(g,m,l.create({...y.attrs,...e}))}):r.addMark(g,m,l.create(e))})});return awt(n,r,l)},owt=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),lwt=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const a=Os(t,r.schema);let s;return r.selection.$anchor.sameParent(r.selection.$head)&&(s=r.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:o})=>ace(a,{...s,...e})(r)?!0:o.clearNodes()).command(({state:o})=>ace(a,{...s,...e})(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},cwt=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=n1(t,0,n.content.size),a=Ir.create(n,i);e.setSelection(a)}return!0},uwt=(t,e)=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=n;let s,o;return typeof e=="number"?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=a.from,o=a.to),i&&r.doc.nodesBetween(s,o,(l,u)=>{l.isText||r.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},hwt=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:a}=typeof t=="number"?{from:t,to:t}:t,s=Tr.atStart(n).from,o=Tr.atEnd(n).to,l=n1(i,s,o),u=n1(a,s,o),h=Tr.create(n,l,u);e.setSelection(h)}return!0},dwt=t=>({state:e,dispatch:r})=>{const n=Os(t,e.schema);return jbt(n)(e,r)};function Rce(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}const fwt=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:a,doc:s}=e,{$from:o,$to:l}=a,u=i.extensionManager.attributes,h=uR(u,o.node().type.name,o.node().attrs);if(a instanceof Ir&&a.node.isBlock)return!o.parentOffset||!If(s,o.pos)?!1:(n&&(t&&Rce(r,i.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=o.depth===0?void 0:S6e(o.node(-1).contentMatchAt(o.indexAfter(-1)));let p=d&&f?[{type:f,attrs:h}]:void 0,g=If(e.doc,e.mapping.map(o.pos),1,p);if(!p&&!g&&If(e.doc,e.mapping.map(o.pos),1,f?[{type:f}]:void 0)&&(g=!0,p=f?[{type:f,attrs:h}]:void 0),n){if(g&&(a instanceof Tr&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,p),f&&!d&&!o.parentOffset&&o.parent.type!==f)){const m=e.mapping.map(o.before()),y=e.doc.resolve(m);o.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(o.before()),f)}t&&Rce(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},pwt=(t,e={})=>({tr:r,state:n,dispatch:i,editor:a})=>{const s=Os(t,n.schema),{$from:o,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||o.depth<2||!o.sameParent(l))return!1;const h=o.node(-1);if(h.type!==s)return!1;const d=a.extensionManager.attributes;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){if(o.depth===2||o.node(-3).type!==s||o.index(-2)!==o.node(-2).childCount-1)return!1;if(i){var f;let v=Rt.empty;const x=o.index(-1)?1:o.index(-2)?2:3;for(let E=o.depth-x;E>=o.depth-3;E-=1)v=Rt.from(o.node(E).copy(v));const b=o.indexAfter(-1){if(C>-1)return!1;E.isTextblock&&E.content.size===0&&(C=A+1)}),C>-1&&r.setSelection(Tr.near(r.doc.resolve(C))),r.scrollIntoView()}return!0}const p=l.pos===o.end()?h.contentMatchAt(0).defaultType:null,g={...uR(d,h.type.name,h.attrs),...e},m={...uR(d,o.node().type.name,o.node().attrs),...e};r.delete(o.pos,l.pos);const y=p?[{type:s,attrs:g},{type:p,attrs:m}]:[{type:s,attrs:g}];if(!If(r.doc,o.pos,2))return!1;if(i){const{selection:v,storedMarks:x}=n,{splittableMarks:b}=a.extensionManager,T=x||v.$to.parentOffset&&v.$from.marks();if(r.split(o.pos,2,y).scrollIntoView(),!T||!i)return!0;const k=T.filter(S=>b.includes(S.type.name));r.ensureMarks(k)}return!0};function _ce(t){return!t||t==="1"?null:t}function L6e(t,e){return _ce(t)===_ce(e)}const oB=(t,e)=>{const r=Q$(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&gg(t.doc,r.pos))||!L6e(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(r.pos),!0},lB=(t,e)=>{const r=Q$(a=>a.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&gg(t.doc,n))||!L6e(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n),!0};function gwt(t){const e=t.doc,r=e.firstChild;if(!r)return null;const n=e.resolve(1),i=e.resolve(r.nodeSize-1);return Tr.between(n,i)}const mwt=(t,e,r,n={})=>({editor:i,tr:a,state:s,dispatch:o,chain:l,commands:u,can:h})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=Os(t,s.schema),g=Os(e,s.schema),{selection:m,storedMarks:y}=s,{$from:v,$to:x}=m,b=v.blockRange(x),T=y||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const k=Q$(N=>sB(N.type.name,d))(m),S=m.from===0&&m.to===s.doc.content.size,C=s.doc.content.content,E=C.length===1?C[0]:null,A=S&&E&&sB(E.type.name,d)?{node:E,pos:0}:null,M=k??A,L=!!k&&b.depth>=1&&b.depth-k.depth<=1,P=!!A;if((L||P)&&M){if(M.node.type===p)return S&&P?l().command(({tr:N,dispatch:_})=>{const I=gwt(N);return I?(N.setSelection(I),_&&_(N),!0):!1}).liftListItem(g).run():u.liftListItem(g);if(sB(M.node.type.name,d)&&p.validContent(M.node.content))return l().command(()=>(a.setNodeMarkup(M.pos,p),!0)).command(()=>oB(a,p)).command(()=>lB(a,p)).run()}return!r||!T||!o?l().command(()=>h().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>oB(a,p)).command(()=>lB(a,p)).run():l().command(()=>{const N=h().wrapInList(p,n),_=T.filter(I=>f.includes(I.type.name));return a.ensureMarks(_),N?!0:u.clearNodes()}).wrapInList(p,n).command(()=>oB(a,p)).command(()=>lB(a,p)).run()},ywt=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:a=!1}=r,s=yg(t,n.schema);return rwt(n,s,e)?i.unsetMark(s,{extendEmptyMarkRange:a}):i.setMark(s,e)},vwt=(t,e,r={})=>({state:n,commands:i})=>{const a=Os(t,n.schema),s=Os(e,n.schema),o=Q1(n,a,r);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),o?i.setNode(s,l):i.setNode(a,{...l,...r})},bwt=(t,e={})=>({state:r,commands:n})=>{const i=Os(t,r.schema);return Q1(r,i,e)?n.lift(i):n.wrapIn(i,e)},xwt=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n=0;l-=1)s.step(o.steps[l].invert(o.docs[l]));if(a.text){const l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1},wwt=(t={})=>({tr:e,dispatch:r,editor:n})=>{const{ignoreClearable:i=!1}=t,{selection:a}=e,{empty:s,ranges:o}=a;if(s)return!0;const{nonClearableMarks:l}=n.extensionManager;if(r){const u=Object.values(n.schema.marks).filter(h=>i||!l.includes(h.name));o.forEach(h=>{for(const d of u)e.removeMark(h.$from.pos,h.$to.pos,d)})}return!0},Twt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{extendEmptyMarkRange:a=!1}=e,{selection:s}=r,o=yg(t,n.schema),{$from:l,empty:u,ranges:h}=s;if(!i)return!0;if(u&&a){var d;let{from:f,to:p}=s;const g=PZ(l,o,(d=l.marks().find(m=>m.type===o))===null||d===void 0?void 0:d.attrs);g&&(f=g.from,p=g.to),r.removeMark(f,p,o)}else h.forEach(f=>{r.removeMark(f.$from.pos,f.$to.pos,o)});return r.removeStoredMark(o),!0},kwt=t=>({tr:e,state:r,dispatch:n})=>{const{selection:i}=r;let a,s;return typeof t=="number"?(a=t,s=t):t&&"from"in t&&"to"in t?(a=t.from,s=t.to):(a=i.from,s=i.to),n&&e.doc.nodesBetween(a,s,(o,l)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},Cwt=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=BZ(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=Os(t,n.schema)),o==="mark"&&(s=yg(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;let f,p,g,m;r.selection.empty?n.doc.nodesBetween(h,d,(y,v)=>{a&&a===y.type&&(l=!0,g=Math.max(v,h),m=Math.min(v+y.nodeSize,d),f=v,p=y)}):n.doc.nodesBetween(h,d,(y,v)=>{v=h&&v<=d&&(a&&a===y.type&&(l=!0,i&&r.setNodeMarkup(v,void 0,{...y.attrs,...e})),s&&y.marks.length&&y.marks.forEach(x=>{if(s===x.type&&(l=!0,i)){const b=Math.max(v,h),T=Math.min(v+y.nodeSize,d);r.addMark(b,T,s.create({...x.attrs,...e}))}}))}),p&&(f!==void 0&&i&&r.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&r.addMark(g,m,s.create({...y.attrs,...e}))}))}),l},Swt=new fa("__tiptap_decorations__"),Ewt=t=>({tr:e,dispatch:r})=>(r&&e.setMeta(Swt,{type:"force",name:t}),!0),Awt=(t,e={})=>({state:r,dispatch:n})=>{const i=Os(t,r.schema);return Hbt(i,e)(r,n)},Rwt=(t,e={})=>({state:r,dispatch:n})=>{const i=Os(t,r.schema);return Vbt(i,e)(r,n)};var Th=D2t({blur:()=>qxt,clearContent:()=>Gxt,clearNodes:()=>Uxt,command:()=>Yxt,createParagraphNear:()=>jxt,cut:()=>Xxt,deleteCurrentNode:()=>Kxt,deleteNode:()=>Zxt,deleteRange:()=>Qxt,deleteSelection:()=>t4t,enter:()=>r4t,exitCode:()=>n4t,extendMarkRange:()=>a4t,first:()=>s4t,focus:()=>c4t,forEach:()=>u4t,insertContent:()=>h4t,insertContentAt:()=>d4t,insertDefaultBlock:()=>f4t,joinBackward:()=>m4t,joinDown:()=>g4t,joinForward:()=>y4t,joinItemBackward:()=>v4t,joinItemForward:()=>b4t,joinTextblockBackward:()=>x4t,joinTextblockForward:()=>w4t,joinUp:()=>p4t,keyboardShortcut:()=>k4t,lift:()=>C4t,liftEmptyBlock:()=>S4t,liftListItem:()=>E4t,newlineInCode:()=>A4t,resetAttributes:()=>R4t,scrollIntoView:()=>_4t,selectAll:()=>M4t,selectNodeBackward:()=>L4t,selectNodeForward:()=>I4t,selectParentNode:()=>$4t,selectTextblockEnd:()=>N4t,selectTextblockStart:()=>D4t,setContent:()=>P4t,setMark:()=>swt,setMeta:()=>owt,setNode:()=>lwt,setNodeSelection:()=>cwt,setTextDirection:()=>uwt,setTextSelection:()=>hwt,sinkListItem:()=>dwt,splitBlock:()=>fwt,splitListItem:()=>pwt,toggleList:()=>mwt,toggleMark:()=>ywt,toggleNode:()=>vwt,toggleWrap:()=>bwt,undoInputRule:()=>xwt,unsetAllMarks:()=>wwt,unsetMark:()=>Twt,unsetTextDirection:()=>kwt,updateAttributes:()=>Cwt,updateDecorations:()=>Ewt,wrapIn:()=>Awt,wrapInList:()=>Rwt});function BT(t,e){if(t===e)return!0;if(!t||!e)return!1;const r=Object.keys(t),n=Object.keys(e);return r.length!==n.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(e,i)&&Object.is(t[i],e[i]))}function _wt(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof Ir){const a=n.index();return n.parent.canReplaceWith(a,a+1,e)}let i=n.depth;for(;i>=0;){const a=n.index(i);if(n.node(i).contentMatchAt(a).matchType(e))return!0;i-=1}return!1}function Mce(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function Mwt(t){return t.replace(/&/g,"&").replace(//g,">")}function Lwt(t){return Object.prototype.toString.call(t).slice(8,-1)}function lA(t){return Lwt(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Lce(t,e,r){const n=t.split(` `),i=[];let a="",s=0;const o=e.baseIndentSize||2;for(;s0)break;if(h.trim()===""){s+=1,a=`${a}${h} `;continue}else return}const f=e.extractItemData(d),{indentLevel:p,mainContent:g}=f;a=`${a}${h} `;const m=[g];for(s+=1;sk.trim()!=="");if(T===-1)break;if((((u=n[s+1+T].match(/^(\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>p){m.push(b),a=`${a}${b} `,s+=1;continue}else break}if((((l=b.match(/^(\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>p)m.push(b),a=`${a}${b} `,s+=1;else break}let y;const v=m.slice(1);if(v.length>0){const b=v.map(T=>T.slice(p+o)).join(` -`);b.trim()&&(e.customNestedParser?y=e.customNestedParser(b):y=r.blockTokens(b))}const x=e.createToken(f,y);i.push(x)}if(i.length!==0)return{items:i,raw:a}}const Mce=4;function Lce(t){let e=0;for(const r of t)e=r===" "?e+Mce-e%Mce:e+1;return e}function L6e(t,e,r,n,i){if(!t||!Array.isArray(t.content))return"";const a=typeof r=="function"?r(n):r,[s,...o]=t.content;let l=`${a}${e.renderChildren([s])}`;return o&&o.length>0&&o.forEach((u,h)=>{var d,f;const p=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,h+1))!==null&&d!==void 0?d:e.renderChildren([u]);if(p!=null){const g=y=>{if(!(i!=null&&i.alignNestedToPrefix))return e.indent(y);const v=e.indent(""),x=Lce(a);return(Lce(v)>=x?v:" ".repeat(x))+y},m=p.split(` +`);b.trim()&&(e.customNestedParser?y=e.customNestedParser(b):y=r.blockTokens(b))}const x=e.createToken(f,y);i.push(x)}if(i.length!==0)return{items:i,raw:a}}const Ice=4;function $ce(t){let e=0;for(const r of t)e=r===" "?e+Ice-e%Ice:e+1;return e}function I6e(t,e,r,n,i){if(!t||!Array.isArray(t.content))return"";const a=typeof r=="function"?r(n):r,[s,...o]=t.content;let l=`${a}${e.renderChildren([s])}`;return o&&o.length>0&&o.forEach((u,h)=>{var d,f;const p=(d=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,h+1))!==null&&d!==void 0?d:e.renderChildren([u]);if(p!=null){const g=y=>{if(!(i!=null&&i.alignNestedToPrefix))return e.indent(y);const v=e.indent(""),x=$ce(a);return($ce(v)>=x?v:" ".repeat(x))+y},m=p.split(` `).map(y=>g(y||"")).join(` `);l+=u.type==="paragraph"?` ${m}`:` -${m}`}}),l}function Ice(t){return typeof t.type=="string"?t.type:t.type.name}function _wt(t,e){if(t.length!==e.length)return!1;const r=Array.from({length:e.length},()=>!1);return t.every(n=>{const i=Ice(n),a=e.findIndex((s,o)=>!r[o]&&i===Ice(s)&&BT(n.attrs,s.attrs));return a===-1?!1:(r[a]=!0,!0)})}function I6e(t,e){const r={...t};return oA(t)&&oA(e)&&Object.keys(e).forEach(n=>{oA(e[n])&&oA(t[n])?r[n]=I6e(t[n],e[n]):r[n]=e[n]}),r}var kE=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},zZ=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ei(un(this,"addOptions",{name:this.name}))}}get storage(){return{...ei(un(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>I6e(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Iy=class $6e extends zZ{constructor(...e){super(...e),this.type="mark"}static create(e={}){const r=typeof e=="function"?e():e;return new $6e(r)}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!a.find(o=>(o==null?void 0:o.type.name)===r.name))return!1;const s=a.find(o=>(o==null?void 0:o.type.name)===r.name);return s&&n.removeStoredMark(s),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}},N6e=class{constructor(t){this.find=t.find,this.handler=t.handler}},Ki=class D6e extends zZ{constructor(...e){super(...e),this.type="extension"}static create(e={}){const r=typeof e=="function"?e():e;return new D6e(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};Ki.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new da({key:new fa("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,a=U4t(r),{blockSeparator:s}=this.options,o={...s!==void 0?{blockSeparator:s}:{},textSerializers:a};return[...i.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>G4t(n,{from:l.pos,to:u.pos},o)).join(s??` +${m}`}}),l}function Nce(t){return typeof t.type=="string"?t.type:t.type.name}function Iwt(t,e){if(t.length!==e.length)return!1;const r=Array.from({length:e.length},()=>!1);return t.every(n=>{const i=Nce(n),a=e.findIndex((s,o)=>!r[o]&&i===Nce(s)&&BT(n.attrs,s.attrs));return a===-1?!1:(r[a]=!0,!0)})}function $6e(t,e){const r={...t};return lA(t)&&lA(e)&&Object.keys(e).forEach(n=>{lA(e[n])&&lA(t[n])?r[n]=$6e(t[n],e[n]):r[n]=e[n]}),r}var CE=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},VZ=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ei(un(this,"addOptions",{name:this.name}))}}get storage(){return{...ei(un(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>$6e(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Iy=class N6e extends VZ{constructor(...e){super(...e),this.type="mark"}static create(e={}){const r=typeof e=="function"?e():e;return new N6e(r)}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!a.find(o=>(o==null?void 0:o.type.name)===r.name))return!1;const s=a.find(o=>(o==null?void 0:o.type.name)===r.name);return s&&n.removeStoredMark(s),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}},D6e=class{constructor(t){this.find=t.find,this.handler=t.handler}},Ki=class O6e extends VZ{constructor(...e){super(...e),this.type="extension"}static create(e={}){const r=typeof e=="function"?e():e;return new O6e(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};Ki.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new da({key:new fa("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,a=X4t(r),{blockSeparator:s}=this.options,o={...s!==void 0?{blockSeparator:s}:{},textSerializers:a};return[...i.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>j4t(n,{from:l.pos,to:u.pos},o)).join(s??` -`)}}})]}});Ki.create({name:"commands",addCommands(){return{...Th}}});Ki.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var r,n;const i=()=>{var a,s,o;if((a=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(o=s.filterTransaction)===null||o===void 0?void 0:o.call(s,t))!==null&&a!==void 0?a:t.getMeta("y-sync$"))return;const l=A6e(t.before,[t,...e]);BZ(l).forEach(h=>{l.mapping.mapResult(h.oldRange.from).deletedAfter&&l.mapping.mapResult(h.oldRange.to).deletedBefore&&l.before.nodesBetween(h.oldRange.from,h.oldRange.to,(d,f)=>{const p=f+d.nodeSize-2,g=h.oldRange.from<=f&&p<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:d,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:h.oldRange,newRange:h.newRange,partial:!g,editor:this.editor,transaction:t,combinedTransform:l})})});const u=l.mapping;l.steps.forEach((h,d)=>{if(h instanceof Hu){var f,p;const g=u.slice(d).map(h.from,-1),m=u.slice(d).map(h.to),y=u.invert().map(g,-1),v=u.invert().map(m),x=g>0?(f=l.doc.nodeAt(g-1))===null||f===void 0?void 0:f.marks.some(T=>T.eq(h.mark)):!1,b=(p=l.doc.nodeAt(m))===null||p===void 0?void 0:p.marks.some(T=>T.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:v},newRange:{from:g,to:m},partial:!!(b||x),editor:this.editor,transaction:t,combinedTransform:l})}})};!((r=(n=this.editor.options.coreExtensionOptions)===null||n===void 0||(n=n.delete)===null||n===void 0?void 0:n.async)!==null&&r!==void 0)||r?setTimeout(i,0):i()}});Ki.create({name:"drop",addProseMirrorPlugins(){return[new da({key:new fa("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}});Ki.create({name:"editable",addProseMirrorPlugins(){return[new da({key:new fa("editable"),props:{editable:()=>this.editor.options.editable}})]}});const Mwt=new fa("focusEvents");Ki.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new da({key:Mwt,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});Ki.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:o})=>{const{selection:l,doc:u}=o,{empty:h,$anchor:d}=l,{pos:f,parent:p}=d,g=d.parent.isTextblock&&f>0?o.doc.resolve(f-1):d,m=g.parent.type.spec.isolating,y=d.pos-d.parentOffset,v=m&&g.parent.childCount===1?y===d.pos:sn.atStart(u).from===f;return!h||!p.type.isTextblock||p.textContent.length||!v||v&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},a={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return mM()||S6e()?a:i},addProseMirrorPlugins(){return[new da({key:new fa("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(p=>p.getMeta("composition")))return;const n=t.some(p=>p.docChanged)&&!e.doc.eq(r.doc),i=t.some(p=>p.getMeta("preventClearDocument"));if(!n||i)return;const{empty:a,from:s,to:o}=e.selection,l=sn.atStart(e.doc).from,u=sn.atEnd(e.doc).to;if(a||!(s===l&&o===u)||!Q$(r.doc))return;const h=r.tr,d=m6e({state:r,transaction:h}),{commands:f}=new zxt({editor:this.editor,state:d});if(f.clearNodes(),!!h.steps.length)return h}})]}});Ki.create({name:"paste",addProseMirrorPlugins(){return[new da({key:new fa("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}});Ki.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new da({key:new fa("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}});Ki.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Z$(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const r=e.getAttribute("dir");return r&&(r==="ltr"||r==="rtl"||r==="auto")?r:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new da({key:new fa("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}});function J1(t){return new kE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=ei(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:a}=e,s=n[n.length-1],o=n[0];if(s){const l=o.search(/\S/),u=r.from+o.indexOf(s),h=u+s.length;if(FZ(r.from,r.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;hr.from&&a.delete(r.from+l,u);const d=r.from+l+s.length;a.addMark(r.from+l,d,t.type.create(i||{})),a.removeStoredMark(t.type)}},undoable:t.undoable})}function O6e(t){return new kE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=ei(t.getAttributes,void 0,n)||{},{tr:a}=e,s=r.from;let o=r.to;const l=t.type.create(i);if(n[1]){let u=s+n[0].lastIndexOf(n[1]);u>o?u=o:o=u+n[1].length;const h=n[0][n[0].length-1];a.insertText(h,s+n[0].length-1),a.replaceWith(u,o,l)}else if(n[0]){const u=t.type.isInline?s:s-1;a.insert(u,t.type.create(i)).delete(a.mapping.map(s),a.mapping.map(o))}a.scrollIntoView()},undoable:t.undoable})}function ZW(t){return new kE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=e.doc.resolve(r.from),a=ei(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)},undoable:t.undoable})}function FT(t){return new kE({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const a=ei(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),o=s.doc.resolve(r.from).blockRange(),l=o&&wZ(o,t.type,a);if(!l)return null;if(s.wrap(o,l),t.keepMarks&&t.editor){const{selection:h,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,p=d||h.$to.parentOffset&&h.$from.marks();if(p){const g=p.filter(m=>f.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,a).run()}const u=s.doc.resolve(r.from-1).nodeBefore;u&&u.type===t.type&&gg(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,u))&&s.join(r.from-1)},undoable:t.undoable})}const Lwt=t=>"touches"in t;var Iwt=class{constructor(t){var e,r,n,i,a,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.touches[0];if(!l)return;const u=l.clientX-this.startX,h=l.clientY-this.startY;this.handleResize(u,h)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(o,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.element.draggable=!1,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,!((e=t.options)===null||e===void 0)&&e.min&&(this.minSize={...this.minSize,...t.options.min}),!((r=t.options)===null||r===void 0)&&r.max&&(this.maxSize=t.options.max),!(t==null||(n=t.options)===null||n===void 0)&&n.directions&&(this.directions=t.options.directions),!((i=t.options)===null||i===void 0)&&i.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),!((a=t.options)===null||a===void 0)&&a.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),!((s=t.options)===null||s===void 0)&&s.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!==null&&t!==void 0?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,r){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,r):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const r=e.includes("top"),n=e.includes("bottom"),i=e.includes("left"),a=e.includes("right");r&&(t.style.top="0"),n&&(t.style.bottom="0"),i&&(t.style.left="0"),a&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",r=>this.handleResizeStart(r,t)),e.addEventListener("touchstart",r=>this.handleResizeStart(r,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Lwt(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const r=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),a=this.applyConstraints(n,i,r);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(t,e,r){let n=this.startWidth,i=this.startHeight;const a=t.includes("right"),s=t.includes("left"),o=t.includes("bottom"),l=t.includes("top");return a?n=this.startWidth+e:s&&(n=this.startWidth-e),o?i=this.startHeight+r:l&&(i=this.startHeight-r),(t==="right"||t==="left")&&(n=this.startWidth+(a?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(o?r:-r)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,i,t):{width:n,height:i}}applyConstraints(t,e,r){var n,i;if(!r){var a,s;let u=Math.max(this.minSize.width,t),h=Math.max(this.minSize.height,e);return!((a=this.maxSize)===null||a===void 0)&&a.width&&(u=Math.min(this.maxSize.width,u)),!((s=this.maxSize)===null||s===void 0)&&s.height&&(h=Math.min(this.maxSize.height,h)),{width:u,height:h}}let o=t,l=e;return othis.maxSize.width&&(o=this.maxSize.width,l=o/this.aspectRatio),!((i=this.maxSize)===null||i===void 0)&&i.height&&l>this.maxSize.height&&(l=this.maxSize.height,o=l*this.aspectRatio),{width:o,height:l}}applyAspectRatio(t,e,r){const n=r==="left"||r==="right",i=r==="top"||r==="bottom";return n?{width:t,height:t/this.aspectRatio}:i?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}},Ti=class P6e extends zZ{constructor(...e){super(...e),this.type="node"}static create(e={}){const r=typeof e=="function"?e():e;return new P6e(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};function Gp(t){return new N6e({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const a=ei(t.getAttributes,void 0,n,i);if(a===!1||a===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let u=r.to;if(o){const h=l.search(/\S/),d=r.from+l.indexOf(o),f=d+o.length;if(FZ(r.from,r.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;fr.from&&s.delete(r.from+h,d),u=r.from+h+o.length,s.addMark(r.from+h,u,t.type.create(a||{})),n.index!==void 0&&n.input!==void 0&&n.index+n[0].length>=n.input.length||s.removeStoredMark(t.type)}}})}const $wt=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Nwt=Ti.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Wn(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,r,n,i,a,s;const o=(e=(r=t.attrs)===null||r===void 0?void 0:r.src)!==null&&e!==void 0?e:"",l=(n=(i=t.attrs)===null||i===void 0?void 0:i.alt)!==null&&n!==void 0?n:"",u=(a=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&a!==void 0?a:"";return u?`![${l}](${o} "${u}")`:`![${l}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize,i=new Set(["src","width","height"]);return({node:a,getPos:s,HTMLAttributes:o,editor:l})=>{const u=document.createElement("img");u.draggable=!1;const h=Wn(this.options.HTMLAttributes,o);Object.entries(h).forEach(([v,x])=>{if(x!=null)switch(v){case"src":case"width":case"height":break;default:u.setAttribute(v,x)}}),h.src!==null&&(u.src=h.src);let d={...o};const f=v=>{if(typeof v=="string"&&v!==""){u.getAttribute("src")!==v&&(u.src=v);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};f(o.src);const p=v=>{if(v.type!==a.type)return!1;const x=l.extensionManager.attributes.filter(T=>T.type===v.type.name),b=yM(v,x);return Object.keys(d).forEach(T=>{!i.has(T)&&!(T in b)&&u.removeAttribute(T)}),Object.entries(b).forEach(([T,k])=>{i.has(T)||(k!=null?u.setAttribute(T,k):u.removeAttribute(T))}),f(b.src),d=b,!0},g=new Iwt({element:u,editor:l,node:a,getPos:s,onResize:(v,x)=>{u.style.width=`${v}px`,u.style.height=`${x}px`},onCommit:(v,x)=>{const b=s();b!==void 0&&this.editor.chain().setNodeSelection(b).updateAttributes(this.name,{width:v,height:x}).run()},onUpdate:p,options:{directions:t,min:{width:e,height:r},preserveAspectRatio:n===!0}}),m=g.dom,y=()=>{m.style.visibility="",m.style.pointerEvents=""};return m.style.visibility="hidden",m.style.pointerEvents="none",u.complete&&u.naturalWidth>0?y():(u.onload=y,u.onerror=y),g}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[O6e({find:$wt,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}});var Dwt=Nwt;const Owt="listItem",$ce="textStyle",Nce=/^\s*([-+*])\s$/,B6e=Ti.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Owt,this.editor.getAttributes($ce)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=FT({find:Nce,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=FT({find:Nce,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes($ce),editor:this.editor})),[t]}}),Pwt=(t,e,r)=>{const{selection:n}=t;if(!n.empty)return null;const{$from:i}=n;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){a=p;break}if(a<0)return null;const s=i.node(a),o=i.index(a);if(o+1>=s.childCount)return null;const l=s.child(o+1);if(!r.includes(l.type.name))return null;const u=t.schema.nodes[e];let h=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(h=!0)}),!h)return null;const d=t.doc.resolve(i.after()).nodeAfter;if(!d||!r.includes(d.type.name))return null;const f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},Bwt=(t,e,r,n)=>{const i=Pwt(t,r,n);if(!i)return!1;const{selection:a}=t,{nestedList:s,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+s.nodeSize);const d=h.mapping.map(l);return h.insert(d,Rt.from(u)),h.setSelection(a.map(h.doc,h.mapping)),e&&e(h),!0},Fwt=(t,e,r)=>Bwt(t.state,t.view.dispatch,e,r),F6e=(t,e)=>Ki.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>Fwt(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),z6e=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],lA="abcdefghijklmnopqrstuvwxyz",H6e=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function J$(t){let e=t,r="";for(const[n,i]of z6e)for(;e>=n;)r+=i,e-=n;return r}function HZ(t){return J$(t).toUpperCase()}function V6e(t){const e=t.toLowerCase();let r=0,n=0;for(;r0?n:1}const r=parseInt(t,10);return Number.isNaN(r)?1:r}function Vwt(t,e){if(t==="numeric")return String(e);switch(t){case"a":return vM(e);case"A":return vM(e).toUpperCase();case"i":return J$(e);case"I":return HZ(e);default:return String(e)}}function Wwt(t){var e;if(t.length===0)return!1;const r=(e=eN(t[0]))!==null&&e!==void 0?e:"numeric",n=VZ(t[0]);if(n<1)return!1;for(let i=0;i{var r;if(t.type!=="list_item")return[];const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(Ywt(t))return{type:"listItem",content:[{type:"paragraph",content:jwt(t.text||"",e)}]};if(t.tokens.some(a=>a.type==="paragraph"))i=n(t.tokens);else{const a=t.tokens[0];if(a&&a.type==="text"&&a.tokens&&a.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(a.tokens)}],t.tokens.length>1){const s=n(t.tokens.slice(1));i.push(...s)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>L6e(t,e,n=>{if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){var i,a;const s=((i=n.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return Uwt((a=n.meta)===null||a===void 0||(a=a.parentAttrs)===null||a===void 0?void 0:a.type,s-1+(n.index||0),". ")}return"- "},r,{alignNestedToPrefix:(r==null?void 0:r.parentType)==="orderedList"}),addExtensions(){return[F6e(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),WZ=(t,e)=>{const{$from:r}=e.selection,n=Os(t,e.schema);let i=null,a=r.depth,s=r.pos,o=null;for(;a>0&&o===null;)i=r.node(a),i.type===n?o=a:(a-=1,s-=1);return o===null?null:{$pos:e.doc.resolve(s),depth:o}},q6e=(t,e)=>{const r=WZ(t,e);if(!r)return!1;const[,n]=Z4t(e,t,r.$pos.pos+4);return n},Xwt=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),a=t.doc.resolve(i).node();return!(!a||!r.includes(a.type.name))},Dce=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Q1(t.state,e)&&Xwt(t.state,e,r)){const{$anchor:a}=t.state.selection,s=t.state.doc.resolve(a.before()-1),o=[];s.node().descendants((h,d)=>{h.type.name===e&&o.push({node:h,pos:d})});const l=o.at(-1);if(!l)return!1;const u=t.state.doc.resolve(s.start()+l.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!Q1(t.state,e)||!twt(t.state))return!1;const{$from:n}=t.state.selection,i=n.depth-1;return n.node(i).type!==t.schema.nodes[e]||n.index(i)!==0?!1:t.chain().liftListItem(e).run()},Kwt=(t,e)=>{const r=q6e(t,e),n=WZ(t,e);return!n||!r?!1:r>n.depth},Zwt=(t,e)=>{const r=q6e(t,e),n=WZ(t,e);return!n||!r?!1:r{if(!Q1(t.state,e)||!ewt(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:Kwt(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Zwt(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Qwt=(t,e,r)=>{const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Q1(n,e))return!1;const s=Q4t(a);if(!s||!r.includes(s.type.name))return!1;const o=s.lastChild;if(!o||o.type.name!==e)return!1;const l=a.parent;if(!o.canReplace(o.childCount,o.childCount,Rt.from(l)))return!1;const u=a.before(),h=a.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,h).insert(d,Rt.from(l)),f.setSelection(wr.create(f.doc,d+1)),f.scrollIntoView()),!0))},G6e=Ki.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Oce(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Oce(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Dce(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Dce(t,r,n)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:r}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&Qwt(t,e,r))return!0;return!1}}}}),QW=new RegExp(`^(\\s*)(${H6e})([.)])\\s+(.*)$`),Jwt=/^\s/,u2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function eTt(t){return QW.test(t.trimStart())}function tTt(t){const e=t.trimStart();return u2.bulletItem.test(e)||eTt(e)||u2.heading.test(e)||u2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||u2.codeFence.test(e)||u2.blockMath.test(e)}function rTt(t){return Object.values(u2).some(e=>e.test(t))}function nTt(t){const e=[],r=[];let n=!1;return t.forEach(i=>{if(n){r.push(i);return}if(i.trim()===""){n=!0,r.push(i);return}if(e.length>0&&tTt(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function iTt(t){const e=[];let r=0,n=0;for(;r{var a,s,o;if((a=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(o=s.filterTransaction)===null||o===void 0?void 0:o.call(s,t))!==null&&a!==void 0?a:t.getMeta("y-sync$"))return;const l=R6e(t.before,[t,...e]);zZ(l).forEach(h=>{l.mapping.mapResult(h.oldRange.from).deletedAfter&&l.mapping.mapResult(h.oldRange.to).deletedBefore&&l.before.nodesBetween(h.oldRange.from,h.oldRange.to,(d,f)=>{const p=f+d.nodeSize-2,g=h.oldRange.from<=f&&p<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:d,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:h.oldRange,newRange:h.newRange,partial:!g,editor:this.editor,transaction:t,combinedTransform:l})})});const u=l.mapping;l.steps.forEach((h,d)=>{if(h instanceof Hu){var f,p;const g=u.slice(d).map(h.from,-1),m=u.slice(d).map(h.to),y=u.invert().map(g,-1),v=u.invert().map(m),x=g>0?(f=l.doc.nodeAt(g-1))===null||f===void 0?void 0:f.marks.some(T=>T.eq(h.mark)):!1,b=(p=l.doc.nodeAt(m))===null||p===void 0?void 0:p.marks.some(T=>T.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:v},newRange:{from:g,to:m},partial:!!(b||x),editor:this.editor,transaction:t,combinedTransform:l})}})};!((r=(n=this.editor.options.coreExtensionOptions)===null||n===void 0||(n=n.delete)===null||n===void 0?void 0:n.async)!==null&&r!==void 0)||r?setTimeout(i,0):i()}});Ki.create({name:"drop",addProseMirrorPlugins(){return[new da({key:new fa("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}});Ki.create({name:"editable",addProseMirrorPlugins(){return[new da({key:new fa("editable"),props:{editable:()=>this.editor.options.editable}})]}});const $wt=new fa("focusEvents");Ki.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new da({key:$wt,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});Ki.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:o})=>{const{selection:l,doc:u}=o,{empty:h,$anchor:d}=l,{pos:f,parent:p}=d,g=d.parent.isTextblock&&f>0?o.doc.resolve(f-1):d,m=g.parent.type.spec.isolating,y=d.pos-d.parentOffset,v=m&&g.parent.childCount===1?y===d.pos:sn.atStart(u).from===f;return!h||!p.type.isTextblock||p.textContent.length||!v||v&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},a={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return yM()||E6e()?a:i},addProseMirrorPlugins(){return[new da({key:new fa("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(p=>p.getMeta("composition")))return;const n=t.some(p=>p.docChanged)&&!e.doc.eq(r.doc),i=t.some(p=>p.getMeta("preventClearDocument"));if(!n||i)return;const{empty:a,from:s,to:o}=e.selection,l=sn.atStart(e.doc).from,u=sn.atEnd(e.doc).to;if(a||!(s===l&&o===u)||!eN(r.doc))return;const h=r.tr,d=y6e({state:r,transaction:h}),{commands:f}=new Wxt({editor:this.editor,state:d});if(f.clearNodes(),!!h.steps.length)return h}})]}});Ki.create({name:"paste",addProseMirrorPlugins(){return[new da({key:new fa("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}});Ki.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new da({key:new fa("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}});Ki.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=J$(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const r=e.getAttribute("dir");return r&&(r==="ltr"||r==="rtl"||r==="auto")?r:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new da({key:new fa("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}});function J1(t){return new CE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=ei(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:a}=e,s=n[n.length-1],o=n[0];if(s){const l=o.search(/\S/),u=r.from+o.indexOf(s),h=u+s.length;if(HZ(r.from,r.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;hr.from&&a.delete(r.from+l,u);const d=r.from+l+s.length;a.addMark(r.from+l,d,t.type.create(i||{})),a.removeStoredMark(t.type)}},undoable:t.undoable})}function P6e(t){return new CE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=ei(t.getAttributes,void 0,n)||{},{tr:a}=e,s=r.from;let o=r.to;const l=t.type.create(i);if(n[1]){let u=s+n[0].lastIndexOf(n[1]);u>o?u=o:o=u+n[1].length;const h=n[0][n[0].length-1];a.insertText(h,s+n[0].length-1),a.replaceWith(u,o,l)}else if(n[0]){const u=t.type.isInline?s:s-1;a.insert(u,t.type.create(i)).delete(a.mapping.map(s),a.mapping.map(o))}a.scrollIntoView()},undoable:t.undoable})}function JW(t){return new CE({find:t.find,handler:({state:e,range:r,match:n})=>{const i=e.doc.resolve(r.from),a=ei(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)},undoable:t.undoable})}function FT(t){return new CE({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const a=ei(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),o=s.doc.resolve(r.from).blockRange(),l=o&&kZ(o,t.type,a);if(!l)return null;if(s.wrap(o,l),t.keepMarks&&t.editor){const{selection:h,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,p=d||h.$to.parentOffset&&h.$from.marks();if(p){const g=p.filter(m=>f.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,a).run()}const u=s.doc.resolve(r.from-1).nodeBefore;u&&u.type===t.type&&gg(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,u))&&s.join(r.from-1)},undoable:t.undoable})}const Nwt=t=>"touches"in t;var Dwt=class{constructor(t){var e,r,n,i,a,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.touches[0];if(!l)return;const u=l.clientX-this.startX,h=l.clientY-this.startY;this.handleResize(u,h)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(o,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)},this.node=t.node,this.editor=t.editor,this.element=t.element,this.element.draggable=!1,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,!((e=t.options)===null||e===void 0)&&e.min&&(this.minSize={...this.minSize,...t.options.min}),!((r=t.options)===null||r===void 0)&&r.max&&(this.maxSize=t.options.max),!(t==null||(n=t.options)===null||n===void 0)&&n.directions&&(this.directions=t.options.directions),!((i=t.options)===null||i===void 0)&&i.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),!((a=t.options)===null||a===void 0)&&a.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),!((s=t.options)===null||s===void 0)&&s.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!==null&&t!==void 0?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,r){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,r):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const r=e.includes("top"),n=e.includes("bottom"),i=e.includes("left"),a=e.includes("right");r&&(t.style.top="0"),n&&(t.style.bottom="0"),i&&(t.style.left="0"),a&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",r=>this.handleResizeStart(r,t)),e.addEventListener("touchstart",r=>this.handleResizeStart(r,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Nwt(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const r=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),a=this.applyConstraints(n,i,r);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(t,e,r){let n=this.startWidth,i=this.startHeight;const a=t.includes("right"),s=t.includes("left"),o=t.includes("bottom"),l=t.includes("top");return a?n=this.startWidth+e:s&&(n=this.startWidth-e),o?i=this.startHeight+r:l&&(i=this.startHeight-r),(t==="right"||t==="left")&&(n=this.startWidth+(a?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(o?r:-r)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,i,t):{width:n,height:i}}applyConstraints(t,e,r){var n,i;if(!r){var a,s;let u=Math.max(this.minSize.width,t),h=Math.max(this.minSize.height,e);return!((a=this.maxSize)===null||a===void 0)&&a.width&&(u=Math.min(this.maxSize.width,u)),!((s=this.maxSize)===null||s===void 0)&&s.height&&(h=Math.min(this.maxSize.height,h)),{width:u,height:h}}let o=t,l=e;return othis.maxSize.width&&(o=this.maxSize.width,l=o/this.aspectRatio),!((i=this.maxSize)===null||i===void 0)&&i.height&&l>this.maxSize.height&&(l=this.maxSize.height,o=l*this.aspectRatio),{width:o,height:l}}applyAspectRatio(t,e,r){const n=r==="left"||r==="right",i=r==="top"||r==="bottom";return n?{width:t,height:t/this.aspectRatio}:i?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}},Ti=class B6e extends VZ{constructor(...e){super(...e),this.type="node"}static create(e={}){const r=typeof e=="function"?e():e;return new B6e(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};function Gp(t){return new D6e({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const a=ei(t.getAttributes,void 0,n,i);if(a===!1||a===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let u=r.to;if(o){const h=l.search(/\S/),d=r.from+l.indexOf(o),f=d+o.length;if(HZ(r.from,r.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;fr.from&&s.delete(r.from+h,d),u=r.from+h+o.length,s.addMark(r.from+h,u,t.type.create(a||{})),n.index!==void 0&&n.input!==void 0&&n.index+n[0].length>=n.input.length||s.removeStoredMark(t.type)}}})}const Owt=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Pwt=Ti.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Wn(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,r,n,i,a,s;const o=(e=(r=t.attrs)===null||r===void 0?void 0:r.src)!==null&&e!==void 0?e:"",l=(n=(i=t.attrs)===null||i===void 0?void 0:i.alt)!==null&&n!==void 0?n:"",u=(a=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&a!==void 0?a:"";return u?`![${l}](${o} "${u}")`:`![${l}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize,i=new Set(["src","width","height"]);return({node:a,getPos:s,HTMLAttributes:o,editor:l})=>{const u=document.createElement("img");u.draggable=!1;const h=Wn(this.options.HTMLAttributes,o);Object.entries(h).forEach(([v,x])=>{if(x!=null)switch(v){case"src":case"width":case"height":break;default:u.setAttribute(v,x)}}),h.src!==null&&(u.src=h.src);let d={...o};const f=v=>{if(typeof v=="string"&&v!==""){u.getAttribute("src")!==v&&(u.src=v);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};f(o.src);const p=v=>{if(v.type!==a.type)return!1;const x=l.extensionManager.attributes.filter(T=>T.type===v.type.name),b=vM(v,x);return Object.keys(d).forEach(T=>{!i.has(T)&&!(T in b)&&u.removeAttribute(T)}),Object.entries(b).forEach(([T,k])=>{i.has(T)||(k!=null?u.setAttribute(T,k):u.removeAttribute(T))}),f(b.src),d=b,!0},g=new Dwt({element:u,editor:l,node:a,getPos:s,onResize:(v,x)=>{u.style.width=`${v}px`,u.style.height=`${x}px`},onCommit:(v,x)=>{const b=s();b!==void 0&&this.editor.chain().setNodeSelection(b).updateAttributes(this.name,{width:v,height:x}).run()},onUpdate:p,options:{directions:t,min:{width:e,height:r},preserveAspectRatio:n===!0}}),m=g.dom,y=()=>{m.style.visibility="",m.style.pointerEvents=""};return m.style.visibility="hidden",m.style.pointerEvents="none",u.complete&&u.naturalWidth>0?y():(u.onload=y,u.onerror=y),g}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[P6e({find:Owt,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}});var Bwt=Pwt;const Fwt="listItem",Dce="textStyle",Oce=/^\s*([-+*])\s$/,F6e=Ti.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Fwt,this.editor.getAttributes(Dce)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=FT({find:Oce,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=FT({find:Oce,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Dce),editor:this.editor})),[t]}}),zwt=(t,e,r)=>{const{selection:n}=t;if(!n.empty)return null;const{$from:i}=n;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){a=p;break}if(a<0)return null;const s=i.node(a),o=i.index(a);if(o+1>=s.childCount)return null;const l=s.child(o+1);if(!r.includes(l.type.name))return null;const u=t.schema.nodes[e];let h=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(h=!0)}),!h)return null;const d=t.doc.resolve(i.after()).nodeAfter;if(!d||!r.includes(d.type.name))return null;const f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},Hwt=(t,e,r,n)=>{const i=zwt(t,r,n);if(!i)return!1;const{selection:a}=t,{nestedList:s,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+s.nodeSize);const d=h.mapping.map(l);return h.insert(d,Rt.from(u)),h.setSelection(a.map(h.doc,h.mapping)),e&&e(h),!0},Vwt=(t,e,r)=>Hwt(t.state,t.view.dispatch,e,r),z6e=(t,e)=>Ki.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>Vwt(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),H6e=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],cA="abcdefghijklmnopqrstuvwxyz",V6e=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function tN(t){let e=t,r="";for(const[n,i]of H6e)for(;e>=n;)r+=i,e-=n;return r}function WZ(t){return tN(t).toUpperCase()}function W6e(t){const e=t.toLowerCase();let r=0,n=0;for(;r0?n:1}const r=parseInt(t,10);return Number.isNaN(r)?1:r}function Gwt(t,e){if(t==="numeric")return String(e);switch(t){case"a":return bM(e);case"A":return bM(e).toUpperCase();case"i":return tN(e);case"I":return WZ(e);default:return String(e)}}function Uwt(t){var e;if(t.length===0)return!1;const r=(e=rN(t[0]))!==null&&e!==void 0?e:"numeric",n=qZ(t[0]);if(n<1)return!1;for(let i=0;i{var r;if(t.type!=="list_item")return[];const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(Kwt(t))return{type:"listItem",content:[{type:"paragraph",content:Zwt(t.text||"",e)}]};if(t.tokens.some(a=>a.type==="paragraph"))i=n(t.tokens);else{const a=t.tokens[0];if(a&&a.type==="text"&&a.tokens&&a.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(a.tokens)}],t.tokens.length>1){const s=n(t.tokens.slice(1));i.push(...s)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>I6e(t,e,n=>{if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){var i,a;const s=((i=n.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return Xwt((a=n.meta)===null||a===void 0||(a=a.parentAttrs)===null||a===void 0?void 0:a.type,s-1+(n.index||0),". ")}return"- "},r,{alignNestedToPrefix:(r==null?void 0:r.parentType)==="orderedList"}),addExtensions(){return[z6e(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),GZ=(t,e)=>{const{$from:r}=e.selection,n=Os(t,e.schema);let i=null,a=r.depth,s=r.pos,o=null;for(;a>0&&o===null;)i=r.node(a),i.type===n?o=a:(a-=1,s-=1);return o===null?null:{$pos:e.doc.resolve(s),depth:o}},G6e=(t,e)=>{const r=GZ(t,e);if(!r)return!1;const[,n]=ewt(e,t,r.$pos.pos+4);return n},Qwt=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),a=t.doc.resolve(i).node();return!(!a||!r.includes(a.type.name))},Pce=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Q1(t.state,e)&&Qwt(t.state,e,r)){const{$anchor:a}=t.state.selection,s=t.state.doc.resolve(a.before()-1),o=[];s.node().descendants((h,d)=>{h.type.name===e&&o.push({node:h,pos:d})});const l=o.at(-1);if(!l)return!1;const u=t.state.doc.resolve(s.start()+l.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!Q1(t.state,e)||!iwt(t.state))return!1;const{$from:n}=t.state.selection,i=n.depth-1;return n.node(i).type!==t.schema.nodes[e]||n.index(i)!==0?!1:t.chain().liftListItem(e).run()},Jwt=(t,e)=>{const r=G6e(t,e),n=GZ(t,e);return!n||!r?!1:r>n.depth},eTt=(t,e)=>{const r=G6e(t,e),n=GZ(t,e);return!n||!r?!1:r{if(!Q1(t.state,e)||!nwt(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:Jwt(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():eTt(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},tTt=(t,e,r)=>{const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Q1(n,e))return!1;const s=twt(a);if(!s||!r.includes(s.type.name))return!1;const o=s.lastChild;if(!o||o.type.name!==e)return!1;const l=a.parent;if(!o.canReplace(o.childCount,o.childCount,Rt.from(l)))return!1;const u=a.before(),h=a.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,h).insert(d,Rt.from(l)),f.setSelection(Tr.create(f.doc,d+1)),f.scrollIntoView()),!0))},U6e=Ki.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Bce(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Bce(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Pce(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Pce(t,r,n)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:r}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&tTt(t,e,r))return!0;return!1}}}}),eq=new RegExp(`^(\\s*)(${V6e})([.)])\\s+(.*)$`),rTt=/^\s/,u2={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function nTt(t){return eq.test(t.trimStart())}function iTt(t){const e=t.trimStart();return u2.bulletItem.test(e)||nTt(e)||u2.heading.test(e)||u2.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||u2.codeFence.test(e)||u2.blockMath.test(e)}function aTt(t){return Object.values(u2).some(e=>e.test(t))}function sTt(t){const e=[],r=[];let n=!1;return t.forEach(i=>{if(n){r.push(i);return}if(i.trim()===""){n=!0,r.push(i);return}if(e.length>0&&iTt(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function oTt(t){const e=[];let r=0,n=0;for(;rn.trim().length>0);if(e.length===0)return null;const r=[];for(const n of e){const i=n.trim().match(aTt);if(!i)return null;r.push({marker:i[1],content:i[3]})}return Wwt(r.map(n=>n.marker))?{type:"orderedList",attrs:Gwt(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function U6e(t,e,r){const n=[];let i=0;for(;in.trim().length>0);if(e.length===0)return null;const r=[];for(const n of e){const i=n.trim().match(lTt);if(!i)return null;r.push({marker:i[1],content:i[3]})}return Uwt(r.map(n=>n.marker))?{type:"orderedList",attrs:jwt(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function Y6e(t,e,r){const n=[];let i=0;for(;ie;)f.push(t[d]),d+=1;if(f.length>0){const p=U6e(f,Math.min(...f.map(g=>g.indent)),r);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(g=>g.raw).join(` -`)})}n.push({type:"list_item",raw:a.raw,tokens:u}),i=d}else i+=1}return n}function oTt(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const a=e.parseChildren([i]);n.push({type:"paragraph",content:a})}else{const a=e.parseChildren([i]);a.length>0&&n.push(...a)}}),{type:"listItem",content:n}})}const lTt="listItem",Pce="textStyle",Bce=/^(\d+)\.\s$/;function Fce(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const Y6e=Ti.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const r=t.getAttribute("style");if(r){const i=Fce(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const a=Fce(i);if(a)return a}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=Wn(this.options.HTMLAttributes,n);return e!==1&&(i.start=e),r&&r!=="1"&&(i.type=r),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.typeMarker,i=t.items?oTt(t.items,e):[],a={};return r!==1&&(a.start=r),n&&(a.type=n),Object.keys(a).length>0?{type:"orderedList",attrs:a,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`).trim();if(h){const p=r.blockTokens(h);u.push(...p)}let d=i+1;const f=[];for(;de;)f.push(t[d]),d+=1;if(f.length>0){const p=Y6e(f,Math.min(...f.map(g=>g.indent)),r);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(g=>g.raw).join(` +`)})}n.push({type:"list_item",raw:a.raw,tokens:u}),i=d}else i+=1}return n}function uTt(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const a=e.parseChildren([i]);n.push({type:"paragraph",content:a})}else{const a=e.parseChildren([i]);a.length>0&&n.push(...a)}}),{type:"listItem",content:n}})}const hTt="listItem",Fce="textStyle",zce=/^(\d+)\.\s$/;function Hce(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const j6e=Ti.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const r=t.getAttribute("style");if(r){const i=Hce(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const a=Hce(i);if(a)return a}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=Wn(this.options.HTMLAttributes,n);return e!==1&&(i.start=e),r&&r!=="1"&&(i.type=r),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.typeMarker,i=t.items?uTt(t.items,e):[],a={};return r!==1&&(a.start=r),n&&(a.type=n),Object.keys(a).length>0?{type:"orderedList",attrs:a,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,r)=>{var n,i;const a=t.split(` -`),[s,o]=iTt(a);if(s.length===0)return;const l=U6e(s,s[0].indent,r);if(l.length!==0)return{type:"list",ordered:!0,start:((n=s[0])===null||n===void 0?void 0:n.number)||1,typeMarker:(i=s[0])===null||i===void 0?void 0:i.type,items:l,raw:a.slice(0,o).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(lTt,this.editor.getAttributes(Pce)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new da({props:{handlePaste:(t,e)=>{var r,n;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/html");if(i!=null&&i.trim())return!1;const a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a)return!1;const s=sTt(a);if(!s)return!1;try{const o=t.state.schema.nodeFromJSON(s),l=t.state.tr.replaceSelectionWith(o);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(r,n)=>(!n.attrs.type||n.attrs.type==="1")&&n.childCount+n.attrs.start===+r[1];let e=FT({find:Bce,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=FT({find:Bce,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(Pce)}),joinPredicate:t,editor:this.editor})),[e]}}),cTt=/^\s*(\[([( |x])?\])\s$/,uTt="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",hTt=(t,e,r)=>{var n;return(r==null||(n=r.checkboxLabel)===null||n===void 0?void 0:n.call(r,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},j6e=Ti.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Wn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const n=`- [${!((r=t.attrs)===null||r===void 0)&&r.checked?"x":" "}] `;return L6e(t,e,n)},addExtensions(){return this.options.nested?[F6e(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),a=document.createElement("label"),s=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div");s.style.cssText=uTt;const u=d=>{const f=hTt(d,d.attrs.checked,this.options.a11y);o.setAttribute("aria-label",f),s.textContent=f};u(t),a.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",d=>d.preventDefault()),o.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=r();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,a.append(o,s),i.append(a,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,o.checked=d.attrs.checked,u(d);const f=n.extensionManager.attributes,p=yM(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(y=>{g.has(y)||(y in m?i.setAttribute(y,m[y]):i.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?i.setAttribute(y,m[y]):i.removeAttribute(y):i.setAttribute(y,v)}),h=g,!0}}}},addInputRules(){return[FT({find:cTt,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),X6e=Ti.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=a=>{const s=_ce(a,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:n},r);if(s){const o={type:"taskList",raw:s.raw,items:s.items},l=a.slice(s.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(a)},i=_ce(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,s)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:r.inlineTokens(a.mainContent),nestedTokens:s}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ki.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(B6e.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(W6e.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(G6e.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Y6e.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(j6e.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(X6e.configure(this.options.taskList)),t}});let JW,eq;if(typeof WeakMap<"u"){let t=new WeakMap;JW=e=>t.get(e),eq=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;JW=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Sa=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e=r){(a||(a=[])).push({type:"overlong_rowspan",pos:h,n:v-b});break}const T=i+b*e;for(let k=0;kn&&(a+=u.attrs.colspan)}}for(let s=0;s1&&(r=!0)}e==-1?e=a:e!=a&&(e=Math.max(e,a))}return e}function pTt(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function mTt(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function uh(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function tN(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=ey(e.$head)||yTt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function yTt(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function tq(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function vTt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function K6e(t,e,r){const n=t.node(-1),i=Sa.get(n),a=t.start(-1),s=i.nextCell(t.pos-a,e,r);return s==null?null:t.node(0).resolve(a+s)}function ty(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function Z6e(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;ih!=r.pos-a);l.unshift(r.pos-a);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=a+h+1;return new ESe(o.resolve(f),o.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(tq(n)&&tq(i)&&qZ(n,i)){const a=this.$anchorCell.node(-1)!=n.node(-1);return a&&this.isRowSelection()?tf.rowSelection(n,i):a&&this.isColSelection()?tf.colSelection(n,i):new tf(n,i)}return wr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Sa.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),a={},s=[];for(let l=i.top;l0||y>0){let v=g.attrs;if(m>0&&(v=ty(v,0,m)),y>0&&(v=ty(v,v.colspan-y,y)),p.lefti.bottom){const v={...g.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Sa.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.top<=o.top?(s.top>0&&(e=l.resolve(a+i.map[s.left])),o.bottom0&&(r=l.resolve(a+i.map[o.left])),s.bottom0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,o=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,o)==r.width}eq(e){return e instanceof tf&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Sa.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.left<=o.left?(s.left>0&&(e=l.resolve(a+i.map[s.top*i.width])),o.right0&&(r=l.resolve(a+i.map[o.top*i.width])),s.right{e.push(Eo.node(n,n+r.nodeSize,{class:"selectedCell"}))}),pi.create(t.doc,e)}function TTt({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(a+1)>e.start(a));a--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function kTt({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const a=t.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){r=a;break}}for(let i=e.depth;i>0;i--){const a=e.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}return r!==n&&e.parentOffset===0}function CTt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let a,s;if(n instanceof Ir&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")a=Li.create(i,n.from);else if(s=="row"){const o=i.resolve(n.from+1);a=Li.rowSelection(o,o)}else if(!r){const o=Sa.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];a=Li.create(i,l+1,u)}}else n instanceof wr&&TTt(n)?a=wr.create(i,n.from):n instanceof wr&&kTt(n)&&(a=wr.create(i,n.$from.start(),n.$from.end()));return a&&(e||(e=t.tr)).setSelection(a),e}const STt=new fa("fix-tables");function J6e(t,e,r,n){const i=t.childCount,a=e.childCount;e:for(let s=0,o=0;s{i.type.spec.tableRole=="table"&&(r=ETt(t,i,a,r))};return e?e.doc!=t.doc&&J6e(e.doc,t.doc,0,n):t.doc.descendants(n),r}function ETt(t,e,r,n){const i=Sa.get(e);if(!i.problems)return n;n||(n=t.tr);const a=[];for(let l=0;l0){let p="cell";h.firstChild&&(p=h.firstChild.type.spec.tableRole);const g=[];for(let y=0;y0?-1:0;bTt(e,n,i+a)&&(a=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[o-1]==l||i0?-1:0;LTt(e,n,i+o)&&(o=i==0||i==e.height?null:0);for(let u=0,h=e.width*i;u0&&i0&&d==e.map[h-e.width]){const f=r.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i0&&r[a]==r[a-1]||n.right0&&r[i]==r[i-t]||n.bottom0){const h=l+1+u.content.size,d=zce(u)?l+1:h;a.replaceWith(d+n.tableStart,h+n.tableStart,o)}a.setSelection(new Li(a.doc.resolve(l+n.tableStart))),e(a)}return!0}function Vce(t,e){const r=Io(t.schema);return PTt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function PTt(t){return(e,r)=>{const n=e.selection;let i,a;if(n instanceof Li){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,a=n.$anchorCell.pos}else{var s;if(i=mTt(n.$from),!i)return!1;a=(s=ey(n.$from))===null||s===void 0?void 0:s.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(r){let o=i.attrs;const l=[],u=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const h=md(e),d=e.tr;for(let p=0;p{s.attrs[t]!==e&&a.setNodeMarkup(o,null,{...s.attrs,[t]:e})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(a)}return!0}}function FTt(t){return function(e,r){if(!uh(e))return!1;if(r){const n=Io(e.schema),i=md(e),a=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),o=s.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=f+a.tableStart,g=s.doc.nodeAt(p);g&&s.setNodeMarkup(p,d,g.attrs)}),n(s)}return!0}}GS("row",{useDeprecatedLogic:!0});GS("column",{useDeprecatedLogic:!0});const zTt=GS("cell",{useDeprecatedLogic:!0});function HTt(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const a=t.node(-1).child(n),s=a.lastChild;if(s)return i-1-s.nodeSize;i-=a.nodeSize}}else{if(t.index()0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function cA(t,e){const r=t.selection;if(!(r instanceof Li))return!1;if(e){const n=t.tr,i=Io(t.schema).cell.createAndFill().content;r.forEachCell((a,s)=>{a.content.eq(i)||n.replace(n.mapping.map(s+1),n.mapping.map(s+a.nodeSize-1),new Jt(i,0,0))}),n.docChanged&&e(n)}return!0}function WTt(t){if(t.size===0)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),a=i.type.spec.tableRole,s=i.type.schema,o=[];if(a=="row")for(let l=0;l=0;s--){const{rowspan:o,colspan:l}=a.child(s).attrs;for(let u=i;u=e.length&&e.push(Rt.empty),r[i]n&&(f=f.type.createChecked(ty(f.attrs,f.attrs.colspan,h+f.attrs.colspan-n),f.content)),u.push(f),h+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}a.push(Rt.from(l))}r=a,e=i}return{width:t,height:e,rows:r}}function UTt(t,e,r,n,i,a,s){const o=t.doc.type.schema,l=Io(o);let u,h;if(i>e.width)for(let d=0,f=0;de.height){const d=[];for(let g=0,m=(e.height-1)*e.width;g=e.width?!1:r.nodeAt(e.map[m+g]).type==l.header_cell;d.push(y?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,Rt.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const a=r.selection;if(a instanceof Li)return uR(r,n,sn.near(a.$headCell,e));if(t!="horiz"&&!a.empty)return!1;const s=nEe(i,t,e);if(s==null)return!1;if(t=="horiz")return uR(r,n,sn.near(r.doc.resolve(a.head+e),e));{const o=r.doc.resolve(s),l=K6e(o,t,e);let u;return l?u=sn.near(l,1):e<0?u=sn.near(r.doc.resolve(o.before(-1)),-1):u=sn.near(r.doc.resolve(o.after(-1)),1),uR(r,n,u)}}}function hA(t,e){return(r,n,i)=>{if(!i)return!1;const a=r.selection;let s;if(a instanceof Li)s=a;else{const l=nEe(i,t,e);if(l==null)return!1;s=new Li(r.doc.resolve(l))}const o=K6e(s.$headCell,t,e);return o?uR(r,n,new Li(s.$anchorCell,o)):!1}}function jTt(t,e){const r=t.state.doc,n=ey(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Li(n))),!0):!1}function XTt(t,e,r){if(!uh(t.state))return!1;let n=WTt(r);const i=t.state.selection;if(i instanceof Li){n||(n={width:1,height:1,rows:[Rt.from(rq(Io(t.state.schema).cell,r))]});const a=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),o=Sa.get(a).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=GTt(n,o.right-o.left,o.bottom-o.top),Yce(t.state,t.dispatch,s,o,n),!0}else if(n){const a=tN(t.state),s=a.start(-1);return Yce(t.state,t.dispatch,s,Sa.get(a.node(-1)).findCell(a.pos-s),n),!0}else return!1}function KTt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=jce(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Li)a(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=ey(t.state.selection.$anchor))!=null&&((r=oB(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)a(i,e),e.preventDefault();else if(!n)return;function a(l,u){let h=oB(t,u);const d=up.getState(t.state)==null;if(!h||!qZ(l,h))if(d)h=l;else return;const f=new Li(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(up,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),up.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(up,-1))}function o(l){const u=l,h=up.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(jce(t,u.target)!=n&&(d=oB(t,e),!d))return s();d&&a(d,u)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",o)}function nEe(t,e,r){if(!(t.state.selection instanceof wr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const a=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const s=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?s:null}}return null}function jce(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function oB(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return null;let{inside:n,pos:i}=r;return n>=0&&ey(t.state.doc.resolve(n))||ey(t.state.doc.resolve(i))}var ZTt=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),nq(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,nq(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function nq(t,e,r,n,i,a){let s=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;dnew n(d,r,f)),new JTt(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes:s=>{const o=gc.getState(s);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,o)=>{e3t(s,o,t,i)},mouseleave:s=>{t3t(s)},mousedown:(s,o)=>{r3t(s,o,e,r)}},decorations:s=>{const o=gc.getState(s);if(o&&o.activeHandle>-1)return o3t(s,o.activeHandle)},nodeViews:{}}});return a}var JTt=class hR{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(gc);if(n&&n.setHandle!=null)return new hR(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new hR(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return tq(e.doc.resolve(i))||(i=-1),new hR(i,r.dragging)}return r}};function e3t(t,e,r,n){if(!t.editable)return;const i=gc.getState(t.state);if(i&&!i.dragging){const a=i3t(e.target);let s=-1;if(a){const{left:o,right:l}=a.getBoundingClientRect();e.clientX-o<=r?s=Xce(t,e,"left",r):l-e.clientX<=r&&(s=Xce(t,e,"right",r))}if(s!=i.activeHandle){if(!n&&s!==-1){const o=t.state.doc.resolve(s),l=o.node(-1),u=Sa.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}iEe(t,s)}}}function t3t(t){if(!t.editable)return;const e=gc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&iEe(t,-1)}function r3t(t,e,r,n){var i;if(!t.editable)return!1;const a=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,s=gc.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const o=t.state.doc.nodeAt(s.activeHandle),l=n3t(t,s.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(gc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",h);const f=gc.getState(t.state);f!=null&&f.dragging&&(a3t(t,f.activeHandle,Kce(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(gc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=gc.getState(t.state);if(f&&f.dragging){const p=Kce(f.dragging,d,r);Zce(t,f.activeHandle,p,n)}}return Zce(t,s.activeHandle,l,n),a.addEventListener("mouseup",u),a.addEventListener("mousemove",h),e.preventDefault(),!0}function n3t(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const a=t.domAtPos(e);let s=a.node.childNodes[a.offset].offsetWidth,o=r;if(n)for(let l=0;lc3t(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function h3t(t){var e;const r=t.parentElement,n=t.closest("table");if(!r||!n)return null;const i=Array.from(r.children).indexOf(t),a=(e=n.querySelectorAll("colgroup > col")[i])===null||e===void 0?void 0:e.getAttribute("width");return a?[parseInt(a,10)]:null}function sEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):h3t(t)}const d3t=/[ \t\r\n\f]+/g;function oEe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(d3t,"")===""}function lEe(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const f3t=Ti.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:sEe},align:aEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>oEe(t)?{}:!1,getContent:(t,e)=>lEe(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Wn(this.options.HTMLAttributes,t),0]}}),p3t=Ti.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:sEe},align:aEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>oEe(t)?{}:!1,getContent:(t,e)=>lEe(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Wn(this.options.HTMLAttributes,t),0]}}),g3t=Ti.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Wn(this.options.HTMLAttributes,t),0]}});function iq(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Qce(t,e,r,n,i,a){let s=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function b3t(t,e,r,n,i){const a=v3t(t),s=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!x3t(e))return!1;let r=0;const n=qS(e.ranges[0].$from,i=>i.type.name==="table");return n==null||n.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(r+=1)}),r!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function eue(t,e){const r=t.mapping.map(e),n=qS(t.selection.$from,s=>s.type.name==="table");if((n==null?void 0:n.pos)===r)return;const i=t.doc.nodeAt(r);if(!i)return;const a=r+i.nodeSize-1;t.setSelection(wr.near(t.doc.resolve(a),-1))}function w3t(t){let e="",r=0;for(;rl==="|"?"\\|":l)+t.slice(i,i+n),r=i+n,a=!0;break}i+=s}a||(e+=t.slice(r,r+n),r+=n)}return e}function T3t(t){return t.split(` -`).map(e=>!e.includes("|")||!e.includes("`")?e:w3t(e)).join(` -`)}function k3t(t){return(t||"").replace(/\s+/g," ").trim()}function C3t(t,e,r={}){var n;const i=(n=r.cellLineSeparator)!==null&&n!==void 0?n:"";if(!t||!t.content||t.content.length===0)return"";const a=[];t.content.forEach(g=>{const m=[];g.content&&g.content.forEach(y=>{let v="";y.content&&Array.isArray(y.content)&&y.content.length>1?v=y.content.map(k=>e.renderChildren(k)).join(i):v=y.content?e.renderChildren(y.content):"";const x=k3t(v.split(i).join(` -`).replace(/[ \t]*\r?\n[ \t]*/g,"
")),b=y.type==="tableHeader",T=u3t(y.attrs);m.push({text:x,isHeader:b,align:T})}),a.push(m)});const s=a.reduce((g,m)=>Math.max(g,m.length),0);if(s===0)return"";const o=Array.from({length:s}).fill(0);a.forEach(g=>{for(let y=0;yo[y]&&(o[y]=v),o[y]<3&&(o[y]=3)}});const l=(g,m)=>g+" ".repeat(Math.max(0,m-g.length)),u=a[0],h=u.some(g=>g.isHeader),d=Array.from({length:s}).fill(null);a.forEach(g=>{for(let y=0;y({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(hTt,this.editor.getAttributes(Fce)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new da({props:{handlePaste:(t,e)=>{var r,n;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/html");if(i!=null&&i.trim())return!1;const a=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!a)return!1;const s=cTt(a);if(!s)return!1;try{const o=t.state.schema.nodeFromJSON(s),l=t.state.tr.replaceSelectionWith(o);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(r,n)=>(!n.attrs.type||n.attrs.type==="1")&&n.childCount+n.attrs.start===+r[1];let e=FT({find:zce,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=FT({find:zce,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(Fce)}),joinPredicate:t,editor:this.editor})),[e]}}),dTt=/^\s*(\[([( |x])?\])\s$/,fTt="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",pTt=(t,e,r)=>{var n;return(r==null||(n=r.checkboxLabel)===null||n===void 0?void 0:n.call(r,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},X6e=Ti.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Wn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const n=`- [${!((r=t.attrs)===null||r===void 0)&&r.checked?"x":" "}] `;return I6e(t,e,n)},addExtensions(){return this.options.nested?[z6e(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),a=document.createElement("label"),s=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div");s.style.cssText=fTt;const u=d=>{const f=pTt(d,d.attrs.checked,this.options.a11y);o.setAttribute("aria-label",f),s.textContent=f};u(t),a.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",d=>d.preventDefault()),o.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=r();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,a.append(o,s),i.append(a,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,o.checked=d.attrs.checked,u(d);const f=n.extensionManager.attributes,p=vM(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(y=>{g.has(y)||(y in m?i.setAttribute(y,m[y]):i.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?i.setAttribute(y,m[y]):i.removeAttribute(y):i.setAttribute(y,v)}),h=g,!0}}}},addInputRules(){return[FT({find:dTt,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),K6e=Ti.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=a=>{const s=Lce(a,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:n},r);if(s){const o={type:"taskList",raw:s.raw,items:s.items},l=a.slice(s.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(a)},i=Lce(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,s)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:r.inlineTokens(a.mainContent),nestedTokens:s}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ki.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(F6e.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(q6e.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(U6e.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(j6e.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(X6e.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(K6e.configure(this.options.taskList)),t}});let tq,rq;if(typeof WeakMap<"u"){let t=new WeakMap;tq=e=>t.get(e),rq=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;tq=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Sa=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e=r){(a||(a=[])).push({type:"overlong_rowspan",pos:h,n:v-b});break}const T=i+b*e;for(let k=0;kn&&(a+=u.attrs.colspan)}}for(let s=0;s1&&(r=!0)}e==-1?e=a:e!=a&&(e=Math.max(e,a))}return e}function yTt(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function bTt(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function uh(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function nN(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=ey(e.$head)||xTt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function xTt(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function nq(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function wTt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function UZ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Z6e(t,e,r){const n=t.node(-1),i=Sa.get(n),a=t.start(-1),s=i.nextCell(t.pos-a,e,r);return s==null?null:t.node(0).resolve(a+s)}function ty(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function Q6e(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;ih!=r.pos-a);l.unshift(r.pos-a);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=a+h+1;return new ASe(o.resolve(f),o.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(nq(n)&&nq(i)&&UZ(n,i)){const a=this.$anchorCell.node(-1)!=n.node(-1);return a&&this.isRowSelection()?rf.rowSelection(n,i):a&&this.isColSelection()?rf.colSelection(n,i):new rf(n,i)}return Tr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Sa.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),a={},s=[];for(let l=i.top;l0||y>0){let v=g.attrs;if(m>0&&(v=ty(v,0,m)),y>0&&(v=ty(v,v.colspan-y,y)),p.lefti.bottom){const v={...g.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Sa.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.top<=o.top?(s.top>0&&(e=l.resolve(a+i.map[s.left])),o.bottom0&&(r=l.resolve(a+i.map[o.left])),s.bottom0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,o=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,o)==r.width}eq(e){return e instanceof rf&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Sa.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.left<=o.left?(s.left>0&&(e=l.resolve(a+i.map[s.top*i.width])),o.right0&&(r=l.resolve(a+i.map[o.top*i.width])),s.right{e.push(Eo.node(n,n+r.nodeSize,{class:"selectedCell"}))}),pi.create(t.doc,e)}function STt({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(a+1)>e.start(a));a--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function ETt({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const a=t.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){r=a;break}}for(let i=e.depth;i>0;i--){const a=e.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}return r!==n&&e.parentOffset===0}function ATt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let a,s;if(n instanceof Ir&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")a=Li.create(i,n.from);else if(s=="row"){const o=i.resolve(n.from+1);a=Li.rowSelection(o,o)}else if(!r){const o=Sa.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];a=Li.create(i,l+1,u)}}else n instanceof Tr&&STt(n)?a=Tr.create(i,n.from):n instanceof Tr&&ETt(n)&&(a=Tr.create(i,n.$from.start(),n.$from.end()));return a&&(e||(e=t.tr)).setSelection(a),e}const RTt=new fa("fix-tables");function eEe(t,e,r,n){const i=t.childCount,a=e.childCount;e:for(let s=0,o=0;s{i.type.spec.tableRole=="table"&&(r=_Tt(t,i,a,r))};return e?e.doc!=t.doc&&eEe(e.doc,t.doc,0,n):t.doc.descendants(n),r}function _Tt(t,e,r,n){const i=Sa.get(e);if(!i.problems)return n;n||(n=t.tr);const a=[];for(let l=0;l0){let p="cell";h.firstChild&&(p=h.firstChild.type.spec.tableRole);const g=[];for(let y=0;y0?-1:0;TTt(e,n,i+a)&&(a=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[o-1]==l||i0?-1:0;NTt(e,n,i+o)&&(o=i==0||i==e.height?null:0);for(let u=0,h=e.width*i;u0&&i0&&d==e.map[h-e.width]){const f=r.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i0&&r[a]==r[a-1]||n.right0&&r[i]==r[i-t]||n.bottom0){const h=l+1+u.content.size,d=Vce(u)?l+1:h;a.replaceWith(d+n.tableStart,h+n.tableStart,o)}a.setSelection(new Li(a.doc.resolve(l+n.tableStart))),e(a)}return!0}function qce(t,e){const r=Io(t.schema);return zTt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function zTt(t){return(e,r)=>{const n=e.selection;let i,a;if(n instanceof Li){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,a=n.$anchorCell.pos}else{var s;if(i=bTt(n.$from),!i)return!1;a=(s=ey(n.$from))===null||s===void 0?void 0:s.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(r){let o=i.attrs;const l=[],u=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const h=yd(e),d=e.tr;for(let p=0;p{s.attrs[t]!==e&&a.setNodeMarkup(o,null,{...s.attrs,[t]:e})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(a)}return!0}}function VTt(t){return function(e,r){if(!uh(e))return!1;if(r){const n=Io(e.schema),i=yd(e),a=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),o=s.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=f+a.tableStart,g=s.doc.nodeAt(p);g&&s.setNodeMarkup(p,d,g.attrs)}),n(s)}return!0}}GS("row",{useDeprecatedLogic:!0});GS("column",{useDeprecatedLogic:!0});const WTt=GS("cell",{useDeprecatedLogic:!0});function qTt(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const a=t.node(-1).child(n),s=a.lastChild;if(s)return i-1-s.nodeSize;i-=a.nodeSize}}else{if(t.index()0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function uA(t,e){const r=t.selection;if(!(r instanceof Li))return!1;if(e){const n=t.tr,i=Io(t.schema).cell.createAndFill().content;r.forEachCell((a,s)=>{a.content.eq(i)||n.replace(n.mapping.map(s+1),n.mapping.map(s+a.nodeSize-1),new Jt(i,0,0))}),n.docChanged&&e(n)}return!0}function UTt(t){if(t.size===0)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),a=i.type.spec.tableRole,s=i.type.schema,o=[];if(a=="row")for(let l=0;l=0;s--){const{rowspan:o,colspan:l}=a.child(s).attrs;for(let u=i;u=e.length&&e.push(Rt.empty),r[i]n&&(f=f.type.createChecked(ty(f.attrs,f.attrs.colspan,h+f.attrs.colspan-n),f.content)),u.push(f),h+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}a.push(Rt.from(l))}r=a,e=i}return{width:t,height:e,rows:r}}function XTt(t,e,r,n,i,a,s){const o=t.doc.type.schema,l=Io(o);let u,h;if(i>e.width)for(let d=0,f=0;de.height){const d=[];for(let g=0,m=(e.height-1)*e.width;g=e.width?!1:r.nodeAt(e.map[m+g]).type==l.header_cell;d.push(y?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,Rt.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const a=r.selection;if(a instanceof Li)return hR(r,n,sn.near(a.$headCell,e));if(t!="horiz"&&!a.empty)return!1;const s=iEe(i,t,e);if(s==null)return!1;if(t=="horiz")return hR(r,n,sn.near(r.doc.resolve(a.head+e),e));{const o=r.doc.resolve(s),l=Z6e(o,t,e);let u;return l?u=sn.near(l,1):e<0?u=sn.near(r.doc.resolve(o.before(-1)),-1):u=sn.near(r.doc.resolve(o.after(-1)),1),hR(r,n,u)}}}function dA(t,e){return(r,n,i)=>{if(!i)return!1;const a=r.selection;let s;if(a instanceof Li)s=a;else{const l=iEe(i,t,e);if(l==null)return!1;s=new Li(r.doc.resolve(l))}const o=Z6e(s.$headCell,t,e);return o?hR(r,n,new Li(s.$anchorCell,o)):!1}}function ZTt(t,e){const r=t.state.doc,n=ey(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Li(n))),!0):!1}function QTt(t,e,r){if(!uh(t.state))return!1;let n=UTt(r);const i=t.state.selection;if(i instanceof Li){n||(n={width:1,height:1,rows:[Rt.from(iq(Io(t.state.schema).cell,r))]});const a=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),o=Sa.get(a).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=jTt(n,o.right-o.left,o.bottom-o.top),Xce(t.state,t.dispatch,s,o,n),!0}else if(n){const a=nN(t.state),s=a.start(-1);return Xce(t.state,t.dispatch,s,Sa.get(a.node(-1)).findCell(a.pos-s),n),!0}else return!1}function JTt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=Kce(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Li)a(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=ey(t.state.selection.$anchor))!=null&&((r=cB(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)a(i,e),e.preventDefault();else if(!n)return;function a(l,u){let h=cB(t,u);const d=up.getState(t.state)==null;if(!h||!UZ(l,h))if(d)h=l;else return;const f=new Li(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(up,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),up.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(up,-1))}function o(l){const u=l,h=up.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(Kce(t,u.target)!=n&&(d=cB(t,e),!d))return s();d&&a(d,u)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",o)}function iEe(t,e,r){if(!(t.state.selection instanceof Tr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const a=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const s=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?s:null}}return null}function Kce(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function cB(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return null;let{inside:n,pos:i}=r;return n>=0&&ey(t.state.doc.resolve(n))||ey(t.state.doc.resolve(i))}var e3t=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),aq(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,aq(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function aq(t,e,r,n,i,a){let s=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;dnew n(d,r,f)),new r3t(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes:s=>{const o=pc.getState(s);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,o)=>{n3t(s,o,t,i)},mouseleave:s=>{i3t(s)},mousedown:(s,o)=>{a3t(s,o,e,r)}},decorations:s=>{const o=pc.getState(s);if(o&&o.activeHandle>-1)return u3t(s,o.activeHandle)},nodeViews:{}}});return a}var r3t=class dR{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(pc);if(n&&n.setHandle!=null)return new dR(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new dR(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return nq(e.doc.resolve(i))||(i=-1),new dR(i,r.dragging)}return r}};function n3t(t,e,r,n){if(!t.editable)return;const i=pc.getState(t.state);if(i&&!i.dragging){const a=o3t(e.target);let s=-1;if(a){const{left:o,right:l}=a.getBoundingClientRect();e.clientX-o<=r?s=Zce(t,e,"left",r):l-e.clientX<=r&&(s=Zce(t,e,"right",r))}if(s!=i.activeHandle){if(!n&&s!==-1){const o=t.state.doc.resolve(s),l=o.node(-1),u=Sa.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}aEe(t,s)}}}function i3t(t){if(!t.editable)return;const e=pc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&aEe(t,-1)}function a3t(t,e,r,n){var i;if(!t.editable)return!1;const a=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,s=pc.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const o=t.state.doc.nodeAt(s.activeHandle),l=s3t(t,s.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(pc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",h);const f=pc.getState(t.state);f!=null&&f.dragging&&(l3t(t,f.activeHandle,Qce(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(pc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=pc.getState(t.state);if(f&&f.dragging){const p=Qce(f.dragging,d,r);Jce(t,f.activeHandle,p,n)}}return Jce(t,s.activeHandle,l,n),a.addEventListener("mouseup",u),a.addEventListener("mousemove",h),e.preventDefault(),!0}function s3t(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const a=t.domAtPos(e);let s=a.node.childNodes[a.offset].offsetWidth,o=r;if(n)for(let l=0;ld3t(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function p3t(t){var e;const r=t.parentElement,n=t.closest("table");if(!r||!n)return null;const i=Array.from(r.children).indexOf(t),a=(e=n.querySelectorAll("colgroup > col")[i])===null||e===void 0?void 0:e.getAttribute("width");return a?[parseInt(a,10)]:null}function oEe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):p3t(t)}const g3t=/[ \t\r\n\f]+/g;function lEe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(g3t,"")===""}function cEe(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const m3t=Ti.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:oEe},align:sEe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>lEe(t)?{}:!1,getContent:(t,e)=>cEe(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Wn(this.options.HTMLAttributes,t),0]}}),y3t=Ti.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:oEe},align:sEe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>lEe(t)?{}:!1,getContent:(t,e)=>cEe(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Wn(this.options.HTMLAttributes,t),0]}}),v3t=Ti.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Wn(this.options.HTMLAttributes,t),0]}});function sq(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function eue(t,e,r,n,i,a){let s=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function T3t(t,e,r,n,i){const a=w3t(t),s=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!k3t(e))return!1;let r=0;const n=qS(e.ranges[0].$from,i=>i.type.name==="table");return n==null||n.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(r+=1)}),r!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function rue(t,e){const r=t.mapping.map(e),n=qS(t.selection.$from,s=>s.type.name==="table");if((n==null?void 0:n.pos)===r)return;const i=t.doc.nodeAt(r);if(!i)return;const a=r+i.nodeSize-1;t.setSelection(Tr.near(t.doc.resolve(a),-1))}function C3t(t){let e="",r=0;for(;rl==="|"?"\\|":l)+t.slice(i,i+n),r=i+n,a=!0;break}i+=s}a||(e+=t.slice(r,r+n),r+=n)}return e}function S3t(t){return t.split(` +`).map(e=>!e.includes("|")||!e.includes("`")?e:C3t(e)).join(` +`)}function E3t(t){return(t||"").replace(/\s+/g," ").trim()}function A3t(t,e,r={}){var n;const i=(n=r.cellLineSeparator)!==null&&n!==void 0?n:"";if(!t||!t.content||t.content.length===0)return"";const a=[];t.content.forEach(g=>{const m=[];g.content&&g.content.forEach(y=>{let v="";y.content&&Array.isArray(y.content)&&y.content.length>1?v=y.content.map(k=>e.renderChildren(k)).join(i):v=y.content?e.renderChildren(y.content):"";const x=E3t(v.split(i).join(` +`).replace(/[ \t]*\r?\n[ \t]*/g,"
")),b=y.type==="tableHeader",T=f3t(y.attrs);m.push({text:x,isHeader:b,align:T})}),a.push(m)});const s=a.reduce((g,m)=>Math.max(g,m.length),0);if(s===0)return"";const o=Array.from({length:s}).fill(0);a.forEach(g=>{for(let y=0;yo[y]&&(o[y]=v),o[y]<3&&(o[y]=3)}});const l=(g,m)=>g+" ".repeat(Math.max(0,m-g.length)),u=a[0],h=u.some(g=>g.isHeader),d=Array.from({length:s}).fill(null);a.forEach(g=>{for(let y=0;yh&&u[m]&&u[m].text||"");return f+=`| ${p.map((g,m)=>l(g,o[m])).join(" | ")} | `,f+=`| ${o.map((g,m)=>{const y=Math.max(3,g),v=d[m];return v==="left"?`:${"-".repeat(y)}`:v==="right"?`${"-".repeat(y)}:`:v==="center"?`:${"-".repeat(y)}:`:"-".repeat(y)}).join(" | ")} | `,(h?a.slice(1):a).forEach(g=>{f+=`| ${Array.from({length:s}).fill(0).map((m,y)=>l(g[y]&&g[y].text||"",o[y])).join(" | ")} | -`}),f}const S3t=Ti.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:m3t,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}=y3t(t,this.options.cellMinWidth),a=e.style;function s(){return a||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",Wn(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=bM((o=n[s])!==null&&o!==void 0?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=bM((l=n[o])!==null&&l!==void 0?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)=>C3t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` +`}),f}const R3t=Ti.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:b3t,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}=x3t(t,this.options.cellMinWidth),a=e.style;function s(){return a||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",Wn(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=xM((o=n[s])!==null&&o!==void 0?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=xM((l=n[o])!==null&&l!==void 0?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)=>A3t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` `);if(e.length<2)return-1;const r=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(r)||!r.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,r){const n=t.indexOf(` `),i=n>=0?t.slice(0,n):t,a=i.split(` -`);if(a.length<2)return;const s=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;const o=T3t(i);if(o===i)return;const l=r.blockTokens(o)[0];if((l==null?void 0:l.type)!=="table"||!l.raw)return;const u=l.raw.split(` +`);if(a.length<2)return;const s=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;const o=S3t(i);if(o===i)return;const l=r.blockTokens(o)[0];if((l==null?void 0:l.type)!=="table"||!l.raw)return;const u=l.raw.split(` `).length,h=t.split(` `).slice(0,u).join(` -`);return{...l,raw:h}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const s=b3t(a.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(wr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>ATt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>RTt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=qS(t.selection.$from,n=>n.type.name==="table");return MTt(t,e&&(n=>{r&&eue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>ITt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>$Tt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=qS(t.selection.$from,n=>n.type.name==="table");return DTt(t,e&&(n=>{r&&eue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>VTt(t,e),mergeCells:()=>({state:t,dispatch:e})=>Hce(t,e),splitCell:()=>({state:t,dispatch:e})=>Vce(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>GS("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>GS("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>zTt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Hce(t,e)?!0:Vce(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>BTt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>qce(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>qce(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&eEe(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Li.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:dA,"Mod-Backspace":dA,Delete:dA,"Mod-Delete":dA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[QTt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],l3t({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=Wn(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:ei(un(t,"tableRole",e))}}}),E3t=Ki.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(S3t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(f3t.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(p3t.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(g3t.configure(this.options.tableRow)),t}});function GZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $y=GZ();function cEe(t){$y=t}var Rm={exec:()=>null};function $n(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(ol.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var A3t=(()=>{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)}}>`)},R3t=/^(?:[ \t]*(?:\n|$))+/,_3t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,M3t=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,CE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,L3t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,UZ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,uEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hEe=$n(uEe).replace(/bull/g,UZ).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(),I3t=$n(uEe).replace(/bull/g,UZ).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(),YZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$3t=/^[^\n]+/,jZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,N3t=$n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),D3t=$n(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,UZ).getRegex(),rN="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",XZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,O3t=$n("^ {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",XZ).replace("tag",rN).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dEe=$n(YZ).replace("hr",CE).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",rN).getRegex(),P3t=$n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dEe).getRegex(),KZ={blockquote:P3t,code:_3t,def:N3t,fences:M3t,heading:L3t,hr:CE,html:O3t,lheading:hEe,list:D3t,newline:R3t,paragraph:dEe,table:Rm,text:$3t},tue=$n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",CE).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",rN).getRegex(),B3t={...KZ,lheading:I3t,table:tue,paragraph:$n(YZ).replace("hr",CE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tue).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",rN).getRegex()},F3t={...KZ,html:$n(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",XZ).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:Rm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$n(YZ).replace("hr",CE).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",hEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},z3t=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,H3t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fEe=/^( {2,}|\\)\n(?!\s*$)/,V3t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",A3t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),gEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Y3t=$n(gEe,"u").replace(/punct/g,D3).getRegex(),j3t=$n(gEe,"u").replace(/punct/g,pEe).getRegex(),mEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X3t=$n(mEe,"gu").replace(/notPunctSpace/g,ZZ).replace(/punctSpace/g,nN).replace(/punct/g,D3).getRegex(),K3t=$n(mEe,"gu").replace(/notPunctSpace/g,G3t).replace(/punctSpace/g,q3t).replace(/punct/g,pEe).getRegex(),Z3t=$n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ZZ).replace(/punctSpace/g,nN).replace(/punct/g,D3).getRegex(),Q3t=$n(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,D3).getRegex(),J3t="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ekt=$n(J3t,"gu").replace(/notPunctSpace/g,ZZ).replace(/punctSpace/g,nN).replace(/punct/g,D3).getRegex(),tkt=$n(/\\(punct)/,"gu").replace(/punct/g,D3).getRegex(),rkt=$n(/^<(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(),nkt=$n(XZ).replace("(?:-->|$)","-->").getRegex(),ikt=$n("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",nkt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xM=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,akt=$n(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",xM).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yEe=$n(/^!?\[(label)\]\[(ref)\]/).replace("label",xM).replace("ref",jZ).getRegex(),vEe=$n(/^!?\[(ref)\](?:\[\])?/).replace("ref",jZ).getRegex(),skt=$n("reflink|nolink(?!\\()","g").replace("reflink",yEe).replace("nolink",vEe).getRegex(),rue=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,QZ={_backpedal:Rm,anyPunctuation:tkt,autolink:rkt,blockSkip:U3t,br:fEe,code:H3t,del:Rm,delLDelim:Rm,delRDelim:Rm,emStrongLDelim:Y3t,emStrongRDelimAst:X3t,emStrongRDelimUnd:Z3t,escape:z3t,link:akt,nolink:vEe,punctuation:W3t,reflink:yEe,reflinkSearch:skt,tag:ikt,text:V3t,url:Rm},okt={...QZ,link:$n(/^!?\[(label)\]\((.*?)\)/).replace("label",xM).getRegex(),reflink:$n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xM).getRegex()},aq={...QZ,emStrongRDelimAst:K3t,emStrongLDelim:j3t,delLDelim:Q3t,delRDelim:ekt,url:$n(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",rue).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:$n(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},nue=t=>ckt[t];function kh(t,e){if(e){if(ol.escapeTest.test(t))return t.replace(ol.escapeReplace,nue)}else if(ol.escapeTestNoEncode.test(t))return t.replace(ol.escapeReplaceNoEncode,nue);return t}function iue(t){try{t=encodeURI(t).replace(ol.percentDecode,"%")}catch{return null}return t}function aue(t,e){var a;let r=t.replace(ol.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ol.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 hkt(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 sue(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 dkt(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` +`);return{...l,raw:h}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const s=T3t(a.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(Tr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>MTt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>LTt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=qS(t.selection.$from,n=>n.type.name==="table");return $Tt(t,e&&(n=>{r&&rue(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>DTt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>OTt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=qS(t.selection.$from,n=>n.type.name==="table");return BTt(t,e&&(n=>{r&&rue(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>GTt(t,e),mergeCells:()=>({state:t,dispatch:e})=>Wce(t,e),splitCell:()=>({state:t,dispatch:e})=>qce(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>GS("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>GS("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>WTt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Wce(t,e)?!0:qce(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>HTt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>Uce(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Uce(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&tEe(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Li.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:fA,"Mod-Backspace":fA,Delete:fA,"Mod-Delete":fA}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[t3t({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],h3t({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=Wn(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:ei(un(t,"tableRole",e))}}}),_3t=Ki.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(R3t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(m3t.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(y3t.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(v3t.configure(this.options.tableRow)),t}});function YZ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $y=YZ();function uEe(t){$y=t}var Rm={exec:()=>null};function $n(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(ol.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var M3t=(()=>{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)}}>`)},L3t=/^(?:[ \t]*(?:\n|$))+/,I3t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$3t=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,SE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N3t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jZ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hEe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dEe=$n(hEe).replace(/bull/g,jZ).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(),D3t=$n(hEe).replace(/bull/g,jZ).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(),XZ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,O3t=/^[^\n]+/,KZ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,P3t=$n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",KZ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),B3t=$n(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jZ).getRegex(),iN="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",ZZ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,F3t=$n("^ {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",ZZ).replace("tag",iN).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fEe=$n(XZ).replace("hr",SE).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",iN).getRegex(),z3t=$n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fEe).getRegex(),QZ={blockquote:z3t,code:I3t,def:P3t,fences:$3t,heading:N3t,hr:SE,html:F3t,lheading:dEe,list:B3t,newline:L3t,paragraph:fEe,table:Rm,text:O3t},nue=$n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",SE).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",iN).getRegex(),H3t={...QZ,lheading:D3t,table:nue,paragraph:$n(XZ).replace("hr",SE).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nue).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",iN).getRegex()},V3t={...QZ,html:$n(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ZZ).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:Rm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$n(XZ).replace("hr",SE).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",dEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},W3t=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,q3t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pEe=/^( {2,}|\\)\n(?!\s*$)/,G3t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",M3t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),mEe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,K3t=$n(mEe,"u").replace(/punct/g,D3).getRegex(),Z3t=$n(mEe,"u").replace(/punct/g,gEe).getRegex(),yEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Q3t=$n(yEe,"gu").replace(/notPunctSpace/g,JZ).replace(/punctSpace/g,aN).replace(/punct/g,D3).getRegex(),J3t=$n(yEe,"gu").replace(/notPunctSpace/g,j3t).replace(/punctSpace/g,Y3t).replace(/punct/g,gEe).getRegex(),ekt=$n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,JZ).replace(/punctSpace/g,aN).replace(/punct/g,D3).getRegex(),tkt=$n(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,D3).getRegex(),rkt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",nkt=$n(rkt,"gu").replace(/notPunctSpace/g,JZ).replace(/punctSpace/g,aN).replace(/punct/g,D3).getRegex(),ikt=$n(/\\(punct)/,"gu").replace(/punct/g,D3).getRegex(),akt=$n(/^<(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(),skt=$n(ZZ).replace("(?:-->|$)","-->").getRegex(),okt=$n("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",skt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wM=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,lkt=$n(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",wM).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vEe=$n(/^!?\[(label)\]\[(ref)\]/).replace("label",wM).replace("ref",KZ).getRegex(),bEe=$n(/^!?\[(ref)\](?:\[\])?/).replace("ref",KZ).getRegex(),ckt=$n("reflink|nolink(?!\\()","g").replace("reflink",vEe).replace("nolink",bEe).getRegex(),iue=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,eQ={_backpedal:Rm,anyPunctuation:ikt,autolink:akt,blockSkip:X3t,br:pEe,code:q3t,del:Rm,delLDelim:Rm,delRDelim:Rm,emStrongLDelim:K3t,emStrongRDelimAst:Q3t,emStrongRDelimUnd:ekt,escape:W3t,link:lkt,nolink:bEe,punctuation:U3t,reflink:vEe,reflinkSearch:ckt,tag:okt,text:G3t,url:Rm},ukt={...eQ,link:$n(/^!?\[(label)\]\((.*?)\)/).replace("label",wM).getRegex(),reflink:$n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wM).getRegex()},oq={...eQ,emStrongRDelimAst:J3t,emStrongLDelim:Z3t,delLDelim:tkt,delRDelim:nkt,url:$n(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",iue).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:$n(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},aue=t=>dkt[t];function kh(t,e){if(e){if(ol.escapeTest.test(t))return t.replace(ol.escapeReplace,aue)}else if(ol.escapeTestNoEncode.test(t))return t.replace(ol.escapeReplaceNoEncode,aue);return t}function sue(t){try{t=encodeURI(t).replace(ol.percentDecode,"%")}catch{return null}return t}function oue(t,e){var a;let r=t.replace(ol.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(ol.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 pkt(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 lue(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 gkt(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 wM=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||$y}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:_k(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=dkt(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=_k(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:_k(r[0],` +`)}var TM=class{constructor(e){Ut(this,"options");Ut(this,"rules");Ut(this,"lexer");this.options=e||$y}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:_k(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=gkt(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=_k(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:_k(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=_k(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=hkt(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=pkt(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 x=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),T=this.rules.other.fencesBeginRegex(v),k=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),C=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(` `,1)[0],A;if(m=E,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),A=m):A=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||k.test(m)||S.test(m)||C.test(m)||x.test(m)||b.test(m))break;if(A.search(this.rules.other.nonSpaceChar)>=v||!m.trim())p+=` `+A.slice(v);else{if(y||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||k.test(g)||b.test(g))break;p+=` `+m}y=!m.trim(),f+=E+` -`,e=e.substring(E.length+1),g=A.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=aue(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=_k(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=ukt(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)),sue(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 sue(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}}}},Du=class sq{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"inlineQueue");Ut(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$y,this.options.tokenizer=this.options.tokenizer||new wM,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:ol,block:fA.normal,inline:Rk.normal};this.options.pedantic?(r.block=fA.pedantic,r.inline=Rk.pedantic):this.options.gfm&&(r.block=fA.gfm,this.options.breaks?r.inline=Rk.breaks:r.inline=Rk.gfm),this.tokenizer.rules=r}static get rules(){return{block:fA,inline:Rk}}static lex(e,r){return new sq(r).lex(e)}static lexInline(e,r){return new sq(r).inlineTokens(e)}lex(e){e=e.replace(ol.carriageReturn,` +`,e=e.substring(E.length+1),g=A.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=oue(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=_k(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=fkt(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)),lue(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 lue(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}}}},Du=class lq{constructor(e){Ut(this,"tokens");Ut(this,"options");Ut(this,"state");Ut(this,"inlineQueue");Ut(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$y,this.options.tokenizer=this.options.tokenizer||new TM,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:ol,block:pA.normal,inline:Rk.normal};this.options.pedantic?(r.block=pA.pedantic,r.inline=Rk.pedantic):this.options.gfm&&(r.block=pA.gfm,this.options.breaks?r.inline=Rk.breaks:r.inline=Rk.gfm),this.tokenizer.rules=r}static get rules(){return{block:pA,inline:Rk}}static lex(e,r){return new lq(r).lex(e)}static lexInline(e,r){return new lq(r).inlineTokens(e)}lex(e){e=e.replace(ol.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(` `)?"":` @@ -623,7 +623,7 @@ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` -`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},TM=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||$y}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(ol.notSpaceStart))==null?void 0:s[0],a=e.replace(ol.endingNewline,"")+` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},kM=class{constructor(e){Ut(this,"options");Ut(this,"parser");this.options=e||$y}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(ol.notSpaceStart))==null?void 0:s[0],a=e.replace(ol.endingNewline,"")+` `;return i?'

'+(n?a:kh(a,!0))+`
`:"
"+(n?a:kh(a,!0))+`
`}blockquote({tokens:e}){return`
@@ -641,54 +641,54 @@ ${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`${kh(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=iue(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=iue(e);if(a===null)return kh(n);e=a;let s=`${kh(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 TM(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 wM(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 _5;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];_5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&_5.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 Du.lex(e,r??this.defaults)}parser(e,r){return Ou.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?Du.lex:Du.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?Ou.parse:Ou.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?Du.lex:Du.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?Ou.parse:Ou.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:

"+kh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},ry=new fkt;function li(t,e){return ry.parse(t,e)}li.options=li.setOptions=function(t){return ry.setOptions(t),li.defaults=ry.defaults,cEe(li.defaults),li};li.getDefaults=GZ;li.defaults=$y;li.use=function(...t){return ry.use(...t),li.defaults=ry.defaults,cEe(li.defaults),li};li.walkTokens=function(t,e){return ry.walkTokens(t,e)};li.parseInline=ry.parseInline;li.Parser=Ou;li.parser=Ou.parse;li.Renderer=TM;li.TextRenderer=JZ;li.Lexer=Du;li.lexer=Du.lex;li.Tokenizer=wM;li.Hooks=_5;li.parse=li;li.options;li.setOptions;li.use;li.walkTokens;li.parseInline;Ou.parse;Du.lex;const pkt=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function gkt(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(pkt);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function mkt(t,e){const r=e.split(` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${kh(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=sue(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=sue(e);if(a===null)return kh(n);e=a;let s=`${kh(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 kM(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 TM(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 _5;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];_5.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&_5.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 Du.lex(e,r??this.defaults)}parser(e,r){return Ou.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?Du.lex:Du.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?Ou.parse:Ou.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?Du.lex:Du.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?Ou.parse:Ou.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:

"+kh(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},ry=new mkt;function li(t,e){return ry.parse(t,e)}li.options=li.setOptions=function(t){return ry.setOptions(t),li.defaults=ry.defaults,uEe(li.defaults),li};li.getDefaults=YZ;li.defaults=$y;li.use=function(...t){return ry.use(...t),li.defaults=ry.defaults,uEe(li.defaults),li};li.walkTokens=function(t,e){return ry.walkTokens(t,e)};li.parseInline=ry.parseInline;li.Parser=Ou;li.parser=Ou.parse;li.Renderer=kM;li.TextRenderer=tQ;li.Lexer=Du;li.lexer=Du.lex;li.Tokenizer=TM;li.Hooks=_5;li.parse=li;li.options;li.setOptions;li.use;li.walkTokens;li.parseInline;Ou.parse;Du.lex;const ykt=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function vkt(t){return t.flatMap((e,r)=>{var n;if(e.type==="space"||((n=t[r+1])===null||n===void 0?void 0:n.type)==="space")return[e];const i=(e.raw||"").match(ykt);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function bkt(t,e){const r=e.split(` `).flatMap(n=>[n,""]).map(n=>`${t}${n}`).join(` -`);return r.slice(0,r.length-1)}function oue(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(a=>a.type===n&&BT(a.attrs,i.attrs))||r.push(n)}),r}function ykt(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!BT(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function vkt(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(h=>h.type===l&&BT(h.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function bkt(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function xkt(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 lB(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function pA(t,e){return typeof t!="string"?"json":e}const wkt=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"]),Tkt=/<\/?([a-zA-Z][\w-]*)/g;function kkt(t){const e=[];let r;for(;(r=Tkt.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function Ckt(t){const e=t.toLowerCase();return e.includes("-")?!1:!wkt.has(e)}function Skt(t,e){return kkt(t).some(r=>Ckt(r)?!e.has(r):!1)}var lq=class{constructor(t){var e,r,n,i,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t==null?void 0:t.marked)!==null&&e!==void 0?e:li,this.indentStyle=(r=t==null||(n=t.indentation)===null||n===void 0?void 0:n.style)!==null&&r!==void 0?r:"space",this.indentSize=(i=t==null||(a=t.indentation)===null||a===void 0?void 0:a.size)!==null&&i!==void 0?i: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,R6e(PZ(t.extensions)).forEach(s=>this.registerExtension(s)))}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=ei(un(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=un(t,"markdownTokenName")||i,s=un(t,"parseMarkdown"),o=un(t,"renderMarkdown"),l=un(t,"markdownTokenizer"),u=(e=un(t,"markdownOptions"))!==null&&e!==void 0?e:null,h={tokenName:a,nodeName:i,parseMarkdown:s,renderMarkdown:o,isIndenting:(r=u==null?void 0:u.indentsContent)!==null&&r!==void 0?r:!1,htmlReopen:u==null?void 0:u.htmlReopen,tokenizer:l};if(a&&s){const d=this.registry.get(a)||[];d.push(h),this.registry.set(a,d)}if(o){const d=this.nodeTypeRegistry.get(i)||[];d.push(h),this.nodeTypeRegistry.set(i,d)}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!==void 0?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=e?gkt(t):t,n=r.reduce((s,o,l)=>(o.type!=="space"&&s.push(l),s),[]);let i=-1,a=0;return r.flatMap((s,o)=>{for(;a({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(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(t,n),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,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>lB(o).isTask),r=t.items.some(o=>!lB(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],a=null;for(let o=0;o{if(!e){r.push(n);return}(e.marks||[]).find(a=>a.type===n&&BT(a.attrs,i.attrs))||r.push(n)}),r}function xkt(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!BT(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function wkt(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(h=>h.type===l&&BT(h.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function Tkt(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=e(n,t.get(n));i&&(r=i+r)}),t.clear(),r}function kkt(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 uB(t){const e=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return e?{isTask:!0,checked:e[2].toLowerCase()==="x",indentLevel:e[1].length}:{isTask:!1,indentLevel:0}}function gA(t,e){return typeof t!="string"?"json":e}const Ckt=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"]),Skt=/<\/?([a-zA-Z][\w-]*)/g;function Ekt(t){const e=[];let r;for(;(r=Skt.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function Akt(t){const e=t.toLowerCase();return e.includes("-")?!1:!Ckt.has(e)}function Rkt(t,e){return Ekt(t).some(r=>Akt(r)?!e.has(r):!1)}var uq=class{constructor(t){var e,r,n,i,a;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(e=t==null?void 0:t.marked)!==null&&e!==void 0?e:li,this.indentStyle=(r=t==null||(n=t.indentation)===null||n===void 0?void 0:n.style)!==null&&r!==void 0?r:"space",this.indentSize=(i=t==null||(a=t.indentation)===null||a===void 0?void 0:a.size)!==null&&i!==void 0?i: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,_6e(FZ(t.extensions)).forEach(s=>this.registerExtension(s)))}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=ei(un(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=un(t,"markdownTokenName")||i,s=un(t,"parseMarkdown"),o=un(t,"renderMarkdown"),l=un(t,"markdownTokenizer"),u=(e=un(t,"markdownOptions"))!==null&&e!==void 0?e:null,h={tokenName:a,nodeName:i,parseMarkdown:s,renderMarkdown:o,isIndenting:(r=u==null?void 0:u.indentsContent)!==null&&r!==void 0?r:!1,htmlReopen:u==null?void 0:u.htmlReopen,tokenizer:l};if(a&&s){const d=this.registry.get(a)||[];d.push(h),this.registry.set(a,d)}if(o){const d=this.nodeTypeRegistry.get(i)||[];d.push(h),this.nodeTypeRegistry.set(i,d)}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!==void 0?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=e?vkt(t):t,n=r.reduce((s,o,l)=>(o.type!=="space"&&s.push(l),s),[]);let i=-1,a=0;return r.flatMap((s,o)=>{for(;a({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(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(t,n),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,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>uB(o).isTask),r=t.items.some(o=>!uB(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&&g.slice(1).join(` `).trim()){const x=g.slice(1),b=x.filter(T=>T.trim());if(b.length>0){const T=Math.min(...b.map(S=>S.length-S.trimStart().length)),k=x.map(S=>S.trim()?S.slice(T):"").join(` `).trim();k&&(v=this.markedInstance.lexer(`${k} -`))}}f={type:"taskItem",raw:"",mainContent:y,indentLevel:d,checked:h??!1,text:y,tokens:this.tokenizeInline(y),nestedTokens:v}}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(n=>{if(!n.parseMarkdown)return!1;const i=n.parseMarkdown(t,r),a=this.normalizeParseResult(i);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const n=this.lastParseResult;return this.lastParseResult=null,n}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){const e=[];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=e[s],l=e[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];_wt(u,h)&&(l.text=(l.text||"")+(o.text||""),e.splice(s,1))}}return e}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:Rce(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=q4t(e,this.baseExtensions);if(r.type==="doc"&&r.content){if(t.block)return r.content;const n=this.toInlineContent(r.content);return n.length>0?n:null}return r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(r=>r.type&&e.has(r.type)?[r]:r.content?this.toInlineContent(r.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=KW(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Skt(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=KW(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(n=>this.codeTypes.has(typeof n=="string"?n:n.type))?t:this.escapeMarkdownSyntax(Awt(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:(h,d)=>{const f=s.isIndenting?n+1:n;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,d||"",r,f):this.renderNodes(h,t,d||"",r,f)},renderChild:(h,d)=>{const f=s.isIndenting?n+1:n;return this.renderNodeToMarkdown(h,t,d,f)},indent:h=>this.indentString+h,wrapInBlock:mkt},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||a===void 0?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[k.type,k])),p=this.getMarksToOpenForSerialization(a,f,h),g=oue(f,h);if(d.length>0&&d.trim().length===0&&f.size>0){const k=new Set(g.filter(S=>!a.has(S)));k.size>0&&(f=new Map(Array.from(f).filter(([S])=>!k.has(S))),p=this.getMarksToOpenForSerialization(a,f,h),g=oue(f,h))}const m=g.filter(k=>a.has(k)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const k=d.match(/(\s+)$/);k&&(v=k[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(k=>{if(!a.has(k))return;const S=f.get(k),C=this.getMarkClosing(k,S,o.get(k));C&&(d+=C),a.has(k)&&(a.delete(k),o.delete(k))});let x="";if(p.length>0){const k=d.match(/^(\s+)/);k&&(x=k[1],d=d.slice(x.length))}p.forEach(({type:k,mark:S})=>{const C=s.has(k)?"html":"markdown",E=this.getMarkOpening(k,S,C);E&&(d=E+d),o.set(k,C),s.delete(k)}),y||p.slice().reverse().forEach(({type:k,mark:S})=>{a.set(k,S)}),d=x+d;let b;if(y){const k=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{k.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const S=Array.from(a.keys()),C=m.slice().sort((E,A)=>S.indexOf(A)-S.indexOf(E));b=[...p.map(E=>E.type),...C]}else b=vkt(a,f,h,this.markSetsEqual.bind(this));let T="";if(b.length>0){const k=d.match(/(\s+)$/);k&&(T=k[1],d=d.slice(0,-T.length))}b.forEach(k=>{var S;const C=(S=a.get(k))!==null&&S!==void 0?S:f.get(k),E=this.getMarkClosing(k,C,o.get(k));E&&(d+=E),a.delete(k),o.delete(k)}),d+=T,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,x)=>{if(d.has(x)){var b;f.set(x,v),p.set(x,(b=o.get(x))!==null&&b!==void 0?b:"markdown")}});const g=bkt(a,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":xkt(f,a,(v,x)=>{var b;const T=(b=p.get(v))!==null&&b!==void 0?b:"markdown";return o.set(v,T),this.getMarkOpening(v,x,T)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?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"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?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+33;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&&BT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=ykt(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&&BT(d.attrs,h)),s=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?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]}};const Ekt=Ki.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||pA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Th.setContent(t,e);const r=this.editor.markdown.parse(t);return Th.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||pA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Th.insertContent(t,e);const r=this.editor.markdown.parse(t);return Th.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||pA(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Th.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return Th.insertContentAt(t,n,r)}}},addStorage(){return{manager:new lq({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 lq({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||pA(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 e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),bEe=new WeakSet,xEe=new WeakSet;function Gg(t){const e=t;return bEe.add(e),e}function cq(t){return Array.isArray(t)&&bEe.has(t)}function wEe(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&xEe.has(e)&&!cq(e)?wEe(e):[e])}function Akt(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!cq(i)&&!xEe.has(i)?Gg(i):i}const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(r)){if(cq(r))return Gg([t,n,r]);if(r.length===0)return Gg([t,n]);const i=wEe(r);return i.length===0?Gg([t,n]):Gg([t,n,...i])}return r!=null?Gg([t,n,r]):Gg([t,n])}const kM=(t,e)=>Akt(t,e),Rkt=(t,e)=>{var r;const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:a}=i;if(a.parentOffset!==0)return!1;const s=a.depth-1;if(s<0)return!1;const o=a.node(s),l=a.index(s);if(l===0)return!1;if(o.type===e)return t.commands.lift(e.name);const u=o.child(l-1);if(u.type!==e||!(!((r=u.lastChild)===null||r===void 0)&&r.isTextblock))return!1;const h=a.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const p=a.parent.content,g=new Jt(p,0,0);return d.replace(h,a.after(),g),d.setSelection(wr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},_kt=/^\s*>\s$/,Mkt=Ti.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return kM("blockquote",{...Wn(this.options.HTMLAttributes,t),children:kM("slot",{})})},parseMarkdown:(t,e)=>{var r;const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const r=">",n=[];return t.content.forEach((i,a)=>{var s,o;const l=((s=(o=e.renderChild)===null||o===void 0?void 0:o.call(e,i,a))!==null&&s!==void 0?s:e.renderChildren([i])).split(` +`))}}f={type:"taskItem",raw:"",mainContent:y,indentLevel:d,checked:h??!1,text:y,tokens:this.tokenizeInline(y),nestedTokens:v}}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(n=>{if(!n.parseMarkdown)return!1;const i=n.parseMarkdown(t,r),a=this.normalizeParseResult(i);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!0):!1})&&this.lastParseResult){const n=this.lastParseResult;return this.lastParseResult=null,n}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){const e=[];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=e[s],l=e[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];Iwt(u,h)&&(l.text=(l.text||"")+(o.text||""),e.splice(s,1))}}return e}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:Mce(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=Y4t(e,this.baseExtensions);if(r.type==="doc"&&r.content){if(t.block)return r.content;const n=this.toInlineContent(r.content);return n.length>0?n:null}return r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(r=>r.type&&e.has(r.type)?[r]:r.content?this.toInlineContent(r.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=QW(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Rkt(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=QW(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(n=>this.codeTypes.has(typeof n=="string"?n:n.type))?t:this.escapeMarkdownSyntax(Mwt(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:(h,d)=>{const f=s.isIndenting?n+1:n;return!Array.isArray(h)&&h.content?this.renderNodes(h.content,t,d||"",r,f):this.renderNodes(h,t,d||"",r,f)},renderChild:(h,d)=>{const f=s.isIndenting?n+1:n;return this.renderNodeToMarkdown(h,t,d,f)},indent:h=>this.indentString+h,wrapInBlock:bkt},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||a===void 0?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[k.type,k])),p=this.getMarksToOpenForSerialization(a,f,h),g=cue(f,h);if(d.length>0&&d.trim().length===0&&f.size>0){const k=new Set(g.filter(S=>!a.has(S)));k.size>0&&(f=new Map(Array.from(f).filter(([S])=>!k.has(S))),p=this.getMarksToOpenForSerialization(a,f,h),g=cue(f,h))}const m=g.filter(k=>a.has(k)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const k=d.match(/(\s+)$/);k&&(v=k[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(k=>{if(!a.has(k))return;const S=f.get(k),C=this.getMarkClosing(k,S,o.get(k));C&&(d+=C),a.has(k)&&(a.delete(k),o.delete(k))});let x="";if(p.length>0){const k=d.match(/^(\s+)/);k&&(x=k[1],d=d.slice(x.length))}p.forEach(({type:k,mark:S})=>{const C=s.has(k)?"html":"markdown",E=this.getMarkOpening(k,S,C);E&&(d=E+d),o.set(k,C),s.delete(k)}),y||p.slice().reverse().forEach(({type:k,mark:S})=>{a.set(k,S)}),d=x+d;let b;if(y){const k=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{k.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const S=Array.from(a.keys()),C=m.slice().sort((E,A)=>S.indexOf(A)-S.indexOf(E));b=[...p.map(E=>E.type),...C]}else b=wkt(a,f,h,this.markSetsEqual.bind(this));let T="";if(b.length>0){const k=d.match(/(\s+)$/);k&&(T=k[1],d=d.slice(0,-T.length))}b.forEach(k=>{var S;const C=(S=a.get(k))!==null&&S!==void 0?S:f.get(k),E=this.getMarkClosing(k,C,o.get(k));E&&(d+=E),a.delete(k),o.delete(k)}),d+=T,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,x)=>{if(d.has(x)){var b;f.set(x,v),p.set(x,(b=o.get(x))!==null&&b!==void 0?b:"markdown")}});const g=Tkt(a,(v,x)=>this.getMarkClosing(v,x,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":kkt(f,a,(v,x)=>{var b;const T=(b=p.get(v))!==null&&b!==void 0?b:"markdown";return o.set(v,T),this.getMarkOpening(v,x,T)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?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"){if(r==="html"){var n;return((n=this.getHtmlReopenTags(t))===null||n===void 0?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+33;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&&BT(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=xkt(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&&BT(d.attrs,h)),s=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!==null&&f!==void 0?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]}};const _kt=Ki.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||gA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Th.setContent(t,e);const r=this.editor.markdown.parse(t);return Th.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||gA(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Th.insertContent(t,e);const r=this.editor.markdown.parse(t);return Th.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||gA(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Th.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return Th.insertContentAt(t,n,r)}}},addStorage(){return{manager:new uq({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 uq({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||gA(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 e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}}),xEe=new WeakSet,wEe=new WeakSet;function Gg(t){const e=t;return xEe.add(e),e}function hq(t){return Array.isArray(t)&&xEe.has(t)}function TEe(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&wEe.has(e)&&!hq(e)?TEe(e):[e])}function Mkt(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!hq(i)&&!wEe.has(i)?Gg(i):i}const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(r)){if(hq(r))return Gg([t,n,r]);if(r.length===0)return Gg([t,n]);const i=TEe(r);return i.length===0?Gg([t,n]):Gg([t,n,...i])}return r!=null?Gg([t,n,r]):Gg([t,n])}const CM=(t,e)=>Mkt(t,e),Lkt=(t,e)=>{var r;const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:a}=i;if(a.parentOffset!==0)return!1;const s=a.depth-1;if(s<0)return!1;const o=a.node(s),l=a.index(s);if(l===0)return!1;if(o.type===e)return t.commands.lift(e.name);const u=o.child(l-1);if(u.type!==e||!(!((r=u.lastChild)===null||r===void 0)&&r.isTextblock))return!1;const h=a.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const p=a.parent.content,g=new Jt(p,0,0);return d.replace(h,a.after(),g),d.setSelection(Tr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},Ikt=/^\s*>\s$/,$kt=Ti.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return CM("blockquote",{...Wn(this.options.HTMLAttributes,t),children:CM("slot",{})})},parseMarkdown:(t,e)=>{var r;const n=(r=e.parseBlockChildren)!==null&&r!==void 0?r:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const r=">",n=[];return t.content.forEach((i,a)=>{var s,o;const l=((s=(o=e.renderChild)===null||o===void 0?void 0:o.call(e,i,a))!==null&&s!==void 0?s:e.renderChildren([i])).split(` `).map(u=>u.trim()===""?r:`${r} ${u}`);n.push(l.join(` `))}),n.join(` ${r} -`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Rkt(this.editor,this.type)}},addInputRules(){return[FT({find:_kt,type:this.type})]}}),Lkt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ikt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$kt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Nkt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Dkt=Iy.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return kM("strong",{...Wn(this.options.HTMLAttributes,t),children:kM("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[J1({find:Lkt,type:this.type}),J1({find:$kt,type:this.type})]},addPasteRules(){return[Gp({find:Ikt,type:this.type}),Gp({find:Nkt,type:this.type})]}}),Okt=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Pkt=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},Bkt=Iy.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[J1({find:Okt,type:this.type})]},addPasteRules(){return[Gp({find:Pkt,type:this.type})]}}),cB=4,Fkt=/^```([a-z]+)?[\s\n]$/,zkt=/^~~~([a-z]+)?[\s\n]$/,Hkt=Ti.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:cB,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options;if(!r)return null;const n=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(r)).map(i=>i.replace(r,""))[0];return n||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Wn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var r,n;return((r=t.raw)===null||r===void 0?void 0:r.startsWith("```"))===!1&&((n=t.raw)===null||n===void 0?void 0:n.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var r;let n="";const i=((r=t.attrs)===null||r===void 0?void 0:r.language)||"";return t.content?n=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(` +`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Lkt(this.editor,this.type)}},addInputRules(){return[FT({find:Ikt,type:this.type})]}}),Nkt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Dkt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Okt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Pkt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Bkt=Iy.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return CM("strong",{...Wn(this.options.HTMLAttributes,t),children:CM("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[J1({find:Nkt,type:this.type}),J1({find:Okt,type:this.type})]},addPasteRules(){return[Gp({find:Dkt,type:this.type}),Gp({find:Pkt,type:this.type})]}}),Fkt=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},zkt=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},Hkt=Iy.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[J1({find:Fkt,type:this.type})]},addPasteRules(){return[Gp({find:zkt,type:this.type})]}}),hB=4,Vkt=/^```([a-z]+)?[\s\n]$/,Wkt=/^~~~([a-z]+)?[\s\n]$/,qkt=Ti.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:hB,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options;if(!r)return null;const n=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(r)).map(i=>i.replace(r,""))[0];return n||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Wn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var r,n;return((r=t.raw)===null||r===void 0?void 0:r.startsWith("```"))===!1&&((n=t.raw)===null||n===void 0?void 0:n.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var r;let n="";const i=((r=t.attrs)===null||r===void 0?void 0:r.language)||"";return t.content?n=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(` `):n=`\`\`\`${i} -\`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!==null&&e!==void 0?e:cB,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;if(a.parent.type!==this.type)return!1;const o=" ".repeat(r);return s?t.commands.insertContent(o):t.commands.command(({tr:l})=>{const{from:u,to:h}=i,d=n.doc.textBetween(u,h,` +\`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!==null&&e!==void 0?e:hB,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;if(a.parent.type!==this.type)return!1;const o=" ".repeat(r);return s?t.commands.insertContent(o):t.commands.command(({tr:l})=>{const{from:u,to:h}=i,d=n.doc.textBetween(u,h,` `,` `).split(` `).map(f=>o+f).join(` -`);return l.replaceWith(u,h,n.schema.text(d)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!==null&&e!==void 0?e:cB,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;return a.parent.type!==this.type?!1:s?t.commands.command(({tr:o})=>{var l;const{pos:u}=a,h=a.start(),d=a.end(),f=n.doc.textBetween(h,d,` +`);return l.replaceWith(u,h,n.schema.text(d)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!==null&&e!==void 0?e:hB,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;return a.parent.type!==this.type?!1:s?t.commands.command(({tr:o})=>{var l;const{pos:u}=a,h=a.start(),d=a.end(),f=n.doc.textBetween(h,d,` `,` `).split(` -`);let p=0,g=0;const m=u-h;for(let b=0;b=m){p=b;break}g+=f[b].length+1}const y=((l=f[p].match(/^ */))===null||l===void 0?void 0:l[0])||"",v=Math.min(y.length,r);if(v===0)return!0;let x=h;for(let b=0;b{const{from:l,to:u}=i,h=n.doc.textBetween(l,u,` +`);let p=0,g=0;const m=u-h;for(let b=0;b=m){p=b;break}g+=f[b].length+1}const y=((l=f[p].match(/^ */))===null||l===void 0?void 0:l[0])||"",v=Math.min(y.length,r);if(v===0)return!0;let x=h;for(let b=0;b{const{from:l,to:u}=i,h=n.doc.textBetween(l,u,` `,` `).split(` `).map(d=>{var f;const p=((f=d.match(/^ */))===null||f===void 0?void 0:f[0])||"",g=Math.min(p.length,r);return d.slice(g)}).join(` `);return o.replaceWith(l,u,n.schema.text(h)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const a=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith(` -`);return!a||!s?!1:t.chain().command(({tr:o})=>(o.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type||n.parentOffset!==0)return!1;const a=n.before();return a>0?!1:t.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:a}=r;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return s===void 0?!1:n.nodeAt(s)?t.commands.command(({tr:o})=>(o.setSelection(sn.near(n.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[ZW({find:Fkt,type:this.type,getAttributes:t=>({language:t[1]})}),ZW({find:zkt,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new da({key:new fa("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,a=i==null?void 0:i.mode;if(!r||!a)return!1;const{tr:s,schema:o}=t.state,l=o.text(r.replace(/\r\n?/g,` -`));return s.replaceSelectionWith(this.type.create({language:a},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(wr.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Vkt=Ti.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`);return!a||!s?!1:t.chain().command(({tr:o})=>(o.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type||n.parentOffset!==0)return!1;const a=n.before();return a>0?!1:t.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:a}=r;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const s=i.after();return s===void 0?!1:n.nodeAt(s)?t.commands.command(({tr:o})=>(o.setSelection(sn.near(n.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[JW({find:Vkt,type:this.type,getAttributes:t=>({language:t[1]})}),JW({find:Wkt,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new da({key:new fa("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,a=i==null?void 0:i.mode;if(!r||!a)return!1;const{tr:s,schema:o}=t.state,l=o.text(r.replace(/\r\n?/g,` +`));return s.replaceSelectionWith(this.type.create({language:a},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Tr.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Gkt=Ti.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):""}),Wkt=Ti.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Wn(this.options.HTMLAttributes,t)]},renderText(){return` +`):""}),Ukt=Ti.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Wn(this.options.HTMLAttributes,t)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:a}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=n.extensionManager,l=a||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&s){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),qkt=Ti.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Wn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ZW({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),Gkt=Ti.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Wn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ewt(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return _6e(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:a,tr:s,dispatch:o})=>{if(o){const{$to:l}=s.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(wr.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(Ir.create(s.doc,l.pos)):s.setSelection(wr.create(s.doc,l.pos));else{const h=a.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(s.insert(u,d),s.setSelection(wr.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[O6e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Ukt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Ykt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jkt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Xkt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Kkt=Iy.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Wn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[J1({find:Ukt,type:this.type}),J1({find:jkt,type:this.type})]},addPasteRules(){return[Gp({find:Ykt,type:this.type}),Gp({find:Xkt,type:this.type})]}}),Zkt="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Qkt="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",uq="numeric",hq="ascii",dq="alpha",MC="asciinumeric",M5="alphanumeric",fq="domain",TEe="emoji",Jkt="scheme",e5t="slashscheme",uB="whitespace";function t5t(t,e){return t in e||(e[t]=[]),e[t]}function i1(t,e,r){e[uq]&&(e[MC]=!0,e[M5]=!0),e[hq]&&(e[MC]=!0,e[dq]=!0),e[MC]&&(e[M5]=!0),e[dq]&&(e[M5]=!0),e[M5]&&(e[fq]=!0),e[TEe]&&(e[fq]=!0);for(const n in e){const i=t5t(n,r);i.indexOf(t)<0&&i.push(t)}}function r5t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function zl(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}zl.groups={};zl.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;nt.ta(e,r,n,i),va=(t,e,r,n,i)=>t.tr(e,r,n,i),lue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),rf="WORD",pq="UWORD",kEe="ASCIINUMERICAL",CEe="ALPHANUMERICAL",US="LOCALHOST",gq="TLD",mq="UTLD",dR="SCHEME",h2="SLASH_SCHEME",eQ="NUM",yq="WS",tQ="NL",LC="OPENBRACE",IC="CLOSEBRACE",CM="OPENBRACKET",SM="CLOSEBRACKET",EM="OPENPAREN",AM="CLOSEPAREN",RM="OPENANGLEBRACKET",_M="CLOSEANGLEBRACKET",MM="FULLWIDTHLEFTPAREN",LM="FULLWIDTHRIGHTPAREN",IM="LEFTCORNERBRACKET",$M="RIGHTCORNERBRACKET",NM="LEFTWHITECORNERBRACKET",DM="RIGHTWHITECORNERBRACKET",OM="FULLWIDTHLESSTHAN",PM="FULLWIDTHGREATERTHAN",BM="AMPERSAND",FM="APOSTROPHE",zM="ASTERISK",Q0="AT",HM="BACKSLASH",VM="BACKTICK",WM="CARET",a1="COLON",rQ="COMMA",qM="DOLLAR",_h="DOT",GM="EQUALS",nQ="EXCLAMATION",Uc="HYPHEN",$C="PERCENT",UM="PIPE",YM="PLUS",jM="POUND",NC="QUERY",iQ="QUOTE",SEe="FULLWIDTHMIDDLEDOT",aQ="SEMI",Mh="SLASH",DC="TILDE",XM="UNDERSCORE",EEe="EMOJI",KM="SYM";var AEe=Object.freeze({__proto__:null,ALPHANUMERICAL:CEe,AMPERSAND:BM,APOSTROPHE:FM,ASCIINUMERICAL:kEe,ASTERISK:zM,AT:Q0,BACKSLASH:HM,BACKTICK:VM,CARET:WM,CLOSEANGLEBRACKET:_M,CLOSEBRACE:IC,CLOSEBRACKET:SM,CLOSEPAREN:AM,COLON:a1,COMMA:rQ,DOLLAR:qM,DOT:_h,EMOJI:EEe,EQUALS:GM,EXCLAMATION:nQ,FULLWIDTHGREATERTHAN:PM,FULLWIDTHLEFTPAREN:MM,FULLWIDTHLESSTHAN:OM,FULLWIDTHMIDDLEDOT:SEe,FULLWIDTHRIGHTPAREN:LM,HYPHEN:Uc,LEFTCORNERBRACKET:IM,LEFTWHITECORNERBRACKET:NM,LOCALHOST:US,NL:tQ,NUM:eQ,OPENANGLEBRACKET:RM,OPENBRACE:LC,OPENBRACKET:CM,OPENPAREN:EM,PERCENT:$C,PIPE:UM,PLUS:YM,POUND:jM,QUERY:NC,QUOTE:iQ,RIGHTCORNERBRACKET:$M,RIGHTWHITECORNERBRACKET:DM,SCHEME:dR,SEMI:aQ,SLASH:Mh,SLASH_SCHEME:h2,SYM:KM,TILDE:DC,TLD:gq,UNDERSCORE:XM,UTLD:mq,UWORD:pq,WORD:rf,WS:yq});const Hd=/[a-z]/,Mk=new RegExp("\\p{L}","u"),hB=new RegExp("\\p{Emoji}","u"),Vd=/\d/,dB=/\s/,cue="\r",fB=` -`,n5t="️",i5t="‍",pB="";let gA=null,mA=null;function a5t(t=[]){const e={};zl.groups=e;const r=new zl;gA==null&&(gA=uue(Zkt)),mA==null&&(mA=uue(Qkt)),Wt(r,"'",FM),Wt(r,"{",LC),Wt(r,"}",IC),Wt(r,"[",CM),Wt(r,"]",SM),Wt(r,"(",EM),Wt(r,")",AM),Wt(r,"<",RM),Wt(r,">",_M),Wt(r,"(",MM),Wt(r,")",LM),Wt(r,"「",IM),Wt(r,"」",$M),Wt(r,"『",NM),Wt(r,"』",DM),Wt(r,"<",OM),Wt(r,">",PM),Wt(r,"&",BM),Wt(r,"*",zM),Wt(r,"@",Q0),Wt(r,"`",VM),Wt(r,"^",WM),Wt(r,":",a1),Wt(r,",",rQ),Wt(r,"$",qM),Wt(r,".",_h),Wt(r,"=",GM),Wt(r,"!",nQ),Wt(r,"-",Uc),Wt(r,"%",$C),Wt(r,"|",UM),Wt(r,"+",YM),Wt(r,"#",jM),Wt(r,"?",NC),Wt(r,'"',iQ),Wt(r,"/",Mh),Wt(r,";",aQ),Wt(r,"~",DC),Wt(r,"_",XM),Wt(r,"\\",HM),Wt(r,"・",SEe);const n=va(r,Vd,eQ,{[uq]:!0});va(n,Vd,n);const i=va(n,Hd,kEe,{[MC]:!0}),a=va(n,Mk,CEe,{[M5]:!0}),s=va(r,Hd,rf,{[hq]:!0});va(s,Vd,i),va(s,Hd,s),va(i,Vd,i),va(i,Hd,i);const o=va(r,Mk,pq,{[dq]:!0});va(o,Hd),va(o,Vd,a),va(o,Mk,o),va(a,Vd,a),va(a,Hd),va(a,Mk,a);const l=Wt(r,fB,tQ,{[uB]:!0}),u=Wt(r,cue,yq,{[uB]:!0}),h=va(r,dB,yq,{[uB]:!0});Wt(r,pB,h),Wt(u,fB,l),Wt(u,pB,h),va(u,dB,h),Wt(h,cue),Wt(h,fB),va(h,dB,h),Wt(h,pB,h);const d=va(r,hB,EEe,{[TEe]:!0});Wt(d,"#"),va(d,hB,d),Wt(d,n5t,d);const f=Wt(d,i5t);Wt(f,"#"),va(f,hB,d);const p=[[Hd,s],[Vd,i]],g=[[Hd,null],[Mk,o],[Vd,a]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[fq]=!0:Hd.test(y)?Vd.test(y)?x[MC]=!0:x[hq]=!0:x[uq]=!0,lue(r,y,y,x)}return lue(r,"localhost",US,{ascii:!0}),r.jd=new zl(KM),{start:r,tokens:Object.assign({groups:e},AEe)}}function REe(t,e){const r=s5t(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let a=0,s=0;for(;s=0&&(d+=r[s].length,f++),u+=r[s].length,a+=r[s].length,s++;a-=d,s-=f,u-=d,i.push({t:h.t,v:e.slice(a-u,a),s:a-u,e:a})}return i}function s5t(t){const e=[],r=t.length;let n=0;for(;n56319||n+1===r||(a=t.charCodeAt(n+1))<56320||a>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length}return e}function L0(t,e,r,n,i){let a;const s=e.length;for(let o=0;o=0;)a++;if(a>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+a),10);s>0;s--)r.pop();n+=a}else r.push(t[n]),n++}return e}const YS={defaultProtocol:"http",events:null,format:hue,formatHref:hue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function sQ(t,e=null){let r=Object.assign({},YS);t&&(r=Object.assign(r,t instanceof sQ?t.o:t));const n=r.ignoreTags,i=[];for(let a=0;ar?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=YS.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),a=this.toFormattedString(t),s={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return s.href=n,o&&(s.class=o),l&&(s.target=l),u&&(s.rel=u),h&&Object.assign(s,h),{tagName:i,attributes:s,content:a,eventListeners:d}}};function iN(t,e){class r extends _Ee{constructor(i,a){super(i,a),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const o5t=iN("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),due=iN("text"),l5t=iN("nl"),yA=iN("url",{isLink:!0,toHref(t=YS.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==US&&t[1].t===a1}}),zc=t=>new zl(t);function c5t({groups:t}){const e=t.domain.concat([BM,zM,Q0,HM,VM,WM,qM,GM,Uc,eQ,$C,UM,YM,jM,Mh,KM,DC,XM]),r=[FM,a1,rQ,_h,nQ,$C,NC,iQ,aQ,RM,_M,LC,IC,SM,CM,EM,AM,MM,LM,IM,$M,NM,DM,OM,PM],n=[BM,FM,zM,HM,VM,WM,qM,GM,Uc,LC,IC,$C,UM,YM,jM,NC,Mh,KM,DC,XM],i=zc(),a=Wt(i,DC);yn(a,n,a),yn(a,t.domain,a);const s=zc(),o=zc(),l=zc();yn(i,t.domain,s),yn(i,t.scheme,o),yn(i,t.slashscheme,l),yn(s,n,a),yn(s,t.domain,s);const u=Wt(s,Q0);Wt(a,Q0,u),Wt(o,Q0,u),Wt(l,Q0,u);const h=Wt(a,_h);yn(h,n,a),yn(h,t.domain,a);const d=zc();yn(u,t.domain,d),yn(d,t.domain,d);const f=Wt(d,_h);yn(f,t.domain,d);const p=zc(o5t);yn(f,t.tld,p),yn(f,t.utld,p),Wt(u,US,p);const g=Wt(d,Uc);Wt(g,Uc,g),yn(g,t.domain,d),yn(p,t.domain,d),Wt(p,_h,f),Wt(p,Uc,g);const m=Wt(s,Uc),y=Wt(s,_h);Wt(m,Uc,m),yn(m,t.domain,s),yn(y,n,a),yn(y,t.domain,s);const v=zc(yA);yn(y,t.tld,v),yn(y,t.utld,v),yn(v,t.domain,s),yn(v,n,a),Wt(v,_h,y),Wt(v,Uc,m),Wt(v,Q0,u);const x=Wt(v,a1),b=zc(yA);yn(x,t.numeric,b);const T=zc(yA),k=zc();yn(T,e,T),yn(T,r,k),yn(k,e,T),yn(k,r,k),Wt(v,Mh,T),Wt(b,Mh,T);const S=Wt(o,a1),C=Wt(l,a1),E=Wt(C,Mh),A=Wt(E,Mh);yn(o,t.domain,s),Wt(o,_h,y),Wt(o,Uc,m),yn(l,t.domain,s),Wt(l,_h,y),Wt(l,Uc,m),yn(S,t.domain,T),Wt(S,Mh,T),Wt(S,NC,T),yn(A,t.domain,T),yn(A,e,T),Wt(A,Mh,T);const M=[[LC,IC],[CM,SM],[EM,AM],[RM,_M],[MM,LM],[IM,$M],[NM,DM],[OM,PM]];for(let L=0;L=0&&f++,i++,h++;if(f<0)i-=h,i0&&(a.push(gB(due,e,s)),s=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);a.push(gB(p,e,g))}}return s.length>0&&a.push(gB(due,e,s)),a}function gB(t,e,r){const n=r[0].s,i=r[r.length-1].e,a=e.slice(n,i);return new t(a,r)}const h5t=typeof console<"u"&&console&&console.warn||(()=>{}),d5t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",zi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function f5t(){return zl.groups={},zi.scanner=null,zi.parser=null,zi.tokenQueue=[],zi.pluginQueue=[],zi.customSchemes=[],zi.initialized=!1,zi}function fue(t,e=!1){if(zi.initialized&&h5t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${d5t}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:a}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=n.extensionManager,l=a||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&s){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ykt=Ti.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Wn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=!((r=t.attrs)===null||r===void 0)&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>JW({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),jkt=Ti.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Wn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!_wt(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return M6e(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:a,tr:s,dispatch:o})=>{if(o){const{$to:l}=s.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(Tr.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(Ir.create(s.doc,l.pos)):s.setSelection(Tr.create(s.doc,l.pos));else{const h=a.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(s.insert(u,d),s.setSelection(Tr.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[P6e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xkt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kkt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Zkt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Qkt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Jkt=Iy.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Wn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[J1({find:Xkt,type:this.type}),J1({find:Zkt,type:this.type})]},addPasteRules(){return[Gp({find:Kkt,type:this.type}),Gp({find:Qkt,type:this.type})]}}),e5t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",t5t="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",dq="numeric",fq="ascii",pq="alpha",MC="asciinumeric",M5="alphanumeric",gq="domain",kEe="emoji",r5t="scheme",n5t="slashscheme",dB="whitespace";function i5t(t,e){return t in e||(e[t]=[]),e[t]}function i1(t,e,r){e[dq]&&(e[MC]=!0,e[M5]=!0),e[fq]&&(e[MC]=!0,e[pq]=!0),e[MC]&&(e[M5]=!0),e[pq]&&(e[M5]=!0),e[M5]&&(e[gq]=!0),e[kEe]&&(e[gq]=!0);for(const n in e){const i=i5t(n,r);i.indexOf(t)<0&&i.push(t)}}function a5t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function zl(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}zl.groups={};zl.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;nt.ta(e,r,n,i),va=(t,e,r,n,i)=>t.tr(e,r,n,i),uue=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),nf="WORD",mq="UWORD",CEe="ASCIINUMERICAL",SEe="ALPHANUMERICAL",US="LOCALHOST",yq="TLD",vq="UTLD",fR="SCHEME",h2="SLASH_SCHEME",rQ="NUM",bq="WS",nQ="NL",LC="OPENBRACE",IC="CLOSEBRACE",SM="OPENBRACKET",EM="CLOSEBRACKET",AM="OPENPAREN",RM="CLOSEPAREN",_M="OPENANGLEBRACKET",MM="CLOSEANGLEBRACKET",LM="FULLWIDTHLEFTPAREN",IM="FULLWIDTHRIGHTPAREN",$M="LEFTCORNERBRACKET",NM="RIGHTCORNERBRACKET",DM="LEFTWHITECORNERBRACKET",OM="RIGHTWHITECORNERBRACKET",PM="FULLWIDTHLESSTHAN",BM="FULLWIDTHGREATERTHAN",FM="AMPERSAND",zM="APOSTROPHE",HM="ASTERISK",Q0="AT",VM="BACKSLASH",WM="BACKTICK",qM="CARET",a1="COLON",iQ="COMMA",GM="DOLLAR",_h="DOT",UM="EQUALS",aQ="EXCLAMATION",Uc="HYPHEN",$C="PERCENT",YM="PIPE",jM="PLUS",XM="POUND",NC="QUERY",sQ="QUOTE",EEe="FULLWIDTHMIDDLEDOT",oQ="SEMI",Mh="SLASH",DC="TILDE",KM="UNDERSCORE",AEe="EMOJI",ZM="SYM";var REe=Object.freeze({__proto__:null,ALPHANUMERICAL:SEe,AMPERSAND:FM,APOSTROPHE:zM,ASCIINUMERICAL:CEe,ASTERISK:HM,AT:Q0,BACKSLASH:VM,BACKTICK:WM,CARET:qM,CLOSEANGLEBRACKET:MM,CLOSEBRACE:IC,CLOSEBRACKET:EM,CLOSEPAREN:RM,COLON:a1,COMMA:iQ,DOLLAR:GM,DOT:_h,EMOJI:AEe,EQUALS:UM,EXCLAMATION:aQ,FULLWIDTHGREATERTHAN:BM,FULLWIDTHLEFTPAREN:LM,FULLWIDTHLESSTHAN:PM,FULLWIDTHMIDDLEDOT:EEe,FULLWIDTHRIGHTPAREN:IM,HYPHEN:Uc,LEFTCORNERBRACKET:$M,LEFTWHITECORNERBRACKET:DM,LOCALHOST:US,NL:nQ,NUM:rQ,OPENANGLEBRACKET:_M,OPENBRACE:LC,OPENBRACKET:SM,OPENPAREN:AM,PERCENT:$C,PIPE:YM,PLUS:jM,POUND:XM,QUERY:NC,QUOTE:sQ,RIGHTCORNERBRACKET:NM,RIGHTWHITECORNERBRACKET:OM,SCHEME:fR,SEMI:oQ,SLASH:Mh,SLASH_SCHEME:h2,SYM:ZM,TILDE:DC,TLD:yq,UNDERSCORE:KM,UTLD:vq,UWORD:mq,WORD:nf,WS:bq});const Vd=/[a-z]/,Mk=new RegExp("\\p{L}","u"),fB=new RegExp("\\p{Emoji}","u"),Wd=/\d/,pB=/\s/,hue="\r",gB=` +`,s5t="️",o5t="‍",mB="";let mA=null,yA=null;function l5t(t=[]){const e={};zl.groups=e;const r=new zl;mA==null&&(mA=due(e5t)),yA==null&&(yA=due(t5t)),Wt(r,"'",zM),Wt(r,"{",LC),Wt(r,"}",IC),Wt(r,"[",SM),Wt(r,"]",EM),Wt(r,"(",AM),Wt(r,")",RM),Wt(r,"<",_M),Wt(r,">",MM),Wt(r,"(",LM),Wt(r,")",IM),Wt(r,"「",$M),Wt(r,"」",NM),Wt(r,"『",DM),Wt(r,"』",OM),Wt(r,"<",PM),Wt(r,">",BM),Wt(r,"&",FM),Wt(r,"*",HM),Wt(r,"@",Q0),Wt(r,"`",WM),Wt(r,"^",qM),Wt(r,":",a1),Wt(r,",",iQ),Wt(r,"$",GM),Wt(r,".",_h),Wt(r,"=",UM),Wt(r,"!",aQ),Wt(r,"-",Uc),Wt(r,"%",$C),Wt(r,"|",YM),Wt(r,"+",jM),Wt(r,"#",XM),Wt(r,"?",NC),Wt(r,'"',sQ),Wt(r,"/",Mh),Wt(r,";",oQ),Wt(r,"~",DC),Wt(r,"_",KM),Wt(r,"\\",VM),Wt(r,"・",EEe);const n=va(r,Wd,rQ,{[dq]:!0});va(n,Wd,n);const i=va(n,Vd,CEe,{[MC]:!0}),a=va(n,Mk,SEe,{[M5]:!0}),s=va(r,Vd,nf,{[fq]:!0});va(s,Wd,i),va(s,Vd,s),va(i,Wd,i),va(i,Vd,i);const o=va(r,Mk,mq,{[pq]:!0});va(o,Vd),va(o,Wd,a),va(o,Mk,o),va(a,Wd,a),va(a,Vd),va(a,Mk,a);const l=Wt(r,gB,nQ,{[dB]:!0}),u=Wt(r,hue,bq,{[dB]:!0}),h=va(r,pB,bq,{[dB]:!0});Wt(r,mB,h),Wt(u,gB,l),Wt(u,mB,h),va(u,pB,h),Wt(h,hue),Wt(h,gB),va(h,pB,h),Wt(h,mB,h);const d=va(r,fB,AEe,{[kEe]:!0});Wt(d,"#"),va(d,fB,d),Wt(d,s5t,d);const f=Wt(d,o5t);Wt(f,"#"),va(f,fB,d);const p=[[Vd,s],[Wd,i]],g=[[Vd,null],[Mk,o],[Wd,a]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?x[gq]=!0:Vd.test(y)?Wd.test(y)?x[MC]=!0:x[fq]=!0:x[dq]=!0,uue(r,y,y,x)}return uue(r,"localhost",US,{ascii:!0}),r.jd=new zl(ZM),{start:r,tokens:Object.assign({groups:e},REe)}}function _Ee(t,e){const r=c5t(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let a=0,s=0;for(;s=0&&(d+=r[s].length,f++),u+=r[s].length,a+=r[s].length,s++;a-=d,s-=f,u-=d,i.push({t:h.t,v:e.slice(a-u,a),s:a-u,e:a})}return i}function c5t(t){const e=[],r=t.length;let n=0;for(;n56319||n+1===r||(a=t.charCodeAt(n+1))<56320||a>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length}return e}function L0(t,e,r,n,i){let a;const s=e.length;for(let o=0;o=0;)a++;if(a>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+a),10);s>0;s--)r.pop();n+=a}else r.push(t[n]),n++}return e}const YS={defaultProtocol:"http",events:null,format:fue,formatHref:fue,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lQ(t,e=null){let r=Object.assign({},YS);t&&(r=Object.assign(r,t instanceof lQ?t.o:t));const n=r.ignoreTags,i=[];for(let a=0;ar?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=YS.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),a=this.toFormattedString(t),s={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return s.href=n,o&&(s.class=o),l&&(s.target=l),u&&(s.rel=u),h&&Object.assign(s,h),{tagName:i,attributes:s,content:a,eventListeners:d}}};function sN(t,e){class r extends MEe{constructor(i,a){super(i,a),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const u5t=sN("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),pue=sN("text"),h5t=sN("nl"),vA=sN("url",{isLink:!0,toHref(t=YS.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==US&&t[1].t===a1}}),zc=t=>new zl(t);function d5t({groups:t}){const e=t.domain.concat([FM,HM,Q0,VM,WM,qM,GM,UM,Uc,rQ,$C,YM,jM,XM,Mh,ZM,DC,KM]),r=[zM,a1,iQ,_h,aQ,$C,NC,sQ,oQ,_M,MM,LC,IC,EM,SM,AM,RM,LM,IM,$M,NM,DM,OM,PM,BM],n=[FM,zM,HM,VM,WM,qM,GM,UM,Uc,LC,IC,$C,YM,jM,XM,NC,Mh,ZM,DC,KM],i=zc(),a=Wt(i,DC);yn(a,n,a),yn(a,t.domain,a);const s=zc(),o=zc(),l=zc();yn(i,t.domain,s),yn(i,t.scheme,o),yn(i,t.slashscheme,l),yn(s,n,a),yn(s,t.domain,s);const u=Wt(s,Q0);Wt(a,Q0,u),Wt(o,Q0,u),Wt(l,Q0,u);const h=Wt(a,_h);yn(h,n,a),yn(h,t.domain,a);const d=zc();yn(u,t.domain,d),yn(d,t.domain,d);const f=Wt(d,_h);yn(f,t.domain,d);const p=zc(u5t);yn(f,t.tld,p),yn(f,t.utld,p),Wt(u,US,p);const g=Wt(d,Uc);Wt(g,Uc,g),yn(g,t.domain,d),yn(p,t.domain,d),Wt(p,_h,f),Wt(p,Uc,g);const m=Wt(s,Uc),y=Wt(s,_h);Wt(m,Uc,m),yn(m,t.domain,s),yn(y,n,a),yn(y,t.domain,s);const v=zc(vA);yn(y,t.tld,v),yn(y,t.utld,v),yn(v,t.domain,s),yn(v,n,a),Wt(v,_h,y),Wt(v,Uc,m),Wt(v,Q0,u);const x=Wt(v,a1),b=zc(vA);yn(x,t.numeric,b);const T=zc(vA),k=zc();yn(T,e,T),yn(T,r,k),yn(k,e,T),yn(k,r,k),Wt(v,Mh,T),Wt(b,Mh,T);const S=Wt(o,a1),C=Wt(l,a1),E=Wt(C,Mh),A=Wt(E,Mh);yn(o,t.domain,s),Wt(o,_h,y),Wt(o,Uc,m),yn(l,t.domain,s),Wt(l,_h,y),Wt(l,Uc,m),yn(S,t.domain,T),Wt(S,Mh,T),Wt(S,NC,T),yn(A,t.domain,T),yn(A,e,T),Wt(A,Mh,T);const M=[[LC,IC],[SM,EM],[AM,RM],[_M,MM],[LM,IM],[$M,NM],[DM,OM],[PM,BM]];for(let L=0;L=0&&f++,i++,h++;if(f<0)i-=h,i0&&(a.push(yB(pue,e,s)),s=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);a.push(yB(p,e,g))}}return s.length>0&&a.push(yB(pue,e,s)),a}function yB(t,e,r){const n=r[0].s,i=r[r.length-1].e,a=e.slice(n,i);return new t(a,r)}const p5t=typeof console<"u"&&console&&console.warn||(()=>{}),g5t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",zi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function m5t(){return zl.groups={},zi.scanner=null,zi.parser=null,zi.tokenQueue=[],zi.pluginQueue=[],zi.customSchemes=[],zi.initialized=!1,zi}function gue(t,e=!1){if(zi.initialized&&p5t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${g5t}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);zi.customSchemes.push([t,e])}function p5t(){zi.scanner=a5t(zi.customSchemes);for(let t=0;t{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),a=e.some(l=>l.getMeta("preventAutolink"));if(!i||a)return;const{tr:s}=n,o=A6e(r.doc,[...e]);if(BZ(o).forEach(({newRange:l})=>{const u=D4t(n.doc,l,f=>f.isTextblock);let h,d;if(u.length>1)h=u[0],d=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=n.doc.textBetween(l.from,l.to," "," ");if(!m5t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(g5t).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],g=h.pos+d.lastIndexOf(p);if(!p)return!1;const m=oQ(p).map(y=>y.toObject(t.defaultProtocol));if(!v5t(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{FZ(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function x5t(t){return new da({key:new fa("handleClickLink"),props:{handleClick:(e,r,n)=>{if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{const l=n.target;if(!l)return!1;const u=t.editor.view.dom;i=l.closest("a"),i&&!u.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,o;const l=j4t(e.state,t.type.name),u=(s=i.href)!==null&&s!==void 0?s:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),a=!0)}return a}}})}const w5t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,T5t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function LEe(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function k5t(t,e){let r=0,n=0;for(;n0}function IEe(t,e,r){var n,i;const[,a,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||LEe(t,(n=e.index)!==null&&n!==void 0?n:0)||k5t(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!a.trim()&&r(s)}function $Ee(t){var e,r;const[n,i,a,,s,o,l]=t,u=(e=s??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:a,title:u||null,markdown:!0}}}function C5t(t,e){return t.index{const n=w5t.exec(r);return!n||!IEe(r,n,t.isAllowedHref)?null:$Ee(n)},type:t.type,getAttributes:NEe});return new kE({find:e.find,handler:r=>{const n=e.handler(r);return n!==null&&r.state.tr.steps.length&&r.state.tr.setMeta("preventAutolink",!0),n}})}function E5t(t){const e=Gp({find:r=>{var n,i;const a=[];for(const o of r.matchAll(T5t))IEe(r,o,t.isAllowedHref)&&a.push($Ee(o));const s=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!a.some(l=>C5t(l,o)));return[...a,...s]},type:t.type,getAttributes:NEe});return new N6e({find:e.find,handler:r=>{var n;const i=e.handler(r);return i!==null&&r.state.tr.steps.length&&(!((n=r.match.data)===null||n===void 0)&&n.markdown)&&r.state.tr.setMeta("preventAutolink",!0),i}})}function A5t(t){return new da({key:new fa("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:a}=e,{selection:s}=a,{empty:o}=s;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=MEe(l,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Wd(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(y5t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const R5t=Iy.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){fue(t);return}fue(t.scheme,t.optionalSlashes)})},onDestroy(){f5t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Wd(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),r=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||r&&!t.includes("@"))return!0;const n=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(n)||!/\./.test(n))}}},addAttributes(){var t,e,r;return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(r=this.options.HTMLAttributes.class)!==null&&r!==void 0?r:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!Wd(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Wd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Wn(this.options.HTMLAttributes,t),0]:["a",Wn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r,n,i,a;const s=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(a=t.attrs)===null||a===void 0?void 0:a.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${s} "${o}")`:`[${l}](${s})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Wd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!Wd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[S5t({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Wd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const r=[];if(e){const{protocols:n,defaultProtocol:i}=this.options;MEe(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:s=>!!Wd(s,n),protocols:n,defaultProtocol:i})).forEach(a=>{this.options.shouldAutoLink(a.value)&&r.push({text:a.value,data:{href:a.href},index:a.start})})}return r};return this.options.markdownLinks?[E5t({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Wd(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Gp({find:t,type:this.type,getAttributes:e=>{var r;return{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(b5t({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Wd(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(x5t({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(A5t({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),vA=" ",mB=" ",_5t=Ti.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];if(r.length===1&&r[0].type==="image")return e.parseChildren([r[0]]);const n=e.parseInline(r);return r.length===1&&r[0].type==="text"&&(r[0].raw===vA||r[0].text===vA||r[0].raw===mB||r[0].text===mB)&&n.length===1&&n[0].type==="text"&&(n[0].text===vA||n[0].text===mB)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e,r)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];if(n.length===0){var i,a;const s=Array.isArray(r==null||(i=r.previousNode)===null||i===void 0?void 0:i.content)?r.previousNode.content:[];return(r==null||(a=r.previousNode)===null||a===void 0?void 0:a.type)==="paragraph"&&s.length===0?vA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),M5t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,L5t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,I5t=Iy.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[J1({find:M5t,type:this.type})]},addPasteRules(){return[Gp({find:L5t,type:this.type})]}}),$5t=Ti.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),N5t=Iy.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const n=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!n)return;const i=n[2].trim();return{type:"underline",raw:n[0],text:i,tokens:r.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function D5t(t={}){return new da({view(e){return new O5t(e,t)}})}class O5t{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let a=s=>{this[i](s)};return e.dom.addEventListener(i,a),{name:i,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,i=this.editorView.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,o=a.height/i.offsetHeight;if(r){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let g=p.getBoundingClientRect(),m=d?g.bottom:g.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*o;n={left:g.left,right:g.right,top:m-y,bottom:m+y}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;n={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,h;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,h=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,p=d.height/l.offsetHeight;u=d.left-l.scrollLeft*f,h=d.top-l.scrollTop*p}this.element.style.left=(n.left-u)/s+"px",this.element.style.top=(n.top-h)/o+"px",this.element.style.width=(n.right-n.left)/s+"px",this.element.style.height=(n.bottom-n.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,a=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!a){let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=xSe(this.editorView.state.doc,s,this.editorView.dragging.slice);o!=null&&(s=o)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ka extends sn{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return ka.valid(n)?new ka(n):sn.near(n)}content(){return Jt.empty}eq(e){return e instanceof ka&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ka(e.resolve(r.pos))}getBookmark(){return new cQ(this.anchor)}static valid(e){let r=e.parent;if(r.inlineContent||!P5t(e)||!B5t(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&ka.valid(e))return e;let i=e.pos,a=null;for(let s=e.depth;;s--){let o=e.node(s);if(r>0?e.indexAfter(s)0){a=o.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=r;let l=e.doc.resolve(i);if(ka.valid(l))return l}for(;;){let s=r>0?a.firstChild:a.lastChild;if(!s){if(a.isAtom&&!a.isText&&!Ir.isSelectable(a)){e=e.doc.resolve(i+a.nodeSize*r),n=!1;continue e}break}a=s,i+=r;let o=e.doc.resolve(i);if(ka.valid(o))return o}return null}}}ka.prototype.visible=!1;ka.findFrom=ka.findGapCursorFrom;sn.jsonID("gapcursor",ka);class cQ{constructor(e){this.pos=e}map(e){return new cQ(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return ka.valid(r)?new ka(r):sn.near(r)}}function DEe(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function P5t(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||DEe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function B5t(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||DEe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function F5t(){return new da({props:{decorations:W5t,createSelectionBetween(t,e,r){return e.pos==r.pos&&ka.valid(r)?new ka(r):null},handleClick:H5t,handleKeyDown:z5t,handleDOMEvents:{beforeinput:V5t}}})}const z5t=g6e({ArrowLeft:bA("horiz",-1),ArrowRight:bA("horiz",1),ArrowUp:bA("vert",-1),ArrowDown:bA("vert",1)});function bA(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,a){let s=n.selection,o=e>0?s.$to:s.$from,l=s.empty;if(s instanceof wr){if(!a.endOfTextblock(r)||o.depth==0)return!1;l=!1,o=n.doc.resolve(e>0?o.after():o.before())}let u=ka.findGapCursorFrom(o,e,l);return u?(i&&i(n.tr.setSelection(new ka(u))),!0):!1}}function H5t(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!ka.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&Ir.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ka(n))),!0)}function V5t(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ka))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=Rt.empty;for(let s=n.length-1;s>=0;s--)i=Rt.from(n[s].createAndFill(null,i));let a=t.state.tr.replace(r.pos,r.pos,new Jt(i,0,0));return a.setSelection(wr.near(a.doc.resolve(r.pos+1))),t.dispatch(a),!1}function W5t(t){if(!(t.selection instanceof ka))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pi.create(t.doc,[Eo.widget(t.selection.head,e,{key:"gapcursor"})])}var ZM=200,$s=function(){};$s.prototype.append=function(e){return e.length?(e=$s.from(e),!this.length&&e||e.length=r?$s.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};$s.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};$s.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};$s.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,s){return i.push(e(a,s))},r,n),i};$s.from=function(e){return e instanceof $s?e:e&&e.length?new OEe(e):$s.empty};var OEe=(function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,s,o){for(var l=a;l=s;l--)if(i(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=ZM)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ZM)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e})($s);$s.empty=new OEe([]);var q5t=(function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return no&&this.right.forEachInner(n,Math.max(i-o,0),Math.min(this.length,a)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,s){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(n,i-o,Math.max(a,o)-o,s+o)===!1||a=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})($s);const G5t=500;let jS=class d2{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;r&&(i=this.remapping(n,this.items.length),a=i.maps.length);let s=e.tr,o,l,u=[],h=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),a=i.maps.length),a--,h.push(d);return}if(i){h.push(new I0(d.map));let p=d.step.map(i.slice(a)),g;p&&s.maybeStep(p).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],u.push(new I0(g,void 0,void 0,u.length+h.length))),a--,g&&i.appendMap(g,a)}else s.maybeStep(d.step);if(d.selection)return o=i?d.selection.map(i.slice(a)):d.selection,l=new d2(this.items.slice(0,n).append(h.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:o}}addTransform(e,r,n,i){let a=[],s=this.eventCount,o=this.items,l=!i&&o.length?o.get(o.length-1):null;for(let h=0;hY5t&&(o=U5t(o,u),s-=u),new d2(o.append(a),s)}remapping(e,r){let n=new zS;return this.items.forEach((i,a)=>{let s=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,s)},e,r),n}addMaps(e){return this.eventCount==0?this:new d2(this.items.append(e.map(r=>new I0(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),a=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(f=>{f.selection&&o--},i);let l=r;this.items.forEach(f=>{let p=a.getMirror(--l);if(p==null)return;s=Math.min(s,p);let g=a.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(a.slice(l+1,p));y&&o++,n.push(new I0(g,m,y))}else n.push(new I0(g))},i);let u=[];for(let f=r;fG5t&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],a=0;return this.items.forEach((s,o)=>{if(o>=e)i.push(s),s.selection&&a++;else if(s.step){let l=s.step.map(r.slice(n)),u=l&&l.getMap();if(n--,u&&r.appendMap(u,n),l){let h=s.selection&&s.selection.map(r.slice(n));h&&a++;let d=new I0(u.invert(),l,h),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&n--},this.items.length,0),new d2($s.from(i.reverse()),a)}};jS.empty=new jS($s.empty,0);function U5t(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}let I0=class PEe{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new PEe(r.getMap().invert(),r,this.selection)}}};class J0{constructor(e,r,n,i,a){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const Y5t=20;function j5t(t,e,r,n){let i=r.getMeta(E1),a;if(i)return i.historyState;r.getMeta(Z5t)&&(t=new J0(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta(E1))return s.getMeta(E1).redo?new J0(t.done.addTransform(r,void 0,n,fR(e)),t.undone,pue(r.mapping.maps),t.prevTime,t.prevComposition):new J0(t.done,t.undone.addTransform(r,void 0,n,fR(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!X5t(r,t.prevRanges)),u=s?yB(t.prevRanges,r.mapping):pue(r.mapping.maps);return new J0(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,fR(e)),jS.empty,u,r.time,o??t.prevComposition)}else return(a=r.getMeta("rebased"))?new J0(t.done.rebased(r,a),t.undone.rebased(r,a),yB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new J0(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),yB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function X5t(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let a=0;a=e[a]&&(r=!0)}),r}function pue(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,a,s)=>e.push(a,s));return e}function yB(t,e){if(!t)return null;let r=[];for(let n=0;n{let i=E1.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let a=K5t(i,r,t);a&&n(e?a.scrollIntoView():a)}return!0}}const FEe=BEe(!1,!0),zEe=BEe(!0,!0);Ki.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new da({key:new fa("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){t=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,l=0,u=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const h=n.tr.deleteRange(l,u);return t=!0,h}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:r.doc}),a=this.storage.characters({node:e.doc});if(a<=n||i>n&&a>n&&a<=i)return!0;if(i>n&&a>n&&a>i||!e.getMeta("paste"))return!1;const s=e.selection.$head.pos,o=s-(a-n),l=s;return e.deleteRange(o,l),!(this.storage.characters({node:e.doc})>n)}})]}});const J5t=Ki.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[D5t(this.options)]}});Ki.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new da({key:new fa("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=e,a=[];if(!r||!n)return pi.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(!l.isText){if(!(i>=u&&i<=u+l.nodeSize-1))return!1;s+=1}});let o=0;return t.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&s-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";a.push(Eo.node(u,u+l.nodeSize,{class:this.options.className}))}),pi.create(t,a)}}})]}});const eCt=Ki.create({name:"gapCursor",addProseMirrorPlugins(){return[F5t()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ei(un(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),HEe="placeholder",mue=new fa("tiptap__placeholder");function VEe(t){const{editor:e,placeholder:r,dataAttribute:n,pos:i,node:a,isEmptyDoc:s,hasAnchor:o,classes:{emptyNode:l,emptyEditor:u}}=t,h=[l];return s&&h.push(u),Eo.node(i,i+a.nodeSize,{class:h.join(" "),[n]:typeof r=="function"?r({editor:e,node:a,pos:i,hasAnchor:o}):r})}function WEe(t,e){return typeof t=="function"?t(e):t}function qEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:a,to:s}){const{anchor:o}=i,l=[],u=t.isEmpty;return n.nodesBetween(a,s,(h,d)=>{const f=o>=d&&o<=d+h.nodeSize,p=!h.isLeaf&&Q$(h);return h.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(VEe({editor:t,isEmptyDoc:u,dataAttribute:r,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:WEe(e.emptyNodeClass,{editor:t,node:h,pos:d,hasAnchor:f})},node:h,pos:d})),e.includeChildren}),l}function GEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=i,s=[],o=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const l=n.resolve(a),u=l.depth>0?l.node(1):l.nodeAfter,h=l.depth>0?l.before(1):a;if(u&&u.type.isTextblock&&Q$(u)){const d=a>=h&&a<=h+u.nodeSize;s.push(VEe({editor:t,isEmptyDoc:o,dataAttribute:r,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:WEe(e.emptyNodeClass,{editor:t,node:u,pos:h,hasAnchor:d})},node:u,pos:h}))}}else s.push(...qEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:0,to:n.content.size}));return pi.create(n,s)}function OC(t,e){const r=t.resolve(e);if(r.depth===0){var n;const a=(n=r.nodeAfter)!==null&&n!==void 0?n:r.nodeBefore;if(!a)return{from:e,to:e};const s=r.nodeAfter?e:e-a.nodeSize;return{from:s,to:s+a.nodeSize}}const i=r.before(1);return{from:i,to:i+r.node(1).nodeSize}}function PC(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function tCt(t,e,r){const n=[];return t.forEach((i,a)=>{const s=a,o=s+i.nodeSize,l=s+1,u=o+1;le&&n.push({from:s,to:o})}),n}function rCt(t){if(t.length===0)return[];const e=[...t].sort((n,i)=>n.from-i.from),r=[{...e[0]}];for(let n=1;ne.from?r.push(PC(t,OC(t,Math.min(e.to,t.content.size+1)-1))):e.fromp.from>=u&&p.to<=h);d.length&&(o=o.remove(d));const f=qEe({editor:r,options:n,dataAttribute:i,doc:a,selection:s,from:u,to:h});f.length&&(o=o.add(a,f))}return o}function oCt({editor:t,options:e,dataAttribute:r}){return{init(n,i){const a=GEe({editor:t,options:e,dataAttribute:r,doc:i.doc,selection:i.selection});return a??pi.empty},apply(n,i,a,s){return!n.docChanged&&!n.selectionSet?i:sCt({decorations:i.map(n.mapping,n.doc),ranges:iCt(n,a,s),editor:t,options:e,dataAttribute:r,doc:s.doc,selection:s.selection})}}}function lCt(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function cCt({editor:t,options:e}){const r=e.dataAttribute?`data-${lCt(e.dataAttribute)}`:`data-${HEe}`,n=e.showOnlyCurrent&&!e.includeChildren;return new da({key:mue,...n?{}:{state:oCt({editor:t,options:e,dataAttribute:r})},props:{decorations:n?({doc:i,selection:a})=>GEe({editor:t,options:e,dataAttribute:r,doc:i,selection:a}):i=>{var a;return e.showOnlyWhenEditable&&!t.isEditable?pi.empty:(a=mue.getState(i))!==null&&a!==void 0?a:pi.empty}}})}Ki.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:HEe,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[cCt({editor:this.editor,options:this.options})]}});function vq(t,e){return!t.selection.empty&&!_6e(t.selection)&&e.isEditable}function uCt(t,e){return vq(t,e)&&!e.isFocused&&!e.view.dragging}function hCt(){var t;(t=window.getSelection())===null||t===void 0||t.removeAllRanges()}function dCt(t){t.focus()}Ki.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new da({key:new fa("selection"),props:{decorations(r){return uCt(r,t)?pi.create(r.doc,[Eo.inline(r.selection.from,r.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(r){return vq(r.state,t)&&hCt(),!1},focus(r){return vq(r.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&r.hasFocus()&&dCt(r)}),!1}}}})]}});function yue({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}const fCt=Ki.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new fa(this.name),r=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)===null||t===void 0?void 0:t.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(r).includes(i.name));return[new da({key:e,appendTransaction:(i,a,s)=>{const{doc:o,tr:l,schema:u}=s,h=e.getState(s),d=o.content.size,f=u.nodes[r];if(!i.some(p=>p.getMeta("skipTrailingNode"))&&h)return l.insert(d,f.create())},state:{init:(i,a)=>{const s=a.tr.doc.lastChild;return!yue({node:s,types:n})},apply:(i,a)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return a;const s=i.doc.lastChild;return!yue({node:s,types:n})}}})]}}),pCt=Ki.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>FEe(t,e),redo:()=>({state:t,dispatch:e})=>zEe(t,e)}},addProseMirrorPlugins(){return[Q5t(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),gCt=Ki.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(Dkt.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(Mkt.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(B6e.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Bkt.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(Hkt.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Vkt.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(J5t.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(eCt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(Wkt.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(qkt.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(pCt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(Gkt.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(Kkt.configure(this.options.italic)),this.options.listItem!==!1&&t.push(W6e.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(G6e.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(R5t.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(Y6e.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(_5t.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(I5t.configure(this.options.strike)),this.options.text!==!1&&t.push($5t.configure(this.options.text)),this.options.underline!==!1){var n;t.push(N5t.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(fCt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var mCt=gCt;const xA="edgeeverMergeDivider",yCt="\x3C!-- edgeever:merge-divider -->",vCt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,bCt=Ti.create({name:xA,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",Wn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${yCt} +3. "-" cannot repeat`);zi.customSchemes.push([t,e])}function y5t(){zi.scanner=l5t(zi.customSchemes);for(let t=0;t{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),a=e.some(l=>l.getMeta("preventAutolink"));if(!i||a)return;const{tr:s}=n,o=R6e(r.doc,[...e]);if(zZ(o).forEach(({newRange:l})=>{const u=B4t(n.doc,l,f=>f.isTextblock);let h,d;if(u.length>1)h=u[0],d=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=n.doc.textBetween(l.from,l.to," "," ");if(!b5t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(v5t).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],g=h.pos+d.lastIndexOf(p);if(!p)return!1;const m=cQ(p).map(y=>y.toObject(t.defaultProtocol));if(!w5t(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{HZ(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function k5t(t){return new da({key:new fa("handleClickLink"),props:{handleClick:(e,r,n)=>{if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{const l=n.target;if(!l)return!1;const u=t.editor.view.dom;i=l.closest("a"),i&&!u.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,o;const l=Z4t(e.state,t.type.name),u=(s=i.href)!==null&&s!==void 0?s:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),a=!0)}return a}}})}const C5t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,S5t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function IEe(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function E5t(t,e){let r=0,n=0;for(;n0}function $Ee(t,e,r){var n,i;const[,a,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||IEe(t,(n=e.index)!==null&&n!==void 0?n:0)||E5t(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!a.trim()&&r(s)}function NEe(t){var e,r;const[n,i,a,,s,o,l]=t,u=(e=s??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:a,title:u||null,markdown:!0}}}function A5t(t,e){return t.index{const n=C5t.exec(r);return!n||!$Ee(r,n,t.isAllowedHref)?null:NEe(n)},type:t.type,getAttributes:DEe});return new CE({find:e.find,handler:r=>{const n=e.handler(r);return n!==null&&r.state.tr.steps.length&&r.state.tr.setMeta("preventAutolink",!0),n}})}function _5t(t){const e=Gp({find:r=>{var n,i;const a=[];for(const o of r.matchAll(S5t))$Ee(r,o,t.isAllowedHref)&&a.push(NEe(o));const s=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!a.some(l=>A5t(l,o)));return[...a,...s]},type:t.type,getAttributes:DEe});return new D6e({find:e.find,handler:r=>{var n;const i=e.handler(r);return i!==null&&r.state.tr.steps.length&&(!((n=r.match.data)===null||n===void 0)&&n.markdown)&&r.state.tr.setMeta("preventAutolink",!0),i}})}function M5t(t){return new da({key:new fa("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:a}=e,{selection:s}=a,{empty:o}=s;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=LEe(l,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function qd(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(x5t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const L5t=Iy.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){gue(t);return}gue(t.scheme,t.optionalSlashes)})},onDestroy(){m5t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!qd(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),r=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||r&&!t.includes("@"))return!0;const n=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(n)||!/\./.test(n))}}},addAttributes(){var t,e,r;return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(r=this.options.HTMLAttributes.class)!==null&&r!==void 0?r:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!qd(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!qd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Wn(this.options.HTMLAttributes,t),0]:["a",Wn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r,n,i,a;const s=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(a=t.attrs)===null||a===void 0?void 0:a.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${s} "${o}")`:`[${l}](${s})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!qd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!qd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[R5t({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!qd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const r=[];if(e){const{protocols:n,defaultProtocol:i}=this.options;LEe(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:s=>!!qd(s,n),protocols:n,defaultProtocol:i})).forEach(a=>{this.options.shouldAutoLink(a.value)&&r.push({text:a.value,data:{href:a.href},index:a.start})})}return r};return this.options.markdownLinks?[_5t({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!qd(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Gp({find:t,type:this.type,getAttributes:e=>{var r;return{href:(r=e.data)===null||r===void 0?void 0:r.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(T5t({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!qd(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(k5t({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(M5t({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),bA=" ",vB=" ",I5t=Ti.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];if(r.length===1&&r[0].type==="image")return e.parseChildren([r[0]]);const n=e.parseInline(r);return r.length===1&&r[0].type==="text"&&(r[0].raw===bA||r[0].text===bA||r[0].raw===vB||r[0].text===vB)&&n.length===1&&n[0].type==="text"&&(n[0].text===bA||n[0].text===vB)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e,r)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];if(n.length===0){var i,a;const s=Array.isArray(r==null||(i=r.previousNode)===null||i===void 0?void 0:i.content)?r.previousNode.content:[];return(r==null||(a=r.previousNode)===null||a===void 0?void 0:a.type)==="paragraph"&&s.length===0?bA:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),$5t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,N5t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,D5t=Iy.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[J1({find:$5t,type:this.type})]},addPasteRules(){return[Gp({find:N5t,type:this.type})]}}),O5t=Ti.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),P5t=Iy.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const n=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!n)return;const i=n[2].trim();return{type:"underline",raw:n[0],text:i,tokens:r.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function B5t(t={}){return new da({view(e){return new F5t(e,t)}})}class F5t{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let a=s=>{this[i](s)};return e.dom.addEventListener(i,a),{name:i,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,i=this.editorView.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,o=a.height/i.offsetHeight;if(r){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let g=p.getBoundingClientRect(),m=d?g.bottom:g.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*o;n={left:g.left,right:g.right,top:m-y,bottom:m+y}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;n={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,h;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,h=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,p=d.height/l.offsetHeight;u=d.left-l.scrollLeft*f,h=d.top-l.scrollTop*p}this.element.style.left=(n.left-u)/s+"px",this.element.style.top=(n.top-h)/o+"px",this.element.style.width=(n.right-n.left)/s+"px",this.element.style.height=(n.bottom-n.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,a=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!a){let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=wSe(this.editorView.state.doc,s,this.editorView.dragging.slice);o!=null&&(s=o)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ka extends sn{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return ka.valid(n)?new ka(n):sn.near(n)}content(){return Jt.empty}eq(e){return e instanceof ka&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ka(e.resolve(r.pos))}getBookmark(){return new hQ(this.anchor)}static valid(e){let r=e.parent;if(r.inlineContent||!z5t(e)||!H5t(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&ka.valid(e))return e;let i=e.pos,a=null;for(let s=e.depth;;s--){let o=e.node(s);if(r>0?e.indexAfter(s)0){a=o.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=r;let l=e.doc.resolve(i);if(ka.valid(l))return l}for(;;){let s=r>0?a.firstChild:a.lastChild;if(!s){if(a.isAtom&&!a.isText&&!Ir.isSelectable(a)){e=e.doc.resolve(i+a.nodeSize*r),n=!1;continue e}break}a=s,i+=r;let o=e.doc.resolve(i);if(ka.valid(o))return o}return null}}}ka.prototype.visible=!1;ka.findFrom=ka.findGapCursorFrom;sn.jsonID("gapcursor",ka);class hQ{constructor(e){this.pos=e}map(e){return new hQ(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return ka.valid(r)?new ka(r):sn.near(r)}}function OEe(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function z5t(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||OEe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function H5t(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||OEe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function V5t(){return new da({props:{decorations:U5t,createSelectionBetween(t,e,r){return e.pos==r.pos&&ka.valid(r)?new ka(r):null},handleClick:q5t,handleKeyDown:W5t,handleDOMEvents:{beforeinput:G5t}}})}const W5t=m6e({ArrowLeft:xA("horiz",-1),ArrowRight:xA("horiz",1),ArrowUp:xA("vert",-1),ArrowDown:xA("vert",1)});function xA(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,a){let s=n.selection,o=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Tr){if(!a.endOfTextblock(r)||o.depth==0)return!1;l=!1,o=n.doc.resolve(e>0?o.after():o.before())}let u=ka.findGapCursorFrom(o,e,l);return u?(i&&i(n.tr.setSelection(new ka(u))),!0):!1}}function q5t(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!ka.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&Ir.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ka(n))),!0)}function G5t(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ka))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=Rt.empty;for(let s=n.length-1;s>=0;s--)i=Rt.from(n[s].createAndFill(null,i));let a=t.state.tr.replace(r.pos,r.pos,new Jt(i,0,0));return a.setSelection(Tr.near(a.doc.resolve(r.pos+1))),t.dispatch(a),!1}function U5t(t){if(!(t.selection instanceof ka))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pi.create(t.doc,[Eo.widget(t.selection.head,e,{key:"gapcursor"})])}var QM=200,$s=function(){};$s.prototype.append=function(e){return e.length?(e=$s.from(e),!this.length&&e||e.length=r?$s.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};$s.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};$s.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};$s.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,s){return i.push(e(a,s))},r,n),i};$s.from=function(e){return e instanceof $s?e:e&&e.length?new PEe(e):$s.empty};var PEe=(function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,s,o){for(var l=a;l=s;l--)if(i(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=QM)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=QM)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e})($s);$s.empty=new PEe([]);var Y5t=(function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return no&&this.right.forEachInner(n,Math.max(i-o,0),Math.min(this.length,a)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,s){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(n,i-o,Math.max(a,o)-o,s+o)===!1||a=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})($s);const j5t=500;let jS=class d2{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;r&&(i=this.remapping(n,this.items.length),a=i.maps.length);let s=e.tr,o,l,u=[],h=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),a=i.maps.length),a--,h.push(d);return}if(i){h.push(new I0(d.map));let p=d.step.map(i.slice(a)),g;p&&s.maybeStep(p).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],u.push(new I0(g,void 0,void 0,u.length+h.length))),a--,g&&i.appendMap(g,a)}else s.maybeStep(d.step);if(d.selection)return o=i?d.selection.map(i.slice(a)):d.selection,l=new d2(this.items.slice(0,n).append(h.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:o}}addTransform(e,r,n,i){let a=[],s=this.eventCount,o=this.items,l=!i&&o.length?o.get(o.length-1):null;for(let h=0;hK5t&&(o=X5t(o,u),s-=u),new d2(o.append(a),s)}remapping(e,r){let n=new zS;return this.items.forEach((i,a)=>{let s=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,s)},e,r),n}addMaps(e){return this.eventCount==0?this:new d2(this.items.append(e.map(r=>new I0(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),a=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(f=>{f.selection&&o--},i);let l=r;this.items.forEach(f=>{let p=a.getMirror(--l);if(p==null)return;s=Math.min(s,p);let g=a.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(a.slice(l+1,p));y&&o++,n.push(new I0(g,m,y))}else n.push(new I0(g))},i);let u=[];for(let f=r;fj5t&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],a=0;return this.items.forEach((s,o)=>{if(o>=e)i.push(s),s.selection&&a++;else if(s.step){let l=s.step.map(r.slice(n)),u=l&&l.getMap();if(n--,u&&r.appendMap(u,n),l){let h=s.selection&&s.selection.map(r.slice(n));h&&a++;let d=new I0(u.invert(),l,h),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&n--},this.items.length,0),new d2($s.from(i.reverse()),a)}};jS.empty=new jS($s.empty,0);function X5t(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}let I0=class BEe{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new BEe(r.getMap().invert(),r,this.selection)}}};class J0{constructor(e,r,n,i,a){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const K5t=20;function Z5t(t,e,r,n){let i=r.getMeta(E1),a;if(i)return i.historyState;r.getMeta(eCt)&&(t=new J0(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta(E1))return s.getMeta(E1).redo?new J0(t.done.addTransform(r,void 0,n,pR(e)),t.undone,mue(r.mapping.maps),t.prevTime,t.prevComposition):new J0(t.done,t.undone.addTransform(r,void 0,n,pR(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!Q5t(r,t.prevRanges)),u=s?bB(t.prevRanges,r.mapping):mue(r.mapping.maps);return new J0(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,pR(e)),jS.empty,u,r.time,o??t.prevComposition)}else return(a=r.getMeta("rebased"))?new J0(t.done.rebased(r,a),t.undone.rebased(r,a),bB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new J0(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),bB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function Q5t(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let a=0;a=e[a]&&(r=!0)}),r}function mue(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,a,s)=>e.push(a,s));return e}function bB(t,e){if(!t)return null;let r=[];for(let n=0;n{let i=E1.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let a=J5t(i,r,t);a&&n(e?a.scrollIntoView():a)}return!0}}const zEe=FEe(!1,!0),HEe=FEe(!0,!0);Ki.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new da({key:new fa("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){t=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,l=0,u=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const h=n.tr.deleteRange(l,u);return t=!0,h}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:r.doc}),a=this.storage.characters({node:e.doc});if(a<=n||i>n&&a>n&&a<=i)return!0;if(i>n&&a>n&&a>i||!e.getMeta("paste"))return!1;const s=e.selection.$head.pos,o=s-(a-n),l=s;return e.deleteRange(o,l),!(this.storage.characters({node:e.doc})>n)}})]}});const rCt=Ki.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[B5t(this.options)]}});Ki.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new da({key:new fa("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=e,a=[];if(!r||!n)return pi.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(!l.isText){if(!(i>=u&&i<=u+l.nodeSize-1))return!1;s+=1}});let o=0;return t.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&s-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";a.push(Eo.node(u,u+l.nodeSize,{class:this.options.className}))}),pi.create(t,a)}}})]}});const nCt=Ki.create({name:"gapCursor",addProseMirrorPlugins(){return[V5t()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ei(un(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),VEe="placeholder",vue=new fa("tiptap__placeholder");function WEe(t){const{editor:e,placeholder:r,dataAttribute:n,pos:i,node:a,isEmptyDoc:s,hasAnchor:o,classes:{emptyNode:l,emptyEditor:u}}=t,h=[l];return s&&h.push(u),Eo.node(i,i+a.nodeSize,{class:h.join(" "),[n]:typeof r=="function"?r({editor:e,node:a,pos:i,hasAnchor:o}):r})}function qEe(t,e){return typeof t=="function"?t(e):t}function GEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:a,to:s}){const{anchor:o}=i,l=[],u=t.isEmpty;return n.nodesBetween(a,s,(h,d)=>{const f=o>=d&&o<=d+h.nodeSize,p=!h.isLeaf&&eN(h);return h.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(WEe({editor:t,isEmptyDoc:u,dataAttribute:r,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qEe(e.emptyNodeClass,{editor:t,node:h,pos:d,hasAnchor:f})},node:h,pos:d})),e.includeChildren}),l}function UEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=i,s=[],o=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const l=n.resolve(a),u=l.depth>0?l.node(1):l.nodeAfter,h=l.depth>0?l.before(1):a;if(u&&u.type.isTextblock&&eN(u)){const d=a>=h&&a<=h+u.nodeSize;s.push(WEe({editor:t,isEmptyDoc:o,dataAttribute:r,hasAnchor:d,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:qEe(e.emptyNodeClass,{editor:t,node:u,pos:h,hasAnchor:d})},node:u,pos:h}))}}else s.push(...GEe({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:0,to:n.content.size}));return pi.create(n,s)}function OC(t,e){const r=t.resolve(e);if(r.depth===0){var n;const a=(n=r.nodeAfter)!==null&&n!==void 0?n:r.nodeBefore;if(!a)return{from:e,to:e};const s=r.nodeAfter?e:e-a.nodeSize;return{from:s,to:s+a.nodeSize}}const i=r.before(1);return{from:i,to:i+r.node(1).nodeSize}}function PC(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function iCt(t,e,r){const n=[];return t.forEach((i,a)=>{const s=a,o=s+i.nodeSize,l=s+1,u=o+1;le&&n.push({from:s,to:o})}),n}function aCt(t){if(t.length===0)return[];const e=[...t].sort((n,i)=>n.from-i.from),r=[{...e[0]}];for(let n=1;ne.from?r.push(PC(t,OC(t,Math.min(e.to,t.content.size+1)-1))):e.fromp.from>=u&&p.to<=h);d.length&&(o=o.remove(d));const f=GEe({editor:r,options:n,dataAttribute:i,doc:a,selection:s,from:u,to:h});f.length&&(o=o.add(a,f))}return o}function uCt({editor:t,options:e,dataAttribute:r}){return{init(n,i){const a=UEe({editor:t,options:e,dataAttribute:r,doc:i.doc,selection:i.selection});return a??pi.empty},apply(n,i,a,s){return!n.docChanged&&!n.selectionSet?i:cCt({decorations:i.map(n.mapping,n.doc),ranges:oCt(n,a,s),editor:t,options:e,dataAttribute:r,doc:s.doc,selection:s.selection})}}}function hCt(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function dCt({editor:t,options:e}){const r=e.dataAttribute?`data-${hCt(e.dataAttribute)}`:`data-${VEe}`,n=e.showOnlyCurrent&&!e.includeChildren;return new da({key:vue,...n?{}:{state:uCt({editor:t,options:e,dataAttribute:r})},props:{decorations:n?({doc:i,selection:a})=>UEe({editor:t,options:e,dataAttribute:r,doc:i,selection:a}):i=>{var a;return e.showOnlyWhenEditable&&!t.isEditable?pi.empty:(a=vue.getState(i))!==null&&a!==void 0?a:pi.empty}}})}Ki.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:VEe,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[dCt({editor:this.editor,options:this.options})]}});function xq(t,e){return!t.selection.empty&&!M6e(t.selection)&&e.isEditable}function fCt(t,e){return xq(t,e)&&!e.isFocused&&!e.view.dragging}function pCt(){var t;(t=window.getSelection())===null||t===void 0||t.removeAllRanges()}function gCt(t){t.focus()}Ki.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new da({key:new fa("selection"),props:{decorations(r){return fCt(r,t)?pi.create(r.doc,[Eo.inline(r.selection.from,r.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(r){return xq(r.state,t)&&pCt(),!1},focus(r){return xq(r.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&r.hasFocus()&&gCt(r)}),!1}}}})]}});function bue({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}const mCt=Ki.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new fa(this.name),r=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)===null||t===void 0?void 0:t.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(r).includes(i.name));return[new da({key:e,appendTransaction:(i,a,s)=>{const{doc:o,tr:l,schema:u}=s,h=e.getState(s),d=o.content.size,f=u.nodes[r];if(!i.some(p=>p.getMeta("skipTrailingNode"))&&h)return l.insert(d,f.create())},state:{init:(i,a)=>{const s=a.tr.doc.lastChild;return!bue({node:s,types:n})},apply:(i,a)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return a;const s=i.doc.lastChild;return!bue({node:s,types:n})}}})]}}),yCt=Ki.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zEe(t,e),redo:()=>({state:t,dispatch:e})=>HEe(t,e)}},addProseMirrorPlugins(){return[tCt(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vCt=Ki.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(Bkt.configure(this.options.bold)),this.options.blockquote!==!1&&t.push($kt.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(F6e.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Hkt.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(qkt.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Gkt.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(rCt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(nCt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(Ukt.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(Ykt.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(yCt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(jkt.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(Jkt.configure(this.options.italic)),this.options.listItem!==!1&&t.push(q6e.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(U6e.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(L5t.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(j6e.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(I5t.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(D5t.configure(this.options.strike)),this.options.text!==!1&&t.push(O5t.configure(this.options.text)),this.options.underline!==!1){var n;t.push(P5t.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(mCt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var bCt=vCt;const wA="edgeeverMergeDivider",xCt="\x3C!-- edgeever:merge-divider -->",wCt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,TCt=Ti.create({name:wA,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",Wn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${xCt} ----`},parseMarkdown(t,e){return e.createNode(xA)},markdownTokenizer:{name:xA,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=vCt.exec(t);if(e)return{type:xA,raw:e[0],text:""}}}}),uQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),UEe=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},xCt={aac:"audio/aac",aiff:"audio/aiff",ape:"audio/x-ape",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",weba:"audio/webm",wma:"audio/x-ms-wma"},wCt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:xCt[UEe(e)]??null},hb=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=UEe(e);return r.startsWith("image/")?"image":wCt(r,e)?"audio":r.startsWith("video/")?"video":r==="application/pdf"||n==="pdf"?"pdf":r.includes("spreadsheet")||r.includes("excel")||["xls","xlsx","xlsm","ods","csv"].includes(n)?"spreadsheet":r.includes("word")||r.includes("wordprocessingml")||["doc","docx","odt","rtf"].includes(n)?"document":r.includes("presentation")||r.includes("powerpoint")||["ppt","pptx","odp","key"].includes(n)?"presentation":r.includes("zip")||r.includes("compressed")||r.includes("tar")||r.includes("rar")||r.includes("gzip")||["zip","rar","7z","tar","gz","bz2","xz"].includes(n)?"archive":r.includes("javascript")||r.includes("typescript")||r.includes("json")||r.includes("xml")||r.includes("yaml")||["js","jsx","ts","tsx","json","xml","yaml","yml","html","css","sh","py","java","go","rs"].includes(n)?"code":r.startsWith("text/")||["txt","md","log"].includes(n)?"text":"file"},TCt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",text:"TXT",file:"FILE"},Up=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},kCt=t=>{const e=Up(t);if(e===null)return null;const r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1),i=e/1024**n;return`${n===0?i.toFixed(0):i.toFixed(i>=10?1:2)} ${r[n]}`},CCt=(t,e)=>TCt[hb(t,e)],SCt=(t,e,r)=>[CCt(t,e),kCt(r)].filter(Boolean).join(" · "),B2="edgeeverPdfAttachment",vue=t=>t==="inline"?"inline":"compact",ECt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,bue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,ACt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),RCt=Ti.create({name:B2,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-pdf-url")||"",renderHTML:t=>({"data-pdf-url":t.url||""})},label:{default:"PDF",parseHTML:t=>t.getAttribute("data-pdf-label")||"PDF",renderHTML:t=>({"data-pdf-label":t.label||"PDF"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-pdf-name")||"",renderHTML:t=>({"data-pdf-name":t.filename||""})},mimeType:{default:"application/pdf",parseHTML:t=>t.getAttribute("data-pdf-mime-type")||"application/pdf",renderHTML:t=>({"data-pdf-mime-type":t.mimeType||"application/pdf"})},byteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=Up(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>vue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":vue(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:B2,attrs:{url:t.url||"",label:t.label||"PDF",filename:uQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${ACt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:B2,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=ECt.exec(t);if(!(!e||!bue(null,e[1])&&!bue(null,e[2])))return{type:B2,raw:e[0],label:e[1],url:e[2]}}}}),F2="edgeeverFileAttachment",_Ct=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,MCt=/^\s*(?:附件[::]|Attachment:)\s*/i,LCt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,ICt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),$Ct=(t,e)=>{const r=uQ(t)||t||e;return hb(null,r)==="pdf"||hb(null,e)==="pdf"?!1:MCt.test(t)||LCt.test(e)||hb(null,r)!=="file"},NCt=Ti.create({name:F2,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-file-url")||"",renderHTML:t=>({"data-file-url":t.url||""})},label:{default:"Attachment",parseHTML:t=>t.getAttribute("data-file-label")||"Attachment",renderHTML:t=>({"data-file-label":t.label||"Attachment"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-file-name")||"",renderHTML:t=>({"data-file-name":t.filename||""})},mimeType:{default:"",parseHTML:t=>t.getAttribute("data-file-mime-type")||"",renderHTML:t=>({"data-file-mime-type":t.mimeType||""})},byteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=Up(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:F2,attrs:{url:t.url||"",label:e,filename:uQ(e),mimeType:"",byteSize:null}}},renderMarkdown:t=>{var e,r;return`[${ICt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:F2,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=_Ct.exec(t);if(!(!e||!$Ct(e[1],e[2])))return{type:F2,raw:e[0],label:e[1],url:e[2]}}}}),QM="blockMath",JM="inlineMath",DCt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},YEe=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!DCt(t,n))return n;return-1},OCt={name:JM,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=YEe(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` -`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:JM,raw:r,latex:n}}},PCt={name:QM,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=YEe(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:QM,raw:t.slice(0,e+2),latex:r}}},BCt=Ti.create({name:JM,group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:JM,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:OCt}),FCt=Ti.create({name:QM,group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",Wn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:QM,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:PCt}),zCt=()=>[FCt.configure(),BCt.configure()],L5="edgeeverPluginEmbed",jEe="edgeever-plugin-embed",Ev=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",xue=t=>{if(!t||typeof t!="object")return null;const e=t,r=Ev(e.id,160),n=Ev(e.pluginId,160),i=Ev(e.type,120),a=Ev(e.resourceId,200);if(!r||!n||!i||!a)return null;const s=typeof e.dataJson=="string"?e.dataJson:"null";try{JSON.parse(s)}catch{return null}return{id:r,pluginId:n,type:i,resourceId:a,previewResourceId:Ev(e.previewResourceId,200),title:Ev(e.title,500),dataJson:s}},HCt=t=>`\`\`\`${jEe} +---`},parseMarkdown(t,e){return e.createNode(wA)},markdownTokenizer:{name:wA,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=wCt.exec(t);if(e)return{type:wA,raw:e[0],text:""}}}}),dQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),YEe=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},kCt={aac:"audio/aac",aiff:"audio/aiff",ape:"audio/x-ape",flac:"audio/flac",m4a:"audio/mp4",mp3:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg",wav:"audio/wav",weba:"audio/webm",wma:"audio/x-ms-wma"},CCt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:kCt[YEe(e)]??null},hb=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=YEe(e);return r.startsWith("image/")?"image":CCt(r,e)?"audio":r.startsWith("video/")?"video":r==="application/pdf"||n==="pdf"?"pdf":r.includes("spreadsheet")||r.includes("excel")||["xls","xlsx","xlsm","ods","csv"].includes(n)?"spreadsheet":r.includes("word")||r.includes("wordprocessingml")||["doc","docx","odt","rtf"].includes(n)?"document":r.includes("presentation")||r.includes("powerpoint")||["ppt","pptx","odp","key"].includes(n)?"presentation":r.includes("zip")||r.includes("compressed")||r.includes("tar")||r.includes("rar")||r.includes("gzip")||["zip","rar","7z","tar","gz","bz2","xz"].includes(n)?"archive":r.includes("javascript")||r.includes("typescript")||r.includes("json")||r.includes("xml")||r.includes("yaml")||["js","jsx","ts","tsx","json","xml","yaml","yml","html","css","sh","py","java","go","rs"].includes(n)?"code":r.startsWith("text/")||["txt","md","log"].includes(n)?"text":"file"},SCt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",text:"TXT",file:"FILE"},Up=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},ECt=t=>{const e=Up(t);if(e===null)return null;const r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1),i=e/1024**n;return`${n===0?i.toFixed(0):i.toFixed(i>=10?1:2)} ${r[n]}`},ACt=(t,e)=>SCt[hb(t,e)],RCt=(t,e,r)=>[ACt(t,e),ECt(r)].filter(Boolean).join(" · "),B2="edgeeverPdfAttachment",xue=t=>t==="inline"?"inline":"compact",_Ct=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,wue=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,MCt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),LCt=Ti.create({name:B2,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-pdf-url")||"",renderHTML:t=>({"data-pdf-url":t.url||""})},label:{default:"PDF",parseHTML:t=>t.getAttribute("data-pdf-label")||"PDF",renderHTML:t=>({"data-pdf-label":t.label||"PDF"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-pdf-name")||"",renderHTML:t=>({"data-pdf-name":t.filename||""})},mimeType:{default:"application/pdf",parseHTML:t=>t.getAttribute("data-pdf-mime-type")||"application/pdf",renderHTML:t=>({"data-pdf-mime-type":t.mimeType||"application/pdf"})},byteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=Up(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>xue(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":xue(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:B2,attrs:{url:t.url||"",label:t.label||"PDF",filename:dQ(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${MCt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:B2,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=_Ct.exec(t);if(!(!e||!wue(null,e[1])&&!wue(null,e[2])))return{type:B2,raw:e[0],label:e[1],url:e[2]}}}}),F2="edgeeverFileAttachment",ICt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,$Ct=/^\s*(?:附件[::]|Attachment:)\s*/i,NCt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,DCt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),OCt=(t,e)=>{const r=dQ(t)||t||e;return hb(null,r)==="pdf"||hb(null,e)==="pdf"?!1:$Ct.test(t)||NCt.test(e)||hb(null,r)!=="file"},PCt=Ti.create({name:F2,group:"inline",inline:!0,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{url:{default:"",parseHTML:t=>t.getAttribute("data-file-url")||"",renderHTML:t=>({"data-file-url":t.url||""})},label:{default:"Attachment",parseHTML:t=>t.getAttribute("data-file-label")||"Attachment",renderHTML:t=>({"data-file-label":t.label||"Attachment"})},filename:{default:"",parseHTML:t=>t.getAttribute("data-file-name")||"",renderHTML:t=>({"data-file-name":t.filename||""})},mimeType:{default:"",parseHTML:t=>t.getAttribute("data-file-mime-type")||"",renderHTML:t=>({"data-file-mime-type":t.mimeType||""})},byteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=Up(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:F2,attrs:{url:t.url||"",label:e,filename:dQ(e),mimeType:"",byteSize:null}}},renderMarkdown:t=>{var e,r;return`[${DCt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:F2,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=ICt.exec(t);if(!(!e||!OCt(e[1],e[2])))return{type:F2,raw:e[0],label:e[1],url:e[2]}}}}),JM="blockMath",eL="inlineMath",BCt=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},jEe=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!BCt(t,n))return n;return-1},FCt={name:eL,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=jEe(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` +`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:eL,raw:r,latex:n}}},zCt={name:JM,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=jEe(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:JM,raw:t.slice(0,e+2),latex:r}}},HCt=Ti.create({name:eL,group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",Wn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:eL,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:FCt}),VCt=Ti.create({name:JM,group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",Wn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:JM,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:zCt}),WCt=()=>[VCt.configure(),HCt.configure()],L5="edgeeverPluginEmbed",XEe="edgeever-plugin-embed",Ev=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",Tue=t=>{if(!t||typeof t!="object")return null;const e=t,r=Ev(e.id,160),n=Ev(e.pluginId,160),i=Ev(e.type,120),a=Ev(e.resourceId,200);if(!r||!n||!i||!a)return null;const s=typeof e.dataJson=="string"?e.dataJson:"null";try{JSON.parse(s)}catch{return null}return{id:r,pluginId:n,type:i,resourceId:a,previewResourceId:Ev(e.previewResourceId,200),title:Ev(e.title,500),dataJson:s}},qCt=t=>`\`\`\`${XEe} ${JSON.stringify(t)} -\`\`\``,VCt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,WCt=Ti.create({name:L5,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{id:{default:""},pluginId:{default:""},type:{default:""},resourceId:{default:""},previewResourceId:{default:""},title:{default:""},dataJson:{default:"null"}}},parseHTML(){return[{tag:'figure[data-type="edgeever-plugin-embed"]'}]},renderHTML({HTMLAttributes:t}){const e=typeof t.title=="string"&&t.title?t.title:"Plugin embed";return["figure",Wn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:L5,attrs:t.attrs}),renderMarkdown:t=>{const e=xue(t.attrs);return e?HCt(e):""},markdownTokenizer:{name:L5,level:"block",start(t){return t.indexOf(`\`\`\`${jEe}`)},tokenize(t){const e=VCt.exec(t);if(e)try{const r=xue(JSON.parse(e[1]));return r?{type:L5,raw:e[0],attrs:r}:void 0}catch{return}}}}),hQ="edgeeverUnsupportedBlock",XS="edgeeverUnsupportedInline",SE="edgeeverUnsupportedMark",KS=new Set([hQ,XS]),XEe=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider","inlineMath","blockMath",...KS]),bq=new Set(["bold","italic","strike","underline","code","link",SE]),qCt=new Set([...XEe,F2,B2,L5]),KEe=new Set(["paragraph","heading"]),aN=t=>t.type==="text"&&"text"in t,ZS=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",zT=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:`Unsupported content: ${t}`,GCt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:zT(t.type,e)}),ZEe=t=>{if(typeof(t==null?void 0:t.originalJson)!="string")return null;try{const e=JSON.parse(t.originalJson);return e&&typeof e.type=="string"?e:null}catch{return null}},UCt=t=>{if(typeof(t==null?void 0:t.originalMarksJson)!="string")return[];try{const e=JSON.parse(t.originalMarksJson);return Array.isArray(e)?e.filter(r=>!!(r&&typeof r=="object"&&typeof r.type=="string")):[]}catch{return[]}},YCt=Ti.create({name:hQ,group:"block",atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"div[data-edgeever-unsupported-block]"}]},renderHTML({node:t}){const e=ZS(t.attrs);return["div",{"data-edgeever-unsupported-block":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--block",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:zT(e)]}}),jCt=Ti.create({name:XS,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-inline]"}]},renderHTML({node:t}){const e=ZS(t.attrs);return["span",{"data-edgeever-unsupported-inline":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--inline",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:zT(e)]}}),XCt=Iy.create({name:SE,addAttributes(){return{originalMarksJson:{default:"[]"}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-mark]"}]},renderHTML(){return["span",{"data-edgeever-unsupported-mark":"true",class:"edgeever-unsupported-mark"},0]}}),KCt=()=>[YCt,jCt,XCt],ZCt=t=>{const e=t.marks??[],r=e.filter(i=>bq.has(i.type));return e.filter(i=>!bq.has(i.type)).length?{...t,marks:[...r,{type:SE,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},QCt=(t,e)=>{const r=(n,i)=>{if(aN(n))return ZCt(n);if(!XEe.has(n.type))return{type:KEe.has(i)?XS:hQ,attrs:GCt(n,e)};const a=n;return KS.has(a.type)?a:a.content?{...a,content:a.content.map(s=>r(s,a.type))}:a};return{...t,content:t.content.map(n=>r(n,"doc"))}},dQ=t=>{const e=r=>{var i;if(KS.has(r.type)){const a=r;return ZEe(a.attrs)??{type:r.type===XS?"text":"paragraph",...r.type===XS?{text:zT(ZS(a.attrs))}:{content:[{type:"text",text:zT(ZS(a.attrs))}]}}}if(aN(r)){const a=r,s=(i=a.marks)==null?void 0:i.find(l=>l.type===SE),o=s?UCt(s.attrs):a.marks??[];return o.length?{...a,marks:o}:{type:"text",text:a.text}}const n=r;return n.content?{...n,content:n.content.map(e)}:n};return{...t,content:t.content.map(r=>e(r))}},QEe=t=>{var e;return aN(t)?t.text:((e=t.content)==null?void 0:e.map(QEe).filter(Boolean).join(" "))??""},JCt=t=>{const e=(r,n)=>{var a;if(aN(r)){const s=r;return{...s,marks:(a=s.marks)==null?void 0:a.filter(o=>bq.has(o.type)&&o.type!==SE)}}if(!qCt.has(r.type)||KS.has(r.type)){const s=r,o=KS.has(r.type)?ZEe(s.attrs):s,l=(o==null?void 0:o.type)??ZS(s.attrs),h=(o?QEe(o):"")||zT(l);return KEe.has(n)?{type:"text",text:h}:{type:"paragraph",content:[{type:"text",text:h}]}}const i=r;return i.content?{...i,content:i.content.map(s=>e(s,i.type))}:i};return{...t,content:t.content.map(r=>e(r,"doc"))}},eSt="edgeeverImageGallery",tSt=["auto","2","3","1"],wue=t=>tSt.includes(t)?t:"auto",rSt=Ti.create({name:eSt,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>wue(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":wue(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",Wn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` +\`\`\``,GCt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,UCt=Ti.create({name:L5,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{id:{default:""},pluginId:{default:""},type:{default:""},resourceId:{default:""},previewResourceId:{default:""},title:{default:""},dataJson:{default:"null"}}},parseHTML(){return[{tag:'figure[data-type="edgeever-plugin-embed"]'}]},renderHTML({HTMLAttributes:t}){const e=typeof t.title=="string"&&t.title?t.title:"Plugin embed";return["figure",Wn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:L5,attrs:t.attrs}),renderMarkdown:t=>{const e=Tue(t.attrs);return e?qCt(e):""},markdownTokenizer:{name:L5,level:"block",start(t){return t.indexOf(`\`\`\`${XEe}`)},tokenize(t){const e=GCt.exec(t);if(e)try{const r=Tue(JSON.parse(e[1]));return r?{type:L5,raw:e[0],attrs:r}:void 0}catch{return}}}}),fQ="edgeeverUnsupportedBlock",XS="edgeeverUnsupportedInline",EE="edgeeverUnsupportedMark",KS=new Set([fQ,XS]),KEe=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider","inlineMath","blockMath",...KS]),wq=new Set(["bold","italic","strike","underline","code","link",EE]),YCt=new Set([...KEe,F2,B2,L5]),ZEe=new Set(["paragraph","heading"]),oN=t=>t.type==="text"&&"text"in t,ZS=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",zT=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:`Unsupported content: ${t}`,jCt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:zT(t.type,e)}),QEe=t=>{if(typeof(t==null?void 0:t.originalJson)!="string")return null;try{const e=JSON.parse(t.originalJson);return e&&typeof e.type=="string"?e:null}catch{return null}},XCt=t=>{if(typeof(t==null?void 0:t.originalMarksJson)!="string")return[];try{const e=JSON.parse(t.originalMarksJson);return Array.isArray(e)?e.filter(r=>!!(r&&typeof r=="object"&&typeof r.type=="string")):[]}catch{return[]}},KCt=Ti.create({name:fQ,group:"block",atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"div[data-edgeever-unsupported-block]"}]},renderHTML({node:t}){const e=ZS(t.attrs);return["div",{"data-edgeever-unsupported-block":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--block",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:zT(e)]}}),ZCt=Ti.create({name:XS,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{originalType:{default:"unknown"},originalJson:{default:""},displayLabel:{default:""}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-inline]"}]},renderHTML({node:t}){const e=ZS(t.attrs);return["span",{"data-edgeever-unsupported-inline":"true","data-original-type":e,class:"edgeever-unsupported-content edgeever-unsupported-content--inline",contenteditable:"false"},typeof t.attrs.displayLabel=="string"&&t.attrs.displayLabel?t.attrs.displayLabel:zT(e)]}}),QCt=Iy.create({name:EE,addAttributes(){return{originalMarksJson:{default:"[]"}}},parseHTML(){return[{tag:"span[data-edgeever-unsupported-mark]"}]},renderHTML(){return["span",{"data-edgeever-unsupported-mark":"true",class:"edgeever-unsupported-mark"},0]}}),JCt=()=>[KCt,ZCt,QCt],eSt=t=>{const e=t.marks??[],r=e.filter(i=>wq.has(i.type));return e.filter(i=>!wq.has(i.type)).length?{...t,marks:[...r,{type:EE,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},tSt=(t,e)=>{const r=(n,i)=>{if(oN(n))return eSt(n);if(!KEe.has(n.type))return{type:ZEe.has(i)?XS:fQ,attrs:jCt(n,e)};const a=n;return KS.has(a.type)?a:a.content?{...a,content:a.content.map(s=>r(s,a.type))}:a};return{...t,content:t.content.map(n=>r(n,"doc"))}},pQ=t=>{const e=r=>{var i;if(KS.has(r.type)){const a=r;return QEe(a.attrs)??{type:r.type===XS?"text":"paragraph",...r.type===XS?{text:zT(ZS(a.attrs))}:{content:[{type:"text",text:zT(ZS(a.attrs))}]}}}if(oN(r)){const a=r,s=(i=a.marks)==null?void 0:i.find(l=>l.type===EE),o=s?XCt(s.attrs):a.marks??[];return o.length?{...a,marks:o}:{type:"text",text:a.text}}const n=r;return n.content?{...n,content:n.content.map(e)}:n};return{...t,content:t.content.map(r=>e(r))}},JEe=t=>{var e;return oN(t)?t.text:((e=t.content)==null?void 0:e.map(JEe).filter(Boolean).join(" "))??""},rSt=t=>{const e=(r,n)=>{var a;if(oN(r)){const s=r;return{...s,marks:(a=s.marks)==null?void 0:a.filter(o=>wq.has(o.type)&&o.type!==EE)}}if(!YCt.has(r.type)||KS.has(r.type)){const s=r,o=KS.has(r.type)?QEe(s.attrs):s,l=(o==null?void 0:o.type)??ZS(s.attrs),h=(o?JEe(o):"")||zT(l);return ZEe.has(n)?{type:"text",text:h}:{type:"paragraph",content:[{type:"text",text:h}]}}const i=r;return i.content?{...i,content:i.content.map(s=>e(s,i.type))}:i};return{...t,content:t.content.map(r=>e(r,"doc"))}},QS="edgeeverImageGallery",e7e=["auto","2","3","1"],Tq=t=>e7e.includes(t)?t:"auto",nSt=Ti.create({name:QS,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>Tq(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":Tq(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",Wn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` -`)}}),nSt=new lq({extensions:[mCt,X6e,j6e.configure({nested:!0}),E3t,Dwt,rSt,RCt,NCt,bCt,WCt,...zCt(),Ekt.configure({markedOptions:{gfm:!0}})]}),iSt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=e7e(JCt(xq(t)));return nSt.serialize(r).replaceAll(JEe,"\\$")},JEe="edgeever-dollar",e7e=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",JEe)}:t:Array.isArray(e.content)?{...e,content:e.content.map(e7e)}:t},xq=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=aSt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(xq)]}}return Array.isArray(e.content)?{...e,content:e.content.map(xq)}:t},aSt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""},wq=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],sSt=["professional","friendly","casual","direct"],oSt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],lSt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],cSt=4,Tue=4*1024*1024,uSt=256*1024,hSt=8*1024*1024,t7e=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},dSt=t=>t.startsWith("text/")||t==="application/json",fQ=["none","target-language","tone"],pQ=["append","replace","both"],Av=(t,e,r)=>({...t,...e,translations:{"zh-CN":e,"en-US":r}});Av({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")}),Av({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."}),Av({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."}),Av({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."}),Av({key:"rewrite-proofread",action:"rewrite-proofread",parameterKind:"none",resultMode:"both"},{name:"转为小红书风格",description:"改写成自然、有吸引力的小红书笔记",instruction:"将内容改写成适合小红书发布的笔记:生成吸引人的标题,使用自然、有亲和力的口吻、短段落和清晰层次,可适量加入贴合语义的 Emoji,并在结尾给出 3–8 个相关话题标签。保留原文的关键事实与观点,不夸大效果,不编造经历、数据或结论。只返回可直接发布的内容。"},{name:"Convert to Xiaohongshu style",description:"Rewrite as a natural and engaging Xiaohongshu post",instruction:"Rewrite the content as a Xiaohongshu-ready post. Add an engaging title, use a natural and approachable voice, short paragraphs, and clear structure, include a few contextually appropriate emoji, and end with 3–8 relevant hashtags. Preserve the source's key facts and claims without exaggerating results or inventing experiences, data, or conclusions. Return only the publishable post."}),Av({key:"simplify-language",action:"simplify-language",parameterKind:"none",resultMode:"both"},{name:"转为推特风格",description:"改写成简洁、有观点的推文或推文串",instruction:"将内容改写成适合推特发布的文本:开头直接抓住重点,表达简洁、有观点、易读。内容较短时输出一条推文;无法在一条内保留关键信息时,输出带序号的精简推文串。只在确有帮助时使用少量标签。保留原文事实与立场,不制造噱头或编造信息。只返回可直接发布的内容。"},{name:"Convert to X (Twitter) style",description:"Rewrite as a concise, opinionated post or thread",instruction:"Rewrite the content for X (Twitter): lead with the main point and make it concise, opinionated, and easy to scan. Return one post when the key information fits; otherwise return a compact numbered thread. Use hashtags sparingly and only when useful. Preserve the source's facts and position without manufacturing hype or information. Return only the publishable post or thread."});const fSt=new Set([F2,B2]),Lk=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},kue="edgeever-attachment-kind-",gQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),r7e=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(a=>a&&a!=="edgeever-attachment-link"&&!a.startsWith(kue)):[],i=hb(e,gQ(t));return[...n,"edgeever-attachment-link",`${kue}${i}`].join(" ")},pSt=Ki.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Up(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":SCt(n,r,e)}}}}}]}}),Cue=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},gSt=t=>{var e;return(e=t.marks)!=null&&e.some(Cue)?{...t,marks:t.marks.map(r=>{var n,i;return Cue(r)?{...r,attrs:{...r.attrs,class:r7e(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:gQ(t.text)}}:r})}:t},mSt=t=>{var s;const e=Lk(t,"url"),r=Lk(t,"label")||Lk(t,"filename")||"Attachment",n=Lk(t,"mimeType"),i=Lk(t,"filename")||gQ(r),a=Up((s=t.attrs)==null?void 0:s.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:r7e(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:a}}]}:{}}},ySt=t=>{const e=r=>fSt.has(r.type)?mSt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?gSt(r):r;return{...t,content:t.content.map(r=>e(r))}};var Sue;function xt(t,e,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),o._zod.traits.has(t))return;o._zod.traits.add(t),e(o,l);const u=s.prototype,h=Object.keys(u);for(let d=0;d{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(t)}}),Object.defineProperty(s,"name",{value:t}),s}class db extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Sue=globalThis).__zod_globalConfig??(Sue.__zod_globalConfig={});const mQ=globalThis.__zod_globalConfig;function ny(t){return mQ}function i7e(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Tq(t,e){return typeof e=="bigint"?e.toString():e}function sN(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function yQ(t){return t==null}function vQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function vSt(t,e){const r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function QS(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const xSt=sN(()=>{var t;if(mQ.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function JS(t){if(QS(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(QS(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function s7e(t){return JS(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const wSt=new Set(["string","number","symbol"]);function HT(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bg(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r!=null&&r.parent)&&(n._zod.parent=t),n}function _r(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function TSt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const kSt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function CSt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=vg(t._zod.def,{get shape(){const s={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(s[o]=r.shape[o])}return Ny(this,"shape",s),s},checks:[]});return bg(t,a)}function SSt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=vg(t._zod.def,{get shape(){const s={...t._zod.def.shape};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete s[o]}return Ny(this,"shape",s),s},checks:[]});return bg(t,a)}function ESt(t,e){if(!JS(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const a=t._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=vg(t._zod.def,{get shape(){const a={...t._zod.def.shape,...e};return Ny(this,"shape",a),a}});return bg(t,i)}function ASt(t,e){if(!JS(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=vg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return Ny(this,"shape",n),n}});return bg(t,r)}function RSt(t,e){var n;if((n=t._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=vg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return Ny(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return bg(t,r)}function _St(t,e,r){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=vg(e._zod.def,{get shape(){const o=e._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=t?new t({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=t?new t({type:"optional",innerType:o[u]}):o[u];return Ny(this,"shape",l),l},checks:[]});return bg(e,s)}function MSt(t,e,r){const n=vg(e._zod.def,{get shape(){const i=e._zod.def.shape,a={...i};if(r)for(const s in r){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new t({type:"nonoptional",innerType:i[s]}))}else for(const s in i)a[s]=new t({type:"nonoptional",innerType:i[s]});return Ny(this,"shape",a),a}});return bg(e,n)}function z2(t,e=0){var r;if(t.aborted===!0)return!0;for(let n=e;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function wA(t){return typeof t=="string"?t:t==null?void 0:t.message}function iy(t,e,r){var l,u,h,d,f,p;const n=t.message?t.message:wA((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??wA((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??wA((f=r.customError)==null?void 0:f.call(r,t))??wA((p=r.localeError)==null?void 0:p.call(r,t))??"Invalid input",{inst:i,continue:a,input:s,...o}=t;return o.path??(o.path=[]),o.message=n,e!=null&&e.reportInput&&(o.input=s),o}function bQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function e6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const l7e=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Tq,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},c7e=xt("$ZodError",l7e),u7e=xt("$ZodError",l7e,{Parent:Error});function ISt(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function $St(t,e=r=>r.message){const r={_errors:[]},n=(i,a=[])=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>n({issues:o},[...a,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...a,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...a,...s.path]);else{const o=[...a,...s.path];if(o.length===0)r._errors.push(e(s));else{let l=r,u=0;for(;u(e,r,n,i)=>{const a=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new db;if(s.issues.length){const o=new((i==null?void 0:i.Err)??t)(s.issues.map(l=>iy(l,a,ny())));throw a7e(o,i==null?void 0:i.callee),o}return s.value},wQ=t=>async(e,r,n,i)=>{const a=n?{...n,async:!0}:{async:!0};let s=e._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const o=new((i==null?void 0:i.Err)??t)(s.issues.map(l=>iy(l,a,ny())));throw a7e(o,i==null?void 0:i.callee),o}return s.value},oN=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new db;return a.issues.length?{success:!1,error:new(t??c7e)(a.issues.map(s=>iy(s,i,ny())))}:{success:!0,data:a.value}},NSt=oN(u7e),lN=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(s=>iy(s,i,ny())))}:{success:!0,data:a.value}},DSt=lN(u7e),OSt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return xQ(t)(e,r,i)},PSt=t=>(e,r,n)=>xQ(t)(e,r,n),BSt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return wQ(t)(e,r,i)},FSt=t=>async(e,r,n)=>wQ(t)(e,r,n),zSt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return oN(t)(e,r,i)},HSt=t=>(e,r,n)=>oN(t)(e,r,n),VSt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return lN(t)(e,r,i)},WSt=t=>async(e,r,n)=>lN(t)(e,r,n),qSt=/^[cC][0-9a-z]{6,}$/,GSt=/^[0-9a-z]+$/,USt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,YSt=/^[0-9a-vA-V]{20}$/,jSt=/^[A-Za-z0-9]{27}$/,XSt=/^[a-zA-Z0-9_-]{21}$/,KSt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ZSt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Rue=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,QSt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,JSt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function e6t(){return new RegExp(JSt,"u")}const t6t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r6t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,n6t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,i6t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,a6t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,h7e=/^[A-Za-z0-9_-]*$/,s6t=/^https?$/,o6t=/^\+[1-9]\d{6,14}$/,d7e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",l6t=new RegExp(`^${d7e}$`);function f7e(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function c6t(t){return new RegExp(`^${f7e(t)}$`)}function u6t(t){const e=f7e({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${d7e}T(?:${n})$`)}const h6t=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},d6t=/^-?\d+$/,f6t=/^-?\d+(?:\.\d+)?$/,p6t=/^(?:true|false)$/i,g6t=/^[^A-Z]*$/,m6t=/^[^a-z]*$/,rc=xt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),p7e={number:"number",bigint:"bigint",object:"date"},g7e=xt("$ZodCheckLessThan",(t,e)=>{rc.init(t,e);const r=p7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{rc.init(t,e);const r=p7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),y6t=xt("$ZodCheckMultipleOf",(t,e)=>{rc.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):vSt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),v6t=xt("$ZodCheckNumberFormat",(t,e)=>{var s;rc.init(t,e),e.format=e.format||"float64";const r=(s=e.format)==null?void 0:s.includes("int"),n=r?"int":"number",[i,a]=kSt[e.format];t._zod.onattach.push(o=>{const l=o._zod.bag;l.format=e.format,l.minimum=i,l.maximum=a,r&&(l.pattern=d6t)}),t._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}la&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),b6t=xt("$ZodCheckMaxLength",(t,e)=>{var r;rc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!yQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=n.value;if(i.length<=e.maximum)return;const s=bQ(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),x6t=xt("$ZodCheckMinLength",(t,e)=>{var r;rc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!yQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const s=bQ(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),w6t=xt("$ZodCheckLengthEquals",(t,e)=>{var r;rc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!yQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,a=i.length;if(a===e.length)return;const s=bQ(i),o=a>e.length;n.issues.push({origin:s,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),cN=xt("$ZodCheckStringFormat",(t,e)=>{var r,n;rc.init(t,e),t._zod.onattach.push(i=>{const a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),T6t=xt("$ZodCheckRegex",(t,e)=>{cN.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),k6t=xt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=g6t),cN.init(t,e)}),C6t=xt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=m6t),cN.init(t,e)}),S6t=xt("$ZodCheckIncludes",(t,e)=>{rc.init(t,e);const r=HT(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),E6t=xt("$ZodCheckStartsWith",(t,e)=>{rc.init(t,e);const r=new RegExp(`^${HT(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),A6t=xt("$ZodCheckEndsWith",(t,e)=>{rc.init(t,e);const r=new RegExp(`.*${HT(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),R6t=xt("$ZodCheckOverwrite",(t,e)=>{rc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class _6t{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(` +`)}}),iSt=new uq({extensions:[bCt,K6e,X6e.configure({nested:!0}),_3t,Bwt,nSt,LCt,PCt,TCt,UCt,...WCt(),_kt.configure({markedOptions:{gfm:!0}})]}),aSt=t=>{if(!t||typeof t!="object"||!Array.isArray(t.content))return"";const r=r7e(rSt(kq(t)));return iSt.serialize(r).replaceAll(t7e,"\\$")},t7e="edgeever-dollar",r7e=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",t7e)}:t:Array.isArray(e.content)?{...e,content:e.content.map(r7e)}:t},kq=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=sSt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(kq)]}}return Array.isArray(e.content)?{...e,content:e.content.map(kq)}:t},sSt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""},Cq=["summarize","extract-key-points","extract-todos","rewrite-proofread","translate","improve-writing","fix-spelling-grammar","make-shorter","make-longer","simplify-language","change-tone","continue-writing","custom"],oSt=["professional","friendly","casual","direct"],lSt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt"],cSt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],uSt=4,kue=4*1024*1024,hSt=256*1024,dSt=8*1024*1024,n7e=t=>{if(!t||t.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))return null;const e=t.endsWith("==")?2:t.endsWith("=")?1:0;return t.length/4*3-e},fSt=t=>t.startsWith("text/")||t==="application/json",gQ=["none","target-language","tone"],mQ=["append","replace","both"],Av=(t,e,r)=>({...t,...e,translations:{"zh-CN":e,"en-US":r}});Av({key:"summarize",action:"summarize",parameterKind:"none",resultMode:"append"},{name:"总结",description:"压缩全文,提炼主题、结论与可执行结果",instruction:["对笔记做真正的精简总结,不要逐句改写、同义复述或回声式重写。","识别中心主题、主要主张、关键结论与可执行结果。","省略重复、修辞、举例、引语和次要细节,除非它们对理解关键结论必不可少。","较长笔记目标约为原文 20–30% 篇幅,用 3–7 条简洁 Markdown 要点;短笔记用 1–3 句即可。","不要大段照搬原文,也不要添加原文没有的信息。","保持笔记原语言,只返回 Markdown 总结。"].join("")},{name:"Summarize",description:"Condense the note into its topic, conclusions, and actionable outcomes",instruction:["Create a genuinely condensed summary of the note rather than rewriting, paraphrasing line by line, or echoing it. ","Identify the central topic, main claims, essential conclusions, and actionable outcomes. ","Omit repetition, rhetorical phrasing, examples, quotations, and minor details unless necessary to understand a key conclusion. ","For a substantial note, target roughly 20–30% of the source length and use 3–7 concise Markdown bullet points; for a short note, use 1–3 concise sentences. ","Do not reproduce long passages verbatim or add facts that are not present in the source. ","Preserve the note's language and return only the summary in Markdown."].join("")}),Av({key:"translate",action:"translate",parameterKind:"target-language",resultMode:"both"},{name:"翻译",description:"翻译为指定目标语言,保留结构与格式",instruction:"将完整笔记翻译成用户指定的目标语言。保留原意、Markdown 结构、链接与代码块。只返回译文,不要评论。"},{name:"Translate",description:"Translate into a selected language while preserving formatting",instruction:"Translate the complete note into the target language specified by the user. Preserve its meaning, Markdown structure, links, and code blocks. Return only the translated note without commentary."}),Av({key:"improve-writing",action:"improve-writing",parameterKind:"none",resultMode:"both"},{name:"润色",description:"校正语言并提升文字的清晰度与流畅度",instruction:"润色内容,修正错别字、语法与标点,改善用词、句式、清晰度和流畅度,但不要改变原意或刻意缩短内容。保持原语言与有用的 Markdown 格式。只返回润色后的内容。"},{name:"Polish",description:"Correct the language and improve clarity and flow",instruction:"Polish the content by correcting spelling, grammar, and punctuation and improving word choice, sentence structure, clarity, and flow. Do not change its meaning or deliberately shorten it. Preserve its language and useful Markdown formatting. Return only the polished content."}),Av({key:"make-shorter",action:"make-shorter",parameterKind:"none",resultMode:"both"},{name:"精炼表达",description:"删去重复与冗余,让表达更简洁有力",instruction:"精炼内容,删除重复、空话和不必要的修饰,合并可以合并的句子,使表达简洁、清晰、有力。保留所有关键事实、观点与原意,不要添加新信息。保持原语言与有用的 Markdown 格式。只返回精炼后的内容。"},{name:"Make concise",description:"Remove repetition and make the writing concise and direct",instruction:"Refine the content by removing repetition, filler, and unnecessary modifiers and by combining sentences where useful. Make it concise, clear, and direct while preserving every key fact, claim, and the original meaning. Do not add new information. Preserve its language and useful Markdown formatting. Return only the refined content."}),Av({key:"rewrite-proofread",action:"rewrite-proofread",parameterKind:"none",resultMode:"both"},{name:"转为小红书风格",description:"改写成自然、有吸引力的小红书笔记",instruction:"将内容改写成适合小红书发布的笔记:生成吸引人的标题,使用自然、有亲和力的口吻、短段落和清晰层次,可适量加入贴合语义的 Emoji,并在结尾给出 3–8 个相关话题标签。保留原文的关键事实与观点,不夸大效果,不编造经历、数据或结论。只返回可直接发布的内容。"},{name:"Convert to Xiaohongshu style",description:"Rewrite as a natural and engaging Xiaohongshu post",instruction:"Rewrite the content as a Xiaohongshu-ready post. Add an engaging title, use a natural and approachable voice, short paragraphs, and clear structure, include a few contextually appropriate emoji, and end with 3–8 relevant hashtags. Preserve the source's key facts and claims without exaggerating results or inventing experiences, data, or conclusions. Return only the publishable post."}),Av({key:"simplify-language",action:"simplify-language",parameterKind:"none",resultMode:"both"},{name:"转为推特风格",description:"改写成简洁、有观点的推文或推文串",instruction:"将内容改写成适合推特发布的文本:开头直接抓住重点,表达简洁、有观点、易读。内容较短时输出一条推文;无法在一条内保留关键信息时,输出带序号的精简推文串。只在确有帮助时使用少量标签。保留原文事实与立场,不制造噱头或编造信息。只返回可直接发布的内容。"},{name:"Convert to X (Twitter) style",description:"Rewrite as a concise, opinionated post or thread",instruction:"Rewrite the content for X (Twitter): lead with the main point and make it concise, opinionated, and easy to scan. Return one post when the key information fits; otherwise return a compact numbered thread. Use hashtags sparingly and only when useful. Preserve the source's facts and position without manufacturing hype or information. Return only the publishable post or thread."});const pSt=new Set([F2,B2]),Lk=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},Cue="edgeever-attachment-kind-",yQ=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),i7e=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(a=>a&&a!=="edgeever-attachment-link"&&!a.startsWith(Cue)):[],i=hb(e,yQ(t));return[...n,"edgeever-attachment-link",`${Cue}${i}`].join(" ")},gSt=Ki.create({name:"edgeeverNativeAttachmentMetadata",addGlobalAttributes(){return[{types:["link"],attributes:{attachmentFilename:{default:null,parseHTML:t=>t.getAttribute("data-attachment-filename"),renderHTML:t=>t.attachmentFilename?{"data-attachment-filename":String(t.attachmentFilename)}:{}},attachmentMimeType:{default:null,parseHTML:t=>t.getAttribute("data-attachment-mime-type"),renderHTML:t=>t.attachmentMimeType?{"data-attachment-mime-type":String(t.attachmentMimeType)}:{}},attachmentByteSize:{default:null,parseHTML:t=>Up(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Up(t.attachmentByteSize),r=typeof t.attachmentFilename=="string"?t.attachmentFilename:"",n=typeof t.attachmentMimeType=="string"?t.attachmentMimeType:"";return!r&&!n&&e===null?{}:{...e===null?{}:{"data-attachment-byte-size":String(e)},"data-attachment-meta":RCt(n,r,e)}}}}}]}}),Sue=t=>{var n,i;if(t.type!=="link")return!1;const e=typeof((n=t.attrs)==null?void 0:n.href)=="string"?t.attrs.href:"";return(typeof((i=t.attrs)==null?void 0:i.class)=="string"?t.attrs.class:"").split(/\s+/).includes("edgeever-attachment-link")||e.includes("/api/v1/resources/")},mSt=t=>{var e;return(e=t.marks)!=null&&e.some(Sue)?{...t,marks:t.marks.map(r=>{var n,i;return Sue(r)?{...r,attrs:{...r.attrs,class:i7e(t.text,null,(n=r.attrs)==null?void 0:n.class),attachmentFilename:typeof((i=r.attrs)==null?void 0:i.attachmentFilename)=="string"?r.attrs.attachmentFilename:yQ(t.text)}}:r})}:t},ySt=t=>{var s;const e=Lk(t,"url"),r=Lk(t,"label")||Lk(t,"filename")||"Attachment",n=Lk(t,"mimeType"),i=Lk(t,"filename")||yQ(r),a=Up((s=t.attrs)==null?void 0:s.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:i7e(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:a}}]}:{}}},vSt=t=>{const e=r=>pSt.has(r.type)?ySt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?mSt(r):r;return{...t,content:t.content.map(r=>e(r))}};var Eue;function xt(t,e,r){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),o._zod.traits.has(t))return;o._zod.traits.add(t),e(o,l);const u=s.prototype,h=Object.keys(u);for(let d=0;d{var l,u;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(u=(l=o==null?void 0:o._zod)==null?void 0:l.traits)==null?void 0:u.has(t)}}),Object.defineProperty(s,"name",{value:t}),s}class db extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class a7e extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(Eue=globalThis).__zod_globalConfig??(Eue.__zod_globalConfig={});const vQ=globalThis.__zod_globalConfig;function ny(t){return vQ}function s7e(t){const e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Sq(t,e){return typeof e=="bigint"?e.toString():e}function lN(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function bQ(t){return t==null}function xQ(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function bSt(t,e){const r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function JS(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const wSt=lN(()=>{var t;if(vQ.jitless||typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function e6(t){if(JS(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(JS(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function l7e(t){return e6(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const TSt=new Set(["string","number","symbol"]);function HT(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bg(t,e,r){const n=new t._zod.constr(e??t._zod.def);return(!e||r!=null&&r.parent)&&(n._zod.parent=t),n}function _r(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function kSt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const CSt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function SSt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=vg(t._zod.def,{get shape(){const s={};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(s[o]=r.shape[o])}return Ny(this,"shape",s),s},checks:[]});return bg(t,a)}function ESt(t,e){const r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=vg(t._zod.def,{get shape(){const s={...t._zod.def.shape};for(const o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete s[o]}return Ny(this,"shape",s),s},checks:[]});return bg(t,a)}function ASt(t,e){if(!e6(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const a=t._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=vg(t._zod.def,{get shape(){const a={...t._zod.def.shape,...e};return Ny(this,"shape",a),a}});return bg(t,i)}function RSt(t,e){if(!e6(e))throw new Error("Invalid input to safeExtend: expected a plain object");const r=vg(t._zod.def,{get shape(){const n={...t._zod.def.shape,...e};return Ny(this,"shape",n),n}});return bg(t,r)}function _St(t,e){var n;if((n=t._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=vg(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e._zod.def.shape};return Ny(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return bg(t,r)}function MSt(t,e,r){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=vg(e._zod.def,{get shape(){const o=e._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=t?new t({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=t?new t({type:"optional",innerType:o[u]}):o[u];return Ny(this,"shape",l),l},checks:[]});return bg(e,s)}function LSt(t,e,r){const n=vg(e._zod.def,{get shape(){const i=e._zod.def.shape,a={...i};if(r)for(const s in r){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new t({type:"nonoptional",innerType:i[s]}))}else for(const s in i)a[s]=new t({type:"nonoptional",innerType:i[s]});return Ny(this,"shape",a),a}});return bg(e,n)}function z2(t,e=0){var r;if(t.aborted===!0)return!0;for(let n=e;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function TA(t){return typeof t=="string"?t:t==null?void 0:t.message}function iy(t,e,r){var l,u,h,d,f,p;const n=t.message?t.message:TA((h=(u=(l=t.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:h.call(u,t))??TA((d=e==null?void 0:e.error)==null?void 0:d.call(e,t))??TA((f=r.customError)==null?void 0:f.call(r,t))??TA((p=r.localeError)==null?void 0:p.call(r,t))??"Invalid input",{inst:i,continue:a,input:s,...o}=t;return o.path??(o.path=[]),o.message=n,e!=null&&e.reportInput&&(o.input=s),o}function wQ(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function t6(...t){const[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}const u7e=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Sq,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},h7e=xt("$ZodError",u7e),d7e=xt("$ZodError",u7e,{Parent:Error});function $St(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function NSt(t,e=r=>r.message){const r={_errors:[]},n=(i,a=[])=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>n({issues:o},[...a,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...a,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...a,...s.path]);else{const o=[...a,...s.path];if(o.length===0)r._errors.push(e(s));else{let l=r,u=0;for(;u(e,r,n,i)=>{const a=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new db;if(s.issues.length){const o=new((i==null?void 0:i.Err)??t)(s.issues.map(l=>iy(l,a,ny())));throw o7e(o,i==null?void 0:i.callee),o}return s.value},kQ=t=>async(e,r,n,i)=>{const a=n?{...n,async:!0}:{async:!0};let s=e._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const o=new((i==null?void 0:i.Err)??t)(s.issues.map(l=>iy(l,a,ny())));throw o7e(o,i==null?void 0:i.callee),o}return s.value},cN=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new db;return a.issues.length?{success:!1,error:new(t??h7e)(a.issues.map(s=>iy(s,i,ny())))}:{success:!0,data:a.value}},DSt=cN(d7e),uN=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(s=>iy(s,i,ny())))}:{success:!0,data:a.value}},OSt=uN(d7e),PSt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return TQ(t)(e,r,i)},BSt=t=>(e,r,n)=>TQ(t)(e,r,n),FSt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return kQ(t)(e,r,i)},zSt=t=>async(e,r,n)=>kQ(t)(e,r,n),HSt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return cN(t)(e,r,i)},VSt=t=>(e,r,n)=>cN(t)(e,r,n),WSt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return uN(t)(e,r,i)},qSt=t=>async(e,r,n)=>uN(t)(e,r,n),GSt=/^[cC][0-9a-z]{6,}$/,USt=/^[0-9a-z]+$/,YSt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jSt=/^[0-9a-vA-V]{20}$/,XSt=/^[A-Za-z0-9]{27}$/,KSt=/^[a-zA-Z0-9_-]{21}$/,ZSt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QSt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_ue=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,JSt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e6t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function t6t(){return new RegExp(e6t,"u")}const r6t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,n6t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,i6t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,a6t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,s6t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,f7e=/^[A-Za-z0-9_-]*$/,o6t=/^https?$/,l6t=/^\+[1-9]\d{6,14}$/,p7e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",c6t=new RegExp(`^${p7e}$`);function g7e(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function u6t(t){return new RegExp(`^${g7e(t)}$`)}function h6t(t){const e=g7e({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${r.join("|")})`;return new RegExp(`^${p7e}T(?:${n})$`)}const d6t=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},f6t=/^-?\d+$/,p6t=/^-?\d+(?:\.\d+)?$/,g6t=/^(?:true|false)$/i,m6t=/^[^A-Z]*$/,y6t=/^[^a-z]*$/,tc=xt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),m7e={number:"number",bigint:"bigint",object:"date"},y7e=xt("$ZodCheckLessThan",(t,e)=>{tc.init(t,e);const r=m7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{tc.init(t,e);const r=m7e[typeof e.value];t._zod.onattach.push(n=>{const i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),v6t=xt("$ZodCheckMultipleOf",(t,e)=>{tc.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):bSt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),b6t=xt("$ZodCheckNumberFormat",(t,e)=>{var s;tc.init(t,e),e.format=e.format||"float64";const r=(s=e.format)==null?void 0:s.includes("int"),n=r?"int":"number",[i,a]=CSt[e.format];t._zod.onattach.push(o=>{const l=o._zod.bag;l.format=e.format,l.minimum=i,l.maximum=a,r&&(l.pattern=f6t)}),t._zod.check=o=>{const l=o.value;if(r){if(!Number.isInteger(l)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}la&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),x6t=xt("$ZodCheckMaxLength",(t,e)=>{var r;tc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!bQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=n.value;if(i.length<=e.maximum)return;const s=wQ(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),w6t=xt("$ZodCheckMinLength",(t,e)=>{var r;tc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!bQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{const i=n.value;if(i.length>=e.minimum)return;const s=wQ(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),T6t=xt("$ZodCheckLengthEquals",(t,e)=>{var r;tc.init(t,e),(r=t._zod.def).when??(r.when=n=>{const i=n.value;return!bQ(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{const i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{const i=n.value,a=i.length;if(a===e.length)return;const s=wQ(i),o=a>e.length;n.issues.push({origin:s,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),hN=xt("$ZodCheckStringFormat",(t,e)=>{var r,n;tc.init(t,e),t._zod.onattach.push(i=>{const a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),k6t=xt("$ZodCheckRegex",(t,e)=>{hN.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),C6t=xt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=m6t),hN.init(t,e)}),S6t=xt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=y6t),hN.init(t,e)}),E6t=xt("$ZodCheckIncludes",(t,e)=>{tc.init(t,e);const r=HT(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),A6t=xt("$ZodCheckStartsWith",(t,e)=>{tc.init(t,e);const r=new RegExp(`^${HT(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),R6t=xt("$ZodCheckEndsWith",(t,e)=>{tc.init(t,e);const r=new RegExp(`.*${HT(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),_6t=xt("$ZodCheckOverwrite",(t,e)=>{tc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class M6t{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(` `).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),a=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of a)this.content.push(s)}compile(){const e=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new e(...r,i.join(` -`))}}const M6t={major:4,minor:4,patch:3},Ma=xt("$ZodType",(t,e)=>{var i;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=M6t;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const a of n)for(const s of a._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const a=(o,l,u)=>{let h=z2(o),d;for(const f of l){if(f._zod.def.when){if(LSt(o)||!f._zod.def.when(o))continue}else if(h)continue;const p=o.issues.length,g=f._zod.check(o);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new db;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=z2(o,p)))});else{if(o.issues.length===p)continue;h||(h=z2(o,p))}}return d?d.then(()=>o):o},s=(o,l,u)=>{if(z2(o))return o.aborted=!0,o;const h=a(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new db;return h.then(d=>t._zod.parse(d,u))}return t._zod.parse(h,u)};t._zod.run=(o,l)=>{if(l.skipChecks)return t._zod.parse(o,l);if(l.direction==="backward"){const h=t._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(d=>s(d,o,l)):s(h,o,l)}const u=t._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new db;return u.then(h=>a(h,n,l))}return a(u,n,l)}}ci(t,"~standard",()=>({validate:a=>{var s;try{const o=NSt(t,a);return o.success?{value:o.data}:{issues:(s=o.error)==null?void 0:s.issues}}catch{return DSt(t,a).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),TQ=xt("$ZodString",(t,e)=>{var r;Ma.init(t,e),t._zod.pattern=[...((r=t==null?void 0:t._zod.bag)==null?void 0:r.patterns)??[]].pop()??h6t(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),ta=xt("$ZodStringFormat",(t,e)=>{cN.init(t,e),TQ.init(t,e)}),L6t=xt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=ZSt),ta.init(t,e)}),I6t=xt("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Rue(n))}else e.pattern??(e.pattern=Rue());ta.init(t,e)}),$6t=xt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=QSt),ta.init(t,e)}),N6t=xt("$ZodURL",(t,e)=>{ta.init(t,e),t._zod.check=r=>{var n;try{const i=r.value.trim();if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===s6t.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}const a=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),D6t=xt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=e6t()),ta.init(t,e)}),O6t=xt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=XSt),ta.init(t,e)}),P6t=xt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=qSt),ta.init(t,e)}),B6t=xt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=GSt),ta.init(t,e)}),F6t=xt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=USt),ta.init(t,e)}),z6t=xt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=YSt),ta.init(t,e)}),H6t=xt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=jSt),ta.init(t,e)}),V6t=xt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=u6t(e)),ta.init(t,e)}),W6t=xt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=l6t),ta.init(t,e)}),q6t=xt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=c6t(e)),ta.init(t,e)}),G6t=xt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=KSt),ta.init(t,e)}),U6t=xt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=t6t),ta.init(t,e),t._zod.bag.format="ipv4"}),Y6t=xt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=r6t),ta.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),j6t=xt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=n6t),ta.init(t,e)}),X6t=xt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=i6t),ta.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,a]=n;if(!a)throw new Error;const s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function y7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const K6t=xt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=a6t),ta.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{y7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Z6t(t){if(!h7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return y7e(r)}const Q6t=xt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=h7e),ta.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Z6t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),J6t=xt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=o6t),ta.init(t,e)});function eEt(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const tEt=xt("$ZodJWT",(t,e)=>{ta.init(t,e),t._zod.check=r=>{eEt(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),v7e=xt("$ZodNumber",(t,e)=>{Ma.init(t,e),t._zod.pattern=t._zod.bag.pattern??f6t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),rEt=xt("$ZodNumberFormat",(t,e)=>{v6t.init(t,e),v7e.init(t,e)}),nEt=xt("$ZodBoolean",(t,e)=>{Ma.init(t,e),t._zod.pattern=p6t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),iEt=xt("$ZodUnknown",(t,e)=>{Ma.init(t,e),t._zod.parse=r=>r}),aEt=xt("$ZodNever",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function _ue(t,e,r){t.issues.length&&e.issues.push(...o7e(r,t.issues)),e.value[r]=t.value}const sEt=xt("$ZodArray",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const a=[];for(let s=0;s_ue(u,r,s))):_ue(l,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function eL(t,e,r,n,i,a){const s=r in n;if(t.issues.length){if(i&&a&&!s)return;e.issues.push(...o7e(r,t.issues))}if(!s&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function b7e(t){var n,i,a,s;const e=Object.keys(t.shape);for(const o of e)if(!((s=(a=(i=(n=t.shape)==null?void 0:n[o])==null?void 0:i._zod)==null?void 0:a.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=TSt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function x7e(t,e,r,n,i,a){const s=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,h=l.optin==="optional",d=l.optout==="optional";for(const f in e){if(f==="__proto__"||o.has(f))continue;if(u==="never"){s.push(f);continue}const p=l.run({value:e[f],issues:[]},n);p instanceof Promise?t.push(p.then(g=>eL(g,r,f,e,h,d))):eL(p,r,f,e,h,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}const oEt=xt("$ZodObject",(t,e)=>{Ma.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!(r!=null&&r.get)){const o=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...o};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=sN(()=>b7e(e));ci(t._zod,"propValues",()=>{const o=e.shape,l={};for(const u in o){const h=o[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const d of h.values)l[u].add(d)}}return l});const i=QS,a=e.catchall;let s;t._zod.parse=(o,l)=>{s??(s=n.value);const u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};const h=[],d=s.shape;for(const f of s.keys){const p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",y=p._zod.run({value:u[f],issues:[]},l);y instanceof Promise?h.push(y.then(v=>eL(v,o,f,u,g,m))):eL(y,o,f,u,g,m)}return a?x7e(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),lEt=xt("$ZodObjectJIT",(t,e)=>{oEt.init(t,e);const r=t._zod.parse,n=sN(()=>b7e(e)),i=f=>{var b,T;const p=new _6t(["shape","payload","ctx"]),g=n.value,m=k=>{const S=Aue(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const k of g.keys)y[k]=`key_${v++}`;p.write("const newResult = {};");for(const k of g.keys){const S=y[k],C=Aue(k),E=f[k],A=((b=E==null?void 0:E._zod)==null?void 0:b.optin)==="optional",M=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";p.write(`const ${S} = ${m(k)};`),A&&M?p.write(` +`))}}const L6t={major:4,minor:4,patch:3},Ma=xt("$ZodType",(t,e)=>{var i;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=L6t;const n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(const a of n)for(const s of a._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),(i=t._zod.deferred)==null||i.push(()=>{t._zod.run=t._zod.parse});else{const a=(o,l,u)=>{let h=z2(o),d;for(const f of l){if(f._zod.def.when){if(ISt(o)||!f._zod.def.when(o))continue}else if(h)continue;const p=o.issues.length,g=f._zod.check(o);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new db;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,o.issues.length!==p&&(h||(h=z2(o,p)))});else{if(o.issues.length===p)continue;h||(h=z2(o,p))}}return d?d.then(()=>o):o},s=(o,l,u)=>{if(z2(o))return o.aborted=!0,o;const h=a(l,n,u);if(h instanceof Promise){if(u.async===!1)throw new db;return h.then(d=>t._zod.parse(d,u))}return t._zod.parse(h,u)};t._zod.run=(o,l)=>{if(l.skipChecks)return t._zod.parse(o,l);if(l.direction==="backward"){const h=t._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(d=>s(d,o,l)):s(h,o,l)}const u=t._zod.parse(o,l);if(u instanceof Promise){if(l.async===!1)throw new db;return u.then(h=>a(h,n,l))}return a(u,n,l)}}ci(t,"~standard",()=>({validate:a=>{var s;try{const o=DSt(t,a);return o.success?{value:o.data}:{issues:(s=o.error)==null?void 0:s.issues}}catch{return OSt(t,a).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),CQ=xt("$ZodString",(t,e)=>{var r;Ma.init(t,e),t._zod.pattern=[...((r=t==null?void 0:t._zod.bag)==null?void 0:r.patterns)??[]].pop()??d6t(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),ta=xt("$ZodStringFormat",(t,e)=>{hN.init(t,e),CQ.init(t,e)}),I6t=xt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=QSt),ta.init(t,e)}),$6t=xt("$ZodUUID",(t,e)=>{if(e.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=_ue(n))}else e.pattern??(e.pattern=_ue());ta.init(t,e)}),N6t=xt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=JSt),ta.init(t,e)}),D6t=xt("$ZodURL",(t,e)=>{ta.init(t,e),t._zod.check=r=>{var n;try{const i=r.value.trim();if(!e.normalize&&((n=e.protocol)==null?void 0:n.source)===o6t.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}const a=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),O6t=xt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=t6t()),ta.init(t,e)}),P6t=xt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=KSt),ta.init(t,e)}),B6t=xt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=GSt),ta.init(t,e)}),F6t=xt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=USt),ta.init(t,e)}),z6t=xt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=YSt),ta.init(t,e)}),H6t=xt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=jSt),ta.init(t,e)}),V6t=xt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=XSt),ta.init(t,e)}),W6t=xt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=h6t(e)),ta.init(t,e)}),q6t=xt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=c6t),ta.init(t,e)}),G6t=xt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=u6t(e)),ta.init(t,e)}),U6t=xt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=ZSt),ta.init(t,e)}),Y6t=xt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=r6t),ta.init(t,e),t._zod.bag.format="ipv4"}),j6t=xt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=n6t),ta.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),X6t=xt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=i6t),ta.init(t,e)}),K6t=xt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=a6t),ta.init(t,e),t._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[i,a]=n;if(!a)throw new Error;const s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function b7e(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const Z6t=xt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=s6t),ta.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{b7e(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Q6t(t){if(!f7e.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return b7e(r)}const J6t=xt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=f7e),ta.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Q6t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),eEt=xt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=l6t),ta.init(t,e)});function tEt(t,e=null){try{const r=t.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const i=JSON.parse(atob(n));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const rEt=xt("$ZodJWT",(t,e)=>{ta.init(t,e),t._zod.check=r=>{tEt(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),x7e=xt("$ZodNumber",(t,e)=>{Ma.init(t,e),t._zod.pattern=t._zod.bag.pattern??p6t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),nEt=xt("$ZodNumberFormat",(t,e)=>{b6t.init(t,e),x7e.init(t,e)}),iEt=xt("$ZodBoolean",(t,e)=>{Ma.init(t,e),t._zod.pattern=g6t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),aEt=xt("$ZodUnknown",(t,e)=>{Ma.init(t,e),t._zod.parse=r=>r}),sEt=xt("$ZodNever",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function Mue(t,e,r){t.issues.length&&e.issues.push(...c7e(r,t.issues)),e.value[r]=t.value}const oEt=xt("$ZodArray",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);const a=[];for(let s=0;sMue(u,r,s))):Mue(l,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function tL(t,e,r,n,i,a){const s=r in n;if(t.issues.length){if(i&&a&&!s)return;e.issues.push(...c7e(r,t.issues))}if(!s&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function w7e(t){var n,i,a,s;const e=Object.keys(t.shape);for(const o of e)if(!((s=(a=(i=(n=t.shape)==null?void 0:n[o])==null?void 0:i._zod)==null?void 0:a.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=kSt(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function T7e(t,e,r,n,i,a){const s=[],o=i.keySet,l=i.catchall._zod,u=l.def.type,h=l.optin==="optional",d=l.optout==="optional";for(const f in e){if(f==="__proto__"||o.has(f))continue;if(u==="never"){s.push(f);continue}const p=l.run({value:e[f],issues:[]},n);p instanceof Promise?t.push(p.then(g=>tL(g,r,f,e,h,d))):tL(p,r,f,e,h,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}const lEt=xt("$ZodObject",(t,e)=>{Ma.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape");if(!(r!=null&&r.get)){const o=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...o};return Object.defineProperty(e,"shape",{value:l}),l}})}const n=lN(()=>w7e(e));ci(t._zod,"propValues",()=>{const o=e.shape,l={};for(const u in o){const h=o[u]._zod;if(h.values){l[u]??(l[u]=new Set);for(const d of h.values)l[u].add(d)}}return l});const i=JS,a=e.catchall;let s;t._zod.parse=(o,l)=>{s??(s=n.value);const u=o.value;if(!i(u))return o.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),o;o.value={};const h=[],d=s.shape;for(const f of s.keys){const p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",y=p._zod.run({value:u[f],issues:[]},l);y instanceof Promise?h.push(y.then(v=>tL(v,o,f,u,g,m))):tL(y,o,f,u,g,m)}return a?T7e(h,u,o,l,n.value,t):h.length?Promise.all(h).then(()=>o):o}}),cEt=xt("$ZodObjectJIT",(t,e)=>{lEt.init(t,e);const r=t._zod.parse,n=lN(()=>w7e(e)),i=f=>{var b,T;const p=new M6t(["shape","payload","ctx"]),g=n.value,m=k=>{const S=Rue(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const k of g.keys)y[k]=`key_${v++}`;p.write("const newResult = {};");for(const k of g.keys){const S=y[k],C=Rue(k),E=f[k],A=((b=E==null?void 0:E._zod)==null?void 0:b.optin)==="optional",M=((T=E==null?void 0:E._zod)==null?void 0:T.optout)==="optional";p.write(`const ${S} = ${m(k)};`),A&&M?p.write(` if (${S}.issues.length) { if (${C} in input) { payload.issues = payload.issues.concat(${S}.issues.map(iss => ({ @@ -747,9 +747,9 @@ ${JSON.stringify(t)} } } - `)}p.write("payload.value = newResult;"),p.write("return payload;");const x=p.compile();return(k,S)=>x(f,k,S)};let a;const s=QS,o=!mQ.jitless,u=o&&xSt.value,h=e.catchall;let d;t._zod.parse=(f,p)=>{d??(d=n.value);const g=f.value;return s(g)?o&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(a||(a=i(e.shape)),f=a(f,p),h?x7e([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function Mue(t,e,r,n){for(const a of t)if(a.issues.length===0)return e.value=a.value,e;const i=t.filter(a=>!z2(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(s=>iy(s,n,ny())))}),e)}const w7e=xt("$ZodUnion",(t,e)=>{Ma.init(t,e),ci(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ci(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ci(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ci(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>vQ(i.source)).join("|")})$`)}});const r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1;const s=[];for(const o of e.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(o=>Mue(o,n,t,i)):Mue(s,n,t,i)}}),cEt=xt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,w7e.init(t,e);const r=t._zod.parse;ci(t._zod,"propValues",()=>{const i={};for(const a of e.options){const s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const[o,l]of Object.entries(s)){i[o]||(i[o]=new Set);for(const u of l)i[o].add(u)}}return i});const n=sN(()=>{var s;const i=e.options,a=new Map;for(const o of i){const l=(s=o._zod.propValues)==null?void 0:s[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const u of l){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,o)}}return a});t._zod.parse=(i,a)=>{const s=i.value;if(!QS(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;const o=n.value.get(s==null?void 0:s[e.discriminator]);return o?o._zod.run(i,a):e.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:s,path:[e.discriminator],inst:t}),i)}}),uEt=xt("$ZodIntersection",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,a=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([l,u])=>Lue(r,l,u)):Lue(r,a,s)}});function kq(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(JS(t)&&JS(e)){const r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};for(const a of n){const s=kq(t[a],e[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;no.l&&o.r).map(([o])=>o);if(a.length&&i&&t.issues.push({...i,keys:a}),z2(t))return t;const s=kq(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}const hEt=xt("$ZodEnum",(t,e)=>{Ma.init(t,e);const r=i7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>wSt.has(typeof i)).map(i=>typeof i=="string"?HT(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),dEt=xt("$ZodLiteral",(t,e)=>{if(Ma.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?HT(n):n?HT(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{const a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}}),fEt=xt("$ZodTransform",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new n7e(t.constructor.name);const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r.fallback=!0,r));if(i instanceof Promise)throw new db;return r.value=i,r.fallback=!0,r}});function Iue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const T7e=xt("$ZodOptional",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ci(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ci(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${vQ(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){const i=r.value,a=e.innerType._zod.run(r,n);return a instanceof Promise?a.then(s=>Iue(s,i)):Iue(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),pEt=xt("$ZodExactOptional",(t,e)=>{T7e.init(t,e),ci(t._zod,"values",()=>e.innerType._zod.values),ci(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),gEt=xt("$ZodNullable",(t,e)=>{Ma.init(t,e),ci(t._zod,"optin",()=>e.innerType._zod.optin),ci(t._zod,"optout",()=>e.innerType._zod.optout),ci(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${vQ(r.source)}|null)$`):void 0}),ci(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),mEt=xt("$ZodDefault",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>$ue(a,e)):$ue(i,e)}});function $ue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const yEt=xt("$ZodPrefault",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),vEt=xt("$ZodNonOptional",(t,e)=>{Ma.init(t,e),ci(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Nue(a,t)):Nue(i,t)}});function Nue(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const bEt=xt("$ZodCatch",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"optout",()=>e.innerType._zod.optout),ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=e.catchValue({...r,error:{issues:a.issues.map(s=>iy(s,n,ny()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>iy(a,n,ny()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),xEt=xt("$ZodPipe",(t,e)=>{Ma.init(t,e),ci(t._zod,"values",()=>e.in._zod.values),ci(t._zod,"optin",()=>e.in._zod.optin),ci(t._zod,"optout",()=>e.out._zod.optout),ci(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=e.out._zod.run(r,n);return a instanceof Promise?a.then(s=>TA(s,e.in,n)):TA(a,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>TA(a,e.out,n)):TA(i,e.out,n)}});function TA(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}const wEt=xt("$ZodReadonly",(t,e)=>{Ma.init(t,e),ci(t._zod,"propValues",()=>e.innerType._zod.propValues),ci(t._zod,"values",()=>e.innerType._zod.values),ci(t._zod,"optin",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),ci(t._zod,"optout",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Due):Due(i)}});function Due(t){return t.value=Object.freeze(t.value),t}const TEt=xt("$ZodCustom",(t,e)=>{rc.init(t,e),Ma.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>Oue(a,r,n,t));Oue(i,r,n,t)}});function Oue(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(e6(i))}}var Pue;class kEt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){const n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function CEt(){return new kEt}(Pue=globalThis).__zod_globalRegistry??(Pue.__zod_globalRegistry=CEt());const I5=globalThis.__zod_globalRegistry;function SEt(t,e){return new t({type:"string",..._r(e)})}function EEt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function Bue(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function AEt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function REt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function _Et(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function MEt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function LEt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function IEt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function $Et(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function NEt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function DEt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function OEt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function PEt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function BEt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function FEt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function zEt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function HEt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function VEt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function WEt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function qEt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function GEt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function UEt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function YEt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function jEt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function XEt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,..._r(e)})}function KEt(t,e){return new t({type:"string",format:"duration",check:"string_format",..._r(e)})}function ZEt(t,e){return new t({type:"number",checks:[],..._r(e)})}function QEt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function JEt(t,e){return new t({type:"boolean",..._r(e)})}function e7t(t){return new t({type:"unknown"})}function t7t(t,e){return new t({type:"never",..._r(e)})}function Fue(t,e){return new g7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function bB(t,e){return new g7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function zue(t,e){return new m7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function xB(t,e){return new m7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function Hue(t,e){return new y6t({check:"multiple_of",..._r(e),value:t})}function k7e(t,e){return new b6t({check:"max_length",..._r(e),maximum:t})}function tL(t,e){return new x6t({check:"min_length",..._r(e),minimum:t})}function C7e(t,e){return new w6t({check:"length_equals",..._r(e),length:t})}function r7t(t,e){return new T6t({check:"string_format",format:"regex",..._r(e),pattern:t})}function n7t(t){return new k6t({check:"string_format",format:"lowercase",..._r(t)})}function i7t(t){return new C6t({check:"string_format",format:"uppercase",..._r(t)})}function a7t(t,e){return new S6t({check:"string_format",format:"includes",..._r(e),includes:t})}function s7t(t,e){return new E6t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function o7t(t,e){return new A6t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function O3(t){return new R6t({check:"overwrite",tx:t})}function l7t(t){return O3(e=>e.normalize(t))}function c7t(){return O3(t=>t.trim())}function u7t(){return O3(t=>t.toLowerCase())}function h7t(){return O3(t=>t.toUpperCase())}function d7t(){return O3(t=>bSt(t))}function f7t(t,e,r){return new t({type:"array",element:e,..._r(r)})}function p7t(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function g7t(t,e){const r=m7t(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(e6(i,n.value,r._zod.def));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(e6(a))}},t(n.value,n)),e);return r}function m7t(t,e){const r=new rc({check:"custom",..._r(e)});return r._zod.check=t,r}function S7e(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??I5,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function po(t,e,r={path:[],schemaPath:[]}){var h,d;var n;const i=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);const o=(d=(h=t._zod).toJSONSchema)==null?void 0:d.call(h);if(o)s.schema=o;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,f);else{const g=s.schema,m=e.processors[i.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);m(t,e,g,f)}const p=t._zod.parent;p&&(s.ref||(s.ref=p),po(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),e.io==="input"&&Xo(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function E7e(t,e){var s,o,l,u;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const h of t.seen.entries()){const d=(s=t.metadataRegistry.get(h[0]))==null?void 0:s.id;if(d){const f=n.get(d);if(f&&f!==h[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,h[0])}}const i=h=>{var m;const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const y=(m=t.external.registry.get(h[0]))==null?void 0:m.id,v=t.external.uri??(b=>b);if(y)return{ref:v(y)};const x=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(h[1]===r)return{ref:"#"};const p=`#/${d}/`,g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+g}},a=h=>{if(h[1].schema.$ref)return;const d=h[1],{ref:f,defId:p}=i(h);d.def={...d.schema},p&&(d.defId=p);const g=d.schema;for(const m in g)delete g[m];g.$ref=f};if(t.cycles==="throw")for(const h of t.seen.entries()){const d=h[1];if(d.cycle)throw new Error(`Cycle detected: #/${(o=d.cycle)==null?void 0:o.join("/")}/ + `)}p.write("payload.value = newResult;"),p.write("return payload;");const x=p.compile();return(k,S)=>x(f,k,S)};let a;const s=JS,o=!vQ.jitless,u=o&&wSt.value,h=e.catchall;let d;t._zod.parse=(f,p)=>{d??(d=n.value);const g=f.value;return s(g)?o&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(a||(a=i(e.shape)),f=a(f,p),h?T7e([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)}});function Lue(t,e,r,n){for(const a of t)if(a.issues.length===0)return e.value=a.value,e;const i=t.filter(a=>!z2(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(s=>iy(s,n,ny())))}),e)}const k7e=xt("$ZodUnion",(t,e)=>{Ma.init(t,e),ci(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ci(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ci(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ci(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>xQ(i.source)).join("|")})$`)}});const r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1;const s=[];for(const o of e.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(o=>Lue(o,n,t,i)):Lue(s,n,t,i)}}),uEt=xt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,k7e.init(t,e);const r=t._zod.parse;ci(t._zod,"propValues",()=>{const i={};for(const a of e.options){const s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const[o,l]of Object.entries(s)){i[o]||(i[o]=new Set);for(const u of l)i[o].add(u)}}return i});const n=lN(()=>{var s;const i=e.options,a=new Map;for(const o of i){const l=(s=o._zod.propValues)==null?void 0:s[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const u of l){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,o)}}return a});t._zod.parse=(i,a)=>{const s=i.value;if(!JS(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;const o=n.value.get(s==null?void 0:s[e.discriminator]);return o?o._zod.run(i,a):e.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:s,path:[e.discriminator],inst:t}),i)}}),hEt=xt("$ZodIntersection",(t,e)=>{Ma.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,a=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([l,u])=>Iue(r,l,u)):Iue(r,a,s)}});function Eq(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(e6(t)&&e6(e)){const r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};for(const a of n){const s=Eq(t[a],e[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;no.l&&o.r).map(([o])=>o);if(a.length&&i&&t.issues.push({...i,keys:a}),z2(t))return t;const s=Eq(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}const dEt=xt("$ZodEnum",(t,e)=>{Ma.init(t,e);const r=s7e(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>TSt.has(typeof i)).map(i=>typeof i=="string"?HT(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),fEt=xt("$ZodLiteral",(t,e)=>{if(Ma.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?HT(n):n?HT(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{const a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}}),pEt=xt("$ZodTransform",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new a7e(t.constructor.name);const i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r.fallback=!0,r));if(i instanceof Promise)throw new db;return r.value=i,r.fallback=!0,r}});function $ue(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}const C7e=xt("$ZodOptional",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ci(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ci(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${xQ(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){const i=r.value,a=e.innerType._zod.run(r,n);return a instanceof Promise?a.then(s=>$ue(s,i)):$ue(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),gEt=xt("$ZodExactOptional",(t,e)=>{C7e.init(t,e),ci(t._zod,"values",()=>e.innerType._zod.values),ci(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),mEt=xt("$ZodNullable",(t,e)=>{Ma.init(t,e),ci(t._zod,"optin",()=>e.innerType._zod.optin),ci(t._zod,"optout",()=>e.innerType._zod.optout),ci(t._zod,"pattern",()=>{const r=e.innerType._zod.pattern;return r?new RegExp(`^(${xQ(r.source)}|null)$`):void 0}),ci(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),yEt=xt("$ZodDefault",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Nue(a,e)):Nue(i,e)}});function Nue(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const vEt=xt("$ZodPrefault",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),bEt=xt("$ZodNonOptional",(t,e)=>{Ma.init(t,e),ci(t._zod,"values",()=>{const r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Due(a,t)):Due(i,t)}});function Due(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const xEt=xt("$ZodCatch",(t,e)=>{Ma.init(t,e),t._zod.optin="optional",ci(t._zod,"optout",()=>e.innerType._zod.optout),ci(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=e.catchValue({...r,error:{issues:a.issues.map(s=>iy(s,n,ny()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>iy(a,n,ny()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),wEt=xt("$ZodPipe",(t,e)=>{Ma.init(t,e),ci(t._zod,"values",()=>e.in._zod.values),ci(t._zod,"optin",()=>e.in._zod.optin),ci(t._zod,"optout",()=>e.out._zod.optout),ci(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const a=e.out._zod.run(r,n);return a instanceof Promise?a.then(s=>kA(s,e.in,n)):kA(a,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>kA(a,e.out,n)):kA(i,e.out,n)}});function kA(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}const TEt=xt("$ZodReadonly",(t,e)=>{Ma.init(t,e),ci(t._zod,"propValues",()=>e.innerType._zod.propValues),ci(t._zod,"values",()=>e.innerType._zod.values),ci(t._zod,"optin",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),ci(t._zod,"optout",()=>{var r,n;return(n=(r=e.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Oue):Oue(i)}});function Oue(t){return t.value=Object.freeze(t.value),t}const kEt=xt("$ZodCustom",(t,e)=>{tc.init(t,e),Ma.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{const n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>Pue(a,r,n,t));Pue(i,r,n,t)}});function Pue(t,e,r,n){if(!t){const i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(t6(i))}}var Bue;class CEt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){const n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){const r=e._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function SEt(){return new CEt}(Bue=globalThis).__zod_globalRegistry??(Bue.__zod_globalRegistry=SEt());const I5=globalThis.__zod_globalRegistry;function EEt(t,e){return new t({type:"string",..._r(e)})}function AEt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,..._r(e)})}function Fue(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,..._r(e)})}function REt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,..._r(e)})}function _Et(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._r(e)})}function MEt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._r(e)})}function LEt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._r(e)})}function IEt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,..._r(e)})}function $Et(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,..._r(e)})}function NEt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,..._r(e)})}function DEt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,..._r(e)})}function OEt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,..._r(e)})}function PEt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,..._r(e)})}function BEt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,..._r(e)})}function FEt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,..._r(e)})}function zEt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,..._r(e)})}function HEt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,..._r(e)})}function VEt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._r(e)})}function WEt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._r(e)})}function qEt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,..._r(e)})}function GEt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,..._r(e)})}function UEt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,..._r(e)})}function YEt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,..._r(e)})}function jEt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._r(e)})}function XEt(t,e){return new t({type:"string",format:"date",check:"string_format",..._r(e)})}function KEt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,..._r(e)})}function ZEt(t,e){return new t({type:"string",format:"duration",check:"string_format",..._r(e)})}function QEt(t,e){return new t({type:"number",checks:[],..._r(e)})}function JEt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",..._r(e)})}function e7t(t,e){return new t({type:"boolean",..._r(e)})}function t7t(t){return new t({type:"unknown"})}function r7t(t,e){return new t({type:"never",..._r(e)})}function zue(t,e){return new y7e({check:"less_than",..._r(e),value:t,inclusive:!1})}function wB(t,e){return new y7e({check:"less_than",..._r(e),value:t,inclusive:!0})}function Hue(t,e){return new v7e({check:"greater_than",..._r(e),value:t,inclusive:!1})}function TB(t,e){return new v7e({check:"greater_than",..._r(e),value:t,inclusive:!0})}function Vue(t,e){return new v6t({check:"multiple_of",..._r(e),value:t})}function S7e(t,e){return new x6t({check:"max_length",..._r(e),maximum:t})}function rL(t,e){return new w6t({check:"min_length",..._r(e),minimum:t})}function E7e(t,e){return new T6t({check:"length_equals",..._r(e),length:t})}function n7t(t,e){return new k6t({check:"string_format",format:"regex",..._r(e),pattern:t})}function i7t(t){return new C6t({check:"string_format",format:"lowercase",..._r(t)})}function a7t(t){return new S6t({check:"string_format",format:"uppercase",..._r(t)})}function s7t(t,e){return new E6t({check:"string_format",format:"includes",..._r(e),includes:t})}function o7t(t,e){return new A6t({check:"string_format",format:"starts_with",..._r(e),prefix:t})}function l7t(t,e){return new R6t({check:"string_format",format:"ends_with",..._r(e),suffix:t})}function O3(t){return new _6t({check:"overwrite",tx:t})}function c7t(t){return O3(e=>e.normalize(t))}function u7t(){return O3(t=>t.trim())}function h7t(){return O3(t=>t.toLowerCase())}function d7t(){return O3(t=>t.toUpperCase())}function f7t(){return O3(t=>xSt(t))}function p7t(t,e,r){return new t({type:"array",element:e,..._r(r)})}function g7t(t,e,r){return new t({type:"custom",check:"custom",fn:e,..._r(r)})}function m7t(t,e){const r=y7t(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(t6(i,n.value,r._zod.def));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(t6(a))}},t(n.value,n)),e);return r}function y7t(t,e){const r=new tc({check:"custom",..._r(e)});return r._zod.check=t,r}function A7e(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??I5,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function po(t,e,r={path:[],schemaPath:[]}){var h,d;var n;const i=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);const o=(d=(h=t._zod).toJSONSchema)==null?void 0:d.call(h);if(o)s.schema=o;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,f);else{const g=s.schema,m=e.processors[i.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);m(t,e,g,f)}const p=t._zod.parent;p&&(s.ref||(s.ref=p),po(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),e.io==="input"&&Xo(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function R7e(t,e){var s,o,l,u;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const h of t.seen.entries()){const d=(s=t.metadataRegistry.get(h[0]))==null?void 0:s.id;if(d){const f=n.get(d);if(f&&f!==h[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,h[0])}}const i=h=>{var m;const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const y=(m=t.external.registry.get(h[0]))==null?void 0:m.id,v=t.external.uri??(b=>b);if(y)return{ref:v(y)};const x=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(h[1]===r)return{ref:"#"};const p=`#/${d}/`,g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+g}},a=h=>{if(h[1].schema.$ref)return;const d=h[1],{ref:f,defId:p}=i(h);d.def={...d.schema},p&&(d.defId=p);const g=d.schema;for(const m in g)delete g[m];g.$ref=f};if(t.cycles==="throw")for(const h of t.seen.entries()){const d=h[1];if(d.cycle)throw new Error(`Cycle detected: #/${(o=d.cycle)==null?void 0:o.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){a(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){a(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){a(h);continue}if(d.cycle){a(h);continue}if(d.count>1&&t.reused==="ref"){a(h);continue}}}function A7e(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const a=(u=t.metadataRegistry.get(e))==null?void 0:u.id;a!==void 0&&i.id===a&&delete i.id;const s=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,s[f.defId]=f.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:rL(e,"input",t.processors),output:rL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Xo(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Xo(n.element,r);if(n.type==="set")return Xo(n.valueType,r);if(n.type==="lazy")return Xo(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Xo(n.innerType,r);if(n.type==="intersection")return Xo(n.left,r)||Xo(n.right,r);if(n.type==="record"||n.type==="map")return Xo(n.keyType,r)||Xo(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Xo(n.in,r)||Xo(n.out,r);if(n.type==="object"){for(const i in n.shape)if(Xo(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(Xo(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(Xo(i,r))return!0;return!!(n.rest&&Xo(n.rest,r))}return!1}const y7t=(t,e={})=>r=>{const n=S7e({...r,processors:e});return po(t,n),E7e(n,t),A7e(n,t)},rL=(t,e,r={})=>n=>{const{libraryOptions:i,target:a}=n??{},s=S7e({...i??{},target:a,io:e,processors:r});return po(t,s),E7e(s,t),A7e(s,t)},v7t={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},b7t=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:a,maximum:s,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),o&&(i.format=v7t[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},x7t=(t,e,r,n)=>{const i=r,{minimum:a,maximum:s,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(a??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof a=="number"&&(i.minimum=a),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof s=="number"&&(i.maximum=s),typeof l=="number"&&(i.multipleOf=l)},w7t=(t,e,r,n)=>{r.type="boolean"},T7t=(t,e,r,n)=>{r.not={}},k7t=(t,e,r,n)=>{},C7t=(t,e,r,n)=>{const i=t._zod.def,a=i7e(i.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},S7t=(t,e,r,n)=>{const i=t._zod.def,a=[];for(const s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){const s=a[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},E7t=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},A7t=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},R7t=(t,e,r,n)=>{const i=r,a=t._zod.def,{minimum:s,maximum:o}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=po(a.element,e,{...n,path:[...n.path,"items"]})},_7t=(t,e,r,n)=>{var u;const i=r,a=t._zod.def;i.type="object",i.properties={};const s=a.shape;for(const h in s)i.properties[h]=po(s[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(s)),l=new Set([...o].filter(h=>{const d=a.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=a.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=po(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},M7t=(t,e,r,n)=>{const i=t._zod.def,a=i.inclusive===!1,s=i.options.map((o,l)=>po(o,e,{...n,path:[...n.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=s:r.anyOf=s},L7t=(t,e,r,n)=>{const i=t._zod.def,a=po(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=po(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]];r.allOf=l},I7t=(t,e,r,n)=>{const i=t._zod.def,a=po(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},$7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},N7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},D7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},O7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},P7t=(t,e,r,n)=>{const i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?a?i.out:i.in:i.out;po(s,e,n);const o=e.seen.get(t);o.ref=s},B7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},R7e=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},F7t=xt("ZodISODateTime",(t,e)=>{V6t.init(t,e),pa.init(t,e)});function z7t(t){return YEt(F7t,t)}const H7t=xt("ZodISODate",(t,e)=>{W6t.init(t,e),pa.init(t,e)});function V7t(t){return jEt(H7t,t)}const W7t=xt("ZodISOTime",(t,e)=>{q6t.init(t,e),pa.init(t,e)});function q7t(t){return XEt(W7t,t)}const G7t=xt("ZodISODuration",(t,e)=>{G6t.init(t,e),pa.init(t,e)});function U7t(t){return KEt(G7t,t)}const Y7t=(t,e)=>{c7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>$St(t,r)},flatten:{value:r=>ISt(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Tq,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Tq,2)}},isEmpty:{get(){return t.issues.length===0}}})},yu=xt("ZodError",Y7t,{Parent:Error}),j7t=xQ(yu),X7t=wQ(yu),K7t=oN(yu),Z7t=lN(yu),Q7t=OSt(yu),J7t=PSt(yu),eAt=BSt(yu),tAt=FSt(yu),rAt=zSt(yu),nAt=HSt(yu),iAt=VSt(yu),aAt=WSt(yu),Vue=new WeakMap;function EE(t,e,r){const n=Object.getPrototypeOf(t);let i=Vue.get(n);if(i||(i=new Set,Vue.set(n,i)),!i.has(e)){i.add(e);for(const a in r){const s=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const o=s.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const La=xt("ZodType",(t,e)=>(Ma.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:rL(t,"input"),output:rL(t,"output")}}),t.toJSONSchema=y7t(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>j7t(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>K7t(t,r,n),t.parseAsync=async(r,n)=>X7t(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Z7t(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>Q7t(t,r,n),t.decode=(r,n)=>J7t(t,r,n),t.encodeAsync=async(r,n)=>eAt(t,r,n),t.decodeAsync=async(r,n)=>tAt(t,r,n),t.safeEncode=(r,n)=>rAt(t,r,n),t.safeDecode=(r,n)=>nAt(t,r,n),t.safeEncodeAsync=async(r,n)=>iAt(t,r,n),t.safeDecodeAsync=async(r,n)=>aAt(t,r,n),EE(t,"ZodType",{check(...r){const n=this.def;return this.clone(vg(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return bg(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(QAt(r,n))},superRefine(r,n){return this.check(JAt(r,n))},overwrite(r){return this.check(O3(r))},optional(){return Gue(this)},exactOptional(){return FAt(this)},nullable(){return Uue(this)},nullish(){return Gue(Uue(this))},nonoptional(r){return GAt(this,r)},array(){return ms(this)},or(r){return I7e([this,r])},and(r){return NAt(this,r)},transform(r){return Yue(this,PAt(r))},default(r){return VAt(this,r)},prefault(r){return qAt(this,r)},catch(r){return YAt(this,r)},pipe(r){return Yue(this,r)},readonly(){return KAt(this)},describe(r){const n=this.clone();return I5.add(n,{description:r}),n},meta(...r){if(r.length===0)return I5.get(this);const n=this.clone();return I5.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=I5.get(t))==null?void 0:r.description},configurable:!0}),t)),_7e=xt("_ZodString",(t,e)=>{TQ.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>b7t(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,EE(t,"_ZodString",{regex(...n){return this.check(r7t(...n))},includes(...n){return this.check(a7t(...n))},startsWith(...n){return this.check(s7t(...n))},endsWith(...n){return this.check(o7t(...n))},min(...n){return this.check(tL(...n))},max(...n){return this.check(k7e(...n))},length(...n){return this.check(C7e(...n))},nonempty(...n){return this.check(tL(1,...n))},lowercase(n){return this.check(n7t(n))},uppercase(n){return this.check(i7t(n))},trim(){return this.check(c7t())},normalize(...n){return this.check(l7t(...n))},toLowerCase(){return this.check(u7t())},toUpperCase(){return this.check(h7t())},slugify(){return this.check(d7t())}})}),sAt=xt("ZodString",(t,e)=>{TQ.init(t,e),_7e.init(t,e),t.email=r=>t.check(EEt(oAt,r)),t.url=r=>t.check(LEt(lAt,r)),t.jwt=r=>t.check(UEt(kAt,r)),t.emoji=r=>t.check(IEt(cAt,r)),t.guid=r=>t.check(Bue(Wue,r)),t.uuid=r=>t.check(AEt(kA,r)),t.uuidv4=r=>t.check(REt(kA,r)),t.uuidv6=r=>t.check(_Et(kA,r)),t.uuidv7=r=>t.check(MEt(kA,r)),t.nanoid=r=>t.check($Et(uAt,r)),t.guid=r=>t.check(Bue(Wue,r)),t.cuid=r=>t.check(NEt(hAt,r)),t.cuid2=r=>t.check(DEt(dAt,r)),t.ulid=r=>t.check(OEt(fAt,r)),t.base64=r=>t.check(WEt(xAt,r)),t.base64url=r=>t.check(qEt(wAt,r)),t.xid=r=>t.check(PEt(pAt,r)),t.ksuid=r=>t.check(BEt(gAt,r)),t.ipv4=r=>t.check(FEt(mAt,r)),t.ipv6=r=>t.check(zEt(yAt,r)),t.cidrv4=r=>t.check(HEt(vAt,r)),t.cidrv6=r=>t.check(VEt(bAt,r)),t.e164=r=>t.check(GEt(TAt,r)),t.datetime=r=>t.check(z7t(r)),t.date=r=>t.check(V7t(r)),t.time=r=>t.check(q7t(r)),t.duration=r=>t.check(U7t(r))});function ot(t){return SEt(sAt,t)}const pa=xt("ZodStringFormat",(t,e)=>{ta.init(t,e),_7e.init(t,e)}),oAt=xt("ZodEmail",(t,e)=>{$6t.init(t,e),pa.init(t,e)}),Wue=xt("ZodGUID",(t,e)=>{L6t.init(t,e),pa.init(t,e)}),kA=xt("ZodUUID",(t,e)=>{I6t.init(t,e),pa.init(t,e)}),lAt=xt("ZodURL",(t,e)=>{N6t.init(t,e),pa.init(t,e)}),cAt=xt("ZodEmoji",(t,e)=>{D6t.init(t,e),pa.init(t,e)}),uAt=xt("ZodNanoID",(t,e)=>{O6t.init(t,e),pa.init(t,e)}),hAt=xt("ZodCUID",(t,e)=>{P6t.init(t,e),pa.init(t,e)}),dAt=xt("ZodCUID2",(t,e)=>{B6t.init(t,e),pa.init(t,e)}),fAt=xt("ZodULID",(t,e)=>{F6t.init(t,e),pa.init(t,e)}),pAt=xt("ZodXID",(t,e)=>{z6t.init(t,e),pa.init(t,e)}),gAt=xt("ZodKSUID",(t,e)=>{H6t.init(t,e),pa.init(t,e)}),mAt=xt("ZodIPv4",(t,e)=>{U6t.init(t,e),pa.init(t,e)}),yAt=xt("ZodIPv6",(t,e)=>{Y6t.init(t,e),pa.init(t,e)}),vAt=xt("ZodCIDRv4",(t,e)=>{j6t.init(t,e),pa.init(t,e)}),bAt=xt("ZodCIDRv6",(t,e)=>{X6t.init(t,e),pa.init(t,e)}),xAt=xt("ZodBase64",(t,e)=>{K6t.init(t,e),pa.init(t,e)}),wAt=xt("ZodBase64URL",(t,e)=>{Q6t.init(t,e),pa.init(t,e)}),TAt=xt("ZodE164",(t,e)=>{J6t.init(t,e),pa.init(t,e)}),kAt=xt("ZodJWT",(t,e)=>{tEt.init(t,e),pa.init(t,e)}),M7e=xt("ZodNumber",(t,e)=>{v7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>x7t(t,n,i),EE(t,"ZodNumber",{gt(n,i){return this.check(zue(n,i))},gte(n,i){return this.check(xB(n,i))},min(n,i){return this.check(xB(n,i))},lt(n,i){return this.check(Fue(n,i))},lte(n,i){return this.check(bB(n,i))},max(n,i){return this.check(bB(n,i))},int(n){return this.check(que(n))},safe(n){return this.check(que(n))},positive(n){return this.check(zue(0,n))},nonnegative(n){return this.check(xB(0,n))},negative(n){return this.check(Fue(0,n))},nonpositive(n){return this.check(bB(0,n))},multipleOf(n,i){return this.check(Hue(n,i))},step(n,i){return this.check(Hue(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function rl(t){return ZEt(M7e,t)}const CAt=xt("ZodNumberFormat",(t,e)=>{rEt.init(t,e),M7e.init(t,e)});function que(t){return QEt(CAt,t)}const SAt=xt("ZodBoolean",(t,e)=>{nEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>w7t(t,r,n)});function Ro(t){return JEt(SAt,t)}const EAt=xt("ZodUnknown",(t,e)=>{iEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>k7t()});function t6(){return e7t(EAt)}const AAt=xt("ZodNever",(t,e)=>{aEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>T7t(t,r,n)});function RAt(t){return t7t(AAt,t)}const _At=xt("ZodArray",(t,e)=>{sEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>R7t(t,r,n,i),t.element=e.element,EE(t,"ZodArray",{min(r,n){return this.check(tL(r,n))},nonempty(r){return this.check(tL(1,r))},max(r,n){return this.check(k7e(r,n))},length(r,n){return this.check(C7e(r,n))},unwrap(){return this.element}})});function ms(t,e){return f7t(_At,t,e)}const MAt=xt("ZodObject",(t,e)=>{lEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_7t(t,r,n,i),ci(t,"shape",()=>e.shape),EE(t,"ZodObject",{keyof(){return ds(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:t6()})},loose(){return this.clone({...this._zod.def,catchall:t6()})},strict(){return this.clone({...this._zod.def,catchall:RAt()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return ESt(this,r)},safeExtend(r){return ASt(this,r)},merge(r){return RSt(this,r)},pick(r){return CSt(this,r)},omit(r){return SSt(this,r)},partial(...r){return _St($7e,this,r[0])},required(...r){return MSt(N7e,this,r[0])}})});function nn(t,e){const r={type:"object",shape:t??{},..._r(e)};return new MAt(r)}const L7e=xt("ZodUnion",(t,e)=>{w7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>M7t(t,r,n,i),t.options=e.options});function I7e(t,e){return new L7e({type:"union",options:t,..._r(e)})}const LAt=xt("ZodDiscriminatedUnion",(t,e)=>{L7e.init(t,e),cEt.init(t,e)});function IAt(t,e,r){return new LAt({type:"union",options:e,discriminator:t,..._r(r)})}const $At=xt("ZodIntersection",(t,e)=>{uEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>L7t(t,r,n,i)});function NAt(t,e){return new $At({type:"intersection",left:t,right:e})}const Cq=xt("ZodEnum",(t,e)=>{hEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>C7t(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const a={};for(const s of n)if(r.has(s))a[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Cq({...e,checks:[],..._r(i),entries:a})},t.exclude=(n,i)=>{const a={...e.entries};for(const s of n)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new Cq({...e,checks:[],..._r(i),entries:a})}});function ds(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Cq({type:"enum",entries:r,..._r(e)})}const DAt=xt("ZodLiteral",(t,e)=>{dEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>S7t(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function s1(t,e){return new DAt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const OAt=xt("ZodTransform",(t,e)=>{fEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>A7t(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new n7e(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(e6(a,r.value,e));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(e6(s))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function PAt(t){return new OAt({type:"transform",transform:t})}const $7e=xt("ZodOptional",(t,e)=>{T7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>R7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Gue(t){return new $7e({type:"optional",innerType:t})}const BAt=xt("ZodExactOptional",(t,e)=>{pEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>R7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function FAt(t){return new BAt({type:"optional",innerType:t})}const zAt=xt("ZodNullable",(t,e)=>{gEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>I7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Uue(t){return new zAt({type:"nullable",innerType:t})}const HAt=xt("ZodDefault",(t,e)=>{mEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>N7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function VAt(t,e){return new HAt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():s7e(e)}})}const WAt=xt("ZodPrefault",(t,e)=>{yEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>D7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function qAt(t,e){return new WAt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():s7e(e)}})}const N7e=xt("ZodNonOptional",(t,e)=>{vEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function GAt(t,e){return new N7e({type:"nonoptional",innerType:t,..._r(e)})}const UAt=xt("ZodCatch",(t,e)=>{bEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>O7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function YAt(t,e){return new UAt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const jAt=xt("ZodPipe",(t,e)=>{xEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>P7t(t,r,n,i),t.in=e.in,t.out=e.out});function Yue(t,e){return new jAt({type:"pipe",in:t,out:e})}const XAt=xt("ZodReadonly",(t,e)=>{wEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>B7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function KAt(t){return new XAt({type:"readonly",innerType:t})}const ZAt=xt("ZodCustom",(t,e)=>{TEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>E7t(t,r)});function QAt(t,e={}){return p7t(ZAt,t,e)}function JAt(t,e){return g7t(t,e)}const e8t="edgeever-zip",t8t=2,Yu=ot().datetime();nn({format:s1(e8t),formatVersion:I7e([s1(1),s1(t8t)]),schemaVersion:rl().int().positive(),edgeeverVersion:ot().trim().min(1),buildId:ot().trim().min(1),exportedAt:Yu,includesTrash:s1(!1),counts:nn({notebooks:rl().int().min(0),memos:rl().int().min(0),revisions:rl().int().min(0),resources:rl().int().min(0),prompts:rl().int().min(0).optional()})});const r8t=nn({id:ot().trim().min(1),parentId:ot().trim().min(1).nullable(),name:ot().trim().min(1).max(80),slug:ot().nullable(),icon:ot().nullable(),color:ot().nullable(),sortOrder:rl().int(),createdAt:Yu,updatedAt:Yu}),n8t=nn({id:ot().trim().min(1),memoId:ot().trim().min(1),revision:rl().int().min(0),title:ot().nullable(),tags:ms(ot()),contentJson:t6(),contentMarkdown:ot(),contentText:ot(),contentHash:ot(),createdBy:ot(),createdAt:Yu}),i8t=nn({id:ot().trim().min(1),notebookId:ot().trim().min(1),title:ot().nullable(),excerpt:ot(),tags:ms(ot()),isPinned:Ro(),isArchived:Ro(),isDeleted:Ro(),revision:rl().int().min(0),createdAt:Yu,updatedAt:Yu,deletedAt:Yu.nullable(),contentJson:t6(),contentMarkdown:ot(),contentText:ot(),contentHash:ot(),sourceMemoIds:ms(ot()),mergeSourceCount:rl().int().min(0),mergedIntoMemoId:ot().nullable()}),D7e=nn({memo:i8t,revisions:ms(n8t),resources:ms(nn({id:ot().trim().min(1),memoId:ot().trim().min(1),originalMemoId:ot().nullable(),kind:ds(["image","attachment"]),mimeType:ot().nullable(),filename:ot().nullable(),byteSize:rl().int().min(0),sha256:ot().nullable(),width:rl().int().positive().nullable(),height:rl().int().positive().nullable(),createdAt:Yu,updatedAt:Yu,archivePath:ot().trim().min(1)}))});nn({notebooks:ms(r8t).min(1).max(100)});nn({memos:ms(D7e).min(1).max(10)});const a8t=nn({id:ot().trim().min(1).max(200),origin:ds(["default","custom"]),seedKey:ds(wq.filter(t=>t!=="custom")).nullable(),action:ds(wq),parameterKind:ds(fQ),resultMode:ds(pQ),nameCustomized:Ro(),descriptionCustomized:Ro(),instructionCustomized:Ro(),name:ot().trim().min(1).max(80),description:ot().max(200).nullable(),instruction:ot().trim().min(1).max(2e3),createdAt:Yu,updatedAt:Yu}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});nn({prompts:ms(a8t).max(100)});D7e.shape.resources.element;const Ik=(t,e,r)=>({...t,translations:{"zh-CN":e,"en-US":r}});Ik({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of t.seen.entries()){const d=h[1];if(e===h[0]){a(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){a(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){a(h);continue}if(d.cycle){a(h);continue}if(d.count>1&&t.reused==="ref"){a(h);continue}}}function _7e(t,e){var o,l,u,h;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=d=>{const f=t.seen.get(d);if(f.ref===null)return;const p=f.def??f.schema,g={...p},m=f.ref;if(f.ref=null,m){n(m);const v=t.seen.get(m),x=v.schema;if(x.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Object.assign(p,x),Object.assign(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(x.$ref&&v.def)for(const T in p)T==="$ref"||T==="allOf"||T in v.def&&JSON.stringify(p[T])===JSON.stringify(v.def[T])&&delete p[T]}const y=d._zod.parent;if(y&&y!==m){n(y);const v=t.seen.get(y);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(const x in p)x==="$ref"||x==="allOf"||x in v.def&&JSON.stringify(p[x])===JSON.stringify(v.def[x])&&delete p[x]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};for(const d of[...t.seen.entries()].reverse())n(d[0]);const i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,(o=t.external)!=null&&o.uri){const d=(l=t.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(d)}Object.assign(i,r.def??r.schema);const a=(u=t.metadataRegistry.get(e))==null?void 0:u.id;a!==void 0&&i.id===a&&delete i.id;const s=((h=t.external)==null?void 0:h.defs)??{};for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,s[f.defId]=f.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:nL(e,"input",t.processors),output:nL(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Xo(t,e){const r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);const n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Xo(n.element,r);if(n.type==="set")return Xo(n.valueType,r);if(n.type==="lazy")return Xo(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Xo(n.innerType,r);if(n.type==="intersection")return Xo(n.left,r)||Xo(n.right,r);if(n.type==="record"||n.type==="map")return Xo(n.keyType,r)||Xo(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Xo(n.in,r)||Xo(n.out,r);if(n.type==="object"){for(const i in n.shape)if(Xo(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(Xo(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(Xo(i,r))return!0;return!!(n.rest&&Xo(n.rest,r))}return!1}const v7t=(t,e={})=>r=>{const n=A7e({...r,processors:e});return po(t,n),R7e(n,t),_7e(n,t)},nL=(t,e,r={})=>n=>{const{libraryOptions:i,target:a}=n??{},s=A7e({...i??{},target:a,io:e,processors:r});return po(t,s),R7e(s,t),_7e(s,t)},b7t={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},x7t=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:a,maximum:s,format:o,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),o&&(i.format=b7t[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},w7t=(t,e,r,n)=>{const i=r,{minimum:a,maximum:s,format:o,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:h}=t._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number";const d=typeof h=="number"&&h>=(a??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof a=="number"&&(i.minimum=a),f?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof s=="number"&&(i.maximum=s),typeof l=="number"&&(i.multipleOf=l)},T7t=(t,e,r,n)=>{r.type="boolean"},k7t=(t,e,r,n)=>{r.not={}},C7t=(t,e,r,n)=>{},S7t=(t,e,r,n)=>{const i=t._zod.def,a=s7e(i.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},E7t=(t,e,r,n)=>{const i=t._zod.def,a=[];for(const s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){const s=a[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},A7t=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},R7t=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_7t=(t,e,r,n)=>{const i=r,a=t._zod.def,{minimum:s,maximum:o}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=po(a.element,e,{...n,path:[...n.path,"items"]})},M7t=(t,e,r,n)=>{var u;const i=r,a=t._zod.def;i.type="object",i.properties={};const s=a.shape;for(const h in s)i.properties[h]=po(s[h],e,{...n,path:[...n.path,"properties",h]});const o=new Set(Object.keys(s)),l=new Set([...o].filter(h=>{const d=a.shape[h]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((u=a.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=po(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},L7t=(t,e,r,n)=>{const i=t._zod.def,a=i.inclusive===!1,s=i.options.map((o,l)=>po(o,e,{...n,path:[...n.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=s:r.anyOf=s},I7t=(t,e,r,n)=>{const i=t._zod.def,a=po(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=po(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]];r.allOf=l},$7t=(t,e,r,n)=>{const i=t._zod.def,a=po(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},N7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},D7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},O7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},P7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},B7t=(t,e,r,n)=>{const i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?a?i.out:i.in:i.out;po(s,e,n);const o=e.seen.get(t);o.ref=s},F7t=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},M7e=(t,e,r,n)=>{const i=t._zod.def;po(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},z7t=xt("ZodISODateTime",(t,e)=>{W6t.init(t,e),pa.init(t,e)});function H7t(t){return jEt(z7t,t)}const V7t=xt("ZodISODate",(t,e)=>{q6t.init(t,e),pa.init(t,e)});function W7t(t){return XEt(V7t,t)}const q7t=xt("ZodISOTime",(t,e)=>{G6t.init(t,e),pa.init(t,e)});function G7t(t){return KEt(q7t,t)}const U7t=xt("ZodISODuration",(t,e)=>{U6t.init(t,e),pa.init(t,e)});function Y7t(t){return ZEt(U7t,t)}const j7t=(t,e)=>{h7e.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>NSt(t,r)},flatten:{value:r=>$St(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Sq,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Sq,2)}},isEmpty:{get(){return t.issues.length===0}}})},yu=xt("ZodError",j7t,{Parent:Error}),X7t=TQ(yu),K7t=kQ(yu),Z7t=cN(yu),Q7t=uN(yu),J7t=PSt(yu),eAt=BSt(yu),tAt=FSt(yu),rAt=zSt(yu),nAt=HSt(yu),iAt=VSt(yu),aAt=WSt(yu),sAt=qSt(yu),Wue=new WeakMap;function AE(t,e,r){const n=Object.getPrototypeOf(t);let i=Wue.get(n);if(i||(i=new Set,Wue.set(n,i)),!i.has(e)){i.add(e);for(const a in r){const s=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const o=s.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:o}),o},set(o){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:o})}})}}}const La=xt("ZodType",(t,e)=>(Ma.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:nL(t,"input"),output:nL(t,"output")}}),t.toJSONSchema=v7t(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>X7t(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Z7t(t,r,n),t.parseAsync=async(r,n)=>K7t(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Q7t(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>J7t(t,r,n),t.decode=(r,n)=>eAt(t,r,n),t.encodeAsync=async(r,n)=>tAt(t,r,n),t.decodeAsync=async(r,n)=>rAt(t,r,n),t.safeEncode=(r,n)=>nAt(t,r,n),t.safeDecode=(r,n)=>iAt(t,r,n),t.safeEncodeAsync=async(r,n)=>aAt(t,r,n),t.safeDecodeAsync=async(r,n)=>sAt(t,r,n),AE(t,"ZodType",{check(...r){const n=this.def;return this.clone(vg(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return bg(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(JAt(r,n))},superRefine(r,n){return this.check(e8t(r,n))},overwrite(r){return this.check(O3(r))},optional(){return Uue(this)},exactOptional(){return zAt(this)},nullable(){return Yue(this)},nullish(){return Uue(Yue(this))},nonoptional(r){return UAt(this,r)},array(){return ms(this)},or(r){return N7e([this,r])},and(r){return DAt(this,r)},transform(r){return jue(this,BAt(r))},default(r){return WAt(this,r)},prefault(r){return GAt(this,r)},catch(r){return jAt(this,r)},pipe(r){return jue(this,r)},readonly(){return ZAt(this)},describe(r){const n=this.clone();return I5.add(n,{description:r}),n},meta(...r){if(r.length===0)return I5.get(this);const n=this.clone();return I5.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){var r;return(r=I5.get(t))==null?void 0:r.description},configurable:!0}),t)),L7e=xt("_ZodString",(t,e)=>{CQ.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>x7t(t,n,i);const r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,AE(t,"_ZodString",{regex(...n){return this.check(n7t(...n))},includes(...n){return this.check(s7t(...n))},startsWith(...n){return this.check(o7t(...n))},endsWith(...n){return this.check(l7t(...n))},min(...n){return this.check(rL(...n))},max(...n){return this.check(S7e(...n))},length(...n){return this.check(E7e(...n))},nonempty(...n){return this.check(rL(1,...n))},lowercase(n){return this.check(i7t(n))},uppercase(n){return this.check(a7t(n))},trim(){return this.check(u7t())},normalize(...n){return this.check(c7t(...n))},toLowerCase(){return this.check(h7t())},toUpperCase(){return this.check(d7t())},slugify(){return this.check(f7t())}})}),oAt=xt("ZodString",(t,e)=>{CQ.init(t,e),L7e.init(t,e),t.email=r=>t.check(AEt(lAt,r)),t.url=r=>t.check(IEt(cAt,r)),t.jwt=r=>t.check(YEt(CAt,r)),t.emoji=r=>t.check($Et(uAt,r)),t.guid=r=>t.check(Fue(que,r)),t.uuid=r=>t.check(REt(CA,r)),t.uuidv4=r=>t.check(_Et(CA,r)),t.uuidv6=r=>t.check(MEt(CA,r)),t.uuidv7=r=>t.check(LEt(CA,r)),t.nanoid=r=>t.check(NEt(hAt,r)),t.guid=r=>t.check(Fue(que,r)),t.cuid=r=>t.check(DEt(dAt,r)),t.cuid2=r=>t.check(OEt(fAt,r)),t.ulid=r=>t.check(PEt(pAt,r)),t.base64=r=>t.check(qEt(wAt,r)),t.base64url=r=>t.check(GEt(TAt,r)),t.xid=r=>t.check(BEt(gAt,r)),t.ksuid=r=>t.check(FEt(mAt,r)),t.ipv4=r=>t.check(zEt(yAt,r)),t.ipv6=r=>t.check(HEt(vAt,r)),t.cidrv4=r=>t.check(VEt(bAt,r)),t.cidrv6=r=>t.check(WEt(xAt,r)),t.e164=r=>t.check(UEt(kAt,r)),t.datetime=r=>t.check(H7t(r)),t.date=r=>t.check(W7t(r)),t.time=r=>t.check(G7t(r)),t.duration=r=>t.check(Y7t(r))});function ot(t){return EEt(oAt,t)}const pa=xt("ZodStringFormat",(t,e)=>{ta.init(t,e),L7e.init(t,e)}),lAt=xt("ZodEmail",(t,e)=>{N6t.init(t,e),pa.init(t,e)}),que=xt("ZodGUID",(t,e)=>{I6t.init(t,e),pa.init(t,e)}),CA=xt("ZodUUID",(t,e)=>{$6t.init(t,e),pa.init(t,e)}),cAt=xt("ZodURL",(t,e)=>{D6t.init(t,e),pa.init(t,e)}),uAt=xt("ZodEmoji",(t,e)=>{O6t.init(t,e),pa.init(t,e)}),hAt=xt("ZodNanoID",(t,e)=>{P6t.init(t,e),pa.init(t,e)}),dAt=xt("ZodCUID",(t,e)=>{B6t.init(t,e),pa.init(t,e)}),fAt=xt("ZodCUID2",(t,e)=>{F6t.init(t,e),pa.init(t,e)}),pAt=xt("ZodULID",(t,e)=>{z6t.init(t,e),pa.init(t,e)}),gAt=xt("ZodXID",(t,e)=>{H6t.init(t,e),pa.init(t,e)}),mAt=xt("ZodKSUID",(t,e)=>{V6t.init(t,e),pa.init(t,e)}),yAt=xt("ZodIPv4",(t,e)=>{Y6t.init(t,e),pa.init(t,e)}),vAt=xt("ZodIPv6",(t,e)=>{j6t.init(t,e),pa.init(t,e)}),bAt=xt("ZodCIDRv4",(t,e)=>{X6t.init(t,e),pa.init(t,e)}),xAt=xt("ZodCIDRv6",(t,e)=>{K6t.init(t,e),pa.init(t,e)}),wAt=xt("ZodBase64",(t,e)=>{Z6t.init(t,e),pa.init(t,e)}),TAt=xt("ZodBase64URL",(t,e)=>{J6t.init(t,e),pa.init(t,e)}),kAt=xt("ZodE164",(t,e)=>{eEt.init(t,e),pa.init(t,e)}),CAt=xt("ZodJWT",(t,e)=>{rEt.init(t,e),pa.init(t,e)}),I7e=xt("ZodNumber",(t,e)=>{x7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>w7t(t,n,i),AE(t,"ZodNumber",{gt(n,i){return this.check(Hue(n,i))},gte(n,i){return this.check(TB(n,i))},min(n,i){return this.check(TB(n,i))},lt(n,i){return this.check(zue(n,i))},lte(n,i){return this.check(wB(n,i))},max(n,i){return this.check(wB(n,i))},int(n){return this.check(Gue(n))},safe(n){return this.check(Gue(n))},positive(n){return this.check(Hue(0,n))},nonnegative(n){return this.check(TB(0,n))},negative(n){return this.check(zue(0,n))},nonpositive(n){return this.check(wB(0,n))},multipleOf(n,i){return this.check(Vue(n,i))},step(n,i){return this.check(Vue(n,i))},finite(){return this}});const r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function rl(t){return QEt(I7e,t)}const SAt=xt("ZodNumberFormat",(t,e)=>{nEt.init(t,e),I7e.init(t,e)});function Gue(t){return JEt(SAt,t)}const EAt=xt("ZodBoolean",(t,e)=>{iEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>T7t(t,r,n)});function Ro(t){return e7t(EAt,t)}const AAt=xt("ZodUnknown",(t,e)=>{aEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>C7t()});function r6(){return t7t(AAt)}const RAt=xt("ZodNever",(t,e)=>{sEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>k7t(t,r,n)});function _At(t){return r7t(RAt,t)}const MAt=xt("ZodArray",(t,e)=>{oEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_7t(t,r,n,i),t.element=e.element,AE(t,"ZodArray",{min(r,n){return this.check(rL(r,n))},nonempty(r){return this.check(rL(1,r))},max(r,n){return this.check(S7e(r,n))},length(r,n){return this.check(E7e(r,n))},unwrap(){return this.element}})});function ms(t,e){return p7t(MAt,t,e)}const LAt=xt("ZodObject",(t,e)=>{cEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>M7t(t,r,n,i),ci(t,"shape",()=>e.shape),AE(t,"ZodObject",{keyof(){return ds(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:r6()})},loose(){return this.clone({...this._zod.def,catchall:r6()})},strict(){return this.clone({...this._zod.def,catchall:_At()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return ASt(this,r)},safeExtend(r){return RSt(this,r)},merge(r){return _St(this,r)},pick(r){return SSt(this,r)},omit(r){return ESt(this,r)},partial(...r){return MSt(D7e,this,r[0])},required(...r){return LSt(O7e,this,r[0])}})});function nn(t,e){const r={type:"object",shape:t??{},..._r(e)};return new LAt(r)}const $7e=xt("ZodUnion",(t,e)=>{k7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>L7t(t,r,n,i),t.options=e.options});function N7e(t,e){return new $7e({type:"union",options:t,..._r(e)})}const IAt=xt("ZodDiscriminatedUnion",(t,e)=>{$7e.init(t,e),uEt.init(t,e)});function $At(t,e,r){return new IAt({type:"union",options:e,discriminator:t,..._r(r)})}const NAt=xt("ZodIntersection",(t,e)=>{hEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>I7t(t,r,n,i)});function DAt(t,e){return new NAt({type:"intersection",left:t,right:e})}const Aq=xt("ZodEnum",(t,e)=>{dEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(n,i,a)=>S7t(t,n,i),t.enum=e.entries,t.options=Object.values(e.entries);const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const a={};for(const s of n)if(r.has(s))a[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Aq({...e,checks:[],..._r(i),entries:a})},t.exclude=(n,i)=>{const a={...e.entries};for(const s of n)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new Aq({...e,checks:[],..._r(i),entries:a})}});function ds(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Aq({type:"enum",entries:r,..._r(e)})}const OAt=xt("ZodLiteral",(t,e)=>{fEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>E7t(t,r,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function s1(t,e){return new OAt({type:"literal",values:Array.isArray(t)?t:[t],..._r(e)})}const PAt=xt("ZodTransform",(t,e)=>{pEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>R7t(t,r),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new a7e(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(t6(a,r.value,e));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(t6(s))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function BAt(t){return new PAt({type:"transform",transform:t})}const D7e=xt("ZodOptional",(t,e)=>{C7e.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>M7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Uue(t){return new D7e({type:"optional",innerType:t})}const FAt=xt("ZodExactOptional",(t,e)=>{gEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>M7e(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function zAt(t){return new FAt({type:"optional",innerType:t})}const HAt=xt("ZodNullable",(t,e)=>{mEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Yue(t){return new HAt({type:"nullable",innerType:t})}const VAt=xt("ZodDefault",(t,e)=>{yEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>D7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function WAt(t,e){return new VAt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():l7e(e)}})}const qAt=xt("ZodPrefault",(t,e)=>{vEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>O7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function GAt(t,e){return new qAt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():l7e(e)}})}const O7e=xt("ZodNonOptional",(t,e)=>{bEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>N7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function UAt(t,e){return new O7e({type:"nonoptional",innerType:t,..._r(e)})}const YAt=xt("ZodCatch",(t,e)=>{xEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>P7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function jAt(t,e){return new YAt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const XAt=xt("ZodPipe",(t,e)=>{wEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>B7t(t,r,n,i),t.in=e.in,t.out=e.out});function jue(t,e){return new XAt({type:"pipe",in:t,out:e})}const KAt=xt("ZodReadonly",(t,e)=>{TEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>F7t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ZAt(t){return new KAt({type:"readonly",innerType:t})}const QAt=xt("ZodCustom",(t,e)=>{kEt.init(t,e),La.init(t,e),t._zod.processJSONSchema=(r,n,i)=>A7t(t,r)});function JAt(t,e={}){return g7t(QAt,t,e)}function e8t(t,e){return m7t(t,e)}const t8t="edgeever-zip",r8t=2,Yu=ot().datetime();nn({format:s1(t8t),formatVersion:N7e([s1(1),s1(r8t)]),schemaVersion:rl().int().positive(),edgeeverVersion:ot().trim().min(1),buildId:ot().trim().min(1),exportedAt:Yu,includesTrash:s1(!1),counts:nn({notebooks:rl().int().min(0),memos:rl().int().min(0),revisions:rl().int().min(0),resources:rl().int().min(0),prompts:rl().int().min(0).optional()})});const n8t=nn({id:ot().trim().min(1),parentId:ot().trim().min(1).nullable(),name:ot().trim().min(1).max(80),slug:ot().nullable(),icon:ot().nullable(),color:ot().nullable(),sortOrder:rl().int(),createdAt:Yu,updatedAt:Yu}),i8t=nn({id:ot().trim().min(1),memoId:ot().trim().min(1),revision:rl().int().min(0),title:ot().nullable(),tags:ms(ot()),contentJson:r6(),contentMarkdown:ot(),contentText:ot(),contentHash:ot(),createdBy:ot(),createdAt:Yu}),a8t=nn({id:ot().trim().min(1),notebookId:ot().trim().min(1),title:ot().nullable(),excerpt:ot(),tags:ms(ot()),isPinned:Ro(),isArchived:Ro(),isDeleted:Ro(),revision:rl().int().min(0),createdAt:Yu,updatedAt:Yu,deletedAt:Yu.nullable(),contentJson:r6(),contentMarkdown:ot(),contentText:ot(),contentHash:ot(),sourceMemoIds:ms(ot()),mergeSourceCount:rl().int().min(0),mergedIntoMemoId:ot().nullable()}),P7e=nn({memo:a8t,revisions:ms(i8t),resources:ms(nn({id:ot().trim().min(1),memoId:ot().trim().min(1),originalMemoId:ot().nullable(),kind:ds(["image","attachment"]),mimeType:ot().nullable(),filename:ot().nullable(),byteSize:rl().int().min(0),sha256:ot().nullable(),width:rl().int().positive().nullable(),height:rl().int().positive().nullable(),createdAt:Yu,updatedAt:Yu,archivePath:ot().trim().min(1)}))});nn({notebooks:ms(n8t).min(1).max(100)});nn({memos:ms(P7e).min(1).max(10)});const s8t=nn({id:ot().trim().min(1).max(200),origin:ds(["default","custom"]),seedKey:ds(Cq.filter(t=>t!=="custom")).nullable(),action:ds(Cq),parameterKind:ds(gQ),resultMode:ds(mQ),nameCustomized:Ro(),descriptionCustomized:Ro(),instructionCustomized:Ro(),name:ot().trim().min(1).max(80),description:ot().max(200).nullable(),instruction:ot().trim().min(1).max(2e3),createdAt:Yu,updatedAt:Yu}).superRefine((t,e)=>{t.origin==="default"&&!t.seedKey&&e.addIssue({code:"custom",path:["seedKey"],message:"A default prompt must include a seed key."}),t.origin==="default"&&t.seedKey&&t.action!==t.seedKey&&e.addIssue({code:"custom",path:["action"],message:"A default prompt action must match its seed key."}),t.origin==="custom"&&(t.seedKey!==null||t.action!=="custom")&&e.addIssue({code:"custom",path:["origin"],message:"A custom prompt cannot use factory prompt identity."})});nn({prompts:ms(s8t).max(100)});P7e.shape.resources.element;const Ik=(t,e,r)=>({...t,translations:{"zh-CN":e,"en-US":r}});Ik({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 - @@ -959,7 +959,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] - [ ] -`});nn({name:ot().trim().min(1).max(80),parentId:ot().trim().min(1).nullable().optional()});nn({name:ot().trim().min(1).max(80).optional(),parentId:ot().trim().min(1).nullable().optional(),sortOrder:rl().int().optional()});nn({notebookId:ot().trim().min(1),title:ot().trim().max(160).optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional(),createdAt:ot().datetime().optional(),updatedAt:ot().datetime().optional()});nn({expectedRevision:rl().int().min(0).optional(),expectedContentHash:ot().length(64).optional(),editSessionId:ot().trim().min(1).optional(),notebookId:ot().trim().min(1).optional(),title:ot().trim().max(160).optional(),isPinned:Ro().optional(),contentJson:t6().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional(),createdAt:ot().datetime().optional(),updatedAt:ot().datetime().optional(),allowDestructiveOverwrite:Ro().optional()});nn({name:ot().trim().min(1).max(160),description:ot().trim().max(500).optional(),memoId:ot().trim().min(1).optional(),title:ot().trim().max(160).nullable().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});nn({name:ot().trim().min(1).max(160).optional(),description:ot().trim().max(500).nullable().optional(),title:ot().trim().max(160).nullable().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional()});nn({notebookId:ot().trim().min(1)});const O7e=nn({pluginId:ot().trim().min(3).max(200),commandId:ot().trim().min(1).max(200)}),s8t=nn({name:ot().trim().min(1).max(120),taskType:s1("plugin-command"),taskPayload:O7e,cronExpression:ot().trim().min(1).max(160),timezone:ot().trim().min(1).max(80),executorDeviceId:ot().trim().min(16).max(160),missedRunPolicy:ds(["run-once","skip"]).default("run-once"),isEnabled:Ro().default(!0)});s8t.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:O7e.optional(),executorDeviceId:ot().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});nn({pluginId:ot().trim().min(3).max(200),scheduleKey:ot().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:ot().trim().min(1).max(120),commandId:ot().trim().min(1).max(200),cronExpression:ot().trim().min(1).max(160),timezone:ot().trim().min(1).max(80),executorDeviceId:ot().trim().min(16).max(160),missedRunPolicy:ds(["run-once","skip"]).default("run-once"),isEnabled:Ro().optional()});nn({scheduledFor:ot().datetime(),executorDeviceId:ot().trim().min(16).max(160)});nn({executorDeviceId:ot().trim().min(16).max(160),status:ds(["succeeded","failed"]),errorMessage:ot().trim().max(2e3).nullable().optional()});nn({memoIds:ms(ot().trim().min(1)).min(1).max(100),notebookId:ot().trim().min(1)});nn({memoIds:ms(ot().trim().min(1)).min(1).max(100),permanent:Ro().optional()});nn({memoIds:ms(ot().trim().min(1)).min(2).max(50),notebookId:ot().trim().min(1).optional(),title:ot().trim().max(160).optional()});nn({username:ot().trim().min(1).max(80),password:ot().min(1).max(512),deviceId:ot().trim().min(16).max(160).optional()});nn({label:ot().trim().max(80).nullable()});nn({currentPassword:ot().min(1).max(512),newPassword:ot().min(8).max(512),confirmPassword:ot().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});nn({username:ot().trim().min(1).max(80),displayName:ot().trim().max(80).nullable().optional(),password:ot().min(8).max(512)});nn({displayName:ot().trim().max(80).nullable().optional(),password:ot().min(8).max(512).optional(),isDisabled:Ro().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");nn({name:ot().trim().min(1).max(80),scopes:ms(ot().trim().min(1).max(80)).min(1).max(32),expiresAt:ot().datetime().nullable().optional()});nn({name:ot().trim().min(1).max(80)});nn({filename:ot().trim().min(1).max(160)});const P7e=ot().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");IAt("provider",[nn({provider:s1("builtin")}),nn({provider:s1("s3"),displayName:ot().trim().min(1).max(80),endpoint:P7e,region:ot().trim().min(1).max(80),bucket:ot().trim().min(1).max(255),accessKeyId:ot().trim().min(1).max(256),secretAccessKey:ot().min(1).max(1024).optional(),forcePathStyle:Ro().default(!0),objectPrefix:ot().trim().max(500).default("")})]);nn({endpoint:P7e,region:ot().trim().min(1).max(80),bucket:ot().trim().min(1).max(255),accessKeyId:ot().trim().min(1).max(256),secretAccessKey:ot().min(1).max(1024).optional(),forcePathStyle:Ro().default(!0),objectPrefix:ot().trim().max(500).default("")});const B7e=ds(["openai-compatible","anthropic","google"]),F7e=ot().trim().url().max(500).superRefine((t,e)=>{let r;try{r=new URL(t)}catch{return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})}),z7e=nn({provider:B7e,displayName:ot().trim().min(1).max(80),baseUrl:F7e,isEnabled:Ro().default(!0)});z7e.extend({apiKey:ot().min(1).max(4096),initialModelId:ot().trim().min(1).max(200).optional()});z7e.extend({apiKey:ot().min(1).max(4096).optional()});nn({modelId:ot().trim().min(1).max(200),provider:B7e.optional(),baseUrl:F7e.optional(),apiKey:ot().min(1).max(4096).optional()});nn({modelId:ot().trim().min(1).max(200),displayName:ot().trim().min(1).max(200).optional()});nn({modelConfigId:ot().trim().min(1).nullable()});const o8t=nn({filename:ot().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ds(lSt),base64Data:ot().min(1).max(Math.ceil(Tue/3)*4)}).superRefine((t,e)=>{const r=t7e(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=dSt(t.mediaType)?uSt:Tue;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});nn({action:ds(wq),promptId:ot().trim().min(1).max(200).optional(),locale:ot().trim().min(2).max(35).optional(),title:ot().trim().max(160).default(""),contentMarkdown:ot().max(3e5),stream:Ro().default(!1),targetLanguage:ds(oSt).optional(),tone:ds(sSt).optional(),instruction:ot().trim().min(1).max(2e3).optional(),attachments:ms(o8t).max(cSt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,a)=>i+(t7e(a.base64Data)??0),0)>hSt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});nn({title:ot().trim().max(160).default(""),contentMarkdown:ot().max(3e5),currentTags:ms(ot().trim().min(1).max(200)).max(24).default([]),locale:ot().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});nn({prompt:ot().trim().min(1).max(4e3).nullable()});nn({name:ot().trim().min(1).max(80),description:ot().trim().max(200).optional(),instruction:ot().trim().min(1).max(2e3),parameterKind:ds(fQ).default("none"),resultMode:ds(pQ).default("both")});nn({name:ot().trim().min(1).max(80).optional(),description:ot().trim().max(200).nullable().optional(),instruction:ot().trim().min(1).max(2e3).optional(),parameterKind:ds(fQ).optional(),resultMode:ds(pQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});const H7e={compact:560,standard:680,wide:800},l8t=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,c8t={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},VT={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},jue={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Xue={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",meta:"14px",code:"15px"}},u8t=(t,e)=>e&&VT[e]?e:t==="warm"?"sunset":t&&VT[t]?t:"slate",h8t=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return l8t.test(n)?`_${n}`:n},$k=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),d8t=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:a="slate",fontStyle:s="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=s==="mono",p=a==="notepad",g=f?`
+`});nn({name:ot().trim().min(1).max(80),parentId:ot().trim().min(1).nullable().optional()});nn({name:ot().trim().min(1).max(80).optional(),parentId:ot().trim().min(1).nullable().optional(),sortOrder:rl().int().optional()});nn({notebookId:ot().trim().min(1),title:ot().trim().max(160).optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional(),createdAt:ot().datetime().optional(),updatedAt:ot().datetime().optional()});nn({expectedRevision:rl().int().min(0).optional(),expectedContentHash:ot().length(64).optional(),editSessionId:ot().trim().min(1).optional(),notebookId:ot().trim().min(1).optional(),title:ot().trim().max(160).optional(),isPinned:Ro().optional(),contentJson:r6().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional(),createdAt:ot().datetime().optional(),updatedAt:ot().datetime().optional(),allowDestructiveOverwrite:Ro().optional()});nn({name:ot().trim().min(1).max(160),description:ot().trim().max(500).optional(),memoId:ot().trim().min(1).optional(),title:ot().trim().max(160).nullable().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});nn({name:ot().trim().min(1).max(160).optional(),description:ot().trim().max(500).nullable().optional(),title:ot().trim().max(160).nullable().optional(),contentMarkdown:ot().optional(),tags:ms(ot()).optional()});nn({notebookId:ot().trim().min(1)});const B7e=nn({pluginId:ot().trim().min(3).max(200),commandId:ot().trim().min(1).max(200)}),o8t=nn({name:ot().trim().min(1).max(120),taskType:s1("plugin-command"),taskPayload:B7e,cronExpression:ot().trim().min(1).max(160),timezone:ot().trim().min(1).max(80),executorDeviceId:ot().trim().min(16).max(160),missedRunPolicy:ds(["run-once","skip"]).default("run-once"),isEnabled:Ro().default(!0)});o8t.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:B7e.optional(),executorDeviceId:ot().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});nn({pluginId:ot().trim().min(3).max(200),scheduleKey:ot().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:ot().trim().min(1).max(120),commandId:ot().trim().min(1).max(200),cronExpression:ot().trim().min(1).max(160),timezone:ot().trim().min(1).max(80),executorDeviceId:ot().trim().min(16).max(160),missedRunPolicy:ds(["run-once","skip"]).default("run-once"),isEnabled:Ro().optional()});nn({scheduledFor:ot().datetime(),executorDeviceId:ot().trim().min(16).max(160)});nn({executorDeviceId:ot().trim().min(16).max(160),status:ds(["succeeded","failed"]),errorMessage:ot().trim().max(2e3).nullable().optional()});nn({memoIds:ms(ot().trim().min(1)).min(1).max(100),notebookId:ot().trim().min(1)});nn({memoIds:ms(ot().trim().min(1)).min(1).max(100),permanent:Ro().optional()});nn({memoIds:ms(ot().trim().min(1)).min(2).max(50),notebookId:ot().trim().min(1).optional(),title:ot().trim().max(160).optional()});nn({username:ot().trim().min(1).max(80),password:ot().min(1).max(512),deviceId:ot().trim().min(16).max(160).optional()});nn({label:ot().trim().max(80).nullable()});nn({currentPassword:ot().min(1).max(512),newPassword:ot().min(8).max(512),confirmPassword:ot().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});nn({username:ot().trim().min(1).max(80),displayName:ot().trim().max(80).nullable().optional(),password:ot().min(8).max(512)});nn({displayName:ot().trim().max(80).nullable().optional(),password:ot().min(8).max(512).optional(),isDisabled:Ro().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");nn({name:ot().trim().min(1).max(80),scopes:ms(ot().trim().min(1).max(80)).min(1).max(32),expiresAt:ot().datetime().nullable().optional()});nn({name:ot().trim().min(1).max(80)});nn({filename:ot().trim().min(1).max(160)});const F7e=ot().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");$At("provider",[nn({provider:s1("builtin")}),nn({provider:s1("s3"),displayName:ot().trim().min(1).max(80),endpoint:F7e,region:ot().trim().min(1).max(80),bucket:ot().trim().min(1).max(255),accessKeyId:ot().trim().min(1).max(256),secretAccessKey:ot().min(1).max(1024).optional(),forcePathStyle:Ro().default(!0),objectPrefix:ot().trim().max(500).default("")})]);nn({endpoint:F7e,region:ot().trim().min(1).max(80),bucket:ot().trim().min(1).max(255),accessKeyId:ot().trim().min(1).max(256),secretAccessKey:ot().min(1).max(1024).optional(),forcePathStyle:Ro().default(!0),objectPrefix:ot().trim().max(500).default("")});const z7e=ds(["openai-compatible","anthropic","google"]),H7e=ot().trim().url().max(500).superRefine((t,e)=>{let r;try{r=new URL(t)}catch{return}r.protocol!=="http:"&&r.protocol!=="https:"&&e.addIssue({code:"custom",message:"AI Base URL must use HTTP or HTTPS."}),(r.username||r.password)&&e.addIssue({code:"custom",message:"AI Base URL must not contain credentials."})}),V7e=nn({provider:z7e,displayName:ot().trim().min(1).max(80),baseUrl:H7e,isEnabled:Ro().default(!0)});V7e.extend({apiKey:ot().min(1).max(4096),initialModelId:ot().trim().min(1).max(200).optional()});V7e.extend({apiKey:ot().min(1).max(4096).optional()});nn({modelId:ot().trim().min(1).max(200),provider:z7e.optional(),baseUrl:H7e.optional(),apiKey:ot().min(1).max(4096).optional()});nn({modelId:ot().trim().min(1).max(200),displayName:ot().trim().min(1).max(200).optional()});nn({modelConfigId:ot().trim().min(1).nullable()});const l8t=nn({filename:ot().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:ds(cSt),base64Data:ot().min(1).max(Math.ceil(kue/3)*4)}).superRefine((t,e)=>{const r=n7e(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=fSt(t.mediaType)?hSt:kue;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});nn({action:ds(Cq),promptId:ot().trim().min(1).max(200).optional(),locale:ot().trim().min(2).max(35).optional(),title:ot().trim().max(160).default(""),contentMarkdown:ot().max(3e5),stream:Ro().default(!1),targetLanguage:ds(lSt).optional(),tone:ds(oSt).optional(),instruction:ot().trim().min(1).max(2e3).optional(),attachments:ms(l8t).max(uSt).default([])}).superRefine((t,e)=>{!t.promptId&&t.action==="translate"&&!t.targetLanguage&&e.addIssue({code:"custom",path:["targetLanguage"],message:"A target language is required for translation."}),!t.promptId&&t.action==="change-tone"&&!t.tone&&e.addIssue({code:"custom",path:["tone"],message:"A tone is required when changing tone."}),!t.promptId&&t.action==="custom"&&!t.instruction&&e.addIssue({code:"custom",path:["instruction"],message:"An instruction is required for a custom action."});const r=t.action==="custom"&&!!(t.instruction||t.promptId);!t.title&&!t.contentMarkdown.trim()&&t.attachments.length===0&&!r&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."}),t.attachments.reduce((i,a)=>i+(n7e(a.base64Data)??0),0)>dSt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});nn({title:ot().trim().max(160).default(""),contentMarkdown:ot().max(3e5),currentTags:ms(ot().trim().min(1).max(200)).max(24).default([]),locale:ot().trim().min(2).max(35).optional()}).superRefine((t,e)=>{!t.title&&!t.contentMarkdown.trim()&&e.addIssue({code:"custom",path:["contentMarkdown"],message:"Note content is required."})});nn({prompt:ot().trim().min(1).max(4e3).nullable()});nn({name:ot().trim().min(1).max(80),description:ot().trim().max(200).optional(),instruction:ot().trim().min(1).max(2e3),parameterKind:ds(gQ).default("none"),resultMode:ds(mQ).default("both")});nn({name:ot().trim().min(1).max(80).optional(),description:ot().trim().max(200).nullable().optional(),instruction:ot().trim().min(1).max(2e3).optional(),parameterKind:ds(gQ).optional(),resultMode:ds(mQ).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});const W7e={compact:560,standard:680,wide:800},c8t=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,u8t={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",warm:"#fffbeb"},VT={slate:{canvasBg:"linear-gradient(145deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(226, 232, 240, 0.85)",cardShadow:"0 2px 4px rgba(15, 23, 42, 0.02), 0 12px 28px -4px rgba(15, 23, 42, 0.07), 0 24px 60px -12px rgba(15, 23, 42, 0.06)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#64748b",metaBg:"#f8fafc",metaBorder:"#e2e8f0",accentColor:"#16a06e",accentSubtle:"rgba(22, 160, 110, 0.16)",linkBg:"rgba(22, 160, 110, 0.08)",dividerColor:"#e2e8f0",codeBg:"#f8fafc",codeBorder:"#e2e8f0",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 244, 0.7)",quoteBorder:"#10b981",tableThBg:"#f8fafc",tableBorder:"#e2e8f0",brandText:"#07130b",brandMark:"#16a06e"},aurora:{canvasBg:"linear-gradient(135deg, #a7f3d0 0%, #67e8f9 40%, #c4b5fd 100%)",cardBg:"rgba(255, 255, 255, 0.96)",cardBorder:"1px solid rgba(255, 255, 255, 0.95)",cardShadow:"0 24px 60px -12px rgba(14, 165, 233, 0.28), 0 4px 16px rgba(0, 0, 0, 0.04)",textColor:"#1e293b",headingColor:"#0f172a",metaColor:"#475569",metaBg:"rgba(241, 245, 249, 0.85)",metaBorder:"rgba(203, 213, 225, 0.7)",accentColor:"#0d9488",accentSubtle:"rgba(13, 148, 136, 0.18)",linkBg:"rgba(13, 148, 136, 0.09)",dividerColor:"rgba(226, 232, 240, 0.8)",codeBg:"rgba(248, 250, 252, 0.95)",codeBorder:"rgba(226, 232, 240, 0.8)",codeColor:"#0f172a",quoteBg:"rgba(240, 253, 250, 0.85)",quoteBorder:"#14b8a6",tableThBg:"#f1f5f9",tableBorder:"#cbd5e1",brandText:"#0f172a",brandMark:"#0d9488"},sunset:{canvasBg:"linear-gradient(135deg, #fde68a 0%, #fbcfe8 45%, #fed7aa 100%)",cardBg:"#fffdfa",cardBorder:"1px solid rgba(253, 230, 138, 0.7)",cardShadow:"0 24px 60px -12px rgba(244, 63, 94, 0.18), 0 4px 16px rgba(0, 0, 0, 0.03)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"rgba(254, 243, 199, 0.75)",metaBorder:"rgba(253, 230, 138, 0.8)",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"rgba(254, 215, 170, 0.7)",codeBg:"#fffbeb",codeBorder:"#fde68a",codeColor:"#1c1917",quoteBg:"rgba(255, 247, 237, 0.85)",quoteBorder:"#f97316",tableThBg:"#fef3c7",tableBorder:"#fde68a",brandText:"#1c1917",brandMark:"#ea580c"},midnight:{canvasBg:"linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%)",cardBg:"#131b2e",cardBorder:"1px solid rgba(255, 255, 255, 0.14)",cardShadow:"0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08)",textColor:"#cbd5e1",headingColor:"#f8fafc",metaColor:"#94a3b8",metaBg:"rgba(30, 41, 59, 0.85)",metaBorder:"rgba(51, 65, 85, 0.8)",accentColor:"#34d399",accentSubtle:"rgba(52, 211, 153, 0.2)",linkBg:"rgba(52, 211, 153, 0.12)",dividerColor:"rgba(51, 65, 85, 0.7)",codeBg:"#0b1120",codeBorder:"#1e293b",codeColor:"#e2e8f0",quoteBg:"rgba(16, 185, 129, 0.12)",quoteBorder:"#34d399",tableThBg:"#1e293b",tableBorder:"#334155",brandText:"#f8fafc",brandMark:"#34d399",isDark:!0},mint:{canvasBg:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(167, 243, 208, 0.85)",cardShadow:"0 20px 50px -15px rgba(16, 185, 129, 0.2), 0 4px 16px rgba(16, 185, 129, 0.06)",textColor:"#134e4a",headingColor:"#042f2e",metaColor:"#0f766e",metaBg:"#ccfbf1",metaBorder:"#99f6e4",accentColor:"#059669",accentSubtle:"rgba(5, 150, 105, 0.18)",linkBg:"rgba(5, 150, 105, 0.1)",dividerColor:"#a7f3d0",codeBg:"#f0fdf4",codeBorder:"#a7f3d0",codeColor:"#064e3b",quoteBg:"rgba(236, 253, 245, 0.85)",quoteBorder:"#10b981",tableThBg:"#ccfbf1",tableBorder:"#99f6e4",brandText:"#042f2e",brandMark:"#059669"},notepad:{canvasBg:"linear-gradient(135deg, #fbf7ee 0%, #f4ede0 100%)",cardBg:"#fefdfa",cardBorder:"1px solid rgba(220, 205, 180, 0.85)",cardShadow:"0 2px 4px rgba(100, 80, 50, 0.04), 0 16px 36px -8px rgba(100, 80, 50, 0.12), 0 28px 64px -16px rgba(100, 80, 50, 0.08)",textColor:"#2c2419",headingColor:"#1a140d",metaColor:"#8c7b68",metaBg:"rgba(240, 230, 214, 0.6)",metaBorder:"#dfd3c3",accentColor:"#c2410c",accentSubtle:"rgba(194, 65, 12, 0.15)",linkBg:"rgba(194, 65, 12, 0.08)",dividerColor:"#e8decb",codeBg:"#f5efe4",codeBorder:"#e2d5c3",codeColor:"#1a140d",quoteBg:"rgba(248, 241, 230, 0.85)",quoteBorder:"#d97706",tableThBg:"#f5ede0",tableBorder:"#dfd3c3",brandText:"#1a140d",brandMark:"#c2410c"},xuan:{canvasBg:"linear-gradient(135deg, #f7f6f2 0%, #ebe8e1 100%)",cardBg:"#fdfcf7",cardBorder:"1px solid rgba(210, 205, 195, 0.8)",cardShadow:"0 20px 48px -12px rgba(40, 35, 30, 0.1), 0 4px 16px rgba(40, 35, 30, 0.03)",textColor:"#242220",headingColor:"#0f0e0d",metaColor:"#736d66",metaBg:"#f0eee8",metaBorder:"#dedad2",accentColor:"#b91c1c",accentSubtle:"rgba(185, 28, 28, 0.15)",linkBg:"rgba(185, 28, 28, 0.08)",dividerColor:"#e3dfd6",codeBg:"#f4f2eb",codeBorder:"#dedad2",codeColor:"#0f0e0d",quoteBg:"rgba(245, 243, 238, 0.85)",quoteBorder:"#b91c1c",tableThBg:"#edeae2",tableBorder:"#dedad2",brandText:"#0f0e0d",brandMark:"#b91c1c"},lavender:{canvasBg:"linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%)",cardBg:"#ffffff",cardBorder:"1px solid rgba(221, 214, 254, 0.85)",cardShadow:"0 20px 48px -12px rgba(124, 58, 237, 0.16), 0 2px 8px rgba(124, 58, 237, 0.04)",textColor:"#1e1b4b",headingColor:"#0f0a2e",metaColor:"#6b21a8",metaBg:"#f5f3ff",metaBorder:"#ddd6fe",accentColor:"#7c3aed",accentSubtle:"rgba(124, 58, 237, 0.18)",linkBg:"rgba(124, 58, 237, 0.08)",dividerColor:"#e9d5ff",codeBg:"#faf5ff",codeBorder:"#e9d5ff",codeColor:"#4c1d95",quoteBg:"rgba(245, 243, 255, 0.85)",quoteBorder:"#8b5cf6",tableThBg:"#f5f3ff",tableBorder:"#ddd6fe",brandText:"#1e1b4b",brandMark:"#7c3aed"}},Xue={sans:'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',serif:'"Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "Hiragino Mincho ProN", Georgia, "Times New Roman", serif',mono:'"JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Kue={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",meta:"14px",code:"15px"}},h8t=(t,e)=>e&&VT[e]?e:t==="warm"?"sunset":t&&VT[t]?t:"slate",d8t=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return c8t.test(n)?`_${n}`:n},$k=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),f8t=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:a="slate",fontStyle:s="serif",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0})=>{const f=s==="mono",p=a==="notepad",g=f?`
@@ -991,7 +991,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
`:""} -
`},f8t=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=VT[t]||VT.slate,a=jue[e]||jue.sans,s=Xue[r]||Xue.md,o=H7e[n]||680;return` +`},p8t=({theme:t="slate",fontStyle:e="serif",fontSize:r="lg",cardWidth:n="standard"})=>{const i=VT[t]||VT.slate,a=Xue[e]||Xue.sans,s=Kue[r]||Kue.md,o=W7e[n]||680;return` :root { --ee-canvas-bg: ${i.canvasBg}; --ee-card-bg: ${i.cardBg}; @@ -1385,7 +1385,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. opacity: 0.9; } `:""} - `};let Au=class V7e{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new V7e(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Qh=class W7e{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new W7e(r,Au.range(this,e))}},Gt=class q7e{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;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+15":">","<":"<",'"':""","'":"'"},b8t=/[&><"']/g;function x8t(t){return String(t).replace(b8t,e=>v8t[e])}var G7e=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},w8t=function(e){var r=G7e(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},T8t=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},k8t=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},Lr={contains:p8t,deflt:g8t,escape:x8t,hyphenate:y8t,getBaseElem:G7e,isCharacterBox:w8t,protocolFromUrl:k8t},pR={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 C8t(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let kQ=class{constructor(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 in pR)if(pR.hasOwnProperty(r)){var n=pR[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:C8t(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 Gt("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(e.url&&!e.protocol){var r=Lr.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},$0=class{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 Bh[S8t[this.id]]}sub(){return Bh[E8t[this.id]]}fracNum(){return Bh[A8t[this.id]]}fracDen(){return Bh[R8t[this.id]]}cramp(){return Bh[_8t[this.id]]}text(){return Bh[M8t[this.id]]}isTight(){return this.size>=2}};var CQ=0,nL=1,fb=2,$f=3,r6=4,ru=5,WT=6,ll=7,Bh=[new $0(CQ,0,!1),new $0(nL,0,!0),new $0(fb,1,!1),new $0($f,1,!0),new $0(r6,2,!1),new $0(ru,2,!0),new $0(WT,3,!1),new $0(ll,3,!0)],S8t=[r6,ru,r6,ru,WT,ll,WT,ll],E8t=[ru,ru,ru,ru,ll,ll,ll,ll],A8t=[fb,$f,r6,ru,WT,ll,WT,ll],R8t=[$f,$f,ru,ru,ll,ll,ll,ll],_8t=[nL,nL,$f,$f,ru,ru,ll,ll],M8t=[CQ,nL,fb,$f,fb,$f,fb,$f],Or={DISPLAY:Bh[CQ],TEXT:Bh[fb],SCRIPT:Bh[r6],SCRIPTSCRIPT:Bh[WT]},Sq=[{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 L8t(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var gR=[];Sq.forEach(t=>t.blocks.forEach(e=>gR.push(...e)));function U7e(t){for(var e=0;e=gR[e]&&t<=gR[e+1])return!0;return!1}var Rv=80,I8t=function(e,r){return"M95,"+(622+e+r)+` + `};let Au=class q7e{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new q7e(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}},Jh=class G7e{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new G7e(r,Au.range(this,e))}},Gt=class U7e{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;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+15":">","<":"<",'"':""","'":"'"},x8t=/[&><"']/g;function w8t(t){return String(t).replace(x8t,e=>b8t[e])}var Y7e=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},T8t=function(e){var r=Y7e(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},k8t=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},C8t=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},Lr={contains:g8t,deflt:m8t,escape:w8t,hyphenate:v8t,getBaseElem:Y7e,isCharacterBox:T8t,protocolFromUrl:C8t},gR={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 S8t(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let SQ=class{constructor(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 in gR)if(gR.hasOwnProperty(r)){var n=gR[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:S8t(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 Gt("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(e.url&&!e.protocol){var r=Lr.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},$0=class{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 Fh[E8t[this.id]]}sub(){return Fh[A8t[this.id]]}fracNum(){return Fh[R8t[this.id]]}fracDen(){return Fh[_8t[this.id]]}cramp(){return Fh[M8t[this.id]]}text(){return Fh[L8t[this.id]]}isTight(){return this.size>=2}};var EQ=0,iL=1,fb=2,$f=3,n6=4,ru=5,WT=6,ll=7,Fh=[new $0(EQ,0,!1),new $0(iL,0,!0),new $0(fb,1,!1),new $0($f,1,!0),new $0(n6,2,!1),new $0(ru,2,!0),new $0(WT,3,!1),new $0(ll,3,!0)],E8t=[n6,ru,n6,ru,WT,ll,WT,ll],A8t=[ru,ru,ru,ru,ll,ll,ll,ll],R8t=[fb,$f,n6,ru,WT,ll,WT,ll],_8t=[$f,$f,ru,ru,ll,ll,ll,ll],M8t=[iL,iL,$f,$f,ru,ru,ll,ll],L8t=[EQ,iL,fb,$f,fb,$f,fb,$f],Or={DISPLAY:Fh[EQ],TEXT:Fh[fb],SCRIPT:Fh[n6],SCRIPTSCRIPT:Fh[WT]},Rq=[{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 I8t(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var mR=[];Rq.forEach(t=>t.blocks.forEach(e=>mR.push(...e)));function j7e(t){for(var e=0;e=mR[e]&&t<=mR[e+1])return!0;return!1}var Rv=80,$8t=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 @@ -1396,7 +1396,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"},$8t=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"},N8t=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+` @@ -1406,7 +1406,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"},N8t=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},D8t=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 @@ -1415,7 +1415,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"},D8t=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},O8t=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 @@ -1425,18 +1425,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"},O8t=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},P8t=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"},P8t=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},B8t=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"},B8t=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},F8t=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"},F8t=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=I8t(r,Rv);break;case"sqrtSize1":i=$8t(r,Rv);break;case"sqrtSize2":i=N8t(r,Rv);break;case"sqrtSize3":i=D8t(r,Rv);break;case"sqrtSize4":i=O8t(r,Rv);break;case"sqrtTall":i=B8t(r,Rv,n)}return i},z8t=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},Kue={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},z8t=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=$8t(r,Rv);break;case"sqrtSize1":i=N8t(r,Rv);break;case"sqrtSize2":i=D8t(r,Rv);break;case"sqrtSize3":i=O8t(r,Rv);break;case"sqrtSize4":i=P8t(r,Rv);break;case"sqrtTall":i=F8t(r,Rv,n)}return i},H8t=function(e,r){switch(e){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},Zue={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 @@ -1611,7 +1611,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`},H8t=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},V8t=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 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 @@ -1639,22 +1639,35 @@ 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.")}};let AE=class{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 Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText();return this.children.map(e).join("")}};var Vh={"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]}},CA={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]},Zue={Å:"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 V8t(t,e){Vh[t]=e}function SQ(t,e,r){if(!Vh[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Vh[e][n];if(!i&&t[0]in Zue&&(n=Zue[t[0]].charCodeAt(0),i=Vh[e][n]),!i&&r==="text"&&U7e(n)&&(i=Vh[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var wB={};function W8t(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!wB[e]){var r=wB[e]={cssEmPerMu:CA.quad[e]/18};for(var n in CA)CA.hasOwnProperty(n)&&(r[n]=CA[n][e])}return wB[e]}var q8t=[[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]],Que=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Jue=function(e,r){return r.size<2?e:q8t[e-1][r.size-1]};let Y7e=class um{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||um.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=Que[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};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new um(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Jue(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:Que[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Jue(um.BASESIZE,e);return this.size===r&&this.textSize===um.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!==um.BASESIZE?["sizing","reset-size"+this.size,"size"+um.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=W8t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};Y7e.BASESIZE=6;var Eq={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},G8t={ex:!0,em:!0,mu:!0},j7e=function(e){return typeof e!="string"&&(e=e.unit),e in Eq||e in G8t||e==="ex"},oa=function(e,r){var n;if(e.unit in Eq)n=Eq[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 Gt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Xt=function(e){return+e.toFixed(4)+"em"},Yp=function(e){return e.filter(r=>r).join(" ")},X7e=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)}},K7e=function(e){var r=document.createElement(e);r.className=Yp(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a/=\x00-\x1f]/,Z7e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Lr.escape(Yp(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Lr.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+Lr.escape(n)+'"');for(var a in this.attributes)if(this.attributes.hasOwnProperty(a)){if(U8t.test(a))throw new Gt("Invalid attribute name '"+a+"'");r+=" "+a+'="'+Lr.escape(this.attributes[a])+'"'}r+=">";for(var s=0;s",r};let RE=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.width=void 0,this.maxFontSize=void 0,this.style=void 0,X7e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Lr.contains(this.classes,e)}toNode(){return K7e.call(this,"span")}toMarkup(){return Z7e.call(this,"span")}},EQ=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,X7e.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Lr.contains(this.classes,e)}toNode(){return K7e.call(this,"a")}toMarkup(){return Z7e.call(this,"a")}},Y8t=class{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.style=n}hasClass(e){return Lr.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=''+Lr.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Yp(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Lr.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Lr.escape(n)+'"');var a=Lr.escape(this.text);return e?(r+=">",r+=a,r+="",r):a}},Gf=class{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 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},Aq=class{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 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var K8t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Z8t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ii={math:{},text:{}};function Y(t,e,r,n,i,a){Ii[t][i]={font:e,group:r,replace:n},a&&n&&(Ii[t][n]=Ii[t][i])}var ie="math",$t="text",xe="main",qe="ams",ra="accent-token",sr="bin",Cl="close",P3="inner",Nr="mathord",rs="op-token",Lc="open",uN="punct",je="rel",d0="spacing",Qe="textord";Y(ie,xe,je,"≡","\\equiv",!0);Y(ie,xe,je,"≺","\\prec",!0);Y(ie,xe,je,"≻","\\succ",!0);Y(ie,xe,je,"∼","\\sim",!0);Y(ie,xe,je,"⊥","\\perp");Y(ie,xe,je,"⪯","\\preceq",!0);Y(ie,xe,je,"⪰","\\succeq",!0);Y(ie,xe,je,"≃","\\simeq",!0);Y(ie,xe,je,"∣","\\mid",!0);Y(ie,xe,je,"≪","\\ll",!0);Y(ie,xe,je,"≫","\\gg",!0);Y(ie,xe,je,"≍","\\asymp",!0);Y(ie,xe,je,"∥","\\parallel");Y(ie,xe,je,"⋈","\\bowtie",!0);Y(ie,xe,je,"⌣","\\smile",!0);Y(ie,xe,je,"⊑","\\sqsubseteq",!0);Y(ie,xe,je,"⊒","\\sqsupseteq",!0);Y(ie,xe,je,"≐","\\doteq",!0);Y(ie,xe,je,"⌢","\\frown",!0);Y(ie,xe,je,"∋","\\ni",!0);Y(ie,xe,je,"∝","\\propto",!0);Y(ie,xe,je,"⊢","\\vdash",!0);Y(ie,xe,je,"⊣","\\dashv",!0);Y(ie,xe,je,"∋","\\owns");Y(ie,xe,uN,".","\\ldotp");Y(ie,xe,uN,"⋅","\\cdotp");Y(ie,xe,Qe,"#","\\#");Y($t,xe,Qe,"#","\\#");Y(ie,xe,Qe,"&","\\&");Y($t,xe,Qe,"&","\\&");Y(ie,xe,Qe,"ℵ","\\aleph",!0);Y(ie,xe,Qe,"∀","\\forall",!0);Y(ie,xe,Qe,"ℏ","\\hbar",!0);Y(ie,xe,Qe,"∃","\\exists",!0);Y(ie,xe,Qe,"∇","\\nabla",!0);Y(ie,xe,Qe,"♭","\\flat",!0);Y(ie,xe,Qe,"ℓ","\\ell",!0);Y(ie,xe,Qe,"♮","\\natural",!0);Y(ie,xe,Qe,"♣","\\clubsuit",!0);Y(ie,xe,Qe,"℘","\\wp",!0);Y(ie,xe,Qe,"♯","\\sharp",!0);Y(ie,xe,Qe,"♢","\\diamondsuit",!0);Y(ie,xe,Qe,"ℜ","\\Re",!0);Y(ie,xe,Qe,"♡","\\heartsuit",!0);Y(ie,xe,Qe,"ℑ","\\Im",!0);Y(ie,xe,Qe,"♠","\\spadesuit",!0);Y(ie,xe,Qe,"§","\\S",!0);Y($t,xe,Qe,"§","\\S");Y(ie,xe,Qe,"¶","\\P",!0);Y($t,xe,Qe,"¶","\\P");Y(ie,xe,Qe,"†","\\dag");Y($t,xe,Qe,"†","\\dag");Y($t,xe,Qe,"†","\\textdagger");Y(ie,xe,Qe,"‡","\\ddag");Y($t,xe,Qe,"‡","\\ddag");Y($t,xe,Qe,"‡","\\textdaggerdbl");Y(ie,xe,Cl,"⎱","\\rmoustache",!0);Y(ie,xe,Lc,"⎰","\\lmoustache",!0);Y(ie,xe,Cl,"⟯","\\rgroup",!0);Y(ie,xe,Lc,"⟮","\\lgroup",!0);Y(ie,xe,sr,"∓","\\mp",!0);Y(ie,xe,sr,"⊖","\\ominus",!0);Y(ie,xe,sr,"⊎","\\uplus",!0);Y(ie,xe,sr,"⊓","\\sqcap",!0);Y(ie,xe,sr,"∗","\\ast");Y(ie,xe,sr,"⊔","\\sqcup",!0);Y(ie,xe,sr,"◯","\\bigcirc",!0);Y(ie,xe,sr,"∙","\\bullet",!0);Y(ie,xe,sr,"‡","\\ddagger");Y(ie,xe,sr,"≀","\\wr",!0);Y(ie,xe,sr,"⨿","\\amalg");Y(ie,xe,sr,"&","\\And");Y(ie,xe,je,"⟵","\\longleftarrow",!0);Y(ie,xe,je,"⇐","\\Leftarrow",!0);Y(ie,xe,je,"⟸","\\Longleftarrow",!0);Y(ie,xe,je,"⟶","\\longrightarrow",!0);Y(ie,xe,je,"⇒","\\Rightarrow",!0);Y(ie,xe,je,"⟹","\\Longrightarrow",!0);Y(ie,xe,je,"↔","\\leftrightarrow",!0);Y(ie,xe,je,"⟷","\\longleftrightarrow",!0);Y(ie,xe,je,"⇔","\\Leftrightarrow",!0);Y(ie,xe,je,"⟺","\\Longleftrightarrow",!0);Y(ie,xe,je,"↦","\\mapsto",!0);Y(ie,xe,je,"⟼","\\longmapsto",!0);Y(ie,xe,je,"↗","\\nearrow",!0);Y(ie,xe,je,"↩","\\hookleftarrow",!0);Y(ie,xe,je,"↪","\\hookrightarrow",!0);Y(ie,xe,je,"↘","\\searrow",!0);Y(ie,xe,je,"↼","\\leftharpoonup",!0);Y(ie,xe,je,"⇀","\\rightharpoonup",!0);Y(ie,xe,je,"↙","\\swarrow",!0);Y(ie,xe,je,"↽","\\leftharpoondown",!0);Y(ie,xe,je,"⇁","\\rightharpoondown",!0);Y(ie,xe,je,"↖","\\nwarrow",!0);Y(ie,xe,je,"⇌","\\rightleftharpoons",!0);Y(ie,qe,je,"≮","\\nless",!0);Y(ie,qe,je,"","\\@nleqslant");Y(ie,qe,je,"","\\@nleqq");Y(ie,qe,je,"⪇","\\lneq",!0);Y(ie,qe,je,"≨","\\lneqq",!0);Y(ie,qe,je,"","\\@lvertneqq");Y(ie,qe,je,"⋦","\\lnsim",!0);Y(ie,qe,je,"⪉","\\lnapprox",!0);Y(ie,qe,je,"⊀","\\nprec",!0);Y(ie,qe,je,"⋠","\\npreceq",!0);Y(ie,qe,je,"⋨","\\precnsim",!0);Y(ie,qe,je,"⪹","\\precnapprox",!0);Y(ie,qe,je,"≁","\\nsim",!0);Y(ie,qe,je,"","\\@nshortmid");Y(ie,qe,je,"∤","\\nmid",!0);Y(ie,qe,je,"⊬","\\nvdash",!0);Y(ie,qe,je,"⊭","\\nvDash",!0);Y(ie,qe,je,"⋪","\\ntriangleleft");Y(ie,qe,je,"⋬","\\ntrianglelefteq",!0);Y(ie,qe,je,"⊊","\\subsetneq",!0);Y(ie,qe,je,"","\\@varsubsetneq");Y(ie,qe,je,"⫋","\\subsetneqq",!0);Y(ie,qe,je,"","\\@varsubsetneqq");Y(ie,qe,je,"≯","\\ngtr",!0);Y(ie,qe,je,"","\\@ngeqslant");Y(ie,qe,je,"","\\@ngeqq");Y(ie,qe,je,"⪈","\\gneq",!0);Y(ie,qe,je,"≩","\\gneqq",!0);Y(ie,qe,je,"","\\@gvertneqq");Y(ie,qe,je,"⋧","\\gnsim",!0);Y(ie,qe,je,"⪊","\\gnapprox",!0);Y(ie,qe,je,"⊁","\\nsucc",!0);Y(ie,qe,je,"⋡","\\nsucceq",!0);Y(ie,qe,je,"⋩","\\succnsim",!0);Y(ie,qe,je,"⪺","\\succnapprox",!0);Y(ie,qe,je,"≆","\\ncong",!0);Y(ie,qe,je,"","\\@nshortparallel");Y(ie,qe,je,"∦","\\nparallel",!0);Y(ie,qe,je,"⊯","\\nVDash",!0);Y(ie,qe,je,"⋫","\\ntriangleright");Y(ie,qe,je,"⋭","\\ntrianglerighteq",!0);Y(ie,qe,je,"","\\@nsupseteqq");Y(ie,qe,je,"⊋","\\supsetneq",!0);Y(ie,qe,je,"","\\@varsupsetneq");Y(ie,qe,je,"⫌","\\supsetneqq",!0);Y(ie,qe,je,"","\\@varsupsetneqq");Y(ie,qe,je,"⊮","\\nVdash",!0);Y(ie,qe,je,"⪵","\\precneqq",!0);Y(ie,qe,je,"⪶","\\succneqq",!0);Y(ie,qe,je,"","\\@nsubseteqq");Y(ie,qe,sr,"⊴","\\unlhd");Y(ie,qe,sr,"⊵","\\unrhd");Y(ie,qe,je,"↚","\\nleftarrow",!0);Y(ie,qe,je,"↛","\\nrightarrow",!0);Y(ie,qe,je,"⇍","\\nLeftarrow",!0);Y(ie,qe,je,"⇏","\\nRightarrow",!0);Y(ie,qe,je,"↮","\\nleftrightarrow",!0);Y(ie,qe,je,"⇎","\\nLeftrightarrow",!0);Y(ie,qe,je,"△","\\vartriangle");Y(ie,qe,Qe,"ℏ","\\hslash");Y(ie,qe,Qe,"▽","\\triangledown");Y(ie,qe,Qe,"◊","\\lozenge");Y(ie,qe,Qe,"Ⓢ","\\circledS");Y(ie,qe,Qe,"®","\\circledR");Y($t,qe,Qe,"®","\\circledR");Y(ie,qe,Qe,"∡","\\measuredangle",!0);Y(ie,qe,Qe,"∄","\\nexists");Y(ie,qe,Qe,"℧","\\mho");Y(ie,qe,Qe,"Ⅎ","\\Finv",!0);Y(ie,qe,Qe,"⅁","\\Game",!0);Y(ie,qe,Qe,"‵","\\backprime");Y(ie,qe,Qe,"▲","\\blacktriangle");Y(ie,qe,Qe,"▼","\\blacktriangledown");Y(ie,qe,Qe,"■","\\blacksquare");Y(ie,qe,Qe,"⧫","\\blacklozenge");Y(ie,qe,Qe,"★","\\bigstar");Y(ie,qe,Qe,"∢","\\sphericalangle",!0);Y(ie,qe,Qe,"∁","\\complement",!0);Y(ie,qe,Qe,"ð","\\eth",!0);Y($t,xe,Qe,"ð","ð");Y(ie,qe,Qe,"╱","\\diagup");Y(ie,qe,Qe,"╲","\\diagdown");Y(ie,qe,Qe,"□","\\square");Y(ie,qe,Qe,"□","\\Box");Y(ie,qe,Qe,"◊","\\Diamond");Y(ie,qe,Qe,"¥","\\yen",!0);Y($t,qe,Qe,"¥","\\yen",!0);Y(ie,qe,Qe,"✓","\\checkmark",!0);Y($t,qe,Qe,"✓","\\checkmark");Y(ie,qe,Qe,"ℶ","\\beth",!0);Y(ie,qe,Qe,"ℸ","\\daleth",!0);Y(ie,qe,Qe,"ℷ","\\gimel",!0);Y(ie,qe,Qe,"ϝ","\\digamma",!0);Y(ie,qe,Qe,"ϰ","\\varkappa");Y(ie,qe,Lc,"┌","\\@ulcorner",!0);Y(ie,qe,Cl,"┐","\\@urcorner",!0);Y(ie,qe,Lc,"└","\\@llcorner",!0);Y(ie,qe,Cl,"┘","\\@lrcorner",!0);Y(ie,qe,je,"≦","\\leqq",!0);Y(ie,qe,je,"⩽","\\leqslant",!0);Y(ie,qe,je,"⪕","\\eqslantless",!0);Y(ie,qe,je,"≲","\\lesssim",!0);Y(ie,qe,je,"⪅","\\lessapprox",!0);Y(ie,qe,je,"≊","\\approxeq",!0);Y(ie,qe,sr,"⋖","\\lessdot");Y(ie,qe,je,"⋘","\\lll",!0);Y(ie,qe,je,"≶","\\lessgtr",!0);Y(ie,qe,je,"⋚","\\lesseqgtr",!0);Y(ie,qe,je,"⪋","\\lesseqqgtr",!0);Y(ie,qe,je,"≑","\\doteqdot");Y(ie,qe,je,"≓","\\risingdotseq",!0);Y(ie,qe,je,"≒","\\fallingdotseq",!0);Y(ie,qe,je,"∽","\\backsim",!0);Y(ie,qe,je,"⋍","\\backsimeq",!0);Y(ie,qe,je,"⫅","\\subseteqq",!0);Y(ie,qe,je,"⋐","\\Subset",!0);Y(ie,qe,je,"⊏","\\sqsubset",!0);Y(ie,qe,je,"≼","\\preccurlyeq",!0);Y(ie,qe,je,"⋞","\\curlyeqprec",!0);Y(ie,qe,je,"≾","\\precsim",!0);Y(ie,qe,je,"⪷","\\precapprox",!0);Y(ie,qe,je,"⊲","\\vartriangleleft");Y(ie,qe,je,"⊴","\\trianglelefteq");Y(ie,qe,je,"⊨","\\vDash",!0);Y(ie,qe,je,"⊪","\\Vvdash",!0);Y(ie,qe,je,"⌣","\\smallsmile");Y(ie,qe,je,"⌢","\\smallfrown");Y(ie,qe,je,"≏","\\bumpeq",!0);Y(ie,qe,je,"≎","\\Bumpeq",!0);Y(ie,qe,je,"≧","\\geqq",!0);Y(ie,qe,je,"⩾","\\geqslant",!0);Y(ie,qe,je,"⪖","\\eqslantgtr",!0);Y(ie,qe,je,"≳","\\gtrsim",!0);Y(ie,qe,je,"⪆","\\gtrapprox",!0);Y(ie,qe,sr,"⋗","\\gtrdot");Y(ie,qe,je,"⋙","\\ggg",!0);Y(ie,qe,je,"≷","\\gtrless",!0);Y(ie,qe,je,"⋛","\\gtreqless",!0);Y(ie,qe,je,"⪌","\\gtreqqless",!0);Y(ie,qe,je,"≖","\\eqcirc",!0);Y(ie,qe,je,"≗","\\circeq",!0);Y(ie,qe,je,"≜","\\triangleq",!0);Y(ie,qe,je,"∼","\\thicksim");Y(ie,qe,je,"≈","\\thickapprox");Y(ie,qe,je,"⫆","\\supseteqq",!0);Y(ie,qe,je,"⋑","\\Supset",!0);Y(ie,qe,je,"⊐","\\sqsupset",!0);Y(ie,qe,je,"≽","\\succcurlyeq",!0);Y(ie,qe,je,"⋟","\\curlyeqsucc",!0);Y(ie,qe,je,"≿","\\succsim",!0);Y(ie,qe,je,"⪸","\\succapprox",!0);Y(ie,qe,je,"⊳","\\vartriangleright");Y(ie,qe,je,"⊵","\\trianglerighteq");Y(ie,qe,je,"⊩","\\Vdash",!0);Y(ie,qe,je,"∣","\\shortmid");Y(ie,qe,je,"∥","\\shortparallel");Y(ie,qe,je,"≬","\\between",!0);Y(ie,qe,je,"⋔","\\pitchfork",!0);Y(ie,qe,je,"∝","\\varpropto");Y(ie,qe,je,"◀","\\blacktriangleleft");Y(ie,qe,je,"∴","\\therefore",!0);Y(ie,qe,je,"∍","\\backepsilon");Y(ie,qe,je,"▶","\\blacktriangleright");Y(ie,qe,je,"∵","\\because",!0);Y(ie,qe,je,"⋘","\\llless");Y(ie,qe,je,"⋙","\\gggtr");Y(ie,qe,sr,"⊲","\\lhd");Y(ie,qe,sr,"⊳","\\rhd");Y(ie,qe,je,"≂","\\eqsim",!0);Y(ie,xe,je,"⋈","\\Join");Y(ie,qe,je,"≑","\\Doteq",!0);Y(ie,qe,sr,"∔","\\dotplus",!0);Y(ie,qe,sr,"∖","\\smallsetminus");Y(ie,qe,sr,"⋒","\\Cap",!0);Y(ie,qe,sr,"⋓","\\Cup",!0);Y(ie,qe,sr,"⩞","\\doublebarwedge",!0);Y(ie,qe,sr,"⊟","\\boxminus",!0);Y(ie,qe,sr,"⊞","\\boxplus",!0);Y(ie,qe,sr,"⋇","\\divideontimes",!0);Y(ie,qe,sr,"⋉","\\ltimes",!0);Y(ie,qe,sr,"⋊","\\rtimes",!0);Y(ie,qe,sr,"⋋","\\leftthreetimes",!0);Y(ie,qe,sr,"⋌","\\rightthreetimes",!0);Y(ie,qe,sr,"⋏","\\curlywedge",!0);Y(ie,qe,sr,"⋎","\\curlyvee",!0);Y(ie,qe,sr,"⊝","\\circleddash",!0);Y(ie,qe,sr,"⊛","\\circledast",!0);Y(ie,qe,sr,"⋅","\\centerdot");Y(ie,qe,sr,"⊺","\\intercal",!0);Y(ie,qe,sr,"⋒","\\doublecap");Y(ie,qe,sr,"⋓","\\doublecup");Y(ie,qe,sr,"⊠","\\boxtimes",!0);Y(ie,qe,je,"⇢","\\dashrightarrow",!0);Y(ie,qe,je,"⇠","\\dashleftarrow",!0);Y(ie,qe,je,"⇇","\\leftleftarrows",!0);Y(ie,qe,je,"⇆","\\leftrightarrows",!0);Y(ie,qe,je,"⇚","\\Lleftarrow",!0);Y(ie,qe,je,"↞","\\twoheadleftarrow",!0);Y(ie,qe,je,"↢","\\leftarrowtail",!0);Y(ie,qe,je,"↫","\\looparrowleft",!0);Y(ie,qe,je,"⇋","\\leftrightharpoons",!0);Y(ie,qe,je,"↶","\\curvearrowleft",!0);Y(ie,qe,je,"↺","\\circlearrowleft",!0);Y(ie,qe,je,"↰","\\Lsh",!0);Y(ie,qe,je,"⇈","\\upuparrows",!0);Y(ie,qe,je,"↿","\\upharpoonleft",!0);Y(ie,qe,je,"⇃","\\downharpoonleft",!0);Y(ie,xe,je,"⊶","\\origof",!0);Y(ie,xe,je,"⊷","\\imageof",!0);Y(ie,qe,je,"⊸","\\multimap",!0);Y(ie,qe,je,"↭","\\leftrightsquigarrow",!0);Y(ie,qe,je,"⇉","\\rightrightarrows",!0);Y(ie,qe,je,"⇄","\\rightleftarrows",!0);Y(ie,qe,je,"↠","\\twoheadrightarrow",!0);Y(ie,qe,je,"↣","\\rightarrowtail",!0);Y(ie,qe,je,"↬","\\looparrowright",!0);Y(ie,qe,je,"↷","\\curvearrowright",!0);Y(ie,qe,je,"↻","\\circlearrowright",!0);Y(ie,qe,je,"↱","\\Rsh",!0);Y(ie,qe,je,"⇊","\\downdownarrows",!0);Y(ie,qe,je,"↾","\\upharpoonright",!0);Y(ie,qe,je,"⇂","\\downharpoonright",!0);Y(ie,qe,je,"⇝","\\rightsquigarrow",!0);Y(ie,qe,je,"⇝","\\leadsto");Y(ie,qe,je,"⇛","\\Rrightarrow",!0);Y(ie,qe,je,"↾","\\restriction");Y(ie,xe,Qe,"‘","`");Y(ie,xe,Qe,"$","\\$");Y($t,xe,Qe,"$","\\$");Y($t,xe,Qe,"$","\\textdollar");Y(ie,xe,Qe,"%","\\%");Y($t,xe,Qe,"%","\\%");Y(ie,xe,Qe,"_","\\_");Y($t,xe,Qe,"_","\\_");Y($t,xe,Qe,"_","\\textunderscore");Y(ie,xe,Qe,"∠","\\angle",!0);Y(ie,xe,Qe,"∞","\\infty",!0);Y(ie,xe,Qe,"′","\\prime");Y(ie,xe,Qe,"△","\\triangle");Y(ie,xe,Qe,"Γ","\\Gamma",!0);Y(ie,xe,Qe,"Δ","\\Delta",!0);Y(ie,xe,Qe,"Θ","\\Theta",!0);Y(ie,xe,Qe,"Λ","\\Lambda",!0);Y(ie,xe,Qe,"Ξ","\\Xi",!0);Y(ie,xe,Qe,"Π","\\Pi",!0);Y(ie,xe,Qe,"Σ","\\Sigma",!0);Y(ie,xe,Qe,"Υ","\\Upsilon",!0);Y(ie,xe,Qe,"Φ","\\Phi",!0);Y(ie,xe,Qe,"Ψ","\\Psi",!0);Y(ie,xe,Qe,"Ω","\\Omega",!0);Y(ie,xe,Qe,"A","Α");Y(ie,xe,Qe,"B","Β");Y(ie,xe,Qe,"E","Ε");Y(ie,xe,Qe,"Z","Ζ");Y(ie,xe,Qe,"H","Η");Y(ie,xe,Qe,"I","Ι");Y(ie,xe,Qe,"K","Κ");Y(ie,xe,Qe,"M","Μ");Y(ie,xe,Qe,"N","Ν");Y(ie,xe,Qe,"O","Ο");Y(ie,xe,Qe,"P","Ρ");Y(ie,xe,Qe,"T","Τ");Y(ie,xe,Qe,"X","Χ");Y(ie,xe,Qe,"¬","\\neg",!0);Y(ie,xe,Qe,"¬","\\lnot");Y(ie,xe,Qe,"⊤","\\top");Y(ie,xe,Qe,"⊥","\\bot");Y(ie,xe,Qe,"∅","\\emptyset");Y(ie,qe,Qe,"∅","\\varnothing");Y(ie,xe,Nr,"α","\\alpha",!0);Y(ie,xe,Nr,"β","\\beta",!0);Y(ie,xe,Nr,"γ","\\gamma",!0);Y(ie,xe,Nr,"δ","\\delta",!0);Y(ie,xe,Nr,"ϵ","\\epsilon",!0);Y(ie,xe,Nr,"ζ","\\zeta",!0);Y(ie,xe,Nr,"η","\\eta",!0);Y(ie,xe,Nr,"θ","\\theta",!0);Y(ie,xe,Nr,"ι","\\iota",!0);Y(ie,xe,Nr,"κ","\\kappa",!0);Y(ie,xe,Nr,"λ","\\lambda",!0);Y(ie,xe,Nr,"μ","\\mu",!0);Y(ie,xe,Nr,"ν","\\nu",!0);Y(ie,xe,Nr,"ξ","\\xi",!0);Y(ie,xe,Nr,"ο","\\omicron",!0);Y(ie,xe,Nr,"π","\\pi",!0);Y(ie,xe,Nr,"ρ","\\rho",!0);Y(ie,xe,Nr,"σ","\\sigma",!0);Y(ie,xe,Nr,"τ","\\tau",!0);Y(ie,xe,Nr,"υ","\\upsilon",!0);Y(ie,xe,Nr,"ϕ","\\phi",!0);Y(ie,xe,Nr,"χ","\\chi",!0);Y(ie,xe,Nr,"ψ","\\psi",!0);Y(ie,xe,Nr,"ω","\\omega",!0);Y(ie,xe,Nr,"ε","\\varepsilon",!0);Y(ie,xe,Nr,"ϑ","\\vartheta",!0);Y(ie,xe,Nr,"ϖ","\\varpi",!0);Y(ie,xe,Nr,"ϱ","\\varrho",!0);Y(ie,xe,Nr,"ς","\\varsigma",!0);Y(ie,xe,Nr,"φ","\\varphi",!0);Y(ie,xe,sr,"∗","*",!0);Y(ie,xe,sr,"+","+");Y(ie,xe,sr,"−","-",!0);Y(ie,xe,sr,"⋅","\\cdot",!0);Y(ie,xe,sr,"∘","\\circ",!0);Y(ie,xe,sr,"÷","\\div",!0);Y(ie,xe,sr,"±","\\pm",!0);Y(ie,xe,sr,"×","\\times",!0);Y(ie,xe,sr,"∩","\\cap",!0);Y(ie,xe,sr,"∪","\\cup",!0);Y(ie,xe,sr,"∖","\\setminus",!0);Y(ie,xe,sr,"∧","\\land");Y(ie,xe,sr,"∨","\\lor");Y(ie,xe,sr,"∧","\\wedge",!0);Y(ie,xe,sr,"∨","\\vee",!0);Y(ie,xe,Qe,"√","\\surd");Y(ie,xe,Lc,"⟨","\\langle",!0);Y(ie,xe,Lc,"∣","\\lvert");Y(ie,xe,Lc,"∥","\\lVert");Y(ie,xe,Cl,"?","?");Y(ie,xe,Cl,"!","!");Y(ie,xe,Cl,"⟩","\\rangle",!0);Y(ie,xe,Cl,"∣","\\rvert");Y(ie,xe,Cl,"∥","\\rVert");Y(ie,xe,je,"=","=");Y(ie,xe,je,":",":");Y(ie,xe,je,"≈","\\approx",!0);Y(ie,xe,je,"≅","\\cong",!0);Y(ie,xe,je,"≥","\\ge");Y(ie,xe,je,"≥","\\geq",!0);Y(ie,xe,je,"←","\\gets");Y(ie,xe,je,">","\\gt",!0);Y(ie,xe,je,"∈","\\in",!0);Y(ie,xe,je,"","\\@not");Y(ie,xe,je,"⊂","\\subset",!0);Y(ie,xe,je,"⊃","\\supset",!0);Y(ie,xe,je,"⊆","\\subseteq",!0);Y(ie,xe,je,"⊇","\\supseteq",!0);Y(ie,qe,je,"⊈","\\nsubseteq",!0);Y(ie,qe,je,"⊉","\\nsupseteq",!0);Y(ie,xe,je,"⊨","\\models");Y(ie,xe,je,"←","\\leftarrow",!0);Y(ie,xe,je,"≤","\\le");Y(ie,xe,je,"≤","\\leq",!0);Y(ie,xe,je,"<","\\lt",!0);Y(ie,xe,je,"→","\\rightarrow",!0);Y(ie,xe,je,"→","\\to");Y(ie,qe,je,"≱","\\ngeq",!0);Y(ie,qe,je,"≰","\\nleq",!0);Y(ie,xe,d0," ","\\ ");Y(ie,xe,d0," ","\\space");Y(ie,xe,d0," ","\\nobreakspace");Y($t,xe,d0," ","\\ ");Y($t,xe,d0," "," ");Y($t,xe,d0," ","\\space");Y($t,xe,d0," ","\\nobreakspace");Y(ie,xe,d0,null,"\\nobreak");Y(ie,xe,d0,null,"\\allowbreak");Y(ie,xe,uN,",",",");Y(ie,xe,uN,";",";");Y(ie,qe,sr,"⊼","\\barwedge",!0);Y(ie,qe,sr,"⊻","\\veebar",!0);Y(ie,xe,sr,"⊙","\\odot",!0);Y(ie,xe,sr,"⊕","\\oplus",!0);Y(ie,xe,sr,"⊗","\\otimes",!0);Y(ie,xe,Qe,"∂","\\partial",!0);Y(ie,xe,sr,"⊘","\\oslash",!0);Y(ie,qe,sr,"⊚","\\circledcirc",!0);Y(ie,qe,sr,"⊡","\\boxdot",!0);Y(ie,xe,sr,"△","\\bigtriangleup");Y(ie,xe,sr,"▽","\\bigtriangledown");Y(ie,xe,sr,"†","\\dagger");Y(ie,xe,sr,"⋄","\\diamond");Y(ie,xe,sr,"⋆","\\star");Y(ie,xe,sr,"◃","\\triangleleft");Y(ie,xe,sr,"▹","\\triangleright");Y(ie,xe,Lc,"{","\\{");Y($t,xe,Qe,"{","\\{");Y($t,xe,Qe,"{","\\textbraceleft");Y(ie,xe,Cl,"}","\\}");Y($t,xe,Qe,"}","\\}");Y($t,xe,Qe,"}","\\textbraceright");Y(ie,xe,Lc,"{","\\lbrace");Y(ie,xe,Cl,"}","\\rbrace");Y(ie,xe,Lc,"[","\\lbrack",!0);Y($t,xe,Qe,"[","\\lbrack",!0);Y(ie,xe,Cl,"]","\\rbrack",!0);Y($t,xe,Qe,"]","\\rbrack",!0);Y(ie,xe,Lc,"(","\\lparen",!0);Y(ie,xe,Cl,")","\\rparen",!0);Y($t,xe,Qe,"<","\\textless",!0);Y($t,xe,Qe,">","\\textgreater",!0);Y(ie,xe,Lc,"⌊","\\lfloor",!0);Y(ie,xe,Cl,"⌋","\\rfloor",!0);Y(ie,xe,Lc,"⌈","\\lceil",!0);Y(ie,xe,Cl,"⌉","\\rceil",!0);Y(ie,xe,Qe,"\\","\\backslash");Y(ie,xe,Qe,"∣","|");Y(ie,xe,Qe,"∣","\\vert");Y($t,xe,Qe,"|","\\textbar",!0);Y(ie,xe,Qe,"∥","\\|");Y(ie,xe,Qe,"∥","\\Vert");Y($t,xe,Qe,"∥","\\textbardbl");Y($t,xe,Qe,"~","\\textasciitilde");Y($t,xe,Qe,"\\","\\textbackslash");Y($t,xe,Qe,"^","\\textasciicircum");Y(ie,xe,je,"↑","\\uparrow",!0);Y(ie,xe,je,"⇑","\\Uparrow",!0);Y(ie,xe,je,"↓","\\downarrow",!0);Y(ie,xe,je,"⇓","\\Downarrow",!0);Y(ie,xe,je,"↕","\\updownarrow",!0);Y(ie,xe,je,"⇕","\\Updownarrow",!0);Y(ie,xe,rs,"∐","\\coprod");Y(ie,xe,rs,"⋁","\\bigvee");Y(ie,xe,rs,"⋀","\\bigwedge");Y(ie,xe,rs,"⨄","\\biguplus");Y(ie,xe,rs,"⋂","\\bigcap");Y(ie,xe,rs,"⋃","\\bigcup");Y(ie,xe,rs,"∫","\\int");Y(ie,xe,rs,"∫","\\intop");Y(ie,xe,rs,"∬","\\iint");Y(ie,xe,rs,"∭","\\iiint");Y(ie,xe,rs,"∏","\\prod");Y(ie,xe,rs,"∑","\\sum");Y(ie,xe,rs,"⨂","\\bigotimes");Y(ie,xe,rs,"⨁","\\bigoplus");Y(ie,xe,rs,"⨀","\\bigodot");Y(ie,xe,rs,"∮","\\oint");Y(ie,xe,rs,"∯","\\oiint");Y(ie,xe,rs,"∰","\\oiiint");Y(ie,xe,rs,"⨆","\\bigsqcup");Y(ie,xe,rs,"∫","\\smallint");Y($t,xe,P3,"…","\\textellipsis");Y(ie,xe,P3,"…","\\mathellipsis");Y($t,xe,P3,"…","\\ldots",!0);Y(ie,xe,P3,"…","\\ldots",!0);Y(ie,xe,P3,"⋯","\\@cdots",!0);Y(ie,xe,P3,"⋱","\\ddots",!0);Y(ie,xe,Qe,"⋮","\\varvdots");Y($t,xe,Qe,"⋮","\\varvdots");Y(ie,xe,ra,"ˊ","\\acute");Y(ie,xe,ra,"ˋ","\\grave");Y(ie,xe,ra,"¨","\\ddot");Y(ie,xe,ra,"~","\\tilde");Y(ie,xe,ra,"ˉ","\\bar");Y(ie,xe,ra,"˘","\\breve");Y(ie,xe,ra,"ˇ","\\check");Y(ie,xe,ra,"^","\\hat");Y(ie,xe,ra,"⃗","\\vec");Y(ie,xe,ra,"˙","\\dot");Y(ie,xe,ra,"˚","\\mathring");Y(ie,xe,Nr,"","\\@imath");Y(ie,xe,Nr,"","\\@jmath");Y(ie,xe,Qe,"ı","ı");Y(ie,xe,Qe,"ȷ","ȷ");Y($t,xe,Qe,"ı","\\i",!0);Y($t,xe,Qe,"ȷ","\\j",!0);Y($t,xe,Qe,"ß","\\ss",!0);Y($t,xe,Qe,"æ","\\ae",!0);Y($t,xe,Qe,"œ","\\oe",!0);Y($t,xe,Qe,"ø","\\o",!0);Y($t,xe,Qe,"Æ","\\AE",!0);Y($t,xe,Qe,"Œ","\\OE",!0);Y($t,xe,Qe,"Ø","\\O",!0);Y($t,xe,ra,"ˊ","\\'");Y($t,xe,ra,"ˋ","\\`");Y($t,xe,ra,"ˆ","\\^");Y($t,xe,ra,"˜","\\~");Y($t,xe,ra,"ˉ","\\=");Y($t,xe,ra,"˘","\\u");Y($t,xe,ra,"˙","\\.");Y($t,xe,ra,"¸","\\c");Y($t,xe,ra,"˚","\\r");Y($t,xe,ra,"ˇ","\\v");Y($t,xe,ra,"¨",'\\"');Y($t,xe,ra,"˝","\\H");Y($t,xe,ra,"◯","\\textcircled");var Q7e={"--":!0,"---":!0,"``":!0,"''":!0};Y($t,xe,Qe,"–","--",!0);Y($t,xe,Qe,"–","\\textendash");Y($t,xe,Qe,"—","---",!0);Y($t,xe,Qe,"—","\\textemdash");Y($t,xe,Qe,"‘","`",!0);Y($t,xe,Qe,"‘","\\textquoteleft");Y($t,xe,Qe,"’","'",!0);Y($t,xe,Qe,"’","\\textquoteright");Y($t,xe,Qe,"“","``",!0);Y($t,xe,Qe,"“","\\textquotedblleft");Y($t,xe,Qe,"”","''",!0);Y($t,xe,Qe,"”","\\textquotedblright");Y(ie,xe,Qe,"°","\\degree",!0);Y($t,xe,Qe,"°","\\degree");Y($t,xe,Qe,"°","\\textdegree",!0);Y(ie,xe,Qe,"£","\\pounds");Y(ie,xe,Qe,"£","\\mathsterling",!0);Y($t,xe,Qe,"£","\\pounds");Y($t,xe,Qe,"£","\\textsterling",!0);Y(ie,qe,Qe,"✠","\\maltese");Y($t,qe,Qe,"✠","\\maltese");var the='0123456789/@."';for(var TB=0;TB0)return Ru(a,u,i,r,s.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=eRt(a,i,r,s,n);d=p.fontName,f=[p.fontClass]}else o?(d=tAe[l].fontName,f=[l]):(d=RA(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(hN(a,d,i).metrics)return Ru(a,d,i,r,s.concat(f));if(Q7e.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(Yp(t.classes)!==Yp(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},nRt=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},Dl=function(e,r,n,i){var a=new RE(e,r,n,i);return AQ(a),a},J7e=(t,e,r,n)=>new RE(t,e,r,n),iRt=function(e,r,n){var i=Dl([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},aRt=function(e,r,n,i){var a=new EQ(e,r,n,i);return AQ(a),a},eAe=function(e){var r=new AE(e);return AQ(r),r},sRt=function(e,r){return e instanceof AE?Dl([],[e],r):e},oRt=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=Dl(["mspace"],[],e),n=oa(t,e);return r.style.marginRight=Xt(n),r},RA=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},tAe={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"}},rAe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},uRt=function(e,r){var[n,i,a]=rAe[e],s=new jp(n),o=new Gf([s],{width:Xt(i),height:Xt(a),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=J7e(["overlay"],[o],r);return l.height=a,l.style.height=Xt(a),l.style.width=Xt(i),l},it={fontMap:tAe,makeSymbol:Ru,mathsym:J8t,makeSpan:Dl,makeSvgSpan:J7e,makeLineSpan:iRt,makeAnchor:aRt,makeFragment:eAe,wrapFragment:sRt,makeVList:lRt,makeOrd:tRt,makeGlue:cRt,staticSvg:uRt,svgData:rAe,tryCombineChars:nRt},aa={number:3,unit:"mu"},Yg={number:4,unit:"mu"},qd={number:5,unit:"mu"},hRt={mord:{mop:aa,mbin:Yg,mrel:qd,minner:aa},mop:{mord:aa,mop:aa,mrel:qd,minner:aa},mbin:{mord:Yg,mop:Yg,mopen:Yg,minner:Yg},mrel:{mord:qd,mop:qd,mopen:qd,minner:qd},mopen:{},mclose:{mop:aa,mbin:Yg,mrel:qd,minner:aa},mpunct:{mord:aa,mop:aa,mrel:qd,mopen:aa,mclose:aa,mpunct:aa,minner:aa},minner:{mord:aa,mop:aa,mbin:Yg,mrel:qd,mopen:aa,mpunct:aa,minner:aa}},dRt={mord:{mop:aa},mop:{mord:aa,mop:aa},mbin:{},mrel:{},mopen:{},mclose:{mop:aa},mpunct:{},minner:{mop:aa}},nAe={},aL={},sL={};function tr(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"&&Lr.contains(pRt,v)?m.classes[0]="mord":v==="mbin"&&Lr.contains(fRt,y)&&(g.classes[0]="mord")},{node:d},f,p),she(a,(g,m)=>{var y=_q(m),v=_q(g),x=y&&v?g.hasClass("mtight")?dRt[y][v]:hRt[y][v]:null;if(x)return it.makeGlue(x,u)},{node:d},f,p),a},she=function t(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()},iAe=function(e){return e instanceof AE||e instanceof EQ||e instanceof RE&&e.hasClass("enclosing")?e:null},yRt=function t(e,r){var n=iAe(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},_q=function(e,r){return e?(r&&(e=yRt(e,r)),mRt[e.classes[0]]||null):null},n6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Uf(r.concat(n))},Hn=function(e,r,n){if(!e)return Uf();if(aL[e.type]){var i=aL[e.type](e,r);if(n&&r.size!==n.size){i=Uf(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function _A(t,e){var r=Uf(["base"],t,e),n=Uf(["strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function Mq(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=ys(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(_A(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(_A(s,e));var u;r?(u=_A(ys(r,e,!0)),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Uf(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Xt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Xt(-h.depth))}return h}function aAe(t){return new AE(t)}let mc=class{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=Yp(this.classes));for(var n=0;n0&&(e+=' class ="'+Lr.escape(Yp(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},Wh=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Lr.escape(this.toText())}toText(){return this.text}},vRt=class{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",Xt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}};var zt={MathNode:mc,TextNode:Wh,SpaceNode:vRt,newDocumentFragment:aAe},hu=function(e,r,n){return Ii[r][e]&&Ii[r][e].replace&&e.charCodeAt(0)!==55349&&!(Q7e.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Ii[r][e].replace),new zt.TextNode(e)},RQ=function(e){return e.length===1?e[0]:new zt.MathNode("mrow",e)},_Q=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Lr.contains(["\\imath","\\jmath"],a))return null;Ii[i][a]&&Ii[i][a].replace&&(a=Ii[i][a].replace);var s=it.fontMap[n].fontName;return SQ(a,s,i)?it.fontMap[n].variant:null};function EB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Wh&&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 Wh&&r.text===","}else return!1}var nc=function(e,r,n){if(e.length===1){var i=vi(e[0],r);return n&&i instanceof mc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||EB(s))){var u=l.children[0];u instanceof mc&&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 Wh&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Wh&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Xp=function(e,r,n){return RQ(nc(e,r,n))},vi=function(e,r){if(!e)return new zt.MathNode("mrow");if(sL[e.type]){var n=sL[e.type](e,r);return n}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function ohe(t,e,r,n,i){var a=nc(t,r),s;a.length===1&&a[0]instanceof mc&&Lr.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new zt.MathNode("mrow",a);var o=new zt.MathNode("annotation",[new zt.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new zt.MathNode("semantics",[s,o]),u=new zt.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return it.makeSpan([h],[u])}var sAe=function(e){return new Y7e({style:e.displayMode?Or.DISPLAY:Or.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},oAe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=it.makeSpan(n,[e])}return e},bRt=function(e,r,n){var i=sAe(n),a;if(n.output==="mathml")return ohe(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=Mq(e,i);a=it.makeSpan(["katex"],[s])}else{var o=ohe(e,r,i,n.displayMode,!1),l=Mq(e,i);a=it.makeSpan(["katex"],[o,l])}return oAe(a,n)},xRt=function(e,r,n){var i=sAe(n),a=Mq(e,i),s=it.makeSpan(["katex"],[a]);return oAe(s,n)},wRt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",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":"="},TRt=function(e){var r=new zt.MathNode("mo",[new zt.TextNode(wRt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},kRt={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],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]},CRt=function(e){return e.type==="ordgroup"?e.body.length:1},SRt=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Lr.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=e,h=CRt(u.base),d,f,p;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,p=.42,f=l+"4"):(d=312,o=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=l+g):(o=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],f="tilde"+g)}var m=new jp(f),y=new Gf([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:it.makeSvgSpan([],[y],r),minWidth:0,height:p}}else{var v=[],x=kRt[l],[b,T,k]=x,S=k/1e3,C=b.length,E,A;if(C===1){var M=x[3];E=["hide-tail"],A=[M]}else if(C===2)E=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(C===3)E=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+C+" children.");for(var L=0;L0&&(i.style.minWidth=Xt(a)),i},ERt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=it.makeSpan(["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 Aq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new Aq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Gf(u,{width:"100%",height:Xt(o)});s=it.makeSvgSpan([],[h],a)}return s.height=o,s.style.height=Xt(o),s},Yf={encloseSpan:ERt,mathMLnode:TRt,svgSpan:SRt};function pn(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 MQ(t){var e=dN(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 dN(t){return t&&(t.type==="atom"||Z8t.hasOwnProperty(t.type))?t:null}var LQ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=pn(t.base,"accent"),r=n.base,t.base=r,i=X8t(Hn(t,e)),t.base=n):(n=pn(t,"accent"),r=n.base);var a=Hn(r,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(r),o=0;if(s){var l=Lr.getBaseElem(r),u=Hn(l,e.havingCrampedStyle());o=ehe(u).skew}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=Yf.svgSpan(n,e),f=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=it.staticSvg("vec",e),g=it.svgData.vec[1]):(p=it.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=ehe(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=it.makeSpan(["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=Xt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var v=it.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},lAe=(t,e)=>{var r=t.isStretchy?Yf.mathMLnode(t.label):new zt.MathNode("mo",[hu(t.label,t.mode)]),n=new zt.MathNode("mover",[vi(t.base,e),r]);return n.setAttribute("accent","true"),n},ARt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tr({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=oL(e[0]),n=!ARt.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:LQ,mathmlBuilder:lAe});tr({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:LQ,mathmlBuilder:lAe});tr({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=Hn(t.base,e),n=Yf.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=it.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return it.makeSpan(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=Yf.mathMLnode(t.label),n=new zt.MathNode("munder",[vi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var MA=t=>{var e=new zt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tr({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=it.wrapFragment(Hn(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=it.wrapFragment(Hn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=Yf.svgSpan(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=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:d}]},e)}else h=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),it.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=Yf.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=MA(vi(t.body,e));if(t.below){var a=MA(vi(t.below,e));n=new zt.MathNode("munderover",[r,a,i])}else n=new zt.MathNode("mover",[r,i])}else if(t.below){var s=MA(vi(t.below,e));n=new zt.MathNode("munder",[r,s])}else n=MA(),n=new zt.MathNode("mover",[r,n]);return n}});var RRt=it.makeSpan;function cAe(t,e){var r=ys(t.body,e,!0);return RRt([t.mclass],r,e)}function uAe(t,e){var r,n=nc(t.body,e);return t.mclass==="minner"?r=new zt.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new zt.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new zt.MathNode("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}tr({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:Fa(i),isCharacterBox:Lr.isCharacterBox(i)}},htmlBuilder:cAe,mathmlBuilder:uAe});var fN=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"};tr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:fN(e[0]),body:Fa(e[1]),isCharacterBox:Lr.isCharacterBox(e[1])}}});tr({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=fN(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Fa(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:Lr.isCharacterBox(l)}},htmlBuilder:cAe,mathmlBuilder:uAe});tr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:fN(e[0]),body:Fa(e[0])}},htmlBuilder(t,e){var r=ys(t.body,e,!0),n=it.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=nc(t.body,e),n=new zt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var _Rt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},lhe=()=>({type:"styling",body:[],mode:"math",style:"display"}),che=t=>t.type==="textord"&&t.text==="@",MRt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function LRt(t,e,r){var n=_Rt[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 IRt(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 Gt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=LRt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=lhe()}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([])}}tr({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=it.wrapFragment(Hn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Xt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new zt.MathNode("mrow",[vi(t.label,e)]);return r=new zt.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new zt.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});tr({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=it.wrapFragment(Hn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new zt.MathNode("mrow",[vi(t.fragment,e)])}});tr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=pn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Gt("\\@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 hAe=(t,e)=>{var r=ys(t.body,e.withColor(t.color),!1);return it.makeFragment(r)},dAe=(t,e)=>{var r=nc(t.body,e.withColor(t.color)),n=new zt.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};tr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=pn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Fa(i)}},htmlBuilder:hAe,mathmlBuilder:dAe});tr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=pn(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:hAe,mathmlBuilder:dAe});tr({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&&pn(i,"size").value}},htmlBuilder(t,e){var r=it.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Xt(oa(t.size,e)))),r},mathmlBuilder(t,e){var r=new zt.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(oa(t.size,e)))),r}});var Lq={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},fAe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},$Rt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},pAe=(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)};tr({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(Lq[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Lq[n.text]),pn(e.parseFunction(),"internal");throw new Gt("Invalid token after macro prefix",n)}});tr({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 Gt("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 Gt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Gt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Gt("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===Lq[r]),{type:"internal",mode:e.mode}}});tr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=fAe(e.gullet.popToken());e.gullet.consumeSpaces();var i=$Rt(e);return pAe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});tr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=fAe(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return pAe(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var $5=function(e,r,n){var i=Ii.math[e]&&Ii.math[e].replace,a=SQ(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},IQ=function(e,r,n,i){var a=n.havingBaseStyle(r),s=it.makeSpan(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},gAe=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=Xt(a),e.height-=a,e.depth+=a},NRt=function(e,r,n,i,a,s){var o=it.makeSymbol(e,"Main-Regular",a,i),l=IQ(o,r,i,s);return n&&gAe(l,i,r),l},DRt=function(e,r,n,i){return it.makeSymbol(e,"Size"+r+"-Regular",n,i)},mAe=function(e,r,n,i,a,s){var o=DRt(e,r,a,i),l=IQ(it.makeSpan(["delimsizing","size"+r],[o],i),Or.TEXT,i,s);return n&&gAe(l,i,Or.TEXT),l},AB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=it.makeSpan(["delimsizinginner",i],[it.makeSpan([],[it.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},RB=function(e,r,n){var i=Vh["Size4-Regular"][e.charCodeAt(0)]?Vh["Size4-Regular"][e.charCodeAt(0)][4]:Vh["Size1-Regular"][e.charCodeAt(0)][4],a=new jp("inner",z8t(e,Math.round(1e3*r))),s=new Gf([a],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=it.makeSvgSpan([],[s],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},Iq=.008,LA={type:"kern",size:-1*Iq},ORt=["|","\\lvert","\\rvert","\\vert"],PRt=["\\|","\\lVert","\\rVert","\\Vert"],yAe=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"):Lr.contains(ORt,e)?(u="∣",d="vert",f=333):Lr.contains(PRt,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=$5(o,p,a),m=g.height+g.depth,y=$5(u,p,a),v=y.height+y.depth,x=$5(h,p,a),b=x.height+x.depth,T=0,k=1;if(l!==null){var S=$5(l,p,a);T=S.height+S.depth,k=2}var C=m+b+T,E=Math.max(0,Math.ceil((r-C)/(k*v))),A=C+E*k*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=A/2-M,P=[];if(d.length>0){var N=A-m-b,_=Math.round(A*1e3),I=H8t(d,Math.round(N*1e3)),O=new jp(d,I),D=(f/1e3).toFixed(3)+"em",$=(_/1e3).toFixed(3)+"em",F=new Gf([O],{width:D,height:$,viewBox:"0 0 "+f+" "+_}),z=it.makeSvgSpan([],[F],i);z.height=_/1e3,z.style.width=D,z.style.height=$,P.push({type:"elem",elem:z})}else{if(P.push(AB(h,p,a)),P.push(LA),l===null){var H=A-m-b+2*Iq;P.push(RB(u,H,i))}else{var B=(A-m-b-T)/2+2*Iq;P.push(RB(u,B,i)),P.push(LA),P.push(AB(l,p,a)),P.push(LA),P.push(RB(u,B,i))}P.push(LA),P.push(AB(o,p,a))}var V=i.havingBaseStyle(Or.TEXT),q=it.makeVList({positionType:"bottom",positionData:L,children:P},V);return IQ(it.makeSpan(["delimsizing","mult"],[q],V),Or.TEXT,i,s)},_B=80,MB=.08,LB=function(e,r,n,i,a){var s=F8t(e,i,n),o=new jp(e,s),l=new Gf([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return it.makeSvgSpan(["hide-tail"],[l],a)},BRt=function(e,r){var n=r.havingBaseSizing(),i=wAe("\\surd",e*n.sizeMultiplier,xAe,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l=0,u=0,h=0,d;return i.type==="small"?(h=1e3+1e3*s+_B,e<1?a=1:e<1.4&&(a=.7),l=(1+s+MB)/a,u=(1+s)/a,o=LB("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+_B)*BC[i.size],u=(BC[i.size]+s)/a,l=(BC[i.size]+s+MB)/a,o=LB("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+MB,u=e+s,h=Math.floor(1e3*e+s)+_B,o=LB("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Xt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},vAe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],FRt=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],bAe=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],BC=[0,1.2,1.8,2.4,3],zRt=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Lr.contains(vAe,e)||Lr.contains(bAe,e))return mAe(e,r,!1,n,i,a);if(Lr.contains(FRt,e))return yAe(e,BC[r],!1,n,i,a);throw new Gt("Illegal delimiter: '"+e+"'")},HRt=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],VRt=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"stack"}],xAe=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],WRt=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";throw new Error("Add support for delim type '"+e.type+"' here.")},wAe=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return n[s]}return n[n.length-1]},TAe=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Lr.contains(bAe,e)?o=HRt:Lr.contains(vAe,e)?o=xAe:o=VRt;var l=wAe(e,r,o,i);return l.type==="small"?NRt(e,l.style,n,i,a,s):l.type==="large"?mAe(e,l.size,n,i,a,s):yAe(e,r,n,i,a,s)},qRt=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 TAe(e,d,!0,i,a,s)},Nf={sqrtImage:BRt,sizedDelim:zRt,sizeToMaxHeight:BC,customSizedDelim:TAe,leftRightDelim:qRt},uhe={"\\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}},GRt=["(","\\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 pN(t,e){var r=dN(t);if(r&&Lr.contains(GRt,r.text))return r;throw r?new Gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Gt("Invalid delimiter type '"+t.type+"'",t)}tr({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=pN(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:uhe[t.funcName].size,mclass:uhe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?it.makeSpan([t.mclass]):Nf.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(hu(t.delim,t.mode));var r=new zt.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Xt(Nf.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function hhe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tr({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 Gt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:pN(e[0],t).text,color:r}}});tr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=pN(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=pn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{hhe(t);for(var r=ys(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{hhe(t);var r=nc(t.body,e);if(t.left!=="."){var n=new zt.MathNode("mo",[hu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new zt.MathNode("mo",[hu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return RQ(r)}});tr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=pN(e[0],t);if(!t.parser.leftrightDepth)throw new Gt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=n6(e,[]);else{r=Nf.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?hu("|","text"):hu(t.delim,t.mode),n=new zt.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var $Q=(t,e)=>{var r=it.wrapFragment(Hn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,o=Lr.isCharacterBox(t.body);if(n==="sout")a=it.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=oa({number:.6,unit:"pt"},e),u=oa({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Xt(d/2+l);var f=Math.floor(1e3*d*i),p=P8t(f),g=new Gf([new jp("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=it.makeSvgSpan(["hide-tail"],[g],e),a.style.height=Xt(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=0,y=0,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=Yf.encloseSpan(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Xt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Xt(v),a.style.borderRightWidth=Xt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]},e)}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?it.makeSpan(["mord","cancel-lap"],[x],e):it.makeSpan(["mord"],[x],e)},NQ=(t,e)=>{var r=0,n=new zt.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[vi(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: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};tr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=pn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:$Q,mathmlBuilder:NQ});tr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=pn(e[0],"color-token").color,s=pn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:$Q,mathmlBuilder:NQ});tr({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]}}});tr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\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:$Q,mathmlBuilder:NQ});tr({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 kAe={};function yd(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 Gt("{"+t.envName+"} can be used only in display mode.")};function DQ(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function xg(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 Gt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Qh("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(dhe(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},r&&(k={type:"styling",mode:t.mode,style:r,body:[k]}),g.push(k);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Gt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){T(),g.length===1&&k.type==="styling"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:ue[ce]})}for(T(s[0]),n=0;n0&&(L+=x,Cue))for(n=0;n=o)){var j=void 0;(i>0||e.hskipBeforeAndAfter)&&(j=Lr.deflt(B.pregap,f),j!==0&&(I=it.makeSpan(["arraycolsep"],[]),I.style.width=Xt(j),_.push(I)));var ae=[];for(n=0;n0){for(var ee=it.makeLineSpan("hline",r,h),me=it.makeLineSpan("hdashline",r,h),te=[{type:"elem",elem:l,shift:0}];u.length>0;){var $e=u.pop(),Oe=$e.pos-P;$e.isDashed?te.push({type:"elem",elem:me,shift:Oe}):te.push({type:"elem",elem:ee,shift:Oe})}l=it.makeVList({positionType:"individualShift",children:te},r)}if(D.length===0)return it.makeSpan(["mord"],[l],r);var He=it.makeVList({positionType:"individualShift",children:D},r);return He=it.makeSpan(["tag"],[He],r),it.makeFragment([l,He])},URt={c:"center ",l:"left ",r:"right "},bd=function(e,r){for(var n=[],i=new zt.MathNode("mtd",[],["mtr-glue"]),a=new zt.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A-1?"alignat":"align",a=e.envName==="split",s=xg(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:DQ(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o,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};yd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=dN(e[0]),n=r?[e[0]]:pn(e[0],"ordgroup").body,i=n.map(function(s){var o=MQ(s),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Gt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return xg(t.parser,a,OQ(t.envName))},htmlBuilder:vd,mathmlBuilder:bd});yd({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".indexOf(r)===-1)throw new Gt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=xg(t.parser,n,OQ(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:vd,mathmlBuilder:bd});yd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=xg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=dN(e[0]),n=r?[e[0]]:pn(e[0],"ordgroup").body,i=n.map(function(s){var o=MQ(s),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new Gt("Unknown column alignment: "+l,s)});if(i.length>1)throw new Gt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=xg(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new Gt("{subarray} can contain only one column");return a},htmlBuilder:vd,mathmlBuilder:bd});yd({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=xg(t.parser,e,OQ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:SAe,htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Lr.contains(["gather","gather*"],t.envName)&&gN(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:DQ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return xg(t.parser,e,"display")},htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:SAe,htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){gN(t);var e={autoTag:DQ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return xg(t.parser,e,"display")},htmlBuilder:vd,mathmlBuilder:bd});yd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return gN(t),IRt(t.parser)},htmlBuilder:vd,mathmlBuilder:bd});Se("\\nonumber","\\gdef\\@eqnsw{0}");Se("\\notag","\\nonumber");tr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Gt(t.funcName+" valid only within array environment")}});var fhe=kAe;tr({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 Gt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Hn(t.body,n)},AAe=(t,e)=>{var r=t.font,n=e.withFont(r);return vi(t.body,n)},phe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tr({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=oL(e[0]),a=n;return a in phe&&(a=phe[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:EAe,mathmlBuilder:AAe});tr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=Lr.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:fN(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});tr({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),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:EAe,mathmlBuilder:AAe});var RAe=(t,e)=>{var r=e;return t==="display"?r=r.id>=Or.SCRIPT.id?r.text():Or.DISPLAY:t==="text"&&r.size===Or.DISPLAY.size?r=Or.TEXT:t==="script"?r=Or.SCRIPT:t==="scriptscript"&&(r=Or.SCRIPTSCRIPT),r},PQ=(t,e)=>{var r=RAe(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Hn(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 x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new zt.MathNode("mfrac",[vi(t.numer,e),vi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=oa(t.barSize,e);r.setAttribute("linethickness",Xt(n))}var i=RAe(t.size,e.style);if(i.size!==e.style.size){r=new zt.MathNode("mstyle",[r]);var a=i.size===Or.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var o=new zt.MathNode("mo",[new zt.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(r),t.rightDelim!=null){var l=new zt.MathNode("mo",[new zt.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return RQ(s)}return r};tr({type:"genfrac",names:["\\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,u="auto";switch(n){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")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:o,rightDelim:l,size:u,barSize:null}},htmlBuilder:PQ,mathmlBuilder:BQ});tr({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tr({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 ghe=["display","text","script","scriptscript"],mhe=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};tr({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=oL(e[0]),s=a.type==="atom"&&a.family==="open"?mhe(a.text):null,o=oL(e[1]),l=o.type==="atom"&&o.family==="close"?mhe(o.text):null,u=pn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=pn(p.body[0],"textord");f=ghe[Number(g.text)]}}else p=pn(p,"textord"),f=ghe[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l,size:f}},htmlBuilder:PQ,mathmlBuilder:BQ});tr({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:pn(e[0],"size").value,token:i}}});tr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=T8t(pn(e[1],"infix").size),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,size:"auto"}},htmlBuilder:PQ,mathmlBuilder:BQ});var _Ae=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Hn(t.sup,e.havingStyle(r.sup()),e):Hn(t.sub,e.havingStyle(r.sub()),e),i=pn(t.base,"horizBrace")):i=pn(t,"horizBrace");var a=Hn(i.base,e.havingBaseStyle(Or.DISPLAY)),s=Yf.svgSpan(i,e),o;if(i.isOver?(o=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=it.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=it.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=it.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return it.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},YRt=(t,e)=>{var r=Yf.mathMLnode(t.label);return new zt.MathNode(t.isOver?"mover":"munder",[vi(t.base,e),r])};tr({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:_Ae,mathmlBuilder:YRt});tr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=pn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Fa(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=ys(t.body,e,!1);return it.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Xp(t.body,e);return r instanceof mc||(r=new mc("mrow",[r])),r.setAttribute("href",t.href),r}});tr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=pn(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=pn(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=ys(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=it.makeSpan(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)=>Xp(t.body,e)});tr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Fa(e[0]),mathml:Fa(e[1])}},htmlBuilder:(t,e)=>{var r=ys(t.html,e,!1);return it.makeFragment(r)},mathmlBuilder:(t,e)=>Xp(t.mathml,e)});var IB=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 Gt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!j7e(n))throw new Gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};tr({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=pn(r[0],"raw").string,u=l.split(","),h=0;h{var r=oa(t.height,e),n=0;t.totalheight.number>0&&(n=oa(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=oa(t.width,e));var a={height:Xt(r+n)};i>0&&(a.width=Xt(i)),n>0&&(a.verticalAlign=Xt(-n));var s=new Y8t(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new zt.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=oa(t.height,e),i=0;if(t.totalheight.number>0&&(i=oa(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var a=oa(t.width,e);r.setAttribute("width",Xt(a))}return r.setAttribute("src",t.src),r}});tr({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=pn(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 it.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=oa(t.dimension,e);return new zt.SpaceNode(r)}});tr({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=it.makeSpan([],[Hn(t.body,e)]),r=it.makeSpan(["inner"],[r],e)):r=it.makeSpan(["inner"],[Hn(t.body,e)]);var n=it.makeSpan(["fix"],[]),i=it.makeSpan([t.alignment],[r,n],e),a=it.makeSpan(["strut"]);return a.style.height=Xt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Xt(-i.depth)),i.children.unshift(a),i=it.makeSpan(["thinbox"],[i],e),it.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new zt.MathNode("mpadded",[vi(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}});tr({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",body:s}}});tr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Gt("Mismatched "+t.funcName)}});var yhe=(t,e)=>{switch(e.style.size){case Or.DISPLAY.size:return t.display;case Or.TEXT.size:return t.text;case Or.SCRIPT.size:return t.script;case Or.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Fa(e[0]),text:Fa(e[1]),script:Fa(e[2]),scriptscript:Fa(e[3])}},htmlBuilder:(t,e)=>{var r=yhe(t,e),n=ys(r,e,!1);return it.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=yhe(t,e);return Xp(r,e)}});var MAe=(t,e,r,n,i,a,s)=>{t=it.makeSpan([],[t]);var o=r&&Lr.isCharacterBox(r),l,u;if(e){var h=Hn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Hn(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=it.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var g=t.height-s;f=it.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(u){var m=t.depth+s;f=it.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var y=[f];if(l&&a!==0&&!o){var v=it.makeSpan(["mspace"],[],n);v.style.marginRight=Xt(a),y.unshift(v)}return it.makeSpan(["mop","op-limits"],y,n)},LAe=["\\smallint"],B3=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=pn(t.base,"op"),i=!0):a=pn(t,"op");var s=e.style,o=!1;s.size===Or.DISPLAY.size&&a.symbol&&!Lr.contains(LAe,a.name)&&(o=!0);var l;if(a.symbol){var u=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=it.makeSymbol(a.name,u,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,f=it.staticSvg(h+"Size"+(o?"2":"1"),e);l=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]},e),a.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var p=ys(a.body,e,!0);p.length===1&&p[0]instanceof uu?(l=p[0],l.classes[0]="mop"):l=it.makeSpan(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new mc("mo",[hu(t.name,t.mode)]),Lr.contains(LAe,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new mc("mo",nc(t.body,e));else{r=new mc("mi",[new Wh(t.name.slice(1))]);var n=new mc("mo",[hu("⁡","text")]);t.parentIsSupSub?r=new mc("mrow",[r,n]):r=aAe([r,n])}return r},jRt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tr({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=jRt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:B3,mathmlBuilder:_E});tr({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:Fa(n)}},htmlBuilder:B3,mathmlBuilder:_E});var XRt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tr({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:B3,mathmlBuilder:_E});tr({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:B3,mathmlBuilder:_E});tr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=XRt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:B3,mathmlBuilder:_E});var IAe=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=pn(t.base,"operatorname"),i=!0):a=pn(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=ys(o,e.withFont("mathrm"),!0),u=0;u{for(var r=nc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new zt.TextNode(o)]}var l=new zt.MathNode("mi",r);l.setAttribute("mathvariant","normal");var u=new zt.MathNode("mo",[hu("⁡","text")]);return t.parentIsSupSub?new zt.MathNode("mrow",[l,u]):zt.newDocumentFragment([l,u])};tr({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:Fa(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:IAe,mathmlBuilder:KRt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Dy({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?it.makeFragment(ys(t.body,e,!1)):it.makeSpan(["mord"],ys(t.body,e,!0),e)},mathmlBuilder(t,e){return Xp(t.body,e,!0)}});tr({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=Hn(t.body,e.havingCrampedStyle()),n=it.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return it.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[new zt.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zt.MathNode("mover",[vi(t.body,e),r]);return n.setAttribute("accent","true"),n}});tr({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:Fa(n)}},htmlBuilder:(t,e)=>{var r=ys(t.body,e.withPhantom(),!1);return it.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=nc(t.body,e);return new zt.MathNode("mphantom",r)}});tr({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=it.makeSpan([],[Hn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=nc(Fa(t.body),e),n=new zt.MathNode("mphantom",r),i=new zt.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});tr({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=it.makeSpan(["inner"],[Hn(t.body,e.withPhantom())]),n=it.makeSpan(["fix"],[]);return it.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=nc(Fa(t.body),e),n=new zt.MathNode("mphantom",r),i=new zt.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});tr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=pn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Hn(t.body,e),n=oa(t.dy,e);return it.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new zt.MathNode("mpadded",[vi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});tr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tr({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=pn(e[0],"size"),s=pn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&pn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=it.makeSpan(["mord","rule"],[],e),n=oa(t.width,e),i=oa(t.height,e),a=t.shift?oa(t.shift,e):0;return r.style.borderRightWidth=Xt(n),r.style.borderTopWidth=Xt(i),r.style.bottom=Xt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=oa(t.width,e),n=oa(t.height,e),i=t.shift?oa(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new zt.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Xt(r)),s.setAttribute("height",Xt(n));var o=new zt.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",Xt(i)):(o.setAttribute("height",Xt(i)),o.setAttribute("depth",Xt(-i))),o.setAttribute("voffset",Xt(i)),o}});function $Ae(t,e,r){for(var n=ys(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return $Ae(t.body,r,e)};tr({type:"sizing",names:vhe,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:vhe.indexOf(n)+1,body:a}},htmlBuilder:ZRt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=nc(t.body,r),i=new zt.MathNode("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});tr({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]&&pn(r[0],"ordgroup");if(s)for(var o="",l=0;l{var r=it.makeSpan([],[Hn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new zt.MathNode("mpadded",[vi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});tr({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=Hn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=it.wrapFragment(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=Xt(h);var p=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(Or.SCRIPTSCRIPT),m=Hn(t.index,g,e),y=.6*(p.height-p.depth),v=it.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]},e),x=it.makeSpan(["root"],[v]);return it.makeSpan(["mord","sqrt"],[x,p],e)}else return it.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new zt.MathNode("mroot",[vi(r,e),vi(n,e)]):new zt.MathNode("msqrt",[vi(r,e)])}});var bhe={display:Or.DISPLAY,text:Or.TEXT,script:Or.SCRIPT,scriptscript:Or.SCRIPTSCRIPT};tr({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);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=bhe[t.style],n=e.havingStyle(r).withFont("");return $Ae(t.body,n,e)},mathmlBuilder(t,e){var r=bhe[t.style],n=e.havingStyle(r),i=nc(t.body,n),a=new zt.MathNode("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 QRt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Or.DISPLAY.size||n.alwaysHandleSupSub);return i?B3:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Or.DISPLAY.size||n.limits);return a?IAe:null}else{if(n.type==="accent")return Lr.isCharacterBox(n.base)?LQ:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?_Ae:null}else return null}else return null};Dy({type:"supsub",htmlBuilder(t,e){var r=QRt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Hn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Lr.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());o=Hn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Hn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Or.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Xt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof uu||b)&&(x=Xt(-s.italic))}var T;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var k=u.defaultRuleThickness,S=4*k;if(h-o.depth-(l.height-d)0&&(h+=C,d-=C)}var E=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];T=it.makeVList({positionType:"individualShift",children:E},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];T=it.makeVList({positionType:"shift",positionData:d,children:A},e)}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=it.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]},e);else throw new Error("supsub must have either sup or sub.");var M=_q(s,"right")||"mord";return it.makeSpan([M],[s,it.makeSpan(["msupsub"],[T])],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=[vi(t.base,e)];t.sub&&a.push(vi(t.sub,e)),t.sup&&a.push(vi(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===Or.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Or.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Or.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Or.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Or.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Or.DISPLAY)?s="mover":s="msup"}return new zt.MathNode(s,a)}});Dy({type:"atom",htmlBuilder(t,e){return it.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[hu(t.text,t.mode)]);if(t.family==="bin"){var n=_Q(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 NAe={mi:"italic",mn:"normal",mtext:"normal"};Dy({type:"mathord",htmlBuilder(t,e){return it.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new zt.MathNode("mi",[hu(t.text,t.mode,e)]),n=_Q(t,e)||"italic";return n!==NAe[r.type]&&r.setAttribute("mathvariant",n),r}});Dy({type:"textord",htmlBuilder(t,e){return it.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=hu(t.text,t.mode,e),n=_Q(t,e)||"normal",i;return t.mode==="text"?i=new zt.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new zt.MathNode("mn",[r]):t.text==="\\prime"?i=new zt.MathNode("mo",[r]):i=new zt.MathNode("mi",[r]),n!==NAe[i.type]&&i.setAttribute("mathvariant",n),i}});var $B={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},NB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Dy({type:"spacing",htmlBuilder(t,e){if(NB.hasOwnProperty(t.text)){var r=NB[t.text].className||"";if(t.mode==="text"){var n=it.makeOrd(t,e,"textord");return n.classes.push(r),n}else return it.makeSpan(["mspace",r],[it.mathsym(t.text,t.mode,e)],e)}else{if($B.hasOwnProperty(t.text))return it.makeSpan(["mspace",$B[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(NB.hasOwnProperty(t.text))r=new zt.MathNode("mtext",[new zt.TextNode(" ")]);else{if($B.hasOwnProperty(t.text))return new zt.MathNode("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var xhe=()=>{var t=new zt.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Dy({type:"tag",mathmlBuilder(t,e){var r=new zt.MathNode("mtable",[new zt.MathNode("mtr",[xhe(),new zt.MathNode("mtd",[Xp(t.body,e)]),xhe(),new zt.MathNode("mtd",[Xp(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var whe={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},The={"\\textbf":"textbf","\\textmd":"textmd"},JRt={"\\textit":"textit","\\textup":"textup"},khe=(t,e)=>{var r=t.font;if(r){if(whe[r])return e.withTextFontFamily(whe[r]);if(The[r])return e.withTextFontWeight(The[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(JRt[r])};tr({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:Fa(i),font:n}},htmlBuilder(t,e){var r=khe(t,e),n=ys(t.body,r,!0);return it.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=khe(t,e);return Xp(t.body,r)}});tr({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=Hn(t.body,e),n=it.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=it.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return it.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[new zt.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zt.MathNode("munder",[vi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});tr({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=Hn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return it.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new zt.MathNode("mpadded",[vi(t.body,e)],["vcenter"])}});tr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Gt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Che(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),yp=nAe,DAe=`[ \r - ]`,e_t="\\\\[a-zA-Z@]+",t_t="\\\\[^\uD800-\uDFFF]",r_t="("+e_t+")"+DAe+"*",n_t=`\\\\( +-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.")}};let RE=class{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 Lr.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),r=0;rr.toText();return this.children.map(e).join("")}};var Wh={"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]}},SA={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]},Que={Å:"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 W8t(t,e){Wh[t]=e}function AQ(t,e,r){if(!Wh[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Wh[e][n];if(!i&&t[0]in Que&&(n=Que[t[0]].charCodeAt(0),i=Wh[e][n]),!i&&r==="text"&&j7e(n)&&(i=Wh[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var kB={};function q8t(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!kB[e]){var r=kB[e]={cssEmPerMu:SA.quad[e]/18};for(var n in SA)SA.hasOwnProperty(n)&&(r[n]=SA[n][e])}return kB[e]}var G8t=[[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]],Jue=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],ehe=function(e,r){return r.size<2?e:G8t[e-1][r.size-1]};let X7e=class um{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||um.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=Jue[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};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new um(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:ehe(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:Jue[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=ehe(um.BASESIZE,e);return this.size===r&&this.textSize===um.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!==um.BASESIZE?["sizing","reset-size"+this.size,"size"+um.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=q8t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};X7e.BASESIZE=6;var _q={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},U8t={ex:!0,em:!0,mu:!0},K7e=function(e){return typeof e!="string"&&(e=e.unit),e in _q||e in U8t||e==="ex"},oa=function(e,r){var n;if(e.unit in _q)n=_q[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 Gt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Xt=function(e){return+e.toFixed(4)+"em"},Yp=function(e){return e.filter(r=>r).join(" ")},Z7e=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)}},Q7e=function(e){var r=document.createElement(e);r.className=Yp(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(r.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&r.setAttribute(i,this.attributes[i]);for(var a=0;a/=\x00-\x1f]/,J7e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Lr.escape(Yp(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Lr.hyphenate(i)+":"+this.style[i]+";");n&&(r+=' style="'+Lr.escape(n)+'"');for(var a in this.attributes)if(this.attributes.hasOwnProperty(a)){if(Y8t.test(a))throw new Gt("Invalid attribute name '"+a+"'");r+=" "+a+'="'+Lr.escape(this.attributes[a])+'"'}r+=">";for(var s=0;s",r};let _E=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.width=void 0,this.maxFontSize=void 0,this.style=void 0,Z7e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Lr.contains(this.classes,e)}toNode(){return Q7e.call(this,"span")}toMarkup(){return J7e.call(this,"span")}},RQ=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,Z7e.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return Lr.contains(this.classes,e)}toNode(){return Q7e.call(this,"a")}toMarkup(){return J7e.call(this,"a")}},j8t=class{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.style=n}hasClass(e){return Lr.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);return e}toMarkup(){var e=''+Lr.escape(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Yp(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(r=r||document.createElement("span"),r.style[n]=this.style[n]);return r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Lr.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,r+=' style="'+Lr.escape(n)+'"');var a=Lr.escape(this.text);return e?(r+=">",r+=a,r+="",r):a}},Gf=class{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 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},Mq=class{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 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var Z8t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Q8t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ii={math:{},text:{}};function Y(t,e,r,n,i,a){Ii[t][i]={font:e,group:r,replace:n},a&&n&&(Ii[t][n]=Ii[t][i])}var ie="math",$t="text",xe="main",qe="ams",ra="accent-token",sr="bin",Cl="close",P3="inner",Nr="mathord",rs="op-token",Lc="open",dN="punct",je="rel",d0="spacing",Qe="textord";Y(ie,xe,je,"≡","\\equiv",!0);Y(ie,xe,je,"≺","\\prec",!0);Y(ie,xe,je,"≻","\\succ",!0);Y(ie,xe,je,"∼","\\sim",!0);Y(ie,xe,je,"⊥","\\perp");Y(ie,xe,je,"⪯","\\preceq",!0);Y(ie,xe,je,"⪰","\\succeq",!0);Y(ie,xe,je,"≃","\\simeq",!0);Y(ie,xe,je,"∣","\\mid",!0);Y(ie,xe,je,"≪","\\ll",!0);Y(ie,xe,je,"≫","\\gg",!0);Y(ie,xe,je,"≍","\\asymp",!0);Y(ie,xe,je,"∥","\\parallel");Y(ie,xe,je,"⋈","\\bowtie",!0);Y(ie,xe,je,"⌣","\\smile",!0);Y(ie,xe,je,"⊑","\\sqsubseteq",!0);Y(ie,xe,je,"⊒","\\sqsupseteq",!0);Y(ie,xe,je,"≐","\\doteq",!0);Y(ie,xe,je,"⌢","\\frown",!0);Y(ie,xe,je,"∋","\\ni",!0);Y(ie,xe,je,"∝","\\propto",!0);Y(ie,xe,je,"⊢","\\vdash",!0);Y(ie,xe,je,"⊣","\\dashv",!0);Y(ie,xe,je,"∋","\\owns");Y(ie,xe,dN,".","\\ldotp");Y(ie,xe,dN,"⋅","\\cdotp");Y(ie,xe,Qe,"#","\\#");Y($t,xe,Qe,"#","\\#");Y(ie,xe,Qe,"&","\\&");Y($t,xe,Qe,"&","\\&");Y(ie,xe,Qe,"ℵ","\\aleph",!0);Y(ie,xe,Qe,"∀","\\forall",!0);Y(ie,xe,Qe,"ℏ","\\hbar",!0);Y(ie,xe,Qe,"∃","\\exists",!0);Y(ie,xe,Qe,"∇","\\nabla",!0);Y(ie,xe,Qe,"♭","\\flat",!0);Y(ie,xe,Qe,"ℓ","\\ell",!0);Y(ie,xe,Qe,"♮","\\natural",!0);Y(ie,xe,Qe,"♣","\\clubsuit",!0);Y(ie,xe,Qe,"℘","\\wp",!0);Y(ie,xe,Qe,"♯","\\sharp",!0);Y(ie,xe,Qe,"♢","\\diamondsuit",!0);Y(ie,xe,Qe,"ℜ","\\Re",!0);Y(ie,xe,Qe,"♡","\\heartsuit",!0);Y(ie,xe,Qe,"ℑ","\\Im",!0);Y(ie,xe,Qe,"♠","\\spadesuit",!0);Y(ie,xe,Qe,"§","\\S",!0);Y($t,xe,Qe,"§","\\S");Y(ie,xe,Qe,"¶","\\P",!0);Y($t,xe,Qe,"¶","\\P");Y(ie,xe,Qe,"†","\\dag");Y($t,xe,Qe,"†","\\dag");Y($t,xe,Qe,"†","\\textdagger");Y(ie,xe,Qe,"‡","\\ddag");Y($t,xe,Qe,"‡","\\ddag");Y($t,xe,Qe,"‡","\\textdaggerdbl");Y(ie,xe,Cl,"⎱","\\rmoustache",!0);Y(ie,xe,Lc,"⎰","\\lmoustache",!0);Y(ie,xe,Cl,"⟯","\\rgroup",!0);Y(ie,xe,Lc,"⟮","\\lgroup",!0);Y(ie,xe,sr,"∓","\\mp",!0);Y(ie,xe,sr,"⊖","\\ominus",!0);Y(ie,xe,sr,"⊎","\\uplus",!0);Y(ie,xe,sr,"⊓","\\sqcap",!0);Y(ie,xe,sr,"∗","\\ast");Y(ie,xe,sr,"⊔","\\sqcup",!0);Y(ie,xe,sr,"◯","\\bigcirc",!0);Y(ie,xe,sr,"∙","\\bullet",!0);Y(ie,xe,sr,"‡","\\ddagger");Y(ie,xe,sr,"≀","\\wr",!0);Y(ie,xe,sr,"⨿","\\amalg");Y(ie,xe,sr,"&","\\And");Y(ie,xe,je,"⟵","\\longleftarrow",!0);Y(ie,xe,je,"⇐","\\Leftarrow",!0);Y(ie,xe,je,"⟸","\\Longleftarrow",!0);Y(ie,xe,je,"⟶","\\longrightarrow",!0);Y(ie,xe,je,"⇒","\\Rightarrow",!0);Y(ie,xe,je,"⟹","\\Longrightarrow",!0);Y(ie,xe,je,"↔","\\leftrightarrow",!0);Y(ie,xe,je,"⟷","\\longleftrightarrow",!0);Y(ie,xe,je,"⇔","\\Leftrightarrow",!0);Y(ie,xe,je,"⟺","\\Longleftrightarrow",!0);Y(ie,xe,je,"↦","\\mapsto",!0);Y(ie,xe,je,"⟼","\\longmapsto",!0);Y(ie,xe,je,"↗","\\nearrow",!0);Y(ie,xe,je,"↩","\\hookleftarrow",!0);Y(ie,xe,je,"↪","\\hookrightarrow",!0);Y(ie,xe,je,"↘","\\searrow",!0);Y(ie,xe,je,"↼","\\leftharpoonup",!0);Y(ie,xe,je,"⇀","\\rightharpoonup",!0);Y(ie,xe,je,"↙","\\swarrow",!0);Y(ie,xe,je,"↽","\\leftharpoondown",!0);Y(ie,xe,je,"⇁","\\rightharpoondown",!0);Y(ie,xe,je,"↖","\\nwarrow",!0);Y(ie,xe,je,"⇌","\\rightleftharpoons",!0);Y(ie,qe,je,"≮","\\nless",!0);Y(ie,qe,je,"","\\@nleqslant");Y(ie,qe,je,"","\\@nleqq");Y(ie,qe,je,"⪇","\\lneq",!0);Y(ie,qe,je,"≨","\\lneqq",!0);Y(ie,qe,je,"","\\@lvertneqq");Y(ie,qe,je,"⋦","\\lnsim",!0);Y(ie,qe,je,"⪉","\\lnapprox",!0);Y(ie,qe,je,"⊀","\\nprec",!0);Y(ie,qe,je,"⋠","\\npreceq",!0);Y(ie,qe,je,"⋨","\\precnsim",!0);Y(ie,qe,je,"⪹","\\precnapprox",!0);Y(ie,qe,je,"≁","\\nsim",!0);Y(ie,qe,je,"","\\@nshortmid");Y(ie,qe,je,"∤","\\nmid",!0);Y(ie,qe,je,"⊬","\\nvdash",!0);Y(ie,qe,je,"⊭","\\nvDash",!0);Y(ie,qe,je,"⋪","\\ntriangleleft");Y(ie,qe,je,"⋬","\\ntrianglelefteq",!0);Y(ie,qe,je,"⊊","\\subsetneq",!0);Y(ie,qe,je,"","\\@varsubsetneq");Y(ie,qe,je,"⫋","\\subsetneqq",!0);Y(ie,qe,je,"","\\@varsubsetneqq");Y(ie,qe,je,"≯","\\ngtr",!0);Y(ie,qe,je,"","\\@ngeqslant");Y(ie,qe,je,"","\\@ngeqq");Y(ie,qe,je,"⪈","\\gneq",!0);Y(ie,qe,je,"≩","\\gneqq",!0);Y(ie,qe,je,"","\\@gvertneqq");Y(ie,qe,je,"⋧","\\gnsim",!0);Y(ie,qe,je,"⪊","\\gnapprox",!0);Y(ie,qe,je,"⊁","\\nsucc",!0);Y(ie,qe,je,"⋡","\\nsucceq",!0);Y(ie,qe,je,"⋩","\\succnsim",!0);Y(ie,qe,je,"⪺","\\succnapprox",!0);Y(ie,qe,je,"≆","\\ncong",!0);Y(ie,qe,je,"","\\@nshortparallel");Y(ie,qe,je,"∦","\\nparallel",!0);Y(ie,qe,je,"⊯","\\nVDash",!0);Y(ie,qe,je,"⋫","\\ntriangleright");Y(ie,qe,je,"⋭","\\ntrianglerighteq",!0);Y(ie,qe,je,"","\\@nsupseteqq");Y(ie,qe,je,"⊋","\\supsetneq",!0);Y(ie,qe,je,"","\\@varsupsetneq");Y(ie,qe,je,"⫌","\\supsetneqq",!0);Y(ie,qe,je,"","\\@varsupsetneqq");Y(ie,qe,je,"⊮","\\nVdash",!0);Y(ie,qe,je,"⪵","\\precneqq",!0);Y(ie,qe,je,"⪶","\\succneqq",!0);Y(ie,qe,je,"","\\@nsubseteqq");Y(ie,qe,sr,"⊴","\\unlhd");Y(ie,qe,sr,"⊵","\\unrhd");Y(ie,qe,je,"↚","\\nleftarrow",!0);Y(ie,qe,je,"↛","\\nrightarrow",!0);Y(ie,qe,je,"⇍","\\nLeftarrow",!0);Y(ie,qe,je,"⇏","\\nRightarrow",!0);Y(ie,qe,je,"↮","\\nleftrightarrow",!0);Y(ie,qe,je,"⇎","\\nLeftrightarrow",!0);Y(ie,qe,je,"△","\\vartriangle");Y(ie,qe,Qe,"ℏ","\\hslash");Y(ie,qe,Qe,"▽","\\triangledown");Y(ie,qe,Qe,"◊","\\lozenge");Y(ie,qe,Qe,"Ⓢ","\\circledS");Y(ie,qe,Qe,"®","\\circledR");Y($t,qe,Qe,"®","\\circledR");Y(ie,qe,Qe,"∡","\\measuredangle",!0);Y(ie,qe,Qe,"∄","\\nexists");Y(ie,qe,Qe,"℧","\\mho");Y(ie,qe,Qe,"Ⅎ","\\Finv",!0);Y(ie,qe,Qe,"⅁","\\Game",!0);Y(ie,qe,Qe,"‵","\\backprime");Y(ie,qe,Qe,"▲","\\blacktriangle");Y(ie,qe,Qe,"▼","\\blacktriangledown");Y(ie,qe,Qe,"■","\\blacksquare");Y(ie,qe,Qe,"⧫","\\blacklozenge");Y(ie,qe,Qe,"★","\\bigstar");Y(ie,qe,Qe,"∢","\\sphericalangle",!0);Y(ie,qe,Qe,"∁","\\complement",!0);Y(ie,qe,Qe,"ð","\\eth",!0);Y($t,xe,Qe,"ð","ð");Y(ie,qe,Qe,"╱","\\diagup");Y(ie,qe,Qe,"╲","\\diagdown");Y(ie,qe,Qe,"□","\\square");Y(ie,qe,Qe,"□","\\Box");Y(ie,qe,Qe,"◊","\\Diamond");Y(ie,qe,Qe,"¥","\\yen",!0);Y($t,qe,Qe,"¥","\\yen",!0);Y(ie,qe,Qe,"✓","\\checkmark",!0);Y($t,qe,Qe,"✓","\\checkmark");Y(ie,qe,Qe,"ℶ","\\beth",!0);Y(ie,qe,Qe,"ℸ","\\daleth",!0);Y(ie,qe,Qe,"ℷ","\\gimel",!0);Y(ie,qe,Qe,"ϝ","\\digamma",!0);Y(ie,qe,Qe,"ϰ","\\varkappa");Y(ie,qe,Lc,"┌","\\@ulcorner",!0);Y(ie,qe,Cl,"┐","\\@urcorner",!0);Y(ie,qe,Lc,"└","\\@llcorner",!0);Y(ie,qe,Cl,"┘","\\@lrcorner",!0);Y(ie,qe,je,"≦","\\leqq",!0);Y(ie,qe,je,"⩽","\\leqslant",!0);Y(ie,qe,je,"⪕","\\eqslantless",!0);Y(ie,qe,je,"≲","\\lesssim",!0);Y(ie,qe,je,"⪅","\\lessapprox",!0);Y(ie,qe,je,"≊","\\approxeq",!0);Y(ie,qe,sr,"⋖","\\lessdot");Y(ie,qe,je,"⋘","\\lll",!0);Y(ie,qe,je,"≶","\\lessgtr",!0);Y(ie,qe,je,"⋚","\\lesseqgtr",!0);Y(ie,qe,je,"⪋","\\lesseqqgtr",!0);Y(ie,qe,je,"≑","\\doteqdot");Y(ie,qe,je,"≓","\\risingdotseq",!0);Y(ie,qe,je,"≒","\\fallingdotseq",!0);Y(ie,qe,je,"∽","\\backsim",!0);Y(ie,qe,je,"⋍","\\backsimeq",!0);Y(ie,qe,je,"⫅","\\subseteqq",!0);Y(ie,qe,je,"⋐","\\Subset",!0);Y(ie,qe,je,"⊏","\\sqsubset",!0);Y(ie,qe,je,"≼","\\preccurlyeq",!0);Y(ie,qe,je,"⋞","\\curlyeqprec",!0);Y(ie,qe,je,"≾","\\precsim",!0);Y(ie,qe,je,"⪷","\\precapprox",!0);Y(ie,qe,je,"⊲","\\vartriangleleft");Y(ie,qe,je,"⊴","\\trianglelefteq");Y(ie,qe,je,"⊨","\\vDash",!0);Y(ie,qe,je,"⊪","\\Vvdash",!0);Y(ie,qe,je,"⌣","\\smallsmile");Y(ie,qe,je,"⌢","\\smallfrown");Y(ie,qe,je,"≏","\\bumpeq",!0);Y(ie,qe,je,"≎","\\Bumpeq",!0);Y(ie,qe,je,"≧","\\geqq",!0);Y(ie,qe,je,"⩾","\\geqslant",!0);Y(ie,qe,je,"⪖","\\eqslantgtr",!0);Y(ie,qe,je,"≳","\\gtrsim",!0);Y(ie,qe,je,"⪆","\\gtrapprox",!0);Y(ie,qe,sr,"⋗","\\gtrdot");Y(ie,qe,je,"⋙","\\ggg",!0);Y(ie,qe,je,"≷","\\gtrless",!0);Y(ie,qe,je,"⋛","\\gtreqless",!0);Y(ie,qe,je,"⪌","\\gtreqqless",!0);Y(ie,qe,je,"≖","\\eqcirc",!0);Y(ie,qe,je,"≗","\\circeq",!0);Y(ie,qe,je,"≜","\\triangleq",!0);Y(ie,qe,je,"∼","\\thicksim");Y(ie,qe,je,"≈","\\thickapprox");Y(ie,qe,je,"⫆","\\supseteqq",!0);Y(ie,qe,je,"⋑","\\Supset",!0);Y(ie,qe,je,"⊐","\\sqsupset",!0);Y(ie,qe,je,"≽","\\succcurlyeq",!0);Y(ie,qe,je,"⋟","\\curlyeqsucc",!0);Y(ie,qe,je,"≿","\\succsim",!0);Y(ie,qe,je,"⪸","\\succapprox",!0);Y(ie,qe,je,"⊳","\\vartriangleright");Y(ie,qe,je,"⊵","\\trianglerighteq");Y(ie,qe,je,"⊩","\\Vdash",!0);Y(ie,qe,je,"∣","\\shortmid");Y(ie,qe,je,"∥","\\shortparallel");Y(ie,qe,je,"≬","\\between",!0);Y(ie,qe,je,"⋔","\\pitchfork",!0);Y(ie,qe,je,"∝","\\varpropto");Y(ie,qe,je,"◀","\\blacktriangleleft");Y(ie,qe,je,"∴","\\therefore",!0);Y(ie,qe,je,"∍","\\backepsilon");Y(ie,qe,je,"▶","\\blacktriangleright");Y(ie,qe,je,"∵","\\because",!0);Y(ie,qe,je,"⋘","\\llless");Y(ie,qe,je,"⋙","\\gggtr");Y(ie,qe,sr,"⊲","\\lhd");Y(ie,qe,sr,"⊳","\\rhd");Y(ie,qe,je,"≂","\\eqsim",!0);Y(ie,xe,je,"⋈","\\Join");Y(ie,qe,je,"≑","\\Doteq",!0);Y(ie,qe,sr,"∔","\\dotplus",!0);Y(ie,qe,sr,"∖","\\smallsetminus");Y(ie,qe,sr,"⋒","\\Cap",!0);Y(ie,qe,sr,"⋓","\\Cup",!0);Y(ie,qe,sr,"⩞","\\doublebarwedge",!0);Y(ie,qe,sr,"⊟","\\boxminus",!0);Y(ie,qe,sr,"⊞","\\boxplus",!0);Y(ie,qe,sr,"⋇","\\divideontimes",!0);Y(ie,qe,sr,"⋉","\\ltimes",!0);Y(ie,qe,sr,"⋊","\\rtimes",!0);Y(ie,qe,sr,"⋋","\\leftthreetimes",!0);Y(ie,qe,sr,"⋌","\\rightthreetimes",!0);Y(ie,qe,sr,"⋏","\\curlywedge",!0);Y(ie,qe,sr,"⋎","\\curlyvee",!0);Y(ie,qe,sr,"⊝","\\circleddash",!0);Y(ie,qe,sr,"⊛","\\circledast",!0);Y(ie,qe,sr,"⋅","\\centerdot");Y(ie,qe,sr,"⊺","\\intercal",!0);Y(ie,qe,sr,"⋒","\\doublecap");Y(ie,qe,sr,"⋓","\\doublecup");Y(ie,qe,sr,"⊠","\\boxtimes",!0);Y(ie,qe,je,"⇢","\\dashrightarrow",!0);Y(ie,qe,je,"⇠","\\dashleftarrow",!0);Y(ie,qe,je,"⇇","\\leftleftarrows",!0);Y(ie,qe,je,"⇆","\\leftrightarrows",!0);Y(ie,qe,je,"⇚","\\Lleftarrow",!0);Y(ie,qe,je,"↞","\\twoheadleftarrow",!0);Y(ie,qe,je,"↢","\\leftarrowtail",!0);Y(ie,qe,je,"↫","\\looparrowleft",!0);Y(ie,qe,je,"⇋","\\leftrightharpoons",!0);Y(ie,qe,je,"↶","\\curvearrowleft",!0);Y(ie,qe,je,"↺","\\circlearrowleft",!0);Y(ie,qe,je,"↰","\\Lsh",!0);Y(ie,qe,je,"⇈","\\upuparrows",!0);Y(ie,qe,je,"↿","\\upharpoonleft",!0);Y(ie,qe,je,"⇃","\\downharpoonleft",!0);Y(ie,xe,je,"⊶","\\origof",!0);Y(ie,xe,je,"⊷","\\imageof",!0);Y(ie,qe,je,"⊸","\\multimap",!0);Y(ie,qe,je,"↭","\\leftrightsquigarrow",!0);Y(ie,qe,je,"⇉","\\rightrightarrows",!0);Y(ie,qe,je,"⇄","\\rightleftarrows",!0);Y(ie,qe,je,"↠","\\twoheadrightarrow",!0);Y(ie,qe,je,"↣","\\rightarrowtail",!0);Y(ie,qe,je,"↬","\\looparrowright",!0);Y(ie,qe,je,"↷","\\curvearrowright",!0);Y(ie,qe,je,"↻","\\circlearrowright",!0);Y(ie,qe,je,"↱","\\Rsh",!0);Y(ie,qe,je,"⇊","\\downdownarrows",!0);Y(ie,qe,je,"↾","\\upharpoonright",!0);Y(ie,qe,je,"⇂","\\downharpoonright",!0);Y(ie,qe,je,"⇝","\\rightsquigarrow",!0);Y(ie,qe,je,"⇝","\\leadsto");Y(ie,qe,je,"⇛","\\Rrightarrow",!0);Y(ie,qe,je,"↾","\\restriction");Y(ie,xe,Qe,"‘","`");Y(ie,xe,Qe,"$","\\$");Y($t,xe,Qe,"$","\\$");Y($t,xe,Qe,"$","\\textdollar");Y(ie,xe,Qe,"%","\\%");Y($t,xe,Qe,"%","\\%");Y(ie,xe,Qe,"_","\\_");Y($t,xe,Qe,"_","\\_");Y($t,xe,Qe,"_","\\textunderscore");Y(ie,xe,Qe,"∠","\\angle",!0);Y(ie,xe,Qe,"∞","\\infty",!0);Y(ie,xe,Qe,"′","\\prime");Y(ie,xe,Qe,"△","\\triangle");Y(ie,xe,Qe,"Γ","\\Gamma",!0);Y(ie,xe,Qe,"Δ","\\Delta",!0);Y(ie,xe,Qe,"Θ","\\Theta",!0);Y(ie,xe,Qe,"Λ","\\Lambda",!0);Y(ie,xe,Qe,"Ξ","\\Xi",!0);Y(ie,xe,Qe,"Π","\\Pi",!0);Y(ie,xe,Qe,"Σ","\\Sigma",!0);Y(ie,xe,Qe,"Υ","\\Upsilon",!0);Y(ie,xe,Qe,"Φ","\\Phi",!0);Y(ie,xe,Qe,"Ψ","\\Psi",!0);Y(ie,xe,Qe,"Ω","\\Omega",!0);Y(ie,xe,Qe,"A","Α");Y(ie,xe,Qe,"B","Β");Y(ie,xe,Qe,"E","Ε");Y(ie,xe,Qe,"Z","Ζ");Y(ie,xe,Qe,"H","Η");Y(ie,xe,Qe,"I","Ι");Y(ie,xe,Qe,"K","Κ");Y(ie,xe,Qe,"M","Μ");Y(ie,xe,Qe,"N","Ν");Y(ie,xe,Qe,"O","Ο");Y(ie,xe,Qe,"P","Ρ");Y(ie,xe,Qe,"T","Τ");Y(ie,xe,Qe,"X","Χ");Y(ie,xe,Qe,"¬","\\neg",!0);Y(ie,xe,Qe,"¬","\\lnot");Y(ie,xe,Qe,"⊤","\\top");Y(ie,xe,Qe,"⊥","\\bot");Y(ie,xe,Qe,"∅","\\emptyset");Y(ie,qe,Qe,"∅","\\varnothing");Y(ie,xe,Nr,"α","\\alpha",!0);Y(ie,xe,Nr,"β","\\beta",!0);Y(ie,xe,Nr,"γ","\\gamma",!0);Y(ie,xe,Nr,"δ","\\delta",!0);Y(ie,xe,Nr,"ϵ","\\epsilon",!0);Y(ie,xe,Nr,"ζ","\\zeta",!0);Y(ie,xe,Nr,"η","\\eta",!0);Y(ie,xe,Nr,"θ","\\theta",!0);Y(ie,xe,Nr,"ι","\\iota",!0);Y(ie,xe,Nr,"κ","\\kappa",!0);Y(ie,xe,Nr,"λ","\\lambda",!0);Y(ie,xe,Nr,"μ","\\mu",!0);Y(ie,xe,Nr,"ν","\\nu",!0);Y(ie,xe,Nr,"ξ","\\xi",!0);Y(ie,xe,Nr,"ο","\\omicron",!0);Y(ie,xe,Nr,"π","\\pi",!0);Y(ie,xe,Nr,"ρ","\\rho",!0);Y(ie,xe,Nr,"σ","\\sigma",!0);Y(ie,xe,Nr,"τ","\\tau",!0);Y(ie,xe,Nr,"υ","\\upsilon",!0);Y(ie,xe,Nr,"ϕ","\\phi",!0);Y(ie,xe,Nr,"χ","\\chi",!0);Y(ie,xe,Nr,"ψ","\\psi",!0);Y(ie,xe,Nr,"ω","\\omega",!0);Y(ie,xe,Nr,"ε","\\varepsilon",!0);Y(ie,xe,Nr,"ϑ","\\vartheta",!0);Y(ie,xe,Nr,"ϖ","\\varpi",!0);Y(ie,xe,Nr,"ϱ","\\varrho",!0);Y(ie,xe,Nr,"ς","\\varsigma",!0);Y(ie,xe,Nr,"φ","\\varphi",!0);Y(ie,xe,sr,"∗","*",!0);Y(ie,xe,sr,"+","+");Y(ie,xe,sr,"−","-",!0);Y(ie,xe,sr,"⋅","\\cdot",!0);Y(ie,xe,sr,"∘","\\circ",!0);Y(ie,xe,sr,"÷","\\div",!0);Y(ie,xe,sr,"±","\\pm",!0);Y(ie,xe,sr,"×","\\times",!0);Y(ie,xe,sr,"∩","\\cap",!0);Y(ie,xe,sr,"∪","\\cup",!0);Y(ie,xe,sr,"∖","\\setminus",!0);Y(ie,xe,sr,"∧","\\land");Y(ie,xe,sr,"∨","\\lor");Y(ie,xe,sr,"∧","\\wedge",!0);Y(ie,xe,sr,"∨","\\vee",!0);Y(ie,xe,Qe,"√","\\surd");Y(ie,xe,Lc,"⟨","\\langle",!0);Y(ie,xe,Lc,"∣","\\lvert");Y(ie,xe,Lc,"∥","\\lVert");Y(ie,xe,Cl,"?","?");Y(ie,xe,Cl,"!","!");Y(ie,xe,Cl,"⟩","\\rangle",!0);Y(ie,xe,Cl,"∣","\\rvert");Y(ie,xe,Cl,"∥","\\rVert");Y(ie,xe,je,"=","=");Y(ie,xe,je,":",":");Y(ie,xe,je,"≈","\\approx",!0);Y(ie,xe,je,"≅","\\cong",!0);Y(ie,xe,je,"≥","\\ge");Y(ie,xe,je,"≥","\\geq",!0);Y(ie,xe,je,"←","\\gets");Y(ie,xe,je,">","\\gt",!0);Y(ie,xe,je,"∈","\\in",!0);Y(ie,xe,je,"","\\@not");Y(ie,xe,je,"⊂","\\subset",!0);Y(ie,xe,je,"⊃","\\supset",!0);Y(ie,xe,je,"⊆","\\subseteq",!0);Y(ie,xe,je,"⊇","\\supseteq",!0);Y(ie,qe,je,"⊈","\\nsubseteq",!0);Y(ie,qe,je,"⊉","\\nsupseteq",!0);Y(ie,xe,je,"⊨","\\models");Y(ie,xe,je,"←","\\leftarrow",!0);Y(ie,xe,je,"≤","\\le");Y(ie,xe,je,"≤","\\leq",!0);Y(ie,xe,je,"<","\\lt",!0);Y(ie,xe,je,"→","\\rightarrow",!0);Y(ie,xe,je,"→","\\to");Y(ie,qe,je,"≱","\\ngeq",!0);Y(ie,qe,je,"≰","\\nleq",!0);Y(ie,xe,d0," ","\\ ");Y(ie,xe,d0," ","\\space");Y(ie,xe,d0," ","\\nobreakspace");Y($t,xe,d0," ","\\ ");Y($t,xe,d0," "," ");Y($t,xe,d0," ","\\space");Y($t,xe,d0," ","\\nobreakspace");Y(ie,xe,d0,null,"\\nobreak");Y(ie,xe,d0,null,"\\allowbreak");Y(ie,xe,dN,",",",");Y(ie,xe,dN,";",";");Y(ie,qe,sr,"⊼","\\barwedge",!0);Y(ie,qe,sr,"⊻","\\veebar",!0);Y(ie,xe,sr,"⊙","\\odot",!0);Y(ie,xe,sr,"⊕","\\oplus",!0);Y(ie,xe,sr,"⊗","\\otimes",!0);Y(ie,xe,Qe,"∂","\\partial",!0);Y(ie,xe,sr,"⊘","\\oslash",!0);Y(ie,qe,sr,"⊚","\\circledcirc",!0);Y(ie,qe,sr,"⊡","\\boxdot",!0);Y(ie,xe,sr,"△","\\bigtriangleup");Y(ie,xe,sr,"▽","\\bigtriangledown");Y(ie,xe,sr,"†","\\dagger");Y(ie,xe,sr,"⋄","\\diamond");Y(ie,xe,sr,"⋆","\\star");Y(ie,xe,sr,"◃","\\triangleleft");Y(ie,xe,sr,"▹","\\triangleright");Y(ie,xe,Lc,"{","\\{");Y($t,xe,Qe,"{","\\{");Y($t,xe,Qe,"{","\\textbraceleft");Y(ie,xe,Cl,"}","\\}");Y($t,xe,Qe,"}","\\}");Y($t,xe,Qe,"}","\\textbraceright");Y(ie,xe,Lc,"{","\\lbrace");Y(ie,xe,Cl,"}","\\rbrace");Y(ie,xe,Lc,"[","\\lbrack",!0);Y($t,xe,Qe,"[","\\lbrack",!0);Y(ie,xe,Cl,"]","\\rbrack",!0);Y($t,xe,Qe,"]","\\rbrack",!0);Y(ie,xe,Lc,"(","\\lparen",!0);Y(ie,xe,Cl,")","\\rparen",!0);Y($t,xe,Qe,"<","\\textless",!0);Y($t,xe,Qe,">","\\textgreater",!0);Y(ie,xe,Lc,"⌊","\\lfloor",!0);Y(ie,xe,Cl,"⌋","\\rfloor",!0);Y(ie,xe,Lc,"⌈","\\lceil",!0);Y(ie,xe,Cl,"⌉","\\rceil",!0);Y(ie,xe,Qe,"\\","\\backslash");Y(ie,xe,Qe,"∣","|");Y(ie,xe,Qe,"∣","\\vert");Y($t,xe,Qe,"|","\\textbar",!0);Y(ie,xe,Qe,"∥","\\|");Y(ie,xe,Qe,"∥","\\Vert");Y($t,xe,Qe,"∥","\\textbardbl");Y($t,xe,Qe,"~","\\textasciitilde");Y($t,xe,Qe,"\\","\\textbackslash");Y($t,xe,Qe,"^","\\textasciicircum");Y(ie,xe,je,"↑","\\uparrow",!0);Y(ie,xe,je,"⇑","\\Uparrow",!0);Y(ie,xe,je,"↓","\\downarrow",!0);Y(ie,xe,je,"⇓","\\Downarrow",!0);Y(ie,xe,je,"↕","\\updownarrow",!0);Y(ie,xe,je,"⇕","\\Updownarrow",!0);Y(ie,xe,rs,"∐","\\coprod");Y(ie,xe,rs,"⋁","\\bigvee");Y(ie,xe,rs,"⋀","\\bigwedge");Y(ie,xe,rs,"⨄","\\biguplus");Y(ie,xe,rs,"⋂","\\bigcap");Y(ie,xe,rs,"⋃","\\bigcup");Y(ie,xe,rs,"∫","\\int");Y(ie,xe,rs,"∫","\\intop");Y(ie,xe,rs,"∬","\\iint");Y(ie,xe,rs,"∭","\\iiint");Y(ie,xe,rs,"∏","\\prod");Y(ie,xe,rs,"∑","\\sum");Y(ie,xe,rs,"⨂","\\bigotimes");Y(ie,xe,rs,"⨁","\\bigoplus");Y(ie,xe,rs,"⨀","\\bigodot");Y(ie,xe,rs,"∮","\\oint");Y(ie,xe,rs,"∯","\\oiint");Y(ie,xe,rs,"∰","\\oiiint");Y(ie,xe,rs,"⨆","\\bigsqcup");Y(ie,xe,rs,"∫","\\smallint");Y($t,xe,P3,"…","\\textellipsis");Y(ie,xe,P3,"…","\\mathellipsis");Y($t,xe,P3,"…","\\ldots",!0);Y(ie,xe,P3,"…","\\ldots",!0);Y(ie,xe,P3,"⋯","\\@cdots",!0);Y(ie,xe,P3,"⋱","\\ddots",!0);Y(ie,xe,Qe,"⋮","\\varvdots");Y($t,xe,Qe,"⋮","\\varvdots");Y(ie,xe,ra,"ˊ","\\acute");Y(ie,xe,ra,"ˋ","\\grave");Y(ie,xe,ra,"¨","\\ddot");Y(ie,xe,ra,"~","\\tilde");Y(ie,xe,ra,"ˉ","\\bar");Y(ie,xe,ra,"˘","\\breve");Y(ie,xe,ra,"ˇ","\\check");Y(ie,xe,ra,"^","\\hat");Y(ie,xe,ra,"⃗","\\vec");Y(ie,xe,ra,"˙","\\dot");Y(ie,xe,ra,"˚","\\mathring");Y(ie,xe,Nr,"","\\@imath");Y(ie,xe,Nr,"","\\@jmath");Y(ie,xe,Qe,"ı","ı");Y(ie,xe,Qe,"ȷ","ȷ");Y($t,xe,Qe,"ı","\\i",!0);Y($t,xe,Qe,"ȷ","\\j",!0);Y($t,xe,Qe,"ß","\\ss",!0);Y($t,xe,Qe,"æ","\\ae",!0);Y($t,xe,Qe,"œ","\\oe",!0);Y($t,xe,Qe,"ø","\\o",!0);Y($t,xe,Qe,"Æ","\\AE",!0);Y($t,xe,Qe,"Œ","\\OE",!0);Y($t,xe,Qe,"Ø","\\O",!0);Y($t,xe,ra,"ˊ","\\'");Y($t,xe,ra,"ˋ","\\`");Y($t,xe,ra,"ˆ","\\^");Y($t,xe,ra,"˜","\\~");Y($t,xe,ra,"ˉ","\\=");Y($t,xe,ra,"˘","\\u");Y($t,xe,ra,"˙","\\.");Y($t,xe,ra,"¸","\\c");Y($t,xe,ra,"˚","\\r");Y($t,xe,ra,"ˇ","\\v");Y($t,xe,ra,"¨",'\\"');Y($t,xe,ra,"˝","\\H");Y($t,xe,ra,"◯","\\textcircled");var eAe={"--":!0,"---":!0,"``":!0,"''":!0};Y($t,xe,Qe,"–","--",!0);Y($t,xe,Qe,"–","\\textendash");Y($t,xe,Qe,"—","---",!0);Y($t,xe,Qe,"—","\\textemdash");Y($t,xe,Qe,"‘","`",!0);Y($t,xe,Qe,"‘","\\textquoteleft");Y($t,xe,Qe,"’","'",!0);Y($t,xe,Qe,"’","\\textquoteright");Y($t,xe,Qe,"“","``",!0);Y($t,xe,Qe,"“","\\textquotedblleft");Y($t,xe,Qe,"”","''",!0);Y($t,xe,Qe,"”","\\textquotedblright");Y(ie,xe,Qe,"°","\\degree",!0);Y($t,xe,Qe,"°","\\degree");Y($t,xe,Qe,"°","\\textdegree",!0);Y(ie,xe,Qe,"£","\\pounds");Y(ie,xe,Qe,"£","\\mathsterling",!0);Y($t,xe,Qe,"£","\\pounds");Y($t,xe,Qe,"£","\\textsterling",!0);Y(ie,qe,Qe,"✠","\\maltese");Y($t,qe,Qe,"✠","\\maltese");var rhe='0123456789/@."';for(var CB=0;CB0)return Ru(a,u,i,r,s.concat(h));if(l){var d,f;if(l==="boldsymbol"){var p=tRt(a,i,r,s,n);d=p.fontName,f=[p.fontClass]}else o?(d=nAe[l].fontName,f=[l]):(d=_A(l,r.fontWeight,r.fontShape),f=[l,r.fontWeight,r.fontShape]);if(fN(a,d,i).metrics)return Ru(a,d,i,r,s.concat(f));if(eAe.hasOwnProperty(a)&&d.slice(0,10)==="Typewriter"){for(var g=[],m=0;m{if(Yp(t.classes)!==Yp(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},iRt=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},Dl=function(e,r,n,i){var a=new _E(e,r,n,i);return _Q(a),a},tAe=(t,e,r,n)=>new _E(t,e,r,n),aRt=function(e,r,n){var i=Dl([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},sRt=function(e,r,n,i){var a=new RQ(e,r,n,i);return _Q(a),a},rAe=function(e){var r=new RE(e);return _Q(r),r},oRt=function(e,r){return e instanceof RE?Dl([],[e],r):e},lRt=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=Dl(["mspace"],[],e),n=oa(t,e);return r.style.marginRight=Xt(n),r},_A=function(e,r,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var a;return r==="textbf"&&n==="textit"?a="BoldItalic":r==="textbf"?a="Bold":r==="textit"?a="Italic":a="Regular",i+"-"+a},nAe={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"}},iAe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},hRt=function(e,r){var[n,i,a]=iAe[e],s=new jp(n),o=new Gf([s],{width:Xt(i),height:Xt(a),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=tAe(["overlay"],[o],r);return l.height=a,l.style.height=Xt(a),l.style.width=Xt(i),l},it={fontMap:nAe,makeSymbol:Ru,mathsym:eRt,makeSpan:Dl,makeSvgSpan:tAe,makeLineSpan:aRt,makeAnchor:sRt,makeFragment:rAe,wrapFragment:oRt,makeVList:cRt,makeOrd:rRt,makeGlue:uRt,staticSvg:hRt,svgData:iAe,tryCombineChars:iRt},aa={number:3,unit:"mu"},Yg={number:4,unit:"mu"},Gd={number:5,unit:"mu"},dRt={mord:{mop:aa,mbin:Yg,mrel:Gd,minner:aa},mop:{mord:aa,mop:aa,mrel:Gd,minner:aa},mbin:{mord:Yg,mop:Yg,mopen:Yg,minner:Yg},mrel:{mord:Gd,mop:Gd,mopen:Gd,minner:Gd},mopen:{},mclose:{mop:aa,mbin:Yg,mrel:Gd,minner:aa},mpunct:{mord:aa,mop:aa,mrel:Gd,mopen:aa,mclose:aa,mpunct:aa,minner:aa},minner:{mord:aa,mop:aa,mbin:Yg,mrel:Gd,mopen:aa,mpunct:aa,minner:aa}},fRt={mord:{mop:aa},mop:{mord:aa,mop:aa},mbin:{},mrel:{},mopen:{},mclose:{mop:aa},mpunct:{},minner:{mop:aa}},aAe={},sL={},oL={};function tr(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"&&Lr.contains(gRt,v)?m.classes[0]="mord":v==="mbin"&&Lr.contains(pRt,y)&&(g.classes[0]="mord")},{node:d},f,p),ohe(a,(g,m)=>{var y=Iq(m),v=Iq(g),x=y&&v?g.hasClass("mtight")?fRt[y][v]:dRt[y][v]:null;if(x)return it.makeGlue(x,u)},{node:d},f,p),a},ohe=function t(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()},sAe=function(e){return e instanceof RE||e instanceof RQ||e instanceof _E&&e.hasClass("enclosing")?e:null},vRt=function t(e,r){var n=sAe(e);if(n){var i=n.children;if(i.length){if(r==="right")return t(i[i.length-1],"right");if(r==="left")return t(i[0],"left")}}return e},Iq=function(e,r){return e?(r&&(e=vRt(e,r)),yRt[e.classes[0]]||null):null},i6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Uf(r.concat(n))},Hn=function(e,r,n){if(!e)return Uf();if(sL[e.type]){var i=sL[e.type](e,r);if(n&&r.size!==n.size){i=Uf(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function MA(t,e){var r=Uf(["base"],t,e),n=Uf(["strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function $q(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=ys(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(MA(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(MA(s,e));var u;r?(u=MA(ys(r,e,!0)),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Uf(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Xt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Xt(-h.depth))}return h}function oAe(t){return new RE(t)}let gc=class{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=Yp(this.classes));for(var n=0;n0&&(e+=' class ="'+Lr.escape(Yp(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}},qh=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Lr.escape(this.toText())}toText(){return this.text}},bRt=class{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",Xt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}};var zt={MathNode:gc,TextNode:qh,SpaceNode:bRt,newDocumentFragment:oAe},hu=function(e,r,n){return Ii[r][e]&&Ii[r][e].replace&&e.charCodeAt(0)!==55349&&!(eAe.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Ii[r][e].replace),new zt.TextNode(e)},MQ=function(e){return e.length===1?e[0]:new zt.MathNode("mrow",e)},LQ=function(e,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var n=r.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var a=e.text;if(Lr.contains(["\\imath","\\jmath"],a))return null;Ii[i][a]&&Ii[i][a].replace&&(a=Ii[i][a].replace);var s=it.fontMap[n].fontName;return AQ(a,s,i)?it.fontMap[n].variant:null};function RB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof qh&&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 qh&&r.text===","}else return!1}var rc=function(e,r,n){if(e.length===1){var i=vi(e[0],r);return n&&i instanceof gc&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||RB(s))){var u=l.children[0];u instanceof gc&&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 qh&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof qh&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Xp=function(e,r,n){return MQ(rc(e,r,n))},vi=function(e,r){if(!e)return new zt.MathNode("mrow");if(oL[e.type]){var n=oL[e.type](e,r);return n}else throw new Gt("Got group of unknown type: '"+e.type+"'")};function lhe(t,e,r,n,i){var a=rc(t,r),s;a.length===1&&a[0]instanceof gc&&Lr.contains(["mrow","mtable"],a[0].type)?s=a[0]:s=new zt.MathNode("mrow",a);var o=new zt.MathNode("annotation",[new zt.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new zt.MathNode("semantics",[s,o]),u=new zt.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return it.makeSpan([h],[u])}var lAe=function(e){return new X7e({style:e.displayMode?Or.DISPLAY:Or.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},cAe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=it.makeSpan(n,[e])}return e},xRt=function(e,r,n){var i=lAe(n),a;if(n.output==="mathml")return lhe(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=$q(e,i);a=it.makeSpan(["katex"],[s])}else{var o=lhe(e,r,i,n.displayMode,!1),l=$q(e,i);a=it.makeSpan(["katex"],[o,l])}return cAe(a,n)},wRt=function(e,r,n){var i=lAe(n),a=$q(e,i),s=it.makeSpan(["katex"],[a]);return cAe(s,n)},TRt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",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":"="},kRt=function(e){var r=new zt.MathNode("mo",[new zt.TextNode(TRt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},CRt={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],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]},SRt=function(e){return e.type==="ordgroup"?e.body.length:1},ERt=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Lr.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=e,h=SRt(u.base),d,f,p;if(h>5)l==="widehat"||l==="widecheck"?(d=420,o=2364,p=.42,f=l+"4"):(d=312,o=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=l+g):(o=[0,600,1033,2339,2340][g],d=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],f="tilde"+g)}var m=new jp(f),y=new Gf([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+o+" "+d,preserveAspectRatio:"none"});return{span:it.makeSvgSpan([],[y],r),minWidth:0,height:p}}else{var v=[],x=CRt[l],[b,T,k]=x,S=k/1e3,C=b.length,E,A;if(C===1){var M=x[3];E=["hide-tail"],A=[M]}else if(C===2)E=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(C===3)E=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+C+" children.");for(var L=0;L0&&(i.style.minWidth=Xt(a)),i},ARt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=it.makeSpan(["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 Mq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new Mq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Gf(u,{width:"100%",height:Xt(o)});s=it.makeSvgSpan([],[h],a)}return s.height=o,s.style.height=Xt(o),s},Yf={encloseSpan:ARt,mathMLnode:kRt,svgSpan:ERt};function pn(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 IQ(t){var e=pN(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 pN(t){return t&&(t.type==="atom"||Q8t.hasOwnProperty(t.type))?t:null}var $Q=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=pn(t.base,"accent"),r=n.base,t.base=r,i=K8t(Hn(t,e)),t.base=n):(n=pn(t,"accent"),r=n.base);var a=Hn(r,e.havingCrampedStyle()),s=n.isShifty&&Lr.isCharacterBox(r),o=0;if(s){var l=Lr.getBaseElem(r),u=Hn(l,e.havingCrampedStyle());o=the(u).skew}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=Yf.svgSpan(n,e),f=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=it.staticSvg("vec",e),g=it.svgData.vec[1]):(p=it.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=the(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=it.makeSpan(["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=Xt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var v=it.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},uAe=(t,e)=>{var r=t.isStretchy?Yf.mathMLnode(t.label):new zt.MathNode("mo",[hu(t.label,t.mode)]),n=new zt.MathNode("mover",[vi(t.base,e),r]);return n.setAttribute("accent","true"),n},RRt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));tr({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=lL(e[0]),n=!RRt.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:$Q,mathmlBuilder:uAe});tr({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:$Q,mathmlBuilder:uAe});tr({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=Hn(t.base,e),n=Yf.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,a=it.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return it.makeSpan(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=Yf.mathMLnode(t.label),n=new zt.MathNode("munder",[vi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var LA=t=>{var e=new zt.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};tr({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=it.wrapFragment(Hn(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=it.wrapFragment(Hn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=Yf.svgSpan(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=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l},{type:"elem",elem:s,shift:d}]},e)}else h=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l}]},e);return h.children[0].children[0].children[1].classes.push("svg-align"),it.makeSpan(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=Yf.mathMLnode(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=LA(vi(t.body,e));if(t.below){var a=LA(vi(t.below,e));n=new zt.MathNode("munderover",[r,a,i])}else n=new zt.MathNode("mover",[r,i])}else if(t.below){var s=LA(vi(t.below,e));n=new zt.MathNode("munder",[r,s])}else n=LA(),n=new zt.MathNode("mover",[r,n]);return n}});var _Rt=it.makeSpan;function hAe(t,e){var r=ys(t.body,e,!0);return _Rt([t.mclass],r,e)}function dAe(t,e){var r,n=rc(t.body,e);return t.mclass==="minner"?r=new zt.MathNode("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new zt.MathNode("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new zt.MathNode("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}tr({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:Fa(i),isCharacterBox:Lr.isCharacterBox(i)}},htmlBuilder:hAe,mathmlBuilder:dAe});var gN=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"};tr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:gN(e[0]),body:Fa(e[1]),isCharacterBox:Lr.isCharacterBox(e[1])}}});tr({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=gN(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Fa(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:Lr.isCharacterBox(l)}},htmlBuilder:hAe,mathmlBuilder:dAe});tr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:gN(e[0]),body:Fa(e[0])}},htmlBuilder(t,e){var r=ys(t.body,e,!0),n=it.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=rc(t.body,e),n=new zt.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var MRt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},che=()=>({type:"styling",body:[],mode:"math",style:"display"}),uhe=t=>t.type==="textord"&&t.text==="@",LRt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function IRt(t,e,r){var n=MRt[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 $Rt(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 Gt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=IRt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display"};n.push(m),o=che()}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([])}}tr({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=it.wrapFragment(Hn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Xt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new zt.MathNode("mrow",[vi(t.label,e)]);return r=new zt.MathNode("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new zt.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});tr({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=it.wrapFragment(Hn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new zt.MathNode("mrow",[vi(t.fragment,e)])}});tr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=pn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Gt("\\@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 fAe=(t,e)=>{var r=ys(t.body,e.withColor(t.color),!1);return it.makeFragment(r)},pAe=(t,e)=>{var r=rc(t.body,e.withColor(t.color)),n=new zt.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n};tr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=pn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Fa(i)}},htmlBuilder:fAe,mathmlBuilder:pAe});tr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=pn(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:fAe,mathmlBuilder:pAe});tr({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&&pn(i,"size").value}},htmlBuilder(t,e){var r=it.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Xt(oa(t.size,e)))),r},mathmlBuilder(t,e){var r=new zt.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(oa(t.size,e)))),r}});var Nq={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},gAe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},NRt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},mAe=(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)};tr({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(Nq[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Nq[n.text]),pn(e.parseFunction(),"internal");throw new Gt("Invalid token after macro prefix",n)}});tr({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 Gt("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 Gt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Gt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Gt("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===Nq[r]),{type:"internal",mode:e.mode}}});tr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=gAe(e.gullet.popToken());e.gullet.consumeSpaces();var i=NRt(e);return mAe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});tr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=gAe(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return mAe(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var $5=function(e,r,n){var i=Ii.math[e]&&Ii.math[e].replace,a=AQ(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},NQ=function(e,r,n,i){var a=n.havingBaseStyle(r),s=it.makeSpan(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},yAe=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=Xt(a),e.height-=a,e.depth+=a},DRt=function(e,r,n,i,a,s){var o=it.makeSymbol(e,"Main-Regular",a,i),l=NQ(o,r,i,s);return n&&yAe(l,i,r),l},ORt=function(e,r,n,i){return it.makeSymbol(e,"Size"+r+"-Regular",n,i)},vAe=function(e,r,n,i,a,s){var o=ORt(e,r,a,i),l=NQ(it.makeSpan(["delimsizing","size"+r],[o],i),Or.TEXT,i,s);return n&&yAe(l,i,Or.TEXT),l},_B=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=it.makeSpan(["delimsizinginner",i],[it.makeSpan([],[it.makeSymbol(e,r,n)])]);return{type:"elem",elem:a}},MB=function(e,r,n){var i=Wh["Size4-Regular"][e.charCodeAt(0)]?Wh["Size4-Regular"][e.charCodeAt(0)][4]:Wh["Size1-Regular"][e.charCodeAt(0)][4],a=new jp("inner",H8t(e,Math.round(1e3*r))),s=new Gf([a],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=it.makeSvgSpan([],[s],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},Dq=.008,IA={type:"kern",size:-1*Dq},PRt=["|","\\lvert","\\rvert","\\vert"],BRt=["\\|","\\lVert","\\rVert","\\Vert"],bAe=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"):Lr.contains(PRt,e)?(u="∣",d="vert",f=333):Lr.contains(BRt,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=$5(o,p,a),m=g.height+g.depth,y=$5(u,p,a),v=y.height+y.depth,x=$5(h,p,a),b=x.height+x.depth,T=0,k=1;if(l!==null){var S=$5(l,p,a);T=S.height+S.depth,k=2}var C=m+b+T,E=Math.max(0,Math.ceil((r-C)/(k*v))),A=C+E*k*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=A/2-M,P=[];if(d.length>0){var N=A-m-b,_=Math.round(A*1e3),I=V8t(d,Math.round(N*1e3)),O=new jp(d,I),D=(f/1e3).toFixed(3)+"em",$=(_/1e3).toFixed(3)+"em",F=new Gf([O],{width:D,height:$,viewBox:"0 0 "+f+" "+_}),z=it.makeSvgSpan([],[F],i);z.height=_/1e3,z.style.width=D,z.style.height=$,P.push({type:"elem",elem:z})}else{if(P.push(_B(h,p,a)),P.push(IA),l===null){var H=A-m-b+2*Dq;P.push(MB(u,H,i))}else{var B=(A-m-b-T)/2+2*Dq;P.push(MB(u,B,i)),P.push(IA),P.push(_B(l,p,a)),P.push(IA),P.push(MB(u,B,i))}P.push(IA),P.push(_B(o,p,a))}var V=i.havingBaseStyle(Or.TEXT),q=it.makeVList({positionType:"bottom",positionData:L,children:P},V);return NQ(it.makeSpan(["delimsizing","mult"],[q],V),Or.TEXT,i,s)},LB=80,IB=.08,$B=function(e,r,n,i,a){var s=z8t(e,i,n),o=new jp(e,s),l=new Gf([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return it.makeSvgSpan(["hide-tail"],[l],a)},FRt=function(e,r){var n=r.havingBaseSizing(),i=kAe("\\surd",e*n.sizeMultiplier,TAe,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l=0,u=0,h=0,d;return i.type==="small"?(h=1e3+1e3*s+LB,e<1?a=1:e<1.4&&(a=.7),l=(1+s+IB)/a,u=(1+s)/a,o=$B("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+LB)*BC[i.size],u=(BC[i.size]+s)/a,l=(BC[i.size]+s+IB)/a,o=$B("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+IB,u=e+s,h=Math.floor(1e3*e+s)+LB,o=$B("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Xt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},xAe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],zRt=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],wAe=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],BC=[0,1.2,1.8,2.4,3],HRt=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Lr.contains(xAe,e)||Lr.contains(wAe,e))return vAe(e,r,!1,n,i,a);if(Lr.contains(zRt,e))return bAe(e,BC[r],!1,n,i,a);throw new Gt("Illegal delimiter: '"+e+"'")},VRt=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],WRt=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"stack"}],TAe=[{type:"small",style:Or.SCRIPTSCRIPT},{type:"small",style:Or.SCRIPT},{type:"small",style:Or.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],qRt=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";throw new Error("Add support for delim type '"+e.type+"' here.")},kAe=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;sr)return n[s]}return n[n.length-1]},CAe=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Lr.contains(wAe,e)?o=VRt:Lr.contains(xAe,e)?o=TAe:o=WRt;var l=kAe(e,r,o,i);return l.type==="small"?DRt(e,l.style,n,i,a,s):l.type==="large"?vAe(e,l.size,n,i,a,s):bAe(e,r,n,i,a,s)},GRt=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 CAe(e,d,!0,i,a,s)},Nf={sqrtImage:FRt,sizedDelim:HRt,sizeToMaxHeight:BC,customSizedDelim:CAe,leftRightDelim:GRt},hhe={"\\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}},URt=["(","\\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 mN(t,e){var r=pN(t);if(r&&Lr.contains(URt,r.text))return r;throw r?new Gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Gt("Invalid delimiter type '"+t.type+"'",t)}tr({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=mN(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:hhe[t.funcName].size,mclass:hhe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?it.makeSpan([t.mclass]):Nf.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(hu(t.delim,t.mode));var r=new zt.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Xt(Nf.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function dhe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}tr({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 Gt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:mN(e[0],t).text,color:r}}});tr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=mN(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=pn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{dhe(t);for(var r=ys(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{dhe(t);var r=rc(t.body,e);if(t.left!=="."){var n=new zt.MathNode("mo",[hu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new zt.MathNode("mo",[hu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return MQ(r)}});tr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=mN(e[0],t);if(!t.parser.leftrightDepth)throw new Gt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;if(t.delim===".")r=i6(e,[]);else{r=Nf.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?hu("|","text"):hu(t.delim,t.mode),n=new zt.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var DQ=(t,e)=>{var r=it.wrapFragment(Hn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s=0,o=Lr.isCharacterBox(t.body);if(n==="sout")a=it.makeSpan(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=oa({number:.6,unit:"pt"},e),u=oa({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Xt(d/2+l);var f=Math.floor(1e3*d*i),p=B8t(f),g=new Gf([new jp("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=it.makeSvgSpan(["hide-tail"],[g],e),a.style.height=Xt(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=0,y=0,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=Yf.encloseSpan(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Xt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Xt(v),a.style.borderRightWidth=Xt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]},e);else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]},e)}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?it.makeSpan(["mord","cancel-lap"],[x],e):it.makeSpan(["mord"],[x],e)},OQ=(t,e)=>{var r=0,n=new zt.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[vi(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: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};tr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=pn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:DQ,mathmlBuilder:OQ});tr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=pn(e[0],"color-token").color,s=pn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:DQ,mathmlBuilder:OQ});tr({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]}}});tr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\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:DQ,mathmlBuilder:OQ});tr({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 SAe={};function vd(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 Gt("{"+t.envName+"} can be used only in display mode.")};function PQ(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function xg(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 Gt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new Jh("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(fhe(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},r&&(k={type:"styling",mode:t.mode,style:r,body:[k]}),g.push(k);var S=t.fetch().text;if(S==="&"){if(d&&g.length===d){if(u||o)throw new Gt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){T(),g.length===1&&k.type==="styling"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length0&&(b+=.25),u.push({pos:b,isDashed:ue[ce]})}for(T(s[0]),n=0;n0&&(L+=x,Cue))for(n=0;n=o)){var j=void 0;(i>0||e.hskipBeforeAndAfter)&&(j=Lr.deflt(B.pregap,f),j!==0&&(I=it.makeSpan(["arraycolsep"],[]),I.style.width=Xt(j),_.push(I)));var ae=[];for(n=0;n0){for(var ee=it.makeLineSpan("hline",r,h),me=it.makeLineSpan("hdashline",r,h),te=[{type:"elem",elem:l,shift:0}];u.length>0;){var $e=u.pop(),Oe=$e.pos-P;$e.isDashed?te.push({type:"elem",elem:me,shift:Oe}):te.push({type:"elem",elem:ee,shift:Oe})}l=it.makeVList({positionType:"individualShift",children:te},r)}if(D.length===0)return it.makeSpan(["mord"],[l],r);var He=it.makeVList({positionType:"individualShift",children:D},r);return He=it.makeSpan(["tag"],[He],r),it.makeFragment([l,He])},YRt={c:"center ",l:"left ",r:"right "},xd=function(e,r){for(var n=[],i=new zt.MathNode("mtd",[],["mtr-glue"]),a=new zt.MathNode("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A-1?"alignat":"align",a=e.envName==="split",s=xg(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:PQ(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o,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};vd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=pN(e[0]),n=r?[e[0]]:pn(e[0],"ordgroup").body,i=n.map(function(s){var o=IQ(s),l=o.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Gt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return xg(t.parser,a,BQ(t.envName))},htmlBuilder:bd,mathmlBuilder:xd});vd({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".indexOf(r)===-1)throw new Gt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=xg(t.parser,n,BQ(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:bd,mathmlBuilder:xd});vd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=xg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=pN(e[0]),n=r?[e[0]]:pn(e[0],"ordgroup").body,i=n.map(function(s){var o=IQ(s),l=o.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new Gt("Unknown column alignment: "+l,s)});if(i.length>1)throw new Gt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=xg(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new Gt("{subarray} can contain only one column");return a},htmlBuilder:bd,mathmlBuilder:xd});vd({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=xg(t.parser,e,BQ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:AAe,htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Lr.contains(["gather","gather*"],t.envName)&&yN(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:PQ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return xg(t.parser,e,"display")},htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:AAe,htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){yN(t);var e={autoTag:PQ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return xg(t.parser,e,"display")},htmlBuilder:bd,mathmlBuilder:xd});vd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return yN(t),$Rt(t.parser)},htmlBuilder:bd,mathmlBuilder:xd});Se("\\nonumber","\\gdef\\@eqnsw{0}");Se("\\notag","\\nonumber");tr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Gt(t.funcName+" valid only within array environment")}});var phe=SAe;tr({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 Gt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Hn(t.body,n)},_Ae=(t,e)=>{var r=t.font,n=e.withFont(r);return vi(t.body,n)},ghe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};tr({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=lL(e[0]),a=n;return a in ghe&&(a=ghe[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:RAe,mathmlBuilder:_Ae});tr({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0],i=Lr.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:gN(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});tr({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),o="math"+n.slice(1);return{type:"font",mode:a,font:o,body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:RAe,mathmlBuilder:_Ae});var MAe=(t,e)=>{var r=e;return t==="display"?r=r.id>=Or.SCRIPT.id?r.text():Or.DISPLAY:t==="text"&&r.size===Or.DISPLAY.size?r=Or.TEXT:t==="script"?r=Or.SCRIPT:t==="scriptscript"&&(r=Or.SCRIPTSCRIPT),r},FQ=(t,e)=>{var r=MAe(t.size,e.style),n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Hn(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 x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new zt.MathNode("mfrac",[vi(t.numer,e),vi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=oa(t.barSize,e);r.setAttribute("linethickness",Xt(n))}var i=MAe(t.size,e.style);if(i.size!==e.style.size){r=new zt.MathNode("mstyle",[r]);var a=i.size===Or.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var s=[];if(t.leftDelim!=null){var o=new zt.MathNode("mo",[new zt.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(r),t.rightDelim!=null){var l=new zt.MathNode("mo",[new zt.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return MQ(s)}return r};tr({type:"genfrac",names:["\\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,u="auto";switch(n){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")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:s,leftDelim:o,rightDelim:l,size:u,barSize:null}},htmlBuilder:FQ,mathmlBuilder:zQ});tr({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});tr({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 mhe=["display","text","script","scriptscript"],yhe=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};tr({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=lL(e[0]),s=a.type==="atom"&&a.family==="open"?yhe(a.text):null,o=lL(e[1]),l=o.type==="atom"&&o.family==="close"?yhe(o.text):null,u=pn(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=pn(p.body[0],"textord");f=mhe[Number(g.text)]}}else p=pn(p,"textord"),f=mhe[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l,size:f}},htmlBuilder:FQ,mathmlBuilder:zQ});tr({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:pn(e[0],"size").value,token:i}}});tr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=k8t(pn(e[1],"infix").size),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,size:"auto"}},htmlBuilder:FQ,mathmlBuilder:zQ});var LAe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Hn(t.sup,e.havingStyle(r.sup()),e):Hn(t.sub,e.havingStyle(r.sub()),e),i=pn(t.base,"horizBrace")):i=pn(t,"horizBrace");var a=Hn(i.base,e.havingBaseStyle(Or.DISPLAY)),s=Yf.svgSpan(i,e),o;if(i.isOver?(o=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=it.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=it.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e);i.isOver?o=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):o=it.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return it.makeSpan(["mord",i.isOver?"mover":"munder"],[o],e)},jRt=(t,e)=>{var r=Yf.mathMLnode(t.label);return new zt.MathNode(t.isOver?"mover":"munder",[vi(t.base,e),r])};tr({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:LAe,mathmlBuilder:jRt});tr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=pn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Fa(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=ys(t.body,e,!1);return it.makeAnchor(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Xp(t.body,e);return r instanceof gc||(r=new gc("mrow",[r])),r.setAttribute("href",t.href),r}});tr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=pn(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=pn(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=ys(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=it.makeSpan(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)=>Xp(t.body,e)});tr({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Fa(e[0]),mathml:Fa(e[1])}},htmlBuilder:(t,e)=>{var r=ys(t.html,e,!1);return it.makeFragment(r)},mathmlBuilder:(t,e)=>Xp(t.mathml,e)});var NB=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 Gt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!K7e(n))throw new Gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};tr({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=pn(r[0],"raw").string,u=l.split(","),h=0;h{var r=oa(t.height,e),n=0;t.totalheight.number>0&&(n=oa(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=oa(t.width,e));var a={height:Xt(r+n)};i>0&&(a.width=Xt(i)),n>0&&(a.verticalAlign=Xt(-n));var s=new j8t(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new zt.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=oa(t.height,e),i=0;if(t.totalheight.number>0&&(i=oa(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var a=oa(t.width,e);r.setAttribute("width",Xt(a))}return r.setAttribute("src",t.src),r}});tr({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=pn(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 it.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var r=oa(t.dimension,e);return new zt.SpaceNode(r)}});tr({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=it.makeSpan([],[Hn(t.body,e)]),r=it.makeSpan(["inner"],[r],e)):r=it.makeSpan(["inner"],[Hn(t.body,e)]);var n=it.makeSpan(["fix"],[]),i=it.makeSpan([t.alignment],[r,n],e),a=it.makeSpan(["strut"]);return a.style.height=Xt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Xt(-i.depth)),i.children.unshift(a),i=it.makeSpan(["thinbox"],[i],e),it.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new zt.MathNode("mpadded",[vi(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}});tr({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",body:s}}});tr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Gt("Mismatched "+t.funcName)}});var vhe=(t,e)=>{switch(e.style.size){case Or.DISPLAY.size:return t.display;case Or.TEXT.size:return t.text;case Or.SCRIPT.size:return t.script;case Or.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};tr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Fa(e[0]),text:Fa(e[1]),script:Fa(e[2]),scriptscript:Fa(e[3])}},htmlBuilder:(t,e)=>{var r=vhe(t,e),n=ys(r,e,!1);return it.makeFragment(n)},mathmlBuilder:(t,e)=>{var r=vhe(t,e);return Xp(r,e)}});var IAe=(t,e,r,n,i,a,s)=>{t=it.makeSpan([],[t]);var o=r&&Lr.isCharacterBox(r),l,u;if(e){var h=Hn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Hn(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=it.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var g=t.height-s;f=it.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},n)}else if(u){var m=t.depth+s;f=it.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return t;var y=[f];if(l&&a!==0&&!o){var v=it.makeSpan(["mspace"],[],n);v.style.marginRight=Xt(a),y.unshift(v)}return it.makeSpan(["mop","op-limits"],y,n)},$Ae=["\\smallint"],B3=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=pn(t.base,"op"),i=!0):a=pn(t,"op");var s=e.style,o=!1;s.size===Or.DISPLAY.size&&a.symbol&&!Lr.contains($Ae,a.name)&&(o=!0);var l;if(a.symbol){var u=o?"Size2-Regular":"Size1-Regular",h="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(h=a.name.slice(1),a.name=h==="oiint"?"\\iint":"\\iiint"),l=it.makeSymbol(a.name,u,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),h.length>0){var d=l.italic,f=it.staticSvg(h+"Size"+(o?"2":"1"),e);l=it.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]},e),a.name="\\"+h,l.classes.unshift("mop"),l.italic=d}}else if(a.body){var p=ys(a.body,e,!0);p.length===1&&p[0]instanceof uu?(l=p[0],l.classes[0]="mop"):l=it.makeSpan(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new gc("mo",[hu(t.name,t.mode)]),Lr.contains($Ae,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new gc("mo",rc(t.body,e));else{r=new gc("mi",[new qh(t.name.slice(1))]);var n=new gc("mo",[hu("⁡","text")]);t.parentIsSupSub?r=new gc("mrow",[r,n]):r=oAe([r,n])}return r},XRt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};tr({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=XRt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:B3,mathmlBuilder:ME});tr({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:Fa(n)}},htmlBuilder:B3,mathmlBuilder:ME});var KRt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};tr({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:B3,mathmlBuilder:ME});tr({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:B3,mathmlBuilder:ME});tr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=KRt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:B3,mathmlBuilder:ME});var NAe=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=pn(t.base,"operatorname"),i=!0):a=pn(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=ys(o,e.withFont("mathrm"),!0),u=0;u{for(var r=rc(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new zt.TextNode(o)]}var l=new zt.MathNode("mi",r);l.setAttribute("mathvariant","normal");var u=new zt.MathNode("mo",[hu("⁡","text")]);return t.parentIsSupSub?new zt.MathNode("mrow",[l,u]):zt.newDocumentFragment([l,u])};tr({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:Fa(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:NAe,mathmlBuilder:ZRt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Dy({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?it.makeFragment(ys(t.body,e,!1)):it.makeSpan(["mord"],ys(t.body,e,!0),e)},mathmlBuilder(t,e){return Xp(t.body,e,!0)}});tr({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=Hn(t.body,e.havingCrampedStyle()),n=it.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return it.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[new zt.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zt.MathNode("mover",[vi(t.body,e),r]);return n.setAttribute("accent","true"),n}});tr({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:Fa(n)}},htmlBuilder:(t,e)=>{var r=ys(t.body,e.withPhantom(),!1);return it.makeFragment(r)},mathmlBuilder:(t,e)=>{var r=rc(t.body,e);return new zt.MathNode("mphantom",r)}});tr({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=it.makeSpan([],[Hn(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n{var r=rc(Fa(t.body),e),n=new zt.MathNode("mphantom",r),i=new zt.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});tr({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=it.makeSpan(["inner"],[Hn(t.body,e.withPhantom())]),n=it.makeSpan(["fix"],[]);return it.makeSpan(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=rc(Fa(t.body),e),n=new zt.MathNode("mphantom",r),i=new zt.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});tr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=pn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Hn(t.body,e),n=oa(t.dy,e);return it.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new zt.MathNode("mpadded",[vi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});tr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});tr({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=pn(e[0],"size"),s=pn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&pn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=it.makeSpan(["mord","rule"],[],e),n=oa(t.width,e),i=oa(t.height,e),a=t.shift?oa(t.shift,e):0;return r.style.borderRightWidth=Xt(n),r.style.borderTopWidth=Xt(i),r.style.bottom=Xt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=oa(t.width,e),n=oa(t.height,e),i=t.shift?oa(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new zt.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Xt(r)),s.setAttribute("height",Xt(n));var o=new zt.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",Xt(i)):(o.setAttribute("height",Xt(i)),o.setAttribute("depth",Xt(-i))),o.setAttribute("voffset",Xt(i)),o}});function DAe(t,e,r){for(var n=ys(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return DAe(t.body,r,e)};tr({type:"sizing",names:bhe,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:bhe.indexOf(n)+1,body:a}},htmlBuilder:QRt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=rc(t.body,r),i=new zt.MathNode("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});tr({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]&&pn(r[0],"ordgroup");if(s)for(var o="",l=0;l{var r=it.makeSpan([],[Hn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n{var r=new zt.MathNode("mpadded",[vi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});tr({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=Hn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=it.wrapFragment(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=Xt(h);var p=it.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(Or.SCRIPTSCRIPT),m=Hn(t.index,g,e),y=.6*(p.height-p.depth),v=it.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]},e),x=it.makeSpan(["root"],[v]);return it.makeSpan(["mord","sqrt"],[x,p],e)}else return it.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new zt.MathNode("mroot",[vi(r,e),vi(n,e)]):new zt.MathNode("msqrt",[vi(r,e)])}});var xhe={display:Or.DISPLAY,text:Or.TEXT,script:Or.SCRIPT,scriptscript:Or.SCRIPTSCRIPT};tr({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);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=xhe[t.style],n=e.havingStyle(r).withFont("");return DAe(t.body,n,e)},mathmlBuilder(t,e){var r=xhe[t.style],n=e.havingStyle(r),i=rc(t.body,n),a=new zt.MathNode("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 JRt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Or.DISPLAY.size||n.alwaysHandleSupSub);return i?B3:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Or.DISPLAY.size||n.limits);return a?NAe:null}else{if(n.type==="accent")return Lr.isCharacterBox(n.base)?$Q:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?LAe:null}else return null}else return null};Dy({type:"supsub",htmlBuilder(t,e){var r=JRt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Hn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Lr.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());o=Hn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Hn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Or.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Xt(.5/u.ptPerEm/y),x=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(s instanceof uu||b)&&(x=Xt(-s.italic))}var T;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var k=u.defaultRuleThickness,S=4*k;if(h-o.depth-(l.height-d)0&&(h+=C,d-=C)}var E=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];T=it.makeVList({positionType:"individualShift",children:E},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];T=it.makeVList({positionType:"shift",positionData:d,children:A},e)}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=it.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]},e);else throw new Error("supsub must have either sup or sub.");var M=Iq(s,"right")||"mord";return it.makeSpan([M],[s,it.makeSpan(["msupsub"],[T])],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=[vi(t.base,e)];t.sub&&a.push(vi(t.sub,e)),t.sup&&a.push(vi(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===Or.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Or.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Or.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Or.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Or.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Or.DISPLAY)?s="mover":s="msup"}return new zt.MathNode(s,a)}});Dy({type:"atom",htmlBuilder(t,e){return it.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[hu(t.text,t.mode)]);if(t.family==="bin"){var n=LQ(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 OAe={mi:"italic",mn:"normal",mtext:"normal"};Dy({type:"mathord",htmlBuilder(t,e){return it.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var r=new zt.MathNode("mi",[hu(t.text,t.mode,e)]),n=LQ(t,e)||"italic";return n!==OAe[r.type]&&r.setAttribute("mathvariant",n),r}});Dy({type:"textord",htmlBuilder(t,e){return it.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var r=hu(t.text,t.mode,e),n=LQ(t,e)||"normal",i;return t.mode==="text"?i=new zt.MathNode("mtext",[r]):/[0-9]/.test(t.text)?i=new zt.MathNode("mn",[r]):t.text==="\\prime"?i=new zt.MathNode("mo",[r]):i=new zt.MathNode("mi",[r]),n!==OAe[i.type]&&i.setAttribute("mathvariant",n),i}});var DB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},OB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Dy({type:"spacing",htmlBuilder(t,e){if(OB.hasOwnProperty(t.text)){var r=OB[t.text].className||"";if(t.mode==="text"){var n=it.makeOrd(t,e,"textord");return n.classes.push(r),n}else return it.makeSpan(["mspace",r],[it.mathsym(t.text,t.mode,e)],e)}else{if(DB.hasOwnProperty(t.text))return it.makeSpan(["mspace",DB[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(OB.hasOwnProperty(t.text))r=new zt.MathNode("mtext",[new zt.TextNode(" ")]);else{if(DB.hasOwnProperty(t.text))return new zt.MathNode("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var whe=()=>{var t=new zt.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Dy({type:"tag",mathmlBuilder(t,e){var r=new zt.MathNode("mtable",[new zt.MathNode("mtr",[whe(),new zt.MathNode("mtd",[Xp(t.body,e)]),whe(),new zt.MathNode("mtd",[Xp(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var The={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},khe={"\\textbf":"textbf","\\textmd":"textmd"},e_t={"\\textit":"textit","\\textup":"textup"},Che=(t,e)=>{var r=t.font;if(r){if(The[r])return e.withTextFontFamily(The[r]);if(khe[r])return e.withTextFontWeight(khe[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(e_t[r])};tr({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:Fa(i),font:n}},htmlBuilder(t,e){var r=Che(t,e),n=ys(t.body,r,!0);return it.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Che(t,e);return Xp(t.body,r)}});tr({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=Hn(t.body,e),n=it.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=it.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return it.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new zt.MathNode("mo",[new zt.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new zt.MathNode("munder",[vi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});tr({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=Hn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return it.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){return new zt.MathNode("mpadded",[vi(t.body,e)],["vcenter"])}});tr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Gt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=She(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),yp=aAe,PAe=`[ \r + ]`,t_t="\\\\[a-zA-Z@]+",r_t="\\\\[^\uD800-\uDFFF]",n_t="("+t_t+")"+PAe+"*",i_t=`\\\\( |[ \r ]+ -?)[ \r ]*`,$q="[̀-ͯ]",i_t=new RegExp($q+"+$"),a_t="("+DAe+"+)|"+(n_t+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+($q+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+($q+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+r_t)+("|"+t_t+")");let She=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(a_t,"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 Qh("EOF",new Au(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Gt("Unexpected character: '"+e[r]+"'",new Qh(e[r],new Au(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 Qh(i,new Au(this,r,this.tokenRegex.lastIndex))}},s_t=class{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 Gt("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 o_t=CAe;Se("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@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}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Ehe={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};Se("\\char",function(t){var e=t.popToken(),r,n="";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 Gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Ehe[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Ehe[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Gt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Gt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Gt("\\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 Gt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};Se("\\newcommand",t=>FQ(t,!1,!0,!1));Se("\\renewcommand",t=>FQ(t,!0,!1,!1));Se("\\providecommand",t=>FQ(t,!0,!0,!0));Se("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Se("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Se("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),yp[r],Ii.math[r],Ii.text[r]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("·","\\cdotp");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Se("∉","\\notin");Se("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Se("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Se("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Se("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Se("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Se("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Se("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Se("⟂","\\perp");Se("‼","\\mathclose{!\\mkern-0.8mu!}");Se("∌","\\notni");Se("⌜","\\ulcorner");Se("⌝","\\urcorner");Se("⌞","\\llcorner");Se("⌟","\\lrcorner");Se("©","\\copyright");Se("®","\\textregistered");Se("️","\\textregistered");Se("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Se("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Se("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Se("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Se("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Se("⋮","\\vdots");Se("\\varGamma","\\mathit{\\Gamma}");Se("\\varDelta","\\mathit{\\Delta}");Se("\\varTheta","\\mathit{\\Theta}");Se("\\varLambda","\\mathit{\\Lambda}");Se("\\varXi","\\mathit{\\Xi}");Se("\\varPi","\\mathit{\\Pi}");Se("\\varSigma","\\mathit{\\Sigma}");Se("\\varUpsilon","\\mathit{\\Upsilon}");Se("\\varPhi","\\mathit{\\Phi}");Se("\\varPsi","\\mathit{\\Psi}");Se("\\varOmega","\\mathit{\\Omega}");Se("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Se("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Se("\\boxed","\\fbox{$\\displaystyle{#1}$}");Se("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Se("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Se("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Se("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Se("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Ahe={",":"\\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"};Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Ahe?e=Ahe[r]:(r.slice(0,4)==="\\not"||r in Ii.math&&Lr.contains(["bin","rel"],Ii.math[r].group))&&(e="\\dotsb"),e});var zQ={")":!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};Se("\\dotso",function(t){var e=t.future().text;return e in zQ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in zQ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in zQ?"\\@cdots\\,":"\\@cdots"});Se("\\dotsb","\\cdots");Se("\\dotsm","\\cdots");Se("\\dotsi","\\!\\cdots");Se("\\dotsx","\\ldots\\,");Se("\\DOTSI","\\relax");Se("\\DOTSB","\\relax");Se("\\DOTSX","\\relax");Se("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Se("\\,","\\tmspace+{3mu}{.1667em}");Se("\\thinspace","\\,");Se("\\>","\\mskip{4mu}");Se("\\:","\\tmspace+{4mu}{.2222em}");Se("\\medspace","\\:");Se("\\;","\\tmspace+{5mu}{.2777em}");Se("\\thickspace","\\;");Se("\\!","\\tmspace-{3mu}{.1667em}");Se("\\negthinspace","\\!");Se("\\negmedspace","\\tmspace-{4mu}{.2222em}");Se("\\negthickspace","\\tmspace-{5mu}{.277em}");Se("\\enspace","\\kern.5em ");Se("\\enskip","\\hskip.5em\\relax");Se("\\quad","\\hskip1em\\relax");Se("\\qquad","\\hskip2em\\relax");Se("\\tag","\\@ifstar\\tag@literal\\tag@paren");Se("\\tag@paren","\\tag@literal{({#1})}");Se("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Se("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Se("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Se("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Se("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Se("\\newline","\\\\\\relax");Se("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var OAe=Xt(Vh["Main-Regular"][84][1]-.7*Vh["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+OAe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+OAe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Se("\\hspace","\\@ifstar\\@hspacer\\@hspace");Se("\\@hspace","\\hskip #1\\relax");Se("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Se("\\ordinarycolon",":");Se("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Se("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Se("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Se("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Se("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Se("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Se("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Se("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Se("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Se("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Se("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Se("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Se("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Se("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Se("∷","\\dblcolon");Se("∹","\\eqcolon");Se("≔","\\coloneqq");Se("≕","\\eqqcolon");Se("⩴","\\Coloneqq");Se("\\ratio","\\vcentcolon");Se("\\coloncolon","\\dblcolon");Se("\\colonequals","\\coloneqq");Se("\\coloncolonequals","\\Coloneqq");Se("\\equalscolon","\\eqqcolon");Se("\\equalscoloncolon","\\Eqqcolon");Se("\\colonminus","\\coloneq");Se("\\coloncolonminus","\\Coloneq");Se("\\minuscolon","\\eqcolon");Se("\\minuscoloncolon","\\Eqcolon");Se("\\coloncolonapprox","\\Colonapprox");Se("\\coloncolonsim","\\Colonsim");Se("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Se("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Se("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Se("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Se("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Se("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Se("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Se("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Se("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Se("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Se("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Se("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Se("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Se("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Se("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Se("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Se("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Se("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Se("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Se("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Se("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Se("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Se("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Se("\\imath","\\html@mathml{\\@imath}{ı}");Se("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Se("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Se("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Se("⟦","\\llbracket");Se("⟧","\\rrbracket");Se("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Se("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Se("⦃","\\lBrace");Se("⦄","\\rBrace");Se("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Se("⦵","\\minuso");Se("\\darr","\\downarrow");Se("\\dArr","\\Downarrow");Se("\\Darr","\\Downarrow");Se("\\lang","\\langle");Se("\\rang","\\rangle");Se("\\uarr","\\uparrow");Se("\\uArr","\\Uparrow");Se("\\Uarr","\\Uparrow");Se("\\N","\\mathbb{N}");Se("\\R","\\mathbb{R}");Se("\\Z","\\mathbb{Z}");Se("\\alef","\\aleph");Se("\\alefsym","\\aleph");Se("\\Alpha","\\mathrm{A}");Se("\\Beta","\\mathrm{B}");Se("\\bull","\\bullet");Se("\\Chi","\\mathrm{X}");Se("\\clubs","\\clubsuit");Se("\\cnums","\\mathbb{C}");Se("\\Complex","\\mathbb{C}");Se("\\Dagger","\\ddagger");Se("\\diamonds","\\diamondsuit");Se("\\empty","\\emptyset");Se("\\Epsilon","\\mathrm{E}");Se("\\Eta","\\mathrm{H}");Se("\\exist","\\exists");Se("\\harr","\\leftrightarrow");Se("\\hArr","\\Leftrightarrow");Se("\\Harr","\\Leftrightarrow");Se("\\hearts","\\heartsuit");Se("\\image","\\Im");Se("\\infin","\\infty");Se("\\Iota","\\mathrm{I}");Se("\\isin","\\in");Se("\\Kappa","\\mathrm{K}");Se("\\larr","\\leftarrow");Se("\\lArr","\\Leftarrow");Se("\\Larr","\\Leftarrow");Se("\\lrarr","\\leftrightarrow");Se("\\lrArr","\\Leftrightarrow");Se("\\Lrarr","\\Leftrightarrow");Se("\\Mu","\\mathrm{M}");Se("\\natnums","\\mathbb{N}");Se("\\Nu","\\mathrm{N}");Se("\\Omicron","\\mathrm{O}");Se("\\plusmn","\\pm");Se("\\rarr","\\rightarrow");Se("\\rArr","\\Rightarrow");Se("\\Rarr","\\Rightarrow");Se("\\real","\\Re");Se("\\reals","\\mathbb{R}");Se("\\Reals","\\mathbb{R}");Se("\\Rho","\\mathrm{P}");Se("\\sdot","\\cdot");Se("\\sect","\\S");Se("\\spades","\\spadesuit");Se("\\sub","\\subset");Se("\\sube","\\subseteq");Se("\\supe","\\supseteq");Se("\\Tau","\\mathrm{T}");Se("\\thetasym","\\vartheta");Se("\\weierp","\\wp");Se("\\Zeta","\\mathrm{Z}");Se("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Se("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Se("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Se("\\bra","\\mathinner{\\langle{#1}|}");Se("\\ket","\\mathinner{|{#1}\\rangle}");Se("\\braket","\\mathinner{\\langle{#1}\\rangle}");Se("\\Bra","\\left\\langle#1\\right|");Se("\\Ket","\\left|#1\\right\\rangle");var PAe=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}};Se("\\bra@ket",PAe(!1));Se("\\bra@set",PAe(!0));Se("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Se("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Se("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Se("\\angln","{\\angl n}");Se("\\blue","\\textcolor{##6495ed}{#1}");Se("\\orange","\\textcolor{##ffa500}{#1}");Se("\\pink","\\textcolor{##ff00af}{#1}");Se("\\red","\\textcolor{##df0030}{#1}");Se("\\green","\\textcolor{##28ae7b}{#1}");Se("\\gray","\\textcolor{gray}{#1}");Se("\\purple","\\textcolor{##9d38bd}{#1}");Se("\\blueA","\\textcolor{##ccfaff}{#1}");Se("\\blueB","\\textcolor{##80f6ff}{#1}");Se("\\blueC","\\textcolor{##63d9ea}{#1}");Se("\\blueD","\\textcolor{##11accd}{#1}");Se("\\blueE","\\textcolor{##0c7f99}{#1}");Se("\\tealA","\\textcolor{##94fff5}{#1}");Se("\\tealB","\\textcolor{##26edd5}{#1}");Se("\\tealC","\\textcolor{##01d1c1}{#1}");Se("\\tealD","\\textcolor{##01a995}{#1}");Se("\\tealE","\\textcolor{##208170}{#1}");Se("\\greenA","\\textcolor{##b6ffb0}{#1}");Se("\\greenB","\\textcolor{##8af281}{#1}");Se("\\greenC","\\textcolor{##74cf70}{#1}");Se("\\greenD","\\textcolor{##1fab54}{#1}");Se("\\greenE","\\textcolor{##0d923f}{#1}");Se("\\goldA","\\textcolor{##ffd0a9}{#1}");Se("\\goldB","\\textcolor{##ffbb71}{#1}");Se("\\goldC","\\textcolor{##ff9c39}{#1}");Se("\\goldD","\\textcolor{##e07d10}{#1}");Se("\\goldE","\\textcolor{##a75a05}{#1}");Se("\\redA","\\textcolor{##fca9a9}{#1}");Se("\\redB","\\textcolor{##ff8482}{#1}");Se("\\redC","\\textcolor{##f9685d}{#1}");Se("\\redD","\\textcolor{##e84d39}{#1}");Se("\\redE","\\textcolor{##bc2612}{#1}");Se("\\maroonA","\\textcolor{##ffbde0}{#1}");Se("\\maroonB","\\textcolor{##ff92c6}{#1}");Se("\\maroonC","\\textcolor{##ed5fa6}{#1}");Se("\\maroonD","\\textcolor{##ca337c}{#1}");Se("\\maroonE","\\textcolor{##9e034e}{#1}");Se("\\purpleA","\\textcolor{##ddd7ff}{#1}");Se("\\purpleB","\\textcolor{##c6b9fc}{#1}");Se("\\purpleC","\\textcolor{##aa87ff}{#1}");Se("\\purpleD","\\textcolor{##7854ab}{#1}");Se("\\purpleE","\\textcolor{##543b78}{#1}");Se("\\mintA","\\textcolor{##f5f9e8}{#1}");Se("\\mintB","\\textcolor{##edf2df}{#1}");Se("\\mintC","\\textcolor{##e0e5cc}{#1}");Se("\\grayA","\\textcolor{##f6f7f7}{#1}");Se("\\grayB","\\textcolor{##f0f1f2}{#1}");Se("\\grayC","\\textcolor{##e3e5e6}{#1}");Se("\\grayD","\\textcolor{##d6d8da}{#1}");Se("\\grayE","\\textcolor{##babec2}{#1}");Se("\\grayF","\\textcolor{##888d93}{#1}");Se("\\grayG","\\textcolor{##626569}{#1}");Se("\\grayH","\\textcolor{##3b3e40}{#1}");Se("\\grayI","\\textcolor{##21242c}{#1}");Se("\\kaBlue","\\textcolor{##314453}{#1}");Se("\\kaGreen","\\textcolor{##71B307}{#1}");var BAe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let l_t=class{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 s_t(o_t,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new She(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 Qh("EOF",n.loc)),this.pushTokens(i),r.range(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 Gt("Extra }",a)}else if(a.text==="EOF")throw new Gt("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 Gt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Gt("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 Gt("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 Gt("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 Gt("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}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Qh(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.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var o=new She(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)||yp.hasOwnProperty(e)||Ii.math.hasOwnProperty(e)||Ii.text.hasOwnProperty(e)||BAe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:yp.hasOwnProperty(e)&&!yp[e].primitive}};var Rhe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,IA=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),DB={"́":{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"}},_he={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let FAe=class zAe{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 l_t(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Gt("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 Qh("}")),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(zAe.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&yp[i.text]&&yp[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=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=Ii[this.mode][r].group,l=Au.range(e),u;if(K8t.hasOwnProperty(o)){var h=o;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else u={type:o,mode:this.mode,loc:l,text:r};s=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(U7e(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:Au.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;dt.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertBlockMath:t=>({commands:e,editor:r})=>{const{latex:n,pos:i}=t;return n?e.insertContentAt(i??r.state.selection.from,{type:this.name,attrs:{latex:n}}):!1},deleteBlockMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.delete(i,i+a.nodeSize),!0)},updateBlockMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...a.attrs,latex:n??a.attrs.latex}),!0)}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",ai(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:"blockMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)===null||e===void 0?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{const e=t.match(/^\$\$([^$]+)\$\$/);if(!e)return;const[r,n]=e;return{type:"blockMath",raw:r,latex:n.trim()}}},addInputRules(){return[new xy({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:t,range:e,match:r})=>{const[,n]=r,{tr:i}=t,a=t.doc.resolve(e.from),s=this.type.create({latex:n}),o=a.depth>0&&a.parent.isTextblock&&e.from===a.start()&&e.to===a.end()&&a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),this.type)?{from:a.before(),to:a.after()}:e;i.replaceWith(o.from,o.to,s)}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("div"),i=document.createElement("div");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),i.className="block-math-inner",n.dataset.type="block-math",n.setAttribute("data-latex",e.attrs.latex),n.appendChild(i);function a(){try{WAe.render(e.attrs.latex,i,t),n.classList.remove("block-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("block-math-error")}}const s=o=>{o.preventDefault(),o.stopPropagation();const l=r();l!=null&&this.options.onClick&&this.options.onClick(e,l)};return this.options.onClick&&n.addEventListener("click",s),a(),{dom:n,destroy(){n.removeEventListener("click",s)}}}}}),GAe=Ra.create({name:"inlineMath",group:"inline",inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertInlineMath:t=>({editor:e,tr:r})=>{var n;const i=t.latex,a=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.from;return i?(r.replaceWith(a,a,this.type.create({latex:i})),!0):!1},deleteInlineMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.delete(i,i+a.nodeSize),!0)},updateInlineMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...a.attrs,latex:n}),!0)}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",ai(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:"inlineMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)===null||e===void 0?void 0:e.latex)||""}$`},markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{const e=t.match(/^\$([^$]+)\$(?!\$)/);if(!e)return;const[r,n]=e;return{type:"inlineMath",raw:r,latex:n.trim()}}},addInputRules(){return[new xy({find:new RegExp("(?{const n=r[2],{tr:i}=t,a=e.from,s=e.to;i.replaceWith(a,s,this.type.create({latex:n}))}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("span");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),n.dataset.type="inline-math",n.setAttribute("data-latex",e.attrs.latex);function i(){try{WAe.render(e.attrs.latex,n,t),n.classList.remove("inline-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("inline-math-error")}}const a=s=>{s.preventDefault(),s.stopPropagation();const o=r();o!=null&&this.options.onClick&&this.options.onClick(e,o)};return this.options.onClick&&n.addEventListener("click",a),i(),{dom:n,destroy(){n.removeEventListener("click",a)}}}}});Ui.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[qAe.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),GAe.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const p_t=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},UAe=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!p_t(t,n))return n;return-1},g_t=GAe.extend({markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=UAe(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` -`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:"inlineMath",raw:r,latex:n}}}}),m_t=qAe.extend({markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=UAe(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:"blockMath",raw:t.slice(0,e+2),latex:r}}}}),Mhe={throwOnError:!1,strict:"warn",trust:!1},y_t=()=>[m_t.configure({katexOptions:Mhe}),g_t.configure({katexOptions:Mhe})],Lhe="\x3C!-- edgeever:merge-divider -->",v_t=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,b_t=Ra.create({name:"edgeeverMergeDivider",group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",ai(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${Lhe} +?)[ \r ]*`,Oq="[̀-ͯ]",a_t=new RegExp(Oq+"+$"),s_t="("+PAe+"+)|"+(i_t+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Oq+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Oq+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+n_t)+("|"+r_t+")");let Ehe=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(s_t,"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 Jh("EOF",new Au(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Gt("Unexpected character: '"+e[r]+"'",new Jh(e[r],new Au(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 Jh(i,new Au(this,r,this.tokenRegex.lastIndex))}},o_t=class{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 Gt("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 l_t=EAe;Se("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Se("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Se("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Se("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Se("\\@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}});Se("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Se("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Ahe={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};Se("\\char",function(t){var e=t.popToken(),r,n="";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 Gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Ahe[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Ahe[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Gt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Gt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Gt("\\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 Gt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};Se("\\newcommand",t=>HQ(t,!1,!0,!1));Se("\\renewcommand",t=>HQ(t,!0,!1,!1));Se("\\providecommand",t=>HQ(t,!0,!0,!0));Se("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Se("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Se("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),yp[r],Ii.math[r],Ii.text[r]),""});Se("\\bgroup","{");Se("\\egroup","}");Se("~","\\nobreakspace");Se("\\lq","`");Se("\\rq","'");Se("\\aa","\\r a");Se("\\AA","\\r A");Se("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Se("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Se("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Se("ℬ","\\mathscr{B}");Se("ℰ","\\mathscr{E}");Se("ℱ","\\mathscr{F}");Se("ℋ","\\mathscr{H}");Se("ℐ","\\mathscr{I}");Se("ℒ","\\mathscr{L}");Se("ℳ","\\mathscr{M}");Se("ℛ","\\mathscr{R}");Se("ℭ","\\mathfrak{C}");Se("ℌ","\\mathfrak{H}");Se("ℨ","\\mathfrak{Z}");Se("\\Bbbk","\\Bbb{k}");Se("·","\\cdotp");Se("\\llap","\\mathllap{\\textrm{#1}}");Se("\\rlap","\\mathrlap{\\textrm{#1}}");Se("\\clap","\\mathclap{\\textrm{#1}}");Se("\\mathstrut","\\vphantom{(}");Se("\\underbar","\\underline{\\text{#1}}");Se("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');Se("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Se("\\ne","\\neq");Se("≠","\\neq");Se("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Se("∉","\\notin");Se("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Se("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Se("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Se("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Se("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Se("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Se("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Se("⟂","\\perp");Se("‼","\\mathclose{!\\mkern-0.8mu!}");Se("∌","\\notni");Se("⌜","\\ulcorner");Se("⌝","\\urcorner");Se("⌞","\\llcorner");Se("⌟","\\lrcorner");Se("©","\\copyright");Se("®","\\textregistered");Se("️","\\textregistered");Se("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Se("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Se("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Se("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Se("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Se("⋮","\\vdots");Se("\\varGamma","\\mathit{\\Gamma}");Se("\\varDelta","\\mathit{\\Delta}");Se("\\varTheta","\\mathit{\\Theta}");Se("\\varLambda","\\mathit{\\Lambda}");Se("\\varXi","\\mathit{\\Xi}");Se("\\varPi","\\mathit{\\Pi}");Se("\\varSigma","\\mathit{\\Sigma}");Se("\\varUpsilon","\\mathit{\\Upsilon}");Se("\\varPhi","\\mathit{\\Phi}");Se("\\varPsi","\\mathit{\\Psi}");Se("\\varOmega","\\mathit{\\Omega}");Se("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Se("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Se("\\boxed","\\fbox{$\\displaystyle{#1}$}");Se("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Se("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Se("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Se("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Se("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Rhe={",":"\\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"};Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in Rhe?e=Rhe[r]:(r.slice(0,4)==="\\not"||r in Ii.math&&Lr.contains(["bin","rel"],Ii.math[r].group))&&(e="\\dotsb"),e});var VQ={")":!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};Se("\\dotso",function(t){var e=t.future().text;return e in VQ?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in VQ&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in VQ?"\\@cdots\\,":"\\@cdots"});Se("\\dotsb","\\cdots");Se("\\dotsm","\\cdots");Se("\\dotsi","\\!\\cdots");Se("\\dotsx","\\ldots\\,");Se("\\DOTSI","\\relax");Se("\\DOTSB","\\relax");Se("\\DOTSX","\\relax");Se("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Se("\\,","\\tmspace+{3mu}{.1667em}");Se("\\thinspace","\\,");Se("\\>","\\mskip{4mu}");Se("\\:","\\tmspace+{4mu}{.2222em}");Se("\\medspace","\\:");Se("\\;","\\tmspace+{5mu}{.2777em}");Se("\\thickspace","\\;");Se("\\!","\\tmspace-{3mu}{.1667em}");Se("\\negthinspace","\\!");Se("\\negmedspace","\\tmspace-{4mu}{.2222em}");Se("\\negthickspace","\\tmspace-{5mu}{.277em}");Se("\\enspace","\\kern.5em ");Se("\\enskip","\\hskip.5em\\relax");Se("\\quad","\\hskip1em\\relax");Se("\\qquad","\\hskip2em\\relax");Se("\\tag","\\@ifstar\\tag@literal\\tag@paren");Se("\\tag@paren","\\tag@literal{({#1})}");Se("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Se("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Se("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Se("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Se("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Se("\\newline","\\\\\\relax");Se("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var BAe=Xt(Wh["Main-Regular"][84][1]-.7*Wh["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+BAe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+BAe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Se("\\hspace","\\@ifstar\\@hspacer\\@hspace");Se("\\@hspace","\\hskip #1\\relax");Se("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Se("\\ordinarycolon",":");Se("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Se("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Se("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Se("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Se("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Se("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Se("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Se("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Se("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Se("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Se("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Se("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Se("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Se("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Se("∷","\\dblcolon");Se("∹","\\eqcolon");Se("≔","\\coloneqq");Se("≕","\\eqqcolon");Se("⩴","\\Coloneqq");Se("\\ratio","\\vcentcolon");Se("\\coloncolon","\\dblcolon");Se("\\colonequals","\\coloneqq");Se("\\coloncolonequals","\\Coloneqq");Se("\\equalscolon","\\eqqcolon");Se("\\equalscoloncolon","\\Eqqcolon");Se("\\colonminus","\\coloneq");Se("\\coloncolonminus","\\Coloneq");Se("\\minuscolon","\\eqcolon");Se("\\minuscoloncolon","\\Eqcolon");Se("\\coloncolonapprox","\\Colonapprox");Se("\\coloncolonsim","\\Colonsim");Se("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Se("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Se("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Se("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Se("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Se("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Se("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Se("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Se("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Se("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Se("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Se("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Se("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Se("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Se("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Se("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Se("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Se("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Se("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Se("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Se("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Se("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Se("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Se("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Se("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Se("\\imath","\\html@mathml{\\@imath}{ı}");Se("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Se("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Se("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Se("⟦","\\llbracket");Se("⟧","\\rrbracket");Se("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Se("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Se("⦃","\\lBrace");Se("⦄","\\rBrace");Se("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Se("⦵","\\minuso");Se("\\darr","\\downarrow");Se("\\dArr","\\Downarrow");Se("\\Darr","\\Downarrow");Se("\\lang","\\langle");Se("\\rang","\\rangle");Se("\\uarr","\\uparrow");Se("\\uArr","\\Uparrow");Se("\\Uarr","\\Uparrow");Se("\\N","\\mathbb{N}");Se("\\R","\\mathbb{R}");Se("\\Z","\\mathbb{Z}");Se("\\alef","\\aleph");Se("\\alefsym","\\aleph");Se("\\Alpha","\\mathrm{A}");Se("\\Beta","\\mathrm{B}");Se("\\bull","\\bullet");Se("\\Chi","\\mathrm{X}");Se("\\clubs","\\clubsuit");Se("\\cnums","\\mathbb{C}");Se("\\Complex","\\mathbb{C}");Se("\\Dagger","\\ddagger");Se("\\diamonds","\\diamondsuit");Se("\\empty","\\emptyset");Se("\\Epsilon","\\mathrm{E}");Se("\\Eta","\\mathrm{H}");Se("\\exist","\\exists");Se("\\harr","\\leftrightarrow");Se("\\hArr","\\Leftrightarrow");Se("\\Harr","\\Leftrightarrow");Se("\\hearts","\\heartsuit");Se("\\image","\\Im");Se("\\infin","\\infty");Se("\\Iota","\\mathrm{I}");Se("\\isin","\\in");Se("\\Kappa","\\mathrm{K}");Se("\\larr","\\leftarrow");Se("\\lArr","\\Leftarrow");Se("\\Larr","\\Leftarrow");Se("\\lrarr","\\leftrightarrow");Se("\\lrArr","\\Leftrightarrow");Se("\\Lrarr","\\Leftrightarrow");Se("\\Mu","\\mathrm{M}");Se("\\natnums","\\mathbb{N}");Se("\\Nu","\\mathrm{N}");Se("\\Omicron","\\mathrm{O}");Se("\\plusmn","\\pm");Se("\\rarr","\\rightarrow");Se("\\rArr","\\Rightarrow");Se("\\Rarr","\\Rightarrow");Se("\\real","\\Re");Se("\\reals","\\mathbb{R}");Se("\\Reals","\\mathbb{R}");Se("\\Rho","\\mathrm{P}");Se("\\sdot","\\cdot");Se("\\sect","\\S");Se("\\spades","\\spadesuit");Se("\\sub","\\subset");Se("\\sube","\\subseteq");Se("\\supe","\\supseteq");Se("\\Tau","\\mathrm{T}");Se("\\thetasym","\\vartheta");Se("\\weierp","\\wp");Se("\\Zeta","\\mathrm{Z}");Se("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Se("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Se("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Se("\\bra","\\mathinner{\\langle{#1}|}");Se("\\ket","\\mathinner{|{#1}\\rangle}");Se("\\braket","\\mathinner{\\langle{#1}\\rangle}");Se("\\Bra","\\left\\langle#1\\right|");Se("\\Ket","\\left|#1\\right\\rangle");var FAe=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}};Se("\\bra@ket",FAe(!1));Se("\\bra@set",FAe(!0));Se("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Se("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Se("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Se("\\angln","{\\angl n}");Se("\\blue","\\textcolor{##6495ed}{#1}");Se("\\orange","\\textcolor{##ffa500}{#1}");Se("\\pink","\\textcolor{##ff00af}{#1}");Se("\\red","\\textcolor{##df0030}{#1}");Se("\\green","\\textcolor{##28ae7b}{#1}");Se("\\gray","\\textcolor{gray}{#1}");Se("\\purple","\\textcolor{##9d38bd}{#1}");Se("\\blueA","\\textcolor{##ccfaff}{#1}");Se("\\blueB","\\textcolor{##80f6ff}{#1}");Se("\\blueC","\\textcolor{##63d9ea}{#1}");Se("\\blueD","\\textcolor{##11accd}{#1}");Se("\\blueE","\\textcolor{##0c7f99}{#1}");Se("\\tealA","\\textcolor{##94fff5}{#1}");Se("\\tealB","\\textcolor{##26edd5}{#1}");Se("\\tealC","\\textcolor{##01d1c1}{#1}");Se("\\tealD","\\textcolor{##01a995}{#1}");Se("\\tealE","\\textcolor{##208170}{#1}");Se("\\greenA","\\textcolor{##b6ffb0}{#1}");Se("\\greenB","\\textcolor{##8af281}{#1}");Se("\\greenC","\\textcolor{##74cf70}{#1}");Se("\\greenD","\\textcolor{##1fab54}{#1}");Se("\\greenE","\\textcolor{##0d923f}{#1}");Se("\\goldA","\\textcolor{##ffd0a9}{#1}");Se("\\goldB","\\textcolor{##ffbb71}{#1}");Se("\\goldC","\\textcolor{##ff9c39}{#1}");Se("\\goldD","\\textcolor{##e07d10}{#1}");Se("\\goldE","\\textcolor{##a75a05}{#1}");Se("\\redA","\\textcolor{##fca9a9}{#1}");Se("\\redB","\\textcolor{##ff8482}{#1}");Se("\\redC","\\textcolor{##f9685d}{#1}");Se("\\redD","\\textcolor{##e84d39}{#1}");Se("\\redE","\\textcolor{##bc2612}{#1}");Se("\\maroonA","\\textcolor{##ffbde0}{#1}");Se("\\maroonB","\\textcolor{##ff92c6}{#1}");Se("\\maroonC","\\textcolor{##ed5fa6}{#1}");Se("\\maroonD","\\textcolor{##ca337c}{#1}");Se("\\maroonE","\\textcolor{##9e034e}{#1}");Se("\\purpleA","\\textcolor{##ddd7ff}{#1}");Se("\\purpleB","\\textcolor{##c6b9fc}{#1}");Se("\\purpleC","\\textcolor{##aa87ff}{#1}");Se("\\purpleD","\\textcolor{##7854ab}{#1}");Se("\\purpleE","\\textcolor{##543b78}{#1}");Se("\\mintA","\\textcolor{##f5f9e8}{#1}");Se("\\mintB","\\textcolor{##edf2df}{#1}");Se("\\mintC","\\textcolor{##e0e5cc}{#1}");Se("\\grayA","\\textcolor{##f6f7f7}{#1}");Se("\\grayB","\\textcolor{##f0f1f2}{#1}");Se("\\grayC","\\textcolor{##e3e5e6}{#1}");Se("\\grayD","\\textcolor{##d6d8da}{#1}");Se("\\grayE","\\textcolor{##babec2}{#1}");Se("\\grayF","\\textcolor{##888d93}{#1}");Se("\\grayG","\\textcolor{##626569}{#1}");Se("\\grayH","\\textcolor{##3b3e40}{#1}");Se("\\grayI","\\textcolor{##21242c}{#1}");Se("\\kaBlue","\\textcolor{##314453}{#1}");Se("\\kaGreen","\\textcolor{##71B307}{#1}");var zAe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let c_t=class{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 o_t(l_t,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Ehe(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 Jh("EOF",n.loc)),this.pushTokens(i),r.range(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 Gt("Extra }",a)}else if(a.text==="EOF")throw new Gt("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 Gt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Gt("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 Gt("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 Gt("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 Gt("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}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Jh(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.indexOf("#")!==-1)for(var s=i.replace(/##/g,"");s.indexOf("#"+(a+1))!==-1;)++a;for(var o=new Ehe(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)||yp.hasOwnProperty(e)||Ii.math.hasOwnProperty(e)||Ii.text.hasOwnProperty(e)||zAe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:yp.hasOwnProperty(e)&&!yp[e].primitive}};var _he=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,$A=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),PB={"́":{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"}},Mhe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let HAe=class VAe{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 c_t(e,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new Gt("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 Jh("}")),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(VAe.endOfExpression.indexOf(i.text)!==-1||r&&i.text===r||e&&yp[i.text]&&yp[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=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=Ii[this.mode][r].group,l=Au.range(e),u;if(Z8t.hasOwnProperty(o)){var h=o;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else u={type:o,mode:this.mode,loc:l,text:r};s=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(j7e(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:Au.range(e),text:r};else return null;if(this.consume(),a)for(var d=0;dt.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertBlockMath:t=>({commands:e,editor:r})=>{const{latex:n,pos:i}=t;return n?e.insertContentAt(i??r.state.selection.from,{type:this.name,attrs:{latex:n}}):!1},deleteBlockMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.delete(i,i+a.nodeSize),!0)},updateBlockMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...a.attrs,latex:n??a.attrs.latex}),!0)}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",ai(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:"blockMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)===null||e===void 0?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{const e=t.match(/^\$\$([^$]+)\$\$/);if(!e)return;const[r,n]=e;return{type:"blockMath",raw:r,latex:n.trim()}}},addInputRules(){return[new xy({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:t,range:e,match:r})=>{const[,n]=r,{tr:i}=t,a=t.doc.resolve(e.from),s=this.type.create({latex:n}),o=a.depth>0&&a.parent.isTextblock&&e.from===a.start()&&e.to===a.end()&&a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),this.type)?{from:a.before(),to:a.after()}:e;i.replaceWith(o.from,o.to,s)}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("div"),i=document.createElement("div");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),i.className="block-math-inner",n.dataset.type="block-math",n.setAttribute("data-latex",e.attrs.latex),n.appendChild(i);function a(){try{GAe.render(e.attrs.latex,i,t),n.classList.remove("block-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("block-math-error")}}const s=o=>{o.preventDefault(),o.stopPropagation();const l=r();l!=null&&this.options.onClick&&this.options.onClick(e,l)};return this.options.onClick&&n.addEventListener("click",s),a(),{dom:n,destroy(){n.removeEventListener("click",s)}}}}}),YAe=Ra.create({name:"inlineMath",group:"inline",inline:!0,atom:!0,addOptions(){return{onClick:void 0,katexOptions:void 0}},addAttributes(){return{latex:{default:"",parseHTML:t=>t.getAttribute("data-latex"),renderHTML:t=>({"data-latex":t.latex})}}},addCommands(){return{insertInlineMath:t=>({editor:e,tr:r})=>{var n;const i=t.latex,a=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.from;return i?(r.replaceWith(a,a,this.type.create({latex:i})),!0):!1},deleteInlineMath:t=>({editor:e,tr:r})=>{var n;const i=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.$from.pos,a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.delete(i,i+a.nodeSize),!0)},updateInlineMath:t=>({editor:e,tr:r})=>{const n=t==null?void 0:t.latex;let i=t==null?void 0:t.pos;i===void 0&&(i=e.state.selection.$from.pos);const a=e.state.doc.nodeAt(i);return!a||a.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...a.attrs,latex:n}),!0)}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",ai(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:"inlineMath",attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)===null||e===void 0?void 0:e.latex)||""}$`},markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{const e=t.match(/^\$([^$]+)\$(?!\$)/);if(!e)return;const[r,n]=e;return{type:"inlineMath",raw:r,latex:n.trim()}}},addInputRules(){return[new xy({find:new RegExp("(?{const n=r[2],{tr:i}=t,a=e.from,s=e.to;i.replaceWith(a,s,this.type.create({latex:n}))}})]},addNodeView(){const{katexOptions:t}=this.options;return({node:e,getPos:r})=>{const n=document.createElement("span");n.className="tiptap-mathematics-render",this.editor.isEditable&&n.classList.add("tiptap-mathematics-render--editable"),n.dataset.type="inline-math",n.setAttribute("data-latex",e.attrs.latex);function i(){try{GAe.render(e.attrs.latex,n,t),n.classList.remove("inline-math-error")}catch{n.textContent=e.attrs.latex,n.classList.add("inline-math-error")}}const a=s=>{s.preventDefault(),s.stopPropagation();const o=r();o!=null&&this.options.onClick&&this.options.onClick(e,o)};return this.options.onClick&&n.addEventListener("click",a),i(),{dom:n,destroy(){n.removeEventListener("click",a)}}}}});Ui.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[UAe.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),YAe.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const g_t=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},jAe=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!g_t(t,n))return n;return-1},m_t=YAe.extend({markdownTokenizer:{name:"inlineMath",level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=jAe(t,"$",1);if(e<0||t[e+1]==="$")return;const r=t.slice(0,e+1),n=t.slice(1,e).trim();if(!(!n||n.includes(` +`)))return/^\d+(?:[.,]\d+)?$/u.test(n)?{type:"text",raw:r,text:r}:{type:"inlineMath",raw:r,latex:n}}}}),y_t=UAe.extend({markdownTokenizer:{name:"blockMath",level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=jAe(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:"blockMath",raw:t.slice(0,e+2),latex:r}}}}),Lhe={throwOnError:!1,strict:"warn",trust:!1},v_t=()=>[y_t.configure({katexOptions:Lhe}),m_t.configure({katexOptions:Lhe})],b_t=(t,e)=>{const r=Math.min(e.from,t.content.size),n=Math.min(e.to,t.content.size),i=t.resolve(r);for(let s=i.depth;s>0;s-=1)if(i.node(s).type.name===QS){const o=i.after(s);return{from:o,to:o}}const a=t.nodeAt(r);if(n>r&&((a==null?void 0:a.type.name)==="image"||(a==null?void 0:a.type.name)===QS)){const s=r+a.nodeSize;return{from:s,to:s}}return{from:r,to:n}},x_t=(t,e,r=t.selection)=>{const{from:n,to:i}=b_t(t.doc,r),a=t.schema.nodes.image.create(e),s=t.tr.replaceRangeWith(n,i,a);return s.doc.descendants((o,l)=>{o===a&&s.setSelection(Ir.create(s.doc,l))}),s},w_t=(t,e)=>{if(!t.isEditable||t.isDestroyed||e.length<2)return!1;const r=t.schema.nodes[QS];if(!r)return!1;const n=new Set(e),i=[];let a=null;if(t.state.doc.forEach((o,l)=>{o.type.name==="image"&&n.has(o.attrs.src)?(a||(a={from:l,to:l,images:[]}),a.images.push(o),a.to=l+o.nodeSize):(a&&a.images.length>1&&i.push(a),a=null)}),a&&a.images.length>1&&i.push(a),!i.length)return!1;const s=t.state.tr;for(const o of i.reverse())s.replaceWith(o.from,o.to,r.create({layout:"auto"},o.images));return t.view.dispatch(s),!0},T_t=t=>(({editor:e,node:r,getPos:n})=>{let i=r;const a=document.createElement("div");a.className="edgeever-native-image-gallery",a.dataset.edgeeverImageGallery="true";const s=document.createElement("div");s.className="edgeever-native-gallery-toolbar",s.contentEditable="false",s.setAttribute("role","toolbar");const o=document.createElement("div");o.className="edgeever-native-gallery-content";const l=e7e.map(h=>{const d=document.createElement("button");return d.type="button",d.addEventListener("pointerdown",f=>f.stopPropagation()),d.addEventListener("mousedown",f=>f.preventDefault()),d.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation();const p=n();if(!e.isEditable||typeof p!="number")return;const g=e.state.doc.nodeAt(p);(g==null?void 0:g.type.name)===QS&&e.view.dispatch(e.state.tr.setNodeMarkup(p,void 0,{...g.attrs,layout:h}))}),s.appendChild(d),{button:d,layout:h}});a.appendChild(s),a.appendChild(o);const u=()=>{const h=t()==="en-US",d=Tq(i.attrs.layout);a.dataset.imageGalleryLayout=d,a.dataset.imageCount=String(i.childCount),s.hidden=!e.isEditable,s.setAttribute("aria-label",h?"Image gallery layout":"图片画廊布局");for(const f of l)f.button.textContent=f.layout==="auto"?h?"Auto":"自动":f.layout==="1"?h?"Single":"单列":`${f.layout} ${h?"columns":"栏"}`,f.button.setAttribute("aria-pressed",String(f.layout===d))};return u(),e.on("transaction",u),e.on("update",u),{dom:a,contentDOM:o,update:h=>h.type!==i.type?!1:(i=h,u(),!0),stopEvent:h=>s.contains(h.target),ignoreMutation:h=>h.type!=="selection"&&!o.contains(h.target),destroy:()=>{e.off("transaction",u),e.off("update",u)}}}),k_t=` +[data-edgeever-image-gallery].edgeever-native-image-gallery { display: block; } +.edgeever-native-gallery-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; line-height: 1.2; } +.edgeever-native-gallery-toolbar[hidden] { display: none; } +.edgeever-native-gallery-toolbar button { min-height: 44px; padding: 8px 12px; border: 1px solid #16a06e55; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; } +.edgeever-native-gallery-toolbar button[aria-pressed="true"] { color: #16a06e; background: #16a06e22; } +.edgeever-native-gallery-toolbar button:focus-visible { outline: 2px solid #16a06e; outline-offset: 2px; } +.edgeever-native-gallery-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } +[data-image-gallery-layout="1"] > .edgeever-native-gallery-content { grid-template-columns: minmax(0, 1fr); } +@media (min-width: 600px) { [data-image-gallery-layout="3"] > .edgeever-native-gallery-content { grid-template-columns: repeat(3, minmax(0, 1fr)); } } +.edgeever-native-gallery-content > * { width: 100% !important; min-width: 0; height: 100%; margin: 0 !important; overflow: hidden; border-radius: 10px; background: transparent; } +.edgeever-native-gallery-content > img, .edgeever-native-gallery-content > * > img { width: 100% !important; height: 100%; min-height: 112px; max-height: 220px; object-fit: cover; } +.edgeever-native-gallery-content .edgeever-image-size-controls { display: none !important; } +`,XAe=document.createElement("style");XAe.textContent=k_t;document.head.append(XAe);const Ihe="\x3C!-- edgeever:merge-divider -->",C_t=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,S_t=Ra.create({name:"edgeeverMergeDivider",group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",ai(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${Ihe} ----`},parseMarkdown(t,e){return e.createNode("edgeeverMergeDivider")},markdownTokenizer:{name:"edgeeverMergeDivider",level:"block",start(t){return t.indexOf(Lhe)},tokenize(t){const e=v_t.exec(t);if(e)return{type:"edgeeverMergeDivider",raw:e[0],text:""}}}}),x_t=Ra.create({name:"edgeeverImageGallery",group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>{const e=t.getAttribute("data-image-gallery-layout");return e==="1"||e==="2"||e==="3"?e:"auto"},renderHTML:t=>({"data-image-gallery-layout":t.layout==="1"||t.layout==="2"||t.layout==="3"?t.layout:"auto"})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ai(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]}});function A1(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 WQ(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 qQ(t,e){const r=A1(t);return r?JSON.stringify({kind:"image",href:WQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function w_t(t,e){const r=A1(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:WQ(t,r),filename:n,resourceId:r})}const Ihe="edgeever-attachment-kind-";function T_t(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function YAe(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(Ihe)&&e.classList.remove(n)});const r=T_t(e.textContent||"");e.classList.add("edgeever-attachment-link",`${Ihe}${hb(null,r)}`)})}const k_t=performance.now(),$he=256*1024;let to="viewer",Nq="zh-CN",Dq="开始输入…",N5=!1;const lL=new Map;let C_t=0;function oo(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{}}async function S_t(t){return new Uint8Array(await t.arrayBuffer())}function E_t(t){let e="";for(let r=0;r{const r=`r${++C_t}`;lL.set(r,e),oo({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{lL.delete(r)&&e(null)},3e4)})}async function A_t(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(jAe(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await XAe(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function R_t(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]);Lle.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 Lle.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,s.replaceWith(h)}catch{}}}const __t=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function D0(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 KAe(t){return Math.min(100,Math.max(10,Math.round(t)))}function $A(t,e){const r=e==null?null:KAe(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 Nhe(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 M_t(){return ort.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>D0(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=D0(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 A=e();if(typeof A!="number")return;const M=t.state.doc.nodeAt(A);if(!M||M.type.name!=="image")return;const L=KAe(E);let P=t.state.tr.setNodeMarkup(A,void 0,{...M.attrs,width:L});try{P=P.setSelection(Wr.create(P.doc,A))}catch{}t.view.dispatch(P),$A(i,L),f(L)},d=[];for(const E of __t){const A=document.createElement("button");A.type="button",A.className="edgeever-image-size-button",A.textContent=E.label,A.setAttribute("aria-label",E.label),A.setAttribute("aria-pressed","false"),Nhe(A,()=>h(E.width)),d.push({button:A,width:E.width}),u.append(A)}const f=E=>{for(const A of d){const M=E!=null&&A.width===E;A.button.classList.toggle("is-active",M),A.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 A=document.createElement("span");A.className="edgeever-image-loading-label",A.textContent="图片加载失败",a.append(A),a.hidden=!1}else E==="loading"&&a.replaceChildren(s)},g=E=>{const A=String(E.src??"");return cL(A)||A1(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=qQ(E,String(n.attrs.alt??"image"));if(A){oo({type:"resourcePress",targetJson:A});return}oo({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&&oo({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};Nhe(l,m);let v=0;const x=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const A=Date.now();if(A-v<350)return;if(v=A,E.stopPropagation(),to==="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",x),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&x(E)}),i.append(a,o,l,u);let b=0,T="",k=!1;const S=E=>{const A=String(E.alt??"");o.alt=A;const M=D0(E.width);$A(i,M),f(M);const L=String(E.src??""),P=A1(L);P&&(i.dataset.resourceHref=WQ(L,P),o.dataset.originalSrc=i.dataset.resourceHref)},C=E=>{b+=1;const A=b,M=String(E.src??"");T=M,S(E),p("loading"),u.hidden=!0;const L=P=>{A===b&&(o.onload=()=>{A===b&&(p("ready"),o.style.cursor=to==="viewer"||!t.isEditable?"zoom-in":"pointer",k&&t.isEditable&&to==="editor"&&(u.hidden=!1))},o.onerror=()=>{A===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(jAe(M)){XAe(M).then(P=>{A===b&&(P?L(P):p("failed"))});return}L(M)};return C(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const A=String(E.attrs.src??"");return S(E.attrs),A!==T?C(E.attrs):(f(D0(E.attrs.width)),$A(i,D0(E.attrs.width))),!0},selectNode:()=>{var A,M;k=!0,i.classList.add("is-selected");const E=D0((M=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:M.width)??D0(i.dataset.width)??D0(n.attrs.width);$A(i,E),t.isEditable&&to==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{k=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function L_t(t){return[irt.configure({codeBlock:!1}),pSt,qbe,Wbe.configure({nested:!0}),b_t,...y_t(),XJe.configure({languageClassPrefix:"language-"}),x_t,M_t(),knt.configure({table:{resizable:!1}}),...KCt(),lrt.configure({placeholder:t}),kit.configure({markedOptions:{gfm:!0}})]}const Gl=document.getElementById("editor"),mR=document.getElementById("toolbar"),Er=new IJe({element:Gl,extensions:L_t("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{uL(),requestAnimationFrame(()=>YAe(Gl)),!(N5||to!=="editor")&&of(t)},onSelectionUpdate:()=>uL(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},handleClick(t,e,r){return Dhe(r,"click")},handleDOMEvents:{contextmenu(t,e){return Dhe(e,"contextmenu")}}}});function Dhe(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(cL(a)||A1(a)){const s=w_t(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),oo({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||(cL(a)||A1(a)?a:"");if(!s&&!A1(a))return to==="viewer"&&e==="click"&&a?(t.preventDefault(),oo({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=qQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),oo({type:"resourcePress",targetJson:u}),!0}if(to==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),oo({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Gl.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=qQ(s,e.getAttribute("alt")||"image");o&&oo({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Gl.addEventListener("touchend",r,{passive:!0}),Gl.addEventListener("touchmove",r,{passive:!0}),Gl.addEventListener("touchcancel",r,{passive:!0})})();const GQ="edgeever-dollar",UQ=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",GQ)}:t:Array.isArray(e.content)?{...e,content:e.content.map(UQ)}:t},ZAe=t=>iSt(dQ(t.getJSON()));let Nk=null;const I_t=(t,e,r)=>{var a;const n=(a=t.storage.markdown)==null?void 0:a.manager,i=t.state.doc.slice(e,r).content.toJSON();return n!=null&&n.serialize?n.serialize(UQ({type:"doc",content:i})).replaceAll(GQ,"\\$"):t.state.doc.textBetween(e,r,` +---`},parseMarkdown(t,e){return e.createNode("edgeeverMergeDivider")},markdownTokenizer:{name:"edgeeverMergeDivider",level:"block",start(t){return t.indexOf(Ihe)},tokenize(t){const e=C_t.exec(t);if(e)return{type:"edgeeverMergeDivider",raw:e[0],text:""}}}}),E_t=Ra.create({name:"edgeeverImageGallery",group:"block",content:"image+",defining:!0,isolating:!0,addNodeView(){return T_t(()=>cL)},addAttributes(){return{layout:{default:"auto",parseHTML:t=>{const e=t.getAttribute("data-image-gallery-layout");return e==="1"||e==="2"||e==="3"?e:"auto"},renderHTML:t=>({"data-image-gallery-layout":t.layout==="1"||t.layout==="2"||t.layout==="3"?t.layout:"auto"})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ai(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]}});function A1(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 GQ(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 UQ(t,e){const r=A1(t);return r?JSON.stringify({kind:"image",href:GQ(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function A_t(t,e){const r=A1(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:GQ(t,r),filename:n,resourceId:r})}const $he="edgeever-attachment-kind-";function R_t(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function KAe(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith($he)&&e.classList.remove(n)});const r=R_t(e.textContent||"");e.classList.add("edgeever-attachment-link",`${$he}${hb(null,r)}`)})}const __t=performance.now(),Nhe=256*1024;let to="viewer",cL="zh-CN",Pq="开始输入…",N5=!1;const uL=new Map;let M_t=0;function oo(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{}}async function L_t(t){return new Uint8Array(await t.arrayBuffer())}function I_t(t){let e="";for(let r=0;r{const r=`r${++M_t}`;uL.set(r,e),oo({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{uL.delete(r)&&e(null)},3e4)})}async function $_t(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(ZAe(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await QAe(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function N_t(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]);$le.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 $le.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,s.replaceWith(h)}catch{}}}const D_t=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function D0(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 JAe(t){return Math.min(100,Math.max(10,Math.round(t)))}function NA(t,e){const r=e==null?null:JAe(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 Dhe(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 O_t(){return urt.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>D0(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=D0(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 A=e();if(typeof A!="number")return;const M=t.state.doc.nodeAt(A);if(!M||M.type.name!=="image")return;const L=JAe(E);let P=t.state.tr.setNodeMarkup(A,void 0,{...M.attrs,width:L});try{P=P.setSelection(Wr.create(P.doc,A))}catch{}t.view.dispatch(P),NA(i,L),f(L)},d=[];for(const E of D_t){const A=document.createElement("button");A.type="button",A.className="edgeever-image-size-button",A.textContent=E.label,A.setAttribute("aria-label",E.label),A.setAttribute("aria-pressed","false"),Dhe(A,()=>h(E.width)),d.push({button:A,width:E.width}),u.append(A)}const f=E=>{for(const A of d){const M=E!=null&&A.width===E;A.button.classList.toggle("is-active",M),A.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 A=document.createElement("span");A.className="edgeever-image-loading-label",A.textContent="图片加载失败",a.append(A),a.hidden=!1}else E==="loading"&&a.replaceChildren(s)},g=E=>{const A=String(E.src??"");return hL(A)||A1(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=UQ(E,String(n.attrs.alt??"image"));if(A){oo({type:"resourcePress",targetJson:A});return}oo({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&&oo({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};Dhe(l,m);let v=0;const x=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const A=Date.now();if(A-v<350)return;if(v=A,E.stopPropagation(),to==="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",x),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&x(E)}),i.append(a,o,l,u);let b=0,T="",k=!1;const S=E=>{const A=String(E.alt??"");o.alt=A;const M=D0(E.width);NA(i,M),f(M);const L=String(E.src??""),P=A1(L);P&&(i.dataset.resourceHref=GQ(L,P),o.dataset.originalSrc=i.dataset.resourceHref)},C=E=>{b+=1;const A=b,M=String(E.src??"");T=M,S(E),p("loading"),u.hidden=!0;const L=P=>{A===b&&(o.onload=()=>{A===b&&(p("ready"),o.style.cursor=to==="viewer"||!t.isEditable?"zoom-in":"pointer",k&&t.isEditable&&to==="editor"&&(u.hidden=!1))},o.onerror=()=>{A===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(ZAe(M)){QAe(M).then(P=>{A===b&&(P?L(P):p("failed"))});return}L(M)};return C(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const A=String(E.attrs.src??"");return S(E.attrs),A!==T?C(E.attrs):(f(D0(E.attrs.width)),NA(i,D0(E.attrs.width))),!0},selectNode:()=>{var A,M;k=!0,i.classList.add("is-selected");const E=D0((M=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:M.width)??D0(i.dataset.width)??D0(n.attrs.width);NA(i,E),t.isEditable&&to==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{k=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function P_t(t){return[ort.configure({codeBlock:!1}),gSt,Gbe,qbe.configure({nested:!0}),S_t,...v_t(),QJe.configure({languageClassPrefix:"language-"}),E_t,O_t(),Ent.configure({table:{resizable:!1}}),...JCt(),hrt.configure({placeholder:t}),Eit.configure({markedOptions:{gfm:!0}})]}const mc=document.getElementById("editor"),yR=document.getElementById("toolbar"),vr=new DJe({element:mc,extensions:P_t("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{dL(),requestAnimationFrame(()=>KAe(mc)),!(N5||to!=="editor")&&Lh(t)},onSelectionUpdate:()=>dL(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},handleClick(t,e,r){return Ohe(r,"click")},handleDOMEvents:{contextmenu(t,e){return Ohe(e,"contextmenu")}}}});function Ohe(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(hL(a)||A1(a)){const s=A_t(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),oo({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||(hL(a)||A1(a)?a:"");if(!s&&!A1(a))return to==="viewer"&&e==="click"&&a?(t.preventDefault(),oo({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=UQ(o,l);if(u)return t.preventDefault(),t.stopPropagation(),oo({type:"resourcePress",targetJson:u}),!0}if(to==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),oo({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};mc.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=UQ(s,e.getAttribute("alt")||"image");o&&oo({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),mc.addEventListener("touchend",r,{passive:!0}),mc.addEventListener("touchmove",r,{passive:!0}),mc.addEventListener("touchcancel",r,{passive:!0})})();const YQ="edgeever-dollar",jQ=t=>{if(!t||typeof t!="object")return t;const e=t;return e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(n=>n==="$").length>=2?{...e,text:e.text.replaceAll("$",YQ)}:t:Array.isArray(e.content)?{...e,content:e.content.map(jQ)}:t},e8e=t=>aSt(pQ(t.getJSON()));let Nk=null;const B_t=(t,e,r)=>{var a;const n=(a=t.storage.markdown)==null?void 0:a.manager,i=t.state.doc.slice(e,r).content.toJSON();return n!=null&&n.serialize?n.serialize(jQ({type:"doc",content:i})).replaceAll(YQ,"\\$"):t.state.doc.textBetween(e,r,` -`)},OB="edgeever-inline-sentinel",$_t=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(UQ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(GQ,"\\$"):r},N_t=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,a)=>{if(!i.isTextblock)return!0;const s=a+1,o=s+i.content.size,l=Math.max(e.from,s),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:s,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],a=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),s=t.state.doc.textBetween(i.from,i.to,` -`),o=$_t(t,a.content??[],s).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:s}:null}const n=I_t(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,` +`)},BB="edgeever-inline-sentinel",F_t=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(jQ({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(YQ,"\\$"):r},z_t=t=>{const e=t.state.selection;if(e.empty||e.from>=e.to)return null;const r=[];if(t.state.doc.nodesBetween(e.from,e.to,(i,a)=>{if(!i.isTextblock)return!0;const s=a+1,o=s+i.content.size,l=Math.max(e.from,s),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:s,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],a=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),s=t.state.doc.textBetween(i.from,i.to,` +`),o=F_t(t,a.content??[],s).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:s}:null}const n=B_t(t,e.from,e.to).trim();return n?{from:e.from,to:e.to,isInline:!1,markdown:n,text:t.state.doc.textBetween(e.from,e.to,` -`)}:null},D_t=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),a=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return a;const s=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${OB}${s}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(OB))return[{type:"text",text:s}];const d=h.text.slice(OB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function of(t){try{const e=JSON.stringify(dQ(t.getJSON())),r=ZAe(t);oo({type:"change",contentMarkdown:r,contentJson:e})}catch(e){oo({type:"error",message:e instanceof Error?e.message:String(e)})}}function O_t(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;hl.char).join("").toLocaleLowerCase(),s=[];let o=a.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&s.push({from:l.pos,to:u.pos+1}),o=a.indexOf(r,o+r.length)}return s}const Ohe=()=>Er.isActive("taskItem")?"taskItem":"listItem";function QAe(t){var r;if(mR.classList.toggle("editor-mode",t),mR.innerHTML="",!t)return;const e=[{id:"image",label:"▧+",run:()=>oo({type:"pickImage"})},{id:"bold",label:"B",run:()=>Er.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>Er.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>Er.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>Er.chain().focus().sinkListItem(Ohe()).run()},{id:"outdent",label:"⇤",run:()=>Er.chain().focus().liftListItem(Ohe()).run()},{id:"quote",label:"❝",run:()=>Er.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>Er.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const a={image:["插入图片","Insert image"],bold:["粗体","Bold"],bullet:["项目符号列表","Bullet list"],task:["任务清单","Task list"],indent:["增加列表缩进","Increase list indent"],outdent:["减少列表缩进","Decrease list indent"],quote:["引用","Block quote"],hr:["分隔线","Horizontal rule"]};i.setAttribute("aria-label",((r=a[n.id])==null?void 0:r[Nq==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&of(Er),uL()}),mR.appendChild(i)}uL()}function uL(){const t={bold:Er.isActive("bold"),bullet:Er.isActive("bulletList"),task:Er.isActive("taskList"),quote:Er.isActive("blockquote")};mR.querySelectorAll("button[data-action]").forEach(e=>{e.classList.toggle("is-active",t[e.dataset.action??""]??!1)})}async function PB(t="light"){Gl.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=Dq}),YAe(Gl),await A_t(Gl),to==="viewer"&&await R_t(Gl,t)}async function P_t(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=u8t(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",a=H7e[i]||680,s=VT[e]||VT.slate,o=Er.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${a}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=f8t({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=d8t({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${a}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async M=>{if(!M.complete)try{await M.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(M=>!M.complete||M.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=c8t[e]||s.canvasBg,x=await L2t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:a}),b=await new Promise((M,L)=>{x.toBlob(P=>P?M(P):L(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",k=h8t(t.title,t.fallbackTitle),S=await S_t(b),C=`${k}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=E_t(S);for(let M=0;MsetTimeout(L,0));oo({type:"imageExportComplete",requestId:t.requestId,filename:C,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){oo({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const B_t={exportImage(t){P_t(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==to;to=e,Nq=t.locale==="en-US"?"en-US":"zh-CN",Er.setEditable(to==="editor"),QAe(to==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",to==="viewer"),document.body.classList.toggle("editor-mode",to==="editor"),t.placeholder&&(Dq=t.placeholder,Gl.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=Dq})),to==="editor"&&r&&requestAnimationFrame(()=>{try{Er.commands.focus("end")}catch{}}),PB(t.theme||"light")},setMarkdown(t){var e;N5=!0;try{Er.commands.setContent(t||"",{contentType:"markdown"})}catch{try{const r=(e=Er.storage.markdown)==null?void 0:e.manager;if(r)Er.commands.setContent(r.parse(t||""));else throw new Error("no markdown manager")}catch{Er.commands.setContent({type:"doc",content:[{type:"paragraph",content:t?[{type:"text",text:t}]:[]}]})}}Er.setEditable(to==="editor"),N5=!1,PB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){N5=!0;try{const e=JSON.parse(t);Er.commands.setContent(QCt(ySt(e),Nq))}catch{Er.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}Er.setEditable(to==="editor"),N5=!1,PB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=lL.get(t);r&&(lL.delete(t),r(e))},getMarkdown(){return ZAe(Er)},getDocument(){return JSON.stringify(dQ(Er.getJSON()))},captureSelection(){const t=N_t(Er);return t?(Nk={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(Er.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(Nk=null,null)},applySelectionDraft(t,e){var s,o;const r=Nk;if(!r||!t.trim())return!1;if(JSON.stringify(Er.getJSON())!==r.documentFingerprint)return Nk=null,!1;const n=Er.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),a=Math.min(Math.max(r.to,i),n);try{const l=(s=Er.storage.markdown)==null?void 0:s.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?D_t(Er,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:a,to:a}:{from:i,to:a};return Er.chain().focus().insertContentAt(d,h).run(),Nk=null,of(Er),!0}catch{return!1}},undo(){if(!Er.can().undo())return!1;const t=Er.commands.undo();return t&&of(Er),t},focusEnd(){var t;try{Er.commands.focus("end")}catch{}try{const e=(t=Er.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){of(Er)},exec(t){var r;const e={bold:()=>Er.chain().focus().toggleBold().run(),bulletList:()=>Er.chain().focus().toggleBulletList().run(),taskList:()=>Er.chain().focus().toggleTaskList().run(),blockquote:()=>Er.chain().focus().toggleBlockquote().run(),horizontalRule:()=>Er.chain().focus().setHorizontalRule().run(),heading2:()=>Er.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>Er.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),of(Er)},beginImageUpload(t,e){Er.chain().focus().setImage({src:e,alt:t}).run();const r=Gl.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),of(Er)},completeImageUpload(t,e,r){Er.chain().focus().setImage({src:e,alt:r||t||""}).run();const n=Gl.querySelectorAll("img"),i=n[n.length-1];i&&(i.dataset.originalSrc=e,delete i.dataset.uploadId),of(Er)},cancelImageUpload(t){const e=Gl.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),of(Er)},search(t,e){const r=O_t(Er,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){Er.commands.setTextSelection({from:i.from,to:i.to});try{const a=Er.view.domAtPos(i.from).node,s=a instanceof Element?a:a.parentElement;s==null||s.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}oo({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=B_t;QAe(!1);oo({type:"ready",startupMs:Math.round(performance.now()-k_t)});class Ht 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(F_t,"-$1").toLowerCase(),H_t={"&":"&",">":">","<":"<",'"':""","'":"'"},V_t=/[&><"']/g,_o=t=>String(t).replace(V_t,e=>H_t[e]),yR=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?yR(t.body[0]):t:t.type==="font"?yR(t.body):t,W_t=new Set(["mathord","textord","atom"]),f0=t=>W_t.has(yR(t).type),q_t=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"},hL={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 G_t(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 U_t(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return G_t(e)}function Y_t(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:U_t(n)}class YQ{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(hL)){var n=hL[r];n&&Y_t(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 Ht("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=q_t(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class O0{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 Fh[j_t[this.id]]}sub(){return Fh[X_t[this.id]]}fracNum(){return Fh[K_t[this.id]]}fracDen(){return Fh[Z_t[this.id]]}cramp(){return Fh[Q_t[this.id]]}text(){return Fh[J_t[this.id]]}isTight(){return this.size>=2}}var jQ=0,dL=1,pb=2,Df=3,i6=4,nu=5,qT=6,cl=7,Fh=[new O0(jQ,0,!1),new O0(dL,0,!0),new O0(pb,1,!1),new O0(Df,1,!0),new O0(i6,2,!1),new O0(nu,2,!0),new O0(qT,3,!1),new O0(cl,3,!0)],j_t=[i6,nu,i6,nu,qT,cl,qT,cl],X_t=[nu,nu,nu,nu,cl,cl,cl,cl],K_t=[pb,Df,i6,nu,qT,cl,qT,cl],Z_t=[Df,Df,nu,nu,cl,cl,cl,cl],Q_t=[dL,dL,Df,Df,nu,nu,cl,cl],J_t=[jQ,dL,pb,Df,pb,Df,pb,Df],ln={DISPLAY:Fh[jQ],TEXT:Fh[pb],SCRIPT:Fh[i6],SCRIPTSCRIPT:Fh[qT]},Oq=[{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 e9t(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var vR=[];Oq.forEach(t=>t.blocks.forEach(e=>vR.push(...e)));function JAe(t){for(var e=0;e=vR[e]&&t<=vR[e+1])return!0;return!1}var ss=t=>t+" "+t,_v=80,t9t=function(e,r){return"M95,"+(622+e+r)+` +`)}:null},H_t=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),a=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return a;const s=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${BB}${s}`).content,l=(o==null?void 0:o.length)===1?o[0]:null,u=(l==null?void 0:l.type)==="paragraph"?l.content??[]:[],h=u[0];if((h==null?void 0:h.type)!=="text"||typeof h.text!="string"||!h.text.startsWith(BB))return[{type:"text",text:s}];const d=h.text.slice(BB.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function Lh(t){try{const e=JSON.stringify(pQ(t.getJSON())),r=e8e(t);oo({type:"change",contentMarkdown:r,contentJson:e})}catch(e){oo({type:"error",message:e instanceof Error?e.message:String(e)})}}function V_t(t,e){const r=e.trim().toLocaleLowerCase();if(r.length===0)return[];const n=[];let i=null;t.state.doc.descendants((l,u)=>{if(!(!l.isText||!l.text)){i!==null&&u>i&&n.push({char:"\0",pos:-1});for(let h=0;hl.char).join("").toLocaleLowerCase(),s=[];let o=a.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&s.push({from:l.pos,to:u.pos+1}),o=a.indexOf(r,o+r.length)}return s}const Phe=()=>vr.isActive("taskItem")?"taskItem":"listItem";function t8e(t){var r;if(yR.classList.toggle("editor-mode",t),yR.innerHTML="",!t)return;const e=[{id:"image",label:"▧+",run:()=>oo({type:"pickImage"})},{id:"bold",label:"B",run:()=>vr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>vr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>vr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>vr.chain().focus().sinkListItem(Phe()).run()},{id:"outdent",label:"⇤",run:()=>vr.chain().focus().liftListItem(Phe()).run()},{id:"quote",label:"❝",run:()=>vr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>vr.chain().focus().setHorizontalRule().run()}];for(const n of e){const i=document.createElement("button");i.type="button",i.textContent=n.label,i.dataset.action=n.id;const a={image:["插入图片","Insert image"],bold:["粗体","Bold"],bullet:["项目符号列表","Bullet list"],task:["任务清单","Task list"],indent:["增加列表缩进","Increase list indent"],outdent:["减少列表缩进","Decrease list indent"],quote:["引用","Block quote"],hr:["分隔线","Horizontal rule"]};i.setAttribute("aria-label",((r=a[n.id])==null?void 0:r[cL==="en-US"?1:0])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&Lh(vr),dL()}),yR.appendChild(i)}dL()}function dL(){const t={bold:vr.isActive("bold"),bullet:vr.isActive("bulletList"),task:vr.isActive("taskList"),quote:vr.isActive("blockquote")};yR.querySelectorAll("button[data-action]").forEach(e=>{e.classList.toggle("is-active",t[e.dataset.action??""]??!1)})}async function FB(t="light"){mc.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=Pq}),KAe(mc),await $_t(mc),to==="viewer"&&await N_t(mc,t)}async function W_t(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=h8t(t.background,t.theme),r=t.fontStyle??"serif",n=t.fontSize??"lg",i=t.cardWidth??"standard",a=W7e[i]||680,s=VT[e]||VT.slate,o=vr.view.dom.cloneNode(!0);o.removeAttribute("contenteditable"),o.querySelectorAll("button, [contenteditable='true']").forEach(g=>{g.removeAttribute("contenteditable"),g instanceof HTMLButtonElement&&g.remove()});const l=o.innerHTML,u=document.createElement("div");u.style.cssText=`position:fixed;left:-100000px;top:0;width:${a}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=p8t({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=f8t({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,fontStyle:r,showTitle:t.showTitle??!0,showNotebook:t.showNotebook??!1,showTags:t.showTags??!1,showUpdatedAt:t.showUpdatedAt??!0,showBranding:t.branding??!0});u.appendChild(h),u.insertAdjacentHTML("beforeend",d);const f=u.lastElementChild;f.style.width=`${a}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{await((p=document.fonts)==null?void 0:p.ready),await Promise.all(Array.from(f.querySelectorAll("img")).map(async M=>{if(!M.complete)try{await M.decode()}catch{}}));const g=Array.from(f.querySelectorAll(".edgeever-card-body img")),m=g.filter(M=>!M.complete||M.naturalWidth===0).length,y=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=u8t[e]||s.canvasBg,x=await N2t(f,{backgroundColor:v,cacheBust:!1,height:y,pixelRatio:2,skipFonts:!0,width:a}),b=await new Promise((M,L)=>{x.toBlob(P=>P?M(P):L(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),T=t.format==="jpeg"?"jpg":"png",k=d8t(t.title,t.fallbackTitle),S=await L_t(b),C=`${k}.${T}`,E=t.format==="jpeg"?"image/jpeg":"image/png",A=I_t(S);for(let M=0;MsetTimeout(L,0));oo({type:"imageExportComplete",requestId:t.requestId,filename:C,mimeType:E,width:x.width,height:x.height,totalImages:g.length,failedImages:m})}catch(g){oo({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const q_t={exportImage(t){W_t(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==to;to=e,cL=t.locale==="en-US"?"en-US":"zh-CN",vr.setEditable(to==="editor"),t8e(to==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",to==="viewer"),document.body.classList.toggle("editor-mode",to==="editor"),t.placeholder&&(Pq=t.placeholder,mc.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=Pq})),to==="editor"&&r&&requestAnimationFrame(()=>{try{vr.commands.focus("end")}catch{}}),FB(t.theme||"light")},setMarkdown(t){var e;N5=!0;try{vr.commands.setContent(t||"",{contentType:"markdown"})}catch{try{const r=(e=vr.storage.markdown)==null?void 0:e.manager;if(r)vr.commands.setContent(r.parse(t||""));else throw new Error("no markdown manager")}catch{vr.commands.setContent({type:"doc",content:[{type:"paragraph",content:t?[{type:"text",text:t}]:[]}]})}}vr.setEditable(to==="editor"),N5=!1,FB(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){N5=!0;try{const e=JSON.parse(t);vr.commands.setContent(tSt(vSt(e),cL))}catch{vr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}vr.setEditable(to==="editor"),N5=!1,FB(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=uL.get(t);r&&(uL.delete(t),r(e))},getMarkdown(){return e8e(vr)},getDocument(){return JSON.stringify(pQ(vr.getJSON()))},captureSelection(){const t=z_t(vr);return t?(Nk={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(vr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(Nk=null,null)},applySelectionDraft(t,e){var s,o;const r=Nk;if(!r||!t.trim())return!1;if(JSON.stringify(vr.getJSON())!==r.documentFingerprint)return Nk=null,!1;const n=vr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),a=Math.min(Math.max(r.to,i),n);try{const l=(s=vr.storage.markdown)==null?void 0:s.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?H_t(vr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:a,to:a}:{from:i,to:a};return vr.chain().focus().insertContentAt(d,h).run(),Nk=null,Lh(vr),!0}catch{return!1}},undo(){if(!vr.can().undo())return!1;const t=vr.commands.undo();return t&&Lh(vr),t},focusEnd(){var t;try{vr.commands.focus("end")}catch{}try{const e=(t=vr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){Lh(vr)},exec(t){var r;const e={bold:()=>vr.chain().focus().toggleBold().run(),bulletList:()=>vr.chain().focus().toggleBulletList().run(),taskList:()=>vr.chain().focus().toggleTaskList().run(),blockquote:()=>vr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>vr.chain().focus().setHorizontalRule().run(),heading2:()=>vr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>vr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),Lh(vr)},beginImageUpload(t,e){vr.chain().focus().setImage({src:e,alt:t}).run();const r=mc.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),Lh(vr)},completeImageUpload(t,e,r){vr.isEditable&&(vr.view.dispatch(x_t(vr.state,{src:e,alt:r||t||""})),Lh(vr))},groupImages(t){const e=w_t(vr,t);return e&&Lh(vr),e},cancelImageUpload(t){const e=mc.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),Lh(vr)},search(t,e){const r=V_t(vr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){vr.commands.setTextSelection({from:i.from,to:i.to});try{const a=vr.view.domAtPos(i.from).node,s=a instanceof Element?a:a.parentElement;s==null||s.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}oo({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=q_t;t8e(!1);oo({type:"ready",startupMs:Math.round(performance.now()-__t)});class Ht 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(G_t,"-$1").toLowerCase(),Y_t={"&":"&",">":">","<":"<",'"':""","'":"'"},j_t=/[&><"']/g,_o=t=>String(t).replace(j_t,e=>Y_t[e]),vR=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?vR(t.body[0]):t:t.type==="font"?vR(t.body):t,X_t=new Set(["mathord","textord","atom"]),f0=t=>X_t.has(vR(t).type),K_t=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"},fL={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 Z_t(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 Q_t(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return Z_t(e)}function J_t(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:Q_t(n)}class XQ{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(fL)){var n=fL[r];n&&J_t(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 Ht("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=K_t(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class O0{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 zh[e9t[this.id]]}sub(){return zh[t9t[this.id]]}fracNum(){return zh[r9t[this.id]]}fracDen(){return zh[n9t[this.id]]}cramp(){return zh[i9t[this.id]]}text(){return zh[a9t[this.id]]}isTight(){return this.size>=2}}var KQ=0,pL=1,pb=2,Df=3,a6=4,nu=5,qT=6,cl=7,zh=[new O0(KQ,0,!1),new O0(pL,0,!0),new O0(pb,1,!1),new O0(Df,1,!0),new O0(a6,2,!1),new O0(nu,2,!0),new O0(qT,3,!1),new O0(cl,3,!0)],e9t=[a6,nu,a6,nu,qT,cl,qT,cl],t9t=[nu,nu,nu,nu,cl,cl,cl,cl],r9t=[pb,Df,a6,nu,qT,cl,qT,cl],n9t=[Df,Df,nu,nu,cl,cl,cl,cl],i9t=[pL,pL,Df,Df,nu,nu,cl,cl],a9t=[KQ,pL,pb,Df,pb,Df,pb,Df],ln={DISPLAY:zh[KQ],TEXT:zh[pb],SCRIPT:zh[a6],SCRIPTSCRIPT:zh[qT]},Bq=[{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 s9t(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var bR=[];Bq.forEach(t=>t.blocks.forEach(e=>bR.push(...e)));function r8e(t){for(var e=0;e=bR[e]&&t<=bR[e+1])return!0;return!1}var ss=t=>t+" "+t,_v=80,o9t=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 @@ -1665,7 +1678,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"},r9t=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"},l9t=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+` @@ -1675,7 +1688,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"},n9t=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},c9t=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 @@ -1684,7 +1697,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"},i9t=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},u9t=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 @@ -1694,18 +1707,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"},a9t=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},h9t=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"},s9t=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},o9t=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"},d9t=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},f9t=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"},l9t=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=t9t(r,_v);break;case"sqrtSize1":i=r9t(r,_v);break;case"sqrtSize2":i=n9t(r,_v);break;case"sqrtSize3":i=i9t(r,_v);break;case"sqrtSize4":i=a9t(r,_v);break;case"sqrtTall":i=o9t(r,_v,n)}return i},c9t=function(e,r){switch(e){case"⎜":return ss("M291 0 H417 V"+r+" H291z");case"∣":return ss("M145 0 H188 V"+r+" H145z");case"∥":return ss("M145 0 H188 V"+r+" H145z")+ss("M367 0 H410 V"+r+" H367z");case"⎟":return ss("M457 0 H583 V"+r+" H457z");case"⎢":return ss("M319 0 H403 V"+r+" H319z");case"⎥":return ss("M263 0 H347 V"+r+" H263z");case"⎪":return ss("M384 0 H504 V"+r+" H384z");case"⏐":return ss("M312 0 H355 V"+r+" H312z");case"‖":return ss("M257 0 H300 V"+r+" H257z")+ss("M478 0 H521 V"+r+" H478z");default:return""}},Phe={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},p9t=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=o9t(r,_v);break;case"sqrtSize1":i=l9t(r,_v);break;case"sqrtSize2":i=c9t(r,_v);break;case"sqrtSize3":i=u9t(r,_v);break;case"sqrtSize4":i=h9t(r,_v);break;case"sqrtTall":i=f9t(r,_v,n)}return i},g9t=function(e,r){switch(e){case"⎜":return ss("M291 0 H417 V"+r+" H291z");case"∣":return ss("M145 0 H188 V"+r+" H145z");case"∥":return ss("M145 0 H188 V"+r+" H145z")+ss("M367 0 H410 V"+r+" H367z");case"⎟":return ss("M457 0 H583 V"+r+" H457z");case"⎢":return ss("M319 0 H403 V"+r+" H319z");case"⎥":return ss("M263 0 H347 V"+r+" H263z");case"⎪":return ss("M384 0 H504 V"+r+" H384z");case"⏐":return ss("M312 0 H355 V"+r+" H312z");case"‖":return ss("M257 0 H300 V"+r+" H257z")+ss("M478 0 H521 V"+r+" H478z");default:return""}},Bhe={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 @@ -1876,7 +1889,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`},u9t=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`},m9t=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 @@ -1904,48 +1917,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 h9t(t){return"toText"in t}class F3{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(h9t(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var Pq={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},d9t={ex:!0,em:!0,mu:!0},e8e=function(e){return typeof e!="string"&&(e=e.unit),e in Pq||e in d9t||e==="ex"},la=function(e,r){var n;if(e.unit in Pq)n=Pq[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 Ht("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Yt=function(e){return+e.toFixed(4)+"em"},Kp=function(e){return e.filter(r=>r).join(" ")},XQ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=z_t(n)+":"+i+";")}return r},t8e=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)}},r8e=function(e){var r=document.createElement(e);r.className=Kp(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]/,n8e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+_o(Kp(this.classes))+'"');var n=XQ(this.style);n&&(r+=' style="'+_o(n)+'"');for(var i of Object.keys(this.attributes)){if(f9t.test(i))throw new Ht("Invalid attribute name '"+i+"'");r+=" "+i+'="'+_o(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class z3{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,t8e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return r8e.call(this,"span")}toMarkup(){return n8e.call(this,"span")}}let mN=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,t8e.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 r8e.call(this,"a")}toMarkup(){return n8e.call(this,"a")}};class p9t{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=''+_o(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Kp(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:"+Yt(this.italic)+";"),n+=XQ(this.style),n&&(e=!0,r+=' style="'+_o(n)+'"');var i=_o(this.text);return e?(r+=">",r+=i,r+="",r):i}}class jf{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 Bq{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 v9t=t=>t instanceof z3||t instanceof mN||t instanceof F3,qh={"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]}},NA={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]},Bhe={Å:"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 i8e(t,e){qh[t]=e}function KQ(t,e,r){if(!qh[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=qh[e][n];if(!i&&t[0]in Bhe&&(n=Bhe[t[0]].charCodeAt(0),i=qh[e][n]),!i&&r==="text"&&JAe(n)&&(i=qh[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var BB={};function b9t(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!BB[e]){var r=BB[e]={cssEmPerMu:NA.quad[e]/18};for(var n in NA)NA.hasOwnProperty(n)&&(r[n]=NA[n][e])}return BB[e]}var ea={math:{},text:{}};function U(t,e,r,n,i,a){ea[t][i]={font:e,group:r,replace:n},a&&n&&(ea[t][n]=ea[t][i])}var ne="math",Lt="text",be="main",Ge="ams",na="accent-token",or="bin",Sl="close",H3="inner",Dr="mathord",ns="op-token",Ic="open",ME="punct",Xe="rel",p0="spacing",Ze="textord";U(ne,be,Xe,"≡","\\equiv",!0);U(ne,be,Xe,"≺","\\prec",!0);U(ne,be,Xe,"≻","\\succ",!0);U(ne,be,Xe,"∼","\\sim",!0);U(ne,be,Xe,"⊥","\\perp");U(ne,be,Xe,"⪯","\\preceq",!0);U(ne,be,Xe,"⪰","\\succeq",!0);U(ne,be,Xe,"≃","\\simeq",!0);U(ne,be,Xe,"∣","\\mid",!0);U(ne,be,Xe,"≪","\\ll",!0);U(ne,be,Xe,"≫","\\gg",!0);U(ne,be,Xe,"≍","\\asymp",!0);U(ne,be,Xe,"∥","\\parallel");U(ne,be,Xe,"⋈","\\bowtie",!0);U(ne,be,Xe,"⌣","\\smile",!0);U(ne,be,Xe,"⊑","\\sqsubseteq",!0);U(ne,be,Xe,"⊒","\\sqsupseteq",!0);U(ne,be,Xe,"≐","\\doteq",!0);U(ne,be,Xe,"⌢","\\frown",!0);U(ne,be,Xe,"∋","\\ni",!0);U(ne,be,Xe,"∝","\\propto",!0);U(ne,be,Xe,"⊢","\\vdash",!0);U(ne,be,Xe,"⊣","\\dashv",!0);U(ne,be,Xe,"∋","\\owns");U(ne,be,ME,".","\\ldotp");U(ne,be,ME,"⋅","\\cdotp");U(ne,be,ME,"⋅","·");U(Lt,be,Ze,"⋅","·");U(ne,be,Ze,"#","\\#");U(Lt,be,Ze,"#","\\#");U(ne,be,Ze,"&","\\&");U(Lt,be,Ze,"&","\\&");U(ne,be,Ze,"ℵ","\\aleph",!0);U(ne,be,Ze,"∀","\\forall",!0);U(ne,be,Ze,"ℏ","\\hbar",!0);U(ne,be,Ze,"∃","\\exists",!0);U(ne,be,Ze,"∇","\\nabla",!0);U(ne,be,Ze,"♭","\\flat",!0);U(ne,be,Ze,"ℓ","\\ell",!0);U(ne,be,Ze,"♮","\\natural",!0);U(ne,be,Ze,"♣","\\clubsuit",!0);U(ne,be,Ze,"℘","\\wp",!0);U(ne,be,Ze,"♯","\\sharp",!0);U(ne,be,Ze,"♢","\\diamondsuit",!0);U(ne,be,Ze,"ℜ","\\Re",!0);U(ne,be,Ze,"♡","\\heartsuit",!0);U(ne,be,Ze,"ℑ","\\Im",!0);U(ne,be,Ze,"♠","\\spadesuit",!0);U(ne,be,Ze,"§","\\S",!0);U(Lt,be,Ze,"§","\\S");U(ne,be,Ze,"¶","\\P",!0);U(Lt,be,Ze,"¶","\\P");U(ne,be,Ze,"†","\\dag");U(Lt,be,Ze,"†","\\dag");U(Lt,be,Ze,"†","\\textdagger");U(ne,be,Ze,"‡","\\ddag");U(Lt,be,Ze,"‡","\\ddag");U(Lt,be,Ze,"‡","\\textdaggerdbl");U(ne,be,Sl,"⎱","\\rmoustache",!0);U(ne,be,Ic,"⎰","\\lmoustache",!0);U(ne,be,Sl,"⟯","\\rgroup",!0);U(ne,be,Ic,"⟮","\\lgroup",!0);U(ne,be,or,"∓","\\mp",!0);U(ne,be,or,"⊖","\\ominus",!0);U(ne,be,or,"⊎","\\uplus",!0);U(ne,be,or,"⊓","\\sqcap",!0);U(ne,be,or,"∗","\\ast");U(ne,be,or,"⊔","\\sqcup",!0);U(ne,be,or,"◯","\\bigcirc",!0);U(ne,be,or,"∙","\\bullet",!0);U(ne,be,or,"‡","\\ddagger");U(ne,be,or,"≀","\\wr",!0);U(ne,be,or,"⨿","\\amalg");U(ne,be,or,"&","\\And");U(ne,be,Xe,"⟵","\\longleftarrow",!0);U(ne,be,Xe,"⇐","\\Leftarrow",!0);U(ne,be,Xe,"⟸","\\Longleftarrow",!0);U(ne,be,Xe,"⟶","\\longrightarrow",!0);U(ne,be,Xe,"⇒","\\Rightarrow",!0);U(ne,be,Xe,"⟹","\\Longrightarrow",!0);U(ne,be,Xe,"↔","\\leftrightarrow",!0);U(ne,be,Xe,"⟷","\\longleftrightarrow",!0);U(ne,be,Xe,"⇔","\\Leftrightarrow",!0);U(ne,be,Xe,"⟺","\\Longleftrightarrow",!0);U(ne,be,Xe,"↦","\\mapsto",!0);U(ne,be,Xe,"⟼","\\longmapsto",!0);U(ne,be,Xe,"↗","\\nearrow",!0);U(ne,be,Xe,"↩","\\hookleftarrow",!0);U(ne,be,Xe,"↪","\\hookrightarrow",!0);U(ne,be,Xe,"↘","\\searrow",!0);U(ne,be,Xe,"↼","\\leftharpoonup",!0);U(ne,be,Xe,"⇀","\\rightharpoonup",!0);U(ne,be,Xe,"↙","\\swarrow",!0);U(ne,be,Xe,"↽","\\leftharpoondown",!0);U(ne,be,Xe,"⇁","\\rightharpoondown",!0);U(ne,be,Xe,"↖","\\nwarrow",!0);U(ne,be,Xe,"⇌","\\rightleftharpoons",!0);U(ne,Ge,Xe,"≮","\\nless",!0);U(ne,Ge,Xe,"","\\@nleqslant");U(ne,Ge,Xe,"","\\@nleqq");U(ne,Ge,Xe,"⪇","\\lneq",!0);U(ne,Ge,Xe,"≨","\\lneqq",!0);U(ne,Ge,Xe,"","\\@lvertneqq");U(ne,Ge,Xe,"⋦","\\lnsim",!0);U(ne,Ge,Xe,"⪉","\\lnapprox",!0);U(ne,Ge,Xe,"⊀","\\nprec",!0);U(ne,Ge,Xe,"⋠","\\npreceq",!0);U(ne,Ge,Xe,"⋨","\\precnsim",!0);U(ne,Ge,Xe,"⪹","\\precnapprox",!0);U(ne,Ge,Xe,"≁","\\nsim",!0);U(ne,Ge,Xe,"","\\@nshortmid");U(ne,Ge,Xe,"∤","\\nmid",!0);U(ne,Ge,Xe,"⊬","\\nvdash",!0);U(ne,Ge,Xe,"⊭","\\nvDash",!0);U(ne,Ge,Xe,"⋪","\\ntriangleleft");U(ne,Ge,Xe,"⋬","\\ntrianglelefteq",!0);U(ne,Ge,Xe,"⊊","\\subsetneq",!0);U(ne,Ge,Xe,"","\\@varsubsetneq");U(ne,Ge,Xe,"⫋","\\subsetneqq",!0);U(ne,Ge,Xe,"","\\@varsubsetneqq");U(ne,Ge,Xe,"≯","\\ngtr",!0);U(ne,Ge,Xe,"","\\@ngeqslant");U(ne,Ge,Xe,"","\\@ngeqq");U(ne,Ge,Xe,"⪈","\\gneq",!0);U(ne,Ge,Xe,"≩","\\gneqq",!0);U(ne,Ge,Xe,"","\\@gvertneqq");U(ne,Ge,Xe,"⋧","\\gnsim",!0);U(ne,Ge,Xe,"⪊","\\gnapprox",!0);U(ne,Ge,Xe,"⊁","\\nsucc",!0);U(ne,Ge,Xe,"⋡","\\nsucceq",!0);U(ne,Ge,Xe,"⋩","\\succnsim",!0);U(ne,Ge,Xe,"⪺","\\succnapprox",!0);U(ne,Ge,Xe,"≆","\\ncong",!0);U(ne,Ge,Xe,"","\\@nshortparallel");U(ne,Ge,Xe,"∦","\\nparallel",!0);U(ne,Ge,Xe,"⊯","\\nVDash",!0);U(ne,Ge,Xe,"⋫","\\ntriangleright");U(ne,Ge,Xe,"⋭","\\ntrianglerighteq",!0);U(ne,Ge,Xe,"","\\@nsupseteqq");U(ne,Ge,Xe,"⊋","\\supsetneq",!0);U(ne,Ge,Xe,"","\\@varsupsetneq");U(ne,Ge,Xe,"⫌","\\supsetneqq",!0);U(ne,Ge,Xe,"","\\@varsupsetneqq");U(ne,Ge,Xe,"⊮","\\nVdash",!0);U(ne,Ge,Xe,"⪵","\\precneqq",!0);U(ne,Ge,Xe,"⪶","\\succneqq",!0);U(ne,Ge,Xe,"","\\@nsubseteqq");U(ne,Ge,or,"⊴","\\unlhd");U(ne,Ge,or,"⊵","\\unrhd");U(ne,Ge,Xe,"↚","\\nleftarrow",!0);U(ne,Ge,Xe,"↛","\\nrightarrow",!0);U(ne,Ge,Xe,"⇍","\\nLeftarrow",!0);U(ne,Ge,Xe,"⇏","\\nRightarrow",!0);U(ne,Ge,Xe,"↮","\\nleftrightarrow",!0);U(ne,Ge,Xe,"⇎","\\nLeftrightarrow",!0);U(ne,Ge,Xe,"△","\\vartriangle");U(ne,Ge,Ze,"ℏ","\\hslash");U(ne,Ge,Ze,"▽","\\triangledown");U(ne,Ge,Ze,"◊","\\lozenge");U(ne,Ge,Ze,"Ⓢ","\\circledS");U(ne,Ge,Ze,"®","\\circledR");U(Lt,Ge,Ze,"®","\\circledR");U(ne,Ge,Ze,"∡","\\measuredangle",!0);U(ne,Ge,Ze,"∄","\\nexists");U(ne,Ge,Ze,"℧","\\mho");U(ne,Ge,Ze,"Ⅎ","\\Finv",!0);U(ne,Ge,Ze,"⅁","\\Game",!0);U(ne,Ge,Ze,"‵","\\backprime");U(ne,Ge,Ze,"▲","\\blacktriangle");U(ne,Ge,Ze,"▼","\\blacktriangledown");U(ne,Ge,Ze,"■","\\blacksquare");U(ne,Ge,Ze,"⧫","\\blacklozenge");U(ne,Ge,Ze,"★","\\bigstar");U(ne,Ge,Ze,"∢","\\sphericalangle",!0);U(ne,Ge,Ze,"∁","\\complement",!0);U(ne,Ge,Ze,"ð","\\eth",!0);U(Lt,be,Ze,"ð","ð");U(ne,Ge,Ze,"╱","\\diagup");U(ne,Ge,Ze,"╲","\\diagdown");U(ne,Ge,Ze,"□","\\square");U(ne,Ge,Ze,"□","\\Box");U(ne,Ge,Ze,"◊","\\Diamond");U(ne,Ge,Ze,"¥","\\yen",!0);U(Lt,Ge,Ze,"¥","\\yen",!0);U(ne,Ge,Ze,"✓","\\checkmark",!0);U(Lt,Ge,Ze,"✓","\\checkmark");U(ne,Ge,Ze,"ℶ","\\beth",!0);U(ne,Ge,Ze,"ℸ","\\daleth",!0);U(ne,Ge,Ze,"ℷ","\\gimel",!0);U(ne,Ge,Ze,"ϝ","\\digamma",!0);U(ne,Ge,Ze,"ϰ","\\varkappa");U(ne,Ge,Ic,"┌","\\@ulcorner",!0);U(ne,Ge,Sl,"┐","\\@urcorner",!0);U(ne,Ge,Ic,"└","\\@llcorner",!0);U(ne,Ge,Sl,"┘","\\@lrcorner",!0);U(ne,Ge,Xe,"≦","\\leqq",!0);U(ne,Ge,Xe,"⩽","\\leqslant",!0);U(ne,Ge,Xe,"⪕","\\eqslantless",!0);U(ne,Ge,Xe,"≲","\\lesssim",!0);U(ne,Ge,Xe,"⪅","\\lessapprox",!0);U(ne,Ge,Xe,"≊","\\approxeq",!0);U(ne,Ge,or,"⋖","\\lessdot");U(ne,Ge,Xe,"⋘","\\lll",!0);U(ne,Ge,Xe,"≶","\\lessgtr",!0);U(ne,Ge,Xe,"⋚","\\lesseqgtr",!0);U(ne,Ge,Xe,"⪋","\\lesseqqgtr",!0);U(ne,Ge,Xe,"≑","\\doteqdot");U(ne,Ge,Xe,"≓","\\risingdotseq",!0);U(ne,Ge,Xe,"≒","\\fallingdotseq",!0);U(ne,Ge,Xe,"∽","\\backsim",!0);U(ne,Ge,Xe,"⋍","\\backsimeq",!0);U(ne,Ge,Xe,"⫅","\\subseteqq",!0);U(ne,Ge,Xe,"⋐","\\Subset",!0);U(ne,Ge,Xe,"⊏","\\sqsubset",!0);U(ne,Ge,Xe,"≼","\\preccurlyeq",!0);U(ne,Ge,Xe,"⋞","\\curlyeqprec",!0);U(ne,Ge,Xe,"≾","\\precsim",!0);U(ne,Ge,Xe,"⪷","\\precapprox",!0);U(ne,Ge,Xe,"⊲","\\vartriangleleft");U(ne,Ge,Xe,"⊴","\\trianglelefteq");U(ne,Ge,Xe,"⊨","\\vDash",!0);U(ne,Ge,Xe,"⊪","\\Vvdash",!0);U(ne,Ge,Xe,"⌣","\\smallsmile");U(ne,Ge,Xe,"⌢","\\smallfrown");U(ne,Ge,Xe,"≏","\\bumpeq",!0);U(ne,Ge,Xe,"≎","\\Bumpeq",!0);U(ne,Ge,Xe,"≧","\\geqq",!0);U(ne,Ge,Xe,"⩾","\\geqslant",!0);U(ne,Ge,Xe,"⪖","\\eqslantgtr",!0);U(ne,Ge,Xe,"≳","\\gtrsim",!0);U(ne,Ge,Xe,"⪆","\\gtrapprox",!0);U(ne,Ge,or,"⋗","\\gtrdot");U(ne,Ge,Xe,"⋙","\\ggg",!0);U(ne,Ge,Xe,"≷","\\gtrless",!0);U(ne,Ge,Xe,"⋛","\\gtreqless",!0);U(ne,Ge,Xe,"⪌","\\gtreqqless",!0);U(ne,Ge,Xe,"≖","\\eqcirc",!0);U(ne,Ge,Xe,"≗","\\circeq",!0);U(ne,Ge,Xe,"≜","\\triangleq",!0);U(ne,Ge,Xe,"∼","\\thicksim");U(ne,Ge,Xe,"≈","\\thickapprox");U(ne,Ge,Xe,"⫆","\\supseteqq",!0);U(ne,Ge,Xe,"⋑","\\Supset",!0);U(ne,Ge,Xe,"⊐","\\sqsupset",!0);U(ne,Ge,Xe,"≽","\\succcurlyeq",!0);U(ne,Ge,Xe,"⋟","\\curlyeqsucc",!0);U(ne,Ge,Xe,"≿","\\succsim",!0);U(ne,Ge,Xe,"⪸","\\succapprox",!0);U(ne,Ge,Xe,"⊳","\\vartriangleright");U(ne,Ge,Xe,"⊵","\\trianglerighteq");U(ne,Ge,Xe,"⊩","\\Vdash",!0);U(ne,Ge,Xe,"∣","\\shortmid");U(ne,Ge,Xe,"∥","\\shortparallel");U(ne,Ge,Xe,"≬","\\between",!0);U(ne,Ge,Xe,"⋔","\\pitchfork",!0);U(ne,Ge,Xe,"∝","\\varpropto");U(ne,Ge,Xe,"◀","\\blacktriangleleft");U(ne,Ge,Xe,"∴","\\therefore",!0);U(ne,Ge,Xe,"∍","\\backepsilon");U(ne,Ge,Xe,"▶","\\blacktriangleright");U(ne,Ge,Xe,"∵","\\because",!0);U(ne,Ge,Xe,"⋘","\\llless");U(ne,Ge,Xe,"⋙","\\gggtr");U(ne,Ge,or,"⊲","\\lhd");U(ne,Ge,or,"⊳","\\rhd");U(ne,Ge,Xe,"≂","\\eqsim",!0);U(ne,be,Xe,"⋈","\\Join");U(ne,Ge,Xe,"≑","\\Doteq",!0);U(ne,Ge,or,"∔","\\dotplus",!0);U(ne,Ge,or,"∖","\\smallsetminus");U(ne,Ge,or,"⋒","\\Cap",!0);U(ne,Ge,or,"⋓","\\Cup",!0);U(ne,Ge,or,"⩞","\\doublebarwedge",!0);U(ne,Ge,or,"⊟","\\boxminus",!0);U(ne,Ge,or,"⊞","\\boxplus",!0);U(ne,Ge,or,"⋇","\\divideontimes",!0);U(ne,Ge,or,"⋉","\\ltimes",!0);U(ne,Ge,or,"⋊","\\rtimes",!0);U(ne,Ge,or,"⋋","\\leftthreetimes",!0);U(ne,Ge,or,"⋌","\\rightthreetimes",!0);U(ne,Ge,or,"⋏","\\curlywedge",!0);U(ne,Ge,or,"⋎","\\curlyvee",!0);U(ne,Ge,or,"⊝","\\circleddash",!0);U(ne,Ge,or,"⊛","\\circledast",!0);U(ne,Ge,or,"⋅","\\centerdot");U(ne,Ge,or,"⊺","\\intercal",!0);U(ne,Ge,or,"⋒","\\doublecap");U(ne,Ge,or,"⋓","\\doublecup");U(ne,Ge,or,"⊠","\\boxtimes",!0);U(ne,Ge,Xe,"⇢","\\dashrightarrow",!0);U(ne,Ge,Xe,"⇠","\\dashleftarrow",!0);U(ne,Ge,Xe,"⇇","\\leftleftarrows",!0);U(ne,Ge,Xe,"⇆","\\leftrightarrows",!0);U(ne,Ge,Xe,"⇚","\\Lleftarrow",!0);U(ne,Ge,Xe,"↞","\\twoheadleftarrow",!0);U(ne,Ge,Xe,"↢","\\leftarrowtail",!0);U(ne,Ge,Xe,"↫","\\looparrowleft",!0);U(ne,Ge,Xe,"⇋","\\leftrightharpoons",!0);U(ne,Ge,Xe,"↶","\\curvearrowleft",!0);U(ne,Ge,Xe,"↺","\\circlearrowleft",!0);U(ne,Ge,Xe,"↰","\\Lsh",!0);U(ne,Ge,Xe,"⇈","\\upuparrows",!0);U(ne,Ge,Xe,"↿","\\upharpoonleft",!0);U(ne,Ge,Xe,"⇃","\\downharpoonleft",!0);U(ne,be,Xe,"⊶","\\origof",!0);U(ne,be,Xe,"⊷","\\imageof",!0);U(ne,Ge,Xe,"⊸","\\multimap",!0);U(ne,Ge,Xe,"↭","\\leftrightsquigarrow",!0);U(ne,Ge,Xe,"⇉","\\rightrightarrows",!0);U(ne,Ge,Xe,"⇄","\\rightleftarrows",!0);U(ne,Ge,Xe,"↠","\\twoheadrightarrow",!0);U(ne,Ge,Xe,"↣","\\rightarrowtail",!0);U(ne,Ge,Xe,"↬","\\looparrowright",!0);U(ne,Ge,Xe,"↷","\\curvearrowright",!0);U(ne,Ge,Xe,"↻","\\circlearrowright",!0);U(ne,Ge,Xe,"↱","\\Rsh",!0);U(ne,Ge,Xe,"⇊","\\downdownarrows",!0);U(ne,Ge,Xe,"↾","\\upharpoonright",!0);U(ne,Ge,Xe,"⇂","\\downharpoonright",!0);U(ne,Ge,Xe,"⇝","\\rightsquigarrow",!0);U(ne,Ge,Xe,"⇝","\\leadsto");U(ne,Ge,Xe,"⇛","\\Rrightarrow",!0);U(ne,Ge,Xe,"↾","\\restriction");U(ne,be,Ze,"‘","`");U(ne,be,Ze,"$","\\$");U(Lt,be,Ze,"$","\\$");U(Lt,be,Ze,"$","\\textdollar");U(ne,be,Ze,"%","\\%");U(Lt,be,Ze,"%","\\%");U(ne,be,Ze,"_","\\_");U(Lt,be,Ze,"_","\\_");U(Lt,be,Ze,"_","\\textunderscore");U(ne,be,Ze,"∠","\\angle",!0);U(ne,be,Ze,"∞","\\infty",!0);U(ne,be,Ze,"′","\\prime");U(ne,be,Ze,"△","\\triangle");U(ne,be,Ze,"Γ","\\Gamma",!0);U(ne,be,Ze,"Δ","\\Delta",!0);U(ne,be,Ze,"Θ","\\Theta",!0);U(ne,be,Ze,"Λ","\\Lambda",!0);U(ne,be,Ze,"Ξ","\\Xi",!0);U(ne,be,Ze,"Π","\\Pi",!0);U(ne,be,Ze,"Σ","\\Sigma",!0);U(ne,be,Ze,"Υ","\\Upsilon",!0);U(ne,be,Ze,"Φ","\\Phi",!0);U(ne,be,Ze,"Ψ","\\Psi",!0);U(ne,be,Ze,"Ω","\\Omega",!0);U(ne,be,Ze,"A","Α");U(ne,be,Ze,"B","Β");U(ne,be,Ze,"E","Ε");U(ne,be,Ze,"Z","Ζ");U(ne,be,Ze,"H","Η");U(ne,be,Ze,"I","Ι");U(ne,be,Ze,"K","Κ");U(ne,be,Ze,"M","Μ");U(ne,be,Ze,"N","Ν");U(ne,be,Ze,"O","Ο");U(ne,be,Ze,"P","Ρ");U(ne,be,Ze,"T","Τ");U(ne,be,Ze,"X","Χ");U(ne,be,Ze,"¬","\\neg",!0);U(ne,be,Ze,"¬","\\lnot");U(ne,be,Ze,"⊤","\\top");U(ne,be,Ze,"⊥","\\bot");U(ne,be,Ze,"∅","\\emptyset");U(ne,Ge,Ze,"∅","\\varnothing");U(ne,be,Dr,"α","\\alpha",!0);U(ne,be,Dr,"β","\\beta",!0);U(ne,be,Dr,"γ","\\gamma",!0);U(ne,be,Dr,"δ","\\delta",!0);U(ne,be,Dr,"ϵ","\\epsilon",!0);U(ne,be,Dr,"ζ","\\zeta",!0);U(ne,be,Dr,"η","\\eta",!0);U(ne,be,Dr,"θ","\\theta",!0);U(ne,be,Dr,"ι","\\iota",!0);U(ne,be,Dr,"κ","\\kappa",!0);U(ne,be,Dr,"λ","\\lambda",!0);U(ne,be,Dr,"μ","\\mu",!0);U(ne,be,Dr,"ν","\\nu",!0);U(ne,be,Dr,"ξ","\\xi",!0);U(ne,be,Dr,"ο","\\omicron",!0);U(ne,be,Dr,"π","\\pi",!0);U(ne,be,Dr,"ρ","\\rho",!0);U(ne,be,Dr,"σ","\\sigma",!0);U(ne,be,Dr,"τ","\\tau",!0);U(ne,be,Dr,"υ","\\upsilon",!0);U(ne,be,Dr,"ϕ","\\phi",!0);U(ne,be,Dr,"χ","\\chi",!0);U(ne,be,Dr,"ψ","\\psi",!0);U(ne,be,Dr,"ω","\\omega",!0);U(ne,be,Dr,"ε","\\varepsilon",!0);U(ne,be,Dr,"ϑ","\\vartheta",!0);U(ne,be,Dr,"ϖ","\\varpi",!0);U(ne,be,Dr,"ϱ","\\varrho",!0);U(ne,be,Dr,"ς","\\varsigma",!0);U(ne,be,Dr,"φ","\\varphi",!0);U(ne,be,or,"∗","*",!0);U(ne,be,or,"+","+");U(ne,be,or,"−","-",!0);U(ne,be,or,"⋅","\\cdot",!0);U(ne,be,or,"∘","\\circ",!0);U(ne,be,or,"÷","\\div",!0);U(ne,be,or,"±","\\pm",!0);U(ne,be,or,"×","\\times",!0);U(ne,be,or,"∩","\\cap",!0);U(ne,be,or,"∪","\\cup",!0);U(ne,be,or,"∖","\\setminus",!0);U(ne,be,or,"∧","\\land");U(ne,be,or,"∨","\\lor");U(ne,be,or,"∧","\\wedge",!0);U(ne,be,or,"∨","\\vee",!0);U(ne,be,Ze,"√","\\surd");U(ne,be,Ic,"⟨","\\langle",!0);U(ne,be,Ic,"∣","\\lvert");U(ne,be,Ic,"∥","\\lVert");U(ne,be,Sl,"?","?");U(ne,be,Sl,"!","!");U(ne,be,Sl,"⟩","\\rangle",!0);U(ne,be,Sl,"∣","\\rvert");U(ne,be,Sl,"∥","\\rVert");U(ne,be,Xe,"=","=");U(ne,be,Xe,":",":");U(ne,be,Xe,"≈","\\approx",!0);U(ne,be,Xe,"≅","\\cong",!0);U(ne,be,Xe,"≥","\\ge");U(ne,be,Xe,"≥","\\geq",!0);U(ne,be,Xe,"←","\\gets");U(ne,be,Xe,">","\\gt",!0);U(ne,be,Xe,"∈","\\in",!0);U(ne,be,Xe,"","\\@not");U(ne,be,Xe,"⊂","\\subset",!0);U(ne,be,Xe,"⊃","\\supset",!0);U(ne,be,Xe,"⊆","\\subseteq",!0);U(ne,be,Xe,"⊇","\\supseteq",!0);U(ne,Ge,Xe,"⊈","\\nsubseteq",!0);U(ne,Ge,Xe,"⊉","\\nsupseteq",!0);U(ne,be,Xe,"⊨","\\models");U(ne,be,Xe,"←","\\leftarrow",!0);U(ne,be,Xe,"≤","\\le");U(ne,be,Xe,"≤","\\leq",!0);U(ne,be,Xe,"<","\\lt",!0);U(ne,be,Xe,"→","\\rightarrow",!0);U(ne,be,Xe,"→","\\to");U(ne,Ge,Xe,"≱","\\ngeq",!0);U(ne,Ge,Xe,"≰","\\nleq",!0);U(ne,be,p0," ","\\ ");U(ne,be,p0," ","\\space");U(ne,be,p0," ","\\nobreakspace");U(Lt,be,p0," ","\\ ");U(Lt,be,p0," "," ");U(Lt,be,p0," ","\\space");U(Lt,be,p0," ","\\nobreakspace");U(ne,be,p0,"","\\nobreak");U(ne,be,p0,"","\\allowbreak");U(ne,be,ME,",",",");U(ne,be,ME,";",";");U(ne,Ge,or,"⊼","\\barwedge",!0);U(ne,Ge,or,"⊻","\\veebar",!0);U(ne,be,or,"⊙","\\odot",!0);U(ne,be,or,"⊕","\\oplus",!0);U(ne,be,or,"⊗","\\otimes",!0);U(ne,be,Ze,"∂","\\partial",!0);U(ne,be,or,"⊘","\\oslash",!0);U(ne,Ge,or,"⊚","\\circledcirc",!0);U(ne,Ge,or,"⊡","\\boxdot",!0);U(ne,be,or,"△","\\bigtriangleup");U(ne,be,or,"▽","\\bigtriangledown");U(ne,be,or,"†","\\dagger");U(ne,be,or,"⋄","\\diamond");U(ne,be,or,"⋆","\\star");U(ne,be,or,"◃","\\triangleleft");U(ne,be,or,"▹","\\triangleright");U(ne,be,Ic,"{","\\{");U(Lt,be,Ze,"{","\\{");U(Lt,be,Ze,"{","\\textbraceleft");U(ne,be,Sl,"}","\\}");U(Lt,be,Ze,"}","\\}");U(Lt,be,Ze,"}","\\textbraceright");U(ne,be,Ic,"{","\\lbrace");U(ne,be,Sl,"}","\\rbrace");U(ne,be,Ic,"[","\\lbrack",!0);U(Lt,be,Ze,"[","\\lbrack",!0);U(ne,be,Sl,"]","\\rbrack",!0);U(Lt,be,Ze,"]","\\rbrack",!0);U(ne,be,Ic,"(","\\lparen",!0);U(ne,be,Sl,")","\\rparen",!0);U(Lt,be,Ze,"<","\\textless",!0);U(Lt,be,Ze,">","\\textgreater",!0);U(ne,be,Ic,"⌊","\\lfloor",!0);U(ne,be,Sl,"⌋","\\rfloor",!0);U(ne,be,Ic,"⌈","\\lceil",!0);U(ne,be,Sl,"⌉","\\rceil",!0);U(ne,be,Ze,"\\","\\backslash");U(ne,be,Ze,"∣","|");U(ne,be,Ze,"∣","\\vert");U(Lt,be,Ze,"|","\\textbar",!0);U(ne,be,Ze,"∥","\\|");U(ne,be,Ze,"∥","\\Vert");U(Lt,be,Ze,"∥","\\textbardbl");U(Lt,be,Ze,"~","\\textasciitilde");U(Lt,be,Ze,"\\","\\textbackslash");U(Lt,be,Ze,"^","\\textasciicircum");U(ne,be,Xe,"↑","\\uparrow",!0);U(ne,be,Xe,"⇑","\\Uparrow",!0);U(ne,be,Xe,"↓","\\downarrow",!0);U(ne,be,Xe,"⇓","\\Downarrow",!0);U(ne,be,Xe,"↕","\\updownarrow",!0);U(ne,be,Xe,"⇕","\\Updownarrow",!0);U(ne,be,ns,"∐","\\coprod");U(ne,be,ns,"⋁","\\bigvee");U(ne,be,ns,"⋀","\\bigwedge");U(ne,be,ns,"⨄","\\biguplus");U(ne,be,ns,"⋂","\\bigcap");U(ne,be,ns,"⋃","\\bigcup");U(ne,be,ns,"∫","\\int");U(ne,be,ns,"∫","\\intop");U(ne,be,ns,"∬","\\iint");U(ne,be,ns,"∭","\\iiint");U(ne,be,ns,"∏","\\prod");U(ne,be,ns,"∑","\\sum");U(ne,be,ns,"⨂","\\bigotimes");U(ne,be,ns,"⨁","\\bigoplus");U(ne,be,ns,"⨀","\\bigodot");U(ne,be,ns,"∮","\\oint");U(ne,be,ns,"∯","\\oiint");U(ne,be,ns,"∰","\\oiiint");U(ne,be,ns,"⨆","\\bigsqcup");U(ne,be,ns,"∫","\\smallint");U(Lt,be,H3,"…","\\textellipsis");U(ne,be,H3,"…","\\mathellipsis");U(Lt,be,H3,"…","\\ldots",!0);U(ne,be,H3,"…","\\ldots",!0);U(ne,be,H3,"⋯","\\@cdots",!0);U(ne,be,H3,"⋱","\\ddots",!0);U(ne,be,Ze,"⋮","\\varvdots");U(Lt,be,Ze,"⋮","\\varvdots");U(ne,be,na,"ˊ","\\acute");U(ne,be,na,"ˋ","\\grave");U(ne,be,na,"¨","\\ddot");U(ne,be,na,"~","\\tilde");U(ne,be,na,"ˉ","\\bar");U(ne,be,na,"˘","\\breve");U(ne,be,na,"ˇ","\\check");U(ne,be,na,"^","\\hat");U(ne,be,na,"⃗","\\vec");U(ne,be,na,"˙","\\dot");U(ne,be,na,"˚","\\mathring");U(ne,be,Dr,"","\\@imath");U(ne,be,Dr,"","\\@jmath");U(ne,be,Ze,"ı","ı");U(ne,be,Ze,"ȷ","ȷ");U(Lt,be,Ze,"ı","\\i",!0);U(Lt,be,Ze,"ȷ","\\j",!0);U(Lt,be,Ze,"ß","\\ss",!0);U(Lt,be,Ze,"æ","\\ae",!0);U(Lt,be,Ze,"œ","\\oe",!0);U(Lt,be,Ze,"ø","\\o",!0);U(Lt,be,Ze,"Æ","\\AE",!0);U(Lt,be,Ze,"Œ","\\OE",!0);U(Lt,be,Ze,"Ø","\\O",!0);U(Lt,be,na,"ˊ","\\'");U(Lt,be,na,"ˋ","\\`");U(Lt,be,na,"ˆ","\\^");U(Lt,be,na,"˜","\\~");U(Lt,be,na,"ˉ","\\=");U(Lt,be,na,"˘","\\u");U(Lt,be,na,"˙","\\.");U(Lt,be,na,"¸","\\c");U(Lt,be,na,"˚","\\r");U(Lt,be,na,"ˇ","\\v");U(Lt,be,na,"¨",'\\"');U(Lt,be,na,"˝","\\H");U(Lt,be,na,"◯","\\textcircled");var a8e={"--":!0,"---":!0,"``":!0,"''":!0};U(Lt,be,Ze,"–","--",!0);U(Lt,be,Ze,"–","\\textendash");U(Lt,be,Ze,"—","---",!0);U(Lt,be,Ze,"—","\\textemdash");U(Lt,be,Ze,"‘","`",!0);U(Lt,be,Ze,"‘","\\textquoteleft");U(Lt,be,Ze,"’","'",!0);U(Lt,be,Ze,"’","\\textquoteright");U(Lt,be,Ze,"“","``",!0);U(Lt,be,Ze,"“","\\textquotedblleft");U(Lt,be,Ze,"”","''",!0);U(Lt,be,Ze,"”","\\textquotedblright");U(ne,be,Ze,"°","\\degree",!0);U(Lt,be,Ze,"°","\\degree");U(Lt,be,Ze,"°","\\textdegree",!0);U(ne,be,Ze,"£","\\pounds");U(ne,be,Ze,"£","\\mathsterling",!0);U(Lt,be,Ze,"£","\\pounds");U(Lt,be,Ze,"£","\\textsterling",!0);U(ne,Ge,Ze,"✠","\\maltese");U(Lt,Ge,Ze,"✠","\\maltese");var Fhe='0123456789/@."';for(var FB=0;FB{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 Xhe[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return w9t[a]}else{if(n===120485||n===120486)return Xhe[0];if(120486{if(Kp(t.classes)!==Kp(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},s8e=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},Ot=function(e,r,n,i){var a=new z3(e,r,n,i);return QQ(a),a},Qp=(t,e,r,n)=>new z3(t,e,r,n),GT=function(e,r,n){var i=Ot([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Yt(i.height),i.maxFontSize=1,i},S9t=function(e,r,n,i){var a=new mN(e,r,n,i);return QQ(a),a},g0=function(e){var r=new F3(e);return QQ(r),r},UT=function(e,r){return e instanceof F3?Ot([],[e],r):e},E9t=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=Ot(["mspace"],[],e),n=la(t,e);return r.style.marginRight=Yt(n),r},PA=(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},qq={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"}},l8e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},c8e=function(e,r){var[n,i,a]=l8e[e],s=new Zp(n),o=new jf([s],{width:Yt(i),height:Yt(a),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Qp(["overlay"],[o],r);return l.height=a,l.style.height=Yt(a),l.style.width=Yt(i),l},sa={number:3,unit:"mu"},Xg={number:4,unit:"mu"},Gd={number:5,unit:"mu"},A9t={mord:{mop:sa,mbin:Xg,mrel:Gd,minner:sa},mop:{mord:sa,mop:sa,mrel:Gd,minner:sa},mbin:{mord:Xg,mop:Xg,mopen:Xg,minner:Xg},mrel:{mord:Gd,mop:Gd,mopen:Gd,minner:Gd},mopen:{},mclose:{mop:sa,mbin:Xg,mrel:Gd,minner:sa},mpunct:{mord:sa,mop:sa,mrel:Gd,mopen:sa,mclose:sa,mpunct:sa,minner:sa},minner:{mord:sa,mop:sa,mbin:Xg,mrel:Gd,mopen:sa,mpunct:sa,minner:sa}},R9t={mord:{mop:sa},mop:{mord:sa,mop:sa},mbin:{},mrel:{},mopen:{},mclose:{mop:sa},mpunct:{},minner:{mop:sa}},u8e={},pL={},gL={};function rr(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"&&M9t.has(v)?m.classes[0]="mord":v==="mbin"&&_9t.has(y)&&(g.classes[0]="mord")},{node:d},f,p),Gq(a,(g,m)=>{var y,v,x=Yq(m),b=Yq(g),T=x&&b?g.hasClass("mtight")?(y=R9t[x])==null?void 0:y[b]:(v=A9t[x])==null?void 0:v[b]:null;if(T)return o8e(T,u)},{node:d},f,p),a},Gq=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()},h8e=function(e){return e instanceof F3||e instanceof mN||e instanceof z3&&e.hasClass("enclosing")?e:null},Uq=function(e,r){var n=h8e(e);if(n){var i=n.children;if(i.length){if(r==="right")return Uq(i[i.length-1],"right");if(r==="left")return Uq(i[0],"left")}}return e},Yq=function(e,r){if(!e)return null;r&&(e=Uq(e,r));var n=e.classes[0];return I9t[n]||null},a6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ot(r.concat(n))},Qn=function(e,r,n){if(!e)return Ot();if(pL[e.type]){var i=pL[e.type](e,r);if(n&&r.size!==n.size){i=Ot(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Ht("Got group of unknown type: '"+e.type+"'")};function BA(t,e){var r=Ot(["base"],t,e),n=Ot(["strut"]);return n.style.height=Yt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Yt(-r.depth)),r.children.unshift(n),r}function jq(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=vs(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(BA(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(BA(s,e));var u;r?(u=BA(vs(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Ot(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Yt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Yt(-h.depth))}return h}function d8e(t){return new F3(t)}class qt{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=Kp(this.classes));for(var n=0;n0&&(e+=' class ="'+_o(Kp(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Qa{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return _o(this.toText())}toText(){return this.text}}class f8e{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",Yt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var $9t=new Set(["\\imath","\\jmath"]),N9t=new Set(["mrow","mtable"]),du=function(e,r,n){return ea[r][e]&&ea[r][e].replace&&e.charCodeAt(0)!==55349&&!(a8e.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ea[r][e].replace),new Qa(e)},JQ=function(e){return e.length===1?e[0]:new qt("mrow",e)},D9t={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"},eJ=(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=D9t[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if($9t.has(a))return null;if(ea[n][a]){var s=ea[n][a].replace;s&&(a=s)}var o=qq[r].fontName;return KQ(a,o,n)?qq[r].variant:null};function WB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Qa&&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 Qa&&r.text===","}else return!1}var $c=function(e,r,n){if(e.length===1){var i=bi(e[0],r);return n&&i instanceof qt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||WB(s))){var u=l.children[0];u instanceof qt&&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 Qa&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Qa&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Jp=function(e,r,n){return JQ($c(e,r,n))},bi=function(e,r){if(!e)return new qt("mrow");if(gL[e.type])return gL[e.type](e,r);throw new Ht("Got group of unknown type: '"+e.type+"'")};function Khe(t,e,r,n,i){var a=$c(t,r),s;a.length===1&&a[0]instanceof qt&&N9t.has(a[0].type)?s=a[0]:s=new qt("mrow",a);var o=new qt("annotation",[new Qa(e)]);o.setAttribute("encoding","application/x-tex");var l=new qt("semantics",[s,o]),u=new qt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Ot([h],[u])}var O9t=[[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]],Zhe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Qhe=function(e,r){return r.size<2?e:O9t[e-1][r.size-1]};class uf{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||uf.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=Zhe[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 uf(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Qhe(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:Zhe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Qhe(uf.BASESIZE,e);return this.size===r&&this.textSize===uf.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!==uf.BASESIZE?["sizing","reset-size"+this.size,"size"+uf.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=b9t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}uf.BASESIZE=6;var p8e=function(e){return new uf({style:e.displayMode?ln.DISPLAY:ln.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},g8e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Ot(n,[e])}return e},P9t=function(e,r,n){var i=p8e(n),a;if(n.output==="mathml")return Khe(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=jq(e,i);a=Ot(["katex"],[s])}else{var o=Khe(e,r,i,n.displayMode,!1),l=jq(e,i);a=Ot(["katex"],[o,l])}return g8e(a,n)},B9t=function(e,r,n){var i=p8e(n),a=jq(e,i),s=Ot(["katex"],[a]);return g8e(s,n)},F9t={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":"="},bN=function(e){var r=new qt("mo",[new Qa(F9t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},z9t={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]},H9t=new Set(["widehat","widecheck","widetilde","utilde"]),xN=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(H9t.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 Zp(d),m=new jf([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Qp([],[m],r),minWidth:0,height:f}}else{var y=[],v=z9t[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,T]=v,k=T/1e3,S=x.length,C,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],E=[v[3]]}else if(S===2)C=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)C=["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 A=0;A0&&(i.style.minWidth=Yt(a)),i},V9t=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Ot(["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 Bq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new Bq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new jf(u,{width:"100%",height:Yt(o)});s=Qp([],[h],a)}return s.height=o,s.style.height=Yt(o),s},W9t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},q9t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function G9t(t){return t in W9t}function gn(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 wN(t){var e=TN(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 TN(t){return t&&(t.type==="atom"||q9t.hasOwnProperty(t.type))?t:null}var m8e=t=>{if(t instanceof Ec)return t;if(v9t(t)&&t.children.length===1)return m8e(t.children[0])},tJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=gn(t.base,"accent"),r=n.base,t.base=r,i=y9t(Qn(t,e)),t.base=n):(n=gn(t,"accent"),r=n.base);var a=Qn(r,e.havingCrampedStyle()),s=n.isShifty&&f0(r),o=0;if(s){var l,u;o=(l=(u=m8e(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=xN(n,e),f=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Yt(2*o)+")",marginLeft:Yt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=c8e("vec",e),g=l8e.vec[1]):(p=vN({mode:n.mode,text:n.label},e,"textord"),p=m9t(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Ot(["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=Yt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Ot(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},y8e=(t,e)=>{var r=t.isStretchy?bN(t.label):new qt("mo",[du(t.label,t.mode)]),n=new qt("mover",[bi(t.base,e),r]);return n.setAttribute("accent","true"),n},U9t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));rr({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=mL(e[0]),n=!U9t.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:tJ,mathmlBuilder:y8e});rr({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:tJ,mathmlBuilder:y8e});rr({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=Qn(t.base,e),n=xN(t,e),i=t.label==="\\utilde"?.12:0,a=Zn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Ot(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=bN(t.label),n=new qt("munder",[bi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var FA=t=>{var e=new qt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};rr({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=UT(Qn(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=UT(Qn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=xN(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=Zn({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=Zn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ot(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=bN(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=FA(bi(t.body,e));if(t.below){var a=FA(bi(t.below,e));n=new qt("munderover",[r,a,i])}else n=new qt("mover",[r,i])}else if(t.below){var s=FA(bi(t.below,e));n=new qt("munder",[r,s])}else n=FA(),n=new qt("mover",[r,n]);return n}});function v8e(t,e){var r=vs(t.body,e,!0);return Ot([t.mclass],r,e)}function b8e(t,e){var r,n=$c(t.body,e);return t.mclass==="minner"?r=new qt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new qt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new qt("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}rr({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:Za(i),isCharacterBox:f0(i)}},htmlBuilder:v8e,mathmlBuilder:b8e});var kN=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"};rr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:kN(e[0]),body:Za(e[1]),isCharacterBox:f0(e[1])}}});rr({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=kN(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Za(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:f0(l)}},htmlBuilder:v8e,mathmlBuilder:b8e});rr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:kN(e[0]),body:Za(e[0])}},htmlBuilder(t,e){var r=vs(t.body,e,!0),n=Ot([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=$c(t.body,e),n=new qt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Y9t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Jhe=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),ede=t=>t.type==="textord"&&t.text==="@",j9t=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function X9t(t,e,r){var n=Y9t[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 K9t(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 Ht("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=X9t(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Jhe()}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([])}}rr({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=UT(Qn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Yt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new qt("mrow",[bi(t.label,e)]);return r=new qt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new qt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});rr({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=UT(Qn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new qt("mrow",[bi(t.fragment,e)])}});rr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=gn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Ht("\\@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 x8e=(t,e)=>{var r=vs(t.body,e.withColor(t.color),!1);return g0(r)},w8e=(t,e)=>{var r=$c(t.body,e.withColor(t.color)),n=new qt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};rr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=gn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Za(i)}},htmlBuilder:x8e,mathmlBuilder:w8e});rr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=gn(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:x8e,mathmlBuilder:w8e});rr({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&&gn(i,"size").value}},htmlBuilder(t,e){var r=Ot(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Yt(la(t.size,e)))),r},mathmlBuilder(t,e){var r=new qt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Yt(la(t.size,e)))),r}});var Xq={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},T8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ht("Expected a control sequence",t);return e},Z9t=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},k8e=(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)};rr({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(Xq[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Xq[n.text]),gn(e.parseFunction(),"internal");throw new Ht("Invalid token after macro prefix",n)}});rr({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 Ht("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 Ht('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Ht('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Ht("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===Xq[r]),{type:"internal",mode:e.mode}}});rr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=T8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=Z9t(e);return k8e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});rr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=T8e(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return k8e(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var D5=function(e,r,n){var i=ea.math[e]&&ea.math[e].replace,a=KQ(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},rJ=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Ot(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},C8e=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=Yt(a),e.height-=a,e.depth+=a},Q9t=function(e,r,n,i,a,s){var o=Qo(e,"Main-Regular",a,i),l=rJ(o,r,i,s);return C8e(l,i,r),l},J9t=function(e,r,n,i){return Qo(e,"Size"+r+"-Regular",n,i)},S8e=function(e,r,n,i,a,s){var o=J9t(e,r,a,i),l=rJ(Ot(["delimsizing","size"+r],[o],i),ln.TEXT,i,s);return n&&C8e(l,i,ln.TEXT),l},qB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ot(["delimsizinginner",i],[Ot([],[Qo(e,r,n)])]);return{type:"elem",elem:a}},GB=function(e,r,n){var i=qh["Size4-Regular"][e.charCodeAt(0)]?qh["Size4-Regular"][e.charCodeAt(0)][4]:qh["Size1-Regular"][e.charCodeAt(0)][4],a=new Zp("inner",c9t(e,Math.round(1e3*r))),s=new jf([a],{width:Yt(i),height:Yt(r),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Qp([],[s],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},Kq=.008,zA={type:"kern",size:-1*Kq},eMt=new Set(["|","\\lvert","\\rvert","\\vert"]),tMt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),E8e=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"):eMt.has(e)?(u="∣",d="vert",f=333):tMt.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=D5(o,p,a),m=g.height+g.depth,y=D5(u,p,a),v=y.height+y.depth,x=D5(h,p,a),b=x.height+x.depth,T=0,k=1;if(l!==null){var S=D5(l,p,a);T=S.height+S.depth,k=2}var C=m+b+T,E=Math.max(0,Math.ceil((r-C)/(k*v))),A=C+E*k*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=A/2-M,P=[];if(d.length>0){var N=A-m-b,_=Math.round(A*1e3),I=u9t(d,Math.round(N*1e3)),O=new Zp(d,I),D=Yt(f/1e3),$=Yt(_/1e3),F=new jf([O],{width:D,height:$,viewBox:"0 0 "+f+" "+_}),z=Qp([],[F],i);z.height=_/1e3,z.style.width=D,z.style.height=$,P.push({type:"elem",elem:z})}else{if(P.push(qB(h,p,a)),P.push(zA),l===null){var H=A-m-b+2*Kq;P.push(GB(u,H,i))}else{var B=(A-m-b-T)/2+2*Kq;P.push(GB(u,B,i)),P.push(zA),P.push(qB(l,p,a)),P.push(zA),P.push(GB(u,B,i))}P.push(zA),P.push(qB(o,p,a))}var V=i.havingBaseStyle(ln.TEXT),q=Zn({positionType:"bottom",positionData:L,children:P});return rJ(Ot(["delimsizing","mult"],[q],V),ln.TEXT,i,s)},UB=80,YB=.08,jB=function(e,r,n,i,a){var s=l9t(e,i,n),o=new Zp(e,s),l=new jf([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Qp(["hide-tail"],[l],a)},rMt=function(e,r){var n=r.havingBaseSizing(),i=L8e("\\surd",e*n.sizeMultiplier,M8e,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+UB,e<1?a=1:e<1.4&&(a=.7),l=(1+s+YB)/a,u=(1+s)/a,o=jB("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+UB)*FC[i.size],u=(FC[i.size]+s)/a,l=(FC[i.size]+s+YB)/a,o=jB("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+YB,u=e+s,h=Math.floor(1e3*e+s)+UB,o=jB("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Yt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},A8e=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),nMt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),R8e=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),FC=[0,1.2,1.8,2.4,3],_8e=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),A8e.has(e)||R8e.has(e))return S8e(e,r,!1,n,i,a);if(nMt.has(e))return E8e(e,FC[r],!1,n,i,a);throw new Ht("Illegal delimiter: '"+e+"'")},iMt=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],aMt=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"stack"}],M8e=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],sMt=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.")},L8e=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]},Zq=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;R8e.has(e)?o=iMt:A8e.has(e)?o=M8e:o=aMt;var l=L8e(e,r,o,i);return l.type==="small"?Q9t(e,l.style,n,i,a,s):l.type==="large"?S8e(e,l.size,n,i,a,s):E8e(e,r,n,i,a,s)},XB=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 Zq(e,d,!0,i,a,s)},tde={"\\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}},oMt=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 rde(t){return"isMiddle"in t}function CN(t,e){var r=TN(t);if(r&&oMt.has(r.text))return r;throw r?new Ht("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Ht("Invalid delimiter type '"+t.type+"'",t)}rr({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=CN(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:tde[t.funcName].size,mclass:tde[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ot([t.mclass]):_8e(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(du(t.delim,t.mode));var r=new qt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Yt(FC[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function nde(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}rr({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 Ht("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:CN(e[0],t).text,color:r}}});rr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=CN(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=gn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{nde(t);for(var r=vs(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{nde(t);var r=$c(t.body,e);if(t.left!=="."){var n=new qt("mo",[du(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new qt("mo",[du(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return JQ(r)}});rr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=CN(e[0],t);if(!t.parser.leftrightDepth)throw new Ht("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=a6(e,[]):(r=_8e(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?du("|","text"):du(t.delim,t.mode),n=new qt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var SN=(t,e)=>{var r=UT(Qn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=f0(t.body);if(n==="sout")a=Ot(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=la({number:.6,unit:"pt"},e),u=la({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Yt(d/2+l);var f=Math.floor(1e3*d*i),p=s9t(f),g=new jf([new Zp("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Qp(["hide-tail"],[g],e),a.style.height=Yt(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=V9t(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Yt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Yt(v),a.style.borderRightWidth=Yt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=Zn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=Zn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?Ot(["mord","cancel-lap"],[x],e):Ot(["mord"],[x],e)},EN=(t,e)=>{var r,n=new qt(t.label.includes("colorbox")?"mpadded":"menclose",[bi(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: "+Yt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};rr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=gn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:SN,mathmlBuilder:EN});rr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=gn(e[0],"color-token").color,s=gn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:SN,mathmlBuilder:EN});rr({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]}}});rr({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:SN,mathmlBuilder:EN});rr({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:SN,mathmlBuilder:EN});rr({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 I8e={};function xd(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 Ht("{"+t.envName+"} can be used only in display mode.")},lMt=new Set(["gather","gather*"]);function nJ(t){if(!t.includes("ed"))return!t.includes("*")}function wg(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 Ht("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new bc("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(ide(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:k};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Ht("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){T(),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:Ce[oe]})}for(T(s[0]),n=0;n0&&(L+=x,CCe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var J,re;Z=(J=(re=V)==null?void 0:re.pregap)!=null?J:f,Z!==0&&(I=Ot(["arraycolsep"],[]),I.style.width=Yt(Z),_.push(I))}var ee=[];for(n=0;n0){for(var ge=GT("hline",r,h),Ve=GT("hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Ae=u.pop(),Ue=Ae.pos-P;Ae.isDashed?we.push({type:"elem",elem:Ve,shift:Ue}):we.push({type:"elem",elem:ge,shift:Ue})}Te=Zn({positionType:"individualShift",children:we})}if(D.length===0)return Ot(["mord"],[Te],r);var le=Zn({positionType:"individualShift",children:D}),pe=Ot(["tag"],[le],r);return g0([Te,pe])},cMt={c:"center ",l:"left ",r:"right "},Td=function(e,r){for(var n=[],i=new qt("mtd",[],["mtr-glue"]),a=new qt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var M=1;M0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};xd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=TN(e[0]),n=r?[e[0]]:gn(e[0],"ordgroup").body,i=n.map(function(s){var o=wN(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 Ht("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return wg(t.parser,a,iJ(t.envName))},htmlBuilder:wd,mathmlBuilder:Td});xd({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 Ht("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=wg(t.parser,n,iJ(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:wd,mathmlBuilder:Td});xd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=wg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=TN(e[0]),n=r?[e[0]]:gn(e[0],"ordgroup").body,i=n.map(function(o){var l=wN(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ht("Unknown column alignment: "+u,o)});if(i.length>1)throw new Ht("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=wg(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Ht("{subarray} can contain only one column");return s},htmlBuilder:wd,mathmlBuilder:Td});xd({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=wg(t.parser,e,iJ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:N8e,htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){lMt.has(t.envName)&&AN(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:nJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return wg(t.parser,e,"display")},htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:N8e,htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){AN(t);var e={autoTag:nJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return wg(t.parser,e,"display")},htmlBuilder:wd,mathmlBuilder:Td});xd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return AN(t),K9t(t.parser)},htmlBuilder:wd,mathmlBuilder:Td});Ee("\\nonumber","\\gdef\\@eqnsw{0}");Ee("\\notag","\\nonumber");rr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Ht(t.funcName+" valid only within array environment")}});var ade=I8e;rr({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 Ht("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Qn(t.body,n)},O8e=(t,e)=>{var r=t.font,n=e.withFont(r);return bi(t.body,n)},sde={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};rr({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=mL(e[0]),a=n;return a in sde&&(a=sde[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:D8e,mathmlBuilder:O8e});rr({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:kN(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:f0(n)}}});rr({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:D8e,mathmlBuilder:O8e});var uMt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Qn(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 x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new qt("mfrac",[bi(t.numer,e),bi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=la(t.barSize,e);r.setAttribute("linethickness",Yt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new qt("mo",[new Qa(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new qt("mo",[new Qa(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return JQ(i)}return r},P8e=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};rr({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"),P8e({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:uMt,mathmlBuilder:hMt});rr({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 ode=["display","text","script","scriptscript"],lde=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};rr({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=mL(e[0]),s=a.type==="atom"&&a.family==="open"?lde(a.text):null,o=mL(e[1]),l=o.type==="atom"&&o.family==="close"?lde(o.text):null,u=gn(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=gn(p.body[0],"textord");f=ode[Number(g.text)]}}else p=gn(p,"textord"),f=ode[Number(p.text)];return P8e({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});rr({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:gn(e[0],"size").value,token:i}}});rr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=gn(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 B8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Qn(t.sup,e.havingStyle(r.sup()),e):Qn(t.sub,e.havingStyle(r.sub()),e),i=gn(t.base,"horizBrace")):i=gn(t,"horizBrace");var a=Qn(i.base,e.havingBaseStyle(ln.DISPLAY)),s=xN(i,e),o;if(i.isOver?o=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=Zn({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=Ot(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=Zn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ot(["minner",i.isOver?"mover":"munder"],[o],e)},dMt=(t,e)=>{var r=bN(t.label);return new qt(t.isOver?"mover":"munder",[bi(t.base,e),r])};rr({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:B8e,mathmlBuilder:dMt});rr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=gn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Za(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=vs(t.body,e,!1);return S9t(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Jp(t.body,e);return r instanceof qt||(r=new qt("mrow",[r])),r.setAttribute("href",t.href),r}});rr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=gn(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=gn(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=vs(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Ot(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)=>Jp(t.body,e)});rr({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:Za(e[0]),mathml:Za(e[1])}},htmlBuilder:(t,e)=>{var r=vs(t.html,e,!1);return g0(r)},mathmlBuilder:(t,e)=>Jp(t.mathml,e)});var KB=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 Ht("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!e8e(n))throw new Ht("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};rr({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=gn(r[0],"raw").string,u=l.split(","),h=0;h{var r=la(t.height,e),n=0;t.totalheight.number>0&&(n=la(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=la(t.width,e));var a={height:Yt(r+n)};i>0&&(a.width=Yt(i)),n>0&&(a.verticalAlign=Yt(-n));var s=new p9t(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new qt("mglyph",[]);r.setAttribute("alt",t.alt);var n=la(t.height,e),i=0;if(t.totalheight.number>0&&(i=la(t.totalheight,e)-n,r.setAttribute("valign",Yt(-i))),r.setAttribute("height",Yt(n+i)),t.width.number>0){var a=la(t.width,e);r.setAttribute("width",Yt(a))}return r.setAttribute("src",t.src),r}});rr({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=gn(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 o8e(t.dimension,e)},mathmlBuilder(t,e){var r=la(t.dimension,e);return new f8e(r)}});rr({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=Ot([],[Qn(t.body,e)]),r=Ot(["inner"],[r],e)):r=Ot(["inner"],[Qn(t.body,e)]);var n=Ot(["fix"],[]),i=Ot([t.alignment],[r,n],e),a=Ot(["strut"]);return a.style.height=Yt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Yt(-i.depth)),i.children.unshift(a),i=Ot(["thinbox"],[i],e),Ot(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new qt("mpadded",[bi(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}});rr({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}}});rr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Ht("Mismatched "+t.funcName)}});var cde=(t,e)=>{switch(e.style.size){case ln.DISPLAY.size:return t.display;case ln.TEXT.size:return t.text;case ln.SCRIPT.size:return t.script;case ln.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};rr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Za(e[0]),text:Za(e[1]),script:Za(e[2]),scriptscript:Za(e[3])}},htmlBuilder:(t,e)=>{var r=cde(t,e),n=vs(r,e,!1);return g0(n)},mathmlBuilder:(t,e)=>{var r=cde(t,e);return Jp(r,e)}});var F8e=(t,e,r,n,i,a,s)=>{t=Ot([],[t]);var o=r&&f0(r),l,u;if(e){var h=Qn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Qn(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=Zn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=Zn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=Zn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Ot(["mspace"],[],n);v.style.marginRight=Yt(a),y.unshift(v)}return Ot(["mop","op-limits"],y,n)},z8e=new Set(["\\smallint"]),V3=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=gn(t.base,"op"),i=!0):a=gn(t,"op");var s=e.style,o=!1;s.size===ln.DISPLAY.size&&a.symbol&&!z8e.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=Qo(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=c8e(d+"Size"+(o?"2":"1"),e);l=Zn({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=vs(a.body,e,!0);p.length===1&&p[0]instanceof Ec?(l=p[0],l.classes[0]="mop"):l=Ot(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new qt("mo",[du(t.name,t.mode)]),z8e.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new qt("mo",$c(t.body,e));else{r=new qt("mi",[new Qa(t.name.slice(1))]);var n=new qt("mo",[du("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=d8e([r,n])}return r},fMt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};rr({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=fMt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:V3,mathmlBuilder:LE});rr({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:Za(n)}},htmlBuilder:V3,mathmlBuilder:LE});var pMt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};rr({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:V3,mathmlBuilder:LE});rr({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:V3,mathmlBuilder:LE});rr({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=pMt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:V3,mathmlBuilder:LE});var H8e=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=gn(t.base,"operatorname"),i=!0):a=gn(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=vs(o,e.withFont("mathrm"),!0),u=0;u{for(var r=$c(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Qa(o)]}var l=new qt("mi",r);l.setAttribute("mathvariant","normal");var u=new qt("mo",[du("⁡","text")]);return t.parentIsSupSub?new qt("mrow",[l,u]):d8e([l,u])};rr({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:Za(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:H8e,mathmlBuilder:gMt});Ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Oy({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?g0(vs(t.body,e,!1)):Ot(["mord"],vs(t.body,e,!0),e)},mathmlBuilder(t,e){return Jp(t.body,e,!0)}});rr({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=Qn(t.body,e.havingCrampedStyle()),n=GT("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Ot(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new Qa("‾")]);r.setAttribute("stretchy","true");var n=new qt("mover",[bi(t.body,e),r]);return n.setAttribute("accent","true"),n}});rr({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:Za(n)}},htmlBuilder:(t,e)=>{var r=vs(t.body,e.withPhantom(),!1);return g0(r)},mathmlBuilder:(t,e)=>{var r=$c(t.body,e);return new qt("mphantom",r)}});Ee("\\hphantom","\\smash{\\phantom{#1}}");rr({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=Ot(["inner"],[Qn(t.body,e.withPhantom())]),n=Ot(["fix"],[]);return Ot(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=$c(Za(t.body),e),n=new qt("mphantom",r),i=new qt("mpadded",[n]);return i.setAttribute("width","0px"),i}});rr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=gn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Qn(t.body,e),n=la(t.dy,e);return Zn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[bi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});rr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});rr({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=gn(e[0],"size"),s=gn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&gn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Ot(["mord","rule"],[],e),n=la(t.width,e),i=la(t.height,e),a=t.shift?la(t.shift,e):0;return r.style.borderRightWidth=Yt(n),r.style.borderTopWidth=Yt(i),r.style.bottom=Yt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=la(t.width,e),n=la(t.height,e),i=t.shift?la(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new qt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Yt(r)),s.setAttribute("height",Yt(n));var o=new qt("mpadded",[s]);return i>=0?o.setAttribute("height",Yt(i)):(o.setAttribute("height",Yt(i)),o.setAttribute("depth",Yt(-i))),o.setAttribute("voffset",Yt(i)),o}});function V8e(t,e,r){for(var n=vs(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return V8e(t.body,r,e)};rr({type:"sizing",names:ude,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:ude.indexOf(n)+1,body:a}},htmlBuilder:mMt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=$c(t.body,r),i=new qt("mstyle",n);return i.setAttribute("mathsize",Yt(r.sizeMultiplier)),i}});rr({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]&&gn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Ot([],[Qn(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 Ot(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new qt("mpadded",[bi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});rr({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=Qn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=UT(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=Yt(h);var p=Zn({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(ln.SCRIPTSCRIPT),m=Qn(t.index,g,e),y=.6*(p.height-p.depth),v=Zn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=Ot(["root"],[v]);return Ot(["mord","sqrt"],[x,p],e)}else return Ot(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new qt("mroot",[bi(r,e),bi(n,e)]):new qt("msqrt",[bi(r,e)])}});var Qq={display:ln.DISPLAY,text:ln.TEXT,script:ln.SCRIPT,scriptscript:ln.SCRIPTSCRIPT};function yMt(t){return t in Qq}rr({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(!yMt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=Qq[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),V8e(t.body,n,e)},mathmlBuilder(t,e){var r=Qq[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=$c(t.body,n),a=new qt("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 vMt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===ln.DISPLAY.size||n.alwaysHandleSupSub);return i?V3:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===ln.DISPLAY.size||n.limits);return a?H8e:null}else{if(n.type==="accent")return f0(n.base)?tJ:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?B8e:null}else return null}else return null};Oy({type:"supsub",htmlBuilder(t,e){var r=vMt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Qn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&f0(n);if(i){var p=e.havingStyle(e.style.sup());o=Qn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Qn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===ln.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Yt(.5/u.ptPerEm/y),x=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 Ec||b){var T;x=Yt(-((T=s.italic)!=null?T:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,C=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];k=Zn({positionType:"individualShift",children:A})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];k=Zn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=Zn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=Yq(s,"right")||"mord";return Ot([L],[s,Ot(["msupsub"],[k])],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=[bi(t.base,e)];t.sub&&a.push(bi(t.sub,e)),t.sup&&a.push(bi(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===ln.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===ln.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===ln.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ln.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===ln.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===ln.DISPLAY)?s="mover":s="msup"}return new qt(s,a)}});Oy({type:"atom",htmlBuilder(t,e){return ZQ(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new qt("mo",[du(t.text,t.mode)]);if(t.family==="bin"){var n=eJ(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 W8e={mi:"italic",mn:"normal",mtext:"normal"};Oy({type:"mathord",htmlBuilder(t,e){return vN(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[du(t.text,t.mode,e)]),n=eJ(t,e)||"italic";return n!==W8e[r.type]&&r.setAttribute("mathvariant",n),r}});Oy({type:"textord",htmlBuilder(t,e){return vN(t,e,"textord")},mathmlBuilder(t,e){var r=du(t.text,t.mode,e),n=eJ(t,e)||"normal",i;return t.mode==="text"?i=new qt("mtext",[r]):/[0-9]/.test(t.text)?i=new qt("mn",[r]):t.text==="\\prime"?i=new qt("mo",[r]):i=new qt("mi",[r]),n!==W8e[i.type]&&i.setAttribute("mathvariant",n),i}});var ZB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},QB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Oy({type:"spacing",htmlBuilder(t,e){if(QB.hasOwnProperty(t.text)){var r=QB[t.text].className||"";if(t.mode==="text"){var n=vN(t,e,"textord");return n.classes.push(r),n}else return Ot(["mspace",r],[ZQ(t.text,t.mode,e)],e)}else{if(ZB.hasOwnProperty(t.text))return Ot(["mspace",ZB[t.text]],[],e);throw new Ht('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(QB.hasOwnProperty(t.text))r=new qt("mtext",[new Qa(" ")]);else{if(ZB.hasOwnProperty(t.text))return new qt("mspace");throw new Ht('Unknown type of space "'+t.text+'"')}return r}});var hde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};Oy({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[hde(),new qt("mtd",[Jp(t.body,e)]),hde(),new qt("mtd",[Jp(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var dde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},fde={"\\textbf":"textbf","\\textmd":"textmd"},bMt={"\\textit":"textit","\\textup":"textup"},pde=(t,e)=>{var r=t.font;if(r){if(dde[r])return e.withTextFontFamily(dde[r]);if(fde[r])return e.withTextFontWeight(fde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(bMt[r])};rr({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:Za(i),font:n}},htmlBuilder(t,e){var r=pde(t,e),n=vs(t.body,r,!0);return Ot(["mord","text"],n,r)},mathmlBuilder(t,e){var r=pde(t,e);return Jp(t.body,r)}});rr({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=Qn(t.body,e),n=GT("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Ot(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new Qa("‾")]);r.setAttribute("stretchy","true");var n=new qt("munder",[bi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});rr({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=Qn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Zn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[bi(t.body,e)],["vcenter"]);return new qt("mrow",[r])}});rr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Ht("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=gde(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),vp=u8e,q8e=`[ \r - ]`,xMt="\\\\[a-zA-Z@]+",wMt="\\\\[^\uD800-\uDFFF]",TMt="("+xMt+")"+q8e+"*",kMt=`\\\\( +-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 y9t(t){return"toText"in t}class F3{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(y9t(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var Fq={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},v9t={ex:!0,em:!0,mu:!0},n8e=function(e){return typeof e!="string"&&(e=e.unit),e in Fq||e in v9t||e==="ex"},la=function(e,r){var n;if(e.unit in Fq)n=Fq[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 Ht("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Yt=function(e){return+e.toFixed(4)+"em"},Kp=function(e){return e.filter(r=>r).join(" ")},ZQ=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=U_t(n)+":"+i+";")}return r},i8e=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)}},a8e=function(e){var r=document.createElement(e);r.className=Kp(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]/,s8e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+_o(Kp(this.classes))+'"');var n=ZQ(this.style);n&&(r+=' style="'+_o(n)+'"');for(var i of Object.keys(this.attributes)){if(b9t.test(i))throw new Ht("Invalid attribute name '"+i+"'");r+=" "+i+'="'+_o(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class z3{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,i8e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return a8e.call(this,"span")}toMarkup(){return s8e.call(this,"span")}}let vN=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,i8e.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 a8e.call(this,"a")}toMarkup(){return s8e.call(this,"a")}};class x9t{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=''+_o(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Yt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Kp(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:"+Yt(this.italic)+";"),n+=ZQ(this.style),n&&(e=!0,r+=' style="'+_o(n)+'"');var i=_o(this.text);return e?(r+=">",r+=i,r+="",r):i}}class jf{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 zq{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 C9t=t=>t instanceof z3||t instanceof vN||t instanceof F3,Gh={"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]}},DA={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]},Fhe={Å:"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 o8e(t,e){Gh[t]=e}function QQ(t,e,r){if(!Gh[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Gh[e][n];if(!i&&t[0]in Fhe&&(n=Fhe[t[0]].charCodeAt(0),i=Gh[e][n]),!i&&r==="text"&&r8e(n)&&(i=Gh[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var zB={};function S9t(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!zB[e]){var r=zB[e]={cssEmPerMu:DA.quad[e]/18};for(var n in DA)DA.hasOwnProperty(n)&&(r[n]=DA[n][e])}return zB[e]}var ea={math:{},text:{}};function U(t,e,r,n,i,a){ea[t][i]={font:e,group:r,replace:n},a&&n&&(ea[t][n]=ea[t][i])}var ne="math",Lt="text",be="main",Ge="ams",na="accent-token",or="bin",Sl="close",H3="inner",Dr="mathord",ns="op-token",Ic="open",LE="punct",Xe="rel",p0="spacing",Ze="textord";U(ne,be,Xe,"≡","\\equiv",!0);U(ne,be,Xe,"≺","\\prec",!0);U(ne,be,Xe,"≻","\\succ",!0);U(ne,be,Xe,"∼","\\sim",!0);U(ne,be,Xe,"⊥","\\perp");U(ne,be,Xe,"⪯","\\preceq",!0);U(ne,be,Xe,"⪰","\\succeq",!0);U(ne,be,Xe,"≃","\\simeq",!0);U(ne,be,Xe,"∣","\\mid",!0);U(ne,be,Xe,"≪","\\ll",!0);U(ne,be,Xe,"≫","\\gg",!0);U(ne,be,Xe,"≍","\\asymp",!0);U(ne,be,Xe,"∥","\\parallel");U(ne,be,Xe,"⋈","\\bowtie",!0);U(ne,be,Xe,"⌣","\\smile",!0);U(ne,be,Xe,"⊑","\\sqsubseteq",!0);U(ne,be,Xe,"⊒","\\sqsupseteq",!0);U(ne,be,Xe,"≐","\\doteq",!0);U(ne,be,Xe,"⌢","\\frown",!0);U(ne,be,Xe,"∋","\\ni",!0);U(ne,be,Xe,"∝","\\propto",!0);U(ne,be,Xe,"⊢","\\vdash",!0);U(ne,be,Xe,"⊣","\\dashv",!0);U(ne,be,Xe,"∋","\\owns");U(ne,be,LE,".","\\ldotp");U(ne,be,LE,"⋅","\\cdotp");U(ne,be,LE,"⋅","·");U(Lt,be,Ze,"⋅","·");U(ne,be,Ze,"#","\\#");U(Lt,be,Ze,"#","\\#");U(ne,be,Ze,"&","\\&");U(Lt,be,Ze,"&","\\&");U(ne,be,Ze,"ℵ","\\aleph",!0);U(ne,be,Ze,"∀","\\forall",!0);U(ne,be,Ze,"ℏ","\\hbar",!0);U(ne,be,Ze,"∃","\\exists",!0);U(ne,be,Ze,"∇","\\nabla",!0);U(ne,be,Ze,"♭","\\flat",!0);U(ne,be,Ze,"ℓ","\\ell",!0);U(ne,be,Ze,"♮","\\natural",!0);U(ne,be,Ze,"♣","\\clubsuit",!0);U(ne,be,Ze,"℘","\\wp",!0);U(ne,be,Ze,"♯","\\sharp",!0);U(ne,be,Ze,"♢","\\diamondsuit",!0);U(ne,be,Ze,"ℜ","\\Re",!0);U(ne,be,Ze,"♡","\\heartsuit",!0);U(ne,be,Ze,"ℑ","\\Im",!0);U(ne,be,Ze,"♠","\\spadesuit",!0);U(ne,be,Ze,"§","\\S",!0);U(Lt,be,Ze,"§","\\S");U(ne,be,Ze,"¶","\\P",!0);U(Lt,be,Ze,"¶","\\P");U(ne,be,Ze,"†","\\dag");U(Lt,be,Ze,"†","\\dag");U(Lt,be,Ze,"†","\\textdagger");U(ne,be,Ze,"‡","\\ddag");U(Lt,be,Ze,"‡","\\ddag");U(Lt,be,Ze,"‡","\\textdaggerdbl");U(ne,be,Sl,"⎱","\\rmoustache",!0);U(ne,be,Ic,"⎰","\\lmoustache",!0);U(ne,be,Sl,"⟯","\\rgroup",!0);U(ne,be,Ic,"⟮","\\lgroup",!0);U(ne,be,or,"∓","\\mp",!0);U(ne,be,or,"⊖","\\ominus",!0);U(ne,be,or,"⊎","\\uplus",!0);U(ne,be,or,"⊓","\\sqcap",!0);U(ne,be,or,"∗","\\ast");U(ne,be,or,"⊔","\\sqcup",!0);U(ne,be,or,"◯","\\bigcirc",!0);U(ne,be,or,"∙","\\bullet",!0);U(ne,be,or,"‡","\\ddagger");U(ne,be,or,"≀","\\wr",!0);U(ne,be,or,"⨿","\\amalg");U(ne,be,or,"&","\\And");U(ne,be,Xe,"⟵","\\longleftarrow",!0);U(ne,be,Xe,"⇐","\\Leftarrow",!0);U(ne,be,Xe,"⟸","\\Longleftarrow",!0);U(ne,be,Xe,"⟶","\\longrightarrow",!0);U(ne,be,Xe,"⇒","\\Rightarrow",!0);U(ne,be,Xe,"⟹","\\Longrightarrow",!0);U(ne,be,Xe,"↔","\\leftrightarrow",!0);U(ne,be,Xe,"⟷","\\longleftrightarrow",!0);U(ne,be,Xe,"⇔","\\Leftrightarrow",!0);U(ne,be,Xe,"⟺","\\Longleftrightarrow",!0);U(ne,be,Xe,"↦","\\mapsto",!0);U(ne,be,Xe,"⟼","\\longmapsto",!0);U(ne,be,Xe,"↗","\\nearrow",!0);U(ne,be,Xe,"↩","\\hookleftarrow",!0);U(ne,be,Xe,"↪","\\hookrightarrow",!0);U(ne,be,Xe,"↘","\\searrow",!0);U(ne,be,Xe,"↼","\\leftharpoonup",!0);U(ne,be,Xe,"⇀","\\rightharpoonup",!0);U(ne,be,Xe,"↙","\\swarrow",!0);U(ne,be,Xe,"↽","\\leftharpoondown",!0);U(ne,be,Xe,"⇁","\\rightharpoondown",!0);U(ne,be,Xe,"↖","\\nwarrow",!0);U(ne,be,Xe,"⇌","\\rightleftharpoons",!0);U(ne,Ge,Xe,"≮","\\nless",!0);U(ne,Ge,Xe,"","\\@nleqslant");U(ne,Ge,Xe,"","\\@nleqq");U(ne,Ge,Xe,"⪇","\\lneq",!0);U(ne,Ge,Xe,"≨","\\lneqq",!0);U(ne,Ge,Xe,"","\\@lvertneqq");U(ne,Ge,Xe,"⋦","\\lnsim",!0);U(ne,Ge,Xe,"⪉","\\lnapprox",!0);U(ne,Ge,Xe,"⊀","\\nprec",!0);U(ne,Ge,Xe,"⋠","\\npreceq",!0);U(ne,Ge,Xe,"⋨","\\precnsim",!0);U(ne,Ge,Xe,"⪹","\\precnapprox",!0);U(ne,Ge,Xe,"≁","\\nsim",!0);U(ne,Ge,Xe,"","\\@nshortmid");U(ne,Ge,Xe,"∤","\\nmid",!0);U(ne,Ge,Xe,"⊬","\\nvdash",!0);U(ne,Ge,Xe,"⊭","\\nvDash",!0);U(ne,Ge,Xe,"⋪","\\ntriangleleft");U(ne,Ge,Xe,"⋬","\\ntrianglelefteq",!0);U(ne,Ge,Xe,"⊊","\\subsetneq",!0);U(ne,Ge,Xe,"","\\@varsubsetneq");U(ne,Ge,Xe,"⫋","\\subsetneqq",!0);U(ne,Ge,Xe,"","\\@varsubsetneqq");U(ne,Ge,Xe,"≯","\\ngtr",!0);U(ne,Ge,Xe,"","\\@ngeqslant");U(ne,Ge,Xe,"","\\@ngeqq");U(ne,Ge,Xe,"⪈","\\gneq",!0);U(ne,Ge,Xe,"≩","\\gneqq",!0);U(ne,Ge,Xe,"","\\@gvertneqq");U(ne,Ge,Xe,"⋧","\\gnsim",!0);U(ne,Ge,Xe,"⪊","\\gnapprox",!0);U(ne,Ge,Xe,"⊁","\\nsucc",!0);U(ne,Ge,Xe,"⋡","\\nsucceq",!0);U(ne,Ge,Xe,"⋩","\\succnsim",!0);U(ne,Ge,Xe,"⪺","\\succnapprox",!0);U(ne,Ge,Xe,"≆","\\ncong",!0);U(ne,Ge,Xe,"","\\@nshortparallel");U(ne,Ge,Xe,"∦","\\nparallel",!0);U(ne,Ge,Xe,"⊯","\\nVDash",!0);U(ne,Ge,Xe,"⋫","\\ntriangleright");U(ne,Ge,Xe,"⋭","\\ntrianglerighteq",!0);U(ne,Ge,Xe,"","\\@nsupseteqq");U(ne,Ge,Xe,"⊋","\\supsetneq",!0);U(ne,Ge,Xe,"","\\@varsupsetneq");U(ne,Ge,Xe,"⫌","\\supsetneqq",!0);U(ne,Ge,Xe,"","\\@varsupsetneqq");U(ne,Ge,Xe,"⊮","\\nVdash",!0);U(ne,Ge,Xe,"⪵","\\precneqq",!0);U(ne,Ge,Xe,"⪶","\\succneqq",!0);U(ne,Ge,Xe,"","\\@nsubseteqq");U(ne,Ge,or,"⊴","\\unlhd");U(ne,Ge,or,"⊵","\\unrhd");U(ne,Ge,Xe,"↚","\\nleftarrow",!0);U(ne,Ge,Xe,"↛","\\nrightarrow",!0);U(ne,Ge,Xe,"⇍","\\nLeftarrow",!0);U(ne,Ge,Xe,"⇏","\\nRightarrow",!0);U(ne,Ge,Xe,"↮","\\nleftrightarrow",!0);U(ne,Ge,Xe,"⇎","\\nLeftrightarrow",!0);U(ne,Ge,Xe,"△","\\vartriangle");U(ne,Ge,Ze,"ℏ","\\hslash");U(ne,Ge,Ze,"▽","\\triangledown");U(ne,Ge,Ze,"◊","\\lozenge");U(ne,Ge,Ze,"Ⓢ","\\circledS");U(ne,Ge,Ze,"®","\\circledR");U(Lt,Ge,Ze,"®","\\circledR");U(ne,Ge,Ze,"∡","\\measuredangle",!0);U(ne,Ge,Ze,"∄","\\nexists");U(ne,Ge,Ze,"℧","\\mho");U(ne,Ge,Ze,"Ⅎ","\\Finv",!0);U(ne,Ge,Ze,"⅁","\\Game",!0);U(ne,Ge,Ze,"‵","\\backprime");U(ne,Ge,Ze,"▲","\\blacktriangle");U(ne,Ge,Ze,"▼","\\blacktriangledown");U(ne,Ge,Ze,"■","\\blacksquare");U(ne,Ge,Ze,"⧫","\\blacklozenge");U(ne,Ge,Ze,"★","\\bigstar");U(ne,Ge,Ze,"∢","\\sphericalangle",!0);U(ne,Ge,Ze,"∁","\\complement",!0);U(ne,Ge,Ze,"ð","\\eth",!0);U(Lt,be,Ze,"ð","ð");U(ne,Ge,Ze,"╱","\\diagup");U(ne,Ge,Ze,"╲","\\diagdown");U(ne,Ge,Ze,"□","\\square");U(ne,Ge,Ze,"□","\\Box");U(ne,Ge,Ze,"◊","\\Diamond");U(ne,Ge,Ze,"¥","\\yen",!0);U(Lt,Ge,Ze,"¥","\\yen",!0);U(ne,Ge,Ze,"✓","\\checkmark",!0);U(Lt,Ge,Ze,"✓","\\checkmark");U(ne,Ge,Ze,"ℶ","\\beth",!0);U(ne,Ge,Ze,"ℸ","\\daleth",!0);U(ne,Ge,Ze,"ℷ","\\gimel",!0);U(ne,Ge,Ze,"ϝ","\\digamma",!0);U(ne,Ge,Ze,"ϰ","\\varkappa");U(ne,Ge,Ic,"┌","\\@ulcorner",!0);U(ne,Ge,Sl,"┐","\\@urcorner",!0);U(ne,Ge,Ic,"└","\\@llcorner",!0);U(ne,Ge,Sl,"┘","\\@lrcorner",!0);U(ne,Ge,Xe,"≦","\\leqq",!0);U(ne,Ge,Xe,"⩽","\\leqslant",!0);U(ne,Ge,Xe,"⪕","\\eqslantless",!0);U(ne,Ge,Xe,"≲","\\lesssim",!0);U(ne,Ge,Xe,"⪅","\\lessapprox",!0);U(ne,Ge,Xe,"≊","\\approxeq",!0);U(ne,Ge,or,"⋖","\\lessdot");U(ne,Ge,Xe,"⋘","\\lll",!0);U(ne,Ge,Xe,"≶","\\lessgtr",!0);U(ne,Ge,Xe,"⋚","\\lesseqgtr",!0);U(ne,Ge,Xe,"⪋","\\lesseqqgtr",!0);U(ne,Ge,Xe,"≑","\\doteqdot");U(ne,Ge,Xe,"≓","\\risingdotseq",!0);U(ne,Ge,Xe,"≒","\\fallingdotseq",!0);U(ne,Ge,Xe,"∽","\\backsim",!0);U(ne,Ge,Xe,"⋍","\\backsimeq",!0);U(ne,Ge,Xe,"⫅","\\subseteqq",!0);U(ne,Ge,Xe,"⋐","\\Subset",!0);U(ne,Ge,Xe,"⊏","\\sqsubset",!0);U(ne,Ge,Xe,"≼","\\preccurlyeq",!0);U(ne,Ge,Xe,"⋞","\\curlyeqprec",!0);U(ne,Ge,Xe,"≾","\\precsim",!0);U(ne,Ge,Xe,"⪷","\\precapprox",!0);U(ne,Ge,Xe,"⊲","\\vartriangleleft");U(ne,Ge,Xe,"⊴","\\trianglelefteq");U(ne,Ge,Xe,"⊨","\\vDash",!0);U(ne,Ge,Xe,"⊪","\\Vvdash",!0);U(ne,Ge,Xe,"⌣","\\smallsmile");U(ne,Ge,Xe,"⌢","\\smallfrown");U(ne,Ge,Xe,"≏","\\bumpeq",!0);U(ne,Ge,Xe,"≎","\\Bumpeq",!0);U(ne,Ge,Xe,"≧","\\geqq",!0);U(ne,Ge,Xe,"⩾","\\geqslant",!0);U(ne,Ge,Xe,"⪖","\\eqslantgtr",!0);U(ne,Ge,Xe,"≳","\\gtrsim",!0);U(ne,Ge,Xe,"⪆","\\gtrapprox",!0);U(ne,Ge,or,"⋗","\\gtrdot");U(ne,Ge,Xe,"⋙","\\ggg",!0);U(ne,Ge,Xe,"≷","\\gtrless",!0);U(ne,Ge,Xe,"⋛","\\gtreqless",!0);U(ne,Ge,Xe,"⪌","\\gtreqqless",!0);U(ne,Ge,Xe,"≖","\\eqcirc",!0);U(ne,Ge,Xe,"≗","\\circeq",!0);U(ne,Ge,Xe,"≜","\\triangleq",!0);U(ne,Ge,Xe,"∼","\\thicksim");U(ne,Ge,Xe,"≈","\\thickapprox");U(ne,Ge,Xe,"⫆","\\supseteqq",!0);U(ne,Ge,Xe,"⋑","\\Supset",!0);U(ne,Ge,Xe,"⊐","\\sqsupset",!0);U(ne,Ge,Xe,"≽","\\succcurlyeq",!0);U(ne,Ge,Xe,"⋟","\\curlyeqsucc",!0);U(ne,Ge,Xe,"≿","\\succsim",!0);U(ne,Ge,Xe,"⪸","\\succapprox",!0);U(ne,Ge,Xe,"⊳","\\vartriangleright");U(ne,Ge,Xe,"⊵","\\trianglerighteq");U(ne,Ge,Xe,"⊩","\\Vdash",!0);U(ne,Ge,Xe,"∣","\\shortmid");U(ne,Ge,Xe,"∥","\\shortparallel");U(ne,Ge,Xe,"≬","\\between",!0);U(ne,Ge,Xe,"⋔","\\pitchfork",!0);U(ne,Ge,Xe,"∝","\\varpropto");U(ne,Ge,Xe,"◀","\\blacktriangleleft");U(ne,Ge,Xe,"∴","\\therefore",!0);U(ne,Ge,Xe,"∍","\\backepsilon");U(ne,Ge,Xe,"▶","\\blacktriangleright");U(ne,Ge,Xe,"∵","\\because",!0);U(ne,Ge,Xe,"⋘","\\llless");U(ne,Ge,Xe,"⋙","\\gggtr");U(ne,Ge,or,"⊲","\\lhd");U(ne,Ge,or,"⊳","\\rhd");U(ne,Ge,Xe,"≂","\\eqsim",!0);U(ne,be,Xe,"⋈","\\Join");U(ne,Ge,Xe,"≑","\\Doteq",!0);U(ne,Ge,or,"∔","\\dotplus",!0);U(ne,Ge,or,"∖","\\smallsetminus");U(ne,Ge,or,"⋒","\\Cap",!0);U(ne,Ge,or,"⋓","\\Cup",!0);U(ne,Ge,or,"⩞","\\doublebarwedge",!0);U(ne,Ge,or,"⊟","\\boxminus",!0);U(ne,Ge,or,"⊞","\\boxplus",!0);U(ne,Ge,or,"⋇","\\divideontimes",!0);U(ne,Ge,or,"⋉","\\ltimes",!0);U(ne,Ge,or,"⋊","\\rtimes",!0);U(ne,Ge,or,"⋋","\\leftthreetimes",!0);U(ne,Ge,or,"⋌","\\rightthreetimes",!0);U(ne,Ge,or,"⋏","\\curlywedge",!0);U(ne,Ge,or,"⋎","\\curlyvee",!0);U(ne,Ge,or,"⊝","\\circleddash",!0);U(ne,Ge,or,"⊛","\\circledast",!0);U(ne,Ge,or,"⋅","\\centerdot");U(ne,Ge,or,"⊺","\\intercal",!0);U(ne,Ge,or,"⋒","\\doublecap");U(ne,Ge,or,"⋓","\\doublecup");U(ne,Ge,or,"⊠","\\boxtimes",!0);U(ne,Ge,Xe,"⇢","\\dashrightarrow",!0);U(ne,Ge,Xe,"⇠","\\dashleftarrow",!0);U(ne,Ge,Xe,"⇇","\\leftleftarrows",!0);U(ne,Ge,Xe,"⇆","\\leftrightarrows",!0);U(ne,Ge,Xe,"⇚","\\Lleftarrow",!0);U(ne,Ge,Xe,"↞","\\twoheadleftarrow",!0);U(ne,Ge,Xe,"↢","\\leftarrowtail",!0);U(ne,Ge,Xe,"↫","\\looparrowleft",!0);U(ne,Ge,Xe,"⇋","\\leftrightharpoons",!0);U(ne,Ge,Xe,"↶","\\curvearrowleft",!0);U(ne,Ge,Xe,"↺","\\circlearrowleft",!0);U(ne,Ge,Xe,"↰","\\Lsh",!0);U(ne,Ge,Xe,"⇈","\\upuparrows",!0);U(ne,Ge,Xe,"↿","\\upharpoonleft",!0);U(ne,Ge,Xe,"⇃","\\downharpoonleft",!0);U(ne,be,Xe,"⊶","\\origof",!0);U(ne,be,Xe,"⊷","\\imageof",!0);U(ne,Ge,Xe,"⊸","\\multimap",!0);U(ne,Ge,Xe,"↭","\\leftrightsquigarrow",!0);U(ne,Ge,Xe,"⇉","\\rightrightarrows",!0);U(ne,Ge,Xe,"⇄","\\rightleftarrows",!0);U(ne,Ge,Xe,"↠","\\twoheadrightarrow",!0);U(ne,Ge,Xe,"↣","\\rightarrowtail",!0);U(ne,Ge,Xe,"↬","\\looparrowright",!0);U(ne,Ge,Xe,"↷","\\curvearrowright",!0);U(ne,Ge,Xe,"↻","\\circlearrowright",!0);U(ne,Ge,Xe,"↱","\\Rsh",!0);U(ne,Ge,Xe,"⇊","\\downdownarrows",!0);U(ne,Ge,Xe,"↾","\\upharpoonright",!0);U(ne,Ge,Xe,"⇂","\\downharpoonright",!0);U(ne,Ge,Xe,"⇝","\\rightsquigarrow",!0);U(ne,Ge,Xe,"⇝","\\leadsto");U(ne,Ge,Xe,"⇛","\\Rrightarrow",!0);U(ne,Ge,Xe,"↾","\\restriction");U(ne,be,Ze,"‘","`");U(ne,be,Ze,"$","\\$");U(Lt,be,Ze,"$","\\$");U(Lt,be,Ze,"$","\\textdollar");U(ne,be,Ze,"%","\\%");U(Lt,be,Ze,"%","\\%");U(ne,be,Ze,"_","\\_");U(Lt,be,Ze,"_","\\_");U(Lt,be,Ze,"_","\\textunderscore");U(ne,be,Ze,"∠","\\angle",!0);U(ne,be,Ze,"∞","\\infty",!0);U(ne,be,Ze,"′","\\prime");U(ne,be,Ze,"△","\\triangle");U(ne,be,Ze,"Γ","\\Gamma",!0);U(ne,be,Ze,"Δ","\\Delta",!0);U(ne,be,Ze,"Θ","\\Theta",!0);U(ne,be,Ze,"Λ","\\Lambda",!0);U(ne,be,Ze,"Ξ","\\Xi",!0);U(ne,be,Ze,"Π","\\Pi",!0);U(ne,be,Ze,"Σ","\\Sigma",!0);U(ne,be,Ze,"Υ","\\Upsilon",!0);U(ne,be,Ze,"Φ","\\Phi",!0);U(ne,be,Ze,"Ψ","\\Psi",!0);U(ne,be,Ze,"Ω","\\Omega",!0);U(ne,be,Ze,"A","Α");U(ne,be,Ze,"B","Β");U(ne,be,Ze,"E","Ε");U(ne,be,Ze,"Z","Ζ");U(ne,be,Ze,"H","Η");U(ne,be,Ze,"I","Ι");U(ne,be,Ze,"K","Κ");U(ne,be,Ze,"M","Μ");U(ne,be,Ze,"N","Ν");U(ne,be,Ze,"O","Ο");U(ne,be,Ze,"P","Ρ");U(ne,be,Ze,"T","Τ");U(ne,be,Ze,"X","Χ");U(ne,be,Ze,"¬","\\neg",!0);U(ne,be,Ze,"¬","\\lnot");U(ne,be,Ze,"⊤","\\top");U(ne,be,Ze,"⊥","\\bot");U(ne,be,Ze,"∅","\\emptyset");U(ne,Ge,Ze,"∅","\\varnothing");U(ne,be,Dr,"α","\\alpha",!0);U(ne,be,Dr,"β","\\beta",!0);U(ne,be,Dr,"γ","\\gamma",!0);U(ne,be,Dr,"δ","\\delta",!0);U(ne,be,Dr,"ϵ","\\epsilon",!0);U(ne,be,Dr,"ζ","\\zeta",!0);U(ne,be,Dr,"η","\\eta",!0);U(ne,be,Dr,"θ","\\theta",!0);U(ne,be,Dr,"ι","\\iota",!0);U(ne,be,Dr,"κ","\\kappa",!0);U(ne,be,Dr,"λ","\\lambda",!0);U(ne,be,Dr,"μ","\\mu",!0);U(ne,be,Dr,"ν","\\nu",!0);U(ne,be,Dr,"ξ","\\xi",!0);U(ne,be,Dr,"ο","\\omicron",!0);U(ne,be,Dr,"π","\\pi",!0);U(ne,be,Dr,"ρ","\\rho",!0);U(ne,be,Dr,"σ","\\sigma",!0);U(ne,be,Dr,"τ","\\tau",!0);U(ne,be,Dr,"υ","\\upsilon",!0);U(ne,be,Dr,"ϕ","\\phi",!0);U(ne,be,Dr,"χ","\\chi",!0);U(ne,be,Dr,"ψ","\\psi",!0);U(ne,be,Dr,"ω","\\omega",!0);U(ne,be,Dr,"ε","\\varepsilon",!0);U(ne,be,Dr,"ϑ","\\vartheta",!0);U(ne,be,Dr,"ϖ","\\varpi",!0);U(ne,be,Dr,"ϱ","\\varrho",!0);U(ne,be,Dr,"ς","\\varsigma",!0);U(ne,be,Dr,"φ","\\varphi",!0);U(ne,be,or,"∗","*",!0);U(ne,be,or,"+","+");U(ne,be,or,"−","-",!0);U(ne,be,or,"⋅","\\cdot",!0);U(ne,be,or,"∘","\\circ",!0);U(ne,be,or,"÷","\\div",!0);U(ne,be,or,"±","\\pm",!0);U(ne,be,or,"×","\\times",!0);U(ne,be,or,"∩","\\cap",!0);U(ne,be,or,"∪","\\cup",!0);U(ne,be,or,"∖","\\setminus",!0);U(ne,be,or,"∧","\\land");U(ne,be,or,"∨","\\lor");U(ne,be,or,"∧","\\wedge",!0);U(ne,be,or,"∨","\\vee",!0);U(ne,be,Ze,"√","\\surd");U(ne,be,Ic,"⟨","\\langle",!0);U(ne,be,Ic,"∣","\\lvert");U(ne,be,Ic,"∥","\\lVert");U(ne,be,Sl,"?","?");U(ne,be,Sl,"!","!");U(ne,be,Sl,"⟩","\\rangle",!0);U(ne,be,Sl,"∣","\\rvert");U(ne,be,Sl,"∥","\\rVert");U(ne,be,Xe,"=","=");U(ne,be,Xe,":",":");U(ne,be,Xe,"≈","\\approx",!0);U(ne,be,Xe,"≅","\\cong",!0);U(ne,be,Xe,"≥","\\ge");U(ne,be,Xe,"≥","\\geq",!0);U(ne,be,Xe,"←","\\gets");U(ne,be,Xe,">","\\gt",!0);U(ne,be,Xe,"∈","\\in",!0);U(ne,be,Xe,"","\\@not");U(ne,be,Xe,"⊂","\\subset",!0);U(ne,be,Xe,"⊃","\\supset",!0);U(ne,be,Xe,"⊆","\\subseteq",!0);U(ne,be,Xe,"⊇","\\supseteq",!0);U(ne,Ge,Xe,"⊈","\\nsubseteq",!0);U(ne,Ge,Xe,"⊉","\\nsupseteq",!0);U(ne,be,Xe,"⊨","\\models");U(ne,be,Xe,"←","\\leftarrow",!0);U(ne,be,Xe,"≤","\\le");U(ne,be,Xe,"≤","\\leq",!0);U(ne,be,Xe,"<","\\lt",!0);U(ne,be,Xe,"→","\\rightarrow",!0);U(ne,be,Xe,"→","\\to");U(ne,Ge,Xe,"≱","\\ngeq",!0);U(ne,Ge,Xe,"≰","\\nleq",!0);U(ne,be,p0," ","\\ ");U(ne,be,p0," ","\\space");U(ne,be,p0," ","\\nobreakspace");U(Lt,be,p0," ","\\ ");U(Lt,be,p0," "," ");U(Lt,be,p0," ","\\space");U(Lt,be,p0," ","\\nobreakspace");U(ne,be,p0,"","\\nobreak");U(ne,be,p0,"","\\allowbreak");U(ne,be,LE,",",",");U(ne,be,LE,";",";");U(ne,Ge,or,"⊼","\\barwedge",!0);U(ne,Ge,or,"⊻","\\veebar",!0);U(ne,be,or,"⊙","\\odot",!0);U(ne,be,or,"⊕","\\oplus",!0);U(ne,be,or,"⊗","\\otimes",!0);U(ne,be,Ze,"∂","\\partial",!0);U(ne,be,or,"⊘","\\oslash",!0);U(ne,Ge,or,"⊚","\\circledcirc",!0);U(ne,Ge,or,"⊡","\\boxdot",!0);U(ne,be,or,"△","\\bigtriangleup");U(ne,be,or,"▽","\\bigtriangledown");U(ne,be,or,"†","\\dagger");U(ne,be,or,"⋄","\\diamond");U(ne,be,or,"⋆","\\star");U(ne,be,or,"◃","\\triangleleft");U(ne,be,or,"▹","\\triangleright");U(ne,be,Ic,"{","\\{");U(Lt,be,Ze,"{","\\{");U(Lt,be,Ze,"{","\\textbraceleft");U(ne,be,Sl,"}","\\}");U(Lt,be,Ze,"}","\\}");U(Lt,be,Ze,"}","\\textbraceright");U(ne,be,Ic,"{","\\lbrace");U(ne,be,Sl,"}","\\rbrace");U(ne,be,Ic,"[","\\lbrack",!0);U(Lt,be,Ze,"[","\\lbrack",!0);U(ne,be,Sl,"]","\\rbrack",!0);U(Lt,be,Ze,"]","\\rbrack",!0);U(ne,be,Ic,"(","\\lparen",!0);U(ne,be,Sl,")","\\rparen",!0);U(Lt,be,Ze,"<","\\textless",!0);U(Lt,be,Ze,">","\\textgreater",!0);U(ne,be,Ic,"⌊","\\lfloor",!0);U(ne,be,Sl,"⌋","\\rfloor",!0);U(ne,be,Ic,"⌈","\\lceil",!0);U(ne,be,Sl,"⌉","\\rceil",!0);U(ne,be,Ze,"\\","\\backslash");U(ne,be,Ze,"∣","|");U(ne,be,Ze,"∣","\\vert");U(Lt,be,Ze,"|","\\textbar",!0);U(ne,be,Ze,"∥","\\|");U(ne,be,Ze,"∥","\\Vert");U(Lt,be,Ze,"∥","\\textbardbl");U(Lt,be,Ze,"~","\\textasciitilde");U(Lt,be,Ze,"\\","\\textbackslash");U(Lt,be,Ze,"^","\\textasciicircum");U(ne,be,Xe,"↑","\\uparrow",!0);U(ne,be,Xe,"⇑","\\Uparrow",!0);U(ne,be,Xe,"↓","\\downarrow",!0);U(ne,be,Xe,"⇓","\\Downarrow",!0);U(ne,be,Xe,"↕","\\updownarrow",!0);U(ne,be,Xe,"⇕","\\Updownarrow",!0);U(ne,be,ns,"∐","\\coprod");U(ne,be,ns,"⋁","\\bigvee");U(ne,be,ns,"⋀","\\bigwedge");U(ne,be,ns,"⨄","\\biguplus");U(ne,be,ns,"⋂","\\bigcap");U(ne,be,ns,"⋃","\\bigcup");U(ne,be,ns,"∫","\\int");U(ne,be,ns,"∫","\\intop");U(ne,be,ns,"∬","\\iint");U(ne,be,ns,"∭","\\iiint");U(ne,be,ns,"∏","\\prod");U(ne,be,ns,"∑","\\sum");U(ne,be,ns,"⨂","\\bigotimes");U(ne,be,ns,"⨁","\\bigoplus");U(ne,be,ns,"⨀","\\bigodot");U(ne,be,ns,"∮","\\oint");U(ne,be,ns,"∯","\\oiint");U(ne,be,ns,"∰","\\oiiint");U(ne,be,ns,"⨆","\\bigsqcup");U(ne,be,ns,"∫","\\smallint");U(Lt,be,H3,"…","\\textellipsis");U(ne,be,H3,"…","\\mathellipsis");U(Lt,be,H3,"…","\\ldots",!0);U(ne,be,H3,"…","\\ldots",!0);U(ne,be,H3,"⋯","\\@cdots",!0);U(ne,be,H3,"⋱","\\ddots",!0);U(ne,be,Ze,"⋮","\\varvdots");U(Lt,be,Ze,"⋮","\\varvdots");U(ne,be,na,"ˊ","\\acute");U(ne,be,na,"ˋ","\\grave");U(ne,be,na,"¨","\\ddot");U(ne,be,na,"~","\\tilde");U(ne,be,na,"ˉ","\\bar");U(ne,be,na,"˘","\\breve");U(ne,be,na,"ˇ","\\check");U(ne,be,na,"^","\\hat");U(ne,be,na,"⃗","\\vec");U(ne,be,na,"˙","\\dot");U(ne,be,na,"˚","\\mathring");U(ne,be,Dr,"","\\@imath");U(ne,be,Dr,"","\\@jmath");U(ne,be,Ze,"ı","ı");U(ne,be,Ze,"ȷ","ȷ");U(Lt,be,Ze,"ı","\\i",!0);U(Lt,be,Ze,"ȷ","\\j",!0);U(Lt,be,Ze,"ß","\\ss",!0);U(Lt,be,Ze,"æ","\\ae",!0);U(Lt,be,Ze,"œ","\\oe",!0);U(Lt,be,Ze,"ø","\\o",!0);U(Lt,be,Ze,"Æ","\\AE",!0);U(Lt,be,Ze,"Œ","\\OE",!0);U(Lt,be,Ze,"Ø","\\O",!0);U(Lt,be,na,"ˊ","\\'");U(Lt,be,na,"ˋ","\\`");U(Lt,be,na,"ˆ","\\^");U(Lt,be,na,"˜","\\~");U(Lt,be,na,"ˉ","\\=");U(Lt,be,na,"˘","\\u");U(Lt,be,na,"˙","\\.");U(Lt,be,na,"¸","\\c");U(Lt,be,na,"˚","\\r");U(Lt,be,na,"ˇ","\\v");U(Lt,be,na,"¨",'\\"');U(Lt,be,na,"˝","\\H");U(Lt,be,na,"◯","\\textcircled");var l8e={"--":!0,"---":!0,"``":!0,"''":!0};U(Lt,be,Ze,"–","--",!0);U(Lt,be,Ze,"–","\\textendash");U(Lt,be,Ze,"—","---",!0);U(Lt,be,Ze,"—","\\textemdash");U(Lt,be,Ze,"‘","`",!0);U(Lt,be,Ze,"‘","\\textquoteleft");U(Lt,be,Ze,"’","'",!0);U(Lt,be,Ze,"’","\\textquoteright");U(Lt,be,Ze,"“","``",!0);U(Lt,be,Ze,"“","\\textquotedblleft");U(Lt,be,Ze,"”","''",!0);U(Lt,be,Ze,"”","\\textquotedblright");U(ne,be,Ze,"°","\\degree",!0);U(Lt,be,Ze,"°","\\degree");U(Lt,be,Ze,"°","\\textdegree",!0);U(ne,be,Ze,"£","\\pounds");U(ne,be,Ze,"£","\\mathsterling",!0);U(Lt,be,Ze,"£","\\pounds");U(Lt,be,Ze,"£","\\textsterling",!0);U(ne,Ge,Ze,"✠","\\maltese");U(Lt,Ge,Ze,"✠","\\maltese");var zhe='0123456789/@."';for(var HB=0;HB{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 Khe[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return A9t[a]}else{if(n===120485||n===120486)return Khe[0];if(120486{if(Kp(t.classes)!==Kp(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},c8e=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},Ot=function(e,r,n,i){var a=new z3(e,r,n,i);return eJ(a),a},Qp=(t,e,r,n)=>new z3(t,e,r,n),GT=function(e,r,n){var i=Ot([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Yt(i.height),i.maxFontSize=1,i},L9t=function(e,r,n,i){var a=new vN(e,r,n,i);return eJ(a),a},g0=function(e){var r=new F3(e);return eJ(r),r},UT=function(e,r){return e instanceof F3?Ot([],[e],r):e},I9t=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=Ot(["mspace"],[],e),n=la(t,e);return r.style.marginRight=Yt(n),r},BA=(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},Uq={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"}},h8e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},d8e=function(e,r){var[n,i,a]=h8e[e],s=new Zp(n),o=new jf([s],{width:Yt(i),height:Yt(a),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Qp(["overlay"],[o],r);return l.height=a,l.style.height=Yt(a),l.style.width=Yt(i),l},sa={number:3,unit:"mu"},Xg={number:4,unit:"mu"},Ud={number:5,unit:"mu"},$9t={mord:{mop:sa,mbin:Xg,mrel:Ud,minner:sa},mop:{mord:sa,mop:sa,mrel:Ud,minner:sa},mbin:{mord:Xg,mop:Xg,mopen:Xg,minner:Xg},mrel:{mord:Ud,mop:Ud,mopen:Ud,minner:Ud},mopen:{},mclose:{mop:sa,mbin:Xg,mrel:Ud,minner:sa},mpunct:{mord:sa,mop:sa,mrel:Ud,mopen:sa,mclose:sa,mpunct:sa,minner:sa},minner:{mord:sa,mop:sa,mbin:Xg,mrel:Ud,mopen:sa,mpunct:sa,minner:sa}},N9t={mord:{mop:sa},mop:{mord:sa,mop:sa},mbin:{},mrel:{},mopen:{},mclose:{mop:sa},mpunct:{},minner:{mop:sa}},f8e={},mL={},yL={};function rr(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"&&O9t.has(v)?m.classes[0]="mord":v==="mbin"&&D9t.has(y)&&(g.classes[0]="mord")},{node:d},f,p),Yq(a,(g,m)=>{var y,v,x=Xq(m),b=Xq(g),T=x&&b?g.hasClass("mtight")?(y=N9t[x])==null?void 0:y[b]:(v=$9t[x])==null?void 0:v[b]:null;if(T)return u8e(T,u)},{node:d},f,p),a},Yq=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()},p8e=function(e){return e instanceof F3||e instanceof vN||e instanceof z3&&e.hasClass("enclosing")?e:null},jq=function(e,r){var n=p8e(e);if(n){var i=n.children;if(i.length){if(r==="right")return jq(i[i.length-1],"right");if(r==="left")return jq(i[0],"left")}}return e},Xq=function(e,r){if(!e)return null;r&&(e=jq(e,r));var n=e.classes[0];return B9t[n]||null},s6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ot(r.concat(n))},Qn=function(e,r,n){if(!e)return Ot();if(mL[e.type]){var i=mL[e.type](e,r);if(n&&r.size!==n.size){i=Ot(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Ht("Got group of unknown type: '"+e.type+"'")};function FA(t,e){var r=Ot(["base"],t,e),n=Ot(["strut"]);return n.style.height=Yt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Yt(-r.depth)),r.children.unshift(n),r}function Kq(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=vs(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(FA(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(FA(s,e));var u;r?(u=FA(vs(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Ot(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Yt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Yt(-h.depth))}return h}function g8e(t){return new F3(t)}class qt{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=Kp(this.classes));for(var n=0;n0&&(e+=' class ="'+_o(Kp(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Qa{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return _o(this.toText())}toText(){return this.text}}class m8e{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",Yt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var F9t=new Set(["\\imath","\\jmath"]),z9t=new Set(["mrow","mtable"]),du=function(e,r,n){return ea[r][e]&&ea[r][e].replace&&e.charCodeAt(0)!==55349&&!(l8e.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ea[r][e].replace),new Qa(e)},tJ=function(e){return e.length===1?e[0]:new qt("mrow",e)},H9t={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"},rJ=(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=H9t[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(F9t.has(a))return null;if(ea[n][a]){var s=ea[n][a].replace;s&&(a=s)}var o=Uq[r].fontName;return QQ(a,o,n)?Uq[r].variant:null};function GB(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Qa&&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 Qa&&r.text===","}else return!1}var $c=function(e,r,n){if(e.length===1){var i=bi(e[0],r);return n&&i instanceof qt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||GB(s))){var u=l.children[0];u instanceof qt&&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 Qa&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Qa&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Jp=function(e,r,n){return tJ($c(e,r,n))},bi=function(e,r){if(!e)return new qt("mrow");if(yL[e.type])return yL[e.type](e,r);throw new Ht("Got group of unknown type: '"+e.type+"'")};function Zhe(t,e,r,n,i){var a=$c(t,r),s;a.length===1&&a[0]instanceof qt&&z9t.has(a[0].type)?s=a[0]:s=new qt("mrow",a);var o=new qt("annotation",[new Qa(e)]);o.setAttribute("encoding","application/x-tex");var l=new qt("semantics",[s,o]),u=new qt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Ot([h],[u])}var V9t=[[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]],Qhe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Jhe=function(e,r){return r.size<2?e:V9t[e-1][r.size-1]};class uf{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||uf.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=Qhe[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 uf(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Jhe(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:Qhe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Jhe(uf.BASESIZE,e);return this.size===r&&this.textSize===uf.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!==uf.BASESIZE?["sizing","reset-size"+this.size,"size"+uf.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=S9t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}uf.BASESIZE=6;var y8e=function(e){return new uf({style:e.displayMode?ln.DISPLAY:ln.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},v8e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Ot(n,[e])}return e},W9t=function(e,r,n){var i=y8e(n),a;if(n.output==="mathml")return Zhe(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=Kq(e,i);a=Ot(["katex"],[s])}else{var o=Zhe(e,r,i,n.displayMode,!1),l=Kq(e,i);a=Ot(["katex"],[o,l])}return v8e(a,n)},q9t=function(e,r,n){var i=y8e(n),a=Kq(e,i),s=Ot(["katex"],[a]);return v8e(s,n)},G9t={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":"="},wN=function(e){var r=new qt("mo",[new Qa(G9t[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},U9t={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]},Y9t=new Set(["widehat","widecheck","widetilde","utilde"]),TN=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Y9t.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 Zp(d),m=new jf([g],{width:"100%",height:Yt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Qp([],[m],r),minWidth:0,height:f}}else{var y=[],v=U9t[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[x,b,T]=v,k=T/1e3,S=x.length,C,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],E=[v[3]]}else if(S===2)C=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)C=["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 A=0;A0&&(i.style.minWidth=Yt(a)),i},j9t=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Ot(["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 zq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new zq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new jf(u,{width:"100%",height:Yt(o)});s=Qp([],[h],a)}return s.height=o,s.style.height=Yt(o),s},X9t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},K9t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Z9t(t){return t in X9t}function gn(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 kN(t){var e=CN(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 CN(t){return t&&(t.type==="atom"||K9t.hasOwnProperty(t.type))?t:null}var b8e=t=>{if(t instanceof Ec)return t;if(C9t(t)&&t.children.length===1)return b8e(t.children[0])},nJ=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=gn(t.base,"accent"),r=n.base,t.base=r,i=k9t(Qn(t,e)),t.base=n):(n=gn(t,"accent"),r=n.base);var a=Qn(r,e.havingCrampedStyle()),s=n.isShifty&&f0(r),o=0;if(s){var l,u;o=(l=(u=b8e(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=TN(n,e),f=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Yt(2*o)+")",marginLeft:Yt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=d8e("vec",e),g=h8e.vec[1]):(p=xN({mode:n.mode,text:n.label},e,"textord"),p=T9t(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Ot(["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=Yt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Ot(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},x8e=(t,e)=>{var r=t.isStretchy?wN(t.label):new qt("mo",[du(t.label,t.mode)]),n=new qt("mover",[bi(t.base,e),r]);return n.setAttribute("accent","true"),n},Q9t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));rr({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=vL(e[0]),n=!Q9t.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:nJ,mathmlBuilder:x8e});rr({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:nJ,mathmlBuilder:x8e});rr({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=Qn(t.base,e),n=TN(t,e),i=t.label==="\\utilde"?.12:0,a=Zn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Ot(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=wN(t.label),n=new qt("munder",[bi(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var zA=t=>{var e=new qt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};rr({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=UT(Qn(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=UT(Qn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=TN(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=Zn({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=Zn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ot(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=wN(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=zA(bi(t.body,e));if(t.below){var a=zA(bi(t.below,e));n=new qt("munderover",[r,a,i])}else n=new qt("mover",[r,i])}else if(t.below){var s=zA(bi(t.below,e));n=new qt("munder",[r,s])}else n=zA(),n=new qt("mover",[r,n]);return n}});function w8e(t,e){var r=vs(t.body,e,!0);return Ot([t.mclass],r,e)}function T8e(t,e){var r,n=$c(t.body,e);return t.mclass==="minner"?r=new qt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new qt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new qt("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}rr({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:Za(i),isCharacterBox:f0(i)}},htmlBuilder:w8e,mathmlBuilder:T8e});var SN=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"};rr({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:SN(e[0]),body:Za(e[1]),isCharacterBox:f0(e[1])}}});rr({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=SN(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Za(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:f0(l)}},htmlBuilder:w8e,mathmlBuilder:T8e});rr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:SN(e[0]),body:Za(e[0])}},htmlBuilder(t,e){var r=vs(t.body,e,!0),n=Ot([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=$c(t.body,e),n=new qt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var J9t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},ede=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),tde=t=>t.type==="textord"&&t.text==="@",eMt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function tMt(t,e,r){var n=J9t[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 rMt(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 Ht("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=tMt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=ede()}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([])}}rr({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=UT(Qn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Yt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new qt("mrow",[bi(t.label,e)]);return r=new qt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new qt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});rr({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=UT(Qn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new qt("mrow",[bi(t.fragment,e)])}});rr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=gn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Ht("\\@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 k8e=(t,e)=>{var r=vs(t.body,e.withColor(t.color),!1);return g0(r)},C8e=(t,e)=>{var r=$c(t.body,e.withColor(t.color)),n=new qt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};rr({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=gn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Za(i)}},htmlBuilder:k8e,mathmlBuilder:C8e});rr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=gn(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:k8e,mathmlBuilder:C8e});rr({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&&gn(i,"size").value}},htmlBuilder(t,e){var r=Ot(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Yt(la(t.size,e)))),r},mathmlBuilder(t,e){var r=new qt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Yt(la(t.size,e)))),r}});var Zq={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},S8e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Ht("Expected a control sequence",t);return e},nMt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},E8e=(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)};rr({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(Zq[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=Zq[n.text]),gn(e.parseFunction(),"internal");throw new Ht("Invalid token after macro prefix",n)}});rr({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 Ht("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 Ht('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Ht('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Ht("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===Zq[r]),{type:"internal",mode:e.mode}}});rr({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=S8e(e.gullet.popToken());e.gullet.consumeSpaces();var i=nMt(e);return E8e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});rr({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=S8e(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return E8e(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var D5=function(e,r,n){var i=ea.math[e]&&ea.math[e].replace,a=QQ(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},iJ=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Ot(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},A8e=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=Yt(a),e.height-=a,e.depth+=a},iMt=function(e,r,n,i,a,s){var o=Qo(e,"Main-Regular",a,i),l=iJ(o,r,i,s);return A8e(l,i,r),l},aMt=function(e,r,n,i){return Qo(e,"Size"+r+"-Regular",n,i)},R8e=function(e,r,n,i,a,s){var o=aMt(e,r,a,i),l=iJ(Ot(["delimsizing","size"+r],[o],i),ln.TEXT,i,s);return n&&A8e(l,i,ln.TEXT),l},UB=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ot(["delimsizinginner",i],[Ot([],[Qo(e,r,n)])]);return{type:"elem",elem:a}},YB=function(e,r,n){var i=Gh["Size4-Regular"][e.charCodeAt(0)]?Gh["Size4-Regular"][e.charCodeAt(0)][4]:Gh["Size1-Regular"][e.charCodeAt(0)][4],a=new Zp("inner",g9t(e,Math.round(1e3*r))),s=new jf([a],{width:Yt(i),height:Yt(r),style:"width:"+Yt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Qp([],[s],n);return o.height=r,o.style.height=Yt(r),o.style.width=Yt(i),{type:"elem",elem:o}},Qq=.008,HA={type:"kern",size:-1*Qq},sMt=new Set(["|","\\lvert","\\rvert","\\vert"]),oMt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),_8e=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"):sMt.has(e)?(u="∣",d="vert",f=333):oMt.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=D5(o,p,a),m=g.height+g.depth,y=D5(u,p,a),v=y.height+y.depth,x=D5(h,p,a),b=x.height+x.depth,T=0,k=1;if(l!==null){var S=D5(l,p,a);T=S.height+S.depth,k=2}var C=m+b+T,E=Math.max(0,Math.ceil((r-C)/(k*v))),A=C+E*k*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=A/2-M,P=[];if(d.length>0){var N=A-m-b,_=Math.round(A*1e3),I=m9t(d,Math.round(N*1e3)),O=new Zp(d,I),D=Yt(f/1e3),$=Yt(_/1e3),F=new jf([O],{width:D,height:$,viewBox:"0 0 "+f+" "+_}),z=Qp([],[F],i);z.height=_/1e3,z.style.width=D,z.style.height=$,P.push({type:"elem",elem:z})}else{if(P.push(UB(h,p,a)),P.push(HA),l===null){var H=A-m-b+2*Qq;P.push(YB(u,H,i))}else{var B=(A-m-b-T)/2+2*Qq;P.push(YB(u,B,i)),P.push(HA),P.push(UB(l,p,a)),P.push(HA),P.push(YB(u,B,i))}P.push(HA),P.push(UB(o,p,a))}var V=i.havingBaseStyle(ln.TEXT),q=Zn({positionType:"bottom",positionData:L,children:P});return iJ(Ot(["delimsizing","mult"],[q],V),ln.TEXT,i,s)},jB=80,XB=.08,KB=function(e,r,n,i,a){var s=p9t(e,i,n),o=new Zp(e,s),l=new jf([o],{width:"400em",height:Yt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Qp(["hide-tail"],[l],a)},lMt=function(e,r){var n=r.havingBaseSizing(),i=N8e("\\surd",e*n.sizeMultiplier,$8e,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+jB,e<1?a=1:e<1.4&&(a=.7),l=(1+s+XB)/a,u=(1+s)/a,o=KB("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+jB)*FC[i.size],u=(FC[i.size]+s)/a,l=(FC[i.size]+s+XB)/a,o=KB("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+XB,u=e+s,h=Math.floor(1e3*e+s)+jB,o=KB("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Yt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},M8e=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),cMt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),L8e=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),FC=[0,1.2,1.8,2.4,3],I8e=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),M8e.has(e)||L8e.has(e))return R8e(e,r,!1,n,i,a);if(cMt.has(e))return _8e(e,FC[r],!1,n,i,a);throw new Ht("Illegal delimiter: '"+e+"'")},uMt=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],hMt=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"stack"}],$8e=[{type:"small",style:ln.SCRIPTSCRIPT},{type:"small",style:ln.SCRIPT},{type:"small",style:ln.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],dMt=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.")},N8e=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]},Jq=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;L8e.has(e)?o=uMt:M8e.has(e)?o=$8e:o=hMt;var l=N8e(e,r,o,i);return l.type==="small"?iMt(e,l.style,n,i,a,s):l.type==="large"?R8e(e,l.size,n,i,a,s):_8e(e,r,n,i,a,s)},ZB=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 Jq(e,d,!0,i,a,s)},rde={"\\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}},fMt=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 nde(t){return"isMiddle"in t}function EN(t,e){var r=CN(t);if(r&&fMt.has(r.text))return r;throw r?new Ht("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Ht("Invalid delimiter type '"+t.type+"'",t)}rr({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=EN(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:rde[t.funcName].size,mclass:rde[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ot([t.mclass]):I8e(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(du(t.delim,t.mode));var r=new qt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Yt(FC[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function ide(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}rr({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 Ht("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:EN(e[0],t).text,color:r}}});rr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=EN(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=gn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{ide(t);for(var r=vs(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{ide(t);var r=$c(t.body,e);if(t.left!=="."){var n=new qt("mo",[du(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new qt("mo",[du(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return tJ(r)}});rr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=EN(e[0],t);if(!t.parser.leftrightDepth)throw new Ht("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=s6(e,[]):(r=I8e(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?du("|","text"):du(t.delim,t.mode),n=new qt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var AN=(t,e)=>{var r=UT(Qn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=f0(t.body);if(n==="sout")a=Ot(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=la({number:.6,unit:"pt"},e),u=la({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Yt(d/2+l);var f=Math.floor(1e3*d*i),p=d9t(f),g=new jf([new Zp("phase",p)],{width:"400em",height:Yt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Qp(["hide-tail"],[g],e),a.style.height=Yt(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=j9t(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Yt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Yt(v),a.style.borderRightWidth=Yt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=Zn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];x=Zn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(x.height=r.height,x.depth=r.depth),/cancel/.test(n)&&!o?Ot(["mord","cancel-lap"],[x],e):Ot(["mord"],[x],e)},RN=(t,e)=>{var r,n=new qt(t.label.includes("colorbox")?"mpadded":"menclose",[bi(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: "+Yt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};rr({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=gn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:AN,mathmlBuilder:RN});rr({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=gn(e[0],"color-token").color,s=gn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:AN,mathmlBuilder:RN});rr({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]}}});rr({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:AN,mathmlBuilder:RN});rr({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:AN,mathmlBuilder:RN});rr({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 D8e={};function wd(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 Ht("{"+t.envName+"} can be used only in display mode.")},pMt=new Set(["gather","gather*"]);function aJ(t){if(!t.includes("ed"))return!t.includes("*")}function wg(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 Ht("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],x=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new bc("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(ade(t));;){var k=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:k};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Ht("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(C==="\\end"){T(),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:Ce[oe]})}for(T(s[0]),n=0;n0&&(L+=x,CCe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var J,re;Z=(J=(re=V)==null?void 0:re.pregap)!=null?J:f,Z!==0&&(I=Ot(["arraycolsep"],[]),I.style.width=Yt(Z),_.push(I))}var ee=[];for(n=0;n0){for(var ge=GT("hline",r,h),Ve=GT("hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Ae=u.pop(),Ue=Ae.pos-P;Ae.isDashed?we.push({type:"elem",elem:Ve,shift:Ue}):we.push({type:"elem",elem:ge,shift:Ue})}Te=Zn({positionType:"individualShift",children:we})}if(D.length===0)return Ot(["mord"],[Te],r);var le=Zn({positionType:"individualShift",children:D}),pe=Ot(["tag"],[le],r);return g0([Te,pe])},gMt={c:"center ",l:"left ",r:"right "},kd=function(e,r){for(var n=[],i=new qt("mtd",[],["mtr-glue"]),a=new qt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",y=!1,v=0,x=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",x-=1);for(var b=v;b0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var M=1;M0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};wd({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=CN(e[0]),n=r?[e[0]]:gn(e[0],"ordgroup").body,i=n.map(function(s){var o=kN(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 Ht("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return wg(t.parser,a,sJ(t.envName))},htmlBuilder:Td,mathmlBuilder:kd});wd({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 Ht("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=wg(t.parser,n,sJ(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:Td,mathmlBuilder:kd});wd({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=wg(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=CN(e[0]),n=r?[e[0]]:gn(e[0],"ordgroup").body,i=n.map(function(o){var l=kN(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Ht("Unknown column alignment: "+u,o)});if(i.length>1)throw new Ht("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=wg(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Ht("{subarray} can contain only one column");return s},htmlBuilder:Td,mathmlBuilder:kd});wd({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=wg(t.parser,e,sJ(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:P8e,htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){pMt.has(t.envName)&&_N(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:aJ(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return wg(t.parser,e,"display")},htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:P8e,htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){_N(t);var e={autoTag:aJ(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return wg(t.parser,e,"display")},htmlBuilder:Td,mathmlBuilder:kd});wd({type:"array",names:["CD"],props:{numArgs:0},handler(t){return _N(t),rMt(t.parser)},htmlBuilder:Td,mathmlBuilder:kd});Ee("\\nonumber","\\gdef\\@eqnsw{0}");Ee("\\notag","\\nonumber");rr({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Ht(t.funcName+" valid only within array environment")}});var sde=D8e;rr({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 Ht("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return Qn(t.body,n)},F8e=(t,e)=>{var r=t.font,n=e.withFont(r);return bi(t.body,n)},ode={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};rr({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=vL(e[0]),a=n;return a in ode&&(a=ode[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:B8e,mathmlBuilder:F8e});rr({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:SN(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:f0(n)}}});rr({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:B8e,mathmlBuilder:F8e});var mMt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Qn(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 x=e.fontMetrics().axisHeight;p-s.depth-(x+.5*d){var r=new qt("mfrac",[bi(t.numer,e),bi(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=la(t.barSize,e);r.setAttribute("linethickness",Yt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new qt("mo",[new Qa(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new qt("mo",[new Qa(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return tJ(i)}return r},z8e=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};rr({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"),z8e({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:mMt,mathmlBuilder:yMt});rr({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 lde=["display","text","script","scriptscript"],cde=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};rr({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=vL(e[0]),s=a.type==="atom"&&a.family==="open"?cde(a.text):null,o=vL(e[1]),l=o.type==="atom"&&o.family==="close"?cde(o.text):null,u=gn(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=gn(p.body[0],"textord");f=lde[Number(g.text)]}}else p=gn(p,"textord"),f=lde[Number(p.text)];return z8e({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});rr({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:gn(e[0],"size").value,token:i}}});rr({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=gn(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 H8e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Qn(t.sup,e.havingStyle(r.sup()),e):Qn(t.sub,e.havingStyle(r.sub()),e),i=gn(t.base,"horizBrace")):i=gn(t,"horizBrace");var a=Qn(i.base,e.havingBaseStyle(ln.DISPLAY)),s=TN(i,e),o;if(i.isOver?o=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=Zn({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=Ot(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=Zn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ot(["minner",i.isOver?"mover":"munder"],[o],e)},vMt=(t,e)=>{var r=wN(t.label);return new qt(t.isOver?"mover":"munder",[bi(t.base,e),r])};rr({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:H8e,mathmlBuilder:vMt});rr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=gn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Za(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=vs(t.body,e,!1);return L9t(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Jp(t.body,e);return r instanceof qt||(r=new qt("mrow",[r])),r.setAttribute("href",t.href),r}});rr({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=gn(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=gn(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=vs(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Ot(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)=>Jp(t.body,e)});rr({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:Za(e[0]),mathml:Za(e[1])}},htmlBuilder:(t,e)=>{var r=vs(t.html,e,!1);return g0(r)},mathmlBuilder:(t,e)=>Jp(t.mathml,e)});var QB=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 Ht("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!n8e(n))throw new Ht("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};rr({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=gn(r[0],"raw").string,u=l.split(","),h=0;h{var r=la(t.height,e),n=0;t.totalheight.number>0&&(n=la(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=la(t.width,e));var a={height:Yt(r+n)};i>0&&(a.width=Yt(i)),n>0&&(a.verticalAlign=Yt(-n));var s=new x9t(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new qt("mglyph",[]);r.setAttribute("alt",t.alt);var n=la(t.height,e),i=0;if(t.totalheight.number>0&&(i=la(t.totalheight,e)-n,r.setAttribute("valign",Yt(-i))),r.setAttribute("height",Yt(n+i)),t.width.number>0){var a=la(t.width,e);r.setAttribute("width",Yt(a))}return r.setAttribute("src",t.src),r}});rr({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=gn(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 u8e(t.dimension,e)},mathmlBuilder(t,e){var r=la(t.dimension,e);return new m8e(r)}});rr({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=Ot([],[Qn(t.body,e)]),r=Ot(["inner"],[r],e)):r=Ot(["inner"],[Qn(t.body,e)]);var n=Ot(["fix"],[]),i=Ot([t.alignment],[r,n],e),a=Ot(["strut"]);return a.style.height=Yt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Yt(-i.depth)),i.children.unshift(a),i=Ot(["thinbox"],[i],e),Ot(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new qt("mpadded",[bi(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}});rr({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}}});rr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Ht("Mismatched "+t.funcName)}});var ude=(t,e)=>{switch(e.style.size){case ln.DISPLAY.size:return t.display;case ln.TEXT.size:return t.text;case ln.SCRIPT.size:return t.script;case ln.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};rr({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Za(e[0]),text:Za(e[1]),script:Za(e[2]),scriptscript:Za(e[3])}},htmlBuilder:(t,e)=>{var r=ude(t,e),n=vs(r,e,!1);return g0(n)},mathmlBuilder:(t,e)=>{var r=ude(t,e);return Jp(r,e)}});var V8e=(t,e,r,n,i,a,s)=>{t=Ot([],[t]);var o=r&&f0(r),l,u;if(e){var h=Qn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Qn(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=Zn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=Zn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Yt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=Zn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Yt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=Ot(["mspace"],[],n);v.style.marginRight=Yt(a),y.unshift(v)}return Ot(["mop","op-limits"],y,n)},W8e=new Set(["\\smallint"]),V3=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=gn(t.base,"op"),i=!0):a=gn(t,"op");var s=e.style,o=!1;s.size===ln.DISPLAY.size&&a.symbol&&!W8e.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=Qo(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=d8e(d+"Size"+(o?"2":"1"),e);l=Zn({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=vs(a.body,e,!0);p.length===1&&p[0]instanceof Ec?(l=p[0],l.classes[0]="mop"):l=Ot(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new qt("mo",[du(t.name,t.mode)]),W8e.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new qt("mo",$c(t.body,e));else{r=new qt("mi",[new Qa(t.name.slice(1))]);var n=new qt("mo",[du("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=g8e([r,n])}return r},bMt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};rr({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=bMt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:V3,mathmlBuilder:IE});rr({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:Za(n)}},htmlBuilder:V3,mathmlBuilder:IE});var xMt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};rr({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:V3,mathmlBuilder:IE});rr({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:V3,mathmlBuilder:IE});rr({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=xMt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:V3,mathmlBuilder:IE});var q8e=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=gn(t.base,"operatorname"),i=!0):a=gn(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=vs(o,e.withFont("mathrm"),!0),u=0;u{for(var r=$c(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Qa(o)]}var l=new qt("mi",r);l.setAttribute("mathvariant","normal");var u=new qt("mo",[du("⁡","text")]);return t.parentIsSupSub?new qt("mrow",[l,u]):g8e([l,u])};rr({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:Za(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:q8e,mathmlBuilder:wMt});Ee("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Oy({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?g0(vs(t.body,e,!1)):Ot(["mord"],vs(t.body,e,!0),e)},mathmlBuilder(t,e){return Jp(t.body,e,!0)}});rr({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=Qn(t.body,e.havingCrampedStyle()),n=GT("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Ot(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new Qa("‾")]);r.setAttribute("stretchy","true");var n=new qt("mover",[bi(t.body,e),r]);return n.setAttribute("accent","true"),n}});rr({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:Za(n)}},htmlBuilder:(t,e)=>{var r=vs(t.body,e.withPhantom(),!1);return g0(r)},mathmlBuilder:(t,e)=>{var r=$c(t.body,e);return new qt("mphantom",r)}});Ee("\\hphantom","\\smash{\\phantom{#1}}");rr({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=Ot(["inner"],[Qn(t.body,e.withPhantom())]),n=Ot(["fix"],[]);return Ot(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=$c(Za(t.body),e),n=new qt("mphantom",r),i=new qt("mpadded",[n]);return i.setAttribute("width","0px"),i}});rr({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=gn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Qn(t.body,e),n=la(t.dy,e);return Zn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[bi(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});rr({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});rr({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=gn(e[0],"size"),s=gn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&gn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Ot(["mord","rule"],[],e),n=la(t.width,e),i=la(t.height,e),a=t.shift?la(t.shift,e):0;return r.style.borderRightWidth=Yt(n),r.style.borderTopWidth=Yt(i),r.style.bottom=Yt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=la(t.width,e),n=la(t.height,e),i=t.shift?la(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new qt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Yt(r)),s.setAttribute("height",Yt(n));var o=new qt("mpadded",[s]);return i>=0?o.setAttribute("height",Yt(i)):(o.setAttribute("height",Yt(i)),o.setAttribute("depth",Yt(-i))),o.setAttribute("voffset",Yt(i)),o}});function G8e(t,e,r){for(var n=vs(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return G8e(t.body,r,e)};rr({type:"sizing",names:hde,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:hde.indexOf(n)+1,body:a}},htmlBuilder:TMt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=$c(t.body,r),i=new qt("mstyle",n);return i.setAttribute("mathsize",Yt(r.sizeMultiplier)),i}});rr({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]&&gn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Ot([],[Qn(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 Ot(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new qt("mpadded",[bi(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});rr({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=Qn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=UT(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=Yt(h);var p=Zn({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(ln.SCRIPTSCRIPT),m=Qn(t.index,g,e),y=.6*(p.height-p.depth),v=Zn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),x=Ot(["root"],[v]);return Ot(["mord","sqrt"],[x,p],e)}else return Ot(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new qt("mroot",[bi(r,e),bi(n,e)]):new qt("msqrt",[bi(r,e)])}});var eG={display:ln.DISPLAY,text:ln.TEXT,script:ln.SCRIPT,scriptscript:ln.SCRIPTSCRIPT};function kMt(t){return t in eG}rr({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(!kMt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=eG[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),G8e(t.body,n,e)},mathmlBuilder(t,e){var r=eG[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=$c(t.body,n),a=new qt("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 CMt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===ln.DISPLAY.size||n.alwaysHandleSupSub);return i?V3:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===ln.DISPLAY.size||n.limits);return a?q8e:null}else{if(n.type==="accent")return f0(n.base)?nJ:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?H8e:null}else return null}else return null};Oy({type:"supsub",htmlBuilder(t,e){var r=CMt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Qn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&f0(n);if(i){var p=e.havingStyle(e.style.sup());o=Qn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Qn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===ln.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Yt(.5/u.ptPerEm/y),x=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 Ec||b){var T;x=Yt(-((T=s.italic)!=null?T:0))}}var k;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,C=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:o,shift:-h,marginRight:v}];k=Zn({positionType:"individualShift",children:A})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:x,marginRight:v}];k=Zn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),k=Zn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=Xq(s,"right")||"mord";return Ot([L],[s,Ot(["msupsub"],[k])],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=[bi(t.base,e)];t.sub&&a.push(bi(t.sub,e)),t.sup&&a.push(bi(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===ln.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===ln.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===ln.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ln.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===ln.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===ln.DISPLAY)?s="mover":s="msup"}return new qt(s,a)}});Oy({type:"atom",htmlBuilder(t,e){return JQ(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new qt("mo",[du(t.text,t.mode)]);if(t.family==="bin"){var n=rJ(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 U8e={mi:"italic",mn:"normal",mtext:"normal"};Oy({type:"mathord",htmlBuilder(t,e){return xN(t,e,"mathord")},mathmlBuilder(t,e){var r=new qt("mi",[du(t.text,t.mode,e)]),n=rJ(t,e)||"italic";return n!==U8e[r.type]&&r.setAttribute("mathvariant",n),r}});Oy({type:"textord",htmlBuilder(t,e){return xN(t,e,"textord")},mathmlBuilder(t,e){var r=du(t.text,t.mode,e),n=rJ(t,e)||"normal",i;return t.mode==="text"?i=new qt("mtext",[r]):/[0-9]/.test(t.text)?i=new qt("mn",[r]):t.text==="\\prime"?i=new qt("mo",[r]):i=new qt("mi",[r]),n!==U8e[i.type]&&i.setAttribute("mathvariant",n),i}});var JB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},eF={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Oy({type:"spacing",htmlBuilder(t,e){if(eF.hasOwnProperty(t.text)){var r=eF[t.text].className||"";if(t.mode==="text"){var n=xN(t,e,"textord");return n.classes.push(r),n}else return Ot(["mspace",r],[JQ(t.text,t.mode,e)],e)}else{if(JB.hasOwnProperty(t.text))return Ot(["mspace",JB[t.text]],[],e);throw new Ht('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(eF.hasOwnProperty(t.text))r=new qt("mtext",[new Qa(" ")]);else{if(JB.hasOwnProperty(t.text))return new qt("mspace");throw new Ht('Unknown type of space "'+t.text+'"')}return r}});var dde=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};Oy({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[dde(),new qt("mtd",[Jp(t.body,e)]),dde(),new qt("mtd",[Jp(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var fde={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},pde={"\\textbf":"textbf","\\textmd":"textmd"},SMt={"\\textit":"textit","\\textup":"textup"},gde=(t,e)=>{var r=t.font;if(r){if(fde[r])return e.withTextFontFamily(fde[r]);if(pde[r])return e.withTextFontWeight(pde[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(SMt[r])};rr({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:Za(i),font:n}},htmlBuilder(t,e){var r=gde(t,e),n=vs(t.body,r,!0);return Ot(["mord","text"],n,r)},mathmlBuilder(t,e){var r=gde(t,e);return Jp(t.body,r)}});rr({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=Qn(t.body,e),n=GT("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Ot(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new Qa("‾")]);r.setAttribute("stretchy","true");var n=new qt("munder",[bi(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});rr({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=Qn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Zn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[bi(t.body,e)],["vcenter"]);return new qt("mrow",[r])}});rr({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Ht("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=mde(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),vp=f8e,Y8e=`[ \r + ]`,EMt="\\\\[a-zA-Z@]+",AMt="\\\\[^\uD800-\uDFFF]",RMt="("+EMt+")"+Y8e+"*",_Mt=`\\\\( |[ \r ]+ -?)[ \r ]*`,Jq="[̀-ͯ]",CMt=new RegExp(Jq+"+$"),SMt="("+q8e+"+)|"+(kMt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Jq+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Jq+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+TMt)+("|"+wMt+")");let mde=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(SMt,"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 bc("EOF",new Pl(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Ht("Unexpected character: '"+e[r]+"'",new bc(e[r],new Pl(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 bc(i,new Pl(this,r,this.tokenRegex.lastIndex))}};class EMt{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 Ht("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 AMt=$8e;Ee("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Ee("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Ee("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Ee("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Ee("\\@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}});Ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Ee("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var yde={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};Ee("\\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 Ht("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=yde[e.text],n==null||n>=r)throw new Ht("Invalid base-"+r+" digit "+e.text);for(var i;(i=yde[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Ht("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Ht("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Ht("\\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 Ht("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};Ee("\\newcommand",t=>aJ(t,!1,!0,!1));Ee("\\renewcommand",t=>aJ(t,!0,!1,!1));Ee("\\providecommand",t=>aJ(t,!0,!0,!0));Ee("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Ee("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Ee("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),vp[r],ea.math[r],ea.text[r]),""});Ee("\\bgroup","{");Ee("\\egroup","}");Ee("~","\\nobreakspace");Ee("\\lq","`");Ee("\\rq","'");Ee("\\aa","\\r a");Ee("\\AA","\\r A");Ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Ee("ℬ","\\mathscr{B}");Ee("ℰ","\\mathscr{E}");Ee("ℱ","\\mathscr{F}");Ee("ℋ","\\mathscr{H}");Ee("ℐ","\\mathscr{I}");Ee("ℒ","\\mathscr{L}");Ee("ℳ","\\mathscr{M}");Ee("ℛ","\\mathscr{R}");Ee("ℭ","\\mathfrak{C}");Ee("ℌ","\\mathfrak{H}");Ee("ℨ","\\mathfrak{Z}");Ee("\\Bbbk","\\Bbb{k}");Ee("\\llap","\\mathllap{\\textrm{#1}}");Ee("\\rlap","\\mathrlap{\\textrm{#1}}");Ee("\\clap","\\mathclap{\\textrm{#1}}");Ee("\\mathstrut","\\vphantom{(}");Ee("\\underbar","\\underline{\\text{#1}}");Ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Ee("\\ne","\\neq");Ee("≠","\\neq");Ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Ee("∉","\\notin");Ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Ee("⟂","\\perp");Ee("‼","\\mathclose{!\\mkern-0.8mu!}");Ee("∌","\\notni");Ee("⌜","\\ulcorner");Ee("⌝","\\urcorner");Ee("⌞","\\llcorner");Ee("⌟","\\lrcorner");Ee("©","\\copyright");Ee("®","\\textregistered");Ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Ee("⋮","\\vdots");Ee("\\varGamma","\\mathit{\\Gamma}");Ee("\\varDelta","\\mathit{\\Delta}");Ee("\\varTheta","\\mathit{\\Theta}");Ee("\\varLambda","\\mathit{\\Lambda}");Ee("\\varXi","\\mathit{\\Xi}");Ee("\\varPi","\\mathit{\\Pi}");Ee("\\varSigma","\\mathit{\\Sigma}");Ee("\\varUpsilon","\\mathit{\\Upsilon}");Ee("\\varPhi","\\mathit{\\Phi}");Ee("\\varPsi","\\mathit{\\Psi}");Ee("\\varOmega","\\mathit{\\Omega}");Ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");Ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var vde={",":"\\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"},RMt=new Set(["bin","rel"]);Ee("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in vde?e=vde[r]:(r.slice(0,4)==="\\not"||r in ea.math&&RMt.has(ea.math[r].group))&&(e="\\dotsb"),e});var sJ={")":!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};Ee("\\dotso",function(t){var e=t.future().text;return e in sJ?"\\ldots\\,":"\\ldots"});Ee("\\dotsc",function(t){var e=t.future().text;return e in sJ&&e!==","?"\\ldots\\,":"\\ldots"});Ee("\\cdots",function(t){var e=t.future().text;return e in sJ?"\\@cdots\\,":"\\@cdots"});Ee("\\dotsb","\\cdots");Ee("\\dotsm","\\cdots");Ee("\\dotsi","\\!\\cdots");Ee("\\dotsx","\\ldots\\,");Ee("\\DOTSI","\\relax");Ee("\\DOTSB","\\relax");Ee("\\DOTSX","\\relax");Ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Ee("\\,","\\tmspace+{3mu}{.1667em}");Ee("\\thinspace","\\,");Ee("\\>","\\mskip{4mu}");Ee("\\:","\\tmspace+{4mu}{.2222em}");Ee("\\medspace","\\:");Ee("\\;","\\tmspace+{5mu}{.2777em}");Ee("\\thickspace","\\;");Ee("\\!","\\tmspace-{3mu}{.1667em}");Ee("\\negthinspace","\\!");Ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");Ee("\\negthickspace","\\tmspace-{5mu}{.277em}");Ee("\\enspace","\\kern.5em ");Ee("\\enskip","\\hskip.5em\\relax");Ee("\\quad","\\hskip1em\\relax");Ee("\\qquad","\\hskip2em\\relax");Ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");Ee("\\tag@paren","\\tag@literal{({#1})}");Ee("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Ht("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Ee("\\newline","\\\\\\relax");Ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var G8e=Yt(qh["Main-Regular"][84][1]-.7*qh["Main-Regular"][65][1]);Ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+G8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+G8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");Ee("\\@hspace","\\hskip #1\\relax");Ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Ee("\\ordinarycolon",":");Ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Ee("∷","\\dblcolon");Ee("∹","\\eqcolon");Ee("≔","\\coloneqq");Ee("≕","\\eqqcolon");Ee("⩴","\\Coloneqq");Ee("\\ratio","\\vcentcolon");Ee("\\coloncolon","\\dblcolon");Ee("\\colonequals","\\coloneqq");Ee("\\coloncolonequals","\\Coloneqq");Ee("\\equalscolon","\\eqqcolon");Ee("\\equalscoloncolon","\\Eqqcolon");Ee("\\colonminus","\\coloneq");Ee("\\coloncolonminus","\\Coloneq");Ee("\\minuscolon","\\eqcolon");Ee("\\minuscoloncolon","\\Eqcolon");Ee("\\coloncolonapprox","\\Colonapprox");Ee("\\coloncolonsim","\\Colonsim");Ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Ee("\\imath","\\html@mathml{\\@imath}{ı}");Ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Ee("⟦","\\llbracket");Ee("⟧","\\rrbracket");Ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Ee("⦃","\\lBrace");Ee("⦄","\\rBrace");Ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Ee("⦵","\\minuso");Ee("\\darr","\\downarrow");Ee("\\dArr","\\Downarrow");Ee("\\Darr","\\Downarrow");Ee("\\lang","\\langle");Ee("\\rang","\\rangle");Ee("\\uarr","\\uparrow");Ee("\\uArr","\\Uparrow");Ee("\\Uarr","\\Uparrow");Ee("\\N","\\mathbb{N}");Ee("\\R","\\mathbb{R}");Ee("\\Z","\\mathbb{Z}");Ee("\\alef","\\aleph");Ee("\\alefsym","\\aleph");Ee("\\Alpha","\\mathrm{A}");Ee("\\Beta","\\mathrm{B}");Ee("\\bull","\\bullet");Ee("\\Chi","\\mathrm{X}");Ee("\\clubs","\\clubsuit");Ee("\\cnums","\\mathbb{C}");Ee("\\Complex","\\mathbb{C}");Ee("\\Dagger","\\ddagger");Ee("\\diamonds","\\diamondsuit");Ee("\\empty","\\emptyset");Ee("\\Epsilon","\\mathrm{E}");Ee("\\Eta","\\mathrm{H}");Ee("\\exist","\\exists");Ee("\\harr","\\leftrightarrow");Ee("\\hArr","\\Leftrightarrow");Ee("\\Harr","\\Leftrightarrow");Ee("\\hearts","\\heartsuit");Ee("\\image","\\Im");Ee("\\infin","\\infty");Ee("\\Iota","\\mathrm{I}");Ee("\\isin","\\in");Ee("\\Kappa","\\mathrm{K}");Ee("\\larr","\\leftarrow");Ee("\\lArr","\\Leftarrow");Ee("\\Larr","\\Leftarrow");Ee("\\lrarr","\\leftrightarrow");Ee("\\lrArr","\\Leftrightarrow");Ee("\\Lrarr","\\Leftrightarrow");Ee("\\Mu","\\mathrm{M}");Ee("\\natnums","\\mathbb{N}");Ee("\\Nu","\\mathrm{N}");Ee("\\Omicron","\\mathrm{O}");Ee("\\plusmn","\\pm");Ee("\\rarr","\\rightarrow");Ee("\\rArr","\\Rightarrow");Ee("\\Rarr","\\Rightarrow");Ee("\\real","\\Re");Ee("\\reals","\\mathbb{R}");Ee("\\Reals","\\mathbb{R}");Ee("\\Rho","\\mathrm{P}");Ee("\\sdot","\\cdot");Ee("\\sect","\\S");Ee("\\spades","\\spadesuit");Ee("\\sub","\\subset");Ee("\\sube","\\subseteq");Ee("\\supe","\\supseteq");Ee("\\Tau","\\mathrm{T}");Ee("\\thetasym","\\vartheta");Ee("\\weierp","\\wp");Ee("\\Zeta","\\mathrm{Z}");Ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Ee("\\bra","\\mathinner{\\langle{#1}|}");Ee("\\ket","\\mathinner{|{#1}\\rangle}");Ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");Ee("\\Bra","\\left\\langle#1\\right|");Ee("\\Ket","\\left|#1\\right\\rangle");var U8e=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}};Ee("\\bra@ket",U8e(!1));Ee("\\bra@set",U8e(!0));Ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Ee("\\angln","{\\angl n}");Ee("\\blue","\\textcolor{##6495ed}{#1}");Ee("\\orange","\\textcolor{##ffa500}{#1}");Ee("\\pink","\\textcolor{##ff00af}{#1}");Ee("\\red","\\textcolor{##df0030}{#1}");Ee("\\green","\\textcolor{##28ae7b}{#1}");Ee("\\gray","\\textcolor{gray}{#1}");Ee("\\purple","\\textcolor{##9d38bd}{#1}");Ee("\\blueA","\\textcolor{##ccfaff}{#1}");Ee("\\blueB","\\textcolor{##80f6ff}{#1}");Ee("\\blueC","\\textcolor{##63d9ea}{#1}");Ee("\\blueD","\\textcolor{##11accd}{#1}");Ee("\\blueE","\\textcolor{##0c7f99}{#1}");Ee("\\tealA","\\textcolor{##94fff5}{#1}");Ee("\\tealB","\\textcolor{##26edd5}{#1}");Ee("\\tealC","\\textcolor{##01d1c1}{#1}");Ee("\\tealD","\\textcolor{##01a995}{#1}");Ee("\\tealE","\\textcolor{##208170}{#1}");Ee("\\greenA","\\textcolor{##b6ffb0}{#1}");Ee("\\greenB","\\textcolor{##8af281}{#1}");Ee("\\greenC","\\textcolor{##74cf70}{#1}");Ee("\\greenD","\\textcolor{##1fab54}{#1}");Ee("\\greenE","\\textcolor{##0d923f}{#1}");Ee("\\goldA","\\textcolor{##ffd0a9}{#1}");Ee("\\goldB","\\textcolor{##ffbb71}{#1}");Ee("\\goldC","\\textcolor{##ff9c39}{#1}");Ee("\\goldD","\\textcolor{##e07d10}{#1}");Ee("\\goldE","\\textcolor{##a75a05}{#1}");Ee("\\redA","\\textcolor{##fca9a9}{#1}");Ee("\\redB","\\textcolor{##ff8482}{#1}");Ee("\\redC","\\textcolor{##f9685d}{#1}");Ee("\\redD","\\textcolor{##e84d39}{#1}");Ee("\\redE","\\textcolor{##bc2612}{#1}");Ee("\\maroonA","\\textcolor{##ffbde0}{#1}");Ee("\\maroonB","\\textcolor{##ff92c6}{#1}");Ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");Ee("\\maroonD","\\textcolor{##ca337c}{#1}");Ee("\\maroonE","\\textcolor{##9e034e}{#1}");Ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");Ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");Ee("\\purpleC","\\textcolor{##aa87ff}{#1}");Ee("\\purpleD","\\textcolor{##7854ab}{#1}");Ee("\\purpleE","\\textcolor{##543b78}{#1}");Ee("\\mintA","\\textcolor{##f5f9e8}{#1}");Ee("\\mintB","\\textcolor{##edf2df}{#1}");Ee("\\mintC","\\textcolor{##e0e5cc}{#1}");Ee("\\grayA","\\textcolor{##f6f7f7}{#1}");Ee("\\grayB","\\textcolor{##f0f1f2}{#1}");Ee("\\grayC","\\textcolor{##e3e5e6}{#1}");Ee("\\grayD","\\textcolor{##d6d8da}{#1}");Ee("\\grayE","\\textcolor{##babec2}{#1}");Ee("\\grayF","\\textcolor{##888d93}{#1}");Ee("\\grayG","\\textcolor{##626569}{#1}");Ee("\\grayH","\\textcolor{##3b3e40}{#1}");Ee("\\grayI","\\textcolor{##21242c}{#1}");Ee("\\kaBlue","\\textcolor{##314453}{#1}");Ee("\\kaGreen","\\textcolor{##71B307}{#1}");var Y8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class _Mt{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 EMt(AMt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new mde(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 bc("EOF",n.loc)),this.pushTokens(i),new bc("",Pl.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 Ht("Extra }",a)}else if(a.text==="EOF")throw new Ht("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 Ht("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Ht("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 Ht("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 Ht("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 Ht("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 bc(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 mde(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)||vp.hasOwnProperty(e)||ea.math.hasOwnProperty(e)||ea.text.hasOwnProperty(e)||Y8e.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:vp.hasOwnProperty(e)&&!vp[e].primitive}}var bde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,HA=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),JB={"́":{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"}},xde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let j8e=class X8e{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 _Mt(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 Ht("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 bc("}")),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(X8e.endOfExpression.has(i.text)||r&&i.text===r||e&&vp[i.text]&&vp[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&&(JAe(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:Pl.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=vLt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function H2(t){return function(){return t}}var yL=(function(){try{var t=zy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),TLt=yL?function(t,e){return yL(t,"toString",{configurable:!0,enumerable:!1,value:H2(e),writable:!0})}:By,sRe=wLt(TLt);function oRe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var ALt=9007199254740991,RLt=/^(?:0|[1-9]\d*)$/;function _N(t,e){var r=typeof t;return e=e??ALt,!!e&&(r=="number"||r!="symbol"&&RLt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=LLt}function Tg(t){return t!=null&&cJ(t.length)&&!s6(t)}function o6(t,e,r){if(!Ac(r))return!1;var n=typeof e;return(n=="number"?Tg(r)&&_N(e,r.length):n=="string"&&e in r)?W3(r[e],t):!1}function ILt(t){return IN(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&&o6(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function HIt(t,e){var r=this.__data__,n=ON(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function m0(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&UNt?new u6:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&o6(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var DDt=Math.max;function ODt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:QMt(r);return i<0&&(i=DDt(n+i,0)),lRe(t,kg(e),i)}var TJ=NDt(ODt);function BRe(t,e){var r=-1,n=Tg(t)?Array(t.length):[];return zN(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Ja(t,e){var r=ts(t)?gb:BRe;return r(t,kg(e))}function PDt(t,e){return t==null?t:bJ(t,wJ(e),Hy)}function BDt(t,e){return t&&xJ(t,wJ(e))}function FDt(t,e){return t>e}var zDt=Object.prototype,HDt=zDt.hasOwnProperty;function VDt(t,e){return t!=null&&HDt.call(t,e)}function FRe(t,e){return t!=null&&$Re(t,e,VDt)}function WDt(t,e){return gb(e,function(r){return t[r]})}function Of(t){return t==null?[]:WDt(t,hc(t))}var qDt="[object Map]",GDt="[object Set]",UDt=Object.prototype,YDt=UDt.hasOwnProperty;function Zde(t){if(t==null)return!0;if(Tg(t)&&(ts(t)||typeof t=="string"||typeof t.splice=="function"||jT(t)||DN(t)||YT(t)))return!t.length;var e=Zc(t);if(e==qDt||e==GDt)return!t.size;if($N(t))return!gRe(t).length;for(var r in t)if(YDt.call(t,r))return!1;return!0}function Ba(t){return t===void 0}function zRe(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 JDt(t,e,r){e.length?e=gb(e,function(a){return ts(a)?function(s){return FN(s,a.length===1?a[0]:a)}:a}):e=[By];var n=-1;e=gb(e,NN(kg));var i=BRe(t,function(a,s,o){var l=gb(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return KDt(i,function(a,s){return QDt(a,s,r)})}function eOt(t,e){return XDt(t,e,function(r,n){return NRe(t,n)})}var xL=r$t(function(t,e){return t==null?{}:eOt(t,e)}),tOt=Math.ceil,rOt=Math.max;function nOt(t,e,r,n){for(var i=-1,a=rOt(tOt((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function iOt(t){return function(e,r,n){return n&&typeof n!="number"&&o6(e,r,n)&&(r=n=void 0),e=bR(e),r===void 0?(r=e,e=0):r=bR(r),n=n===void 0?e1&&o6(t,e[0],e[1])?e=[]:r>2&&o6(e[0],e[1],e[2])&&(e=[e[0]]),JDt(t,fJ(e),[])}),sOt=1/0,oOt=mb&&1/yJ(new mb([,-0]))[1]==sOt?function(t){return new mb(t)}:yLt,lOt=200;function cOt(t,e,r){var n=-1,i=ELt,a=t.length,s=!0,o=[],l=o;if(a>=lOt){var u=oOt(t);if(u)return yJ(u);s=!1,i=_Re,l=new u6}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]=Kg,this._children[e]={},this._children[Kg][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],kt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),kt(hc(this._in[e]),r),delete this._in[e],delete this._preds[e],kt(hc(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(Ba(r))r=Kg;else{r+="";for(var n=r;!Ba(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!==Kg)return r}}children(e){if(Ba(e)&&(e=Kg),this._isCompound){var r=this._children[e];if(r)return hc(r)}else{if(e===Kg)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return hc(r)}successors(e){var r=this._sucs[e];if(r)return hc(r)}neighbors(e){var r=this.predecessors(e);if(r)return uOt(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;kt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),kt(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&&kt(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return s6(e)||(e=H2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Of(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return NE(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,Ba(n)||(n=""+n);var o=O5(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Ba(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=gOt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,Jde(this._preds[r],e),Jde(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?nF(this._isDirected,arguments[0]):O5(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):O5(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?nF(this._isDirected,arguments[0]):O5(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],efe(this._preds[r],e),efe(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=Of(n);return r?wf(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Of(n);return r?wf(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))}}$o.prototype._nodeCount=0;$o.prototype._edgeCount=0;function Jde(t,e){t[e]?t[e]++:t[e]=1}function efe(t,e){--t[e]||delete t[e]}function O5(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+Qde+a+Qde+(Ba(n)?pOt:n)}function gOt(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 nF(t,e){return O5(t,e.v,e.w,e.name)}function Pf(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:mOt(t),edges:yOt(t)};return Ba(t.graph())||(e.value=PNt(t.graph())),e}function mOt(t){return Ja(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ba(r)||(i.value=r),Ba(n)||(i.parent=n),i})}function yOt(t){return Ja(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ba(e.name)||(n.name=e.name),Ba(r)||(n.value=r),n})}var an=new Map,bp=new Map,HRe=new Map,VRe=w(()=>{bp.clear(),HRe.clear(),an.clear()},"clear"),ly=w((t,e)=>{const r=bp.get(e)||[];return he.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),vOt=w((t,e)=>{const r=bp.get(e)||[];return he.info("Descendants of ",e," is ",r),he.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||ly(t.v,e)||ly(t.w,e)||r.includes(t.w):(he.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),oG=w((t,e,r,n)=>{he.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),he.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)oG(a,e,r,n);else{const s=e.node(a);he.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(he.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(he.debug("Setting parent",a,t),r.setParent(a,t)):(he.info("In copy ",t,"root",n,"data",e.node(t),n),he.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);he.debug("Copying Edges",o),o.forEach(l=>{he.info("Edge",l);const u=e.edge(l.v,l.w,l.name);he.info("Edge data",u,n);try{if(vOt(l,n)){const h=bp.get(n)||[],d=h.includes(l.v)||ly(l.v,n)||l.v===n,f=h.includes(l.w)||ly(l.w,n)||l.w===n;if(d&&f)he.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),he.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;he.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else he.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){he.error(h)}})}he.debug("Removing node",a),e.removeNode(a)})},"copy"),WRe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)HRe.set(i,t),n=[...n,...WRe(i,e)];return n},"extractDescendants"),bOt=w((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"),ZT=w((t,e,r)=>{const n=e.children(t);if(he.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=ZT(a,e,r),o=bOt(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),tfe=w(t=>!an.has(t)||!an.get(t).externalConnections?t:an.has(t)?an.get(t).id:t,"getAnchorId"),xOt=w((t,e)=>{var r;if(!t||e>10){he.debug("Opting out, no graph ");return}else he.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(he.warn("Cluster identified",n," Replacement id in edges: ",ZT(n,t,n)),bp.set(n,WRe(n,t)),an.set(n,{id:ZT(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(he.debug("Cluster identified",n,bp),a.forEach(s=>{const o=ly(s.v,n),l=ly(s.w,n);o^l&&(he.warn("Edge: ",s," leaves cluster ",n),he.warn("Descendants of XXX ",n,": ",bp.get(n)),an.get(n).externalConnections=!0)})):he.debug("Not a cluster ",n,bp)});for(let n of an.keys()){const i=an.get(n).id,a=t.parent(i);a!==n&&an.has(a)&&!an.get(a).externalConnections&&(an.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=an.get(n))!=null&&r.externalConnections)&&s&&URe(t,i,n)){const o=TOt(t,n,t.parent(i));o&&(an.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(he.warn("Fix XXX",an,"ids:",n.v,n.w,"Translating: ",an.get(n.v)," --- ",an.get(n.w)),an.get(n.v)||an.get(n.w)){if(he.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=tfe(n.v),s=tfe(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);an.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);an.get(o).externalConnections=!0,i.toCluster=n.w}he.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),he.warn("Adjusted Graph",Pf(t)),qRe(t,0),he.trace(an)},"adjustClustersAndEdges"),qRe=w((t,e)=>{var i,a,s,o;if(he.warn("extractor - ",e,Pf(t),t.children("D")),e>10){he.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){he.debug("Done, no node has children",t.nodes());return}he.debug("Nodes = ",r,e);for(const l of r)if(he.debug("Extracting node",l,an,an.has(l)&&!an.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!an.has(l))he.debug("Not a cluster",l,e);else if((a=(i=an.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){he.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=an.get(l).clusterData.dir,h=new $o({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});oG(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:an.get(l).clusterData,label:an.get(l).label,graph:h}),he.warn("Subgraph for cluster with explicit dir created:",l,Pf(h))}else if(!an.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){he.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=an.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=an.get(l).clusterData.dir,he.warn("Fixing dir",an.get(l).clusterData.dir,h));const d=new $o({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});oG(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:an.get(l).clusterData,label:an.get(l).label,graph:d}),he.debug("Old graph after copy",Pf(t))}else he.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!an.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),he.debug(an);r=t.nodes(),he.warn("New list of nodes",r);for(const l of r){const u=t.node(l);he.warn(" Now next level",l,u),u!=null&&u.clusterNode&&qRe(u.graph,e+1)}},"extractor"),GRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=GRe(t,i);r=[...r,...a]}),r},"sorter"),wOt=w(t=>GRe(t,t.children()),"sortNodesByHierarchy"),URe=w((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=an.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),TOt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||ly(i,r))continue;const a=ZT(i,t,e);if(a&&!URe(t,a,e))return a}return null},"findSafeAnchorNode");class kOt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return rfe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&rfe(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,COt)),n=n._prev;return"["+e.join(", ")+"]"}}function rfe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function COt(t,e){if(t!=="_next"&&t!=="_prev")return e}var SOt=H2(1);function EOt(t,e){if(t.nodeCount()<=1)return[];var r=ROt(t,e||SOt),n=AOt(r.graph,r.buckets,r.zeroIdx);return q3(Ja(n,function(i){return t.outEdges(i.v,i.w)}))}function AOt(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)iF(t,e,r,s);for(;s=i.dequeue();)iF(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(iF(t,e,r,s,!0));break}}}return n}function iF(t,e,r,n,i){var a=i?[]:void 0;return kt(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,lG(e,r,l)}),kt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,lG(e,r,u)}),t.removeNode(n.v),a}function ROt(t,e){var r=new $o,n=0,i=0;kt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),kt(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=KT(i+n+3).map(function(){return new kOt}),s=n+1;return kt(r.nodes(),function(o){lG(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function lG(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 _Ot(t){var e=t.graph().acyclicer==="greedy"?EOt(t,r(t)):MOt(t);kt(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,SJ("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function MOt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,kt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return kt(t.nodes(),i),e}function LOt(t){kt(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 G3(t,e,r,n){var i;do i=SJ(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function IOt(t){var e=new $o().setGraph(t.graph());return kt(t.nodes(),function(r){e.setNode(r,t.node(r))}),kt(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 YRe(t){var e=new $o({multigraph:t.isMultigraph()}).setGraph(t.graph());return kt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),kt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function nfe(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 VN(t){var e=Ja(KT(jRe(t)+1),function(){return[]});return kt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ba(i)||(e[i][n.order]=r)}),e}function $Ot(t){var e=h6(Ja(t.nodes(),function(r){return t.node(r).rank}));kt(t.nodes(),function(r){var n=t.node(r);FRe(n,"rank")&&(n.rank-=e)})}function NOt(t){var e=h6(Ja(t.nodes(),function(a){return t.node(a).rank})),r=[];kt(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;kt(r,function(a,s){Ba(a)&&s%i!==0?--n:n&&kt(a,function(o){t.node(o).rank+=n})})}function ife(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),G3(t,"border",i,e)}function jRe(t){return oy(Ja(t.nodes(),function(e){var r=t.node(e).rank;if(!Ba(r))return r}))}function DOt(t,e){var r={lhs:[],rhs:[]};return kt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function OOt(t,e){return e()}function POt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&kt(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=wf(e.edges(),function(h){return l===ofe(t,t.node(h.v),o)&&l!==ofe(t,t.node(h.w),o)});return CJ(u,function(h){return d6(e,h)})}function n_e(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),RJ(t),AJ(t,e),QOt(t,e)}function QOt(t,e){var r=TJ(t.nodes(),function(i){return!e.node(i).parent}),n=KOt(t,r);n=n.slice(1),kt(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 JOt(t,e,r){return t.hasEdge(e,r)}function ofe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function ePt(t){switch(t.graph().ranker){case"network-simplex":lfe(t);break;case"tight-tree":rPt(t);break;case"longest-path":tPt(t);break;default:lfe(t)}}var tPt=EJ;function rPt(t){EJ(t),KRe(t)}function lfe(t){Vy(t)}function nPt(t){var e=G3(t,"root",{},"_root"),r=iPt(t),n=oy(Of(r))-1,i=2*n+1;t.graph().nestingRoot=e,kt(t.edges(),function(s){t.edge(s).minlen*=i});var a=aPt(t)+1;kt(t.children(),function(s){i_e(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function i_e(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=ife(t,"_bt"),u=ife(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,kt(o,function(d){i_e(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 iPt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&kt(a,function(s){r(s,i+1)}),e[n]=i}return kt(t.children(),function(n){r(n,1)}),e}function aPt(t){return NE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function sPt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,kt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function oPt(t,e,r){var n={},i;kt(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 lPt(t,e,r){var n=cPt(t),i=new $o({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return kt(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),kt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Ba(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 cPt(t){for(var e;t.hasNode(e=SJ("_root")););return e}function uPt(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 dPt(t){var e={},r=wf(t.nodes(),function(o){return!t.children(o).length}),n=oy(Ja(r,function(o){return t.node(o).rank})),i=Ja(KT(n+1),function(){return[]});function a(o){if(!FRe(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),kt(t.successors(o),a)}}var s=DE(r,function(o){return t.node(o).rank});return kt(s,a),i}function fPt(t,e){return Ja(e,function(r){var n=t.inEdges(r);if(n.length){var i=NE(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 pPt(t,e){var r={};kt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ba(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),kt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Ba(a)&&!Ba(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=wf(r,function(i){return!i.indegree});return gPt(n)}function gPt(t){var e=[];function r(a){return function(s){s.merged||(Ba(s.barycenter)||Ba(a.barycenter)||s.barycenter>=a.barycenter)&&mPt(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),kt(i.in.reverse(),r(i)),kt(i.out,n(i))}return Ja(wf(e,function(a){return!a.merged}),function(a){return xL(a,["vs","i","barycenter","weight"])})}function mPt(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 yPt(t,e){var r=DOt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=DE(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(vPt(!!e)),l=cfe(a,i,l),kt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=cfe(a,i,l)});var u={vs:q3(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function cfe(t,e,r){for(var n;e.length&&(n=bL(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function vPt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function a_e(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=wf(i,function(g){return g!==s&&g!==o}));var u=fPt(t,i);kt(u,function(g){if(t.children(g.v).length){var m=a_e(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&xPt(g,m)}});var h=pPt(u,r);bPt(h,l);var d=yPt(h,n);if(s&&(d.vs=q3([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 bPt(t,e){kt(t,function(r){r.vs=q3(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function xPt(t,e){Ba(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 wPt(t){var e=jRe(t),r=ufe(t,KT(1,e+1),"inEdges"),n=ufe(t,KT(e-1,-1,-1),"outEdges"),i=dPt(t);hfe(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){TPt(o%2?r:n,o%4>=2),i=VN(t);var u=uPt(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 SPt(t){var e={},r=0;function n(i){var a=r;kt(t.children(i),n),e[i]={low:a,lim:r++}}return kt(t.children(),n),e}function EPt(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=bL(a);return kt(a,function(h,d){var f=RPt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(kt(a.slice(o,d+1),function(g){kt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&s_e(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return kt(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 NE(e,i),r}function RPt(t,e){if(t.node(e).dummy)return TJ(t.predecessors(e),function(r){return t.node(r).dummy})}function s_e(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 _Pt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function MPt(t,e,r,n){var i={},a={},s={};return kt(e,function(o){kt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),kt(e,function(o){var l=-1;kt(o,function(u){var h=n(u);if(h.length){h=DE(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",()=>ZPt(t));r(" runLayout",()=>HPt(n,r)),r(" updateInputGraph",()=>VPt(t,n))})}function HPt(t,e){e(" makeSpaceForEdgeLabels",()=>QPt(t)),e(" removeSelfEdges",()=>oBt(t)),e(" acyclic",()=>_Ot(t)),e(" nestingGraph.run",()=>nPt(t)),e(" rank",()=>ePt(YRe(t))),e(" injectEdgeLabelProxies",()=>JPt(t)),e(" removeEmptyRanks",()=>NOt(t)),e(" nestingGraph.cleanup",()=>sPt(t)),e(" normalizeRanks",()=>$Ot(t)),e(" assignRankMinMax",()=>eBt(t)),e(" removeEdgeLabelProxies",()=>tBt(t)),e(" normalize.run",()=>VOt(t)),e(" parentDummyChains",()=>kPt(t)),e(" addBorderSegments",()=>POt(t)),e(" order",()=>wPt(t)),e(" insertSelfEdges",()=>lBt(t)),e(" adjustCoordinateSystem",()=>BOt(t)),e(" position",()=>FPt(t)),e(" positionSelfEdges",()=>cBt(t)),e(" removeBorderNodes",()=>sBt(t)),e(" normalize.undo",()=>qOt(t)),e(" fixupEdgeLabelCoords",()=>iBt(t)),e(" undoCoordinateSystem",()=>FOt(t)),e(" translateGraph",()=>rBt(t)),e(" assignNodeIntersects",()=>nBt(t)),e(" reversePoints",()=>aBt(t)),e(" acyclic.undo",()=>LOt(t))}function VPt(t,e){kt(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))}),kt(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 WPt=["nodesep","edgesep","ranksep","marginx","marginy"],qPt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},GPt=["acyclicer","ranker","rankdir","align"],UPt=["width","height"],YPt={width:0,height:0},jPt=["minlen","weight","width","height","labeloffset"],XPt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},KPt=["labelpos"];function ZPt(t){var e=new $o({multigraph:!0,compound:!0}),r=lF(t.graph());return e.setGraph(sG({},qPt,oF(r,WPt),xL(r,GPt))),kt(t.nodes(),function(n){var i=lF(t.node(n));e.setNode(n,MDt(oF(i,UPt),YPt)),e.setParent(n,t.parent(n))}),kt(t.edges(),function(n){var i=lF(t.edge(n));e.setEdge(n,sG({},XPt,oF(i,jPt),xL(i,KPt)))}),e}function QPt(t){var e=t.graph();e.ranksep/=2,kt(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 JPt(t){kt(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};G3(t,"edge-proxy",a,"_ep")}})}function eBt(t){var e=0;kt(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=oy(e,n.maxRank))}),t.graph().maxRank=e}function tBt(t){kt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function rBt(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)}kt(t.nodes(),function(u){l(t.node(u))}),kt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,kt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),kt(t.edges(),function(u){var h=t.edge(u);kt(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 nBt(t){kt(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(nfe(n,a)),r.points.push(nfe(i,s))})}function iBt(t){kt(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 aBt(t){kt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function sBt(t){kt(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(bL(r.borderLeft)),s=t.node(bL(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}}),kt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function oBt(t){kt(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 lBt(t){var e=VN(t);kt(e,function(r){var n=0;kt(r,function(i,a){var s=t.node(i);s.order=a+n,kt(s.selfEdges,function(o){G3(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 cBt(t){kt(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 oF(t,e){return HN(xL(t,e),Number)}function lF(t){var e={};return kt(t,function(r,n){e[n.toLowerCase()]=r}),e}var dfe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),ffe=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),uBt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),hBt=w((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 ffe(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":ffe(i)},"getSelfLoopSide"),dBt=w((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=dfe(Math.max(n,t.width*.35),36,l),h=dfe(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"),fBt=w((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"),l_e=w((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(x=>i.push(x));return}o.sort((x,b)=>x.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(x=>i.push(x));return}const p={width:u.edge.width,height:u.edge.height},g=hBt(t,f,o,d.start,a),m=dBt(f,g,e,p.width??0),y=fBt(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"),c_e=w(async(t,e,r,n,i,a)=>{he.warn("Graph in recursive render:XAX",Pf(e),i);const s=e.graph().rankdir;he.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?he.info("Recursive render XXX",e.nodes()):he.info("No nodes found for",e),e.edges().length>0&&he.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=uBt(r);await Promise.all(e.nodes().map(async function(x){const b=e.node(x);if(i!==void 0){const T=JSON.parse(JSON.stringify(i.clusterData));he.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,tG="[̀-ͯ]",MMt=new RegExp(tG+"+$"),LMt="("+Y8e+"+)|"+(_Mt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(tG+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(tG+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+RMt)+("|"+AMt+")");let yde=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(LMt,"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 bc("EOF",new Pl(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Ht("Unexpected character: '"+e[r]+"'",new bc(e[r],new Pl(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 bc(i,new Pl(this,r,this.tokenRegex.lastIndex))}};class IMt{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 Ht("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 $Mt=O8e;Ee("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Ee("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Ee("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Ee("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Ee("\\@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}});Ee("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Ee("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var vde={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};Ee("\\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 Ht("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=vde[e.text],n==null||n>=r)throw new Ht("Invalid base-"+r+" digit "+e.text);for(var i;(i=vde[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Ht("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Ht("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Ht("\\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 Ht("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};Ee("\\newcommand",t=>oJ(t,!1,!0,!1));Ee("\\renewcommand",t=>oJ(t,!0,!1,!1));Ee("\\providecommand",t=>oJ(t,!0,!0,!0));Ee("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Ee("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Ee("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),vp[r],ea.math[r],ea.text[r]),""});Ee("\\bgroup","{");Ee("\\egroup","}");Ee("~","\\nobreakspace");Ee("\\lq","`");Ee("\\rq","'");Ee("\\aa","\\r a");Ee("\\AA","\\r A");Ee("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Ee("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Ee("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Ee("ℬ","\\mathscr{B}");Ee("ℰ","\\mathscr{E}");Ee("ℱ","\\mathscr{F}");Ee("ℋ","\\mathscr{H}");Ee("ℐ","\\mathscr{I}");Ee("ℒ","\\mathscr{L}");Ee("ℳ","\\mathscr{M}");Ee("ℛ","\\mathscr{R}");Ee("ℭ","\\mathfrak{C}");Ee("ℌ","\\mathfrak{H}");Ee("ℨ","\\mathfrak{Z}");Ee("\\Bbbk","\\Bbb{k}");Ee("\\llap","\\mathllap{\\textrm{#1}}");Ee("\\rlap","\\mathrlap{\\textrm{#1}}");Ee("\\clap","\\mathclap{\\textrm{#1}}");Ee("\\mathstrut","\\vphantom{(}");Ee("\\underbar","\\underline{\\text{#1}}");Ee("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Ee("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Ee("\\ne","\\neq");Ee("≠","\\neq");Ee("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Ee("∉","\\notin");Ee("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Ee("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Ee("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Ee("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Ee("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Ee("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Ee("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Ee("⟂","\\perp");Ee("‼","\\mathclose{!\\mkern-0.8mu!}");Ee("∌","\\notni");Ee("⌜","\\ulcorner");Ee("⌝","\\urcorner");Ee("⌞","\\llcorner");Ee("⌟","\\lrcorner");Ee("©","\\copyright");Ee("®","\\textregistered");Ee("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Ee("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Ee("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Ee("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Ee("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Ee("⋮","\\vdots");Ee("\\varGamma","\\mathit{\\Gamma}");Ee("\\varDelta","\\mathit{\\Delta}");Ee("\\varTheta","\\mathit{\\Theta}");Ee("\\varLambda","\\mathit{\\Lambda}");Ee("\\varXi","\\mathit{\\Xi}");Ee("\\varPi","\\mathit{\\Pi}");Ee("\\varSigma","\\mathit{\\Sigma}");Ee("\\varUpsilon","\\mathit{\\Upsilon}");Ee("\\varPhi","\\mathit{\\Phi}");Ee("\\varPsi","\\mathit{\\Psi}");Ee("\\varOmega","\\mathit{\\Omega}");Ee("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Ee("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Ee("\\boxed","\\fbox{$\\displaystyle{#1}$}");Ee("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Ee("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Ee("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Ee("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Ee("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var bde={",":"\\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"},NMt=new Set(["bin","rel"]);Ee("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in bde?e=bde[r]:(r.slice(0,4)==="\\not"||r in ea.math&&NMt.has(ea.math[r].group))&&(e="\\dotsb"),e});var lJ={")":!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};Ee("\\dotso",function(t){var e=t.future().text;return e in lJ?"\\ldots\\,":"\\ldots"});Ee("\\dotsc",function(t){var e=t.future().text;return e in lJ&&e!==","?"\\ldots\\,":"\\ldots"});Ee("\\cdots",function(t){var e=t.future().text;return e in lJ?"\\@cdots\\,":"\\@cdots"});Ee("\\dotsb","\\cdots");Ee("\\dotsm","\\cdots");Ee("\\dotsi","\\!\\cdots");Ee("\\dotsx","\\ldots\\,");Ee("\\DOTSI","\\relax");Ee("\\DOTSB","\\relax");Ee("\\DOTSX","\\relax");Ee("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Ee("\\,","\\tmspace+{3mu}{.1667em}");Ee("\\thinspace","\\,");Ee("\\>","\\mskip{4mu}");Ee("\\:","\\tmspace+{4mu}{.2222em}");Ee("\\medspace","\\:");Ee("\\;","\\tmspace+{5mu}{.2777em}");Ee("\\thickspace","\\;");Ee("\\!","\\tmspace-{3mu}{.1667em}");Ee("\\negthinspace","\\!");Ee("\\negmedspace","\\tmspace-{4mu}{.2222em}");Ee("\\negthickspace","\\tmspace-{5mu}{.277em}");Ee("\\enspace","\\kern.5em ");Ee("\\enskip","\\hskip.5em\\relax");Ee("\\quad","\\hskip1em\\relax");Ee("\\qquad","\\hskip2em\\relax");Ee("\\tag","\\@ifstar\\tag@literal\\tag@paren");Ee("\\tag@paren","\\tag@literal{({#1})}");Ee("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Ht("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Ee("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Ee("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Ee("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Ee("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Ee("\\newline","\\\\\\relax");Ee("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var j8e=Yt(Gh["Main-Regular"][84][1]-.7*Gh["Main-Regular"][65][1]);Ee("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+j8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Ee("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+j8e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Ee("\\hspace","\\@ifstar\\@hspacer\\@hspace");Ee("\\@hspace","\\hskip #1\\relax");Ee("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Ee("\\ordinarycolon",":");Ee("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Ee("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Ee("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Ee("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Ee("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Ee("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Ee("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Ee("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Ee("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Ee("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Ee("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Ee("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Ee("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Ee("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Ee("∷","\\dblcolon");Ee("∹","\\eqcolon");Ee("≔","\\coloneqq");Ee("≕","\\eqqcolon");Ee("⩴","\\Coloneqq");Ee("\\ratio","\\vcentcolon");Ee("\\coloncolon","\\dblcolon");Ee("\\colonequals","\\coloneqq");Ee("\\coloncolonequals","\\Coloneqq");Ee("\\equalscolon","\\eqqcolon");Ee("\\equalscoloncolon","\\Eqqcolon");Ee("\\colonminus","\\coloneq");Ee("\\coloncolonminus","\\Coloneq");Ee("\\minuscolon","\\eqcolon");Ee("\\minuscoloncolon","\\Eqcolon");Ee("\\coloncolonapprox","\\Colonapprox");Ee("\\coloncolonsim","\\Colonsim");Ee("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ee("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ee("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ee("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ee("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Ee("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Ee("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Ee("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Ee("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Ee("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Ee("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Ee("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Ee("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Ee("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Ee("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Ee("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Ee("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Ee("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Ee("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Ee("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Ee("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Ee("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Ee("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Ee("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Ee("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Ee("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Ee("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Ee("\\imath","\\html@mathml{\\@imath}{ı}");Ee("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Ee("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Ee("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Ee("⟦","\\llbracket");Ee("⟧","\\rrbracket");Ee("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Ee("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Ee("⦃","\\lBrace");Ee("⦄","\\rBrace");Ee("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Ee("⦵","\\minuso");Ee("\\darr","\\downarrow");Ee("\\dArr","\\Downarrow");Ee("\\Darr","\\Downarrow");Ee("\\lang","\\langle");Ee("\\rang","\\rangle");Ee("\\uarr","\\uparrow");Ee("\\uArr","\\Uparrow");Ee("\\Uarr","\\Uparrow");Ee("\\N","\\mathbb{N}");Ee("\\R","\\mathbb{R}");Ee("\\Z","\\mathbb{Z}");Ee("\\alef","\\aleph");Ee("\\alefsym","\\aleph");Ee("\\Alpha","\\mathrm{A}");Ee("\\Beta","\\mathrm{B}");Ee("\\bull","\\bullet");Ee("\\Chi","\\mathrm{X}");Ee("\\clubs","\\clubsuit");Ee("\\cnums","\\mathbb{C}");Ee("\\Complex","\\mathbb{C}");Ee("\\Dagger","\\ddagger");Ee("\\diamonds","\\diamondsuit");Ee("\\empty","\\emptyset");Ee("\\Epsilon","\\mathrm{E}");Ee("\\Eta","\\mathrm{H}");Ee("\\exist","\\exists");Ee("\\harr","\\leftrightarrow");Ee("\\hArr","\\Leftrightarrow");Ee("\\Harr","\\Leftrightarrow");Ee("\\hearts","\\heartsuit");Ee("\\image","\\Im");Ee("\\infin","\\infty");Ee("\\Iota","\\mathrm{I}");Ee("\\isin","\\in");Ee("\\Kappa","\\mathrm{K}");Ee("\\larr","\\leftarrow");Ee("\\lArr","\\Leftarrow");Ee("\\Larr","\\Leftarrow");Ee("\\lrarr","\\leftrightarrow");Ee("\\lrArr","\\Leftrightarrow");Ee("\\Lrarr","\\Leftrightarrow");Ee("\\Mu","\\mathrm{M}");Ee("\\natnums","\\mathbb{N}");Ee("\\Nu","\\mathrm{N}");Ee("\\Omicron","\\mathrm{O}");Ee("\\plusmn","\\pm");Ee("\\rarr","\\rightarrow");Ee("\\rArr","\\Rightarrow");Ee("\\Rarr","\\Rightarrow");Ee("\\real","\\Re");Ee("\\reals","\\mathbb{R}");Ee("\\Reals","\\mathbb{R}");Ee("\\Rho","\\mathrm{P}");Ee("\\sdot","\\cdot");Ee("\\sect","\\S");Ee("\\spades","\\spadesuit");Ee("\\sub","\\subset");Ee("\\sube","\\subseteq");Ee("\\supe","\\supseteq");Ee("\\Tau","\\mathrm{T}");Ee("\\thetasym","\\vartheta");Ee("\\weierp","\\wp");Ee("\\Zeta","\\mathrm{Z}");Ee("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Ee("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Ee("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Ee("\\bra","\\mathinner{\\langle{#1}|}");Ee("\\ket","\\mathinner{|{#1}\\rangle}");Ee("\\braket","\\mathinner{\\langle{#1}\\rangle}");Ee("\\Bra","\\left\\langle#1\\right|");Ee("\\Ket","\\left|#1\\right\\rangle");var X8e=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}};Ee("\\bra@ket",X8e(!1));Ee("\\bra@set",X8e(!0));Ee("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Ee("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Ee("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Ee("\\angln","{\\angl n}");Ee("\\blue","\\textcolor{##6495ed}{#1}");Ee("\\orange","\\textcolor{##ffa500}{#1}");Ee("\\pink","\\textcolor{##ff00af}{#1}");Ee("\\red","\\textcolor{##df0030}{#1}");Ee("\\green","\\textcolor{##28ae7b}{#1}");Ee("\\gray","\\textcolor{gray}{#1}");Ee("\\purple","\\textcolor{##9d38bd}{#1}");Ee("\\blueA","\\textcolor{##ccfaff}{#1}");Ee("\\blueB","\\textcolor{##80f6ff}{#1}");Ee("\\blueC","\\textcolor{##63d9ea}{#1}");Ee("\\blueD","\\textcolor{##11accd}{#1}");Ee("\\blueE","\\textcolor{##0c7f99}{#1}");Ee("\\tealA","\\textcolor{##94fff5}{#1}");Ee("\\tealB","\\textcolor{##26edd5}{#1}");Ee("\\tealC","\\textcolor{##01d1c1}{#1}");Ee("\\tealD","\\textcolor{##01a995}{#1}");Ee("\\tealE","\\textcolor{##208170}{#1}");Ee("\\greenA","\\textcolor{##b6ffb0}{#1}");Ee("\\greenB","\\textcolor{##8af281}{#1}");Ee("\\greenC","\\textcolor{##74cf70}{#1}");Ee("\\greenD","\\textcolor{##1fab54}{#1}");Ee("\\greenE","\\textcolor{##0d923f}{#1}");Ee("\\goldA","\\textcolor{##ffd0a9}{#1}");Ee("\\goldB","\\textcolor{##ffbb71}{#1}");Ee("\\goldC","\\textcolor{##ff9c39}{#1}");Ee("\\goldD","\\textcolor{##e07d10}{#1}");Ee("\\goldE","\\textcolor{##a75a05}{#1}");Ee("\\redA","\\textcolor{##fca9a9}{#1}");Ee("\\redB","\\textcolor{##ff8482}{#1}");Ee("\\redC","\\textcolor{##f9685d}{#1}");Ee("\\redD","\\textcolor{##e84d39}{#1}");Ee("\\redE","\\textcolor{##bc2612}{#1}");Ee("\\maroonA","\\textcolor{##ffbde0}{#1}");Ee("\\maroonB","\\textcolor{##ff92c6}{#1}");Ee("\\maroonC","\\textcolor{##ed5fa6}{#1}");Ee("\\maroonD","\\textcolor{##ca337c}{#1}");Ee("\\maroonE","\\textcolor{##9e034e}{#1}");Ee("\\purpleA","\\textcolor{##ddd7ff}{#1}");Ee("\\purpleB","\\textcolor{##c6b9fc}{#1}");Ee("\\purpleC","\\textcolor{##aa87ff}{#1}");Ee("\\purpleD","\\textcolor{##7854ab}{#1}");Ee("\\purpleE","\\textcolor{##543b78}{#1}");Ee("\\mintA","\\textcolor{##f5f9e8}{#1}");Ee("\\mintB","\\textcolor{##edf2df}{#1}");Ee("\\mintC","\\textcolor{##e0e5cc}{#1}");Ee("\\grayA","\\textcolor{##f6f7f7}{#1}");Ee("\\grayB","\\textcolor{##f0f1f2}{#1}");Ee("\\grayC","\\textcolor{##e3e5e6}{#1}");Ee("\\grayD","\\textcolor{##d6d8da}{#1}");Ee("\\grayE","\\textcolor{##babec2}{#1}");Ee("\\grayF","\\textcolor{##888d93}{#1}");Ee("\\grayG","\\textcolor{##626569}{#1}");Ee("\\grayH","\\textcolor{##3b3e40}{#1}");Ee("\\grayI","\\textcolor{##21242c}{#1}");Ee("\\kaBlue","\\textcolor{##314453}{#1}");Ee("\\kaGreen","\\textcolor{##71B307}{#1}");var K8e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class DMt{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 IMt($Mt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new yde(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 bc("EOF",n.loc)),this.pushTokens(i),new bc("",Pl.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 Ht("Extra }",a)}else if(a.text==="EOF")throw new Ht("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 Ht("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Ht("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 Ht("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 Ht("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 Ht("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 bc(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 yde(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)||vp.hasOwnProperty(e)||ea.math.hasOwnProperty(e)||ea.text.hasOwnProperty(e)||K8e.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:vp.hasOwnProperty(e)&&!vp[e].primitive}}var xde=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,VA=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),tF={"́":{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"}},wde={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Z8e=class Q8e{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 DMt(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 Ht("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 bc("}")),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(Q8e.endOfExpression.has(i.text)||r&&i.text===r||e&&vp[i.text]&&vp[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&&(r8e(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:Pl.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=CLt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function H2(t){return function(){return t}}var bL=(function(){try{var t=zy(Object,"defineProperty");return t({},"",{}),t}catch{}})(),RLt=bL?function(t,e){return bL(t,"toString",{configurable:!0,enumerable:!1,value:H2(e),writable:!0})}:By,cRe=ALt(RLt);function uRe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var $Lt=9007199254740991,NLt=/^(?:0|[1-9]\d*)$/;function LN(t,e){var r=typeof t;return e=e??$Lt,!!e&&(r=="number"||r!="symbol"&&NLt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=PLt}function Tg(t){return t!=null&&hJ(t.length)&&!o6(t)}function l6(t,e,r){if(!Ac(r))return!1;var n=typeof e;return(n=="number"?Tg(r)&&LN(e,r.length):n=="string"&&e in r)?W3(r[e],t):!1}function BLt(t){return NN(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&&l6(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function YIt(t,e){var r=this.__data__,n=BN(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function m0(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&QNt?new h6:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&l6(e[0],e[1],i)&&(n=1);++r-1?i[a?e[s]:s]:void 0}}var HDt=Math.max;function VDt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:iLt(r);return i<0&&(i=HDt(n+i,0)),hRe(t,kg(e),i)}var CJ=zDt(VDt);function HRe(t,e){var r=-1,n=Tg(t)?Array(t.length):[];return VN(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Ja(t,e){var r=ts(t)?gb:HRe;return r(t,kg(e))}function WDt(t,e){return t==null?t:wJ(t,kJ(e),Hy)}function qDt(t,e){return t&&TJ(t,kJ(e))}function GDt(t,e){return t>e}var UDt=Object.prototype,YDt=UDt.hasOwnProperty;function jDt(t,e){return t!=null&&YDt.call(t,e)}function VRe(t,e){return t!=null&&ORe(t,e,jDt)}function XDt(t,e){return gb(e,function(r){return t[r]})}function Of(t){return t==null?[]:XDt(t,uc(t))}var KDt="[object Map]",ZDt="[object Set]",QDt=Object.prototype,JDt=QDt.hasOwnProperty;function Qde(t){if(t==null)return!0;if(Tg(t)&&(ts(t)||typeof t=="string"||typeof t.splice=="function"||jT(t)||PN(t)||YT(t)))return!t.length;var e=Zc(t);if(e==KDt||e==ZDt)return!t.size;if(DN(t))return!vRe(t).length;for(var r in t)if(JDt.call(t,r))return!1;return!0}function Ba(t){return t===void 0}function WRe(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 aOt(t,e,r){e.length?e=gb(e,function(a){return ts(a)?function(s){return HN(s,a.length===1?a[0]:a)}:a}):e=[By];var n=-1;e=gb(e,ON(kg));var i=HRe(t,function(a,s,o){var l=gb(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return rOt(i,function(a,s){return iOt(a,s,r)})}function sOt(t,e){return tOt(t,e,function(r,n){return PRe(t,n)})}var TL=l$t(function(t,e){return t==null?{}:sOt(t,e)}),oOt=Math.ceil,lOt=Math.max;function cOt(t,e,r,n){for(var i=-1,a=lOt(oOt((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function uOt(t){return function(e,r,n){return n&&typeof n!="number"&&l6(e,r,n)&&(r=n=void 0),e=xR(e),r===void 0?(r=e,e=0):r=xR(r),n=n===void 0?e1&&l6(t,e[0],e[1])?e=[]:r>2&&l6(e[0],e[1],e[2])&&(e=[e[0]]),aOt(t,gJ(e),[])}),dOt=1/0,fOt=mb&&1/bJ(new mb([,-0]))[1]==dOt?function(t){return new mb(t)}:kLt,pOt=200;function gOt(t,e,r){var n=-1,i=ILt,a=t.length,s=!0,o=[],l=o;if(a>=pOt){var u=fOt(t);if(u)return bJ(u);s=!1,i=IRe,l=new h6}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]=Kg,this._children[e]={},this._children[Kg][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],kt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),kt(uc(this._in[e]),r),delete this._in[e],delete this._preds[e],kt(uc(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(Ba(r))r=Kg;else{r+="";for(var n=r;!Ba(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!==Kg)return r}}children(e){if(Ba(e)&&(e=Kg),this._isCompound){var r=this._children[e];if(r)return uc(r)}else{if(e===Kg)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return uc(r)}successors(e){var r=this._sucs[e];if(r)return uc(r)}neighbors(e){var r=this.predecessors(e);if(r)return mOt(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;kt(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),kt(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&&kt(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return o6(e)||(e=H2(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Of(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return DE(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,Ba(n)||(n=""+n);var o=O5(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Ba(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=wOt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,efe(this._preds[r],e),efe(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?aF(this._isDirected,arguments[0]):O5(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?aF(this._isDirected,arguments[0]):O5(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?aF(this._isDirected,arguments[0]):O5(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],tfe(this._preds[r],e),tfe(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=Of(n);return r?wf(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Of(n);return r?wf(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))}}$o.prototype._nodeCount=0;$o.prototype._edgeCount=0;function efe(t,e){t[e]?t[e]++:t[e]=1}function tfe(t,e){--t[e]||delete t[e]}function O5(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+Jde+a+Jde+(Ba(n)?xOt:n)}function wOt(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 aF(t,e){return O5(t,e.v,e.w,e.name)}function Pf(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:TOt(t),edges:kOt(t)};return Ba(t.graph())||(e.value=WNt(t.graph())),e}function TOt(t){return Ja(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ba(r)||(i.value=r),Ba(n)||(i.parent=n),i})}function kOt(t){return Ja(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ba(e.name)||(n.name=e.name),Ba(r)||(n.value=r),n})}var an=new Map,bp=new Map,qRe=new Map,GRe=w(()=>{bp.clear(),qRe.clear(),an.clear()},"clear"),ly=w((t,e)=>{const r=bp.get(e)||[];return he.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),COt=w((t,e)=>{const r=bp.get(e)||[];return he.info("Descendants of ",e," is ",r),he.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||ly(t.v,e)||ly(t.w,e)||r.includes(t.w):(he.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),cG=w((t,e,r,n)=>{he.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),he.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)cG(a,e,r,n);else{const s=e.node(a);he.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(he.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(he.debug("Setting parent",a,t),r.setParent(a,t)):(he.info("In copy ",t,"root",n,"data",e.node(t),n),he.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);he.debug("Copying Edges",o),o.forEach(l=>{he.info("Edge",l);const u=e.edge(l.v,l.w,l.name);he.info("Edge data",u,n);try{if(COt(l,n)){const h=bp.get(n)||[],d=h.includes(l.v)||ly(l.v,n)||l.v===n,f=h.includes(l.w)||ly(l.w,n)||l.w===n;if(d&&f)he.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),he.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;he.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else he.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){he.error(h)}})}he.debug("Removing node",a),e.removeNode(a)})},"copy"),URe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)qRe.set(i,t),n=[...n,...URe(i,e)];return n},"extractDescendants"),SOt=w((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"),ZT=w((t,e,r)=>{const n=e.children(t);if(he.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=ZT(a,e,r),o=SOt(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),rfe=w(t=>!an.has(t)||!an.get(t).externalConnections?t:an.has(t)?an.get(t).id:t,"getAnchorId"),EOt=w((t,e)=>{var r;if(!t||e>10){he.debug("Opting out, no graph ");return}else he.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(he.warn("Cluster identified",n," Replacement id in edges: ",ZT(n,t,n)),bp.set(n,URe(n,t)),an.set(n,{id:ZT(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(he.debug("Cluster identified",n,bp),a.forEach(s=>{const o=ly(s.v,n),l=ly(s.w,n);o^l&&(he.warn("Edge: ",s," leaves cluster ",n),he.warn("Descendants of XXX ",n,": ",bp.get(n)),an.get(n).externalConnections=!0)})):he.debug("Not a cluster ",n,bp)});for(let n of an.keys()){const i=an.get(n).id,a=t.parent(i);a!==n&&an.has(a)&&!an.get(a).externalConnections&&(an.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=an.get(n))!=null&&r.externalConnections)&&s&&XRe(t,i,n)){const o=ROt(t,n,t.parent(i));o&&(an.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),he.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(he.warn("Fix XXX",an,"ids:",n.v,n.w,"Translating: ",an.get(n.v)," --- ",an.get(n.w)),an.get(n.v)||an.get(n.w)){if(he.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=rfe(n.v),s=rfe(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);an.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);an.get(o).externalConnections=!0,i.toCluster=n.w}he.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),he.warn("Adjusted Graph",Pf(t)),YRe(t,0),he.trace(an)},"adjustClustersAndEdges"),YRe=w((t,e)=>{var i,a,s,o;if(he.warn("extractor - ",e,Pf(t),t.children("D")),e>10){he.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){he.debug("Done, no node has children",t.nodes());return}he.debug("Nodes = ",r,e);for(const l of r)if(he.debug("Extracting node",l,an,an.has(l)&&!an.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!an.has(l))he.debug("Not a cluster",l,e);else if((a=(i=an.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){he.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=an.get(l).clusterData.dir,h=new $o({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});cG(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:an.get(l).clusterData,label:an.get(l).label,graph:h}),he.warn("Subgraph for cluster with explicit dir created:",l,Pf(h))}else if(!an.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){he.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=an.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=an.get(l).clusterData.dir,he.warn("Fixing dir",an.get(l).clusterData.dir,h));const d=new $o({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});cG(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:an.get(l).clusterData,label:an.get(l).label,graph:d}),he.debug("Old graph after copy",Pf(t))}else he.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!an.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),he.debug(an);r=t.nodes(),he.warn("New list of nodes",r);for(const l of r){const u=t.node(l);he.warn(" Now next level",l,u),u!=null&&u.clusterNode&&YRe(u.graph,e+1)}},"extractor"),jRe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=jRe(t,i);r=[...r,...a]}),r},"sorter"),AOt=w(t=>jRe(t,t.children()),"sortNodesByHierarchy"),XRe=w((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=an.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),ROt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||ly(i,r))continue;const a=ZT(i,t,e);if(a&&!XRe(t,a,e))return a}return null},"findSafeAnchorNode");class _Ot{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return nfe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&nfe(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,MOt)),n=n._prev;return"["+e.join(", ")+"]"}}function nfe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function MOt(t,e){if(t!=="_next"&&t!=="_prev")return e}var LOt=H2(1);function IOt(t,e){if(t.nodeCount()<=1)return[];var r=NOt(t,e||LOt),n=$Ot(r.graph,r.buckets,r.zeroIdx);return q3(Ja(n,function(i){return t.outEdges(i.v,i.w)}))}function $Ot(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)sF(t,e,r,s);for(;s=i.dequeue();)sF(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(sF(t,e,r,s,!0));break}}}return n}function sF(t,e,r,n,i){var a=i?[]:void 0;return kt(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,uG(e,r,l)}),kt(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,uG(e,r,u)}),t.removeNode(n.v),a}function NOt(t,e){var r=new $o,n=0,i=0;kt(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),kt(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=KT(i+n+3).map(function(){return new _Ot}),s=n+1;return kt(r.nodes(),function(o){uG(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function uG(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 DOt(t){var e=t.graph().acyclicer==="greedy"?IOt(t,r(t)):OOt(t);kt(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,AJ("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function OOt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,kt(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return kt(t.nodes(),i),e}function POt(t){kt(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 G3(t,e,r,n){var i;do i=AJ(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function BOt(t){var e=new $o().setGraph(t.graph());return kt(t.nodes(),function(r){e.setNode(r,t.node(r))}),kt(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 KRe(t){var e=new $o({multigraph:t.isMultigraph()}).setGraph(t.graph());return kt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),kt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function ife(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 qN(t){var e=Ja(KT(ZRe(t)+1),function(){return[]});return kt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ba(i)||(e[i][n.order]=r)}),e}function FOt(t){var e=d6(Ja(t.nodes(),function(r){return t.node(r).rank}));kt(t.nodes(),function(r){var n=t.node(r);VRe(n,"rank")&&(n.rank-=e)})}function zOt(t){var e=d6(Ja(t.nodes(),function(a){return t.node(a).rank})),r=[];kt(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;kt(r,function(a,s){Ba(a)&&s%i!==0?--n:n&&kt(a,function(o){t.node(o).rank+=n})})}function afe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),G3(t,"border",i,e)}function ZRe(t){return oy(Ja(t.nodes(),function(e){var r=t.node(e).rank;if(!Ba(r))return r}))}function HOt(t,e){var r={lhs:[],rhs:[]};return kt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function VOt(t,e){return e()}function WOt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&kt(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=wf(e.edges(),function(h){return l===lfe(t,t.node(h.v),o)&&l!==lfe(t,t.node(h.w),o)});return EJ(u,function(h){return f6(e,h)})}function s_e(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),MJ(t),_J(t,e),iPt(t,e)}function iPt(t,e){var r=CJ(t.nodes(),function(i){return!e.node(i).parent}),n=rPt(t,r);n=n.slice(1),kt(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 aPt(t,e,r){return t.hasEdge(e,r)}function lfe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function sPt(t){switch(t.graph().ranker){case"network-simplex":cfe(t);break;case"tight-tree":lPt(t);break;case"longest-path":oPt(t);break;default:cfe(t)}}var oPt=RJ;function lPt(t){RJ(t),JRe(t)}function cfe(t){Vy(t)}function cPt(t){var e=G3(t,"root",{},"_root"),r=uPt(t),n=oy(Of(r))-1,i=2*n+1;t.graph().nestingRoot=e,kt(t.edges(),function(s){t.edge(s).minlen*=i});var a=hPt(t)+1;kt(t.children(),function(s){o_e(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function o_e(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=afe(t,"_bt"),u=afe(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,kt(o,function(d){o_e(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 uPt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&kt(a,function(s){r(s,i+1)}),e[n]=i}return kt(t.children(),function(n){r(n,1)}),e}function hPt(t){return DE(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function dPt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,kt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function fPt(t,e,r){var n={},i;kt(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 pPt(t,e,r){var n=gPt(t),i=new $o({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return kt(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),kt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Ba(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 gPt(t){for(var e;t.hasNode(e=AJ("_root")););return e}function mPt(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 vPt(t){var e={},r=wf(t.nodes(),function(o){return!t.children(o).length}),n=oy(Ja(r,function(o){return t.node(o).rank})),i=Ja(KT(n+1),function(){return[]});function a(o){if(!VRe(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),kt(t.successors(o),a)}}var s=OE(r,function(o){return t.node(o).rank});return kt(s,a),i}function bPt(t,e){return Ja(e,function(r){var n=t.inEdges(r);if(n.length){var i=DE(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 xPt(t,e){var r={};kt(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ba(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),kt(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Ba(a)&&!Ba(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=wf(r,function(i){return!i.indegree});return wPt(n)}function wPt(t){var e=[];function r(a){return function(s){s.merged||(Ba(s.barycenter)||Ba(a.barycenter)||s.barycenter>=a.barycenter)&&TPt(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),kt(i.in.reverse(),r(i)),kt(i.out,n(i))}return Ja(wf(e,function(a){return!a.merged}),function(a){return TL(a,["vs","i","barycenter","weight"])})}function TPt(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 kPt(t,e){var r=HOt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=OE(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(CPt(!!e)),l=ufe(a,i,l),kt(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=ufe(a,i,l)});var u={vs:q3(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function ufe(t,e,r){for(var n;e.length&&(n=wL(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function CPt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function l_e(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=wf(i,function(g){return g!==s&&g!==o}));var u=bPt(t,i);kt(u,function(g){if(t.children(g.v).length){var m=l_e(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&EPt(g,m)}});var h=xPt(u,r);SPt(h,l);var d=kPt(h,n);if(s&&(d.vs=q3([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 SPt(t,e){kt(t,function(r){r.vs=q3(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function EPt(t,e){Ba(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 APt(t){var e=ZRe(t),r=hfe(t,KT(1,e+1),"inEdges"),n=hfe(t,KT(e-1,-1,-1),"outEdges"),i=vPt(t);dfe(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){RPt(o%2?r:n,o%4>=2),i=qN(t);var u=mPt(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 LPt(t){var e={},r=0;function n(i){var a=r;kt(t.children(i),n),e[i]={low:a,lim:r++}}return kt(t.children(),n),e}function IPt(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=wL(a);return kt(a,function(h,d){var f=NPt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(kt(a.slice(o,d+1),function(g){kt(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&c_e(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return kt(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 DE(e,i),r}function NPt(t,e){if(t.node(e).dummy)return CJ(t.predecessors(e),function(r){return t.node(r).dummy})}function c_e(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 DPt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function OPt(t,e,r,n){var i={},a={},s={};return kt(e,function(o){kt(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),kt(e,function(o){var l=-1;kt(o,function(u){var h=n(u);if(h.length){h=OE(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",()=>nBt(t));r(" runLayout",()=>YPt(n,r)),r(" updateInputGraph",()=>jPt(t,n))})}function YPt(t,e){e(" makeSpaceForEdgeLabels",()=>iBt(t)),e(" removeSelfEdges",()=>fBt(t)),e(" acyclic",()=>DOt(t)),e(" nestingGraph.run",()=>cPt(t)),e(" rank",()=>sPt(KRe(t))),e(" injectEdgeLabelProxies",()=>aBt(t)),e(" removeEmptyRanks",()=>zOt(t)),e(" nestingGraph.cleanup",()=>dPt(t)),e(" normalizeRanks",()=>FOt(t)),e(" assignRankMinMax",()=>sBt(t)),e(" removeEdgeLabelProxies",()=>oBt(t)),e(" normalize.run",()=>jOt(t)),e(" parentDummyChains",()=>_Pt(t)),e(" addBorderSegments",()=>WOt(t)),e(" order",()=>APt(t)),e(" insertSelfEdges",()=>pBt(t)),e(" adjustCoordinateSystem",()=>qOt(t)),e(" position",()=>GPt(t)),e(" positionSelfEdges",()=>gBt(t)),e(" removeBorderNodes",()=>dBt(t)),e(" normalize.undo",()=>KOt(t)),e(" fixupEdgeLabelCoords",()=>uBt(t)),e(" undoCoordinateSystem",()=>GOt(t)),e(" translateGraph",()=>lBt(t)),e(" assignNodeIntersects",()=>cBt(t)),e(" reversePoints",()=>hBt(t)),e(" acyclic.undo",()=>POt(t))}function jPt(t,e){kt(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))}),kt(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 XPt=["nodesep","edgesep","ranksep","marginx","marginy"],KPt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ZPt=["acyclicer","ranker","rankdir","align"],QPt=["width","height"],JPt={width:0,height:0},eBt=["minlen","weight","width","height","labeloffset"],tBt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},rBt=["labelpos"];function nBt(t){var e=new $o({multigraph:!0,compound:!0}),r=uF(t.graph());return e.setGraph(lG({},KPt,cF(r,XPt),TL(r,ZPt))),kt(t.nodes(),function(n){var i=uF(t.node(n));e.setNode(n,ODt(cF(i,QPt),JPt)),e.setParent(n,t.parent(n))}),kt(t.edges(),function(n){var i=uF(t.edge(n));e.setEdge(n,lG({},tBt,cF(i,eBt),TL(i,rBt)))}),e}function iBt(t){var e=t.graph();e.ranksep/=2,kt(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 aBt(t){kt(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};G3(t,"edge-proxy",a,"_ep")}})}function sBt(t){var e=0;kt(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=oy(e,n.maxRank))}),t.graph().maxRank=e}function oBt(t){kt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function lBt(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)}kt(t.nodes(),function(u){l(t.node(u))}),kt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,kt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),kt(t.edges(),function(u){var h=t.edge(u);kt(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 cBt(t){kt(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(ife(n,a)),r.points.push(ife(i,s))})}function uBt(t){kt(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 hBt(t){kt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function dBt(t){kt(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(wL(r.borderLeft)),s=t.node(wL(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}}),kt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function fBt(t){kt(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 pBt(t){var e=qN(t);kt(e,function(r){var n=0;kt(r,function(i,a){var s=t.node(i);s.order=a+n,kt(s.selfEdges,function(o){G3(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 gBt(t){kt(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 cF(t,e){return WN(TL(t,e),Number)}function uF(t){var e={};return kt(t,function(r,n){e[n.toLowerCase()]=r}),e}var ffe=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),pfe=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),mBt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),yBt=w((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 pfe(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":pfe(i)},"getSelfLoopSide"),vBt=w((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=ffe(Math.max(n,t.width*.35),36,l),h=ffe(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"),bBt=w((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"),h_e=w((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(x=>i.push(x));return}o.sort((x,b)=>x.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(x=>i.push(x));return}const p={width:u.edge.width,height:u.edge.height},g=yBt(t,f,o,d.start,a),m=vBt(f,g,e,p.width??0),y=bBt(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"),d_e=w(async(t,e,r,n,i,a)=>{he.warn("Graph in recursive render:XAX",Pf(e),i);const s=e.graph().rankdir;he.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?he.info("Recursive render XXX",e.nodes()):he.info("No nodes found for",e),e.edges().length>0&&he.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=mBt(r);await Promise.all(e.nodes().map(async function(x){const b=e.node(x);if(i!==void 0){const T=JSON.parse(JSON.stringify(i.clusterData));he.trace(`Setting data for parent cluster XXX Node.id = `,x,` data=`,T.height,` -Parent cluster`,i.height),e.setNode(i.id,T),e.parent(x)||(he.trace("Setting parent",x,i.id),e.setParent(x,i.id,T))}if(he.info("(Insert) Node XXX"+x+": "+JSON.stringify(e.node(x))),b!=null&&b.clusterNode){he.info("Cluster identified XBX",x,b.width,e.node(x));const{ranksep:T,nodesep:k}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:T+25,nodesep:k});const S=await c_e(d,b.graph,r,n,e.node(x),a),C=S.elem;gr(b,C),b.diff=S.diff||0,he.info("New compound node after recursive render XAX",x,"width",b.width,"height",b.height),wgt(C,b)}else e.children(x).length>0?(he.trace("Cluster - the non recursive path XBX",x,b.id,b,b.width,"Graph:",e),he.trace(ZT(b.id,e)),an.set(b.id,{id:ZT(b.id,e),node:b})):(he.trace("Node - the non recursive path XAX",x,d,e.node(x),s),await yE(d,e.node(x),{config:a,dir:s}))})),await w(async()=>{const x=e.edges().map(async function(b){const T=e.edge(b.v,b.w,b.name);if(he.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),he.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),he.info("Fix",an,"ids:",b.v,b.w,"Translating: ",an.get(b.v),an.get(b.w)),f&&T.selfLoop){if(T.selfLoop.order!==1)return;const k=T.id;T.id=T.selfLoop.id,await rM(h,T),T.id=k;return}await rM(h,T)});await Promise.all(x)},"processEdges")(),he.info("Graph before layout:",JSON.stringify(Pf(e))),he.info("############################################# XXX"),he.info("### Layout ### XXX"),he.info("############################################# XXX"),o_e(e),he.info("Graph after layout:",JSON.stringify(Pf(e)));let g=0,{subGraphTitleTotalMargin:m}=M3(a);await Promise.all(wOt(e).map(async function(x){var T;const b=e.node(x);if(he.info("Position XBX => "+x+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,he.info("A tainted cluster node XBX1",x,b.id,b.width,b.height,b.x,b.y,e.parent(x)),an.get(b.id).node=b,tM(b);else if(e.children(x).length>0){he.info("A pure cluster node XBX1",x,b.id,b.x,b.y,b.width,b.height,e.parent(x)),b.height+=m,e.node(b.parentId);const k=(b==null?void 0:b.padding)/2||0,S=((T=b==null?void 0:b.labelBBox)==null?void 0:T.height)||0,C=S-k||0;he.debug("OffsetY",C,"labelHeight",S,"halfPadding",k),await B$(l,b),an.get(b.id).node=b}else{const k=e.node(b.parentId);b.y+=m/2,he.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",k,k==null?void 0:k.offsetY,b),tM(b)}}));const y=m/2;return l_e(e,y,{mergeSelfLoops:f}).forEach(function({edge:x,start:b,end:T}){he.info("Edge "+b+" -> "+T+": "+JSON.stringify(x),x),x.points.forEach(E=>E.y+=y);const k=e.node(b),S=e.node(T),C=hZ(u,x,an,r,k,S,n);R5e(x,C)}),e.nodes().forEach(function(x){const b=e.node(x);he.info(x,b.type,b.diff),b.isGroup&&(g=b.diff)}),he.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),pBt=w(async(t,e)=>{var a,s,o,l,u,h;const r=new $o({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");dZ(n,t.markers,t.type,t.diagramId),S5e(),A5e(),ike(),VRe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),he.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),x=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},x.originalEdge=y,x.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",x.startLabelRight="",x.startLabelLeft="",x.endLabelLeft="",x.endLabelRight="",x.arrowTypeStart="none",x.arrowTypeEnd="none",x.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,x,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),he.warn("Graph at first:",JSON.stringify(Pf(r))),xOt(r),he.warn("Graph after XAX:",JSON.stringify(Pf(r)));const i=We();await c_e(n,r,t.type,t.diagramId,void 0,i)},"render");const gBt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:l_e,render:pBt},Symbol.toStringTag,{value:"Module"}));async function u_e(t,e){const r=new $o({multigraph:!0,compound:!0}),n=[...e.edges],i=We(),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 yE(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 xr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>yvr);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}}w(u_e,"createGraphWithElements");var pfe=5,WA=1e-5,qA=1e-6;function wL(t){const e=[];for(let r=0;r=1-qA||f<=qA||f>=1-qA?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}w(h_e,"segmentIntersection");function cG(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(cG,"isHorizontalSeg");function d_e(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(f_e,"getArcSweepFlag");var mBt=.001;function p_e(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Es[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&&Es[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}w(p_e,"applyMarkerOffsets");function g_e(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${yb(o)}`];return i==="arc"?u.push(`A${Pu(t.r)},${Pu(t.r)} 0 0 ${n} ${yb(l)}`):u.push(`M${yb(l)}`),u}w(g_e,"emitJump");function uG(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=uG(i[u-1],i[u],i[u+1]??i[u],pfe);b&&(m=b.cutLen)}let y=d,v=null;a&&ub.t-T.t);for(const b of x)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bT){const k=T/2;x[b].r=Math.min(x[b].r,k),x[b+1].r=Math.min(x[b+1].r,k)}}for(const b of x)b.r=2?n:null}catch{return null}}w(b_e,"decodeDataPoints");function x_e(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=b_e(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=d_e(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&&!v_e(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!y_e(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,x=m_e(u,h,r);if(p.setAttribute("d",x),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),T=Math.max(0,b-y-v),k=`0 ${y} ${T} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${k};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}w(x_e,"applyLineJumpsToSvg");async function w_e(t,e){var i,a;for(const s of t.nodes)s.isGroup?await B$(e.clusters,s):tM(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=hZ(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await rM(e.rootGroups,s),s.label&&T_e(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}));x_e(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}w(w_e,"adjustLayout");function T_e(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=pr(),{subGraphTitleTotalMargin:i}=M3({flowchart:n.flowchart??{}});if(t.label){const a=NS.get(t.id);let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=Na.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Vr.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=Na.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}w(T_e,"positionEdgeLabel");var cF="__swimlane_default__",yBt=21,gfe=20;function hG(t){return Math.max(t.padding??gfe,gfe)}w(hG,"topLaneHorizontalPadding");function k_e(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(yBt,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}}w(k_e,"assignTopLaneTitleRect");function C_e(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===cF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:cF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=cF}w(C_e,"prepareLayoutForSwimlanes");function S_e(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}}w(S_e,"toGraphView");function E_e(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(x=>x.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const x of p){const b=x.x??r.x[x.id],T=x.y??r.y[x.id],k=x.width??0,S=x.height??0;b!=null&&T!=null&&(g=Math.min(g,b-k/2),m=Math.max(m,b+k/2),y=Math.min(y,T-S/2),v=Math.max(v,T+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 x=f.padding??20,b=f.parentId?x:2*hG(f),T=x,k=Math.max(0,m-g)+b,S=Math.max(0,v-y)+T,C=(g+m)/2,E=(y+v)/2;f.x=C,f.y=E,f.width=k,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),x=m+2*v,b=(f+p)/2;for(const A of d)A.y=b,A.height=x,A.swimlaneContentTop=f;const T=[...d].sort((A,M)=>{const L=A.x??0,P=M.x??0;return L-P}),k=[],S=[],C=[];for(const A of T){const M=h.get(A.id);if(!M)continue;const L=Math.max(0,M.maxX-M.minX)+2*hG(A),P=(M.minX+M.maxX)/2;k.push(A.id),S.push(P),C.push(L)}const E=k.length;if(E>0){const A=new Map;if(E===1)A.set(k[0],C[0]);else{const M=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:vb(e,r,n,i)}:void 0}w(_J,"measuredNodeRect");function MJ(t){if(t.isGroup)return;const e=_J(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(MJ,"nodeBoundsInfoFor");function pu(t,e,r=Ps){return Math.abs(t.x-e.x)r}w(wa,"isHorizontalSegment");function Ta(t,e,r=Ps){return Cn(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ta,"isVerticalSegment");function yl(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)))}w(yl,"overlapLength");function Jh(t,e,r=Ps){return t.horizontal&&e.horizontal&&Rn(t.a,e.a,r)?yl(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Cn(t.a,e.a,r)?yl(t.a.y,t.b.y,e.a.y,e.b.y):0}w(Jh,"sameAxisSegmentOverlapLength");function QT(t,e=Ps){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!pu(i,n,e))&&r.push({x:n.x,y:n.y})}return r}w(Fn,"dedupeConsecutivePoints");function LJ(t,e=Ps){if(!t||t.length!==4)return;const[r,n,i,a]=t;return wa(r,n,e)&&Ta(n,i,e)&&wa(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ta(r,n,e)&&wa(n,i,e)&&Ta(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}w(LJ,"classifyThreeSegmentRoute");function WN(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}w(R_e,"rectContainsRect");function TL(t,e){return t.lefte.left&&t.tope.top}w(TL,"rectsOverlap");function dG(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(dG,"inflateRect");function vb(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(vb,"rectFromCenterSize");function Jl(t){var e;return(e=_J(t))==null?void 0:e.rect}w(Jl,"rectOfNodeBounds");function o1(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}}}w(o1,"portForRectSide");function $J(t,e,r,n,i,a=Ps){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Rn(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(Rn(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(Cn(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(Cn(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}w($J,"buildOrthogonalPortPath");function NJ(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]}w(NJ,"buildSameSideTrackPath");function qN(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=MJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(qN,"collectRealNodeBounds");function Cg(t){const e=[],r=[];for(const n of t){const i=MJ(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}}w(Cg,"collectNodeRectEntries");function __e(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,...vb(i,a,s,o)})}return r}w(__e,"collectLayoutNodeRects");function DJ(t,e,r=Ps){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 x=Math.abs(m-h.a.x)i:a&&o&&Rn(t,r,i)?yl(t.x,e.x,r.x,n.x)>i:!1}w(M_e,"sameAxisSegmentsOverlap");function kL(t,e,r,n,{epsilon:i=Ps,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+Ps&&t=2?e[e.length-2]:void 0,l=(s?Cn(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||!pu(i,n))&&r.push(n)}return r}w(CL,"orthogonalizePolyline");function sd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=I_e(e);if(e=n.points,!n.changed)break}return e}w(sd,"simplifyPolyline");var Gr=.001,bBt=.5,mfe=4;function PJ(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=$_e(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}w(pG,"clipEndpoint");function N_e(t,e){for(const r of t){const n=PJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=pG(i,n.srcRect,!0)),n.dstRect&&(i=pG(i,n.dstRect,!1)),i=sd(CL(i)),i=BJ(i,n.srcRect,n.dstRect),n.edge.points=sd(CL(i))}}w(N_e,"clipEdgeEndpointsToNodeBoundaries");function gG(t,e,r,n=!1){if(Rn(t,e,Gr)){if(e.yr.bottom+Gr)return e;if(n){if(t.xr.right+Gr)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(Cn(t,e,Gr)){if(e.xr.right+Gr)return e;if(n){if(t.yr.bottom+Gr)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}w(gG,"snapEndpointToBoundary");function SL(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}}w(D_e,"intersectRanges");function yG(t,e){return e==="left"||e==="right"?EL(t.top,t.bottom):EL(t.left,t.right)}w(yG,"clearanceRangeForSide");function AL(t,e,r){const n=t.y>=r.top-Gr&&t.y<=r.bottom+Gr,i=t.x>=r.left-Gr&&t.x<=r.right+Gr;if(Rn(t,e,Gr)&&n){if(Math.abs(t.x-r.left)0?D_e(a):void 0}w(O_e,"straightClearanceRange");function vG(t,e,r,n,i){const a=O_e(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-Gr&&Math.max(t.x,e.x)<=r.right+Gr,i=Math.min(t.y,e.y)>=r.top-Gr&&Math.max(t.y,e.y)<=r.bottom+Gr;if(Math.abs(t.y-r.top)n.bottom+Gr;case"left":return Rn(e,r,Gr)&&r.xn.right+Gr}}w(wG,"leavesOutward");function TG(t,e,r){if(t.length<3)return t;if(r){const a=xG(t[0],t[1],e);return a&&wG(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=xG(t[n-1],t[n],e);return i&&wG(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(TG,"collapseOwnBorderStub");function F_e(t,e,r){let n=t;if(e){const a=SL(n,0,1);if(a){const s=gG(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=TG(n,e,!0)}if(r){const a=n.length-1,s=SL(n,a,-1);if(s){const o=gG(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=TG(n,r,!1)}const i=BJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=bG(n,e,!0)),r&&(n=bG(n,r,!1)),n)}w(F_e,"snapAndCollapseEndpoints");function kG(t,e){for(const r of t){const n=PJ(r,e,2);if(!n)continue;const i=Fn(n.points,Gr),a=F_e(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}}w(kG,"prepareEdgeEndpointsForRenderer");function FJ(t){return new Map(t.map(e=>[e.id,e]))}w(FJ,"buildNodeMap");function z_e(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}w(z_e,"resolveTopLevelGroupId");function CG(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}w(CG,"groupDepth");function zJ(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}}w(zJ,"boundsForChildren");function H_e(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}w(H_e,"applyGroupBounds");function V_e(t){const e=FJ(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>CG(i,e)-CG(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=zJ(i);a&&H_e(n,a)}}w(V_e,"recomputeNestedGroupBounds");function RL(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=w(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}w(RL,"mirrorAxis");function W_e(t){return(t.nodes??[]).some(r=>!r.isGroup)?RL(t,"y"):!0}w(W_e,"applyBtDirectionTransform");function q_e(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(N=>!N.isGroup);let a=1/0,s=1/0;for(const N of i){const _=N.x??0,I=N.y??0;_0?Math.max(1,h/d):1;for(const N of i){const _=N.x??0,O=((N.y??0)-s)*f+o,D=_-a;N.x=O,N.y=D}for(const N of n)if(N.points)for(const _ of N.points){const I=_.x,D=(_.y-s)*f+o,$=I-a;_.x=D,_.y=$}V_e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&RL(t,"x"),!0;const g=FJ(r),m=new Map;for(const N of r){if(N.isGroup)continue;const _=z_e(N,g);if(!_)continue;const I=m.get(_)??[];I.push(N),m.set(_,I)}let y=0;for(const N of p){const _=N.padding??0;_>y&&(y=_)}const v=[];let x=1/0,b=-1/0;for(const N of p){const _=m.get(N.id)??[],I=zJ(_);I&&(x=Math.min(x,I.minX),b=Math.max(b,I.maxX),v.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(x===1/0||b===-1/0)return!0;const T=Math.max(0,b-x),k=Math.max(y,10),S=T+2*k,C=o+S,M=(x+b)/2-S/2-o,L=M+C/2,P=Math.max(y,o);v.sort((N,_)=>N.centerY-_.centerY);for(let N=0;Nf.cy?v.bottom:v.top,P=f.cx+x;if(P<=v.left+wu||P>=v.right-wu)continue;b={x:P,y:L},T={x:P,y:o.y},k={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,P=f.cy+x;if(P<=v.top+wu||P>=v.bottom-wu)continue;b={x:L,y:P},T={x:o.x,y:P},k={x:o.x,y:o.y}}const S=pu(b,T,wu),C=pu(T,k,wu);if(S&&C||!S&&za(b,T,n,[h],1)||!C&&za(T,k,n,[d],1))continue;const E=!S&&kL(b,T,t,i,{epsilon:wu,skipDegenerateOther:!0}),A=!C&&kL(T,k,t,i,{epsilon:wu,skipDegenerateOther:!0});if(!(E||A)){S?y=[T,k]:C?y=[b,T]:y=[b,T,k];break}}y&&(i.points=y)}}w(G_e,"portSwapToLShape");function U_e(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Fn(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,x=f.y-p.y;if(Math.hypot(v,x)<.001)continue;const T=wa(f,d,.001),k=Ta(f,d,.001),S=wa(p,f,.001),C=Ta(p,f,.001);if(!(T&&C||k&&S))continue;const E=o.end,A=o.start,M=E?e.get(E):void 0;if(!M)continue;const L=M.x??0,P=M.y??0,N=Jl(M);if(!N)continue;let _,I;if(C){const B=x<0;_={x:L,y:p.y},I={x:L,y:B?N.bottom:N.top}}else{const B=v>0;_={x:p.x,y:P},I={x:B?N.right:N.left,y:P}}if(za(_,I,a,E?[E]:[],-2)||za(_,I,s,[],-2))continue;if(A){const B=e.get(A),V=B?Jl(B):void 0;if(V&&IJ(_,V,2))continue}const O=w((B,V)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${V.x.toFixed(3)},${V.y.toFixed(3)}`,"ownSegmentKey"),D=new Set;for(let B=0;B{for(const q of t){if(q===o||q.isLayoutOnly)continue;const G=q.points;if(!(!G||G.length<2))for(let Q=0;Q=0){const B=u[h-3],V=[A,E].filter(q=>!!q);if(za(B,_,a,V,-2)||$(B,_))continue}const z=[...u.slice(0,h-2),_,I];o.points=z;const H=o.labelNodeId;if(H){const B=e.get(H);if(B){const V=B.width??0,q=B.height??0;if(V>0&&q>0){let G,Q,j=-1;for(let ae=0;ae=V+2||me&&re>=q+2)&&re>j&&(j=re,G=(Z.x+J.x)/2,Q=(Z.y+J.y)/2)}G!==void 0&&Q!==void 0&&(B.x=G,B.y=Q)}}}}}w(U_e,"collapseShortTerminalStub");var fr=.001,Ns=8,fn=QT,uF=w((t,e)=>Cn(t,e,fr)||Rn(t,e,fr),"orthogonallyAligned");function Y_e(t,e){const i=w((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,x=g.y-y;let b=(p.width??0)/2,T=(p.height??0)/2;return Math.abs(x)*b>Math.abs(v)*T?(x<0&&(T=-T),{x:m+(x===0?0:T*v/x),y:y+T}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*x/v)})},"rectIntersect"),a=w((p,g)=>{const m=Fn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,x=v?Jl(v):void 0;if(!v||!y||!x)return;const b=g?m[0]:m[m.length-1],T=g?m[1]:m[m.length-2],k=i(v,b);let S=b;if(uF(T,k)&&(S=T),Cn(k,S,fr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:k.x,min:Math.min(k.y,S.y),max:Math.max(k.y,S.y),boundary:k,railEnd:S,rect:x};if(Rn(k,S,fr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:k.y,min:Math.min(k.x,S.x),max:Math.max(k.x,S.x),boundary:k,railEnd:S,rect:x}},"terminalLaneFor"),s=w((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=w((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)&&Cn(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Rn(p.boundary,g.boundary,1),"sameTerminalFace"),l=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=Ns&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=w((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=w((p,g)=>{const m=Fn(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(!w(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Rn(y,p.boundary,fr)&&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?Cn(y,p.boundary,fr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&pu(m[1],p.railEnd,fr),C=m.slice(S?2:1),E=C[0];return E&&!uF(E,v)?void 0:[y,v,...C]}const b=m.length>1&&pu(m[m.length-2],p.railEnd,fr),T=m.slice(0,b?-2:-1),k=T[T.length-1];if(!(k&&!uF(k,v)))return[...T,v,y]},"shiftedCandidate"),d=w(p=>{const g=p.edge,m=Fn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,x=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!x||!b)return!1;const T=x.x??0,k=x.y??0,S=b.x??0,C=b.y??0,[E,A]=m;return Rn(E,A,fr)&&Math.abs(k-C)<1&&Math.abs(T-S)>1||Cn(E,A,fr)&&Math.abs(T-S)<1&&Math.abs(k-C)>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),A=d(C);return E!==A?Number(E)-Number(A):+!C.atStart-+!S.atStart});for(const S of k){for(const C of f){const E=h(S,C);if(!E)continue;const A=a({...S.edge,points:E},S.atStart);if(!(!A||g.some(M=>M.edge!==S.edge&&(l(A,M)||T&&u(A,M))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}w(Y_e,"separateSharedRenderedTerminalLanes");function j_e(t,e){const{realNodeRects:n,labelNodeRects:i}=Cg(e.values()),a=w((o,l)=>{const u=o.start,h=o.end,d=fn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(za(p.a,p.b,n,f,-2)||za(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 fn(Fn(g)))if(Jh(m,y,.5)>=Ns||v0(m.a,m.b,y.a,y.b,fr))return!1}}return!0},"candidateIsSafe"),s=w((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=wa(u,h)&&Ta(h,d)&&wa(d,f)&&Ta(f,p)&&Cn(u,f,fr)&&Cn(u,p,fr)&&Cn(h,d,fr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ta(u,h)&&wa(h,d)&&Ta(d,f)&&wa(f,p)&&Rn(u,f,fr)&&Rn(u,p,fr)&&Rn(h,d,fr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Fn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ta(u,h)&&wa(h,d)&&Ta(d,f)&&wa(f,p)&&Ta(p,y)&&Cn(u,p,fr)&&Cn(u,y,fr)&&Cn(d,f,fr)&&(d.x-h.x)*(p.x-f.x)<0,x=wa(u,h)&&Ta(h,d)&&wa(d,f)&&Ta(f,p)&&wa(p,y)&&Rn(u,p,fr)&&Rn(u,y,fr)&&Rn(d,f,fr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!x))return Fn([...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=Fn(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}}w(j_e,"collapseRedundantRectangularDoglegs");function SG(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=w((g,m,y)=>Fn(g===m?y??[]:g.points??[]),"pointsFor"),u=w((g,m)=>{let y=0;for(let v=0;v{const m=fn(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=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const x=v.rect;return m.horizontal?yl(m.a.x,m.b.x,x.left,x.right)>=Ns&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:yl(m.a.y,m.b.y,x.top,x.bottom)>=Ns&&m.a.x>=x.left-2&&m.a.x<=x.right+2})},"blockingRectsFor"),f=w((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 x=sd(Fn(v));return fn(x).length===x.length-1?x:void 0},"candidateByMovingRail"),p=w((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),x=fn(m);if(x.length!==m.length-1)return!1;for(const b of x)if(za(b.a,b.b,a,v,-2)||za(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const T of x)for(const k of fn(l(b)))if(Jh(T,k,.5)>=Ns)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 x=l(v),b=h(x);if(!b)continue;const T=d(v,b.segment);if(T.length===0)continue;const k=b.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of k){const C=f(x,b.segment,S);if(!(!C||!p(v,C,m))){v.points=C,y=!0;break}}if(y)break}if(!y)return}}w(SG,"liftObstacleHuggingSameSideRails");function EG(t,e){const n=w(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=w(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+fr||h>=u.bottom-fr?!1:yl(l.a.x,l.b.x,u.left,u.right)>=Ns},"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=Fn(l.points??[]);for(const h of fn(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=fr))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})}}w(EG,"liftTopLaneTitleBandsAboveRails");function AG(t,e){const n=w(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=w(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+fr||d>=h.right-fr?!1:yl(u.a.y,u.b.y,h.top,h.bottom)>=Ns},"verticalSegmentIntersectsTitle"),s=w((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+fr||d>=h.bottom-fr?!1:yl(u.a.x,u.b.x,h.left,h.right)>=Ns},"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=Fn(u.points??[]);for(const d of fn(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<=fr))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})}}w(AG,"shiftLeftLaneTitleBandsLeftOfRails");function X_e(t,e){const{realNodeRects:n}=Cg(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=w((g,m=new Map)=>Fn(m.get(g)??g.points??[]),"replacementPointsFor"),s=w((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+dc(a(y,g)),0),"totalBends"),l=w(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!wa(y,v,fr)&&!Ta(y,v,fr)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=w((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],x=y[1];let b;if(wa(v,x,fr))b={x:x.x,y:m.tailStart.y};else if(Ta(v,x,fr))b={x:m.tailStart.x,y:x.y};else return;const T=sd(Fn([v,x,b,m.tailStart,m.terminal]));return fn(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),h=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of fn(m))if(za(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=w((g,m,y)=>{for(const v of i)if(v!==g){for(const x of fn(m))for(const b of fn(a(v,y)))if(Jh(x,b,.5)>=Ns)return!0}return!1},"pathHasSharedTrack"),f=w((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=w(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const x=g.get(y)??[];x.push(m),g.set(y,x)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,x=m,b=y;for(const T of p().values())for(let k=0;k=m||_>x||_===x&&I>=b||(v=N,x=_,b=I)}if(!v)return;for(const[T,k]of v)T.points=k}}w(X_e,"swapDestinationTerminalTailsToReduceCrossings");function K_e(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values()),o=t.filter(T=>!T.isLayoutOnly),l=w((T,k=new Map)=>Fn(k.get(T)??T.points??[]),"replacementPointsFor"),u=w((T=new Map)=>{let k=0;for(let S=0;So.reduce((k,S)=>k+dc(l(S,T)),0),"totalBends"),d=w(T=>{const k=T.start,S=T.end,C=k?e.get(k):void 0,E=S?e.get(S):void 0,A=C?Jl(C):void 0,M=E?Jl(E):void 0;return A&&M?{src:A,dst:M}:void 0},"endpointRectsFor"),f=w((T,k,S)=>{if(S.index<=0||S.index+1>=k.length-1)return;const C=d(T);if(C){if(S.vertical){const E=S.a.x,A=Math.min(C.src.left,C.dst.left),M=Math.max(C.src.right,C.dst.right),L=EM+fr?"right":void 0;return L?{edge:T,points:k,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,A=Math.min(C.src.top,C.dst.top),M=Math.max(C.src.bottom,C.dst.bottom),L=EM+fr?"bottom":void 0;return L?{edge:T,points:k,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=w(()=>{const T=[];for(const k of o){const S=l(k);for(const C of fn(S)){const E=f(k,S,C);E&&T.push(E)}}return T},"collectExternalRails"),g=w((T,k)=>T.edge!==k.edge&&T.axis===k.axis&&T.side===k.side&&yl(T.min,T.max,k.min,k.max)>=Ns,"railsInteract"),m=w(T=>{const k=[],S=new Set;for(const C of T){if(S.has(C))continue;const E=[C],A=[];for(S.add(C);E.length>0;){const M=E.pop();A.push(M);for(const L of T)!S.has(L)&&g(M,L)&&(S.add(L),E.push(L))}A.length>1&&k.push(A)}return k},"connectedComponents"),y=w(T=>{const k=[];for(const S of T)k.some(C=>Math.abs(C-S.coord){const k=T.map(E=>E.coord),S=y(T),C=[];if(T.length<=6){const E=new Array(S.length).fill(!1),A=[],M=w(()=>{if(A.length===T.length){A.some((L,P)=>Math.abs(L-k[P])>=fr)&&C.push([...A]);return}for(const[L,P]of S.entries())E[L]||(E[L]=!0,A.push(P),M(),A.pop(),E[L]=!1)},"visit");return M(),C}for(let E=0;E{const S=new Map;for(const[E,A]of T.entries()){const M=k[E],L=S.get(A.edge)??A.points.map(P=>({x:P.x,y:P.y}));A.axis==="vertical"?(L[A.segmentIndex].x=M,L[A.segmentIndex+1].x=M):(L[A.segmentIndex].y=M,L[A.segmentIndex+1].y=M),S.set(A.edge,L)}const C=new Map;for(const[E,A]of S){const M=sd(Fn(A));if(fn(M).length!==M.length-1)return;C.set(E,M)}return C},"replacementsForAssignment"),b=w(T=>{for(const[k,S]of T){const C=[k.start,k.end].filter(E=>!!E);for(const E of fn(S))if(za(E.a,E.b,a,C,-2)||za(E.a,E.b,s,[],-2))return!1}for(let k=0;k=Ns)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const k=u();if(k===0)return;let S,C=k,E=h(),A=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const L of v(M)){const P=x(M,L);if(!P||!b(P))continue;const N=u(P);if(N>=k)continue;const _=h(P),I=M.reduce((O,D,$)=>O+Math.abs(L[$]-D.coord),0);N>C||N===C&&(_>E||_===E&&I>=A)||(S=P,C=N,E=_,A=I)}if(!S)return;for(const[M,L]of S)M.points=L}}w(K_e,"reassignCrossingExternalRailChannels");function Z_e(t,e){const{realNodeRects:n,labelNodeRects:i}=Cg(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=w((p,g,m)=>Fn(p===g?m??[]:p.points??[]),"pointsFor"),o=w(p=>fn(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=w((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)&&yl(p.a.x,p.b.x,g.left,g.right)>=Ns}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&yl(p.a.y,p.b.y,g.top,g.bottom)>=Ns}return!1},"segmentRunsAlongRectBorder"),h=w(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),x=v?Jl(v):void 0;x&&m.push(x)}return m},"endpointRectsFor"),d=w((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],x=p[g+3],b=wa(m,y,fr)&&Ta(y,v,fr)&&wa(v,x,fr),T=Ta(m,y,fr)&&wa(y,v,fr)&&Ta(v,x,fr);if(!b&&!T)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(x.x-v.x):Math.sign(y.y-m.y)!==Math.sign(x.y-v.y)))return[];const S=Cn(m,x,fr)||Rn(m,x,fr)?[]:[{x:m.x,y:x.y},{x:x.x,y:m.y}],C=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(A=>[...p.slice(0,g+1),A,...p.slice(g+3)]),E=new Set;return C.map(A=>sd(Fn(A))).filter(A=>{if(fn(A).length!==A.length-1||!A.some(L=>pu(L,x,fr)))return!1;const M=A.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=w((p,g,m)=>{const y=[p.start,p.end].filter(x=>!!x),v=h(p);for(const x of fn(g))if(za(x.a,x.b,n,y,-2)||za(x.a,x.b,i,[],-2)||v.some(b=>u(x,b)))return!1;for(const x of a)if(x!==p){for(const b of fn(g))for(const T of fn(s(x)))if(Jh(b,T,.5)>=Ns)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const T of a){const k=s(T),S=dc(k,fr),C=o(k);for(let E=0;E<=k.length-4;E++)for(const A of d(k,E)){const M=dc(A,fr),L=o(A);if(!(Mv||N===v&&(M>x||M===x&&L>=b)||(m=T,y=A,v=N,x=M,b=L)}}if(!m||!y)return;m.points=y}}w(Z_e,"shortcutRedundantOrthogonalJogs");function Q_e(t,e){const s=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const ce=ue.x??0,Te=ue.y??0,ge=Jl(ue);ge&&s.push({id:String(ue.id??""),cx:ce,cy:Te,rect:ge})}if(s.length===0)return;const o=new Map(s.map(ue=>[ue.id,ue])),l=s.map(ue=>({id:ue.id,rect:ue.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ue=>ue.rect.top))-20,bottom:Math.max(...s.map(ue=>ue.rect.bottom))+20,left:Math.min(...s.map(ue=>ue.rect.left))-20,right:Math.max(...s.map(ue=>ue.rect.right))+20},d=t.filter(ue=>!ue.isLayoutOnly),f=new Map(d.map((ue,ce)=>[ue,ce])),p=w(ue=>{const ce=ue==="left"||ue==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[ue]+ce*20*ge);return Te},"outwardTracksForSide"),g=w((ue,ce=new Map)=>Fn(ce.get(ue)??ue.points??[]),"replacementPointsFor"),m=w((ue,ce)=>{let Te=0;for(const ge of ue)for(const Ve of ce)v0(ge.a,ge.b,Ve.a,Ve.b,fr)&&Te++;return Te},"crossingCountBetweenSegments"),y=w((ue,ce)=>m(fn(ue),fn(ce)),"crossingCountBetweenPaths"),v=w((ue=new Map)=>{let ce=0;const Te=[],ge=new Set,Ve=[],we=w(Ae=>{ge.has(Ae)||(ge.add(Ae),Ve.push(Ae))},"addEdge");for(let Ae=0;Ae0&&(ce+=oe,Te.push({first:Ue,second:Ce,count:oe}),we(Ue),we(Ce))}}return Ve.sort((Ae,Ue)=>(f.get(Ae)??0)-(f.get(Ue)??0)),{count:ce,pairs:Te,edgeSet:ge,edges:Ve}},"crossingSnapshot"),x=w((ue,ce)=>{const Te=new Set(ce.keys());if(Te.size===0)return ue.count;let ge=0;for(const we of ue.pairs)(Te.has(we.first)||Te.has(we.second))&&(ge+=we.count);let Ve=0;for(let we=0;we{const ce=new Map;for(const Ve of ue.pairs){const we=ce.get(Ve.first)??new Set;we.add(Ve.second),ce.set(Ve.first,we);const Ae=ce.get(Ve.second)??new Set;Ae.add(Ve.first),ce.set(Ve.second,Ae)}const Te=[],ge=new Set;for(const Ve of ue.edges){if(ge.has(Ve))continue;const we=[Ve],Ae=[];for(ge.add(Ve);we.length>0;){const Ue=we.pop();Ae.push(Ue);for(const le of ce.get(Ue)??[])ge.has(le)||(ge.add(le),we.push(le))}Ae.sort((Ue,le)=>(f.get(Ue)??0)-(f.get(le)??0)),Ae.length>1&&Te.push(Ae)}return Te},"crossingComponents"),T=w(ue=>[ue.start,ue.end].filter(ce=>!!ce),"endpointIdsFor"),k=w(ue=>{const ce=[];for(const Te of b(ue)){const ge=new Set(Te),Ve=new Set(Te.flatMap(Ae=>T(Ae))),we=[...Te];for(const Ae of d)ge.has(Ae)||T(Ae).some(Ue=>Ve.has(Ue))&&we.push(Ae);we.sort((Ae,Ue)=>(f.get(Ae)??0)-(f.get(Ue)??0)),ce.push(we)}return ce},"pairSearchGroups"),S=w((ue,ce,Te)=>x(ue,new Map([[ce,Te]])),"crossingCountWithSingleReplacement"),C=w(ue=>{const ce=new Map;for(const Te of ue.pairs)ce.set(Te.first,(ce.get(Te.first)??0)+Te.count),ce.set(Te.second,(ce.get(Te.second)??0)+Te.count);return ce},"currentCrossingsByEdge"),E=w(ue=>ue.slice(1).reduce((ce,Te,ge)=>{const Ve=ue[ge];return ce+Math.abs(Te.x-Ve.x)+Math.abs(Te.y-Ve.y)},0),"pathLength"),A=w((ue=new Map)=>d.reduce((ce,Te)=>ce+dc(g(Te,ue)),0),"totalBends"),M=w((ue=new Map)=>d.reduce((ce,Te)=>ce+E(g(Te,ue)),0),"totalLength"),L=w((ue,ce,Te=new Map)=>{const ge=fn(ce);for(const Ve of d)if(Ve!==ue){for(const we of ge)for(const Ae of fn(g(Ve,Te)))if(Jh(we,Ae,.5)>=Ns)return!0}return!1},"pathHasSegmentConflict"),P=w((ue,ce)=>{const Te=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of fn(ce))if(za(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),N=w((ue,ce)=>{const Te=sd(Fn(ce));fn(Te).length===Te.length-1&&ue.push(Te)},"pushOrthogonalCandidate"),_=w(ue=>ue==="left"||ue==="right","sideIsHorizontal"),I=w((ue,ce,Te)=>{switch(ce){case"left":return Math.min(ue.x,Te.x)-20;case"right":return Math.max(ue.x,Te.x)+20;case"top":return Math.min(ue.y,Te.y)-20;case"bottom":return Math.max(ue.y,Te.y)+20}},"localTrackForSameSide"),O=w((ue,ce,Te,ge)=>{const Ve=Te==="left"||Te==="top"?-1:1,we=[I(ce,Te,ge),h[Te]];for(const Ae of we)for(let Ue=0;Ue<=2;Ue++)N(ue,NJ(ce,Te,ge,Ae+Ve*20*Ue))},"addSameSideCandidates"),D=w((ue,ce,Te,ge,Ve)=>{for(const we of p(Te))for(const Ae of p(Ve))N(ue,[ce,{x:we,y:ce.y},{x:we,y:Ae},{x:ge.x,y:Ae},ge])},"addHorizontalToVerticalCandidates"),$=w((ue,ce,Te,ge,Ve)=>{for(const we of p(Te))for(const Ae of p(Ve))N(ue,[ce,{x:ce.x,y:we},{x:Ae,y:we},{x:Ae,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=w((ue,ce,Te,ge,Ve)=>{const we=[...p("top"),...p("bottom")];for(const Ae of p(Te))for(const Ue of p(Ve))for(const le of we)N(ue,[ce,{x:Ae,y:ce.y},{x:Ae,y:le},{x:Ue,y:le},{x:Ue,y:ge.y},ge])},"addHorizontalPairCandidates"),z=w((ue,ce,Te,ge,Ve)=>{const we=[...p("left"),...p("right")];for(const Ae of p(Te))for(const Ue of p(Ve))for(const le of we)N(ue,[ce,{x:ce.x,y:Ae},{x:le,y:Ae},{x:le,y:Ue},{x:ge.x,y:Ue},ge])},"addVerticalPairCandidates"),H=w(ue=>{const ce=new Set;return ue.map(Te=>Fn(Te)).filter(Te=>{const ge=Te.map(Ve=>`${Ve.x.toFixed(3)},${Ve.y.toFixed(3)}`).join("|");return ce.has(ge)||Te.length<2?!1:(ce.add(ge),!0)})},"dedupeCandidatePaths"),B=w((ue,ce,Te,ge)=>{const Ve=[],we=$J(ue,ce,Te,ge,20,fr);we&&N(Ve,we),ce===ge&&O(Ve,ue,ce,Te);const Ae=_(ce),Ue=_(ge);return Ae&&!Ue?D(Ve,ue,ce,Te,ge):!Ae&&Ue?$(Ve,ue,ce,Te,ge):Ae?F(Ve,ue,ce,Te,ge):z(Ve,ue,ce,Te,ge),H(Ve)},"buildCandidatesForSides"),V=w((ue,ce,Te,ge)=>{const Ve=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const Ue=o1(ge,Ae),le=Ae==="top"||Ae==="bottom"?p(Ae):we;for(const pe of Ve){N(ue,[ce,Te,{x:pe,y:Te.y},{x:pe,y:Ue.y},Ue]);for(const Ce of le)N(ue,[ce,Te,{x:pe,y:Te.y},{x:pe,y:Ce},{x:Ue.x,y:Ce},Ue])}}},"addVerticalDepartureOuterTrackCandidates"),q=w((ue,ce,Te,ge)=>{const Ve=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const Ue=o1(ge,Ae),le=Ae==="left"||Ae==="right"?p(Ae):Ve;for(const pe of we){N(ue,[ce,Te,{x:Te.x,y:pe},{x:Ue.x,y:pe},Ue]);for(const Ce of le)N(ue,[ce,Te,{x:Te.x,y:pe},{x:Ce,y:pe},{x:Ce,y:Ue.y},Ue])}}},"addHorizontalDepartureOuterTrackCandidates"),G=w(ue=>{const ce=ue.start,Te=ue.end,ge=Te?o.get(Te):void 0;if(!ce||!ge)return[];const Ve=Fn(ue.points??[]);if(Ve.length<4)return[];const we=Ve[0],Ae=Ve[1],Ue=[];return Ta(we,Ae,fr)?V(Ue,we,Ae,ge):wa(we,Ae,fr)&&q(Ue,we,Ae,ge),Ue},"terminalPreservingOuterTrackCandidates"),Q=w(ue=>{const ce=ue.start,Te=ue.end,ge=ce?o.get(ce):void 0,Ve=Te?o.get(Te):void 0;if(!ge||!Ve)return[];const we=[];for(const Ae of u){const Ue=o1(ge,Ae);for(const le of u)we.push(...B(Ue,Ae,o1(Ve,le),le))}return we.push(...G(ue)),we},"candidatePathsFor"),j=w(()=>new Map(d.map(ue=>[ue,fn(g(ue))])),"currentSegmentsByEdge"),ae=w((ue,ce,Te)=>{const ge=new Set;for(const Ve of d){if(Ve===ue)continue;const we=Te.get(Ve)??fn(g(Ve));ce.some(Ae=>we.some(Ue=>Jh(Ae,Ue,.5)>=Ns))&&ge.add(Ve)}return ge},"sharedTrackConflictsFor"),Z=w((ue,ce,Te,ge)=>{const Ve=new Set;return Q(ue).map(Ae=>sd(Fn(Ae))).filter(Ae=>{if(P(ue,Ae))return!1;const Ue=Ae.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return Ve.has(Ue)||Ae.length<2?!1:(Ve.add(Ue),!0)}).map(Ae=>{const Ue=fn(Ae);let le=0;for(const pe of d)pe!==ue&&(le+=m(Ue,Te.get(pe)??fn(g(pe))));return{candidate:Ae,candidateSegments:Ue,crossings:ce.count-(ge.get(ue)??0)+le,bends:dc(Ae,fr),totalBends:dc(Ae),length:E(Ae)}}).filter(({crossings:Ae})=>Ae<=ce.count).sort((Ae,Ue)=>Ae.crossings-Ue.crossings||Ae.bends-Ue.bends||Ae.length-Ue.length).slice(0,48).map(Ae=>({path:Ae.candidate,segments:Ae.candidateSegments,sharedTrackConflicts:ae(ue,Ae.candidateSegments,Te),totalBends:Ae.totalBends,length:Ae.length}))},"pairCandidatesFor"),J=w((ue,ce,Te,ge,Ve,we)=>{let Ae=0;for(const le of ue.pairs)(le.first===ce||le.second===ce||le.first===ge||le.second===ge)&&(Ae+=le.count);let Ue=m(Te.segments,Ve.segments);for(const le of d){if(le===ce||le===ge)continue;const pe=we.get(le)??fn(g(le));Ue+=m(Te.segments,pe)+m(Ve.segments,pe)}return ue.count-Ae+Ue},"pairCrossingCount"),re=w((ue,ce)=>{for(const Te of ue.sharedTrackConflicts)if(Te!==ce)return!1;return!0},"conflictsOnlyWith"),ee=w((ue,ce)=>ue.segments.some(Te=>ce.segments.some(ge=>Jh(Te,ge,.5)>=Ns)),"candidatesShareTrack"),me=w((ue,ce,Te,ge)=>re(ce,Te.edge)&&re(ge,ue.edge)&&!ee(ce,ge),"pairCandidatesAreCompatible"),te=w((ue,ce,Te,ge,Ve)=>{const we=J(ue.current,ce.edge,Te,ge.edge,Ve,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[ce.edge,Te.path],[ge.edge,Ve.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(ce.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+Ve.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(ce.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+Te.length+Ve.length}},"scorePairReplacement"),$e=w((ue,ce)=>ue.crossings{let Ve=ge;for(const we of ce.candidates)for(const Ae of Te.candidates){if(!me(ce,we,Te,Ae))continue;const Ue=te(ue,ce,we,Te,Ae);Ue&&$e(Ue,Ve)&&(Ve=Ue)}return Ve},"bestScoreForOptionPair"),He=w(ue=>{const ce=A(),Te=M(),ge=j(),Ve=C(ue),we=new Map(d.map(oe=>[oe,dc(g(oe))])),Ae=new Map(d.map(oe=>[oe,E(g(oe))])),Ue=new Map,le=k(ue);for(const oe of le)for(const fe of oe){if(Ue.has(fe))continue;const W=Z(fe,ue,ge,Ve);W.length>0&&Ue.set(fe,{edge:fe,candidates:W})}let pe={replacements:new Map,crossings:ue.count,bends:ce,length:Te};const Ce={current:ue,currentBends:ce,currentLength:Te,baseBendsByEdge:we,baseLengthByEdge:Ae,baseSegments:ge};for(const oe of le){const fe=new Set(oe.filter(se=>ue.edgeSet.has(se))),W=oe.map(se=>Ue.get(se)).filter(se=>!!se);for(let se=0;se0?pe.replacements:void 0},"bestPairedReplacement");for(let ue=0;ue<4;ue++){const ce=v(),Te=ce.count;if(Te===0)return;let ge,Ve,we=Te,Ae=Number.POSITIVE_INFINITY;for(const le of ce.edges){const pe=dc(g(le),fr);for(const Ce of Q(le)){const oe=P(le,Ce),fe=!oe&&L(le,Ce),W=S(ce,le,Ce),se=dc(Ce,fr);oe||fe||!(Wwe||W===we&&se>=Ae||(ge=le,Ve=Ce,we=W,Ae=se)}}if(ge&&Ve){ge.points=Ve;continue}const Ue=He(ce);if(!Ue)return;for(const[le,pe]of Ue)le.points=pe}}w(Q_e,"resolveRenderedOrthogonalCrossings");var B0=.001,TBt=8;function J_e(t,e){const{nodeInfoById:r,realNodeRects:n}=qN(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=w((m,y,v,x)=>{const b=[],T=$J(m,y,v,x,a,B0);return T&&b.push(T),y===x&&b.push(NJ(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=QT(m,B0),T=y.start,k=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const C=S.start,E=S.end;if(!v&&T&&k&&(C===T||C===k||E===T||E===k))continue;const A=S.points;if(!(!A||A.length<2))for(const M of b)for(const L of QT(A,B0)){if(OJ(M.a,M.b,L.a,L.b,B0,B0)){x++;continue}Jh(M,L,B0)>=TBt&&x++}}return x},"pathConflictCount"),h=4,d=w((m,y)=>{const v=Math.abs(m.y-y.rect.top),x=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),T=Math.abs(m.x-y.rect.right);let k="top",S=v;return x{const x=f.get(m)??[];x.push({side:y,edgeId:v}),f.set(m,x)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",x=m.start,b=m.end;if(x){const T=r.get(x);T&&p(x,d(y[0],T),v)}if(b){const T=r.get(b);T&&p(b,d(y[y.length-1],T),v)}}const g=w((m,y,v)=>{var x;return((x=f.get(m))==null?void 0:x.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=dc(y,B0);if(v0){const $=u(O,m,!0);if($>M||$===M&&D>=L)continue;M=$,L=D,A=O;continue}u(O,m)>E||D_.edgeId!==S));const N=f.get(b);N&&f.set(b,N.filter(_=>_.edgeId!==S)),p(x,d(A[0],T),S),p(b,d(A[A.length-1],k),S)}}}w(J_e,"simplifyDetouredEdges");var Nl=.001,yfe=10,UA=7;function RG(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&&TL(t,e9e(a)))}w(_G,"labelOverlapsOwnMarker");function xR(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=dG(m,a);for(const{nodeId:v,rect:x}of n)if(v!==g&&TL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=dG(m,a);for(const v of r)if(v.edgeId!==g&&WN(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=w((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=w(g=>{for(const{id:m,rect:y}of i)if(R_e(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&TL(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 x=y.width??0,b=y.height??0;if(x<=0||b<=0)continue;const T=[];for(let H=0;H=Nl&&G>=Nl||T.push({idx:H,length:q+G,orientation:q>=Nl?"horizontal":"vertical",midX:(B.x+V.x)/2,midY:(B.y+V.y)/2})}if(T.length===0)continue;const k=T.length>=3?T.filter(H=>H.idx>0&&H.idx0?k:T,C=x>=b?"horizontal":"vertical",E=w(H=>[...H].sort((B,V)=>{const q=B.orientation===C,G=V.orientation===C;if(q!==G)return q?-1:1;const Q=B.length>=(B.orientation==="horizontal"?x:b)+2,j=V.length>=(V.orientation==="horizontal"?x:b)+2;return Q!==j?Q?-1:1:V.length-B.length}),"rankSegments"),A=T[0],M=T[T.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=w((H,B)=>{const V=v[H.idx],q=v[H.idx+1];return{midX:V.x+(q.x-V.x)*B,midY:V.y+(q.y-V.y)*B}},"anchorAtT"),N=w((H,B,V)=>Math.min(V,Math.max(B,H)),"clamp"),_=w((H,B)=>H.midX>=B.left-Nl&&H.midX<=B.right+Nl&&H.midY>=B.top-Nl&&H.midY<=B.bottom+Nl,"pointInsideRectInclusive"),I=w(H=>{const B=vb(H.midX,H.midY,x,b),V=f(B);if(V)return{laneId:V,anchor:H,rect:B};const q=i.find(({rect:re})=>_(H,re));if(!q)return;const G=q.rect.left+x/2+s,Q=q.rect.right-x/2-s,j=q.rect.top+b/2+s,ae=q.rect.bottom-b/2-s;if(G>Q||j>ae)return;const Z={midX:N(H.midX,G,Q),midY:N(H.midY,j,ae)},J=vb(Z.midX,Z.midY,x,b);return _(H,J)?{laneId:q.id,anchor:Z,rect:J}:void 0},"placementForAnchor"),O=w((H,B,V)=>H.orientation==="horizontal"?Math.abs(B.midX-V.x):Math.abs(B.midY-V.y),"distanceAlongSegment"),D=w((H,B)=>{const q=(H.orientation==="horizontal"?x/2:b/2)+o;if(H===A){const G=v[H.idx];if(O(H,B,G)+Nl{const B=E(H);for(const V of B)for(const q of L){const G=P(V,q);if(!D(V,G))continue;const Q=I(G);if(Q&&!_G(Q.rect,v)&&!p(m,Q.rect)&&!h(m,g.id,Q.rect))return{laneId:Q.laneId,anchor:Q.anchor}}},"tryPool"),F=w((H,B,V=!1)=>{const q=E(H);for(const G of q){const Q={midX:G.midX,midY:G.midY};if(B&&!D(G,Q))continue;const j=I(Q);if(j&&!_G(j.rect,v)&&!p(m,j.rect)&&!l(m,j.rect)&&(V||!u(g.id,j.rect)))return{laneId:j.laneId,anchor:j.anchor}}},"findLaneContainingFallback"),z=$(S)??(S.lengthV.labelId===m);B>=0?d[B]={labelId:m,rect:H}:d.push({labelId:m,rect:H})}}}w(xR,"anchorLabelsToPolyline");var hF=1e-6,kBt=8,vfe=kBt/2,CBt=3;function MG(t,e){return t{const h=MG(o,l);let d=0;const f=w(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||MG(g,m)===h&&f(p.labelNodeId)}return d>0?d+CBt:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!LJ(o,hF))continue;const l=DJ(s,r,hF);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 k=f.cy>d.cy;m={x:d.cx,y:k?d.rect.bottom:d.rect.top},y={x:f.cx,y:k?f.rect.top:f.rect.bottom}}else{const k=f.cx>d.cx;m={x:k?d.rect.right:d.rect.left,y:d.cy},y={x:k?f.rect.left:f.rect.right,y:f.cy}}if(za(m,y,n,[u,h],1))continue;const x=a(s,u,h,p?"x":"y"),b=x>vfe?x:vfe,T=[0,b,-b];for(const k of T){const S={...m},C={...y};if(p){if(S.x+=k,C.x+=k,S.x<=d.rect.left||S.x>=d.rect.right||C.x<=f.rect.left||C.x>=f.rect.right)continue}else if(S.y+=k,C.y+=k,S.y<=d.rect.top||S.y>=d.rect.bottom||C.y<=f.rect.top||C.y>=f.rect.bottom)continue;if(!za(S,C,n,[u,h],1)&&!kL(S,C,t,s,{epsilon:hF})){s.points=[S,C];break}}}}w(t9e,"straightenCollinearSiblingDetours");function LG(t,e){const{realNodeRects:l,labelNodeRects:u}=Cg(e.values()),h=w((k,S)=>QT(S,.001).map(C=>({...C,edge:k,interior:C.index>=1&&C.index<=S.length-3})),"segmentsFor"),d=w(()=>{const k=[];for(const S of t){if(S.isLayoutOnly)continue;const C=S.points;!C||C.length<2||k.push(...h(S,Fn(C)))}return k},"allSegments"),f=w((k,S)=>k.horizontal&&S.horizontal?yl(k.a.x,k.b.x,S.a.x,S.b.x)>=8&&Math.abs(k.a.y-S.a.y)<7:k.vertical&&S.vertical?yl(k.a.y,k.b.y,S.a.y,S.b.y)>=8&&Math.abs(k.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=w((k,S)=>{const C=k.start,E=k.end,A=h(k,S);if(A.length!==S.length-1)return!1;const M=[C,E].filter(P=>!!P),L=k.labelNodeId?[k.labelNodeId]:[];for(const P of A)if(za(P.a,P.b,l,M,-2)||za(P.a,P.b,u,L,-2))return!1;for(const P of t){if(P===k||P.isLayoutOnly)continue;const N=P.points;if(!(!N||N.length<2)){for(const _ of A)for(const I of h(P,Fn(N)))if(f(_,I)||v0(_.a,_.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=w((k,S)=>{const C=Fn(k.edge.points??[]);if(C.length<4||k.index>=C.length-1)return;const E=C.map(A=>({...A}));if(k.horizontal)E[k.index].y+=S,E[k.index+1].y+=S;else if(k.vertical)E[k.index].x+=S,E[k.index+1].x+=S;else return;return h(k.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=w((k,S)=>({x:k.x??(S.left+S.right)/2,y:k.y??(S.top+S.bottom)/2}),"nodeCenter"),y=w(k=>{const S=k.edge,C=Fn(S.points??[]);if(C.length!==4||k.index!==1)return;const E=S.start?e.get(S.start):void 0,A=S.end?e.get(S.end):void 0,M=E?Jl(E):void 0,L=A?Jl(A):void 0,P=C.slice(k.index+2);if(!(!E||!A||!M||!L||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(A,L),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=w((k,S,C,E,A,M)=>{const L=E.y>=C.y,P=L?A.bottom:A.top,N=P+(L?20:-20);if(L&&k.b.y<=N+.001||!L&&k.b.y>=N-.001)return;const _=k.a.x+S;return Fn([{x:C.x,y:P},{x:C.x,y:N},{x:_,y:N},{x:_,y:k.b.y},...M],.001)},"verticalSourceDetour"),x=w((k,S,C,E,A,M)=>{const L=E.x>=C.x,P=L?A.right:A.left,N=P+(L?20:-20);if(L&&k.b.x<=N+.001||!L&&k.b.x>=N-.001)return;const _=k.a.y+S;return Fn([{x:P,y:C.y},{x:N,y:C.y},{x:N,y:_},{x:k.b.x,y:_},...M],.001)},"horizontalSourceDetour"),b=w((k,S)=>{const C=y(k);if(C){if(k.vertical)return v(k,S,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail);if(k.horizontal)return x(k,S,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let k=0;k<12;k++){const S=d();let C=!1;for(let E=0;EN.interior);for(const N of P){for(const _ of T){const I=g(N,_);if(I&&p(N.edge,I)){N.edge.points=I,C=!0;break}const O=b(N,_);if(O&&p(N.edge,O)){N.edge.points=O,C=!0;break}}if(C)break}}if(!C)return}}w(LG,"nudgeSharedInteriorSubpaths");function r9e(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}w(r9e,"segmentsIntersect");function n9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=__e(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;he.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)he.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}w(n9e,"validateSwimlanesLayout");function i9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!q_e(t,e)||e==="BT"&&i.length>0&&!W_e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=sd(CL(l)))}J_e(n,r),t9e(n,r),G_e(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);xR(n,a),N_e(n,a),U_e(n,a),LG(n,a),Y_e(n,a),j_e(n,a),SG(n,a),X_e(n,a);const s=w(()=>{Q_e(n,a),K_e(n,a),Z_e(n,a),xR(n,a),kG(n,a),SG(n,a),xR(n,a),kG(n,a)},"finalizeRenderedEdges");s(),LG(n,a),s(),EG(n,a),AG(n,a),EG(n,a),AG(n,a)}w(i9e,"postProcessSwimlaneLayout");function Sg(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}}w(Sg,"normalizeGraph");function HJ(t,e){return t.edges.filter(r=>r.dst===e)}w(HJ,"incoming");function a9e(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}w(a9e,"buildSuccessorMap");function VJ(t){const e=a9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(VJ,"buildSortedSuccessorMap");function WJ(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}w(WJ,"buildInDegreeMap");function qJ(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(qJ,"sortedZeroInDegreeNodes");function GN(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}}w(GN,"buildPredecessorSuccessorMaps");function GJ(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}w(GJ,"buildLayersFromRanks");function OE(t){const e=WJ(t),r=qJ(e),n=[],i=VJ(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=w(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}}w(s9e,"removeCycles_DFS");function o9e(t){const e=new Map,r=w(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}w(o9e,"buildTopLaneMap");function b0(t){const e=o9e(t);return r=>e.get(r)??null}w(b0,"createTopLaneResolver");function UN(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(UN,"buildTopLaneOrder");function YJ(t,e){const r=UN(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}w(YJ,"resolveTopLaneOrder");var SBt={EPSILON:1e-6},_L={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},bfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function l9e(t,e){const r=Sg(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=GN(r);for(const k of a.values())k.sort((S,C)=>S.localeCompare(C));const s=OE(r)??[...r.nodes].sort((k,S)=>k.localeCompare(S)),o=new Map;for(const[k,S]of s.entries())o.set(S,k);const l=new Map,u=new Map;for(const k of r.nodes)u.set(k,[]);for(const k of s){const S=(a.get(k)??[]).filter(C=>l.has(C));if(S.length>0){const C=c9e(k,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(k,C),u.get(C).push(k)}else l.has(k)||l.set(k,null)}for(const k of r.nodes)l.has(k)||l.set(k,null);const h=new Set;for(const k of r.nodes)(l.get(k)??null)===null&&h.add(k);const d=[...h].sort((k,S)=>{const C=o.get(k)??0,E=o.get(S)??0;return C===E?k.localeCompare(S):C-E}),f=u9e(r),p=new Map;for(const[k,S]of f.entries())p.set(k,[...S].sort((C,E)=>C.localeCompare(E)));const g=h9e(p),m=d9e(p),y=new Map;for(const k of r.nodes)y.set(k,[]);for(const k of m)for(const S of k.nodes){const C=y.get(S);C?C.push(k.id):y.set(S,[k.id])}const v=[],x=[],b=new Set,T=w(k=>{if(!b.has(k)){b.add(k),v.push(k);for(const S of u.get(k)??[])T(S);x.push(k)}},"walk");for(const k of d)T(k);for(const k of s)T(k);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:x,topologicalOrder:s}}w(l9e,"buildDrivingTree");function c9e(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]}w(c9e,"chooseParent");function u9e(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}w(u9e,"buildAdjacency");function h9e(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}w(h9e,"assignComponents");function d9e(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=w((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(f9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}w(d9e,"computeBlocks");function f9e(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]}}w(f9e,"popBlock");function p9e(t,e,r){const n=[...t.nodes],i=new Map;for(const[x,b]of n.entries())i.set(b,x);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const x of n){const b=r.parent.get(x)??null,T=i.get(x);T!=null&&b==null&&(s[T]=-1,o[T]=0,u.has(x)||(u.add(x),l.push(x)))}for(;l.length>0;){const x=l.shift(),b=i.get(x);if(b==null)continue;const T=r.children.get(x)??[];for(const k of T){if(u.has(k))continue;const S=i.get(k);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(k),l.push(k))}}for(const x of n){if(u.has(x))continue;const b=i.get(x);b!=null&&(s[b]=-1,o[b]=0,u.add(x))}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 x=0;x{if(x===-1||b===-1)return-1;o[x]>k&1&&(x=d[k][x],x===-1))return-1;if(x===b)return x;for(let k=h-1;k>=0;k--){const S=d[k][x],C=d[k][b];S===-1||C===-1||S!==C&&(x=S,b=C)}return d[0][x]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const x of t.edges){let b=x.src,T=x.dst,k=e[b],S=e[T];if(k==null||S==null||(k>S&&([b,T]=[T,b],[k,S]=[S,k]),k==null||S==null||k===S))continue;const C=i.get(b),E=i.get(T);if(C==null||E==null)continue;const A=f(C,E);if(A===-1)continue;const M=p[A];for(let L=k;L{if(b.size!==0)for(const[T,k]of b)x.set(T,(x.get(T)??0)+k)},"mergeInto"),y=new Set,v=w(x=>{const b=i.get(x);y.add(x);const T=b==null?void 0:p[b],k=T?new Map(T):new Map,S=r.children.get(x)??[];for(const C of S){const E=v(C),A=e[x];if(A!=null){let M=g.get(x);M||(M=new Map,g.set(x,M));let L=E.get(A)??0;const P=e[C];P!=null&&P>A&&(L+=1),M.set(C,L)}m(k,E)}return k},"dfs");for(const x of r.roots)y.has(x)||v(x);for(const x of n)y.has(x)||v(x);return g}w(p9e,"computeSubtreeCrossCounts");function g9e(t,e,r){const n=new Map,i=w(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(jJ(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}w(g9e,"annotateMinimumLayers");function jJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(jJ,"compareByRankThenId");function m9e(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=w(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}w(m9e,"emitNodesInTreeOrder");function y9e(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}w(y9e,"deduplicateLayers");function v9e(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]}}w(v9e,"createChildOrderer");function ML(t,e,r){const n=l9e(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=p9e(t,e,n),o=[...a].sort(jJ(e)),l=g9e(o,i,e),u=v9e(i,e,s,l);let h=m9e(o,t.nodes,e,u);return h=y9e(h),h}w(ML,"buildMultitreeLayerOrder");function b9e(t,e,r){const n=new Set(t),i=new Set(e),a=JT(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return UJ(s)}w(b9e,"countCrossingsBetweenAdjacent");function IG(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=ML(t,r,i),y=IG(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)}}w(w9e,"adjustCrossLaneSources");function T9e(t,e){const r=Sg(t),n=OE(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=b0(r);let s=Object.create(null);for(const l of n){const u=HJ(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=x9e(r,s)),e!=null&&e.ignoreCrossLaneEdges&&w9e(r,s),{layers:ML(r,s,a),rankOf:s,dummy:new Set}}w(T9e,"assignLayers_LongestPath");function k9e(t,e){const r=Sg(t),i={...T9e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=b0(r),{preds:s,succs:o}=GN(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=OE(r)??[...r.nodes],u=[...l].reverse(),h=w((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 x=o.get(g)??[];return x.length>0&&(v=Math.min(...x.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=w(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],x=o.get(y)??[];if(v.length===0&&x.length===0)continue;const b=v.length>0?v.reduce((C,E)=>C+(i[E]??0)+1,0)/v.length:i[y]??0,T=x.length>0?x.reduce((C,E)=>C+(i[E]??0)-1,0)/x.length:i[y]??0,k=Math.round((b+T)/2),S=h(y,k);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:GJ(r,l,i),rankOf:i,dummy:new Set}}w(k9e,"assignLayers_Gravity");function C9e(t){const e=WJ(t),r=VJ(t);let n=qJ(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}w(C9e,"topoSortByGenerationIfAcyclic");function S9e(t,e){const r=Sg(t),n=(e==null?void 0:e.direction)==="LR"?C9e(r)??[...r.nodes].sort():OE(r)??[...r.nodes].sort(),i=b0(r),a=w(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=w((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=HJ(r,h);let p=0;if(f.length>0)for(const v of f){const x=v.src,b=s[x]??0;p=Math.max(p,b+l(x,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:GJ(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}w(S9e,"assignLayers_LaneAwareCompact");function E9e(t,e){const r=Sg(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=w(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 x=g+1,b=0;x!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}w(E9e,"makeProperLayering");function $G(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])}w($G,"median");function NG(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(NG,"barycenter");function A9e(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}w(A9e,"neighborPositionsFor");function R9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(R9e,"currentOrderTieBreak");function DG(t,e,r){const n=new Set(t),i=new Set(e),a=JT(t),s=JT(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 UJ(l)}w(DG,"countCrossingsBetweenAdjacent");function wR(t,e,r){return[...t].sort((n,i)=>{const a=$G(e.get(n)??[]),s=$G(e.get(i)??[]);return a===s?R9e(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}w(wR,"sortByHeuristic");function OG(t,e,r,n,i,a){const s=JT(t),o=JT(e),l=A9e(e,s,r,n);if(!i||!a||a.length===0)return wR(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=wR(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=wR(d,l,o);for(const p of f){const g=NG(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=NG(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=w(m=>{let y=DG(t,m,u);return h&&n&&(y+=DG(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=b0(e),s=YJ(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=OG(n[l+1],n[l],i,"up",a,s),n[l]=PG(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}w(_9e,"orderLayers");function M9e(t,e,r){const n=(r==null?void 0:r.layerGap)??bfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??bfe.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=w(M=>e.nodeById.get(M),"getNode"),f=w(M=>{var L;return((L=d(M))==null?void 0:L.width)??0},"getWidth"),p=w(M=>{var L;return((L=d(M))==null?void 0:L.height)??0},"getHeight"),g=b0(e),m=YJ(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($,f(F)),0),P=l[M+1].reduce(($,F)=>Math.max($,f(F)),0),N=y[M],_=y[M+1],I=N/2+_/2,O=(L+P)/2,D=Math.max(0,O-I-n);v.push(D)}const x=new Set;for(const M of l)for(const L of M)x.add(g(L));const b=x.has(null),T=m.filter(M=>x.has(M)),k=[...b?[null]:[],...T],S=Object.create(null);for(const M of T)S[M]=0;b&&(S.null=0);for(const M of l){const L=Object.create(null),P=[];for(const N of M){const _=g(N);_===null?P.push(N):(L[_]||(L[_]=[])).push(N)}for(const[N,_]of Object.entries(L)){const I=_.reduce((O,D)=>O+f(D),0)+i*Math.max(0,_.length-1);S[N]=Math.max(S[N]??0,I)}if(b&&P.length){const N=P.reduce((_,I)=>_+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,N)}}const C=new Map;{const M=k.map(N=>(N===null?S.null:S[N])??0);let P=-(M.reduce((N,_)=>N+_,0)+a*Math.max(0,k.length-1))/2;for(let N=0;Nf(H)),F=$.reduce((H,B)=>H+B,0)+i*(O.length-1);let z=D-F/2;for(const[H,B]of O.entries()){const V=$[H];u[B]=z+V/2,h[B]=E+P/2,z+=V+i}}}const _=v[M]??0;E+=P+n+_}const A=new Map;for(const M of e.edges){const L=M.ref.id;A.has(L)||A.set(L,[]),A.get(L).push(M)}for(const[,M]of A){if(M.length===0)continue;const L=M[0].ref,P=L.start,N=L.end;if(P==null||N==null)continue;const _=Math.round(((u[P]??0)+(u[N]??0))/2),I=new Set;for(const O of M)I.add(O.src),I.add(O.dst);for(const O of I){if(O===P||O===N)continue;const D=e.nodeById.get(O);D!=null&&D.isDummy&&(u[O]=_)}}return{x:u,y:h}}w(M9e,"assignCoordinates");var L9e=8;function I9e(t){let e=2166136261;for(let r=0;r>>0}w(I9e,"hashString");function $9e(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}}w($9e,"mulberry32");function N9e(t,e){const r=[...t],n=$9e(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}w(N9e,"deterministicShuffle");function D9e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(D9e,"sourceDistance");function BG(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}w(BG,"laneArrangementCost");function O9e(t){const e=UN(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=b0(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()]}w(O9e,"buildWeightedLaneEdges");function FG(t,e,r){const n=[...t];let i=BG(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 I9e(`${t.join("|")}#${n}#${r}`)}w(B9e,"seedForRestart");function F9e(t,e={}){const r=UN(t);if(r.length<2)return r;const n=O9e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=FG(r,n,i);const s=Math.max(0,e.restarts??L9e);for(let o=0;ovn&&l*3>=o?s>0?"bottom":"top":o>vn?a>0?"right":"left":r}w(zG,"chooseOrthogonalSide");function HG(t,e){return Math.abs(t.to-e.from)le.isGroup&&!le.parentId);for(const le of u){const pe={id:le.id},Ce=w(oe=>{s.set(oe.id,pe),r.filter(fe=>fe.parentId===oe.id).forEach(Ce)},"assignLane");Ce(le)}const h=r.filter(le=>!le.isGroup&&!le.isEdgeLabel).map(le=>{const pe=le.width??10,Ce=le.height??10,oe=le.x??0,fe=le.y??0,W=EBt;return{nodeId:le.id,minX:oe-pe/2-W,maxX:oe+pe/2+W,minY:fe-Ce/2-W,maxY:fe+Ce/2+W,visualXHalfExtent:l?Ce/2+W:pe/2+W}}),d=w((le,pe,Ce,oe)=>{let fe=o.find(W=>W.orientation===le&&Math.abs(W.coord-pe)<1);return fe||(fe={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Ce,spanMax:oe,tracks:[]},o.push(fe)),fe.spanMin=Math.min(fe.spanMin,Ce),fe.spanMax=Math.max(fe.spanMax,oe),fe},"getOrAddPipe"),f=w((le,pe)=>{const Ce=le.width??10,oe=le.height??10,fe=le.x??0,W=le.y??0;switch(pe){case"top":return{x:fe,y:W-oe/2};case"bottom":return{x:fe,y:W+oe/2};case"left":return{x:fe-Ce/2,y:W};case"right":return{x:fe+Ce/2,y:W}}},"portForSide"),p=w((le,pe,Ce)=>f(le,zG(le,pe,Ce?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,x=w((le,pe,Ce)=>{if(g.length===0)return 0;const oe=Math.abs(pe.y-Ce.y)de||X.from-vn<=se&&X.to+vn>=se&&(W+=v)}else if(fe){const se=pe.x,K=Math.min(pe.y,Ce.y)-vn,de=Math.max(pe.y,Ce.y)+vn;if(de<=K)return 0;for(const X of g)X.edgeIndex===le||X.orientation!=="horizontal"||X.pipe.coordde||X.from-vn<=se&&X.to+vn>=se&&(W+=v)}return W},"crossingPenalty"),b=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Ce=a.get(le.start),oe=a.get(le.end),fe=s.get(le.start),W=s.get(le.end),se=fe&&W&&fe.id!==W.id?1:0,K=Ce&&oe?Math.abs((oe.x??0)-(Ce.x??0)):0,de=Ce&&oe?Math.abs((oe.y??0)-(Ce.y??0)):0;return{idx:pe,crossLane:se,dx:K,dy:de}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Ce=le.dx+le.dy,oe=pe.dx+pe.dy;return Math.abs(Ce-oe)>1?Ce-oe:le.idx-pe.idx}).map(le=>le.idx),T=w((le,pe,Ce,oe)=>{const fe=Math.min(le.x,pe.x),W=Math.max(le.x,pe.x),se=Math.min(le.y,pe.y),K=Math.max(le.y,pe.y);return!!h.find(X=>Ce&&X.nodeId===Ce||oe&&X.nodeId===oe?!1:Math.abs(le.x-pe.x)>vn?X.minYle.y&&X.maxX>fe&&X.minXle.x&&X.maxY>se&&X.minYzG(le,pe,"bottom"),"determineSide"),E=new Map;for(const[le,pe]of i.entries()){if(!pe.start||!pe.end||pe.start===pe.end||pe.points&&pe.points.length>0)continue;const Ce=a.get(pe.start),oe=a.get(pe.end);if(!Ce||!oe)continue;const fe=(oe.x??0)-(Ce.x??0),W=(oe.y??0)-(Ce.y??0);E.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:C(Ce,{x:oe.x??0,y:oe.y??0}),dstSide:C(oe,{x:Ce.x??0,y:Ce.y??0}),absDx:Math.abs(fe),absDy:Math.abs(W),dxSign:Math.sign(fe),dySign:Math.sign(W)})}const A=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.absDx===0?1/0:le.absDy/le.absDx:le.absDy===0?1/0:le.absDx/le.absDy,"preferenceStrength"),M=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.dxSign>=0?"right":"left":le.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const le of E.values()){const pe=`${le.srcId}:${le.srcSide}`;L.has(pe)||L.set(pe,[]),L.get(pe).push(le)}const P=new Map,N=w((le,pe)=>`${le}:${pe}`,"loadKey");for(const le of E.values())P.set(N(le.srcId,le.srcSide),(P.get(N(le.srcId,le.srcSide))??0)+1),P.set(N(le.dstId,le.dstSide),(P.get(N(le.dstId,le.dstSide))??0)+1);for(const le of L.values())if(!(le.length<2)){le.sort((pe,Ce)=>{const oe=A(pe),fe=A(Ce);return Math.abs(oe-fe)>1e-9?fe-oe:pe.edgeIdx-Ce.edgeIdx});for(let pe=1;pe=fe||(P.set(N(Ce.srcId,Ce.srcSide),fe-1),P.set(N(Ce.srcId,oe),W+1),Ce.srcSide=oe)}}const _=w(le=>{const pe=le==null?void 0:le.shape;return pe==="question"||pe==="diamond"},"isDiamondNode"),I=new Map;for(const le of E.values())I.has(le.dstId)||I.set(le.dstId,new Set),I.get(le.dstId).add(le.dstSide);for(const le of E.values()){if(!_(a.get(le.srcId)))continue;const pe=I.get(le.srcId);if(!(pe!=null&&pe.has(le.srcSide)))continue;const Ce=M(le);if(pe.has(Ce)||(P.get(N(le.srcId,Ce))??0)>0)continue;const oe=P.get(N(le.srcId,le.srcSide))??0;P.set(N(le.srcId,le.srcSide),Math.max(0,oe-1)),P.set(N(le.srcId,Ce),1),le.srcSide=Ce}for(const le of E.values()){const{edgeIdx:pe,srcId:Ce,dstId:oe,srcSide:fe,dstSide:W}=le,se=a.get(Ce),K=a.get(oe),de=`${Ce}:${fe}:src`,X=fe==="top"||fe==="bottom"?K.x??0:K.y??0;k.has(de)||k.set(de,[]),k.get(de).push({edgeIdx:pe,oppositeCoord:X});const Fe=`${oe}:${W}:dst`,ke=W==="top"||W==="bottom"?se.x??0:se.y??0;k.has(Fe)||k.set(Fe,[]),k.get(Fe).push({edgeIdx:pe,oppositeCoord:ke})}const O=new Map,D=8;for(const[le,pe]of k){if(pe.length<2)continue;pe.sort((Ke,Be)=>Ke.oppositeCoord-Be.oppositeCoord);const Ce=le.split(":"),oe=Ce.slice(0,-2).join(":"),fe=Ce[Ce.length-2],W=Ce[Ce.length-1],se=a.get(oe);if(!se)continue;const de=fe==="left"||fe==="right"?se.height??10:se.width??10,X=se.shape,ke=X==="question"||X==="diamond"?de*.3:de,Ie=Math.min(20,Math.max(D,ke/(pe.length+1))),De=-(Ie*(pe.length-1))/2;for(const[Ke,Be]of pe.entries()){const nt=De+Ke*Ie,Le=`${Be.edgeIdx}:${W}`;O.set(Le,nt)}}const $=w(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),F=w((le,pe)=>le?(k.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Ce})=>$(Ce))||(k.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Ce})=>$(Ce)):!1,"faceHasLabelNode"),z=w((le,pe,Ce)=>pe==="top"||pe==="bottom"?{x:le.x+Ce,y:le.y}:{x:le.x,y:le.y+Ce},"applyPortOffset"),H=w((le,pe,Ce)=>{const oe=E.get(le),fe={x:Ce.x??0,y:Ce.y??0},W={x:pe.x??0,y:pe.y??0},se=(oe==null?void 0:oe.srcSide)??C(pe,fe),K=(oe==null?void 0:oe.dstSide)??C(Ce,W);let de=oe?f(pe,oe.srcSide):p(pe,fe,!0),X=oe?f(Ce,oe.dstSide):p(Ce,W,!1);const Fe=O.get(`${le}:src`),ke=O.get(`${le}:dst`);return Fe!==void 0&&(de=z(de,se,Fe)),ke!==void 0&&(X=z(X,K,ke)),{pSrcPort:de,pDstPort:X,srcSide:se,dstSide:K}},"portsForEdge");for(const le of b){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Ce=a.get(pe.start),oe=a.get(pe.end);if(!Ce||!oe)continue;const{pSrcPort:fe,pDstPort:W,srcSide:se,dstSide:K}=H(le,Ce,oe),de={...fe},X={...W},Fe=se==="top"||se==="bottom",ke=K==="top"||K==="bottom";if(Fe){const st=fe.y>(Ce.y??0);de.y=st?fe.y+Hc:fe.y-Hc}else{const st=fe.x>(Ce.x??0);de.x=st?fe.x+Hc:fe.x-Hc}if(ke){const st=W.y>(oe.y??0);X.y=st?W.y+Hc:W.y-Hc}else{const st=W.x>(oe.x??0);X.x=st?W.x+Hc:W.x-Hc}const Ye=w((st,vt)=>{for(const jt of h)if(!vt.includes(jt.nodeId)&&st.x>jt.minX&&st.xjt.minY&&st.y{if(dn){const Mt=st.y>(vt.y??0);return{x:(jt.x??0)>=st.x?Mr.maxX+Zg:Mr.minX-Zg,y:Mt?Mr.maxY+Mv:Mr.minY-Mv,leavesPositiveSide:Mt}}const Et=st.x>(vt.x??0),ft=(jt.y??0)>=st.y;return{x:Et?Mr.maxX+Zg:Mr.minX-Zg,y:ft?Mr.maxY+Mv:Mr.minY-Mv,leavesPositiveSide:Et}},"obstacleDetour");let ze=[];const De=[pe.start,pe.end],Ke=Ye(de,De);if(Ke.inside&&Ke.obstacle){const st=Ke.obstacle;if(Fe){const vt=Ie(fe,Ce,oe,st,!0);de.x=vt.x,de.y=vt.y;const jt=vt.leavesPositiveSide?Math.min(st.minY-2,fe.y+Hc):Math.max(st.maxY+2,fe.y-Hc);ze=[{x:fe.x,y:jt},{x:vt.x,y:jt},{x:vt.x,y:vt.y}]}else{const vt=Ie(fe,Ce,oe,st,!1),jt=vt.leavesPositiveSide?Math.min(st.minX-2,fe.x+Hc):Math.max(st.maxX+2,fe.x-Hc);de.x=vt.x,de.y=vt.y,ze=[{x:jt,y:fe.y},{x:jt,y:vt.y},{x:vt.x,y:vt.y}]}}let Be=[];const nt=Ye(X,De);if(nt.inside&&nt.obstacle){const st=nt.obstacle;if(ke){const vt=Ie(W,oe,Ce,st,!0);X.x=vt.x,X.y=vt.y,Be=[{x:vt.x,y:vt.y},{x:W.x,y:vt.y}]}else{const vt=Ie(W,oe,Ce,st,!1);X.x=vt.x,X.y=vt.y,Be=[{x:vt.x,y:vt.y},{x:vt.x,y:W.y}]}}if(ze.length===0&&Be.length===0){const st=Zg,vt=Math.abs(de.x-X.x)1||Et>1,Mt=S.get(pe.start??"")??0,dt=S.get(pe.end??"")??0,ur=dn>1&&F(pe.start,se)||Et>1&&F(pe.end,K),Re=dn<=1||Mt<=2,Dn=Et<=1||dt<=2;if((vt||jt)&&!Mr&&(!ft||ft&&!ur&&Re&&Dn)&&!T(fe,W,pe.start,pe.end)){pe.points=[{...fe},{...de},{...X},{...W}],y.add(le);const On=jt?"horizontal":"vertical",Wa=jt?fe.y:fe.x,Mn=jt?Math.min(fe.x,W.x):Math.min(fe.y,W.y),Jn=jt?Math.max(fe.x,W.x):Math.max(fe.y,W.y),En={id:`fast-path-${On}-${Wa.toFixed(0)}-${le}`,orientation:On,coord:Wa,spanMin:Mn,spanMax:Jn,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:On,pipe:En,trackIndex:0,from:Mn,to:Jn});continue}}const Le=d("vertical",de.x,de.y,de.y);de.x=Le.coord;const pt=d("vertical",X.x,X.y,X.y);X.x=pt.coord;let Me=Math.min(de.x,X.x)-50,Ct=Math.max(de.x,X.x)+50,wt=Math.min(de.y,X.y)-50,ht=Math.max(de.y,X.y)+50;for(const st of h){const vt=Math.min(de.x,X.x),jt=Math.max(de.x,X.x),Mr=Math.min(de.y,X.y),dn=Math.max(de.y,X.y);st.minXvt&&st.minYMr&&(Me=Math.min(Me,st.minX-YA),Ct=Math.max(Ct,st.maxX+YA),wt=Math.min(wt,st.minY-YA),ht=Math.max(ht,st.maxY+YA))}for(const st of h){if(st.maxXCt||st.maxYht)continue;const vt=Zg;d("horizontal",st.minY-vt,Me,Ct),d("horizontal",st.maxY+vt,Me,Ct);const jt=Mv;d("vertical",st.minX-jt,wt,ht),d("vertical",st.maxX+jt,wt,ht)}d("horizontal",de.y,Me,Ct),d("horizontal",X.y,Me,Ct);const Bt=o.filter(st=>st.orientation==="horizontal"&&st.coord>=wt&&st.coord<=ht),At=o.filter(st=>st.orientation==="vertical"&&st.coord>=Me&&st.coord<=Ct),mt=w((st,vt)=>`${st.toFixed(1)},${vt.toFixed(1)}`,"getKey"),ye=mt(de.x,de.y),Nt=mt(X.x,X.y),yt=new Map,gt=new Map,St=new Map,tn=new Set,_e=[];yt.set(ye,0),St.set(ye,"n"),_e.push({key:ye,f:Math.hypot(X.x-de.x,X.y-de.y),pt:de}),tn.add(ye);let Je=[];const ut=w((st,vt)=>T(st,vt,pe.start,pe.end),"checkSegmentBlocked"),Dt={x:X.x,y:de.y},Kt=ut(de,Dt),Sr=ut(Dt,X),yr=Kt||Sr,qr={x:de.x,y:X.y},Tr=ut(de,qr),rn=ut(qr,X);if(yr?Tr||rn||(Math.abs(de.x-X.x)0;){_e.sort((dt,ur)=>dt.f-ur.f);const st=_e.shift();if(tn.delete(st.key),st.key===Nt){let dt=Nt,ur=X;for(Je=[ur];gt.has(dt);){const Re=gt.get(dt);Je.unshift(Re),ur=Re,dt=mt(Re.x,Re.y)}break}const vt=st.pt.x,jt=st.pt.y,Mr=At.sort((dt,ur)=>dt.coord-ur.coord),dn=Mr.findIndex(dt=>Math.abs(dt.coord-vt)<1),Et=Bt.sort((dt,ur)=>dt.coord-ur.coord),ft=Et.findIndex(dt=>Math.abs(dt.coord-jt)<1),Mt=[];dn>0&&Mt.push({x:Mr[dn-1].coord,y:jt}),dn>=0&&dn0&&Mt.push({x:vt,y:Et[ft-1].coord}),ft>=0&&ftTt.nodeId===pe.start||Tt.nodeId===pe.end?!1:ur!==Re?Tt.minYjt&&Tt.maxX>ur&&Tt.minXvt&&Tt.maxY>Dn&&Tt.minY10&&Id<-5||qs<-10&&Id>5)&&(Jn=Math.abs(Id)*100),(En>10&&fh<-5||En<-10&&fh>5)&&(Jn+=Math.abs(fh)*50);let Fg=0;const $d=St.get(st.key)??"n",Nd=Math.abs(fh)>vn?"h":"v";$d!=="n"&&$d!==Nd&&(Fg=50);const It=Wa+Mn+Jn+Fg,Ne=(yt.get(st.key)??1/0)+It,rt=Math.abs(X.x-dt.x)+Math.abs(X.y-dt.y);if(Ne<(yt.get(On)??1/0))if(gt.set(On,st.pt),yt.set(On,Ne),St.set(On,Nd),!tn.has(On))_e.push({key:On,f:Ne+rt,pt:dt}),tn.add(On);else{const Tt=_e.findIndex(ir=>ir.key===On);Tt!==-1&&(_e[Tt].f=Ne+rt)}}}if(Je.length===0&&(Je=[de,{x:de.x,y:X.y},X]),Je.length>4){const st=Je[0],vt=Je[Je.length-1];let jt=Math.min(st.x,vt.x),Mr=Math.max(st.x,vt.x),dn=Math.min(st.y,vt.y),Et=Math.max(st.y,vt.y);for(const Dn of Je)jt=Math.min(jt,Dn.x),Mr=Math.max(Mr,Dn.x),dn=Math.min(dn,Dn.y),Et=Math.max(Et,Dn.y);const ft=Mr>Math.max(st.x,vt.x),Mt=jtMn.minXPe&&Mn.minYon);if(Wa.length>0){let Mn=Math.max(st.x,vt.x);for(const Jn of Wa){const En=(Jn.minX+Jn.maxX)/2;if(Jn.visualXHalfExtent===void 0||isNaN(Jn.visualXHalfExtent))continue;const qs=En+Jn.visualXHalfExtent+Dn;Mn=Math.max(Mn,qs)}isNaN(Mn)||(Mr=Mn)}}if(Mt){const Pe=h.filter(on=>on.minXMath.min(st.y,vt.y));if(Pe.length>0){let on=Math.min(st.x,vt.x);for(const On of Pe){const Mn=(On.minX+On.maxX)/2-On.visualXHalfExtent-Dn;on=Math.min(on,Mn)}jt=on}}}const dt=w(Dn=>{const Pe=vt.y>st.y,on=h.filter(Mn=>{const Jn=Math.min(st.x,vt.x)Mn.minX,En=Math.min(st.y,vt.y)Mn.minY;return Jn&&En});let On=on;if(l&&on.length>0){const Mn=on.filter(Jn=>Jn.minXDn);Mn.length>0&&(On=Mn)}if(On.length===0)return vt.y;const Wa=Zg;if(Pe){const Jn=Math.max(...On.map(En=>En.maxY))+Wa;if(JnEn.minY))-Wa;if(Jn>vt.y+vn)return Jn}return vt.y},"findBestReturnY"),ur=w(Dn=>{const Pe=dt(Dn),on={x:Dn,y:st.y},On={x:Dn,y:Pe},Wa={x:vt.x,y:Pe},Mn=ut(st,on),Jn=ut(on,On),En=ut(On,Wa),qs=Pe!==vt.y?ut(Wa,vt):!1;return!Mn&&!Jn&&!En&&!qs?Math.abs(Pe-vt.y)=3){const st=zr[zr.length-1],vt=zr[zr.length-2],jt=zr[zr.length-3],Mr=Math.abs(jt.y-vt.y)Math.abs(st.x-jt.x)&&zr.splice(-2,1)}else if(dn){const Et=Math.sign(vt.y-jt.y),ft=Math.sign(st.y-jt.y);Et!==0&&Et===ft&&Math.abs(vt.y-jt.y)>Math.abs(st.y-jt.y)&&zr.splice(-2,1)}}const hn=[zr[0]];for(let st=1;stvt.x,Et=Mr.x>jt.x;if(dn!==Et){hn.push(jt);continue}continue}if(Math.abs(vt.x-jt.x)vt.y,Et=Mr.y>jt.y;if(dn!==Et){hn.push(jt);continue}continue}hn.push(jt)}hn.push(zr[zr.length-1]);for(let st=0;stle.from{const fe=!oe.segments.some(se=>(se.edgeIndex!==pe.edgeIndex||se.segmentIndex!==pe.segmentIndex)&&B(se,le)),W=!Ce.segments.some(se=>(se.edgeIndex!==le.edgeIndex||se.segmentIndex!==le.segmentIndex)&&B(se,pe));return fe&&W?(le.trackIndex=oe.index,pe.trackIndex=Ce.index,Ce.segments=[...Ce.segments.filter(se=>se.edgeIndex!==le.edgeIndex||se.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],oe.segments=[...oe.segments.filter(se=>se.edgeIndex!==pe.edgeIndex||se.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),q=w(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),G=w((le,pe)=>{const Ce=le.pipe.tracks[le.trackIndex];Ce.segments=Ce.segments.filter(fe=>fe.edgeIndex!==le.edgeIndex||fe.segmentIndex!==le.segmentIndex),le.trackIndex=pe,le.pipe.tracks[pe].segments.push({edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to})},"moveSegmentToTrack"),Q=w((le,pe)=>{const Ce=m[le.edgeIndex];for(const oe of Ce){const fe=g[oe];fe.pipe===le.pipe&&G(fe,pe)}},"moveSegmentChainToTrack"),j=w(le=>{const pe=m[le.edgeIndex],Ce=pe.indexOf(g.indexOf(le)),oe=[];return Ce>0&&oe.push(g[pe[Ce-1]]),Ce{if(le.orientation===pe.orientation)return!1;const Ce=le.orientation==="horizontal"?le:pe,oe=le.orientation==="horizontal"?pe:le;return oe.pipe.coord>Ce.from&&oe.pipe.coordoe.from&&Ce.pipe.coord{for(const Ce of le.tracks)if(!Ce.segments.some(fe=>(fe.edgeIndex!==pe.edgeIndex||fe.segmentIndex!==pe.segmentIndex)&&B(fe,pe)))return Ce.index;return-1},"findAvailableTrack"),J=w((le,pe)=>{if(le.trackIndex===pe.trackIndex)return B(le,pe);const Ce=j(le),oe=j(pe);return Ce.some(fe=>oe.some(W=>ae(fe,W)))},"segmentsConflict"),re=w((le,pe,Ce)=>{if(V(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const oe=Z(le.pipe,pe);Ce(pe,oe!==-1?oe:q(le.pipe))},"resolveTrackConflict"),ee=w(le=>{let pe=0;for(let Ce=0;Ce{if(me.has(le))return me.get(le);const pe=m[le];if(pe.length===0){const K={dest:0,deviation:0,base:0,delta:0};return me.set(le,K),K}const oe=g[pe[0]].pipe.coord;let fe=oe;for(let K=1;KMath.abs(Fe-oe)?X:Fe;break}}const W=Math.abs(fe-oe),se={dest:fe,deviation:W,base:oe,delta:fe-oe};return me.set(le,se),se},"getDestInfo"),$e=w(()=>{let le=0;const pe=new Map;for(const[oe,fe]of i.entries())m[oe].length!==0&&fe.start&&(pe.has(fe.start)||pe.set(fe.start,[]),pe.get(fe.start).push(oe));const Ce=w(oe=>{const fe=i[oe];if(!fe.start||!fe.end)return 0;const W=a.get(fe.start),se=a.get(fe.end);if(!W||!se)return 0;const K=(se.x??0)-(W.x??0),de=(se.y??0)-(W.y??0);return Math.abs(K)+Math.abs(de)},"getEdgeDistance");for(const oe of pe.values()){oe.sort((W,se)=>{const K=te(W),de=te(se);if(Math.abs(K.deviation-de.deviation)>1)return K.deviation-de.deviation;if(Math.abs(K.dest-de.dest)>1)return K.dest-de.dest;const X=Ce(W),Fe=Ce(se);if(Math.abs(X-Fe)>1)return Fe-X;const ke=m[W].length,Ye=m[se].length;if(ke!==Ye)return ke-Ye;if(ke===1){const Ie=m[W][0],ze=m[se][0];if(g[Ie]&&g[ze]){const De=g[Ie],Ke=g[ze],Be=Math.abs(De.to-De.from),nt=Math.abs(Ke.to-Ke.from);if(Math.abs(Be-nt)>1)return Be-nt}}return 0});const fe=oe.map(W=>g[m[W][0]]);le+=ee(fe)}return le},"fixSourceHandleCrossings"),Oe=w(()=>{let le=0;const pe=new Map;for(const[Ce,oe]of i.entries())m[Ce].length!==0&&oe.end&&(pe.has(oe.end)||pe.set(oe.end,[]),pe.get(oe.end).push(Ce));for(const Ce of pe.values()){Ce.sort((fe,W)=>{const se=w(X=>{const Fe=m[X];if(Fe.length<2)return 0;const ke=g[Fe[Fe.length-2]];return Math.abs(ke.to-ke.from)},"getDist"),K=se(fe),de=se(W);return Math.abs(K-de)>.1?K-de:fe-W});const oe=Ce.map(fe=>g[m[fe][m[fe].length-1]]);le+=ee(oe)}return le},"fixTargetHandleCrossings"),He=w(()=>{let le=0;for(const pe of o){const Ce=[];for(const oe of pe.tracks)for(const fe of oe.segments){const W=m[fe.edgeIndex].find(se=>g[se].segmentIndex===fe.segmentIndex);W!==void 0&&Ce.push(g[W])}Ce.sort((oe,fe)=>oe.edgeIndex-fe.edgeIndex||oe.segmentIndex-fe.segmentIndex);for(let oe=0;oe{oe.segments.forEach(fe=>{pe.push({edgeIndex:fe.edgeIndex,segmentIndex:fe.segmentIndex,trackIndex:oe.index,from:fe.from,to:fe.to})})}),pe.sort((oe,fe)=>oe.from-fe.from);const Ce=[];if(pe.length>0){let oe=[pe[0]],fe=pe[0].to;for(let W=1;Wfe.add(Ie.trackIndex));const W=new Map;oe.forEach(Ie=>{const ze=te(Ie.edgeIndex);W.set(Ie.trackIndex,(W.get(Ie.trackIndex)??0)+ze.delta)});const se=[...fe].filter(Ie=>(W.get(Ie)??0)<-1),K=[...fe].filter(Ie=>(W.get(Ie)??0)>1),de=[...fe].filter(Ie=>Math.abs(W.get(Ie)??0)<=1);se.sort((Ie,ze)=>(W.get(ze)??0)-(W.get(Ie)??0)),K.sort((Ie,ze)=>(W.get(Ie)??0)-(W.get(ze)??0));const X=w((Ie,ze)=>{oe.filter(De=>De.trackIndex===Ie).forEach(De=>{const Ke=y.has(De.edgeIndex)?le.coord:ze;Te.set(`${De.edgeIndex}-${De.segmentIndex}`,Ke)})},"assignCoord");let Fe=0;for(const Ie of se)Fe++,X(Ie,le.coord-Fe*dF);if(de.length===0&&fe.size>0){const Ie=[...fe].sort((Ke,Be)=>Math.abs(W.get(Ke)??0)-Math.abs(W.get(Be)??0))[0],ze=se.indexOf(Ie);ze!==-1&&se.splice(ze,1);const De=K.indexOf(Ie);De!==-1&&K.splice(De,1),de.push(Ie)}let ke=0;for(const Ie of de){if(ke===0)X(Ie,le.coord);else{const ze=ke%2===1?1:-1,De=Math.ceil(ke/2);X(Ie,le.coord+ze*De*dF*.5)}ke++}let Ye=0;for(const Ie of K)Ye++,X(Ie,le.coord+Ye*dF)}}for(const[le,pe]of i.entries()){const Ce=m[le]??[];if(Ce.length===0)continue;const oe=[],fe=a.get(pe.start),W=a.get(pe.end),{pSrcPort:se,pDstPort:K}=H(le,fe,W),de=Ce.map(ke=>{const Ye=g[ke],Ie=Te.get(`${Ye.edgeIndex}-${Ye.segmentIndex}`)??Ye.pipe.coord;return{orient:Ye.orientation,coord:Ie,from:Ye.from,to:Ye.to}});oe.push(se);for(let ke=0;kevn&&oe.push(hm(Ye,ze)),Be&&Ke.orient===Ye.orient)if(Math.abs(Ye.coord-Ke.coord)>vn){const nt=Ye.orient==="vertical"?(ze+Ke.from)/2:HG(Ye,Ke);oe.push(hm(Ye,nt),hm(Ke,nt))}else(ke===0||ke===de.length-2)&&oe.push(hm(Ye,HG(Ye,Ke)));else if(Be)oe.push(hm(Ye,Ke.coord));else{const nt=Math.abs(Ye.from-ze)vn||Math.abs(X.y-K.y)>vn)&&oe.push(K);const Fe=[];oe.length>0&&Fe.push(oe[0]);for(let ke=1;kevn||Math.abs(Ye.y-Ie.y)>vn)&&Fe.push(Ye)}pe.points=Fe}for(const le of i){const pe=le.__originalEdge;pe&&le.points&&(pe.points=le.points)}t.edges=(t.edges??[]).filter(le=>!le.isLayoutOnly);const ge=w((le,pe)=>{const Ce=pe.x??0,oe=pe.y??0,fe=pe.width??0,W=pe.height??0;if(fe<=0||W<=0)return le;const se=Ce-fe/2,K=Ce+fe/2,de=oe-W/2,X=oe+W/2;if(le.xK||le.yX)return le;const Fe=le.x-se,ke=K-le.x,Ye=le.y-de,Ie=X-le.y,ze=Math.min(Fe,ke,Ye,Ie);return ze===Fe?{x:se,y:le.y}:ze===ke?{x:K,y:le.y}:ze===Ye?{x:le.x,y:de}:{x:le.x,y:X}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Ce=le.start,oe=le.end,fe=Ce?a.get(Ce):void 0,W=oe?a.get(oe):void 0;fe&&(pe[0]=ge(pe[0],fe)),W&&(pe[pe.length-1]=ge(pe[pe.length-1],W))}return t}w(H9e,"routeEdgesOrthogonal");function V9e(t){return t.direction??"TB"}w(V9e,"getSwimlaneDirection");function W9e(t){var h,d,f,p,g;const e=S_e(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=V9e(t),{ordered:l,coordinates:u}=z9e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});E_e(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;H9e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return i9e(t,o),n9e(t),o}w(W9e,"runSwimlaneLayoutCore");async function q9e(t,e){const r=e.select("g");dZ(r,t.markers,t.type,t.diagramId),S5e(),A5e(),ike(),VRe(),C_e(t);const n=A_e(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await u_e(r,t);W9e(t),await w_e(t,i)}w(q9e,"render");const ABt=Object.freeze(Object.defineProperty({__proto__:null,render:q9e},Symbol.toStringTag,{value:"Module"}));function VG(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 G9e(t,e,r){return(e=U9e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LBt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function IBt(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 $Bt(){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 NBt(){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 Ga(t,e){return RBt(t)||IBt(t,e)||XJ(t,e)||$Bt()}function LL(t){return _Bt(t)||LBt(t)||XJ(t)||NBt()}function DBt(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 U9e(t){var e=DBt(t,"string");return typeof e=="symbol"?e:e+""}function bs(t){"@babel/helpers - typeof";return bs=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},bs(t)}function XJ(t,e){if(t){if(typeof t=="string")return VG(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)?VG(t,e):void 0}}var ls=typeof window>"u"?null:window,xfe=ls?ls.navigator:null;ls&&ls.document;var OBt=bs(""),Y9e=bs({}),PBt=bs(function(){}),BBt=typeof HTMLElement>"u"?"undefined":bs(HTMLElement),PE=function(e){return e&&e.instanceString&&ua(e.instanceString)?e.instanceString():null},Ar=function(e){return e!=null&&bs(e)==OBt},ua=function(e){return e!=null&&bs(e)===PBt},yi=function(e){return!xc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},zn=function(e){return e!=null&&bs(e)===Y9e&&!yi(e)&&e.constructor===Object},FBt=function(e){return e!=null&&bs(e)===Y9e},Zt=function(e){return e!=null&&bs(e)===bs(1)&&!isNaN(e)},zBt=function(e){return Zt(e)&&Math.floor(e)===e},IL=function(e){if(BBt!=="undefined")return e!=null&&e instanceof HTMLElement},xc=function(e){return BE(e)||j9e(e)},BE=function(e){return PE(e)==="collection"&&e._private.single},j9e=function(e){return PE(e)==="collection"&&!e._private.single},KJ=function(e){return PE(e)==="core"},X9e=function(e){return PE(e)==="stylesheet"},HBt=function(e){return PE(e)==="event"},eg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},VBt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},WBt=function(e){return zn(e)&&Zt(e.x1)&&Zt(e.x2)&&Zt(e.y1)&&Zt(e.y2)},qBt=function(e){return FBt(e)&&ua(e.then)},GBt=function(){return xfe&&xfe.userAgent.match(/msie|trident|edge/i)},e3=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},QBt=function(e,r){return-1*Z9e(e,r)},Pr=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("^"+jBt+"$").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},tFt=function(e){var r,n=new RegExp("^"+UBt+"$").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},rFt=function(e){return nFt[e.toLowerCase()]},Q9e=function(e){return(yi(e)?e:null)||rFt(e)||JBt(e)||tFt(e)||eFt(e)},nFt={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]},J9e=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||_<0||x&&I>=f}function E(){var N=e();if(C(N))return A(N);g=setTimeout(E,S(N))}function A(N){return g=void 0,b&&h?T(N):(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:A(e())}function P(){var N=e(),_=C(N);if(h=arguments,d=this,m=N,_){if(g===void 0)return k(m);if(x)return clearTimeout(g),g=setTimeout(E,l),T(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=L,P}return EF=s,EF}var fFt=dFt(),VE=FE(fFt),AF=ls?ls.performance:null,rMe=AF&&AF.now?function(){return AF.now()}:function(){return Date.now()},pFt=(function(){if(ls){if(ls.requestAnimationFrame)return function(t){ls.requestAnimationFrame(t)};if(ls.mozRequestAnimationFrame)return function(t){ls.mozRequestAnimationFrame(t)};if(ls.webkitRequestAnimationFrame)return function(t){ls.webkitRequestAnimationFrame(t)};if(ls.msRequestAnimationFrame)return function(t){ls.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(rMe())},1e3/60)}})(),$L=function(e){return pFt(e)},Xf=rMe,Mm=9261,nMe=65599,f2=5381,iMe=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mm,n=r,i;i=e.next(),!i.done;)n=n*nMe+i.value|0;return n},p6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mm;return r*nMe+e|0},g6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f2;return(r<<5)+r+e|0},gFt=function(e,r){return e*2097152+r},F0=function(e){return e[0]*2097152+e[1]},XA=function(e,r){return[p6(e[0],r[0]),g6(e[1],r[1])]},Ofe=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)},tee=function(e){e.splice(0,e.length)},SFt=function(e,r){for(var n=0;n"u"?"undefined":bs(Set))!==AFt?Set:RFt,XN=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!KJ(e)){Ji("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"){Ji("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 U3,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=[];yi(r.classes)?u=r.classes:Ar(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,T,k){var S;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(T==null&&(T=v.length);bM;0<=M?A++:A--)E.push(A);return E}).apply(this).reverse(),C=[],T=0,k=S.length;TL;0<=L?++E:--E)P.push(s(v,b));return P},m=function(v,x,b,T){var k,S,C;for(T==null&&(T=n),k=v[b];b>x;){if(C=b-1>>1,S=v[C],T(k,S)<0){v[b]=S,b=C;continue}break}return v[b]=k},y=function(v,x,b){var T,k,S,C,E;for(b==null&&(b=n),k=v.length,E=x,S=v[x],T=2*x+1;T0;){var S=x.pop(),C=y(S),E=S.id();if(f[E]=C,C!==1/0)for(var A=S.neighborhood().intersect(g),M=0;M0)for($.unshift(D);d[z];){var H=d[z];$.unshift(H.edge),$.unshift(H.node),F=H.node,z=F.id()}return o.spawn($)}}}},DFt={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(T){for(var k=0;k0;){if(k(),C++,T===h){for(var E=[],A=a,M=h,L=v[M];E.unshift(A),L!=null&&E.unshift(L),A=y[M],A!=null;)M=A.id(),L=v[M];return{found:!0,distance:d[T],path:this.spawn(E),steps:C}}p[T]=!0;for(var P=b._private.edges,N=0;NL&&(g[M]=L,x[M]=A,b[M]=k),!a){var P=A*h+E;!a&&g[P]>L&&(g[P]=L,x[P]=E,b[P]=k)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:s,Te=b(ue),ge=[],Ve=Te;;){if(Ve==null)return r.spawn();var we=x(Ve),Ae=we.edge,Ue=we.pred;if(ge.unshift(Ve[0]),Ve.same(ce)&&ge.length>0)break;Ae!=null&&ge.unshift(Ae),Ve=Ue}return l.spawn(ge)},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=WFt(a,e,r),n--}return r},qFt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function($){return $.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/VFt);if(a<2){Ji("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},KFt=function(e){return Math.PI*e/180},KA=function(e,r){return Math.atan2(r,e)-Math.PI/2},ree=Math.log2||function(t){return Math.log(t)/Math.log(2)},nee=function(e){return e>0?1:e<0?-1:0},uy=function(e,r){return Math.sqrt(dm(e,r))},dm=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},ZFt=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}}},JFt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},ezt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},tzt=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},hMe=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},kR=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},CR=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=Ga(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},Vfe=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},iee=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},wp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Wfe=function(e,r){return wp(e,r.x,r.y)},dMe=function(e,r){return wp(e,r.x1,r.y1)&&wp(e,r.x2,r.y2)},rzt=(MF=Math.hypot)!==null&&MF!==void 0?MF:function(t,e){return Math.sqrt(t*t+e*e)};function nzt(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,A){return{x:E.x+A.x,y:E.y+A.y}},n=function(E,A){return{x:E.x-A.x,y:E.y-A.y}},i=function(E,A){return{x:E.x*A,y:E.y*A}},a=function(E,A){return E.x*A.y-E.y*A.x},s=function(E){var A=rzt(E.x,E.y);return A===0?{x:0,y:0}:{x:E.x/A,y:E.y/A}},o=function(E){for(var A=0,M=0;M7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?rg(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,x=y;if(g=Tp(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,T=i-d+u-o,k=b,S=i+d-u+o;if(g=Tp(e,r,n,i,b,T,k,S,!1),g.length>0)return g}if(f){var C=n-h+u-o,E=i+d+o,A=n+h-u+o,M=E;if(g=Tp(e,r,n,i,C,E,A,M,!1),g.length>0)return g}if(p){var L=n-h-o,P=i-d+u-o,N=L,_=i+d-u+o;if(g=Tp(e,r,n,i,L,P,N,_,!1),g.length>0)return g}var I;{var O=n-h+u,D=i-d+u;if(I=P5(e,r,n,i,O,D,u+o),I.length>0&&I[0]<=O&&I[1]<=D)return[I[0],I[1]]}{var $=n+h-u,F=i-d+u;if(I=P5(e,r,n,i,$,F,u+o),I.length>0&&I[0]>=$&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,H=i+d-u;if(I=P5(e,r,n,i,z,H,u+o),I.length>0&&I[0]>=z&&I[1]>=H)return[I[0],I[1]]}{var B=n-h+u,V=i+d-u;if(I=P5(e,r,n,i,B,V,u+o),I.length>0&&I[0]<=B&&I[1]>=V)return[I[0],I[1]]}return[]},azt=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},szt=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)},ozt=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]},lzt=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)},czt=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=[];lzt(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,x,b,T,k=0;k=0?Tu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Hl=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},Kf=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=OL(h,-u);m=DL(y)}else m=h;return Hl(e,r,m)},hzt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,T=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,T];var k=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,T,k,S]}else return[b,T]},LF=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Tp=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,x=m*d-f*g;if(x!==0){var b=y/x,T=v/x,k=.001,S=0-k,C=1+k;return S<=b&&b<=C&&S<=T&&T<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?LF(e,n,o)===o?[o,l]:LF(e,n,a)===a?[a,s]:LF(a,o,n)===n?[n,i]:[]:[]},fzt=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=OL(d,-l);p=DL(m)}else p=d}else p=n;for(var y,v,x,b,T=0;T2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=T)},get:function(b){return u[b]}},f=0;f0?I=_.edgesTo(N)[0]:I=N.edgesTo(_)[0];var O=i(I);N=N.id(),C[N]>C[L]+O&&(C[N]=C[L]+O,E.nodes.indexOf(N)<0?E.push(N):E.updateItem(N),S[N]=0,k[N]=[]),C[N]==C[L]+O&&(S[N]=S[N]+S[L],k[N].push(L))}else for(var D=0;D0;){for(var H=T.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},Rzt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:Lzt,o=i,l,u,h=0;h=2?Ok(e,r,n,0,jfe,Izt):Ok(e,r,n,0,Yfe)},squaredEuclidean:function(e,r,n){return Ok(e,r,n,0,jfe)},manhattan:function(e,r,n){return Ok(e,r,n,0,Yfe)},max:function(e,r,n){return Ok(e,r,n,-1/0,$zt)}};t3["squared-euclidean"]=t3.squaredEuclidean;t3.squaredeuclidean=t3.squaredEuclidean;function ZN(t,e,r,n,i,a){var s;return ua(t)?s=t:s=t3[t]||t3.euclidean,e===0&&ua(t)?s(i,a):s(e,r,n,i,a)}var Nzt=mo({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),see=function(e){return Nzt(e)},PL=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 ZN(e,i.length,o,l,u,h)},$F=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},Pzt=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][x.key]&&(l=n[m.key][x.key])):a.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(a);return i},e0e=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=e0e(e,r,n),i},t0e=function(e){for(var r=this.cy(),n=this.nodes(),i=Xzt(e),a={},s=0;s=L?(P=L,L=_,N=I):_>P&&(P=_);for(var O=0;O0?1:0;C[A%i.minIterations*o+B]=V,H+=V}if(H>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var q=0,G=0;G1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var T=x.degree(!0);T%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[x.source().id(),x.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 T=b,k=[b],S,C,E;d[T].length;)S=d[T].shift(),C=f[S][0],E=f[S][1],T!=E?(d[E]=d[E].filter(function(A){return A!=S}),T=E):!a&&T!=C&&(d[C]=d[C].filter(function(A){return A!=S}),T=C),k.unshift(S),k.unshift(T);return k},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}},QA=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 x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var T=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[T].cutVertex?y.merge(k.filter(function(S){return S.isLoop()})):y.merge(k)})}),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,x,b;m.forEach(function(T){y=T.source().id(),v=T.target().id(),x=y===p?v:y,x!==g&&(b=T.id(),o[b]||(o[b]=!0,s.push({x:p,y:x,edge:T})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};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}},nHt={hopcroftTarjanBiconnected:QA,htbc:QA,htb:QA,hopcroftTarjanBiconnectedComponents:QA},JA=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}},iHt={tarjanStronglyConnected:JA,tsc:JA,tscc:JA,tarjanStronglyConnectedComponents:JA},xMe={};[m6,NFt,DFt,PFt,FFt,HFt,qFt,yzt,xb,wb,GG,Mzt,Wzt,Yzt,eHt,rHt,nHt,iHt].forEach(function(t){Pr(xMe,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,T),e.parent(x)||(he.trace("Setting parent",x,i.id),e.setParent(x,i.id,T))}if(he.info("(Insert) Node XXX"+x+": "+JSON.stringify(e.node(x))),b!=null&&b.clusterNode){he.info("Cluster identified XBX",x,b.width,e.node(x));const{ranksep:T,nodesep:k}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:T+25,nodesep:k});const S=await d_e(d,b.graph,r,n,e.node(x),a),C=S.elem;gr(b,C),b.diff=S.diff||0,he.info("New compound node after recursive render XAX",x,"width",b.width,"height",b.height),Cgt(C,b)}else e.children(x).length>0?(he.trace("Cluster - the non recursive path XBX",x,b.id,b,b.width,"Graph:",e),he.trace(ZT(b.id,e)),an.set(b.id,{id:ZT(b.id,e),node:b})):(he.trace("Node - the non recursive path XAX",x,d,e.node(x),s),await vE(d,e.node(x),{config:a,dir:s}))})),await w(async()=>{const x=e.edges().map(async function(b){const T=e.edge(b.v,b.w,b.name);if(he.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),he.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),he.info("Fix",an,"ids:",b.v,b.w,"Translating: ",an.get(b.v),an.get(b.w)),f&&T.selfLoop){if(T.selfLoop.order!==1)return;const k=T.id;T.id=T.selfLoop.id,await nM(h,T),T.id=k;return}await nM(h,T)});await Promise.all(x)},"processEdges")(),he.info("Graph before layout:",JSON.stringify(Pf(e))),he.info("############################################# XXX"),he.info("### Layout ### XXX"),he.info("############################################# XXX"),u_e(e),he.info("Graph after layout:",JSON.stringify(Pf(e)));let g=0,{subGraphTitleTotalMargin:m}=M3(a);await Promise.all(AOt(e).map(async function(x){var T;const b=e.node(x);if(he.info("Position XBX => "+x+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,he.info("A tainted cluster node XBX1",x,b.id,b.width,b.height,b.x,b.y,e.parent(x)),an.get(b.id).node=b,rM(b);else if(e.children(x).length>0){he.info("A pure cluster node XBX1",x,b.id,b.x,b.y,b.width,b.height,e.parent(x)),b.height+=m,e.node(b.parentId);const k=(b==null?void 0:b.padding)/2||0,S=((T=b==null?void 0:b.labelBBox)==null?void 0:T.height)||0,C=S-k||0;he.debug("OffsetY",C,"labelHeight",S,"halfPadding",k),await z$(l,b),an.get(b.id).node=b}else{const k=e.node(b.parentId);b.y+=m/2,he.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",k,k==null?void 0:k.offsetY,b),rM(b)}}));const y=m/2;return h_e(e,y,{mergeSelfLoops:f}).forEach(function({edge:x,start:b,end:T}){he.info("Edge "+b+" -> "+T+": "+JSON.stringify(x),x),x.points.forEach(E=>E.y+=y);const k=e.node(b),S=e.node(T),C=fZ(u,x,an,r,k,S,n);_5e(x,C)}),e.nodes().forEach(function(x){const b=e.node(x);he.info(x,b.type,b.diff),b.isGroup&&(g=b.diff)}),he.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),xBt=w(async(t,e)=>{var a,s,o,l,u,h;const r=new $o({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");pZ(n,t.markers,t.type,t.diagramId),E5e(),R5e(),ake(),GRe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),he.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),x=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},x.originalEdge=y,x.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",x.startLabelRight="",x.startLabelLeft="",x.endLabelLeft="",x.endLabelRight="",x.arrowTypeStart="none",x.arrowTypeEnd="none",x.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,x,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),he.warn("Graph at first:",JSON.stringify(Pf(r))),EOt(r),he.warn("Graph after XAX:",JSON.stringify(Pf(r)));const i=We();await d_e(n,r,t.type,t.diagramId,void 0,i)},"render");const wBt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:h_e,render:xBt},Symbol.toStringTag,{value:"Module"}));async function f_e(t,e){const r=new $o({multigraph:!0,compound:!0}),n=[...e.edges],i=We(),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 vE(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 wr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>kvr);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}}w(f_e,"createGraphWithElements");var gfe=5,qA=1e-5,GA=1e-6;function kL(t){const e=[];for(let r=0;r=1-GA||f<=GA||f>=1-GA?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}w(p_e,"segmentIntersection");function hG(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(hG,"isHorizontalSeg");function g_e(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(m_e,"getArcSweepFlag");var TBt=.001;function y_e(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Es[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&&Es[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}w(y_e,"applyMarkerOffsets");function v_e(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${yb(o)}`];return i==="arc"?u.push(`A${Pu(t.r)},${Pu(t.r)} 0 0 ${n} ${yb(l)}`):u.push(`M${yb(l)}`),u}w(v_e,"emitJump");function dG(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=dG(i[u-1],i[u],i[u+1]??i[u],gfe);b&&(m=b.cutLen)}let y=d,v=null;a&&ub.t-T.t);for(const b of x)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;bT){const k=T/2;x[b].r=Math.min(x[b].r,k),x[b+1].r=Math.min(x[b+1].r,k)}}for(const b of x)b.r=2?n:null}catch{return null}}w(T_e,"decodeDataPoints");function k_e(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=T_e(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=g_e(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&&!w_e(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!x_e(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,x=b_e(u,h,r);if(p.setAttribute("d",x),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),T=Math.max(0,b-y-v),k=`0 ${y} ${T} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${k};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}w(k_e,"applyLineJumpsToSvg");async function C_e(t,e){var i,a;for(const s of t.nodes)s.isGroup?await z$(e.clusters,s):rM(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=fZ(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await nM(e.rootGroups,s),s.label&&S_e(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}));k_e(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}w(C_e,"adjustLayout");function S_e(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=pr(),{subGraphTitleTotalMargin:i}=M3({flowchart:n.flowchart??{}});if(t.label){const a=NS.get(t.id);let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=Na.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Vr.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=Na.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=Na.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}w(S_e,"positionEdgeLabel");var hF="__swimlane_default__",kBt=21,mfe=20;function fG(t){return Math.max(t.padding??mfe,mfe)}w(fG,"topLaneHorizontalPadding");function E_e(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(kBt,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}}w(E_e,"assignTopLaneTitleRect");function A_e(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===hF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:hF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=hF}w(A_e,"prepareLayoutForSwimlanes");function R_e(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}}w(R_e,"toGraphView");function __e(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(x=>x.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const x of p){const b=x.x??r.x[x.id],T=x.y??r.y[x.id],k=x.width??0,S=x.height??0;b!=null&&T!=null&&(g=Math.min(g,b-k/2),m=Math.max(m,b+k/2),y=Math.min(y,T-S/2),v=Math.max(v,T+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 x=f.padding??20,b=f.parentId?x:2*fG(f),T=x,k=Math.max(0,m-g)+b,S=Math.max(0,v-y)+T,C=(g+m)/2,E=(y+v)/2;f.x=C,f.y=E,f.width=k,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),x=m+2*v,b=(f+p)/2;for(const A of d)A.y=b,A.height=x,A.swimlaneContentTop=f;const T=[...d].sort((A,M)=>{const L=A.x??0,P=M.x??0;return L-P}),k=[],S=[],C=[];for(const A of T){const M=h.get(A.id);if(!M)continue;const L=Math.max(0,M.maxX-M.minX)+2*fG(A),P=(M.minX+M.maxX)/2;k.push(A.id),S.push(P),C.push(L)}const E=k.length;if(E>0){const A=new Map;if(E===1)A.set(k[0],C[0]);else{const M=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:vb(e,r,n,i)}:void 0}w(LJ,"measuredNodeRect");function IJ(t){if(t.isGroup)return;const e=LJ(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(IJ,"nodeBoundsInfoFor");function pu(t,e,r=Ps){return Math.abs(t.x-e.x)r}w(wa,"isHorizontalSegment");function Ta(t,e,r=Ps){return Cn(t,e,r)&&Math.abs(t.y-e.y)>r}w(Ta,"isVerticalSegment");function yl(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)))}w(yl,"overlapLength");function ed(t,e,r=Ps){return t.horizontal&&e.horizontal&&Rn(t.a,e.a,r)?yl(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Cn(t.a,e.a,r)?yl(t.a.y,t.b.y,e.a.y,e.b.y):0}w(ed,"sameAxisSegmentOverlapLength");function QT(t,e=Ps){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!pu(i,n,e))&&r.push({x:n.x,y:n.y})}return r}w(Fn,"dedupeConsecutivePoints");function $J(t,e=Ps){if(!t||t.length!==4)return;const[r,n,i,a]=t;return wa(r,n,e)&&Ta(n,i,e)&&wa(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ta(r,n,e)&&wa(n,i,e)&&Ta(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}w($J,"classifyThreeSegmentRoute");function GN(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}w(L_e,"rectContainsRect");function CL(t,e){return t.lefte.left&&t.tope.top}w(CL,"rectsOverlap");function pG(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(pG,"inflateRect");function vb(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(vb,"rectFromCenterSize");function Ql(t){var e;return(e=LJ(t))==null?void 0:e.rect}w(Ql,"rectOfNodeBounds");function o1(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}}}w(o1,"portForRectSide");function DJ(t,e,r,n,i,a=Ps){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Rn(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(Rn(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(Cn(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(Cn(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}w(DJ,"buildOrthogonalPortPath");function OJ(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]}w(OJ,"buildSameSideTrackPath");function UN(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=IJ(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(UN,"collectRealNodeBounds");function Cg(t){const e=[],r=[];for(const n of t){const i=IJ(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}}w(Cg,"collectNodeRectEntries");function I_e(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,...vb(i,a,s,o)})}return r}w(I_e,"collectLayoutNodeRects");function PJ(t,e,r=Ps){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 x=Math.abs(m-h.a.x)i:a&&o&&Rn(t,r,i)?yl(t.x,e.x,r.x,n.x)>i:!1}w($_e,"sameAxisSegmentsOverlap");function SL(t,e,r,n,{epsilon:i=Ps,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+Ps&&t=2?e[e.length-2]:void 0,l=(s?Cn(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||!pu(i,n))&&r.push(n)}return r}w(EL,"orthogonalizePolyline");function od(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=D_e(e);if(e=n.points,!n.changed)break}return e}w(od,"simplifyPolyline");var Gr=.001,SBt=.5,yfe=4;function FJ(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=O_e(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}w(mG,"clipEndpoint");function P_e(t,e){for(const r of t){const n=FJ(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=mG(i,n.srcRect,!0)),n.dstRect&&(i=mG(i,n.dstRect,!1)),i=od(EL(i)),i=zJ(i,n.srcRect,n.dstRect),n.edge.points=od(EL(i))}}w(P_e,"clipEdgeEndpointsToNodeBoundaries");function yG(t,e,r,n=!1){if(Rn(t,e,Gr)){if(e.yr.bottom+Gr)return e;if(n){if(t.xr.right+Gr)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(Cn(t,e,Gr)){if(e.xr.right+Gr)return e;if(n){if(t.yr.bottom+Gr)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}w(yG,"snapEndpointToBoundary");function AL(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}}w(B_e,"intersectRanges");function bG(t,e){return e==="left"||e==="right"?RL(t.top,t.bottom):RL(t.left,t.right)}w(bG,"clearanceRangeForSide");function _L(t,e,r){const n=t.y>=r.top-Gr&&t.y<=r.bottom+Gr,i=t.x>=r.left-Gr&&t.x<=r.right+Gr;if(Rn(t,e,Gr)&&n){if(Math.abs(t.x-r.left)0?B_e(a):void 0}w(F_e,"straightClearanceRange");function xG(t,e,r,n,i){const a=F_e(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-Gr&&Math.max(t.x,e.x)<=r.right+Gr,i=Math.min(t.y,e.y)>=r.top-Gr&&Math.max(t.y,e.y)<=r.bottom+Gr;if(Math.abs(t.y-r.top)n.bottom+Gr;case"left":return Rn(e,r,Gr)&&r.xn.right+Gr}}w(kG,"leavesOutward");function CG(t,e,r){if(t.length<3)return t;if(r){const a=TG(t[0],t[1],e);return a&&kG(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=TG(t[n-1],t[n],e);return i&&kG(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(CG,"collapseOwnBorderStub");function V_e(t,e,r){let n=t;if(e){const a=AL(n,0,1);if(a){const s=yG(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=CG(n,e,!0)}if(r){const a=n.length-1,s=AL(n,a,-1);if(s){const o=yG(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=CG(n,r,!1)}const i=zJ(n,e,r);return i!==n||n.length===2?i:(e&&(n=wG(n,e,!0)),r&&(n=wG(n,r,!1)),n)}w(V_e,"snapAndCollapseEndpoints");function SG(t,e){for(const r of t){const n=FJ(r,e,2);if(!n)continue;const i=Fn(n.points,Gr),a=V_e(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}}w(SG,"prepareEdgeEndpointsForRenderer");function HJ(t){return new Map(t.map(e=>[e.id,e]))}w(HJ,"buildNodeMap");function W_e(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}w(W_e,"resolveTopLevelGroupId");function EG(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}w(EG,"groupDepth");function VJ(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}}w(VJ,"boundsForChildren");function q_e(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}w(q_e,"applyGroupBounds");function G_e(t){const e=HJ(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>EG(i,e)-EG(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=VJ(i);a&&q_e(n,a)}}w(G_e,"recomputeNestedGroupBounds");function ML(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=w(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}w(ML,"mirrorAxis");function U_e(t){return(t.nodes??[]).some(r=>!r.isGroup)?ML(t,"y"):!0}w(U_e,"applyBtDirectionTransform");function Y_e(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(N=>!N.isGroup);let a=1/0,s=1/0;for(const N of i){const _=N.x??0,I=N.y??0;_0?Math.max(1,h/d):1;for(const N of i){const _=N.x??0,O=((N.y??0)-s)*f+o,D=_-a;N.x=O,N.y=D}for(const N of n)if(N.points)for(const _ of N.points){const I=_.x,D=(_.y-s)*f+o,$=I-a;_.x=D,_.y=$}G_e(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&ML(t,"x"),!0;const g=HJ(r),m=new Map;for(const N of r){if(N.isGroup)continue;const _=W_e(N,g);if(!_)continue;const I=m.get(_)??[];I.push(N),m.set(_,I)}let y=0;for(const N of p){const _=N.padding??0;_>y&&(y=_)}const v=[];let x=1/0,b=-1/0;for(const N of p){const _=m.get(N.id)??[],I=VJ(_);I&&(x=Math.min(x,I.minX),b=Math.max(b,I.maxX),v.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(x===1/0||b===-1/0)return!0;const T=Math.max(0,b-x),k=Math.max(y,10),S=T+2*k,C=o+S,M=(x+b)/2-S/2-o,L=M+C/2,P=Math.max(y,o);v.sort((N,_)=>N.centerY-_.centerY);for(let N=0;Nf.cy?v.bottom:v.top,P=f.cx+x;if(P<=v.left+wu||P>=v.right-wu)continue;b={x:P,y:L},T={x:P,y:o.y},k={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,P=f.cy+x;if(P<=v.top+wu||P>=v.bottom-wu)continue;b={x:L,y:P},T={x:o.x,y:P},k={x:o.x,y:o.y}}const S=pu(b,T,wu),C=pu(T,k,wu);if(S&&C||!S&&za(b,T,n,[h],1)||!C&&za(T,k,n,[d],1))continue;const E=!S&&SL(b,T,t,i,{epsilon:wu,skipDegenerateOther:!0}),A=!C&&SL(T,k,t,i,{epsilon:wu,skipDegenerateOther:!0});if(!(E||A)){S?y=[T,k]:C?y=[b,T]:y=[b,T,k];break}}y&&(i.points=y)}}w(j_e,"portSwapToLShape");function X_e(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Fn(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,x=f.y-p.y;if(Math.hypot(v,x)<.001)continue;const T=wa(f,d,.001),k=Ta(f,d,.001),S=wa(p,f,.001),C=Ta(p,f,.001);if(!(T&&C||k&&S))continue;const E=o.end,A=o.start,M=E?e.get(E):void 0;if(!M)continue;const L=M.x??0,P=M.y??0,N=Ql(M);if(!N)continue;let _,I;if(C){const B=x<0;_={x:L,y:p.y},I={x:L,y:B?N.bottom:N.top}}else{const B=v>0;_={x:p.x,y:P},I={x:B?N.right:N.left,y:P}}if(za(_,I,a,E?[E]:[],-2)||za(_,I,s,[],-2))continue;if(A){const B=e.get(A),V=B?Ql(B):void 0;if(V&&NJ(_,V,2))continue}const O=w((B,V)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${V.x.toFixed(3)},${V.y.toFixed(3)}`,"ownSegmentKey"),D=new Set;for(let B=0;B{for(const q of t){if(q===o||q.isLayoutOnly)continue;const G=q.points;if(!(!G||G.length<2))for(let Q=0;Q=0){const B=u[h-3],V=[A,E].filter(q=>!!q);if(za(B,_,a,V,-2)||$(B,_))continue}const z=[...u.slice(0,h-2),_,I];o.points=z;const H=o.labelNodeId;if(H){const B=e.get(H);if(B){const V=B.width??0,q=B.height??0;if(V>0&&q>0){let G,Q,j=-1;for(let ae=0;ae=V+2||me&&re>=q+2)&&re>j&&(j=re,G=(Z.x+J.x)/2,Q=(Z.y+J.y)/2)}G!==void 0&&Q!==void 0&&(B.x=G,B.y=Q)}}}}}w(X_e,"collapseShortTerminalStub");var fr=.001,Ns=8,fn=QT,dF=w((t,e)=>Cn(t,e,fr)||Rn(t,e,fr),"orthogonallyAligned");function K_e(t,e){const i=w((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,x=g.y-y;let b=(p.width??0)/2,T=(p.height??0)/2;return Math.abs(x)*b>Math.abs(v)*T?(x<0&&(T=-T),{x:m+(x===0?0:T*v/x),y:y+T}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*x/v)})},"rectIntersect"),a=w((p,g)=>{const m=Fn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,x=v?Ql(v):void 0;if(!v||!y||!x)return;const b=g?m[0]:m[m.length-1],T=g?m[1]:m[m.length-2],k=i(v,b);let S=b;if(dF(T,k)&&(S=T),Cn(k,S,fr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:k.x,min:Math.min(k.y,S.y),max:Math.max(k.y,S.y),boundary:k,railEnd:S,rect:x};if(Rn(k,S,fr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:k.y,min:Math.min(k.x,S.x),max:Math.max(k.x,S.x),boundary:k,railEnd:S,rect:x}},"terminalLaneFor"),s=w((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=w((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)&&Cn(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Rn(p.boundary,g.boundary,1),"sameTerminalFace"),l=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=Ns&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=w((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=w((p,g)=>{const m=Fn(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(!w(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Rn(y,p.boundary,fr)&&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?Cn(y,p.boundary,fr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&pu(m[1],p.railEnd,fr),C=m.slice(S?2:1),E=C[0];return E&&!dF(E,v)?void 0:[y,v,...C]}const b=m.length>1&&pu(m[m.length-2],p.railEnd,fr),T=m.slice(0,b?-2:-1),k=T[T.length-1];if(!(k&&!dF(k,v)))return[...T,v,y]},"shiftedCandidate"),d=w(p=>{const g=p.edge,m=Fn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,x=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!x||!b)return!1;const T=x.x??0,k=x.y??0,S=b.x??0,C=b.y??0,[E,A]=m;return Rn(E,A,fr)&&Math.abs(k-C)<1&&Math.abs(T-S)>1||Cn(E,A,fr)&&Math.abs(T-S)<1&&Math.abs(k-C)>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),A=d(C);return E!==A?Number(E)-Number(A):+!C.atStart-+!S.atStart});for(const S of k){for(const C of f){const E=h(S,C);if(!E)continue;const A=a({...S.edge,points:E},S.atStart);if(!(!A||g.some(M=>M.edge!==S.edge&&(l(A,M)||T&&u(A,M))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}w(K_e,"separateSharedRenderedTerminalLanes");function Z_e(t,e){const{realNodeRects:n,labelNodeRects:i}=Cg(e.values()),a=w((o,l)=>{const u=o.start,h=o.end,d=fn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(za(p.a,p.b,n,f,-2)||za(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 fn(Fn(g)))if(ed(m,y,.5)>=Ns||v0(m.a,m.b,y.a,y.b,fr))return!1}}return!0},"candidateIsSafe"),s=w((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=wa(u,h)&&Ta(h,d)&&wa(d,f)&&Ta(f,p)&&Cn(u,f,fr)&&Cn(u,p,fr)&&Cn(h,d,fr)&&(h.x-u.x)*(f.x-d.x)<0,m=Ta(u,h)&&wa(h,d)&&Ta(d,f)&&wa(f,p)&&Rn(u,f,fr)&&Rn(u,p,fr)&&Rn(h,d,fr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Fn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ta(u,h)&&wa(h,d)&&Ta(d,f)&&wa(f,p)&&Ta(p,y)&&Cn(u,p,fr)&&Cn(u,y,fr)&&Cn(d,f,fr)&&(d.x-h.x)*(p.x-f.x)<0,x=wa(u,h)&&Ta(h,d)&&wa(d,f)&&Ta(f,p)&&wa(p,y)&&Rn(u,p,fr)&&Rn(u,y,fr)&&Rn(d,f,fr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!x))return Fn([...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=Fn(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}}w(Z_e,"collapseRedundantRectangularDoglegs");function AG(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=w((g,m,y)=>Fn(g===m?y??[]:g.points??[]),"pointsFor"),u=w((g,m)=>{let y=0;for(let v=0;v{const m=fn(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=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const x=v.rect;return m.horizontal?yl(m.a.x,m.b.x,x.left,x.right)>=Ns&&m.a.y>=x.top-2&&m.a.y<=x.bottom+2:yl(m.a.y,m.b.y,x.top,x.bottom)>=Ns&&m.a.x>=x.left-2&&m.a.x<=x.right+2})},"blockingRectsFor"),f=w((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 x=od(Fn(v));return fn(x).length===x.length-1?x:void 0},"candidateByMovingRail"),p=w((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),x=fn(m);if(x.length!==m.length-1)return!1;for(const b of x)if(za(b.a,b.b,a,v,-2)||za(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const T of x)for(const k of fn(l(b)))if(ed(T,k,.5)>=Ns)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 x=l(v),b=h(x);if(!b)continue;const T=d(v,b.segment);if(T.length===0)continue;const k=b.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of k){const C=f(x,b.segment,S);if(!(!C||!p(v,C,m))){v.points=C,y=!0;break}}if(y)break}if(!y)return}}w(AG,"liftObstacleHuggingSameSideRails");function RG(t,e){const n=w(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=w(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+fr||h>=u.bottom-fr?!1:yl(l.a.x,l.b.x,u.left,u.right)>=Ns},"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=Fn(l.points??[]);for(const h of fn(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=fr))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})}}w(RG,"liftTopLaneTitleBandsAboveRails");function _G(t,e){const n=w(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=w(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+fr||d>=h.right-fr?!1:yl(u.a.y,u.b.y,h.top,h.bottom)>=Ns},"verticalSegmentIntersectsTitle"),s=w((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+fr||d>=h.bottom-fr?!1:yl(u.a.x,u.b.x,h.left,h.right)>=Ns},"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=Fn(u.points??[]);for(const d of fn(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<=fr))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})}}w(_G,"shiftLeftLaneTitleBandsLeftOfRails");function Q_e(t,e){const{realNodeRects:n}=Cg(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=w((g,m=new Map)=>Fn(m.get(g)??g.points??[]),"replacementPointsFor"),s=w((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+hc(a(y,g)),0),"totalBends"),l=w(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!wa(y,v,fr)&&!Ta(y,v,fr)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=w((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],x=y[1];let b;if(wa(v,x,fr))b={x:x.x,y:m.tailStart.y};else if(Ta(v,x,fr))b={x:m.tailStart.x,y:x.y};else return;const T=od(Fn([v,x,b,m.tailStart,m.terminal]));return fn(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),h=w((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of fn(m))if(za(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=w((g,m,y)=>{for(const v of i)if(v!==g){for(const x of fn(m))for(const b of fn(a(v,y)))if(ed(x,b,.5)>=Ns)return!0}return!1},"pathHasSharedTrack"),f=w((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=w(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const x=g.get(y)??[];x.push(m),g.set(y,x)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,x=m,b=y;for(const T of p().values())for(let k=0;k=m||_>x||_===x&&I>=b||(v=N,x=_,b=I)}if(!v)return;for(const[T,k]of v)T.points=k}}w(Q_e,"swapDestinationTerminalTailsToReduceCrossings");function J_e(t,e){const{realNodeRects:a,labelNodeRects:s}=Cg(e.values()),o=t.filter(T=>!T.isLayoutOnly),l=w((T,k=new Map)=>Fn(k.get(T)??T.points??[]),"replacementPointsFor"),u=w((T=new Map)=>{let k=0;for(let S=0;So.reduce((k,S)=>k+hc(l(S,T)),0),"totalBends"),d=w(T=>{const k=T.start,S=T.end,C=k?e.get(k):void 0,E=S?e.get(S):void 0,A=C?Ql(C):void 0,M=E?Ql(E):void 0;return A&&M?{src:A,dst:M}:void 0},"endpointRectsFor"),f=w((T,k,S)=>{if(S.index<=0||S.index+1>=k.length-1)return;const C=d(T);if(C){if(S.vertical){const E=S.a.x,A=Math.min(C.src.left,C.dst.left),M=Math.max(C.src.right,C.dst.right),L=EM+fr?"right":void 0;return L?{edge:T,points:k,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,A=Math.min(C.src.top,C.dst.top),M=Math.max(C.src.bottom,C.dst.bottom),L=EM+fr?"bottom":void 0;return L?{edge:T,points:k,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=w(()=>{const T=[];for(const k of o){const S=l(k);for(const C of fn(S)){const E=f(k,S,C);E&&T.push(E)}}return T},"collectExternalRails"),g=w((T,k)=>T.edge!==k.edge&&T.axis===k.axis&&T.side===k.side&&yl(T.min,T.max,k.min,k.max)>=Ns,"railsInteract"),m=w(T=>{const k=[],S=new Set;for(const C of T){if(S.has(C))continue;const E=[C],A=[];for(S.add(C);E.length>0;){const M=E.pop();A.push(M);for(const L of T)!S.has(L)&&g(M,L)&&(S.add(L),E.push(L))}A.length>1&&k.push(A)}return k},"connectedComponents"),y=w(T=>{const k=[];for(const S of T)k.some(C=>Math.abs(C-S.coord){const k=T.map(E=>E.coord),S=y(T),C=[];if(T.length<=6){const E=new Array(S.length).fill(!1),A=[],M=w(()=>{if(A.length===T.length){A.some((L,P)=>Math.abs(L-k[P])>=fr)&&C.push([...A]);return}for(const[L,P]of S.entries())E[L]||(E[L]=!0,A.push(P),M(),A.pop(),E[L]=!1)},"visit");return M(),C}for(let E=0;E{const S=new Map;for(const[E,A]of T.entries()){const M=k[E],L=S.get(A.edge)??A.points.map(P=>({x:P.x,y:P.y}));A.axis==="vertical"?(L[A.segmentIndex].x=M,L[A.segmentIndex+1].x=M):(L[A.segmentIndex].y=M,L[A.segmentIndex+1].y=M),S.set(A.edge,L)}const C=new Map;for(const[E,A]of S){const M=od(Fn(A));if(fn(M).length!==M.length-1)return;C.set(E,M)}return C},"replacementsForAssignment"),b=w(T=>{for(const[k,S]of T){const C=[k.start,k.end].filter(E=>!!E);for(const E of fn(S))if(za(E.a,E.b,a,C,-2)||za(E.a,E.b,s,[],-2))return!1}for(let k=0;k=Ns)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const k=u();if(k===0)return;let S,C=k,E=h(),A=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const L of v(M)){const P=x(M,L);if(!P||!b(P))continue;const N=u(P);if(N>=k)continue;const _=h(P),I=M.reduce((O,D,$)=>O+Math.abs(L[$]-D.coord),0);N>C||N===C&&(_>E||_===E&&I>=A)||(S=P,C=N,E=_,A=I)}if(!S)return;for(const[M,L]of S)M.points=L}}w(J_e,"reassignCrossingExternalRailChannels");function e9e(t,e){const{realNodeRects:n,labelNodeRects:i}=Cg(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=w((p,g,m)=>Fn(p===g?m??[]:p.points??[]),"pointsFor"),o=w(p=>fn(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=w((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)&&yl(p.a.x,p.b.x,g.left,g.right)>=Ns}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&yl(p.a.y,p.b.y,g.top,g.bottom)>=Ns}return!1},"segmentRunsAlongRectBorder"),h=w(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),x=v?Ql(v):void 0;x&&m.push(x)}return m},"endpointRectsFor"),d=w((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],x=p[g+3],b=wa(m,y,fr)&&Ta(y,v,fr)&&wa(v,x,fr),T=Ta(m,y,fr)&&wa(y,v,fr)&&Ta(v,x,fr);if(!b&&!T)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(x.x-v.x):Math.sign(y.y-m.y)!==Math.sign(x.y-v.y)))return[];const S=Cn(m,x,fr)||Rn(m,x,fr)?[]:[{x:m.x,y:x.y},{x:x.x,y:m.y}],C=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(A=>[...p.slice(0,g+1),A,...p.slice(g+3)]),E=new Set;return C.map(A=>od(Fn(A))).filter(A=>{if(fn(A).length!==A.length-1||!A.some(L=>pu(L,x,fr)))return!1;const M=A.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=w((p,g,m)=>{const y=[p.start,p.end].filter(x=>!!x),v=h(p);for(const x of fn(g))if(za(x.a,x.b,n,y,-2)||za(x.a,x.b,i,[],-2)||v.some(b=>u(x,b)))return!1;for(const x of a)if(x!==p){for(const b of fn(g))for(const T of fn(s(x)))if(ed(b,T,.5)>=Ns)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const T of a){const k=s(T),S=hc(k,fr),C=o(k);for(let E=0;E<=k.length-4;E++)for(const A of d(k,E)){const M=hc(A,fr),L=o(A);if(!(Mv||N===v&&(M>x||M===x&&L>=b)||(m=T,y=A,v=N,x=M,b=L)}}if(!m||!y)return;m.points=y}}w(e9e,"shortcutRedundantOrthogonalJogs");function t9e(t,e){const s=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const ce=ue.x??0,Te=ue.y??0,ge=Ql(ue);ge&&s.push({id:String(ue.id??""),cx:ce,cy:Te,rect:ge})}if(s.length===0)return;const o=new Map(s.map(ue=>[ue.id,ue])),l=s.map(ue=>({id:ue.id,rect:ue.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ue=>ue.rect.top))-20,bottom:Math.max(...s.map(ue=>ue.rect.bottom))+20,left:Math.min(...s.map(ue=>ue.rect.left))-20,right:Math.max(...s.map(ue=>ue.rect.right))+20},d=t.filter(ue=>!ue.isLayoutOnly),f=new Map(d.map((ue,ce)=>[ue,ce])),p=w(ue=>{const ce=ue==="left"||ue==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[ue]+ce*20*ge);return Te},"outwardTracksForSide"),g=w((ue,ce=new Map)=>Fn(ce.get(ue)??ue.points??[]),"replacementPointsFor"),m=w((ue,ce)=>{let Te=0;for(const ge of ue)for(const Ve of ce)v0(ge.a,ge.b,Ve.a,Ve.b,fr)&&Te++;return Te},"crossingCountBetweenSegments"),y=w((ue,ce)=>m(fn(ue),fn(ce)),"crossingCountBetweenPaths"),v=w((ue=new Map)=>{let ce=0;const Te=[],ge=new Set,Ve=[],we=w(Ae=>{ge.has(Ae)||(ge.add(Ae),Ve.push(Ae))},"addEdge");for(let Ae=0;Ae0&&(ce+=oe,Te.push({first:Ue,second:Ce,count:oe}),we(Ue),we(Ce))}}return Ve.sort((Ae,Ue)=>(f.get(Ae)??0)-(f.get(Ue)??0)),{count:ce,pairs:Te,edgeSet:ge,edges:Ve}},"crossingSnapshot"),x=w((ue,ce)=>{const Te=new Set(ce.keys());if(Te.size===0)return ue.count;let ge=0;for(const we of ue.pairs)(Te.has(we.first)||Te.has(we.second))&&(ge+=we.count);let Ve=0;for(let we=0;we{const ce=new Map;for(const Ve of ue.pairs){const we=ce.get(Ve.first)??new Set;we.add(Ve.second),ce.set(Ve.first,we);const Ae=ce.get(Ve.second)??new Set;Ae.add(Ve.first),ce.set(Ve.second,Ae)}const Te=[],ge=new Set;for(const Ve of ue.edges){if(ge.has(Ve))continue;const we=[Ve],Ae=[];for(ge.add(Ve);we.length>0;){const Ue=we.pop();Ae.push(Ue);for(const le of ce.get(Ue)??[])ge.has(le)||(ge.add(le),we.push(le))}Ae.sort((Ue,le)=>(f.get(Ue)??0)-(f.get(le)??0)),Ae.length>1&&Te.push(Ae)}return Te},"crossingComponents"),T=w(ue=>[ue.start,ue.end].filter(ce=>!!ce),"endpointIdsFor"),k=w(ue=>{const ce=[];for(const Te of b(ue)){const ge=new Set(Te),Ve=new Set(Te.flatMap(Ae=>T(Ae))),we=[...Te];for(const Ae of d)ge.has(Ae)||T(Ae).some(Ue=>Ve.has(Ue))&&we.push(Ae);we.sort((Ae,Ue)=>(f.get(Ae)??0)-(f.get(Ue)??0)),ce.push(we)}return ce},"pairSearchGroups"),S=w((ue,ce,Te)=>x(ue,new Map([[ce,Te]])),"crossingCountWithSingleReplacement"),C=w(ue=>{const ce=new Map;for(const Te of ue.pairs)ce.set(Te.first,(ce.get(Te.first)??0)+Te.count),ce.set(Te.second,(ce.get(Te.second)??0)+Te.count);return ce},"currentCrossingsByEdge"),E=w(ue=>ue.slice(1).reduce((ce,Te,ge)=>{const Ve=ue[ge];return ce+Math.abs(Te.x-Ve.x)+Math.abs(Te.y-Ve.y)},0),"pathLength"),A=w((ue=new Map)=>d.reduce((ce,Te)=>ce+hc(g(Te,ue)),0),"totalBends"),M=w((ue=new Map)=>d.reduce((ce,Te)=>ce+E(g(Te,ue)),0),"totalLength"),L=w((ue,ce,Te=new Map)=>{const ge=fn(ce);for(const Ve of d)if(Ve!==ue){for(const we of ge)for(const Ae of fn(g(Ve,Te)))if(ed(we,Ae,.5)>=Ns)return!0}return!1},"pathHasSegmentConflict"),P=w((ue,ce)=>{const Te=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of fn(ce))if(za(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),N=w((ue,ce)=>{const Te=od(Fn(ce));fn(Te).length===Te.length-1&&ue.push(Te)},"pushOrthogonalCandidate"),_=w(ue=>ue==="left"||ue==="right","sideIsHorizontal"),I=w((ue,ce,Te)=>{switch(ce){case"left":return Math.min(ue.x,Te.x)-20;case"right":return Math.max(ue.x,Te.x)+20;case"top":return Math.min(ue.y,Te.y)-20;case"bottom":return Math.max(ue.y,Te.y)+20}},"localTrackForSameSide"),O=w((ue,ce,Te,ge)=>{const Ve=Te==="left"||Te==="top"?-1:1,we=[I(ce,Te,ge),h[Te]];for(const Ae of we)for(let Ue=0;Ue<=2;Ue++)N(ue,OJ(ce,Te,ge,Ae+Ve*20*Ue))},"addSameSideCandidates"),D=w((ue,ce,Te,ge,Ve)=>{for(const we of p(Te))for(const Ae of p(Ve))N(ue,[ce,{x:we,y:ce.y},{x:we,y:Ae},{x:ge.x,y:Ae},ge])},"addHorizontalToVerticalCandidates"),$=w((ue,ce,Te,ge,Ve)=>{for(const we of p(Te))for(const Ae of p(Ve))N(ue,[ce,{x:ce.x,y:we},{x:Ae,y:we},{x:Ae,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=w((ue,ce,Te,ge,Ve)=>{const we=[...p("top"),...p("bottom")];for(const Ae of p(Te))for(const Ue of p(Ve))for(const le of we)N(ue,[ce,{x:Ae,y:ce.y},{x:Ae,y:le},{x:Ue,y:le},{x:Ue,y:ge.y},ge])},"addHorizontalPairCandidates"),z=w((ue,ce,Te,ge,Ve)=>{const we=[...p("left"),...p("right")];for(const Ae of p(Te))for(const Ue of p(Ve))for(const le of we)N(ue,[ce,{x:ce.x,y:Ae},{x:le,y:Ae},{x:le,y:Ue},{x:ge.x,y:Ue},ge])},"addVerticalPairCandidates"),H=w(ue=>{const ce=new Set;return ue.map(Te=>Fn(Te)).filter(Te=>{const ge=Te.map(Ve=>`${Ve.x.toFixed(3)},${Ve.y.toFixed(3)}`).join("|");return ce.has(ge)||Te.length<2?!1:(ce.add(ge),!0)})},"dedupeCandidatePaths"),B=w((ue,ce,Te,ge)=>{const Ve=[],we=DJ(ue,ce,Te,ge,20,fr);we&&N(Ve,we),ce===ge&&O(Ve,ue,ce,Te);const Ae=_(ce),Ue=_(ge);return Ae&&!Ue?D(Ve,ue,ce,Te,ge):!Ae&&Ue?$(Ve,ue,ce,Te,ge):Ae?F(Ve,ue,ce,Te,ge):z(Ve,ue,ce,Te,ge),H(Ve)},"buildCandidatesForSides"),V=w((ue,ce,Te,ge)=>{const Ve=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const Ue=o1(ge,Ae),le=Ae==="top"||Ae==="bottom"?p(Ae):we;for(const pe of Ve){N(ue,[ce,Te,{x:pe,y:Te.y},{x:pe,y:Ue.y},Ue]);for(const Ce of le)N(ue,[ce,Te,{x:pe,y:Te.y},{x:pe,y:Ce},{x:Ue.x,y:Ce},Ue])}}},"addVerticalDepartureOuterTrackCandidates"),q=w((ue,ce,Te,ge)=>{const Ve=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const Ue=o1(ge,Ae),le=Ae==="left"||Ae==="right"?p(Ae):Ve;for(const pe of we){N(ue,[ce,Te,{x:Te.x,y:pe},{x:Ue.x,y:pe},Ue]);for(const Ce of le)N(ue,[ce,Te,{x:Te.x,y:pe},{x:Ce,y:pe},{x:Ce,y:Ue.y},Ue])}}},"addHorizontalDepartureOuterTrackCandidates"),G=w(ue=>{const ce=ue.start,Te=ue.end,ge=Te?o.get(Te):void 0;if(!ce||!ge)return[];const Ve=Fn(ue.points??[]);if(Ve.length<4)return[];const we=Ve[0],Ae=Ve[1],Ue=[];return Ta(we,Ae,fr)?V(Ue,we,Ae,ge):wa(we,Ae,fr)&&q(Ue,we,Ae,ge),Ue},"terminalPreservingOuterTrackCandidates"),Q=w(ue=>{const ce=ue.start,Te=ue.end,ge=ce?o.get(ce):void 0,Ve=Te?o.get(Te):void 0;if(!ge||!Ve)return[];const we=[];for(const Ae of u){const Ue=o1(ge,Ae);for(const le of u)we.push(...B(Ue,Ae,o1(Ve,le),le))}return we.push(...G(ue)),we},"candidatePathsFor"),j=w(()=>new Map(d.map(ue=>[ue,fn(g(ue))])),"currentSegmentsByEdge"),ae=w((ue,ce,Te)=>{const ge=new Set;for(const Ve of d){if(Ve===ue)continue;const we=Te.get(Ve)??fn(g(Ve));ce.some(Ae=>we.some(Ue=>ed(Ae,Ue,.5)>=Ns))&&ge.add(Ve)}return ge},"sharedTrackConflictsFor"),Z=w((ue,ce,Te,ge)=>{const Ve=new Set;return Q(ue).map(Ae=>od(Fn(Ae))).filter(Ae=>{if(P(ue,Ae))return!1;const Ue=Ae.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return Ve.has(Ue)||Ae.length<2?!1:(Ve.add(Ue),!0)}).map(Ae=>{const Ue=fn(Ae);let le=0;for(const pe of d)pe!==ue&&(le+=m(Ue,Te.get(pe)??fn(g(pe))));return{candidate:Ae,candidateSegments:Ue,crossings:ce.count-(ge.get(ue)??0)+le,bends:hc(Ae,fr),totalBends:hc(Ae),length:E(Ae)}}).filter(({crossings:Ae})=>Ae<=ce.count).sort((Ae,Ue)=>Ae.crossings-Ue.crossings||Ae.bends-Ue.bends||Ae.length-Ue.length).slice(0,48).map(Ae=>({path:Ae.candidate,segments:Ae.candidateSegments,sharedTrackConflicts:ae(ue,Ae.candidateSegments,Te),totalBends:Ae.totalBends,length:Ae.length}))},"pairCandidatesFor"),J=w((ue,ce,Te,ge,Ve,we)=>{let Ae=0;for(const le of ue.pairs)(le.first===ce||le.second===ce||le.first===ge||le.second===ge)&&(Ae+=le.count);let Ue=m(Te.segments,Ve.segments);for(const le of d){if(le===ce||le===ge)continue;const pe=we.get(le)??fn(g(le));Ue+=m(Te.segments,pe)+m(Ve.segments,pe)}return ue.count-Ae+Ue},"pairCrossingCount"),re=w((ue,ce)=>{for(const Te of ue.sharedTrackConflicts)if(Te!==ce)return!1;return!0},"conflictsOnlyWith"),ee=w((ue,ce)=>ue.segments.some(Te=>ce.segments.some(ge=>ed(Te,ge,.5)>=Ns)),"candidatesShareTrack"),me=w((ue,ce,Te,ge)=>re(ce,Te.edge)&&re(ge,ue.edge)&&!ee(ce,ge),"pairCandidatesAreCompatible"),te=w((ue,ce,Te,ge,Ve)=>{const we=J(ue.current,ce.edge,Te,ge.edge,Ve,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[ce.edge,Te.path],[ge.edge,Ve.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(ce.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+Ve.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(ce.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+Te.length+Ve.length}},"scorePairReplacement"),$e=w((ue,ce)=>ue.crossings{let Ve=ge;for(const we of ce.candidates)for(const Ae of Te.candidates){if(!me(ce,we,Te,Ae))continue;const Ue=te(ue,ce,we,Te,Ae);Ue&&$e(Ue,Ve)&&(Ve=Ue)}return Ve},"bestScoreForOptionPair"),He=w(ue=>{const ce=A(),Te=M(),ge=j(),Ve=C(ue),we=new Map(d.map(oe=>[oe,hc(g(oe))])),Ae=new Map(d.map(oe=>[oe,E(g(oe))])),Ue=new Map,le=k(ue);for(const oe of le)for(const fe of oe){if(Ue.has(fe))continue;const W=Z(fe,ue,ge,Ve);W.length>0&&Ue.set(fe,{edge:fe,candidates:W})}let pe={replacements:new Map,crossings:ue.count,bends:ce,length:Te};const Ce={current:ue,currentBends:ce,currentLength:Te,baseBendsByEdge:we,baseLengthByEdge:Ae,baseSegments:ge};for(const oe of le){const fe=new Set(oe.filter(se=>ue.edgeSet.has(se))),W=oe.map(se=>Ue.get(se)).filter(se=>!!se);for(let se=0;se0?pe.replacements:void 0},"bestPairedReplacement");for(let ue=0;ue<4;ue++){const ce=v(),Te=ce.count;if(Te===0)return;let ge,Ve,we=Te,Ae=Number.POSITIVE_INFINITY;for(const le of ce.edges){const pe=hc(g(le),fr);for(const Ce of Q(le)){const oe=P(le,Ce),fe=!oe&&L(le,Ce),W=S(ce,le,Ce),se=hc(Ce,fr);oe||fe||!(Wwe||W===we&&se>=Ae||(ge=le,Ve=Ce,we=W,Ae=se)}}if(ge&&Ve){ge.points=Ve;continue}const Ue=He(ce);if(!Ue)return;for(const[le,pe]of Ue)le.points=pe}}w(t9e,"resolveRenderedOrthogonalCrossings");var B0=.001,RBt=8;function r9e(t,e){const{nodeInfoById:r,realNodeRects:n}=UN(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=w((m,y,v,x)=>{const b=[],T=DJ(m,y,v,x,a,B0);return T&&b.push(T),y===x&&b.push(OJ(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let x=0;const b=QT(m,B0),T=y.start,k=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const C=S.start,E=S.end;if(!v&&T&&k&&(C===T||C===k||E===T||E===k))continue;const A=S.points;if(!(!A||A.length<2))for(const M of b)for(const L of QT(A,B0)){if(BJ(M.a,M.b,L.a,L.b,B0,B0)){x++;continue}ed(M,L,B0)>=RBt&&x++}}return x},"pathConflictCount"),h=4,d=w((m,y)=>{const v=Math.abs(m.y-y.rect.top),x=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),T=Math.abs(m.x-y.rect.right);let k="top",S=v;return x{const x=f.get(m)??[];x.push({side:y,edgeId:v}),f.set(m,x)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",x=m.start,b=m.end;if(x){const T=r.get(x);T&&p(x,d(y[0],T),v)}if(b){const T=r.get(b);T&&p(b,d(y[y.length-1],T),v)}}const g=w((m,y,v)=>{var x;return((x=f.get(m))==null?void 0:x.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=hc(y,B0);if(v0){const $=u(O,m,!0);if($>M||$===M&&D>=L)continue;M=$,L=D,A=O;continue}u(O,m)>E||D_.edgeId!==S));const N=f.get(b);N&&f.set(b,N.filter(_=>_.edgeId!==S)),p(x,d(A[0],T),S),p(b,d(A[A.length-1],k),S)}}}w(r9e,"simplifyDetouredEdges");var Nl=.001,vfe=10,YA=7;function MG(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&&CL(t,n9e(a)))}w(LG,"labelOverlapsOwnMarker");function wR(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=pG(m,a);for(const{nodeId:v,rect:x}of n)if(v!==g&&CL(y,x))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=pG(m,a);for(const v of r)if(v.edgeId!==g&&GN(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=w((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=w(g=>{for(const{id:m,rect:y}of i)if(L_e(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&CL(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 x=y.width??0,b=y.height??0;if(x<=0||b<=0)continue;const T=[];for(let H=0;H=Nl&&G>=Nl||T.push({idx:H,length:q+G,orientation:q>=Nl?"horizontal":"vertical",midX:(B.x+V.x)/2,midY:(B.y+V.y)/2})}if(T.length===0)continue;const k=T.length>=3?T.filter(H=>H.idx>0&&H.idx0?k:T,C=x>=b?"horizontal":"vertical",E=w(H=>[...H].sort((B,V)=>{const q=B.orientation===C,G=V.orientation===C;if(q!==G)return q?-1:1;const Q=B.length>=(B.orientation==="horizontal"?x:b)+2,j=V.length>=(V.orientation==="horizontal"?x:b)+2;return Q!==j?Q?-1:1:V.length-B.length}),"rankSegments"),A=T[0],M=T[T.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=w((H,B)=>{const V=v[H.idx],q=v[H.idx+1];return{midX:V.x+(q.x-V.x)*B,midY:V.y+(q.y-V.y)*B}},"anchorAtT"),N=w((H,B,V)=>Math.min(V,Math.max(B,H)),"clamp"),_=w((H,B)=>H.midX>=B.left-Nl&&H.midX<=B.right+Nl&&H.midY>=B.top-Nl&&H.midY<=B.bottom+Nl,"pointInsideRectInclusive"),I=w(H=>{const B=vb(H.midX,H.midY,x,b),V=f(B);if(V)return{laneId:V,anchor:H,rect:B};const q=i.find(({rect:re})=>_(H,re));if(!q)return;const G=q.rect.left+x/2+s,Q=q.rect.right-x/2-s,j=q.rect.top+b/2+s,ae=q.rect.bottom-b/2-s;if(G>Q||j>ae)return;const Z={midX:N(H.midX,G,Q),midY:N(H.midY,j,ae)},J=vb(Z.midX,Z.midY,x,b);return _(H,J)?{laneId:q.id,anchor:Z,rect:J}:void 0},"placementForAnchor"),O=w((H,B,V)=>H.orientation==="horizontal"?Math.abs(B.midX-V.x):Math.abs(B.midY-V.y),"distanceAlongSegment"),D=w((H,B)=>{const q=(H.orientation==="horizontal"?x/2:b/2)+o;if(H===A){const G=v[H.idx];if(O(H,B,G)+Nl{const B=E(H);for(const V of B)for(const q of L){const G=P(V,q);if(!D(V,G))continue;const Q=I(G);if(Q&&!LG(Q.rect,v)&&!p(m,Q.rect)&&!h(m,g.id,Q.rect))return{laneId:Q.laneId,anchor:Q.anchor}}},"tryPool"),F=w((H,B,V=!1)=>{const q=E(H);for(const G of q){const Q={midX:G.midX,midY:G.midY};if(B&&!D(G,Q))continue;const j=I(Q);if(j&&!LG(j.rect,v)&&!p(m,j.rect)&&!l(m,j.rect)&&(V||!u(g.id,j.rect)))return{laneId:j.laneId,anchor:j.anchor}}},"findLaneContainingFallback"),z=$(S)??(S.lengthV.labelId===m);B>=0?d[B]={labelId:m,rect:H}:d.push({labelId:m,rect:H})}}}w(wR,"anchorLabelsToPolyline");var fF=1e-6,_Bt=8,bfe=_Bt/2,MBt=3;function IG(t,e){return t{const h=IG(o,l);let d=0;const f=w(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||IG(g,m)===h&&f(p.labelNodeId)}return d>0?d+MBt:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!$J(o,fF))continue;const l=PJ(s,r,fF);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 k=f.cy>d.cy;m={x:d.cx,y:k?d.rect.bottom:d.rect.top},y={x:f.cx,y:k?f.rect.top:f.rect.bottom}}else{const k=f.cx>d.cx;m={x:k?d.rect.right:d.rect.left,y:d.cy},y={x:k?f.rect.left:f.rect.right,y:f.cy}}if(za(m,y,n,[u,h],1))continue;const x=a(s,u,h,p?"x":"y"),b=x>bfe?x:bfe,T=[0,b,-b];for(const k of T){const S={...m},C={...y};if(p){if(S.x+=k,C.x+=k,S.x<=d.rect.left||S.x>=d.rect.right||C.x<=f.rect.left||C.x>=f.rect.right)continue}else if(S.y+=k,C.y+=k,S.y<=d.rect.top||S.y>=d.rect.bottom||C.y<=f.rect.top||C.y>=f.rect.bottom)continue;if(!za(S,C,n,[u,h],1)&&!SL(S,C,t,s,{epsilon:fF})){s.points=[S,C];break}}}}w(i9e,"straightenCollinearSiblingDetours");function $G(t,e){const{realNodeRects:l,labelNodeRects:u}=Cg(e.values()),h=w((k,S)=>QT(S,.001).map(C=>({...C,edge:k,interior:C.index>=1&&C.index<=S.length-3})),"segmentsFor"),d=w(()=>{const k=[];for(const S of t){if(S.isLayoutOnly)continue;const C=S.points;!C||C.length<2||k.push(...h(S,Fn(C)))}return k},"allSegments"),f=w((k,S)=>k.horizontal&&S.horizontal?yl(k.a.x,k.b.x,S.a.x,S.b.x)>=8&&Math.abs(k.a.y-S.a.y)<7:k.vertical&&S.vertical?yl(k.a.y,k.b.y,S.a.y,S.b.y)>=8&&Math.abs(k.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=w((k,S)=>{const C=k.start,E=k.end,A=h(k,S);if(A.length!==S.length-1)return!1;const M=[C,E].filter(P=>!!P),L=k.labelNodeId?[k.labelNodeId]:[];for(const P of A)if(za(P.a,P.b,l,M,-2)||za(P.a,P.b,u,L,-2))return!1;for(const P of t){if(P===k||P.isLayoutOnly)continue;const N=P.points;if(!(!N||N.length<2)){for(const _ of A)for(const I of h(P,Fn(N)))if(f(_,I)||v0(_.a,_.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=w((k,S)=>{const C=Fn(k.edge.points??[]);if(C.length<4||k.index>=C.length-1)return;const E=C.map(A=>({...A}));if(k.horizontal)E[k.index].y+=S,E[k.index+1].y+=S;else if(k.vertical)E[k.index].x+=S,E[k.index+1].x+=S;else return;return h(k.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=w((k,S)=>({x:k.x??(S.left+S.right)/2,y:k.y??(S.top+S.bottom)/2}),"nodeCenter"),y=w(k=>{const S=k.edge,C=Fn(S.points??[]);if(C.length!==4||k.index!==1)return;const E=S.start?e.get(S.start):void 0,A=S.end?e.get(S.end):void 0,M=E?Ql(E):void 0,L=A?Ql(A):void 0,P=C.slice(k.index+2);if(!(!E||!A||!M||!L||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(A,L),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=w((k,S,C,E,A,M)=>{const L=E.y>=C.y,P=L?A.bottom:A.top,N=P+(L?20:-20);if(L&&k.b.y<=N+.001||!L&&k.b.y>=N-.001)return;const _=k.a.x+S;return Fn([{x:C.x,y:P},{x:C.x,y:N},{x:_,y:N},{x:_,y:k.b.y},...M],.001)},"verticalSourceDetour"),x=w((k,S,C,E,A,M)=>{const L=E.x>=C.x,P=L?A.right:A.left,N=P+(L?20:-20);if(L&&k.b.x<=N+.001||!L&&k.b.x>=N-.001)return;const _=k.a.y+S;return Fn([{x:P,y:C.y},{x:N,y:C.y},{x:N,y:_},{x:k.b.x,y:_},...M],.001)},"horizontalSourceDetour"),b=w((k,S)=>{const C=y(k);if(C){if(k.vertical)return v(k,S,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail);if(k.horizontal)return x(k,S,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let k=0;k<12;k++){const S=d();let C=!1;for(let E=0;EN.interior);for(const N of P){for(const _ of T){const I=g(N,_);if(I&&p(N.edge,I)){N.edge.points=I,C=!0;break}const O=b(N,_);if(O&&p(N.edge,O)){N.edge.points=O,C=!0;break}}if(C)break}}if(!C)return}}w($G,"nudgeSharedInteriorSubpaths");function a9e(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}w(a9e,"segmentsIntersect");function s9e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=I_e(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;he.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)he.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}w(s9e,"validateSwimlanesLayout");function o9e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!Y_e(t,e)||e==="BT"&&i.length>0&&!U_e(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=od(EL(l)))}r9e(n,r),i9e(n,r),j_e(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);wR(n,a),P_e(n,a),X_e(n,a),$G(n,a),K_e(n,a),Z_e(n,a),AG(n,a),Q_e(n,a);const s=w(()=>{t9e(n,a),J_e(n,a),e9e(n,a),wR(n,a),SG(n,a),AG(n,a),wR(n,a),SG(n,a)},"finalizeRenderedEdges");s(),$G(n,a),s(),RG(n,a),_G(n,a),RG(n,a),_G(n,a)}w(o9e,"postProcessSwimlaneLayout");function Sg(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}}w(Sg,"normalizeGraph");function WJ(t,e){return t.edges.filter(r=>r.dst===e)}w(WJ,"incoming");function l9e(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}w(l9e,"buildSuccessorMap");function qJ(t){const e=l9e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(qJ,"buildSortedSuccessorMap");function GJ(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}w(GJ,"buildInDegreeMap");function UJ(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(UJ,"sortedZeroInDegreeNodes");function YN(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}}w(YN,"buildPredecessorSuccessorMaps");function YJ(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}w(YJ,"buildLayersFromRanks");function PE(t){const e=GJ(t),r=UJ(e),n=[],i=qJ(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=w(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}}w(c9e,"removeCycles_DFS");function u9e(t){const e=new Map,r=w(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}w(u9e,"buildTopLaneMap");function b0(t){const e=u9e(t);return r=>e.get(r)??null}w(b0,"createTopLaneResolver");function jN(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(jN,"buildTopLaneOrder");function XJ(t,e){const r=jN(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}w(XJ,"resolveTopLaneOrder");var LBt={EPSILON:1e-6},LL={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},xfe={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function h9e(t,e){const r=Sg(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=YN(r);for(const k of a.values())k.sort((S,C)=>S.localeCompare(C));const s=PE(r)??[...r.nodes].sort((k,S)=>k.localeCompare(S)),o=new Map;for(const[k,S]of s.entries())o.set(S,k);const l=new Map,u=new Map;for(const k of r.nodes)u.set(k,[]);for(const k of s){const S=(a.get(k)??[]).filter(C=>l.has(C));if(S.length>0){const C=d9e(k,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(k,C),u.get(C).push(k)}else l.has(k)||l.set(k,null)}for(const k of r.nodes)l.has(k)||l.set(k,null);const h=new Set;for(const k of r.nodes)(l.get(k)??null)===null&&h.add(k);const d=[...h].sort((k,S)=>{const C=o.get(k)??0,E=o.get(S)??0;return C===E?k.localeCompare(S):C-E}),f=f9e(r),p=new Map;for(const[k,S]of f.entries())p.set(k,[...S].sort((C,E)=>C.localeCompare(E)));const g=p9e(p),m=g9e(p),y=new Map;for(const k of r.nodes)y.set(k,[]);for(const k of m)for(const S of k.nodes){const C=y.get(S);C?C.push(k.id):y.set(S,[k.id])}const v=[],x=[],b=new Set,T=w(k=>{if(!b.has(k)){b.add(k),v.push(k);for(const S of u.get(k)??[])T(S);x.push(k)}},"walk");for(const k of d)T(k);for(const k of s)T(k);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:x,topologicalOrder:s}}w(h9e,"buildDrivingTree");function d9e(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]}w(d9e,"chooseParent");function f9e(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}w(f9e,"buildAdjacency");function p9e(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}w(p9e,"assignComponents");function g9e(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=w((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(m9e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}w(g9e,"computeBlocks");function m9e(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]}}w(m9e,"popBlock");function y9e(t,e,r){const n=[...t.nodes],i=new Map;for(const[x,b]of n.entries())i.set(b,x);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const x of n){const b=r.parent.get(x)??null,T=i.get(x);T!=null&&b==null&&(s[T]=-1,o[T]=0,u.has(x)||(u.add(x),l.push(x)))}for(;l.length>0;){const x=l.shift(),b=i.get(x);if(b==null)continue;const T=r.children.get(x)??[];for(const k of T){if(u.has(k))continue;const S=i.get(k);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(k),l.push(k))}}for(const x of n){if(u.has(x))continue;const b=i.get(x);b!=null&&(s[b]=-1,o[b]=0,u.add(x))}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 x=0;x{if(x===-1||b===-1)return-1;o[x]>k&1&&(x=d[k][x],x===-1))return-1;if(x===b)return x;for(let k=h-1;k>=0;k--){const S=d[k][x],C=d[k][b];S===-1||C===-1||S!==C&&(x=S,b=C)}return d[0][x]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const x of t.edges){let b=x.src,T=x.dst,k=e[b],S=e[T];if(k==null||S==null||(k>S&&([b,T]=[T,b],[k,S]=[S,k]),k==null||S==null||k===S))continue;const C=i.get(b),E=i.get(T);if(C==null||E==null)continue;const A=f(C,E);if(A===-1)continue;const M=p[A];for(let L=k;L{if(b.size!==0)for(const[T,k]of b)x.set(T,(x.get(T)??0)+k)},"mergeInto"),y=new Set,v=w(x=>{const b=i.get(x);y.add(x);const T=b==null?void 0:p[b],k=T?new Map(T):new Map,S=r.children.get(x)??[];for(const C of S){const E=v(C),A=e[x];if(A!=null){let M=g.get(x);M||(M=new Map,g.set(x,M));let L=E.get(A)??0;const P=e[C];P!=null&&P>A&&(L+=1),M.set(C,L)}m(k,E)}return k},"dfs");for(const x of r.roots)y.has(x)||v(x);for(const x of n)y.has(x)||v(x);return g}w(y9e,"computeSubtreeCrossCounts");function v9e(t,e,r){const n=new Map,i=w(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(KJ(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}w(v9e,"annotateMinimumLayers");function KJ(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(KJ,"compareByRankThenId");function b9e(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=w(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}w(b9e,"emitNodesInTreeOrder");function x9e(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}w(x9e,"deduplicateLayers");function w9e(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]}}w(w9e,"createChildOrderer");function IL(t,e,r){const n=h9e(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=y9e(t,e,n),o=[...a].sort(KJ(e)),l=v9e(o,i,e),u=w9e(i,e,s,l);let h=b9e(o,t.nodes,e,u);return h=x9e(h),h}w(IL,"buildMultitreeLayerOrder");function T9e(t,e,r){const n=new Set(t),i=new Set(e),a=JT(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return jJ(s)}w(T9e,"countCrossingsBetweenAdjacent");function NG(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=IL(t,r,i),y=NG(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)}}w(C9e,"adjustCrossLaneSources");function S9e(t,e){const r=Sg(t),n=PE(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=b0(r);let s=Object.create(null);for(const l of n){const u=WJ(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=k9e(r,s)),e!=null&&e.ignoreCrossLaneEdges&&C9e(r,s),{layers:IL(r,s,a),rankOf:s,dummy:new Set}}w(S9e,"assignLayers_LongestPath");function E9e(t,e){const r=Sg(t),i={...S9e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=b0(r),{preds:s,succs:o}=YN(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=PE(r)??[...r.nodes],u=[...l].reverse(),h=w((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 x=o.get(g)??[];return x.length>0&&(v=Math.min(...x.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=LL.GRAVITY_ITERATIONS,f=w(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],x=o.get(y)??[];if(v.length===0&&x.length===0)continue;const b=v.length>0?v.reduce((C,E)=>C+(i[E]??0)+1,0)/v.length:i[y]??0,T=x.length>0?x.reduce((C,E)=>C+(i[E]??0)-1,0)/x.length:i[y]??0,k=Math.round((b+T)/2),S=h(y,k);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:YJ(r,l,i),rankOf:i,dummy:new Set}}w(E9e,"assignLayers_Gravity");function A9e(t){const e=GJ(t),r=qJ(t);let n=UJ(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}w(A9e,"topoSortByGenerationIfAcyclic");function R9e(t,e){const r=Sg(t),n=(e==null?void 0:e.direction)==="LR"?A9e(r)??[...r.nodes].sort():PE(r)??[...r.nodes].sort(),i=b0(r),a=w(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=w((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=WJ(r,h);let p=0;if(f.length>0)for(const v of f){const x=v.src,b=s[x]??0;p=Math.max(p,b+l(x,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:YJ(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}w(R9e,"assignLayers_LaneAwareCompact");function _9e(t,e){const r=Sg(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=w(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 x=g+1,b=0;x!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}w(_9e,"makeProperLayering");function DG(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])}w(DG,"median");function OG(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(OG,"barycenter");function M9e(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}w(M9e,"neighborPositionsFor");function L9e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(L9e,"currentOrderTieBreak");function PG(t,e,r){const n=new Set(t),i=new Set(e),a=JT(t),s=JT(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 jJ(l)}w(PG,"countCrossingsBetweenAdjacent");function TR(t,e,r){return[...t].sort((n,i)=>{const a=DG(e.get(n)??[]),s=DG(e.get(i)??[]);return a===s?L9e(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}w(TR,"sortByHeuristic");function BG(t,e,r,n,i,a){const s=JT(t),o=JT(e),l=M9e(e,s,r,n);if(!i||!a||a.length===0)return TR(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=TR(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=TR(d,l,o);for(const p of f){const g=OG(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const x=OG(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=w(m=>{let y=PG(t,m,u);return h&&n&&(y+=PG(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=b0(e),s=XJ(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=BG(n[l+1],n[l],i,"up",a,s),n[l]=FG(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}w(I9e,"orderLayers");function $9e(t,e,r){const n=(r==null?void 0:r.layerGap)??xfe.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??xfe.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=w(M=>e.nodeById.get(M),"getNode"),f=w(M=>{var L;return((L=d(M))==null?void 0:L.width)??0},"getWidth"),p=w(M=>{var L;return((L=d(M))==null?void 0:L.height)??0},"getHeight"),g=b0(e),m=XJ(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($,f(F)),0),P=l[M+1].reduce(($,F)=>Math.max($,f(F)),0),N=y[M],_=y[M+1],I=N/2+_/2,O=(L+P)/2,D=Math.max(0,O-I-n);v.push(D)}const x=new Set;for(const M of l)for(const L of M)x.add(g(L));const b=x.has(null),T=m.filter(M=>x.has(M)),k=[...b?[null]:[],...T],S=Object.create(null);for(const M of T)S[M]=0;b&&(S.null=0);for(const M of l){const L=Object.create(null),P=[];for(const N of M){const _=g(N);_===null?P.push(N):(L[_]||(L[_]=[])).push(N)}for(const[N,_]of Object.entries(L)){const I=_.reduce((O,D)=>O+f(D),0)+i*Math.max(0,_.length-1);S[N]=Math.max(S[N]??0,I)}if(b&&P.length){const N=P.reduce((_,I)=>_+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,N)}}const C=new Map;{const M=k.map(N=>(N===null?S.null:S[N])??0);let P=-(M.reduce((N,_)=>N+_,0)+a*Math.max(0,k.length-1))/2;for(let N=0;Nf(H)),F=$.reduce((H,B)=>H+B,0)+i*(O.length-1);let z=D-F/2;for(const[H,B]of O.entries()){const V=$[H];u[B]=z+V/2,h[B]=E+P/2,z+=V+i}}}const _=v[M]??0;E+=P+n+_}const A=new Map;for(const M of e.edges){const L=M.ref.id;A.has(L)||A.set(L,[]),A.get(L).push(M)}for(const[,M]of A){if(M.length===0)continue;const L=M[0].ref,P=L.start,N=L.end;if(P==null||N==null)continue;const _=Math.round(((u[P]??0)+(u[N]??0))/2),I=new Set;for(const O of M)I.add(O.src),I.add(O.dst);for(const O of I){if(O===P||O===N)continue;const D=e.nodeById.get(O);D!=null&&D.isDummy&&(u[O]=_)}}return{x:u,y:h}}w($9e,"assignCoordinates");var N9e=8;function D9e(t){let e=2166136261;for(let r=0;r>>0}w(D9e,"hashString");function O9e(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}}w(O9e,"mulberry32");function P9e(t,e){const r=[...t],n=O9e(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}w(P9e,"deterministicShuffle");function B9e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(B9e,"sourceDistance");function zG(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}w(zG,"laneArrangementCost");function F9e(t){const e=jN(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=b0(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()]}w(F9e,"buildWeightedLaneEdges");function HG(t,e,r){const n=[...t];let i=zG(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 D9e(`${t.join("|")}#${n}#${r}`)}w(H9e,"seedForRestart");function V9e(t,e={}){const r=jN(t);if(r.length<2)return r;const n=F9e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=HG(r,n,i);const s=Math.max(0,e.restarts??N9e);for(let o=0;ovn&&l*3>=o?s>0?"bottom":"top":o>vn?a>0?"right":"left":r}w(VG,"chooseOrthogonalSide");function WG(t,e){return Math.abs(t.to-e.from)le.isGroup&&!le.parentId);for(const le of u){const pe={id:le.id},Ce=w(oe=>{s.set(oe.id,pe),r.filter(fe=>fe.parentId===oe.id).forEach(Ce)},"assignLane");Ce(le)}const h=r.filter(le=>!le.isGroup&&!le.isEdgeLabel).map(le=>{const pe=le.width??10,Ce=le.height??10,oe=le.x??0,fe=le.y??0,W=IBt;return{nodeId:le.id,minX:oe-pe/2-W,maxX:oe+pe/2+W,minY:fe-Ce/2-W,maxY:fe+Ce/2+W,visualXHalfExtent:l?Ce/2+W:pe/2+W}}),d=w((le,pe,Ce,oe)=>{let fe=o.find(W=>W.orientation===le&&Math.abs(W.coord-pe)<1);return fe||(fe={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Ce,spanMax:oe,tracks:[]},o.push(fe)),fe.spanMin=Math.min(fe.spanMin,Ce),fe.spanMax=Math.max(fe.spanMax,oe),fe},"getOrAddPipe"),f=w((le,pe)=>{const Ce=le.width??10,oe=le.height??10,fe=le.x??0,W=le.y??0;switch(pe){case"top":return{x:fe,y:W-oe/2};case"bottom":return{x:fe,y:W+oe/2};case"left":return{x:fe-Ce/2,y:W};case"right":return{x:fe+Ce/2,y:W}}},"portForSide"),p=w((le,pe,Ce)=>f(le,VG(le,pe,Ce?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,x=w((le,pe,Ce)=>{if(g.length===0)return 0;const oe=Math.abs(pe.y-Ce.y)de||X.from-vn<=se&&X.to+vn>=se&&(W+=v)}else if(fe){const se=pe.x,K=Math.min(pe.y,Ce.y)-vn,de=Math.max(pe.y,Ce.y)+vn;if(de<=K)return 0;for(const X of g)X.edgeIndex===le||X.orientation!=="horizontal"||X.pipe.coordde||X.from-vn<=se&&X.to+vn>=se&&(W+=v)}return W},"crossingPenalty"),b=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Ce=a.get(le.start),oe=a.get(le.end),fe=s.get(le.start),W=s.get(le.end),se=fe&&W&&fe.id!==W.id?1:0,K=Ce&&oe?Math.abs((oe.x??0)-(Ce.x??0)):0,de=Ce&&oe?Math.abs((oe.y??0)-(Ce.y??0)):0;return{idx:pe,crossLane:se,dx:K,dy:de}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Ce=le.dx+le.dy,oe=pe.dx+pe.dy;return Math.abs(Ce-oe)>1?Ce-oe:le.idx-pe.idx}).map(le=>le.idx),T=w((le,pe,Ce,oe)=>{const fe=Math.min(le.x,pe.x),W=Math.max(le.x,pe.x),se=Math.min(le.y,pe.y),K=Math.max(le.y,pe.y);return!!h.find(X=>Ce&&X.nodeId===Ce||oe&&X.nodeId===oe?!1:Math.abs(le.x-pe.x)>vn?X.minYle.y&&X.maxX>fe&&X.minXle.x&&X.maxY>se&&X.minYVG(le,pe,"bottom"),"determineSide"),E=new Map;for(const[le,pe]of i.entries()){if(!pe.start||!pe.end||pe.start===pe.end||pe.points&&pe.points.length>0)continue;const Ce=a.get(pe.start),oe=a.get(pe.end);if(!Ce||!oe)continue;const fe=(oe.x??0)-(Ce.x??0),W=(oe.y??0)-(Ce.y??0);E.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:C(Ce,{x:oe.x??0,y:oe.y??0}),dstSide:C(oe,{x:Ce.x??0,y:Ce.y??0}),absDx:Math.abs(fe),absDy:Math.abs(W),dxSign:Math.sign(fe),dySign:Math.sign(W)})}const A=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.absDx===0?1/0:le.absDy/le.absDx:le.absDy===0?1/0:le.absDx/le.absDy,"preferenceStrength"),M=w(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.dxSign>=0?"right":"left":le.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const le of E.values()){const pe=`${le.srcId}:${le.srcSide}`;L.has(pe)||L.set(pe,[]),L.get(pe).push(le)}const P=new Map,N=w((le,pe)=>`${le}:${pe}`,"loadKey");for(const le of E.values())P.set(N(le.srcId,le.srcSide),(P.get(N(le.srcId,le.srcSide))??0)+1),P.set(N(le.dstId,le.dstSide),(P.get(N(le.dstId,le.dstSide))??0)+1);for(const le of L.values())if(!(le.length<2)){le.sort((pe,Ce)=>{const oe=A(pe),fe=A(Ce);return Math.abs(oe-fe)>1e-9?fe-oe:pe.edgeIdx-Ce.edgeIdx});for(let pe=1;pe=fe||(P.set(N(Ce.srcId,Ce.srcSide),fe-1),P.set(N(Ce.srcId,oe),W+1),Ce.srcSide=oe)}}const _=w(le=>{const pe=le==null?void 0:le.shape;return pe==="question"||pe==="diamond"},"isDiamondNode"),I=new Map;for(const le of E.values())I.has(le.dstId)||I.set(le.dstId,new Set),I.get(le.dstId).add(le.dstSide);for(const le of E.values()){if(!_(a.get(le.srcId)))continue;const pe=I.get(le.srcId);if(!(pe!=null&&pe.has(le.srcSide)))continue;const Ce=M(le);if(pe.has(Ce)||(P.get(N(le.srcId,Ce))??0)>0)continue;const oe=P.get(N(le.srcId,le.srcSide))??0;P.set(N(le.srcId,le.srcSide),Math.max(0,oe-1)),P.set(N(le.srcId,Ce),1),le.srcSide=Ce}for(const le of E.values()){const{edgeIdx:pe,srcId:Ce,dstId:oe,srcSide:fe,dstSide:W}=le,se=a.get(Ce),K=a.get(oe),de=`${Ce}:${fe}:src`,X=fe==="top"||fe==="bottom"?K.x??0:K.y??0;k.has(de)||k.set(de,[]),k.get(de).push({edgeIdx:pe,oppositeCoord:X});const Fe=`${oe}:${W}:dst`,ke=W==="top"||W==="bottom"?se.x??0:se.y??0;k.has(Fe)||k.set(Fe,[]),k.get(Fe).push({edgeIdx:pe,oppositeCoord:ke})}const O=new Map,D=8;for(const[le,pe]of k){if(pe.length<2)continue;pe.sort((Ke,Be)=>Ke.oppositeCoord-Be.oppositeCoord);const Ce=le.split(":"),oe=Ce.slice(0,-2).join(":"),fe=Ce[Ce.length-2],W=Ce[Ce.length-1],se=a.get(oe);if(!se)continue;const de=fe==="left"||fe==="right"?se.height??10:se.width??10,X=se.shape,ke=X==="question"||X==="diamond"?de*.3:de,Ie=Math.min(20,Math.max(D,ke/(pe.length+1))),De=-(Ie*(pe.length-1))/2;for(const[Ke,Be]of pe.entries()){const nt=De+Ke*Ie,Le=`${Be.edgeIdx}:${W}`;O.set(Le,nt)}}const $=w(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),F=w((le,pe)=>le?(k.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Ce})=>$(Ce))||(k.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Ce})=>$(Ce)):!1,"faceHasLabelNode"),z=w((le,pe,Ce)=>pe==="top"||pe==="bottom"?{x:le.x+Ce,y:le.y}:{x:le.x,y:le.y+Ce},"applyPortOffset"),H=w((le,pe,Ce)=>{const oe=E.get(le),fe={x:Ce.x??0,y:Ce.y??0},W={x:pe.x??0,y:pe.y??0},se=(oe==null?void 0:oe.srcSide)??C(pe,fe),K=(oe==null?void 0:oe.dstSide)??C(Ce,W);let de=oe?f(pe,oe.srcSide):p(pe,fe,!0),X=oe?f(Ce,oe.dstSide):p(Ce,W,!1);const Fe=O.get(`${le}:src`),ke=O.get(`${le}:dst`);return Fe!==void 0&&(de=z(de,se,Fe)),ke!==void 0&&(X=z(X,K,ke)),{pSrcPort:de,pDstPort:X,srcSide:se,dstSide:K}},"portsForEdge");for(const le of b){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Ce=a.get(pe.start),oe=a.get(pe.end);if(!Ce||!oe)continue;const{pSrcPort:fe,pDstPort:W,srcSide:se,dstSide:K}=H(le,Ce,oe),de={...fe},X={...W},Fe=se==="top"||se==="bottom",ke=K==="top"||K==="bottom";if(Fe){const st=fe.y>(Ce.y??0);de.y=st?fe.y+Hc:fe.y-Hc}else{const st=fe.x>(Ce.x??0);de.x=st?fe.x+Hc:fe.x-Hc}if(ke){const st=W.y>(oe.y??0);X.y=st?W.y+Hc:W.y-Hc}else{const st=W.x>(oe.x??0);X.x=st?W.x+Hc:W.x-Hc}const Ye=w((st,vt)=>{for(const jt of h)if(!vt.includes(jt.nodeId)&&st.x>jt.minX&&st.xjt.minY&&st.y{if(dn){const Mt=st.y>(vt.y??0);return{x:(jt.x??0)>=st.x?Mr.maxX+Zg:Mr.minX-Zg,y:Mt?Mr.maxY+Mv:Mr.minY-Mv,leavesPositiveSide:Mt}}const Et=st.x>(vt.x??0),ft=(jt.y??0)>=st.y;return{x:Et?Mr.maxX+Zg:Mr.minX-Zg,y:ft?Mr.maxY+Mv:Mr.minY-Mv,leavesPositiveSide:Et}},"obstacleDetour");let ze=[];const De=[pe.start,pe.end],Ke=Ye(de,De);if(Ke.inside&&Ke.obstacle){const st=Ke.obstacle;if(Fe){const vt=Ie(fe,Ce,oe,st,!0);de.x=vt.x,de.y=vt.y;const jt=vt.leavesPositiveSide?Math.min(st.minY-2,fe.y+Hc):Math.max(st.maxY+2,fe.y-Hc);ze=[{x:fe.x,y:jt},{x:vt.x,y:jt},{x:vt.x,y:vt.y}]}else{const vt=Ie(fe,Ce,oe,st,!1),jt=vt.leavesPositiveSide?Math.min(st.minX-2,fe.x+Hc):Math.max(st.maxX+2,fe.x-Hc);de.x=vt.x,de.y=vt.y,ze=[{x:jt,y:fe.y},{x:jt,y:vt.y},{x:vt.x,y:vt.y}]}}let Be=[];const nt=Ye(X,De);if(nt.inside&&nt.obstacle){const st=nt.obstacle;if(ke){const vt=Ie(W,oe,Ce,st,!0);X.x=vt.x,X.y=vt.y,Be=[{x:vt.x,y:vt.y},{x:W.x,y:vt.y}]}else{const vt=Ie(W,oe,Ce,st,!1);X.x=vt.x,X.y=vt.y,Be=[{x:vt.x,y:vt.y},{x:vt.x,y:W.y}]}}if(ze.length===0&&Be.length===0){const st=Zg,vt=Math.abs(de.x-X.x)1||Et>1,Mt=S.get(pe.start??"")??0,dt=S.get(pe.end??"")??0,ur=dn>1&&F(pe.start,se)||Et>1&&F(pe.end,K),Re=dn<=1||Mt<=2,Dn=Et<=1||dt<=2;if((vt||jt)&&!Mr&&(!ft||ft&&!ur&&Re&&Dn)&&!T(fe,W,pe.start,pe.end)){pe.points=[{...fe},{...de},{...X},{...W}],y.add(le);const On=jt?"horizontal":"vertical",Wa=jt?fe.y:fe.x,Mn=jt?Math.min(fe.x,W.x):Math.min(fe.y,W.y),Jn=jt?Math.max(fe.x,W.x):Math.max(fe.y,W.y),En={id:`fast-path-${On}-${Wa.toFixed(0)}-${le}`,orientation:On,coord:Wa,spanMin:Mn,spanMax:Jn,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:On,pipe:En,trackIndex:0,from:Mn,to:Jn});continue}}const Le=d("vertical",de.x,de.y,de.y);de.x=Le.coord;const pt=d("vertical",X.x,X.y,X.y);X.x=pt.coord;let Me=Math.min(de.x,X.x)-50,Ct=Math.max(de.x,X.x)+50,wt=Math.min(de.y,X.y)-50,ht=Math.max(de.y,X.y)+50;for(const st of h){const vt=Math.min(de.x,X.x),jt=Math.max(de.x,X.x),Mr=Math.min(de.y,X.y),dn=Math.max(de.y,X.y);st.minXvt&&st.minYMr&&(Me=Math.min(Me,st.minX-jA),Ct=Math.max(Ct,st.maxX+jA),wt=Math.min(wt,st.minY-jA),ht=Math.max(ht,st.maxY+jA))}for(const st of h){if(st.maxXCt||st.maxYht)continue;const vt=Zg;d("horizontal",st.minY-vt,Me,Ct),d("horizontal",st.maxY+vt,Me,Ct);const jt=Mv;d("vertical",st.minX-jt,wt,ht),d("vertical",st.maxX+jt,wt,ht)}d("horizontal",de.y,Me,Ct),d("horizontal",X.y,Me,Ct);const Bt=o.filter(st=>st.orientation==="horizontal"&&st.coord>=wt&&st.coord<=ht),At=o.filter(st=>st.orientation==="vertical"&&st.coord>=Me&&st.coord<=Ct),mt=w((st,vt)=>`${st.toFixed(1)},${vt.toFixed(1)}`,"getKey"),ye=mt(de.x,de.y),Nt=mt(X.x,X.y),yt=new Map,gt=new Map,St=new Map,tn=new Set,_e=[];yt.set(ye,0),St.set(ye,"n"),_e.push({key:ye,f:Math.hypot(X.x-de.x,X.y-de.y),pt:de}),tn.add(ye);let Je=[];const ut=w((st,vt)=>T(st,vt,pe.start,pe.end),"checkSegmentBlocked"),Dt={x:X.x,y:de.y},Kt=ut(de,Dt),Er=ut(Dt,X),yr=Kt||Er,qr={x:de.x,y:X.y},kr=ut(de,qr),rn=ut(qr,X);if(yr?kr||rn||(Math.abs(de.x-X.x)0;){_e.sort((dt,ur)=>dt.f-ur.f);const st=_e.shift();if(tn.delete(st.key),st.key===Nt){let dt=Nt,ur=X;for(Je=[ur];gt.has(dt);){const Re=gt.get(dt);Je.unshift(Re),ur=Re,dt=mt(Re.x,Re.y)}break}const vt=st.pt.x,jt=st.pt.y,Mr=At.sort((dt,ur)=>dt.coord-ur.coord),dn=Mr.findIndex(dt=>Math.abs(dt.coord-vt)<1),Et=Bt.sort((dt,ur)=>dt.coord-ur.coord),ft=Et.findIndex(dt=>Math.abs(dt.coord-jt)<1),Mt=[];dn>0&&Mt.push({x:Mr[dn-1].coord,y:jt}),dn>=0&&dn0&&Mt.push({x:vt,y:Et[ft-1].coord}),ft>=0&&ftTt.nodeId===pe.start||Tt.nodeId===pe.end?!1:ur!==Re?Tt.minYjt&&Tt.maxX>ur&&Tt.minXvt&&Tt.maxY>Dn&&Tt.minY10&&$d<-5||qs<-10&&$d>5)&&(Jn=Math.abs($d)*100),(En>10&&fh<-5||En<-10&&fh>5)&&(Jn+=Math.abs(fh)*50);let Fg=0;const Nd=St.get(st.key)??"n",Dd=Math.abs(fh)>vn?"h":"v";Nd!=="n"&&Nd!==Dd&&(Fg=50);const It=Wa+Mn+Jn+Fg,Ne=(yt.get(st.key)??1/0)+It,rt=Math.abs(X.x-dt.x)+Math.abs(X.y-dt.y);if(Ne<(yt.get(On)??1/0))if(gt.set(On,st.pt),yt.set(On,Ne),St.set(On,Dd),!tn.has(On))_e.push({key:On,f:Ne+rt,pt:dt}),tn.add(On);else{const Tt=_e.findIndex(ir=>ir.key===On);Tt!==-1&&(_e[Tt].f=Ne+rt)}}}if(Je.length===0&&(Je=[de,{x:de.x,y:X.y},X]),Je.length>4){const st=Je[0],vt=Je[Je.length-1];let jt=Math.min(st.x,vt.x),Mr=Math.max(st.x,vt.x),dn=Math.min(st.y,vt.y),Et=Math.max(st.y,vt.y);for(const Dn of Je)jt=Math.min(jt,Dn.x),Mr=Math.max(Mr,Dn.x),dn=Math.min(dn,Dn.y),Et=Math.max(Et,Dn.y);const ft=Mr>Math.max(st.x,vt.x),Mt=jtMn.minXPe&&Mn.minYon);if(Wa.length>0){let Mn=Math.max(st.x,vt.x);for(const Jn of Wa){const En=(Jn.minX+Jn.maxX)/2;if(Jn.visualXHalfExtent===void 0||isNaN(Jn.visualXHalfExtent))continue;const qs=En+Jn.visualXHalfExtent+Dn;Mn=Math.max(Mn,qs)}isNaN(Mn)||(Mr=Mn)}}if(Mt){const Pe=h.filter(on=>on.minXMath.min(st.y,vt.y));if(Pe.length>0){let on=Math.min(st.x,vt.x);for(const On of Pe){const Mn=(On.minX+On.maxX)/2-On.visualXHalfExtent-Dn;on=Math.min(on,Mn)}jt=on}}}const dt=w(Dn=>{const Pe=vt.y>st.y,on=h.filter(Mn=>{const Jn=Math.min(st.x,vt.x)Mn.minX,En=Math.min(st.y,vt.y)Mn.minY;return Jn&&En});let On=on;if(l&&on.length>0){const Mn=on.filter(Jn=>Jn.minXDn);Mn.length>0&&(On=Mn)}if(On.length===0)return vt.y;const Wa=Zg;if(Pe){const Jn=Math.max(...On.map(En=>En.maxY))+Wa;if(JnEn.minY))-Wa;if(Jn>vt.y+vn)return Jn}return vt.y},"findBestReturnY"),ur=w(Dn=>{const Pe=dt(Dn),on={x:Dn,y:st.y},On={x:Dn,y:Pe},Wa={x:vt.x,y:Pe},Mn=ut(st,on),Jn=ut(on,On),En=ut(On,Wa),qs=Pe!==vt.y?ut(Wa,vt):!1;return!Mn&&!Jn&&!En&&!qs?Math.abs(Pe-vt.y)=3){const st=zr[zr.length-1],vt=zr[zr.length-2],jt=zr[zr.length-3],Mr=Math.abs(jt.y-vt.y)Math.abs(st.x-jt.x)&&zr.splice(-2,1)}else if(dn){const Et=Math.sign(vt.y-jt.y),ft=Math.sign(st.y-jt.y);Et!==0&&Et===ft&&Math.abs(vt.y-jt.y)>Math.abs(st.y-jt.y)&&zr.splice(-2,1)}}const hn=[zr[0]];for(let st=1;stvt.x,Et=Mr.x>jt.x;if(dn!==Et){hn.push(jt);continue}continue}if(Math.abs(vt.x-jt.x)vt.y,Et=Mr.y>jt.y;if(dn!==Et){hn.push(jt);continue}continue}hn.push(jt)}hn.push(zr[zr.length-1]);for(let st=0;stle.from{const fe=!oe.segments.some(se=>(se.edgeIndex!==pe.edgeIndex||se.segmentIndex!==pe.segmentIndex)&&B(se,le)),W=!Ce.segments.some(se=>(se.edgeIndex!==le.edgeIndex||se.segmentIndex!==le.segmentIndex)&&B(se,pe));return fe&&W?(le.trackIndex=oe.index,pe.trackIndex=Ce.index,Ce.segments=[...Ce.segments.filter(se=>se.edgeIndex!==le.edgeIndex||se.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],oe.segments=[...oe.segments.filter(se=>se.edgeIndex!==pe.edgeIndex||se.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),q=w(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),G=w((le,pe)=>{const Ce=le.pipe.tracks[le.trackIndex];Ce.segments=Ce.segments.filter(fe=>fe.edgeIndex!==le.edgeIndex||fe.segmentIndex!==le.segmentIndex),le.trackIndex=pe,le.pipe.tracks[pe].segments.push({edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to})},"moveSegmentToTrack"),Q=w((le,pe)=>{const Ce=m[le.edgeIndex];for(const oe of Ce){const fe=g[oe];fe.pipe===le.pipe&&G(fe,pe)}},"moveSegmentChainToTrack"),j=w(le=>{const pe=m[le.edgeIndex],Ce=pe.indexOf(g.indexOf(le)),oe=[];return Ce>0&&oe.push(g[pe[Ce-1]]),Ce{if(le.orientation===pe.orientation)return!1;const Ce=le.orientation==="horizontal"?le:pe,oe=le.orientation==="horizontal"?pe:le;return oe.pipe.coord>Ce.from&&oe.pipe.coordoe.from&&Ce.pipe.coord{for(const Ce of le.tracks)if(!Ce.segments.some(fe=>(fe.edgeIndex!==pe.edgeIndex||fe.segmentIndex!==pe.segmentIndex)&&B(fe,pe)))return Ce.index;return-1},"findAvailableTrack"),J=w((le,pe)=>{if(le.trackIndex===pe.trackIndex)return B(le,pe);const Ce=j(le),oe=j(pe);return Ce.some(fe=>oe.some(W=>ae(fe,W)))},"segmentsConflict"),re=w((le,pe,Ce)=>{if(V(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const oe=Z(le.pipe,pe);Ce(pe,oe!==-1?oe:q(le.pipe))},"resolveTrackConflict"),ee=w(le=>{let pe=0;for(let Ce=0;Ce{if(me.has(le))return me.get(le);const pe=m[le];if(pe.length===0){const K={dest:0,deviation:0,base:0,delta:0};return me.set(le,K),K}const oe=g[pe[0]].pipe.coord;let fe=oe;for(let K=1;KMath.abs(Fe-oe)?X:Fe;break}}const W=Math.abs(fe-oe),se={dest:fe,deviation:W,base:oe,delta:fe-oe};return me.set(le,se),se},"getDestInfo"),$e=w(()=>{let le=0;const pe=new Map;for(const[oe,fe]of i.entries())m[oe].length!==0&&fe.start&&(pe.has(fe.start)||pe.set(fe.start,[]),pe.get(fe.start).push(oe));const Ce=w(oe=>{const fe=i[oe];if(!fe.start||!fe.end)return 0;const W=a.get(fe.start),se=a.get(fe.end);if(!W||!se)return 0;const K=(se.x??0)-(W.x??0),de=(se.y??0)-(W.y??0);return Math.abs(K)+Math.abs(de)},"getEdgeDistance");for(const oe of pe.values()){oe.sort((W,se)=>{const K=te(W),de=te(se);if(Math.abs(K.deviation-de.deviation)>1)return K.deviation-de.deviation;if(Math.abs(K.dest-de.dest)>1)return K.dest-de.dest;const X=Ce(W),Fe=Ce(se);if(Math.abs(X-Fe)>1)return Fe-X;const ke=m[W].length,Ye=m[se].length;if(ke!==Ye)return ke-Ye;if(ke===1){const Ie=m[W][0],ze=m[se][0];if(g[Ie]&&g[ze]){const De=g[Ie],Ke=g[ze],Be=Math.abs(De.to-De.from),nt=Math.abs(Ke.to-Ke.from);if(Math.abs(Be-nt)>1)return Be-nt}}return 0});const fe=oe.map(W=>g[m[W][0]]);le+=ee(fe)}return le},"fixSourceHandleCrossings"),Oe=w(()=>{let le=0;const pe=new Map;for(const[Ce,oe]of i.entries())m[Ce].length!==0&&oe.end&&(pe.has(oe.end)||pe.set(oe.end,[]),pe.get(oe.end).push(Ce));for(const Ce of pe.values()){Ce.sort((fe,W)=>{const se=w(X=>{const Fe=m[X];if(Fe.length<2)return 0;const ke=g[Fe[Fe.length-2]];return Math.abs(ke.to-ke.from)},"getDist"),K=se(fe),de=se(W);return Math.abs(K-de)>.1?K-de:fe-W});const oe=Ce.map(fe=>g[m[fe][m[fe].length-1]]);le+=ee(oe)}return le},"fixTargetHandleCrossings"),He=w(()=>{let le=0;for(const pe of o){const Ce=[];for(const oe of pe.tracks)for(const fe of oe.segments){const W=m[fe.edgeIndex].find(se=>g[se].segmentIndex===fe.segmentIndex);W!==void 0&&Ce.push(g[W])}Ce.sort((oe,fe)=>oe.edgeIndex-fe.edgeIndex||oe.segmentIndex-fe.segmentIndex);for(let oe=0;oe{oe.segments.forEach(fe=>{pe.push({edgeIndex:fe.edgeIndex,segmentIndex:fe.segmentIndex,trackIndex:oe.index,from:fe.from,to:fe.to})})}),pe.sort((oe,fe)=>oe.from-fe.from);const Ce=[];if(pe.length>0){let oe=[pe[0]],fe=pe[0].to;for(let W=1;Wfe.add(Ie.trackIndex));const W=new Map;oe.forEach(Ie=>{const ze=te(Ie.edgeIndex);W.set(Ie.trackIndex,(W.get(Ie.trackIndex)??0)+ze.delta)});const se=[...fe].filter(Ie=>(W.get(Ie)??0)<-1),K=[...fe].filter(Ie=>(W.get(Ie)??0)>1),de=[...fe].filter(Ie=>Math.abs(W.get(Ie)??0)<=1);se.sort((Ie,ze)=>(W.get(ze)??0)-(W.get(Ie)??0)),K.sort((Ie,ze)=>(W.get(Ie)??0)-(W.get(ze)??0));const X=w((Ie,ze)=>{oe.filter(De=>De.trackIndex===Ie).forEach(De=>{const Ke=y.has(De.edgeIndex)?le.coord:ze;Te.set(`${De.edgeIndex}-${De.segmentIndex}`,Ke)})},"assignCoord");let Fe=0;for(const Ie of se)Fe++,X(Ie,le.coord-Fe*pF);if(de.length===0&&fe.size>0){const Ie=[...fe].sort((Ke,Be)=>Math.abs(W.get(Ke)??0)-Math.abs(W.get(Be)??0))[0],ze=se.indexOf(Ie);ze!==-1&&se.splice(ze,1);const De=K.indexOf(Ie);De!==-1&&K.splice(De,1),de.push(Ie)}let ke=0;for(const Ie of de){if(ke===0)X(Ie,le.coord);else{const ze=ke%2===1?1:-1,De=Math.ceil(ke/2);X(Ie,le.coord+ze*De*pF*.5)}ke++}let Ye=0;for(const Ie of K)Ye++,X(Ie,le.coord+Ye*pF)}}for(const[le,pe]of i.entries()){const Ce=m[le]??[];if(Ce.length===0)continue;const oe=[],fe=a.get(pe.start),W=a.get(pe.end),{pSrcPort:se,pDstPort:K}=H(le,fe,W),de=Ce.map(ke=>{const Ye=g[ke],Ie=Te.get(`${Ye.edgeIndex}-${Ye.segmentIndex}`)??Ye.pipe.coord;return{orient:Ye.orientation,coord:Ie,from:Ye.from,to:Ye.to}});oe.push(se);for(let ke=0;kevn&&oe.push(hm(Ye,ze)),Be&&Ke.orient===Ye.orient)if(Math.abs(Ye.coord-Ke.coord)>vn){const nt=Ye.orient==="vertical"?(ze+Ke.from)/2:WG(Ye,Ke);oe.push(hm(Ye,nt),hm(Ke,nt))}else(ke===0||ke===de.length-2)&&oe.push(hm(Ye,WG(Ye,Ke)));else if(Be)oe.push(hm(Ye,Ke.coord));else{const nt=Math.abs(Ye.from-ze)vn||Math.abs(X.y-K.y)>vn)&&oe.push(K);const Fe=[];oe.length>0&&Fe.push(oe[0]);for(let ke=1;kevn||Math.abs(Ye.y-Ie.y)>vn)&&Fe.push(Ye)}pe.points=Fe}for(const le of i){const pe=le.__originalEdge;pe&&le.points&&(pe.points=le.points)}t.edges=(t.edges??[]).filter(le=>!le.isLayoutOnly);const ge=w((le,pe)=>{const Ce=pe.x??0,oe=pe.y??0,fe=pe.width??0,W=pe.height??0;if(fe<=0||W<=0)return le;const se=Ce-fe/2,K=Ce+fe/2,de=oe-W/2,X=oe+W/2;if(le.xK||le.yX)return le;const Fe=le.x-se,ke=K-le.x,Ye=le.y-de,Ie=X-le.y,ze=Math.min(Fe,ke,Ye,Ie);return ze===Fe?{x:se,y:le.y}:ze===ke?{x:K,y:le.y}:ze===Ye?{x:le.x,y:de}:{x:le.x,y:X}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Ce=le.start,oe=le.end,fe=Ce?a.get(Ce):void 0,W=oe?a.get(oe):void 0;fe&&(pe[0]=ge(pe[0],fe)),W&&(pe[pe.length-1]=ge(pe[pe.length-1],W))}return t}w(q9e,"routeEdgesOrthogonal");function G9e(t){return t.direction??"TB"}w(G9e,"getSwimlaneDirection");function U9e(t){var h,d,f,p,g;const e=R_e(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=G9e(t),{ordered:l,coordinates:u}=W9e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});__e(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;q9e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return o9e(t,o),s9e(t),o}w(U9e,"runSwimlaneLayoutCore");async function Y9e(t,e){const r=e.select("g");pZ(r,t.markers,t.type,t.diagramId),E5e(),R5e(),ake(),GRe(),A_e(t);const n=M_e(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await f_e(r,t);U9e(t),await C_e(t,i)}w(Y9e,"render");const $Bt=Object.freeze(Object.defineProperty({__proto__:null,render:Y9e},Symbol.toStringTag,{value:"Module"}));function qG(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 j9e(t,e,r){return(e=X9e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PBt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function BBt(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 FBt(){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 zBt(){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 Ga(t,e){return NBt(t)||BBt(t,e)||ZJ(t,e)||FBt()}function $L(t){return DBt(t)||PBt(t)||ZJ(t)||zBt()}function HBt(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 X9e(t){var e=HBt(t,"string");return typeof e=="symbol"?e:e+""}function bs(t){"@babel/helpers - typeof";return bs=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},bs(t)}function ZJ(t,e){if(t){if(typeof t=="string")return qG(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)?qG(t,e):void 0}}var ls=typeof window>"u"?null:window,wfe=ls?ls.navigator:null;ls&&ls.document;var VBt=bs(""),K9e=bs({}),WBt=bs(function(){}),qBt=typeof HTMLElement>"u"?"undefined":bs(HTMLElement),BE=function(e){return e&&e.instanceString&&ua(e.instanceString)?e.instanceString():null},Ar=function(e){return e!=null&&bs(e)==VBt},ua=function(e){return e!=null&&bs(e)===WBt},yi=function(e){return!xc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},zn=function(e){return e!=null&&bs(e)===K9e&&!yi(e)&&e.constructor===Object},GBt=function(e){return e!=null&&bs(e)===K9e},Zt=function(e){return e!=null&&bs(e)===bs(1)&&!isNaN(e)},UBt=function(e){return Zt(e)&&Math.floor(e)===e},NL=function(e){if(qBt!=="undefined")return e!=null&&e instanceof HTMLElement},xc=function(e){return FE(e)||Z9e(e)},FE=function(e){return BE(e)==="collection"&&e._private.single},Z9e=function(e){return BE(e)==="collection"&&!e._private.single},QJ=function(e){return BE(e)==="core"},Q9e=function(e){return BE(e)==="stylesheet"},YBt=function(e){return BE(e)==="event"},eg=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},jBt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},XBt=function(e){return zn(e)&&Zt(e.x1)&&Zt(e.x2)&&Zt(e.y1)&&Zt(e.y2)},KBt=function(e){return GBt(e)&&ua(e.then)},ZBt=function(){return wfe&&wfe.userAgent.match(/msie|trident|edge/i)},e3=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},iFt=function(e,r){return-1*eMe(e,r)},Pr=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("^"+eFt+"$").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},oFt=function(e){var r,n=new RegExp("^"+QBt+"$").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},lFt=function(e){return cFt[e.toLowerCase()]},tMe=function(e){return(yi(e)?e:null)||lFt(e)||aFt(e)||oFt(e)||sFt(e)},cFt={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]},rMe=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||_<0||x&&I>=f}function E(){var N=e();if(C(N))return A(N);g=setTimeout(E,S(N))}function A(N){return g=void 0,b&&h?T(N):(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:A(e())}function P(){var N=e(),_=C(N);if(h=arguments,d=this,m=N,_){if(g===void 0)return k(m);if(x)return clearTimeout(g),g=setTimeout(E,l),T(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=L,P}return RF=s,RF}var bFt=vFt(),WE=zE(bFt),_F=ls?ls.performance:null,aMe=_F&&_F.now?function(){return _F.now()}:function(){return Date.now()},xFt=(function(){if(ls){if(ls.requestAnimationFrame)return function(t){ls.requestAnimationFrame(t)};if(ls.mozRequestAnimationFrame)return function(t){ls.mozRequestAnimationFrame(t)};if(ls.webkitRequestAnimationFrame)return function(t){ls.webkitRequestAnimationFrame(t)};if(ls.msRequestAnimationFrame)return function(t){ls.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(aMe())},1e3/60)}})(),DL=function(e){return xFt(e)},Xf=aMe,Mm=9261,sMe=65599,f2=5381,oMe=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mm,n=r,i;i=e.next(),!i.done;)n=n*sMe+i.value|0;return n},g6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mm;return r*sMe+e|0},m6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f2;return(r<<5)+r+e|0},wFt=function(e,r){return e*2097152+r},F0=function(e){return e[0]*2097152+e[1]},KA=function(e,r){return[g6(e[0],r[0]),m6(e[1],r[1])]},Pfe=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)},nee=function(e){e.splice(0,e.length)},LFt=function(e,r){for(var n=0;n"u"?"undefined":bs(Set))!==$Ft?Set:NFt,ZN=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!QJ(e)){Ji("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"){Ji("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 U3,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=[];yi(r.classes)?u=r.classes:Ar(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hx?1:0},h=function(v,x,b,T,k){var S;if(b==null&&(b=0),k==null&&(k=n),b<0)throw new Error("lo must be non-negative");for(T==null&&(T=v.length);bM;0<=M?A++:A--)E.push(A);return E}).apply(this).reverse(),C=[],T=0,k=S.length;TL;0<=L?++E:--E)P.push(s(v,b));return P},m=function(v,x,b,T){var k,S,C;for(T==null&&(T=n),k=v[b];b>x;){if(C=b-1>>1,S=v[C],T(k,S)<0){v[b]=S,b=C;continue}break}return v[b]=k},y=function(v,x,b){var T,k,S,C,E;for(b==null&&(b=n),k=v.length,E=x,S=v[x],T=2*x+1;T0;){var S=x.pop(),C=y(S),E=S.id();if(f[E]=C,C!==1/0)for(var A=S.neighborhood().intersect(g),M=0;M0)for($.unshift(D);d[z];){var H=d[z];$.unshift(H.edge),$.unshift(H.node),F=H.node,z=F.id()}return o.spawn($)}}}},HFt={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(T){for(var k=0;k0;){if(k(),C++,T===h){for(var E=[],A=a,M=h,L=v[M];E.unshift(A),L!=null&&E.unshift(L),A=y[M],A!=null;)M=A.id(),L=v[M];return{found:!0,distance:d[T],path:this.spawn(E),steps:C}}p[T]=!0;for(var P=b._private.edges,N=0;NL&&(g[M]=L,x[M]=A,b[M]=k),!a){var P=A*h+E;!a&&g[P]>L&&(g[P]=L,x[P]=E,b[P]=k)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:s,Te=b(ue),ge=[],Ve=Te;;){if(Ve==null)return r.spawn();var we=x(Ve),Ae=we.edge,Ue=we.pred;if(ge.unshift(Ve[0]),Ve.same(ce)&&ge.length>0)break;Ae!=null&&ge.unshift(Ae),Ve=Ue}return l.spawn(ge)},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=XFt(a,e,r),n--}return r},KFt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function($){return $.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/jFt);if(a<2){Ji("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},rzt=function(e){return Math.PI*e/180},ZA=function(e,r){return Math.atan2(r,e)-Math.PI/2},iee=Math.log2||function(t){return Math.log(t)/Math.log(2)},aee=function(e){return e>0?1:e<0?-1:0},uy=function(e,r){return Math.sqrt(dm(e,r))},dm=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},nzt=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}}},azt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},szt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},ozt=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},pMe=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},CR=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},SR=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=Ga(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},Wfe=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},see=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},wp=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},qfe=function(e,r){return wp(e,r.x,r.y)},gMe=function(e,r){return wp(e,r.x1,r.y1)&&wp(e,r.x2,r.y2)},lzt=(IF=Math.hypot)!==null&&IF!==void 0?IF:function(t,e){return Math.sqrt(t*t+e*e)};function czt(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,A){return{x:E.x+A.x,y:E.y+A.y}},n=function(E,A){return{x:E.x-A.x,y:E.y-A.y}},i=function(E,A){return{x:E.x*A,y:E.y*A}},a=function(E,A){return E.x*A.y-E.y*A.x},s=function(E){var A=lzt(E.x,E.y);return A===0?{x:0,y:0}:{x:E.x/A,y:E.y/A}},o=function(E){for(var A=0,M=0;M7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?rg(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,x=y;if(g=Tp(e,r,n,i,m,y,v,x,!1),g.length>0)return g}if(p){var b=n+h+o,T=i-d+u-o,k=b,S=i+d-u+o;if(g=Tp(e,r,n,i,b,T,k,S,!1),g.length>0)return g}if(f){var C=n-h+u-o,E=i+d+o,A=n+h-u+o,M=E;if(g=Tp(e,r,n,i,C,E,A,M,!1),g.length>0)return g}if(p){var L=n-h-o,P=i-d+u-o,N=L,_=i+d-u+o;if(g=Tp(e,r,n,i,L,P,N,_,!1),g.length>0)return g}var I;{var O=n-h+u,D=i-d+u;if(I=P5(e,r,n,i,O,D,u+o),I.length>0&&I[0]<=O&&I[1]<=D)return[I[0],I[1]]}{var $=n+h-u,F=i-d+u;if(I=P5(e,r,n,i,$,F,u+o),I.length>0&&I[0]>=$&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,H=i+d-u;if(I=P5(e,r,n,i,z,H,u+o),I.length>0&&I[0]>=z&&I[1]>=H)return[I[0],I[1]]}{var B=n-h+u,V=i+d-u;if(I=P5(e,r,n,i,B,V,u+o),I.length>0&&I[0]<=B&&I[1]>=V)return[I[0],I[1]]}return[]},hzt=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},dzt=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)},fzt=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]},pzt=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)},gzt=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=[];pzt(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,x,b,T,k=0;k=0?Tu?(e-a)*(e-a)+(r-s)*(r-s):h-f},Hl=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},Kf=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=BL(h,-u);m=PL(y)}else m=h;return Hl(e,r,m)},yzt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&x.push(y),v>=0&&v<=1&&x.push(v),x.length===0)return[];var b=x[0]*l[0]+e,T=x[0]*l[1]+r;if(x.length>1){if(x[0]==x[1])return[b,T];var k=x[1]*l[0]+e,S=x[1]*l[1]+r;return[b,T,k,S]}else return[b,T]},$F=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Tp=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,x=m*d-f*g;if(x!==0){var b=y/x,T=v/x,k=.001,S=0-k,C=1+k;return S<=b&&b<=C&&S<=T&&T<=C?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?$F(e,n,o)===o?[o,l]:$F(e,n,a)===a?[a,s]:$F(a,o,n)===n?[n,i]:[]:[]},bzt=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=BL(d,-l);p=PL(m)}else p=d}else p=n;for(var y,v,x,b,T=0;T2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=T)},get:function(b){return u[b]}},f=0;f0?I=_.edgesTo(N)[0]:I=N.edgesTo(_)[0];var O=i(I);N=N.id(),C[N]>C[L]+O&&(C[N]=C[L]+O,E.nodes.indexOf(N)<0?E.push(N):E.updateItem(N),S[N]=0,k[N]=[]),C[N]==C[L]+O&&(S[N]=S[N]+S[L],k[N].push(L))}else for(var D=0;D0;){for(var H=T.pop(),B=0;B0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},Nzt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:Pzt,o=i,l,u,h=0;h=2?Ok(e,r,n,0,Xfe,Bzt):Ok(e,r,n,0,jfe)},squaredEuclidean:function(e,r,n){return Ok(e,r,n,0,Xfe)},manhattan:function(e,r,n){return Ok(e,r,n,0,jfe)},max:function(e,r,n){return Ok(e,r,n,-1/0,Fzt)}};t3["squared-euclidean"]=t3.squaredEuclidean;t3.squaredeuclidean=t3.squaredEuclidean;function JN(t,e,r,n,i,a){var s;return ua(t)?s=t:s=t3[t]||t3.euclidean,e===0&&ua(t)?s(i,a):s(e,r,n,i,a)}var zzt=mo({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),lee=function(e){return zzt(e)},FL=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 JN(e,i.length,o,l,u,h)},DF=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},Wzt=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][x.key]&&(l=n[m.key][x.key])):a.linkage==="max"?(l=n[g.key][x.key],n[g.key][x.key]0&&i.push(a);return i},t0e=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=t0e(e,r,n),i},r0e=function(e){for(var r=this.cy(),n=this.nodes(),i=tHt(e),a={},s=0;s=L?(P=L,L=_,N=I):_>P&&(P=_);for(var O=0;O0?1:0;C[A%i.minIterations*o+B]=V,H+=V}if(H>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var q=0,G=0;G1||S>1)&&(o=!0),d[b]=[],x.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,x.target().id()]}):s.forEach(function(x){var b=x.id();if(x.isNode()){var T=x.degree(!0);T%2&&(l?u?o=!0:u=b:l=b),d[b]=[],x.connectedEdges().forEach(function(k){return d[b].push(k.id())})}else f[b]=[x.source().id(),x.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 T=b,k=[b],S,C,E;d[T].length;)S=d[T].shift(),C=f[S][0],E=f[S][1],T!=E?(d[E]=d[E].filter(function(A){return A!=S}),T=E):!a&&T!=C&&(d[C]=d[C].filter(function(A){return A!=S}),T=C),k.unshift(S),k.unshift(T);return k},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}},JA=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 x=v.connectedNodes().intersection(e);y.merge(v),x.forEach(function(b){var T=b.id(),k=b.connectedEdges().intersection(e);y.merge(b),r[T].cutVertex?y.merge(k.filter(function(S){return S.isLoop()})):y.merge(k)})}),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,x,b;m.forEach(function(T){y=T.source().id(),v=T.target().id(),x=y===p?v:y,x!==g&&(b=T.id(),o[b]||(o[b]=!0,s.push({x:p,y:x,edge:T})),x in r?r[p].low=Math.min(r[p].low,r[x].id):(u(f,x,p),r[p].low=Math.min(r[p].low,r[x].low),r[p].id<=r[x].low&&(r[p].cutVertex=!0,l(p,x))))})}};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}},cHt={hopcroftTarjanBiconnected:JA,htbc:JA,htb:JA,hopcroftTarjanBiconnectedComponents:JA},e8=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}},uHt={tarjanStronglyConnected:e8,tsc:e8,tscc:e8,tarjanStronglyConnectedComponents:e8},kMe={};[y6,zFt,HFt,WFt,GFt,YFt,KFt,kzt,xb,wb,YG,Ozt,Xzt,Jzt,sHt,lHt,cHt,uHt].forEach(function(t){Pr(kMe,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 wMe=0,TMe=1,kMe=2,nh=function(e){if(!(this instanceof nh))return new nh(e);this.id="Thenable/1.0.7",this.state=wMe,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))};nh.prototype={fulfill:function(e){return r0e(this,TMe,"fulfillValue",e)},reject:function(e){return r0e(this,kMe,"rejectReason",e)},then:function(e,r){var n=this,i=new nh;return n.onFulfilled.push(i0e(e,i,"fulfill")),n.onRejected.push(i0e(r,i,"reject")),CMe(n),i.proxy}};var r0e=function(e,r,n,i){return e.state===wMe&&(e.state=r,e[n]=i,CMe(e)),e},CMe=function(e){e.state===TMe?n0e(e,"onFulfilled",e.fulfillValue):e.state===kMe&&n0e(e,"onRejected",e.rejectReason)},n0e=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 tz=e,tz}var rz,A0e;function kHt(){if(A0e)return rz;A0e=1;var t=eD();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 rz=e,rz}var nz,R0e;function CHt(){if(R0e)return nz;R0e=1;var t=bHt(),e=xHt(),r=wHt(),n=THt(),i=kHt();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){yi(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}};SR.className=SR.classNames=SR.classes;var Pn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:fs,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Pn.variable="(?:[\\w-.]|(?:\\\\"+Pn.metaChar+"))+";Pn.className="(?:[\\w-]|(?:\\\\"+Pn.metaChar+"))+";Pn.value=Pn.string+"|"+Pn.number;Pn.id=Pn.variable;(function(){var t,e,r;for(t=Pn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Pn.comparatorOp+="|\\!"+e)})();var di=function(){return{checks:[]}},hr={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},XG=[{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 QBt(t.selector,e.selector)}),tVt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return ii("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return ii("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&ii("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},oVt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Ar(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case hr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case hr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case hr.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case hr.DATA_EXIST:{var b=h.field;return"["+b+"]"}case hr.META_COMPARE:{var T=h.operator,k=h.field;return"[["+k+n(e(T))+r(p)+"]]"}case hr.STATE:return p;case hr.ID:return"#"+p;case hr.CLASS:return"."+p;case hr.PARENT:case hr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case hr.ANCESTOR:case hr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case hr.COMPOUND_SPLIT:{var S=a(h.left,d),C=a(h.subject,d),E=a(h.right,d);return S+(S.length>0?" ":"")+C+E}case hr.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 IMe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return uee(this,t,e,IMe)};function $Me(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}r3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uee(this,t,e,$Me)};function gVt(t,e,r){$Me(t,e,r),IMe(t,e,r)}r3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return uee(this,t,e,gVt)};r3.ancestors=r3.parents;var b6,NMe;b6=NMe={data:ri.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:ri.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ri.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ri.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ri.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ri.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};b6.attr=b6.data;b6.removeAttr=b6.removeData;var mVt=NMe,rD={};function Lz(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:Iv("indegree",function(t,e){return te}),minOutdegree:Iv("outdegree",function(t,e){return te})});Pr(rD,{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 x=v?m.position():{x:0,y:0};return a={x:g.x-x.x,y:g.y-x.y},e===void 0?a:a[e]}else if(!s)return;return this}};Xu.modelPosition=Xu.point=Xu.position;Xu.modelPositions=Xu.points=Xu.positions;Xu.renderedPoint=Xu.renderedPosition;Xu.relativePoint=Xu.relativePosition;var yVt=DMe,n3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},i3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},vVt=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"}},Tb,Rg;Tb=Rg={};Rg.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}};Rg.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)};Rg.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(A,M,L){var P=0,N=0,_=M+L;return A>0&&_>0&&(P=M/_*A,N=L/_*A),{biasDiff:P,biasComplementDiff:N}}function g(A,M,L,P){if(L.units==="%")switch(P){case"width":return A>0?L.pfValue*A:0;case"height":return M>0?L.pfValue*M:0;case"average":return A>0&&M>0?L.pfValue*(A+M)/2:0;case"min":return A>0&&M>0?A>M?L.pfValue*M:L.pfValue*A:0;case"max":return A>0&&M>0?A>M?L.pfValue*A: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 x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),T=b.biasDiff,k=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),C=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=(-T+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+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)},ep=function(e,r){return r==null?e:_u(e,r.x1,r.y1,r.x2,r.y2)},Pk=function(e,r,n){return Jo(e,r,n)},e8=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,kR(d,1),_u(e,d.x1,d.y1,d.x2,d.y2)}}},Iz=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=Pk(s,"labelWidth",n),d=Pk(s,"labelHeight",n),f=Pk(s,"labelX",n),p=Pk(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"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,T=b/2,k=r.pstyle("text-background-padding").pfValue,S=2,C=d,E=h,A=E/2,M=C/2,L,P,N,_;if(y)L=f-A,P=f+A,N=p-M,_=p+M;else{switch(n3(l.value)){case"left":L=f-E,P=f;break;case"center":L=f-A,P=f+A;break;case"right":L=f,P=f+E;break}switch(i3(u.value)){case"top":N=p-C,_=p;break;case"center":N=p-M,_=p+M;break;case"bottom":N=p,_=p+C;break}}var I=g-Math.max(x,T)-k-S,O=g+Math.max(x,T)+k+S,D=m-Math.max(x,T)-k-S,$=m+Math.max(x,T)+k+S;L+=I,P+=O,N+=D,_+=$;var F=n||"main",z=a.labelBounds,H=z[F]=z[F]||{};H.x1=L,H.y1=N,H.x2=P,H.y2=_,H.w=P-L,H.h=_-N,H.leftPad=I,H.rightPad=O,H.topPad=D,H.botPad=$;var B=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(B||V){var q=B?Pk(a.rstyle,"labelAngle",n):v.pfValue,G=Math.cos(q),Q=Math.sin(q),j=(L+P)/2,ae=(N+_)/2;if(!y){switch(n3(l.value)){case"left":j=P;break;case"right":j=L;break}switch(i3(u.value)){case"top":ae=_;break;case"bottom":ae=N;break}}var Z=function(He,ue){return He=He-j,ue=ue-ae,{x:He*G-ue*Q+j,y:He*Q+ue*G+ae}},J=Z(L,N),re=Z(L,_),ee=Z(P,N),me=Z(P,_);L=Math.min(J.x,re.x,ee.x,me.x),P=Math.max(J.x,re.x,ee.x,me.x),N=Math.min(J.y,re.y,ee.y,me.y),_=Math.max(J.y,re.y,ee.y,me.y)}var te=F+"Rot",$e=z[te]=z[te]||{};$e.x1=L,$e.y1=N,$e.x2=P,$e.y2=_,$e.w=P-L,$e.h=_-N,_u(e,L,N,P,_),_u(a.labelBounds.all,L,N,P,_)}return e}},npe=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;PMe(e,r,n,s,"outside",s/2)}},PMe=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);ep(e,m)}else s!=null&&s>0&&CR(e,[s,s,s,s])}}},bVt=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;PMe(e,r,n,i,a)}},xVt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=vl(),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],x=function(Oe){return Oe.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var T=0,k=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(k=e.pstyle("overlay-padding").value));var S=0,C=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(C=e.pstyle("underlay-padding").value));var E=Math.max(k,C),A=0,M=0;if(i&&(A=e.pstyle("width").pfValue,M=A/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var P=e.outerWidth(),N=P/2,_=e.outerHeight(),I=_/2;h=g-N,d=g+N,f=m-I,p=m+I,_u(s,h,f,d,p),i&&npe(s,e),i&&r.includeOutlines&&!a&&npe(s,e),i&&bVt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var O=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,_u(s,h,f,d,p),O==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var $=h;h=d,d=$}if(f>p){var F=f;f=p,p=F}_u(s,h-M,f-M,d+M,p+M)}}else if(O==="bezier"||O==="unbundled-bezier"||xp(O,"segments")||xp(O,"taxi")){var z;switch(O){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 H=0;Hd){var j=h;h=d,d=j}if(f>p){var ae=f;f=p,p=ae}h-=M,d+=M,f-=M,p+=M,_u(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(e8(s,e,"mid-source"),e8(s,e,"mid-target"),e8(s,e,"source"),e8(s,e,"target")),i){var Z=e.pstyle("ghost").value==="yes";if(Z){var J=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;_u(s,s.x1+J,s.y1+re,s.x2+J,s.y2+re)}}var ee=o.bodyBounds=o.bodyBounds||{};Vfe(ee,s),CR(ee,v),kR(ee,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,_u(s,h-E,f-E,d+E,p+E));var me=o.overlayBounds=o.overlayBounds||{};Vfe(me,s),CR(me,v),kR(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?ezt(te.all):te.all=vl(),i&&r.includeLabels&&(r.includeMainLabels&&Iz(s,e,null),u&&(r.includeSourceLabels&&Iz(s,e,"source"),r.includeTargetLabels&&Iz(s,e,"target")))}return s.x1=Qc(s.x1),s.y1=Qc(s.y1),s.x2=Qc(s.x2),s.y2=Qc(s.y2),s.w=Qc(s.x2-s.x1),s.h=Qc(s.y2-s.y1),s.w>0&&s.h>0&&b&&(CR(s,v),kR(s,1)),s},BMe=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 nz=e,nz}var iz,R0e;function _Ht(){if(R0e)return iz;R0e=1;var t=rD();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 iz=e,iz}var az,_0e;function MHt(){if(_0e)return az;_0e=1;var t=SHt(),e=EHt(),r=AHt(),n=RHt(),i=_Ht();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){yi(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}};ER.className=ER.classNames=ER.classes;var Pn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:fs,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Pn.variable="(?:[\\w-.]|(?:\\\\"+Pn.metaChar+"))+";Pn.className="(?:[\\w-]|(?:\\\\"+Pn.metaChar+"))+";Pn.value=Pn.string+"|"+Pn.number;Pn.id=Pn.variable;(function(){var t,e,r;for(t=Pn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Pn.comparatorOp+="|\\!"+e)})();var di=function(){return{checks:[]}},hr={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},ZG=[{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 iFt(t.selector,e.selector)}),oVt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return ii("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return ii("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&ii("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},fVt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Ar(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case hr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case hr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case hr.DATA_BOOL:{var v=h.operator,x=h.field;return"["+e(v)+x+"]"}case hr.DATA_EXIST:{var b=h.field;return"["+b+"]"}case hr.META_COMPARE:{var T=h.operator,k=h.field;return"[["+k+n(e(T))+r(p)+"]]"}case hr.STATE:return p;case hr.ID:return"#"+p;case hr.CLASS:return"."+p;case hr.PARENT:case hr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case hr.ANCESTOR:case hr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case hr.COMPOUND_SPLIT:{var S=a(h.left,d),C=a(h.subject,d),E=a(h.right,d);return S+(S.length>0?" ":"")+C+E}case hr.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 DMe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return dee(this,t,e,DMe)};function OMe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}r3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return dee(this,t,e,OMe)};function wVt(t,e,r){OMe(t,e,r),DMe(t,e,r)}r3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return dee(this,t,e,wVt)};r3.ancestors=r3.parents;var x6,PMe;x6=PMe={data:ri.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:ri.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:ri.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ri.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:ri.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:ri.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};x6.attr=x6.data;x6.removeAttr=x6.removeData;var TVt=PMe,iD={};function $z(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:Iv("indegree",function(t,e){return te}),minOutdegree:Iv("outdegree",function(t,e){return te})});Pr(iD,{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 x=v?m.position():{x:0,y:0};return a={x:g.x-x.x,y:g.y-x.y},e===void 0?a:a[e]}else if(!s)return;return this}};Xu.modelPosition=Xu.point=Xu.position;Xu.modelPositions=Xu.points=Xu.positions;Xu.renderedPoint=Xu.renderedPosition;Xu.relativePoint=Xu.relativePosition;var kVt=BMe,n3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},i3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},CVt=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"}},Tb,Rg;Tb=Rg={};Rg.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}};Rg.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)};Rg.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(A,M,L){var P=0,N=0,_=M+L;return A>0&&_>0&&(P=M/_*A,N=L/_*A),{biasDiff:P,biasComplementDiff:N}}function g(A,M,L,P){if(L.units==="%")switch(P){case"width":return A>0?L.pfValue*A:0;case"height":return M>0?L.pfValue*M:0;case"average":return A>0&&M>0?L.pfValue*(A+M)/2:0;case"min":return A>0&&M>0?A>M?L.pfValue*M:L.pfValue*A:0;case"max":return A>0&&M>0?A>M?L.pfValue*A: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 x=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var b=p(h.width.val-d.w,m,y),T=b.biasDiff,k=b.biasComplementDiff,S=p(h.height.val-d.h,v,x),C=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=(-T+d.x1+d.x2+k)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+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)},ep=function(e,r){return r==null?e:_u(e,r.x1,r.y1,r.x2,r.y2)},Pk=function(e,r,n){return Jo(e,r,n)},t8=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,CR(d,1),_u(e,d.x1,d.y1,d.x2,d.y2)}}},Nz=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=Pk(s,"labelWidth",n),d=Pk(s,"labelHeight",n),f=Pk(s,"labelX",n),p=Pk(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"),x=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,T=b/2,k=r.pstyle("text-background-padding").pfValue,S=2,C=d,E=h,A=E/2,M=C/2,L,P,N,_;if(y)L=f-A,P=f+A,N=p-M,_=p+M;else{switch(n3(l.value)){case"left":L=f-E,P=f;break;case"center":L=f-A,P=f+A;break;case"right":L=f,P=f+E;break}switch(i3(u.value)){case"top":N=p-C,_=p;break;case"center":N=p-M,_=p+M;break;case"bottom":N=p,_=p+C;break}}var I=g-Math.max(x,T)-k-S,O=g+Math.max(x,T)+k+S,D=m-Math.max(x,T)-k-S,$=m+Math.max(x,T)+k+S;L+=I,P+=O,N+=D,_+=$;var F=n||"main",z=a.labelBounds,H=z[F]=z[F]||{};H.x1=L,H.y1=N,H.x2=P,H.y2=_,H.w=P-L,H.h=_-N,H.leftPad=I,H.rightPad=O,H.topPad=D,H.botPad=$;var B=y&&v.strValue==="autorotate",V=v.pfValue!=null&&v.pfValue!==0;if(B||V){var q=B?Pk(a.rstyle,"labelAngle",n):v.pfValue,G=Math.cos(q),Q=Math.sin(q),j=(L+P)/2,ae=(N+_)/2;if(!y){switch(n3(l.value)){case"left":j=P;break;case"right":j=L;break}switch(i3(u.value)){case"top":ae=_;break;case"bottom":ae=N;break}}var Z=function(He,ue){return He=He-j,ue=ue-ae,{x:He*G-ue*Q+j,y:He*Q+ue*G+ae}},J=Z(L,N),re=Z(L,_),ee=Z(P,N),me=Z(P,_);L=Math.min(J.x,re.x,ee.x,me.x),P=Math.max(J.x,re.x,ee.x,me.x),N=Math.min(J.y,re.y,ee.y,me.y),_=Math.max(J.y,re.y,ee.y,me.y)}var te=F+"Rot",$e=z[te]=z[te]||{};$e.x1=L,$e.y1=N,$e.x2=P,$e.y2=_,$e.w=P-L,$e.h=_-N,_u(e,L,N,P,_),_u(a.labelBounds.all,L,N,P,_)}return e}},ipe=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;zMe(e,r,n,s,"outside",s/2)}},zMe=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);ep(e,m)}else s!=null&&s>0&&SR(e,[s,s,s,s])}}},SVt=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;zMe(e,r,n,i,a)}},EVt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=vl(),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],x=function(Oe){return Oe.pstyle("display").value!=="none"},b=!i||x(e)&&(!u||x(e.source())&&x(e.target()));if(b){var T=0,k=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(k=e.pstyle("overlay-padding").value));var S=0,C=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(C=e.pstyle("underlay-padding").value));var E=Math.max(k,C),A=0,M=0;if(i&&(A=e.pstyle("width").pfValue,M=A/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var P=e.outerWidth(),N=P/2,_=e.outerHeight(),I=_/2;h=g-N,d=g+N,f=m-I,p=m+I,_u(s,h,f,d,p),i&&ipe(s,e),i&&r.includeOutlines&&!a&&ipe(s,e),i&&SVt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var O=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,_u(s,h,f,d,p),O==="haystack"){var D=y.haystackPts;if(D&&D.length===2){if(h=D[0].x,f=D[0].y,d=D[1].x,p=D[1].y,h>d){var $=h;h=d,d=$}if(f>p){var F=f;f=p,p=F}_u(s,h-M,f-M,d+M,p+M)}}else if(O==="bezier"||O==="unbundled-bezier"||xp(O,"segments")||xp(O,"taxi")){var z;switch(O){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 H=0;Hd){var j=h;h=d,d=j}if(f>p){var ae=f;f=p,p=ae}h-=M,d+=M,f-=M,p+=M,_u(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(t8(s,e,"mid-source"),t8(s,e,"mid-target"),t8(s,e,"source"),t8(s,e,"target")),i){var Z=e.pstyle("ghost").value==="yes";if(Z){var J=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;_u(s,s.x1+J,s.y1+re,s.x2+J,s.y2+re)}}var ee=o.bodyBounds=o.bodyBounds||{};Wfe(ee,s),SR(ee,v),CR(ee,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,_u(s,h-E,f-E,d+E,p+E));var me=o.overlayBounds=o.overlayBounds||{};Wfe(me,s),SR(me,v),CR(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?szt(te.all):te.all=vl(),i&&r.includeLabels&&(r.includeMainLabels&&Nz(s,e,null),u&&(r.includeSourceLabels&&Nz(s,e,"source"),r.includeTargetLabels&&Nz(s,e,"target")))}return s.x1=Qc(s.x1),s.y1=Qc(s.y1),s.x2=Qc(s.x2),s.y2=Qc(s.y2),s.w=Qc(s.x2-s.x1),s.h=Qc(s.y2-s.y1),s.w>0&&s.h>0&&b&&(SR(s,v),CR(s,1)),s},HMe=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:DVt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};ag.removeAllListeners=function(){return this.removeListener("*")};ag.emit=ag.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,yi(e)||(e=[e]),OVt(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===NVt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&SFt(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&&Ar(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":bs(Symbol))!=e&&bs(Symbol.iterator)!=e;r&&(BL[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return G9e({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(zn(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Ar(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)}});No.neighbourhood=No.neighborhood;No.closedNeighbourhood=No.closedNeighborhood;No.openNeighbourhood=No.openNeighborhood;Pr(No,{source:iu(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:iu(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:ppe({attr:"source"}),targets:ppe({attr:"target"})});function ppe(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]}});No.componentsOf=No.components;var uo=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){Ji("A collection must have a reference to the core");return}var a=new Tf,s=!1;if(!r)r=[];else if(r.length>0&&zn(r[0])&&!BE(r[0])){s=!0;for(var o=[],l=new U3,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 uo(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(_){for(var I=_._private.edges,O=0;O0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var P=0;P0?P=_:L=_;while(Math.abs(N)>s&&++I=a?x(M,I):O===0?I:T(M,L,L+u)}var S=!1;function C(){S=!0,(t!==e||r!==n)&&b()}var E=function(L){return S||C(),t===e&&r===n?L:L===0?0:L===1?1:y(k(L),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return A},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var YVt=(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}})(),ki=function(e,r,n,i){var a=UVt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},AR={linear:function(e,r,n){return e+(r-e)*n},ease:ki(.25,.1,.25,1),"ease-in":ki(.42,0,1,1),"ease-out":ki(0,0,.58,1),"ease-in-out":ki(.42,0,.58,1),"ease-in-sine":ki(.47,0,.745,.715),"ease-out-sine":ki(.39,.575,.565,1),"ease-in-out-sine":ki(.445,.05,.55,.95),"ease-in-quad":ki(.55,.085,.68,.53),"ease-out-quad":ki(.25,.46,.45,.94),"ease-in-out-quad":ki(.455,.03,.515,.955),"ease-in-cubic":ki(.55,.055,.675,.19),"ease-out-cubic":ki(.215,.61,.355,1),"ease-in-out-cubic":ki(.645,.045,.355,1),"ease-in-quart":ki(.895,.03,.685,.22),"ease-out-quart":ki(.165,.84,.44,1),"ease-in-out-quart":ki(.77,0,.175,1),"ease-in-quint":ki(.755,.05,.855,.06),"ease-out-quint":ki(.23,1,.32,1),"ease-in-out-quint":ki(.86,0,.07,1),"ease-in-expo":ki(.95,.05,.795,.035),"ease-out-expo":ki(.19,1,.22,1),"ease-in-out-expo":ki(1,0,0,1),"ease-in-circ":ki(.6,.04,.98,.335),"ease-out-circ":ki(.075,.82,.165,1),"ease-in-out-circ":ki(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return AR.linear;var i=YVt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":ki};function ype(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 vpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function $v(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=vpe(t,i),o=vpe(e,i);if(Zt(s)&&Zt(o))return ype(a,s,o,r,n);if(yi(s)&&yi(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=AR[p].apply(null,g)):s.easingImpl=AR[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,x=s.position;if(x&&i&&!t.locked()){var b={};Fk(v.x,x.x)&&(b.x=$v(v.x,x.x,y,m)),Fk(v.y,x.y)&&(b.y=$v(v.y,x.y,y,m)),t.position(b)}var T=s.startPan,k=s.pan,S=a.pan,C=k!=null&&n;C&&(Fk(T.x,k.x)&&(S.x=$v(T.x,k.x,y,m)),Fk(T.y,k.y)&&(S.y=$v(T.y,k.y,y,m)),t.emit("pan"));var E=s.startZoom,A=s.zoom,M=A!=null&&n;M&&(Fk(E,A)&&(a.zoom=y6(a.minZoom,$v(E,A,y,m),a.maxZoom)),t.emit("zoom")),(C||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var P=0;P=0;C--){var E=S[C];E()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],T=b._private;if(T.stopped){p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||XVt(h,b,t),jVt(h,b,t,d),T.applying&&(T.applying=!1),v(T.frames),T.step!=null&&T.step(t),b.completed()&&(p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.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 KVt={animate:ri.animate(),animation:ri.animation(),animated:ri.animated(),clearQueue:ri.clearQueue(),delay:ri.delay(),delayAnimation:ri.delayAnimation(),stop:ri.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&&$L(function(a){bpe(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){bpe(s,e)},n.beforeRenderPriorities.animations):r()}},ZVt={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&&BE(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}},n8=function(e){return Ar(e)?new ng(e):e},XMe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new nD(ZVt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,n8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,n8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,n8(r),n),this},once:function(e,r,n){return this.emitter().one(e,n8(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}};ri.eventAliasesOn(XMe);var ZG={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)}};ZG.jpeg=ZG.jpg;var RR={layout:function(e){var r=this;if(e==null){Ji("Layout options must be specified to make a layout");return}if(e.name==null){Ji("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Ji("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Ar(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Pr({},e,{cy:r,eles:a}));return s}};RR.createLayout=RR.makeLayout=RR.layout;var QVt={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)}};QG.invalidateDimensions=QG.resize;var _R={collection:function(e,r){return Ar(e)?this.$(e):xc(e)?e.collection():yi(e)?(r||(r={}),new uo(this,e,r.unique,r.removed)):new uo(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}};_R.elements=_R.filter=_R.$;var Fs={},VC="t",eWt="f";Fs.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&&(T=1),o.color){var S=n.valueMin[0],C=n.valueMax[0],E=n.valueMin[1],A=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(S+(C-S)*T),Math.round(E+(A-E)*T),Math.round(M+(L-M)*T),Math.round(P+(N-P)*T)];a={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*T;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 O=n.field.split("."),D=d.data,$=0;$0&&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)};Fs.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)};Fs.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)})};Fs.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Fs.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()})})};Fs.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()})})};Fs.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 GE={};GE.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){ii("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 ng(d);if(f.invalid){ii("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){ii("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var x=v[1],b=v[2],T=e.properties[x];if(!T){ii("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(x,b);if(!k){ii("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:x,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 ii("`"+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,x=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(x)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+/):yi(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var T=[],k=[],S=[],C="",E=!1,A=0;A0?" ":"")+M.strValue}return u.validate&&!u.validate(T,k)?null:u.singleEnum&&E?T.length===1&&Ar(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:C,bypass:r,units:k}}var L=function(){for(var Z=0;Zu.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?O.pfValue=e:O.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(O.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(O.pfValue=P==="rad"?e:KFt(e)),P==="%"&&(O.pfValue=e/100),O}else if(u.propList){var D=[],$=""+e;if($!=="none"){for(var F=$.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),Zt(e)?s=e:zn(e)&&(s=e.level,e.position!=null?a=KN(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;Zt(u.x)&&(r.pan.x=u.x,o=!1),Zt(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(Ar(e)){var n=e;e=this.mutableElements().filter(n)}else xc(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}};dy.centre=dy.center;dy.autolockNodes=dy.autolock;dy.autoungrabifyNodes=dy.autoungrabify;var w6={data:ri.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ri.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ri.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ri.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};w6.attr=w6.data;w6.removeAttr=w6.removeData;var T6=function(e){var r=this;e=Pr({},e);var n=e.container;n&&!IL(n)&&IL(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=ls!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Pr({name:s?"grid":"null"},o.layout),o.renderer=Pr({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 uo(this),listeners:[],aniEles:new uo(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:Zt(o.zoom)?o.zoom:1,pan:{x:zn(o.pan)&&Zt(o.pan.x)?o.pan.x:0,y:zn(o.pan)&&Zt(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(qBt);if(y)return Y3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Pr({},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&&(zn(g)||yi(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 x=Pr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).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,ua(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=vl(o?t.boundingBox:structuredClone(e.extent())),u;if(xc(t.roots))u=t.roots;else if(yi(t.roots)){for(var h=[],d=0;d0;){var _=N(),I=A(_,L);if(I)_.outgoers().filter(function(ce){return ce.isNode()&&r.has(ce)}).forEach(P);else if(I===null){ii("Detected double maximal shift for node `"+_.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Ae/2:0),le=2*Math.PI/v[Ve].length*we;return Ve===0&&v[0].length===1&&(Ue=1),{x:ee.x+Ue*Math.cos(le),y:ee.y+Ue*Math.sin(le)}}else{var pe=v[Ve].length,Ce=Math.max(pe===1?0:o?(l.w-t.padding*2-me.w)/((t.grid?$e:pe)-1):(l.w-t.padding*2-me.w)/((t.grid?$e:pe)+1),O),oe={x:ee.x+(we+1-(pe+1)/2)*Ce,y:ee.y+(Ve+1-(G+1)/2)*te};return oe}},He={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(He).indexOf(t.direction)===-1&&Ji("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(He).join(", ")));var ue=function(Te){return bFt(Oe(Te),l,He[t.direction])};return r.nodes().layoutPositions(this,t,ue),this};var aWt={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 ZMe(t){this.options=Pr({},aWt,t)}ZMe.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=vl(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),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var T=function(S,C){var E=e.startAngle+C*u*(i?1:-1),A=h*Math.cos(E),M=h*Math.sin(E),L={x:o.x+A,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,T),this};var sWt={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 QMe(t){this.options=Pr({},sWt,t)}QMe.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=vl(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 k=Math.abs(x[0].value-T.value);k>=y&&(x=[],v.push(x))}x.push(T)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-S,A=E/(v.length+C?1:0);S=Math.min(S,A)}for(var M=0,L=0;L1&&e.avoidOverlap){var I=Math.cos(_)-Math.cos(0),O=Math.sin(_)-Math.sin(0),D=Math.sqrt(S*S/(I*I+O*O));M=Math.max(D,M)}P.r=M,M+=S}if(e.equidistant){for(var $=0,F=0,z=0;z=t.numIter||(fWt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),$L(h)}};h()}else{for(;u;)u=s(l),l++;Tpe(n,t),o()}return this};lD.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};lD.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var lWt=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=vl(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},JMe=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=zL(e,o,l),y=zL(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},mWt=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},zL=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)},yWt=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}}}}},bWt=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},tLe=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)}}},TWt={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 rLe(t){this.options=Pr({},TWt,t)}rLe.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=vl(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(V){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(q){if(q==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=q:u=q},d=function(q){if(q==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=q:u=q},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 x=a.w/u,b=a.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var T=0;T=u&&(I=0,_++)},D={},$=0;$(I=uzt(t,e,O[D],O[D+1],O[D+2],O[D+3])))return y(C,I),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var O=A.allpts,D=0;D+5(I=czt(t,e,O[D],O[D+1],O[D+2],O[D+3],O[D+4],O[D+5])))return y(C,I),!0}for(var $=$||E.source,F=F||E.target,z=i.getArrowWidth(M,L),H=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],D=0;D0&&(v($),v(F))}function b(C,E,A){return Jo(C,E,A)}function T(C,E){var A=C._private,M=f,L;E?L=E+"-":L="",C.boundingBox();var P=A.labelBounds[E||"main"],N=C.pstyle(L+"label").value,_=C.pstyle("text-events").strValue==="yes";if(!(!_||!N)){var I=b(A.rscratch,"labelX",E),O=b(A.rscratch,"labelY",E),D=b(A.rscratch,"labelAngle",E),$=C.pstyle(L+"text-margin-x").pfValue,F=C.pstyle(L+"text-margin-y").pfValue,z=P.x1-M-$,H=P.x2+M-$,B=P.y1-M-F,V=P.y2+M-F;if(D){var q=Math.cos(D),G=Math.sin(D),Q=function(me,te){return me=me-I,te=te-O,{x:me*q-te*G+I,y:me*G+te*q+O}},j=Q(z,B),ae=Q(z,V),Z=Q(H,B),J=Q(H,V),re=[j.x+$,j.y+F,Z.x+$,Z.y+F,J.x+$,J.y+F,ae.x+$,ae.y+F];if(Hl(t,e,re))return y(C),!0}else if(wp(P,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var S=s[k];S.isNode()?v(S)||T(S):x(S)||T(S)||T(S,"source")||T(S,"target")}return o};Wy.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=vl({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(me,te,$e){return Jo(me,te,$e)}function y(me,te){var $e=me._private,Oe=s,He="";me.boundingBox();var ue=$e.labelBounds.main;if(!ue)return null;var ce=m($e.rscratch,"labelX",te),Te=m($e.rscratch,"labelY",te),ge=m($e.rscratch,"labelAngle",te),Ve=me.pstyle(He+"text-margin-x").pfValue,we=me.pstyle(He+"text-margin-y").pfValue,Ae=ue.x1-Oe-Ve,Ue=ue.x2+Oe-Ve,le=ue.y1-Oe-we,pe=ue.y2+Oe-we;if(ge){var Ce=Math.cos(ge),oe=Math.sin(ge),fe=function(se,K){return se=se-ce,K=K-Te,{x:se*Ce-K*oe+ce,y:se*oe+K*Ce+Te}};return[fe(Ae,le),fe(Ue,le),fe(Ue,pe),fe(Ae,pe)]}else return[{x:Ae,y:le},{x:Ue,y:le},{x:Ue,y:pe},{x:Ae,y:pe}]}function v(me,te,$e,Oe){function He(ue,ce,Te){return(Te.y-ue.y)*(ce.x-ue.x)>(ce.y-ue.y)*(Te.x-ue.x)}return He(me,$e,Oe)!==He(te,$e,Oe)&&He(me,te,$e)!==He(me,te,Oe)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},RWt=function(e,r,n,i,a){if(e!==Ape?Rpe(r,e,Ch):AWt(qc,Ch),Rpe(r,n,qc),Spe=Ch.nx*qc.ny-Ch.ny*qc.nx,Epe=Ch.nx*qc.nx-Ch.ny*-qc.ny,Ud=Math.asin(Math.max(-1,Math.min(1,Spe))),Math.abs(Ud)<1e-6){JG=r.x,eU=r.y,fm=Dv=0;return}Lm=1,MR=!1,Epe<0?Ud<0?Ud=Math.PI+Ud:(Ud=Math.PI-Ud,Lm=-1,MR=!0):Ud>0&&(Lm=-1,MR=!0),r.radius!==void 0?Dv=r.radius:Dv=i,Qg=Ud/2,i8=Math.min(Ch.len/2,qc.len/2),a?(gh=Math.abs(Math.cos(Qg)*Dv/Math.sin(Qg)),gh>i8?(gh=i8,fm=Math.abs(gh*Math.sin(Qg)/Math.cos(Qg))):fm=Dv):(gh=Math.min(i8,Dv),fm=Math.abs(gh*Math.sin(Qg)/Math.cos(Qg))),tU=r.x+qc.nx*gh,rU=r.y+qc.ny*gh,JG=tU-qc.ny*fm*Lm,eU=rU+qc.nx*fm*Lm,sLe=r.x+Ch.nx*gh,oLe=r.y+Ch.ny*gh,Ape=r};function lLe(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 mee(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}:(RWt(t,e,r,n,i),{cx:JG,cy:eU,radius:fm,startX:sLe,startY:oLe,stopX:tU,stopY:rU,startAngle:Ch.ang+Math.PI/2*Lm,endAngle:qc.ang-Math.PI/2*Lm,counterClockwise:MR})}var k6=.01,_Wt=Math.sqrt(2*k6),Ho={};Ho.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(k,S,C,E){var A=E-S,M=C-k,L=Math.sqrt(M*M+A*A);return{x:-A/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=Ga(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ga(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),a=b}else ii("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}};Ho.findHaystackPoints=function(t){for(var e=0;e0?Math.max(K-de,0):Math.min(K+de,0)},N=P(M,E),_=P(L,A),I=!1;x===u?v=Math.abs(N)>Math.abs(_)?i:n:x===l||x===o?(v=n,I=!0):(x===a||x===s)&&(v=i,I=!0);var O=v===n,D=O?_:N,$=O?L:M,F=nee($),z=!1;!(I&&(T||S))&&(x===o&&$<0||x===l&&$>0||x===a&&$>0||x===s&&$<0)&&(F*=-1,D=F*Math.abs(D),z=!0);var H;if(T){var B=k<0?1+k:k;H=B*D}else{var V=k<0?D:0;H=V+k*F}var q=function(K){return Math.abs(K)=Math.abs(D)},G=q(H),Q=q(Math.abs(D)-Math.abs(H)),j=G||Q;if(j&&!z)if(O){var ae=Math.abs($)<=f/2,Z=Math.abs(M)<=p/2;if(ae){var J=(h.x1+h.x2)/2,re=h.y1,ee=h.y2;r.segpts=[J,re,J,ee]}else if(Z){var me=(h.y1+h.y2)/2,te=h.x1,$e=h.x2;r.segpts=[te,me,$e,me]}else r.segpts=[h.x1,h.y2]}else{var Oe=Math.abs($)<=d/2,He=Math.abs(L)<=g/2;if(Oe){var ue=(h.y1+h.y2)/2,ce=h.x1,Te=h.x2;r.segpts=[ce,ue,Te,ue]}else if(He){var ge=(h.x1+h.x2)/2,Ve=h.y1,we=h.y2;r.segpts=[ge,Ve,ge,we]}else r.segpts=[h.x2,h.y1]}else if(O){var Ae=h.y1+H+(y?f/2*F:0),Ue=h.x1,le=h.x2;r.segpts=[Ue,Ae,le,Ae]}else{var pe=h.x1+H+(y?d/2*F:0),Ce=h.y1,oe=h.y2;r.segpts=[pe,Ce,pe,oe]}if(r.isRound){var fe=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(fe),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};Ho.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=!Zt(r.startX)||!Zt(r.startY),y=!Zt(r.arrowStartX)||!Zt(r.arrowStartY),v=!Zt(r.endX)||!Zt(r.endY),x=!Zt(r.arrowEndX)||!Zt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*T,S=uy({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=S$.poolIndex()){var F=D;D=$,$=F}var z=N.srcPos=D.position(),H=N.tgtPos=$.position(),B=N.srcW=D.outerWidth(),V=N.srcH=D.outerHeight(),q=N.tgtW=$.outerWidth(),G=N.tgtH=$.outerHeight(),Q=N.srcShape=r.nodeShapes[e.getNodeShape(D)],j=N.tgtShape=r.nodeShapes[e.getNodeShape($)],ae=N.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Z=N.tgtCornerRadius=$.pstyle("corner-radius").value==="auto"?"auto":$.pstyle("corner-radius").pfValue,J=N.tgtRs=$._private.rscratch,re=N.srcRs=D._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ee=0;ee=_Wt||(le=Math.sqrt(Math.max(Ue*Ue,k6)+Math.max(Ae*Ae,k6)));var pe=N.vector={x:Ue,y:Ae},Ce=N.vectorNorm={x:pe.x/le,y:pe.y/le},oe={x:-Ce.y,y:Ce.x};N.nodesOverlap=!Zt(le)||j.checkPoint(ue[0],ue[1],0,q,G,H.x,H.y,Z,J)||Q.checkPoint(Te[0],Te[1],0,B,V,z.x,z.y,ae,re),N.vectorNormInverse=oe,_={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:H,srcRs:J,tgtPos:z,tgtRs:re,srcW:q,srcH:G,tgtW:B,tgtH:V,srcIntn:ge,tgtIntn:ce,srcShape:j,tgtShape:Q,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:Ve.x2,y1:Ve.y2,x2:Ve.x1,y2:Ve.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Ce.x,y:-Ce.y},vectorNormInverse:{x:-oe.x,y:-oe.y}}}var fe=He?_:N;te.nodesOverlap=fe.nodesOverlap,te.srcIntn=fe.srcIntn,te.tgtIntn=fe.tgtIntn,te.isRound=$e.startsWith("round"),i&&(D.isParent()||D.isChild()||$.isParent()||$.isChild())&&(D.parents().anySame($)||$.parents().anySame(D)||D.same($)&&D.isParent())?e.findCompoundLoopPoints(me,fe,ee,Oe):D===$?e.findLoopPoints(me,fe,ee,Oe):$e.endsWith("segments")?e.findSegmentsPoints(me,fe):$e.endsWith("taxi")?e.findTaxiPoints(me,fe):$e==="straight"||!Oe&&N.eles.length%2===1&&ee===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,fe,ee,Oe,He),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,fe),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},C=0;C0){var ue=u,ce=dm(ue,V2(s)),Te=dm(ue,V2(He)),ge=ce;if(Te2){var Ve=dm(ue,{x:He[2],y:He[3]});Ve0){var X=h,Fe=dm(X,V2(s)),ke=dm(X,V2(de)),Ye=Fe;if(ke2){var Ie=dm(X,{x:de[2],y:de[3]});Ie=g||C){y={cp:T,segment:S};break}}if(y)break}var E=y.cp,A=y.segment,M=(g-v)/A.length,L=A.t1-A.t0,P=p?A.t0+L*M:A.t1-L*M;P=y6(0,P,1),e=bb(E.p0,E.p1,E.p2,P),f=LWt(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var N=0,_,I,O,D,$=n.allpts.length,F=0;F+3<$&&(p?(O={x:n.allpts[F],y:n.allpts[F+1]},D={x:n.allpts[F+2],y:n.allpts[F+3]}):(O={x:n.allpts[$-2-F],y:n.allpts[$-1-F]},D={x:n.allpts[$-4-F],y:n.allpts[$-3-F]}),_=uy(O,D),I=N,N+=_,!(N>=g));F+=2);var z=g-I,H=z/_;H=y6(0,H,1),e=QFt(O,D,H),f=hLe(O,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Cd.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Cd.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=cy(n,t._private.labelDimsKey);if(Jo(r.rscratch,"prefixedLabelDimsKey",e)!==i){Nh(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=Jo(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;Nh(r.rstyle,"labelWidth",e,f),Nh(r.rscratch,"labelWidth",e,f),Nh(r.rstyle,"labelHeight",e,p),Nh(r.rscratch,"labelHeight",e,p),Nh(r.rscratch,"labelLineHeight",e,d),Nh(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};Cd.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(V,q){return q?(Nh(r.rscratch,V,e,q),q):Jo(r.rscratch,V,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 k=v.matchAll(m),S="",C=0,E=Ul(k),A;try{for(E.s();!(A=E.n()).done;){var M=A.value,L=M[0],P=v.substring(C,M.index);C=M.index+L.length;var N=S.length===0?P:S+P+L,_=this.calculateLabelDimensions(t,N),I=_.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 O=t.pstyle("text-max-width").pfValue,D="",$="…",F=!1;if(this.calculateLabelDimensions(t,i).widthO)break;D+=i[z],z===i.length-1&&(F=!0)}return F||(D+=$),D}return i};Cd.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?vVt(r):"center":e};Cd.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,x=0,b=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var At=a(W);pt&&(t.hoverData.tapholdCancelled=!0);var mt=function(){var Kt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Kt.length===0?(Kt.push(nt[0]),Kt.push(nt[1])):(Kt[0]+=nt[0],Kt[1]+=nt[1])};K=!0,i(De,["mousemove","vmousemove","tapdrag"],W,{x:ke[0],y:ke[1]});var ye=function(Kt){return{originalEvent:W,type:Kt,position:{x:ke[0],y:ke[1]}}},Nt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||de.emit(ye("boxstart")),ze[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(pt){var yt=ye("cxtdrag");Be?Be.emit(yt):de.emit(yt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||De!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ye("cxtdragout")),t.hoverData.cxtOver=De,De&&De.emit(ye("cxtdragover")))}}else if(t.hoverData.dragging){if(K=!0,de.panningEnabled()&&de.userPanningEnabled()){var gt;if(t.hoverData.justStartedPan){var St=t.hoverData.mdownPos;gt={x:(ke[0]-St[0])*X,y:(ke[1]-St[1])*X},t.hoverData.justStartedPan=!1}else gt={x:nt[0]*X,y:nt[1]*X};de.panBy(gt),de.emit(ye("dragpan")),t.hoverData.dragged=!0}ke=t.projectIntoViewport(W.clientX,W.clientY)}else if(ze[4]==1&&(Be==null||Be.pannable())){if(pt){if(!t.hoverData.dragging&&de.boxSelectionEnabled()&&(At||!de.panningEnabled()||!de.userPanningEnabled()))Nt();else if(!t.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var tn=s(Be,t.hoverData.downs);tn&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ze[4]=0,t.data.bgActivePosistion=V2(Ye),t.redrawHint("select",!0),t.redraw())}Be&&Be.pannable()&&Be.active()&&Be.unactivate()}}else{if(Be&&Be.pannable()&&Be.active()&&Be.unactivate(),(!Be||!Be.grabbed())&&De!=Ke&&(Ke&&i(Ke,["mouseout","tapdragout"],W,{x:ke[0],y:ke[1]}),De&&i(De,["mouseover","tapdragover"],W,{x:ke[0],y:ke[1]}),t.hoverData.last=De),Be)if(pt){if(de.boxSelectionEnabled()&&At)Be&&Be.grabbed()&&(m(Le),Be.emit(ye("freeon")),Le.emit(ye("free")),t.dragData.didDrag&&(Be.emit(ye("dragfreeon")),Le.emit(ye("dragfree")))),Nt();else if(Be&&Be.grabbed()&&t.nodeIsDraggable(Be)){var _e=!t.dragData.didDrag;_e&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Le,{inDragLayer:!0});var Je={x:0,y:0};if(Zt(nt[0])&&Zt(nt[1])&&(Je.x+=nt[0],Je.y+=nt[1],_e)){var ut=t.hoverData.dragDelta;ut&&Zt(ut[0])&&Zt(ut[1])&&(Je.x+=ut[0],Je.y+=ut[1])}t.hoverData.draggingEles=!0,Le.silentShift(Je).emit(ye("position")).emit(ye("drag")),t.redrawHint("drag",!0),t.redraw()}}else mt();K=!0}if(ze[2]=ke[0],ze[3]=ke[1],K)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 se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var K=t.cy,de=t.projectIntoViewport(W.clientX,W.clientY),X=t.selection,Fe=t.findNearestElement(de[0],de[1],!0,!1),ke=t.dragData.possibleDragElements,Ye=t.hoverData.down,Ie=a(W);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ye&&Ye.unactivate();var ze=function(Me){return{originalEvent:W,type:Me,position:{x:de[0],y:de[1]}}};if(t.hoverData.which===3){var De=ze("cxttapend");if(Ye?Ye.emit(De):K.emit(De),!t.hoverData.cxtDragged){var Ke=ze("cxttap");Ye?Ye.emit(Ke):K.emit(Ke)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Fe,["mouseup","tapend","vmouseup"],W,{x:de[0],y:de[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ye,["click","tap","vclick"],W,{x:de[0],y:de[1]}),L=!1,W.timeStamp-P<=K.multiClickDebounceTime()?(M&&clearTimeout(M),L=!0,P=null,i(Ye,["dblclick","dbltap","vdblclick"],W,{x:de[0],y:de[1]})):(M=setTimeout(function(){L||i(Ye,["oneclick","onetap","voneclick"],W,{x:de[0],y:de[1]})},K.multiClickDebounceTime()),P=W.timeStamp)),Ye==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(W)&&(K.$(r).unselect(["tapunselect"]),ke.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ke=K.collection()),Fe==Ye&&!t.dragData.didDrag&&!t.hoverData.selecting&&Fe!=null&&Fe._private.selectable&&(t.hoverData.dragging||(K.selectionType()==="additive"||Ie?Fe.selected()?Fe.unselect(["tapunselect"]):Fe.select(["tapselect"]):Ie||(K.$(r).unmerge(Fe).unselect(["tapunselect"]),Fe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Be=K.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),Be.length>0&&t.redrawHint("eles",!0),K.emit(ze("boxend"));var nt=function(Me){return Me.selectable()&&!Me.selected()};K.selectionType()==="additive"||Ie||K.$(r).unmerge(Be).unselect(),Be.emit(ze("box")).stdFilter(nt).select().emit(ze("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 Le=Ye&&Ye.grabbed();m(ke),Le&&(Ye.emit(ze("freeon")),ke.emit(ze("free")),t.dragData.didDrag&&(Ye.emit(ze("dragfreeon")),ke.emit(ze("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 N=[],_=4,I,O=1e5,D=function(W,se){for(var K=0;K=_){var de=N;if(I=D(de,5),!I){var X=Math.abs(de[0]);I=$(de)&&X>5}if(I)for(var Fe=0;Fe5&&(K=nee(K)*5),Ke=K/-250,I&&(Ke/=O,Ke*=3),Ke=Ke*t.wheelSensitivity;var Be=W.deltaMode===1;Be&&(Ke*=33);var nt=ke.zoom()*Math.pow(10,Ke);W.type==="gesturechange"&&(nt=t.gestureStartZoom*W.scale),ke.zoom({level:nt,renderedPosition:{x:De[0],y:De[1]}}),ke.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:ze[0],y:ze[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(fe){t.hasTouchStarted||F(fe)},!0),t.registerBinding(t.container,"mouseout",function(W){var se=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function(W){var se=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me=function(W,se,K,de){return Math.sqrt((K-W)*(K-W)+(de-se)*(de-se))},te=function(W,se,K,de){return(K-W)*(K-W)+(de-se)*(de-se)},$e;t.registerBinding(t.container,"touchstart",$e=function(W){if(t.hasTouchStarted=!0,!!E(W)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,K=t.touchData.now,de=t.touchData.earlier;if(W.touches[0]){var X=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);K[0]=X[0],K[1]=X[1]}if(W.touches[1]){var X=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);K[2]=X[0],K[3]=X[1]}if(W.touches[2]){var X=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);K[4]=X[0],K[5]=X[1]}var Fe=function(At){return{originalEvent:W,type:At,position:{x:K[0],y:K[1]}}};if(W.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var ke=t.findContainerClientCoords();ae=ke[0],Z=ke[1],J=ke[2],re=ke[3],z=W.touches[0].clientX-ae,H=W.touches[0].clientY-Z,B=W.touches[1].clientX-ae,V=W.touches[1].clientY-Z,ee=0<=z&&z<=J&&0<=B&&B<=J&&0<=H&&H<=re&&0<=V&&V<=re;var Ye=se.pan(),Ie=se.zoom();q=me(z,H,B,V),G=te(z,H,B,V),Q=[(z+B)/2,(H+V)/2],j=[(Q[0]-Ye.x)/Ie,(Q[1]-Ye.y)/Ie];var ze=200,De=ze*ze;if(G=1){for(var Ct=t.touchData.startPosition=[null,null,null,null,null,null],wt=0;wt=t.touchTapThreshold2}if(se&&t.touchData.cxt){W.preventDefault();var wt=W.touches[0].clientX-ae,ht=W.touches[0].clientY-Z,Bt=W.touches[1].clientX-ae,At=W.touches[1].clientY-Z,mt=te(wt,ht,Bt,At),ye=mt/G,Nt=150,yt=Nt*Nt,gt=1.5,St=gt*gt;if(ye>=St||mt>=yt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var tn=Ie("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(tn),t.touchData.start=null):de.emit(tn)}}if(se&&t.touchData.cxt){var tn=Ie("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(tn):de.emit(tn),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var _e=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||_e!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ie("cxtdragout")),t.touchData.cxtOver=_e,_e&&_e.emit(Ie("cxtdragover")))}else if(se&&W.touches[2]&&de.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||de.emit(Ie("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,K[4]=1,!K||K.length===0||K[0]===void 0?(K[0]=(X[0]+X[2]+X[4])/3,K[1]=(X[1]+X[3]+X[5])/3,K[2]=(X[0]+X[2]+X[4])/3+1,K[3]=(X[1]+X[3]+X[5])/3+1):(K[2]=(X[0]+X[2]+X[4])/3,K[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&W.touches[1]&&!t.touchData.didSelect&&de.zoomingEnabled()&&de.panningEnabled()&&de.userZoomingEnabled()&&de.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Je=t.dragData.touchDragEles;if(Je){t.redrawHint("drag",!0);for(var ut=0;ut0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var He;t.registerBinding(e,"touchcancel",He=function(W){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var ue,ce,Te,ge;if(t.registerBinding(e,"touchend",ue=function(W){var se=t.touchData.start,K=t.touchData.capture;if(K)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var de=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,Fe=X.zoom(),ke=t.touchData.now,Ye=t.touchData.earlier;if(W.touches[0]){var Ie=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);ke[0]=Ie[0],ke[1]=Ie[1]}if(W.touches[1]){var Ie=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);ke[2]=Ie[0],ke[3]=Ie[1]}if(W.touches[2]){var Ie=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);ke[4]=Ie[0],ke[5]=Ie[1]}var ze=function(yt){return{originalEvent:W,type:yt,position:{x:ke[0],y:ke[1]}}};se&&se.unactivate();var De;if(t.touchData.cxt){if(De=ze("cxttapend"),se?se.emit(De):X.emit(De),!t.touchData.cxtDragged){var Ke=ze("cxttap");se?se.emit(Ke):X.emit(Ke)}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 Be=X.collection(t.getAllInBox(de[0],de[1],de[2],de[3]));de[0]=void 0,de[1]=void 0,de[2]=void 0,de[3]=void 0,de[4]=0,t.redrawHint("select",!0),X.emit(ze("boxend"));var nt=function(yt){return yt.selectable()&&!yt.selected()};Be.emit(ze("box")).stdFilter(nt).select().emit(ze("boxselect")),Be.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.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 Le=t.dragData.touchDragEles;if(se!=null){var pt=se._private.grabbed;m(Le),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt&&(se.emit(ze("freeon")),Le.emit(ze("free")),t.dragData.didDrag&&(se.emit(ze("dragfreeon")),Le.emit(ze("dragfree")))),i(se,["touchend","tapend","vmouseup","tapdragout"],W,{x:ke[0],y:ke[1]}),se.unactivate(),t.touchData.start=null}else{var Me=t.findNearestElement(ke[0],ke[1],!0,!0);i(Me,["touchend","tapend","vmouseup","tapdragout"],W,{x:ke[0],y:ke[1]})}var Ct=t.touchData.startPosition[0]-ke[0],wt=Ct*Ct,ht=t.touchData.startPosition[1]-ke[1],Bt=ht*ht,At=wt+Bt,mt=At*Fe*Fe;t.touchData.singleTouchMoved||(se||X.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],W,{x:ke[0],y:ke[1]}),ce=!1,W.timeStamp-ge<=X.multiClickDebounceTime()?(Te&&clearTimeout(Te),ce=!0,ge=null,i(se,["dbltap","vdblclick"],W,{x:ke[0],y:ke[1]})):(Te=setTimeout(function(){ce||i(se,["onetap","voneclick"],W,{x:ke[0],y:ke[1]})},X.multiClickDebounceTime()),ge=W.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&mt"u"){var Ve=[],we=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}},Ae=function(W){return{event:W,touch:we(W)}},Ue=function(W){Ve.push(Ae(W))},le=function(W){for(var se=0;se0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:fMe(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?rg(i,a):l;var u=2*l;if(Kf(e,r,this.points,s,o,i,a-u,[0,-1],n)||Kf(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!!(Hl(e,r,f)||l1(e,r,u,u,s+i/2-l,o+a/2-l,n)||l1(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};x0.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ko(3,0)),this.generateRoundPolygon("round-triangle",Ko(3,0)),this.generatePolygon("rectangle",Ko(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",Ko(5,0)),this.generateRoundPolygon("round-pentagon",Ko(5,0)),this.generatePolygon("hexagon",Ko(6,0)),this.generateRoundPolygon("round-hexagon",Ko(6,0)),this.generatePolygon("heptagon",Ko(7,0)),this.generateRoundPolygon("round-heptagon",Ko(7,0)),this.generatePolygon("octagon",Ko(8,0)),this.generateRoundPolygon("round-octagon",Ko(8,0));var n=new Array(20);{var i=WG(5,0),a=WG(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*T)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*Dz)break;var k=e.deq(n,y,m);if(k.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||eee;i.beforeRender(s,o(n))}}}},DWt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NL;Eg(this,t),this.idsByKey=new Tf,this.keyForId=new Tf,this.cachesByLvl=new Tf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ag(t,[{key:"getIdsFor",value:function(r){r==null&&Ji("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new U3,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 Tf,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}}])})(),Ipe=25,a8=50,LR=-4,nU=3,vLe=7.99,OWt=8,PWt=1024,BWt=1024,FWt=1024,zWt=.2,HWt=.8,VWt=10,WWt=.15,qWt=.1,GWt=.9,UWt=.9,YWt=100,jWt=1,q2={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},XWt=mo({getKey:null,doesEleInvalidateKey:NL,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:sMe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),F5=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=XWt(r);Pr(n,i),n.lookup=new DWt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ws=F5.prototype;ws.reasons=q2;ws.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};ws.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};ws.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new WE(function(r,n){return n.reqs-r.reqs});return e};ws.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};ws.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(ree(o*r))),n=vLe||n>nU)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<=Ipe?g=Ipe:h<=a8?g=a8:g=Math.ceil(h/a8)*a8,h>FWt||d>BWt)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=a.getElement(t,e,r,L,q2.downscale);M()}else return a.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!k)for(var N=n-1;N>=LR;N--){var _=l.get(t,N);if(_){P=_;break}}if(x(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+OWt),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};ws.invalidateElements=function(t){for(var e=0;e=zWt*t.width&&this.retireTexture(t)};ws.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>HWt&&t.fullnessChecks>=VWt?tg(r,t):t.fullnessChecks++};ws.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;tg(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,tee(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),tg(i,s),n.push(s),s}};ws.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}};ws.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,q2.dequeue)}return i};ws.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=JJ,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};ws.onDequeue=function(t){this.onDequeues.push(t)};ws.offDequeue=function(t){tg(this.onDequeues,t)};ws.setupDequeueing=yLe.setupDequeueing({deqRedrawThreshold:YWt,deqCost:WWt,deqAvgCost:qWt,deqNoDrawCost:GWt,deqFastCost:UWt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=ZWt||r>VL)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 O=r+I;WC<=O&&O<=VL&&!M(O);O+=I);};L(1),L(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&tg(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=vl();for(var M=0;MNpe||N>Npe)return null;var _=P*N;if(_>aqt)return null;var I=n.makeLayer(d,r);if(L!=null){var O=h.indexOf(L)+1;h.splice(O,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,x=t.length/KWt,b=!o,T=0;T=x||!dMe(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)};yo.getEleLevelForLayerLevel=function(t,e){return t};yo.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,sqt),a.setImgSmoothing(s,!0))};yo.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};yo.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};yo.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Xf(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};yo.invalidateLayer=function(t){if(this.lastInvalidationTime=Xf(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];tg(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,x=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")},T=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")},k=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,I)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,N=v*P;t.translate(M,L),b(N),C(N),t.translate(-M,-L)}else T();S(),b(),C(),k(),E(),r&&t.translate(l.x1,l.y1)}};var wLe=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")}}}};w0.drawEdgeOverlay=wLe("overlay");w0.drawEdgeUnderlay=wLe("underlay");w0.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)};qy.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 yqt(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 Bpe(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()}qy.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=Jo(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};qy.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=Jo(s,"labelX",r),u=Jo(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=Jo(s,"labelWidth",r),m=Jo(s,"labelHeight",r),y=Jo(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),T=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(T="center",k="center"),l+=v,u+=x;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 C=n3(T),E=i3(k);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var A=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,N=e.pstyle("text-background-shape").strValue,_=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",O=2;if(A>0||L>0&&M>0){var D=t.fillStyle,$=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,H=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,V=A>0,q=L>0&&M>0,G=l-P;switch(C){case"left":G-=g;break;case"center":G-=g/2;break}var Q=u-m-P,j=g+2*P,ae=m+2*P;if(V&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")")),q&&(t.strokeStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[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(_?(t.beginPath(),Bpe(t,G,Q,j,ae,O)):I?(t.beginPath(),yqt(t,G,Q,j,ae)):(t.beginPath(),t.rect(G,Q,j,ae)),V&&t.fill(),q&&t.stroke(),q&&B==="double"){var Z=L/2;t.beginPath(),_?Bpe(t,G+Z,Q+Z,j-2*Z,ae-2*Z,O):t.rect(G+Z,Q+Z,j-2*Z,ae-2*Z),t.stroke()}t.fillStyle=D,t.strokeStyle=$,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),u-=y,e.pstyle("text-wrap").value==="wrap"){var re=Jo(s,"labelWrapCachedLines",r),ee=Jo(s,"labelLineHeight",r),me=g/2,te=this.getLabelJustification(e);switch(te==="auto"||(C==="left"?te==="left"?l+=-g:te==="center"&&(l+=-me):C==="center"?te==="left"?l+=-me:te==="right"&&(l+=me):C==="right"&&(te==="center"?l+=me:te==="right"&&(l+=g))),E){case"top":u-=(re.length-1)*ee;break;case"center":case"bottom":u-=(re.length-1)*ee;break}for(var $e=0;$e0&&t.strokeText(re[$e],l,u),t.fillText(re[$e],l,u),u+=ee}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var _g={};_g.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(!(!Zt(d.x)||!Zt(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 x=e.pstyle("background-image"),b=x.value,T=new Array(b.length),k=new Array(b.length),S=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:N;s.eleFillStyle(t,e,W)},Z=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;s.colorStrokeStyle(t,_[0],_[1],_[2],W)},J=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,V[0],V[1],V[2],W)},re=function(W,se,K,de){var X=s.nodePathCache=s.nodePathCache||[],Fe=aMe(K==="polygon"?K+","+de.join(","):K,""+se,""+W,""+j),ke=X[Fe],Ye,Ie=!1;return ke!=null?(Ye=ke,Ie=!0,h.pathCache=Ye):(Ye=new Path2D,X[Fe]=h.pathCache=Ye),{path:Ye,cacheHit:Ie}},ee=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=re(o,l,ee,me);g=te.path,m=te.cacheHit}var $e=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,j,h)}p?t.fill(g):t.fill()},Oe=function(){for(var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=u.backgrounding,de=0,X=0;X0&&arguments[0]!==void 0?arguments[0]:!1,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,se),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ue=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,se=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,j,h),t.clip()),s.drawStripe(t,e,se),t.restore(),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ce=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=(L>0?L:-L)*W,K=L>0?0:255;L!==0&&(s.colorFillStyle(t,K,K,K,se),p?t.fill(g):t.fill())},Te=function(){if(P>0){if(t.lineWidth=P,t.lineCap=D,t.lineJoin=O,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($!=="center"){if(t.save(),t.lineWidth*=2,$==="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 se=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=se}t.setLineDash&&t.setLineDash([])}},ge=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(q){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 se=s.getNodeShape(e),K=P;$==="inside"&&(K=0),$==="outside"&&(K*=2);var de=(o+K+(B+Q))/o,X=(l+K+(B+Q))/l,Fe=o*de,ke=l*X,Ye=s.nodeShapes[se].points,Ie;if(p){var ze=re(Fe,ke,se,Ye);Ie=ze.path}if(se==="ellipse")s.drawEllipsePath(Ie||t,W.x,W.y,Fe,ke);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(se)){var De=0,Ke=0,Be=0;se==="round-diamond"?De=(K+Q+B)*1.4:se==="round-heptagon"?(De=(K+Q+B)*1.075,Be=-(K/2+Q+B)/35):se==="round-hexagon"?De=(K+Q+B)*1.12:se==="round-pentagon"?(De=(K+Q+B)*1.13,Be=-(K/2+Q+B)/15):se==="round-tag"?(De=(K+Q+B)*1.12,Ke=(K/2+B+Q)*.07):se==="round-triangle"&&(De=(K+Q+B)*(Math.PI/2),Be=-(K+Q/2+B)/Math.PI),De!==0&&(de=(o+De)/o,Fe=o*de,["round-hexagon","round-tag"].includes(se)||(X=(l+De)/l,ke=l*X)),j=j==="auto"?gMe(Fe,ke):j;for(var nt=Fe/2,Le=ke/2,pt=j+(K+B+Q)/2,Me=new Array(Ye.length/2),Ct=new Array(Ye.length/2),wt=0;wt0){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()}}}};_g.drawNodeOverlay=TLe("overlay");_g.drawNodeUnderlay=TLe("underlay");_g.hasPie=function(t){return t=t[0],t._private.hasPie};_g.hasStripe=function(t){return t=t[0],t._private.hasStripe};_g.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,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,T=v/100;T+g>1&&(T=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var S=2*Math.PI*T,C=k+S;v===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=T)}};_g.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,x=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],x),t.fill(),u+=b)}t.restore()};var El={},vqt=100;El.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};El.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 x=r.style(),b=r.zoom(),T=s!==void 0?s:b,k=r.pan(),S={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},E=e.prevViewport,A=E===void 0||C.zoom!==E.zoom||C.pan.x!==E.pan.x||C.pan.y!==E.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),T*=l,S.x*=l,S.y*=l;var M=e.getCachedZSortedEles();function L(Z,J,re,ee,me){var te=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(J,re,ee,me),Z.globalCompositeOperation=te}function P(Z,J){var re,ee,me,te;!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:k.x*p,y:k.y*p},ee=b*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(re=S,ee=T,me=e.canvasWidth,te=e.canvasHeight),Z.setTransform(1,0,0,1,0,0),J==="motionBlur"?L(Z,0,0,me,te):!n&&(J===void 0||J)&&Z.clearRect(0,0,me,te),i||(Z.translate(re.x,re.y),Z.scale(ee,ee)),o&&Z.translate(o.x,o.y),s&&Z.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 N=e.data.bufferContexts[e.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var _=u.contexts[e.NODE],I=e.textureCache.texture,C=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),f?L(_,0,0,C.width,C.height):_.clearRect(0,0,C.width,C.height);var O=x.core("outside-texture-bg-color").value,D=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,O[0],O[1],O[2],D),_.fillRect(0,0,C.width,C.height);var b=r.zoom();P(_,!1),_.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),_.drawImage(I,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var $=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,H=[];if(H[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,H[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),H[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,H[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||H[e.NODE]){var B=f&&!H[e.NODE]&&p!==1,_=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!B?"motionBlur":void 0;P(_,V),z?e.drawCachedNodes(_,M.nondrag,l,$):e.drawLayeredElements(_,M.nondrag,l,$),e.debug&&e.drawDebugPoints(_,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||H[e.DRAG])){var B=f&&!H[e.DRAG]&&p!==1,_=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(_,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(_,M.drag,l,$):e.drawCachedElements(_,M.drag,l,$),e.debug&&e.drawDebugPoints(_,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ae=function(J,re,ee){J.setTransform(1,0,0,1,0,0),ee||!v?J.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(J,0,0,e.canvasWidth,e.canvasHeight);var me=p;J.drawImage(re,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||H[e.NODE])&&(ae(q,G,H[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||H[e.DRAG])&&(ae(Q,j,H[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,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()},vqt)),n||r.emit("render")};var zk;El.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",!zk){var v=h.measureText(y);zk=v.actualBoundingBoxAscent}h.fillText(y,0,zk);var x=60;h.strokeRect(0,zk+10,250,20),h.fillRect(0,zk+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Fpe(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 bqt(t,e,r){var n=Fpe(t,t.VERTEX_SHADER,e),i=Fpe(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 xqt(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 bee(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 wqt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function Tqt(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 kqt(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 Cqt(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 Sqt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Eqt(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 kLe(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 CLe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Aqt(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 Rqt(t,e,r,n){var i=kLe(t,e),a=Ga(i,2),s=a[0],o=a[1],l=CLe(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 mh(t,e,r,n){var i=kLe(t,r),a=Ga(i,3),s=a[0],o=a[1],l=a[2],u=CLe(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,T){if(i&&T){var k=T.context,S=b.x,C=b.row,E=S,A=l*C;k.save(),k.translate(E,A),k.scale(h,h),i(k,n),k.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,T=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,S=d-k,C=l;{var E=a.freePointer.x,A=a.freePointer.row*l,M=k;T.context.drawImage(b,0,0,M,C,E,A,M,C),g[0]={x:E,y:A,w:M,h:f}}{var L=k,P=(a.freePointer.row+1)*l,N=S;T&&T.context.drawImage(b,L,0,N,C,0,P,N,C),g[1]={x:0,y:P,w:N,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=Ul(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=Ul(this.renderTypes.values()),v;try{var x=function(){var T=v.value,k=T.type;if(h(k)){var S=n.collections.get(T.collection),C=T.getKey(m),E=Array.isArray(C)?C:[C];if(s)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),M=n._key(k,A),L=n.typeAndIdToKey.get(M);L!==void 0&&!Cqt(E,L)&&(d=!0,n.typeAndIdToKey.delete(M),L.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)x()}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=Ul(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=Ga(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=Ul(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ga(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}}])})(),Pqt=(function(){function t(e){Eg(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ag(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}}])})(),Bqt=` +*/var qMe=function(e,r){this.recycle(e,r)};function Bk(){return!1}function r8(){return!0}qMe.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Bk,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?r8:Bk):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=r8;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=r8;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=r8,this.stopPropagation()},isDefaultPrevented:Bk,isPropagationStopped:Bk,isImmediatePropagationStopped:Bk};var GMe=/^([^.]+)(\.(?:[^.]+))?$/,zVt=".*",UMe={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},cpe=Object.keys(UMe),HVt={};function aD(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HVt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};ag.removeAllListeners=function(){return this.removeListener("*")};ag.emit=ag.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,yi(e)||(e=[e]),VVt(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===zVt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&LFt(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&&Ar(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":bs(Symbol))!=e&&bs(Symbol.iterator)!=e;r&&(zL[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return j9e({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(zn(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Ar(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)}});No.neighbourhood=No.neighborhood;No.closedNeighbourhood=No.closedNeighborhood;No.openNeighbourhood=No.openNeighborhood;Pr(No,{source:iu(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:iu(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:gpe({attr:"source"}),targets:gpe({attr:"target"})});function gpe(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]}});No.componentsOf=No.components;var uo=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){Ji("A collection must have a reference to the core");return}var a=new Tf,s=!1;if(!r)r=[];else if(r.length>0&&zn(r[0])&&!FE(r[0])){s=!0;for(var o=[],l=new U3,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 uo(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(_){for(var I=_._private.edges,O=0;O0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var P=0;P0?P=_:L=_;while(Math.abs(N)>s&&++I=a?x(M,I):O===0?I:T(M,L,L+u)}var S=!1;function C(){S=!0,(t!==e||r!==n)&&b()}var E=function(L){return S||C(),t===e&&r===n?L:L===0?0:L===1?1:y(k(L),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return A},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var JVt=(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}})(),ki=function(e,r,n,i){var a=QVt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},RR={linear:function(e,r,n){return e+(r-e)*n},ease:ki(.25,.1,.25,1),"ease-in":ki(.42,0,1,1),"ease-out":ki(0,0,.58,1),"ease-in-out":ki(.42,0,.58,1),"ease-in-sine":ki(.47,0,.745,.715),"ease-out-sine":ki(.39,.575,.565,1),"ease-in-out-sine":ki(.445,.05,.55,.95),"ease-in-quad":ki(.55,.085,.68,.53),"ease-out-quad":ki(.25,.46,.45,.94),"ease-in-out-quad":ki(.455,.03,.515,.955),"ease-in-cubic":ki(.55,.055,.675,.19),"ease-out-cubic":ki(.215,.61,.355,1),"ease-in-out-cubic":ki(.645,.045,.355,1),"ease-in-quart":ki(.895,.03,.685,.22),"ease-out-quart":ki(.165,.84,.44,1),"ease-in-out-quart":ki(.77,0,.175,1),"ease-in-quint":ki(.755,.05,.855,.06),"ease-out-quint":ki(.23,1,.32,1),"ease-in-out-quint":ki(.86,0,.07,1),"ease-in-expo":ki(.95,.05,.795,.035),"ease-out-expo":ki(.19,1,.22,1),"ease-in-out-expo":ki(1,0,0,1),"ease-in-circ":ki(.6,.04,.98,.335),"ease-out-circ":ki(.075,.82,.165,1),"ease-in-out-circ":ki(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return RR.linear;var i=JVt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":ki};function vpe(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 bpe(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function $v(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=bpe(t,i),o=bpe(e,i);if(Zt(s)&&Zt(o))return vpe(a,s,o,r,n);if(yi(s)&&yi(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=RR[p].apply(null,g)):s.easingImpl=RR[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,x=s.position;if(x&&i&&!t.locked()){var b={};Fk(v.x,x.x)&&(b.x=$v(v.x,x.x,y,m)),Fk(v.y,x.y)&&(b.y=$v(v.y,x.y,y,m)),t.position(b)}var T=s.startPan,k=s.pan,S=a.pan,C=k!=null&&n;C&&(Fk(T.x,k.x)&&(S.x=$v(T.x,k.x,y,m)),Fk(T.y,k.y)&&(S.y=$v(T.y,k.y,y,m)),t.emit("pan"));var E=s.startZoom,A=s.zoom,M=A!=null&&n;M&&(Fk(E,A)&&(a.zoom=v6(a.minZoom,$v(E,A,y,m),a.maxZoom)),t.emit("zoom")),(C||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var P=0;P=0;C--){var E=S[C];E()}S.splice(0,S.length)},x=p.length-1;x>=0;x--){var b=p[x],T=b._private;if(T.stopped){p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||tWt(h,b,t),eWt(h,b,t,d),T.applying&&(T.applying=!1),v(T.frames),T.step!=null&&T.step(t),b.completed()&&(p.splice(x,1),T.hooked=!1,T.playing=!1,T.started=!1,v(T.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 rWt={animate:ri.animate(),animation:ri.animation(),animated:ri.animated(),clearQueue:ri.clearQueue(),delay:ri.delay(),delayAnimation:ri.delayAnimation(),stop:ri.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&&DL(function(a){xpe(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){xpe(s,e)},n.beforeRenderPriorities.animations):r()}},nWt={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&&FE(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}},i8=function(e){return Ar(e)?new ng(e):e},QMe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new aD(nWt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,i8(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,i8(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,i8(r),n),this},once:function(e,r,n){return this.emitter().one(e,i8(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}};ri.eventAliasesOn(QMe);var JG={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)}};JG.jpeg=JG.jpg;var _R={layout:function(e){var r=this;if(e==null){Ji("Layout options must be specified to make a layout");return}if(e.name==null){Ji("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Ji("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Ar(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Pr({},e,{cy:r,eles:a}));return s}};_R.createLayout=_R.makeLayout=_R.layout;var iWt={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)}};eU.invalidateDimensions=eU.resize;var MR={collection:function(e,r){return Ar(e)?this.$(e):xc(e)?e.collection():yi(e)?(r||(r={}),new uo(this,e,r.unique,r.removed)):new uo(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}};MR.elements=MR.filter=MR.$;var Fs={},VC="t",sWt="f";Fs.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&&(T=1),o.color){var S=n.valueMin[0],C=n.valueMax[0],E=n.valueMin[1],A=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(S+(C-S)*T),Math.round(E+(A-E)*T),Math.round(M+(L-M)*T),Math.round(P+(N-P)*T)];a={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*T;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 O=n.field.split("."),D=d.data,$=0;$0&&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)};Fs.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)};Fs.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)})};Fs.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Fs.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()})})};Fs.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()})})};Fs.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 UE={};UE.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){ii("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 ng(d);if(f.invalid){ii("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){ii("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var x=v[1],b=v[2],T=e.properties[x];if(!T){ii("Skipping property: Invalid property name in: "+s),l();continue}var k=r.parse(x,b);if(!k){ii("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:x,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 ii("`"+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,x=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(x)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+/):yi(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var T=[],k=[],S=[],C="",E=!1,A=0;A0?" ":"")+M.strValue}return u.validate&&!u.validate(T,k)?null:u.singleEnum&&E?T.length===1&&Ar(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:C,bypass:r,units:k}}var L=function(){for(var Z=0;Zu.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?O.pfValue=e:O.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(O.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(O.pfValue=P==="rad"?e:rzt(e)),P==="%"&&(O.pfValue=e/100),O}else if(u.propList){var D=[],$=""+e;if($!=="none"){for(var F=$.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),Zt(e)?s=e:zn(e)&&(s=e.level,e.position!=null?a=QN(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;Zt(u.x)&&(r.pan.x=u.x,o=!1),Zt(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(Ar(e)){var n=e;e=this.mutableElements().filter(n)}else xc(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}};dy.centre=dy.center;dy.autolockNodes=dy.autolock;dy.autoungrabifyNodes=dy.autoungrabify;var T6={data:ri.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ri.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ri.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ri.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};T6.attr=T6.data;T6.removeAttr=T6.removeData;var k6=function(e){var r=this;e=Pr({},e);var n=e.container;n&&!NL(n)&&NL(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=ls!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Pr({name:s?"grid":"null"},o.layout),o.renderer=Pr({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 uo(this),listeners:[],aniEles:new uo(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:Zt(o.zoom)?o.zoom:1,pan:{x:zn(o.pan)&&Zt(o.pan.x)?o.pan.x:0,y:zn(o.pan)&&Zt(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(KBt);if(y)return Y3.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Pr({},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&&(zn(g)||yi(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 x=Pr({},r._private.options.layout);x.eles=r.elements(),r.layout(x).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,ua(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=vl(o?t.boundingBox:structuredClone(e.extent())),u;if(xc(t.roots))u=t.roots;else if(yi(t.roots)){for(var h=[],d=0;d0;){var _=N(),I=A(_,L);if(I)_.outgoers().filter(function(ce){return ce.isNode()&&r.has(ce)}).forEach(P);else if(I===null){ii("Detected double maximal shift for node `"+_.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var D=0;D0&&v[0].length<=3?Ae/2:0),le=2*Math.PI/v[Ve].length*we;return Ve===0&&v[0].length===1&&(Ue=1),{x:ee.x+Ue*Math.cos(le),y:ee.y+Ue*Math.sin(le)}}else{var pe=v[Ve].length,Ce=Math.max(pe===1?0:o?(l.w-t.padding*2-me.w)/((t.grid?$e:pe)-1):(l.w-t.padding*2-me.w)/((t.grid?$e:pe)+1),O),oe={x:ee.x+(we+1-(pe+1)/2)*Ce,y:ee.y+(Ve+1-(G+1)/2)*te};return oe}},He={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(He).indexOf(t.direction)===-1&&Ji("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(He).join(", ")));var ue=function(Te){return SFt(Oe(Te),l,He[t.direction])};return r.nodes().layoutPositions(this,t,ue),this};var hWt={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 eLe(t){this.options=Pr({},hWt,t)}eLe.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=vl(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),x=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+x*x));h=Math.max(b,h)}var T=function(S,C){var E=e.startAngle+C*u*(i?1:-1),A=h*Math.cos(E),M=h*Math.sin(E),L={x:o.x+A,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,T),this};var dWt={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 tLe(t){this.options=Pr({},dWt,t)}tLe.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=vl(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 k=Math.abs(x[0].value-T.value);k>=y&&(x=[],v.push(x))}x.push(T)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-S,A=E/(v.length+C?1:0);S=Math.min(S,A)}for(var M=0,L=0;L1&&e.avoidOverlap){var I=Math.cos(_)-Math.cos(0),O=Math.sin(_)-Math.sin(0),D=Math.sqrt(S*S/(I*I+O*O));M=Math.max(D,M)}P.r=M,M+=S}if(e.equidistant){for(var $=0,F=0,z=0;z=t.numIter||(bWt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),DL(h)}};h()}else{for(;u;)u=s(l),l++;kpe(n,t),o()}return this};uD.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};uD.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var pWt=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=vl(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},rLe=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=VL(e,o,l),y=VL(r,-1*o,-1*l),v=y.x-m.x,x=y.y-m.y,b=v*v+x*x,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*x/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},TWt=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},VL=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)},kWt=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}}}}},SWt=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},iLe=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)}}},RWt={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 aLe(t){this.options=Pr({},RWt,t)}aLe.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=vl(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(V){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(q){if(q==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=q:u=q},d=function(q){if(q==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=q:u=q},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 x=a.w/u,b=a.h/l;if(e.condense&&(x=0,b=0),e.avoidOverlap)for(var T=0;T=u&&(I=0,_++)},D={},$=0;$(I=mzt(t,e,O[D],O[D+1],O[D+2],O[D+3])))return y(C,I),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var O=A.allpts,D=0;D+5(I=gzt(t,e,O[D],O[D+1],O[D+2],O[D+3],O[D+4],O[D+5])))return y(C,I),!0}for(var $=$||E.source,F=F||E.target,z=i.getArrowWidth(M,L),H=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],D=0;D0&&(v($),v(F))}function b(C,E,A){return Jo(C,E,A)}function T(C,E){var A=C._private,M=f,L;E?L=E+"-":L="",C.boundingBox();var P=A.labelBounds[E||"main"],N=C.pstyle(L+"label").value,_=C.pstyle("text-events").strValue==="yes";if(!(!_||!N)){var I=b(A.rscratch,"labelX",E),O=b(A.rscratch,"labelY",E),D=b(A.rscratch,"labelAngle",E),$=C.pstyle(L+"text-margin-x").pfValue,F=C.pstyle(L+"text-margin-y").pfValue,z=P.x1-M-$,H=P.x2+M-$,B=P.y1-M-F,V=P.y2+M-F;if(D){var q=Math.cos(D),G=Math.sin(D),Q=function(me,te){return me=me-I,te=te-O,{x:me*q-te*G+I,y:me*G+te*q+O}},j=Q(z,B),ae=Q(z,V),Z=Q(H,B),J=Q(H,V),re=[j.x+$,j.y+F,Z.x+$,Z.y+F,J.x+$,J.y+F,ae.x+$,ae.y+F];if(Hl(t,e,re))return y(C),!0}else if(wp(P,t,e))return y(C),!0}}for(var k=s.length-1;k>=0;k--){var S=s[k];S.isNode()?v(S)||T(S):x(S)||T(S)||T(S,"source")||T(S,"target")}return o};Wy.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=vl({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(me,te,$e){return Jo(me,te,$e)}function y(me,te){var $e=me._private,Oe=s,He="";me.boundingBox();var ue=$e.labelBounds.main;if(!ue)return null;var ce=m($e.rscratch,"labelX",te),Te=m($e.rscratch,"labelY",te),ge=m($e.rscratch,"labelAngle",te),Ve=me.pstyle(He+"text-margin-x").pfValue,we=me.pstyle(He+"text-margin-y").pfValue,Ae=ue.x1-Oe-Ve,Ue=ue.x2+Oe-Ve,le=ue.y1-Oe-we,pe=ue.y2+Oe-we;if(ge){var Ce=Math.cos(ge),oe=Math.sin(ge),fe=function(se,K){return se=se-ce,K=K-Te,{x:se*Ce-K*oe+ce,y:se*oe+K*Ce+Te}};return[fe(Ae,le),fe(Ue,le),fe(Ue,pe),fe(Ae,pe)]}else return[{x:Ae,y:le},{x:Ue,y:le},{x:Ue,y:pe},{x:Ae,y:pe}]}function v(me,te,$e,Oe){function He(ue,ce,Te){return(Te.y-ue.y)*(ce.x-ue.x)>(ce.y-ue.y)*(Te.x-ue.x)}return He(me,$e,Oe)!==He(te,$e,Oe)&&He(me,te,$e)!==He(me,te,Oe)}for(var x=0;x0?-(Math.PI-e.ang):Math.PI+e.ang},NWt=function(e,r,n,i,a){if(e!==Rpe?_pe(r,e,Ch):$Wt(qc,Ch),_pe(r,n,qc),Epe=Ch.nx*qc.ny-Ch.ny*qc.nx,Ape=Ch.nx*qc.nx-Ch.ny*-qc.ny,Yd=Math.asin(Math.max(-1,Math.min(1,Epe))),Math.abs(Yd)<1e-6){tU=r.x,rU=r.y,fm=Dv=0;return}Lm=1,LR=!1,Ape<0?Yd<0?Yd=Math.PI+Yd:(Yd=Math.PI-Yd,Lm=-1,LR=!0):Yd>0&&(Lm=-1,LR=!0),r.radius!==void 0?Dv=r.radius:Dv=i,Qg=Yd/2,a8=Math.min(Ch.len/2,qc.len/2),a?(gh=Math.abs(Math.cos(Qg)*Dv/Math.sin(Qg)),gh>a8?(gh=a8,fm=Math.abs(gh*Math.sin(Qg)/Math.cos(Qg))):fm=Dv):(gh=Math.min(a8,Dv),fm=Math.abs(gh*Math.sin(Qg)/Math.cos(Qg))),nU=r.x+qc.nx*gh,iU=r.y+qc.ny*gh,tU=nU-qc.ny*fm*Lm,rU=iU+qc.nx*fm*Lm,cLe=r.x+Ch.nx*gh,uLe=r.y+Ch.ny*gh,Rpe=r};function hLe(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 vee(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}:(NWt(t,e,r,n,i),{cx:tU,cy:rU,radius:fm,startX:cLe,startY:uLe,stopX:nU,stopY:iU,startAngle:Ch.ang+Math.PI/2*Lm,endAngle:qc.ang-Math.PI/2*Lm,counterClockwise:LR})}var C6=.01,DWt=Math.sqrt(2*C6),Ho={};Ho.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(k,S,C,E){var A=E-S,M=C-k,L=Math.sqrt(M*M+A*A);return{x:-A/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=Ga(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=Ga(m,2),v=y[0],x=y[1],b={x1:p,y1:g,x2:v,y2:x};i=u(p,g,v,x),a=b}else ii("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}};Ho.findHaystackPoints=function(t){for(var e=0;e0?Math.max(K-de,0):Math.min(K+de,0)},N=P(M,E),_=P(L,A),I=!1;x===u?v=Math.abs(N)>Math.abs(_)?i:n:x===l||x===o?(v=n,I=!0):(x===a||x===s)&&(v=i,I=!0);var O=v===n,D=O?_:N,$=O?L:M,F=aee($),z=!1;!(I&&(T||S))&&(x===o&&$<0||x===l&&$>0||x===a&&$>0||x===s&&$<0)&&(F*=-1,D=F*Math.abs(D),z=!0);var H;if(T){var B=k<0?1+k:k;H=B*D}else{var V=k<0?D:0;H=V+k*F}var q=function(K){return Math.abs(K)=Math.abs(D)},G=q(H),Q=q(Math.abs(D)-Math.abs(H)),j=G||Q;if(j&&!z)if(O){var ae=Math.abs($)<=f/2,Z=Math.abs(M)<=p/2;if(ae){var J=(h.x1+h.x2)/2,re=h.y1,ee=h.y2;r.segpts=[J,re,J,ee]}else if(Z){var me=(h.y1+h.y2)/2,te=h.x1,$e=h.x2;r.segpts=[te,me,$e,me]}else r.segpts=[h.x1,h.y2]}else{var Oe=Math.abs($)<=d/2,He=Math.abs(L)<=g/2;if(Oe){var ue=(h.y1+h.y2)/2,ce=h.x1,Te=h.x2;r.segpts=[ce,ue,Te,ue]}else if(He){var ge=(h.x1+h.x2)/2,Ve=h.y1,we=h.y2;r.segpts=[ge,Ve,ge,we]}else r.segpts=[h.x2,h.y1]}else if(O){var Ae=h.y1+H+(y?f/2*F:0),Ue=h.x1,le=h.x2;r.segpts=[Ue,Ae,le,Ae]}else{var pe=h.x1+H+(y?d/2*F:0),Ce=h.y1,oe=h.y2;r.segpts=[pe,Ce,pe,oe]}if(r.isRound){var fe=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(fe),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};Ho.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=!Zt(r.startX)||!Zt(r.startY),y=!Zt(r.arrowStartX)||!Zt(r.arrowStartY),v=!Zt(r.endX)||!Zt(r.endY),x=!Zt(r.arrowEndX)||!Zt(r.arrowEndY),b=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=b*T,S=uy({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=S$.poolIndex()){var F=D;D=$,$=F}var z=N.srcPos=D.position(),H=N.tgtPos=$.position(),B=N.srcW=D.outerWidth(),V=N.srcH=D.outerHeight(),q=N.tgtW=$.outerWidth(),G=N.tgtH=$.outerHeight(),Q=N.srcShape=r.nodeShapes[e.getNodeShape(D)],j=N.tgtShape=r.nodeShapes[e.getNodeShape($)],ae=N.srcCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Z=N.tgtCornerRadius=$.pstyle("corner-radius").value==="auto"?"auto":$.pstyle("corner-radius").pfValue,J=N.tgtRs=$._private.rscratch,re=N.srcRs=D._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ee=0;ee=DWt||(le=Math.sqrt(Math.max(Ue*Ue,C6)+Math.max(Ae*Ae,C6)));var pe=N.vector={x:Ue,y:Ae},Ce=N.vectorNorm={x:pe.x/le,y:pe.y/le},oe={x:-Ce.y,y:Ce.x};N.nodesOverlap=!Zt(le)||j.checkPoint(ue[0],ue[1],0,q,G,H.x,H.y,Z,J)||Q.checkPoint(Te[0],Te[1],0,B,V,z.x,z.y,ae,re),N.vectorNormInverse=oe,_={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:H,srcRs:J,tgtPos:z,tgtRs:re,srcW:q,srcH:G,tgtW:B,tgtH:V,srcIntn:ge,tgtIntn:ce,srcShape:j,tgtShape:Q,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:Ve.x2,y1:Ve.y2,x2:Ve.x1,y2:Ve.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Ce.x,y:-Ce.y},vectorNormInverse:{x:-oe.x,y:-oe.y}}}var fe=He?_:N;te.nodesOverlap=fe.nodesOverlap,te.srcIntn=fe.srcIntn,te.tgtIntn=fe.tgtIntn,te.isRound=$e.startsWith("round"),i&&(D.isParent()||D.isChild()||$.isParent()||$.isChild())&&(D.parents().anySame($)||$.parents().anySame(D)||D.same($)&&D.isParent())?e.findCompoundLoopPoints(me,fe,ee,Oe):D===$?e.findLoopPoints(me,fe,ee,Oe):$e.endsWith("segments")?e.findSegmentsPoints(me,fe):$e.endsWith("taxi")?e.findTaxiPoints(me,fe):$e==="straight"||!Oe&&N.eles.length%2===1&&ee===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,fe,ee,Oe,He),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,fe),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},C=0;C0){var ue=u,ce=dm(ue,V2(s)),Te=dm(ue,V2(He)),ge=ce;if(Te2){var Ve=dm(ue,{x:He[2],y:He[3]});Ve0){var X=h,Fe=dm(X,V2(s)),ke=dm(X,V2(de)),Ye=Fe;if(ke2){var Ie=dm(X,{x:de[2],y:de[3]});Ie=g||C){y={cp:T,segment:S};break}}if(y)break}var E=y.cp,A=y.segment,M=(g-v)/A.length,L=A.t1-A.t0,P=p?A.t0+L*M:A.t1-L*M;P=v6(0,P,1),e=bb(E.p0,E.p1,E.p2,P),f=PWt(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var N=0,_,I,O,D,$=n.allpts.length,F=0;F+3<$&&(p?(O={x:n.allpts[F],y:n.allpts[F+1]},D={x:n.allpts[F+2],y:n.allpts[F+3]}):(O={x:n.allpts[$-2-F],y:n.allpts[$-1-F]},D={x:n.allpts[$-4-F],y:n.allpts[$-3-F]}),_=uy(O,D),I=N,N+=_,!(N>=g));F+=2);var z=g-I,H=z/_;H=v6(0,H,1),e=izt(O,D,H),f=pLe(O,D);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Sd.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Sd.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=cy(n,t._private.labelDimsKey);if(Jo(r.rscratch,"prefixedLabelDimsKey",e)!==i){Dh(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=Jo(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;Dh(r.rstyle,"labelWidth",e,f),Dh(r.rscratch,"labelWidth",e,f),Dh(r.rstyle,"labelHeight",e,p),Dh(r.rscratch,"labelHeight",e,p),Dh(r.rscratch,"labelLineHeight",e,d),Dh(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};Sd.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(V,q){return q?(Dh(r.rscratch,V,e,q),q):Jo(r.rscratch,V,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 k=v.matchAll(m),S="",C=0,E=Gl(k),A;try{for(E.s();!(A=E.n()).done;){var M=A.value,L=M[0],P=v.substring(C,M.index);C=M.index+L.length;var N=S.length===0?P:S+P+L,_=this.calculateLabelDimensions(t,N),I=_.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 O=t.pstyle("text-max-width").pfValue,D="",$="…",F=!1;if(this.calculateLabelDimensions(t,i).widthO)break;D+=i[z],z===i.length-1&&(F=!0)}return F||(D+=$),D}return i};Sd.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?CVt(r):"center":e};Sd.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,x=0,b=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var At=a(W);pt&&(t.hoverData.tapholdCancelled=!0);var mt=function(){var Kt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Kt.length===0?(Kt.push(nt[0]),Kt.push(nt[1])):(Kt[0]+=nt[0],Kt[1]+=nt[1])};K=!0,i(De,["mousemove","vmousemove","tapdrag"],W,{x:ke[0],y:ke[1]});var ye=function(Kt){return{originalEvent:W,type:Kt,position:{x:ke[0],y:ke[1]}}},Nt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||de.emit(ye("boxstart")),ze[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(pt){var yt=ye("cxtdrag");Be?Be.emit(yt):de.emit(yt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||De!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(ye("cxtdragout")),t.hoverData.cxtOver=De,De&&De.emit(ye("cxtdragover")))}}else if(t.hoverData.dragging){if(K=!0,de.panningEnabled()&&de.userPanningEnabled()){var gt;if(t.hoverData.justStartedPan){var St=t.hoverData.mdownPos;gt={x:(ke[0]-St[0])*X,y:(ke[1]-St[1])*X},t.hoverData.justStartedPan=!1}else gt={x:nt[0]*X,y:nt[1]*X};de.panBy(gt),de.emit(ye("dragpan")),t.hoverData.dragged=!0}ke=t.projectIntoViewport(W.clientX,W.clientY)}else if(ze[4]==1&&(Be==null||Be.pannable())){if(pt){if(!t.hoverData.dragging&&de.boxSelectionEnabled()&&(At||!de.panningEnabled()||!de.userPanningEnabled()))Nt();else if(!t.hoverData.selecting&&de.panningEnabled()&&de.userPanningEnabled()){var tn=s(Be,t.hoverData.downs);tn&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,ze[4]=0,t.data.bgActivePosistion=V2(Ye),t.redrawHint("select",!0),t.redraw())}Be&&Be.pannable()&&Be.active()&&Be.unactivate()}}else{if(Be&&Be.pannable()&&Be.active()&&Be.unactivate(),(!Be||!Be.grabbed())&&De!=Ke&&(Ke&&i(Ke,["mouseout","tapdragout"],W,{x:ke[0],y:ke[1]}),De&&i(De,["mouseover","tapdragover"],W,{x:ke[0],y:ke[1]}),t.hoverData.last=De),Be)if(pt){if(de.boxSelectionEnabled()&&At)Be&&Be.grabbed()&&(m(Le),Be.emit(ye("freeon")),Le.emit(ye("free")),t.dragData.didDrag&&(Be.emit(ye("dragfreeon")),Le.emit(ye("dragfree")))),Nt();else if(Be&&Be.grabbed()&&t.nodeIsDraggable(Be)){var _e=!t.dragData.didDrag;_e&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Le,{inDragLayer:!0});var Je={x:0,y:0};if(Zt(nt[0])&&Zt(nt[1])&&(Je.x+=nt[0],Je.y+=nt[1],_e)){var ut=t.hoverData.dragDelta;ut&&Zt(ut[0])&&Zt(ut[1])&&(Je.x+=ut[0],Je.y+=ut[1])}t.hoverData.draggingEles=!0,Le.silentShift(Je).emit(ye("position")).emit(ye("drag")),t.redrawHint("drag",!0),t.redraw()}}else mt();K=!0}if(ze[2]=ke[0],ze[3]=ke[1],K)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 se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var K=t.cy,de=t.projectIntoViewport(W.clientX,W.clientY),X=t.selection,Fe=t.findNearestElement(de[0],de[1],!0,!1),ke=t.dragData.possibleDragElements,Ye=t.hoverData.down,Ie=a(W);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ye&&Ye.unactivate();var ze=function(Me){return{originalEvent:W,type:Me,position:{x:de[0],y:de[1]}}};if(t.hoverData.which===3){var De=ze("cxttapend");if(Ye?Ye.emit(De):K.emit(De),!t.hoverData.cxtDragged){var Ke=ze("cxttap");Ye?Ye.emit(Ke):K.emit(Ke)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Fe,["mouseup","tapend","vmouseup"],W,{x:de[0],y:de[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ye,["click","tap","vclick"],W,{x:de[0],y:de[1]}),L=!1,W.timeStamp-P<=K.multiClickDebounceTime()?(M&&clearTimeout(M),L=!0,P=null,i(Ye,["dblclick","dbltap","vdblclick"],W,{x:de[0],y:de[1]})):(M=setTimeout(function(){L||i(Ye,["oneclick","onetap","voneclick"],W,{x:de[0],y:de[1]})},K.multiClickDebounceTime()),P=W.timeStamp)),Ye==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(W)&&(K.$(r).unselect(["tapunselect"]),ke.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ke=K.collection()),Fe==Ye&&!t.dragData.didDrag&&!t.hoverData.selecting&&Fe!=null&&Fe._private.selectable&&(t.hoverData.dragging||(K.selectionType()==="additive"||Ie?Fe.selected()?Fe.unselect(["tapunselect"]):Fe.select(["tapselect"]):Ie||(K.$(r).unmerge(Fe).unselect(["tapunselect"]),Fe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Be=K.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),Be.length>0&&t.redrawHint("eles",!0),K.emit(ze("boxend"));var nt=function(Me){return Me.selectable()&&!Me.selected()};K.selectionType()==="additive"||Ie||K.$(r).unmerge(Be).unselect(),Be.emit(ze("box")).stdFilter(nt).select().emit(ze("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 Le=Ye&&Ye.grabbed();m(ke),Le&&(Ye.emit(ze("freeon")),ke.emit(ze("free")),t.dragData.didDrag&&(Ye.emit(ze("dragfreeon")),ke.emit(ze("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 N=[],_=4,I,O=1e5,D=function(W,se){for(var K=0;K=_){var de=N;if(I=D(de,5),!I){var X=Math.abs(de[0]);I=$(de)&&X>5}if(I)for(var Fe=0;Fe5&&(K=aee(K)*5),Ke=K/-250,I&&(Ke/=O,Ke*=3),Ke=Ke*t.wheelSensitivity;var Be=W.deltaMode===1;Be&&(Ke*=33);var nt=ke.zoom()*Math.pow(10,Ke);W.type==="gesturechange"&&(nt=t.gestureStartZoom*W.scale),ke.zoom({level:nt,renderedPosition:{x:De[0],y:De[1]}}),ke.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:ze[0],y:ze[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(fe){t.hasTouchStarted||F(fe)},!0),t.registerBinding(t.container,"mouseout",function(W){var se=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function(W){var se=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me=function(W,se,K,de){return Math.sqrt((K-W)*(K-W)+(de-se)*(de-se))},te=function(W,se,K,de){return(K-W)*(K-W)+(de-se)*(de-se)},$e;t.registerBinding(t.container,"touchstart",$e=function(W){if(t.hasTouchStarted=!0,!!E(W)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,K=t.touchData.now,de=t.touchData.earlier;if(W.touches[0]){var X=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);K[0]=X[0],K[1]=X[1]}if(W.touches[1]){var X=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);K[2]=X[0],K[3]=X[1]}if(W.touches[2]){var X=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);K[4]=X[0],K[5]=X[1]}var Fe=function(At){return{originalEvent:W,type:At,position:{x:K[0],y:K[1]}}};if(W.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var ke=t.findContainerClientCoords();ae=ke[0],Z=ke[1],J=ke[2],re=ke[3],z=W.touches[0].clientX-ae,H=W.touches[0].clientY-Z,B=W.touches[1].clientX-ae,V=W.touches[1].clientY-Z,ee=0<=z&&z<=J&&0<=B&&B<=J&&0<=H&&H<=re&&0<=V&&V<=re;var Ye=se.pan(),Ie=se.zoom();q=me(z,H,B,V),G=te(z,H,B,V),Q=[(z+B)/2,(H+V)/2],j=[(Q[0]-Ye.x)/Ie,(Q[1]-Ye.y)/Ie];var ze=200,De=ze*ze;if(G=1){for(var Ct=t.touchData.startPosition=[null,null,null,null,null,null],wt=0;wt=t.touchTapThreshold2}if(se&&t.touchData.cxt){W.preventDefault();var wt=W.touches[0].clientX-ae,ht=W.touches[0].clientY-Z,Bt=W.touches[1].clientX-ae,At=W.touches[1].clientY-Z,mt=te(wt,ht,Bt,At),ye=mt/G,Nt=150,yt=Nt*Nt,gt=1.5,St=gt*gt;if(ye>=St||mt>=yt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var tn=Ie("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(tn),t.touchData.start=null):de.emit(tn)}}if(se&&t.touchData.cxt){var tn=Ie("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(tn):de.emit(tn),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var _e=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||_e!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ie("cxtdragout")),t.touchData.cxtOver=_e,_e&&_e.emit(Ie("cxtdragover")))}else if(se&&W.touches[2]&&de.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||de.emit(Ie("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,K[4]=1,!K||K.length===0||K[0]===void 0?(K[0]=(X[0]+X[2]+X[4])/3,K[1]=(X[1]+X[3]+X[5])/3,K[2]=(X[0]+X[2]+X[4])/3+1,K[3]=(X[1]+X[3]+X[5])/3+1):(K[2]=(X[0]+X[2]+X[4])/3,K[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&W.touches[1]&&!t.touchData.didSelect&&de.zoomingEnabled()&&de.panningEnabled()&&de.userZoomingEnabled()&&de.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Je=t.dragData.touchDragEles;if(Je){t.redrawHint("drag",!0);for(var ut=0;ut0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var He;t.registerBinding(e,"touchcancel",He=function(W){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var ue,ce,Te,ge;if(t.registerBinding(e,"touchend",ue=function(W){var se=t.touchData.start,K=t.touchData.capture;if(K)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var de=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,Fe=X.zoom(),ke=t.touchData.now,Ye=t.touchData.earlier;if(W.touches[0]){var Ie=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);ke[0]=Ie[0],ke[1]=Ie[1]}if(W.touches[1]){var Ie=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);ke[2]=Ie[0],ke[3]=Ie[1]}if(W.touches[2]){var Ie=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);ke[4]=Ie[0],ke[5]=Ie[1]}var ze=function(yt){return{originalEvent:W,type:yt,position:{x:ke[0],y:ke[1]}}};se&&se.unactivate();var De;if(t.touchData.cxt){if(De=ze("cxttapend"),se?se.emit(De):X.emit(De),!t.touchData.cxtDragged){var Ke=ze("cxttap");se?se.emit(Ke):X.emit(Ke)}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 Be=X.collection(t.getAllInBox(de[0],de[1],de[2],de[3]));de[0]=void 0,de[1]=void 0,de[2]=void 0,de[3]=void 0,de[4]=0,t.redrawHint("select",!0),X.emit(ze("boxend"));var nt=function(yt){return yt.selectable()&&!yt.selected()};Be.emit(ze("box")).stdFilter(nt).select().emit(ze("boxselect")),Be.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.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 Le=t.dragData.touchDragEles;if(se!=null){var pt=se._private.grabbed;m(Le),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt&&(se.emit(ze("freeon")),Le.emit(ze("free")),t.dragData.didDrag&&(se.emit(ze("dragfreeon")),Le.emit(ze("dragfree")))),i(se,["touchend","tapend","vmouseup","tapdragout"],W,{x:ke[0],y:ke[1]}),se.unactivate(),t.touchData.start=null}else{var Me=t.findNearestElement(ke[0],ke[1],!0,!0);i(Me,["touchend","tapend","vmouseup","tapdragout"],W,{x:ke[0],y:ke[1]})}var Ct=t.touchData.startPosition[0]-ke[0],wt=Ct*Ct,ht=t.touchData.startPosition[1]-ke[1],Bt=ht*ht,At=wt+Bt,mt=At*Fe*Fe;t.touchData.singleTouchMoved||(se||X.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],W,{x:ke[0],y:ke[1]}),ce=!1,W.timeStamp-ge<=X.multiClickDebounceTime()?(Te&&clearTimeout(Te),ce=!0,ge=null,i(se,["dbltap","vdblclick"],W,{x:ke[0],y:ke[1]})):(Te=setTimeout(function(){ce||i(se,["onetap","voneclick"],W,{x:ke[0],y:ke[1]})},X.multiClickDebounceTime()),ge=W.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&mt"u"){var Ve=[],we=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}},Ae=function(W){return{event:W,touch:we(W)}},Ue=function(W){Ve.push(Ae(W))},le=function(W){for(var se=0;se0)return B[0]}return null},g=Object.keys(f),m=0;m0?p:mMe(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?rg(i,a):l;var u=2*l;if(Kf(e,r,this.points,s,o,i,a-u,[0,-1],n)||Kf(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!!(Hl(e,r,f)||l1(e,r,u,u,s+i/2-l,o+a/2-l,n)||l1(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};x0.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ko(3,0)),this.generateRoundPolygon("round-triangle",Ko(3,0)),this.generatePolygon("rectangle",Ko(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",Ko(5,0)),this.generateRoundPolygon("round-pentagon",Ko(5,0)),this.generatePolygon("hexagon",Ko(6,0)),this.generateRoundPolygon("round-hexagon",Ko(6,0)),this.generatePolygon("heptagon",Ko(7,0)),this.generateRoundPolygon("round-heptagon",Ko(7,0)),this.generatePolygon("octagon",Ko(8,0)),this.generateRoundPolygon("round-octagon",Ko(8,0));var n=new Array(20);{var i=GG(5,0),a=GG(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*T)break}else if(u){if(x>=e.deqCost*p||x>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*Pz)break;var k=e.deq(n,y,m);if(k.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||ree;i.beforeRender(s,o(n))}}}},HWt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:OL;Eg(this,t),this.idsByKey=new Tf,this.keyForId=new Tf,this.cachesByLvl=new Tf,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ag(t,[{key:"getIdsFor",value:function(r){r==null&&Ji("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new U3,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 Tf,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}}])})(),$pe=25,s8=50,IR=-4,aU=3,wLe=7.99,VWt=8,WWt=1024,qWt=1024,GWt=1024,UWt=.2,YWt=.8,jWt=10,XWt=.15,KWt=.1,ZWt=.9,QWt=.9,JWt=100,eqt=1,q2={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},tqt=mo({getKey:null,doesEleInvalidateKey:OL,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:cMe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),F5=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=tqt(r);Pr(n,i),n.lookup=new HWt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ws=F5.prototype;ws.reasons=q2;ws.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};ws.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};ws.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new qE(function(r,n){return n.reqs-r.reqs});return e};ws.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};ws.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(iee(o*r))),n=wLe||n>aU)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<=$pe?g=$pe:h<=s8?g=s8:g=Math.ceil(h/s8)*s8,h>GWt||d>qWt)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=a.getElement(t,e,r,L,q2.downscale);M()}else return a.queueElement(t,S.level-1),S;else{var P;if(!b&&!T&&!k)for(var N=n-1;N>=IR;N--){var _=l.get(t,N);if(_){P=_;break}}if(x(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+VWt),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};ws.invalidateElements=function(t){for(var e=0;e=UWt*t.width&&this.retireTexture(t)};ws.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>YWt&&t.fullnessChecks>=jWt?tg(r,t):t.fullnessChecks++};ws.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;tg(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,nee(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),tg(i,s),n.push(s),s}};ws.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}};ws.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,q2.dequeue)}return i};ws.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=tee,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};ws.onDequeue=function(t){this.onDequeues.push(t)};ws.offDequeue=function(t){tg(this.onDequeues,t)};ws.setupDequeueing=xLe.setupDequeueing({deqRedrawThreshold:JWt,deqCost:XWt,deqAvgCost:KWt,deqNoDrawCost:ZWt,deqFastCost:QWt,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=nqt||r>qL)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 O=r+I;WC<=O&&O<=qL&&!M(O);O+=I);};L(1),L(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&tg(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=vl();for(var M=0;MDpe||N>Dpe)return null;var _=P*N;if(_>hqt)return null;var I=n.makeLayer(d,r);if(L!=null){var O=h.indexOf(L)+1;h.splice(O,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,x=t.length/rqt,b=!o,T=0;T=x||!gMe(v.bb,k.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,k):n.drawEleInLayer(v,k,r,e),v.eles.push(k),C[r]=v}return p||(b?null:h)};yo.getEleLevelForLayerLevel=function(t,e){return t};yo.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,dqt),a.setImgSmoothing(s,!0))};yo.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};yo.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};yo.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Xf(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};yo.invalidateLayer=function(t){if(this.lastInvalidationTime=Xf(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];tg(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,x=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")},T=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")},k=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;s.drawArrowheads(t,e,I)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,N=v*P;t.translate(M,L),b(N),C(N),t.translate(-M,-L)}else T();S(),b(),C(),k(),E(),r&&t.translate(l.x1,l.y1)}};var CLe=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")}}}};w0.drawEdgeOverlay=CLe("overlay");w0.drawEdgeUnderlay=CLe("underlay");w0.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)};qy.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 kqt(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 Fpe(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()}qy.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=Jo(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};qy.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=Jo(s,"labelX",r),u=Jo(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=Jo(s,"labelWidth",r),m=Jo(s,"labelHeight",r),y=Jo(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,x=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),T=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;b&&(T="center",k="center"),l+=v,u+=x;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 C=n3(T),E=i3(k);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var A=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,N=e.pstyle("text-background-shape").strValue,_=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",O=2;if(A>0||L>0&&M>0){var D=t.fillStyle,$=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,H=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,V=A>0,q=L>0&&M>0,G=l-P;switch(C){case"left":G-=g;break;case"center":G-=g/2;break}var Q=u-m-P,j=g+2*P,ae=m+2*P;if(V&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")")),q&&(t.strokeStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[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(_?(t.beginPath(),Fpe(t,G,Q,j,ae,O)):I?(t.beginPath(),kqt(t,G,Q,j,ae)):(t.beginPath(),t.rect(G,Q,j,ae)),V&&t.fill(),q&&t.stroke(),q&&B==="double"){var Z=L/2;t.beginPath(),_?Fpe(t,G+Z,Q+Z,j-2*Z,ae-2*Z,O):t.rect(G+Z,Q+Z,j-2*Z,ae-2*Z),t.stroke()}t.fillStyle=D,t.strokeStyle=$,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),u-=y,e.pstyle("text-wrap").value==="wrap"){var re=Jo(s,"labelWrapCachedLines",r),ee=Jo(s,"labelLineHeight",r),me=g/2,te=this.getLabelJustification(e);switch(te==="auto"||(C==="left"?te==="left"?l+=-g:te==="center"&&(l+=-me):C==="center"?te==="left"?l+=-me:te==="right"&&(l+=me):C==="right"&&(te==="center"?l+=me:te==="right"&&(l+=g))),E){case"top":u-=(re.length-1)*ee;break;case"center":case"bottom":u-=(re.length-1)*ee;break}for(var $e=0;$e0&&t.strokeText(re[$e],l,u),t.fillText(re[$e],l,u),u+=ee}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var _g={};_g.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(!(!Zt(d.x)||!Zt(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 x=e.pstyle("background-image"),b=x.value,T=new Array(b.length),k=new Array(b.length),S=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:N;s.eleFillStyle(t,e,W)},Z=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;s.colorStrokeStyle(t,_[0],_[1],_[2],W)},J=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,V[0],V[1],V[2],W)},re=function(W,se,K,de){var X=s.nodePathCache=s.nodePathCache||[],Fe=lMe(K==="polygon"?K+","+de.join(","):K,""+se,""+W,""+j),ke=X[Fe],Ye,Ie=!1;return ke!=null?(Ye=ke,Ie=!0,h.pathCache=Ye):(Ye=new Path2D,X[Fe]=h.pathCache=Ye),{path:Ye,cacheHit:Ie}},ee=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=re(o,l,ee,me);g=te.path,m=te.cacheHit}var $e=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,j,h)}p?t.fill(g):t.fill()},Oe=function(){for(var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=u.backgrounding,de=0,X=0;X0&&arguments[0]!==void 0?arguments[0]:!1,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,se),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ue=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,se=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,j,h),t.clip()),s.drawStripe(t,e,se),t.restore(),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,j,h)))},ce=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,se=(L>0?L:-L)*W,K=L>0?0:255;L!==0&&(s.colorFillStyle(t,K,K,K,se),p?t.fill(g):t.fill())},Te=function(){if(P>0){if(t.lineWidth=P,t.lineCap=D,t.lineJoin=O,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($!=="center"){if(t.save(),t.lineWidth*=2,$==="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 se=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=se}t.setLineDash&&t.setLineDash([])}},ge=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(q){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 se=s.getNodeShape(e),K=P;$==="inside"&&(K=0),$==="outside"&&(K*=2);var de=(o+K+(B+Q))/o,X=(l+K+(B+Q))/l,Fe=o*de,ke=l*X,Ye=s.nodeShapes[se].points,Ie;if(p){var ze=re(Fe,ke,se,Ye);Ie=ze.path}if(se==="ellipse")s.drawEllipsePath(Ie||t,W.x,W.y,Fe,ke);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(se)){var De=0,Ke=0,Be=0;se==="round-diamond"?De=(K+Q+B)*1.4:se==="round-heptagon"?(De=(K+Q+B)*1.075,Be=-(K/2+Q+B)/35):se==="round-hexagon"?De=(K+Q+B)*1.12:se==="round-pentagon"?(De=(K+Q+B)*1.13,Be=-(K/2+Q+B)/15):se==="round-tag"?(De=(K+Q+B)*1.12,Ke=(K/2+B+Q)*.07):se==="round-triangle"&&(De=(K+Q+B)*(Math.PI/2),Be=-(K+Q/2+B)/Math.PI),De!==0&&(de=(o+De)/o,Fe=o*de,["round-hexagon","round-tag"].includes(se)||(X=(l+De)/l,ke=l*X)),j=j==="auto"?vMe(Fe,ke):j;for(var nt=Fe/2,Le=ke/2,pt=j+(K+B+Q)/2,Me=new Array(Ye.length/2),Ct=new Array(Ye.length/2),wt=0;wt0){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()}}}};_g.drawNodeOverlay=SLe("overlay");_g.drawNodeUnderlay=SLe("underlay");_g.hasPie=function(t){return t=t[0],t._private.hasPie};_g.hasStripe=function(t){return t=t[0],t._private.hasStripe};_g.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,x=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,T=v/100;T+g>1&&(T=1-g);var k=1.5*Math.PI+2*Math.PI*g;k+=o;var S=2*Math.PI*T,C=k+S;v===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,k,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,k,C),t.arc(l,u,p,C,k,!0),t.closePath()),this.colorFillStyle(t,x[0],x[1],x[2],b),t.fill(),g+=T)}};_g.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,x=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],x),t.fill(),u+=b)}t.restore()};var El={},Cqt=100;El.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};El.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 x=r.style(),b=r.zoom(),T=s!==void 0?s:b,k=r.pan(),S={x:k.x,y:k.y},C={zoom:b,pan:{x:k.x,y:k.y}},E=e.prevViewport,A=E===void 0||C.zoom!==E.zoom||C.pan.x!==E.pan.x||C.pan.y!==E.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),T*=l,S.x*=l,S.y*=l;var M=e.getCachedZSortedEles();function L(Z,J,re,ee,me){var te=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(J,re,ee,me),Z.globalCompositeOperation=te}function P(Z,J){var re,ee,me,te;!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:k.x*p,y:k.y*p},ee=b*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(re=S,ee=T,me=e.canvasWidth,te=e.canvasHeight),Z.setTransform(1,0,0,1,0,0),J==="motionBlur"?L(Z,0,0,me,te):!n&&(J===void 0||J)&&Z.clearRect(0,0,me,te),i||(Z.translate(re.x,re.y),Z.scale(ee,ee)),o&&Z.translate(o.x,o.y),s&&Z.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 N=e.data.bufferContexts[e.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var C=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var _=u.contexts[e.NODE],I=e.textureCache.texture,C=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),f?L(_,0,0,C.width,C.height):_.clearRect(0,0,C.width,C.height);var O=x.core("outside-texture-bg-color").value,D=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,O[0],O[1],O[2],D),_.fillRect(0,0,C.width,C.height);var b=r.zoom();P(_,!1),_.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),_.drawImage(I,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var $=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,H=[];if(H[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,H[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),H[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,H[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||H[e.NODE]){var B=f&&!H[e.NODE]&&p!==1,_=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!B?"motionBlur":void 0;P(_,V),z?e.drawCachedNodes(_,M.nondrag,l,$):e.drawLayeredElements(_,M.nondrag,l,$),e.debug&&e.drawDebugPoints(_,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||H[e.DRAG])){var B=f&&!H[e.DRAG]&&p!==1,_=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(_,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(_,M.drag,l,$):e.drawCachedElements(_,M.drag,l,$),e.debug&&e.drawDebugPoints(_,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],j=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ae=function(J,re,ee){J.setTransform(1,0,0,1,0,0),ee||!v?J.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(J,0,0,e.canvasWidth,e.canvasHeight);var me=p;J.drawImage(re,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||H[e.NODE])&&(ae(q,G,H[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||H[e.DRAG])&&(ae(Q,j,H[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=C,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()},Cqt)),n||r.emit("render")};var zk;El.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",!zk){var v=h.measureText(y);zk=v.actualBoundingBoxAscent}h.fillText(y,0,zk);var x=60;h.strokeRect(0,zk+10,250,20),h.fillRect(0,zk+10,250*Math.min(m/x,1),20)}o||(l[r.SELECT_BOX]=!1)}};function zpe(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 Sqt(t,e,r){var n=zpe(t,t.VERTEX_SHADER,e),i=zpe(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 Eqt(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 wee(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 Aqt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function Rqt(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 _qt(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 Mqt(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 Lqt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Iqt(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 ELe(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 ALe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function $qt(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 Nqt(t,e,r,n){var i=ELe(t,e),a=Ga(i,2),s=a[0],o=a[1],l=ALe(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 mh(t,e,r,n){var i=ELe(t,r),a=Ga(i,3),s=a[0],o=a[1],l=a[2],u=ALe(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,T){if(i&&T){var k=T.context,S=b.x,C=b.row,E=S,A=l*C;k.save(),k.translate(E,A),k.scale(h,h),i(k,n),k.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,T=a.canvas;b.clear(),p({x:0,row:0},b);var k=s-a.freePointer.x,S=d-k,C=l;{var E=a.freePointer.x,A=a.freePointer.row*l,M=k;T.context.drawImage(b,0,0,M,C,E,A,M,C),g[0]={x:E,y:A,w:M,h:f}}{var L=k,P=(a.freePointer.row+1)*l,N=S;T&&T.context.drawImage(b,L,0,N,C,0,P,N,C),g[1]={x:0,y:P,w:N,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=Gl(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=Gl(this.renderTypes.values()),v;try{var x=function(){var T=v.value,k=T.type;if(h(k)){var S=n.collections.get(T.collection),C=T.getKey(m),E=Array.isArray(C)?C:[C];if(s)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),M=n._key(k,A),L=n.typeAndIdToKey.get(M);L!==void 0&&!Mqt(E,L)&&(d=!0,n.typeAndIdToKey.delete(M),L.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)x()}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=Gl(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=Ga(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=Gl(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ga(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}}])})(),Wqt=(function(){function t(e){Eg(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ag(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}}])})(),qqt=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,Fqt=` +`,Gqt=` 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); } -`,zqt=` +`,Uqt=` 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; } -`,Hqt=` +`,Yqt=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -1965,7 +1978,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,qC={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},WL={IGNORE:1,USE_BB:2},Bz=0,Wpe=1,qpe=2,Fz=3,Pv=4,s8=5,Hk=6,Vk=7,Vqt=(function(){function t(e,r,n){Eg(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=xqt,this.atlasManager=new Oqt(e,n),this.batchManager=new Pqt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(qC.SCREEN),this.pickingProgram=this._createShaderProgram(qC.PICKING),this.vao=this._createVAO()}return Ag(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 +`,qC={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},GL={IGNORE:1,USE_BB:2},zz=0,qpe=1,Gpe=2,Hz=3,Pv=4,o8=5,Hk=6,Vk=7,jqt=(function(){function t(e,r,n){Eg(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=Eqt,this.atlasManager=new Vqt(e,n),this.batchManager=new Wqt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(qC.SCREEN),this.pickingProgram=this._createShaderProgram(qC.PICKING),this.vao=this._createVAO()}return Ag(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; @@ -2012,7 +2025,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below - if(aVertType == `.concat(Bz,`) { + if(aVertType == `.concat(zz,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -2031,7 +2044,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(Pv," || aVertType == ").concat(Vk,` - || aVertType == `).concat(s8," || aVertType == ").concat(Hk,`) { // simple shapes + || aVertType == `).concat(o8," || aVertType == ").concat(Hk,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -2046,7 +2059,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(Wpe,`) { + else if(aVertType == `).concat(qpe,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -2061,7 +2074,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(qpe,`) { + else if(aVertType == `).concat(Gpe,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -2110,7 +2123,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js vColor = aColor; } - else if(aVertType == `).concat(Fz,` && vid < 3) { + else if(aVertType == `).concat(Hz,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -2155,10 +2168,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js out vec4 outColor; - `).concat(Bqt,` - `).concat(Fqt,` - `).concat(zqt,` - `).concat(Hqt,` + `).concat(qqt,` + `).concat(Gqt,` + `).concat(Uqt,` + `).concat(Yqt,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -2174,12 +2187,12 @@ https://github.com/jquery/jquery/blob/master/src/event.js } void main(void) { - if(vVertType == `).concat(Bz,`) { + if(vVertType == `).concat(zz,`) { // look up the texel from the texture unit `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` } - else if(vVertType == `).concat(Fz,`) { + else if(vVertType == `).concat(Hz,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow @@ -2188,7 +2201,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } else if(vVertType == `).concat(Pv," || vVertType == ").concat(Vk,` - || vVertType == `).concat(s8," || vVertType == ").concat(Hk,`) { // use SDF + || vVertType == `).concat(o8," || vVertType == ").concat(Hk,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -2243,16 +2256,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=bqt(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]:qC.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===WL.IGNORE)return;if(l==WL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Ul(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,x=[[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;Hpe(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;IR(r,r,[h,d]),Vpe(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;IR(r,r,[s,o]),iU(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]=Pv;var o=this.indexBuffer.getView(s);Ov(n,o);var l=this.colorBuffer.getView(s);Jg([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===s8||o===Hk){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===Hk&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Ov(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);Jg(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,T=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);Jg(b,T,k);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var C=x/2;v[0]=C,v[1]=-C}}}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 Pv;case"ellipse":return Vk;case"roundrectangle":case"round-rectangle":return s8;case"bottom-round-rectangle":return Hk;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return rg(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,x=this.transformBuffer.getMatrixView(v);Hpe(x),IR(x,x,[s,o]),iU(x,x,[y,y]),Vpe(x,x,l),this.vertTypeBuffer.getView(v)[0]=Fz;var b=this.indexBuffer.getView(v);Ov(n,b);var T=this.colorBuffer.getView(v);Jg(h,p,T),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]=Wpe;var d=this.indexBuffer.getView(h);Ov(n,d);var f=this.colorBuffer.getView(h);Jg(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?WL.USE_BB:WL.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:kqt,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:zz(e.getLabelKey,null),getBoundingBox:Hz(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:zz(e.getSourceLabelKey,"source"),getBoundingBox:Hz(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:zz(e.getTargetLabelKey,"target"),getBoundingBox:Hz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=VE(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()}),qqt(r)};function Wqt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return Q9e(r)}function ELe(t,e){var r=t._private.rscratch;return Jo(r,"labelWrapCachedLines",e)||[]}var zz=function(e,r){return function(n){var i=e(n),a=ELe(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},Hz=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=ELe(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 qqt(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>vLe?(Gqt(t),e.call(t,a)):(Uqt(t),RLe(t,a,qC.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 Qqt(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 Gqt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Uqt(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 Yqt(t){var e=t.canvasWidth,r=t.canvasHeight,n=bee(t),i=n.pan,a=n.zoom,s=Pz();IR(s,s,[i.x,i.y]),iU(s,s,[a,a]);var o=Pz();Iqt(o,e,r);var l=Pz();return Lqt(l,o,s),l}function ALe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=bee(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 jqt(t,e){t.drawSelectionRectangle(e,function(r){return ALe(t,r)})}function Xqt(t){var e=t.data.contexts[t.NODE];e.save(),ALe(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 Kqt(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&&T.add(C)}return T}function Qqt(t,e,r){var n=Zqt(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Ul(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 Vz(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 RLe(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]&&jqt(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=Yqt(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 Jqt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":bs(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};[xLe,Sd,w0,vee,qy,_g,El,SLe,Mg,jE,LLe].forEach(function(t){Pr(bn,t)});var rGt=[{name:"null",impl:aLe},{name:"base",impl:mLe},{name:"canvas",impl:eGt}],nGt=[{type:"layout",extensions:EWt},{type:"renderer",extensions:rGt}],$Le={},NLe={};function DLe(t,e,r){var n=r,i=function(E){ii("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(T6.prototype[e])return i(e);T6.prototype[e]=r}else if(t==="collection"){if(uo.prototype[e])return i(e);uo.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),zn(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,x){a.call(this,x),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,x){if(v==null&&x==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 T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},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 x=v.edges.slice(),b,T=x.length,k=0;k-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,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,x,b,T,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?T=k[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,T=-s.MAX_VALUE,k,S,C,E,A,M=this.nodes,L=M.length,P=0;Pk&&(v=k),xC&&(b=C),Tk&&(v=k),xC&&(b=C),T=this.nodes.length){var L=0;x.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]=x,_=!0):(u[0]=y,u[1]=m,_=!0):O===$&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=b,u[1]=x,_=!0)),-D===$?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=C,I=!0):D===$&&(f>h?(u[2]=S,u[3]=C,I=!0):(u[2]=L,u[3]=M,I=!0)),_&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection(O,$,4),z=this.getCardinalDirection(D,$,2)):(F=this.getCardinalDirection(-O,$,3),z=this.getCardinalDirection(-D,$,1)):d>p?(F=this.getCardinalDirection(-O,$,1),z=this.getCardinalDirection(-D,$,3)):(F=this.getCardinalDirection(O,$,2),z=this.getCardinalDirection(D,$,4)),!_)switch(F){case 1:B=m,H=h+-k/$,u[0]=H,u[1]=B;break;case 2:H=b,B=d+T*$,u[0]=H,u[1]=B;break;case 3:B=x,H=h+k/$,u[0]=H,u[1]=B;break;case 4:H=v,B=d+-T*$,u[0]=H,u[1]=B;break}if(!I)switch(z){case 1:q=C,V=f+-N/$,u[2]=V,u[3]=q;break;case 2:V=L,q=p+P*$,u[2]=V,u[3]=q;break;case 3:q=M,V=f+N/$,u[2]=V,u[3]=q;break;case 4:V=A,q=p+-P*$,u[2]=V,u[3]=q;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,x=h.y,b=void 0,T=void 0,k=void 0,S=void 0,C=void 0,E=void 0,A=void 0,M=void 0,L=void 0;return k=g-f,C=d-p,A=p*f-d*g,S=x-y,E=m-v,M=v*y-m*x,L=k*E-S*C,L===0?null:(b=(C*M-E*A)/L,T=(S*A-k*M)/L,new a(b,T))},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(k.push(C[0]);k.length>0&&y;){var E=k[0];k.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&C.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(_){if(v.indexOf(_)<0){var I=x.get(_),O=I-1;O==1&&E.push(_),x.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},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,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mk||T>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||T>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*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||k>=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(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.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 C=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return C.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 A=!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(A,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),E={},A=0;A1){var _;for(_=0;_M&&(M=Math.floor(N.y)),P=Math.floor(N.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-N.x/2,p.WORLD_CENTER_Y-N.y/2))},k.radialLayout=function(C,E,A){var M=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(E,null,0,359,0,M);var L=b.calculateBounds(C),P=new T;P.setDeviceOrgX(L.getMinX()),P.setDeviceOrgY(L.getMinY()),P.setWorldOrgX(A.x),P.setWorldOrgY(A.y);for(var N=0;N1;){var q=V[0];V.splice(0,1);var G=$.indexOf(q);G>=0&&$.splice(G,1),H--,F--}E!=null?B=($.indexOf(V[0])+1)%H:B=0;for(var Q=Math.abs(M-A)/F,j=B;z!=F;j=++j%H){var ae=$[j].getOtherEnd(C);if(ae!=E){var Z=(A+z*Q)%360,J=(Z+Q)%360;k.branchRadialLayout(ae,C,Z,J,L+P,P),z++}}},k.maxDiagonalInTree=function(C){for(var E=v.MIN_VALUE,A=0;AE&&(E=L)}return E},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,E={};this.memberGroups={},this.idToDummyNode={};for(var A=[],M=this.graphManager.getAllNodes(),L=0;L"u"&&(E[_]=[]),E[_]=E[_].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var O="DummyCompound_"+I;C.memberGroups[O]=E[I];var D=E[I][0].getParent(),$=new u(C.graphManager);$.id=O,$.paddingLeft=D.paddingLeft||0,$.paddingRight=D.paddingRight||0,$.paddingBottom=D.paddingBottom||0,$.paddingTop=D.paddingTop||0,C.idToDummyNode[O]=$;var F=C.getGraphManager().add(C.newGraph(),$),z=D.getChild();z.add($);for(var H=0;H=0;C--){var E=this.compoundOrder[C],A=E.id,M=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[A],E.rect.x,E.rect.y,M,L)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(A){var M=C.idToDummyNode[A],L=M.paddingLeft,P=M.paddingTop;C.adjustLocations(E[A],M.rect.x,M.rect.y,L,P)})},k.prototype.getToBeTiled=function(C){var E=C.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var A=C.getChild();if(A==null)return this.toBeTiled[E]=!1,!1;for(var M=A.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},k.prototype.getNodeDegree=function(C){C.id;for(var E=C.getEdges(),A=0,M=0;MI&&(I=D.rect.height)}A+=I+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,E){var A=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(M){var L=E[M];A.tiledMemberPack[M]=A.tileNodes(C[M],L.paddingLeft+L.paddingRight),L.rect.width=A.tiledMemberPack[M].width,L.rect.height=A.tiledMemberPack[M].height})},k.prototype.tileNodes=function(C,E){var A=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:A,horizontalPadding:M};C.sort(function(_,I){return _.rect.width*_.rect.height>I.rect.width*I.rect.height?-1:_.rect.width*_.rect.height0&&(N+=C.horizontalPadding),C.rowWidth[A]=N,C.width0&&(_+=C.verticalPadding);var I=0;_>C.rowHeight[A]&&(I=C.rowHeight[A],C.rowHeight[A]=_,I=C.rowHeight[A]-I),C.height+=I,C.rows[A].push(E)},k.prototype.getShortestRowIndex=function(C){for(var E=-1,A=Number.MAX_VALUE,M=0;MA&&(E=M,A=C.rowWidth[M]);return E},k.prototype.canAddHorizontal=function(C,E,A){var M=this.getShortestRowIndex(C);if(M<0)return!0;var L=C.rowWidth[M];if(L+C.horizontalPadding+E<=C.width)return!0;var P=0;C.rowHeight[M]0&&(P=A+C.verticalPadding-C.rowHeight[M]);var N;C.width-L>=E+C.horizontalPadding?N=(C.height+P)/(L+E+C.horizontalPadding):N=(C.height+P)/C.width,P=A+C.verticalPadding;var _;return C.widthP&&E!=A){M.splice(-1,1),C.rows[A].push(L),C.rowWidth[E]=C.rowWidth[E]-P,C.rowWidth[A]=C.rowWidth[A]+P,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var N=Number.MIN_VALUE,_=0;_N&&(N=M[_].height);E>0&&(N+=C.verticalPadding);var I=C.rowHeight[E]+C.rowHeight[A];C.rowHeight[E]=N,C.rowHeight[A]0)for(var z=L;z<=P;z++)F[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(P0)for(var z=N;z<=_;z++)F[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var H=v.MAX_VALUE,B,V,q=0;q0){var _;_=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(_,E,T)}}},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})])})})($R)),$R.exports}var fGt=dGt();const pGt=ky(fGt);ld.use(pGt);function PLe(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}})})}w(PLe,"addNodes");function BLe(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})})}w(BLe,"addEdges");function FLe(t){return new Promise(e=>{const r=bt("body").append("div").attr("id","cy").attr("style","display:none"),n=ld({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),PLe(t.nodes,n),BLe(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=>{he.info("Cytoscape ready",a),e(n)})})}w(FLe,"createCytoscapeInstance");function zLe(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})}w(zLe,"extractPositionedNodes");function HLe(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})}w(HLe,"extractPositionedEdges");async function VLe(t,e){he.debug("Starting cose-bilkent layout algorithm");try{WLe(t);const r=await FLe(t),n=zLe(r),i=HLe(r);return he.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw he.error("Error in cose-bilkent layout algorithm:",r),r}}w(VLe,"executeCoseBilkentLayout");function WLe(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}w(WLe,"validateLayoutData");var gGt=w(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 T={...b};d[b.id]=T,h[b.id]=T,await r(p,b)}else{const T={...b};h[b.id]=T;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=k.node().getBBox();T.width=S.width,T.height=S.height,T.domId=k,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 T=h[b.id];return{...b,width:T.width,height:T.height}})},x=await VLe(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const T=h[b.id];T!=null&&T.domId&&(T.domId.attr("transform",`translate(${b.x}, ${b.y})`),T.x=b.x,T.y=b.y,o.debug(`Positioned node ${T.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const T=t.edges.find(k=>k.id===b.id);T&&(T.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 T=h[b.start??""],k=h[b.end??""];if(T&&k){const S=x.edges.find(C=>C.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const C={...b},E=n(g,C,d,t.type,T,k,t.diagramId);l(C,E)}else{const C={...b,points:[{x:T.x||0,y:T.y||0},{x:k.x||0,y:k.y||0}]},E=n(g,C,d,t.type,T,k,t.diagramId);l(C,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),mGt=gGt;const yGt=Object.freeze(Object.defineProperty({__proto__:null,render:mGt},Symbol.toStringTag,{value:"Module"}));var hD=w((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"),qLe=w((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"};hD(t,r).lower()},"drawBackgroundRect"),vGt=w((t,e)=>{const r=e.text.replace(A3," "),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"),xee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=Ay.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),wee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=Ay.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Nc=w(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Tee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),kee=w(()=>{let t=bt(".mermaidTooltip");return t.empty()&&(t=bt("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"),GL=(function(){var t=w(function(we,Ae,Ue,le){for(Ue=Ue||{},le=we.length;le--;Ue[we[le]]=Ae);return Ue},"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],x=[1,34],b=[1,35],T=[1,36],k=[1,37],S=[1,38],C=[1,39],E=[1,40],A=[1,41],M=[1,42],L=[1,43],P=[1,44],N=[1,45],_=[1,46],I=[1,47],O=[1,48],D=[1,50],$=[1,51],F=[1,52],z=[1,53],H=[1,54],B=[1,55],V=[1,56],q=[1,57],G=[1,58],Q=[1,59],j=[1,60],ae=[14,42],Z=[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],J=[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],re=[1,82],ee=[1,83],me=[1,84],te=[1,85],$e=[12,14,42],Oe=[12,14,33,42],He=[12,14,33,42,76,77,79,80],ue=[12,33],ce=[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],Te={trace:w(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:w(function(Ae,Ue,le,pe,Ce,oe,fe){var W=oe.length-1;switch(Ce){case 3:pe.setDirection("TB");break;case 4:pe.setDirection("BT");break;case 5:pe.setDirection("RL");break;case 6:pe.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:pe.setC4Type(oe[W-3]);break;case 19:pe.setTitle(oe[W].substring(6)),this.$=oe[W].substring(6);break;case 20:pe.setAccDescription(oe[W].substring(15)),this.$=oe[W].substring(15);break;case 21:this.$=oe[W].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=oe[W].trim(),pe.setAccDescription(this.$);break;case 28:oe[W].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 29:oe[W].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 30:pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 31:oe[W].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...oe[W]),this.$=oe[W];break;case 32:pe.addDeploymentNode("node",...oe[W]),this.$=oe[W];break;case 33:pe.addDeploymentNode("nodeL",...oe[W]),this.$=oe[W];break;case 34:pe.addDeploymentNode("nodeR",...oe[W]),this.$=oe[W];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...oe[W]),this.$=oe[W];break;case 40:pe.addPersonOrSystem("external_person",...oe[W]),this.$=oe[W];break;case 41:pe.addPersonOrSystem("system",...oe[W]),this.$=oe[W];break;case 42:pe.addPersonOrSystem("system_db",...oe[W]),this.$=oe[W];break;case 43:pe.addPersonOrSystem("system_queue",...oe[W]),this.$=oe[W];break;case 44:pe.addPersonOrSystem("external_system",...oe[W]),this.$=oe[W];break;case 45:pe.addPersonOrSystem("external_system_db",...oe[W]),this.$=oe[W];break;case 46:pe.addPersonOrSystem("external_system_queue",...oe[W]),this.$=oe[W];break;case 47:pe.addContainer("container",...oe[W]),this.$=oe[W];break;case 48:pe.addContainer("container_db",...oe[W]),this.$=oe[W];break;case 49:pe.addContainer("container_queue",...oe[W]),this.$=oe[W];break;case 50:pe.addContainer("external_container",...oe[W]),this.$=oe[W];break;case 51:pe.addContainer("external_container_db",...oe[W]),this.$=oe[W];break;case 52:pe.addContainer("external_container_queue",...oe[W]),this.$=oe[W];break;case 53:pe.addComponent("component",...oe[W]),this.$=oe[W];break;case 54:pe.addComponent("component_db",...oe[W]),this.$=oe[W];break;case 55:pe.addComponent("component_queue",...oe[W]),this.$=oe[W];break;case 56:pe.addComponent("external_component",...oe[W]),this.$=oe[W];break;case 57:pe.addComponent("external_component_db",...oe[W]),this.$=oe[W];break;case 58:pe.addComponent("external_component_queue",...oe[W]),this.$=oe[W];break;case 60:pe.addRel("rel",...oe[W]),this.$=oe[W];break;case 61:pe.addRel("birel",...oe[W]),this.$=oe[W];break;case 62:pe.addRel("rel_u",...oe[W]),this.$=oe[W];break;case 63:pe.addRel("rel_d",...oe[W]),this.$=oe[W];break;case 64:pe.addRel("rel_l",...oe[W]),this.$=oe[W];break;case 65:pe.addRel("rel_r",...oe[W]),this.$=oe[W];break;case 66:pe.addRel("rel_b",...oe[W]),this.$=oe[W];break;case 67:oe[W].splice(0,1),pe.addRel("rel",...oe[W]),this.$=oe[W];break;case 68:pe.updateElStyle("update_el_style",...oe[W]),this.$=oe[W];break;case 69:pe.updateRelStyle("update_rel_style",...oe[W]),this.$=oe[W];break;case 70:pe.updateLayoutConfig("update_layout_config",...oe[W]),this.$=oe[W];break;case 71:this.$=[oe[W]];break;case 72:oe[W].unshift(oe[W-1]),this.$=oe[W];break;case 73:case 75:this.$=oe[W].trim();break;case 74:let se={};se[oe[W-1].trim()]=oe[W].trim(),this.$=se;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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{14:[1,74]},t(ae,[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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j}),t(ae,[2,14]),t(Z,[2,16],{12:[1,76]}),t(ae,[2,36],{12:[1,77]}),t(J,[2,19]),t(J,[2,20]),{25:[1,78]},{27:[1,79]},t(J,[2,23]),{35:80,75:81,76:re,77:ee,79:me,80:te},{35:86,75:81,76:re,77:ee,79:me,80:te},{35:87,75:81,76:re,77:ee,79:me,80:te},{35:88,75:81,76:re,77:ee,79:me,80:te},{35:89,75:81,76:re,77:ee,79:me,80:te},{35:90,75:81,76:re,77:ee,79:me,80:te},{35:91,75:81,76:re,77:ee,79:me,80:te},{35:92,75:81,76:re,77:ee,79:me,80:te},{35:93,75:81,76:re,77:ee,79:me,80:te},{35:94,75:81,76:re,77:ee,79:me,80:te},{35:95,75:81,76:re,77:ee,79:me,80:te},{35:96,75:81,76:re,77:ee,79:me,80:te},{35:97,75:81,76:re,77:ee,79:me,80:te},{35:98,75:81,76:re,77:ee,79:me,80:te},{35:99,75:81,76:re,77:ee,79:me,80:te},{35:100,75:81,76:re,77:ee,79:me,80:te},{35:101,75:81,76:re,77:ee,79:me,80:te},{35:102,75:81,76:re,77:ee,79:me,80:te},{35:103,75:81,76:re,77:ee,79:me,80:te},{35:104,75:81,76:re,77:ee,79:me,80:te},t($e,[2,59]),{35:105,75:81,76:re,77:ee,79:me,80:te},{35:106,75:81,76:re,77:ee,79:me,80:te},{35:107,75:81,76:re,77:ee,79:me,80:te},{35:108,75:81,76:re,77:ee,79:me,80:te},{35:109,75:81,76:re,77:ee,79:me,80:te},{35:110,75:81,76:re,77:ee,79:me,80:te},{35:111,75:81,76:re,77:ee,79:me,80:te},{35:112,75:81,76:re,77:ee,79:me,80:te},{35:113,75:81,76:re,77:ee,79:me,80:te},{35:114,75:81,76:re,77:ee,79:me,80:te},{35:115,75:81,76:re,77:ee,79:me,80:te},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{12:[1,118],33:[1,117]},{35:119,75:81,76:re,77:ee,79:me,80:te},{35:120,75:81,76:re,77:ee,79:me,80:te},{35:121,75:81,76:re,77:ee,79:me,80:te},{35:122,75:81,76:re,77:ee,79:me,80:te},{35:123,75:81,76:re,77:ee,79:me,80:te},{35:124,75:81,76:re,77:ee,79:me,80:te},{35:125,75:81,76:re,77:ee,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ae,[2,15]),t(Z,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ae,[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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j}),t(J,[2,21]),t(J,[2,22]),t($e,[2,39]),t(Oe,[2,71],{75:81,35:132,76:re,77:ee,79:me,80:te}),t(He,[2,73]),{78:[1,133]},t(He,[2,75]),t(He,[2,76]),t($e,[2,40]),t($e,[2,41]),t($e,[2,42]),t($e,[2,43]),t($e,[2,44]),t($e,[2,45]),t($e,[2,46]),t($e,[2,47]),t($e,[2,48]),t($e,[2,49]),t($e,[2,50]),t($e,[2,51]),t($e,[2,52]),t($e,[2,53]),t($e,[2,54]),t($e,[2,55]),t($e,[2,56]),t($e,[2,57]),t($e,[2,58]),t($e,[2,60]),t($e,[2,61]),t($e,[2,62]),t($e,[2,63]),t($e,[2,64]),t($e,[2,65]),t($e,[2,66]),t($e,[2,67]),t($e,[2,68]),t($e,[2,69]),t($e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ue,[2,28]),t(ue,[2,29]),t(ue,[2,30]),t(ue,[2,31]),t(ue,[2,32]),t(ue,[2,33]),t(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Z,[2,18]),t(ae,[2,38]),t(Oe,[2,72]),t(He,[2,74]),t($e,[2,24]),t($e,[2,35]),t(ce,[2,25]),t(ce,[2,26],{12:[1,138]}),t(ce,[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:w(function(Ae,Ue){if(Ue.recoverable)this.trace(Ae);else{var le=new Error(Ae);throw le.hash=Ue,le}},"parseError"),parse:w(function(Ae){var Ue=this,le=[0],pe=[],Ce=[null],oe=[],fe=this.table,W="",se=0,K=0,de=2,X=1,Fe=oe.slice.call(arguments,1),ke=Object.create(this.lexer),Ye={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(Ye.yy[Ie]=this.yy[Ie]);ke.setInput(Ae,Ye.yy),Ye.yy.lexer=ke,Ye.yy.parser=this,typeof ke.yylloc>"u"&&(ke.yylloc={});var ze=ke.yylloc;oe.push(ze);var De=ke.options&&ke.options.ranges;typeof Ye.yy.parseError=="function"?this.parseError=Ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(ye){le.length=le.length-2*ye,Ce.length=Ce.length-ye,oe.length=oe.length-ye}w(Ke,"popStack");function Be(){var ye;return ye=pe.pop()||ke.lex()||X,typeof ye!="number"&&(ye instanceof Array&&(pe=ye,ye=pe.pop()),ye=Ue.symbols_[ye]||ye),ye}w(Be,"lex");for(var nt,Le,pt,Me,Ct={},wt,ht,Bt,At;;){if(Le=le[le.length-1],this.defaultActions[Le]?pt=this.defaultActions[Le]:((nt===null||typeof nt>"u")&&(nt=Be()),pt=fe[Le]&&fe[Le][nt]),typeof pt>"u"||!pt.length||!pt[0]){var mt="";At=[];for(wt in fe[Le])this.terminals_[wt]&&wt>de&&At.push("'"+this.terminals_[wt]+"'");ke.showPosition?mt="Parse error on line "+(se+1)+`: + `),o=Sqt(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]:qC.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===GL.IGNORE)return;if(l==GL.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=Gl(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,x=[[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;Vpe(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;$R(r,r,[h,d]),Wpe(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;$R(r,r,[s,o]),sU(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]=Pv;var o=this.indexBuffer.getView(s);Ov(n,o);var l=this.colorBuffer.getView(s);Jg([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===o8||o===Hk){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===Hk&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);Ov(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);Jg(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var x=r.pstyle("border-width").value;if(x>0){var b=r.pstyle("border-color").value,T=p*r.pstyle("border-opacity").value,k=this.borderColorBuffer.getView(l);Jg(b,T,k);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-x;else if(S==="outside")v[0]=x,v[1]=0;else{var C=x/2;v[0]=C,v[1]=-C}}}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 Pv;case"ellipse":return Vk;case"roundrectangle":case"round-rectangle":return o8;case"bottom-round-rectangle":return Hk;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return rg(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,x=this.transformBuffer.getMatrixView(v);Vpe(x),$R(x,x,[s,o]),sU(x,x,[y,y]),Wpe(x,x,l),this.vertTypeBuffer.getView(v)[0]=Hz;var b=this.indexBuffer.getView(v);Ov(n,b);var T=this.colorBuffer.getView(v);Jg(h,p,T),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]=qpe;var d=this.indexBuffer.getView(h);Ov(n,d);var f=this.colorBuffer.getView(h);Jg(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?GL.USE_BB:GL.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:_qt,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:Vz(e.getLabelKey,null),getBoundingBox:Wz(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:Vz(e.getSourceLabelKey,"source"),getBoundingBox:Wz(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:Vz(e.getTargetLabelKey,"target"),getBoundingBox:Wz(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=WE(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()}),Kqt(r)};function Xqt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return tMe(r)}function _Le(t,e){var r=t._private.rscratch;return Jo(r,"labelWrapCachedLines",e)||[]}var Vz=function(e,r){return function(n){var i=e(n),a=_Le(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},Wz=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=_Le(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 Kqt(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>wLe?(Zqt(t),e.call(t,a)):(Qqt(t),LLe(t,a,qC.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 iGt(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 Zqt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Qqt(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 Jqt(t){var e=t.canvasWidth,r=t.canvasHeight,n=wee(t),i=n.pan,a=n.zoom,s=Fz();$R(s,s,[i.x,i.y]),sU(s,s,[a,a]);var o=Fz();Bqt(o,e,r);var l=Fz();return Pqt(l,o,s),l}function MLe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=wee(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 eGt(t,e){t.drawSelectionRectangle(e,function(r){return MLe(t,r)})}function tGt(t){var e=t.data.contexts[t.NODE];e.save(),MLe(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 rGt(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&&T.add(C)}return T}function iGt(t,e,r){var n=nGt(t,e,r),i=t.getCachedZSortedEles(),a,s,o=Gl(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 qz(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 LLe(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]&&eGt(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=Jqt(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 aGt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":bs(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};[kLe,Ed,w0,xee,qy,_g,El,RLe,Mg,XE,NLe].forEach(function(t){Pr(bn,t)});var lGt=[{name:"null",impl:lLe},{name:"base",impl:bLe},{name:"canvas",impl:sGt}],cGt=[{type:"layout",extensions:IWt},{type:"renderer",extensions:lGt}],OLe={},PLe={};function BLe(t,e,r){var n=r,i=function(E){ii("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(k6.prototype[e])return i(e);k6.prototype[e]=r}else if(t==="collection"){if(uo.prototype[e])return i(e);uo.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),zn(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,x){a.call(this,x),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,x){if(v==null&&x==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 T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},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 x=v.edges.slice(),b,T=x.length,k=0;k-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,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,x,b,T,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?T=k[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,T=-s.MAX_VALUE,k,S,C,E,A,M=this.nodes,L=M.length,P=0;Pk&&(v=k),xC&&(b=C),Tk&&(v=k),xC&&(b=C),T=this.nodes.length){var L=0;x.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]=x,_=!0):(u[0]=y,u[1]=m,_=!0):O===$&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=b,u[1]=x,_=!0)),-D===$?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=C,I=!0):D===$&&(f>h?(u[2]=S,u[3]=C,I=!0):(u[2]=L,u[3]=M,I=!0)),_&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection(O,$,4),z=this.getCardinalDirection(D,$,2)):(F=this.getCardinalDirection(-O,$,3),z=this.getCardinalDirection(-D,$,1)):d>p?(F=this.getCardinalDirection(-O,$,1),z=this.getCardinalDirection(-D,$,3)):(F=this.getCardinalDirection(O,$,2),z=this.getCardinalDirection(D,$,4)),!_)switch(F){case 1:B=m,H=h+-k/$,u[0]=H,u[1]=B;break;case 2:H=b,B=d+T*$,u[0]=H,u[1]=B;break;case 3:B=x,H=h+k/$,u[0]=H,u[1]=B;break;case 4:H=v,B=d+-T*$,u[0]=H,u[1]=B;break}if(!I)switch(z){case 1:q=C,V=f+-N/$,u[2]=V,u[3]=q;break;case 2:V=L,q=p+P*$,u[2]=V,u[3]=q;break;case 3:q=M,V=f+N/$,u[2]=V,u[3]=q;break;case 4:V=A,q=p+-P*$,u[2]=V,u[3]=q;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,x=h.y,b=void 0,T=void 0,k=void 0,S=void 0,C=void 0,E=void 0,A=void 0,M=void 0,L=void 0;return k=g-f,C=d-p,A=p*f-d*g,S=x-y,E=m-v,M=v*y-m*x,L=k*E-S*C,L===0?null:(b=(C*M-E*A)/L,T=(S*A-k*M)/L,new a(b,T))},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(k.push(C[0]);k.length>0&&y;){var E=k[0];k.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&C.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(_){if(v.indexOf(_)<0){var I=x.get(_),O=I-1;O==1&&E.push(_),x.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},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,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mk||T>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||T>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*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||k>=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(C);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},k.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 C=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return C.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 A=!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(A,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),E={},A=0;A1){var _;for(_=0;_M&&(M=Math.floor(N.y)),P=Math.floor(N.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-N.x/2,p.WORLD_CENTER_Y-N.y/2))},k.radialLayout=function(C,E,A){var M=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(E,null,0,359,0,M);var L=b.calculateBounds(C),P=new T;P.setDeviceOrgX(L.getMinX()),P.setDeviceOrgY(L.getMinY()),P.setWorldOrgX(A.x),P.setWorldOrgY(A.y);for(var N=0;N1;){var q=V[0];V.splice(0,1);var G=$.indexOf(q);G>=0&&$.splice(G,1),H--,F--}E!=null?B=($.indexOf(V[0])+1)%H:B=0;for(var Q=Math.abs(M-A)/F,j=B;z!=F;j=++j%H){var ae=$[j].getOtherEnd(C);if(ae!=E){var Z=(A+z*Q)%360,J=(Z+Q)%360;k.branchRadialLayout(ae,C,Z,J,L+P,P),z++}}},k.maxDiagonalInTree=function(C){for(var E=v.MIN_VALUE,A=0;AE&&(E=L)}return E},k.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},k.prototype.groupZeroDegreeMembers=function(){var C=this,E={};this.memberGroups={},this.idToDummyNode={};for(var A=[],M=this.graphManager.getAllNodes(),L=0;L"u"&&(E[_]=[]),E[_]=E[_].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var O="DummyCompound_"+I;C.memberGroups[O]=E[I];var D=E[I][0].getParent(),$=new u(C.graphManager);$.id=O,$.paddingLeft=D.paddingLeft||0,$.paddingRight=D.paddingRight||0,$.paddingBottom=D.paddingBottom||0,$.paddingTop=D.paddingTop||0,C.idToDummyNode[O]=$;var F=C.getGraphManager().add(C.newGraph(),$),z=D.getChild();z.add($);for(var H=0;H=0;C--){var E=this.compoundOrder[C],A=E.id,M=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[A],E.rect.x,E.rect.y,M,L)}},k.prototype.repopulateZeroDegreeMembers=function(){var C=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(A){var M=C.idToDummyNode[A],L=M.paddingLeft,P=M.paddingTop;C.adjustLocations(E[A],M.rect.x,M.rect.y,L,P)})},k.prototype.getToBeTiled=function(C){var E=C.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var A=C.getChild();if(A==null)return this.toBeTiled[E]=!1,!1;for(var M=A.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},k.prototype.getNodeDegree=function(C){C.id;for(var E=C.getEdges(),A=0,M=0;MI&&(I=D.rect.height)}A+=I+C.verticalPadding}},k.prototype.tileCompoundMembers=function(C,E){var A=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(M){var L=E[M];A.tiledMemberPack[M]=A.tileNodes(C[M],L.paddingLeft+L.paddingRight),L.rect.width=A.tiledMemberPack[M].width,L.rect.height=A.tiledMemberPack[M].height})},k.prototype.tileNodes=function(C,E){var A=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:A,horizontalPadding:M};C.sort(function(_,I){return _.rect.width*_.rect.height>I.rect.width*I.rect.height?-1:_.rect.width*_.rect.height0&&(N+=C.horizontalPadding),C.rowWidth[A]=N,C.width0&&(_+=C.verticalPadding);var I=0;_>C.rowHeight[A]&&(I=C.rowHeight[A],C.rowHeight[A]=_,I=C.rowHeight[A]-I),C.height+=I,C.rows[A].push(E)},k.prototype.getShortestRowIndex=function(C){for(var E=-1,A=Number.MAX_VALUE,M=0;MA&&(E=M,A=C.rowWidth[M]);return E},k.prototype.canAddHorizontal=function(C,E,A){var M=this.getShortestRowIndex(C);if(M<0)return!0;var L=C.rowWidth[M];if(L+C.horizontalPadding+E<=C.width)return!0;var P=0;C.rowHeight[M]0&&(P=A+C.verticalPadding-C.rowHeight[M]);var N;C.width-L>=E+C.horizontalPadding?N=(C.height+P)/(L+E+C.horizontalPadding):N=(C.height+P)/C.width,P=A+C.verticalPadding;var _;return C.widthP&&E!=A){M.splice(-1,1),C.rows[A].push(L),C.rowWidth[E]=C.rowWidth[E]-P,C.rowWidth[A]=C.rowWidth[A]+P,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var N=Number.MIN_VALUE,_=0;_N&&(N=M[_].height);E>0&&(N+=C.verticalPadding);var I=C.rowHeight[E]+C.rowHeight[A];C.rowHeight[E]=N,C.rowHeight[A]0)for(var z=L;z<=P;z++)F[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(P0)for(var z=N;z<=_;z++)F[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var H=v.MAX_VALUE,B,V,q=0;q0){var _;_=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(_,E,T)}}},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})])})})(NR)),NR.exports}var bGt=vGt();const xGt=ky(bGt);cd.use(xGt);function zLe(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}})})}w(zLe,"addNodes");function HLe(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})})}w(HLe,"addEdges");function VLe(t){return new Promise(e=>{const r=bt("body").append("div").attr("id","cy").attr("style","display:none"),n=cd({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),zLe(t.nodes,n),HLe(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=>{he.info("Cytoscape ready",a),e(n)})})}w(VLe,"createCytoscapeInstance");function WLe(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})}w(WLe,"extractPositionedNodes");function qLe(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})}w(qLe,"extractPositionedEdges");async function GLe(t,e){he.debug("Starting cose-bilkent layout algorithm");try{ULe(t);const r=await VLe(t),n=WLe(r),i=qLe(r);return he.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw he.error("Error in cose-bilkent layout algorithm:",r),r}}w(GLe,"executeCoseBilkentLayout");function ULe(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}w(ULe,"validateLayoutData");var wGt=w(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 T={...b};d[b.id]=T,h[b.id]=T,await r(p,b)}else{const T={...b};h[b.id]=T;const k=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=k.node().getBBox();T.width=S.width,T.height=S.height,T.domId=k,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 T=h[b.id];return{...b,width:T.width,height:T.height}})},x=await GLe(v,t.config);o.debug("Positioning nodes based on layout results"),x.nodes.forEach(b=>{const T=h[b.id];T!=null&&T.domId&&(T.domId.attr("transform",`translate(${b.x}, ${b.y})`),T.x=b.x,T.y=b.y,o.debug(`Positioned node ${T.id} at center (${b.x}, ${b.y})`))}),x.edges.forEach(b=>{const T=t.edges.find(k=>k.id===b.id);T&&(T.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 T=h[b.start??""],k=h[b.end??""];if(T&&k){const S=x.edges.find(C=>C.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const C={...b},E=n(g,C,d,t.type,T,k,t.diagramId);l(C,E)}else{const C={...b,points:[{x:T.x||0,y:T.y||0},{x:k.x||0,y:k.y||0}]},E=n(g,C,d,t.type,T,k,t.diagramId);l(C,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),TGt=wGt;const kGt=Object.freeze(Object.defineProperty({__proto__:null,render:TGt},Symbol.toStringTag,{value:"Module"}));var fD=w((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"),YLe=w((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"};fD(t,r).lower()},"drawBackgroundRect"),CGt=w((t,e)=>{const r=e.text.replace(A3," "),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"),Tee=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=Ay.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),kee=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=Ay.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Nc=w(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Cee=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),See=w(()=>{let t=bt(".mermaidTooltip");return t.empty()&&(t=bt("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"),YL=(function(){var t=w(function(we,Ae,Ue,le){for(Ue=Ue||{},le=we.length;le--;Ue[we[le]]=Ae);return Ue},"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],x=[1,34],b=[1,35],T=[1,36],k=[1,37],S=[1,38],C=[1,39],E=[1,40],A=[1,41],M=[1,42],L=[1,43],P=[1,44],N=[1,45],_=[1,46],I=[1,47],O=[1,48],D=[1,50],$=[1,51],F=[1,52],z=[1,53],H=[1,54],B=[1,55],V=[1,56],q=[1,57],G=[1,58],Q=[1,59],j=[1,60],ae=[14,42],Z=[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],J=[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],re=[1,82],ee=[1,83],me=[1,84],te=[1,85],$e=[12,14,42],Oe=[12,14,33,42],He=[12,14,33,42,76,77,79,80],ue=[12,33],ce=[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],Te={trace:w(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:w(function(Ae,Ue,le,pe,Ce,oe,fe){var W=oe.length-1;switch(Ce){case 3:pe.setDirection("TB");break;case 4:pe.setDirection("BT");break;case 5:pe.setDirection("RL");break;case 6:pe.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:pe.setC4Type(oe[W-3]);break;case 19:pe.setTitle(oe[W].substring(6)),this.$=oe[W].substring(6);break;case 20:pe.setAccDescription(oe[W].substring(15)),this.$=oe[W].substring(15);break;case 21:this.$=oe[W].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=oe[W].trim(),pe.setAccDescription(this.$);break;case 28:oe[W].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 29:oe[W].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 30:pe.addPersonOrSystemBoundary(...oe[W]),this.$=oe[W];break;case 31:oe[W].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...oe[W]),this.$=oe[W];break;case 32:pe.addDeploymentNode("node",...oe[W]),this.$=oe[W];break;case 33:pe.addDeploymentNode("nodeL",...oe[W]),this.$=oe[W];break;case 34:pe.addDeploymentNode("nodeR",...oe[W]),this.$=oe[W];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...oe[W]),this.$=oe[W];break;case 40:pe.addPersonOrSystem("external_person",...oe[W]),this.$=oe[W];break;case 41:pe.addPersonOrSystem("system",...oe[W]),this.$=oe[W];break;case 42:pe.addPersonOrSystem("system_db",...oe[W]),this.$=oe[W];break;case 43:pe.addPersonOrSystem("system_queue",...oe[W]),this.$=oe[W];break;case 44:pe.addPersonOrSystem("external_system",...oe[W]),this.$=oe[W];break;case 45:pe.addPersonOrSystem("external_system_db",...oe[W]),this.$=oe[W];break;case 46:pe.addPersonOrSystem("external_system_queue",...oe[W]),this.$=oe[W];break;case 47:pe.addContainer("container",...oe[W]),this.$=oe[W];break;case 48:pe.addContainer("container_db",...oe[W]),this.$=oe[W];break;case 49:pe.addContainer("container_queue",...oe[W]),this.$=oe[W];break;case 50:pe.addContainer("external_container",...oe[W]),this.$=oe[W];break;case 51:pe.addContainer("external_container_db",...oe[W]),this.$=oe[W];break;case 52:pe.addContainer("external_container_queue",...oe[W]),this.$=oe[W];break;case 53:pe.addComponent("component",...oe[W]),this.$=oe[W];break;case 54:pe.addComponent("component_db",...oe[W]),this.$=oe[W];break;case 55:pe.addComponent("component_queue",...oe[W]),this.$=oe[W];break;case 56:pe.addComponent("external_component",...oe[W]),this.$=oe[W];break;case 57:pe.addComponent("external_component_db",...oe[W]),this.$=oe[W];break;case 58:pe.addComponent("external_component_queue",...oe[W]),this.$=oe[W];break;case 60:pe.addRel("rel",...oe[W]),this.$=oe[W];break;case 61:pe.addRel("birel",...oe[W]),this.$=oe[W];break;case 62:pe.addRel("rel_u",...oe[W]),this.$=oe[W];break;case 63:pe.addRel("rel_d",...oe[W]),this.$=oe[W];break;case 64:pe.addRel("rel_l",...oe[W]),this.$=oe[W];break;case 65:pe.addRel("rel_r",...oe[W]),this.$=oe[W];break;case 66:pe.addRel("rel_b",...oe[W]),this.$=oe[W];break;case 67:oe[W].splice(0,1),pe.addRel("rel",...oe[W]),this.$=oe[W];break;case 68:pe.updateElStyle("update_el_style",...oe[W]),this.$=oe[W];break;case 69:pe.updateRelStyle("update_rel_style",...oe[W]),this.$=oe[W];break;case 70:pe.updateLayoutConfig("update_layout_config",...oe[W]),this.$=oe[W];break;case 71:this.$=[oe[W]];break;case 72:oe[W].unshift(oe[W-1]),this.$=oe[W];break;case 73:case 75:this.$=oe[W].trim();break;case 74:let se={};se[oe[W-1].trim()]=oe[W].trim(),this.$=se;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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{14:[1,74]},t(ae,[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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j}),t(ae,[2,14]),t(Z,[2,16],{12:[1,76]}),t(ae,[2,36],{12:[1,77]}),t(J,[2,19]),t(J,[2,20]),{25:[1,78]},{27:[1,79]},t(J,[2,23]),{35:80,75:81,76:re,77:ee,79:me,80:te},{35:86,75:81,76:re,77:ee,79:me,80:te},{35:87,75:81,76:re,77:ee,79:me,80:te},{35:88,75:81,76:re,77:ee,79:me,80:te},{35:89,75:81,76:re,77:ee,79:me,80:te},{35:90,75:81,76:re,77:ee,79:me,80:te},{35:91,75:81,76:re,77:ee,79:me,80:te},{35:92,75:81,76:re,77:ee,79:me,80:te},{35:93,75:81,76:re,77:ee,79:me,80:te},{35:94,75:81,76:re,77:ee,79:me,80:te},{35:95,75:81,76:re,77:ee,79:me,80:te},{35:96,75:81,76:re,77:ee,79:me,80:te},{35:97,75:81,76:re,77:ee,79:me,80:te},{35:98,75:81,76:re,77:ee,79:me,80:te},{35:99,75:81,76:re,77:ee,79:me,80:te},{35:100,75:81,76:re,77:ee,79:me,80:te},{35:101,75:81,76:re,77:ee,79:me,80:te},{35:102,75:81,76:re,77:ee,79:me,80:te},{35:103,75:81,76:re,77:ee,79:me,80:te},{35:104,75:81,76:re,77:ee,79:me,80:te},t($e,[2,59]),{35:105,75:81,76:re,77:ee,79:me,80:te},{35:106,75:81,76:re,77:ee,79:me,80:te},{35:107,75:81,76:re,77:ee,79:me,80:te},{35:108,75:81,76:re,77:ee,79:me,80:te},{35:109,75:81,76:re,77:ee,79:me,80:te},{35:110,75:81,76:re,77:ee,79:me,80:te},{35:111,75:81,76:re,77:ee,79:me,80:te},{35:112,75:81,76:re,77:ee,79:me,80:te},{35:113,75:81,76:re,77:ee,79:me,80:te},{35:114,75:81,76:re,77:ee,79:me,80:te},{35:115,75:81,76:re,77:ee,79:me,80:te},{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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j},{12:[1,118],33:[1,117]},{35:119,75:81,76:re,77:ee,79:me,80:te},{35:120,75:81,76:re,77:ee,79:me,80:te},{35:121,75:81,76:re,77:ee,79:me,80:te},{35:122,75:81,76:re,77:ee,79:me,80:te},{35:123,75:81,76:re,77:ee,79:me,80:te},{35:124,75:81,76:re,77:ee,79:me,80:te},{35:125,75:81,76:re,77:ee,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ae,[2,15]),t(Z,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ae,[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:x,50:b,51:T,52:k,53:S,54:C,55:E,56:A,57:M,58:L,59:P,60:N,61:_,62:I,63:O,64:D,65:$,66:F,67:z,68:H,69:B,70:V,71:q,72:G,73:Q,74:j}),t(J,[2,21]),t(J,[2,22]),t($e,[2,39]),t(Oe,[2,71],{75:81,35:132,76:re,77:ee,79:me,80:te}),t(He,[2,73]),{78:[1,133]},t(He,[2,75]),t(He,[2,76]),t($e,[2,40]),t($e,[2,41]),t($e,[2,42]),t($e,[2,43]),t($e,[2,44]),t($e,[2,45]),t($e,[2,46]),t($e,[2,47]),t($e,[2,48]),t($e,[2,49]),t($e,[2,50]),t($e,[2,51]),t($e,[2,52]),t($e,[2,53]),t($e,[2,54]),t($e,[2,55]),t($e,[2,56]),t($e,[2,57]),t($e,[2,58]),t($e,[2,60]),t($e,[2,61]),t($e,[2,62]),t($e,[2,63]),t($e,[2,64]),t($e,[2,65]),t($e,[2,66]),t($e,[2,67]),t($e,[2,68]),t($e,[2,69]),t($e,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ue,[2,28]),t(ue,[2,29]),t(ue,[2,30]),t(ue,[2,31]),t(ue,[2,32]),t(ue,[2,33]),t(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Z,[2,18]),t(ae,[2,38]),t(Oe,[2,72]),t(He,[2,74]),t($e,[2,24]),t($e,[2,35]),t(ce,[2,25]),t(ce,[2,26],{12:[1,138]}),t(ce,[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:w(function(Ae,Ue){if(Ue.recoverable)this.trace(Ae);else{var le=new Error(Ae);throw le.hash=Ue,le}},"parseError"),parse:w(function(Ae){var Ue=this,le=[0],pe=[],Ce=[null],oe=[],fe=this.table,W="",se=0,K=0,de=2,X=1,Fe=oe.slice.call(arguments,1),ke=Object.create(this.lexer),Ye={yy:{}};for(var Ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ie)&&(Ye.yy[Ie]=this.yy[Ie]);ke.setInput(Ae,Ye.yy),Ye.yy.lexer=ke,Ye.yy.parser=this,typeof ke.yylloc>"u"&&(ke.yylloc={});var ze=ke.yylloc;oe.push(ze);var De=ke.options&&ke.options.ranges;typeof Ye.yy.parseError=="function"?this.parseError=Ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ke(ye){le.length=le.length-2*ye,Ce.length=Ce.length-ye,oe.length=oe.length-ye}w(Ke,"popStack");function Be(){var ye;return ye=pe.pop()||ke.lex()||X,typeof ye!="number"&&(ye instanceof Array&&(pe=ye,ye=pe.pop()),ye=Ue.symbols_[ye]||ye),ye}w(Be,"lex");for(var nt,Le,pt,Me,Ct={},wt,ht,Bt,At;;){if(Le=le[le.length-1],this.defaultActions[Le]?pt=this.defaultActions[Le]:((nt===null||typeof nt>"u")&&(nt=Be()),pt=fe[Le]&&fe[Le][nt]),typeof pt>"u"||!pt.length||!pt[0]){var mt="";At=[];for(wt in fe[Le])this.terminals_[wt]&&wt>de&&At.push("'"+this.terminals_[wt]+"'");ke.showPosition?mt="Parse error on line "+(se+1)+`: `+ke.showPosition()+` Expecting `+At.join(", ")+", got '"+(this.terminals_[nt]||nt)+"'":mt="Parse error on line "+(se+1)+": Unexpected "+(nt==X?"end of input":"'"+(this.terminals_[nt]||nt)+"'"),this.parseError(mt,{text:ke.match,token:this.terminals_[nt]||nt,line:ke.yylineno,loc:ze,expected:At})}if(pt[0]instanceof Array&&pt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+nt);switch(pt[0]){case 1:le.push(nt),Ce.push(ke.yytext),oe.push(ke.yylloc),le.push(pt[1]),nt=null,K=ke.yyleng,W=ke.yytext,se=ke.yylineno,ze=ke.yylloc;break;case 2:if(ht=this.productions_[pt[1]][1],Ct.$=Ce[Ce.length-ht],Ct._$={first_line:oe[oe.length-(ht||1)].first_line,last_line:oe[oe.length-1].last_line,first_column:oe[oe.length-(ht||1)].first_column,last_column:oe[oe.length-1].last_column},De&&(Ct._$.range=[oe[oe.length-(ht||1)].range[0],oe[oe.length-1].range[1]]),Me=this.performAction.apply(Ct,[W,K,se,Ye.yy,pt[1],Ce,oe].concat(Fe)),typeof Me<"u")return Me;ht&&(le=le.slice(0,-1*ht*2),Ce=Ce.slice(0,-1*ht),oe=oe.slice(0,-1*ht)),le.push(this.productions_[pt[1]][0]),Ce.push(Ct.$),oe.push(Ct._$),Bt=fe[le[le.length-2]][le[le.length-1]],le.push(Bt);break;case 3:return!0}}return!0},"parse")},ge=(function(){var we={EOF:1,parseError:w(function(Ue,le){if(this.yy.parser)this.yy.parser.parseError(Ue,le);else throw new Error(Ue)},"parseError"),setInput:w(function(Ae,Ue){return this.yy=Ue||this.yy||{},this._input=Ae,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:w(function(){var Ae=this._input[0];this.yytext+=Ae,this.yyleng++,this.offset++,this.match+=Ae,this.matched+=Ae;var Ue=Ae.match(/(?:\r\n?|\n).*/g);return Ue?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ae},"input"),unput:w(function(Ae){var Ue=Ae.length,le=Ae.split(/(?:\r\n?|\n)/g);this._input=Ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ue),this.offset-=Ue;var pe=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),le.length-1&&(this.yylineno-=le.length-1);var Ce=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:le?(le.length===pe.length?this.yylloc.first_column:0)+pe[pe.length-le.length].length-le[0].length:this.yylloc.first_column-Ue},this.options.ranges&&(this.yylloc.range=[Ce[0],Ce[0]+this.yyleng-Ue]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(Ae){this.unput(this.match.slice(Ae))},"less"),pastInput:w(function(){var Ae=this.matched.substr(0,this.matched.length-this.match.length);return(Ae.length>20?"...":"")+Ae.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Ae=this.match;return Ae.length<20&&(Ae+=this._input.substr(0,20-Ae.length)),(Ae.substr(0,20)+(Ae.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Ae=this.pastInput(),Ue=new Array(Ae.length+1).join("-");return Ae+this.upcomingInput()+` `+Ue+"^"},"showPosition"),test_match:w(function(Ae,Ue){var le,pe,Ce;if(this.options.backtrack_lexer&&(Ce={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&&(Ce.yylloc.range=this.yylloc.range.slice(0))),pe=Ae[0].match(/(?:\r\n?|\n).*/g),pe&&(this.yylineno+=pe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:pe?pe[pe.length-1].length-pe[pe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ae[0].length},this.yytext+=Ae[0],this.match+=Ae[0],this.matches=Ae,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(Ae[0].length),this.matched+=Ae[0],le=this.performAction.call(this,this.yy,this,Ue,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),le)return le;if(this._backtrack){for(var oe in Ce)this[oe]=Ce[oe];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ae,Ue,le,pe;this._more||(this.yytext="",this.match="");for(var Ce=this._currentRules(),oe=0;oeUe[0].length)){if(Ue=le,pe=oe,this.options.backtrack_lexer){if(Ae=this.test_match(le,Ce[oe]),Ae!==!1)return Ae;if(this._backtrack){Ue=!1;continue}else return!1}else if(!this.options.flex)break}return Ue?(Ae=this.test_match(Ue,Ce[pe]),Ae!==!1?Ae:!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:w(function(){var Ue=this.next();return Ue||this.lex()},"lex"),begin:w(function(Ue){this.conditionStack.push(Ue)},"begin"),popState:w(function(){var Ue=this.conditionStack.length-1;return Ue>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(Ue){return Ue=this.conditionStack.length-1-Math.abs(Ue||0),Ue>=0?this.conditionStack[Ue]:"INITIAL"},"topState"),pushState:w(function(Ue){this.begin(Ue)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(Ue,le,pe,Ce){switch(pe){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 we})();Te.lexer=ge;function Ve(){this.yy={}}return w(Ve,"Parser"),Ve.prototype=Te,Te.Parser=Ve,new Ve})();GL.parser=GL;var bGt=GL,ih=[],Np=[""],fl="global",Ku="",cd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],C6=[],Cee="",See=!1,UL=4,YL=2,GLe,xGt=w(function(){return GLe},"getC4Type"),wGt=w(function(t){GLe=Tn(t,We())},"setC4Type"),TGt=w(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=C6.find(d=>d.from===e&&d.to===r);if(h?u=h:C6.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=Lg()},"addRel"),kGt=w(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=ih.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,ih.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=fl,o.wrap=Lg()},"addPersonOrSystem"),CGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ih.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ih.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=Lg(),l.typeC4Shape={text:t},l.parentBoundary=fl},"addContainer"),SGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ih.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ih.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=Lg(),l.typeC4Shape={text:t},l.parentBoundary=fl},"addComponent"),EGt=w(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=cd.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,cd.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=fl,a.wrap=Lg(),Ku=fl,fl=t,Np.push(Ku)},"addPersonOrSystemBoundary"),AGt=w(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=cd.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,cd.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=fl,a.wrap=Lg(),Ku=fl,fl=t,Np.push(Ku)},"addContainerBoundary"),RGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=cd.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,cd.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=fl,l.wrap=Lg(),Ku=fl,fl=e,Np.push(Ku)},"addDeploymentNode"),_Gt=w(function(){fl=Ku,Np.pop(),Ku=Np.pop(),Np.push(Ku)},"popBoundaryParseStack"),MGt=w(function(t,e,r,n,i,a,s,o,l,u,h){let d=ih.find(f=>f.alias===e);if(!(d===void 0&&(d=cd.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"),LGt=w(function(t,e,r,n,i,a,s){const o=C6.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"),IGt=w(function(t,e,r){let n=UL,i=YL;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&&(UL=n),i>=1&&(YL=i)},"updateLayoutConfig"),$Gt=w(function(){return UL},"getC4ShapeInRow"),NGt=w(function(){return YL},"getC4BoundaryInRow"),DGt=w(function(){return fl},"getCurrentBoundaryParse"),OGt=w(function(){return Ku},"getParentBoundaryParse"),ULe=w(function(t){return t==null?ih:ih.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),PGt=w(function(t){return ih.find(e=>e.alias===t)},"getC4Shape"),BGt=w(function(t){return Object.keys(ULe(t))},"getC4ShapeKeys"),YLe=w(function(t){return t==null?cd:cd.filter(e=>e.parentBoundary===t)},"getBoundaries"),FGt=YLe,zGt=w(function(){return C6},"getRels"),HGt=w(function(){return Cee},"getTitle"),VGt=w(function(t){See=t},"setWrap"),Lg=w(function(){return See},"autoWrap"),WGt=w(function(){ih=[],cd=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Ku="",fl="global",Np=[""],C6=[],Np=[""],Cee="",See=!1,UL=4,YL=2},"clear"),qGt={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},GGt={FILLED:0,OPEN:1},UGt={LEFTOF:0,RIGHTOF:1,OVER:2},YGt=w(function(t){Cee=Tn(t,We())},"setTitle"),lU={addPersonOrSystem:kGt,addPersonOrSystemBoundary:EGt,addContainer:CGt,addContainerBoundary:AGt,addComponent:SGt,addDeploymentNode:RGt,popBoundaryParseStack:_Gt,addRel:TGt,updateElStyle:MGt,updateRelStyle:LGt,updateLayoutConfig:IGt,autoWrap:Lg,setWrap:VGt,getC4ShapeArray:ULe,getC4Shape:PGt,getC4ShapeKeys:BGt,getBoundaries:YLe,getBoundarys:FGt,getCurrentBoundaryParse:DGt,getParentBoundaryParse:OGt,getRels:zGt,getTitle:HGt,getC4Type:xGt,getC4ShapeInRow:$Gt,getC4BoundaryInRow:NGt,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,getConfig:w(()=>We().c4,"getConfig"),clear:WGt,LINETYPE:qGt,ARROWTYPE:GGt,PLACEMENT:UGt,setTitle:YGt,setC4Type:wGt},Eee=w(function(t,e){return hD(t,e)},"drawRect"),jLe=w(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:Ay.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),jGt=w((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();kf(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(),kf(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"),XGt=w(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};Eee(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,kf(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,kf(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,kf(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),KGt=w(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=Nc();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},Eee(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=iUt(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":jLe(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,kf(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)!==""?kf(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!==""&&kf(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,kf(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),ZGt=w(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"),QGt=w(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"),JGt=w(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"),eUt=w(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"),tUt=w(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"),rUt=w(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"),nUt=w(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"),iUt=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),kf=(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)}w(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Ft.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>XLe)&&(r=this.nextData.startx+e.margin+vr.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},uU(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(Gb,"Bounds"),Gb),uU=w(function(t){ja(vr,t),t.fontFamily&&(vr.personFontFamily=vr.systemFontFamily=vr.messageFontFamily=t.fontFamily),t.fontSize&&(vr.personFontSize=vr.systemFontSize=vr.messageFontSize=t.fontSize),t.fontWeight&&(vr.personFontWeight=vr.systemFontWeight=vr.messageFontWeight=t.fontWeight)},"setConf"),Wk=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),OR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),aUt=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function au(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=CC(e[t].text,i,n),e[t].textLines=e[t].text.split(Ft.lineBreakRegex).length,e[t].width=i,e[t].height=G9(e[t].text,n);else{let a=e[t].text.split(Ft.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(dl(o,n),e[t].width),s=G9(o,n),e[t].height=e[t].height+s}}w(au,"calcC4ShapeTextWH");var ZLe=w(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=vr.c4ShapeMargin-35;let n=e.wrap&&vr.wrap,i=OR(vr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=dl(e.label.text,i);au("label",e,n,i,a),Dh.drawBoundary(t,e,vr)},"drawBoundary"),QLe=w(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=Wk(vr,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=dl("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=vr.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&&vr.wrap,u=vr.width-vr.c4ShapePadding*2,h=Wk(vr,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",au("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=Wk(vr,s.typeC4Shape.text);au("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=Wk(vr,s.techn.text);au("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=Wk(vr,s.typeC4Shape.text);au("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+vr.c4ShapePadding,s.width=Math.max(s.width||vr.width,f,vr.width),s.height=Math.max(s.height||vr.height,d,vr.height),s.margin=s.margin||vr.c4ShapeMargin,t.insert(s),Dh.drawC4Shape(e,s,vr)}t.bumpLastMargin(vr.c4ShapeMargin)},"drawC4ShapeArray"),Ub,Vc=(Ub=class{constructor(e,r){this.x=e,this.y=r}},w(Ub,"Point"),Ub),Zpe=w(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 Vc(r,o):r==i&&na&&(f=new Vc(s,n)),r>i&&n=h?f=new Vc(r,o+h*t.width/2):f=new Vc(s-l/u*t.height/2,n+t.height):r=h?f=new Vc(r+t.width,o+h*t.width/2):f=new Vc(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new Vc(r+t.width,o-h*t.width/2):f=new Vc(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Vc(r,o-t.width/2*h):f=new Vc(s-t.height/2*l/u,n)),f},"getIntersectPoint"),sUt=w(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=Zpe(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Zpe(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),oUt=w(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&vr.wrap,l=aUt(vr);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=dl(s.label.text,l);au("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=dl(s.techn.text,l),au("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=dl(s.descr.text,l),au("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=sUt(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Dh.drawRels(t,e,vr,i)},"drawRels");function Aee(t,e,r,n,i){let a=new KLe(i);a.data.widthLimit=r.data.widthLimit/Math.min(cU,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&&vr.wrap,h=OR(vr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",au("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=OR(vr);au("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=OR(vr);g.fontSize=g.fontSize-2,au("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%cU===0){let g=r.data.startx+vr.diagramMarginX,m=r.data.stopy+vr.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+vr.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&&QLe(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&Aee(t,e,a,p,i),o.alias!=="global"&&ZLe(t,o,a),r.data.stopy=Math.max(a.data.stopy+vr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+vr.c4ShapeMargin,r.data.stopx),jL=Math.max(jL,r.data.stopx),XL=Math.max(XL,r.data.stopy)}}w(Aee,"drawInsideBoundary");var lUt=w(function(t,e,r,n){vr=We().c4;const i=We().securityLevel;let a;i==="sandbox"&&(a=bt("#i"+e));const s=bt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(vr.wrap),XLe=o.getC4ShapeInRow(),cU=o.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(vr,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):bt(`[id="${e}"]`);Dh.insertComputerIcon(l,e),Dh.insertDatabaseIcon(l,e),Dh.insertClockIcon(l,e);let u=new KLe(n);u.setData(vr.diagramMarginX,vr.diagramMarginX,vr.diagramMarginY,vr.diagramMarginY),u.data.widthLimit=screen.availWidth,jL=vr.diagramMarginX,XL=vr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");Aee(l,"",u,d,n),Dh.insertArrowHead(l,e),Dh.insertArrowEnd(l,e),Dh.insertArrowCrossHead(l,e),Dh.insertArrowFilledHead(l,e),oUt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=jL,u.data.stopy=XL;const f=u.data;let g=f.stopy-f.starty+2*vr.diagramMarginY;const y=f.stopx-f.startx+2*vr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*vr.diagramMarginX).attr("y",f.starty+vr.diagramMarginY),_a(l,g,y,vr.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-vr.diagramMarginX+" -"+(vr.diagramMarginY+v)+" "+y+" "+(g+v)),he.debug("models:",f)},"draw"),Qpe={drawPersonOrSystemArray:QLe,drawBoundary:ZLe,setConf:uU,draw:lUt},cUt=w(t=>`.person { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var Ue=this.next();return Ue||this.lex()},"lex"),begin:w(function(Ue){this.conditionStack.push(Ue)},"begin"),popState:w(function(){var Ue=this.conditionStack.length-1;return Ue>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(Ue){return Ue=this.conditionStack.length-1-Math.abs(Ue||0),Ue>=0?this.conditionStack[Ue]:"INITIAL"},"topState"),pushState:w(function(Ue){this.begin(Ue)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(Ue,le,pe,Ce){switch(pe){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 we})();Te.lexer=ge;function Ve(){this.yy={}}return w(Ve,"Parser"),Ve.prototype=Te,Te.Parser=Ve,new Ve})();YL.parser=YL;var SGt=YL,ih=[],Np=[""],fl="global",Ku="",ud=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],S6=[],Eee="",Aee=!1,jL=4,XL=2,jLe,EGt=w(function(){return jLe},"getC4Type"),AGt=w(function(t){jLe=Tn(t,We())},"setC4Type"),RGt=w(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=S6.find(d=>d.from===e&&d.to===r);if(h?u=h:S6.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=Lg()},"addRel"),_Gt=w(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=ih.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,ih.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=fl,o.wrap=Lg()},"addPersonOrSystem"),MGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ih.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ih.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=Lg(),l.typeC4Shape={text:t},l.parentBoundary=fl},"addContainer"),LGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ih.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ih.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=Lg(),l.typeC4Shape={text:t},l.parentBoundary=fl},"addComponent"),IGt=w(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=ud.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,ud.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=fl,a.wrap=Lg(),Ku=fl,fl=t,Np.push(Ku)},"addPersonOrSystemBoundary"),$Gt=w(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=ud.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,ud.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=fl,a.wrap=Lg(),Ku=fl,fl=t,Np.push(Ku)},"addContainerBoundary"),NGt=w(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=ud.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ud.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=fl,l.wrap=Lg(),Ku=fl,fl=e,Np.push(Ku)},"addDeploymentNode"),DGt=w(function(){fl=Ku,Np.pop(),Ku=Np.pop(),Np.push(Ku)},"popBoundaryParseStack"),OGt=w(function(t,e,r,n,i,a,s,o,l,u,h){let d=ih.find(f=>f.alias===e);if(!(d===void 0&&(d=ud.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"),PGt=w(function(t,e,r,n,i,a,s){const o=S6.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"),BGt=w(function(t,e,r){let n=jL,i=XL;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&&(jL=n),i>=1&&(XL=i)},"updateLayoutConfig"),FGt=w(function(){return jL},"getC4ShapeInRow"),zGt=w(function(){return XL},"getC4BoundaryInRow"),HGt=w(function(){return fl},"getCurrentBoundaryParse"),VGt=w(function(){return Ku},"getParentBoundaryParse"),XLe=w(function(t){return t==null?ih:ih.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),WGt=w(function(t){return ih.find(e=>e.alias===t)},"getC4Shape"),qGt=w(function(t){return Object.keys(XLe(t))},"getC4ShapeKeys"),KLe=w(function(t){return t==null?ud:ud.filter(e=>e.parentBoundary===t)},"getBoundaries"),GGt=KLe,UGt=w(function(){return S6},"getRels"),YGt=w(function(){return Eee},"getTitle"),jGt=w(function(t){Aee=t},"setWrap"),Lg=w(function(){return Aee},"autoWrap"),XGt=w(function(){ih=[],ud=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Ku="",fl="global",Np=[""],S6=[],Np=[""],Eee="",Aee=!1,jL=4,XL=2},"clear"),KGt={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},ZGt={FILLED:0,OPEN:1},QGt={LEFTOF:0,RIGHTOF:1,OVER:2},JGt=w(function(t){Eee=Tn(t,We())},"setTitle"),uU={addPersonOrSystem:_Gt,addPersonOrSystemBoundary:IGt,addContainer:MGt,addContainerBoundary:$Gt,addComponent:LGt,addDeploymentNode:NGt,popBoundaryParseStack:DGt,addRel:RGt,updateElStyle:OGt,updateRelStyle:PGt,updateLayoutConfig:BGt,autoWrap:Lg,setWrap:jGt,getC4ShapeArray:XLe,getC4Shape:WGt,getC4ShapeKeys:qGt,getBoundaries:KLe,getBoundarys:GGt,getCurrentBoundaryParse:HGt,getParentBoundaryParse:VGt,getRels:UGt,getTitle:YGt,getC4Type:EGt,getC4ShapeInRow:FGt,getC4BoundaryInRow:zGt,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,getConfig:w(()=>We().c4,"getConfig"),clear:XGt,LINETYPE:KGt,ARROWTYPE:ZGt,PLACEMENT:QGt,setTitle:JGt,setC4Type:AGt},Ree=w(function(t,e){return fD(t,e)},"drawRect"),ZLe=w(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:Ay.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),eUt=w((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();kf(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(),kf(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"),tUt=w(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};Ree(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,kf(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,kf(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,kf(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),rUt=w(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=Nc();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},Ree(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=uUt(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":ZLe(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,kf(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)!==""?kf(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!==""&&kf(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,kf(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),nUt=w(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"),iUt=w(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"),aUt=w(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"),sUt=w(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"),oUt=w(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"),lUt=w(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"),cUt=w(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"),uUt=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),kf=(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)}w(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Ft.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>QLe)&&(r=this.nextData.startx+e.margin+br.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},dU(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(Gb,"Bounds"),Gb),dU=w(function(t){ja(br,t),t.fontFamily&&(br.personFontFamily=br.systemFontFamily=br.messageFontFamily=t.fontFamily),t.fontSize&&(br.personFontSize=br.systemFontSize=br.messageFontSize=t.fontSize),t.fontWeight&&(br.personFontWeight=br.systemFontWeight=br.messageFontWeight=t.fontWeight)},"setConf"),Wk=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),PR=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),hUt=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function au(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=CC(e[t].text,i,n),e[t].textLines=e[t].text.split(Ft.lineBreakRegex).length,e[t].width=i,e[t].height=U9(e[t].text,n);else{let a=e[t].text.split(Ft.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(dl(o,n),e[t].width),s=U9(o,n),e[t].height=e[t].height+s}}w(au,"calcC4ShapeTextWH");var eIe=w(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=br.c4ShapeMargin-35;let n=e.wrap&&br.wrap,i=PR(br);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=dl(e.label.text,i);au("label",e,n,i,a),Oh.drawBoundary(t,e,br)},"drawBoundary"),tIe=w(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=Wk(br,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=dl("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=br.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&&br.wrap,u=br.width-br.c4ShapePadding*2,h=Wk(br,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",au("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=Wk(br,s.typeC4Shape.text);au("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=Wk(br,s.techn.text);au("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=Wk(br,s.typeC4Shape.text);au("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+br.c4ShapePadding,s.width=Math.max(s.width||br.width,f,br.width),s.height=Math.max(s.height||br.height,d,br.height),s.margin=s.margin||br.c4ShapeMargin,t.insert(s),Oh.drawC4Shape(e,s,br)}t.bumpLastMargin(br.c4ShapeMargin)},"drawC4ShapeArray"),Ub,Vc=(Ub=class{constructor(e,r){this.x=e,this.y=r}},w(Ub,"Point"),Ub),Qpe=w(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 Vc(r,o):r==i&&na&&(f=new Vc(s,n)),r>i&&n=h?f=new Vc(r,o+h*t.width/2):f=new Vc(s-l/u*t.height/2,n+t.height):r=h?f=new Vc(r+t.width,o+h*t.width/2):f=new Vc(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new Vc(r+t.width,o-h*t.width/2):f=new Vc(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Vc(r,o-t.width/2*h):f=new Vc(s-t.height/2*l/u,n)),f},"getIntersectPoint"),dUt=w(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=Qpe(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Qpe(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),fUt=w(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&br.wrap,l=hUt(br);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=dl(s.label.text,l);au("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=dl(s.techn.text,l),au("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=dl(s.descr.text,l),au("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=dUt(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Oh.drawRels(t,e,br,i)},"drawRels");function _ee(t,e,r,n,i){let a=new JLe(i);a.data.widthLimit=r.data.widthLimit/Math.min(hU,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&&br.wrap,h=PR(br);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",au("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=PR(br);au("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=PR(br);g.fontSize=g.fontSize-2,au("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%hU===0){let g=r.data.startx+br.diagramMarginX,m=r.data.stopy+br.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+br.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&&tIe(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&_ee(t,e,a,p,i),o.alias!=="global"&&eIe(t,o,a),r.data.stopy=Math.max(a.data.stopy+br.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+br.c4ShapeMargin,r.data.stopx),KL=Math.max(KL,r.data.stopx),ZL=Math.max(ZL,r.data.stopy)}}w(_ee,"drawInsideBoundary");var pUt=w(function(t,e,r,n){br=We().c4;const i=We().securityLevel;let a;i==="sandbox"&&(a=bt("#i"+e));const s=bt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(br.wrap),QLe=o.getC4ShapeInRow(),hU=o.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(br,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):bt(`[id="${e}"]`);Oh.insertComputerIcon(l,e),Oh.insertDatabaseIcon(l,e),Oh.insertClockIcon(l,e);let u=new JLe(n);u.setData(br.diagramMarginX,br.diagramMarginX,br.diagramMarginY,br.diagramMarginY),u.data.widthLimit=screen.availWidth,KL=br.diagramMarginX,ZL=br.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");_ee(l,"",u,d,n),Oh.insertArrowHead(l,e),Oh.insertArrowEnd(l,e),Oh.insertArrowCrossHead(l,e),Oh.insertArrowFilledHead(l,e),fUt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=KL,u.data.stopy=ZL;const f=u.data;let g=f.stopy-f.starty+2*br.diagramMarginY;const y=f.stopx-f.startx+2*br.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*br.diagramMarginX).attr("y",f.starty+br.diagramMarginY),_a(l,g,y,br.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-br.diagramMarginX+" -"+(br.diagramMarginY+v)+" "+y+" "+(g+v)),he.debug("models:",f)},"draw"),Jpe={drawPersonOrSystemArray:tIe,drawBoundary:eIe,setConf:dU,draw:pUt},gUt=w(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),uUt=cUt,hUt={parser:bGt,db:lU,renderer:Qpe,styles:uUt,init:w(({c4:t,wrap:e})=>{Qpe.setConf(t),lU.setWrap(e)},"init")};const dUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:hUt},Symbol.toStringTag,{value:"Module"}));var XE=w(()=>` +`,"getStyles"),mUt=gUt,yUt={parser:SGt,db:uU,renderer:Jpe,styles:mUt,init:w(({c4:t,wrap:e})=>{Jpe.setConf(t),uU.setWrap(e)},"init")};const vUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:yUt},Symbol.toStringTag,{value:"Module"}));var KE=w(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -2266,21 +2279,21 @@ Expecting `+At.join(", ")+", got '"+(this.terminals_[nt]||nt)+"'":mt="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),Q3=w((t,e)=>{let r;return e==="sandbox"&&(r=bt("#i"+t)),bt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Gy=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=fUt(t,e);_a(t,a,i,n);const l=pUt(s,o,i,a,e);t.attr("viewBox",l),he.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),fUt=w((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"),pUt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),gUt="flowchart-",Yb,mUt=(Yb=class{constructor(){this.vertexCounter=0,this.config=We(),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=$i,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getAccTitle=Yi,this.getAccDescription=Xi,this.getDiagramTitle=Di,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 Ft.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"),Q3=w((t,e)=>{let r;return e==="sandbox"&&(r=bt("#i"+t)),bt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Gy=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=bUt(t,e);_a(t,a,i,n);const l=xUt(s,o,i,a,e);t.attr("viewBox",l),he.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),bUt=w((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"),xUt=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),wUt="flowchart-",Yb,TUt=(Yb=class{constructor(){this.vertexCounter=0,this.config=We(),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=$i,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getAccTitle=Yi,this.getAccDescription=Xi,this.getDiagramTitle=Di,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 Ft.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=M$(m,{schema:_$})}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&&he.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:gUt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=We(),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(!C5e(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};he.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=ob(o.start,o.end,{counter:0,prefix:"L"}):o.id=ob(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))he.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=I$(m,{schema:L$})}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&&he.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:wUt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=We(),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(!S5e(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};he.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=ob(o.start,o.end,{counter:0,prefix:"L"}):o.id=ob(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))he.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;he.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(We().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",()=>{Vr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Vr.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=kee();bt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=bt(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(Ff.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),bt(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=We(),wi()}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=w(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const T=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:T in m?m[T].hasOwnProperty(b)?!1:m[T][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=We().flowchart??{},f=u??(d.inheritDir?this.getDirection()??We().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=We(),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:ob(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 Gxe.flowchart}},w(Yb,"FlowDB"),Yb),yUt=w(function(t,e){return e.db.getClasses()},"getClasses"),vUt=w(async function(t,e,r,n,i){var f;he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=We();n.db.setDiagramId(e),he.debug("Before getData: ");const l=n.db.getData();he.debug("Data: ",l);const u=Q3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=vE(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&he.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,he.debug("REF1:",l),await I3(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Vr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),Gy(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),bUt={getClasses:yUt,draw:vUt},hU=(function(){var t=w(function(dn,Et,ft,Mt){for(ft=ft||{},Mt=dn.length;Mt--;ft[dn[Mt]]=Et);return ft},"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],x=[1,31],b=[1,32],T=[1,33],k=[1,45],S=[1,47],C=[1,43],E=[1,48],A=[1,44],M=[1,51],L=[1,46],P=[1,52],N=[1,53],_=[1,34],I=[1,35],O=[1,36],D=[1,37],$=[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],H=[1,62],B=[1,61],V=[1,63],q=[8,9,11,75,77,78],G=[1,79],Q=[1,92],j=[1,97],ae=[1,96],Z=[1,93],J=[1,89],re=[1,95],ee=[1,91],me=[1,98],te=[1,94],$e=[1,99],Oe=[1,90],He=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],ce=[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],Te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],Ve=[1,122],we=[1,123],Ae=[1,125],Ue=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Ce=[1,148],oe=[1,149],fe=[1,150],W=[1,151],se=[1,136],K=[1,138],de=[1,142],X=[1,143],Fe=[1,144],ke=[1,145],Ye=[1,146],Ie=[1,147],ze=[1,152],De=[1,153],Ke=[1,132],Be=[1,133],nt=[1,140],Le=[1,135],pt=[1,139],Me=[1,137],Ct=[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],wt=[1,155],ht=[1,157],Bt=[8,9,11],At=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],mt=[1,177],ye=[1,173],Nt=[1,174],yt=[1,178],gt=[1,175],St=[1,176],tn=[77,116,119],_e=[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],Je=[10,106],ut=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Dt=[1,248],Kt=[1,246],Sr=[1,250],yr=[1,244],qr=[1,245],Tr=[1,247],rn=[1,249],mr=[1,251],zr=[1,269],hn=[8,9,11,106],st=[8,9,10,11,60,84,105,106,109,110,111,112],vt={trace:w(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:w(function(Et,ft,Mt,dt,ur,Re,Dn){var Pe=Re.length-1;switch(ur){case 2:this.$=[];break;case 3:(!Array.isArray(Re[Pe])||Re[Pe].length>0)&&Re[Pe-1].push(Re[Pe]),this.$=Re[Pe-1];break;case 4:case 183:this.$=Re[Pe];break;case 11:dt.setDirection("TB"),this.$="TB";break;case 12:dt.setDirection(Re[Pe-1]),this.$=Re[Pe-1];break;case 27:this.$=Re[Pe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=dt.addSubGraph(Re[Pe-6],Re[Pe-1],Re[Pe-4]);break;case 34:this.$=dt.addSubGraph(Re[Pe-3],Re[Pe-1],Re[Pe-3]);break;case 35:this.$=dt.addSubGraph(void 0,Re[Pe-1],void 0);break;case 37:this.$=Re[Pe].trim(),dt.setAccTitle(this.$);break;case 38:case 39:this.$=Re[Pe].trim(),dt.setAccDescription(this.$);break;case 43:this.$=Re[Pe-1]+Re[Pe];break;case 44:this.$=Re[Pe];break;case 45:dt.addVertex(Re[Pe-1][Re[Pe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe]),dt.addLink(Re[Pe-3].stmt,Re[Pe-1],Re[Pe-2]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1].concat(Re[Pe-3].nodes)};break;case 46:dt.addLink(Re[Pe-2].stmt,Re[Pe],Re[Pe-1]),this.$={stmt:Re[Pe],nodes:Re[Pe].concat(Re[Pe-2].nodes)};break;case 47:dt.addLink(Re[Pe-3].stmt,Re[Pe-1],Re[Pe-2]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1].concat(Re[Pe-3].nodes)};break;case 48:this.$={stmt:Re[Pe-1],nodes:Re[Pe-1]};break;case 49:dt.addVertex(Re[Pe-1][Re[Pe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1],shapeData:Re[Pe]};break;case 50:this.$={stmt:Re[Pe],nodes:Re[Pe]};break;case 51:this.$=[Re[Pe]];break;case 52:dt.addVertex(Re[Pe-5][Re[Pe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe-4]),this.$=Re[Pe-5].concat(Re[Pe]);break;case 53:this.$=Re[Pe-4].concat(Re[Pe]);break;case 54:this.$=Re[Pe];break;case 55:this.$=Re[Pe-2],dt.setClass(Re[Pe-2],Re[Pe]);break;case 56:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"square");break;case 57:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"doublecircle");break;case 58:this.$=Re[Pe-5],dt.addVertex(Re[Pe-5],Re[Pe-2],"circle");break;case 59:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"ellipse");break;case 60:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"stadium");break;case 61:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"subroutine");break;case 62:this.$=Re[Pe-7],dt.addVertex(Re[Pe-7],Re[Pe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Re[Pe-5],Re[Pe-3]]]));break;case 63:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"cylinder");break;case 64:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"round");break;case 65:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"diamond");break;case 66:this.$=Re[Pe-5],dt.addVertex(Re[Pe-5],Re[Pe-2],"hexagon");break;case 67:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"odd");break;case 68:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"trapezoid");break;case 69:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"inv_trapezoid");break;case 70:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"lean_right");break;case 71:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"lean_left");break;case 72:this.$=Re[Pe],dt.addVertex(Re[Pe]);break;case 73:Re[Pe-1].text=Re[Pe],this.$=Re[Pe-1];break;case 74:case 75:Re[Pe-2].text=Re[Pe-1],this.$=Re[Pe-2];break;case 76:this.$=Re[Pe];break;case 77:var on=dt.destructLink(Re[Pe],Re[Pe-2]);this.$={type:on.type,stroke:on.stroke,length:on.length,text:Re[Pe-1]};break;case 78:var on=dt.destructLink(Re[Pe],Re[Pe-2]);this.$={type:on.type,stroke:on.stroke,length:on.length,text:Re[Pe-1],id:Re[Pe-3]};break;case 79:this.$={text:Re[Pe],type:"text"};break;case 80:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 81:this.$={text:Re[Pe],type:"string"};break;case 82:this.$={text:Re[Pe],type:"markdown"};break;case 83:var on=dt.destructLink(Re[Pe]);this.$={type:on.type,stroke:on.stroke,length:on.length};break;case 84:var on=dt.destructLink(Re[Pe]);this.$={type:on.type,stroke:on.stroke,length:on.length,id:Re[Pe-1]};break;case 85:this.$=Re[Pe-1];break;case 86:this.$={text:Re[Pe],type:"text"};break;case 87:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 88:this.$={text:Re[Pe],type:"string"};break;case 89:case 104:this.$={text:Re[Pe],type:"markdown"};break;case 101:this.$={text:Re[Pe],type:"text"};break;case 102:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 103:this.$={text:Re[Pe],type:"text"};break;case 105:this.$=Re[Pe-4],dt.addClass(Re[Pe-2],Re[Pe]);break;case 106:this.$=Re[Pe-4],dt.setClass(Re[Pe-2],Re[Pe]);break;case 107:case 115:this.$=Re[Pe-1],dt.setClickEvent(Re[Pe-1],Re[Pe]);break;case 108:case 116:this.$=Re[Pe-3],dt.setClickEvent(Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-3],Re[Pe]);break;case 109:this.$=Re[Pe-2],dt.setClickEvent(Re[Pe-2],Re[Pe-1],Re[Pe]);break;case 110:this.$=Re[Pe-4],dt.setClickEvent(Re[Pe-4],Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-4],Re[Pe]);break;case 111:this.$=Re[Pe-2],dt.setLink(Re[Pe-2],Re[Pe]);break;case 112:this.$=Re[Pe-4],dt.setLink(Re[Pe-4],Re[Pe-2]),dt.setTooltip(Re[Pe-4],Re[Pe]);break;case 113:this.$=Re[Pe-4],dt.setLink(Re[Pe-4],Re[Pe-2],Re[Pe]);break;case 114:this.$=Re[Pe-6],dt.setLink(Re[Pe-6],Re[Pe-4],Re[Pe]),dt.setTooltip(Re[Pe-6],Re[Pe-2]);break;case 117:this.$=Re[Pe-1],dt.setLink(Re[Pe-1],Re[Pe]);break;case 118:this.$=Re[Pe-3],dt.setLink(Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-3],Re[Pe]);break;case 119:this.$=Re[Pe-3],dt.setLink(Re[Pe-3],Re[Pe-2],Re[Pe]);break;case 120:this.$=Re[Pe-5],dt.setLink(Re[Pe-5],Re[Pe-4],Re[Pe]),dt.setTooltip(Re[Pe-5],Re[Pe-2]);break;case 121:this.$=Re[Pe-4],dt.addVertex(Re[Pe-2],void 0,void 0,Re[Pe]);break;case 122:this.$=Re[Pe-4],dt.updateLink([Re[Pe-2]],Re[Pe]);break;case 123:this.$=Re[Pe-4],dt.updateLink(Re[Pe-2],Re[Pe]);break;case 124:this.$=Re[Pe-8],dt.updateLinkInterpolate([Re[Pe-6]],Re[Pe-2]),dt.updateLink([Re[Pe-6]],Re[Pe]);break;case 125:this.$=Re[Pe-8],dt.updateLinkInterpolate(Re[Pe-6],Re[Pe-2]),dt.updateLink(Re[Pe-6],Re[Pe]);break;case 126:this.$=Re[Pe-6],dt.updateLinkInterpolate([Re[Pe-4]],Re[Pe]);break;case 127:this.$=Re[Pe-6],dt.updateLinkInterpolate(Re[Pe-4],Re[Pe]);break;case 128:case 130:this.$=[Re[Pe]];break;case 129:case 131:Re[Pe-2].push(Re[Pe]),this.$=Re[Pe-2];break;case 133:this.$=Re[Pe-1]+Re[Pe];break;case 181:this.$=Re[Pe];break;case 182:this.$=Re[Pe-1]+""+Re[Pe];break;case 184:this.$=Re[Pe-1]+""+Re[Pe];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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},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:H,9:B,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:H,9:B,11:V,21:68},{8:H,9:B,11:V,21:69},{8:H,9:B,11:V,21:70},{8:H,9:B,11:V,21:71},{8:H,9:B,11:V,21:72},{8:H,9:B,10:[1,73],11:V,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(q,[2,50],{18:77,39:78,10:F,40:G}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Q,44:j,60:ae,80:[1,87],89:Z,95:[1,84],97:[1,85],101:86,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(He,[2,51]),t(He,[2,54],{46:[1,100]}),t(ue,[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:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),t(ce,[2,181]),t(ce,[2,142]),t(ce,[2,143]),t(ce,[2,144]),t(ce,[2,145]),t(ce,[2,146]),t(ce,[2,147]),t(ce,[2,148]),t(ce,[2,149]),t(ce,[2,150]),t(ce,[2,151]),t(ce,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ve,81:we,116:Ae,119:Ue},{75:[1,126],77:[1,127]},t(le,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:pe,12:Ce,14:oe,27:fe,28:128,32:W,44:se,60:K,75:de,80:[1,130],81:[1,131],83:141,84:X,85:Fe,86:ke,87:Ye,88:Ie,89:ze,90:De,91:129,105:Ke,109:Be,111:nt,114:Le,115:pt,116:Me},t(Ct,a,{5:154}),t(z,[2,37]),t(z,[2,38]),t(q,[2,48],{44:wt}),t(q,[2,49],{18:156,10:F,40:ht}),t(He,[2,44]),{44:g,47:158,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{44:g,47:163,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Bt,[2,115],{120:168,10:[1,167],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,117],{10:[1,169]}),t(At,[2,183]),t(At,[2,170]),t(At,[2,171]),t(At,[2,172]),t(At,[2,173]),t(At,[2,174]),t(At,[2,175]),t(At,[2,176]),t(At,[2,177]),t(At,[2,178]),t(At,[2,179]),t(At,[2,180]),{44:g,47:170,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{30:171,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:179,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:181,50:[1,180],67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:182,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:183,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:184,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{109:[1,185]},{30:186,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:187,65:[1,188],67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:189,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:190,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:191,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(ce,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(q,[2,46],{39:192,18:193,10:F,40:G}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{77:[1,197],79:198,116:Ae,119:Ue},t(tn,[2,79]),t(tn,[2,81]),t(tn,[2,82]),t(tn,[2,168]),t(tn,[2,169]),{76:199,79:121,80:Ve,81:we,116:Ae,119:Ue},t(le,[2,84]),{8:H,9:B,10:pe,11:V,12:Ce,14:oe,21:201,27:fe,29:[1,200],32:W,44:se,60:K,75:de,83:141,84:X,85:Fe,86:ke,87:Ye,88:Ie,89:ze,90:De,91:202,105:Ke,109:Be,111:nt,114:Le,115:pt,116:Me},t(_e,[2,101]),t(_e,[2,103]),t(_e,[2,104]),t(_e,[2,157]),t(_e,[2,158]),t(_e,[2,159]),t(_e,[2,160]),t(_e,[2,161]),t(_e,[2,162]),t(_e,[2,163]),t(_e,[2,164]),t(_e,[2,165]),t(_e,[2,166]),t(_e,[2,167]),t(_e,[2,90]),t(_e,[2,91]),t(_e,[2,92]),t(_e,[2,93]),t(_e,[2,94]),t(_e,[2,95]),t(_e,[2,96]),t(_e,[2,97]),t(_e,[2,98]),t(_e,[2,99]),t(_e,[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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},{10:F,18:204},{44:[1,205]},t(He,[2,43]),{10:[1,206],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(Je,[2,128]),{10:[1,210],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{10:[1,211],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{80:[1,212]},t(Bt,[2,109],{10:[1,213]}),t(Bt,[2,111],{10:[1,214]}),{80:[1,215]},t(At,[2,184]),{80:[1,216],98:[1,217]},t(He,[2,55],{113:113,44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),{31:[1,218],67:mt,82:219,116:yt,117:gt,118:St},t(ut,[2,86]),t(ut,[2,88]),t(ut,[2,89]),t(ut,[2,153]),t(ut,[2,154]),t(ut,[2,155]),t(ut,[2,156]),{49:[1,220],67:mt,82:219,116:yt,117:gt,118:St},{30:221,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{51:[1,222],67:mt,82:219,116:yt,117:gt,118:St},{53:[1,223],67:mt,82:219,116:yt,117:gt,118:St},{55:[1,224],67:mt,82:219,116:yt,117:gt,118:St},{57:[1,225],67:mt,82:219,116:yt,117:gt,118:St},{60:[1,226]},{64:[1,227],67:mt,82:219,116:yt,117:gt,118:St},{66:[1,228],67:mt,82:219,116:yt,117:gt,118:St},{30:229,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{31:[1,230],67:mt,82:219,116:yt,117:gt,118:St},{67:mt,69:[1,231],71:[1,232],82:219,116:yt,117:gt,118:St},{67:mt,69:[1,234],71:[1,233],82:219,116:yt,117:gt,118:St},t(q,[2,45],{18:156,10:F,40:ht}),t(q,[2,47],{44:wt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:mt,82:219,116:yt,117:gt,118:St},t(ge,[2,77]),t(tn,[2,80]),{77:[1,236],79:198,116:Ae,119:Ue},{30:237,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(Ct,a,{5:238}),t(_e,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{10:F,18:240},{10:Dt,60:Kt,84:Sr,92:241,105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},{10:Dt,60:Kt,84:Sr,92:252,104:[1,253],105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},{10:Dt,60:Kt,84:Sr,92:254,104:[1,255],105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},{105:[1,256]},{10:Dt,60:Kt,84:Sr,92:257,105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},{44:g,47:258,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Bt,[2,116]),t(Bt,[2,118],{10:[1,262]}),t(Bt,[2,119]),t(ue,[2,56]),t(ut,[2,87]),t(ue,[2,57]),{51:[1,263],67:mt,82:219,116:yt,117:gt,118:St},t(ue,[2,64]),t(ue,[2,59]),t(ue,[2,60]),t(ue,[2,61]),{109:[1,264]},t(ue,[2,63]),t(ue,[2,65]),{66:[1,265],67:mt,82:219,116:yt,117:gt,118:St},t(ue,[2,67]),t(ue,[2,68]),t(ue,[2,70]),t(ue,[2,69]),t(ue,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:mt,82:219,116:yt,117:gt,118:St},{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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},t(He,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,121],{106:zr}),t(hn,[2,130],{108:270,10:Dt,60:Kt,84:Sr,105:yr,109:qr,110:Tr,111:rn,112:mr}),t(st,[2,132]),t(st,[2,134]),t(st,[2,135]),t(st,[2,136]),t(st,[2,137]),t(st,[2,138]),t(st,[2,139]),t(st,[2,140]),t(st,[2,141]),t(Bt,[2,122],{106:zr}),{10:[1,271]},t(Bt,[2,123],{106:zr}),{10:[1,272]},t(Je,[2,129]),t(Bt,[2,105],{106:zr}),t(Bt,[2,106],{113:113,44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),t(Bt,[2,110]),t(Bt,[2,112],{10:[1,273]}),t(Bt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:H,9:B,11:V,21:278},t(z,[2,34]),t(He,[2,52]),{10:Dt,60:Kt,84:Sr,105:yr,107:279,108:243,109:qr,110:Tr,111:rn,112:mr},t(st,[2,133]),{14:Q,44:j,60:ae,89:Z,101:280,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},{14:Q,44:j,60:ae,89:Z,101:281,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},{98:[1,282]},t(Bt,[2,120]),t(ue,[2,58]),{30:283,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(ue,[2,66]),t(Ct,a,{5:284}),t(hn,[2,131],{108:270,10:Dt,60:Kt,84:Sr,105:yr,109:qr,110:Tr,111:rn,112:mr}),t(Bt,[2,126],{120:168,10:[1,285],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,127],{120:168,10:[1,286],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,114]),{31:[1,287],67:mt,82:219,116:yt,117:gt,118:St},{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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},{10:Dt,60:Kt,84:Sr,92:289,105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},{10:Dt,60:Kt,84:Sr,92:290,105:yr,107:242,108:243,109:qr,110:Tr,111:rn,112:mr},t(ue,[2,62]),t(z,[2,33]),t(Bt,[2,124],{106:zr}),t(Bt,[2,125],{106:zr})],defaultActions:{},parseError:w(function(Et,ft){if(ft.recoverable)this.trace(Et);else{var Mt=new Error(Et);throw Mt.hash=ft,Mt}},"parseError"),parse:w(function(Et){var ft=this,Mt=[0],dt=[],ur=[null],Re=[],Dn=this.table,Pe="",on=0,On=0,Wa=2,Mn=1,Jn=Re.slice.call(arguments,1),En=Object.create(this.lexer),qs={yy:{}};for(var fh in this.yy)Object.prototype.hasOwnProperty.call(this.yy,fh)&&(qs.yy[fh]=this.yy[fh]);En.setInput(Et,qs.yy),qs.yy.lexer=En,qs.yy.parser=this,typeof En.yylloc>"u"&&(En.yylloc={});var Id=En.yylloc;Re.push(Id);var Fg=En.options&&En.options.ranges;typeof qs.yy.parseError=="function"?this.parseError=qs.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $d(hi){Mt.length=Mt.length-2*hi,ur.length=ur.length-hi,Re.length=Re.length-hi}w($d,"popStack");function Nd(){var hi;return hi=dt.pop()||En.lex()||Mn,typeof hi!="number"&&(hi instanceof Array&&(dt=hi,hi=dt.pop()),hi=ft.symbols_[hi]||hi),hi}w(Nd,"lex");for(var It,Ne,rt,Tt,ir={},br,$r,Xn,ui;;){if(Ne=Mt[Mt.length-1],this.defaultActions[Ne]?rt=this.defaultActions[Ne]:((It===null||typeof It>"u")&&(It=Nd()),rt=Dn[Ne]&&Dn[Ne][It]),typeof rt>"u"||!rt.length||!rt[0]){var Ts="";ui=[];for(br in Dn[Ne])this.terminals_[br]&&br>Wa&&ui.push("'"+this.terminals_[br]+"'");En.showPosition?Ts="Parse error on line "+(on+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;he.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(We().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",()=>{Vr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Vr.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=See();bt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=bt(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(Ff.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),bt(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=We(),wi()}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=w(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const T=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:T in m?m[T].hasOwnProperty(b)?!1:m[T][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=We().flowchart??{},f=u??(d.inheritDir?this.getDirection()??We().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=We(),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:ob(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 Uxe.flowchart}},w(Yb,"FlowDB"),Yb),kUt=w(function(t,e){return e.db.getClasses()},"getClasses"),CUt=w(async function(t,e,r,n,i){var f;he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=We();n.db.setDiagramId(e),he.debug("Before getData: ");const l=n.db.getData();he.debug("Data: ",l);const u=Q3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=bE(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&he.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,he.debug("REF1:",l),await I3(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Vr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),Gy(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),SUt={getClasses:kUt,draw:CUt},fU=(function(){var t=w(function(dn,Et,ft,Mt){for(ft=ft||{},Mt=dn.length;Mt--;ft[dn[Mt]]=Et);return ft},"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],x=[1,31],b=[1,32],T=[1,33],k=[1,45],S=[1,47],C=[1,43],E=[1,48],A=[1,44],M=[1,51],L=[1,46],P=[1,52],N=[1,53],_=[1,34],I=[1,35],O=[1,36],D=[1,37],$=[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],H=[1,62],B=[1,61],V=[1,63],q=[8,9,11,75,77,78],G=[1,79],Q=[1,92],j=[1,97],ae=[1,96],Z=[1,93],J=[1,89],re=[1,95],ee=[1,91],me=[1,98],te=[1,94],$e=[1,99],Oe=[1,90],He=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],ce=[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],Te=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ge=[44,60,89,102,105,106,109,111,114,115,116],Ve=[1,122],we=[1,123],Ae=[1,125],Ue=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Ce=[1,148],oe=[1,149],fe=[1,150],W=[1,151],se=[1,136],K=[1,138],de=[1,142],X=[1,143],Fe=[1,144],ke=[1,145],Ye=[1,146],Ie=[1,147],ze=[1,152],De=[1,153],Ke=[1,132],Be=[1,133],nt=[1,140],Le=[1,135],pt=[1,139],Me=[1,137],Ct=[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],wt=[1,155],ht=[1,157],Bt=[8,9,11],At=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],mt=[1,177],ye=[1,173],Nt=[1,174],yt=[1,178],gt=[1,175],St=[1,176],tn=[77,116,119],_e=[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],Je=[10,106],ut=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Dt=[1,248],Kt=[1,246],Er=[1,250],yr=[1,244],qr=[1,245],kr=[1,247],rn=[1,249],mr=[1,251],zr=[1,269],hn=[8,9,11,106],st=[8,9,10,11,60,84,105,106,109,110,111,112],vt={trace:w(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:w(function(Et,ft,Mt,dt,ur,Re,Dn){var Pe=Re.length-1;switch(ur){case 2:this.$=[];break;case 3:(!Array.isArray(Re[Pe])||Re[Pe].length>0)&&Re[Pe-1].push(Re[Pe]),this.$=Re[Pe-1];break;case 4:case 183:this.$=Re[Pe];break;case 11:dt.setDirection("TB"),this.$="TB";break;case 12:dt.setDirection(Re[Pe-1]),this.$=Re[Pe-1];break;case 27:this.$=Re[Pe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=dt.addSubGraph(Re[Pe-6],Re[Pe-1],Re[Pe-4]);break;case 34:this.$=dt.addSubGraph(Re[Pe-3],Re[Pe-1],Re[Pe-3]);break;case 35:this.$=dt.addSubGraph(void 0,Re[Pe-1],void 0);break;case 37:this.$=Re[Pe].trim(),dt.setAccTitle(this.$);break;case 38:case 39:this.$=Re[Pe].trim(),dt.setAccDescription(this.$);break;case 43:this.$=Re[Pe-1]+Re[Pe];break;case 44:this.$=Re[Pe];break;case 45:dt.addVertex(Re[Pe-1][Re[Pe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe]),dt.addLink(Re[Pe-3].stmt,Re[Pe-1],Re[Pe-2]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1].concat(Re[Pe-3].nodes)};break;case 46:dt.addLink(Re[Pe-2].stmt,Re[Pe],Re[Pe-1]),this.$={stmt:Re[Pe],nodes:Re[Pe].concat(Re[Pe-2].nodes)};break;case 47:dt.addLink(Re[Pe-3].stmt,Re[Pe-1],Re[Pe-2]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1].concat(Re[Pe-3].nodes)};break;case 48:this.$={stmt:Re[Pe-1],nodes:Re[Pe-1]};break;case 49:dt.addVertex(Re[Pe-1][Re[Pe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe]),this.$={stmt:Re[Pe-1],nodes:Re[Pe-1],shapeData:Re[Pe]};break;case 50:this.$={stmt:Re[Pe],nodes:Re[Pe]};break;case 51:this.$=[Re[Pe]];break;case 52:dt.addVertex(Re[Pe-5][Re[Pe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Re[Pe-4]),this.$=Re[Pe-5].concat(Re[Pe]);break;case 53:this.$=Re[Pe-4].concat(Re[Pe]);break;case 54:this.$=Re[Pe];break;case 55:this.$=Re[Pe-2],dt.setClass(Re[Pe-2],Re[Pe]);break;case 56:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"square");break;case 57:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"doublecircle");break;case 58:this.$=Re[Pe-5],dt.addVertex(Re[Pe-5],Re[Pe-2],"circle");break;case 59:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"ellipse");break;case 60:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"stadium");break;case 61:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"subroutine");break;case 62:this.$=Re[Pe-7],dt.addVertex(Re[Pe-7],Re[Pe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Re[Pe-5],Re[Pe-3]]]));break;case 63:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"cylinder");break;case 64:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"round");break;case 65:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"diamond");break;case 66:this.$=Re[Pe-5],dt.addVertex(Re[Pe-5],Re[Pe-2],"hexagon");break;case 67:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"odd");break;case 68:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"trapezoid");break;case 69:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"inv_trapezoid");break;case 70:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"lean_right");break;case 71:this.$=Re[Pe-3],dt.addVertex(Re[Pe-3],Re[Pe-1],"lean_left");break;case 72:this.$=Re[Pe],dt.addVertex(Re[Pe]);break;case 73:Re[Pe-1].text=Re[Pe],this.$=Re[Pe-1];break;case 74:case 75:Re[Pe-2].text=Re[Pe-1],this.$=Re[Pe-2];break;case 76:this.$=Re[Pe];break;case 77:var on=dt.destructLink(Re[Pe],Re[Pe-2]);this.$={type:on.type,stroke:on.stroke,length:on.length,text:Re[Pe-1]};break;case 78:var on=dt.destructLink(Re[Pe],Re[Pe-2]);this.$={type:on.type,stroke:on.stroke,length:on.length,text:Re[Pe-1],id:Re[Pe-3]};break;case 79:this.$={text:Re[Pe],type:"text"};break;case 80:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 81:this.$={text:Re[Pe],type:"string"};break;case 82:this.$={text:Re[Pe],type:"markdown"};break;case 83:var on=dt.destructLink(Re[Pe]);this.$={type:on.type,stroke:on.stroke,length:on.length};break;case 84:var on=dt.destructLink(Re[Pe]);this.$={type:on.type,stroke:on.stroke,length:on.length,id:Re[Pe-1]};break;case 85:this.$=Re[Pe-1];break;case 86:this.$={text:Re[Pe],type:"text"};break;case 87:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 88:this.$={text:Re[Pe],type:"string"};break;case 89:case 104:this.$={text:Re[Pe],type:"markdown"};break;case 101:this.$={text:Re[Pe],type:"text"};break;case 102:this.$={text:Re[Pe-1].text+""+Re[Pe],type:Re[Pe-1].type};break;case 103:this.$={text:Re[Pe],type:"text"};break;case 105:this.$=Re[Pe-4],dt.addClass(Re[Pe-2],Re[Pe]);break;case 106:this.$=Re[Pe-4],dt.setClass(Re[Pe-2],Re[Pe]);break;case 107:case 115:this.$=Re[Pe-1],dt.setClickEvent(Re[Pe-1],Re[Pe]);break;case 108:case 116:this.$=Re[Pe-3],dt.setClickEvent(Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-3],Re[Pe]);break;case 109:this.$=Re[Pe-2],dt.setClickEvent(Re[Pe-2],Re[Pe-1],Re[Pe]);break;case 110:this.$=Re[Pe-4],dt.setClickEvent(Re[Pe-4],Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-4],Re[Pe]);break;case 111:this.$=Re[Pe-2],dt.setLink(Re[Pe-2],Re[Pe]);break;case 112:this.$=Re[Pe-4],dt.setLink(Re[Pe-4],Re[Pe-2]),dt.setTooltip(Re[Pe-4],Re[Pe]);break;case 113:this.$=Re[Pe-4],dt.setLink(Re[Pe-4],Re[Pe-2],Re[Pe]);break;case 114:this.$=Re[Pe-6],dt.setLink(Re[Pe-6],Re[Pe-4],Re[Pe]),dt.setTooltip(Re[Pe-6],Re[Pe-2]);break;case 117:this.$=Re[Pe-1],dt.setLink(Re[Pe-1],Re[Pe]);break;case 118:this.$=Re[Pe-3],dt.setLink(Re[Pe-3],Re[Pe-2]),dt.setTooltip(Re[Pe-3],Re[Pe]);break;case 119:this.$=Re[Pe-3],dt.setLink(Re[Pe-3],Re[Pe-2],Re[Pe]);break;case 120:this.$=Re[Pe-5],dt.setLink(Re[Pe-5],Re[Pe-4],Re[Pe]),dt.setTooltip(Re[Pe-5],Re[Pe-2]);break;case 121:this.$=Re[Pe-4],dt.addVertex(Re[Pe-2],void 0,void 0,Re[Pe]);break;case 122:this.$=Re[Pe-4],dt.updateLink([Re[Pe-2]],Re[Pe]);break;case 123:this.$=Re[Pe-4],dt.updateLink(Re[Pe-2],Re[Pe]);break;case 124:this.$=Re[Pe-8],dt.updateLinkInterpolate([Re[Pe-6]],Re[Pe-2]),dt.updateLink([Re[Pe-6]],Re[Pe]);break;case 125:this.$=Re[Pe-8],dt.updateLinkInterpolate(Re[Pe-6],Re[Pe-2]),dt.updateLink(Re[Pe-6],Re[Pe]);break;case 126:this.$=Re[Pe-6],dt.updateLinkInterpolate([Re[Pe-4]],Re[Pe]);break;case 127:this.$=Re[Pe-6],dt.updateLinkInterpolate(Re[Pe-4],Re[Pe]);break;case 128:case 130:this.$=[Re[Pe]];break;case 129:case 131:Re[Pe-2].push(Re[Pe]),this.$=Re[Pe-2];break;case 133:this.$=Re[Pe-1]+Re[Pe];break;case 181:this.$=Re[Pe];break;case 182:this.$=Re[Pe-1]+""+Re[Pe];break;case 184:this.$=Re[Pe-1]+""+Re[Pe];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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},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:H,9:B,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:H,9:B,11:V,21:68},{8:H,9:B,11:V,21:69},{8:H,9:B,11:V,21:70},{8:H,9:B,11:V,21:71},{8:H,9:B,11:V,21:72},{8:H,9:B,10:[1,73],11:V,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(q,[2,50],{18:77,39:78,10:F,40:G}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Q,44:j,60:ae,80:[1,87],89:Z,95:[1,84],97:[1,85],101:86,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(He,[2,51]),t(He,[2,54],{46:[1,100]}),t(ue,[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:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),t(ce,[2,181]),t(ce,[2,142]),t(ce,[2,143]),t(ce,[2,144]),t(ce,[2,145]),t(ce,[2,146]),t(ce,[2,147]),t(ce,[2,148]),t(ce,[2,149]),t(ce,[2,150]),t(ce,[2,151]),t(ce,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ve,81:we,116:Ae,119:Ue},{75:[1,126],77:[1,127]},t(le,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:pe,12:Ce,14:oe,27:fe,28:128,32:W,44:se,60:K,75:de,80:[1,130],81:[1,131],83:141,84:X,85:Fe,86:ke,87:Ye,88:Ie,89:ze,90:De,91:129,105:Ke,109:Be,111:nt,114:Le,115:pt,116:Me},t(Ct,a,{5:154}),t(z,[2,37]),t(z,[2,38]),t(q,[2,48],{44:wt}),t(q,[2,49],{18:156,10:F,40:ht}),t(He,[2,44]),{44:g,47:158,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{44:g,47:163,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Bt,[2,115],{120:168,10:[1,167],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,117],{10:[1,169]}),t(At,[2,183]),t(At,[2,170]),t(At,[2,171]),t(At,[2,172]),t(At,[2,173]),t(At,[2,174]),t(At,[2,175]),t(At,[2,176]),t(At,[2,177]),t(At,[2,178]),t(At,[2,179]),t(At,[2,180]),{44:g,47:170,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{30:171,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:179,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:181,50:[1,180],67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:182,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:183,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:184,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{109:[1,185]},{30:186,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:187,65:[1,188],67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:189,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:190,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{30:191,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(ce,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(q,[2,46],{39:192,18:193,10:F,40:G}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{77:[1,197],79:198,116:Ae,119:Ue},t(tn,[2,79]),t(tn,[2,81]),t(tn,[2,82]),t(tn,[2,168]),t(tn,[2,169]),{76:199,79:121,80:Ve,81:we,116:Ae,119:Ue},t(le,[2,84]),{8:H,9:B,10:pe,11:V,12:Ce,14:oe,21:201,27:fe,29:[1,200],32:W,44:se,60:K,75:de,83:141,84:X,85:Fe,86:ke,87:Ye,88:Ie,89:ze,90:De,91:202,105:Ke,109:Be,111:nt,114:Le,115:pt,116:Me},t(_e,[2,101]),t(_e,[2,103]),t(_e,[2,104]),t(_e,[2,157]),t(_e,[2,158]),t(_e,[2,159]),t(_e,[2,160]),t(_e,[2,161]),t(_e,[2,162]),t(_e,[2,163]),t(_e,[2,164]),t(_e,[2,165]),t(_e,[2,166]),t(_e,[2,167]),t(_e,[2,90]),t(_e,[2,91]),t(_e,[2,92]),t(_e,[2,93]),t(_e,[2,94]),t(_e,[2,95]),t(_e,[2,96]),t(_e,[2,97]),t(_e,[2,98]),t(_e,[2,99]),t(_e,[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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},{10:F,18:204},{44:[1,205]},t(He,[2,43]),{10:[1,206],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(Je,[2,128]),{10:[1,210],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{10:[1,211],44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:113,114:L,115:P,116:N},{80:[1,212]},t(Bt,[2,109],{10:[1,213]}),t(Bt,[2,111],{10:[1,214]}),{80:[1,215]},t(At,[2,184]),{80:[1,216],98:[1,217]},t(He,[2,55],{113:113,44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),{31:[1,218],67:mt,82:219,116:yt,117:gt,118:St},t(ut,[2,86]),t(ut,[2,88]),t(ut,[2,89]),t(ut,[2,153]),t(ut,[2,154]),t(ut,[2,155]),t(ut,[2,156]),{49:[1,220],67:mt,82:219,116:yt,117:gt,118:St},{30:221,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{51:[1,222],67:mt,82:219,116:yt,117:gt,118:St},{53:[1,223],67:mt,82:219,116:yt,117:gt,118:St},{55:[1,224],67:mt,82:219,116:yt,117:gt,118:St},{57:[1,225],67:mt,82:219,116:yt,117:gt,118:St},{60:[1,226]},{64:[1,227],67:mt,82:219,116:yt,117:gt,118:St},{66:[1,228],67:mt,82:219,116:yt,117:gt,118:St},{30:229,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},{31:[1,230],67:mt,82:219,116:yt,117:gt,118:St},{67:mt,69:[1,231],71:[1,232],82:219,116:yt,117:gt,118:St},{67:mt,69:[1,234],71:[1,233],82:219,116:yt,117:gt,118:St},t(q,[2,45],{18:156,10:F,40:ht}),t(q,[2,47],{44:wt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:mt,82:219,116:yt,117:gt,118:St},t(ge,[2,77]),t(tn,[2,80]),{77:[1,236],79:198,116:Ae,119:Ue},{30:237,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(Ct,a,{5:238}),t(_e,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},{10:F,18:240},{10:Dt,60:Kt,84:Er,92:241,105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},{10:Dt,60:Kt,84:Er,92:252,104:[1,253],105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},{10:Dt,60:Kt,84:Er,92:254,104:[1,255],105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},{105:[1,256]},{10:Dt,60:Kt,84:Er,92:257,105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},{44:g,47:258,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Bt,[2,116]),t(Bt,[2,118],{10:[1,262]}),t(Bt,[2,119]),t(ue,[2,56]),t(ut,[2,87]),t(ue,[2,57]),{51:[1,263],67:mt,82:219,116:yt,117:gt,118:St},t(ue,[2,64]),t(ue,[2,59]),t(ue,[2,60]),t(ue,[2,61]),{109:[1,264]},t(ue,[2,63]),t(ue,[2,65]),{66:[1,265],67:mt,82:219,116:yt,117:gt,118:St},t(ue,[2,67]),t(ue,[2,68]),t(ue,[2,70]),t(ue,[2,69]),t(ue,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:mt,82:219,116:yt,117:gt,118:St},{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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},t(He,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N},t(Bt,[2,121],{106:zr}),t(hn,[2,130],{108:270,10:Dt,60:Kt,84:Er,105:yr,109:qr,110:kr,111:rn,112:mr}),t(st,[2,132]),t(st,[2,134]),t(st,[2,135]),t(st,[2,136]),t(st,[2,137]),t(st,[2,138]),t(st,[2,139]),t(st,[2,140]),t(st,[2,141]),t(Bt,[2,122],{106:zr}),{10:[1,271]},t(Bt,[2,123],{106:zr}),{10:[1,272]},t(Je,[2,129]),t(Bt,[2,105],{106:zr}),t(Bt,[2,106],{113:113,44:g,60:m,89:k,102:S,105:C,106:E,109:A,111:M,114:L,115:P,116:N}),t(Bt,[2,110]),t(Bt,[2,112],{10:[1,273]}),t(Bt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:H,9:B,11:V,21:278},t(z,[2,34]),t(He,[2,52]),{10:Dt,60:Kt,84:Er,105:yr,107:279,108:243,109:qr,110:kr,111:rn,112:mr},t(st,[2,133]),{14:Q,44:j,60:ae,89:Z,101:280,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},{14:Q,44:j,60:ae,89:Z,101:281,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe,120:88},{98:[1,282]},t(Bt,[2,120]),t(ue,[2,58]),{30:283,67:mt,80:ye,81:Nt,82:172,116:yt,117:gt,118:St},t(ue,[2,66]),t(Ct,a,{5:284}),t(hn,[2,131],{108:270,10:Dt,60:Kt,84:Er,105:yr,109:qr,110:kr,111:rn,112:mr}),t(Bt,[2,126],{120:168,10:[1,285],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,127],{120:168,10:[1,286],14:Q,44:j,60:ae,89:Z,105:J,106:re,109:ee,111:me,114:te,115:$e,116:Oe}),t(Bt,[2,114]),{31:[1,287],67:mt,82:219,116:yt,117:gt,118:St},{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:x,87:b,88:T,89:k,102:S,105:C,106:E,109:A,111:M,113:42,114:L,115:P,116:N,121:_,122:I,123:O,124:D,125:$},{10:Dt,60:Kt,84:Er,92:289,105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},{10:Dt,60:Kt,84:Er,92:290,105:yr,107:242,108:243,109:qr,110:kr,111:rn,112:mr},t(ue,[2,62]),t(z,[2,33]),t(Bt,[2,124],{106:zr}),t(Bt,[2,125],{106:zr})],defaultActions:{},parseError:w(function(Et,ft){if(ft.recoverable)this.trace(Et);else{var Mt=new Error(Et);throw Mt.hash=ft,Mt}},"parseError"),parse:w(function(Et){var ft=this,Mt=[0],dt=[],ur=[null],Re=[],Dn=this.table,Pe="",on=0,On=0,Wa=2,Mn=1,Jn=Re.slice.call(arguments,1),En=Object.create(this.lexer),qs={yy:{}};for(var fh in this.yy)Object.prototype.hasOwnProperty.call(this.yy,fh)&&(qs.yy[fh]=this.yy[fh]);En.setInput(Et,qs.yy),qs.yy.lexer=En,qs.yy.parser=this,typeof En.yylloc>"u"&&(En.yylloc={});var $d=En.yylloc;Re.push($d);var Fg=En.options&&En.options.ranges;typeof qs.yy.parseError=="function"?this.parseError=qs.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nd(hi){Mt.length=Mt.length-2*hi,ur.length=ur.length-hi,Re.length=Re.length-hi}w(Nd,"popStack");function Dd(){var hi;return hi=dt.pop()||En.lex()||Mn,typeof hi!="number"&&(hi instanceof Array&&(dt=hi,hi=dt.pop()),hi=ft.symbols_[hi]||hi),hi}w(Dd,"lex");for(var It,Ne,rt,Tt,ir={},xr,$r,Xn,ui;;){if(Ne=Mt[Mt.length-1],this.defaultActions[Ne]?rt=this.defaultActions[Ne]:((It===null||typeof It>"u")&&(It=Dd()),rt=Dn[Ne]&&Dn[Ne][It]),typeof rt>"u"||!rt.length||!rt[0]){var Ts="";ui=[];for(xr in Dn[Ne])this.terminals_[xr]&&xr>Wa&&ui.push("'"+this.terminals_[xr]+"'");En.showPosition?Ts="Parse error on line "+(on+1)+`: `+En.showPosition()+` -Expecting `+ui.join(", ")+", got '"+(this.terminals_[It]||It)+"'":Ts="Parse error on line "+(on+1)+": Unexpected "+(It==Mn?"end of input":"'"+(this.terminals_[It]||It)+"'"),this.parseError(Ts,{text:En.match,token:this.terminals_[It]||It,line:En.yylineno,loc:Id,expected:ui})}if(rt[0]instanceof Array&&rt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+It);switch(rt[0]){case 1:Mt.push(It),ur.push(En.yytext),Re.push(En.yylloc),Mt.push(rt[1]),It=null,On=En.yyleng,Pe=En.yytext,on=En.yylineno,Id=En.yylloc;break;case 2:if($r=this.productions_[rt[1]][1],ir.$=ur[ur.length-$r],ir._$={first_line:Re[Re.length-($r||1)].first_line,last_line:Re[Re.length-1].last_line,first_column:Re[Re.length-($r||1)].first_column,last_column:Re[Re.length-1].last_column},Fg&&(ir._$.range=[Re[Re.length-($r||1)].range[0],Re[Re.length-1].range[1]]),Tt=this.performAction.apply(ir,[Pe,On,on,qs.yy,rt[1],ur,Re].concat(Jn)),typeof Tt<"u")return Tt;$r&&(Mt=Mt.slice(0,-1*$r*2),ur=ur.slice(0,-1*$r),Re=Re.slice(0,-1*$r)),Mt.push(this.productions_[rt[1]][0]),ur.push(ir.$),Re.push(ir._$),Xn=Dn[Mt[Mt.length-2]][Mt[Mt.length-1]],Mt.push(Xn);break;case 3:return!0}}return!0},"parse")},jt=(function(){var dn={EOF:1,parseError:w(function(ft,Mt){if(this.yy.parser)this.yy.parser.parseError(ft,Mt);else throw new Error(ft)},"parseError"),setInput:w(function(Et,ft){return this.yy=ft||this.yy||{},this._input=Et,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:w(function(){var Et=this._input[0];this.yytext+=Et,this.yyleng++,this.offset++,this.match+=Et,this.matched+=Et;var ft=Et.match(/(?:\r\n?|\n).*/g);return ft?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Et},"input"),unput:w(function(Et){var ft=Et.length,Mt=Et.split(/(?:\r\n?|\n)/g);this._input=Et+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ft),this.offset-=ft;var dt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Mt.length-1&&(this.yylineno-=Mt.length-1);var ur=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:Mt?(Mt.length===dt.length?this.yylloc.first_column:0)+dt[dt.length-Mt.length].length-Mt[0].length:this.yylloc.first_column-ft},this.options.ranges&&(this.yylloc.range=[ur[0],ur[0]+this.yyleng-ft]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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 `+ui.join(", ")+", got '"+(this.terminals_[It]||It)+"'":Ts="Parse error on line "+(on+1)+": Unexpected "+(It==Mn?"end of input":"'"+(this.terminals_[It]||It)+"'"),this.parseError(Ts,{text:En.match,token:this.terminals_[It]||It,line:En.yylineno,loc:$d,expected:ui})}if(rt[0]instanceof Array&&rt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ne+", token: "+It);switch(rt[0]){case 1:Mt.push(It),ur.push(En.yytext),Re.push(En.yylloc),Mt.push(rt[1]),It=null,On=En.yyleng,Pe=En.yytext,on=En.yylineno,$d=En.yylloc;break;case 2:if($r=this.productions_[rt[1]][1],ir.$=ur[ur.length-$r],ir._$={first_line:Re[Re.length-($r||1)].first_line,last_line:Re[Re.length-1].last_line,first_column:Re[Re.length-($r||1)].first_column,last_column:Re[Re.length-1].last_column},Fg&&(ir._$.range=[Re[Re.length-($r||1)].range[0],Re[Re.length-1].range[1]]),Tt=this.performAction.apply(ir,[Pe,On,on,qs.yy,rt[1],ur,Re].concat(Jn)),typeof Tt<"u")return Tt;$r&&(Mt=Mt.slice(0,-1*$r*2),ur=ur.slice(0,-1*$r),Re=Re.slice(0,-1*$r)),Mt.push(this.productions_[rt[1]][0]),ur.push(ir.$),Re.push(ir._$),Xn=Dn[Mt[Mt.length-2]][Mt[Mt.length-1]],Mt.push(Xn);break;case 3:return!0}}return!0},"parse")},jt=(function(){var dn={EOF:1,parseError:w(function(ft,Mt){if(this.yy.parser)this.yy.parser.parseError(ft,Mt);else throw new Error(ft)},"parseError"),setInput:w(function(Et,ft){return this.yy=ft||this.yy||{},this._input=Et,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:w(function(){var Et=this._input[0];this.yytext+=Et,this.yyleng++,this.offset++,this.match+=Et,this.matched+=Et;var ft=Et.match(/(?:\r\n?|\n).*/g);return ft?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Et},"input"),unput:w(function(Et){var ft=Et.length,Mt=Et.split(/(?:\r\n?|\n)/g);this._input=Et+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ft),this.offset-=ft;var dt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Mt.length-1&&(this.yylineno-=Mt.length-1);var ur=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:Mt?(Mt.length===dt.length?this.yylloc.first_column:0)+dt[dt.length-Mt.length].length-Mt[0].length:this.yylloc.first_column-ft},this.options.ranges&&(this.yylloc.range=[ur[0],ur[0]+this.yyleng-ft]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(Et){this.unput(this.match.slice(Et))},"less"),pastInput:w(function(){var Et=this.matched.substr(0,this.matched.length-this.match.length);return(Et.length>20?"...":"")+Et.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Et=this.match;return Et.length<20&&(Et+=this._input.substr(0,20-Et.length)),(Et.substr(0,20)+(Et.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Et=this.pastInput(),ft=new Array(Et.length+1).join("-");return Et+this.upcomingInput()+` `+ft+"^"},"showPosition"),test_match:w(function(Et,ft){var Mt,dt,ur;if(this.options.backtrack_lexer&&(ur={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&&(ur.yylloc.range=this.yylloc.range.slice(0))),dt=Et[0].match(/(?:\r\n?|\n).*/g),dt&&(this.yylineno+=dt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:dt?dt[dt.length-1].length-dt[dt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Et[0].length},this.yytext+=Et[0],this.match+=Et[0],this.matches=Et,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(Et[0].length),this.matched+=Et[0],Mt=this.performAction.call(this,this.yy,this,ft,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Mt)return Mt;if(this._backtrack){for(var Re in ur)this[Re]=ur[Re];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Et,ft,Mt,dt;this._more||(this.yytext="",this.match="");for(var ur=this._currentRules(),Re=0;Reft[0].length)){if(ft=Mt,dt=Re,this.options.backtrack_lexer){if(Et=this.test_match(Mt,ur[Re]),Et!==!1)return Et;if(this._backtrack){ft=!1;continue}else return!1}else if(!this.options.flex)break}return ft?(Et=this.test_match(ft,ur[dt]),Et!==!1?Et:!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:w(function(){var ft=this.next();return ft||this.lex()},"lex"),begin:w(function(ft){this.conditionStack.push(ft)},"begin"),popState:w(function(){var ft=this.conditionStack.length-1;return ft>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(ft){return ft=this.conditionStack.length-1-Math.abs(ft||0),ft>=0?this.conditionStack[ft]:"INITIAL"},"topState"),pushState:w(function(ft){this.begin(ft)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(ft,Mt,dt,ur){switch(dt){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"),Mt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Re=/\n\s*/g;return Mt.yytext=Mt.yytext.replace(Re,"
"),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 ft.lex.firstGraph()&&this.begin("dir"),12;case 36:return ft.lex.firstGraph()&&this.begin("dir"),12;case 37:return ft.lex.firstGraph()&&this.begin("dir"),12;case 38:return ft.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 dn})();vt.lexer=jt;function Mr(){this.yy={}}return w(Mr,"Parser"),Mr.prototype=vt,vt.Parser=Mr,new Mr})();hU.parser=hU;var JLe=hU,eIe=Object.assign({},JLe);eIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return JLe.parse(e)};var xUt=eIe,wUt=w((t,e)=>{const r=iK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),TUt=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var ft=this.next();return ft||this.lex()},"lex"),begin:w(function(ft){this.conditionStack.push(ft)},"begin"),popState:w(function(){var ft=this.conditionStack.length-1;return ft>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(ft){return ft=this.conditionStack.length-1-Math.abs(ft||0),ft>=0?this.conditionStack[ft]:"INITIAL"},"topState"),pushState:w(function(ft){this.begin(ft)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(ft,Mt,dt,ur){switch(dt){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"),Mt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Re=/\n\s*/g;return Mt.yytext=Mt.yytext.replace(Re,"
"),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 ft.lex.firstGraph()&&this.begin("dir"),12;case 36:return ft.lex.firstGraph()&&this.begin("dir"),12;case 37:return ft.lex.firstGraph()&&this.begin("dir"),12;case 38:return ft.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 dn})();vt.lexer=jt;function Mr(){this.yy={}}return w(Mr,"Parser"),Mr.prototype=vt,vt.Parser=Mr,new Mr})();fU.parser=fU;var rIe=fU,nIe=Object.assign({},rIe);nIe.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return rIe.parse(e)};var EUt=nIe,AUt=w((t,e)=>{const r=sK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),RUt=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -2361,7 +2374,7 @@ Expecting `+ui.join(", ")+", got '"+(this.terminals_[It]||It)+"'":Ts="Parse erro /* For html labels only */ .labelBkg { - background-color: ${wUt(t.edgeLabelBackground,.5)}; + background-color: ${AUt(t.edgeLabelBackground,.5)}; // background-color: } @@ -2420,20 +2433,20 @@ Expecting `+ui.join(", ")+", got '"+(this.terminals_[It]||It)+"'":Ts="Parse erro } text-align: center; } - ${XE()} -`,"getStyles"),tIe=TUt,Ree=w(({defaultLayout:t,styles:e=tIe}={})=>({parser:xUt,get db(){return new mUt},renderer:bUt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=Bxe().layout??t??r.layout;n&&OV({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,OV({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),kUt=Ree();const _ee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:Ree,diagram:kUt},Symbol.toStringTag,{value:"Module"}));var CUt=w(t=>`${tIe(t)} + ${KE()} +`,"getStyles"),iIe=RUt,Mee=w(({defaultLayout:t,styles:e=iIe}={})=>({parser:EUt,get db(){return new TUt},renderer:SUt,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=Fxe().layout??t??r.layout;n&&BV({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,BV({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),_Ut=Mee();const Lee=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:Mee,diagram:_Ut},Symbol.toStringTag,{value:"Module"}));var MUt=w(t=>`${iIe(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),SUt=CUt,EUt=Ree({defaultLayout:"swimlane",styles:SUt});const AUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:EUt},Symbol.toStringTag,{value:"Module"}));var dU=(function(){var t=w(function($e,Oe,He,ue){for(He=He||{},ue=$e.length;ue--;He[$e[ue]]=Oe);return He},"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],x=[1,36],b=[1,37],T=[1,38],k=[1,39],S=[1,40],C=[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],A=[1,46],M=[1,55],L=[40,48,50,51,52,71,72],P=[1,66],N=[1,64],_=[1,61],I=[1,65],O=[1,67],D=[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],$=[66,67,68,69,70],F=[1,85],z=[1,84],H=[1,82],B=[1,83],V=[6,10,42,47],q=[6,10,13,41,42,47,48,49],G=[1,93],Q=[1,92],j=[1,91],ae=[19,58],Z=[1,102],J=[1,101],re=[19,58,61,63],ee={trace:w(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:w(function(Oe,He,ue,ce,Te,ge,Ve){var we=ge.length-1;switch(Te){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:ce.addEntity(ge[we-4]),ce.addEntity(ge[we-2]),ce.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:ce.addEntity(ge[we-8]),ce.addEntity(ge[we-4]),ce.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),ce.setClass([ge[we-8]],ge[we-6]),ce.setClass([ge[we-4]],ge[we-2]);break;case 10:ce.addEntity(ge[we-6]),ce.addEntity(ge[we-2]),ce.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),ce.setClass([ge[we-6]],ge[we-4]);break;case 11:ce.addEntity(ge[we-6]),ce.addEntity(ge[we-4]),ce.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),ce.setClass([ge[we-4]],ge[we-2]);break;case 12:ce.addEntity(ge[we-3]),ce.addAttributes(ge[we-3],ge[we-1]);break;case 13:ce.addEntity(ge[we-5]),ce.addAttributes(ge[we-5],ge[we-1]),ce.setClass([ge[we-5]],ge[we-3]);break;case 14:ce.addEntity(ge[we-2]);break;case 15:ce.addEntity(ge[we-4]),ce.setClass([ge[we-4]],ge[we-2]);break;case 16:ce.addEntity(ge[we]);break;case 17:ce.addEntity(ge[we-2]),ce.setClass([ge[we-2]],ge[we]);break;case 18:ce.addEntity(ge[we-6],ge[we-4]),ce.addAttributes(ge[we-6],ge[we-1]);break;case 19:ce.addEntity(ge[we-8],ge[we-6]),ce.addAttributes(ge[we-8],ge[we-1]),ce.setClass([ge[we-8]],ge[we-3]);break;case 20:ce.addEntity(ge[we-5],ge[we-3]);break;case 21:ce.addEntity(ge[we-7],ge[we-5]),ce.setClass([ge[we-7]],ge[we-2]);break;case 22:ce.addEntity(ge[we-3],ge[we-1]);break;case 23:ce.addEntity(ge[we-5],ge[we-3]),ce.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),ce.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),ce.setAccDescription(this.$);break;case 32:ce.setDirection("TB");break;case 33:ce.setDirection("BT");break;case 34:ce.setDirection("RL");break;case 35:ce.setDirection("LR");break;case 36:this.$=ge[we-3],ce.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],ce.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],ce.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=ce.Cardinality.ZERO_OR_ONE;break;case 74:this.$=ce.Cardinality.ZERO_OR_MORE;break;case 75:this.$=ce.Cardinality.ONE_OR_MORE;break;case 76:this.$=ce.Cardinality.ONLY_ONE;break;case 77:this.$=ce.Cardinality.MD_PARENT;break;case 78:this.$=ce.Identification.NON_IDENTIFYING;break;case 79:this.$=ce.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:x,67:b,68:T,69:k,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(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:A},{16:47,40:E,41:A},{16:48,40:E,41:A},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:A},{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:N,42:_,45:62,46:63,48:I,49:O},t(D,[2,37]),t(D,[2,38]),{16:68,40:E,41:A,42:_},{13:P,38:69,41:N,42:_,45:62,46:63,48:I,49:O},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:_,66:x,67:b,68:T,69:k,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:x,67:b,68:T,69:k,70:S},t($,[2,78]),t($,[2,79]),{6:F,10:z,39:81,42:H,47:B},{40:[1,86],41:[1,87]},t(V,[2,43],{46:88,13:P,41:N,48:I,49:O}),t(q,[2,45]),t(q,[2,50]),t(q,[2,51]),t(q,[2,52]),t(q,[2,53]),t(e,[2,41],{42:_}),{6:F,10:z,39:89,42:H,47:B},{14:90,40:G,50:Q,73:j},{16:94,40:E,41:A},{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(ae,[2,61],{56:98,57:99,60:100,62:Z,63:J}),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:N,45:105,46:63,48:I,49:O},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(q,[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:_},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(ae,[2,62],{57:110,61:[1,111],63:J}),t(ae,[2,63]),t(re,[2,68]),t(ae,[2,71]),t(re,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:A},t(V,[2,44],{46:88,13:P,41:N,48:I,49:O}),{14:115,40:G,50:Q,73:j},{16:116,40:E,41:A},{14:117,40:G,50:Q,73:j},t(e,[2,13]),t(ae,[2,64]),{60:118,62:Z},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:_}),t(e,[2,11]),{13:[1,121],42:_},t(e,[2,10]),t(re,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:G,50:Q,73:j},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:w(function(Oe,He){if(He.recoverable)this.trace(Oe);else{var ue=new Error(Oe);throw ue.hash=He,ue}},"parseError"),parse:w(function(Oe){var He=this,ue=[0],ce=[],Te=[null],ge=[],Ve=this.table,we="",Ae=0,Ue=0,le=2,pe=1,Ce=ge.slice.call(arguments,1),oe=Object.create(this.lexer),fe={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(fe.yy[W]=this.yy[W]);oe.setInput(Oe,fe.yy),fe.yy.lexer=oe,fe.yy.parser=this,typeof oe.yylloc>"u"&&(oe.yylloc={});var se=oe.yylloc;ge.push(se);var K=oe.options&&oe.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(pt){ue.length=ue.length-2*pt,Te.length=Te.length-pt,ge.length=ge.length-pt}w(de,"popStack");function X(){var pt;return pt=ce.pop()||oe.lex()||pe,typeof pt!="number"&&(pt instanceof Array&&(ce=pt,pt=ce.pop()),pt=He.symbols_[pt]||pt),pt}w(X,"lex");for(var Fe,ke,Ye,Ie,ze={},De,Ke,Be,nt;;){if(ke=ue[ue.length-1],this.defaultActions[ke]?Ye=this.defaultActions[ke]:((Fe===null||typeof Fe>"u")&&(Fe=X()),Ye=Ve[ke]&&Ve[ke][Fe]),typeof Ye>"u"||!Ye.length||!Ye[0]){var Le="";nt=[];for(De in Ve[ke])this.terminals_[De]&&De>le&&nt.push("'"+this.terminals_[De]+"'");oe.showPosition?Le="Parse error on line "+(Ae+1)+`: +`,"getStyles"),LUt=MUt,IUt=Mee({defaultLayout:"swimlane",styles:LUt});const $Ut=Object.freeze(Object.defineProperty({__proto__:null,diagram:IUt},Symbol.toStringTag,{value:"Module"}));var pU=(function(){var t=w(function($e,Oe,He,ue){for(He=He||{},ue=$e.length;ue--;He[$e[ue]]=Oe);return He},"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],x=[1,36],b=[1,37],T=[1,38],k=[1,39],S=[1,40],C=[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],A=[1,46],M=[1,55],L=[40,48,50,51,52,71,72],P=[1,66],N=[1,64],_=[1,61],I=[1,65],O=[1,67],D=[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],$=[66,67,68,69,70],F=[1,85],z=[1,84],H=[1,82],B=[1,83],V=[6,10,42,47],q=[6,10,13,41,42,47,48,49],G=[1,93],Q=[1,92],j=[1,91],ae=[19,58],Z=[1,102],J=[1,101],re=[19,58,61,63],ee={trace:w(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:w(function(Oe,He,ue,ce,Te,ge,Ve){var we=ge.length-1;switch(Te){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:ce.addEntity(ge[we-4]),ce.addEntity(ge[we-2]),ce.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:ce.addEntity(ge[we-8]),ce.addEntity(ge[we-4]),ce.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),ce.setClass([ge[we-8]],ge[we-6]),ce.setClass([ge[we-4]],ge[we-2]);break;case 10:ce.addEntity(ge[we-6]),ce.addEntity(ge[we-2]),ce.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),ce.setClass([ge[we-6]],ge[we-4]);break;case 11:ce.addEntity(ge[we-6]),ce.addEntity(ge[we-4]),ce.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),ce.setClass([ge[we-4]],ge[we-2]);break;case 12:ce.addEntity(ge[we-3]),ce.addAttributes(ge[we-3],ge[we-1]);break;case 13:ce.addEntity(ge[we-5]),ce.addAttributes(ge[we-5],ge[we-1]),ce.setClass([ge[we-5]],ge[we-3]);break;case 14:ce.addEntity(ge[we-2]);break;case 15:ce.addEntity(ge[we-4]),ce.setClass([ge[we-4]],ge[we-2]);break;case 16:ce.addEntity(ge[we]);break;case 17:ce.addEntity(ge[we-2]),ce.setClass([ge[we-2]],ge[we]);break;case 18:ce.addEntity(ge[we-6],ge[we-4]),ce.addAttributes(ge[we-6],ge[we-1]);break;case 19:ce.addEntity(ge[we-8],ge[we-6]),ce.addAttributes(ge[we-8],ge[we-1]),ce.setClass([ge[we-8]],ge[we-3]);break;case 20:ce.addEntity(ge[we-5],ge[we-3]);break;case 21:ce.addEntity(ge[we-7],ge[we-5]),ce.setClass([ge[we-7]],ge[we-2]);break;case 22:ce.addEntity(ge[we-3],ge[we-1]);break;case 23:ce.addEntity(ge[we-5],ge[we-3]),ce.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),ce.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),ce.setAccDescription(this.$);break;case 32:ce.setDirection("TB");break;case 33:ce.setDirection("BT");break;case 34:ce.setDirection("RL");break;case 35:ce.setDirection("LR");break;case 36:this.$=ge[we-3],ce.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],ce.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],ce.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=ce.Cardinality.ZERO_OR_ONE;break;case 74:this.$=ce.Cardinality.ZERO_OR_MORE;break;case 75:this.$=ce.Cardinality.ONE_OR_MORE;break;case 76:this.$=ce.Cardinality.ONLY_ONE;break;case 77:this.$=ce.Cardinality.MD_PARENT;break;case 78:this.$=ce.Identification.NON_IDENTIFYING;break;case 79:this.$=ce.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:x,67:b,68:T,69:k,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(C,[2,54]),t(C,[2,55]),t(C,[2,56]),t(C,[2,57]),t(C,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:A},{16:47,40:E,41:A},{16:48,40:E,41:A},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:A},{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:N,42:_,45:62,46:63,48:I,49:O},t(D,[2,37]),t(D,[2,38]),{16:68,40:E,41:A,42:_},{13:P,38:69,41:N,42:_,45:62,46:63,48:I,49:O},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:_,66:x,67:b,68:T,69:k,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:x,67:b,68:T,69:k,70:S},t($,[2,78]),t($,[2,79]),{6:F,10:z,39:81,42:H,47:B},{40:[1,86],41:[1,87]},t(V,[2,43],{46:88,13:P,41:N,48:I,49:O}),t(q,[2,45]),t(q,[2,50]),t(q,[2,51]),t(q,[2,52]),t(q,[2,53]),t(e,[2,41],{42:_}),{6:F,10:z,39:89,42:H,47:B},{14:90,40:G,50:Q,73:j},{16:94,40:E,41:A},{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(ae,[2,61],{56:98,57:99,60:100,62:Z,63:J}),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:N,45:105,46:63,48:I,49:O},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(D,[2,39]),t(D,[2,40]),t(q,[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:_},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(ae,[2,62],{57:110,61:[1,111],63:J}),t(ae,[2,63]),t(re,[2,68]),t(ae,[2,71]),t(re,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:A},t(V,[2,44],{46:88,13:P,41:N,48:I,49:O}),{14:115,40:G,50:Q,73:j},{16:116,40:E,41:A},{14:117,40:G,50:Q,73:j},t(e,[2,13]),t(ae,[2,64]),{60:118,62:Z},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:_}),t(e,[2,11]),{13:[1,121],42:_},t(e,[2,10]),t(re,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:G,50:Q,73:j},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:w(function(Oe,He){if(He.recoverable)this.trace(Oe);else{var ue=new Error(Oe);throw ue.hash=He,ue}},"parseError"),parse:w(function(Oe){var He=this,ue=[0],ce=[],Te=[null],ge=[],Ve=this.table,we="",Ae=0,Ue=0,le=2,pe=1,Ce=ge.slice.call(arguments,1),oe=Object.create(this.lexer),fe={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(fe.yy[W]=this.yy[W]);oe.setInput(Oe,fe.yy),fe.yy.lexer=oe,fe.yy.parser=this,typeof oe.yylloc>"u"&&(oe.yylloc={});var se=oe.yylloc;ge.push(se);var K=oe.options&&oe.options.ranges;typeof fe.yy.parseError=="function"?this.parseError=fe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(pt){ue.length=ue.length-2*pt,Te.length=Te.length-pt,ge.length=ge.length-pt}w(de,"popStack");function X(){var pt;return pt=ce.pop()||oe.lex()||pe,typeof pt!="number"&&(pt instanceof Array&&(ce=pt,pt=ce.pop()),pt=He.symbols_[pt]||pt),pt}w(X,"lex");for(var Fe,ke,Ye,Ie,ze={},De,Ke,Be,nt;;){if(ke=ue[ue.length-1],this.defaultActions[ke]?Ye=this.defaultActions[ke]:((Fe===null||typeof Fe>"u")&&(Fe=X()),Ye=Ve[ke]&&Ve[ke][Fe]),typeof Ye>"u"||!Ye.length||!Ye[0]){var Le="";nt=[];for(De in Ve[ke])this.terminals_[De]&&De>le&&nt.push("'"+this.terminals_[De]+"'");oe.showPosition?Le="Parse error on line "+(Ae+1)+`: `+oe.showPosition()+` Expecting `+nt.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":Le="Parse error on line "+(Ae+1)+": Unexpected "+(Fe==pe?"end of input":"'"+(this.terminals_[Fe]||Fe)+"'"),this.parseError(Le,{text:oe.match,token:this.terminals_[Fe]||Fe,line:oe.yylineno,loc:se,expected:nt})}if(Ye[0]instanceof Array&&Ye.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ke+", token: "+Fe);switch(Ye[0]){case 1:ue.push(Fe),Te.push(oe.yytext),ge.push(oe.yylloc),ue.push(Ye[1]),Fe=null,Ue=oe.yyleng,we=oe.yytext,Ae=oe.yylineno,se=oe.yylloc;break;case 2:if(Ke=this.productions_[Ye[1]][1],ze.$=Te[Te.length-Ke],ze._$={first_line:ge[ge.length-(Ke||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ke||1)].first_column,last_column:ge[ge.length-1].last_column},K&&(ze._$.range=[ge[ge.length-(Ke||1)].range[0],ge[ge.length-1].range[1]]),Ie=this.performAction.apply(ze,[we,Ue,Ae,fe.yy,Ye[1],Te,ge].concat(Ce)),typeof Ie<"u")return Ie;Ke&&(ue=ue.slice(0,-1*Ke*2),Te=Te.slice(0,-1*Ke),ge=ge.slice(0,-1*Ke)),ue.push(this.productions_[Ye[1]][0]),Te.push(ze.$),ge.push(ze._$),Be=Ve[ue[ue.length-2]][ue[ue.length-1]],ue.push(Be);break;case 3:return!0}}return!0},"parse")},me=(function(){var $e={EOF:1,parseError:w(function(He,ue){if(this.yy.parser)this.yy.parser.parseError(He,ue);else throw new Error(He)},"parseError"),setInput:w(function(Oe,He){return this.yy=He||this.yy||{},this._input=Oe,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:w(function(){var Oe=this._input[0];this.yytext+=Oe,this.yyleng++,this.offset++,this.match+=Oe,this.matched+=Oe;var He=Oe.match(/(?:\r\n?|\n).*/g);return He?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Oe},"input"),unput:w(function(Oe){var He=Oe.length,ue=Oe.split(/(?:\r\n?|\n)/g);this._input=Oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-He),this.offset-=He;var ce=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),ue.length-1&&(this.yylineno-=ue.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:ue?(ue.length===ce.length?this.yylloc.first_column:0)+ce[ce.length-ue.length].length-ue[0].length:this.yylloc.first_column-He},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-He]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(Oe){this.unput(this.match.slice(Oe))},"less"),pastInput:w(function(){var Oe=this.matched.substr(0,this.matched.length-this.match.length);return(Oe.length>20?"...":"")+Oe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Oe=this.match;return Oe.length<20&&(Oe+=this._input.substr(0,20-Oe.length)),(Oe.substr(0,20)+(Oe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Oe=this.pastInput(),He=new Array(Oe.length+1).join("-");return Oe+this.upcomingInput()+` `+He+"^"},"showPosition"),test_match:w(function(Oe,He){var ue,ce,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))),ce=Oe[0].match(/(?:\r\n?|\n).*/g),ce&&(this.yylineno+=ce.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ce?ce[ce.length-1].length-ce[ce.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Oe[0].length},this.yytext+=Oe[0],this.match+=Oe[0],this.matches=Oe,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(Oe[0].length),this.matched+=Oe[0],ue=this.performAction.call(this,this.yy,this,He,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var ge in Te)this[ge]=Te[ge];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Oe,He,ue,ce;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ge=0;geHe[0].length)){if(He=ue,ce=ge,this.options.backtrack_lexer){if(Oe=this.test_match(ue,Te[ge]),Oe!==!1)return Oe;if(this._backtrack){He=!1;continue}else return!1}else if(!this.options.flex)break}return He?(Oe=this.test_match(He,Te[ce]),Oe!==!1?Oe:!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:w(function(){var He=this.next();return He||this.lex()},"lex"),begin:w(function(He){this.conditionStack.push(He)},"begin"),popState:w(function(){var He=this.conditionStack.length-1;return He>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(He){return He=this.conditionStack.length-1-Math.abs(He||0),He>=0?this.conditionStack[He]:"INITIAL"},"topState"),pushState:w(function(He){this.begin(He)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(He,ue,ce,Te){switch(ce){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 ue.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 ue.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 $e})();ee.lexer=me;function te(){this.yy={}}return w(te,"Parser"),te.prototype=ee,ee.Parser=te,new te})();dU.parser=dU;var RUt=dU,jb,_Ut=(jb=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=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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,he.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:We().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),he.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]),he.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),he.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=[],wi()}getData(){const e=[],r=[],n=We();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:ob(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"}}},w(jb,"ErDB"),jb),rIe={};g$(rIe,{draw:()=>MUt});var MUt=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=We(),o=n.db.getData(),l=Q3(e,i);o.type=n.type,o.layoutAlgorithm=vE(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 I3(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=bt(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;Vr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Jpe=w((t,e)=>{const r=iK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),PR=new Set(["redux-color","redux-dark-color"]),LUt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!PR.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:w(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:w(function(He){return He=this.conditionStack.length-1-Math.abs(He||0),He>=0?this.conditionStack[He]:"INITIAL"},"topState"),pushState:w(function(He){this.begin(He)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(He,ue,ce,Te){switch(ce){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 ue.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 ue.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 $e})();ee.lexer=me;function te(){this.yy={}}return w(te,"Parser"),te.prototype=ee,ee.Parser=te,new te})();pU.parser=pU;var NUt=pU,jb,DUt=(jb=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=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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,he.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:We().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),he.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]),he.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),he.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=[],wi()}getData(){const e=[],r=[],n=We();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:ob(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"}}},w(jb,"ErDB"),jb),aIe={};y$(aIe,{draw:()=>OUt});var OUt=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=We(),o=n.db.getData(),l=Q3(e,i);o.type=n.type,o.layoutAlgorithm=bE(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 I3(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=bt(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;Vr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),ege=w((t,e)=>{const r=sK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),BR=new Set(["redux-color","redux-dark-color"]),PUt=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!BR.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` - ${LUt(t)} + `;return s},"genColor"),BUt=w(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${PUt(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -2461,14 +2474,14 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":Le="Parse erro } .labelBkg { - background-color: ${PR.has(r)&&n?n:Jpe(t.tertiaryColor,.5)}; + background-color: ${BR.has(r)&&n?n:ege(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${PR.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${BR.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${PR.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${BR.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -2510,17 +2523,17 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[Fe]||Fe)+"'":Le="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${Jpe(t.tertiaryColor,.5)}; + background-color: ${ege(t.tertiaryColor,.5)}; } -`},"getStyles"),$Ut=IUt,NUt={parser:RUt,get db(){return new _Ut},renderer:rIe,styles:$Ut};const DUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:NUt},Symbol.toStringTag,{value:"Module"}));var Xb,Mee=(Xb=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(Xb,"ImperativeState"),Xb);function Al(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))}w(Al,"populateCommonDb");var OUt=Object.create,KE=Object.defineProperty,PUt=Object.getOwnPropertyDescriptor,Lee=Object.getOwnPropertyNames,BUt=Object.getPrototypeOf,FUt=Object.prototype.hasOwnProperty,R=(t,e)=>KE(t,"name",{value:e,configurable:!0}),zUt=(t,e)=>function(){return t&&(e=(0,t[Lee(t)[0]])(t=0)),e},cn=(t,e)=>function(){return e||(0,t[Lee(t)[0]])((e={exports:{}}).exports,e),e.exports},Ig=(t,e)=>{for(var r in e)KE(t,r,{get:e[r],enumerable:!0})},Iee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lee(e))!FUt.call(t,i)&&i!==r&&KE(t,i,{get:()=>e[i],enumerable:!(n=PUt(e,i))||n.enumerable});return t},dD=(t,e,r)=>(Iee(t,e,"default"),r),$ee=(t,e,r)=>(r=t!=null?OUt(BUt(t)):{},Iee(KE(r,"default",{value:t,enumerable:!0}),t)),Nee=t=>Iee(KE({},"__esModule",{value:!0}),t),fD={};Ig(fD,{AnnotatedTextEdit:()=>nf,ChangeAnnotation:()=>gm,ChangeAnnotationIdentifier:()=>js,CodeAction:()=>UU,CodeActionContext:()=>GU,CodeActionKind:()=>qU,CodeActionTriggerKind:()=>U5,CodeDescription:()=>TU,CodeLens:()=>YU,Color:()=>FR,ColorInformation:()=>mU,ColorPresentation:()=>yU,Command:()=>pm,CompletionItem:()=>IU,CompletionItemKind:()=>EU,CompletionItemLabelDetails:()=>LU,CompletionItemTag:()=>RU,CompletionList:()=>$U,CreateFile:()=>p2,DeleteFile:()=>m2,Diagnostic:()=>V5,DiagnosticRelatedInformation:()=>zR,DiagnosticSeverity:()=>xU,DiagnosticTag:()=>wU,DocumentHighlight:()=>BU,DocumentHighlightKind:()=>PU,DocumentLink:()=>XU,DocumentSymbol:()=>WU,DocumentUri:()=>fU,EOL:()=>iIe,FoldingRange:()=>bU,FoldingRangeKind:()=>vU,FormattingOptions:()=>jU,Hover:()=>NU,InlayHint:()=>iY,InlayHintKind:()=>WR,InlayHintLabelPart:()=>qR,InlineCompletionContext:()=>uY,InlineCompletionItem:()=>sY,InlineCompletionList:()=>oY,InlineCompletionTriggerKind:()=>lY,InlineValueContext:()=>nY,InlineValueEvaluatableExpression:()=>rY,InlineValueText:()=>eY,InlineValueVariableLookup:()=>tY,InsertReplaceEdit:()=>_U,InsertTextFormat:()=>AU,InsertTextMode:()=>MU,Location:()=>H5,LocationLink:()=>gU,MarkedString:()=>G5,MarkupContent:()=>y2,MarkupKind:()=>VR,OptionalVersionedTextDocumentIdentifier:()=>q5,ParameterInformation:()=>DU,Position:()=>Kn,Range:()=>An,RenameFile:()=>g2,SelectedCompletionInfo:()=>cY,SelectionRange:()=>KU,SemanticTokenModifiers:()=>QU,SemanticTokenTypes:()=>ZU,SemanticTokens:()=>JU,SignatureInformation:()=>OU,StringValue:()=>aY,SymbolInformation:()=>HU,SymbolKind:()=>FU,SymbolTag:()=>zU,TextDocument:()=>dY,TextDocumentEdit:()=>W5,TextDocumentIdentifier:()=>kU,TextDocumentItem:()=>SU,TextEdit:()=>Sh,URI:()=>BR,VersionedTextDocumentIdentifier:()=>CU,WorkspaceChange:()=>nIe,WorkspaceEdit:()=>HR,WorkspaceFolder:()=>hY,WorkspaceSymbol:()=>VU,integer:()=>pU,uinteger:()=>z5});var fU,BR,pU,z5,Kn,An,H5,gU,FR,mU,yU,vU,bU,zR,xU,wU,TU,V5,pm,Sh,gm,js,nf,W5,p2,g2,m2,HR,qk,Wz,nIe,kU,CU,q5,SU,VR,y2,EU,AU,RU,_U,MU,LU,IU,$U,G5,NU,DU,OU,PU,BU,FU,zU,HU,VU,WU,qU,U5,GU,UU,YU,jU,XU,KU,ZU,QU,JU,eY,tY,rY,nY,WR,qR,iY,aY,sY,oY,lY,cY,uY,hY,iIe,dY,ege,at,ZE=zUt({"../../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"}R(a,"is"),i.is=a})(fU||(fU={})),(function(i){function a(s){return typeof s=="string"}R(a,"is"),i.is=a})(BR||(BR={})),(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}R(a,"is"),i.is=a})(pU||(pU={})),(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}R(a,"is"),i.is=a})(z5||(z5={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=z5.MAX_VALUE),l===Number.MAX_VALUE&&(l=z5.MAX_VALUE),{line:o,character:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&at.uinteger(l.line)&&at.uinteger(l.character)}R(s,"is"),i.is=s})(Kn||(Kn={})),(function(i){function a(o,l,u,h){if(at.uinteger(o)&&at.uinteger(l)&&at.uinteger(u)&&at.uinteger(h))return{start:Kn.create(o,l),end:Kn.create(u,h)};if(Kn.is(o)&&Kn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&Kn.is(l.start)&&Kn.is(l.end)}R(s,"is"),i.is=s})(An||(An={})),(function(i){function a(o,l){return{uri:o,range:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.range)&&(at.string(l.uri)||at.undefined(l.uri))}R(s,"is"),i.is=s})(H5||(H5={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.targetRange)&&at.string(l.targetUri)&&An.is(l.targetSelectionRange)&&(An.is(l.originSelectionRange)||at.undefined(l.originSelectionRange))}R(s,"is"),i.is=s})(gU||(gU={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.numberRange(l.red,0,1)&&at.numberRange(l.green,0,1)&&at.numberRange(l.blue,0,1)&&at.numberRange(l.alpha,0,1)}R(s,"is"),i.is=s})(FR||(FR={})),(function(i){function a(o,l){return{range:o,color:l}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&An.is(l.range)&&FR.is(l.color)}R(s,"is"),i.is=s})(mU||(mU={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.string(l.label)&&(at.undefined(l.textEdit)||Sh.is(l))&&(at.undefined(l.additionalTextEdits)||at.typedArray(l.additionalTextEdits,Sh.is))}R(s,"is"),i.is=s})(yU||(yU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(vU||(vU={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return at.defined(u)&&(p.startCharacter=u),at.defined(h)&&(p.endCharacter=h),at.defined(d)&&(p.kind=d),at.defined(f)&&(p.collapsedText=f),p}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.uinteger(l.startLine)&&at.uinteger(l.startLine)&&(at.undefined(l.startCharacter)||at.uinteger(l.startCharacter))&&(at.undefined(l.endCharacter)||at.uinteger(l.endCharacter))&&(at.undefined(l.kind)||at.string(l.kind))}R(s,"is"),i.is=s})(bU||(bU={})),(function(i){function a(o,l){return{location:o,message:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&H5.is(l.location)&&at.string(l.message)}R(s,"is"),i.is=s})(zR||(zR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(xU||(xU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(wU||(wU={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&at.string(o.href)}R(a,"is"),i.is=a})(TU||(TU={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return at.defined(u)&&(p.severity=u),at.defined(h)&&(p.code=h),at.defined(d)&&(p.source=d),at.defined(f)&&(p.relatedInformation=f),p}R(a,"create"),i.create=a;function s(o){var l;let u=o;return at.defined(u)&&An.is(u.range)&&at.string(u.message)&&(at.number(u.severity)||at.undefined(u.severity))&&(at.integer(u.code)||at.string(u.code)||at.undefined(u.code))&&(at.undefined(u.codeDescription)||at.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(at.string(u.source)||at.undefined(u.source))&&(at.undefined(u.relatedInformation)||at.typedArray(u.relatedInformation,zR.is))}R(s,"is"),i.is=s})(V5||(V5={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return at.defined(u)&&u.length>0&&(h.arguments=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.title)&&at.string(l.command)}R(s,"is"),i.is=s})(pm||(pm={})),(function(i){function a(u,h){return{range:u,newText:h}}R(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}R(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}R(o,"del"),i.del=o;function l(u){const h=u;return at.objectLiteral(h)&&at.string(h.newText)&&An.is(h.range)}R(l,"is"),i.is=l})(Sh||(Sh={})),(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}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.string(l.label)&&(at.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(at.string(l.description)||l.description===void 0)}R(s,"is"),i.is=s})(gm||(gm={})),(function(i){function a(s){const o=s;return at.string(o)}R(a,"is"),i.is=a})(js||(js={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}R(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}R(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}R(o,"del"),i.del=o;function l(u){const h=u;return Sh.is(h)&&(gm.is(h.annotationId)||js.is(h.annotationId))}R(l,"is"),i.is=l})(nf||(nf={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&q5.is(l.textDocument)&&Array.isArray(l.edits)}R(s,"is"),i.is=s})(W5||(W5={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&at.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||at.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||at.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(p2||(p2={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&at.string(l.oldUri)&&at.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||at.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||at.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(g2||(g2={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&at.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||at.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||at.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(m2||(m2={})),(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=>at.string(l.kind)?p2.is(l)||g2.is(l)||m2.is(l):W5.is(l)))}R(a,"is"),i.is=a})(HR||(HR={})),qk=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Sh.insert(a,s):js.is(o)?(u=o,l=nf.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=nf.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=Sh.replace(a,s):js.is(o)?(u=o,l=nf.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=nf.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Sh.del(a):js.is(s)?(l=s,o=nf.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=nf.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.")}},R(t,"TextEditChangeImpl"),t),Wz=(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(js.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()}},R(e,"ChangeAnnotations"),e),nIe=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new Wz(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(W5.is(s)){const o=new qk(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new qk(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(q5.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 qk(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 qk(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Wz,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;gm.is(s)||js.is(s)?l=s:o=s;let u,h;if(l===void 0?u=p2.create(a,o):(h=js.is(l)?l:this._changeAnnotations.manage(l),u=p2.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;gm.is(o)||js.is(o)?u=o:l=o;let h,d;if(u===void 0?h=g2.create(a,s,l):(d=js.is(u)?u:this._changeAnnotations.manage(u),h=g2.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;gm.is(s)||js.is(s)?l=s:o=s;let u,h;if(l===void 0?u=m2.create(a,o):(h=js.is(l)?l:this._changeAnnotations.manage(l),u=m2.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},R(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)}R(s,"is"),i.is=s})(kU||(kU={})),(function(i){function a(o,l){return{uri:o,version:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.integer(l.version)}R(s,"is"),i.is=s})(CU||(CU={})),(function(i){function a(o,l){return{uri:o,version:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&(l.version===null||at.integer(l.version))}R(s,"is"),i.is=s})(q5||(q5={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.string(l.languageId)&&at.integer(l.version)&&at.string(l.text)}R(s,"is"),i.is=s})(SU||(SU={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}R(a,"is"),i.is=a})(VR||(VR={})),(function(i){function a(s){const o=s;return at.objectLiteral(s)&&VR.is(o.kind)&&at.string(o.value)}R(a,"is"),i.is=a})(y2||(y2={})),(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})(EU||(EU={})),(function(i){i.PlainText=1,i.Snippet=2})(AU||(AU={})),(function(i){i.Deprecated=1})(RU||(RU={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}R(a,"create"),i.create=a;function s(o){const l=o;return l&&at.string(l.newText)&&An.is(l.insert)&&An.is(l.replace)}R(s,"is"),i.is=s})(_U||(_U={})),(function(i){i.asIs=1,i.adjustIndentation=2})(MU||(MU={})),(function(i){function a(s){const o=s;return o&&(at.string(o.detail)||o.detail===void 0)&&(at.string(o.description)||o.description===void 0)}R(a,"is"),i.is=a})(LU||(LU={})),(function(i){function a(s){return{label:s}}R(a,"create"),i.create=a})(IU||(IU={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}R(a,"create"),i.create=a})($U||($U={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}R(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return at.string(l)||at.objectLiteral(l)&&at.string(l.language)&&at.string(l.value)}R(s,"is"),i.is=s})(G5||(G5={})),(function(i){function a(s){let o=s;return!!o&&at.objectLiteral(o)&&(y2.is(o.contents)||G5.is(o.contents)||at.typedArray(o.contents,G5.is))&&(s.range===void 0||An.is(s.range))}R(a,"is"),i.is=a})(NU||(NU={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}R(a,"create"),i.create=a})(DU||(DU={})),(function(i){function a(s,o,...l){let u={label:s};return at.defined(o)&&(u.documentation=o),at.defined(l)?u.parameters=l:u.parameters=[],u}R(a,"create"),i.create=a})(OU||(OU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(PU||(PU={})),(function(i){function a(s,o){let l={range:s};return at.number(o)&&(l.kind=o),l}R(a,"create"),i.create=a})(BU||(BU={})),(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})(FU||(FU={})),(function(i){i.Deprecated=1})(zU||(zU={})),(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}R(a,"create"),i.create=a})(HU||(HU={})),(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}}}R(a,"create"),i.create=a})(VU||(VU={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&at.string(l.name)&&at.number(l.kind)&&An.is(l.range)&&An.is(l.selectionRange)&&(l.detail===void 0||at.string(l.detail))&&(l.deprecated===void 0||at.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}R(s,"is"),i.is=s})(WU||(WU={})),(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"})(qU||(qU={})),(function(i){i.Invoked=1,i.Automatic=2})(U5||(U5={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.typedArray(l.diagnostics,V5.is)&&(l.only===void 0||at.typedArray(l.only,at.string))&&(l.triggerKind===void 0||l.triggerKind===U5.Invoked||l.triggerKind===U5.Automatic)}R(s,"is"),i.is=s})(GU||(GU={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):pm.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return l&&at.string(l.title)&&(l.diagnostics===void 0||at.typedArray(l.diagnostics,V5.is))&&(l.kind===void 0||at.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pm.is(l.command))&&(l.isPreferred===void 0||at.boolean(l.isPreferred))&&(l.edit===void 0||HR.is(l.edit))}R(s,"is"),i.is=s})(UU||(UU={})),(function(i){function a(o,l){let u={range:o};return at.defined(l)&&(u.data=l),u}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&An.is(l.range)&&(at.undefined(l.command)||pm.is(l.command))}R(s,"is"),i.is=s})(YU||(YU={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.uinteger(l.tabSize)&&at.boolean(l.insertSpaces)}R(s,"is"),i.is=s})(jU||(jU={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&An.is(l.range)&&(at.undefined(l.target)||at.string(l.target))}R(s,"is"),i.is=s})(XU||(XU={})),(function(i){function a(o,l){return{range:o,parent:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.range)&&(l.parent===void 0||i.is(l.parent))}R(s,"is"),i.is=s})(KU||(KU={})),(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"})(ZU||(ZU={})),(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"})(QU||(QU={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}R(a,"is"),i.is=a})(JU||(JU={})),(function(i){function a(o,l){return{range:o,text:l}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&at.string(l.text)}R(s,"is"),i.is=s})(eY||(eY={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&at.boolean(l.caseSensitiveLookup)&&(at.string(l.variableName)||l.variableName===void 0)}R(s,"is"),i.is=s})(tY||(tY={})),(function(i){function a(o,l){return{range:o,expression:l}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&(at.string(l.expression)||l.expression===void 0)}R(s,"is"),i.is=s})(rY||(rY={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}R(a,"create"),i.create=a;function s(o){const l=o;return at.defined(l)&&An.is(o.stoppedLocation)}R(s,"is"),i.is=s})(nY||(nY={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}R(a,"is"),i.is=a})(WR||(WR={})),(function(i){function a(o){return{value:o}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&(l.tooltip===void 0||at.string(l.tooltip)||y2.is(l.tooltip))&&(l.location===void 0||H5.is(l.location))&&(l.command===void 0||pm.is(l.command))}R(s,"is"),i.is=s})(qR||(qR={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&Kn.is(l.position)&&(at.string(l.label)||at.typedArray(l.label,qR.is))&&(l.kind===void 0||WR.is(l.kind))&&l.textEdits===void 0||at.typedArray(l.textEdits,Sh.is)&&(l.tooltip===void 0||at.string(l.tooltip)||y2.is(l.tooltip))&&(l.paddingLeft===void 0||at.boolean(l.paddingLeft))&&(l.paddingRight===void 0||at.boolean(l.paddingRight))}R(s,"is"),i.is=s})(iY||(iY={})),(function(i){function a(s){return{kind:"snippet",value:s}}R(a,"createSnippet"),i.createSnippet=a})(aY||(aY={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}R(a,"create"),i.create=a})(sY||(sY={})),(function(i){function a(s){return{items:s}}R(a,"create"),i.create=a})(oY||(oY={})),(function(i){i.Invoked=0,i.Automatic=1})(lY||(lY={})),(function(i){function a(s,o){return{range:s,text:o}}R(a,"create"),i.create=a})(cY||(cY={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}R(a,"create"),i.create=a})(uY||(uY={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&BR.is(o.uri)&&at.string(o.name)}R(a,"is"),i.is=a})(hY||(hY={})),iIe=[` +`},"getStyles"),FUt=BUt,zUt={parser:NUt,get db(){return new DUt},renderer:aIe,styles:FUt};const HUt=Object.freeze(Object.defineProperty({__proto__:null,diagram:zUt},Symbol.toStringTag,{value:"Module"}));var Xb,Iee=(Xb=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(Xb,"ImperativeState"),Xb);function Al(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))}w(Al,"populateCommonDb");var VUt=Object.create,ZE=Object.defineProperty,WUt=Object.getOwnPropertyDescriptor,$ee=Object.getOwnPropertyNames,qUt=Object.getPrototypeOf,GUt=Object.prototype.hasOwnProperty,R=(t,e)=>ZE(t,"name",{value:e,configurable:!0}),UUt=(t,e)=>function(){return t&&(e=(0,t[$ee(t)[0]])(t=0)),e},cn=(t,e)=>function(){return e||(0,t[$ee(t)[0]])((e={exports:{}}).exports,e),e.exports},Ig=(t,e)=>{for(var r in e)ZE(t,r,{get:e[r],enumerable:!0})},Nee=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $ee(e))!GUt.call(t,i)&&i!==r&&ZE(t,i,{get:()=>e[i],enumerable:!(n=WUt(e,i))||n.enumerable});return t},pD=(t,e,r)=>(Nee(t,e,"default"),r),Dee=(t,e,r)=>(r=t!=null?VUt(qUt(t)):{},Nee(ZE(r,"default",{value:t,enumerable:!0}),t)),Oee=t=>Nee(ZE({},"__esModule",{value:!0}),t),gD={};Ig(gD,{AnnotatedTextEdit:()=>af,ChangeAnnotation:()=>gm,ChangeAnnotationIdentifier:()=>js,CodeAction:()=>jU,CodeActionContext:()=>YU,CodeActionKind:()=>UU,CodeActionTriggerKind:()=>U5,CodeDescription:()=>CU,CodeLens:()=>XU,Color:()=>zR,ColorInformation:()=>vU,ColorPresentation:()=>bU,Command:()=>pm,CompletionItem:()=>NU,CompletionItemKind:()=>RU,CompletionItemLabelDetails:()=>$U,CompletionItemTag:()=>MU,CompletionList:()=>DU,CreateFile:()=>p2,DeleteFile:()=>m2,Diagnostic:()=>V5,DiagnosticRelatedInformation:()=>HR,DiagnosticSeverity:()=>TU,DiagnosticTag:()=>kU,DocumentHighlight:()=>zU,DocumentHighlightKind:()=>FU,DocumentLink:()=>ZU,DocumentSymbol:()=>GU,DocumentUri:()=>gU,EOL:()=>oIe,FoldingRange:()=>wU,FoldingRangeKind:()=>xU,FormattingOptions:()=>KU,Hover:()=>OU,InlayHint:()=>sY,InlayHintKind:()=>qR,InlayHintLabelPart:()=>GR,InlineCompletionContext:()=>dY,InlineCompletionItem:()=>lY,InlineCompletionList:()=>cY,InlineCompletionTriggerKind:()=>uY,InlineValueContext:()=>aY,InlineValueEvaluatableExpression:()=>iY,InlineValueText:()=>rY,InlineValueVariableLookup:()=>nY,InsertReplaceEdit:()=>LU,InsertTextFormat:()=>_U,InsertTextMode:()=>IU,Location:()=>H5,LocationLink:()=>yU,MarkedString:()=>G5,MarkupContent:()=>y2,MarkupKind:()=>WR,OptionalVersionedTextDocumentIdentifier:()=>q5,ParameterInformation:()=>PU,Position:()=>Kn,Range:()=>An,RenameFile:()=>g2,SelectedCompletionInfo:()=>hY,SelectionRange:()=>QU,SemanticTokenModifiers:()=>eY,SemanticTokenTypes:()=>JU,SemanticTokens:()=>tY,SignatureInformation:()=>BU,StringValue:()=>oY,SymbolInformation:()=>WU,SymbolKind:()=>HU,SymbolTag:()=>VU,TextDocument:()=>pY,TextDocumentEdit:()=>W5,TextDocumentIdentifier:()=>SU,TextDocumentItem:()=>AU,TextEdit:()=>Sh,URI:()=>FR,VersionedTextDocumentIdentifier:()=>EU,WorkspaceChange:()=>sIe,WorkspaceEdit:()=>VR,WorkspaceFolder:()=>fY,WorkspaceSymbol:()=>qU,integer:()=>mU,uinteger:()=>z5});var gU,FR,mU,z5,Kn,An,H5,yU,zR,vU,bU,xU,wU,HR,TU,kU,CU,V5,pm,Sh,gm,js,af,W5,p2,g2,m2,VR,qk,Gz,sIe,SU,EU,q5,AU,WR,y2,RU,_U,MU,LU,IU,$U,NU,DU,G5,OU,PU,BU,FU,zU,HU,VU,WU,qU,GU,UU,U5,YU,jU,XU,KU,ZU,QU,JU,eY,tY,rY,nY,iY,aY,qR,GR,sY,oY,lY,cY,uY,hY,dY,fY,oIe,pY,tge,at,QE=UUt({"../../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"}R(a,"is"),i.is=a})(gU||(gU={})),(function(i){function a(s){return typeof s=="string"}R(a,"is"),i.is=a})(FR||(FR={})),(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}R(a,"is"),i.is=a})(mU||(mU={})),(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}R(a,"is"),i.is=a})(z5||(z5={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=z5.MAX_VALUE),l===Number.MAX_VALUE&&(l=z5.MAX_VALUE),{line:o,character:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&at.uinteger(l.line)&&at.uinteger(l.character)}R(s,"is"),i.is=s})(Kn||(Kn={})),(function(i){function a(o,l,u,h){if(at.uinteger(o)&&at.uinteger(l)&&at.uinteger(u)&&at.uinteger(h))return{start:Kn.create(o,l),end:Kn.create(u,h)};if(Kn.is(o)&&Kn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&Kn.is(l.start)&&Kn.is(l.end)}R(s,"is"),i.is=s})(An||(An={})),(function(i){function a(o,l){return{uri:o,range:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.range)&&(at.string(l.uri)||at.undefined(l.uri))}R(s,"is"),i.is=s})(H5||(H5={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.targetRange)&&at.string(l.targetUri)&&An.is(l.targetSelectionRange)&&(An.is(l.originSelectionRange)||at.undefined(l.originSelectionRange))}R(s,"is"),i.is=s})(yU||(yU={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.numberRange(l.red,0,1)&&at.numberRange(l.green,0,1)&&at.numberRange(l.blue,0,1)&&at.numberRange(l.alpha,0,1)}R(s,"is"),i.is=s})(zR||(zR={})),(function(i){function a(o,l){return{range:o,color:l}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&An.is(l.range)&&zR.is(l.color)}R(s,"is"),i.is=s})(vU||(vU={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.string(l.label)&&(at.undefined(l.textEdit)||Sh.is(l))&&(at.undefined(l.additionalTextEdits)||at.typedArray(l.additionalTextEdits,Sh.is))}R(s,"is"),i.is=s})(bU||(bU={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(xU||(xU={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return at.defined(u)&&(p.startCharacter=u),at.defined(h)&&(p.endCharacter=h),at.defined(d)&&(p.kind=d),at.defined(f)&&(p.collapsedText=f),p}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.uinteger(l.startLine)&&at.uinteger(l.startLine)&&(at.undefined(l.startCharacter)||at.uinteger(l.startCharacter))&&(at.undefined(l.endCharacter)||at.uinteger(l.endCharacter))&&(at.undefined(l.kind)||at.string(l.kind))}R(s,"is"),i.is=s})(wU||(wU={})),(function(i){function a(o,l){return{location:o,message:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&H5.is(l.location)&&at.string(l.message)}R(s,"is"),i.is=s})(HR||(HR={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(TU||(TU={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(kU||(kU={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&at.string(o.href)}R(a,"is"),i.is=a})(CU||(CU={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return at.defined(u)&&(p.severity=u),at.defined(h)&&(p.code=h),at.defined(d)&&(p.source=d),at.defined(f)&&(p.relatedInformation=f),p}R(a,"create"),i.create=a;function s(o){var l;let u=o;return at.defined(u)&&An.is(u.range)&&at.string(u.message)&&(at.number(u.severity)||at.undefined(u.severity))&&(at.integer(u.code)||at.string(u.code)||at.undefined(u.code))&&(at.undefined(u.codeDescription)||at.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(at.string(u.source)||at.undefined(u.source))&&(at.undefined(u.relatedInformation)||at.typedArray(u.relatedInformation,HR.is))}R(s,"is"),i.is=s})(V5||(V5={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return at.defined(u)&&u.length>0&&(h.arguments=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.title)&&at.string(l.command)}R(s,"is"),i.is=s})(pm||(pm={})),(function(i){function a(u,h){return{range:u,newText:h}}R(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}R(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}R(o,"del"),i.del=o;function l(u){const h=u;return at.objectLiteral(h)&&at.string(h.newText)&&An.is(h.range)}R(l,"is"),i.is=l})(Sh||(Sh={})),(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}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&at.string(l.label)&&(at.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(at.string(l.description)||l.description===void 0)}R(s,"is"),i.is=s})(gm||(gm={})),(function(i){function a(s){const o=s;return at.string(o)}R(a,"is"),i.is=a})(js||(js={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}R(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}R(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}R(o,"del"),i.del=o;function l(u){const h=u;return Sh.is(h)&&(gm.is(h.annotationId)||js.is(h.annotationId))}R(l,"is"),i.is=l})(af||(af={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&q5.is(l.textDocument)&&Array.isArray(l.edits)}R(s,"is"),i.is=s})(W5||(W5={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&at.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||at.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||at.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(p2||(p2={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&at.string(l.oldUri)&&at.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||at.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||at.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(g2||(g2={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&at.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||at.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||at.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||js.is(l.annotationId))}R(s,"is"),i.is=s})(m2||(m2={})),(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=>at.string(l.kind)?p2.is(l)||g2.is(l)||m2.is(l):W5.is(l)))}R(a,"is"),i.is=a})(VR||(VR={})),qk=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=Sh.insert(a,s):js.is(o)?(u=o,l=af.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=af.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=Sh.replace(a,s):js.is(o)?(u=o,l=af.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=af.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=Sh.del(a):js.is(s)?(l=s,o=af.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=af.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.")}},R(t,"TextEditChangeImpl"),t),Gz=(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(js.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()}},R(e,"ChangeAnnotations"),e),sIe=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new Gz(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(W5.is(s)){const o=new qk(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new qk(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(q5.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 qk(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 qk(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Gz,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;gm.is(s)||js.is(s)?l=s:o=s;let u,h;if(l===void 0?u=p2.create(a,o):(h=js.is(l)?l:this._changeAnnotations.manage(l),u=p2.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;gm.is(o)||js.is(o)?u=o:l=o;let h,d;if(u===void 0?h=g2.create(a,s,l):(d=js.is(u)?u:this._changeAnnotations.manage(u),h=g2.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;gm.is(s)||js.is(s)?l=s:o=s;let u,h;if(l===void 0?u=m2.create(a,o):(h=js.is(l)?l:this._changeAnnotations.manage(l),u=m2.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},R(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)}R(s,"is"),i.is=s})(SU||(SU={})),(function(i){function a(o,l){return{uri:o,version:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.integer(l.version)}R(s,"is"),i.is=s})(EU||(EU={})),(function(i){function a(o,l){return{uri:o,version:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&(l.version===null||at.integer(l.version))}R(s,"is"),i.is=s})(q5||(q5={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.string(l.languageId)&&at.integer(l.version)&&at.string(l.text)}R(s,"is"),i.is=s})(AU||(AU={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}R(a,"is"),i.is=a})(WR||(WR={})),(function(i){function a(s){const o=s;return at.objectLiteral(s)&&WR.is(o.kind)&&at.string(o.value)}R(a,"is"),i.is=a})(y2||(y2={})),(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})(RU||(RU={})),(function(i){i.PlainText=1,i.Snippet=2})(_U||(_U={})),(function(i){i.Deprecated=1})(MU||(MU={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}R(a,"create"),i.create=a;function s(o){const l=o;return l&&at.string(l.newText)&&An.is(l.insert)&&An.is(l.replace)}R(s,"is"),i.is=s})(LU||(LU={})),(function(i){i.asIs=1,i.adjustIndentation=2})(IU||(IU={})),(function(i){function a(s){const o=s;return o&&(at.string(o.detail)||o.detail===void 0)&&(at.string(o.description)||o.description===void 0)}R(a,"is"),i.is=a})($U||($U={})),(function(i){function a(s){return{label:s}}R(a,"create"),i.create=a})(NU||(NU={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}R(a,"create"),i.create=a})(DU||(DU={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}R(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return at.string(l)||at.objectLiteral(l)&&at.string(l.language)&&at.string(l.value)}R(s,"is"),i.is=s})(G5||(G5={})),(function(i){function a(s){let o=s;return!!o&&at.objectLiteral(o)&&(y2.is(o.contents)||G5.is(o.contents)||at.typedArray(o.contents,G5.is))&&(s.range===void 0||An.is(s.range))}R(a,"is"),i.is=a})(OU||(OU={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}R(a,"create"),i.create=a})(PU||(PU={})),(function(i){function a(s,o,...l){let u={label:s};return at.defined(o)&&(u.documentation=o),at.defined(l)?u.parameters=l:u.parameters=[],u}R(a,"create"),i.create=a})(BU||(BU={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(FU||(FU={})),(function(i){function a(s,o){let l={range:s};return at.number(o)&&(l.kind=o),l}R(a,"create"),i.create=a})(zU||(zU={})),(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})(HU||(HU={})),(function(i){i.Deprecated=1})(VU||(VU={})),(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}R(a,"create"),i.create=a})(WU||(WU={})),(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}}}R(a,"create"),i.create=a})(qU||(qU={})),(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}R(a,"create"),i.create=a;function s(o){let l=o;return l&&at.string(l.name)&&at.number(l.kind)&&An.is(l.range)&&An.is(l.selectionRange)&&(l.detail===void 0||at.string(l.detail))&&(l.deprecated===void 0||at.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}R(s,"is"),i.is=s})(GU||(GU={})),(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"})(UU||(UU={})),(function(i){i.Invoked=1,i.Automatic=2})(U5||(U5={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.typedArray(l.diagnostics,V5.is)&&(l.only===void 0||at.typedArray(l.only,at.string))&&(l.triggerKind===void 0||l.triggerKind===U5.Invoked||l.triggerKind===U5.Automatic)}R(s,"is"),i.is=s})(YU||(YU={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):pm.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}R(a,"create"),i.create=a;function s(o){let l=o;return l&&at.string(l.title)&&(l.diagnostics===void 0||at.typedArray(l.diagnostics,V5.is))&&(l.kind===void 0||at.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||pm.is(l.command))&&(l.isPreferred===void 0||at.boolean(l.isPreferred))&&(l.edit===void 0||VR.is(l.edit))}R(s,"is"),i.is=s})(jU||(jU={})),(function(i){function a(o,l){let u={range:o};return at.defined(l)&&(u.data=l),u}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&An.is(l.range)&&(at.undefined(l.command)||pm.is(l.command))}R(s,"is"),i.is=s})(XU||(XU={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&at.uinteger(l.tabSize)&&at.boolean(l.insertSpaces)}R(s,"is"),i.is=s})(KU||(KU={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}R(a,"create"),i.create=a;function s(o){let l=o;return at.defined(l)&&An.is(l.range)&&(at.undefined(l.target)||at.string(l.target))}R(s,"is"),i.is=s})(ZU||(ZU={})),(function(i){function a(o,l){return{range:o,parent:l}}R(a,"create"),i.create=a;function s(o){let l=o;return at.objectLiteral(l)&&An.is(l.range)&&(l.parent===void 0||i.is(l.parent))}R(s,"is"),i.is=s})(QU||(QU={})),(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"})(JU||(JU={})),(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"})(eY||(eY={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}R(a,"is"),i.is=a})(tY||(tY={})),(function(i){function a(o,l){return{range:o,text:l}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&at.string(l.text)}R(s,"is"),i.is=s})(rY||(rY={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&at.boolean(l.caseSensitiveLookup)&&(at.string(l.variableName)||l.variableName===void 0)}R(s,"is"),i.is=s})(nY||(nY={})),(function(i){function a(o,l){return{range:o,expression:l}}R(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&An.is(l.range)&&(at.string(l.expression)||l.expression===void 0)}R(s,"is"),i.is=s})(iY||(iY={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}R(a,"create"),i.create=a;function s(o){const l=o;return at.defined(l)&&An.is(o.stoppedLocation)}R(s,"is"),i.is=s})(aY||(aY={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}R(a,"is"),i.is=a})(qR||(qR={})),(function(i){function a(o){return{value:o}}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&(l.tooltip===void 0||at.string(l.tooltip)||y2.is(l.tooltip))&&(l.location===void 0||H5.is(l.location))&&(l.command===void 0||pm.is(l.command))}R(s,"is"),i.is=s})(GR||(GR={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}R(a,"create"),i.create=a;function s(o){const l=o;return at.objectLiteral(l)&&Kn.is(l.position)&&(at.string(l.label)||at.typedArray(l.label,GR.is))&&(l.kind===void 0||qR.is(l.kind))&&l.textEdits===void 0||at.typedArray(l.textEdits,Sh.is)&&(l.tooltip===void 0||at.string(l.tooltip)||y2.is(l.tooltip))&&(l.paddingLeft===void 0||at.boolean(l.paddingLeft))&&(l.paddingRight===void 0||at.boolean(l.paddingRight))}R(s,"is"),i.is=s})(sY||(sY={})),(function(i){function a(s){return{kind:"snippet",value:s}}R(a,"createSnippet"),i.createSnippet=a})(oY||(oY={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}R(a,"create"),i.create=a})(lY||(lY={})),(function(i){function a(s){return{items:s}}R(a,"create"),i.create=a})(cY||(cY={})),(function(i){i.Invoked=0,i.Automatic=1})(uY||(uY={})),(function(i){function a(s,o){return{range:s,text:o}}R(a,"create"),i.create=a})(hY||(hY={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}R(a,"create"),i.create=a})(dY||(dY={})),(function(i){function a(s){const o=s;return at.objectLiteral(o)&&FR.is(o.uri)&&at.string(o.name)}R(a,"is"),i.is=a})(fY||(fY={})),oIe=[` `,`\r -`,"\r"],(function(i){function a(u,h,d,f){return new ege(u,h,d,f)}R(a,"create"),i.create=a;function s(u){let h=u;return!!(at.defined(h)&&at.string(h.uri)&&(at.undefined(h.languageId)||at.string(h.languageId))&&at.uinteger(h.lineCount)&&at.func(h.getText)&&at.func(h.positionAt)&&at.func(h.offsetAt))}R(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}R(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}R(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 Kn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return Kn.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"}R(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}R(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}R(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}R(h,"number"),i.number=h;function d(v,x,b){return a.call(v)==="[object Number]"&&x<=v&&v<=b}R(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}R(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}R(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}R(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}R(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}R(y,"typedArray"),i.typedArray=y})(at||(at={}))}}),Uy=cn({"../../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}R(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}R(i,"install"),n.install=i})(r||(r={})),t.default=r}}),QE=cn({"../../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}R(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}R(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}R(n,"number"),t.number=n;function i(l){return l instanceof Error}R(i,"error"),t.error=i;function a(l){return typeof l=="function"}R(a,"func"),t.func=a;function s(l){return Array.isArray(l)}R(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}R(o,"stringArray"),t.stringArray=o}}),J3=cn({"../../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=Uy(),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:R(()=>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:R(()=>{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)}},R(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),pD=cn({"../../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=Uy(),r=QE(),n=J3(),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)}R(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)}},R(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}},R(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),aIe=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me,te,$e,Oe,He;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=QE(),r;(function(ue){ue.ParseError=-32700,ue.InvalidRequest=-32600,ue.MethodNotFound=-32601,ue.InvalidParams=-32602,ue.InternalError=-32603,ue.jsonrpcReservedErrorRangeStart=-32099,ue.serverErrorStart=-32099,ue.MessageWriteError=-32099,ue.MessageReadError=-32098,ue.PendingResponseRejected=-32097,ue.ConnectionInactive=-32096,ue.ServerNotInitialized=-32002,ue.UnknownErrorCode=-32001,ue.jsonrpcReservedErrorRangeEnd=-32e3,ue.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(ce,Te,ge){super(Te),this.code=e.number(ce)?ce:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const ce={code:this.code,message:this.message};return this.data!==void 0&&(ce.data=this.data),ce}},R(N,"ResponseError"),N);t.ResponseError=n;var i=(_=class{constructor(ce){this.kind=ce}static is(ce){return ce===_.auto||ce===_.byName||ce===_.byPosition}toString(){return this.kind}},R(_,"ParameterStructures"),_);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(ce,Te){this.method=ce,this.numberOfParams=Te}get parameterStructures(){return i.auto}},R(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=(O=class extends a{constructor(ce){super(ce,0)}},R(O,"RequestType0"),O);t.RequestType0=s;var o=(D=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(D,"RequestType"),D);t.RequestType=o;var l=($=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R($,"RequestType1"),$);t.RequestType1=l;var u=(F=class extends a{constructor(ce){super(ce,2)}},R(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends a{constructor(ce){super(ce,3)}},R(z,"RequestType3"),z);t.RequestType3=h;var d=(H=class extends a{constructor(ce){super(ce,4)}},R(H,"RequestType4"),H);t.RequestType4=d;var f=(B=class extends a{constructor(ce){super(ce,5)}},R(B,"RequestType5"),B);t.RequestType5=f;var p=(V=class extends a{constructor(ce){super(ce,6)}},R(V,"RequestType6"),V);t.RequestType6=p;var g=(q=class extends a{constructor(ce){super(ce,7)}},R(q,"RequestType7"),q);t.RequestType7=g;var m=(G=class extends a{constructor(ce){super(ce,8)}},R(G,"RequestType8"),G);t.RequestType8=m;var y=(Q=class extends a{constructor(ce){super(ce,9)}},R(Q,"RequestType9"),Q);t.RequestType9=y;var v=(j=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(j,"NotificationType"),j);t.NotificationType=v;var x=(ae=class extends a{constructor(ce){super(ce,0)}},R(ae,"NotificationType0"),ae);t.NotificationType0=x;var b=(Z=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(Z,"NotificationType1"),Z);t.NotificationType1=b;var T=(J=class extends a{constructor(ce){super(ce,2)}},R(J,"NotificationType2"),J);t.NotificationType2=T;var k=(re=class extends a{constructor(ce){super(ce,3)}},R(re,"NotificationType3"),re);t.NotificationType3=k;var S=(ee=class extends a{constructor(ce){super(ce,4)}},R(ee,"NotificationType4"),ee);t.NotificationType4=S;var C=(me=class extends a{constructor(ce){super(ce,5)}},R(me,"NotificationType5"),me);t.NotificationType5=C;var E=(te=class extends a{constructor(ce){super(ce,6)}},R(te,"NotificationType6"),te);t.NotificationType6=E;var A=($e=class extends a{constructor(ce){super(ce,7)}},R($e,"NotificationType7"),$e);t.NotificationType7=A;var M=(Oe=class extends a{constructor(ce){super(ce,8)}},R(Oe,"NotificationType8"),Oe);t.NotificationType8=M;var L=(He=class extends a{constructor(ce){super(ce,9)}},R(He,"NotificationType9"),He);t.NotificationType9=L;var P;(function(ue){function ce(Ve){const we=Ve;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}R(ce,"isRequest"),ue.isRequest=ce;function Te(Ve){const we=Ve;return we&&e.string(we.method)&&Ve.id===void 0}R(Te,"isNotification"),ue.isNotification=Te;function ge(Ve){const we=Ve;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}R(ge,"isResponse"),ue.isResponse=ge})(P||(t.Message=P={}))}}),sIe=cn({"../../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:R(()=>{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:R(()=>{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:R(()=>{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)}},R(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))}},R(s,"LRUCache"),s);t.LRUCache=i}}),HUt=cn({"../../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}}R(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),VUt=cn({"../../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=pD(),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()}},R(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")}},R(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},R(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)}},R(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),oIe=cn({"../../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=Uy(),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()}}},R(n,"Semaphore"),n);t.Semaphore=r}}),WUt=cn({"../../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=Uy(),r=QE(),n=J3(),i=oIe(),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)}R(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"}`)}},R(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=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,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}R(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))}},R(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),qUt=cn({"../../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=Uy(),r=QE(),n=oIe(),i=J3(),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)}R(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"}`)}},R(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}}R(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()}},R(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),GUt=cn({"../../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 Kn.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return Kn.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"}R(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}R(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}R(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}R(h,"number"),i.number=h;function d(v,x,b){return a.call(v)==="[object Number]"&&x<=v&&v<=b}R(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}R(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}R(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}R(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}R(m,"objectLiteral"),i.objectLiteral=m;function y(v,x){return Array.isArray(v)&&v.every(x)}R(y,"typedArray"),i.typedArray=y})(at||(at={}))}}),Uy=cn({"../../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}R(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}R(i,"install"),n.install=i})(r||(r={})),t.default=r}}),JE=cn({"../../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}R(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}R(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}R(n,"number"),t.number=n;function i(l){return l instanceof Error}R(i,"error"),t.error=i;function a(l){return typeof l=="function"}R(a,"func"),t.func=a;function s(l){return Array.isArray(l)}R(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}R(o,"stringArray"),t.stringArray=o}}),J3=cn({"../../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=Uy(),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:R(()=>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:R(()=>{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)}},R(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),mD=cn({"../../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=Uy(),r=JE(),n=J3(),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)}R(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)}},R(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}},R(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),lIe=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,_,I,O,D,$,F,z,H,B,V,q,G,Q,j,ae,Z,J,re,ee,me,te,$e,Oe,He;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=JE(),r;(function(ue){ue.ParseError=-32700,ue.InvalidRequest=-32600,ue.MethodNotFound=-32601,ue.InvalidParams=-32602,ue.InternalError=-32603,ue.jsonrpcReservedErrorRangeStart=-32099,ue.serverErrorStart=-32099,ue.MessageWriteError=-32099,ue.MessageReadError=-32098,ue.PendingResponseRejected=-32097,ue.ConnectionInactive=-32096,ue.ServerNotInitialized=-32002,ue.UnknownErrorCode=-32001,ue.jsonrpcReservedErrorRangeEnd=-32e3,ue.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(ce,Te,ge){super(Te),this.code=e.number(ce)?ce:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const ce={code:this.code,message:this.message};return this.data!==void 0&&(ce.data=this.data),ce}},R(N,"ResponseError"),N);t.ResponseError=n;var i=(_=class{constructor(ce){this.kind=ce}static is(ce){return ce===_.auto||ce===_.byName||ce===_.byPosition}toString(){return this.kind}},R(_,"ParameterStructures"),_);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(ce,Te){this.method=ce,this.numberOfParams=Te}get parameterStructures(){return i.auto}},R(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=(O=class extends a{constructor(ce){super(ce,0)}},R(O,"RequestType0"),O);t.RequestType0=s;var o=(D=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(D,"RequestType"),D);t.RequestType=o;var l=($=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R($,"RequestType1"),$);t.RequestType1=l;var u=(F=class extends a{constructor(ce){super(ce,2)}},R(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends a{constructor(ce){super(ce,3)}},R(z,"RequestType3"),z);t.RequestType3=h;var d=(H=class extends a{constructor(ce){super(ce,4)}},R(H,"RequestType4"),H);t.RequestType4=d;var f=(B=class extends a{constructor(ce){super(ce,5)}},R(B,"RequestType5"),B);t.RequestType5=f;var p=(V=class extends a{constructor(ce){super(ce,6)}},R(V,"RequestType6"),V);t.RequestType6=p;var g=(q=class extends a{constructor(ce){super(ce,7)}},R(q,"RequestType7"),q);t.RequestType7=g;var m=(G=class extends a{constructor(ce){super(ce,8)}},R(G,"RequestType8"),G);t.RequestType8=m;var y=(Q=class extends a{constructor(ce){super(ce,9)}},R(Q,"RequestType9"),Q);t.RequestType9=y;var v=(j=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(j,"NotificationType"),j);t.NotificationType=v;var x=(ae=class extends a{constructor(ce){super(ce,0)}},R(ae,"NotificationType0"),ae);t.NotificationType0=x;var b=(Z=class extends a{constructor(ce,Te=i.auto){super(ce,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},R(Z,"NotificationType1"),Z);t.NotificationType1=b;var T=(J=class extends a{constructor(ce){super(ce,2)}},R(J,"NotificationType2"),J);t.NotificationType2=T;var k=(re=class extends a{constructor(ce){super(ce,3)}},R(re,"NotificationType3"),re);t.NotificationType3=k;var S=(ee=class extends a{constructor(ce){super(ce,4)}},R(ee,"NotificationType4"),ee);t.NotificationType4=S;var C=(me=class extends a{constructor(ce){super(ce,5)}},R(me,"NotificationType5"),me);t.NotificationType5=C;var E=(te=class extends a{constructor(ce){super(ce,6)}},R(te,"NotificationType6"),te);t.NotificationType6=E;var A=($e=class extends a{constructor(ce){super(ce,7)}},R($e,"NotificationType7"),$e);t.NotificationType7=A;var M=(Oe=class extends a{constructor(ce){super(ce,8)}},R(Oe,"NotificationType8"),Oe);t.NotificationType8=M;var L=(He=class extends a{constructor(ce){super(ce,9)}},R(He,"NotificationType9"),He);t.NotificationType9=L;var P;(function(ue){function ce(Ve){const we=Ve;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}R(ce,"isRequest"),ue.isRequest=ce;function Te(Ve){const we=Ve;return we&&e.string(we.method)&&Ve.id===void 0}R(Te,"isNotification"),ue.isNotification=Te;function ge(Ve){const we=Ve;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}R(ge,"isResponse"),ue.isResponse=ge})(P||(t.Message=P={}))}}),cIe=cn({"../../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:R(()=>{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:R(()=>{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:R(()=>{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)}},R(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))}},R(s,"LRUCache"),s);t.LRUCache=i}}),YUt=cn({"../../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}}R(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),jUt=cn({"../../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=mD(),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()}},R(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")}},R(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},R(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)}},R(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),uIe=cn({"../../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=Uy(),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()}}},R(n,"Semaphore"),n);t.Semaphore=r}}),XUt=cn({"../../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=Uy(),r=JE(),n=J3(),i=uIe(),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)}R(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"}`)}},R(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const x=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,x.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)x.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,x.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:x}}R(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))}},R(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),KUt=cn({"../../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=Uy(),r=JE(),n=uIe(),i=J3(),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)}R(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"}`)}},R(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}}R(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()}},R(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),ZUt=cn({"../../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}},R(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),UUt=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,_;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=Uy(),r=QE(),n=aIe(),i=sIe(),a=J3(),s=pD(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function O(D){return typeof D=="string"||typeof D=="number"}R(O,"is"),I.is=O})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},R(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function O(D){return r.func(D)}R(O,"is"),I.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:R(()=>{},"error"),warn:R(()=>{},"warn"),info:R(()=>{},"info"),log:R(()=>{},"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 O($){if(!r.string($))return I.Off;switch($=$.toLowerCase(),$){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}R(O,"fromString"),I.fromString=O;function D($){switch($){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}R(D,"toString"),I.toString=D})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function O(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?I.JSON:I.Text):I.Text}R(O,"fromString"),I.fromString=O})(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 x=(_=class extends Error{constructor(O,D){super(D),this.code=O,Object.setPrototypeOf(this,_.prototype)}},R(_,"ConnectionError"),_);t.ConnectionError=x;var b;(function(I){function O(D){const $=D;return $&&r.func($.cancelUndispatched)}R(O,"is"),I.is=O})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function O(D){const $=D;return $&&($.kind===void 0||$.kind==="id")&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}R(O,"is"),I.is=O})(T||(t.IdCancellationReceiverStrategy=T={}));var k;(function(I){function O(D){const $=D;return $&&$.kind==="request"&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}R(O,"is"),I.is=O})(k||(t.RequestCancellationReceiverStrategy=k={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function O(D){return T.is(D)||k.is(D)}R(O,"is"),I.is=O})(S||(t.CancellationReceiverStrategy=S={}));var C;(function(I){I.Message=Object.freeze({sendCancellation(D,$){return D.sendNotification(o.type,{id:$})},cleanup(D){}});function O(D){const $=D;return $&&r.func($.sendCancellation)&&r.func($.cleanup)}R(O,"is"),I.is=O})(C||(t.CancellationSenderStrategy=C={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:C.Message});function O(D){const $=D;return $&&S.is($.receiver)&&C.is($.sender)}R(O,"is"),I.is=O})(E||(t.CancellationStrategy=E={}));var A;(function(I){function O(D){const $=D;return $&&r.func($.handleMessage)}R(O,"is"),I.is=O})(A||(t.MessageStrategy=A={}));var M;(function(I){function O(D){const $=D;return $&&(E.is($.cancellationStrategy)||b.is($.connectionStrategy)||A.is($.messageStrategy))}R(O,"is"),I.is=O})(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,D,$){const F=D!==void 0?D:t.NullLogger;let z=0,H=0,B=0;const V="2.0";let q;const G=new Map;let Q;const j=new Map,ae=new Map;let Z,J=new i.LinkedMap,re=new Map,ee=new Set,me=new Map,te=f.Off,$e=g.Text,Oe,He=L.New;const ue=new a.Emitter,ce=new a.Emitter,Te=new a.Emitter,ge=new a.Emitter,Ve=new a.Emitter,we=$&&$.cancellationStrategy?$.cancellationStrategy:E.Message;function Ae(_e){if(_e===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+_e.toString()}R(Ae,"createRequestQueueKey");function Ue(_e){return _e===null?"res-unknown-"+(++B).toString():"res-"+_e.toString()}R(Ue,"createResponseQueueKey");function le(){return"not-"+(++H).toString()}R(le,"createNotificationQueueKey");function pe(_e,Je){n.Message.isRequest(Je)?_e.set(Ae(Je.id),Je):n.Message.isResponse(Je)?_e.set(Ue(Je.id),Je):_e.set(le(),Je)}R(pe,"addMessageToQueue");function Ce(_e){}R(Ce,"cancelUndispatched");function oe(){return He===L.Listening}R(oe,"isListening");function fe(){return He===L.Closed}R(fe,"isClosed");function W(){return He===L.Disposed}R(W,"isDisposed");function se(){(He===L.New||He===L.Listening)&&(He=L.Closed,ce.fire(void 0))}R(se,"closeHandler");function K(_e){ue.fire([_e,void 0,void 0])}R(K,"readErrorHandler");function de(_e){ue.fire(_e)}R(de,"writeErrorHandler"),I.onClose(se),I.onError(K),O.onClose(se),O.onError(de);function X(){Z||J.size===0||(Z=(0,e.default)().timer.setImmediate(()=>{Z=void 0,ke()}))}R(X,"triggerMessageQueue");function Fe(_e){n.Message.isRequest(_e)?Ie(_e):n.Message.isNotification(_e)?De(_e):n.Message.isResponse(_e)?ze(_e):Ke(_e)}R(Fe,"handleMessage");function ke(){if(J.size===0)return;const _e=J.shift();try{const Je=$==null?void 0:$.messageStrategy;A.is(Je)?Je.handleMessage(_e,Fe):Fe(_e)}finally{X()}}R(ke,"processMessageQueue");const Ye=R(_e=>{try{if(n.Message.isNotification(_e)&&_e.method===o.type.method){const Je=_e.params.id,ut=Ae(Je),Dt=J.get(ut);if(n.Message.isRequest(Dt)){const Sr=$==null?void 0:$.connectionStrategy,yr=Sr&&Sr.cancelUndispatched?Sr.cancelUndispatched(Dt,Ce):void 0;if(yr&&(yr.error!==void 0||yr.result!==void 0)){J.delete(ut),me.delete(Je),yr.id=Dt.id,pt(yr,_e.method,Date.now()),O.write(yr).catch(()=>F.error("Sending response for canceled message failed."));return}}const Kt=me.get(Je);if(Kt!==void 0){Kt.cancel(),Ct(_e);return}else ee.add(Je)}pe(J,_e)}finally{X()}},"callback");function Ie(_e){if(W())return;function Je(Tr,rn,mr){const zr={jsonrpc:V,id:_e.id};Tr instanceof n.ResponseError?zr.error=Tr.toJson():zr.result=Tr===void 0?null:Tr,pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(Je,"reply");function ut(Tr,rn,mr){const zr={jsonrpc:V,id:_e.id,error:Tr.toJson()};pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(ut,"replyError");function Dt(Tr,rn,mr){Tr===void 0&&(Tr=null);const zr={jsonrpc:V,id:_e.id,result:Tr};pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(Dt,"replySuccess"),Me(_e);const Kt=G.get(_e.method);let Sr,yr;Kt&&(Sr=Kt.type,yr=Kt.handler);const qr=Date.now();if(yr||q){const Tr=_e.id??String(Date.now()),rn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Tr):we.receiver.createCancellationTokenSource(_e);_e.id!==null&&ee.has(_e.id)&&rn.cancel(),_e.id!==null&&me.set(Tr,rn);try{let mr;if(yr)if(_e.params===void 0){if(Sr!==void 0&&Sr.numberOfParams!==0){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines ${Sr.numberOfParams} params but received none.`),_e.method,qr);return}mr=yr(rn.token)}else if(Array.isArray(_e.params)){if(Sr!==void 0&&Sr.parameterStructures===n.ParameterStructures.byName){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines parameters by name but received parameters by position`),_e.method,qr);return}mr=yr(..._e.params,rn.token)}else{if(Sr!==void 0&&Sr.parameterStructures===n.ParameterStructures.byPosition){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines parameters by position but received parameters by name`),_e.method,qr);return}mr=yr(_e.params,rn.token)}else q&&(mr=q(_e.method,_e.params,rn.token));const zr=mr;mr?zr.then?zr.then(hn=>{me.delete(Tr),Je(hn,_e.method,qr)},hn=>{me.delete(Tr),hn instanceof n.ResponseError?ut(hn,_e.method,qr):hn&&r.string(hn.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed with message: ${hn.message}`),_e.method,qr):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed unexpectedly without providing any details.`),_e.method,qr)}):(me.delete(Tr),Je(mr,_e.method,qr)):(me.delete(Tr),Dt(mr,_e.method,qr))}catch(mr){me.delete(Tr),mr instanceof n.ResponseError?Je(mr,_e.method,qr):mr&&r.string(mr.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed with message: ${mr.message}`),_e.method,qr):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed unexpectedly without providing any details.`),_e.method,qr)}}else ut(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${_e.method}`),_e.method,qr)}R(Ie,"handleRequest");function ze(_e){if(!W())if(_e.id===null)_e.error?F.error(`Received response message without id: Error is: +${y}`);const x=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?x.toLowerCase():x,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}},R(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),QUt=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,_;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=Uy(),r=JE(),n=lIe(),i=cIe(),a=J3(),s=mD(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function O(D){return typeof D=="string"||typeof D=="number"}R(O,"is"),I.is=O})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},R(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function O(D){return r.func(D)}R(O,"is"),I.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:R(()=>{},"error"),warn:R(()=>{},"warn"),info:R(()=>{},"info"),log:R(()=>{},"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 O($){if(!r.string($))return I.Off;switch($=$.toLowerCase(),$){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}R(O,"fromString"),I.fromString=O;function D($){switch($){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}R(D,"toString"),I.toString=D})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function O(D){return r.string(D)?(D=D.toLowerCase(),D==="json"?I.JSON:I.Text):I.Text}R(O,"fromString"),I.fromString=O})(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 x=(_=class extends Error{constructor(O,D){super(D),this.code=O,Object.setPrototypeOf(this,_.prototype)}},R(_,"ConnectionError"),_);t.ConnectionError=x;var b;(function(I){function O(D){const $=D;return $&&r.func($.cancelUndispatched)}R(O,"is"),I.is=O})(b||(t.ConnectionStrategy=b={}));var T;(function(I){function O(D){const $=D;return $&&($.kind===void 0||$.kind==="id")&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}R(O,"is"),I.is=O})(T||(t.IdCancellationReceiverStrategy=T={}));var k;(function(I){function O(D){const $=D;return $&&$.kind==="request"&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}R(O,"is"),I.is=O})(k||(t.RequestCancellationReceiverStrategy=k={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(D){return new s.CancellationTokenSource}});function O(D){return T.is(D)||k.is(D)}R(O,"is"),I.is=O})(S||(t.CancellationReceiverStrategy=S={}));var C;(function(I){I.Message=Object.freeze({sendCancellation(D,$){return D.sendNotification(o.type,{id:$})},cleanup(D){}});function O(D){const $=D;return $&&r.func($.sendCancellation)&&r.func($.cleanup)}R(O,"is"),I.is=O})(C||(t.CancellationSenderStrategy=C={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:C.Message});function O(D){const $=D;return $&&S.is($.receiver)&&C.is($.sender)}R(O,"is"),I.is=O})(E||(t.CancellationStrategy=E={}));var A;(function(I){function O(D){const $=D;return $&&r.func($.handleMessage)}R(O,"is"),I.is=O})(A||(t.MessageStrategy=A={}));var M;(function(I){function O(D){const $=D;return $&&(E.is($.cancellationStrategy)||b.is($.connectionStrategy)||A.is($.messageStrategy))}R(O,"is"),I.is=O})(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,D,$){const F=D!==void 0?D:t.NullLogger;let z=0,H=0,B=0;const V="2.0";let q;const G=new Map;let Q;const j=new Map,ae=new Map;let Z,J=new i.LinkedMap,re=new Map,ee=new Set,me=new Map,te=f.Off,$e=g.Text,Oe,He=L.New;const ue=new a.Emitter,ce=new a.Emitter,Te=new a.Emitter,ge=new a.Emitter,Ve=new a.Emitter,we=$&&$.cancellationStrategy?$.cancellationStrategy:E.Message;function Ae(_e){if(_e===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+_e.toString()}R(Ae,"createRequestQueueKey");function Ue(_e){return _e===null?"res-unknown-"+(++B).toString():"res-"+_e.toString()}R(Ue,"createResponseQueueKey");function le(){return"not-"+(++H).toString()}R(le,"createNotificationQueueKey");function pe(_e,Je){n.Message.isRequest(Je)?_e.set(Ae(Je.id),Je):n.Message.isResponse(Je)?_e.set(Ue(Je.id),Je):_e.set(le(),Je)}R(pe,"addMessageToQueue");function Ce(_e){}R(Ce,"cancelUndispatched");function oe(){return He===L.Listening}R(oe,"isListening");function fe(){return He===L.Closed}R(fe,"isClosed");function W(){return He===L.Disposed}R(W,"isDisposed");function se(){(He===L.New||He===L.Listening)&&(He=L.Closed,ce.fire(void 0))}R(se,"closeHandler");function K(_e){ue.fire([_e,void 0,void 0])}R(K,"readErrorHandler");function de(_e){ue.fire(_e)}R(de,"writeErrorHandler"),I.onClose(se),I.onError(K),O.onClose(se),O.onError(de);function X(){Z||J.size===0||(Z=(0,e.default)().timer.setImmediate(()=>{Z=void 0,ke()}))}R(X,"triggerMessageQueue");function Fe(_e){n.Message.isRequest(_e)?Ie(_e):n.Message.isNotification(_e)?De(_e):n.Message.isResponse(_e)?ze(_e):Ke(_e)}R(Fe,"handleMessage");function ke(){if(J.size===0)return;const _e=J.shift();try{const Je=$==null?void 0:$.messageStrategy;A.is(Je)?Je.handleMessage(_e,Fe):Fe(_e)}finally{X()}}R(ke,"processMessageQueue");const Ye=R(_e=>{try{if(n.Message.isNotification(_e)&&_e.method===o.type.method){const Je=_e.params.id,ut=Ae(Je),Dt=J.get(ut);if(n.Message.isRequest(Dt)){const Er=$==null?void 0:$.connectionStrategy,yr=Er&&Er.cancelUndispatched?Er.cancelUndispatched(Dt,Ce):void 0;if(yr&&(yr.error!==void 0||yr.result!==void 0)){J.delete(ut),me.delete(Je),yr.id=Dt.id,pt(yr,_e.method,Date.now()),O.write(yr).catch(()=>F.error("Sending response for canceled message failed."));return}}const Kt=me.get(Je);if(Kt!==void 0){Kt.cancel(),Ct(_e);return}else ee.add(Je)}pe(J,_e)}finally{X()}},"callback");function Ie(_e){if(W())return;function Je(kr,rn,mr){const zr={jsonrpc:V,id:_e.id};kr instanceof n.ResponseError?zr.error=kr.toJson():zr.result=kr===void 0?null:kr,pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(Je,"reply");function ut(kr,rn,mr){const zr={jsonrpc:V,id:_e.id,error:kr.toJson()};pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(ut,"replyError");function Dt(kr,rn,mr){kr===void 0&&(kr=null);const zr={jsonrpc:V,id:_e.id,result:kr};pt(zr,rn,mr),O.write(zr).catch(()=>F.error("Sending response failed."))}R(Dt,"replySuccess"),Me(_e);const Kt=G.get(_e.method);let Er,yr;Kt&&(Er=Kt.type,yr=Kt.handler);const qr=Date.now();if(yr||q){const kr=_e.id??String(Date.now()),rn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(kr):we.receiver.createCancellationTokenSource(_e);_e.id!==null&&ee.has(_e.id)&&rn.cancel(),_e.id!==null&&me.set(kr,rn);try{let mr;if(yr)if(_e.params===void 0){if(Er!==void 0&&Er.numberOfParams!==0){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines ${Er.numberOfParams} params but received none.`),_e.method,qr);return}mr=yr(rn.token)}else if(Array.isArray(_e.params)){if(Er!==void 0&&Er.parameterStructures===n.ParameterStructures.byName){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines parameters by name but received parameters by position`),_e.method,qr);return}mr=yr(..._e.params,rn.token)}else{if(Er!==void 0&&Er.parameterStructures===n.ParameterStructures.byPosition){ut(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${_e.method} defines parameters by position but received parameters by name`),_e.method,qr);return}mr=yr(_e.params,rn.token)}else q&&(mr=q(_e.method,_e.params,rn.token));const zr=mr;mr?zr.then?zr.then(hn=>{me.delete(kr),Je(hn,_e.method,qr)},hn=>{me.delete(kr),hn instanceof n.ResponseError?ut(hn,_e.method,qr):hn&&r.string(hn.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed with message: ${hn.message}`),_e.method,qr):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed unexpectedly without providing any details.`),_e.method,qr)}):(me.delete(kr),Je(mr,_e.method,qr)):(me.delete(kr),Dt(mr,_e.method,qr))}catch(mr){me.delete(kr),mr instanceof n.ResponseError?Je(mr,_e.method,qr):mr&&r.string(mr.message)?ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed with message: ${mr.message}`),_e.method,qr):ut(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${_e.method} failed unexpectedly without providing any details.`),_e.method,qr)}}else ut(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${_e.method}`),_e.method,qr)}R(Ie,"handleRequest");function ze(_e){if(!W())if(_e.id===null)_e.error?F.error(`Received response message without id: Error is: ${JSON.stringify(_e.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const Je=_e.id,ut=re.get(Je);if(wt(_e,ut),ut!==void 0){re.delete(Je);try{if(_e.error){const Dt=_e.error;ut.reject(new n.ResponseError(Dt.code,Dt.message,Dt.data))}else if(_e.result!==void 0)ut.resolve(_e.result);else throw new Error("Should never happen.")}catch(Dt){Dt.message?F.error(`Response handler '${ut.method}' failed with message: ${Dt.message}`):F.error(`Response handler '${ut.method}' failed unexpectedly.`)}}}}R(ze,"handleResponse");function De(_e){if(W())return;let Je,ut;if(_e.method===o.type.method){const Dt=_e.params.id;ee.delete(Dt),Ct(_e);return}else{const Dt=j.get(_e.method);Dt&&(ut=Dt.handler,Je=Dt.type)}if(ut||Q)try{if(Ct(_e),ut)if(_e.params===void 0)Je!==void 0&&Je.numberOfParams!==0&&Je.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${_e.method} defines ${Je.numberOfParams} params but received none.`),ut();else if(Array.isArray(_e.params)){const Dt=_e.params;_e.method===u.type.method&&Dt.length===2&&l.is(Dt[0])?ut({token:Dt[0],value:Dt[1]}):(Je!==void 0&&(Je.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${_e.method} defines parameters by name but received parameters by position`),Je.numberOfParams!==_e.params.length&&F.error(`Notification ${_e.method} defines ${Je.numberOfParams} params but received ${Dt.length} arguments`)),ut(...Dt))}else Je!==void 0&&Je.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${_e.method} defines parameters by position but received parameters by name`),ut(_e.params);else Q&&Q(_e.method,_e.params)}catch(Dt){Dt.message?F.error(`Notification handler '${_e.method}' failed with message: ${Dt.message}`):F.error(`Notification handler '${_e.method}' failed unexpectedly.`)}else Te.fire(_e)}R(De,"handleNotification");function Ke(_e){if(!_e){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(_e,null,4)}`);const Je=_e;if(r.string(Je.id)||r.number(Je.id)){const ut=Je.id,Dt=re.get(ut);Dt&&Dt.reject(new Error("The received response has neither a result nor an error property."))}}R(Ke,"handleInvalidMessage");function Be(_e){if(_e!=null)switch(te){case f.Verbose:return JSON.stringify(_e,null,4);case f.Compact:return JSON.stringify(_e);default:return}}R(Be,"stringifyTrace");function nt(_e){if(!(te===f.Off||!Oe))if($e===g.Text){let Je;(te===f.Verbose||te===f.Compact)&&_e.params&&(Je=`Params: ${Be(_e.params)} @@ -2546,68 +2559,68 @@ ${JSON.stringify(_e,null,4)}`);const Je=_e;if(r.string(Je.id)||r.number(Je.id)){ `:_e.error===void 0&&(ut=`No result returned. -`)),Je){const Dt=_e.error?` Request failed: ${_e.error.message} (${_e.error.code}).`:"";Oe.log(`Received response '${Je.method} - (${_e.id})' in ${Date.now()-Je.timerStart}ms.${Dt}`,ut)}else Oe.log(`Received response ${_e.id} without active response promise.`,ut)}else ht("receive-response",_e)}R(wt,"traceReceivedResponse");function ht(_e,Je){if(!Oe||te===f.Off)return;const ut={isLSPMessage:!0,type:_e,message:Je,timestamp:Date.now()};Oe.log(ut)}R(ht,"logLSPMessage");function Bt(){if(fe())throw new x(v.Closed,"Connection is closed.");if(W())throw new x(v.Disposed,"Connection is disposed.")}R(Bt,"throwIfClosedOrDisposed");function At(){if(oe())throw new x(v.AlreadyListening,"Connection is already listening")}R(At,"throwIfListening");function mt(){if(!oe())throw new Error("Call listen() first.")}R(mt,"throwIfNotListening");function ye(_e){return _e===void 0?null:_e}R(ye,"undefinedToNull");function Nt(_e){if(_e!==null)return _e}R(Nt,"nullToUndefined");function yt(_e){return _e!=null&&!Array.isArray(_e)&&typeof _e=="object"}R(yt,"isNamedParam");function gt(_e,Je){switch(_e){case n.ParameterStructures.auto:return yt(Je)?Nt(Je):[ye(Je)];case n.ParameterStructures.byName:if(!yt(Je))throw new Error("Received parameters by name but param is not an object literal.");return Nt(Je);case n.ParameterStructures.byPosition:return[ye(Je)];default:throw new Error(`Unknown parameter structure ${_e.toString()}`)}}R(gt,"computeSingleParam");function St(_e,Je){let ut;const Dt=_e.numberOfParams;switch(Dt){case 0:ut=void 0;break;case 1:ut=gt(_e.parameterStructures,Je[0]);break;default:ut=[];for(let Kt=0;Kt{Bt();let ut,Dt;if(r.string(_e)){ut=_e;const Sr=Je[0];let yr=0,qr=n.ParameterStructures.auto;n.ParameterStructures.is(Sr)&&(yr=1,qr=Sr);let Tr=Je.length;const rn=Tr-yr;switch(rn){case 0:Dt=void 0;break;case 1:Dt=gt(qr,Je[yr]);break;default:if(qr===n.ParameterStructures.byName)throw new Error(`Received ${rn} parameters for 'by Name' notification parameter structure.`);Dt=Je.slice(yr,Tr).map(mr=>ye(mr));break}}else{const Sr=Je;ut=_e.method,Dt=St(_e,Sr)}const Kt={jsonrpc:V,method:ut,params:Dt};return Le(Kt),O.write(Kt).catch(Sr=>{throw F.error("Sending notification failed."),Sr})},"sendNotification"),onNotification:R((_e,Je)=>{Bt();let ut;return r.func(_e)?Q=_e:Je&&(r.string(_e)?(ut=_e,j.set(_e,{type:void 0,handler:Je})):(ut=_e.method,j.set(_e.method,{type:_e,handler:Je}))),{dispose:R(()=>{ut!==void 0?j.delete(ut):Q=void 0},"dispose")}},"onNotification"),onProgress:R((_e,Je,ut)=>{if(ae.has(Je))throw new Error(`Progress handler for token ${Je} already registered`);return ae.set(Je,ut),{dispose:R(()=>{ae.delete(Je)},"dispose")}},"onProgress"),sendProgress:R((_e,Je,ut)=>tn.sendNotification(u.type,{token:Je,value:ut}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:R((_e,...Je)=>{Bt(),mt();let ut,Dt,Kt;if(r.string(_e)){ut=_e;const Tr=Je[0],rn=Je[Je.length-1];let mr=0,zr=n.ParameterStructures.auto;n.ParameterStructures.is(Tr)&&(mr=1,zr=Tr);let hn=Je.length;s.CancellationToken.is(rn)&&(hn=hn-1,Kt=rn);const st=hn-mr;switch(st){case 0:Dt=void 0;break;case 1:Dt=gt(zr,Je[mr]);break;default:if(zr===n.ParameterStructures.byName)throw new Error(`Received ${st} parameters for 'by Name' request parameter structure.`);Dt=Je.slice(mr,hn).map(vt=>ye(vt));break}}else{const Tr=Je;ut=_e.method,Dt=St(_e,Tr);const rn=_e.numberOfParams;Kt=s.CancellationToken.is(Tr[rn])?Tr[rn]:void 0}const Sr=z++;let yr;Kt&&(yr=Kt.onCancellationRequested(()=>{const Tr=we.sender.sendCancellation(tn,Sr);return Tr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${Sr}`),Promise.resolve()):Tr.catch(()=>{F.log(`Sending cancellation messages for id ${Sr} failed`)})}));const qr={jsonrpc:V,id:Sr,method:ut,params:Dt};return nt(qr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(qr),new Promise(async(Tr,rn)=>{const mr=R(st=>{Tr(st),we.sender.cleanup(Sr),yr==null||yr.dispose()},"resolveWithCleanup"),zr=R(st=>{rn(st),we.sender.cleanup(Sr),yr==null||yr.dispose()},"rejectWithCleanup"),hn={method:ut,timerStart:Date.now(),resolve:mr,reject:zr};try{await O.write(qr),re.set(Sr,hn)}catch(st){throw F.error("Sending request failed."),hn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,st.message?st.message:"Unknown reason")),st}})},"sendRequest"),onRequest:R((_e,Je)=>{Bt();let ut=null;return d.is(_e)?(ut=void 0,q=_e):r.string(_e)?(ut=null,Je!==void 0&&(ut=_e,G.set(_e,{handler:Je,type:void 0}))):Je!==void 0&&(ut=_e.method,G.set(_e.method,{type:_e,handler:Je})),{dispose:R(()=>{ut!==null&&(ut!==void 0?G.delete(ut):q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:R(()=>re.size>0,"hasPendingResponse"),trace:R(async(_e,Je,ut)=>{let Dt=!1,Kt=g.Text;ut!==void 0&&(r.boolean(ut)?Dt=ut:(Dt=ut.sendNotification||!1,Kt=ut.traceFormat||g.Text)),te=_e,$e=Kt,te===f.Off?Oe=void 0:Oe=Je,Dt&&!fe()&&!W()&&await tn.sendNotification(m.type,{value:f.toString(_e)})},"trace"),onError:ue.event,onClose:ce.event,onUnhandledNotification:Te.event,onDispose:Ve.event,end:R(()=>{O.end()},"end"),dispose:R(()=>{if(W())return;He=L.Disposed,Ve.fire(void 0);const _e=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Je of re.values())Je.reject(_e);re=new Map,me=new Map,ee=new Set,J=new i.LinkedMap,r.func(O.dispose)&&O.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:R(()=>{Bt(),At(),He=L.Listening,I.listen(Ye)},"listen"),inspect:R(()=>{(0,e.default)().console.log("inspect")},"inspect")};return tn.onNotification(y.type,_e=>{if(te===f.Off||!Oe)return;const Je=te===f.Verbose||te===f.Compact;Oe.log(_e.message,Je?_e.verbose:void 0)}),tn.onNotification(u.type,_e=>{const Je=ae.get(_e.token);Je?Je(_e.value):ge.fire(_e)}),tn}R(P,"createMessageConnection"),t.createMessageConnection=P}}),fY=cn({"../../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=aIe();Object.defineProperty(t,"Message",{enumerable:!0,get:R(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:R(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:R(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:R(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:R(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:R(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:R(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:R(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:R(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:R(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:R(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:R(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:R(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:R(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:R(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:R(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:R(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:R(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:R(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:R(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:R(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:R(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:R(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:R(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:R(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:R(function(){return e.ParameterStructures},"get")});var r=sIe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:R(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:R(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:R(function(){return r.Touch},"get")});var n=HUt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:R(function(){return n.Disposable},"get")});var i=J3();Object.defineProperty(t,"Event",{enumerable:!0,get:R(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:R(function(){return i.Emitter},"get")});var a=pD();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:R(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:R(function(){return a.CancellationToken},"get")});var s=VUt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:R(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:R(function(){return s.SharedArrayReceiverStrategy},"get")});var o=WUt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:R(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:R(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:R(function(){return o.ReadableStreamMessageReader},"get")});var l=qUt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:R(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:R(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:R(function(){return l.WriteableStreamMessageWriter},"get")});var u=GUt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:R(function(){return u.AbstractMessageBuffer},"get")});var h=UUt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:R(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:R(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:R(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:R(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:R(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:R(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:R(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:R(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:R(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:R(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:R(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:R(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:R(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:R(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:R(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:R(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:R(function(){return h.MessageStrategy},"get")});var d=Uy();t.RAL=d.default}}),YUt=cn({"../../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=fY(),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)}},R(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)}},R(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()}},R(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:R(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:R((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:R((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:R(d=>new n(d),"asReadableStream"),asWritableStream:R(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:R(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:R(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:R(()=>clearInterval(g),"dispose")}}})});function o(){return s}R(o,"RIL"),(function(d){function f(){e.RAL.install(s)}R(f,"install"),d.install=f})(o||(o={})),t.default=o}}),ek=cn({"../../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:R(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=YUt();n.default.install();var i=fY();r(fY(),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)}},R(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(){}},R(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)}R(o,"createMessageConnection"),t.createMessageConnection=o}}),tge=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=ek()}}),ga=cn({"../../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=ek(),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}},R(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},R(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},R(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},R(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},R(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),Dee=cn({"../../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}R(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}R(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}R(n,"number"),t.number=n;function i(h){return h instanceof Error}R(i,"error"),t.error=i;function a(h){return typeof h=="function"}R(a,"func"),t.func=a;function s(h){return Array.isArray(h)}R(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}R(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}R(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}R(u,"objectLiteral"),t.objectLiteral=u}}),jUt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),XUt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),KUt=cn({"../../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=ga(),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={}))}}),ZUt=cn({"../../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=ga(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),QUt=cn({"../../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=ga(),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={}))}}),JUt=cn({"../../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=ga(),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={}))}}),eYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),tYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),rYt=cn({"../../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=ek(),r=ga(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}R(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={}))}}),nYt=cn({"../../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=ga(),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={}))}}),iYt=cn({"../../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=ga(),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={}))}}),aYt=cn({"../../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=ga(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),sYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),oYt=cn({"../../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=ga(),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={}))}}),lYt=cn({"../../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=ga(),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={}))}}),cYt=cn({"../../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=ga(),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={}))}}),uYt=cn({"../../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=ga(),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={}))}}),hYt=cn({"../../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=ga(),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={}))}}),dYt=cn({"../../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=ek(),r=Dee(),n=ga(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}R(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={}))}}),fYt=cn({"../../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=(ZE(),Nee(fD)),r=Dee(),n=ga(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}R(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(x,b){const T={executionOrder:x};return(b===!0||b===!1)&&(T.success=b),T}R(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}R(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}R(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,T){return{kind:b,document:T}}R(m,"create"),g.create=m;function y(b){const T=b;return r.objectLiteral(T)&&i.is(T.kind)&&e.DocumentUri.is(T.document)&&(T.metadata===void 0||r.objectLiteral(T.metadata))}R(y,"is"),g.is=y;function v(b,T){const k=new Set;return b.document!==T.document&&k.add("document"),b.kind!==T.kind&&k.add("kind"),b.executionSummary!==T.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||T.metadata!==void 0)&&!x(b.metadata,T.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||T.executionSummary!==void 0)&&!a.equals(b.executionSummary,T.executionSummary)&&k.add("executionSummary"),k}R(v,"diff"),g.diff=v;function x(b,T){if(b===T)return!0;if(b==null||T===null||T===void 0||typeof b!=typeof T||typeof b!="object")return!1;const k=Array.isArray(b),S=Array.isArray(T);if(k!==S)return!1;if(k&&S){if(b.length!==T.length)return!1;for(let C=0;C0}R(Nt,"hasId"),ye.hasId=Nt})($||(t.StaticRegistrationOptions=$={}));var F;(function(ye){function Nt(yt){const gt=yt;return gt&&(gt.documentSelector===null||P.is(gt.documentSelector))}R(Nt,"is"),ye.is=Nt})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(ye){function Nt(gt){const St=gt;return n.objectLiteral(St)&&(St.workDoneProgress===void 0||n.boolean(St.workDoneProgress))}R(Nt,"is"),ye.is=Nt;function yt(gt){const St=gt;return St&&n.boolean(St.workDoneProgress)}R(yt,"hasWorkDoneProgress"),ye.hasWorkDoneProgress=yt})(z||(t.WorkDoneProgressOptions=z={}));var H;(function(ye){ye.method="initialize",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(H||(t.InitializeRequest=H={}));var B;(function(ye){ye.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var V;(function(ye){ye.method="initialized",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(V||(t.InitializedNotification=V={}));var q;(function(ye){ye.method="shutdown",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType0(ye.method)})(q||(t.ShutdownRequest=q={}));var G;(function(ye){ye.method="exit",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType0(ye.method)})(G||(t.ExitNotification=G={}));var Q;(function(ye){ye.method="workspace/didChangeConfiguration",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(Q||(t.DidChangeConfigurationNotification=Q={}));var j;(function(ye){ye.Error=1,ye.Warning=2,ye.Info=3,ye.Log=4,ye.Debug=5})(j||(t.MessageType=j={}));var ae;(function(ye){ye.method="window/showMessage",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(ae||(t.ShowMessageNotification=ae={}));var Z;(function(ye){ye.method="window/showMessageRequest",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType(ye.method)})(Z||(t.ShowMessageRequest=Z={}));var J;(function(ye){ye.method="window/logMessage",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(J||(t.LogMessageNotification=J={}));var re;(function(ye){ye.method="telemetry/event",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(re||(t.TelemetryEventNotification=re={}));var ee;(function(ye){ye.None=0,ye.Full=1,ye.Incremental=2})(ee||(t.TextDocumentSyncKind=ee={}));var me;(function(ye){ye.method="textDocument/didOpen",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(ye){function Nt(gt){let St=gt;return St!=null&&typeof St.text=="string"&&St.range!==void 0&&(St.rangeLength===void 0||typeof St.rangeLength=="number")}R(Nt,"isIncremental"),ye.isIncremental=Nt;function yt(gt){let St=gt;return St!=null&&typeof St.text=="string"&&St.range===void 0&&St.rangeLength===void 0}R(yt,"isFull"),ye.isFull=yt})(te||(t.TextDocumentContentChangeEvent=te={}));var $e;(function(ye){ye.method="textDocument/didChange",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})($e||(t.DidChangeTextDocumentNotification=$e={}));var Oe;(function(ye){ye.method="textDocument/didClose",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));var He;(function(ye){ye.method="textDocument/didSave",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(He||(t.DidSaveTextDocumentNotification=He={}));var ue;(function(ye){ye.Manual=1,ye.AfterDelay=2,ye.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var ce;(function(ye){ye.method="textDocument/willSave",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(ce||(t.WillSaveTextDocumentNotification=ce={}));var Te;(function(ye){ye.method="textDocument/willSaveWaitUntil",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(ye){ye.method="workspace/didChangeWatchedFiles",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var Ve;(function(ye){ye.Created=1,ye.Changed=2,ye.Deleted=3})(Ve||(t.FileChangeType=Ve={}));var we;(function(ye){function Nt(yt){const gt=yt;return n.objectLiteral(gt)&&(r.URI.is(gt.baseUri)||r.WorkspaceFolder.is(gt.baseUri))&&n.string(gt.pattern)}R(Nt,"is"),ye.is=Nt})(we||(t.RelativePattern=we={}));var Ae;(function(ye){ye.Create=1,ye.Change=2,ye.Delete=4})(Ae||(t.WatchKind=Ae={}));var Ue;(function(ye){ye.method="textDocument/publishDiagnostics",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(Ue||(t.PublishDiagnosticsNotification=Ue={}));var le;(function(ye){ye.Invoked=1,ye.TriggerCharacter=2,ye.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(ye){ye.method="textDocument/completion",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(pe||(t.CompletionRequest=pe={}));var Ce;(function(ye){ye.method="completionItem/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ce||(t.CompletionResolveRequest=Ce={}));var oe;(function(ye){ye.method="textDocument/hover",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(oe||(t.HoverRequest=oe={}));var fe;(function(ye){ye.Invoked=1,ye.TriggerCharacter=2,ye.ContentChange=3})(fe||(t.SignatureHelpTriggerKind=fe={}));var W;(function(ye){ye.method="textDocument/signatureHelp",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(W||(t.SignatureHelpRequest=W={}));var se;(function(ye){ye.method="textDocument/definition",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(se||(t.DefinitionRequest=se={}));var K;(function(ye){ye.method="textDocument/references",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(K||(t.ReferencesRequest=K={}));var de;(function(ye){ye.method="textDocument/documentHighlight",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(de||(t.DocumentHighlightRequest=de={}));var X;(function(ye){ye.method="textDocument/documentSymbol",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(X||(t.DocumentSymbolRequest=X={}));var Fe;(function(ye){ye.method="textDocument/codeAction",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Fe||(t.CodeActionRequest=Fe={}));var ke;(function(ye){ye.method="codeAction/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ke||(t.CodeActionResolveRequest=ke={}));var Ye;(function(ye){ye.method="workspace/symbol",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ye||(t.WorkspaceSymbolRequest=Ye={}));var Ie;(function(ye){ye.method="workspaceSymbol/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ie||(t.WorkspaceSymbolResolveRequest=Ie={}));var ze;(function(ye){ye.method="textDocument/codeLens",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ze||(t.CodeLensRequest=ze={}));var De;(function(ye){ye.method="codeLens/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(De||(t.CodeLensResolveRequest=De={}));var Ke;(function(ye){ye.method="workspace/codeLens/refresh",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType0(ye.method)})(Ke||(t.CodeLensRefreshRequest=Ke={}));var Be;(function(ye){ye.method="textDocument/documentLink",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Be||(t.DocumentLinkRequest=Be={}));var nt;(function(ye){ye.method="documentLink/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(nt||(t.DocumentLinkResolveRequest=nt={}));var Le;(function(ye){ye.method="textDocument/formatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Le||(t.DocumentFormattingRequest=Le={}));var pt;(function(ye){ye.method="textDocument/rangeFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(pt||(t.DocumentRangeFormattingRequest=pt={}));var Me;(function(ye){ye.method="textDocument/rangesFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Me||(t.DocumentRangesFormattingRequest=Me={}));var Ct;(function(ye){ye.method="textDocument/onTypeFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ct||(t.DocumentOnTypeFormattingRequest=Ct={}));var wt;(function(ye){ye.Identifier=1})(wt||(t.PrepareSupportDefaultBehavior=wt={}));var ht;(function(ye){ye.method="textDocument/rename",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ht||(t.RenameRequest=ht={}));var Bt;(function(ye){ye.method="textDocument/prepareRename",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Bt||(t.PrepareRenameRequest=Bt={}));var At;(function(ye){ye.method="workspace/executeCommand",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(At||(t.ExecuteCommandRequest=At={}));var mt;(function(ye){ye.method="workspace/applyEdit",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType("workspace/applyEdit")})(mt||(t.ApplyWorkspaceEditRequest=mt={}))}}),mYt=cn({"../../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=ek();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}R(r,"createProtocolConnection"),t.createProtocolConnection=r}}),yYt=cn({"../../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:R(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(ek(),t),r((ZE(),Nee(fD)),t),r(ga(),t),r(gYt(),t);var n=mYt();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:R(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={}))}}),vYt=cn({"../../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:R(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=tge();r(tge(),t),r(yYt(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}R(i,"createProtocolConnection"),t.createProtocolConnection=i}}),lIe={};Ig(lIe,{AbstractAstReflection:()=>Bee,AbstractCstNode:()=>zre,AbstractLangiumParser:()=>Vre,AbstractParserErrorMessageProvider:()=>XHe,AbstractThreadedAsyncParser:()=>Vir,AstUtils:()=>Fee,BiMap:()=>$I,Cancellation:()=>Ai,CompositeCstNodeImpl:()=>uO,ContextCache:()=>yO,CstNodeBuilder:()=>UHe,CstUtils:()=>Oee,DEFAULT_TOKENIZE_OPTIONS:()=>sne,DONE_RESULT:()=>el,DatatypeSymbol:()=>_I,DefaultAstNodeDescriptionProvider:()=>SVe,DefaultAstNodeLocator:()=>AVe,DefaultAsyncParser:()=>GVe,DefaultCommentProvider:()=>qVe,DefaultConfigurationProvider:()=>RVe,DefaultDocumentBuilder:()=>_Ve,DefaultDocumentValidator:()=>CVe,DefaultHydrator:()=>YVe,DefaultIndexManager:()=>MVe,DefaultJsonSerializer:()=>xVe,DefaultLangiumDocumentFactory:()=>hVe,DefaultLangiumDocuments:()=>dVe,DefaultLangiumProfiler:()=>Yir,DefaultLexer:()=>one,DefaultLexerErrorMessageProvider:()=>IVe,DefaultLinker:()=>fVe,DefaultNameProvider:()=>pVe,DefaultReferenceDescriptionProvider:()=>EVe,DefaultReferences:()=>gVe,DefaultScopeComputation:()=>mVe,DefaultScopeProvider:()=>bVe,DefaultServiceRegistry:()=>wVe,DefaultTokenBuilder:()=>fO,DefaultValueConverter:()=>Xre,DefaultWorkspaceLock:()=>UVe,DefaultWorkspaceManager:()=>LVe,Deferred:()=>a0,Disposable:()=>_1,DisposableCache:()=>mO,DocumentCache:()=>vVe,DocumentState:()=>wn,DocumentValidator:()=>eu,EMPTY_SCOPE:()=>Bir,EMPTY_STREAM:()=>a3,EmptyFileSystem:()=>vo,EmptyFileSystemProvider:()=>KVe,ErrorWithLocation:()=>kD,GrammarAST:()=>hIe,GrammarUtils:()=>gte,IndentationAwareLexer:()=>qir,IndentationAwareTokenBuilder:()=>XVe,JSDocDocumentationProvider:()=>WVe,LangiumCompletionParser:()=>KHe,LangiumParser:()=>jHe,LangiumParserErrorMessageProvider:()=>Wre,LeafCstNodeImpl:()=>RI,LexingMode:()=>d1,MapScope:()=>Pir,Module:()=>YY,MultiMap:()=>s0,MultiMapScope:()=>yVe,OperationCancelled:()=>Yh,ParserWorker:()=>Wir,ProfilingTask:()=>QVe,Reduction:()=>E6,RefResolving:()=>bm,RegExpUtils:()=>yte,RootCstNodeImpl:()=>Hre,SimpleCache:()=>tne,StreamImpl:()=>Uh,StreamScope:()=>WY,TextDocument:()=>LI,TreeStreamImpl:()=>s3,URI:()=>wc,UriTrie:()=>Jre,UriUtils:()=>hl,VALIDATE_EACH_NODE:()=>kVe,ValidationCategory:()=>NI,ValidationRegistry:()=>TVe,ValueConverter:()=>Oh,WorkspaceCache:()=>rne,assertCondition:()=>mte,assertUnreachable:()=>$g,createCompletionParser:()=>Ure,createDefaultCoreModule:()=>zs,createDefaultSharedCoreModule:()=>Hs,createGrammarConfig:()=>Dte,createLangiumParser:()=>Yre,createParser:()=>hO,delayNextTick:()=>pO,diagnosticData:()=>h1,eagerLoad:()=>pne,getDiagnosticRange:()=>ine,indentationBuilderDefaultOptions:()=>XY,inject:()=>Nn,interruptAndCheck:()=>Rs,isAstNode:()=>Xa,isAstNodeDescription:()=>Pee,isAstNodeWithComment:()=>nne,isCompositeCstNode:()=>Zf,isIMultiModeLexerDefinition:()=>xO,isJSDoc:()=>cne,isLeafCstNode:()=>Yy,isLinkingError:()=>Im,isMultiReference:()=>ed,isNamed:()=>ene,isOperationCancelled:()=>dv,isReference:()=>ul,isRootCstNode:()=>gD,isTokenTypeArray:()=>bO,isTokenTypeDictionary:()=>DI,loadGrammarFromJson:()=>Vs,parseJSDoc:()=>lne,prepareLangiumParser:()=>jre,setInterruptionPeriod:()=>Kre,startCancelableOperation:()=>gO,stream:()=>si,toDiagnosticData:()=>ane,toDiagnosticSeverity:()=>aS});var Oee={};Ig(Oee,{DefaultNameRegexp:()=>ute,RangeComparison:()=>zh,compareRange:()=>lte,findCommentNode:()=>hte,findDeclarationNodeAtOffset:()=>MIe,findLeafNodeAtOffset:()=>TD,findLeafNodeBeforeOffset:()=>dte,flattenCst:()=>_Ie,getDatatypeNode:()=>RIe,getInteriorNodes:()=>$Ie,getNextNode:()=>LIe,getPreviousNode:()=>pte,getStartlineNode:()=>IIe,inRange:()=>cte,isChildNode:()=>ote,isCommentNode:()=>dI,streamCst:()=>u3,toDocumentSegment:()=>h3,tokenToRange:()=>A6});function Xa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}R(Xa,"isAstNode");function ul(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}R(ul,"isReference");function ed(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}R(ed,"isMultiReference");function Pee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}R(Pee,"isAstNodeDescription");function Im(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}R(Im,"isLinkingError");var Kb,Bee=(Kb=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 Xa(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}}},R(Kb,"AbstractAstReflection"),Kb);function Zf(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}R(Zf,"isCompositeCstNode");function Yy(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}R(Yy,"isLeafCstNode");function gD(t){return Zf(t)&&typeof t.fullText=="string"}R(gD,"isRootCstNode");var Ol,Uh=(Ol=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:R(()=>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 Ol(()=>({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 el})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=cIe(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 Ol(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?el:{done:!1,value:e(i)}})}filter(e){return new Ol(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return el})}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 Ol(()=>({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(S6(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return el})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ol(()=>({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(S6(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return el})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ol(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?el:this.nextFn(r.state)))}distinct(e){return new Ol(()=>({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 el})}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)})}},R(Ol,"StreamImpl"),Ol);function cIe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}R(cIe,"toString");function S6(t){return!!t&&typeof t[Symbol.iterator]=="function"}R(S6,"isIterable");var a3=new Uh(()=>{},()=>el),el=Object.freeze({done:!0,value:void 0});function si(...t){if(t.length===1){const e=t[0];if(e instanceof Uh)return e;if(S6(e))return new Uh(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Uh(()=>({index:0}),r=>r.index1?new Uh(()=>({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 el})}iterator(){const e={state:this.startFn(),next:R(()=>this.nextFn(e.state),"next"),prune:R(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},R(Zb,"TreeStreamImpl"),Zb),E6;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}R(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}R(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}R(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}R(i,"max"),t.max=i})(E6||(E6={}));var Fee={};Ig(Fee,{assignMandatoryProperties:()=>zee,copyAstNode:()=>QL,findRootNode:()=>kb,getContainerOfType:()=>jy,getDocument:()=>Zu,getReferenceNodes:()=>KL,hasContainerOfType:()=>uIe,linkContentToContainer:()=>o3,streamAllContents:()=>T0,streamAst:()=>Qu,streamContents:()=>JE,streamReferences:()=>l3});function o3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&o3(i,e))}):Xa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&o3(n,e)))}R(o3,"linkContentToContainer");function jy(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}R(jy,"getContainerOfType");function uIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}R(uIe,"hasContainerOfType");function Zu(t){const r=kb(t).$document;if(!r)throw new Error("AST node has no document.");return r}R(Zu,"getDocument");function kb(t){for(;t.$container;)t=t.$container;return t}R(kb,"findRootNode");function KL(t){return ul(t)?t.ref?[t.ref]:[]:ed(t)?t.items.map(e=>e.ref):[]}R(KL,"getReferenceNodes");function JE(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Uh(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexJE(r,e))}R(T0,"streamAllContents");function Qu(t,e){if(t){if(e!=null&&e.range&&!ZL(t,e.range))return new s3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new s3(t,r=>JE(r,e),{includeRoot:!0})}R(Qu,"streamAst");function ZL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?cte(r,e):!1}R(ZL,"isAstNodeInRange");function l3(t){return new Uh(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexIl,AbstractParserRule:()=>GC,AbstractRule:()=>G2,AbstractType:()=>cc,Action:()=>tp,Alternatives:()=>UC,ArrayLiteral:()=>JL,ArrayType:()=>eI,Assignment:()=>rp,BooleanLiteral:()=>tI,CharacterRange:()=>np,Condition:()=>ip,Conjunction:()=>YC,CrossReference:()=>ap,Disjunction:()=>jC,EndOfFile:()=>rI,Grammar:()=>lf,GrammarImport:()=>nI,Group:()=>$m,InferredType:()=>iI,InfixRule:()=>Lh,InfixRuleOperatorList:()=>XC,InfixRuleOperators:()=>aI,Interface:()=>U2,Keyword:()=>Y2,LangiumGrammarAstReflection:()=>ste,LangiumGrammarTerminals:()=>bYt,NamedArgument:()=>j2,NegatedToken:()=>Nm,Negation:()=>sI,NumberLiteral:()=>oI,Parameter:()=>X2,ParameterReference:()=>lI,ParserRule:()=>Cu,ReferenceType:()=>KC,RegexToken:()=>Dm,ReturnType:()=>cI,RuleCall:()=>Om,SimpleType:()=>K2,StringLiteral:()=>uI,TerminalAlternatives:()=>Pm,TerminalElement:()=>$l,TerminalGroup:()=>Bm,TerminalRule:()=>cf,TerminalRuleCall:()=>Fm,Type:()=>ZC,TypeAttribute:()=>zm,TypeDefinition:()=>Hm,UnionType:()=>hI,UnorderedGroup:()=>QC,UntilToken:()=>Vm,ValueLiteral:()=>Wm,Wildcard:()=>Z2,isAbstractElement:()=>mD,isAbstractParserRule:()=>Xy,isAbstractRule:()=>dIe,isAbstractType:()=>fIe,isAction:()=>sg,isAlternatives:()=>yD,isArrayLiteral:()=>pIe,isArrayType:()=>Vee,isAssignment:()=>Qf,isBooleanLiteral:()=>Wee,isCharacterRange:()=>qee,isCondition:()=>gIe,isConjunction:()=>Gee,isCrossReference:()=>Ky,isDisjunction:()=>Uee,isEndOfFile:()=>Yee,isGrammar:()=>mIe,isGrammarImport:()=>yIe,isGroup:()=>Zy,isInferredType:()=>e7,isInfixRule:()=>c3,isInfixRuleOperatorList:()=>vIe,isInfixRuleOperators:()=>bIe,isInterface:()=>jee,isKeyword:()=>Jf,isNamedArgument:()=>xIe,isNegatedToken:()=>Xee,isNegation:()=>Kee,isNumberLiteral:()=>wIe,isParameter:()=>TIe,isParameterReference:()=>Zee,isParserRule:()=>bl,isReferenceType:()=>Qee,isRegexToken:()=>Jee,isReturnType:()=>ete,isRuleCall:()=>e0,isSimpleType:()=>vD,isStringLiteral:()=>kIe,isTerminalAlternatives:()=>tte,isTerminalElement:()=>CIe,isTerminalGroup:()=>rte,isTerminalRule:()=>vu,isTerminalRuleCall:()=>bD,isType:()=>xD,isTypeAttribute:()=>SIe,isTypeDefinition:()=>EIe,isUnionType:()=>nte,isUnorderedGroup:()=>wD,isUntilToken:()=>ite,isValueLiteral:()=>AIe,isWildcard:()=>ate,reflection:()=>Fr});var bYt={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]*/},Il={$type:"AbstractElement",cardinality:"cardinality"};function mD(t){return Fr.isInstance(t,Il.$type)}R(mD,"isAbstractElement");var GC={$type:"AbstractParserRule"};function Xy(t){return Fr.isInstance(t,GC.$type)}R(Xy,"isAbstractParserRule");var G2={$type:"AbstractRule"};function dIe(t){return Fr.isInstance(t,G2.$type)}R(dIe,"isAbstractRule");var cc={$type:"AbstractType"};function fIe(t){return Fr.isInstance(t,cc.$type)}R(fIe,"isAbstractType");var tp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function sg(t){return Fr.isInstance(t,tp.$type)}R(sg,"isAction");var UC={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function yD(t){return Fr.isInstance(t,UC.$type)}R(yD,"isAlternatives");var JL={$type:"ArrayLiteral",elements:"elements"};function pIe(t){return Fr.isInstance(t,JL.$type)}R(pIe,"isArrayLiteral");var eI={$type:"ArrayType",elementType:"elementType"};function Vee(t){return Fr.isInstance(t,eI.$type)}R(Vee,"isArrayType");var rp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Qf(t){return Fr.isInstance(t,rp.$type)}R(Qf,"isAssignment");var tI={$type:"BooleanLiteral",true:"true"};function Wee(t){return Fr.isInstance(t,tI.$type)}R(Wee,"isBooleanLiteral");var np={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function qee(t){return Fr.isInstance(t,np.$type)}R(qee,"isCharacterRange");var ip={$type:"Condition"};function gIe(t){return Fr.isInstance(t,ip.$type)}R(gIe,"isCondition");var YC={$type:"Conjunction",left:"left",right:"right"};function Gee(t){return Fr.isInstance(t,YC.$type)}R(Gee,"isConjunction");var ap={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Ky(t){return Fr.isInstance(t,ap.$type)}R(Ky,"isCrossReference");var jC={$type:"Disjunction",left:"left",right:"right"};function Uee(t){return Fr.isInstance(t,jC.$type)}R(Uee,"isDisjunction");var rI={$type:"EndOfFile",cardinality:"cardinality"};function Yee(t){return Fr.isInstance(t,rI.$type)}R(Yee,"isEndOfFile");var lf={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function mIe(t){return Fr.isInstance(t,lf.$type)}R(mIe,"isGrammar");var nI={$type:"GrammarImport",path:"path"};function yIe(t){return Fr.isInstance(t,nI.$type)}R(yIe,"isGrammarImport");var $m={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Zy(t){return Fr.isInstance(t,$m.$type)}R(Zy,"isGroup");var iI={$type:"InferredType",name:"name"};function e7(t){return Fr.isInstance(t,iI.$type)}R(e7,"isInferredType");var Lh={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function c3(t){return Fr.isInstance(t,Lh.$type)}R(c3,"isInfixRule");var XC={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function vIe(t){return Fr.isInstance(t,XC.$type)}R(vIe,"isInfixRuleOperatorList");var aI={$type:"InfixRuleOperators",precedences:"precedences"};function bIe(t){return Fr.isInstance(t,aI.$type)}R(bIe,"isInfixRuleOperators");var U2={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function jee(t){return Fr.isInstance(t,U2.$type)}R(jee,"isInterface");var Y2={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Jf(t){return Fr.isInstance(t,Y2.$type)}R(Jf,"isKeyword");var j2={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function xIe(t){return Fr.isInstance(t,j2.$type)}R(xIe,"isNamedArgument");var Nm={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Xee(t){return Fr.isInstance(t,Nm.$type)}R(Xee,"isNegatedToken");var sI={$type:"Negation",value:"value"};function Kee(t){return Fr.isInstance(t,sI.$type)}R(Kee,"isNegation");var oI={$type:"NumberLiteral",value:"value"};function wIe(t){return Fr.isInstance(t,oI.$type)}R(wIe,"isNumberLiteral");var X2={$type:"Parameter",name:"name"};function TIe(t){return Fr.isInstance(t,X2.$type)}R(TIe,"isParameter");var lI={$type:"ParameterReference",parameter:"parameter"};function Zee(t){return Fr.isInstance(t,lI.$type)}R(Zee,"isParameterReference");var Cu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function bl(t){return Fr.isInstance(t,Cu.$type)}R(bl,"isParserRule");var KC={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Qee(t){return Fr.isInstance(t,KC.$type)}R(Qee,"isReferenceType");var Dm={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Jee(t){return Fr.isInstance(t,Dm.$type)}R(Jee,"isRegexToken");var cI={$type:"ReturnType",name:"name"};function ete(t){return Fr.isInstance(t,cI.$type)}R(ete,"isReturnType");var Om={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function e0(t){return Fr.isInstance(t,Om.$type)}R(e0,"isRuleCall");var K2={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function vD(t){return Fr.isInstance(t,K2.$type)}R(vD,"isSimpleType");var uI={$type:"StringLiteral",value:"value"};function kIe(t){return Fr.isInstance(t,uI.$type)}R(kIe,"isStringLiteral");var Pm={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function tte(t){return Fr.isInstance(t,Pm.$type)}R(tte,"isTerminalAlternatives");var $l={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function CIe(t){return Fr.isInstance(t,$l.$type)}R(CIe,"isTerminalElement");var Bm={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function rte(t){return Fr.isInstance(t,Bm.$type)}R(rte,"isTerminalGroup");var cf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function vu(t){return Fr.isInstance(t,cf.$type)}R(vu,"isTerminalRule");var Fm={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function bD(t){return Fr.isInstance(t,Fm.$type)}R(bD,"isTerminalRuleCall");var ZC={$type:"Type",name:"name",type:"type"};function xD(t){return Fr.isInstance(t,ZC.$type)}R(xD,"isType");var zm={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function SIe(t){return Fr.isInstance(t,zm.$type)}R(SIe,"isTypeAttribute");var Hm={$type:"TypeDefinition"};function EIe(t){return Fr.isInstance(t,Hm.$type)}R(EIe,"isTypeDefinition");var hI={$type:"UnionType",types:"types"};function nte(t){return Fr.isInstance(t,hI.$type)}R(nte,"isUnionType");var QC={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function wD(t){return Fr.isInstance(t,QC.$type)}R(wD,"isUnorderedGroup");var Vm={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ite(t){return Fr.isInstance(t,Vm.$type)}R(ite,"isUntilToken");var Wm={$type:"ValueLiteral"};function AIe(t){return Fr.isInstance(t,Wm.$type)}R(AIe,"isValueLiteral");var Z2={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ate(t){return Fr.isInstance(t,Z2.$type)}R(ate,"isWildcard");var Qb,ste=(Qb=class extends Bee{constructor(){super(...arguments),this.types={AbstractElement:{name:Il.$type,properties:{cardinality:{name:Il.cardinality}},superTypes:[]},AbstractParserRule:{name:GC.$type,properties:{},superTypes:[G2.$type,cc.$type]},AbstractRule:{name:G2.$type,properties:{},superTypes:[]},AbstractType:{name:cc.$type,properties:{},superTypes:[]},Action:{name:tp.$type,properties:{cardinality:{name:tp.cardinality},feature:{name:tp.feature},inferredType:{name:tp.inferredType},operator:{name:tp.operator},type:{name:tp.type,referenceType:cc.$type}},superTypes:[Il.$type]},Alternatives:{name:UC.$type,properties:{cardinality:{name:UC.cardinality},elements:{name:UC.elements,defaultValue:[]}},superTypes:[Il.$type]},ArrayLiteral:{name:JL.$type,properties:{elements:{name:JL.elements,defaultValue:[]}},superTypes:[Wm.$type]},ArrayType:{name:eI.$type,properties:{elementType:{name:eI.elementType}},superTypes:[Hm.$type]},Assignment:{name:rp.$type,properties:{cardinality:{name:rp.cardinality},feature:{name:rp.feature},operator:{name:rp.operator},predicate:{name:rp.predicate},terminal:{name:rp.terminal}},superTypes:[Il.$type]},BooleanLiteral:{name:tI.$type,properties:{true:{name:tI.true,defaultValue:!1}},superTypes:[ip.$type,Wm.$type]},CharacterRange:{name:np.$type,properties:{cardinality:{name:np.cardinality},left:{name:np.left},lookahead:{name:np.lookahead},parenthesized:{name:np.parenthesized,defaultValue:!1},right:{name:np.right}},superTypes:[$l.$type]},Condition:{name:ip.$type,properties:{},superTypes:[]},Conjunction:{name:YC.$type,properties:{left:{name:YC.left},right:{name:YC.right}},superTypes:[ip.$type]},CrossReference:{name:ap.$type,properties:{cardinality:{name:ap.cardinality},deprecatedSyntax:{name:ap.deprecatedSyntax,defaultValue:!1},isMulti:{name:ap.isMulti,defaultValue:!1},terminal:{name:ap.terminal},type:{name:ap.type,referenceType:cc.$type}},superTypes:[Il.$type]},Disjunction:{name:jC.$type,properties:{left:{name:jC.left},right:{name:jC.right}},superTypes:[ip.$type]},EndOfFile:{name:rI.$type,properties:{cardinality:{name:rI.cardinality}},superTypes:[Il.$type]},Grammar:{name:lf.$type,properties:{imports:{name:lf.imports,defaultValue:[]},interfaces:{name:lf.interfaces,defaultValue:[]},isDeclared:{name:lf.isDeclared,defaultValue:!1},name:{name:lf.name},rules:{name:lf.rules,defaultValue:[]},types:{name:lf.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:nI.$type,properties:{path:{name:nI.path}},superTypes:[]},Group:{name:$m.$type,properties:{cardinality:{name:$m.cardinality},elements:{name:$m.elements,defaultValue:[]},guardCondition:{name:$m.guardCondition},predicate:{name:$m.predicate}},superTypes:[Il.$type]},InferredType:{name:iI.$type,properties:{name:{name:iI.name}},superTypes:[cc.$type]},InfixRule:{name:Lh.$type,properties:{call:{name:Lh.call},dataType:{name:Lh.dataType},inferredType:{name:Lh.inferredType},name:{name:Lh.name},operators:{name:Lh.operators},parameters:{name:Lh.parameters,defaultValue:[]},returnType:{name:Lh.returnType,referenceType:cc.$type}},superTypes:[GC.$type]},InfixRuleOperatorList:{name:XC.$type,properties:{associativity:{name:XC.associativity},operators:{name:XC.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:aI.$type,properties:{precedences:{name:aI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:U2.$type,properties:{attributes:{name:U2.attributes,defaultValue:[]},name:{name:U2.name},superTypes:{name:U2.superTypes,defaultValue:[],referenceType:cc.$type}},superTypes:[cc.$type]},Keyword:{name:Y2.$type,properties:{cardinality:{name:Y2.cardinality},predicate:{name:Y2.predicate},value:{name:Y2.value}},superTypes:[Il.$type]},NamedArgument:{name:j2.$type,properties:{calledByName:{name:j2.calledByName,defaultValue:!1},parameter:{name:j2.parameter,referenceType:X2.$type},value:{name:j2.value}},superTypes:[]},NegatedToken:{name:Nm.$type,properties:{cardinality:{name:Nm.cardinality},lookahead:{name:Nm.lookahead},parenthesized:{name:Nm.parenthesized,defaultValue:!1},terminal:{name:Nm.terminal}},superTypes:[$l.$type]},Negation:{name:sI.$type,properties:{value:{name:sI.value}},superTypes:[ip.$type]},NumberLiteral:{name:oI.$type,properties:{value:{name:oI.value}},superTypes:[Wm.$type]},Parameter:{name:X2.$type,properties:{name:{name:X2.name}},superTypes:[]},ParameterReference:{name:lI.$type,properties:{parameter:{name:lI.parameter,referenceType:X2.$type}},superTypes:[ip.$type]},ParserRule:{name:Cu.$type,properties:{dataType:{name:Cu.dataType},definition:{name:Cu.definition},entry:{name:Cu.entry,defaultValue:!1},fragment:{name:Cu.fragment,defaultValue:!1},inferredType:{name:Cu.inferredType},name:{name:Cu.name},parameters:{name:Cu.parameters,defaultValue:[]},returnType:{name:Cu.returnType,referenceType:cc.$type}},superTypes:[GC.$type]},ReferenceType:{name:KC.$type,properties:{isMulti:{name:KC.isMulti,defaultValue:!1},referenceType:{name:KC.referenceType}},superTypes:[Hm.$type]},RegexToken:{name:Dm.$type,properties:{cardinality:{name:Dm.cardinality},lookahead:{name:Dm.lookahead},parenthesized:{name:Dm.parenthesized,defaultValue:!1},regex:{name:Dm.regex}},superTypes:[$l.$type]},ReturnType:{name:cI.$type,properties:{name:{name:cI.name}},superTypes:[]},RuleCall:{name:Om.$type,properties:{arguments:{name:Om.arguments,defaultValue:[]},cardinality:{name:Om.cardinality},predicate:{name:Om.predicate},rule:{name:Om.rule,referenceType:G2.$type}},superTypes:[Il.$type]},SimpleType:{name:K2.$type,properties:{primitiveType:{name:K2.primitiveType},stringType:{name:K2.stringType},typeRef:{name:K2.typeRef,referenceType:cc.$type}},superTypes:[Hm.$type]},StringLiteral:{name:uI.$type,properties:{value:{name:uI.value}},superTypes:[Wm.$type]},TerminalAlternatives:{name:Pm.$type,properties:{cardinality:{name:Pm.cardinality},elements:{name:Pm.elements,defaultValue:[]},lookahead:{name:Pm.lookahead},parenthesized:{name:Pm.parenthesized,defaultValue:!1}},superTypes:[$l.$type]},TerminalElement:{name:$l.$type,properties:{cardinality:{name:$l.cardinality},lookahead:{name:$l.lookahead},parenthesized:{name:$l.parenthesized,defaultValue:!1}},superTypes:[Il.$type]},TerminalGroup:{name:Bm.$type,properties:{cardinality:{name:Bm.cardinality},elements:{name:Bm.elements,defaultValue:[]},lookahead:{name:Bm.lookahead},parenthesized:{name:Bm.parenthesized,defaultValue:!1}},superTypes:[$l.$type]},TerminalRule:{name:cf.$type,properties:{definition:{name:cf.definition},fragment:{name:cf.fragment,defaultValue:!1},hidden:{name:cf.hidden,defaultValue:!1},name:{name:cf.name},type:{name:cf.type}},superTypes:[G2.$type]},TerminalRuleCall:{name:Fm.$type,properties:{cardinality:{name:Fm.cardinality},lookahead:{name:Fm.lookahead},parenthesized:{name:Fm.parenthesized,defaultValue:!1},rule:{name:Fm.rule,referenceType:cf.$type}},superTypes:[$l.$type]},Type:{name:ZC.$type,properties:{name:{name:ZC.name},type:{name:ZC.type}},superTypes:[cc.$type]},TypeAttribute:{name:zm.$type,properties:{defaultValue:{name:zm.defaultValue},isOptional:{name:zm.isOptional,defaultValue:!1},name:{name:zm.name},type:{name:zm.type}},superTypes:[]},TypeDefinition:{name:Hm.$type,properties:{},superTypes:[]},UnionType:{name:hI.$type,properties:{types:{name:hI.types,defaultValue:[]}},superTypes:[Hm.$type]},UnorderedGroup:{name:QC.$type,properties:{cardinality:{name:QC.cardinality},elements:{name:QC.elements,defaultValue:[]}},superTypes:[Il.$type]},UntilToken:{name:Vm.$type,properties:{cardinality:{name:Vm.cardinality},lookahead:{name:Vm.lookahead},parenthesized:{name:Vm.parenthesized,defaultValue:!1},terminal:{name:Vm.terminal}},superTypes:[$l.$type]},ValueLiteral:{name:Wm.$type,properties:{},superTypes:[]},Wildcard:{name:Z2.$type,properties:{cardinality:{name:Z2.cardinality},lookahead:{name:Z2.lookahead},parenthesized:{name:Z2.parenthesized,defaultValue:!1}},superTypes:[$l.$type]}}}},R(Qb,"LangiumGrammarAstReflection"),Qb),Fr=new ste;function RIe(t){let e=t,r=!1;for(;e;){const n=jy(e.grammarSource,bl);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}R(RIe,"getDatatypeNode");function u3(t){return new s3(t,e=>Zf(e)?e.content:[],{includeRoot:!0})}R(u3,"streamCst");function _Ie(t){return u3(t).filter(Yy)}R(_Ie,"flattenCst");function ote(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}R(ote,"isChildNode");function A6(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}R(A6,"tokenToRange");function h3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}R(h3,"toDocumentSegment");var zh;(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"})(zh||(zh={}));function lte(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return zh.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linezh.After}R(cte,"inRange");var ute=/^[\w\p{L}]$/u;function MIe(t,e,r=ute){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return TD(t,e)}}R(MIe,"findDeclarationNodeAtOffset");function hte(t,e){if(t){const r=pte(t,!0);if(r&&dI(r,e))return r;if(gD(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(dI(a,e))return a}}}}R(hte,"findCommentNode");function dI(t,e){return Yy(t)&&e.includes(t.tokenType.name)}R(dI,"isCommentNode");function TD(t,e){if(Yy(t))return t;if(Zf(t)){const r=fte(t,e,!1);if(r)return TD(r,e)}}R(TD,"findLeafNodeAtOffset");function dte(t,e){if(Yy(t))return t;if(Zf(t)){const r=fte(t,e,!0);if(r)return dte(r,e)}}R(dte,"findLeafNodeBeforeOffset");function fte(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}R(fte,"binarySearch");function pte(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}}R(pte,"getPreviousNode");function LIe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nRte,findNameAssignment:()=>MD,findNodeForKeyword:()=>Ate,findNodeForProperty:()=>AD,findNodesForKeyword:()=>VIe,findNodesForKeywordInternal:()=>_D,findNodesForProperty:()=>Ete,getActionAtElement:()=>Mte,getActionType:()=>Ite,getAllReachableRules:()=>ED,getAllRulesUsedForCrossReferences:()=>HIe,getCrossReferenceTerminal:()=>Cte,getEntryRule:()=>wte,getExplicitRuleType:()=>r7,getHiddenRules:()=>Tte,getRuleType:()=>$te,getRuleTypeName:()=>YIe,getTypeName:()=>py,isArrayCardinality:()=>qIe,isArrayOperator:()=>GIe,isCommentTerminal:()=>Ste,isDataType:()=>UIe,isDataTypeRule:()=>t7,isOptionalCardinality:()=>WIe,terminalRegex:()=>n7});var Jb,kD=(Jb=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},R(Jb,"ErrorWithLocation"),Jb);function $g(t,e="Error: Got unexpected value."){throw new Error(e)}R($g,"assertUnreachable");function mte(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}R(mte,"assertCondition");var yte={};Ig(yte,{NEWLINE_REGEXP:()=>PIe,escapeRegExp:()=>tk,getTerminalParts:()=>FIe,isMultilineComment:()=>vte,isWhitespace:()=>SD,partialMatches:()=>bte,partialRegExp:()=>xte,whitespaceCharacters:()=>zIe});function Yr(t){return t.charCodeAt(0)}R(Yr,"cc");function GR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}R(GR,"insertToSet");function v2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}R(v2,"addFlag");function mm(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}R(mm,"ASSERT_EXISTS");function DIe(){throw Error("Internal Error - Should never get here!")}R(DIe,"ASSERT_NEVER_REACH_HERE");function gY(t){return t.type==="Character"}R(gY,"isCharacter");var fI=[];for(let t=Yr("0");t<=Yr("9");t++)fI.push(t);var pI=[Yr("_")].concat(fI);for(let t=Yr("a");t<=Yr("z");t++)pI.push(t);for(let t=Yr("A");t<=Yr("Z");t++)pI.push(t);var rge=[Yr(" "),Yr("\f"),Yr(` -`),Yr("\r"),Yr(" "),Yr("\v"),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr("\u2028"),Yr("\u2029"),Yr(" "),Yr(" "),Yr(" "),Yr("\uFEFF")],xYt=/[0-9a-fA-F]/,o8=/[0-9]/,wYt=/[1-9]/,ex,OIe=(ex=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":v2(n,"global");break;case"i":v2(n,"ignoreCase");break;case"m":v2(n,"multiLine");break;case"u":v2(n,"unicode");break;case"y":v2(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}}mm(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return DIe()}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;mm(r);break}if(!(e===!0&&r===void 0)&&mm(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()),mm(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Yr(` -`),Yr("\r"),Yr("\u2028"),Yr("\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=fI;break;case"D":e=fI,r=!0;break;case"s":e=rge;break;case"S":e=rge,r=!0;break;case"w":e=pI;break;case"W":e=pI,r=!0;break}if(mm(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Yr("\f");break;case"n":e=Yr(` +`)),Je){const Dt=_e.error?` Request failed: ${_e.error.message} (${_e.error.code}).`:"";Oe.log(`Received response '${Je.method} - (${_e.id})' in ${Date.now()-Je.timerStart}ms.${Dt}`,ut)}else Oe.log(`Received response ${_e.id} without active response promise.`,ut)}else ht("receive-response",_e)}R(wt,"traceReceivedResponse");function ht(_e,Je){if(!Oe||te===f.Off)return;const ut={isLSPMessage:!0,type:_e,message:Je,timestamp:Date.now()};Oe.log(ut)}R(ht,"logLSPMessage");function Bt(){if(fe())throw new x(v.Closed,"Connection is closed.");if(W())throw new x(v.Disposed,"Connection is disposed.")}R(Bt,"throwIfClosedOrDisposed");function At(){if(oe())throw new x(v.AlreadyListening,"Connection is already listening")}R(At,"throwIfListening");function mt(){if(!oe())throw new Error("Call listen() first.")}R(mt,"throwIfNotListening");function ye(_e){return _e===void 0?null:_e}R(ye,"undefinedToNull");function Nt(_e){if(_e!==null)return _e}R(Nt,"nullToUndefined");function yt(_e){return _e!=null&&!Array.isArray(_e)&&typeof _e=="object"}R(yt,"isNamedParam");function gt(_e,Je){switch(_e){case n.ParameterStructures.auto:return yt(Je)?Nt(Je):[ye(Je)];case n.ParameterStructures.byName:if(!yt(Je))throw new Error("Received parameters by name but param is not an object literal.");return Nt(Je);case n.ParameterStructures.byPosition:return[ye(Je)];default:throw new Error(`Unknown parameter structure ${_e.toString()}`)}}R(gt,"computeSingleParam");function St(_e,Je){let ut;const Dt=_e.numberOfParams;switch(Dt){case 0:ut=void 0;break;case 1:ut=gt(_e.parameterStructures,Je[0]);break;default:ut=[];for(let Kt=0;Kt{Bt();let ut,Dt;if(r.string(_e)){ut=_e;const Er=Je[0];let yr=0,qr=n.ParameterStructures.auto;n.ParameterStructures.is(Er)&&(yr=1,qr=Er);let kr=Je.length;const rn=kr-yr;switch(rn){case 0:Dt=void 0;break;case 1:Dt=gt(qr,Je[yr]);break;default:if(qr===n.ParameterStructures.byName)throw new Error(`Received ${rn} parameters for 'by Name' notification parameter structure.`);Dt=Je.slice(yr,kr).map(mr=>ye(mr));break}}else{const Er=Je;ut=_e.method,Dt=St(_e,Er)}const Kt={jsonrpc:V,method:ut,params:Dt};return Le(Kt),O.write(Kt).catch(Er=>{throw F.error("Sending notification failed."),Er})},"sendNotification"),onNotification:R((_e,Je)=>{Bt();let ut;return r.func(_e)?Q=_e:Je&&(r.string(_e)?(ut=_e,j.set(_e,{type:void 0,handler:Je})):(ut=_e.method,j.set(_e.method,{type:_e,handler:Je}))),{dispose:R(()=>{ut!==void 0?j.delete(ut):Q=void 0},"dispose")}},"onNotification"),onProgress:R((_e,Je,ut)=>{if(ae.has(Je))throw new Error(`Progress handler for token ${Je} already registered`);return ae.set(Je,ut),{dispose:R(()=>{ae.delete(Je)},"dispose")}},"onProgress"),sendProgress:R((_e,Je,ut)=>tn.sendNotification(u.type,{token:Je,value:ut}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:R((_e,...Je)=>{Bt(),mt();let ut,Dt,Kt;if(r.string(_e)){ut=_e;const kr=Je[0],rn=Je[Je.length-1];let mr=0,zr=n.ParameterStructures.auto;n.ParameterStructures.is(kr)&&(mr=1,zr=kr);let hn=Je.length;s.CancellationToken.is(rn)&&(hn=hn-1,Kt=rn);const st=hn-mr;switch(st){case 0:Dt=void 0;break;case 1:Dt=gt(zr,Je[mr]);break;default:if(zr===n.ParameterStructures.byName)throw new Error(`Received ${st} parameters for 'by Name' request parameter structure.`);Dt=Je.slice(mr,hn).map(vt=>ye(vt));break}}else{const kr=Je;ut=_e.method,Dt=St(_e,kr);const rn=_e.numberOfParams;Kt=s.CancellationToken.is(kr[rn])?kr[rn]:void 0}const Er=z++;let yr;Kt&&(yr=Kt.onCancellationRequested(()=>{const kr=we.sender.sendCancellation(tn,Er);return kr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${Er}`),Promise.resolve()):kr.catch(()=>{F.log(`Sending cancellation messages for id ${Er} failed`)})}));const qr={jsonrpc:V,id:Er,method:ut,params:Dt};return nt(qr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(qr),new Promise(async(kr,rn)=>{const mr=R(st=>{kr(st),we.sender.cleanup(Er),yr==null||yr.dispose()},"resolveWithCleanup"),zr=R(st=>{rn(st),we.sender.cleanup(Er),yr==null||yr.dispose()},"rejectWithCleanup"),hn={method:ut,timerStart:Date.now(),resolve:mr,reject:zr};try{await O.write(qr),re.set(Er,hn)}catch(st){throw F.error("Sending request failed."),hn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,st.message?st.message:"Unknown reason")),st}})},"sendRequest"),onRequest:R((_e,Je)=>{Bt();let ut=null;return d.is(_e)?(ut=void 0,q=_e):r.string(_e)?(ut=null,Je!==void 0&&(ut=_e,G.set(_e,{handler:Je,type:void 0}))):Je!==void 0&&(ut=_e.method,G.set(_e.method,{type:_e,handler:Je})),{dispose:R(()=>{ut!==null&&(ut!==void 0?G.delete(ut):q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:R(()=>re.size>0,"hasPendingResponse"),trace:R(async(_e,Je,ut)=>{let Dt=!1,Kt=g.Text;ut!==void 0&&(r.boolean(ut)?Dt=ut:(Dt=ut.sendNotification||!1,Kt=ut.traceFormat||g.Text)),te=_e,$e=Kt,te===f.Off?Oe=void 0:Oe=Je,Dt&&!fe()&&!W()&&await tn.sendNotification(m.type,{value:f.toString(_e)})},"trace"),onError:ue.event,onClose:ce.event,onUnhandledNotification:Te.event,onDispose:Ve.event,end:R(()=>{O.end()},"end"),dispose:R(()=>{if(W())return;He=L.Disposed,Ve.fire(void 0);const _e=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Je of re.values())Je.reject(_e);re=new Map,me=new Map,ee=new Set,J=new i.LinkedMap,r.func(O.dispose)&&O.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:R(()=>{Bt(),At(),He=L.Listening,I.listen(Ye)},"listen"),inspect:R(()=>{(0,e.default)().console.log("inspect")},"inspect")};return tn.onNotification(y.type,_e=>{if(te===f.Off||!Oe)return;const Je=te===f.Verbose||te===f.Compact;Oe.log(_e.message,Je?_e.verbose:void 0)}),tn.onNotification(u.type,_e=>{const Je=ae.get(_e.token);Je?Je(_e.value):ge.fire(_e)}),tn}R(P,"createMessageConnection"),t.createMessageConnection=P}}),gY=cn({"../../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=lIe();Object.defineProperty(t,"Message",{enumerable:!0,get:R(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:R(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:R(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:R(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:R(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:R(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:R(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:R(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:R(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:R(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:R(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:R(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:R(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:R(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:R(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:R(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:R(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:R(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:R(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:R(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:R(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:R(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:R(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:R(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:R(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:R(function(){return e.ParameterStructures},"get")});var r=cIe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:R(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:R(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:R(function(){return r.Touch},"get")});var n=YUt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:R(function(){return n.Disposable},"get")});var i=J3();Object.defineProperty(t,"Event",{enumerable:!0,get:R(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:R(function(){return i.Emitter},"get")});var a=mD();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:R(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:R(function(){return a.CancellationToken},"get")});var s=jUt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:R(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:R(function(){return s.SharedArrayReceiverStrategy},"get")});var o=XUt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:R(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:R(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:R(function(){return o.ReadableStreamMessageReader},"get")});var l=KUt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:R(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:R(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:R(function(){return l.WriteableStreamMessageWriter},"get")});var u=ZUt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:R(function(){return u.AbstractMessageBuffer},"get")});var h=QUt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:R(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:R(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:R(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:R(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:R(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:R(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:R(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:R(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:R(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:R(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:R(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:R(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:R(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:R(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:R(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:R(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:R(function(){return h.MessageStrategy},"get")});var d=Uy();t.RAL=d.default}}),JUt=cn({"../../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=gY(),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)}},R(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)}},R(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()}},R(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:R(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:R((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:R((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:R(d=>new n(d),"asReadableStream"),asWritableStream:R(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:R(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:R(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:R(()=>clearInterval(g),"dispose")}}})});function o(){return s}R(o,"RIL"),(function(d){function f(){e.RAL.install(s)}R(f,"install"),d.install=f})(o||(o={})),t.default=o}}),ek=cn({"../../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:R(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=JUt();n.default.install();var i=gY();r(gY(),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)}},R(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(){}},R(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)}R(o,"createMessageConnection"),t.createMessageConnection=o}}),rge=cn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=ek()}}),ga=cn({"../../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=ek(),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}},R(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},R(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},R(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},R(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},R(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),Pee=cn({"../../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}R(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}R(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}R(n,"number"),t.number=n;function i(h){return h instanceof Error}R(i,"error"),t.error=i;function a(h){return typeof h=="function"}R(a,"func"),t.func=a;function s(h){return Array.isArray(h)}R(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}R(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}R(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}R(u,"objectLiteral"),t.objectLiteral=u}}),eYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),tYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),rYt=cn({"../../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=ga(),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={}))}}),nYt=cn({"../../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=ga(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),iYt=cn({"../../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=ga(),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={}))}}),aYt=cn({"../../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=ga(),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={}))}}),sYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),oYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),lYt=cn({"../../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=ek(),r=ga(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}R(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={}))}}),cYt=cn({"../../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=ga(),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={}))}}),uYt=cn({"../../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=ga(),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={}))}}),hYt=cn({"../../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=ga(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),dYt=cn({"../../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=ga(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),fYt=cn({"../../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=ga(),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={}))}}),pYt=cn({"../../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=ga(),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={}))}}),gYt=cn({"../../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=ga(),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={}))}}),mYt=cn({"../../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=ga(),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={}))}}),yYt=cn({"../../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=ga(),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={}))}}),vYt=cn({"../../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=ek(),r=Pee(),n=ga(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}R(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={}))}}),bYt=cn({"../../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=(QE(),Oee(gD)),r=Pee(),n=ga(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}R(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(x,b){const T={executionOrder:x};return(b===!0||b===!1)&&(T.success=b),T}R(m,"create"),g.create=m;function y(x){const b=x;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}R(y,"is"),g.is=y;function v(x,b){return x===b?!0:x==null||b===null||b===void 0?!1:x.executionOrder===b.executionOrder&&x.success===b.success}R(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,T){return{kind:b,document:T}}R(m,"create"),g.create=m;function y(b){const T=b;return r.objectLiteral(T)&&i.is(T.kind)&&e.DocumentUri.is(T.document)&&(T.metadata===void 0||r.objectLiteral(T.metadata))}R(y,"is"),g.is=y;function v(b,T){const k=new Set;return b.document!==T.document&&k.add("document"),b.kind!==T.kind&&k.add("kind"),b.executionSummary!==T.executionSummary&&k.add("executionSummary"),(b.metadata!==void 0||T.metadata!==void 0)&&!x(b.metadata,T.metadata)&&k.add("metadata"),(b.executionSummary!==void 0||T.executionSummary!==void 0)&&!a.equals(b.executionSummary,T.executionSummary)&&k.add("executionSummary"),k}R(v,"diff"),g.diff=v;function x(b,T){if(b===T)return!0;if(b==null||T===null||T===void 0||typeof b!=typeof T||typeof b!="object")return!1;const k=Array.isArray(b),S=Array.isArray(T);if(k!==S)return!1;if(k&&S){if(b.length!==T.length)return!1;for(let C=0;C0}R(Nt,"hasId"),ye.hasId=Nt})($||(t.StaticRegistrationOptions=$={}));var F;(function(ye){function Nt(yt){const gt=yt;return gt&&(gt.documentSelector===null||P.is(gt.documentSelector))}R(Nt,"is"),ye.is=Nt})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(ye){function Nt(gt){const St=gt;return n.objectLiteral(St)&&(St.workDoneProgress===void 0||n.boolean(St.workDoneProgress))}R(Nt,"is"),ye.is=Nt;function yt(gt){const St=gt;return St&&n.boolean(St.workDoneProgress)}R(yt,"hasWorkDoneProgress"),ye.hasWorkDoneProgress=yt})(z||(t.WorkDoneProgressOptions=z={}));var H;(function(ye){ye.method="initialize",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(H||(t.InitializeRequest=H={}));var B;(function(ye){ye.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var V;(function(ye){ye.method="initialized",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(V||(t.InitializedNotification=V={}));var q;(function(ye){ye.method="shutdown",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType0(ye.method)})(q||(t.ShutdownRequest=q={}));var G;(function(ye){ye.method="exit",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType0(ye.method)})(G||(t.ExitNotification=G={}));var Q;(function(ye){ye.method="workspace/didChangeConfiguration",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(Q||(t.DidChangeConfigurationNotification=Q={}));var j;(function(ye){ye.Error=1,ye.Warning=2,ye.Info=3,ye.Log=4,ye.Debug=5})(j||(t.MessageType=j={}));var ae;(function(ye){ye.method="window/showMessage",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(ae||(t.ShowMessageNotification=ae={}));var Z;(function(ye){ye.method="window/showMessageRequest",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType(ye.method)})(Z||(t.ShowMessageRequest=Z={}));var J;(function(ye){ye.method="window/logMessage",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(J||(t.LogMessageNotification=J={}));var re;(function(ye){ye.method="telemetry/event",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(re||(t.TelemetryEventNotification=re={}));var ee;(function(ye){ye.None=0,ye.Full=1,ye.Incremental=2})(ee||(t.TextDocumentSyncKind=ee={}));var me;(function(ye){ye.method="textDocument/didOpen",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(ye){function Nt(gt){let St=gt;return St!=null&&typeof St.text=="string"&&St.range!==void 0&&(St.rangeLength===void 0||typeof St.rangeLength=="number")}R(Nt,"isIncremental"),ye.isIncremental=Nt;function yt(gt){let St=gt;return St!=null&&typeof St.text=="string"&&St.range===void 0&&St.rangeLength===void 0}R(yt,"isFull"),ye.isFull=yt})(te||(t.TextDocumentContentChangeEvent=te={}));var $e;(function(ye){ye.method="textDocument/didChange",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})($e||(t.DidChangeTextDocumentNotification=$e={}));var Oe;(function(ye){ye.method="textDocument/didClose",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(Oe||(t.DidCloseTextDocumentNotification=Oe={}));var He;(function(ye){ye.method="textDocument/didSave",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(He||(t.DidSaveTextDocumentNotification=He={}));var ue;(function(ye){ye.Manual=1,ye.AfterDelay=2,ye.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var ce;(function(ye){ye.method="textDocument/willSave",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(ce||(t.WillSaveTextDocumentNotification=ce={}));var Te;(function(ye){ye.method="textDocument/willSaveWaitUntil",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(ye){ye.method="workspace/didChangeWatchedFiles",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolNotificationType(ye.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var Ve;(function(ye){ye.Created=1,ye.Changed=2,ye.Deleted=3})(Ve||(t.FileChangeType=Ve={}));var we;(function(ye){function Nt(yt){const gt=yt;return n.objectLiteral(gt)&&(r.URI.is(gt.baseUri)||r.WorkspaceFolder.is(gt.baseUri))&&n.string(gt.pattern)}R(Nt,"is"),ye.is=Nt})(we||(t.RelativePattern=we={}));var Ae;(function(ye){ye.Create=1,ye.Change=2,ye.Delete=4})(Ae||(t.WatchKind=Ae={}));var Ue;(function(ye){ye.method="textDocument/publishDiagnostics",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolNotificationType(ye.method)})(Ue||(t.PublishDiagnosticsNotification=Ue={}));var le;(function(ye){ye.Invoked=1,ye.TriggerCharacter=2,ye.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(ye){ye.method="textDocument/completion",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(pe||(t.CompletionRequest=pe={}));var Ce;(function(ye){ye.method="completionItem/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ce||(t.CompletionResolveRequest=Ce={}));var oe;(function(ye){ye.method="textDocument/hover",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(oe||(t.HoverRequest=oe={}));var fe;(function(ye){ye.Invoked=1,ye.TriggerCharacter=2,ye.ContentChange=3})(fe||(t.SignatureHelpTriggerKind=fe={}));var W;(function(ye){ye.method="textDocument/signatureHelp",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(W||(t.SignatureHelpRequest=W={}));var se;(function(ye){ye.method="textDocument/definition",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(se||(t.DefinitionRequest=se={}));var K;(function(ye){ye.method="textDocument/references",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(K||(t.ReferencesRequest=K={}));var de;(function(ye){ye.method="textDocument/documentHighlight",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(de||(t.DocumentHighlightRequest=de={}));var X;(function(ye){ye.method="textDocument/documentSymbol",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(X||(t.DocumentSymbolRequest=X={}));var Fe;(function(ye){ye.method="textDocument/codeAction",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Fe||(t.CodeActionRequest=Fe={}));var ke;(function(ye){ye.method="codeAction/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ke||(t.CodeActionResolveRequest=ke={}));var Ye;(function(ye){ye.method="workspace/symbol",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ye||(t.WorkspaceSymbolRequest=Ye={}));var Ie;(function(ye){ye.method="workspaceSymbol/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ie||(t.WorkspaceSymbolResolveRequest=Ie={}));var ze;(function(ye){ye.method="textDocument/codeLens",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ze||(t.CodeLensRequest=ze={}));var De;(function(ye){ye.method="codeLens/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(De||(t.CodeLensResolveRequest=De={}));var Ke;(function(ye){ye.method="workspace/codeLens/refresh",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType0(ye.method)})(Ke||(t.CodeLensRefreshRequest=Ke={}));var Be;(function(ye){ye.method="textDocument/documentLink",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Be||(t.DocumentLinkRequest=Be={}));var nt;(function(ye){ye.method="documentLink/resolve",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(nt||(t.DocumentLinkResolveRequest=nt={}));var Le;(function(ye){ye.method="textDocument/formatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Le||(t.DocumentFormattingRequest=Le={}));var pt;(function(ye){ye.method="textDocument/rangeFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(pt||(t.DocumentRangeFormattingRequest=pt={}));var Me;(function(ye){ye.method="textDocument/rangesFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Me||(t.DocumentRangesFormattingRequest=Me={}));var Ct;(function(ye){ye.method="textDocument/onTypeFormatting",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Ct||(t.DocumentOnTypeFormattingRequest=Ct={}));var wt;(function(ye){ye.Identifier=1})(wt||(t.PrepareSupportDefaultBehavior=wt={}));var ht;(function(ye){ye.method="textDocument/rename",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(ht||(t.RenameRequest=ht={}));var Bt;(function(ye){ye.method="textDocument/prepareRename",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(Bt||(t.PrepareRenameRequest=Bt={}));var At;(function(ye){ye.method="workspace/executeCommand",ye.messageDirection=e.MessageDirection.clientToServer,ye.type=new e.ProtocolRequestType(ye.method)})(At||(t.ExecuteCommandRequest=At={}));var mt;(function(ye){ye.method="workspace/applyEdit",ye.messageDirection=e.MessageDirection.serverToClient,ye.type=new e.ProtocolRequestType("workspace/applyEdit")})(mt||(t.ApplyWorkspaceEditRequest=mt={}))}}),TYt=cn({"../../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=ek();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}R(r,"createProtocolConnection"),t.createProtocolConnection=r}}),kYt=cn({"../../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:R(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(ek(),t),r((QE(),Oee(gD)),t),r(ga(),t),r(wYt(),t);var n=TYt();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:R(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={}))}}),CYt=cn({"../../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:R(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=rge();r(rge(),t),r(kYt(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}R(i,"createProtocolConnection"),t.createProtocolConnection=i}}),hIe={};Ig(hIe,{AbstractAstReflection:()=>zee,AbstractCstNode:()=>Vre,AbstractLangiumParser:()=>qre,AbstractParserErrorMessageProvider:()=>QHe,AbstractThreadedAsyncParser:()=>jir,AstUtils:()=>Hee,BiMap:()=>DI,Cancellation:()=>Ai,CompositeCstNodeImpl:()=>dO,ContextCache:()=>bO,CstNodeBuilder:()=>XHe,CstUtils:()=>Bee,DEFAULT_TOKENIZE_OPTIONS:()=>lne,DONE_RESULT:()=>el,DatatypeSymbol:()=>LI,DefaultAstNodeDescriptionProvider:()=>RVe,DefaultAstNodeLocator:()=>MVe,DefaultAsyncParser:()=>jVe,DefaultCommentProvider:()=>YVe,DefaultConfigurationProvider:()=>LVe,DefaultDocumentBuilder:()=>IVe,DefaultDocumentValidator:()=>AVe,DefaultHydrator:()=>KVe,DefaultIndexManager:()=>$Ve,DefaultJsonSerializer:()=>kVe,DefaultLangiumDocumentFactory:()=>pVe,DefaultLangiumDocuments:()=>gVe,DefaultLangiumProfiler:()=>Jir,DefaultLexer:()=>cne,DefaultLexerErrorMessageProvider:()=>DVe,DefaultLinker:()=>mVe,DefaultNameProvider:()=>yVe,DefaultReferenceDescriptionProvider:()=>_Ve,DefaultReferences:()=>vVe,DefaultScopeComputation:()=>bVe,DefaultScopeProvider:()=>TVe,DefaultServiceRegistry:()=>CVe,DefaultTokenBuilder:()=>gO,DefaultValueConverter:()=>Zre,DefaultWorkspaceLock:()=>XVe,DefaultWorkspaceManager:()=>NVe,Deferred:()=>a0,Disposable:()=>_1,DisposableCache:()=>vO,DocumentCache:()=>wVe,DocumentState:()=>wn,DocumentValidator:()=>eu,EMPTY_SCOPE:()=>qir,EMPTY_STREAM:()=>a3,EmptyFileSystem:()=>vo,EmptyFileSystemProvider:()=>JVe,ErrorWithLocation:()=>SD,GrammarAST:()=>pIe,GrammarUtils:()=>yte,IndentationAwareLexer:()=>Kir,IndentationAwareTokenBuilder:()=>QVe,JSDocDocumentationProvider:()=>UVe,LangiumCompletionParser:()=>JHe,LangiumParser:()=>ZHe,LangiumParserErrorMessageProvider:()=>Gre,LeafCstNodeImpl:()=>MI,LexingMode:()=>d1,MapScope:()=>Wir,Module:()=>XY,MultiMap:()=>s0,MultiMapScope:()=>xVe,OperationCancelled:()=>jh,ParserWorker:()=>Xir,ProfilingTask:()=>tWe,Reduction:()=>A6,RefResolving:()=>bm,RegExpUtils:()=>bte,RootCstNodeImpl:()=>Wre,SimpleCache:()=>nne,StreamImpl:()=>Yh,StreamScope:()=>GY,TextDocument:()=>$I,TreeStreamImpl:()=>s3,URI:()=>wc,UriTrie:()=>tne,UriUtils:()=>hl,VALIDATE_EACH_NODE:()=>EVe,ValidationCategory:()=>OI,ValidationRegistry:()=>SVe,ValueConverter:()=>Ph,WorkspaceCache:()=>ine,assertCondition:()=>vte,assertUnreachable:()=>$g,createCompletionParser:()=>jre,createDefaultCoreModule:()=>zs,createDefaultSharedCoreModule:()=>Hs,createGrammarConfig:()=>Pte,createLangiumParser:()=>Xre,createParser:()=>fO,delayNextTick:()=>mO,diagnosticData:()=>h1,eagerLoad:()=>mne,getDiagnosticRange:()=>sne,indentationBuilderDefaultOptions:()=>ZY,inject:()=>Nn,interruptAndCheck:()=>Rs,isAstNode:()=>Xa,isAstNodeDescription:()=>Fee,isAstNodeWithComment:()=>ane,isCompositeCstNode:()=>Zf,isIMultiModeLexerDefinition:()=>TO,isJSDoc:()=>hne,isLeafCstNode:()=>Yy,isLinkingError:()=>Im,isMultiReference:()=>td,isNamed:()=>rne,isOperationCancelled:()=>dv,isReference:()=>ul,isRootCstNode:()=>yD,isTokenTypeArray:()=>wO,isTokenTypeDictionary:()=>PI,loadGrammarFromJson:()=>Vs,parseJSDoc:()=>une,prepareLangiumParser:()=>Kre,setInterruptionPeriod:()=>Qre,startCancelableOperation:()=>yO,stream:()=>si,toDiagnosticData:()=>one,toDiagnosticSeverity:()=>aS});var Bee={};Ig(Bee,{DefaultNameRegexp:()=>dte,RangeComparison:()=>Hh,compareRange:()=>ute,findCommentNode:()=>fte,findDeclarationNodeAtOffset:()=>$Ie,findLeafNodeAtOffset:()=>CD,findLeafNodeBeforeOffset:()=>pte,flattenCst:()=>IIe,getDatatypeNode:()=>LIe,getInteriorNodes:()=>OIe,getNextNode:()=>NIe,getPreviousNode:()=>mte,getStartlineNode:()=>DIe,inRange:()=>hte,isChildNode:()=>cte,isCommentNode:()=>pI,streamCst:()=>u3,toDocumentSegment:()=>h3,tokenToRange:()=>R6});function Xa(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}R(Xa,"isAstNode");function ul(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}R(ul,"isReference");function td(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}R(td,"isMultiReference");function Fee(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}R(Fee,"isAstNodeDescription");function Im(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}R(Im,"isLinkingError");var Kb,zee=(Kb=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 Xa(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}}},R(Kb,"AbstractAstReflection"),Kb);function Zf(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}R(Zf,"isCompositeCstNode");function Yy(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}R(Yy,"isLeafCstNode");function yD(t){return Zf(t)&&typeof t.fullText=="string"}R(yD,"isRootCstNode");var Ol,Yh=(Ol=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:R(()=>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 Ol(()=>({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 el})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=dIe(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 Ol(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?el:{done:!1,value:e(i)}})}filter(e){return new Ol(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return el})}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 Ol(()=>({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(E6(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return el})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new Ol(()=>({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(E6(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return el})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new Ol(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?el:this.nextFn(r.state)))}distinct(e){return new Ol(()=>({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 el})}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)})}},R(Ol,"StreamImpl"),Ol);function dIe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}R(dIe,"toString");function E6(t){return!!t&&typeof t[Symbol.iterator]=="function"}R(E6,"isIterable");var a3=new Yh(()=>{},()=>el),el=Object.freeze({done:!0,value:void 0});function si(...t){if(t.length===1){const e=t[0];if(e instanceof Yh)return e;if(E6(e))return new Yh(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Yh(()=>({index:0}),r=>r.index1?new Yh(()=>({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 el})}iterator(){const e={state:this.startFn(),next:R(()=>this.nextFn(e.state),"next"),prune:R(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},R(Zb,"TreeStreamImpl"),Zb),A6;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}R(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}R(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}R(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}R(i,"max"),t.max=i})(A6||(A6={}));var Hee={};Ig(Hee,{assignMandatoryProperties:()=>Vee,copyAstNode:()=>eI,findRootNode:()=>kb,getContainerOfType:()=>jy,getDocument:()=>Zu,getReferenceNodes:()=>QL,hasContainerOfType:()=>fIe,linkContentToContainer:()=>o3,streamAllContents:()=>T0,streamAst:()=>Qu,streamContents:()=>e7,streamReferences:()=>l3});function o3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xa(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&o3(i,e))}):Xa(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&o3(n,e)))}R(o3,"linkContentToContainer");function jy(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}R(jy,"getContainerOfType");function fIe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}R(fIe,"hasContainerOfType");function Zu(t){const r=kb(t).$document;if(!r)throw new Error("AST node has no document.");return r}R(Zu,"getDocument");function kb(t){for(;t.$container;)t=t.$container;return t}R(kb,"findRootNode");function QL(t){return ul(t)?t.ref?[t.ref]:[]:td(t)?t.items.map(e=>e.ref):[]}R(QL,"getReferenceNodes");function e7(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Yh(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexe7(r,e))}R(T0,"streamAllContents");function Qu(t,e){if(t){if(e!=null&&e.range&&!JL(t,e.range))return new s3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new s3(t,r=>e7(r,e),{includeRoot:!0})}R(Qu,"streamAst");function JL(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?hte(r,e):!1}R(JL,"isAstNodeInRange");function l3(t){return new Yh(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexIl,AbstractParserRule:()=>GC,AbstractRule:()=>G2,AbstractType:()=>lc,Action:()=>tp,Alternatives:()=>UC,ArrayLiteral:()=>tI,ArrayType:()=>rI,Assignment:()=>rp,BooleanLiteral:()=>nI,CharacterRange:()=>np,Condition:()=>ip,Conjunction:()=>YC,CrossReference:()=>ap,Disjunction:()=>jC,EndOfFile:()=>iI,Grammar:()=>lf,GrammarImport:()=>aI,Group:()=>$m,InferredType:()=>sI,InfixRule:()=>Ih,InfixRuleOperatorList:()=>XC,InfixRuleOperators:()=>oI,Interface:()=>U2,Keyword:()=>Y2,LangiumGrammarAstReflection:()=>lte,LangiumGrammarTerminals:()=>SYt,NamedArgument:()=>j2,NegatedToken:()=>Nm,Negation:()=>lI,NumberLiteral:()=>cI,Parameter:()=>X2,ParameterReference:()=>uI,ParserRule:()=>Cu,ReferenceType:()=>KC,RegexToken:()=>Dm,ReturnType:()=>hI,RuleCall:()=>Om,SimpleType:()=>K2,StringLiteral:()=>dI,TerminalAlternatives:()=>Pm,TerminalElement:()=>$l,TerminalGroup:()=>Bm,TerminalRule:()=>cf,TerminalRuleCall:()=>Fm,Type:()=>ZC,TypeAttribute:()=>zm,TypeDefinition:()=>Hm,UnionType:()=>fI,UnorderedGroup:()=>QC,UntilToken:()=>Vm,ValueLiteral:()=>Wm,Wildcard:()=>Z2,isAbstractElement:()=>vD,isAbstractParserRule:()=>Xy,isAbstractRule:()=>gIe,isAbstractType:()=>mIe,isAction:()=>sg,isAlternatives:()=>bD,isArrayLiteral:()=>yIe,isArrayType:()=>qee,isAssignment:()=>Qf,isBooleanLiteral:()=>Gee,isCharacterRange:()=>Uee,isCondition:()=>vIe,isConjunction:()=>Yee,isCrossReference:()=>Ky,isDisjunction:()=>jee,isEndOfFile:()=>Xee,isGrammar:()=>bIe,isGrammarImport:()=>xIe,isGroup:()=>Zy,isInferredType:()=>t7,isInfixRule:()=>c3,isInfixRuleOperatorList:()=>wIe,isInfixRuleOperators:()=>TIe,isInterface:()=>Kee,isKeyword:()=>Jf,isNamedArgument:()=>kIe,isNegatedToken:()=>Zee,isNegation:()=>Qee,isNumberLiteral:()=>CIe,isParameter:()=>SIe,isParameterReference:()=>Jee,isParserRule:()=>bl,isReferenceType:()=>ete,isRegexToken:()=>tte,isReturnType:()=>rte,isRuleCall:()=>e0,isSimpleType:()=>xD,isStringLiteral:()=>EIe,isTerminalAlternatives:()=>nte,isTerminalElement:()=>AIe,isTerminalGroup:()=>ite,isTerminalRule:()=>vu,isTerminalRuleCall:()=>wD,isType:()=>TD,isTypeAttribute:()=>RIe,isTypeDefinition:()=>_Ie,isUnionType:()=>ate,isUnorderedGroup:()=>kD,isUntilToken:()=>ste,isValueLiteral:()=>MIe,isWildcard:()=>ote,reflection:()=>Fr});var SYt={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]*/},Il={$type:"AbstractElement",cardinality:"cardinality"};function vD(t){return Fr.isInstance(t,Il.$type)}R(vD,"isAbstractElement");var GC={$type:"AbstractParserRule"};function Xy(t){return Fr.isInstance(t,GC.$type)}R(Xy,"isAbstractParserRule");var G2={$type:"AbstractRule"};function gIe(t){return Fr.isInstance(t,G2.$type)}R(gIe,"isAbstractRule");var lc={$type:"AbstractType"};function mIe(t){return Fr.isInstance(t,lc.$type)}R(mIe,"isAbstractType");var tp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function sg(t){return Fr.isInstance(t,tp.$type)}R(sg,"isAction");var UC={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function bD(t){return Fr.isInstance(t,UC.$type)}R(bD,"isAlternatives");var tI={$type:"ArrayLiteral",elements:"elements"};function yIe(t){return Fr.isInstance(t,tI.$type)}R(yIe,"isArrayLiteral");var rI={$type:"ArrayType",elementType:"elementType"};function qee(t){return Fr.isInstance(t,rI.$type)}R(qee,"isArrayType");var rp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Qf(t){return Fr.isInstance(t,rp.$type)}R(Qf,"isAssignment");var nI={$type:"BooleanLiteral",true:"true"};function Gee(t){return Fr.isInstance(t,nI.$type)}R(Gee,"isBooleanLiteral");var np={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Uee(t){return Fr.isInstance(t,np.$type)}R(Uee,"isCharacterRange");var ip={$type:"Condition"};function vIe(t){return Fr.isInstance(t,ip.$type)}R(vIe,"isCondition");var YC={$type:"Conjunction",left:"left",right:"right"};function Yee(t){return Fr.isInstance(t,YC.$type)}R(Yee,"isConjunction");var ap={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Ky(t){return Fr.isInstance(t,ap.$type)}R(Ky,"isCrossReference");var jC={$type:"Disjunction",left:"left",right:"right"};function jee(t){return Fr.isInstance(t,jC.$type)}R(jee,"isDisjunction");var iI={$type:"EndOfFile",cardinality:"cardinality"};function Xee(t){return Fr.isInstance(t,iI.$type)}R(Xee,"isEndOfFile");var lf={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function bIe(t){return Fr.isInstance(t,lf.$type)}R(bIe,"isGrammar");var aI={$type:"GrammarImport",path:"path"};function xIe(t){return Fr.isInstance(t,aI.$type)}R(xIe,"isGrammarImport");var $m={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Zy(t){return Fr.isInstance(t,$m.$type)}R(Zy,"isGroup");var sI={$type:"InferredType",name:"name"};function t7(t){return Fr.isInstance(t,sI.$type)}R(t7,"isInferredType");var Ih={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function c3(t){return Fr.isInstance(t,Ih.$type)}R(c3,"isInfixRule");var XC={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function wIe(t){return Fr.isInstance(t,XC.$type)}R(wIe,"isInfixRuleOperatorList");var oI={$type:"InfixRuleOperators",precedences:"precedences"};function TIe(t){return Fr.isInstance(t,oI.$type)}R(TIe,"isInfixRuleOperators");var U2={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Kee(t){return Fr.isInstance(t,U2.$type)}R(Kee,"isInterface");var Y2={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Jf(t){return Fr.isInstance(t,Y2.$type)}R(Jf,"isKeyword");var j2={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function kIe(t){return Fr.isInstance(t,j2.$type)}R(kIe,"isNamedArgument");var Nm={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Zee(t){return Fr.isInstance(t,Nm.$type)}R(Zee,"isNegatedToken");var lI={$type:"Negation",value:"value"};function Qee(t){return Fr.isInstance(t,lI.$type)}R(Qee,"isNegation");var cI={$type:"NumberLiteral",value:"value"};function CIe(t){return Fr.isInstance(t,cI.$type)}R(CIe,"isNumberLiteral");var X2={$type:"Parameter",name:"name"};function SIe(t){return Fr.isInstance(t,X2.$type)}R(SIe,"isParameter");var uI={$type:"ParameterReference",parameter:"parameter"};function Jee(t){return Fr.isInstance(t,uI.$type)}R(Jee,"isParameterReference");var Cu={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function bl(t){return Fr.isInstance(t,Cu.$type)}R(bl,"isParserRule");var KC={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function ete(t){return Fr.isInstance(t,KC.$type)}R(ete,"isReferenceType");var Dm={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function tte(t){return Fr.isInstance(t,Dm.$type)}R(tte,"isRegexToken");var hI={$type:"ReturnType",name:"name"};function rte(t){return Fr.isInstance(t,hI.$type)}R(rte,"isReturnType");var Om={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function e0(t){return Fr.isInstance(t,Om.$type)}R(e0,"isRuleCall");var K2={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function xD(t){return Fr.isInstance(t,K2.$type)}R(xD,"isSimpleType");var dI={$type:"StringLiteral",value:"value"};function EIe(t){return Fr.isInstance(t,dI.$type)}R(EIe,"isStringLiteral");var Pm={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function nte(t){return Fr.isInstance(t,Pm.$type)}R(nte,"isTerminalAlternatives");var $l={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function AIe(t){return Fr.isInstance(t,$l.$type)}R(AIe,"isTerminalElement");var Bm={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function ite(t){return Fr.isInstance(t,Bm.$type)}R(ite,"isTerminalGroup");var cf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function vu(t){return Fr.isInstance(t,cf.$type)}R(vu,"isTerminalRule");var Fm={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function wD(t){return Fr.isInstance(t,Fm.$type)}R(wD,"isTerminalRuleCall");var ZC={$type:"Type",name:"name",type:"type"};function TD(t){return Fr.isInstance(t,ZC.$type)}R(TD,"isType");var zm={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function RIe(t){return Fr.isInstance(t,zm.$type)}R(RIe,"isTypeAttribute");var Hm={$type:"TypeDefinition"};function _Ie(t){return Fr.isInstance(t,Hm.$type)}R(_Ie,"isTypeDefinition");var fI={$type:"UnionType",types:"types"};function ate(t){return Fr.isInstance(t,fI.$type)}R(ate,"isUnionType");var QC={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function kD(t){return Fr.isInstance(t,QC.$type)}R(kD,"isUnorderedGroup");var Vm={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ste(t){return Fr.isInstance(t,Vm.$type)}R(ste,"isUntilToken");var Wm={$type:"ValueLiteral"};function MIe(t){return Fr.isInstance(t,Wm.$type)}R(MIe,"isValueLiteral");var Z2={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ote(t){return Fr.isInstance(t,Z2.$type)}R(ote,"isWildcard");var Qb,lte=(Qb=class extends zee{constructor(){super(...arguments),this.types={AbstractElement:{name:Il.$type,properties:{cardinality:{name:Il.cardinality}},superTypes:[]},AbstractParserRule:{name:GC.$type,properties:{},superTypes:[G2.$type,lc.$type]},AbstractRule:{name:G2.$type,properties:{},superTypes:[]},AbstractType:{name:lc.$type,properties:{},superTypes:[]},Action:{name:tp.$type,properties:{cardinality:{name:tp.cardinality},feature:{name:tp.feature},inferredType:{name:tp.inferredType},operator:{name:tp.operator},type:{name:tp.type,referenceType:lc.$type}},superTypes:[Il.$type]},Alternatives:{name:UC.$type,properties:{cardinality:{name:UC.cardinality},elements:{name:UC.elements,defaultValue:[]}},superTypes:[Il.$type]},ArrayLiteral:{name:tI.$type,properties:{elements:{name:tI.elements,defaultValue:[]}},superTypes:[Wm.$type]},ArrayType:{name:rI.$type,properties:{elementType:{name:rI.elementType}},superTypes:[Hm.$type]},Assignment:{name:rp.$type,properties:{cardinality:{name:rp.cardinality},feature:{name:rp.feature},operator:{name:rp.operator},predicate:{name:rp.predicate},terminal:{name:rp.terminal}},superTypes:[Il.$type]},BooleanLiteral:{name:nI.$type,properties:{true:{name:nI.true,defaultValue:!1}},superTypes:[ip.$type,Wm.$type]},CharacterRange:{name:np.$type,properties:{cardinality:{name:np.cardinality},left:{name:np.left},lookahead:{name:np.lookahead},parenthesized:{name:np.parenthesized,defaultValue:!1},right:{name:np.right}},superTypes:[$l.$type]},Condition:{name:ip.$type,properties:{},superTypes:[]},Conjunction:{name:YC.$type,properties:{left:{name:YC.left},right:{name:YC.right}},superTypes:[ip.$type]},CrossReference:{name:ap.$type,properties:{cardinality:{name:ap.cardinality},deprecatedSyntax:{name:ap.deprecatedSyntax,defaultValue:!1},isMulti:{name:ap.isMulti,defaultValue:!1},terminal:{name:ap.terminal},type:{name:ap.type,referenceType:lc.$type}},superTypes:[Il.$type]},Disjunction:{name:jC.$type,properties:{left:{name:jC.left},right:{name:jC.right}},superTypes:[ip.$type]},EndOfFile:{name:iI.$type,properties:{cardinality:{name:iI.cardinality}},superTypes:[Il.$type]},Grammar:{name:lf.$type,properties:{imports:{name:lf.imports,defaultValue:[]},interfaces:{name:lf.interfaces,defaultValue:[]},isDeclared:{name:lf.isDeclared,defaultValue:!1},name:{name:lf.name},rules:{name:lf.rules,defaultValue:[]},types:{name:lf.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:aI.$type,properties:{path:{name:aI.path}},superTypes:[]},Group:{name:$m.$type,properties:{cardinality:{name:$m.cardinality},elements:{name:$m.elements,defaultValue:[]},guardCondition:{name:$m.guardCondition},predicate:{name:$m.predicate}},superTypes:[Il.$type]},InferredType:{name:sI.$type,properties:{name:{name:sI.name}},superTypes:[lc.$type]},InfixRule:{name:Ih.$type,properties:{call:{name:Ih.call},dataType:{name:Ih.dataType},inferredType:{name:Ih.inferredType},name:{name:Ih.name},operators:{name:Ih.operators},parameters:{name:Ih.parameters,defaultValue:[]},returnType:{name:Ih.returnType,referenceType:lc.$type}},superTypes:[GC.$type]},InfixRuleOperatorList:{name:XC.$type,properties:{associativity:{name:XC.associativity},operators:{name:XC.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:oI.$type,properties:{precedences:{name:oI.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:U2.$type,properties:{attributes:{name:U2.attributes,defaultValue:[]},name:{name:U2.name},superTypes:{name:U2.superTypes,defaultValue:[],referenceType:lc.$type}},superTypes:[lc.$type]},Keyword:{name:Y2.$type,properties:{cardinality:{name:Y2.cardinality},predicate:{name:Y2.predicate},value:{name:Y2.value}},superTypes:[Il.$type]},NamedArgument:{name:j2.$type,properties:{calledByName:{name:j2.calledByName,defaultValue:!1},parameter:{name:j2.parameter,referenceType:X2.$type},value:{name:j2.value}},superTypes:[]},NegatedToken:{name:Nm.$type,properties:{cardinality:{name:Nm.cardinality},lookahead:{name:Nm.lookahead},parenthesized:{name:Nm.parenthesized,defaultValue:!1},terminal:{name:Nm.terminal}},superTypes:[$l.$type]},Negation:{name:lI.$type,properties:{value:{name:lI.value}},superTypes:[ip.$type]},NumberLiteral:{name:cI.$type,properties:{value:{name:cI.value}},superTypes:[Wm.$type]},Parameter:{name:X2.$type,properties:{name:{name:X2.name}},superTypes:[]},ParameterReference:{name:uI.$type,properties:{parameter:{name:uI.parameter,referenceType:X2.$type}},superTypes:[ip.$type]},ParserRule:{name:Cu.$type,properties:{dataType:{name:Cu.dataType},definition:{name:Cu.definition},entry:{name:Cu.entry,defaultValue:!1},fragment:{name:Cu.fragment,defaultValue:!1},inferredType:{name:Cu.inferredType},name:{name:Cu.name},parameters:{name:Cu.parameters,defaultValue:[]},returnType:{name:Cu.returnType,referenceType:lc.$type}},superTypes:[GC.$type]},ReferenceType:{name:KC.$type,properties:{isMulti:{name:KC.isMulti,defaultValue:!1},referenceType:{name:KC.referenceType}},superTypes:[Hm.$type]},RegexToken:{name:Dm.$type,properties:{cardinality:{name:Dm.cardinality},lookahead:{name:Dm.lookahead},parenthesized:{name:Dm.parenthesized,defaultValue:!1},regex:{name:Dm.regex}},superTypes:[$l.$type]},ReturnType:{name:hI.$type,properties:{name:{name:hI.name}},superTypes:[]},RuleCall:{name:Om.$type,properties:{arguments:{name:Om.arguments,defaultValue:[]},cardinality:{name:Om.cardinality},predicate:{name:Om.predicate},rule:{name:Om.rule,referenceType:G2.$type}},superTypes:[Il.$type]},SimpleType:{name:K2.$type,properties:{primitiveType:{name:K2.primitiveType},stringType:{name:K2.stringType},typeRef:{name:K2.typeRef,referenceType:lc.$type}},superTypes:[Hm.$type]},StringLiteral:{name:dI.$type,properties:{value:{name:dI.value}},superTypes:[Wm.$type]},TerminalAlternatives:{name:Pm.$type,properties:{cardinality:{name:Pm.cardinality},elements:{name:Pm.elements,defaultValue:[]},lookahead:{name:Pm.lookahead},parenthesized:{name:Pm.parenthesized,defaultValue:!1}},superTypes:[$l.$type]},TerminalElement:{name:$l.$type,properties:{cardinality:{name:$l.cardinality},lookahead:{name:$l.lookahead},parenthesized:{name:$l.parenthesized,defaultValue:!1}},superTypes:[Il.$type]},TerminalGroup:{name:Bm.$type,properties:{cardinality:{name:Bm.cardinality},elements:{name:Bm.elements,defaultValue:[]},lookahead:{name:Bm.lookahead},parenthesized:{name:Bm.parenthesized,defaultValue:!1}},superTypes:[$l.$type]},TerminalRule:{name:cf.$type,properties:{definition:{name:cf.definition},fragment:{name:cf.fragment,defaultValue:!1},hidden:{name:cf.hidden,defaultValue:!1},name:{name:cf.name},type:{name:cf.type}},superTypes:[G2.$type]},TerminalRuleCall:{name:Fm.$type,properties:{cardinality:{name:Fm.cardinality},lookahead:{name:Fm.lookahead},parenthesized:{name:Fm.parenthesized,defaultValue:!1},rule:{name:Fm.rule,referenceType:cf.$type}},superTypes:[$l.$type]},Type:{name:ZC.$type,properties:{name:{name:ZC.name},type:{name:ZC.type}},superTypes:[lc.$type]},TypeAttribute:{name:zm.$type,properties:{defaultValue:{name:zm.defaultValue},isOptional:{name:zm.isOptional,defaultValue:!1},name:{name:zm.name},type:{name:zm.type}},superTypes:[]},TypeDefinition:{name:Hm.$type,properties:{},superTypes:[]},UnionType:{name:fI.$type,properties:{types:{name:fI.types,defaultValue:[]}},superTypes:[Hm.$type]},UnorderedGroup:{name:QC.$type,properties:{cardinality:{name:QC.cardinality},elements:{name:QC.elements,defaultValue:[]}},superTypes:[Il.$type]},UntilToken:{name:Vm.$type,properties:{cardinality:{name:Vm.cardinality},lookahead:{name:Vm.lookahead},parenthesized:{name:Vm.parenthesized,defaultValue:!1},terminal:{name:Vm.terminal}},superTypes:[$l.$type]},ValueLiteral:{name:Wm.$type,properties:{},superTypes:[]},Wildcard:{name:Z2.$type,properties:{cardinality:{name:Z2.cardinality},lookahead:{name:Z2.lookahead},parenthesized:{name:Z2.parenthesized,defaultValue:!1}},superTypes:[$l.$type]}}}},R(Qb,"LangiumGrammarAstReflection"),Qb),Fr=new lte;function LIe(t){let e=t,r=!1;for(;e;){const n=jy(e.grammarSource,bl);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}R(LIe,"getDatatypeNode");function u3(t){return new s3(t,e=>Zf(e)?e.content:[],{includeRoot:!0})}R(u3,"streamCst");function IIe(t){return u3(t).filter(Yy)}R(IIe,"flattenCst");function cte(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}R(cte,"isChildNode");function R6(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}R(R6,"tokenToRange");function h3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}R(h3,"toDocumentSegment");var Hh;(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"})(Hh||(Hh={}));function ute(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Hh.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineHh.After}R(hte,"inRange");var dte=/^[\w\p{L}]$/u;function $Ie(t,e,r=dte){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return CD(t,e)}}R($Ie,"findDeclarationNodeAtOffset");function fte(t,e){if(t){const r=mte(t,!0);if(r&&pI(r,e))return r;if(yD(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(pI(a,e))return a}}}}R(fte,"findCommentNode");function pI(t,e){return Yy(t)&&e.includes(t.tokenType.name)}R(pI,"isCommentNode");function CD(t,e){if(Yy(t))return t;if(Zf(t)){const r=gte(t,e,!1);if(r)return CD(r,e)}}R(CD,"findLeafNodeAtOffset");function pte(t,e){if(Yy(t))return t;if(Zf(t)){const r=gte(t,e,!0);if(r)return pte(r,e)}}R(pte,"findLeafNodeBeforeOffset");function gte(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}R(gte,"binarySearch");function mte(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}}R(mte,"getPreviousNode");function NIe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nMte,findNameAssignment:()=>ID,findNodeForKeyword:()=>_te,findNodeForProperty:()=>_D,findNodesForKeyword:()=>GIe,findNodesForKeywordInternal:()=>LD,findNodesForProperty:()=>Rte,getActionAtElement:()=>Ite,getActionType:()=>Nte,getAllReachableRules:()=>RD,getAllRulesUsedForCrossReferences:()=>qIe,getCrossReferenceTerminal:()=>Ete,getEntryRule:()=>kte,getExplicitRuleType:()=>n7,getHiddenRules:()=>Cte,getRuleType:()=>Dte,getRuleTypeName:()=>KIe,getTypeName:()=>py,isArrayCardinality:()=>YIe,isArrayOperator:()=>jIe,isCommentTerminal:()=>Ate,isDataType:()=>XIe,isDataTypeRule:()=>r7,isOptionalCardinality:()=>UIe,terminalRegex:()=>i7});var Jb,SD=(Jb=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},R(Jb,"ErrorWithLocation"),Jb);function $g(t,e="Error: Got unexpected value."){throw new Error(e)}R($g,"assertUnreachable");function vte(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}R(vte,"assertCondition");var bte={};Ig(bte,{NEWLINE_REGEXP:()=>zIe,escapeRegExp:()=>tk,getTerminalParts:()=>VIe,isMultilineComment:()=>xte,isWhitespace:()=>AD,partialMatches:()=>wte,partialRegExp:()=>Tte,whitespaceCharacters:()=>WIe});function Yr(t){return t.charCodeAt(0)}R(Yr,"cc");function UR(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}R(UR,"insertToSet");function v2(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}R(v2,"addFlag");function mm(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}R(mm,"ASSERT_EXISTS");function BIe(){throw Error("Internal Error - Should never get here!")}R(BIe,"ASSERT_NEVER_REACH_HERE");function yY(t){return t.type==="Character"}R(yY,"isCharacter");var gI=[];for(let t=Yr("0");t<=Yr("9");t++)gI.push(t);var mI=[Yr("_")].concat(gI);for(let t=Yr("a");t<=Yr("z");t++)mI.push(t);for(let t=Yr("A");t<=Yr("Z");t++)mI.push(t);var nge=[Yr(" "),Yr("\f"),Yr(` +`),Yr("\r"),Yr(" "),Yr("\v"),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr(" "),Yr("\u2028"),Yr("\u2029"),Yr(" "),Yr(" "),Yr(" "),Yr("\uFEFF")],EYt=/[0-9a-fA-F]/,l8=/[0-9]/,AYt=/[1-9]/,ex,FIe=(ex=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":v2(n,"global");break;case"i":v2(n,"ignoreCase");break;case"m":v2(n,"multiLine");break;case"u":v2(n,"unicode");break;case"y":v2(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}}mm(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return BIe()}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;mm(r);break}if(!(e===!0&&r===void 0)&&mm(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()),mm(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Yr(` +`),Yr("\r"),Yr("\u2028"),Yr("\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=gI;break;case"D":e=gI,r=!0;break;case"s":e=nge;break;case"S":e=nge,r=!0;break;case"w":e=mI;break;case"W":e=mI,r=!0;break}if(mm(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Yr("\f");break;case"n":e=Yr(` `);break;case"r":e=Yr("\r");break;case"t":e=Yr(" ");break;case"v":e=Yr("\v");break}if(mm(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:Yr("\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:Yr(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:Yr(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,gY(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,gY(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},R(ex,"RegExpParser"),ex),tx,CD=(tx=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){}},R(tx,"BaseRegExpVisitor"),tx),PIe=/\r?\n/gm,BIe=new OIe,rx,TYt=(rx=class extends CD{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}}},R(ex,"RegExpParser"),ex),tx,ED=(tx=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){}},R(tx,"BaseRegExpVisitor"),tx),zIe=/\r?\n/gm,HIe=new FIe,rx,RYt=(rx=class extends ED{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=tk(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)}},R(rx,"TerminalRegExpVisitor"),rx),c1=new TYt;function FIe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=BIe.pattern(t),r=[];for(const n of e.value.value)c1.reset(t),c1.visit(n),r.push({start:c1.startRegexp,end:c1.endRegex});return r}catch{return[]}}R(FIe,"getTerminalParts");function vte(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),c1.reset(t),c1.visit(BIe.pattern(t)),c1.multiline}catch{return!1}}R(vte,"isMultilineComment");var zIe=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function SD(t){const e=typeof t=="string"?new RegExp(t):t;return zIe.some(r=>e.test(r))}R(SD,"isWhitespace");function tk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}R(tk,"escapeRegExp");function bte(t,e){const r=xte(t),n=e.match(r);return!!n&&n[0].length>0}R(bte,"partialMatches");function xte(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}R(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(R(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 R(i,"process"),new RegExp(i(),t.flags)}R(xte,"partialRegExp");function wte(t){return t.rules.find(e=>bl(e)&&e.entry)}R(wte,"getEntryRule");function Tte(t){return t.rules.filter(e=>vu(e)&&e.hidden)}R(Tte,"getHiddenRules");function ED(t,e){const r=new Set,n=wte(t);if(!n)return new Set(t.rules);const i=[n].concat(Tte(t));for(const s of i)kte(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||vu(s)&&s.hidden)&&a.add(s);return a}R(ED,"getAllReachableRules");function kte(t,e,r){e.add(t.name),T0(t).forEach(n=>{if(e0(n)||r&&bD(n)){const i=n.rule.ref;i&&!e.has(i.name)&&kte(i,e,r)}})}R(kte,"ruleDfs");function HIe(t){const e=new Set;return T0(t).forEach(r=>{Ky(r)&&(bl(r.type.ref)&&e.add(r.type.ref),e7(r.type.ref)&&bl(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}R(HIe,"getAllRulesUsedForCrossReferences");function Cte(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=MD(t.type.ref);return e==null?void 0:e.terminal}}R(Cte,"getCrossReferenceTerminal");function Ste(t){return t.hidden&&!SD(n7(t))}R(Ste,"isCommentTerminal");function Ete(t,e){return!t||!e?[]:RD(t,e,t.astNode,!0)}R(Ete,"findNodesForProperty");function AD(t,e,r){if(!t||!e)return;const n=RD(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]}R(AD,"findNodeForProperty");function RD(t,e,r,n){if(!n){const i=jy(t.grammarSource,Qf);if(i&&i.feature===e)return[t]}return Zf(t)&&t.astNode===r?t.content.flatMap(i=>RD(i,e,r,!1)):[]}R(RD,"findNodesForPropertyInternal");function VIe(t,e){return t?_D(t,e,t==null?void 0:t.astNode):[]}R(VIe,"findNodesForKeyword");function Ate(t,e,r){if(!t)return;const n=_D(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]}R(Ate,"findNodeForKeyword");function _D(t,e,r){if(t.astNode!==r)return[];if(Jf(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=u3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Jf(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}R(_D,"findNodesForKeywordInternal");function Rte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=jy(t.grammarSource,Qf);if(n)return n;t=t.container}}R(Rte,"findAssignment");function MD(t){let e=t;return e7(e)&&(sg(e.$container)?e=e.$container.$container:Xy(e.$container)?e=e.$container:$g(e.$container)),_te(t,e,new Map)}R(MD,"findNameAssignment");function _te(t,e,r){var i;function n(a,s){let o;return jy(a,Qf)||(o=_te(s,s,r)),r.set(t,o),o}if(R(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of T0(e)){if(Qf(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(e0(a)&&bl(a.rule.ref))return n(a,a.rule.ref);if(vD(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}R(_te,"findNameAssignmentInternal");function Mte(t){const e=t.$container;if(Zy(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(sg(a))return a;{const s=T0(r[i]).find(sg);if(s)return s}}}if(mD(e))return Mte(e)}R(Mte,"getActionAtElement");function WIe(t,e){return t==="?"||t==="*"||Zy(e)&&!!e.guardCondition}R(WIe,"isOptionalCardinality");function qIe(t){return t==="*"||t==="+"}R(qIe,"isArrayCardinality");function GIe(t){return t==="+="}R(GIe,"isArrayOperator");function t7(t){return Lte(t,new Set)}R(t7,"isDataTypeRule");function Lte(t,e){if(e.has(t))return!0;e.add(t);for(const r of T0(t))if(e0(r)){if(!r.rule.ref||bl(r.rule.ref)&&!Lte(r.rule.ref,e)||c3(r.rule.ref))return!1}else{if(Qf(r))return!1;if(sg(r))return!1}return!!t.definition}R(Lte,"isDataTypeRuleInternal");function UIe(t){return gI(t.type,new Set)}R(UIe,"isDataType");function gI(t,e){if(e.has(t))return!0;if(e.add(t),Vee(t))return!1;if(Qee(t))return!1;if(nte(t))return t.types.every(r=>gI(r,e));if(vD(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 xD(r)?gI(r.type,e):!1}else return!1}else return!1}R(gI,"isDataTypeInternal");function r7(t){if(!vu(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}}}R(r7,"getExplicitRuleType");function py(t){if(Xy(t))return bl(t)&&t7(t)?t.name:r7(t)??t.name;if(jee(t)||xD(t)||ete(t))return t.name;if(sg(t)){const e=Ite(t);if(e)return e}else if(e7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}R(py,"getTypeName");function Ite(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return py(t.type.ref)}R(Ite,"getActionType");function YIe(t){var e;return vu(t)?((e=t.type)==null?void 0:e.name)??"string":bl(t)&&t7(t)?t.name:r7(t)??t.name}R(YIe,"getRuleTypeName");function $te(t){var e;return vu(t)?((e=t.type)==null?void 0:e.name)??"string":r7(t)??t.name}R($te,"getRuleType");function n7(t){const e={s:!1,i:!1,u:!1},r=Qy(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}R(n7,"terminalRegex");var Nte=/[\s\S]/.source;function Qy(t,e){var r;if(tte(t))return jIe(t);if(rte(t))return XIe(t);if(qee(t))return QIe(t);if(bD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return td(Qy(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Xee(t))return ZIe(t);if(ite(t))return KIe(t);if(Jee(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")),td(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(ate(t))return td(Nte,{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}`)}}}R(Qy,"abstractElementToRegex");function jIe(t){return td(t.elements.map(e=>Qy(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(jIe,"terminalAlternativesToRegex");function XIe(t){return td(t.elements.map(e=>Qy(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(XIe,"terminalGroupToRegex");function KIe(t){return td(`${Nte}*?${Qy(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}R(KIe,"untilTokenToRegex");function ZIe(t){return td(`(?!${Qy(t.terminal)})${Nte}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}R(ZIe,"negateTokenToRegex");function QIe(t){return t.right?td(`[${UR(t.left)}-${UR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):td(UR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(QIe,"characterRangeToRegex");function UR(t){return tk(t.value)}R(UR,"keywordToRegex");function td(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}R(td,"withCardinality");function Dte(t){const e=[],r=t.Grammar;for(const n of r.rules)vu(n)&&Ste(n)&&vte(n7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:ute}}R(Dte,"createGrammarConfig");var kYt=typeof global=="object"&&global&&global.Object===Object&&global,JIe=kYt,CYt=typeof self=="object"&&self&&self.Object===Object&&self,SYt=JIe||CYt||Function("return this")(),Ed=SYt,EYt=Ed.Symbol,gu=EYt,e$e=Object.prototype,AYt=e$e.hasOwnProperty,RYt=e$e.toString,Gk=gu?gu.toStringTag:void 0;function t$e(t){var e=AYt.call(t,Gk),r=t[Gk];try{t[Gk]=void 0;var n=!0}catch{}var i=RYt.call(t);return n&&(e?t[Gk]=r:delete t[Gk]),i}R(t$e,"getRawTag");var _Yt=t$e,MYt=Object.prototype,LYt=MYt.toString;function r$e(t){return LYt.call(t)}R(r$e,"objectToString");var IYt=r$e,$Yt="[object Null]",NYt="[object Undefined]",nge=gu?gu.toStringTag:void 0;function n$e(t){return t==null?t===void 0?NYt:$Yt:nge&&nge in Object(t)?_Yt(t):IYt(t)}R(n$e,"baseGetTag");var Ng=n$e;function i$e(t){return t!=null&&typeof t=="object"}R(i$e,"isObjectLike");var ah=i$e,DYt="[object Symbol]";function a$e(t){return typeof t=="symbol"||ah(t)&&Ng(t)==DYt}R(a$e,"isSymbol");var LD=a$e;function s$e(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=yjt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}R(k$e,"shortOut");var xjt=k$e;function C$e(t){return function(){return t}}R(C$e,"constant");var wjt=C$e,Tjt=(function(){try{var t=ev(Object,"defineProperty");return t({},"",{}),t}catch{}})(),mI=Tjt,kjt=mI?function(t,e){return mI(t,"toString",{configurable:!0,enumerable:!1,value:wjt(e),writable:!0})}:s7,Cjt=kjt,Sjt=xjt(Cjt),Ejt=Sjt;function S$e(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}R(I$e,"arrayIncludes");var $$e=I$e,_jt=9007199254740991,Mjt=/^(?:0|[1-9]\d*)$/;function N$e(t,e){var r=typeof t;return e=e??_jt,!!e&&(r=="number"||r!="symbol"&&Mjt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Njt}R(H$e,"isLength");var zte=H$e;function V$e(t){return t!=null&&zte(t.length)&&!k0(t)}R(V$e,"isArrayLike");var Ad=V$e;function W$e(t,e,r){if(!mu(r))return!1;var n=typeof e;return(n=="number"?Ad(r)&&ID(e,r.length):n=="string"&&e in r)?o7(r[e],t):!1}R(W$e,"isIterateeCall");var ND=W$e;function q$e(t){return Fte(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&&ND(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}R(xNe,"listCacheHas");var QXt=xNe;function wNe(t,e){var r=this.__data__,n=PD(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}R(wNe,"listCacheSet");var JXt=wNe;function rv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Gte(o,e-1,r,n,i):qte(i,o):n||(i[i.length]=o)}return i}R(Gte,"baseFlatten");var Ute=Gte;function PNe(t){var e=t==null?0:t.length;return e?Ute(t,1):[]}R(PNe,"flatten");var Ju=PNe,vKt=nNe(Object.getPrototypeOf,Object),BNe=vKt;function FNe(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&lQt?new Kte:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&ND(e[0],e[1],i)&&(n=1);++r=tJt&&(a=Zte,s=!1,e=new Kte(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}R(xOe,"createFind");var oJt=xOe,lJt=Math.max;function wOe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:a7(r);return i<0&&(i=lJt(n+i,0)),R$e(t,Rd(e),i)}R(wOe,"findIndex");var cJt=wOe,uJt=oJt(cJt),f3=uJt;function TOe(t){return t&&t.length?t[0]:void 0}R(TOe,"head");var sh=TOe;function kOe(t,e){var r=-1,n=Ad(t)?Array(t.length):[];return av(t,function(i,a,s){n[++r]=e(i,a,s)}),n}R(kOe,"baseMap");var hJt=kOe;function COe(t,e){var r=Vn(t)?i7:hJt;return r(t,Rd(e))}R(COe,"map");var kr=COe;function SOe(t,e){return Ute(kr(t,e),1)}R(SOe,"flatMap");var lu=SOe,dJt=Object.prototype,fJt=dJt.hasOwnProperty,pJt=QQt(function(t,e,r){fJt.call(t,r)?t[r].push(e):Bte(t,r,[e])}),gJt=pJt,mJt=Object.prototype,yJt=mJt.hasOwnProperty;function EOe(t,e){return t!=null&&yJt.call(t,e)}R(EOe,"baseHas");var vJt=EOe;function AOe(t,e){return t!=null&&GDe(t,e,vJt)}R(AOe,"has");var Hr=AOe,bJt="[object String]";function ROe(t){return typeof t=="string"||!Vn(t)&&ah(t)&&Ng(t)==bJt}R(ROe,"isString");var ec=ROe;function _Oe(t,e){return i7(e,function(r){return t[r]})}R(_Oe,"baseValues");var xJt=_Oe;function MOe(t){return t==null?[]:xJt(t,Rc(t))}R(MOe,"values");var cs=MOe,wJt=Math.max;function LOe(t,e,r,n){t=Ad(t)?t:cs(t),r=r&&!n?a7(r):0;var i=t.length;return r<0&&(r=wJt(i+r,0)),ec(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Pte(t,e,r)>-1}R(LOe,"includes");var Rl=LOe,TJt=Math.max;function IOe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:a7(r);return i<0&&(i=TJt(n+i,0)),Pte(t,e,i)}R(IOe,"indexOf");var Dge=IOe,kJt="[object Map]",CJt="[object Set]",SJt=Object.prototype,EJt=SJt.hasOwnProperty;function $Oe(t){if(t==null)return!0;if(Ad(t)&&(Vn(t)||typeof t=="string"||typeof t.splice=="function"||R6(t)||Hte(t)||DD(t)))return!t.length;var e=d3(t);if(e==kJt||e==CJt)return!t.size;if(c7(t))return!aNe(t).length;for(var r in t)if(EJt.call(t,r))return!1;return!0}R($Oe,"isEmpty");var Ri=$Oe,AJt="[object RegExp]";function NOe(t){return ah(t)&&Ng(t)==AJt}R(NOe,"baseIsRegExp");var RJt=NOe,Oge=og&&og.isRegExp,_Jt=Oge?u7(Oge):RJt,t0=_Jt;function DOe(t){return t===void 0}R(DOe,"isUndefined");var r0=DOe,MJt="Expected a function";function OOe(t){if(typeof t!="function")throw new TypeError(MJt);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)}}R(OOe,"negate");var LJt=OOe;function POe(t,e,r,n){if(!mu(t))return t;e=VD(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=FJt){var u=e?null:BJt(t);if(u)return Qte(u);s=!1,i=Zte,l=new Kte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},R(nx,"AbstractProduction"),nx),ix,xl=(ix=class extends _d{constructor(e){super([]),this.idx=1,_c(this,hh(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},R(ix,"NonTerminal"),ix),ax,rk=(ax=class extends _d{constructor(e){super(e.definition),this.orgText="",_c(this,hh(e,r=>r!==void 0))}},R(ax,"Rule"),ax),sx,tc=(sx=class extends _d{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_c(this,hh(e,r=>r!==void 0))}},R(sx,"Alternative"),sx),ox,ho=(ox=class extends _d{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(ox,"Option"),ox),lx,Dc=(lx=class extends _d{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(lx,"RepetitionMandatory"),lx),cx,Oc=(cx=class extends _d{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(cx,"RepetitionMandatoryWithSeparator"),cx),ux,Ea=(ux=class extends _d{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(ux,"Repetition"),ux),hx,ic=(hx=class extends _d{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(hx,"RepetitionWithSeparator"),hx),dx,ac=(dx=class extends _d{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,_c(this,hh(e,r=>r!==void 0))}},R(dx,"Alternation"),dx),fx,Vi=(fx=class{constructor(e){this.idx=1,_c(this,hh(e,r=>r!==void 0))}accept(e){e.visit(this)}},R(fx,"Terminal"),fx);function KOe(t){return kr(t,rS)}R(KOe,"serializeGrammar");function rS(t){function e(r){return kr(r,rS)}if(R(e,"convertDefinition"),t instanceof xl){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return ec(t.label)&&(r.label=t.label),r}else{if(t instanceof tc)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ho)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Dc)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Oc)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:rS(new Vi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ic)return{type:"RepetitionWithSeparator",idx:t.idx,separator:rS(new Vi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ea)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ac)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Vi){const r={type:"Terminal",name:t.terminalType.name,label:jOe(t.terminalType),idx:t.idx};ec(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=t0(n)?n.source:n),r}else{if(t instanceof rk)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}R(rS,"serializeProduction");var px,nk=(px=class{visit(e){const r=e;switch(r.constructor){case xl:return this.visitNonTerminal(r);case tc:return this.visitAlternative(r);case ho:return this.visitOption(r);case Dc:return this.visitRepetitionMandatory(r);case Oc:return this.visitRepetitionMandatoryWithSeparator(r);case ic:return this.visitRepetitionWithSeparator(r);case Ea:return this.visitRepetition(r);case ac:return this.visitAlternation(r);case Vi:return this.visitTerminal(r);case rk: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){}},R(px,"GAstVisitor"),px);function ZOe(t){return t instanceof tc||t instanceof ho||t instanceof Ea||t instanceof Dc||t instanceof Oc||t instanceof ic||t instanceof Vi||t instanceof rk}R(ZOe,"isSequenceProd");function $6(t,e=[]){return t instanceof ho||t instanceof Ea||t instanceof ic?!0:t instanceof ac?GOe(t.definition,n=>$6(n,e)):t instanceof xl&&Rl(e,t)?!1:t instanceof _d?(t instanceof xl&&e.push(t),eh(t.definition,n=>$6(n,e))):!1}R($6,"isOptionalProd");function QOe(t){return t instanceof ac}R(QOe,"isBranchingProd");function Bu(t){if(t instanceof xl)return"SUBRULE";if(t instanceof ho)return"OPTION";if(t instanceof ac)return"OR";if(t instanceof Dc)return"AT_LEAST_ONE";if(t instanceof Oc)return"AT_LEAST_ONE_SEP";if(t instanceof ic)return"MANY_SEP";if(t instanceof Ea)return"MANY";if(t instanceof Vi)return"CONSUME";throw Error("non exhaustive match")}R(Bu,"getProductionDslName");var gx,GD=(gx=class{walk(e,r=[]){Kr(e.definition,(n,i)=>{const a=Qs(e.definition,i+1);if(n instanceof xl)this.walkProdRef(n,a,r);else if(n instanceof Vi)this.walkTerminal(n,a,r);else if(n instanceof tc)this.walkFlat(n,a,r);else if(n instanceof ho)this.walkOption(n,a,r);else if(n instanceof Dc)this.walkAtLeastOne(n,a,r);else if(n instanceof Oc)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ic)this.walkManySep(n,a,r);else if(n instanceof Ea)this.walkMany(n,a,r);else if(n instanceof ac)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 ho({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=xY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ho({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=xY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Kr(e.definition,a=>{const s=new tc({definition:[a]});this.walk(s,i)})}},R(gx,"RestWalker"),gx);function xY(t,e,r){return[new ho({definition:[new Vi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}R(xY,"restForRepetitionWithSeparator");function ik(t){if(t instanceof xl)return ik(t.referencedRule);if(t instanceof Vi)return tPe(t);if(ZOe(t))return JOe(t);if(QOe(t))return ePe(t);throw Error("non exhaustive match")}R(ik,"first");function JOe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=$6(a),e=e.concat(ik(a)),n=n+1,i=r.length>n;return tre(e)}R(JOe,"firstForSequence");function ePe(t){const e=kr(t.definition,r=>ik(r));return tre(Ju(e))}R(ePe,"firstForBranching");function tPe(t){return[t.terminalType]}R(tPe,"firstForTerminal");var rPe="_~IN~_",mx,HJt=(mx=class extends GD{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=iPe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new tc({definition:a}),o=ik(s);this.follows[i]=o}},R(mx,"ResyncFollowsWalker"),mx);function nPe(t){const e={};return Kr(t,r=>{const n=new HJt(r).startWalking();_c(e,n)}),e}R(nPe,"computeAllProdsFollows");function iPe(t,e){return t.name+e+rPe}R(iPe,"buildBetweenProdsFollowPrefix");var YR={},VJt=new OIe;function f7(t){const e=t.toString();if(YR.hasOwnProperty(e))return YR[e];{const r=VJt.pattern(e);return YR[e]=r,r}}R(f7,"getRegExpAst");function aPe(){YR={}}R(aPe,"clearRegExpParserCache");var sPe="Complement Sets are not supported for first char optimization",bI=`Unable to use "first char" lexer optimizations: -`;function oPe(t,e=!1){try{const r=f7(t);return xI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===sPe)e&&rre(`${bI} 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)}},R(rx,"TerminalRegExpVisitor"),rx),c1=new RYt;function VIe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=HIe.pattern(t),r=[];for(const n of e.value.value)c1.reset(t),c1.visit(n),r.push({start:c1.startRegexp,end:c1.endRegex});return r}catch{return[]}}R(VIe,"getTerminalParts");function xte(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),c1.reset(t),c1.visit(HIe.pattern(t)),c1.multiline}catch{return!1}}R(xte,"isMultilineComment");var WIe=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function AD(t){const e=typeof t=="string"?new RegExp(t):t;return WIe.some(r=>e.test(r))}R(AD,"isWhitespace");function tk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}R(tk,"escapeRegExp");function wte(t,e){const r=Tte(t),n=e.match(r);return!!n&&n[0].length>0}R(wte,"partialMatches");function Tte(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}R(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(R(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 R(i,"process"),new RegExp(i(),t.flags)}R(Tte,"partialRegExp");function kte(t){return t.rules.find(e=>bl(e)&&e.entry)}R(kte,"getEntryRule");function Cte(t){return t.rules.filter(e=>vu(e)&&e.hidden)}R(Cte,"getHiddenRules");function RD(t,e){const r=new Set,n=kte(t);if(!n)return new Set(t.rules);const i=[n].concat(Cte(t));for(const s of i)Ste(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||vu(s)&&s.hidden)&&a.add(s);return a}R(RD,"getAllReachableRules");function Ste(t,e,r){e.add(t.name),T0(t).forEach(n=>{if(e0(n)||r&&wD(n)){const i=n.rule.ref;i&&!e.has(i.name)&&Ste(i,e,r)}})}R(Ste,"ruleDfs");function qIe(t){const e=new Set;return T0(t).forEach(r=>{Ky(r)&&(bl(r.type.ref)&&e.add(r.type.ref),t7(r.type.ref)&&bl(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}R(qIe,"getAllRulesUsedForCrossReferences");function Ete(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=ID(t.type.ref);return e==null?void 0:e.terminal}}R(Ete,"getCrossReferenceTerminal");function Ate(t){return t.hidden&&!AD(i7(t))}R(Ate,"isCommentTerminal");function Rte(t,e){return!t||!e?[]:MD(t,e,t.astNode,!0)}R(Rte,"findNodesForProperty");function _D(t,e,r){if(!t||!e)return;const n=MD(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]}R(_D,"findNodeForProperty");function MD(t,e,r,n){if(!n){const i=jy(t.grammarSource,Qf);if(i&&i.feature===e)return[t]}return Zf(t)&&t.astNode===r?t.content.flatMap(i=>MD(i,e,r,!1)):[]}R(MD,"findNodesForPropertyInternal");function GIe(t,e){return t?LD(t,e,t==null?void 0:t.astNode):[]}R(GIe,"findNodesForKeyword");function _te(t,e,r){if(!t)return;const n=LD(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]}R(_te,"findNodeForKeyword");function LD(t,e,r){if(t.astNode!==r)return[];if(Jf(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=u3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Jf(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}R(LD,"findNodesForKeywordInternal");function Mte(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=jy(t.grammarSource,Qf);if(n)return n;t=t.container}}R(Mte,"findAssignment");function ID(t){let e=t;return t7(e)&&(sg(e.$container)?e=e.$container.$container:Xy(e.$container)?e=e.$container:$g(e.$container)),Lte(t,e,new Map)}R(ID,"findNameAssignment");function Lte(t,e,r){var i;function n(a,s){let o;return jy(a,Qf)||(o=Lte(s,s,r)),r.set(t,o),o}if(R(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of T0(e)){if(Qf(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(e0(a)&&bl(a.rule.ref))return n(a,a.rule.ref);if(xD(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}R(Lte,"findNameAssignmentInternal");function Ite(t){const e=t.$container;if(Zy(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(sg(a))return a;{const s=T0(r[i]).find(sg);if(s)return s}}}if(vD(e))return Ite(e)}R(Ite,"getActionAtElement");function UIe(t,e){return t==="?"||t==="*"||Zy(e)&&!!e.guardCondition}R(UIe,"isOptionalCardinality");function YIe(t){return t==="*"||t==="+"}R(YIe,"isArrayCardinality");function jIe(t){return t==="+="}R(jIe,"isArrayOperator");function r7(t){return $te(t,new Set)}R(r7,"isDataTypeRule");function $te(t,e){if(e.has(t))return!0;e.add(t);for(const r of T0(t))if(e0(r)){if(!r.rule.ref||bl(r.rule.ref)&&!$te(r.rule.ref,e)||c3(r.rule.ref))return!1}else{if(Qf(r))return!1;if(sg(r))return!1}return!!t.definition}R($te,"isDataTypeRuleInternal");function XIe(t){return yI(t.type,new Set)}R(XIe,"isDataType");function yI(t,e){if(e.has(t))return!0;if(e.add(t),qee(t))return!1;if(ete(t))return!1;if(ate(t))return t.types.every(r=>yI(r,e));if(xD(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 TD(r)?yI(r.type,e):!1}else return!1}else return!1}R(yI,"isDataTypeInternal");function n7(t){if(!vu(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}}}R(n7,"getExplicitRuleType");function py(t){if(Xy(t))return bl(t)&&r7(t)?t.name:n7(t)??t.name;if(Kee(t)||TD(t)||rte(t))return t.name;if(sg(t)){const e=Nte(t);if(e)return e}else if(t7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}R(py,"getTypeName");function Nte(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return py(t.type.ref)}R(Nte,"getActionType");function KIe(t){var e;return vu(t)?((e=t.type)==null?void 0:e.name)??"string":bl(t)&&r7(t)?t.name:n7(t)??t.name}R(KIe,"getRuleTypeName");function Dte(t){var e;return vu(t)?((e=t.type)==null?void 0:e.name)??"string":n7(t)??t.name}R(Dte,"getRuleType");function i7(t){const e={s:!1,i:!1,u:!1},r=Qy(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}R(i7,"terminalRegex");var Ote=/[\s\S]/.source;function Qy(t,e){var r;if(nte(t))return ZIe(t);if(ite(t))return QIe(t);if(Uee(t))return t$e(t);if(wD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return rd(Qy(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Zee(t))return e$e(t);if(ste(t))return JIe(t);if(tte(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")),rd(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(ote(t))return rd(Ote,{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}`)}}}R(Qy,"abstractElementToRegex");function ZIe(t){return rd(t.elements.map(e=>Qy(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(ZIe,"terminalAlternativesToRegex");function QIe(t){return rd(t.elements.map(e=>Qy(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(QIe,"terminalGroupToRegex");function JIe(t){return rd(`${Ote}*?${Qy(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}R(JIe,"untilTokenToRegex");function e$e(t){return rd(`(?!${Qy(t.terminal)})${Ote}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}R(e$e,"negateTokenToRegex");function t$e(t){return t.right?rd(`[${YR(t.left)}-${YR(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):rd(YR(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}R(t$e,"characterRangeToRegex");function YR(t){return tk(t.value)}R(YR,"keywordToRegex");function rd(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}R(rd,"withCardinality");function Pte(t){const e=[],r=t.Grammar;for(const n of r.rules)vu(n)&&Ate(n)&&xte(i7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:dte}}R(Pte,"createGrammarConfig");var _Yt=typeof global=="object"&&global&&global.Object===Object&&global,r$e=_Yt,MYt=typeof self=="object"&&self&&self.Object===Object&&self,LYt=r$e||MYt||Function("return this")(),Ad=LYt,IYt=Ad.Symbol,gu=IYt,n$e=Object.prototype,$Yt=n$e.hasOwnProperty,NYt=n$e.toString,Gk=gu?gu.toStringTag:void 0;function i$e(t){var e=$Yt.call(t,Gk),r=t[Gk];try{t[Gk]=void 0;var n=!0}catch{}var i=NYt.call(t);return n&&(e?t[Gk]=r:delete t[Gk]),i}R(i$e,"getRawTag");var DYt=i$e,OYt=Object.prototype,PYt=OYt.toString;function a$e(t){return PYt.call(t)}R(a$e,"objectToString");var BYt=a$e,FYt="[object Null]",zYt="[object Undefined]",ige=gu?gu.toStringTag:void 0;function s$e(t){return t==null?t===void 0?zYt:FYt:ige&&ige in Object(t)?DYt(t):BYt(t)}R(s$e,"baseGetTag");var Ng=s$e;function o$e(t){return t!=null&&typeof t=="object"}R(o$e,"isObjectLike");var ah=o$e,HYt="[object Symbol]";function l$e(t){return typeof t=="symbol"||ah(t)&&Ng(t)==HYt}R(l$e,"isSymbol");var $D=l$e;function c$e(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=kjt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}R(E$e,"shortOut");var Ejt=E$e;function A$e(t){return function(){return t}}R(A$e,"constant");var Ajt=A$e,Rjt=(function(){try{var t=ev(Object,"defineProperty");return t({},"",{}),t}catch{}})(),vI=Rjt,_jt=vI?function(t,e){return vI(t,"toString",{configurable:!0,enumerable:!1,value:Ajt(e),writable:!0})}:o7,Mjt=_jt,Ljt=Ejt(Mjt),Ijt=Ljt;function R$e(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}R(D$e,"arrayIncludes");var O$e=D$e,Djt=9007199254740991,Ojt=/^(?:0|[1-9]\d*)$/;function P$e(t,e){var r=typeof t;return e=e??Djt,!!e&&(r=="number"||r!="symbol"&&Ojt.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=zjt}R(q$e,"isLength");var Vte=q$e;function G$e(t){return t!=null&&Vte(t.length)&&!k0(t)}R(G$e,"isArrayLike");var Rd=G$e;function U$e(t,e,r){if(!mu(r))return!1;var n=typeof e;return(n=="number"?Rd(r)&&ND(e,r.length):n=="string"&&e in r)?l7(r[e],t):!1}R(U$e,"isIterateeCall");var OD=U$e;function Y$e(t){return Hte(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&&OD(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}R(kNe,"listCacheHas");var iKt=kNe;function CNe(t,e){var r=this.__data__,n=FD(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}R(CNe,"listCacheSet");var aKt=CNe;function rv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Yte(o,e-1,r,n,i):Ute(i,o):n||(i[i.length]=o)}return i}R(Yte,"baseFlatten");var jte=Yte;function zNe(t){var e=t==null?0:t.length;return e?jte(t,1):[]}R(zNe,"flatten");var Ju=zNe,CKt=sNe(Object.getPrototypeOf,Object),HNe=CKt;function VNe(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&pQt?new Qte:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&OD(e[0],e[1],i)&&(n=1);++r=oJt&&(a=Jte,s=!1,e=new Qte(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}R(kOe,"createFind");var fJt=kOe,pJt=Math.max;function COe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:s7(r);return i<0&&(i=pJt(n+i,0)),L$e(t,_d(e),i)}R(COe,"findIndex");var gJt=COe,mJt=fJt(gJt),f3=mJt;function SOe(t){return t&&t.length?t[0]:void 0}R(SOe,"head");var sh=SOe;function EOe(t,e){var r=-1,n=Rd(t)?Array(t.length):[];return av(t,function(i,a,s){n[++r]=e(i,a,s)}),n}R(EOe,"baseMap");var yJt=EOe;function AOe(t,e){var r=Vn(t)?a7:yJt;return r(t,_d(e))}R(AOe,"map");var Cr=AOe;function ROe(t,e){return jte(Cr(t,e),1)}R(ROe,"flatMap");var lu=ROe,vJt=Object.prototype,bJt=vJt.hasOwnProperty,xJt=iJt(function(t,e,r){bJt.call(t,r)?t[r].push(e):zte(t,r,[e])}),wJt=xJt,TJt=Object.prototype,kJt=TJt.hasOwnProperty;function _Oe(t,e){return t!=null&&kJt.call(t,e)}R(_Oe,"baseHas");var CJt=_Oe;function MOe(t,e){return t!=null&&jDe(t,e,CJt)}R(MOe,"has");var Hr=MOe,SJt="[object String]";function LOe(t){return typeof t=="string"||!Vn(t)&&ah(t)&&Ng(t)==SJt}R(LOe,"isString");var Jl=LOe;function IOe(t,e){return a7(e,function(r){return t[r]})}R(IOe,"baseValues");var EJt=IOe;function $Oe(t){return t==null?[]:EJt(t,Rc(t))}R($Oe,"values");var cs=$Oe,AJt=Math.max;function NOe(t,e,r,n){t=Rd(t)?t:cs(t),r=r&&!n?s7(r):0;var i=t.length;return r<0&&(r=AJt(i+r,0)),Jl(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Fte(t,e,r)>-1}R(NOe,"includes");var Rl=NOe,RJt=Math.max;function DOe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:s7(r);return i<0&&(i=RJt(n+i,0)),Fte(t,e,i)}R(DOe,"indexOf");var Oge=DOe,_Jt="[object Map]",MJt="[object Set]",LJt=Object.prototype,IJt=LJt.hasOwnProperty;function OOe(t){if(t==null)return!0;if(Rd(t)&&(Vn(t)||typeof t=="string"||typeof t.splice=="function"||_6(t)||Wte(t)||PD(t)))return!t.length;var e=d3(t);if(e==_Jt||e==MJt)return!t.size;if(u7(t))return!lNe(t).length;for(var r in t)if(IJt.call(t,r))return!1;return!0}R(OOe,"isEmpty");var Ri=OOe,$Jt="[object RegExp]";function POe(t){return ah(t)&&Ng(t)==$Jt}R(POe,"baseIsRegExp");var NJt=POe,Pge=og&&og.isRegExp,DJt=Pge?h7(Pge):NJt,t0=DJt;function BOe(t){return t===void 0}R(BOe,"isUndefined");var r0=BOe,OJt="Expected a function";function FOe(t){if(typeof t!="function")throw new TypeError(OJt);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)}}R(FOe,"negate");var PJt=FOe;function zOe(t,e,r,n){if(!mu(t))return t;e=qD(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=GJt){var u=e?null:qJt(t);if(u)return ere(u);s=!1,i=Jte,l=new Qte}else l=e?[]:o;e:for(;++n{r.accept(e)})}},R(nx,"AbstractProduction"),nx),ix,xl=(ix=class extends Md{constructor(e){super([]),this.idx=1,_c(this,hh(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},R(ix,"NonTerminal"),ix),ax,rk=(ax=class extends Md{constructor(e){super(e.definition),this.orgText="",_c(this,hh(e,r=>r!==void 0))}},R(ax,"Rule"),ax),sx,ec=(sx=class extends Md{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_c(this,hh(e,r=>r!==void 0))}},R(sx,"Alternative"),sx),ox,ho=(ox=class extends Md{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(ox,"Option"),ox),lx,Dc=(lx=class extends Md{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(lx,"RepetitionMandatory"),lx),cx,Oc=(cx=class extends Md{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(cx,"RepetitionMandatoryWithSeparator"),cx),ux,Ea=(ux=class extends Md{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(ux,"Repetition"),ux),hx,nc=(hx=class extends Md{constructor(e){super(e.definition),this.idx=1,_c(this,hh(e,r=>r!==void 0))}},R(hx,"RepetitionWithSeparator"),hx),dx,ic=(dx=class extends Md{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,_c(this,hh(e,r=>r!==void 0))}},R(dx,"Alternation"),dx),fx,Vi=(fx=class{constructor(e){this.idx=1,_c(this,hh(e,r=>r!==void 0))}accept(e){e.visit(this)}},R(fx,"Terminal"),fx);function JOe(t){return Cr(t,rS)}R(JOe,"serializeGrammar");function rS(t){function e(r){return Cr(r,rS)}if(R(e,"convertDefinition"),t instanceof xl){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Jl(t.label)&&(r.label=t.label),r}else{if(t instanceof ec)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ho)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Dc)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Oc)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:rS(new Vi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof nc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:rS(new Vi({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Ea)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ic)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Vi){const r={type:"Terminal",name:t.terminalType.name,label:ZOe(t.terminalType),idx:t.idx};Jl(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=t0(n)?n.source:n),r}else{if(t instanceof rk)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}R(rS,"serializeProduction");var px,nk=(px=class{visit(e){const r=e;switch(r.constructor){case xl:return this.visitNonTerminal(r);case ec:return this.visitAlternative(r);case ho:return this.visitOption(r);case Dc:return this.visitRepetitionMandatory(r);case Oc:return this.visitRepetitionMandatoryWithSeparator(r);case nc:return this.visitRepetitionWithSeparator(r);case Ea:return this.visitRepetition(r);case ic:return this.visitAlternation(r);case Vi:return this.visitTerminal(r);case rk: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){}},R(px,"GAstVisitor"),px);function ePe(t){return t instanceof ec||t instanceof ho||t instanceof Ea||t instanceof Dc||t instanceof Oc||t instanceof nc||t instanceof Vi||t instanceof rk}R(ePe,"isSequenceProd");function N6(t,e=[]){return t instanceof ho||t instanceof Ea||t instanceof nc?!0:t instanceof ic?jOe(t.definition,n=>N6(n,e)):t instanceof xl&&Rl(e,t)?!1:t instanceof Md?(t instanceof xl&&e.push(t),eh(t.definition,n=>N6(n,e))):!1}R(N6,"isOptionalProd");function tPe(t){return t instanceof ic}R(tPe,"isBranchingProd");function Bu(t){if(t instanceof xl)return"SUBRULE";if(t instanceof ho)return"OPTION";if(t instanceof ic)return"OR";if(t instanceof Dc)return"AT_LEAST_ONE";if(t instanceof Oc)return"AT_LEAST_ONE_SEP";if(t instanceof nc)return"MANY_SEP";if(t instanceof Ea)return"MANY";if(t instanceof Vi)return"CONSUME";throw Error("non exhaustive match")}R(Bu,"getProductionDslName");var gx,YD=(gx=class{walk(e,r=[]){Kr(e.definition,(n,i)=>{const a=Qs(e.definition,i+1);if(n instanceof xl)this.walkProdRef(n,a,r);else if(n instanceof Vi)this.walkTerminal(n,a,r);else if(n instanceof ec)this.walkFlat(n,a,r);else if(n instanceof ho)this.walkOption(n,a,r);else if(n instanceof Dc)this.walkAtLeastOne(n,a,r);else if(n instanceof Oc)this.walkAtLeastOneSep(n,a,r);else if(n instanceof nc)this.walkManySep(n,a,r);else if(n instanceof Ea)this.walkMany(n,a,r);else if(n instanceof ic)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 ho({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=TY(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ho({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=TY(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Kr(e.definition,a=>{const s=new ec({definition:[a]});this.walk(s,i)})}},R(gx,"RestWalker"),gx);function TY(t,e,r){return[new ho({definition:[new Vi({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}R(TY,"restForRepetitionWithSeparator");function ik(t){if(t instanceof xl)return ik(t.referencedRule);if(t instanceof Vi)return iPe(t);if(ePe(t))return rPe(t);if(tPe(t))return nPe(t);throw Error("non exhaustive match")}R(ik,"first");function rPe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=N6(a),e=e.concat(ik(a)),n=n+1,i=r.length>n;return nre(e)}R(rPe,"firstForSequence");function nPe(t){const e=Cr(t.definition,r=>ik(r));return nre(Ju(e))}R(nPe,"firstForBranching");function iPe(t){return[t.terminalType]}R(iPe,"firstForTerminal");var aPe="_~IN~_",mx,YJt=(mx=class extends YD{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=oPe(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new ec({definition:a}),o=ik(s);this.follows[i]=o}},R(mx,"ResyncFollowsWalker"),mx);function sPe(t){const e={};return Kr(t,r=>{const n=new YJt(r).startWalking();_c(e,n)}),e}R(sPe,"computeAllProdsFollows");function oPe(t,e){return t.name+e+aPe}R(oPe,"buildBetweenProdsFollowPrefix");var jR={},jJt=new FIe;function p7(t){const e=t.toString();if(jR.hasOwnProperty(e))return jR[e];{const r=jJt.pattern(e);return jR[e]=r,r}}R(p7,"getRegExpAst");function lPe(){jR={}}R(lPe,"clearRegExpParserCache");var cPe="Complement Sets are not supported for first char optimization",wI=`Unable to use "first char" lexer optimizations: +`;function uPe(t,e=!1){try{const r=p7(t);return TI(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===cPe)e&&ire(`${wI} 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=` This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),vI(`${bI} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),xI(`${wI} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}R(oPe,"getOptimizedStartCodesIndices");function xI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")Y5(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)Y5(h,e,r);else{for(let h=u.from;h<=u.to&&h=X5){const h=u.from>=X5?u.from:X5,d=u.to,f=n0(h),p=n0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":xI(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"&&wI(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return cs(e)}R(xI,"firstCharOptimizedIndices");function Y5(t,e,r){const n=n0(t);e[n]=n,r===!0&&lPe(t,e)}R(Y5,"addOptimizedIdxToResult");function lPe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=n0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=n0(i.charCodeAt(0));e[a]=a}}}R(lPe,"handleIgnoreCase");function wY(t,e){return f3(t.value,r=>{if(typeof r=="number")return Rl(e,r);{const n=r;return f3(e,i=>n.from<=i&&i<=n.to)!==void 0}})}R(wY,"findCode");function wI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Vn(t.value)?eh(t.value,wI):wI(t.value):!1}R(wI,"isWholeOptional");var yx,WJt=(yx=class extends CD{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){Rl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?wY(e,this.targetCharCodes)===void 0&&(this.found=!0):wY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},R(yx,"CharCodeFinder"),yx);function UD(t,e){if(e instanceof RegExp){const r=f7(e),n=new WJt(t);return n.visit(r),n.found}else return f3(e,r=>Rl(t,r.charCodeAt(0)))!==void 0}R(UD,"canMatchCharCode");var my="PATTERN",j5="defaultMode",c8="modes";function cPe(t,e){e=ere(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:R((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{MPe()});let n;r("Reject Lexer.NA",()=>{n=qD(t,x=>x[my]===pl.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=kr(n,x=>{const b=x[my];if(t0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Rl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:TY(b)}else{if(k0(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 T=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(T);return TY(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=kr(n,x=>x.tokenTypeIdx),o=kr(n,x=>{const b=x.GROUP;if(b!==pl.SKIPPED){if(ec(b))return b;if(r0(b))return!1;throw Error("non exhaustive match")}}),l=kr(n,x=>{const b=x.LONGER_ALT;if(b)return Vn(b)?kr(b,k=>Dge(n,k)):[Dge(n,b)]}),u=kr(n,x=>x.PUSH_MODE),h=kr(n,x=>Hr(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=ore(e.lineTerminatorCharacters);d=kr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=kr(n,b=>Hr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:sre(b,x)===!1&&UD(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=kr(n,are),p=kr(a,RPe),g=Mc(n,(x,b)=>{const T=b.GROUP;return ec(T)&&T!==pl.SKIPPED&&(x[T]=[]),x},{}),m=kr(a,(x,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=Mc(n,(x,b,T)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),S=n0(k);jR(x,S,m[T])}else if(Vn(b.START_CHARS_HINT)){let k;Kr(b.START_CHARS_HINT,S=>{const C=typeof S=="string"?S.charCodeAt(0):S,E=n0(C);k!==E&&(k=E,jR(x,E,m[T]))})}else if(t0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&vI(`${bI} Unable to analyze < ${b.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}R(uPe,"getOptimizedStartCodesIndices");function TI(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")Y5(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)Y5(h,e,r);else{for(let h=u.from;h<=u.to&&h=X5){const h=u.from>=X5?u.from:X5,d=u.to,f=n0(h),p=n0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":TI(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"&&kI(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return cs(e)}R(TI,"firstCharOptimizedIndices");function Y5(t,e,r){const n=n0(t);e[n]=n,r===!0&&hPe(t,e)}R(Y5,"addOptimizedIdxToResult");function hPe(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=n0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=n0(i.charCodeAt(0));e[a]=a}}}R(hPe,"handleIgnoreCase");function kY(t,e){return f3(t.value,r=>{if(typeof r=="number")return Rl(e,r);{const n=r;return f3(e,i=>n.from<=i&&i<=n.to)!==void 0}})}R(kY,"findCode");function kI(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Vn(t.value)?eh(t.value,kI):kI(t.value):!1}R(kI,"isWholeOptional");var yx,XJt=(yx=class extends ED{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){Rl(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?kY(e,this.targetCharCodes)===void 0&&(this.found=!0):kY(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},R(yx,"CharCodeFinder"),yx);function jD(t,e){if(e instanceof RegExp){const r=p7(e),n=new XJt(t);return n.visit(r),n.found}else return f3(e,r=>Rl(t,r.charCodeAt(0)))!==void 0}R(jD,"canMatchCharCode");var my="PATTERN",j5="defaultMode",u8="modes";function dPe(t,e){e=rre(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:R((x,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{$Pe()});let n;r("Reject Lexer.NA",()=>{n=UD(t,x=>x[my]===pl.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Cr(n,x=>{const b=x[my];if(t0(b)){const T=b.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!b.ignoreCase?T:T.length===2&&T[0]==="\\"&&!Rl(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:CY(b)}else{if(k0(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 T=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),k=new RegExp(T);return CY(k)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=Cr(n,x=>x.tokenTypeIdx),o=Cr(n,x=>{const b=x.GROUP;if(b!==pl.SKIPPED){if(Jl(b))return b;if(r0(b))return!1;throw Error("non exhaustive match")}}),l=Cr(n,x=>{const b=x.LONGER_ALT;if(b)return Vn(b)?Cr(b,k=>Oge(n,k)):[Oge(n,b)]}),u=Cr(n,x=>x.PUSH_MODE),h=Cr(n,x=>Hr(x,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const x=cre(e.lineTerminatorCharacters);d=Cr(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=Cr(n,b=>Hr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:lre(b,x)===!1&&jD(x,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Cr(n,ore),p=Cr(a,LPe),g=Mc(n,(x,b)=>{const T=b.GROUP;return Jl(T)&&T!==pl.SKIPPED&&(x[T]=[]),x},{}),m=Cr(a,(x,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=Mc(n,(x,b,T)=>{if(typeof b.PATTERN=="string"){const k=b.PATTERN.charCodeAt(0),S=n0(k);XR(x,S,m[T])}else if(Vn(b.START_CHARS_HINT)){let k;Kr(b.START_CHARS_HINT,S=>{const C=typeof S=="string"?S.charCodeAt(0):S,E=n0(C);k!==E&&(k=E,XR(x,E,m[T]))})}else if(t0(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&xI(`${wI} 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 k=oPe(b.PATTERN,e.ensureOptimizations);Ri(k)&&(y=!1),Kr(k,S=>{jR(x,S,m[T])})}else e.ensureOptimizations&&vI(`${bI} 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 k=uPe(b.PATTERN,e.ensureOptimizations);Ri(k)&&(y=!1),Kr(k,S=>{XR(x,S,m[T])})}else e.ensureOptimizations&&xI(`${wI} 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 x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}R(cPe,"analyzeTokenTypes");function uPe(t,e){let r=[];const n=dPe(t);r=r.concat(n.errors);const i=fPe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(hPe(a)),r=r.concat(bPe(a)),r=r.concat(xPe(a,e)),r=r.concat(wPe(a)),r}R(uPe,"validatePatterns");function hPe(t){let e=[];const r=bu(t,n=>t0(n[my]));return e=e.concat(pPe(r)),e=e.concat(mPe(r)),e=e.concat(yPe(r)),e=e.concat(vPe(r)),e=e.concat(gPe(r)),e}R(hPe,"validateRegExpPattern");function dPe(t){const e=bu(t,i=>!Hr(i,my)),r=kr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Aa.MISSING_PATTERN,tokenTypes:[i]})),n=WD(t,e);return{errors:r,valid:n}}R(dPe,"findMissingPatterns");function fPe(t){const e=bu(t,i=>{const a=i[my];return!t0(a)&&!k0(a)&&!Hr(a,"exec")&&!ec(a)}),r=kr(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:Aa.INVALID_PATTERN,tokenTypes:[i]})),n=WD(t,e);return{errors:r,valid:n}}R(fPe,"findInvalidPatterns");var qJt=/[^\\][$]/;function pPe(t){const i=class i extends CD{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};R(i,"EndAnchorFinder");let e=i;const r=bu(t,a=>{const s=a.PATTERN;try{const o=f7(s),l=new e;return l.visit(o),l.found}catch{return qJt.test(s.source)}});return kr(r,a=>({message:`Unexpected RegExp Anchor Error: + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return x},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}R(dPe,"analyzeTokenTypes");function fPe(t,e){let r=[];const n=gPe(t);r=r.concat(n.errors);const i=mPe(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(pPe(a)),r=r.concat(TPe(a)),r=r.concat(kPe(a,e)),r=r.concat(CPe(a)),r}R(fPe,"validatePatterns");function pPe(t){let e=[];const r=bu(t,n=>t0(n[my]));return e=e.concat(yPe(r)),e=e.concat(bPe(r)),e=e.concat(xPe(r)),e=e.concat(wPe(r)),e=e.concat(vPe(r)),e}R(pPe,"validateRegExpPattern");function gPe(t){const e=bu(t,i=>!Hr(i,my)),r=Cr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Aa.MISSING_PATTERN,tokenTypes:[i]})),n=GD(t,e);return{errors:r,valid:n}}R(gPe,"findMissingPatterns");function mPe(t){const e=bu(t,i=>{const a=i[my];return!t0(a)&&!k0(a)&&!Hr(a,"exec")&&!Jl(a)}),r=Cr(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:Aa.INVALID_PATTERN,tokenTypes:[i]})),n=GD(t,e);return{errors:r,valid:n}}R(mPe,"findInvalidPatterns");var KJt=/[^\\][$]/;function yPe(t){const i=class i extends ED{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};R(i,"EndAnchorFinder");let e=i;const r=bu(t,a=>{const s=a.PATTERN;try{const o=p7(s),l=new e;return l.visit(o),l.found}catch{return KJt.test(s.source)}});return Cr(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:Aa.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}R(pPe,"findEndOfInputAnchor");function gPe(t){const e=bu(t,n=>n.PATTERN.test(""));return kr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Aa.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}R(gPe,"findEmptyMatchRegExps");var GJt=/[^\\[][\^]|^\^/;function mPe(t){const i=class i extends CD{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};R(i,"StartAnchorFinder");let e=i;const r=bu(t,a=>{const s=a.PATTERN;try{const o=f7(s),l=new e;return l.visit(o),l.found}catch{return GJt.test(s.source)}});return kr(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Aa.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}R(yPe,"findEndOfInputAnchor");function vPe(t){const e=bu(t,n=>n.PATTERN.test(""));return Cr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Aa.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}R(vPe,"findEmptyMatchRegExps");var ZJt=/[^\\[][\^]|^\^/;function bPe(t){const i=class i extends ED{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};R(i,"StartAnchorFinder");let e=i;const r=bu(t,a=>{const s=a.PATTERN;try{const o=p7(s),l=new e;return l.visit(o),l.found}catch{return ZJt.test(s.source)}});return Cr(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:Aa.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}R(mPe,"findStartOfInputAnchor");function yPe(t){const e=bu(t,n=>{const i=n[my];return i instanceof RegExp&&(i.multiline||i.global)});return kr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Aa.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}R(yPe,"findUnsupportedFlags");function vPe(t){const e=[];let r=kr(t,a=>Mc(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Rl(e,o)&&o.PATTERN!==pl.NA&&(e.push(o),s.push(o)),s),[]));r=d7(r);const n=bu(r,a=>a.length>1);return kr(n,a=>{const s=kr(a,l=>l.name);return{message:`The same RegExp pattern ->${sh(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Aa.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}R(vPe,"findDuplicatePatterns");function bPe(t){const e=bu(t,n=>{if(!Hr(n,"GROUP"))return!1;const i=n.GROUP;return i!==pl.SKIPPED&&i!==pl.NA&&!ec(i)});return kr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Aa.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}R(bPe,"findInvalidGroupType");function xPe(t,e){const r=bu(t,i=>i.PUSH_MODE!==void 0&&!Rl(e,i.PUSH_MODE));return kr(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:Aa.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}R(xPe,"findModesThatDoNotExist");function wPe(t){const e=[],r=Mc(t,(n,i,a)=>{const s=i.PATTERN;return s===pl.NA||(ec(s)?n.push({str:s,idx:a,tokenType:i}):t0(s)&&kPe(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:Aa.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}R(bPe,"findStartOfInputAnchor");function xPe(t){const e=bu(t,n=>{const i=n[my];return i instanceof RegExp&&(i.multiline||i.global)});return Cr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Aa.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}R(xPe,"findUnsupportedFlags");function wPe(t){const e=[];let r=Cr(t,a=>Mc(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!Rl(e,o)&&o.PATTERN!==pl.NA&&(e.push(o),s.push(o)),s),[]));r=f7(r);const n=bu(r,a=>a.length>1);return Cr(n,a=>{const s=Cr(a,l=>l.name);return{message:`The same RegExp pattern ->${sh(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Aa.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}R(wPe,"findDuplicatePatterns");function TPe(t){const e=bu(t,n=>{if(!Hr(n,"GROUP"))return!1;const i=n.GROUP;return i!==pl.SKIPPED&&i!==pl.NA&&!Jl(i)});return Cr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Aa.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}R(TPe,"findInvalidGroupType");function kPe(t,e){const r=bu(t,i=>i.PUSH_MODE!==void 0&&!Rl(e,i.PUSH_MODE));return Cr(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:Aa.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}R(kPe,"findModesThatDoNotExist");function CPe(t){const e=[],r=Mc(t,(n,i,a)=>{const s=i.PATTERN;return s===pl.NA||(Jl(s)?n.push({str:s,idx:a,tokenType:i}):t0(s)&&EPe(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:Aa.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}R(wPe,"findUnreachablePatterns");function TPe(t,e){if(t0(e)){if(CPe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(k0(e))return e(t,0,[],{});if(Hr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}R(TPe,"tryToMatchStrToPattern");function kPe(t){return f3([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}R(kPe,"noMetaChar");function CPe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:Aa.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Hr(t,c8)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+c8+`> property in its definition -`,type:Aa.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Hr(t,c8)&&Hr(t,j5)&&!Hr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${j5}: <${t.defaultMode}>which does not exist -`,type:Aa.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Hr(t,c8)&&Kr(t.modes,(i,a)=>{Kr(i,(s,o)=>{if(r0(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Aa.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}R(CPe,"findUnreachablePatterns");function SPe(t,e){if(t0(e)){if(APe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(k0(e))return e(t,0,[],{});if(Hr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}R(SPe,"tryToMatchStrToPattern");function EPe(t){return f3([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}R(EPe,"noMetaChar");function APe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:Aa.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Hr(t,u8)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+u8+`> property in its definition +`,type:Aa.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Hr(t,u8)&&Hr(t,j5)&&!Hr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${j5}: <${t.defaultMode}>which does not exist +`,type:Aa.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Hr(t,u8)&&Kr(t.modes,(i,a)=>{Kr(i,(s,o)=>{if(r0(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> `,type:Aa.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Hr(s,"LONGER_ALT")){const l=Vn(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];Kr(l,u=>{!r0(u)&&!Rl(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:Aa.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}R(SPe,"performRuntimeChecks");function EPe(t,e,r){const n=[];let i=!1;const a=d7(Ju(cs(t.modes))),s=qD(a,l=>l[my]===pl.NA),o=ore(r);return e&&Kr(s,l=>{const u=sre(l,o);if(u!==!1){const d={message:_Pe(l,u),type:u.issue,tokenType:l};n.push(d)}else Hr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):UD(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +`,type:Aa.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}R(RPe,"performRuntimeChecks");function _Pe(t,e,r){const n=[];let i=!1;const a=f7(Ju(cs(t.modes))),s=UD(a,l=>l[my]===pl.NA),o=cre(r);return e&&Kr(s,l=>{const u=lre(l,o);if(u!==!1){const d={message:IPe(l,u),type:u.issue,tokenType:l};n.push(d)}else Hr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):jD(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:Aa.NO_LINE_BREAKS_FLAGS}),n}R(EPe,"performWarningRuntimeChecks");function APe(t){const e={},r=Rc(t);return Kr(r,n=>{const i=t[n];if(Vn(i))e[n]=[];else throw Error("non exhaustive match")}),e}R(APe,"cloneEmptyGroups");function are(t){const e=t.PATTERN;if(t0(e))return!1;if(k0(e))return!0;if(Hr(e,"exec"))return!0;if(ec(e))return!1;throw Error("non exhaustive match")}R(are,"isCustomPattern");function RPe(t){return ec(t)&&t.length===1?t.charCodeAt(0):!1}R(RPe,"isShortPattern");var UJt={test:R(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(Vn(i))e[n]=[];else throw Error("non exhaustive match")}),e}R(MPe,"cloneEmptyGroups");function ore(t){const e=t.PATTERN;if(t0(e))return!1;if(k0(e))return!0;if(Hr(e,"exec"))return!0;if(Jl(e))return!1;throw Error("non exhaustive match")}R(ore,"isCustomPattern");function LPe(t){return Jl(t)&&t.length===1?t.charCodeAt(0):!1}R(LPe,"isShortPattern");var QJt={test:R(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===Aa.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")}R(_Pe,"buildLineBreakIssueMessage");function ore(t){return kr(t,r=>ec(r)?r.charCodeAt(0):r)}R(ore,"getCharCodes");function jR(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}R(jR,"addToMapOfArrays");var X5=256,XR=[];function n0(t){return t255?255+~~(t/255):t}}R(MPe,"initCharCodeToOptimizedIndexMap");function ak(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}R(ak,"tokenStructuredMatcher");function N6(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}R(N6,"tokenStructuredMatcherNoCategories");var Pge=1,LPe={};function sk(t){const e=IPe(t);$Pe(e),DPe(e),NPe(e),Kr(e,r=>{r.isParent=r.categoryMatches.length>0})}R(sk,"augmentTokenTypes");function IPe(t){let e=go(t),r=t,n=!0;for(;n;){r=d7(Ju(kr(r,a=>a.CATEGORIES)));const i=WD(r,e);e=e.concat(i),Ri(i)?n=!1:r=i}return e}R(IPe,"expandCategories");function $Pe(t){Kr(t,e=>{cre(e)||(LPe[Pge]=e,e.tokenTypeIdx=Pge++),kY(e)&&!Vn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),kY(e)||(e.CATEGORIES=[]),OPe(e)||(e.categoryMatches=[]),PPe(e)||(e.categoryMatchesMap={})})}R($Pe,"assignTokenDefaultProps");function NPe(t){Kr(t,e=>{e.categoryMatches=[],Kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(LPe[n].tokenTypeIdx)})})}R(NPe,"assignCategoriesTokensProp");function DPe(t){Kr(t,e=>{lre([],e)})}R(DPe,"assignCategoriesMapProp");function lre(t,e){Kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Kr(e.CATEGORIES,r=>{const n=t.concat(e);Rl(n,r)||lre(n,r)})}R(lre,"singleAssignCategoriesToksMap");function cre(t){return Hr(t,"tokenTypeIdx")}R(cre,"hasShortKeyProperty");function kY(t){return Hr(t,"CATEGORIES")}R(kY,"hasCategoriesProperty");function OPe(t){return Hr(t,"categoryMatches")}R(OPe,"hasExtendingTokensTypesProperty");function PPe(t){return Hr(t,"categoryMatchesMap")}R(PPe,"hasExtendingTokensTypesMapProperty");function BPe(t){return Hr(t,"tokenTypeIdx")}R(BPe,"isTokenType");var CY={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.`}},Aa;(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"})(Aa||(Aa={}));var K5={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:CY,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(K5);var vx,pl=(vx=class{constructor(e,r=K5){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}=nre(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=_c({},K5,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===K5.lineTerminatorsPattern)this.config.lineTerminatorsPattern=UJt;else if(this.config.lineTerminatorCharacters===K5.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),Vn(e)?i={modes:{defaultMode:go(e)},defaultMode:j5}:(a=!1,i=go(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(SPe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(EPe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Kr(i.modes,(o,l)=>{i.modes[l]=qD(o,u=>r0(u))});const s=Rc(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(uPe(o,s))}),Ri(this.lexerDefinitionErrors)){sk(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=cPe(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=_c({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ri(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=kr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}R(IPe,"buildLineBreakIssueMessage");function cre(t){return Cr(t,r=>Jl(r)?r.charCodeAt(0):r)}R(cre,"getCharCodes");function XR(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}R(XR,"addToMapOfArrays");var X5=256,KR=[];function n0(t){return t255?255+~~(t/255):t}}R($Pe,"initCharCodeToOptimizedIndexMap");function ak(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}R(ak,"tokenStructuredMatcher");function D6(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}R(D6,"tokenStructuredMatcherNoCategories");var Bge=1,NPe={};function sk(t){const e=DPe(t);OPe(e),BPe(e),PPe(e),Kr(e,r=>{r.isParent=r.categoryMatches.length>0})}R(sk,"augmentTokenTypes");function DPe(t){let e=go(t),r=t,n=!0;for(;n;){r=f7(Ju(Cr(r,a=>a.CATEGORIES)));const i=GD(r,e);e=e.concat(i),Ri(i)?n=!1:r=i}return e}R(DPe,"expandCategories");function OPe(t){Kr(t,e=>{hre(e)||(NPe[Bge]=e,e.tokenTypeIdx=Bge++),SY(e)&&!Vn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),SY(e)||(e.CATEGORIES=[]),FPe(e)||(e.categoryMatches=[]),zPe(e)||(e.categoryMatchesMap={})})}R(OPe,"assignTokenDefaultProps");function PPe(t){Kr(t,e=>{e.categoryMatches=[],Kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(NPe[n].tokenTypeIdx)})})}R(PPe,"assignCategoriesTokensProp");function BPe(t){Kr(t,e=>{ure([],e)})}R(BPe,"assignCategoriesMapProp");function ure(t,e){Kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Kr(e.CATEGORIES,r=>{const n=t.concat(e);Rl(n,r)||ure(n,r)})}R(ure,"singleAssignCategoriesToksMap");function hre(t){return Hr(t,"tokenTypeIdx")}R(hre,"hasShortKeyProperty");function SY(t){return Hr(t,"CATEGORIES")}R(SY,"hasCategoriesProperty");function FPe(t){return Hr(t,"categoryMatches")}R(FPe,"hasExtendingTokensTypesProperty");function zPe(t){return Hr(t,"categoryMatchesMap")}R(zPe,"hasExtendingTokensTypesMapProperty");function HPe(t){return Hr(t,"tokenTypeIdx")}R(HPe,"isTokenType");var EY={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.`}},Aa;(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"})(Aa||(Aa={}));var K5={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:EY,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(K5);var vx,pl=(vx=class{constructor(e,r=K5){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}=are(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=_c({},K5,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===K5.lineTerminatorsPattern)this.config.lineTerminatorsPattern=QJt;else if(this.config.lineTerminatorCharacters===K5.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),Vn(e)?i={modes:{defaultMode:go(e)},defaultMode:j5}:(a=!1,i=go(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(RPe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(_Pe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Kr(i.modes,(o,l)=>{i.modes[l]=UD(o,u=>r0(u))});const s=Rc(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(fPe(o,s))}),Ri(this.lexerDefinitionErrors)){sk(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=dPe(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=_c({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ri(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Cr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}Kr(this.lexerDefinitionWarning,o=>{rre(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Ss),this.trackStartLines===!1&&(this.computeNewColumn=s7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ss),/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=Mc(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Ri(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}Kr(this.lexerDefinitionWarning,o=>{ire(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Ss),this.trackStartLines===!1&&(this.computeNewColumn=o7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ss),/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=Mc(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Ri(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",()=>{aPe()}),this.TRACE_INIT("toFastProperties",()=>{ire(this)})})}tokenize(e,r=this.defaultMode){if(!Ri(this.lexerDefinitionErrors)){const i=kr(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{lPe()}),this.TRACE_INIT("toFastProperties",()=>{sre(this)})})}tokenize(e,r=this.defaultMode){if(!Ri(this.lexerDefinitionErrors)){const i=Cr(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 x=e,b=x.length;let T=0,k=0;const S=this.hasCustom?0:Math.floor(e.length/10),C=new Array(S),E=[];let A=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const L=APe(this.emptyGroups),P=this.trackStartLines,N=this.config.lineTerminatorsPattern;let _=0,I=[],O=[];const D=[],$=[];Object.freeze($);let F=!1;const z=R(q=>{if(D.length===1&&q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);E.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:G})}else{D.pop();const G=gy(D);I=this.patternIdxToConfig[G],O=this.charCodeToPatternIdxToConfig[G],_=I.length;const Q=this.canModeBeOptimized[G]&&this.config.safeMode===!1;O&&Q?F=!0:F=!1}},"pop_mode");function H(q){D.push(q),O=this.charCodeToPatternIdxToConfig[q],I=this.patternIdxToConfig[q],_=I.length,_=I.length;const G=this.canModeBeOptimized[q]&&this.config.safeMode===!1;O&&G?F=!0:F=!1}R(H,"push_mode"),H.call(this,r);let B;const V=this.config.recoveryEnabled;for(;Tl.length){l=s,d=s.length,u=h,B=J;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(T,T+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,T,p,B.tokenType,A,M,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):L[f].push(g)),P===!0&&B.canLineTerminator===!0){let j=0,ae,Z;N.lastIndex=0;do l=l!==null?l:e.substring(T,T+d),ae=N.test(l),ae===!0&&(Z=N.lastIndex-1,j++);while(ae===!0);j!==0?(A=A+j,M=d-Z,this.updateTokenEndLineColumnLocation(g,f,Z,j,A,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);T=T+d,this.handleModes(B,z,H,g)}else{const j=T,ae=A,Z=M;let J=V===!1;for(;J===!1&&T ${R1(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: '`+sh(e).image+"'";if(n)return a+n+o;{const l=Mc(t,(f,p)=>f.concat(p),[]),u=kr(l,f=>`[${kr(f,p=>R1(p)).join(", ")}]`),d=`one of these possible Token sequences: -${kr(u,(f,p)=>` ${p+1}. ${f}`).join(` +`+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 x=e,b=x.length;let T=0,k=0;const S=this.hasCustom?0:Math.floor(e.length/10),C=new Array(S),E=[];let A=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const L=MPe(this.emptyGroups),P=this.trackStartLines,N=this.config.lineTerminatorsPattern;let _=0,I=[],O=[];const D=[],$=[];Object.freeze($);let F=!1;const z=R(q=>{if(D.length===1&&q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(q);E.push({offset:q.startOffset,line:q.startLine,column:q.startColumn,length:q.image.length,message:G})}else{D.pop();const G=gy(D);I=this.patternIdxToConfig[G],O=this.charCodeToPatternIdxToConfig[G],_=I.length;const Q=this.canModeBeOptimized[G]&&this.config.safeMode===!1;O&&Q?F=!0:F=!1}},"pop_mode");function H(q){D.push(q),O=this.charCodeToPatternIdxToConfig[q],I=this.patternIdxToConfig[q],_=I.length,_=I.length;const G=this.canModeBeOptimized[q]&&this.config.safeMode===!1;O&&G?F=!0:F=!1}R(H,"push_mode"),H.call(this,r);let B;const V=this.config.recoveryEnabled;for(;Tl.length){l=s,d=s.length,u=h,B=J;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(T,T+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,T,p,B.tokenType,A,M,d),this.handlePayload(g,u),f===!1?k=this.addToken(C,k,g):L[f].push(g)),P===!0&&B.canLineTerminator===!0){let j=0,ae,Z;N.lastIndex=0;do l=l!==null?l:e.substring(T,T+d),ae=N.test(l),ae===!0&&(Z=N.lastIndex-1,j++);while(ae===!0);j!==0?(A=A+j,M=d-Z,this.updateTokenEndLineColumnLocation(g,f,Z,j,A,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);T=T+d,this.handleModes(B,z,H,g)}else{const j=T,ae=A,Z=M;let J=V===!1;for(;J===!1&&T ${R1(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: '`+sh(e).image+"'";if(n)return a+n+o;{const l=Mc(t,(f,p)=>f.concat(p),[]),u=Cr(l,f=>`[${Cr(f,p=>R1(p)).join(", ")}]`),d=`one of these possible Token sequences: +${Cr(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: '`+sh(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${kr(t,u=>`[${kr(u,h=>R1(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Q2);var jJt={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- + <${Cr(t,u=>`[${Cr(u,h=>R1(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Q2);var eer={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},u1={buildDuplicateFoundError(t,e){function r(h){return h instanceof Vi?h.terminalType.name:h instanceof xl?h.nonTerminalName:""}R(r,"getExtraProductionArgument");const n=t.name,i=sh(e),a=i.idx,s=Bu(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 @@ -2616,63 +2629,63 @@ inside top level rule: ->`+t.name+"<-"}},u1={buildDuplicateFoundError(t,e){funct The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. To resolve this make sure each Terminal and Non-Terminal names are unique This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=kr(t.prefixPath,i=>R1(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=Cr(t.prefixPath,i=>R1(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix in inside <${t.topLevelRule.name}> Rule, <${e}> may appears as a prefix path in all these alternatives. See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in inside <${t.topLevelRule.name}> Rule, `;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. Only the last alternative may be empty. -`;else{const i=kr(t.prefixPath,a=>R1(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. +`;else{const i=Cr(t.prefixPath,a=>R1(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. `}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES For Further details.`,n},buildEmptyRepetitionError(t){let e=Bu(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens. This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in inside <${t.topLevelRule.name}> Rule. Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives: inside <${t.topLevelRule.name}> Rule. - has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=kr(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. + has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=Cr(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. 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 rk?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function zPe(t,e){const r=new XJt(t,e);return r.resolveRefs(),r.errors}R(zPe,"resolveGrammar");var bx,XJt=(bx=class extends nk{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Kr(cs(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:wl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},R(bx,"GastRefResolverVisitor"),bx),xx,KJt=(xx=class extends GD{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=go(this.path.ruleStack).reverse(),this.occurrenceStack=go(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(){Ri(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},R(xx,"AbstractNextPossibleTokensWalker"),xx),wx,ZJt=(wx=class extends KJt{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 tc({definition:i});this.possibleTokTypes=ik(a),this.found=!0}}},R(wx,"NextAfterTokenWalker"),wx),Tx,YD=(Tx=class extends GD{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}},R(Tx,"AbstractNextTerminalAfterProductionWalker"),Tx),kx,QJt=(kx=class extends YD{walkMany(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},R(kx,"NextTerminalAfterManyWalker"),kx),Cx,Uge=(Cx=class extends YD{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},R(Cx,"NextTerminalAfterManySepWalker"),Cx),Sx,JJt=(Sx=class extends YD{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},R(Sx,"NextTerminalAfterAtLeastOneWalker"),Sx),Ex,Yge=(Ex=class extends YD{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},R(Ex,"NextTerminalAfterAtLeastOneSepWalker"),Ex);function TI(t,e,r=[]){r=go(r);let n=[],i=0;function a(o){return o.concat(Qs(t,i+1))}R(a,"remainingPathWith");function s(o){const l=TI(a(o),e,r);return n.concat(l)}for(R(s,"getAlternativesForProd");r.length{Ri(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Vi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Qs(t,i)}),n}R(TI,"possiblePathsFrom");function dre(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:[]});!Ri(d);){const f=d.pop();if(f===s){o&&gy(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Ri(p))continue;const v=p[0];if(v===i){const x={idx:g,def:Qs(p),ruleStack:I6(m),occurrenceStack:I6(y)};d.push(x)}else if(v instanceof Vi)if(g=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(Qs(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(s)}else if(v instanceof tc)d.push({idx:g,def:v.definition.concat(Qs(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof rk)d.push(HPe(v,g,m,y));else throw Error("non exhaustive match")}return h}R(dre,"nextPossibleTokensAfter");function HPe(t,e,r,n){const i=go(r);i.push(t.name);const a=go(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}R(HPe,"expandTopLevelRule");var ca;(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"})(ca||(ca={}));function jD(t){if(t instanceof ho||t==="Option")return ca.OPTION;if(t instanceof Ea||t==="Repetition")return ca.REPETITION;if(t instanceof Dc||t==="RepetitionMandatory")return ca.REPETITION_MANDATORY;if(t instanceof Oc||t==="RepetitionMandatoryWithSeparator")return ca.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ic||t==="RepetitionWithSeparator")return ca.REPETITION_WITH_SEPARATOR;if(t instanceof ac||t==="Alternation")return ca.ALTERNATION;throw Error("non exhaustive match")}R(jD,"getProdType");function SY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=jD(n);return a===ca.ALTERNATION?g7(e,r,i):m7(e,r,a,i)}R(SY,"getLookaheadPaths");function VPe(t,e,r,n,i,a){const s=g7(t,e,r),o=pre(s)?N6:ak;return a(s,n,o,i)}R(VPe,"buildLookaheadFuncForOr");function WPe(t,e,r,n,i,a){const s=m7(t,e,i,r),o=pre(s)?N6:ak;return a(s[0],o,n)}R(WPe,"buildLookaheadFuncForOptionalProd");function qPe(t,e,r,n){const i=t.length,a=eh(t,s=>eh(s,o=>o.length===1));if(e)return function(s){const o=kr(s,l=>l.GATE);for(let l=0;lJu(l)),o=Mc(s,(l,u,h)=>(Kr(u,d=>{Hr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Kr(d.categoryMatches,f=>{Hr(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=Ju(t);if(a.length===1&&Ri(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Mc(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;aTI([s],1)),n=EY(r.length),i=kr(r,s=>{const o={};return Kr(s,l=>{const u=KR(l.partialPath);Kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=EY(o.length);for(let l=0;l{const v=KR(y.partialPath);Kr(v,x=>{i[l][x]=!0})})}}}}return n}R(fre,"lookAheadSequenceFromAlternatives");function g7(t,e,r,n){const i=new UPe(t,ca.ALTERNATION,n);return e.accept(i),fre(i.result,r)}R(g7,"getLookaheadPathsForOr");function m7(t,e,r,n){const i=new UPe(t,r);e.accept(i);const a=i.result,o=new eer(e,t,r).startWalking(),l=new tc({definition:a}),u=new tc({definition:o});return fre([l,u],n)}R(m7,"getLookaheadPathsForOptionalProd");function kI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}R(jPe,"isStrictPrefixOfPath");function pre(t){return eh(t,e=>eh(e,r=>eh(r,n=>Ri(n.categoryMatches))))}R(pre,"areTokenCategoriesNotUsed");function XPe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return kr(e,r=>Object.assign({type:wl.CUSTOM_LOOKAHEAD_VALIDATION},r))}R(XPe,"validateLookahead");function KPe(t,e,r,n){const i=lu(t,l=>ZPe(l,r)),a=oBe(t,e,r),s=lu(t,l=>nBe(l,r)),o=lu(t,l=>JPe(l,t,n,r));return i.concat(a,s,o)}R(KPe,"validateGrammar");function ZPe(t,e){const r=new ter;t.accept(r);const n=r.allProductions,i=gJt(n,QPe),a=hh(i,o=>o.length>1);return kr(cs(a),o=>{const l=sh(o),u=e.buildDuplicateFoundError(t,o),h=Bu(l),d={message:u,type:wl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=gre(l);return f&&(d.parameter=f),d})}R(ZPe,"validateDuplicateProductions");function QPe(t){return`${Bu(t)}_#_${t.idx}_#_${gre(t)}`}R(QPe,"identifyProductionForDuplicates");function gre(t){return t instanceof Vi?t.terminalType.name:t instanceof xl?t.nonTerminalName:""}R(gre,"getExtraProductionArgument");var _x,ter=(_x=class extends nk{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)}},R(_x,"OccurrenceValidationCollector"),_x);function JPe(t,e,r,n){const i=[];if(Mc(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:wl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}R(JPe,"validateRuleDoesNotAlreadyExist");function eBe(t,e,r){const n=[];let i;return Rl(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:wl.INVALID_RULE_OVERRIDE,ruleName:t})),n}R(eBe,"validateRuleIsOverridden");function mre(t,e,r,n=[]){const i=[],a=nS(e.definition);if(Ri(a))return[];{const s=t.name;Rl(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:wl.LEFT_RECURSION,ruleName:s});const l=WD(a,n.concat([t])),u=lu(l,h=>{const d=go(n);return d.push(h),mre(t,h,r,d)});return i.concat(u)}}R(mre,"validateNoLeftRecursion");function nS(t){let e=[];if(Ri(t))return e;const r=sh(t);if(r instanceof xl)e.push(r.referencedRule);else if(r instanceof tc||r instanceof ho||r instanceof Dc||r instanceof Oc||r instanceof ic||r instanceof Ea)e=e.concat(nS(r.definition));else if(r instanceof ac)e=Ju(kr(r.definition,a=>nS(a.definition)));else if(!(r instanceof Vi))throw Error("non exhaustive match");const n=$6(r),i=t.length>1;if(n&&i){const a=Qs(t);return e.concat(nS(a))}else return e}R(nS,"getFirstNoneTerminal");var Mx,yre=(Mx=class extends nk{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},R(Mx,"OrCollector"),Mx);function tBe(t,e){const r=new yre;t.accept(r);const n=r.alternations;return lu(n,a=>{const s=I6(a.definition);return lu(s,(o,l)=>{const u=dre([o],[],ak,1);return Ri(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:wl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}R(tBe,"validateEmptyOrAlternative");function rBe(t,e,r){const n=new yre;t.accept(n);let i=n.alternations;return i=qD(i,s=>s.ignoreAmbiguities===!0),lu(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=g7(o,t,l,s),h=aBe(u,s,t,r),d=sBe(u,s,t,r);return h.concat(d)})}R(rBe,"validateAmbiguousAlternationAlternatives");var Lx,rer=(Lx=class extends nk{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)}},R(Lx,"RepetitionCollector"),Lx);function nBe(t,e){const r=new yre;t.accept(r);const n=r.alternations;return lu(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:wl.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}R(nBe,"validateTooManyAlts");function iBe(t,e,r){const n=[];return Kr(t,i=>{const a=new rer;i.accept(a);const s=a.allProductions;Kr(s,o=>{const l=jD(o),u=o.maxLookahead||e,h=o.idx,f=m7(h,i,l,u)[0];if(Ri(Ju(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:wl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}R(iBe,"validateSomeNonEmptyLookaheadPath");function aBe(t,e,r,n){const i=[],a=Mc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Kr(l,h=>{const d=[u];Kr(t,(f,p)=>{u!==p&&kI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!kI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return kr(a,o=>{const l=kr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:wl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}R(aBe,"checkAlternativesAmbiguities");function sBe(t,e,r,n){const i=Mc(t,(s,o,l)=>{const u=kr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return d7(lu(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=bu(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:wl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}R(sBe,"checkPrefixAlternativesAmbiguities");function oBe(t,e,r){const n=[],i=kr(e,a=>a.name);return Kr(t,a=>{const s=a.name;if(Rl(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:wl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}R(oBe,"checkTerminalAndNoneTerminalsNameSpace");function lBe(t){const e=ere(t,{errMsgProvider:jJt}),r={};return Kr(t.rules,n=>{r[n.name]=n}),zPe(r,e.errMsgProvider)}R(lBe,"resolveGrammar");function cBe(t){return t=ere(t,{errMsgProvider:u1}),KPe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}R(cBe,"validateGrammar");var uBe="MismatchedTokenException",hBe="NoViableAltException",dBe="EarlyExitException",fBe="NotAllInputParsedException",pBe=[uBe,hBe,dBe,fBe];Object.freeze(pBe);function D6(t){return Rl(pBe,t.name)}R(D6,"isRecognitionException");var Ix,XD=(Ix=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)}},R(Ix,"RecognitionException"),Ix),$x,gBe=($x=class extends XD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=uBe}},R($x,"MismatchedTokenException"),$x),Nx,ner=(Nx=class extends XD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=hBe}},R(Nx,"NoViableAltException"),Nx),Dx,ier=(Dx=class extends XD{constructor(e,r){super(e,r),this.name=fBe}},R(Dx,"NotAllInputParsedException"),Dx),Ox,aer=(Ox=class extends XD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=dBe}},R(Ox,"EarlyExitException"),Ox),Yz={},mBe="InRuleRecoveryException",Px,ser=(Px=class extends Error{constructor(e){super(e),this.name=mBe}},R(Px,"InRuleRecoveryException"),Px),Bx,oer=(Bx=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Hr(e,"recoveryEnabled")?e.recoveryEnabled:i0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=yBe)}getTokenToInsert(e){const r=p7(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=R(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new gBe(p,u,this.LA(0));g.resyncedTokens=I6(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 ser("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ri(r))return!1;const n=this.LA(1);return f3(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 Rl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=f3(e,a=>hre(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Yz;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 kr(e,(n,i)=>i===0?Yz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=kr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ju(e)}getFollowSetFromFollowKey(e){if(e===Yz)return[lg];const r=e.ruleName+e.idxInCallingRule+rPe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,lg)||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 I6(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=go(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return kr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},R(Bx,"Recoverable"),Bx);function yBe(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=lg,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}R(yBe,"attemptInRepetitionRecovery");var ler=4,Dg=8,vBe=1<mre(r,r,u1))}validateEmptyOrAlternatives(e){return lu(e,r=>tBe(r,u1))}validateAmbiguousAlternationAlternatives(e,r){return lu(e,n=>rBe(n,r,u1))}validateSomeNonEmptyLookaheadPath(e,r){return iBe(e,r,u1)}buildLookaheadForAlternation(e){return VPe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,qPe)}buildLookaheadForOptional(e){return WPe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,jD(e.prodType),GPe)}},R(Fx,"LLkLookaheadStrategy"),Fx),zx,cer=(zx=class{initLooksAhead(e){this.dynamicTokensEnabled=Hr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:i0.dynamicTokensEnabled,this.maxLookahead=Hr(e,"maxLookahead")?e.maxLookahead:i0.maxLookahead,this.lookaheadStrategy=Hr(e,"lookaheadStrategy")?e.lookaheadStrategy:new vre({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}=xBe(r);Kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Bu(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=QR(this.fullRuleNameToShort[r.name],vBe,u.idx);this.setLaFuncCache(f,d)})}),Kr(i,u=>{this.computeLookaheadFunc(r,u.idx,AY,"Repetition",u.maxLookahead,Bu(u))}),Kr(a,u=>{this.computeLookaheadFunc(r,u.idx,bBe,"Option",u.maxLookahead,Bu(u))}),Kr(s,u=>{this.computeLookaheadFunc(r,u.idx,RY,"RepetitionMandatory",u.maxLookahead,Bu(u))}),Kr(o,u=>{this.computeLookaheadFunc(r,u.idx,ZR,"RepetitionMandatoryWithSeparator",u.maxLookahead,Bu(u))}),Kr(l,u=>{this.computeLookaheadFunc(r,u.idx,_Y,"RepetitionWithSeparator",u.maxLookahead,Bu(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=QR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return QR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},R(zx,"LooksAhead"),zx),Hx,uer=(Hx=class extends nk{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)}},R(Hx,"DslMethodsCollectorVisitor"),Hx),u8=new uer;function xBe(t){u8.reset(),t.accept(u8);const e=u8.dslMethods;return u8.reset(),e}R(xBe,"collectMethods");function MY(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 rk?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function WPe(t,e){const r=new ter(t,e);return r.resolveRefs(),r.errors}R(WPe,"resolveGrammar");var bx,ter=(bx=class extends nk{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Kr(cs(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:wl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},R(bx,"GastRefResolverVisitor"),bx),xx,rer=(xx=class extends YD{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=go(this.path.ruleStack).reverse(),this.occurrenceStack=go(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(){Ri(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},R(xx,"AbstractNextPossibleTokensWalker"),xx),wx,ner=(wx=class extends rer{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 ec({definition:i});this.possibleTokTypes=ik(a),this.found=!0}}},R(wx,"NextAfterTokenWalker"),wx),Tx,XD=(Tx=class extends YD{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}},R(Tx,"AbstractNextTerminalAfterProductionWalker"),Tx),kx,ier=(kx=class extends XD{walkMany(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},R(kx,"NextTerminalAfterManyWalker"),kx),Cx,Yge=(Cx=class extends XD{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},R(Cx,"NextTerminalAfterManySepWalker"),Cx),Sx,aer=(Sx=class extends XD{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},R(Sx,"NextTerminalAfterAtLeastOneWalker"),Sx),Ex,jge=(Ex=class extends XD{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=sh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Vi&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},R(Ex,"NextTerminalAfterAtLeastOneSepWalker"),Ex);function CI(t,e,r=[]){r=go(r);let n=[],i=0;function a(o){return o.concat(Qs(t,i+1))}R(a,"remainingPathWith");function s(o){const l=CI(a(o),e,r);return n.concat(l)}for(R(s,"getAlternativesForProd");r.length{Ri(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Vi)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Qs(t,i)}),n}R(CI,"possiblePathsFrom");function pre(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:[]});!Ri(d);){const f=d.pop();if(f===s){o&&gy(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Ri(p))continue;const v=p[0];if(v===i){const x={idx:g,def:Qs(p),ruleStack:$6(m),occurrenceStack:$6(y)};d.push(x)}else if(v instanceof Vi)if(g=0;x--){const b=v.definition[x],T={idx:g,def:b.definition.concat(Qs(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(s)}else if(v instanceof ec)d.push({idx:g,def:v.definition.concat(Qs(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof rk)d.push(qPe(v,g,m,y));else throw Error("non exhaustive match")}return h}R(pre,"nextPossibleTokensAfter");function qPe(t,e,r,n){const i=go(r);i.push(t.name);const a=go(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}R(qPe,"expandTopLevelRule");var ca;(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"})(ca||(ca={}));function KD(t){if(t instanceof ho||t==="Option")return ca.OPTION;if(t instanceof Ea||t==="Repetition")return ca.REPETITION;if(t instanceof Dc||t==="RepetitionMandatory")return ca.REPETITION_MANDATORY;if(t instanceof Oc||t==="RepetitionMandatoryWithSeparator")return ca.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof nc||t==="RepetitionWithSeparator")return ca.REPETITION_WITH_SEPARATOR;if(t instanceof ic||t==="Alternation")return ca.ALTERNATION;throw Error("non exhaustive match")}R(KD,"getProdType");function AY(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=KD(n);return a===ca.ALTERNATION?m7(e,r,i):y7(e,r,a,i)}R(AY,"getLookaheadPaths");function GPe(t,e,r,n,i,a){const s=m7(t,e,r),o=mre(s)?D6:ak;return a(s,n,o,i)}R(GPe,"buildLookaheadFuncForOr");function UPe(t,e,r,n,i,a){const s=y7(t,e,i,r),o=mre(s)?D6:ak;return a(s[0],o,n)}R(UPe,"buildLookaheadFuncForOptionalProd");function YPe(t,e,r,n){const i=t.length,a=eh(t,s=>eh(s,o=>o.length===1));if(e)return function(s){const o=Cr(s,l=>l.GATE);for(let l=0;lJu(l)),o=Mc(s,(l,u,h)=>(Kr(u,d=>{Hr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Kr(d.categoryMatches,f=>{Hr(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=Ju(t);if(a.length===1&&Ri(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Mc(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;aCI([s],1)),n=RY(r.length),i=Cr(r,s=>{const o={};return Kr(s,l=>{const u=ZR(l.partialPath);Kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=RY(o.length);for(let l=0;l{const v=ZR(y.partialPath);Kr(v,x=>{i[l][x]=!0})})}}}}return n}R(gre,"lookAheadSequenceFromAlternatives");function m7(t,e,r,n){const i=new XPe(t,ca.ALTERNATION,n);return e.accept(i),gre(i.result,r)}R(m7,"getLookaheadPathsForOr");function y7(t,e,r,n){const i=new XPe(t,r);e.accept(i);const a=i.result,o=new ser(e,t,r).startWalking(),l=new ec({definition:a}),u=new ec({definition:o});return gre([l,u],n)}R(y7,"getLookaheadPathsForOptionalProd");function SI(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}R(ZPe,"isStrictPrefixOfPath");function mre(t){return eh(t,e=>eh(e,r=>eh(r,n=>Ri(n.categoryMatches))))}R(mre,"areTokenCategoriesNotUsed");function QPe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Cr(e,r=>Object.assign({type:wl.CUSTOM_LOOKAHEAD_VALIDATION},r))}R(QPe,"validateLookahead");function JPe(t,e,r,n){const i=lu(t,l=>eBe(l,r)),a=uBe(t,e,r),s=lu(t,l=>sBe(l,r)),o=lu(t,l=>rBe(l,t,n,r));return i.concat(a,s,o)}R(JPe,"validateGrammar");function eBe(t,e){const r=new oer;t.accept(r);const n=r.allProductions,i=wJt(n,tBe),a=hh(i,o=>o.length>1);return Cr(cs(a),o=>{const l=sh(o),u=e.buildDuplicateFoundError(t,o),h=Bu(l),d={message:u,type:wl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=yre(l);return f&&(d.parameter=f),d})}R(eBe,"validateDuplicateProductions");function tBe(t){return`${Bu(t)}_#_${t.idx}_#_${yre(t)}`}R(tBe,"identifyProductionForDuplicates");function yre(t){return t instanceof Vi?t.terminalType.name:t instanceof xl?t.nonTerminalName:""}R(yre,"getExtraProductionArgument");var _x,oer=(_x=class extends nk{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)}},R(_x,"OccurrenceValidationCollector"),_x);function rBe(t,e,r,n){const i=[];if(Mc(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:wl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}R(rBe,"validateRuleDoesNotAlreadyExist");function nBe(t,e,r){const n=[];let i;return Rl(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:wl.INVALID_RULE_OVERRIDE,ruleName:t})),n}R(nBe,"validateRuleIsOverridden");function vre(t,e,r,n=[]){const i=[],a=nS(e.definition);if(Ri(a))return[];{const s=t.name;Rl(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:wl.LEFT_RECURSION,ruleName:s});const l=GD(a,n.concat([t])),u=lu(l,h=>{const d=go(n);return d.push(h),vre(t,h,r,d)});return i.concat(u)}}R(vre,"validateNoLeftRecursion");function nS(t){let e=[];if(Ri(t))return e;const r=sh(t);if(r instanceof xl)e.push(r.referencedRule);else if(r instanceof ec||r instanceof ho||r instanceof Dc||r instanceof Oc||r instanceof nc||r instanceof Ea)e=e.concat(nS(r.definition));else if(r instanceof ic)e=Ju(Cr(r.definition,a=>nS(a.definition)));else if(!(r instanceof Vi))throw Error("non exhaustive match");const n=N6(r),i=t.length>1;if(n&&i){const a=Qs(t);return e.concat(nS(a))}else return e}R(nS,"getFirstNoneTerminal");var Mx,bre=(Mx=class extends nk{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},R(Mx,"OrCollector"),Mx);function iBe(t,e){const r=new bre;t.accept(r);const n=r.alternations;return lu(n,a=>{const s=$6(a.definition);return lu(s,(o,l)=>{const u=pre([o],[],ak,1);return Ri(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:wl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}R(iBe,"validateEmptyOrAlternative");function aBe(t,e,r){const n=new bre;t.accept(n);let i=n.alternations;return i=UD(i,s=>s.ignoreAmbiguities===!0),lu(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=m7(o,t,l,s),h=lBe(u,s,t,r),d=cBe(u,s,t,r);return h.concat(d)})}R(aBe,"validateAmbiguousAlternationAlternatives");var Lx,ler=(Lx=class extends nk{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)}},R(Lx,"RepetitionCollector"),Lx);function sBe(t,e){const r=new bre;t.accept(r);const n=r.alternations;return lu(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:wl.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}R(sBe,"validateTooManyAlts");function oBe(t,e,r){const n=[];return Kr(t,i=>{const a=new ler;i.accept(a);const s=a.allProductions;Kr(s,o=>{const l=KD(o),u=o.maxLookahead||e,h=o.idx,f=y7(h,i,l,u)[0];if(Ri(Ju(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:wl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}R(oBe,"validateSomeNonEmptyLookaheadPath");function lBe(t,e,r,n){const i=[],a=Mc(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Kr(l,h=>{const d=[u];Kr(t,(f,p)=>{u!==p&&SI(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!SI(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Cr(a,o=>{const l=Cr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:wl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}R(lBe,"checkAlternativesAmbiguities");function cBe(t,e,r,n){const i=Mc(t,(s,o,l)=>{const u=Cr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return f7(lu(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=bu(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:wl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}R(cBe,"checkPrefixAlternativesAmbiguities");function uBe(t,e,r){const n=[],i=Cr(e,a=>a.name);return Kr(t,a=>{const s=a.name;if(Rl(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:wl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}R(uBe,"checkTerminalAndNoneTerminalsNameSpace");function hBe(t){const e=rre(t,{errMsgProvider:eer}),r={};return Kr(t.rules,n=>{r[n.name]=n}),WPe(r,e.errMsgProvider)}R(hBe,"resolveGrammar");function dBe(t){return t=rre(t,{errMsgProvider:u1}),JPe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}R(dBe,"validateGrammar");var fBe="MismatchedTokenException",pBe="NoViableAltException",gBe="EarlyExitException",mBe="NotAllInputParsedException",yBe=[fBe,pBe,gBe,mBe];Object.freeze(yBe);function O6(t){return Rl(yBe,t.name)}R(O6,"isRecognitionException");var Ix,ZD=(Ix=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)}},R(Ix,"RecognitionException"),Ix),$x,vBe=($x=class extends ZD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=fBe}},R($x,"MismatchedTokenException"),$x),Nx,cer=(Nx=class extends ZD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=pBe}},R(Nx,"NoViableAltException"),Nx),Dx,uer=(Dx=class extends ZD{constructor(e,r){super(e,r),this.name=mBe}},R(Dx,"NotAllInputParsedException"),Dx),Ox,her=(Ox=class extends ZD{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=gBe}},R(Ox,"EarlyExitException"),Ox),Xz={},bBe="InRuleRecoveryException",Px,der=(Px=class extends Error{constructor(e){super(e),this.name=bBe}},R(Px,"InRuleRecoveryException"),Px),Bx,fer=(Bx=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Hr(e,"recoveryEnabled")?e.recoveryEnabled:i0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=xBe)}getTokenToInsert(e){const r=g7(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=R(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new vBe(p,u,this.LA(0));g.resyncedTokens=$6(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 der("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ri(r))return!1;const n=this.LA(1);return f3(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 Rl(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=f3(e,a=>fre(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Xz;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 Cr(e,(n,i)=>i===0?Xz:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Cr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ju(e)}getFollowSetFromFollowKey(e){if(e===Xz)return[lg];const r=e.ruleName+e.idxInCallingRule+aPe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,lg)||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 $6(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=go(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Cr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},R(Bx,"Recoverable"),Bx);function xBe(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=lg,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}R(xBe,"attemptInRepetitionRecovery");var per=4,Dg=8,wBe=1<vre(r,r,u1))}validateEmptyOrAlternatives(e){return lu(e,r=>iBe(r,u1))}validateAmbiguousAlternationAlternatives(e,r){return lu(e,n=>aBe(n,r,u1))}validateSomeNonEmptyLookaheadPath(e,r){return oBe(e,r,u1)}buildLookaheadForAlternation(e){return GPe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,YPe)}buildLookaheadForOptional(e){return UPe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,KD(e.prodType),jPe)}},R(Fx,"LLkLookaheadStrategy"),Fx),zx,ger=(zx=class{initLooksAhead(e){this.dynamicTokensEnabled=Hr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:i0.dynamicTokensEnabled,this.maxLookahead=Hr(e,"maxLookahead")?e.maxLookahead:i0.maxLookahead,this.lookaheadStrategy=Hr(e,"lookaheadStrategy")?e.lookaheadStrategy:new xre({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}=kBe(r);Kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Bu(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=JR(this.fullRuleNameToShort[r.name],wBe,u.idx);this.setLaFuncCache(f,d)})}),Kr(i,u=>{this.computeLookaheadFunc(r,u.idx,_Y,"Repetition",u.maxLookahead,Bu(u))}),Kr(a,u=>{this.computeLookaheadFunc(r,u.idx,TBe,"Option",u.maxLookahead,Bu(u))}),Kr(s,u=>{this.computeLookaheadFunc(r,u.idx,MY,"RepetitionMandatory",u.maxLookahead,Bu(u))}),Kr(o,u=>{this.computeLookaheadFunc(r,u.idx,QR,"RepetitionMandatoryWithSeparator",u.maxLookahead,Bu(u))}),Kr(l,u=>{this.computeLookaheadFunc(r,u.idx,LY,"RepetitionWithSeparator",u.maxLookahead,Bu(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=JR(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return JR(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},R(zx,"LooksAhead"),zx),Hx,mer=(Hx=class extends nk{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)}},R(Hx,"DslMethodsCollectorVisitor"),Hx),h8=new mer;function kBe(t){h8.reset(),t.accept(h8);const e=h8.dslMethods;return h8.reset(),e}R(kBe,"collectMethods");function IY(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}R(CBe,"createBaseSemanticVisitorConstructor");function SBe(t,e,r){const n=R(function(){},"derivedConstructor");bre(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Kr(e,a=>{i[a]=kBe}),n.prototype=i,n.prototype.constructor=n,n}R(SBe,"createBaseVisitorConstructorWithDefaults");var IY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(IY||(IY={}));function EBe(t,e){return ABe(t,e)}R(EBe,"validateVisitor");function ABe(t,e){const r=bu(e,i=>k0(t[i])===!1),n=kr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:IY.MISSING_METHOD,methodName:i}));return d7(n)}R(ABe,"validateMissingCstMethods");var Vx,der=(Vx=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Hr(e,"nodeLocationTracking")?e.nodeLocationTracking:i0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ss,this.cstFinallyStateUpdate=Ss,this.cstPostTerminal=Ss,this.cstPostNonTerminal=Ss,this.cstPostRule=Ss;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=LY,this.setNodeLocationFromNode=LY,this.cstPostRule=Ss,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=MY,this.setNodeLocationFromNode=MY,this.cstPostRule=Ss,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=Ss,this.setInitialNodeLocation=Ss;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];wBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];TBe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(r0(this.baseCstVisitorConstructor)){const e=CBe(this.className,Rc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(r0(this.baseCstVisitorWithDefaultsConstructor)){const e=SBe(this.className,Rc(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]}},R(Vx,"TreeBuilder"),Vx),Wx,fer=(Wx=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)):CI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?CI: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()}},R(Wx,"LexerAdapter"),Wx),qx,per=(qx=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=SI){if(Rl(this.definedRulesNames,e)){const s={message:u1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:wl.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=SI){const i=eBe(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(D6(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return KOe(cs(this.gastProductionsCache))}},R(qx,"RecognizerApi"),qx),Gx,ger=(Gx=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=N6,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Hr(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}R(ABe,"createBaseSemanticVisitorConstructor");function RBe(t,e,r){const n=R(function(){},"derivedConstructor");wre(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Kr(e,a=>{i[a]=EBe}),n.prototype=i,n.prototype.constructor=n,n}R(RBe,"createBaseVisitorConstructorWithDefaults");var NY;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(NY||(NY={}));function _Be(t,e){return MBe(t,e)}R(_Be,"validateVisitor");function MBe(t,e){const r=bu(e,i=>k0(t[i])===!1),n=Cr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:NY.MISSING_METHOD,methodName:i}));return f7(n)}R(MBe,"validateMissingCstMethods");var Vx,ver=(Vx=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Hr(e,"nodeLocationTracking")?e.nodeLocationTracking:i0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ss,this.cstFinallyStateUpdate=Ss,this.cstPostTerminal=Ss,this.cstPostNonTerminal=Ss,this.cstPostRule=Ss;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=$Y,this.setNodeLocationFromNode=$Y,this.cstPostRule=Ss,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=IY,this.setNodeLocationFromNode=IY,this.cstPostRule=Ss,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ss,this.setNodeLocationFromNode=Ss,this.cstPostRule=Ss,this.setInitialNodeLocation=Ss;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];CBe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];SBe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(r0(this.baseCstVisitorConstructor)){const e=ABe(this.className,Rc(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(r0(this.baseCstVisitorWithDefaultsConstructor)){const e=RBe(this.className,Rc(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]}},R(Vx,"TreeBuilder"),Vx),Wx,ber=(Wx=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)):EI}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?EI: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()}},R(Wx,"LexerAdapter"),Wx),qx,xer=(qx=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=AI){if(Rl(this.definedRulesNames,e)){const s={message:u1.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:wl.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=AI){const i=nBe(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(O6(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return JOe(cs(this.gastProductionsCache))}},R(qx,"RecognizerApi"),qx),Gx,wer=(Gx=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=D6,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Hr(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(Vn(e)){if(Ri(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(Vn(e))this.tokensMap=Mc(e,(a,s)=>(a[s.name]=s,a),{});else if(Hr(e,"modes")&&eh(Ju(cs(e.modes)),BPe)){const a=Ju(cs(e.modes)),s=tre(a);this.tokensMap=Mc(s,(o,l)=>(o[l.name]=l,o),{})}else if(mu(e))this.tokensMap=go(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=lg;const n=Hr(e,"modes")?Ju(cs(e.modes)):cs(e),i=eh(n,a=>Ri(a.categoryMatches));this.tokenMatcher=i?N6:ak,sk(cs(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=Hr(n,"resyncEnabled")?n.resyncEnabled:SI.resyncEnabled,a=Hr(n,"recoveryValueFunc")?n.recoveryValueFunc:SI.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(RY,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=R(()=>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,ca.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,RY,e,JJt)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(ZR,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=R(()=>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,Yge],o,ZR,e,Yge)}else throw this.raiseEarlyExitException(e,ca.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(AY,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=R(()=>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,AY,e,QJt,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(_Y,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=R(()=>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,Uge],o,_Y,e,Uge)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,ZR,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(vBe,r),i=Vn(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 ier(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 D6(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 gBe(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===mBe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=go(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),lg)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},R(Gx,"RecognizerEngine"),Gx),Ux,mer=(Ux=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Hr(e,"errorMessageProvider")?e.errorMessageProvider:i0.errorMessageProvider}SAVE_ERROR(e){if(D6(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:go(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return go(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=m7(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 aer(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=g7(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 ner(l,this.LA(1),o))}},R(Ux,"ErrorHandler"),Ux),Yx,yer=(Yx=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(r0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return dre([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=sh(e.ruleStack),i=this.getGAstProductions()[r];return new ZJt(i,e).startWalking()}},R(Yx,"ContentAssist"),Yx),KD={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(KD);var jge=!0,Xge=Math.pow(2,Dg)-1,RBe=Sb({name:"RECORDING_PHASE_TOKEN",pattern:pl.NA});sk([RBe]);var _Be=p7(RBe,`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(_Be);var ver={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},jx,ber=(jx=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 CI}topLevelRuleRecord(e,r){try{const n=new rk({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(Vn(e))this.tokensMap=Mc(e,(a,s)=>(a[s.name]=s,a),{});else if(Hr(e,"modes")&&eh(Ju(cs(e.modes)),HPe)){const a=Ju(cs(e.modes)),s=nre(a);this.tokensMap=Mc(s,(o,l)=>(o[l.name]=l,o),{})}else if(mu(e))this.tokensMap=go(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=lg;const n=Hr(e,"modes")?Ju(cs(e.modes)):cs(e),i=eh(n,a=>Ri(a.categoryMatches));this.tokenMatcher=i?D6:ak,sk(cs(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=Hr(n,"resyncEnabled")?n.resyncEnabled:AI.resyncEnabled,a=Hr(n,"recoveryValueFunc")?n.recoveryValueFunc:AI.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(MY,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=R(()=>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,ca.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,MY,e,aer)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(QR,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=R(()=>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,jge],o,QR,e,jge)}else throw this.raiseEarlyExitException(e,ca.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(_Y,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=R(()=>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,_Y,e,ier,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(LY,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=R(()=>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,Yge],o,LY,e,Yge)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,QR,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(wBe,r),i=Vn(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 uer(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 O6(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 vBe(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===bBe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=go(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),lg)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},R(Gx,"RecognizerEngine"),Gx),Ux,Ter=(Ux=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Hr(e,"errorMessageProvider")?e.errorMessageProvider:i0.errorMessageProvider}SAVE_ERROR(e){if(O6(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:go(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return go(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=y7(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 her(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=m7(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 cer(l,this.LA(1),o))}},R(Ux,"ErrorHandler"),Ux),Yx,ker=(Yx=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(r0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return pre([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=sh(e.ruleStack),i=this.getGAstProductions()[r];return new ner(i,e).startWalking()}},R(Yx,"ContentAssist"),Yx),QD={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(QD);var Xge=!0,Kge=Math.pow(2,Dg)-1,LBe=Sb({name:"RECORDING_PHASE_TOKEN",pattern:pl.NA});sk([LBe]);var IBe=g7(LBe,`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(IBe);var Cer={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},jx,Ser=(jx=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 EI}topLevelRuleRecord(e,r){try{const n=new rk({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 b2.call(this,ho,e,r)}atLeastOneInternalRecord(e,r){b2.call(this,Dc,r,e)}atLeastOneSepFirstInternalRecord(e,r){b2.call(this,Oc,r,e,jge)}manyInternalRecord(e,r){b2.call(this,Ea,r,e)}manySepFirstInternalRecord(e,r){b2.call(this,ic,r,e,jge)}orInternalRecord(e,r){return MBe.call(this,e,r)}subruleInternalRecord(e,r,n){if(O6(r),!e||Hr(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=gy(this.recordingProdStack),a=e.ruleName,s=new xl({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?ver:KD}consumeInternalRecord(e,r,n){if(O6(r),!cre(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=gy(this.recordingProdStack),a=new Vi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),_Be}},R(jx,"GastRecorder"),jx);function b2(t,e,r,n=!1){O6(r);const i=gy(this.recordingProdStack),a=k0(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Hr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),KD}R(b2,"recordProd");function MBe(t,e){O6(e);const r=gy(this.recordingProdStack),n=Vn(t)===!1,i=n===!1?t:t.DEF,a=new ac({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Hr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=GOe(i,o=>k0(o.GATE));return a.hasPredicates=s,r.definition.push(a),Kr(i,o=>{const l=new tc({definition:[]});a.definition.push(l),Hr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Hr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),KD}R(MBe,"recordOrProd");function $Y(t){return t===0?"":`${t}`}R($Y,"getIdxSuffix");function O6(t){if(t<0||t>Xge){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${Xge+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}R(O6,"assertMethodIdxIsValid");var Xx,xer=(Xx=class{initPerformanceTracer(e){if(Hr(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=i0.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}=nre(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},R(Xx,"PerformanceTracer"),Xx);function LBe(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]})})}R(LBe,"applyMixins");var CI=p7(lg,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(CI);var i0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Q2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),SI=Object.freeze({recoveryValueFunc:R(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),wl;(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"})(wl||(wl={}));function NY(t=void 0){return function(){return t}}R(NY,"EMPTY_ALT");var L1,xre=(L1=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",()=>{ire(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=lBe({rules:cs(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ri(n)&&this.skipValidations===!1){const i=cBe({rules:cs(this.gastProductionsCache),tokenTypes:cs(this.tokensMap),errMsgProvider:u1,grammarName:r}),a=XPe({lookaheadStrategy:this.lookaheadStrategy,rules:cs(this.gastProductionsCache),tokenTypes:cs(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Ri(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=nPe(cs(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:cs(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(cs(this.gastProductionsCache))})),!L1.DEFER_DEFINITION_ERRORS_HANDLING&&!Ri(this.definitionErrors))throw e=kr(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 b2.call(this,ho,e,r)}atLeastOneInternalRecord(e,r){b2.call(this,Dc,r,e)}atLeastOneSepFirstInternalRecord(e,r){b2.call(this,Oc,r,e,Xge)}manyInternalRecord(e,r){b2.call(this,Ea,r,e)}manySepFirstInternalRecord(e,r){b2.call(this,nc,r,e,Xge)}orInternalRecord(e,r){return $Be.call(this,e,r)}subruleInternalRecord(e,r,n){if(P6(r),!e||Hr(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=gy(this.recordingProdStack),a=e.ruleName,s=new xl({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Cer:QD}consumeInternalRecord(e,r,n){if(P6(r),!hre(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=gy(this.recordingProdStack),a=new Vi({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),IBe}},R(jx,"GastRecorder"),jx);function b2(t,e,r,n=!1){P6(r);const i=gy(this.recordingProdStack),a=k0(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Hr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),QD}R(b2,"recordProd");function $Be(t,e){P6(e);const r=gy(this.recordingProdStack),n=Vn(t)===!1,i=n===!1?t:t.DEF,a=new ic({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Hr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=jOe(i,o=>k0(o.GATE));return a.hasPredicates=s,r.definition.push(a),Kr(i,o=>{const l=new ec({definition:[]});a.definition.push(l),Hr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Hr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),QD}R($Be,"recordOrProd");function DY(t){return t===0?"":`${t}`}R(DY,"getIdxSuffix");function P6(t){if(t<0||t>Kge){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${Kge+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}R(P6,"assertMethodIdxIsValid");var Xx,Eer=(Xx=class{initPerformanceTracer(e){if(Hr(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=i0.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}=are(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},R(Xx,"PerformanceTracer"),Xx);function NBe(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]})})}R(NBe,"applyMixins");var EI=g7(lg,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(EI);var i0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Q2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),AI=Object.freeze({recoveryValueFunc:R(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),wl;(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"})(wl||(wl={}));function OY(t=void 0){return function(){return t}}R(OY,"EMPTY_ALT");var L1,Tre=(L1=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",()=>{sre(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=hBe({rules:cs(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ri(n)&&this.skipValidations===!1){const i=dBe({rules:cs(this.gastProductionsCache),tokenTypes:cs(this.tokensMap),errMsgProvider:u1,grammarName:r}),a=QPe({lookaheadStrategy:this.lookaheadStrategy,rules:cs(this.gastProductionsCache),tokenTypes:cs(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Ri(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=sPe(cs(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:cs(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(cs(this.gastProductionsCache))})),!L1.DEFER_DEFINITION_ERRORS_HANDLING&&!Ri(this.definitionErrors))throw e=Cr(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),Hr(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=Hr(r,"skipValidations")?r.skipValidations:i0.skipValidations}},R(L1,"Parser"),L1);xre.DEFER_DEFINITION_ERRORS_HANDLING=!1;LBe(xre,[oer,cer,der,fer,ger,per,mer,yer,ber,xer]);var Kx,wer=(Kx=class extends xre{constructor(e,r=i0){const n=go(r);n.outputCst=!1,super(e,n)}},R(Kx,"EmbeddedActionsParser"),Kx);function IBe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}R(zBe,"listCacheHas");var Aer=zBe;function HBe(t,e){var r=this.__data__,n=ZD(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}R(HBe,"listCacheSet");var Rer=HBe;function sv(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&Ntr?new xFe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=grr}R(WFe,"isLength");var kre=WFe,mrr="[object Arguments]",yrr="[object Array]",vrr="[object Boolean]",brr="[object Date]",xrr="[object Error]",wrr="[object Function]",Trr="[object Map]",krr="[object Number]",Crr="[object Object]",Srr="[object RegExp]",Err="[object Set]",Arr="[object String]",Rrr="[object WeakMap]",_rr="[object ArrayBuffer]",Mrr="[object DataView]",Lrr="[object Float32Array]",Irr="[object Float64Array]",$rr="[object Int8Array]",Nrr="[object Int16Array]",Drr="[object Int32Array]",Orr="[object Uint8Array]",Prr="[object Uint8ClampedArray]",Brr="[object Uint16Array]",Frr="[object Uint32Array]",Bi={};Bi[Lrr]=Bi[Irr]=Bi[$rr]=Bi[Nrr]=Bi[Drr]=Bi[Orr]=Bi[Prr]=Bi[Brr]=Bi[Frr]=!0;Bi[mrr]=Bi[yrr]=Bi[_rr]=Bi[vrr]=Bi[Mrr]=Bi[brr]=Bi[xrr]=Bi[wrr]=Bi[Trr]=Bi[krr]=Bi[Crr]=Bi[Srr]=Bi[Err]=Bi[Arr]=Bi[Rrr]=!1;function qFe(t){return p3(t)&&kre(t.length)&&!!Bi[ok(t)]}R(qFe,"baseIsTypedArray");var zrr=qFe;function GFe(t){return function(e){return t(e)}}R(GFe,"baseUnary");var Hrr=GFe,UFe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iS=UFe&&typeof module=="object"&&module&&!module.nodeType&&module,Vrr=iS&&iS.exports===UFe,Kz=Vrr&&UBe.process,Wrr=(function(){try{var t=iS&&iS.require&&iS.require("util").types;return t||Kz&&Kz.binding&&Kz.binding("util")}catch{}})(),ame=Wrr,sme=ame&&ame.isTypedArray,qrr=sme?Hrr(sme):zrr,Cre=qrr,Grr=Object.prototype,Urr=Grr.hasOwnProperty;function YFe(t,e){var r=Tl(t),n=!r&&tO(t),i=!r&&!n&&EI(t),a=!r&&!n&&!i&&Cre(t),s=r||n||i||a,o=s?irr(t.length,String):[],l=o.length;for(var u in t)(e||Urr.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||VFe(u,l)))&&o.push(u);return o}R(YFe,"arrayLikeKeys");var Yrr=YFe,jrr=Object.prototype;function jFe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||jrr;return t===r}R(jFe,"isPrototype");var XFe=jFe;function KFe(t,e){return function(r){return t(e(r))}}R(KFe,"overArg");var Xrr=KFe,Krr=Xrr(Object.keys,Object),Zrr=Krr,Qrr=Object.prototype,Jrr=Qrr.hasOwnProperty;function ZFe(t){if(!XFe(t))return Zrr(t);var e=[];for(var r in Object(t))Jrr.call(t,r)&&r!="constructor"&&e.push(r);return e}R(ZFe,"baseKeys");var QFe=ZFe;function JFe(t){return t!=null&&kre(t.length)&&!JBe(t)}R(JFe,"isArrayLike");var rO=JFe;function eze(t){return rO(t)?Yrr(t):QFe(t)}R(eze,"keys");var Sre=eze;function tze(t){return Qtr(t,Sre,nrr)}R(tze,"getAllKeys");var ome=tze,enr=1,tnr=Object.prototype,rnr=tnr.hasOwnProperty;function rze(t,e,r,n,i,a){var s=r&enr,o=ome(t),l=o.length,u=ome(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:rnr.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;++d$re(t,e,s));return hv(t,e,n,r,...i)}R(jze,"alternation");function Xze(t,e,r){const n=ps(t,e,r,{type:cg});S0(t,n);const i=hv(t,e,n,r,Og(t,e,r));return Kze(t,e,r,i)}R(Xze,"option");function Og(t,e,r){const n=Jnr(Cf(r.definition,i=>$re(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:Qze(t,n)}R(Og,"block");function Nre(t,e,r,n,i){const a=n.left,s=n.right,o=ps(t,e,r,{type:iir});S0(t,o);const l=ps(t,e,r,{type:zze});return a.loopback=o,l.loopback=o,t.decisionMap[yy(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Oa(s,o),i===void 0?(Oa(o,a),Oa(o,l)):(Oa(o,l),Oa(o,i.left),Oa(i.right,a)),{left:a,right:l}}R(Nre,"plus");function Dre(t,e,r,n,i){const a=n.left,s=n.right,o=ps(t,e,r,{type:nir});S0(t,o);const l=ps(t,e,r,{type:zze}),u=ps(t,e,r,{type:rir});return o.loopback=u,l.loopback=u,Oa(o,a),Oa(o,l),Oa(s,u),i!==void 0?(Oa(u,l),Oa(u,i.left),Oa(i.right,a)):Oa(u,o),t.decisionMap[yy(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}R(Dre,"star");function Kze(t,e,r,n){const i=n.left,a=n.right;return Oa(i,a),t.decisionMap[yy(e,"Option",r.idx)]=i,n}R(Kze,"optional");function S0(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}R(S0,"defineDecisionState");function hv(t,e,r,n,...i){const a=ps(t,e,n,{type:tir,start:r});r.end=a;for(const o of i)o!==void 0?(Oa(r,o.left),Oa(o.right,a)):Oa(r,a);const s={left:r,right:a};return t.decisionMap[yy(e,Zze(n),n.idx)]=r,s}R(hv,"makeAlts");function Zze(t){if(t instanceof ac)return"Alternation";if(t instanceof ho)return"Option";if(t instanceof Ea)return"Repetition";if(t instanceof ic)return"RepetitionWithSeparator";if(t instanceof Dc)return"RepetitionMandatory";if(t instanceof Oc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}R(Zze,"getProdType");function Qze(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}},R(t4,"ATNConfigSet"),t4);function Ore(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}R(Ore,"getATNConfigKey");function rHe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Pre(o,e-1,r,n,i):MFe(i,o):n||(i[i.length]=o)}return i}R(Pre,"baseFlatten");var sHe=Pre;function oHe(t,e){return sHe(Cf(t,e),1)}R(oHe,"flatMap");var cir=oHe;function lHe(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}R(dHe,"arrayIncludes");var pir=dHe;function fHe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=xir){var u=e?null:bir(t);if(u)return Tre(u);s=!1,i=kFe,l=new xFe}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}}R(SHe,"createDFACache");var r4,EHe=(r4=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=Vze(e.rules),this.dfas=AHe(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=yy(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Cf(SY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Cf(f,p=>p[0]));if(zY(d,!1)&&!a){const f=bme(d,(p,g,m)=>(Zz(g,y=>{y&&(p[y.tokenTypeIdx]=m,Zz(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 EHe,g=f===void 0?0:f.length;for(let y=0;yCf(f,p=>p[0]));if(zY(d)&&d[0][0]&&!a){const f=d[0],p=kir(f);if(p.length===1&&Mir(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=bme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,Zz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=e_.call(this,s,h,xme,o);return typeof f=="object"?!1:f===0}}},R(n4,"LLStarLookaheadStrategy"),n4);function zY(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}R(zY,"isLL1Sequence");function AHe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nR1(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${IHe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=Hr(r,"skipValidations")?r.skipValidations:i0.skipValidations}},R(L1,"Parser"),L1);Tre.DEFER_DEFINITION_ERRORS_HANDLING=!1;NBe(Tre,[fer,ger,ver,ber,wer,xer,Ter,ker,Ser,Eer]);var Kx,Aer=(Kx=class extends Tre{constructor(e,r=i0){const n=go(r);n.outputCst=!1,super(e,n)}},R(Kx,"EmbeddedActionsParser"),Kx);function DBe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}R(WBe,"listCacheHas");var $er=WBe;function qBe(t,e){var r=this.__data__,n=JD(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}R(qBe,"listCacheSet");var Ner=qBe;function sv(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&ztr?new kFe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=wrr}R(UFe,"isLength");var Sre=UFe,Trr="[object Arguments]",krr="[object Array]",Crr="[object Boolean]",Srr="[object Date]",Err="[object Error]",Arr="[object Function]",Rrr="[object Map]",_rr="[object Number]",Mrr="[object Object]",Lrr="[object RegExp]",Irr="[object Set]",$rr="[object String]",Nrr="[object WeakMap]",Drr="[object ArrayBuffer]",Orr="[object DataView]",Prr="[object Float32Array]",Brr="[object Float64Array]",Frr="[object Int8Array]",zrr="[object Int16Array]",Hrr="[object Int32Array]",Vrr="[object Uint8Array]",Wrr="[object Uint8ClampedArray]",qrr="[object Uint16Array]",Grr="[object Uint32Array]",Bi={};Bi[Prr]=Bi[Brr]=Bi[Frr]=Bi[zrr]=Bi[Hrr]=Bi[Vrr]=Bi[Wrr]=Bi[qrr]=Bi[Grr]=!0;Bi[Trr]=Bi[krr]=Bi[Drr]=Bi[Crr]=Bi[Orr]=Bi[Srr]=Bi[Err]=Bi[Arr]=Bi[Rrr]=Bi[_rr]=Bi[Mrr]=Bi[Lrr]=Bi[Irr]=Bi[$rr]=Bi[Nrr]=!1;function YFe(t){return p3(t)&&Sre(t.length)&&!!Bi[ok(t)]}R(YFe,"baseIsTypedArray");var Urr=YFe;function jFe(t){return function(e){return t(e)}}R(jFe,"baseUnary");var Yrr=jFe,XFe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iS=XFe&&typeof module=="object"&&module&&!module.nodeType&&module,jrr=iS&&iS.exports===XFe,Qz=jrr&&XBe.process,Xrr=(function(){try{var t=iS&&iS.require&&iS.require("util").types;return t||Qz&&Qz.binding&&Qz.binding("util")}catch{}})(),sme=Xrr,ome=sme&&sme.isTypedArray,Krr=ome?Yrr(ome):Urr,Ere=Krr,Zrr=Object.prototype,Qrr=Zrr.hasOwnProperty;function KFe(t,e){var r=Tl(t),n=!r&&nO(t),i=!r&&!n&&RI(t),a=!r&&!n&&!i&&Ere(t),s=r||n||i||a,o=s?urr(t.length,String):[],l=o.length;for(var u in t)(e||Qrr.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||GFe(u,l)))&&o.push(u);return o}R(KFe,"arrayLikeKeys");var Jrr=KFe,enr=Object.prototype;function ZFe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||enr;return t===r}R(ZFe,"isPrototype");var QFe=ZFe;function JFe(t,e){return function(r){return t(e(r))}}R(JFe,"overArg");var tnr=JFe,rnr=tnr(Object.keys,Object),nnr=rnr,inr=Object.prototype,anr=inr.hasOwnProperty;function eze(t){if(!QFe(t))return nnr(t);var e=[];for(var r in Object(t))anr.call(t,r)&&r!="constructor"&&e.push(r);return e}R(eze,"baseKeys");var tze=eze;function rze(t){return t!=null&&Sre(t.length)&&!rFe(t)}R(rze,"isArrayLike");var iO=rze;function nze(t){return iO(t)?Jrr(t):tze(t)}R(nze,"keys");var Are=nze;function ize(t){return irr(t,Are,crr)}R(ize,"getAllKeys");var lme=ize,snr=1,onr=Object.prototype,lnr=onr.hasOwnProperty;function aze(t,e,r,n,i,a){var s=r&snr,o=lme(t),l=o.length,u=lme(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:lnr.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;++dDre(t,e,s));return hv(t,e,n,r,...i)}R(Zze,"alternation");function Qze(t,e,r){const n=ps(t,e,r,{type:cg});S0(t,n);const i=hv(t,e,n,r,Og(t,e,r));return Jze(t,e,r,i)}R(Qze,"option");function Og(t,e,r){const n=air(Cf(r.definition,i=>Dre(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:tHe(t,n)}R(Og,"block");function Ore(t,e,r,n,i){const a=n.left,s=n.right,o=ps(t,e,r,{type:uir});S0(t,o);const l=ps(t,e,r,{type:Wze});return a.loopback=o,l.loopback=o,t.decisionMap[yy(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Oa(s,o),i===void 0?(Oa(o,a),Oa(o,l)):(Oa(o,l),Oa(o,i.left),Oa(i.right,a)),{left:a,right:l}}R(Ore,"plus");function Pre(t,e,r,n,i){const a=n.left,s=n.right,o=ps(t,e,r,{type:cir});S0(t,o);const l=ps(t,e,r,{type:Wze}),u=ps(t,e,r,{type:lir});return o.loopback=u,l.loopback=u,Oa(o,a),Oa(o,l),Oa(s,u),i!==void 0?(Oa(u,l),Oa(u,i.left),Oa(i.right,a)):Oa(u,o),t.decisionMap[yy(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}R(Pre,"star");function Jze(t,e,r,n){const i=n.left,a=n.right;return Oa(i,a),t.decisionMap[yy(e,"Option",r.idx)]=i,n}R(Jze,"optional");function S0(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}R(S0,"defineDecisionState");function hv(t,e,r,n,...i){const a=ps(t,e,n,{type:oir,start:r});r.end=a;for(const o of i)o!==void 0?(Oa(r,o.left),Oa(o.right,a)):Oa(r,a);const s={left:r,right:a};return t.decisionMap[yy(e,eHe(n),n.idx)]=r,s}R(hv,"makeAlts");function eHe(t){if(t instanceof ic)return"Alternation";if(t instanceof ho)return"Option";if(t instanceof Ea)return"Repetition";if(t instanceof nc)return"RepetitionWithSeparator";if(t instanceof Dc)return"RepetitionMandatory";if(t instanceof Oc)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}R(eHe,"getProdType");function tHe(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}},R(t4,"ATNConfigSet"),t4);function Bre(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}R(Bre,"getATNConfigKey");function aHe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Fre(o,e-1,r,n,i):$Fe(i,o):n||(i[i.length]=o)}return i}R(Fre,"baseFlatten");var cHe=Fre;function uHe(t,e){return cHe(Cf(t,e),1)}R(uHe,"flatMap");var gir=uHe;function hHe(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}R(gHe,"arrayIncludes");var xir=gHe;function mHe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=Eir){var u=e?null:Sir(t);if(u)return Cre(u);s=!1,i=EFe,l=new kFe}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}}R(RHe,"createDFACache");var r4,_He=(r4=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=Gze(e.rules),this.dfas=MHe(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=yy(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=Cf(AY({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>Cf(f,p=>p[0]));if(VY(d,!1)&&!a){const f=xme(d,(p,g,m)=>(Jz(g,y=>{y&&(p[y.tokenTypeIdx]=m,Jz(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 _He,g=f===void 0?0:f.length;for(let y=0;yCf(f,p=>p[0]));if(VY(d)&&d[0][0]&&!a){const f=d[0],p=_ir(f);if(p.length===1&&Oir(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=xme(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,Jz(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=t_.call(this,s,h,wme,o);return typeof f=="object"?!1:f===0}}},R(n4,"LLStarLookaheadStrategy"),n4);function VY(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}R(VY,"isLL1Sequence");function MHe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nR1(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${DHe(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}R(LHe,"buildAmbiguityError");function IHe(t){if(t instanceof xl)return"SUBRULE";if(t instanceof ho)return"OPTION";if(t instanceof ac)return"OR";if(t instanceof Dc)return"AT_LEAST_ONE";if(t instanceof Oc)return"AT_LEAST_ONE_SEP";if(t instanceof ic)return"MANY_SEP";if(t instanceof Ea)return"MANY";if(t instanceof Vi)return"CONSUME";throw Error("non exhaustive match")}R(IHe,"getProductionDslName");function $He(t,e,r){const n=cir(e.configs.elements,a=>a.state.transitions),i=Tir(n.filter(a=>a instanceof Lre).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}R($He,"buildAdaptivePredictError");function NHe(t,e){return t.edges[e.tokenTypeIdx]}R(NHe,"getExistingTargetState");function DHe(t,e,r){const n=new FY,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===y7){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!zHe(a))for(const s of i)a.add(s);return a}R(DHe,"computeReachSet");function OHe(t,e){if(t instanceof Lre&&hre(e,t.tokenType))return t.target}R(OHe,"getReachableTarget");function PHe(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}R(PHe,"getUniqueAlt");function Bre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}R(Bre,"newDFAState");function HY(t,e,r,n){return n=Fre(t,n),e.edges[r.tokenTypeIdx]=n,n}R(HY,"addDFAEdge");function Fre(t,e){if(e===AI)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}R(Fre,"addDFAState");function BHe(t){const e=new FY,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};z6(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}R(qHe,"hasConflictingAltSet");function GHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}R(GHe,"hasStateAssociatedWithOneAlt");ZE();var i4,UHe=(i4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Hre(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new uO;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new RI(e.startOffset,e.image.length,A6(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 RI(a.startOffset,a.image.length,A6(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)}},R(i4,"CstNodeBuilder"),i4),a4,zre=(a4=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)}},R(a4,"AbstractCstNode"),a4),s4,RI=(s4=class extends zre{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}},R(s4,"LeafCstNodeImpl"),s4),o4,uO=(o4=class extends zre{constructor(){super(...arguments),this.content=new Nir(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]}},R(o4,"CompositeCstNodeImpl"),o4),I1,Nir=(I1=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,I1.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}},R(I1,"CstNodeContainer"),I1),l4,Hre=(l4=class extends uO{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},R(l4,"RootCstNodeImpl"),l4),_I=Symbol("Datatype");function t_(t){return t.$type===_I}R(t_,"isDataTypeNode");var wme="​",YHe=R(t=>t.endsWith(wme)?t:t+wme,"withRuleSuffix"),c4,Vre=(c4=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 Oir(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new ZHe(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()}},R(c4,"AbstractLangiumParser"),c4),u4,jHe=(u4=class extends Vre{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new UHe,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;c3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(YHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),bl(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===_I?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=Jf(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(t_(u)){let h=i.image;Jf(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(t_(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)):t_(e)?this.converter.convert(e.value,e.$cstNode):(zee(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=jy(e,Qf);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Ky(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}},R(u4,"LangiumParser"),u4),h4,XHe=(h4=class{buildMismatchTokenMessage(e){return Q2.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Q2.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Q2.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Q2.buildEarlyExitMessage(e)}},R(h4,"AbstractParserErrorMessageProvider"),h4),d4,Wre=(d4=class extends XHe{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}\`.`}},R(d4,"LangiumParserErrorMessageProvider"),d4),f4,KHe=(f4=class extends Vre{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(YHe(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}},R(f4,"LangiumCompletionParser"),f4),Dir={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Wre},p4,ZHe=(p4=class extends wer{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Dir,lookaheadStrategy:n?new vre({maxLookahead:r.maxLookahead}):new $ir({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,{})}},R(p4,"ChevrotainWrapper"),p4),g4,Oir=(g4=class extends ZHe{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))}}},R(g4,"ProfilerWrapper"),g4);function hO(t,e,r){return QHe({parser:e,tokens:r,ruleNames:new Map},t),e}R(hO,"createParser");function QHe(t,e){const r=ED(e,!1),n=si(e.rules).filter(bl).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,ug(s,a.definition))}const i=si(e.rules).filter(c3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,JHe(t,a))}R(QHe,"buildRules");function JHe(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(vu(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:R(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=dO(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:R(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}R(JHe,"buildInfixRule");function ug(t,e,r=!1){let n;if(Jf(e))n=sVe(t,e);else if(sg(e))n=eVe(t,e);else if(Qf(e))n=ug(t,e.terminal);else if(Ky(e))n=qre(t,e);else if(e0(e))n=tVe(t,e);else if(yD(e))n=nVe(t,e);else if(wD(e))n=iVe(t,e);else if(Zy(e))n=aVe(t,e);else if(Yee(e)){const i=t.consume++;n=R(()=>t.parser.consume(i,lg,e),"method")}else throw new kD(e.$cstNode,`Unexpected element type: ${e.$type}`);return Gre(t,r?void 0:H6(e),n,e.cardinality)}R(ug,"buildElement");function eVe(t,e){const r=py(e);return()=>t.parser.action(r,e)}R(eVe,"buildAction");function tVe(t,e){const r=e.rule.ref;if(Xy(r)){const n=t.subrule++,i=bl(r)&&r.fragment,a=e.arguments.length>0?rVe(r,e.arguments):()=>({});let s;return o=>{s??(s=dO(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(vu(r)){const n=t.consume++,i=MI(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)$g();else throw new kD(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}R(tVe,"buildRuleCall");function rVe(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:zu(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=>zu(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(Gee(t)){const e=zu(t.left),r=zu(t.right);return n=>e(n)&&r(n)}else if(Kee(t)){const e=zu(t.value);return r=>!e(r)}else if(Zee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Wee(t)){const e=!!t.true;return()=>e}$g()}R(zu,"buildPredicate");function nVe(t,e){if(e.elements.length===1)return ug(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:ug(t,i,!0)},s=H6(i);s&&(a.GATE=zu(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:R(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}R(nVe,"buildAlternatives");function iVe(t,e){if(e.elements.length===1)return ug(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:ug(t,o,!0)},u=H6(o);u&&(l.GATE=zu(u)),r.push(l)}const n=t.or++,i=R((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=R(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:R(()=>!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=Gre(t,H6(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}R(iVe,"buildUnorderedGroup");function aVe(t,e){const r=e.elements.map(n=>ug(t,n));return n=>r.forEach(i=>i(n))}R(aVe,"buildGroup");function H6(t){if(Zy(t))return t.guardCondition}R(H6,"getGuardCondition");function qre(t,e,r=e.terminal){if(r)if(e0(r)&&bl(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=dO(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(e0(r)&&vu(r.rule.ref)){const n=t.consume++,i=MI(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Jf(r)){const n=t.consume++,i=MI(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=MD(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+py(e.type.ref));return qre(t,e,i)}}R(qre,"buildCrossReference");function sVe(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)}R(sVe,"buildKeyword");function Gre(t,e,r,n){const i=e&&zu(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:R(()=>r(s),"ALT"),GATE:R(()=>i(s),"GATE")},{ALT:NY(),GATE:R(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:R(()=>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:R(()=>t.parser.atLeastOne(a,{DEF:R(()=>r(o),"DEF")}),"ALT"),GATE:R(()=>i(o),"GATE")},{ALT:NY(),GATE:R(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:R(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:R(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else $g()}R(Gre,"wrap");function dO(t,e){const r=oVe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}R(dO,"getRule");function oVe(t,e){if(Xy(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!bl(n);)(Zy(n)||yD(n)||wD(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}R(oVe,"getRuleName");function MI(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}R(MI,"getToken");function Ure(t){const e=t.Grammar,r=t.parser.Lexer,n=new KHe(t);return hO(e,n,r.definition),n.finalize(),n}R(Ure,"createCompletionParser");function Yre(t){const e=jre(t);return e.finalize(),e}R(Yre,"createLangiumParser");function jre(t){const e=t.Grammar,r=t.parser.Lexer,n=new jHe(t);return hO(e,n,r.definition)}R(jre,"prepareLangiumParser");var m4,fO=(m4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=si(ED(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(vu).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=n7(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=SD(r)?pl.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(Xy).flatMap(i=>T0(i).filter(Jf)).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(tk(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&&bte("^"+a.source+"$",e.value)&&n.push(i),n},[])}},R(m4,"DefaultTokenBuilder"),m4),y4,Xre=(y4=class{convert(e,r){let n=r.grammarSource;if(Ky(n)&&(n=Cte(n)),e0(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 Oh.convertInt(r);case"STRING":return Oh.convertString(r);case"ID":return Oh.convertID(r)}switch((i=$te(e))==null?void 0:i.toLowerCase()){case"number":return Oh.convertNumber(r);case"boolean":return Oh.convertBoolean(r);case"bigint":return Oh.convertBigint(r);case"date":return Oh.convertDate(r);default:return r}}},R(y4,"DefaultValueConverter"),y4),Oh;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}R(pO,"delayNextTick");var r_=0,lVe=10;function gO(){return r_=performance.now(),new Ai.CancellationTokenSource}R(gO,"startCancelableOperation");function Kre(t){lVe=t}R(Kre,"setInterruptionPeriod");var Yh=Symbol("OperationCancelled");function dv(t){return t===Yh}R(dv,"isOperationCancelled");async function Rs(t){if(t===Ai.CancellationToken.None)return;const e=performance.now();if(e-r_>=lVe&&(r_=e,await pO(),r_=performance.now()),t.isCancellationRequested)throw Yh}R(Rs,"interruptAndCheck");var v4,a0=(v4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},R(v4,"Deferred"),v4),Op,Tme=(Op=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(Op.isIncremental(n)){const i=Qre(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=VY(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&&Zre(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}},R(Op,"FullTextDocument"),Op),LI;(function(t){function e(i,a,s,o){return new Tme(i,a,s,o)}R(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Tme)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}R(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=II(a.map(cVe),(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("")}R(n,"applyEdits"),t.applyEdits=n})(LI||(LI={}));function II(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);II(n,e),II(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}R(Qre,"getWellformedRange");function cVe(t){const e=Qre(t.range);return e!==t.range?{newText:t.newText,range:e}:t}R(cVe,"getWellformedEdit");var uVe;(()=>{var t={975:N=>{function _(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}R(_,"e");function I(D,$){for(var F,z="",H=0,B=-1,V=0,q=0;q<=D.length;++q){if(q2){var G=z.lastIndexOf("/");if(G!==z.length-1){G===-1?(z="",H=0):H=(z=z.slice(0,G)).length-1-z.lastIndexOf("/"),B=q,V=0;continue}}else if(z.length===2||z.length===1){z="",H=0,B=q,V=0;continue}}$&&(z.length>0?z+="/..":z="..",H=2)}else z.length>0?z+="/"+D.slice(B+1,q):z=D.slice(B+1,q),H=q-B-1;B=q,V=0}else F===46&&V!==-1?++V:V=-1}return z}R(I,"r");var O={resolve:R(function(){for(var D,$="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var H;z>=0?H=arguments[z]:(D===void 0&&(D=process.cwd()),H=D),_(H),H.length!==0&&($=H+"/"+$,F=H.charCodeAt(0)===47)}return $=I($,!F),F?$.length>0?"/"+$:"/":$.length>0?$:"."},"resolve"),normalize:R(function(D){if(_(D),D.length===0)return".";var $=D.charCodeAt(0)===47,F=D.charCodeAt(D.length-1)===47;return(D=I(D,!$)).length!==0||$||(D="."),D.length>0&&F&&(D+="/"),$?"/"+D:D},"normalize"),isAbsolute:R(function(D){return _(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:R(function(){if(arguments.length===0)return".";for(var D,$=0;$0&&(D===void 0?D=F:D+="/"+F)}return D===void 0?".":O.normalize(D)},"join"),relative:R(function(D,$){if(_(D),_($),D===$||(D=O.resolve(D))===($=O.resolve($)))return"";for(var F=1;Fq){if($.charCodeAt(B+Q)===47)return $.slice(B+Q+1);if(Q===0)return $.slice(B+Q)}else H>q&&(D.charCodeAt(F+Q)===47?G=Q:Q===0&&(G=0));break}var j=D.charCodeAt(F+Q);if(j!==$.charCodeAt(B+Q))break;j===47&&(G=Q)}var ae="";for(Q=F+G+1;Q<=z;++Q)Q!==z&&D.charCodeAt(Q)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+$.slice(B+G):(B+=G,$.charCodeAt(B)===47&&++B,$.slice(B))},"relative"),_makeLong:R(function(D){return D},"_makeLong"),dirname:R(function(D){if(_(D),D.length===0)return".";for(var $=D.charCodeAt(0),F=$===47,z=-1,H=!0,B=D.length-1;B>=1;--B)if(($=D.charCodeAt(B))===47){if(!H){z=B;break}}else H=!1;return z===-1?F?"/":".":F&&z===1?"//":D.slice(0,z)},"dirname"),basename:R(function(D,$){if($!==void 0&&typeof $!="string")throw new TypeError('"ext" argument must be a string');_(D);var F,z=0,H=-1,B=!0;if($!==void 0&&$.length>0&&$.length<=D.length){if($.length===D.length&&$===D)return"";var V=$.length-1,q=-1;for(F=D.length-1;F>=0;--F){var G=D.charCodeAt(F);if(G===47){if(!B){z=F+1;break}}else q===-1&&(B=!1,q=F+1),V>=0&&(G===$.charCodeAt(V)?--V==-1&&(H=F):(V=-1,H=q))}return z===H?H=q:H===-1&&(H=D.length),D.slice(z,H)}for(F=D.length-1;F>=0;--F)if(D.charCodeAt(F)===47){if(!B){z=F+1;break}}else H===-1&&(B=!1,H=F+1);return H===-1?"":D.slice(z,H)},"basename"),extname:R(function(D){_(D);for(var $=-1,F=0,z=-1,H=!0,B=0,V=D.length-1;V>=0;--V){var q=D.charCodeAt(V);if(q!==47)z===-1&&(H=!1,z=V+1),q===46?$===-1?$=V:B!==1&&(B=1):$!==-1&&(B=-1);else if(!H){F=V+1;break}}return $===-1||z===-1||B===0||B===1&&$===z-1&&$===F+1?"":D.slice($,z)},"extname"),format:R(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function($,F){var z=F.dir||F.root,H=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+H:z+"/"+H:H})(0,D)},"format"),parse:R(function(D){_(D);var $={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return $;var F,z=D.charCodeAt(0),H=z===47;H?($.root="/",F=1):F=0;for(var B=-1,V=0,q=-1,G=!0,Q=D.length-1,j=0;Q>=F;--Q)if((z=D.charCodeAt(Q))!==47)q===-1&&(G=!1,q=Q+1),z===46?B===-1?B=Q:j!==1&&(j=1):B!==-1&&(j=-1);else if(!G){V=Q+1;break}return B===-1||q===-1||j===0||j===1&&B===q-1&&B===V+1?q!==-1&&($.base=$.name=V===0&&H?D.slice(1,q):D.slice(V,q)):(V===0&&H?($.name=D.slice(1,B),$.base=D.slice(1,q)):($.name=D.slice(V,B),$.base=D.slice(V,q)),$.ext=D.slice(B,q)),V>0?$.dir=D.slice(0,V-1):H&&($.dir="/"),$},"parse"),sep:"/",delimiter:":",win32:null,posix:null};O.posix=O,N.exports=O}},e={};function r(N){var _=e[N];if(_!==void 0)return _.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}R(r,"r"),r.d=(N,_)=>{for(var I in _)r.o(_,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:_[I]})},r.o=(N,_)=>Object.prototype.hasOwnProperty.call(N,_),r.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:R(()=>f,"URI"),Utils:R(()=>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(N,_){if(!N.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!a.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!s.test(N.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(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}R(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(_,I,O,D,$,F=!1){Ut(this,"scheme");Ut(this,"authority");Ut(this,"path");Ut(this,"query");Ut(this,"fragment");typeof _=="object"?(this.scheme=_.scheme||u,this.authority=_.authority||u,this.path=_.path||u,this.query=_.query||u,this.fragment=_.fragment||u):(this.scheme=(function(z,H){return z||H?z:"file"})(_,F),this.authority=I||u,this.path=(function(z,H){switch(z){case"https":case"http":case"file":H?H[0]!==h&&(H=h+H):H=h}return H})(this.scheme,O||u),this.query=D||u,this.fragment=$||u,l(this,F))}static isUri(_){return _ instanceof L||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}get fsPath(){return x(this,!1)}with(_){if(!_)return this;let{scheme:I,authority:O,path:D,query:$,fragment:F}=_;return I===void 0?I=this.scheme:I===null&&(I=u),O===void 0?O=this.authority:O===null&&(O=u),D===void 0?D=this.path:D===null&&(D=u),$===void 0?$=this.query:$===null&&($=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&O===this.authority&&D===this.path&&$===this.query&&F===this.fragment?this:new g(I,O,D,$,F)}static parse(_,I=!1){const O=d.exec(_);return O?new g(O[2]||u,S(O[4]||u),S(O[5]||u),S(O[7]||u),S(O[9]||u),I):new g(u,u,u,u,u)}static file(_){let I=u;if(i&&(_=_.replace(/\\/g,h)),_[0]===h&&_[1]===h){const O=_.indexOf(h,2);O===-1?(I=_.substring(2),_=h):(I=_.substring(2,O),_=_.substring(O)||h)}return new g("file",I,_,u,u)}static from(_){const I=new g(_.scheme,_.authority,_.path,_.query,_.fragment);return l(I,!0),I}toString(_=!1){return b(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof L)return _;{const I=new g(_);return I._formatted=_.external,I._fsPath=_._sep===p?_.fsPath:null,I}}return _}};R(L,"l");let f=L;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);Ut(this,"_formatted",null);Ut(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(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}};R(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(N,_,I){let O,D=-1;for(let $=0;$=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||_&&F===47||I&&F===91||I&&F===93||I&&F===58)D!==-1&&(O+=encodeURIComponent(N.substring(D,$)),D=-1),O!==void 0&&(O+=N.charAt($));else{O===void 0&&(O=N.substr(0,$));const z=m[F];z!==void 0?(D!==-1&&(O+=encodeURIComponent(N.substring(D,$)),D=-1),O+=z):D===-1&&(D=$)}}return D!==-1&&(O+=encodeURIComponent(N.substring(D))),O!==void 0?O:N}R(y,"m");function v(N){let _;for(let I=0;I1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?_?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}R(x,"v");function b(N,_){const I=_?v:y;let O="",{scheme:D,authority:$,path:F,query:z,fragment:H}=N;if(D&&(O+=D,O+=":"),($||D==="file")&&(O+=h,O+=h),$){let B=$.indexOf("@");if(B!==-1){const V=$.substr(0,B);$=$.substr(B+1),B=V.lastIndexOf(":"),B===-1?O+=I(V,!1,!1):(O+=I(V.substr(0,B),!1,!1),O+=":",O+=I(V.substr(B+1),!1,!0)),O+="@"}$=$.toLowerCase(),B=$.lastIndexOf(":"),B===-1?O+=I($,!1,!0):(O+=I($.substr(0,B),!1,!0),O+=$.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)}`)}O+=I(F,!0,!1)}return z&&(O+="?",O+=I(z,!1,!1)),H&&(O+="#",O+=_?H:y(H,!1,!1)),O}R(b,"b");function T(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+T(N.substr(3)):N}}R(T,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(N){return N.match(k)?N.replace(k,(_=>T(_))):N}R(S,"w");var C=r(975);const E=C.posix||C,A="/";var M;(function(N){N.joinPath=function(_,...I){return _.with({path:E.join(_.path,...I)})},N.resolvePath=function(_,...I){let O=_.path,D=!1;O[0]!==A&&(O=A+O,D=!0);let $=E.resolve(O,...I);return D&&$[0]===A&&!_.authority&&($=$.substring(1)),_.with({path:$})},N.dirname=function(_){if(_.path.length===0||_.path===A)return _;let I=E.dirname(_.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),_.with({path:I})},N.basename=function(_){return E.basename(_.path)},N.extname=function(_){return E.extname(_.path)}})(M||(M={})),uVe=n})();var{URI:wc,Utils:Yk}=uVe,hl;(function(t){t.basename=Yk.basename,t.dirname=Yk.dirname,t.extname=Yk.extname,t.joinPath=Yk.joinPath,t.resolvePath=Yk.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())}R(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?wc.parse(s).path:s.path,u=typeof o=="string"?wc.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:hl.joinPath(wc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(hl.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}},R(b4,"UriTrie"),b4),wn;(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"})(wn||(wn={}));var x4,hVe=(x4=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Ai.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??wc.parse(e.uri),Ai.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Ai.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:wn.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:wn.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=wn.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=LI.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},R(x4,"DefaultLangiumDocumentFactory"),x4),w4,dVe=(w4=class{constructor(e){this.documentTrie=new Jre,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return si(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,wn.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=wn.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=wn.Changed;return this.documentTrie.delete(r),n}},R(w4,"DefaultLangiumDocuments"),w4),bm=Symbol("RefResolving"),T4,fVe=(T4=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=Ai.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 Qu(e.parseResult.value))await Rs(r),l3(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 Qu(e.parseResult.value))await Rs(r),l3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=bm;try{const i=this.getCandidate(e);if(Im(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=bm;try{const i=this.getCandidates(e),a=[];if(Im(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(Xa(this._ref))return this._ref;if(Pee(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=bm;const o=kb(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(Im(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=kb(e.container).$document;n&&n.stateKy(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Rte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ul(i)||ed(i))return KL(i);if(Array.isArray(i)){for(const a of i)if((ul(a)||ed(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return KL(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||ote(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 l3(n))if(ed(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=>hl.equals(a.sourceUri,r.documentUri))),n.push(...i),si(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Zu(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:h3(a),local:!0})}}return n}},R(C4,"DefaultReferences"),C4),S4,s0=(S4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return E6.sum(si(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?si(r):a3}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 si(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return si(this.map.keys())}values(){return si(this.map.values()).flat()}entriesGroupedByKey(){return si(this.map.entries())}},R(S4,"MultiMap"),S4),E4,$I=(E4=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}},R(E4,"BiMap"),E4),A4,mVe=(A4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Ai.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=JE,i=Ai.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Rs(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=Ai.CancellationToken.None){const n=e.parseResult.value,i=new s0;for(const a of T0(n))await Rs(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))}}},R(A4,"DefaultScopeComputation"),A4),R4,WY=(R4=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}},R(R4,"StreamScope"),R4),_4,Pir=(_4=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?si(i).concat(this.outerScope.getElements(e)):si(i)}getAllElements(){let e=si(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},R(_4,"MapScope"),_4),M4,yVe=(M4=class{constructor(e,r,n){this.elements=new s0,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?si(n).concat(this.outerScope.getElements(e)):si(n)}getAllElements(){let e=si(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},R(M4,"MultiMapScope"),M4),Bir={getElement(){},getElements(){return a3},getAllElements(){return a3}},L4,mO=(L4=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")}},R(L4,"DisposableCache"),L4),I4,tne=(I4=class extends mO{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()}},R(I4,"SimpleCache"),I4),$4,yO=($4=class extends mO{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}},R($4,"ContextCache"),$4),N4,vVe=(N4=class extends yO{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)}))}},R(N4,"DocumentCache"),N4),D4,rne=(D4=class extends tne{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()}))}},R(D4,"WorkspaceCache"),D4),O4,bVe=(O4=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 rne(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Zu(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 WY(si(e),r,n)}createScopeForNodes(e,r,n){const i=si(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new WY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new yVe(this.indexManager.allElements(e)))}},R(O4,"DefaultScopeProvider"),O4);function nne(t){return typeof t.$comment=="string"}R(nne,"isAstNodeWithComment");function qY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}R(qY,"isIntermediateReference");var P4,xVe=(P4=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=R((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Zu(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(ul(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Zu(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(ed(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Zu(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(Xa(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=R(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=Ete(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(dv(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=si(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}},R(F4,"ValidationRegistry"),F4),kVe=Object.freeze({validateNode:!0,validateChildren:!0}),z4,CVe=(z4=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=Ai.CancellationToken.None){const i=e.parseResult,a=[];if(await Rs(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)===eu.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===eu.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===eu.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(dv(s))throw s;console.error("An error occurred during validation:",s)}return await Rs(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:aS(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:ane(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=A6(i.token);if(a){const s={severity:aS("error"),range:a,message:i.message,data:h1(eu.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:eu.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=Ai.CancellationToken.None){const i=[],a=R((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=Ai.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Rs(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Ai.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=Qu(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=Qu(e).iterator();for(const o of s){await Rs(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 kVe}async validateAstAfter(e,r,n,i=Ai.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Rs(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:ine(n),severity:aS(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},R(z4,"DefaultDocumentValidator"),z4);function ine(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=AD(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Ate(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}}}R(ine,"getDiagnosticRange");function aS(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)}}R(aS,"toDiagnosticSeverity");function ane(t){switch(t){case"error":return h1(eu.LexingError);case"warning":return h1(eu.LexingWarning);case"info":return h1(eu.LexingInfo);case"hint":return h1(eu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}R(ane,"toDiagnosticData");var eu;(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"})(eu||(eu={}));var H4,SVe=(H4=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Zu(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=R(()=>s??(s=h3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:h3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},R(H4,"DefaultAstNodeDescriptionProvider"),H4),V4,EVe=(V4=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Ai.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Qu(i))await Rs(r),l3(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=[];ul(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ed(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Zu(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=h3(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:hl.equals(l.documentUri,i)});return s}},R(V4,"DefaultReferenceDescriptionProvider"),V4),W4,AVe=(W4=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)}},R(W4,"DefaultAstNodeLocator"),W4),vO={};dD(vO,$ee(J3()));var q4,RVe=(q4=class{constructor(e){this._ready=new a0,this.onConfigurationSectionUpdateEmitter=new vO.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}},R(q4,"DefaultConfigurationProvider"),q4),d8=$ee(vYt()),_1;(function(t){function e(r){return{dispose:R(async()=>await r(),"dispose")}}R(e,"create"),t.create=e})(_1||(_1={}));var G4,_Ve=(G4=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new s0,this.documentPhaseListeners=new s0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=wn.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=Ai.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===wn.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,wn.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=wn.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=wn.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Ai.CancellationToken.None){this.currentState=wn.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=wn.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,wn.Changed)}const s=si(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,wn.ComputedScopes)),await this.emitUpdate(a,i),await Rs(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 si(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),_1.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case wn.Changed:case wn.Parsed:this.indexManager.removeContent(e.uri);case wn.IndexedContent:e.localSymbols=void 0;case wn.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case wn.Linked:this.indexManager.removeReferences(e.uri);case wn.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case wn.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=wn.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,wn.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,wn.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,wn.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,wn.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,wn.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,wn.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),_1.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),_1.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Ai.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(Yh);if(this.currentState>=e&&e>i.state)return Promise.reject(new d8.ResponseError(d8.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${wn[i.state]}, requiring ${wn[e]}, but workspace state is already ${wn[this.currentState]}. Returning undefined.`))}else return Promise.reject(new d8.ResponseError(d8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{hl.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Yh)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Yh):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Yh)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Rs(n),await s(e,n)}catch(o){if(!dv(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 Rs(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=si(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)??{}}},R(G4,"DefaultDocumentBuilder"),G4),U4,MVe=(U4=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new yO,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Zu(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{hl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),si(i)}allElements(e,r){let n=si(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=Ai.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=Ai.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}},R(U4,"DefaultIndexManager"),U4),Y4,LVe=(Y4=class{constructor(e){this.initialBuildOptions={},this._ready=new a0,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=Ai.CancellationToken.None){const n=await this.performStartup(e);await Rs(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=R(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=si(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 wc.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=hl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},R(Y4,"DefaultWorkspaceManager"),Y4),j4,IVe=(j4=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return CY.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return CY.buildUnableToPopLexerModeMessage(e)}},R(j4,"DefaultLexerErrorMessageProvider"),j4),sne={mode:"full"},X4,one=(X4=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=DI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new pl(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=sne){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(DI(e))return e;const r=xO(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},R(X4,"DefaultLexer"),X4);function bO(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}R(bO,"isTokenTypeArray");function xO(t){return t&&"modes"in t&&"defaultMode"in t}R(xO,"isIMultiModeLexerDefinition");function DI(t){return!bO(t)&&!xO(t)}R(DI,"isTokenTypeDictionary");ZE();function lne(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Kn.create(0,0));const a=une(t),s=wO(n),o=$Ve({lines:a,position:i,options:s});return OVe({index:0,tokens:o,position:i})}R(lne,"parseJSDoc");function cne(t,e){const r=wO(e),n=une(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))}R(cne,"isJSDoc");function une(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(PIe)}R(une,"getLines");var kme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Fir=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function $Ve(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=Kn.create(r,n);e.push({type:"break",content:"",range:An.create(p,p)})}}else{kme.lastIndex=d;const p=kme.exec(h);if(p){const g=p[0],m=p[1],y=Kn.create(r,n+d),v=Kn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:An.create(y,v)}),d+=g.length,d=OI(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}R($Ve,"tokenize");function NVe(t,e,r,n){const i=[];if(t.length===0){const a=Kn.create(r,n),s=Kn.create(r,n+e.length);i.push({type:"text",content:e,range:An.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:An.create(Kn.create(r,a+n),Kn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:An.create(Kn.create(r,a+h+n),Kn.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:An.create(Kn.create(r,a+h+n),Kn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:An.create(Kn.create(r,a+h+n),Kn.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:An.create(Kn.create(r,a+n),Kn.create(r,a+n+s.length))})}return i}R(NVe,"buildInlineTokens");var zir=/\S/,Hir=/\s*$/;function OI(t,e){const r=t.substring(e).match(zir);return r?e+r.index:t.length}R(OI,"skipWhitespace");function DVe(t){const e=t.match(Hir);if(e&&typeof e.index=="number")return e.index}R(DVe,"lastCharacter");function OVe(t){var a,s;const e=Kn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Cme([],An.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+=UY(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+=UY(r)+i}return r.trim()}},R(K4,"JSDocCommentImpl"),K4),Z4,Qz=(Z4=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=zVe(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}},R(Z4,"JSDocTagImpl"),Z4);function zVe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=OI(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))??HVe(e,a)}}R(zVe,"renderInlineTag");function HVe(t,e){try{return wc.parse(t,!0),`[${e}](${t})`}catch{return t}}R(HVe,"renderLinkDefault");var Q4,GY=(Q4=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}R(NHe,"buildAmbiguityError");function DHe(t){if(t instanceof xl)return"SUBRULE";if(t instanceof ho)return"OPTION";if(t instanceof ic)return"OR";if(t instanceof Dc)return"AT_LEAST_ONE";if(t instanceof Oc)return"AT_LEAST_ONE_SEP";if(t instanceof nc)return"MANY_SEP";if(t instanceof Ea)return"MANY";if(t instanceof Vi)return"CONSUME";throw Error("non exhaustive match")}R(DHe,"getProductionDslName");function OHe(t,e,r){const n=gir(e.configs.elements,a=>a.state.transitions),i=Rir(n.filter(a=>a instanceof $re).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}R(OHe,"buildAdaptivePredictError");function PHe(t,e){return t.edges[e.tokenTypeIdx]}R(PHe,"getExistingTargetState");function BHe(t,e,r){const n=new HY,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===v7){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!WHe(a))for(const s of i)a.add(s);return a}R(BHe,"computeReachSet");function FHe(t,e){if(t instanceof $re&&fre(e,t.tokenType))return t.target}R(FHe,"getReachableTarget");function zHe(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}R(zHe,"getUniqueAlt");function zre(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}R(zre,"newDFAState");function WY(t,e,r,n){return n=Hre(t,n),e.edges[r.tokenTypeIdx]=n,n}R(WY,"addDFAEdge");function Hre(t,e){if(e===_I)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}R(Hre,"addDFAState");function HHe(t){const e=new HY,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};H6(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}R(YHe,"hasConflictingAltSet");function jHe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}R(jHe,"hasStateAssociatedWithOneAlt");QE();var i4,XHe=(i4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Wre(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new dO;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new MI(e.startOffset,e.image.length,R6(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 MI(a.startOffset,a.image.length,R6(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)}},R(i4,"CstNodeBuilder"),i4),a4,Vre=(a4=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)}},R(a4,"AbstractCstNode"),a4),s4,MI=(s4=class extends Vre{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}},R(s4,"LeafCstNodeImpl"),s4),o4,dO=(o4=class extends Vre{constructor(){super(...arguments),this.content=new zir(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]}},R(o4,"CompositeCstNodeImpl"),o4),I1,zir=(I1=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,I1.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}},R(I1,"CstNodeContainer"),I1),l4,Wre=(l4=class extends dO{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},R(l4,"RootCstNodeImpl"),l4),LI=Symbol("Datatype");function r_(t){return t.$type===LI}R(r_,"isDataTypeNode");var Tme="​",KHe=R(t=>t.endsWith(Tme)?t:t+Tme,"withRuleSuffix"),c4,qre=(c4=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 Vir(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new eVe(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()}},R(c4,"AbstractLangiumParser"),c4),u4,ZHe=(u4=class extends qre{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new XHe,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;c3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(KHe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),bl(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===LI?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=Jf(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(r_(u)){let h=i.image;Jf(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(r_(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)):r_(e)?this.converter.convert(e.value,e.$cstNode):(Vee(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=jy(e,Qf);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Ky(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}},R(u4,"LangiumParser"),u4),h4,QHe=(h4=class{buildMismatchTokenMessage(e){return Q2.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Q2.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Q2.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Q2.buildEarlyExitMessage(e)}},R(h4,"AbstractParserErrorMessageProvider"),h4),d4,Gre=(d4=class extends QHe{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}\`.`}},R(d4,"LangiumParserErrorMessageProvider"),d4),f4,JHe=(f4=class extends qre{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(KHe(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}},R(f4,"LangiumCompletionParser"),f4),Hir={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Gre},p4,eVe=(p4=class extends Aer{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...Hir,lookaheadStrategy:n?new xre({maxLookahead:r.maxLookahead}):new Fir({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,{})}},R(p4,"ChevrotainWrapper"),p4),g4,Vir=(g4=class extends eVe{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))}}},R(g4,"ProfilerWrapper"),g4);function fO(t,e,r){return tVe({parser:e,tokens:r,ruleNames:new Map},t),e}R(fO,"createParser");function tVe(t,e){const r=RD(e,!1),n=si(e.rules).filter(bl).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,ug(s,a.definition))}const i=si(e.rules).filter(c3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,rVe(t,a))}R(tVe,"buildRules");function rVe(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(vu(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:R(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=pO(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:R(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}R(rVe,"buildInfixRule");function ug(t,e,r=!1){let n;if(Jf(e))n=cVe(t,e);else if(sg(e))n=nVe(t,e);else if(Qf(e))n=ug(t,e.terminal);else if(Ky(e))n=Ure(t,e);else if(e0(e))n=iVe(t,e);else if(bD(e))n=sVe(t,e);else if(kD(e))n=oVe(t,e);else if(Zy(e))n=lVe(t,e);else if(Xee(e)){const i=t.consume++;n=R(()=>t.parser.consume(i,lg,e),"method")}else throw new SD(e.$cstNode,`Unexpected element type: ${e.$type}`);return Yre(t,r?void 0:V6(e),n,e.cardinality)}R(ug,"buildElement");function nVe(t,e){const r=py(e);return()=>t.parser.action(r,e)}R(nVe,"buildAction");function iVe(t,e){const r=e.rule.ref;if(Xy(r)){const n=t.subrule++,i=bl(r)&&r.fragment,a=e.arguments.length>0?aVe(r,e.arguments):()=>({});let s;return o=>{s??(s=pO(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(vu(r)){const n=t.consume++,i=II(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)$g();else throw new SD(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}R(iVe,"buildRuleCall");function aVe(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:zu(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=>zu(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(Yee(t)){const e=zu(t.left),r=zu(t.right);return n=>e(n)&&r(n)}else if(Qee(t)){const e=zu(t.value);return r=>!e(r)}else if(Jee(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Gee(t)){const e=!!t.true;return()=>e}$g()}R(zu,"buildPredicate");function sVe(t,e){if(e.elements.length===1)return ug(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:ug(t,i,!0)},s=V6(i);s&&(a.GATE=zu(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:R(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}R(sVe,"buildAlternatives");function oVe(t,e){if(e.elements.length===1)return ug(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:ug(t,o,!0)},u=V6(o);u&&(l.GATE=zu(u)),r.push(l)}const n=t.or++,i=R((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=R(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:R(()=>!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=Yre(t,V6(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}R(oVe,"buildUnorderedGroup");function lVe(t,e){const r=e.elements.map(n=>ug(t,n));return n=>r.forEach(i=>i(n))}R(lVe,"buildGroup");function V6(t){if(Zy(t))return t.guardCondition}R(V6,"getGuardCondition");function Ure(t,e,r=e.terminal){if(r)if(e0(r)&&bl(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=pO(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(e0(r)&&vu(r.rule.ref)){const n=t.consume++,i=II(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Jf(r)){const n=t.consume++,i=II(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=ID(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+py(e.type.ref));return Ure(t,e,i)}}R(Ure,"buildCrossReference");function cVe(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)}R(cVe,"buildKeyword");function Yre(t,e,r,n){const i=e&&zu(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:R(()=>r(s),"ALT"),GATE:R(()=>i(s),"GATE")},{ALT:OY(),GATE:R(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:R(()=>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:R(()=>t.parser.atLeastOne(a,{DEF:R(()=>r(o),"DEF")}),"ALT"),GATE:R(()=>i(o),"GATE")},{ALT:OY(),GATE:R(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:R(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:R(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else $g()}R(Yre,"wrap");function pO(t,e){const r=uVe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}R(pO,"getRule");function uVe(t,e){if(Xy(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!bl(n);)(Zy(n)||bD(n)||kD(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}R(uVe,"getRuleName");function II(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}R(II,"getToken");function jre(t){const e=t.Grammar,r=t.parser.Lexer,n=new JHe(t);return fO(e,n,r.definition),n.finalize(),n}R(jre,"createCompletionParser");function Xre(t){const e=Kre(t);return e.finalize(),e}R(Xre,"createLangiumParser");function Kre(t){const e=t.Grammar,r=t.parser.Lexer,n=new ZHe(t);return fO(e,n,r.definition)}R(Kre,"prepareLangiumParser");var m4,gO=(m4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=si(RD(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(vu).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=i7(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=AD(r)?pl.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(Xy).flatMap(i=>T0(i).filter(Jf)).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(tk(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&&wte("^"+a.source+"$",e.value)&&n.push(i),n},[])}},R(m4,"DefaultTokenBuilder"),m4),y4,Zre=(y4=class{convert(e,r){let n=r.grammarSource;if(Ky(n)&&(n=Ete(n)),e0(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 Ph.convertInt(r);case"STRING":return Ph.convertString(r);case"ID":return Ph.convertID(r)}switch((i=Dte(e))==null?void 0:i.toLowerCase()){case"number":return Ph.convertNumber(r);case"boolean":return Ph.convertBoolean(r);case"bigint":return Ph.convertBigint(r);case"date":return Ph.convertDate(r);default:return r}}},R(y4,"DefaultValueConverter"),y4),Ph;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}R(mO,"delayNextTick");var n_=0,hVe=10;function yO(){return n_=performance.now(),new Ai.CancellationTokenSource}R(yO,"startCancelableOperation");function Qre(t){hVe=t}R(Qre,"setInterruptionPeriod");var jh=Symbol("OperationCancelled");function dv(t){return t===jh}R(dv,"isOperationCancelled");async function Rs(t){if(t===Ai.CancellationToken.None)return;const e=performance.now();if(e-n_>=hVe&&(n_=e,await mO(),n_=performance.now()),t.isCancellationRequested)throw jh}R(Rs,"interruptAndCheck");var v4,a0=(v4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},R(v4,"Deferred"),v4),Op,kme=(Op=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(Op.isIncremental(n)){const i=ene(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=qY(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&&Jre(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}},R(Op,"FullTextDocument"),Op),$I;(function(t){function e(i,a,s,o){return new kme(i,a,s,o)}R(e,"create"),t.create=e;function r(i,a,s){if(i instanceof kme)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}R(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=NI(a.map(dVe),(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("")}R(n,"applyEdits"),t.applyEdits=n})($I||($I={}));function NI(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);NI(n,e),NI(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}R(ene,"getWellformedRange");function dVe(t){const e=ene(t.range);return e!==t.range?{newText:t.newText,range:e}:t}R(dVe,"getWellformedEdit");var fVe;(()=>{var t={975:N=>{function _(D){if(typeof D!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(D))}R(_,"e");function I(D,$){for(var F,z="",H=0,B=-1,V=0,q=0;q<=D.length;++q){if(q2){var G=z.lastIndexOf("/");if(G!==z.length-1){G===-1?(z="",H=0):H=(z=z.slice(0,G)).length-1-z.lastIndexOf("/"),B=q,V=0;continue}}else if(z.length===2||z.length===1){z="",H=0,B=q,V=0;continue}}$&&(z.length>0?z+="/..":z="..",H=2)}else z.length>0?z+="/"+D.slice(B+1,q):z=D.slice(B+1,q),H=q-B-1;B=q,V=0}else F===46&&V!==-1?++V:V=-1}return z}R(I,"r");var O={resolve:R(function(){for(var D,$="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var H;z>=0?H=arguments[z]:(D===void 0&&(D=process.cwd()),H=D),_(H),H.length!==0&&($=H+"/"+$,F=H.charCodeAt(0)===47)}return $=I($,!F),F?$.length>0?"/"+$:"/":$.length>0?$:"."},"resolve"),normalize:R(function(D){if(_(D),D.length===0)return".";var $=D.charCodeAt(0)===47,F=D.charCodeAt(D.length-1)===47;return(D=I(D,!$)).length!==0||$||(D="."),D.length>0&&F&&(D+="/"),$?"/"+D:D},"normalize"),isAbsolute:R(function(D){return _(D),D.length>0&&D.charCodeAt(0)===47},"isAbsolute"),join:R(function(){if(arguments.length===0)return".";for(var D,$=0;$0&&(D===void 0?D=F:D+="/"+F)}return D===void 0?".":O.normalize(D)},"join"),relative:R(function(D,$){if(_(D),_($),D===$||(D=O.resolve(D))===($=O.resolve($)))return"";for(var F=1;Fq){if($.charCodeAt(B+Q)===47)return $.slice(B+Q+1);if(Q===0)return $.slice(B+Q)}else H>q&&(D.charCodeAt(F+Q)===47?G=Q:Q===0&&(G=0));break}var j=D.charCodeAt(F+Q);if(j!==$.charCodeAt(B+Q))break;j===47&&(G=Q)}var ae="";for(Q=F+G+1;Q<=z;++Q)Q!==z&&D.charCodeAt(Q)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+$.slice(B+G):(B+=G,$.charCodeAt(B)===47&&++B,$.slice(B))},"relative"),_makeLong:R(function(D){return D},"_makeLong"),dirname:R(function(D){if(_(D),D.length===0)return".";for(var $=D.charCodeAt(0),F=$===47,z=-1,H=!0,B=D.length-1;B>=1;--B)if(($=D.charCodeAt(B))===47){if(!H){z=B;break}}else H=!1;return z===-1?F?"/":".":F&&z===1?"//":D.slice(0,z)},"dirname"),basename:R(function(D,$){if($!==void 0&&typeof $!="string")throw new TypeError('"ext" argument must be a string');_(D);var F,z=0,H=-1,B=!0;if($!==void 0&&$.length>0&&$.length<=D.length){if($.length===D.length&&$===D)return"";var V=$.length-1,q=-1;for(F=D.length-1;F>=0;--F){var G=D.charCodeAt(F);if(G===47){if(!B){z=F+1;break}}else q===-1&&(B=!1,q=F+1),V>=0&&(G===$.charCodeAt(V)?--V==-1&&(H=F):(V=-1,H=q))}return z===H?H=q:H===-1&&(H=D.length),D.slice(z,H)}for(F=D.length-1;F>=0;--F)if(D.charCodeAt(F)===47){if(!B){z=F+1;break}}else H===-1&&(B=!1,H=F+1);return H===-1?"":D.slice(z,H)},"basename"),extname:R(function(D){_(D);for(var $=-1,F=0,z=-1,H=!0,B=0,V=D.length-1;V>=0;--V){var q=D.charCodeAt(V);if(q!==47)z===-1&&(H=!1,z=V+1),q===46?$===-1?$=V:B!==1&&(B=1):$!==-1&&(B=-1);else if(!H){F=V+1;break}}return $===-1||z===-1||B===0||B===1&&$===z-1&&$===F+1?"":D.slice($,z)},"extname"),format:R(function(D){if(D===null||typeof D!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof D);return(function($,F){var z=F.dir||F.root,H=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+H:z+"/"+H:H})(0,D)},"format"),parse:R(function(D){_(D);var $={root:"",dir:"",base:"",ext:"",name:""};if(D.length===0)return $;var F,z=D.charCodeAt(0),H=z===47;H?($.root="/",F=1):F=0;for(var B=-1,V=0,q=-1,G=!0,Q=D.length-1,j=0;Q>=F;--Q)if((z=D.charCodeAt(Q))!==47)q===-1&&(G=!1,q=Q+1),z===46?B===-1?B=Q:j!==1&&(j=1):B!==-1&&(j=-1);else if(!G){V=Q+1;break}return B===-1||q===-1||j===0||j===1&&B===q-1&&B===V+1?q!==-1&&($.base=$.name=V===0&&H?D.slice(1,q):D.slice(V,q)):(V===0&&H?($.name=D.slice(1,B),$.base=D.slice(1,q)):($.name=D.slice(V,B),$.base=D.slice(V,q)),$.ext=D.slice(B,q)),V>0?$.dir=D.slice(0,V-1):H&&($.dir="/"),$},"parse"),sep:"/",delimiter:":",win32:null,posix:null};O.posix=O,N.exports=O}},e={};function r(N){var _=e[N];if(_!==void 0)return _.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}R(r,"r"),r.d=(N,_)=>{for(var I in _)r.o(_,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:_[I]})},r.o=(N,_)=>Object.prototype.hasOwnProperty.call(N,_),r.r=N=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:R(()=>f,"URI"),Utils:R(()=>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(N,_){if(!N.scheme&&_)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!a.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!s.test(N.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(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}R(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(_,I,O,D,$,F=!1){Ut(this,"scheme");Ut(this,"authority");Ut(this,"path");Ut(this,"query");Ut(this,"fragment");typeof _=="object"?(this.scheme=_.scheme||u,this.authority=_.authority||u,this.path=_.path||u,this.query=_.query||u,this.fragment=_.fragment||u):(this.scheme=(function(z,H){return z||H?z:"file"})(_,F),this.authority=I||u,this.path=(function(z,H){switch(z){case"https":case"http":case"file":H?H[0]!==h&&(H=h+H):H=h}return H})(this.scheme,O||u),this.query=D||u,this.fragment=$||u,l(this,F))}static isUri(_){return _ instanceof L||!!_&&typeof _.authority=="string"&&typeof _.fragment=="string"&&typeof _.path=="string"&&typeof _.query=="string"&&typeof _.scheme=="string"&&typeof _.fsPath=="string"&&typeof _.with=="function"&&typeof _.toString=="function"}get fsPath(){return x(this,!1)}with(_){if(!_)return this;let{scheme:I,authority:O,path:D,query:$,fragment:F}=_;return I===void 0?I=this.scheme:I===null&&(I=u),O===void 0?O=this.authority:O===null&&(O=u),D===void 0?D=this.path:D===null&&(D=u),$===void 0?$=this.query:$===null&&($=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&O===this.authority&&D===this.path&&$===this.query&&F===this.fragment?this:new g(I,O,D,$,F)}static parse(_,I=!1){const O=d.exec(_);return O?new g(O[2]||u,S(O[4]||u),S(O[5]||u),S(O[7]||u),S(O[9]||u),I):new g(u,u,u,u,u)}static file(_){let I=u;if(i&&(_=_.replace(/\\/g,h)),_[0]===h&&_[1]===h){const O=_.indexOf(h,2);O===-1?(I=_.substring(2),_=h):(I=_.substring(2,O),_=_.substring(O)||h)}return new g("file",I,_,u,u)}static from(_){const I=new g(_.scheme,_.authority,_.path,_.query,_.fragment);return l(I,!0),I}toString(_=!1){return b(this,_)}toJSON(){return this}static revive(_){if(_){if(_ instanceof L)return _;{const I=new g(_);return I._formatted=_.external,I._fsPath=_._sep===p?_.fsPath:null,I}}return _}};R(L,"l");let f=L;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);Ut(this,"_formatted",null);Ut(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=x(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}};R(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(N,_,I){let O,D=-1;for(let $=0;$=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||_&&F===47||I&&F===91||I&&F===93||I&&F===58)D!==-1&&(O+=encodeURIComponent(N.substring(D,$)),D=-1),O!==void 0&&(O+=N.charAt($));else{O===void 0&&(O=N.substr(0,$));const z=m[F];z!==void 0?(D!==-1&&(O+=encodeURIComponent(N.substring(D,$)),D=-1),O+=z):D===-1&&(D=$)}}return D!==-1&&(O+=encodeURIComponent(N.substring(D))),O!==void 0?O:N}R(y,"m");function v(N){let _;for(let I=0;I1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?_?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}R(x,"v");function b(N,_){const I=_?v:y;let O="",{scheme:D,authority:$,path:F,query:z,fragment:H}=N;if(D&&(O+=D,O+=":"),($||D==="file")&&(O+=h,O+=h),$){let B=$.indexOf("@");if(B!==-1){const V=$.substr(0,B);$=$.substr(B+1),B=V.lastIndexOf(":"),B===-1?O+=I(V,!1,!1):(O+=I(V.substr(0,B),!1,!1),O+=":",O+=I(V.substr(B+1),!1,!0)),O+="@"}$=$.toLowerCase(),B=$.lastIndexOf(":"),B===-1?O+=I($,!1,!0):(O+=I($.substr(0,B),!1,!0),O+=$.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)}`)}O+=I(F,!0,!1)}return z&&(O+="?",O+=I(z,!1,!1)),H&&(O+="#",O+=_?H:y(H,!1,!1)),O}R(b,"b");function T(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+T(N.substr(3)):N}}R(T,"C");const k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(N){return N.match(k)?N.replace(k,(_=>T(_))):N}R(S,"w");var C=r(975);const E=C.posix||C,A="/";var M;(function(N){N.joinPath=function(_,...I){return _.with({path:E.join(_.path,...I)})},N.resolvePath=function(_,...I){let O=_.path,D=!1;O[0]!==A&&(O=A+O,D=!0);let $=E.resolve(O,...I);return D&&$[0]===A&&!_.authority&&($=$.substring(1)),_.with({path:$})},N.dirname=function(_){if(_.path.length===0||_.path===A)return _;let I=E.dirname(_.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),_.with({path:I})},N.basename=function(_){return E.basename(_.path)},N.extname=function(_){return E.extname(_.path)}})(M||(M={})),fVe=n})();var{URI:wc,Utils:Yk}=fVe,hl;(function(t){t.basename=Yk.basename,t.dirname=Yk.dirname,t.extname=Yk.extname,t.joinPath=Yk.joinPath,t.resolvePath=Yk.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())}R(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?wc.parse(s).path:s.path,u=typeof o=="string"?wc.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:hl.joinPath(wc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(hl.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}},R(b4,"UriTrie"),b4),wn;(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"})(wn||(wn={}));var x4,pVe=(x4=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Ai.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??wc.parse(e.uri),Ai.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Ai.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:wn.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:wn.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=wn.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=$I.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},R(x4,"DefaultLangiumDocumentFactory"),x4),w4,gVe=(w4=class{constructor(e){this.documentTrie=new tne,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return si(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,wn.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=wn.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=wn.Changed;return this.documentTrie.delete(r),n}},R(w4,"DefaultLangiumDocuments"),w4),bm=Symbol("RefResolving"),T4,mVe=(T4=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=Ai.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 Qu(e.parseResult.value))await Rs(r),l3(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 Qu(e.parseResult.value))await Rs(r),l3(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=bm;try{const i=this.getCandidate(e);if(Im(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=bm;try{const i=this.getCandidates(e),a=[];if(Im(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(Xa(this._ref))return this._ref;if(Fee(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=bm;const o=kb(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(Im(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=kb(e.container).$document;n&&n.stateKy(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Mte(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ul(i)||td(i))return QL(i);if(Array.isArray(i)){for(const a of i)if((ul(a)||td(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return QL(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||cte(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 l3(n))if(td(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=>hl.equals(a.sourceUri,r.documentUri))),n.push(...i),si(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Zu(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:h3(a),local:!0})}}return n}},R(C4,"DefaultReferences"),C4),S4,s0=(S4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return A6.sum(si(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?si(r):a3}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 si(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return si(this.map.keys())}values(){return si(this.map.values()).flat()}entriesGroupedByKey(){return si(this.map.entries())}},R(S4,"MultiMap"),S4),E4,DI=(E4=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}},R(E4,"BiMap"),E4),A4,bVe=(A4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Ai.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=e7,i=Ai.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Rs(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=Ai.CancellationToken.None){const n=e.parseResult.value,i=new s0;for(const a of T0(n))await Rs(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))}}},R(A4,"DefaultScopeComputation"),A4),R4,GY=(R4=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}},R(R4,"StreamScope"),R4),_4,Wir=(_4=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?si(i).concat(this.outerScope.getElements(e)):si(i)}getAllElements(){let e=si(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},R(_4,"MapScope"),_4),M4,xVe=(M4=class{constructor(e,r,n){this.elements=new s0,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?si(n).concat(this.outerScope.getElements(e)):si(n)}getAllElements(){let e=si(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},R(M4,"MultiMapScope"),M4),qir={getElement(){},getElements(){return a3},getAllElements(){return a3}},L4,vO=(L4=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")}},R(L4,"DisposableCache"),L4),I4,nne=(I4=class extends vO{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()}},R(I4,"SimpleCache"),I4),$4,bO=($4=class extends vO{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}},R($4,"ContextCache"),$4),N4,wVe=(N4=class extends bO{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)}))}},R(N4,"DocumentCache"),N4),D4,ine=(D4=class extends nne{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()}))}},R(D4,"WorkspaceCache"),D4),O4,TVe=(O4=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 ine(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Zu(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 GY(si(e),r,n)}createScopeForNodes(e,r,n){const i=si(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new GY(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new xVe(this.indexManager.allElements(e)))}},R(O4,"DefaultScopeProvider"),O4);function ane(t){return typeof t.$comment=="string"}R(ane,"isAstNodeWithComment");function UY(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}R(UY,"isIntermediateReference");var P4,kVe=(P4=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=R((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Zu(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(ul(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Zu(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(td(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Zu(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(Xa(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=R(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=Rte(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(dv(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=si(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}},R(F4,"ValidationRegistry"),F4),EVe=Object.freeze({validateNode:!0,validateChildren:!0}),z4,AVe=(z4=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=Ai.CancellationToken.None){const i=e.parseResult,a=[];if(await Rs(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)===eu.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===eu.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===eu.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(dv(s))throw s;console.error("An error occurred during validation:",s)}return await Rs(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:aS(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:one(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=R6(i.token);if(a){const s={severity:aS("error"),range:a,message:i.message,data:h1(eu.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:eu.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=Ai.CancellationToken.None){const i=[],a=R((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=Ai.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Rs(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Ai.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=Qu(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=Qu(e).iterator();for(const o of s){await Rs(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 EVe}async validateAstAfter(e,r,n,i=Ai.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Rs(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:sne(n),severity:aS(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},R(z4,"DefaultDocumentValidator"),z4);function sne(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=_D(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=_te(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}}}R(sne,"getDiagnosticRange");function aS(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)}}R(aS,"toDiagnosticSeverity");function one(t){switch(t){case"error":return h1(eu.LexingError);case"warning":return h1(eu.LexingWarning);case"info":return h1(eu.LexingInfo);case"hint":return h1(eu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}R(one,"toDiagnosticData");var eu;(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"})(eu||(eu={}));var H4,RVe=(H4=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Zu(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=R(()=>s??(s=h3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:h3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},R(H4,"DefaultAstNodeDescriptionProvider"),H4),V4,_Ve=(V4=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Ai.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Qu(i))await Rs(r),l3(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=[];ul(r)&&r.$nodeDescription?n=[r.$nodeDescription]:td(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Zu(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=h3(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:hl.equals(l.documentUri,i)});return s}},R(V4,"DefaultReferenceDescriptionProvider"),V4),W4,MVe=(W4=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)}},R(W4,"DefaultAstNodeLocator"),W4),xO={};pD(xO,Dee(J3()));var q4,LVe=(q4=class{constructor(e){this._ready=new a0,this.onConfigurationSectionUpdateEmitter=new xO.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}},R(q4,"DefaultConfigurationProvider"),q4),f8=Dee(CYt()),_1;(function(t){function e(r){return{dispose:R(async()=>await r(),"dispose")}}R(e,"create"),t.create=e})(_1||(_1={}));var G4,IVe=(G4=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new s0,this.documentPhaseListeners=new s0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=wn.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=Ai.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===wn.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,wn.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=wn.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=wn.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Ai.CancellationToken.None){this.currentState=wn.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=wn.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,wn.Changed)}const s=si(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,wn.ComputedScopes)),await this.emitUpdate(a,i),await Rs(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 si(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),_1.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case wn.Changed:case wn.Parsed:this.indexManager.removeContent(e.uri);case wn.IndexedContent:e.localSymbols=void 0;case wn.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case wn.Linked:this.indexManager.removeReferences(e.uri);case wn.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case wn.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=wn.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,wn.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,wn.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,wn.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,wn.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,wn.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,wn.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),_1.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),_1.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Ai.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(jh);if(this.currentState>=e&&e>i.state)return Promise.reject(new f8.ResponseError(f8.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${wn[i.state]}, requiring ${wn[e]}, but workspace state is already ${wn[this.currentState]}. Returning undefined.`))}else return Promise.reject(new f8.ResponseError(f8.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{hl.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(jh)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(jh):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(jh)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Rs(n),await s(e,n)}catch(o){if(!dv(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 Rs(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=si(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)??{}}},R(G4,"DefaultDocumentBuilder"),G4),U4,$Ve=(U4=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new bO,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Zu(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{hl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),si(i)}allElements(e,r){let n=si(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=Ai.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=Ai.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}},R(U4,"DefaultIndexManager"),U4),Y4,NVe=(Y4=class{constructor(e){this.initialBuildOptions={},this._ready=new a0,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=Ai.CancellationToken.None){const n=await this.performStartup(e);await Rs(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=R(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=si(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 wc.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=hl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},R(Y4,"DefaultWorkspaceManager"),Y4),j4,DVe=(j4=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return EY.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return EY.buildUnableToPopLexerModeMessage(e)}},R(j4,"DefaultLexerErrorMessageProvider"),j4),lne={mode:"full"},X4,cne=(X4=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=PI(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new pl(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=lne){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(PI(e))return e;const r=TO(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},R(X4,"DefaultLexer"),X4);function wO(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}R(wO,"isTokenTypeArray");function TO(t){return t&&"modes"in t&&"defaultMode"in t}R(TO,"isIMultiModeLexerDefinition");function PI(t){return!wO(t)&&!TO(t)}R(PI,"isTokenTypeDictionary");QE();function une(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Kn.create(0,0));const a=dne(t),s=kO(n),o=OVe({lines:a,position:i,options:s});return FVe({index:0,tokens:o,position:i})}R(une,"parseJSDoc");function hne(t,e){const r=kO(e),n=dne(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))}R(hne,"isJSDoc");function dne(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(zIe)}R(dne,"getLines");var Cme=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Gir=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function OVe(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=Kn.create(r,n);e.push({type:"break",content:"",range:An.create(p,p)})}}else{Cme.lastIndex=d;const p=Cme.exec(h);if(p){const g=p[0],m=p[1],y=Kn.create(r,n+d),v=Kn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:An.create(y,v)}),d+=g.length,d=BI(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}R(OVe,"tokenize");function PVe(t,e,r,n){const i=[];if(t.length===0){const a=Kn.create(r,n),s=Kn.create(r,n+e.length);i.push({type:"text",content:e,range:An.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:An.create(Kn.create(r,a+n),Kn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:An.create(Kn.create(r,a+h+n),Kn.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:An.create(Kn.create(r,a+h+n),Kn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:An.create(Kn.create(r,a+h+n),Kn.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:An.create(Kn.create(r,a+n),Kn.create(r,a+n+s.length))})}return i}R(PVe,"buildInlineTokens");var Uir=/\S/,Yir=/\s*$/;function BI(t,e){const r=t.substring(e).match(Uir);return r?e+r.index:t.length}R(BI,"skipWhitespace");function BVe(t){const e=t.match(Yir);if(e&&typeof e.index=="number")return e.index}R(BVe,"lastCharacter");function FVe(t){var a,s;const e=Kn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Sme([],An.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+=jY(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+=jY(r)+i}return r.trim()}},R(K4,"JSDocCommentImpl"),K4),Z4,eH=(Z4=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=WVe(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}},R(Z4,"JSDocTagImpl"),Z4);function WVe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=BI(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))??qVe(e,a)}}R(WVe,"renderInlineTag");function qVe(t,e){try{return wc.parse(t,!0),`[${e}](${t})`}catch{return t}}R(qVe,"renderLinkDefault");var Q4,YY=(Q4=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}},R(Q4,"JSDocTextImpl"),Q4),J4,VVe=(J4=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},R(J4,"JSDocLineImpl"),J4);function UY(t){return t.endsWith(` +`)}return r}},R(Q4,"JSDocTextImpl"),Q4),J4,GVe=(J4=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},R(J4,"JSDocLineImpl"),J4);function jY(t){return t.endsWith(` `)?` `:` -`}R(UY,"fillNewlines");var ew,WVe=(ew=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&cne(r))return lne(r).toMarkdown({renderLink:R((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:R(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=Zu(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)}},R(ew,"JSDocDocumentationProvider"),ew),tw,qVe=(tw=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return nne(e)?e.$comment:(r=hte(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},R(tw,"DefaultCommentProvider"),tw),rw,GVe=(rw=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},R(rw,"DefaultAsyncParser"),rw),nw,Vir=(nw=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 a0;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 a0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Yh)}),this.queue.push(r),r.promise}},R(nw,"AbstractThreadedAsyncParser"),nw),iw,Wir=(iw=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new vO.Emitter,this.deferred=new a0,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(Yh),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 a0,this.sendMessage(e),this.deferred.promise}},R(iw,"ParserWorker"),iw),aw,UVe=(aw=class{constructor(){this.previousTokenSource=new Ai.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=gO();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Ai.CancellationToken.None){const i=new a0,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){dv(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},R(aw,"DefaultWorkspaceLock"),aw),sw,YVe=(sw=class{constructor(e){this.grammarElementIdMap=new $I,this.tokenTypeIdMap=new $I,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 Qu(e))r.set(i,{});if(e.$cstNode)for(const i of u3(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)Xa(o)?s.push(this.dehydrateAstNode(o,r)):ul(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Xa(a)?n[i]=this.dehydrateAstNode(a,r):ul(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 gD(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Zf(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Yy(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 Qu(e))r.set(a,{});let i;if(e.$cstNode)for(const a of u3(e.$cstNode)){let s;"fullText"in a?(s=new Hre(a.fullText),i=s):"content"in a?s=new uO:"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)Xa(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ul(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Xa(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ul(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),Zf(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 RI(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 Qu(this.grammar))mD(r)&&this.grammarElementIdMap.set(r,e++)}},R(sw,"DefaultHydrator"),sw);function zs(t){return{documentation:{CommentProvider:R(e=>new qVe(e),"CommentProvider"),DocumentationProvider:R(e=>new WVe(e),"DocumentationProvider")},parser:{AsyncParser:R(e=>new GVe(e),"AsyncParser"),GrammarConfig:R(e=>Dte(e),"GrammarConfig"),LangiumParser:R(e=>Yre(e),"LangiumParser"),CompletionParser:R(e=>Ure(e),"CompletionParser"),ValueConverter:R(()=>new Xre,"ValueConverter"),TokenBuilder:R(()=>new fO,"TokenBuilder"),Lexer:R(e=>new one(e),"Lexer"),ParserErrorMessageProvider:R(()=>new Wre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:R(()=>new IVe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:R(()=>new AVe,"AstNodeLocator"),AstNodeDescriptionProvider:R(e=>new SVe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:R(e=>new EVe(e),"ReferenceDescriptionProvider")},references:{Linker:R(e=>new fVe(e),"Linker"),NameProvider:R(()=>new pVe,"NameProvider"),ScopeProvider:R(e=>new bVe(e),"ScopeProvider"),ScopeComputation:R(e=>new mVe(e),"ScopeComputation"),References:R(e=>new gVe(e),"References")},serializer:{Hydrator:R(e=>new YVe(e),"Hydrator"),JsonSerializer:R(e=>new xVe(e),"JsonSerializer")},validation:{DocumentValidator:R(e=>new CVe(e),"DocumentValidator"),ValidationRegistry:R(e=>new TVe(e),"ValidationRegistry")},shared:R(()=>t.shared,"shared")}}R(zs,"createDefaultCoreModule");function Hs(t){return{ServiceRegistry:R(e=>new wVe(e),"ServiceRegistry"),workspace:{LangiumDocuments:R(e=>new dVe(e),"LangiumDocuments"),LangiumDocumentFactory:R(e=>new hVe(e),"LangiumDocumentFactory"),DocumentBuilder:R(e=>new _Ve(e),"DocumentBuilder"),IndexManager:R(e=>new MVe(e),"IndexManager"),WorkspaceManager:R(e=>new LVe(e),"WorkspaceManager"),FileSystemProvider:R(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:R(()=>new UVe,"WorkspaceLock"),ConfigurationProvider:R(e=>new RVe(e),"ConfigurationProvider")},profilers:{}}}R(Hs,"createDefaultSharedCoreModule");var YY;(function(t){t.merge=(e,r)=>g3(g3({},e),r)})(YY||(YY={}));function Nn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(g3,{});return gne(u)}R(Nn,"inject");var jVe=Symbol("isProxy");function pne(t){if(t&&t[jVe])for(const e of Object.values(t))pne(e);return t}R(pne,"eagerLoad");function gne(t,e){const r=new Proxy({},{deleteProperty:R(()=>!1,"deleteProperty"),set:R(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:R((n,i)=>i===jVe?!0:jY(n,i,t,e||r),"get"),getOwnPropertyDescriptor:R((n,i)=>(jY(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:R((n,i)=>i in t,"has"),ownKeys:R(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}R(gne,"_inject");var Sme=Symbol();function jY(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]===Sme)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]=Sme;try{t[e]=typeof i=="function"?i(n):gne(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}R(jY,"_resolve");function g3(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]=g3(i,n):t[r]=g3({},n)}else t[r]=n}return t}R(g3,"_merge");var XY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},d1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(d1||(d1={}));var ow,XVe=(ow=class extends fO{constructor(e=XY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...XY,...e},this.indentTokenType=Sb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!bO(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=d1.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:{[d1.REGULAR]:[l,u,...d,h],[d1.IGNORE_INDENTATION]:[...d,h]},defaultMode:d1.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 p7(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}},R(ow,"IndentationAwareTokenBuilder"),ow),lw,qir=(lw=class extends one{constructor(e){if(super(e),e.parser.TokenBuilder instanceof XVe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=sne){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}},R(lw,"IndentationAwareLexer"),lw),mne={};Ig(mne,{AstUtils:()=>Fee,BiMap:()=>$I,Cancellation:()=>Ai,ContextCache:()=>yO,CstUtils:()=>Oee,DONE_RESULT:()=>el,Deferred:()=>a0,Disposable:()=>_1,DisposableCache:()=>mO,DocumentCache:()=>vVe,EMPTY_STREAM:()=>a3,ErrorWithLocation:()=>kD,GrammarUtils:()=>gte,MultiMap:()=>s0,OperationCancelled:()=>Yh,Reduction:()=>E6,RegExpUtils:()=>yte,SimpleCache:()=>tne,StreamImpl:()=>Uh,TreeStreamImpl:()=>s3,URI:()=>wc,UriTrie:()=>Jre,UriUtils:()=>hl,WorkspaceCache:()=>rne,assertCondition:()=>mte,assertUnreachable:()=>$g,delayNextTick:()=>pO,interruptAndCheck:()=>Rs,isOperationCancelled:()=>dv,loadGrammarFromJson:()=>Vs,setInterruptionPeriod:()=>Kre,startCancelableOperation:()=>gO,stream:()=>si});dD(mne,vO);var cw,KVe=(cw=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[]}},R(cw,"EmptyFileSystemProvider"),cw),vo={fileSystemProvider:R(()=>new KVe,"fileSystemProvider")},Gir={Grammar:R(()=>{},"Grammar"),LanguageMetaData:R(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Uir={AstReflection:R(()=>new ste,"AstReflection")};function ZVe(){const t=Nn(Hs(vo),Uir),e=Nn(zs({shared:t}),Gir);return t.ServiceRegistry.register(e),e}R(ZVe,"createMinimalGrammarServices");function Vs(t){const e=ZVe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,wc.parse(`memory:/${r.name??"grammar"}.langium`)),r}R(Vs,"loadGrammarFromJson");dD(lIe,mne);var uw,Yir=(uw=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new s0}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 QVe(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 R(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])}},R(uw,"DefaultLangiumProfiler"),uw),hw,QVe=(hw=class{constructor(e,r){this.stack=[],this.entries=new s0,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)}},R(hw,"ProfilingTask"),hw),KY;(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 ]+)\]/}})(KY||(KY={}));var ZY;(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]*/}})(ZY||(ZY={}));var QY;(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]*/}})(QY||(QY={}));var JY;(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])?/}})(JY||(JY={}));var ej;(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]*/}})(ej||(ej={}));var tj;(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]*/}})(tj||(tj={}));var rj;(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]*/}})(rj||(rj={}));var nj;(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]*/}})(nj||(nj={}));var ij;(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]*/}})(ij||(ij={}));var aj;(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]*?\*\)/}})(aj||(aj={}));var sj;(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]*?\*\//}})(sj||(sj={}));var oj;(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]*/}})(oj||(oj={}));var lj;(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:/"[^"]*"|'[^']*'/}})(lj||(lj={}));var cj;(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])*/}})(cj||(cj={}));var uj;(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]*/}})(uj||(uj={}));({...KY.Terminals,...ZY.Terminals,...QY.Terminals,...JY.Terminals,...ej.Terminals,...tj.Terminals,...rj.Terminals,...nj.Terminals,...ij.Terminals,...aj.Terminals,...sj.Terminals,...oj.Terminals,...cj.Terminals,...lj.Terminals,...uj.Terminals});var Eme={$type:"AbnfAlternation",alternatives:"alternatives"},Ame={$type:"AbnfConcatenation",elements:"elements"},Jz={$type:"AbnfElement",primary:"primary",repeat:"repeat"},Rme={$type:"AbnfGroup",element:"element"},_me={$type:"AbnfNumVal",value:"value"},Mme={$type:"AbnfOptionalGroup",element:"element"},Fv={$type:"AbnfPrimary"},eH={$type:"AbnfRule",definition:"definition",name:"name"},Lme={$type:"AbnfRuleName",name:"name"},Ime={$type:"AbnfStringLiteral",value:"value"},f8={$type:"Accelerator",name:"name",x:"x",y:"y"},tH={$type:"Alignment",direction:"direction",members:"members"},p8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},jk={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},rH={$type:"Annotations",x:"x",y:"y"},Eh={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function jir(t){return Va.isInstance(t,Eh.$type)}R(jir,"isArchitecture");var g8={$type:"Axis",label:"label",name:"name"},i_={$type:"Branch",name:"name",order:"order"};function Xir(t){return Va.isInstance(t,i_.$type)}R(Xir,"isBranch");var $me={$type:"Checkout",branch:"branch"},m8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},nH={$type:"ClassDefStatement",className:"className",styleText:"styleText"},x2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Kir(t){return Va.isInstance(t,x2.$type)}R(Kir,"isCommit");var y8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},em={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},v8={$type:"Curve",entries:"entries",label:"label",name:"name"},xm={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Zir(t){return Va.isInstance(t,xm.$type)}R(Zir,"isCynefin");var b8={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Nme={$type:"Decorator",strategy:"strategy"},zv={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},a_={$type:"DomainBlock",domain:"domain",items:"items"};function Qir(t){return Va.isInstance(t,a_.$type)}R(Qir,"isDomainBlock");var hj={$type:"DomainItem",label:"label"};function Jir(t){return Va.isInstance(t,hj.$type)}R(Jir,"isDomainItem");var Dme={$type:"EbnfChoice",alternatives:"alternatives"},Ome={$type:"EbnfExceptionPostfix",except:"except"},Pme={$type:"EbnfGroup",element:"element"},Bme={$type:"EbnfNonTerminal",name:"name"},Fme={$type:"EbnfOneOrMorePostfix",operator:"operator"},zme={$type:"EbnfOptional",element:"element"},Hme={$type:"EbnfOptionalPostfix",operator:"operator"},Xk={$type:"EbnfPostfix"},tm={$type:"EbnfPrimary"},Vme={$type:"EbnfRepetition",element:"element"},iH={$type:"EbnfRule",definition:"definition",name:"name"},Wme={$type:"EbnfSequence",elements:"elements"},qme={$type:"EbnfSpecial",text:"text"},aH={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Gme={$type:"EbnfTerminal",value:"value"},Ume={$type:"EbnfZeroOrMorePostfix",operator:"operator"},yh={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Hv={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},rm={$type:"EmFrame"},Kk={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Yme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},sH={$type:"EmModelEntity",name:"name"};function ear(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}R(ear,"isEmModelEntityType");var x8={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},af={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function JVe(t){return Va.isInstance(t,af.$type)}R(JVe,"isEmResetFrame");var H0={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},oH={$type:"Entry",axis:"axis",value:"value"},Yd={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},jme={$type:"Evolution",stages:"stages"},w8={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},lH={$type:"Evolve",component:"component",target:"target"},wm={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function tar(t){return Va.isInstance(t,wm.$type)}R(tar,"isGitGraph");var Zk={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Z5={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function rar(t){return Va.isInstance(t,Z5.$type)}R(rar,"isInfo");var Qk={$type:"Item",classSelector:"classSelector",name:"name"},cH={$type:"Junction",id:"id",in:"in"},Jk={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},T8={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},nm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},w2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function nar(t){return Va.isInstance(t,w2.$type)}R(nar,"isMerge");var k8={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},uH={$type:"Option",name:"name",value:"value"},T2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function iar(t){return Va.isInstance(t,T2.$type)}R(iar,"isPacket");var k2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function aar(t){return Va.isInstance(t,k2.$type)}R(aar,"isPacketBlock");var Xme={$type:"PegAny",dot:"dot"},Kme={$type:"PegGroup",element:"element"},Zme={$type:"PegIdentifier",name:"name"},Qme={$type:"PegLiteral",value:"value"},Jme={$type:"PegOrderedChoice",alternatives:"alternatives"},hH={$type:"PegPrefix",operator:"operator",suffix:"suffix"},e5={$type:"PegPrimary"},dH={$type:"PegRule",definition:"definition",name:"name"},e1e={$type:"PegSequence",elements:"elements"},fH={$type:"PegSuffix",operator:"operator",primary:"primary"},Tm={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function sar(t){return Va.isInstance(t,Tm.$type)}R(sar,"isPie");var s_={$type:"PieSection",label:"label",value:"value"};function oar(t){return Va.isInstance(t,s_.$type)}R(oar,"isPieSection");var pH={$type:"Pipeline",components:"components",parent:"parent"},C8={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},im={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},C2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function lar(t){return Va.isInstance(t,C2.$type)}R(lar,"isRailroad");var S2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function car(t){return Va.isInstance(t,S2.$type)}R(car,"isRailroadAbnf");var t1e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},E2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function uar(t){return Va.isInstance(t,E2.$type)}R(uar,"isRailroadEbnf");var jd={$type:"RailroadExpression"},r1e={$type:"RailroadNonTerminalExpr",name:"name"},n1e={$type:"RailroadOneOrMoreExpr",element:"element"},i1e={$type:"RailroadOptionalExpr",element:"element"},A2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function har(t){return Va.isInstance(t,A2.$type)}R(har,"isRailroadPeg");var gH={$type:"RailroadRule",definition:"definition",name:"name"},a1e={$type:"RailroadSequenceExpr",elements:"elements"},s1e={$type:"RailroadSpecialExpr",text:"text"},o1e={$type:"RailroadTerminalExpr",value:"value"},l1e={$type:"RailroadZeroOrMoreExpr",element:"element"},mH={$type:"Section",classSelector:"classSelector",name:"name"},Vv={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},yH={$type:"Size",height:"height",width:"width"},Wv={$type:"Statement"},Q5={$type:"Transition",from:"from",label:"label",to:"to"};function dar(t){return Va.isInstance(t,Q5.$type)}R(dar,"isTransition");var R2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function far(t){return Va.isInstance(t,R2.$type)}R(far,"isTreemap");var vH={$type:"TreemapRow",indent:"indent",item:"item"},qv={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},t5={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Xs={$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 par(t){return Va.isInstance(t,Xs.$type)}R(par,"isWardley");var dw,eWe=(dw=class extends Bee{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Eme.$type,properties:{alternatives:{name:Eme.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Ame.$type,properties:{elements:{name:Ame.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:Jz.$type,properties:{primary:{name:Jz.primary},repeat:{name:Jz.repeat}},superTypes:[]},AbnfGroup:{name:Rme.$type,properties:{element:{name:Rme.element}},superTypes:[Fv.$type]},AbnfNumVal:{name:_me.$type,properties:{value:{name:_me.value}},superTypes:[Fv.$type]},AbnfOptionalGroup:{name:Mme.$type,properties:{element:{name:Mme.element}},superTypes:[Fv.$type]},AbnfPrimary:{name:Fv.$type,properties:{},superTypes:[]},AbnfRule:{name:eH.$type,properties:{definition:{name:eH.definition},name:{name:eH.name}},superTypes:[]},AbnfRuleName:{name:Lme.$type,properties:{name:{name:Lme.name}},superTypes:[Fv.$type]},AbnfStringLiteral:{name:Ime.$type,properties:{value:{name:Ime.value}},superTypes:[Fv.$type]},Accelerator:{name:f8.$type,properties:{name:{name:f8.name},x:{name:f8.x},y:{name:f8.y}},superTypes:[]},Alignment:{name:tH.$type,properties:{direction:{name:tH.direction},members:{name:tH.members,defaultValue:[]}},superTypes:[]},Anchor:{name:p8.$type,properties:{evolution:{name:p8.evolution},name:{name:p8.name},visibility:{name:p8.visibility}},superTypes:[]},Annotation:{name:jk.$type,properties:{number:{name:jk.number},text:{name:jk.text},x:{name:jk.x},y:{name:jk.y}},superTypes:[]},Annotations:{name:rH.$type,properties:{x:{name:rH.x},y:{name:rH.y}},superTypes:[]},Architecture:{name:Eh.$type,properties:{accDescr:{name:Eh.accDescr},accTitle:{name:Eh.accTitle},alignments:{name:Eh.alignments,defaultValue:[]},edges:{name:Eh.edges,defaultValue:[]},groups:{name:Eh.groups,defaultValue:[]},junctions:{name:Eh.junctions,defaultValue:[]},services:{name:Eh.services,defaultValue:[]},title:{name:Eh.title}},superTypes:[]},Axis:{name:g8.$type,properties:{label:{name:g8.label},name:{name:g8.name}},superTypes:[]},Branch:{name:i_.$type,properties:{name:{name:i_.name},order:{name:i_.order}},superTypes:[Wv.$type]},Checkout:{name:$me.$type,properties:{branch:{name:$me.branch}},superTypes:[Wv.$type]},CherryPicking:{name:m8.$type,properties:{id:{name:m8.id},parent:{name:m8.parent},tags:{name:m8.tags,defaultValue:[]}},superTypes:[Wv.$type]},ClassDefStatement:{name:nH.$type,properties:{className:{name:nH.className},styleText:{name:nH.styleText}},superTypes:[]},Commit:{name:x2.$type,properties:{id:{name:x2.id},message:{name:x2.message},tags:{name:x2.tags,defaultValue:[]},type:{name:x2.type}},superTypes:[Wv.$type]},Common:{name:y8.$type,properties:{accDescr:{name:y8.accDescr},accTitle:{name:y8.accTitle},title:{name:y8.title}},superTypes:[]},Component:{name:em.$type,properties:{decorator:{name:em.decorator},evolution:{name:em.evolution},inertia:{name:em.inertia,defaultValue:!1},label:{name:em.label},name:{name:em.name},visibility:{name:em.visibility}},superTypes:[]},Curve:{name:v8.$type,properties:{entries:{name:v8.entries,defaultValue:[]},label:{name:v8.label},name:{name:v8.name}},superTypes:[]},Cynefin:{name:xm.$type,properties:{accDescr:{name:xm.accDescr},accTitle:{name:xm.accTitle},domains:{name:xm.domains,defaultValue:[]},title:{name:xm.title},transitions:{name:xm.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:b8.$type,properties:{name:{name:b8.name},x:{name:b8.x},y:{name:b8.y}},superTypes:[]},Decorator:{name:Nme.$type,properties:{strategy:{name:Nme.strategy}},superTypes:[]},Direction:{name:zv.$type,properties:{accDescr:{name:zv.accDescr},accTitle:{name:zv.accTitle},dir:{name:zv.dir},statements:{name:zv.statements,defaultValue:[]},title:{name:zv.title}},superTypes:[wm.$type]},DomainBlock:{name:a_.$type,properties:{domain:{name:a_.domain},items:{name:a_.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:hj.$type,properties:{label:{name:hj.label}},superTypes:[]},EbnfChoice:{name:Dme.$type,properties:{alternatives:{name:Dme.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Ome.$type,properties:{except:{name:Ome.except}},superTypes:[Xk.$type]},EbnfGroup:{name:Pme.$type,properties:{element:{name:Pme.element}},superTypes:[tm.$type]},EbnfNonTerminal:{name:Bme.$type,properties:{name:{name:Bme.name}},superTypes:[tm.$type]},EbnfOneOrMorePostfix:{name:Fme.$type,properties:{operator:{name:Fme.operator}},superTypes:[Xk.$type]},EbnfOptional:{name:zme.$type,properties:{element:{name:zme.element}},superTypes:[tm.$type]},EbnfOptionalPostfix:{name:Hme.$type,properties:{operator:{name:Hme.operator}},superTypes:[Xk.$type]},EbnfPostfix:{name:Xk.$type,properties:{},superTypes:[]},EbnfPrimary:{name:tm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Vme.$type,properties:{element:{name:Vme.element}},superTypes:[tm.$type]},EbnfRule:{name:iH.$type,properties:{definition:{name:iH.definition},name:{name:iH.name}},superTypes:[]},EbnfSequence:{name:Wme.$type,properties:{elements:{name:Wme.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:qme.$type,properties:{text:{name:qme.text}},superTypes:[tm.$type]},EbnfTerm:{name:aH.$type,properties:{base:{name:aH.base},postfixes:{name:aH.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Gme.$type,properties:{value:{name:Gme.value}},superTypes:[tm.$type]},EbnfZeroOrMorePostfix:{name:Ume.$type,properties:{operator:{name:Ume.operator}},superTypes:[Xk.$type]},Edge:{name:yh.$type,properties:{lhsDir:{name:yh.lhsDir},lhsGroup:{name:yh.lhsGroup,defaultValue:!1},lhsId:{name:yh.lhsId},lhsInto:{name:yh.lhsInto,defaultValue:!1},rhsDir:{name:yh.rhsDir},rhsGroup:{name:yh.rhsGroup,defaultValue:!1},rhsId:{name:yh.rhsId},rhsInto:{name:yh.rhsInto,defaultValue:!1},title:{name:yh.title}},superTypes:[]},EmDataEntity:{name:Hv.$type,properties:{dataBlockValue:{name:Hv.dataBlockValue},dataType:{name:Hv.dataType},name:{name:Hv.name}},superTypes:[]},EmFrame:{name:rm.$type,properties:{},superTypes:[]},EmGwt:{name:Kk.$type,properties:{givenStatements:{name:Kk.givenStatements,defaultValue:[]},sourceFrame:{name:Kk.sourceFrame,referenceType:rm.$type},thenStatements:{name:Kk.thenStatements,defaultValue:[]},whenStatements:{name:Kk.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Yme.$type,properties:{entityIdentifier:{name:Yme.entityIdentifier,referenceType:sH.$type}},superTypes:[]},EmModelEntity:{name:sH.$type,properties:{name:{name:sH.name}},superTypes:[]},EmNoteEntity:{name:x8.$type,properties:{dataBlockValue:{name:x8.dataBlockValue},dataType:{name:x8.dataType},sourceFrame:{name:x8.sourceFrame,referenceType:rm.$type}},superTypes:[]},EmResetFrame:{name:af.$type,properties:{dataInlineValue:{name:af.dataInlineValue},dataReference:{name:af.dataReference,referenceType:Hv.$type},dataType:{name:af.dataType},entityIdentifier:{name:af.entityIdentifier},modelEntityType:{name:af.modelEntityType},name:{name:af.name},sourceFrames:{name:af.sourceFrames,defaultValue:[],referenceType:rm.$type}},superTypes:[rm.$type]},EmTimeFrame:{name:H0.$type,properties:{dataInlineValue:{name:H0.dataInlineValue},dataReference:{name:H0.dataReference,referenceType:Hv.$type},dataType:{name:H0.dataType},entityIdentifier:{name:H0.entityIdentifier},modelEntityType:{name:H0.modelEntityType},name:{name:H0.name},sourceFrames:{name:H0.sourceFrames,defaultValue:[],referenceType:rm.$type}},superTypes:[rm.$type]},Entry:{name:oH.$type,properties:{axis:{name:oH.axis,referenceType:g8.$type},value:{name:oH.value}},superTypes:[]},EventModel:{name:Yd.$type,properties:{accDescr:{name:Yd.accDescr},accTitle:{name:Yd.accTitle},dataEntities:{name:Yd.dataEntities,defaultValue:[]},frames:{name:Yd.frames,defaultValue:[]},gwtEntities:{name:Yd.gwtEntities,defaultValue:[]},modelEntities:{name:Yd.modelEntities,defaultValue:[]},noteEntities:{name:Yd.noteEntities,defaultValue:[]},title:{name:Yd.title}},superTypes:[]},Evolution:{name:jme.$type,properties:{stages:{name:jme.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:w8.$type,properties:{boundary:{name:w8.boundary},name:{name:w8.name},secondName:{name:w8.secondName}},superTypes:[]},Evolve:{name:lH.$type,properties:{component:{name:lH.component},target:{name:lH.target}},superTypes:[]},GitGraph:{name:wm.$type,properties:{accDescr:{name:wm.accDescr},accTitle:{name:wm.accTitle},statements:{name:wm.statements,defaultValue:[]},title:{name:wm.title}},superTypes:[]},Group:{name:Zk.$type,properties:{icon:{name:Zk.icon},id:{name:Zk.id},in:{name:Zk.in},title:{name:Zk.title}},superTypes:[]},Info:{name:Z5.$type,properties:{accDescr:{name:Z5.accDescr},accTitle:{name:Z5.accTitle},title:{name:Z5.title}},superTypes:[]},Item:{name:Qk.$type,properties:{classSelector:{name:Qk.classSelector},name:{name:Qk.name}},superTypes:[]},Junction:{name:cH.$type,properties:{id:{name:cH.id},in:{name:cH.in}},superTypes:[]},Label:{name:Jk.$type,properties:{negX:{name:Jk.negX,defaultValue:!1},negY:{name:Jk.negY,defaultValue:!1},offsetX:{name:Jk.offsetX},offsetY:{name:Jk.offsetY}},superTypes:[]},Leaf:{name:T8.$type,properties:{classSelector:{name:T8.classSelector},name:{name:T8.name},value:{name:T8.value}},superTypes:[Qk.$type]},Link:{name:nm.$type,properties:{arrow:{name:nm.arrow},from:{name:nm.from},fromPort:{name:nm.fromPort},linkLabel:{name:nm.linkLabel},to:{name:nm.to},toPort:{name:nm.toPort}},superTypes:[]},Merge:{name:w2.$type,properties:{branch:{name:w2.branch},id:{name:w2.id},tags:{name:w2.tags,defaultValue:[]},type:{name:w2.type}},superTypes:[Wv.$type]},Note:{name:k8.$type,properties:{evolution:{name:k8.evolution},text:{name:k8.text},visibility:{name:k8.visibility}},superTypes:[]},Option:{name:uH.$type,properties:{name:{name:uH.name},value:{name:uH.value,defaultValue:!1}},superTypes:[]},Packet:{name:T2.$type,properties:{accDescr:{name:T2.accDescr},accTitle:{name:T2.accTitle},blocks:{name:T2.blocks,defaultValue:[]},title:{name:T2.title}},superTypes:[]},PacketBlock:{name:k2.$type,properties:{bits:{name:k2.bits},end:{name:k2.end},label:{name:k2.label},start:{name:k2.start}},superTypes:[]},PegAny:{name:Xme.$type,properties:{dot:{name:Xme.dot}},superTypes:[e5.$type]},PegGroup:{name:Kme.$type,properties:{element:{name:Kme.element}},superTypes:[e5.$type]},PegIdentifier:{name:Zme.$type,properties:{name:{name:Zme.name}},superTypes:[e5.$type]},PegLiteral:{name:Qme.$type,properties:{value:{name:Qme.value}},superTypes:[e5.$type]},PegOrderedChoice:{name:Jme.$type,properties:{alternatives:{name:Jme.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:hH.$type,properties:{operator:{name:hH.operator},suffix:{name:hH.suffix}},superTypes:[]},PegPrimary:{name:e5.$type,properties:{},superTypes:[]},PegRule:{name:dH.$type,properties:{definition:{name:dH.definition},name:{name:dH.name}},superTypes:[]},PegSequence:{name:e1e.$type,properties:{elements:{name:e1e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:fH.$type,properties:{operator:{name:fH.operator},primary:{name:fH.primary}},superTypes:[]},Pie:{name:Tm.$type,properties:{accDescr:{name:Tm.accDescr},accTitle:{name:Tm.accTitle},sections:{name:Tm.sections,defaultValue:[]},showData:{name:Tm.showData,defaultValue:!1},title:{name:Tm.title}},superTypes:[]},PieSection:{name:s_.$type,properties:{label:{name:s_.label},value:{name:s_.value}},superTypes:[]},Pipeline:{name:pH.$type,properties:{components:{name:pH.components,defaultValue:[]},parent:{name:pH.parent}},superTypes:[]},PipelineComponent:{name:C8.$type,properties:{evolution:{name:C8.evolution},label:{name:C8.label},name:{name:C8.name}},superTypes:[]},Radar:{name:im.$type,properties:{accDescr:{name:im.accDescr},accTitle:{name:im.accTitle},axes:{name:im.axes,defaultValue:[]},curves:{name:im.curves,defaultValue:[]},options:{name:im.options,defaultValue:[]},title:{name:im.title}},superTypes:[]},Railroad:{name:C2.$type,properties:{accDescr:{name:C2.accDescr},accTitle:{name:C2.accTitle},rules:{name:C2.rules,defaultValue:[]},title:{name:C2.title}},superTypes:[]},RailroadAbnf:{name:S2.$type,properties:{accDescr:{name:S2.accDescr},accTitle:{name:S2.accTitle},rules:{name:S2.rules,defaultValue:[]},title:{name:S2.title}},superTypes:[]},RailroadChoiceExpr:{name:t1e.$type,properties:{alternatives:{name:t1e.alternatives,defaultValue:[]}},superTypes:[jd.$type]},RailroadEbnf:{name:E2.$type,properties:{accDescr:{name:E2.accDescr},accTitle:{name:E2.accTitle},rules:{name:E2.rules,defaultValue:[]},title:{name:E2.title}},superTypes:[]},RailroadExpression:{name:jd.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:r1e.$type,properties:{name:{name:r1e.name}},superTypes:[jd.$type]},RailroadOneOrMoreExpr:{name:n1e.$type,properties:{element:{name:n1e.element}},superTypes:[jd.$type]},RailroadOptionalExpr:{name:i1e.$type,properties:{element:{name:i1e.element}},superTypes:[jd.$type]},RailroadPeg:{name:A2.$type,properties:{accDescr:{name:A2.accDescr},accTitle:{name:A2.accTitle},rules:{name:A2.rules,defaultValue:[]},title:{name:A2.title}},superTypes:[]},RailroadRule:{name:gH.$type,properties:{definition:{name:gH.definition},name:{name:gH.name}},superTypes:[]},RailroadSequenceExpr:{name:a1e.$type,properties:{elements:{name:a1e.elements,defaultValue:[]}},superTypes:[jd.$type]},RailroadSpecialExpr:{name:s1e.$type,properties:{text:{name:s1e.text}},superTypes:[jd.$type]},RailroadTerminalExpr:{name:o1e.$type,properties:{value:{name:o1e.value}},superTypes:[jd.$type]},RailroadZeroOrMoreExpr:{name:l1e.$type,properties:{element:{name:l1e.element}},superTypes:[jd.$type]},Section:{name:mH.$type,properties:{classSelector:{name:mH.classSelector},name:{name:mH.name}},superTypes:[Qk.$type]},Service:{name:Vv.$type,properties:{icon:{name:Vv.icon},iconText:{name:Vv.iconText},id:{name:Vv.id},in:{name:Vv.in},title:{name:Vv.title}},superTypes:[]},Size:{name:yH.$type,properties:{height:{name:yH.height},width:{name:yH.width}},superTypes:[]},Statement:{name:Wv.$type,properties:{},superTypes:[]},Transition:{name:Q5.$type,properties:{from:{name:Q5.from},label:{name:Q5.label},to:{name:Q5.to}},superTypes:[]},TreeNode:{name:qv.$type,properties:{classAnnotation:{name:qv.classAnnotation},descAnnotation:{name:qv.descAnnotation},iconAnnotation:{name:qv.iconAnnotation},indent:{name:qv.indent},name:{name:qv.name}},superTypes:[]},TreeView:{name:t5.$type,properties:{accDescr:{name:t5.accDescr},accTitle:{name:t5.accTitle},nodes:{name:t5.nodes,defaultValue:[]},title:{name:t5.title}},superTypes:[]},Treemap:{name:R2.$type,properties:{accDescr:{name:R2.accDescr},accTitle:{name:R2.accTitle},title:{name:R2.title},TreemapRows:{name:R2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:vH.$type,properties:{indent:{name:vH.indent},item:{name:vH.item}},superTypes:[]},Wardley:{name:Xs.$type,properties:{accDescr:{name:Xs.accDescr},accelerators:{name:Xs.accelerators,defaultValue:[]},accTitle:{name:Xs.accTitle},anchors:{name:Xs.anchors,defaultValue:[]},annotation:{name:Xs.annotation,defaultValue:[]},annotations:{name:Xs.annotations,defaultValue:[]},components:{name:Xs.components,defaultValue:[]},deaccelerators:{name:Xs.deaccelerators,defaultValue:[]},evolution:{name:Xs.evolution},evolves:{name:Xs.evolves,defaultValue:[]},links:{name:Xs.links,defaultValue:[]},notes:{name:Xs.notes,defaultValue:[]},pipelines:{name:Xs.pipelines,defaultValue:[]},size:{name:Xs.size},title:{name:Xs.title}},superTypes:[]}}}},R(dw,"MermaidAstReflection"),dw),Va=new eWe,c1e,gar=R(()=>c1e??(c1e=Vs(`{"$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"),u1e,mar=R(()=>u1e??(u1e=Vs(`{"$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"),h1e,yar=R(()=>h1e??(h1e=Vs('{"$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"),d1e,bar=R(()=>d1e??(d1e=Vs(`{"$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"),f1e,xar=R(()=>f1e??(f1e=Vs(`{"$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"),p1e,war=R(()=>p1e??(p1e=Vs(`{"$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"),g1e,Tar=R(()=>g1e??(g1e=Vs(`{"$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"),m1e,kar=R(()=>m1e??(m1e=Vs(`{"$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"),y1e,Car=R(()=>y1e??(y1e=Vs('{"$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"),v1e,Sar=R(()=>v1e??(v1e=Vs(`{"$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"),b1e,Ear=R(()=>b1e??(b1e=Vs(`{"$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"),x1e,Aar=R(()=>x1e??(x1e=Vs(`{"$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"),w1e,Rar=R(()=>w1e??(w1e=Vs(`{"$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"),T1e,_ar=R(()=>T1e??(T1e=Vs(`{"$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"),k1e,Mar=R(()=>k1e??(k1e=Vs(`{"$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"),Lar={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iar={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$ar={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Nar={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Dar={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Oar={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Par={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bar={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Far={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zar={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Har={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Var={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},War={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qar={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gar={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_l={AstReflection:R(()=>new eWe,"AstReflection")},Uar={Grammar:R(()=>gar(),"Grammar"),LanguageMetaData:R(()=>Lar,"LanguageMetaData"),parser:{}},Yar={Grammar:R(()=>mar(),"Grammar"),LanguageMetaData:R(()=>Iar,"LanguageMetaData"),parser:{}},jar={Grammar:R(()=>yar(),"Grammar"),LanguageMetaData:R(()=>$ar,"LanguageMetaData"),parser:{}},Xar={Grammar:R(()=>bar(),"Grammar"),LanguageMetaData:R(()=>Nar,"LanguageMetaData"),parser:{}},Kar={Grammar:R(()=>xar(),"Grammar"),LanguageMetaData:R(()=>Dar,"LanguageMetaData"),parser:{}},Zar={Grammar:R(()=>war(),"Grammar"),LanguageMetaData:R(()=>Oar,"LanguageMetaData"),parser:{}},Qar={Grammar:R(()=>Tar(),"Grammar"),LanguageMetaData:R(()=>Par,"LanguageMetaData"),parser:{}},Jar={Grammar:R(()=>kar(),"Grammar"),LanguageMetaData:R(()=>Bar,"LanguageMetaData"),parser:{}},esr={Grammar:R(()=>Car(),"Grammar"),LanguageMetaData:R(()=>Far,"LanguageMetaData"),parser:{}},tsr={Grammar:R(()=>Sar(),"Grammar"),LanguageMetaData:R(()=>zar,"LanguageMetaData"),parser:{}},rsr={Grammar:R(()=>Ear(),"Grammar"),LanguageMetaData:R(()=>Har,"LanguageMetaData"),parser:{}},nsr={Grammar:R(()=>Aar(),"Grammar"),LanguageMetaData:R(()=>Var,"LanguageMetaData"),parser:{}},isr={Grammar:R(()=>Rar(),"Grammar"),LanguageMetaData:R(()=>War,"LanguageMetaData"),parser:{}},asr={Grammar:R(()=>_ar(),"Grammar"),LanguageMetaData:R(()=>qar,"LanguageMetaData"),parser:{}},ssr={Grammar:R(()=>Mar(),"Grammar"),LanguageMetaData:R(()=>Gar,"LanguageMetaData"),parser:{}},osr=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,lsr=/accTitle[\t ]*:([^\n\r]*)/,csr=/title([\t ][^\n\r]*|)/,usr={ACC_DESCR:osr,ACC_TITLE:lsr,TITLE:csr},fw,Md=(fw=class extends Xre{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=usr[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,` -`)}}},R(fw,"AbstractMermaidValueConverter"),fw),pw,ck=(pw=class extends Md{runCustomConverter(e,r,n){}},R(pw,"CommonValueConverter"),pw),gw,Ml=(gw=class extends fO{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}},R(gw,"AbstractMermaidTokenBuilder"),gw),mw;mw=class extends Ml{},R(mw,"CommonTokenBuilder");/*! Bundled license information: +`}R(jY,"fillNewlines");var ew,UVe=(ew=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&hne(r))return une(r).toMarkdown({renderLink:R((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:R(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=Zu(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)}},R(ew,"JSDocDocumentationProvider"),ew),tw,YVe=(tw=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return ane(e)?e.$comment:(r=fte(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},R(tw,"DefaultCommentProvider"),tw),rw,jVe=(rw=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},R(rw,"DefaultAsyncParser"),rw),nw,jir=(nw=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 a0;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 a0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(jh)}),this.queue.push(r),r.promise}},R(nw,"AbstractThreadedAsyncParser"),nw),iw,Xir=(iw=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new xO.Emitter,this.deferred=new a0,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(jh),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 a0,this.sendMessage(e),this.deferred.promise}},R(iw,"ParserWorker"),iw),aw,XVe=(aw=class{constructor(){this.previousTokenSource=new Ai.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=yO();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Ai.CancellationToken.None){const i=new a0,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){dv(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},R(aw,"DefaultWorkspaceLock"),aw),sw,KVe=(sw=class{constructor(e){this.grammarElementIdMap=new DI,this.tokenTypeIdMap=new DI,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 Qu(e))r.set(i,{});if(e.$cstNode)for(const i of u3(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)Xa(o)?s.push(this.dehydrateAstNode(o,r)):ul(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Xa(a)?n[i]=this.dehydrateAstNode(a,r):ul(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 yD(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Zf(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Yy(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 Qu(e))r.set(a,{});let i;if(e.$cstNode)for(const a of u3(e.$cstNode)){let s;"fullText"in a?(s=new Wre(a.fullText),i=s):"content"in a?s=new dO:"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)Xa(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ul(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Xa(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ul(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),Zf(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 MI(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 Qu(this.grammar))vD(r)&&this.grammarElementIdMap.set(r,e++)}},R(sw,"DefaultHydrator"),sw);function zs(t){return{documentation:{CommentProvider:R(e=>new YVe(e),"CommentProvider"),DocumentationProvider:R(e=>new UVe(e),"DocumentationProvider")},parser:{AsyncParser:R(e=>new jVe(e),"AsyncParser"),GrammarConfig:R(e=>Pte(e),"GrammarConfig"),LangiumParser:R(e=>Xre(e),"LangiumParser"),CompletionParser:R(e=>jre(e),"CompletionParser"),ValueConverter:R(()=>new Zre,"ValueConverter"),TokenBuilder:R(()=>new gO,"TokenBuilder"),Lexer:R(e=>new cne(e),"Lexer"),ParserErrorMessageProvider:R(()=>new Gre,"ParserErrorMessageProvider"),LexerErrorMessageProvider:R(()=>new DVe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:R(()=>new MVe,"AstNodeLocator"),AstNodeDescriptionProvider:R(e=>new RVe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:R(e=>new _Ve(e),"ReferenceDescriptionProvider")},references:{Linker:R(e=>new mVe(e),"Linker"),NameProvider:R(()=>new yVe,"NameProvider"),ScopeProvider:R(e=>new TVe(e),"ScopeProvider"),ScopeComputation:R(e=>new bVe(e),"ScopeComputation"),References:R(e=>new vVe(e),"References")},serializer:{Hydrator:R(e=>new KVe(e),"Hydrator"),JsonSerializer:R(e=>new kVe(e),"JsonSerializer")},validation:{DocumentValidator:R(e=>new AVe(e),"DocumentValidator"),ValidationRegistry:R(e=>new SVe(e),"ValidationRegistry")},shared:R(()=>t.shared,"shared")}}R(zs,"createDefaultCoreModule");function Hs(t){return{ServiceRegistry:R(e=>new CVe(e),"ServiceRegistry"),workspace:{LangiumDocuments:R(e=>new gVe(e),"LangiumDocuments"),LangiumDocumentFactory:R(e=>new pVe(e),"LangiumDocumentFactory"),DocumentBuilder:R(e=>new IVe(e),"DocumentBuilder"),IndexManager:R(e=>new $Ve(e),"IndexManager"),WorkspaceManager:R(e=>new NVe(e),"WorkspaceManager"),FileSystemProvider:R(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:R(()=>new XVe,"WorkspaceLock"),ConfigurationProvider:R(e=>new LVe(e),"ConfigurationProvider")},profilers:{}}}R(Hs,"createDefaultSharedCoreModule");var XY;(function(t){t.merge=(e,r)=>g3(g3({},e),r)})(XY||(XY={}));function Nn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(g3,{});return yne(u)}R(Nn,"inject");var ZVe=Symbol("isProxy");function mne(t){if(t&&t[ZVe])for(const e of Object.values(t))mne(e);return t}R(mne,"eagerLoad");function yne(t,e){const r=new Proxy({},{deleteProperty:R(()=>!1,"deleteProperty"),set:R(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:R((n,i)=>i===ZVe?!0:KY(n,i,t,e||r),"get"),getOwnPropertyDescriptor:R((n,i)=>(KY(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:R((n,i)=>i in t,"has"),ownKeys:R(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}R(yne,"_inject");var Eme=Symbol();function KY(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]===Eme)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]=Eme;try{t[e]=typeof i=="function"?i(n):yne(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}R(KY,"_resolve");function g3(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]=g3(i,n):t[r]=g3({},n)}else t[r]=n}return t}R(g3,"_merge");var ZY={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},d1;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(d1||(d1={}));var ow,QVe=(ow=class extends gO{constructor(e=ZY){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...ZY,...e},this.indentTokenType=Sb({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sb({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!wO(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=d1.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:{[d1.REGULAR]:[l,u,...d,h],[d1.IGNORE_INDENTATION]:[...d,h]},defaultMode:d1.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 g7(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}},R(ow,"IndentationAwareTokenBuilder"),ow),lw,Kir=(lw=class extends cne{constructor(e){if(super(e),e.parser.TokenBuilder instanceof QVe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=lne){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}},R(lw,"IndentationAwareLexer"),lw),vne={};Ig(vne,{AstUtils:()=>Hee,BiMap:()=>DI,Cancellation:()=>Ai,ContextCache:()=>bO,CstUtils:()=>Bee,DONE_RESULT:()=>el,Deferred:()=>a0,Disposable:()=>_1,DisposableCache:()=>vO,DocumentCache:()=>wVe,EMPTY_STREAM:()=>a3,ErrorWithLocation:()=>SD,GrammarUtils:()=>yte,MultiMap:()=>s0,OperationCancelled:()=>jh,Reduction:()=>A6,RegExpUtils:()=>bte,SimpleCache:()=>nne,StreamImpl:()=>Yh,TreeStreamImpl:()=>s3,URI:()=>wc,UriTrie:()=>tne,UriUtils:()=>hl,WorkspaceCache:()=>ine,assertCondition:()=>vte,assertUnreachable:()=>$g,delayNextTick:()=>mO,interruptAndCheck:()=>Rs,isOperationCancelled:()=>dv,loadGrammarFromJson:()=>Vs,setInterruptionPeriod:()=>Qre,startCancelableOperation:()=>yO,stream:()=>si});pD(vne,xO);var cw,JVe=(cw=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[]}},R(cw,"EmptyFileSystemProvider"),cw),vo={fileSystemProvider:R(()=>new JVe,"fileSystemProvider")},Zir={Grammar:R(()=>{},"Grammar"),LanguageMetaData:R(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Qir={AstReflection:R(()=>new lte,"AstReflection")};function eWe(){const t=Nn(Hs(vo),Qir),e=Nn(zs({shared:t}),Zir);return t.ServiceRegistry.register(e),e}R(eWe,"createMinimalGrammarServices");function Vs(t){const e=eWe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,wc.parse(`memory:/${r.name??"grammar"}.langium`)),r}R(Vs,"loadGrammarFromJson");pD(hIe,vne);var uw,Jir=(uw=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new s0}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 tWe(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 R(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])}},R(uw,"DefaultLangiumProfiler"),uw),hw,tWe=(hw=class{constructor(e,r){this.stack=[],this.entries=new s0,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)}},R(hw,"ProfilingTask"),hw),QY;(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 ]+)\]/}})(QY||(QY={}));var JY;(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]*/}})(JY||(JY={}));var ej;(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]*/}})(ej||(ej={}));var tj;(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])?/}})(tj||(tj={}));var rj;(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]*/}})(rj||(rj={}));var nj;(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]*/}})(nj||(nj={}));var ij;(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]*/}})(ij||(ij={}));var aj;(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]*/}})(aj||(aj={}));var sj;(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]*/}})(sj||(sj={}));var oj;(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]*?\*\)/}})(oj||(oj={}));var lj;(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]*?\*\//}})(lj||(lj={}));var cj;(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]*/}})(cj||(cj={}));var uj;(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:/"[^"]*"|'[^']*'/}})(uj||(uj={}));var hj;(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])*/}})(hj||(hj={}));var dj;(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]*/}})(dj||(dj={}));({...QY.Terminals,...JY.Terminals,...ej.Terminals,...tj.Terminals,...rj.Terminals,...nj.Terminals,...ij.Terminals,...aj.Terminals,...sj.Terminals,...oj.Terminals,...lj.Terminals,...cj.Terminals,...hj.Terminals,...uj.Terminals,...dj.Terminals});var Ame={$type:"AbnfAlternation",alternatives:"alternatives"},Rme={$type:"AbnfConcatenation",elements:"elements"},tH={$type:"AbnfElement",primary:"primary",repeat:"repeat"},_me={$type:"AbnfGroup",element:"element"},Mme={$type:"AbnfNumVal",value:"value"},Lme={$type:"AbnfOptionalGroup",element:"element"},Fv={$type:"AbnfPrimary"},rH={$type:"AbnfRule",definition:"definition",name:"name"},Ime={$type:"AbnfRuleName",name:"name"},$me={$type:"AbnfStringLiteral",value:"value"},p8={$type:"Accelerator",name:"name",x:"x",y:"y"},nH={$type:"Alignment",direction:"direction",members:"members"},g8={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},jk={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},iH={$type:"Annotations",x:"x",y:"y"},Eh={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function ear(t){return Va.isInstance(t,Eh.$type)}R(ear,"isArchitecture");var m8={$type:"Axis",label:"label",name:"name"},a_={$type:"Branch",name:"name",order:"order"};function tar(t){return Va.isInstance(t,a_.$type)}R(tar,"isBranch");var Nme={$type:"Checkout",branch:"branch"},y8={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},aH={$type:"ClassDefStatement",className:"className",styleText:"styleText"},x2={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function rar(t){return Va.isInstance(t,x2.$type)}R(rar,"isCommit");var v8={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},em={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},b8={$type:"Curve",entries:"entries",label:"label",name:"name"},xm={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function nar(t){return Va.isInstance(t,xm.$type)}R(nar,"isCynefin");var x8={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Dme={$type:"Decorator",strategy:"strategy"},zv={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},s_={$type:"DomainBlock",domain:"domain",items:"items"};function iar(t){return Va.isInstance(t,s_.$type)}R(iar,"isDomainBlock");var fj={$type:"DomainItem",label:"label"};function aar(t){return Va.isInstance(t,fj.$type)}R(aar,"isDomainItem");var Ome={$type:"EbnfChoice",alternatives:"alternatives"},Pme={$type:"EbnfExceptionPostfix",except:"except"},Bme={$type:"EbnfGroup",element:"element"},Fme={$type:"EbnfNonTerminal",name:"name"},zme={$type:"EbnfOneOrMorePostfix",operator:"operator"},Hme={$type:"EbnfOptional",element:"element"},Vme={$type:"EbnfOptionalPostfix",operator:"operator"},Xk={$type:"EbnfPostfix"},tm={$type:"EbnfPrimary"},Wme={$type:"EbnfRepetition",element:"element"},sH={$type:"EbnfRule",definition:"definition",name:"name"},qme={$type:"EbnfSequence",elements:"elements"},Gme={$type:"EbnfSpecial",text:"text"},oH={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Ume={$type:"EbnfTerminal",value:"value"},Yme={$type:"EbnfZeroOrMorePostfix",operator:"operator"},yh={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Hv={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},rm={$type:"EmFrame"},Kk={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},jme={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},lH={$type:"EmModelEntity",name:"name"};function sar(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}R(sar,"isEmModelEntityType");var w8={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},sf={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function rWe(t){return Va.isInstance(t,sf.$type)}R(rWe,"isEmResetFrame");var H0={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},cH={$type:"Entry",axis:"axis",value:"value"},jd={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Xme={$type:"Evolution",stages:"stages"},T8={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},uH={$type:"Evolve",component:"component",target:"target"},wm={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function oar(t){return Va.isInstance(t,wm.$type)}R(oar,"isGitGraph");var Zk={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Z5={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function lar(t){return Va.isInstance(t,Z5.$type)}R(lar,"isInfo");var Qk={$type:"Item",classSelector:"classSelector",name:"name"},hH={$type:"Junction",id:"id",in:"in"},Jk={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},k8={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},nm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},w2={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function car(t){return Va.isInstance(t,w2.$type)}R(car,"isMerge");var C8={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},dH={$type:"Option",name:"name",value:"value"},T2={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function uar(t){return Va.isInstance(t,T2.$type)}R(uar,"isPacket");var k2={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function har(t){return Va.isInstance(t,k2.$type)}R(har,"isPacketBlock");var Kme={$type:"PegAny",dot:"dot"},Zme={$type:"PegGroup",element:"element"},Qme={$type:"PegIdentifier",name:"name"},Jme={$type:"PegLiteral",value:"value"},e1e={$type:"PegOrderedChoice",alternatives:"alternatives"},fH={$type:"PegPrefix",operator:"operator",suffix:"suffix"},e5={$type:"PegPrimary"},pH={$type:"PegRule",definition:"definition",name:"name"},t1e={$type:"PegSequence",elements:"elements"},gH={$type:"PegSuffix",operator:"operator",primary:"primary"},Tm={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function dar(t){return Va.isInstance(t,Tm.$type)}R(dar,"isPie");var o_={$type:"PieSection",label:"label",value:"value"};function far(t){return Va.isInstance(t,o_.$type)}R(far,"isPieSection");var mH={$type:"Pipeline",components:"components",parent:"parent"},S8={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},im={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},C2={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function par(t){return Va.isInstance(t,C2.$type)}R(par,"isRailroad");var S2={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function gar(t){return Va.isInstance(t,S2.$type)}R(gar,"isRailroadAbnf");var r1e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},E2={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function mar(t){return Va.isInstance(t,E2.$type)}R(mar,"isRailroadEbnf");var Xd={$type:"RailroadExpression"},n1e={$type:"RailroadNonTerminalExpr",name:"name"},i1e={$type:"RailroadOneOrMoreExpr",element:"element"},a1e={$type:"RailroadOptionalExpr",element:"element"},A2={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function yar(t){return Va.isInstance(t,A2.$type)}R(yar,"isRailroadPeg");var yH={$type:"RailroadRule",definition:"definition",name:"name"},s1e={$type:"RailroadSequenceExpr",elements:"elements"},o1e={$type:"RailroadSpecialExpr",text:"text"},l1e={$type:"RailroadTerminalExpr",value:"value"},c1e={$type:"RailroadZeroOrMoreExpr",element:"element"},vH={$type:"Section",classSelector:"classSelector",name:"name"},Vv={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},bH={$type:"Size",height:"height",width:"width"},Wv={$type:"Statement"},Q5={$type:"Transition",from:"from",label:"label",to:"to"};function bar(t){return Va.isInstance(t,Q5.$type)}R(bar,"isTransition");var R2={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function xar(t){return Va.isInstance(t,R2.$type)}R(xar,"isTreemap");var xH={$type:"TreemapRow",indent:"indent",item:"item"},qv={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},t5={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Xs={$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 war(t){return Va.isInstance(t,Xs.$type)}R(war,"isWardley");var dw,nWe=(dw=class extends zee{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Ame.$type,properties:{alternatives:{name:Ame.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Rme.$type,properties:{elements:{name:Rme.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:tH.$type,properties:{primary:{name:tH.primary},repeat:{name:tH.repeat}},superTypes:[]},AbnfGroup:{name:_me.$type,properties:{element:{name:_me.element}},superTypes:[Fv.$type]},AbnfNumVal:{name:Mme.$type,properties:{value:{name:Mme.value}},superTypes:[Fv.$type]},AbnfOptionalGroup:{name:Lme.$type,properties:{element:{name:Lme.element}},superTypes:[Fv.$type]},AbnfPrimary:{name:Fv.$type,properties:{},superTypes:[]},AbnfRule:{name:rH.$type,properties:{definition:{name:rH.definition},name:{name:rH.name}},superTypes:[]},AbnfRuleName:{name:Ime.$type,properties:{name:{name:Ime.name}},superTypes:[Fv.$type]},AbnfStringLiteral:{name:$me.$type,properties:{value:{name:$me.value}},superTypes:[Fv.$type]},Accelerator:{name:p8.$type,properties:{name:{name:p8.name},x:{name:p8.x},y:{name:p8.y}},superTypes:[]},Alignment:{name:nH.$type,properties:{direction:{name:nH.direction},members:{name:nH.members,defaultValue:[]}},superTypes:[]},Anchor:{name:g8.$type,properties:{evolution:{name:g8.evolution},name:{name:g8.name},visibility:{name:g8.visibility}},superTypes:[]},Annotation:{name:jk.$type,properties:{number:{name:jk.number},text:{name:jk.text},x:{name:jk.x},y:{name:jk.y}},superTypes:[]},Annotations:{name:iH.$type,properties:{x:{name:iH.x},y:{name:iH.y}},superTypes:[]},Architecture:{name:Eh.$type,properties:{accDescr:{name:Eh.accDescr},accTitle:{name:Eh.accTitle},alignments:{name:Eh.alignments,defaultValue:[]},edges:{name:Eh.edges,defaultValue:[]},groups:{name:Eh.groups,defaultValue:[]},junctions:{name:Eh.junctions,defaultValue:[]},services:{name:Eh.services,defaultValue:[]},title:{name:Eh.title}},superTypes:[]},Axis:{name:m8.$type,properties:{label:{name:m8.label},name:{name:m8.name}},superTypes:[]},Branch:{name:a_.$type,properties:{name:{name:a_.name},order:{name:a_.order}},superTypes:[Wv.$type]},Checkout:{name:Nme.$type,properties:{branch:{name:Nme.branch}},superTypes:[Wv.$type]},CherryPicking:{name:y8.$type,properties:{id:{name:y8.id},parent:{name:y8.parent},tags:{name:y8.tags,defaultValue:[]}},superTypes:[Wv.$type]},ClassDefStatement:{name:aH.$type,properties:{className:{name:aH.className},styleText:{name:aH.styleText}},superTypes:[]},Commit:{name:x2.$type,properties:{id:{name:x2.id},message:{name:x2.message},tags:{name:x2.tags,defaultValue:[]},type:{name:x2.type}},superTypes:[Wv.$type]},Common:{name:v8.$type,properties:{accDescr:{name:v8.accDescr},accTitle:{name:v8.accTitle},title:{name:v8.title}},superTypes:[]},Component:{name:em.$type,properties:{decorator:{name:em.decorator},evolution:{name:em.evolution},inertia:{name:em.inertia,defaultValue:!1},label:{name:em.label},name:{name:em.name},visibility:{name:em.visibility}},superTypes:[]},Curve:{name:b8.$type,properties:{entries:{name:b8.entries,defaultValue:[]},label:{name:b8.label},name:{name:b8.name}},superTypes:[]},Cynefin:{name:xm.$type,properties:{accDescr:{name:xm.accDescr},accTitle:{name:xm.accTitle},domains:{name:xm.domains,defaultValue:[]},title:{name:xm.title},transitions:{name:xm.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:x8.$type,properties:{name:{name:x8.name},x:{name:x8.x},y:{name:x8.y}},superTypes:[]},Decorator:{name:Dme.$type,properties:{strategy:{name:Dme.strategy}},superTypes:[]},Direction:{name:zv.$type,properties:{accDescr:{name:zv.accDescr},accTitle:{name:zv.accTitle},dir:{name:zv.dir},statements:{name:zv.statements,defaultValue:[]},title:{name:zv.title}},superTypes:[wm.$type]},DomainBlock:{name:s_.$type,properties:{domain:{name:s_.domain},items:{name:s_.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:fj.$type,properties:{label:{name:fj.label}},superTypes:[]},EbnfChoice:{name:Ome.$type,properties:{alternatives:{name:Ome.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Pme.$type,properties:{except:{name:Pme.except}},superTypes:[Xk.$type]},EbnfGroup:{name:Bme.$type,properties:{element:{name:Bme.element}},superTypes:[tm.$type]},EbnfNonTerminal:{name:Fme.$type,properties:{name:{name:Fme.name}},superTypes:[tm.$type]},EbnfOneOrMorePostfix:{name:zme.$type,properties:{operator:{name:zme.operator}},superTypes:[Xk.$type]},EbnfOptional:{name:Hme.$type,properties:{element:{name:Hme.element}},superTypes:[tm.$type]},EbnfOptionalPostfix:{name:Vme.$type,properties:{operator:{name:Vme.operator}},superTypes:[Xk.$type]},EbnfPostfix:{name:Xk.$type,properties:{},superTypes:[]},EbnfPrimary:{name:tm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Wme.$type,properties:{element:{name:Wme.element}},superTypes:[tm.$type]},EbnfRule:{name:sH.$type,properties:{definition:{name:sH.definition},name:{name:sH.name}},superTypes:[]},EbnfSequence:{name:qme.$type,properties:{elements:{name:qme.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Gme.$type,properties:{text:{name:Gme.text}},superTypes:[tm.$type]},EbnfTerm:{name:oH.$type,properties:{base:{name:oH.base},postfixes:{name:oH.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Ume.$type,properties:{value:{name:Ume.value}},superTypes:[tm.$type]},EbnfZeroOrMorePostfix:{name:Yme.$type,properties:{operator:{name:Yme.operator}},superTypes:[Xk.$type]},Edge:{name:yh.$type,properties:{lhsDir:{name:yh.lhsDir},lhsGroup:{name:yh.lhsGroup,defaultValue:!1},lhsId:{name:yh.lhsId},lhsInto:{name:yh.lhsInto,defaultValue:!1},rhsDir:{name:yh.rhsDir},rhsGroup:{name:yh.rhsGroup,defaultValue:!1},rhsId:{name:yh.rhsId},rhsInto:{name:yh.rhsInto,defaultValue:!1},title:{name:yh.title}},superTypes:[]},EmDataEntity:{name:Hv.$type,properties:{dataBlockValue:{name:Hv.dataBlockValue},dataType:{name:Hv.dataType},name:{name:Hv.name}},superTypes:[]},EmFrame:{name:rm.$type,properties:{},superTypes:[]},EmGwt:{name:Kk.$type,properties:{givenStatements:{name:Kk.givenStatements,defaultValue:[]},sourceFrame:{name:Kk.sourceFrame,referenceType:rm.$type},thenStatements:{name:Kk.thenStatements,defaultValue:[]},whenStatements:{name:Kk.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:jme.$type,properties:{entityIdentifier:{name:jme.entityIdentifier,referenceType:lH.$type}},superTypes:[]},EmModelEntity:{name:lH.$type,properties:{name:{name:lH.name}},superTypes:[]},EmNoteEntity:{name:w8.$type,properties:{dataBlockValue:{name:w8.dataBlockValue},dataType:{name:w8.dataType},sourceFrame:{name:w8.sourceFrame,referenceType:rm.$type}},superTypes:[]},EmResetFrame:{name:sf.$type,properties:{dataInlineValue:{name:sf.dataInlineValue},dataReference:{name:sf.dataReference,referenceType:Hv.$type},dataType:{name:sf.dataType},entityIdentifier:{name:sf.entityIdentifier},modelEntityType:{name:sf.modelEntityType},name:{name:sf.name},sourceFrames:{name:sf.sourceFrames,defaultValue:[],referenceType:rm.$type}},superTypes:[rm.$type]},EmTimeFrame:{name:H0.$type,properties:{dataInlineValue:{name:H0.dataInlineValue},dataReference:{name:H0.dataReference,referenceType:Hv.$type},dataType:{name:H0.dataType},entityIdentifier:{name:H0.entityIdentifier},modelEntityType:{name:H0.modelEntityType},name:{name:H0.name},sourceFrames:{name:H0.sourceFrames,defaultValue:[],referenceType:rm.$type}},superTypes:[rm.$type]},Entry:{name:cH.$type,properties:{axis:{name:cH.axis,referenceType:m8.$type},value:{name:cH.value}},superTypes:[]},EventModel:{name:jd.$type,properties:{accDescr:{name:jd.accDescr},accTitle:{name:jd.accTitle},dataEntities:{name:jd.dataEntities,defaultValue:[]},frames:{name:jd.frames,defaultValue:[]},gwtEntities:{name:jd.gwtEntities,defaultValue:[]},modelEntities:{name:jd.modelEntities,defaultValue:[]},noteEntities:{name:jd.noteEntities,defaultValue:[]},title:{name:jd.title}},superTypes:[]},Evolution:{name:Xme.$type,properties:{stages:{name:Xme.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:T8.$type,properties:{boundary:{name:T8.boundary},name:{name:T8.name},secondName:{name:T8.secondName}},superTypes:[]},Evolve:{name:uH.$type,properties:{component:{name:uH.component},target:{name:uH.target}},superTypes:[]},GitGraph:{name:wm.$type,properties:{accDescr:{name:wm.accDescr},accTitle:{name:wm.accTitle},statements:{name:wm.statements,defaultValue:[]},title:{name:wm.title}},superTypes:[]},Group:{name:Zk.$type,properties:{icon:{name:Zk.icon},id:{name:Zk.id},in:{name:Zk.in},title:{name:Zk.title}},superTypes:[]},Info:{name:Z5.$type,properties:{accDescr:{name:Z5.accDescr},accTitle:{name:Z5.accTitle},title:{name:Z5.title}},superTypes:[]},Item:{name:Qk.$type,properties:{classSelector:{name:Qk.classSelector},name:{name:Qk.name}},superTypes:[]},Junction:{name:hH.$type,properties:{id:{name:hH.id},in:{name:hH.in}},superTypes:[]},Label:{name:Jk.$type,properties:{negX:{name:Jk.negX,defaultValue:!1},negY:{name:Jk.negY,defaultValue:!1},offsetX:{name:Jk.offsetX},offsetY:{name:Jk.offsetY}},superTypes:[]},Leaf:{name:k8.$type,properties:{classSelector:{name:k8.classSelector},name:{name:k8.name},value:{name:k8.value}},superTypes:[Qk.$type]},Link:{name:nm.$type,properties:{arrow:{name:nm.arrow},from:{name:nm.from},fromPort:{name:nm.fromPort},linkLabel:{name:nm.linkLabel},to:{name:nm.to},toPort:{name:nm.toPort}},superTypes:[]},Merge:{name:w2.$type,properties:{branch:{name:w2.branch},id:{name:w2.id},tags:{name:w2.tags,defaultValue:[]},type:{name:w2.type}},superTypes:[Wv.$type]},Note:{name:C8.$type,properties:{evolution:{name:C8.evolution},text:{name:C8.text},visibility:{name:C8.visibility}},superTypes:[]},Option:{name:dH.$type,properties:{name:{name:dH.name},value:{name:dH.value,defaultValue:!1}},superTypes:[]},Packet:{name:T2.$type,properties:{accDescr:{name:T2.accDescr},accTitle:{name:T2.accTitle},blocks:{name:T2.blocks,defaultValue:[]},title:{name:T2.title}},superTypes:[]},PacketBlock:{name:k2.$type,properties:{bits:{name:k2.bits},end:{name:k2.end},label:{name:k2.label},start:{name:k2.start}},superTypes:[]},PegAny:{name:Kme.$type,properties:{dot:{name:Kme.dot}},superTypes:[e5.$type]},PegGroup:{name:Zme.$type,properties:{element:{name:Zme.element}},superTypes:[e5.$type]},PegIdentifier:{name:Qme.$type,properties:{name:{name:Qme.name}},superTypes:[e5.$type]},PegLiteral:{name:Jme.$type,properties:{value:{name:Jme.value}},superTypes:[e5.$type]},PegOrderedChoice:{name:e1e.$type,properties:{alternatives:{name:e1e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:fH.$type,properties:{operator:{name:fH.operator},suffix:{name:fH.suffix}},superTypes:[]},PegPrimary:{name:e5.$type,properties:{},superTypes:[]},PegRule:{name:pH.$type,properties:{definition:{name:pH.definition},name:{name:pH.name}},superTypes:[]},PegSequence:{name:t1e.$type,properties:{elements:{name:t1e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:gH.$type,properties:{operator:{name:gH.operator},primary:{name:gH.primary}},superTypes:[]},Pie:{name:Tm.$type,properties:{accDescr:{name:Tm.accDescr},accTitle:{name:Tm.accTitle},sections:{name:Tm.sections,defaultValue:[]},showData:{name:Tm.showData,defaultValue:!1},title:{name:Tm.title}},superTypes:[]},PieSection:{name:o_.$type,properties:{label:{name:o_.label},value:{name:o_.value}},superTypes:[]},Pipeline:{name:mH.$type,properties:{components:{name:mH.components,defaultValue:[]},parent:{name:mH.parent}},superTypes:[]},PipelineComponent:{name:S8.$type,properties:{evolution:{name:S8.evolution},label:{name:S8.label},name:{name:S8.name}},superTypes:[]},Radar:{name:im.$type,properties:{accDescr:{name:im.accDescr},accTitle:{name:im.accTitle},axes:{name:im.axes,defaultValue:[]},curves:{name:im.curves,defaultValue:[]},options:{name:im.options,defaultValue:[]},title:{name:im.title}},superTypes:[]},Railroad:{name:C2.$type,properties:{accDescr:{name:C2.accDescr},accTitle:{name:C2.accTitle},rules:{name:C2.rules,defaultValue:[]},title:{name:C2.title}},superTypes:[]},RailroadAbnf:{name:S2.$type,properties:{accDescr:{name:S2.accDescr},accTitle:{name:S2.accTitle},rules:{name:S2.rules,defaultValue:[]},title:{name:S2.title}},superTypes:[]},RailroadChoiceExpr:{name:r1e.$type,properties:{alternatives:{name:r1e.alternatives,defaultValue:[]}},superTypes:[Xd.$type]},RailroadEbnf:{name:E2.$type,properties:{accDescr:{name:E2.accDescr},accTitle:{name:E2.accTitle},rules:{name:E2.rules,defaultValue:[]},title:{name:E2.title}},superTypes:[]},RailroadExpression:{name:Xd.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:n1e.$type,properties:{name:{name:n1e.name}},superTypes:[Xd.$type]},RailroadOneOrMoreExpr:{name:i1e.$type,properties:{element:{name:i1e.element}},superTypes:[Xd.$type]},RailroadOptionalExpr:{name:a1e.$type,properties:{element:{name:a1e.element}},superTypes:[Xd.$type]},RailroadPeg:{name:A2.$type,properties:{accDescr:{name:A2.accDescr},accTitle:{name:A2.accTitle},rules:{name:A2.rules,defaultValue:[]},title:{name:A2.title}},superTypes:[]},RailroadRule:{name:yH.$type,properties:{definition:{name:yH.definition},name:{name:yH.name}},superTypes:[]},RailroadSequenceExpr:{name:s1e.$type,properties:{elements:{name:s1e.elements,defaultValue:[]}},superTypes:[Xd.$type]},RailroadSpecialExpr:{name:o1e.$type,properties:{text:{name:o1e.text}},superTypes:[Xd.$type]},RailroadTerminalExpr:{name:l1e.$type,properties:{value:{name:l1e.value}},superTypes:[Xd.$type]},RailroadZeroOrMoreExpr:{name:c1e.$type,properties:{element:{name:c1e.element}},superTypes:[Xd.$type]},Section:{name:vH.$type,properties:{classSelector:{name:vH.classSelector},name:{name:vH.name}},superTypes:[Qk.$type]},Service:{name:Vv.$type,properties:{icon:{name:Vv.icon},iconText:{name:Vv.iconText},id:{name:Vv.id},in:{name:Vv.in},title:{name:Vv.title}},superTypes:[]},Size:{name:bH.$type,properties:{height:{name:bH.height},width:{name:bH.width}},superTypes:[]},Statement:{name:Wv.$type,properties:{},superTypes:[]},Transition:{name:Q5.$type,properties:{from:{name:Q5.from},label:{name:Q5.label},to:{name:Q5.to}},superTypes:[]},TreeNode:{name:qv.$type,properties:{classAnnotation:{name:qv.classAnnotation},descAnnotation:{name:qv.descAnnotation},iconAnnotation:{name:qv.iconAnnotation},indent:{name:qv.indent},name:{name:qv.name}},superTypes:[]},TreeView:{name:t5.$type,properties:{accDescr:{name:t5.accDescr},accTitle:{name:t5.accTitle},nodes:{name:t5.nodes,defaultValue:[]},title:{name:t5.title}},superTypes:[]},Treemap:{name:R2.$type,properties:{accDescr:{name:R2.accDescr},accTitle:{name:R2.accTitle},title:{name:R2.title},TreemapRows:{name:R2.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:xH.$type,properties:{indent:{name:xH.indent},item:{name:xH.item}},superTypes:[]},Wardley:{name:Xs.$type,properties:{accDescr:{name:Xs.accDescr},accelerators:{name:Xs.accelerators,defaultValue:[]},accTitle:{name:Xs.accTitle},anchors:{name:Xs.anchors,defaultValue:[]},annotation:{name:Xs.annotation,defaultValue:[]},annotations:{name:Xs.annotations,defaultValue:[]},components:{name:Xs.components,defaultValue:[]},deaccelerators:{name:Xs.deaccelerators,defaultValue:[]},evolution:{name:Xs.evolution},evolves:{name:Xs.evolves,defaultValue:[]},links:{name:Xs.links,defaultValue:[]},notes:{name:Xs.notes,defaultValue:[]},pipelines:{name:Xs.pipelines,defaultValue:[]},size:{name:Xs.size},title:{name:Xs.title}},superTypes:[]}}}},R(dw,"MermaidAstReflection"),dw),Va=new nWe,u1e,Tar=R(()=>u1e??(u1e=Vs(`{"$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"),h1e,kar=R(()=>h1e??(h1e=Vs(`{"$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"),d1e,Car=R(()=>d1e??(d1e=Vs('{"$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"),f1e,Sar=R(()=>f1e??(f1e=Vs(`{"$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"),p1e,Ear=R(()=>p1e??(p1e=Vs(`{"$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"),g1e,Aar=R(()=>g1e??(g1e=Vs(`{"$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"),m1e,Rar=R(()=>m1e??(m1e=Vs(`{"$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"),y1e,_ar=R(()=>y1e??(y1e=Vs(`{"$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"),v1e,Mar=R(()=>v1e??(v1e=Vs('{"$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"),b1e,Lar=R(()=>b1e??(b1e=Vs(`{"$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"),x1e,Iar=R(()=>x1e??(x1e=Vs(`{"$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"),w1e,$ar=R(()=>w1e??(w1e=Vs(`{"$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"),T1e,Nar=R(()=>T1e??(T1e=Vs(`{"$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"),k1e,Dar=R(()=>k1e??(k1e=Vs(`{"$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"),C1e,Oar=R(()=>C1e??(C1e=Vs(`{"$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"),Par={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bar={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Far={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zar={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Har={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Var={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},War={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qar={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gar={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Uar={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Yar={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jar={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Xar={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kar={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Zar={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_l={AstReflection:R(()=>new nWe,"AstReflection")},Qar={Grammar:R(()=>Tar(),"Grammar"),LanguageMetaData:R(()=>Par,"LanguageMetaData"),parser:{}},Jar={Grammar:R(()=>kar(),"Grammar"),LanguageMetaData:R(()=>Bar,"LanguageMetaData"),parser:{}},esr={Grammar:R(()=>Car(),"Grammar"),LanguageMetaData:R(()=>Far,"LanguageMetaData"),parser:{}},tsr={Grammar:R(()=>Sar(),"Grammar"),LanguageMetaData:R(()=>zar,"LanguageMetaData"),parser:{}},rsr={Grammar:R(()=>Ear(),"Grammar"),LanguageMetaData:R(()=>Har,"LanguageMetaData"),parser:{}},nsr={Grammar:R(()=>Aar(),"Grammar"),LanguageMetaData:R(()=>Var,"LanguageMetaData"),parser:{}},isr={Grammar:R(()=>Rar(),"Grammar"),LanguageMetaData:R(()=>War,"LanguageMetaData"),parser:{}},asr={Grammar:R(()=>_ar(),"Grammar"),LanguageMetaData:R(()=>qar,"LanguageMetaData"),parser:{}},ssr={Grammar:R(()=>Mar(),"Grammar"),LanguageMetaData:R(()=>Gar,"LanguageMetaData"),parser:{}},osr={Grammar:R(()=>Lar(),"Grammar"),LanguageMetaData:R(()=>Uar,"LanguageMetaData"),parser:{}},lsr={Grammar:R(()=>Iar(),"Grammar"),LanguageMetaData:R(()=>Yar,"LanguageMetaData"),parser:{}},csr={Grammar:R(()=>$ar(),"Grammar"),LanguageMetaData:R(()=>jar,"LanguageMetaData"),parser:{}},usr={Grammar:R(()=>Nar(),"Grammar"),LanguageMetaData:R(()=>Xar,"LanguageMetaData"),parser:{}},hsr={Grammar:R(()=>Dar(),"Grammar"),LanguageMetaData:R(()=>Kar,"LanguageMetaData"),parser:{}},dsr={Grammar:R(()=>Oar(),"Grammar"),LanguageMetaData:R(()=>Zar,"LanguageMetaData"),parser:{}},fsr=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,psr=/accTitle[\t ]*:([^\n\r]*)/,gsr=/title([\t ][^\n\r]*|)/,msr={ACC_DESCR:fsr,ACC_TITLE:psr,TITLE:gsr},fw,Ld=(fw=class extends Zre{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=msr[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,` +`)}}},R(fw,"AbstractMermaidValueConverter"),fw),pw,ck=(pw=class extends Ld{runCustomConverter(e,r,n){}},R(pw,"CommonValueConverter"),pw),gw,Ml=(gw=class extends gO{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}},R(gw,"AbstractMermaidTokenBuilder"),gw),mw;mw=class extends Ml{},R(mw,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -2684,39 +2697,39 @@ lodash-es/lodash.js: * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) -*/var yw,hsr=(yw=class extends Ml{constructor(){super(["radar-beta"])}},R(yw,"RadarTokenBuilder"),yw),tWe={parser:{TokenBuilder:R(()=>new hsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function rWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Jar,tWe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}R(rWe,"createRadarServices");var vw,dsr=(vw=class extends Ml{constructor(){super(["railroad-beta"])}},R(vw,"RailroadTokenBuilder"),vw),C1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew dsr,"TokenBuilder"),ValueConverter:R(()=>new fsr,"ValueConverter")}};function yne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),rsr,nWe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}R(yne,"createRailroadServices");var xw,psr=(xw=class extends Ml{constructor(){super(["railroad-ebnf-beta"])}},R(xw,"RailroadEbnfTokenBuilder"),xw),S1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew psr,"TokenBuilder"),ValueConverter:R(()=>new gsr,"ValueConverter")}};function vne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),tsr,iWe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}R(vne,"createRailroadEbnfServices");var Tw,msr=(Tw=class extends Ml{constructor(){super(["railroad-abnf-beta"])}},R(Tw,"RailroadAbnfTokenBuilder"),Tw),kw,ysr=(kw=class extends Md{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)}},R(kw,"RailroadAbnfValueConverter"),kw),aWe={parser:{TokenBuilder:R(()=>new msr,"TokenBuilder"),ValueConverter:R(()=>new ysr,"ValueConverter")}};function bne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),esr,aWe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}R(bne,"createRailroadAbnfServices");var Cw,vsr=(Cw=class extends Ml{constructor(){super(["railroad-peg-beta"])}},R(Cw,"RailroadPegTokenBuilder"),Cw),E1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew vsr,"TokenBuilder"),ValueConverter:R(()=>new bsr,"ValueConverter")}};function xne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),nsr,sWe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}R(xne,"createRailroadPegServices");var Ew,xsr=(Ew=class extends Ml{constructor(){super(["treemap"])}},R(Ew,"TreemapTokenBuilder"),Ew),wsr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Aw,Tsr=(Aw=class extends Md{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=wsr.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},R(Aw,"TreemapValueConverter"),Aw);function oWe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}R(oWe,"registerValidationChecks");var Rw,ksr=(Rw=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"}))}},R(Rw,"TreemapValidator"),Rw),lWe={parser:{TokenBuilder:R(()=>new xsr,"TokenBuilder"),ValueConverter:R(()=>new Tsr,"ValueConverter")},validation:{TreemapValidator:R(()=>new ksr,"TreemapValidator")}};function cWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),isr,lWe);return e.ServiceRegistry.register(r),oWe(r),{shared:e,Treemap:r}}R(cWe,"createTreemapServices");var _w,Csr=(_w=class extends Md{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},R(_w,"WardleyValueConverter"),_w),uWe={parser:{ValueConverter:R(()=>new Csr,"ValueConverter")}};function hWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),ssr,uWe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}R(hWe,"createWardleyServices");var Mw,Ssr=(Mw=class extends Ml{constructor(){super(["cynefin-beta"])}},R(Mw,"CynefinTokenBuilder"),Mw),dWe={parser:{TokenBuilder:R(()=>new Ssr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function fWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Yar,dWe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}R(fWe,"createCynefinServices");var Lw,Esr=(Lw=class extends Ml{constructor(){super(["gitGraph"])}},R(Lw,"GitGraphTokenBuilder"),Lw),pWe={parser:{TokenBuilder:R(()=>new Esr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function gWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Xar,pWe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}R(gWe,"createGitGraphServices");var Iw,Asr=(Iw=class extends Ml{constructor(){super(["info","showInfo"])}},R(Iw,"InfoTokenBuilder"),Iw),mWe={parser:{TokenBuilder:R(()=>new Asr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function yWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Kar,mWe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}R(yWe,"createInfoServices");var $w,Rsr=($w=class extends Ml{constructor(){super(["packet"])}},R($w,"PacketTokenBuilder"),$w),vWe={parser:{TokenBuilder:R(()=>new Rsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function bWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Zar,vWe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}R(bWe,"createPacketServices");var Nw,_sr=(Nw=class extends Ml{constructor(){super(["pie","showData"])}},R(Nw,"PieTokenBuilder"),Nw),Dw,Msr=(Dw=class extends Md{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},R(Dw,"PieValueConverter"),Dw),xWe={parser:{TokenBuilder:R(()=>new _sr,"TokenBuilder"),ValueConverter:R(()=>new Msr,"ValueConverter")}};function wWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Qar,xWe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}R(wWe,"createPieServices");var Ow,Lsr=(Ow=class extends Md{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()}},R(Ow,"TreeViewValueConverter"),Ow),Pw,Isr=(Pw=class extends Ml{constructor(){super(["treeView-beta"])}},R(Pw,"TreeViewTokenBuilder"),Pw),TWe={parser:{TokenBuilder:R(()=>new Isr,"TokenBuilder"),ValueConverter:R(()=>new Lsr,"ValueConverter")}};function kWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),asr,TWe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}R(kWe,"createTreeViewServices");var Bw,$sr=(Bw=class extends Ml{constructor(){super(["architecture"])}},R(Bw,"ArchitectureTokenBuilder"),Bw),Fw,Nsr=(Fw=class extends Md{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()}}},R(Fw,"ArchitectureValueConverter"),Fw),CWe={parser:{TokenBuilder:R(()=>new $sr,"TokenBuilder"),ValueConverter:R(()=>new Nsr,"ValueConverter")}};function SWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Uar,CWe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}R(SWe,"createArchitectureServices");var zw,Dsr=(zw=class extends Ml{constructor(){super(["eventmodeling"])}},R(zw,"EventModelingTokenBuilder"),zw),A1e=new Set(["cmd","command"]),R1e=new Set(["evt","event"]),bH=new Set(["rmo","readmodel"]),_1e=new Set(["pcr","processor"]),M1e=new Set(["ui"]);function EWe(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)}}R(EWe,"registerValidationChecks");var Hw,Osr=(Hw=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(A1e.has(e.modelEntityType)?this.validateSources(e,new Set([...M1e,..._1e]),"command","ui or processor",r):R1e.has(e.modelEntityType)?this.validateSources(e,A1e,"event","command",r):bH.has(e.modelEntityType)?this.validateSources(e,R1e,"read model","event",r):_1e.has(e.modelEntityType)?this.validateSources(e,bH,"processor","read model",r):M1e.has(e.modelEntityType)&&this.validateSources(e,bH,"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"})}}},R(Hw,"EventModelingValidator"),Hw),AWe={parser:{TokenBuilder:R(()=>new Dsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")},validation:{EventModelingValidator:R(()=>new Osr,"EventModelingValidator")}};function RWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),jar,AWe);return e.ServiceRegistry.register(r),EWe(r),{shared:e,EventModel:r}}R(RWe,"createEventModelingServices");var Zs={},Psr={info:R(async()=>{const{createInfoServices:t}=await xr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>vvr);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;Zs.info=e},"info"),packet:R(async()=>{const{createPacketServices:t}=await xr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>bvr);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;Zs.packet=e},"packet"),pie:R(async()=>{const{createPieServices:t}=await xr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>xvr);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;Zs.pie=e},"pie"),treeView:R(async()=>{const{createTreeViewServices:t}=await xr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>wvr);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;Zs.treeView=e},"treeView"),architecture:R(async()=>{const{createArchitectureServices:t}=await xr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Tvr);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;Zs.architecture=e},"architecture"),gitGraph:R(async()=>{const{createGitGraphServices:t}=await xr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>kvr);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;Zs.gitGraph=e},"gitGraph"),eventmodeling:R(async()=>{const{createEventModelingServices:t}=await xr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Cvr);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;Zs.eventmodeling=e},"eventmodeling"),radar:R(async()=>{const{createRadarServices:t}=await xr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>Svr);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;Zs.radar=e},"radar"),railroad:R(async()=>{const{createRailroadServices:t}=await xr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>Evr);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;Zs.railroad=e},"railroad"),railroadEbnf:R(async()=>{const{createRailroadEbnfServices:t}=await xr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Avr);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;Zs.railroadEbnf=e},"railroadEbnf"),railroadAbnf:R(async()=>{const{createRailroadAbnfServices:t}=await xr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Rvr);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;Zs.railroadAbnf=e},"railroadAbnf"),railroadPeg:R(async()=>{const{createRailroadPegServices:t}=await xr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>_vr);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;Zs.railroadPeg=e},"railroadPeg"),treemap:R(async()=>{const{createTreemapServices:t}=await xr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Mvr);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;Zs.treemap=e},"treemap"),wardley:R(async()=>{const{createWardleyServices:t}=await xr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Lvr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;Zs.wardley=e},"wardley"),cynefin:R(async()=>{const{createCynefinServices:t}=await xr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Ivr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;Zs.cynefin=e},"cynefin")};async function xu(t,e){const r=Psr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Zs[t]||await r();const i=Zs[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new v7(i);return i.value}R(xu,"parse");var Vw,v7=(Vw=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 yw,ysr=(yw=class extends Ml{constructor(){super(["radar-beta"])}},R(yw,"RadarTokenBuilder"),yw),iWe={parser:{TokenBuilder:R(()=>new ysr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function aWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),asr,iWe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}R(aWe,"createRadarServices");var vw,vsr=(vw=class extends Ml{constructor(){super(["railroad-beta"])}},R(vw,"RailroadTokenBuilder"),vw),S1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew vsr,"TokenBuilder"),ValueConverter:R(()=>new bsr,"ValueConverter")}};function bne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),lsr,sWe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}R(bne,"createRailroadServices");var xw,xsr=(xw=class extends Ml{constructor(){super(["railroad-ebnf-beta"])}},R(xw,"RailroadEbnfTokenBuilder"),xw),E1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew xsr,"TokenBuilder"),ValueConverter:R(()=>new wsr,"ValueConverter")}};function xne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),osr,oWe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}R(xne,"createRailroadEbnfServices");var Tw,Tsr=(Tw=class extends Ml{constructor(){super(["railroad-abnf-beta"])}},R(Tw,"RailroadAbnfTokenBuilder"),Tw),kw,ksr=(kw=class extends Ld{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)}},R(kw,"RailroadAbnfValueConverter"),kw),lWe={parser:{TokenBuilder:R(()=>new Tsr,"TokenBuilder"),ValueConverter:R(()=>new ksr,"ValueConverter")}};function wne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),ssr,lWe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}R(wne,"createRailroadAbnfServices");var Cw,Csr=(Cw=class extends Ml{constructor(){super(["railroad-peg-beta"])}},R(Cw,"RailroadPegTokenBuilder"),Cw),A1e=R(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Csr,"TokenBuilder"),ValueConverter:R(()=>new Ssr,"ValueConverter")}};function Tne(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),csr,cWe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}R(Tne,"createRailroadPegServices");var Ew,Esr=(Ew=class extends Ml{constructor(){super(["treemap"])}},R(Ew,"TreemapTokenBuilder"),Ew),Asr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Aw,Rsr=(Aw=class extends Ld{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=Asr.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},R(Aw,"TreemapValueConverter"),Aw);function uWe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}R(uWe,"registerValidationChecks");var Rw,_sr=(Rw=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"}))}},R(Rw,"TreemapValidator"),Rw),hWe={parser:{TokenBuilder:R(()=>new Esr,"TokenBuilder"),ValueConverter:R(()=>new Rsr,"ValueConverter")},validation:{TreemapValidator:R(()=>new _sr,"TreemapValidator")}};function dWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),usr,hWe);return e.ServiceRegistry.register(r),uWe(r),{shared:e,Treemap:r}}R(dWe,"createTreemapServices");var _w,Msr=(_w=class extends Ld{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},R(_w,"WardleyValueConverter"),_w),fWe={parser:{ValueConverter:R(()=>new Msr,"ValueConverter")}};function pWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),dsr,fWe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}R(pWe,"createWardleyServices");var Mw,Lsr=(Mw=class extends Ml{constructor(){super(["cynefin-beta"])}},R(Mw,"CynefinTokenBuilder"),Mw),gWe={parser:{TokenBuilder:R(()=>new Lsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function mWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Jar,gWe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}R(mWe,"createCynefinServices");var Lw,Isr=(Lw=class extends Ml{constructor(){super(["gitGraph"])}},R(Lw,"GitGraphTokenBuilder"),Lw),yWe={parser:{TokenBuilder:R(()=>new Isr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function vWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),tsr,yWe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}R(vWe,"createGitGraphServices");var Iw,$sr=(Iw=class extends Ml{constructor(){super(["info","showInfo"])}},R(Iw,"InfoTokenBuilder"),Iw),bWe={parser:{TokenBuilder:R(()=>new $sr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function xWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),rsr,bWe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}R(xWe,"createInfoServices");var $w,Nsr=($w=class extends Ml{constructor(){super(["packet"])}},R($w,"PacketTokenBuilder"),$w),wWe={parser:{TokenBuilder:R(()=>new Nsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")}};function TWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),nsr,wWe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}R(TWe,"createPacketServices");var Nw,Dsr=(Nw=class extends Ml{constructor(){super(["pie","showData"])}},R(Nw,"PieTokenBuilder"),Nw),Dw,Osr=(Dw=class extends Ld{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},R(Dw,"PieValueConverter"),Dw),kWe={parser:{TokenBuilder:R(()=>new Dsr,"TokenBuilder"),ValueConverter:R(()=>new Osr,"ValueConverter")}};function CWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),isr,kWe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}R(CWe,"createPieServices");var Ow,Psr=(Ow=class extends Ld{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()}},R(Ow,"TreeViewValueConverter"),Ow),Pw,Bsr=(Pw=class extends Ml{constructor(){super(["treeView-beta"])}},R(Pw,"TreeViewTokenBuilder"),Pw),SWe={parser:{TokenBuilder:R(()=>new Bsr,"TokenBuilder"),ValueConverter:R(()=>new Psr,"ValueConverter")}};function EWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),hsr,SWe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}R(EWe,"createTreeViewServices");var Bw,Fsr=(Bw=class extends Ml{constructor(){super(["architecture"])}},R(Bw,"ArchitectureTokenBuilder"),Bw),Fw,zsr=(Fw=class extends Ld{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()}}},R(Fw,"ArchitectureValueConverter"),Fw),AWe={parser:{TokenBuilder:R(()=>new Fsr,"TokenBuilder"),ValueConverter:R(()=>new zsr,"ValueConverter")}};function RWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),Qar,AWe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}R(RWe,"createArchitectureServices");var zw,Hsr=(zw=class extends Ml{constructor(){super(["eventmodeling"])}},R(zw,"EventModelingTokenBuilder"),zw),R1e=new Set(["cmd","command"]),_1e=new Set(["evt","event"]),wH=new Set(["rmo","readmodel"]),M1e=new Set(["pcr","processor"]),L1e=new Set(["ui"]);function _We(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)}}R(_We,"registerValidationChecks");var Hw,Vsr=(Hw=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(R1e.has(e.modelEntityType)?this.validateSources(e,new Set([...L1e,...M1e]),"command","ui or processor",r):_1e.has(e.modelEntityType)?this.validateSources(e,R1e,"event","command",r):wH.has(e.modelEntityType)?this.validateSources(e,_1e,"read model","event",r):M1e.has(e.modelEntityType)?this.validateSources(e,wH,"processor","read model",r):L1e.has(e.modelEntityType)&&this.validateSources(e,wH,"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"})}}},R(Hw,"EventModelingValidator"),Hw),MWe={parser:{TokenBuilder:R(()=>new Hsr,"TokenBuilder"),ValueConverter:R(()=>new ck,"ValueConverter")},validation:{EventModelingValidator:R(()=>new Vsr,"EventModelingValidator")}};function LWe(t=vo){const e=Nn(Hs(t),_l),r=Nn(zs({shared:e}),esr,MWe);return e.ServiceRegistry.register(r),_We(r),{shared:e,EventModel:r}}R(LWe,"createEventModelingServices");var Zs={},Wsr={info:R(async()=>{const{createInfoServices:t}=await wr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>Cvr);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;Zs.info=e},"info"),packet:R(async()=>{const{createPacketServices:t}=await wr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>Svr);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;Zs.packet=e},"packet"),pie:R(async()=>{const{createPieServices:t}=await wr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Evr);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;Zs.pie=e},"pie"),treeView:R(async()=>{const{createTreeViewServices:t}=await wr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>Avr);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;Zs.treeView=e},"treeView"),architecture:R(async()=>{const{createArchitectureServices:t}=await wr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Rvr);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;Zs.architecture=e},"architecture"),gitGraph:R(async()=>{const{createGitGraphServices:t}=await wr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>_vr);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;Zs.gitGraph=e},"gitGraph"),eventmodeling:R(async()=>{const{createEventModelingServices:t}=await wr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Mvr);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;Zs.eventmodeling=e},"eventmodeling"),radar:R(async()=>{const{createRadarServices:t}=await wr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>Lvr);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;Zs.radar=e},"radar"),railroad:R(async()=>{const{createRailroadServices:t}=await wr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>Ivr);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;Zs.railroad=e},"railroad"),railroadEbnf:R(async()=>{const{createRailroadEbnfServices:t}=await wr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>$vr);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;Zs.railroadEbnf=e},"railroadEbnf"),railroadAbnf:R(async()=>{const{createRailroadAbnfServices:t}=await wr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Nvr);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;Zs.railroadAbnf=e},"railroadAbnf"),railroadPeg:R(async()=>{const{createRailroadPegServices:t}=await wr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>Dvr);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;Zs.railroadPeg=e},"railroadPeg"),treemap:R(async()=>{const{createTreemapServices:t}=await wr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Ovr);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;Zs.treemap=e},"treemap"),wardley:R(async()=>{const{createWardleyServices:t}=await wr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Pvr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;Zs.wardley=e},"wardley"),cynefin:R(async()=>{const{createCynefinServices:t}=await wr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Bvr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;Zs.cynefin=e},"cynefin")};async function xu(t,e){const r=Wsr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Zs[t]||await r();const i=Zs[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new b7(i);return i.value}R(xu,"parse");var Vw,b7=(Vw=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}},R(Vw,"MermaidParseError"),Vw),gi={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Bsr=xn.gitGraph,fv=w(()=>Gi({...Bsr,...pr().gitGraph}),"getConfig"),Qt=new Mee(()=>{const t=fv(),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 TO(){return b3e({length:7})}w(TO,"getID");function _We(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},[])}w(_We,"uniqBy");var Fsr=w(function(t){Qt.records.direction=t},"setDirection"),zsr=w(function(t){he.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Qt.records.options=JSON.parse(t)}catch(e){he.error("error while parsing gitGraph options",e.message)}},"setOptions"),Hsr=w(function(){return Qt.records.options},"getOptions"),Vsr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;he.info("commit",e,r,n,i),he.debug("Entering commit:",e,r,n,i);const a=fv();r=Ft.sanitizeText(r,a),e=Ft.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Ft.sanitizeText(o,a));const s={id:r||Qt.records.seq+"-"+TO(),message:e,seq:Qt.records.seq++,type:n??gi.NORMAL,tags:i??[],parents:Qt.records.head==null?[]:[Qt.records.head.id],branch:Qt.records.currBranch};Qt.records.head=s,he.info("main branch",a.mainBranchName),Qt.records.commits.has(s.id)&&he.warn(`Commit ID ${s.id} already exists`),Qt.records.commits.set(s.id,s),Qt.records.branches.set(Qt.records.currBranch,s.id),he.debug("in pushCommit "+s.id)},"commit"),Wsr=w(function(t){let e=t.name;const r=t.order;if(e=Ft.sanitizeText(e,fv()),Qt.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}")`);Qt.records.branches.set(e,Qt.records.head!=null?Qt.records.head.id:null),Qt.records.branchConfig.set(e,{name:e,order:r}),MWe(e),he.debug("in createBranch")},"branch"),qsr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=fv();e=Ft.sanitizeText(e,a),r&&(r=Ft.sanitizeText(r,a));const s=Qt.records.branches.get(Qt.records.currBranch),o=Qt.records.branches.get(e),l=s?Qt.records.commits.get(s):void 0,u=o?Qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Qt.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 (${Qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Qt.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&&Qt.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||`${Qt.records.seq}-${TO()}`,message:`merged branch ${e} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,h],branch:Qt.records.currBranch,type:gi.MERGE,customType:n,customId:!!r,tags:i??[]};Qt.records.head=d,Qt.records.commits.set(d.id,d),Qt.records.branches.set(Qt.records.currBranch,d.id),he.debug(Qt.records.branches),he.debug("in mergeBranch")},"merge"),Gsr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;he.debug("Entering cherryPick:",e,r,n);const a=fv();if(e=Ft.sanitizeText(e,a),r=Ft.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Ft.sanitizeText(l,a)),i=Ft.sanitizeText(i,a),!e||!Qt.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=Qt.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===gi.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||!Qt.records.commits.has(r)){if(o===Qt.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=Qt.records.branches.get(Qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Qt.records.seq+"-"+TO(),message:`cherry-picked ${s==null?void 0:s.message} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,s.id],branch:Qt.records.currBranch,type:gi.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===gi.MERGE?`|parent:${i}`:""}`]};Qt.records.head=h,Qt.records.commits.set(h.id,h),Qt.records.branches.set(Qt.records.currBranch,h.id),he.debug(Qt.records.branches),he.debug("in cherryPick")}},"cherryPick"),MWe=w(function(t){if(t=Ft.sanitizeText(t,fv()),Qt.records.branches.has(t)){Qt.records.currBranch=t;const e=Qt.records.branches.get(Qt.records.currBranch);e===void 0||!e?Qt.records.head=null:Qt.records.head=Qt.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 dj(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(dj,"upsert");function wne(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 Qt.records.branches)Qt.records.branches.get(i)===e.id&&n.push(i);if(he.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Qt.records.commits.get(e.parents[0]);dj(t,e,i),e.parents[1]&&t.push(Qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Qt.records.commits.get(e.parents[0]);dj(t,e,i)}}t=_We(t,i=>i.id),wne(t)}w(wne,"prettyPrintCommitHistory");var Usr=w(function(){he.debug(Qt.records.commits);const t=LWe()[0];wne([t])},"prettyPrint"),Ysr=w(function(){Qt.reset(),wi()},"clear"),jsr=w(function(){return[...Qt.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"),Xsr=w(function(){return Qt.records.branches},"getBranches"),Ksr=w(function(){return Qt.records.commits},"getCommits"),LWe=w(function(){const t=[...Qt.records.commits.values()];return t.forEach(function(e){he.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),Zsr=w(function(){return Qt.records.currBranch},"getCurrentBranch"),Qsr=w(function(){return Qt.records.direction},"getDirection"),Jsr=w(function(){return Qt.records.head},"getHead"),IWe={commitType:gi,getConfig:fv,setDirection:Fsr,setOptions:zsr,getOptions:Hsr,commit:Vsr,branch:Wsr,merge:qsr,cherryPick:Gsr,checkout:MWe,prettyPrint:Usr,clear:Ysr,getBranchesAsObjArray:jsr,getBranches:Xsr,getCommits:Ksr,getCommitsArray:LWe,getCurrentBranch:Zsr,getDirection:Qsr,getHead:Jsr,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,setDiagramTitle:qi,getDiagramTitle:Di},eor=w((t,e)=>{Al(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)tor(r,e)},"populate"),tor=w((t,e)=>{const n={Commit:w(i=>e.commit(ror(i)),"Commit"),Branch:w(i=>e.branch(nor(i)),"Branch"),Merge:w(i=>e.merge(ior(i)),"Merge"),Checkout:w(i=>e.checkout(aor(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(sor(i)),"CherryPicking")}[t.$type];n?n(t):he.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),ror=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?gi[t.type]:gi.NORMAL,tags:t.tags??void 0}),"parseCommit"),nor=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),ior=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?gi[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),aor=w(t=>t.branch,"parseCheckout"),sor=w(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"),oor={parse:w(async t=>{const e=await xu("gitGraph",t);he.debug(e),eor(e,IWe)},"parse")},kp=10,Cp=40,Ih=4,hf=2,qm=8,kO=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),fj=12,Tne=new Set(["redux-color","redux-dark-color"]),lor=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Gm=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Wl=new Map,Xl=new Map,PI=30,J5=new Map,BI=[],df=0,kn="LR",cor=w(()=>{Wl.clear(),Xl.clear(),J5.clear(),df=0,BI=[],kn="LR"},"clear"),$We=w(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"),NWe=w(t=>{let e,r,n;return kn==="BT"?(r=w((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=w((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=kn==="TB"||kn=="BT"?(s=Xl.get(i))==null?void 0:s.y:(o=Xl.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),uor=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Xl.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),hor=w((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=por(o),i=Math.max(n,i)):a.push(o),gor(o,n)}),n=i,a.forEach(s=>{mor(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=uor(o.parents);n=Xl.get(l).y-Cp,n<=i&&(i=n);const u=Wl.get(o.branch).pos,h=n-kp;Xl.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),dor=w(t=>{var n;const e=NWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Xl.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"),por=w(t=>dor(t)+Cp,"calculateCommitPosition"),gor=w((t,e)=>{const r=Wl.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+kp;return Xl.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),mor=w((t,e,r)=>{const n=Wl.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Xl.set(t.id,{x:a,y:i})},"setRootPosition"),yor=w((t,e,r,n,i,a)=>{const{theme:s}=We(),o=kO.has(s??""),l=Tne.has(s??""),u=lor.has(s??"");if(a===gi.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${Gm(i,qm,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${Gm(i,qm,l)} ${n}-inner`);else if(a===gi.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${Gm(i,qm,l)}`),a===gi.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${Gm(i,qm,l)}`)}if(a===gi.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${Gm(i,qm,l)}`)}}},"drawCommitBullet"),vor=w((t,e,r,n,i)=>{var a;if(e.type!==gi.CHERRY_PICK&&(e.customId&&e.type===gi.MERGE||e.type!==gi.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-hf).attr("y",r.y+13.5).attr("width",u.width+2*hf).attr("height",u.height+2*hf),kn==="TB"||kn==="BT"?(o.attr("x",r.x-(u.width+4*Ih+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Ih)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(kn==="TB"||kn==="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"),bor=w((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-Ih/2},${g+hf} - ${n-s/2-Ih/2},${g-hf} - ${r.posWithOffset-s/2-Ih},${g-p-hf} - ${r.posWithOffset+s/2+Ih},${g-p-hf} - ${r.posWithOffset+s/2+Ih},${g+p+hf} - ${r.posWithOffset-s/2-Ih},${g+p+hf}`),h.attr("cy",g).attr("cx",n-s/2+Ih/2).attr("r",1.5).attr("class","tag-hole"),kn==="TB"||kn==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},R(Vw,"MermaidParseError"),Vw),gi={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},qsr=xn.gitGraph,fv=w(()=>Gi({...qsr,...pr().gitGraph}),"getConfig"),Qt=new Iee(()=>{const t=fv(),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 CO(){return x3e({length:7})}w(CO,"getID");function IWe(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},[])}w(IWe,"uniqBy");var Gsr=w(function(t){Qt.records.direction=t},"setDirection"),Usr=w(function(t){he.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Qt.records.options=JSON.parse(t)}catch(e){he.error("error while parsing gitGraph options",e.message)}},"setOptions"),Ysr=w(function(){return Qt.records.options},"getOptions"),jsr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;he.info("commit",e,r,n,i),he.debug("Entering commit:",e,r,n,i);const a=fv();r=Ft.sanitizeText(r,a),e=Ft.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Ft.sanitizeText(o,a));const s={id:r||Qt.records.seq+"-"+CO(),message:e,seq:Qt.records.seq++,type:n??gi.NORMAL,tags:i??[],parents:Qt.records.head==null?[]:[Qt.records.head.id],branch:Qt.records.currBranch};Qt.records.head=s,he.info("main branch",a.mainBranchName),Qt.records.commits.has(s.id)&&he.warn(`Commit ID ${s.id} already exists`),Qt.records.commits.set(s.id,s),Qt.records.branches.set(Qt.records.currBranch,s.id),he.debug("in pushCommit "+s.id)},"commit"),Xsr=w(function(t){let e=t.name;const r=t.order;if(e=Ft.sanitizeText(e,fv()),Qt.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}")`);Qt.records.branches.set(e,Qt.records.head!=null?Qt.records.head.id:null),Qt.records.branchConfig.set(e,{name:e,order:r}),$We(e),he.debug("in createBranch")},"branch"),Ksr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=fv();e=Ft.sanitizeText(e,a),r&&(r=Ft.sanitizeText(r,a));const s=Qt.records.branches.get(Qt.records.currBranch),o=Qt.records.branches.get(e),l=s?Qt.records.commits.get(s):void 0,u=o?Qt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Qt.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 (${Qt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Qt.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&&Qt.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||`${Qt.records.seq}-${CO()}`,message:`merged branch ${e} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,h],branch:Qt.records.currBranch,type:gi.MERGE,customType:n,customId:!!r,tags:i??[]};Qt.records.head=d,Qt.records.commits.set(d.id,d),Qt.records.branches.set(Qt.records.currBranch,d.id),he.debug(Qt.records.branches),he.debug("in mergeBranch")},"merge"),Zsr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;he.debug("Entering cherryPick:",e,r,n);const a=fv();if(e=Ft.sanitizeText(e,a),r=Ft.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Ft.sanitizeText(l,a)),i=Ft.sanitizeText(i,a),!e||!Qt.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=Qt.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===gi.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||!Qt.records.commits.has(r)){if(o===Qt.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=Qt.records.branches.get(Qt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Qt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Qt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Qt.records.seq+"-"+CO(),message:`cherry-picked ${s==null?void 0:s.message} into ${Qt.records.currBranch}`,seq:Qt.records.seq++,parents:Qt.records.head==null?[]:[Qt.records.head.id,s.id],branch:Qt.records.currBranch,type:gi.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===gi.MERGE?`|parent:${i}`:""}`]};Qt.records.head=h,Qt.records.commits.set(h.id,h),Qt.records.branches.set(Qt.records.currBranch,h.id),he.debug(Qt.records.branches),he.debug("in cherryPick")}},"cherryPick"),$We=w(function(t){if(t=Ft.sanitizeText(t,fv()),Qt.records.branches.has(t)){Qt.records.currBranch=t;const e=Qt.records.branches.get(Qt.records.currBranch);e===void 0||!e?Qt.records.head=null:Qt.records.head=Qt.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 pj(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(pj,"upsert");function kne(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 Qt.records.branches)Qt.records.branches.get(i)===e.id&&n.push(i);if(he.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Qt.records.commits.get(e.parents[0]);pj(t,e,i),e.parents[1]&&t.push(Qt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Qt.records.commits.get(e.parents[0]);pj(t,e,i)}}t=IWe(t,i=>i.id),kne(t)}w(kne,"prettyPrintCommitHistory");var Qsr=w(function(){he.debug(Qt.records.commits);const t=NWe()[0];kne([t])},"prettyPrint"),Jsr=w(function(){Qt.reset(),wi()},"clear"),eor=w(function(){return[...Qt.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"),tor=w(function(){return Qt.records.branches},"getBranches"),ror=w(function(){return Qt.records.commits},"getCommits"),NWe=w(function(){const t=[...Qt.records.commits.values()];return t.forEach(function(e){he.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),nor=w(function(){return Qt.records.currBranch},"getCurrentBranch"),ior=w(function(){return Qt.records.direction},"getDirection"),aor=w(function(){return Qt.records.head},"getHead"),DWe={commitType:gi,getConfig:fv,setDirection:Gsr,setOptions:Usr,getOptions:Ysr,commit:jsr,branch:Xsr,merge:Ksr,cherryPick:Zsr,checkout:$We,prettyPrint:Qsr,clear:Jsr,getBranchesAsObjArray:eor,getBranches:tor,getCommits:ror,getCommitsArray:NWe,getCurrentBranch:nor,getDirection:ior,getHead:aor,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,setDiagramTitle:qi,getDiagramTitle:Di},sor=w((t,e)=>{Al(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)oor(r,e)},"populate"),oor=w((t,e)=>{const n={Commit:w(i=>e.commit(lor(i)),"Commit"),Branch:w(i=>e.branch(cor(i)),"Branch"),Merge:w(i=>e.merge(uor(i)),"Merge"),Checkout:w(i=>e.checkout(hor(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(dor(i)),"CherryPicking")}[t.$type];n?n(t):he.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),lor=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?gi[t.type]:gi.NORMAL,tags:t.tags??void 0}),"parseCommit"),cor=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),uor=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?gi[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),hor=w(t=>t.branch,"parseCheckout"),dor=w(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"),por={parse:w(async t=>{const e=await xu("gitGraph",t);he.debug(e),sor(e,DWe)},"parse")},kp=10,Cp=40,$h=4,hf=2,qm=8,SO=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),gj=12,Cne=new Set(["redux-color","redux-dark-color"]),gor=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Gm=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),Wl=new Map,jl=new Map,FI=30,J5=new Map,zI=[],df=0,kn="LR",mor=w(()=>{Wl.clear(),jl.clear(),J5.clear(),df=0,zI=[],kn="LR"},"clear"),OWe=w(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"),PWe=w(t=>{let e,r,n;return kn==="BT"?(r=w((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=w((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=kn==="TB"||kn=="BT"?(s=jl.get(i))==null?void 0:s.y:(o=jl.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),yor=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=jl.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),vor=w((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=xor(o),i=Math.max(n,i)):a.push(o),wor(o,n)}),n=i,a.forEach(s=>{Tor(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=yor(o.parents);n=jl.get(l).y-Cp,n<=i&&(i=n);const u=Wl.get(o.branch).pos,h=n-kp;jl.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),bor=w(t=>{var n;const e=PWe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=jl.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"),xor=w(t=>bor(t)+Cp,"calculateCommitPosition"),wor=w((t,e)=>{const r=Wl.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+kp;return jl.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Tor=w((t,e,r)=>{const n=Wl.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;jl.set(t.id,{x:a,y:i})},"setRootPosition"),kor=w((t,e,r,n,i,a)=>{const{theme:s}=We(),o=SO.has(s??""),l=Cne.has(s??""),u=gor.has(s??"");if(a===gi.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${Gm(i,qm,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${Gm(i,qm,l)} ${n}-inner`);else if(a===gi.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${Gm(i,qm,l)}`),a===gi.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${Gm(i,qm,l)}`)}if(a===gi.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${Gm(i,qm,l)}`)}}},"drawCommitBullet"),Cor=w((t,e,r,n,i)=>{var a;if(e.type!==gi.CHERRY_PICK&&(e.customId&&e.type===gi.MERGE||e.type!==gi.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-hf).attr("y",r.y+13.5).attr("width",u.width+2*hf).attr("height",u.height+2*hf),kn==="TB"||kn==="BT"?(o.attr("x",r.x-(u.width+4*$h+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*$h)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(kn==="TB"||kn==="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"),Sor=w((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-$h/2},${g+hf} + ${n-s/2-$h/2},${g-hf} + ${r.posWithOffset-s/2-$h},${g-p-hf} + ${r.posWithOffset+s/2+$h},${g-p-hf} + ${r.posWithOffset+s/2+$h},${g+p+hf} + ${r.posWithOffset-s/2-$h},${g+p+hf}`),h.attr("cy",g).attr("cx",n-s/2+$h/2).attr("r",1.5).attr("class","tag-hole"),kn==="TB"||kn==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} ${r.x+kp},${m-p-2} ${r.x+kp+s+4},${m-p-2} ${r.x+kp+s+4},${m+p+2} - ${r.x+kp},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+Ih/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"),xor=w(t=>{switch(t.customType??t.type){case gi.NORMAL:return"commit-normal";case gi.REVERSE:return"commit-reverse";case gi.HIGHLIGHT:return"commit-highlight";case gi.MERGE:return"commit-merge";case gi.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),wor=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=NWe(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Cp:e==="BT"?(n.get(t.id)??i).y-Cp:s.x+Cp}}else return e==="TB"?PI:e==="BT"?(n.get(t.id)??i).y-Cp:0;return 0},"calculatePosition"),Tor=w((t,e,r)=>{var l,u;const n=kn==="BT"&&r?e:e+kp,i=(l=Wl.get(t.branch))==null?void 0:l.pos,a=kn==="TB"||kn==="BT"?(u=Wl.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=kO.has(We().theme??""),o=kn==="TB"||kn==="BT"?n:i+(s?fj/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),L1e=w((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=kn==="TB"||kn==="BT"?PI:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=w((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);kn==="BT"&&(l&&hor(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=wor(f,kn,s,Xl));const p=Tor(f,s,l);if(r){const m=xor(f),y=f.customType??f.type,v=((g=Wl.get(f.branch))==null?void 0:g.index)??0;yor(i,f,p,m,v,y),vor(a,f,p,s,n),bor(a,f,p,s)}kn==="TB"||kn==="BT"?Xl.set(f.id,{x:p.x,y:p.posWithOffset}):Xl.set(f.id,{x:p.posWithOffset,y:p.y}),s=kn==="BT"&&l?s+Cp:s+Cp+kp,s>df&&(df=s)})},"drawCommits"),kor=w((t,e,r,n,i)=>{const s=(kn==="TB"||kn==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=w(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),eC=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(BI.every(s=>Math.abs(s-n)>=10))return BI.push(n),n;const a=Math.abs(t-e);return eC(t,e-a/5,r+1)},"findLane"),Cor=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=We(),a=Tne.has(i??""),s=Xl.get(e.id),o=Xl.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=kor(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Wl.get(r.branch))==null?void 0:m.index;r.type===gi.MERGE&&e.id!==r.parents[0]&&(p=(y=Wl.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 T=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===gi.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}`)):kn==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===gi.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===gi.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"+Gm(p,qm,a))},"drawArrow"),Sor=w((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=>{Cor(r,e.get(a),i,e)})})},"drawArrows"),Eor=w((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=We(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=kO.has(a??""),h=Tne.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=Gm(p,u?l:qm,h),m=(L=Wl.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=kn==="TB"||kn==="BT"?m:u?m+fj/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",df),v.attr("y2",y),v.attr("class","branch branch"+g),kn==="TB"?(v.attr("y1",PI),v.attr("x1",m),v.attr("y2",df),v.attr("x2",m)):kn==="BT"&&(v.attr("y1",df),v.attr("x1",m),v.attr("y2",PI),v.attr("x2",m)),BI.push(y);const x=f.name,b=$We(x),T=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const C=b.getBBox(),E=u?0:4,A=u?16:0,M=u?fj:0;i==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+A).attr("height",C.height+4+M),S.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+A/2)+", "+(y-C.height/2-2)+")"),kn==="TB"?(T.attr("x",m-C.width/2-10).attr("y",0),S.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(T.attr("transform",`translate(${-A/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(-M*2+7)+")"))):kn==="BT"?(T.attr("x",m-C.width/2-10).attr("y",df),S.attr("transform","translate("+(m-C.width/2-5)+", "+df+")"),u&&(T.attr("transform",`translate(${-A/2-3}, ${M+10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(df+M*2+4)+")"))):T.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),Aor=w(function(t,e,r,n,i){return Wl.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(kn==="TB"||kn==="BT"?n.width/2:0),e},"setBranchPosition"),Ror=w(function(t,e,r,n){cor(),he.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){he.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;J5=i.getCommits();const o=i.getBranchesAsObjArray();kn=i.getDirection();const l=bt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=We(),{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"&&kO.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,x)=>{var E;const b=$We(v.name),T=l.append("g"),k=T.insert("g").attr("class","branchLabel"),S=k.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const C=b.getBBox();y=Aor(v.name,y,x,C,s),S.remove(),k.remove(),T.remove()}),L1e(l,J5,!1,a),a.showBranches&&Eor(l,o,a,e),Sor(l,J5),L1e(l,J5,!0,a),Vr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),fK(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),_or={draw:Ror},DWe=8,OWe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Mor=new Set(["redux-color","redux-dark-color"]),Lor=new Set(["neo","neo-dark"]),Ior=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),$or=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Nor=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case gi.NORMAL:return"commit-normal";case gi.REVERSE:return"commit-reverse";case gi.HIGHLIGHT:return"commit-highlight";case gi.MERGE:return"commit-merge";case gi.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Aor=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=PWe(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Cp:e==="BT"?(n.get(t.id)??i).y-Cp:s.x+Cp}}else return e==="TB"?FI:e==="BT"?(n.get(t.id)??i).y-Cp:0;return 0},"calculatePosition"),Ror=w((t,e,r)=>{var l,u;const n=kn==="BT"&&r?e:e+kp,i=(l=Wl.get(t.branch))==null?void 0:l.pos,a=kn==="TB"||kn==="BT"?(u=Wl.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=SO.has(We().theme??""),o=kn==="TB"||kn==="BT"?n:i+(s?gj/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),I1e=w((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=kn==="TB"||kn==="BT"?FI:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=w((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);kn==="BT"&&(l&&vor(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=Aor(f,kn,s,jl));const p=Ror(f,s,l);if(r){const m=Eor(f),y=f.customType??f.type,v=((g=Wl.get(f.branch))==null?void 0:g.index)??0;kor(i,f,p,m,v,y),Cor(a,f,p,s,n),Sor(a,f,p,s)}kn==="TB"||kn==="BT"?jl.set(f.id,{x:p.x,y:p.posWithOffset}):jl.set(f.id,{x:p.posWithOffset,y:p.y}),s=kn==="BT"&&l?s+Cp:s+Cp+kp,s>df&&(df=s)})},"drawCommits"),_or=w((t,e,r,n,i)=>{const s=(kn==="TB"||kn==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=w(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),eC=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(zI.every(s=>Math.abs(s-n)>=10))return zI.push(n),n;const a=Math.abs(t-e);return eC(t,e-a/5,r+1)},"findLane"),Mor=w((t,e,r,n)=>{var m,y,v,x,b;const{theme:i}=We(),a=Cne.has(i??""),s=jl.get(e.id),o=jl.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=_or(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=Wl.get(r.branch))==null?void 0:m.index;r.type===gi.MERGE&&e.id!==r.parents[0]&&(p=(y=Wl.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 T=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===gi.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}`)):kn==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===gi.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===gi.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"+Gm(p,qm,a))},"drawArrow"),Lor=w((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=>{Mor(r,e.get(a),i,e)})})},"drawArrows"),Ior=w((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=We(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=SO.has(a??""),h=Cne.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=Gm(p,u?l:qm,h),m=(L=Wl.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=kn==="TB"||kn==="BT"?m:u?m+gj/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",df),v.attr("y2",y),v.attr("class","branch branch"+g),kn==="TB"?(v.attr("y1",FI),v.attr("x1",m),v.attr("y2",df),v.attr("x2",m)):kn==="BT"&&(v.attr("y1",df),v.attr("x1",m),v.attr("y2",FI),v.attr("x2",m)),zI.push(y);const x=f.name,b=OWe(x),T=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const C=b.getBBox(),E=u?0:4,A=u?16:0,M=u?gj:0;i==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+A).attr("height",C.height+4+M),S.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+A/2)+", "+(y-C.height/2-2)+")"),kn==="TB"?(T.attr("x",m-C.width/2-10).attr("y",0),S.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(T.attr("transform",`translate(${-A/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(-M*2+7)+")"))):kn==="BT"?(T.attr("x",m-C.width/2-10).attr("y",df),S.attr("transform","translate("+(m-C.width/2-5)+", "+df+")"),u&&(T.attr("transform",`translate(${-A/2-3}, ${M+10})`),S.attr("transform","translate("+(m-C.width/2-5)+", "+(df+M*2+4)+")"))):T.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),$or=w(function(t,e,r,n,i){return Wl.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(kn==="TB"||kn==="BT"?n.width/2:0),e},"setBranchPosition"),Nor=w(function(t,e,r,n){mor(),he.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){he.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;J5=i.getCommits();const o=i.getBranchesAsObjArray();kn=i.getDirection();const l=bt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=We(),{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"&&SO.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,x)=>{var E;const b=OWe(v.name),T=l.append("g"),k=T.insert("g").attr("class","branchLabel"),S=k.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const C=b.getBBox();y=$or(v.name,y,x,C,s),S.remove(),k.remove(),T.remove()}),I1e(l,J5,!1,a),a.showBranches&&Ior(l,o,a,e),Lor(l,J5),I1e(l,J5,!0,a),Vr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),gK(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),Dor={draw:Nor},BWe=8,FWe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Oor=new Set(["redux-color","redux-dark-color"]),Por=new Set(["neo","neo-dark"]),Bor=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),For=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),zor=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=pr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=OWe.has(r);if(Lor.has(r)){let s="";for(let o=0;o{const e=pr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=FWe.has(r);if(Por.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%DWe;return` + `;return s}},"genColor"),Vor=w(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%BWe;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"),Por=w(t=>{const e=pr(),{theme:r}=e,n=$or.has(r);return` +`)}`,"normalTheme"),Wor=w(t=>{const e=pr(),{theme:r}=e,n=For.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -2754,7 +2767,7 @@ lodash-es/lodash.js: font-family: var(--mermaid-font-family); } - ${n?Dor(t):Oor(t)} + ${n?Hor(t):Vor(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -2785,7 +2798,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: ${OWe.has(r)?t.strokeWidth:8}; + stroke-width: ${FWe.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -2794,12 +2807,12 @@ lodash-es/lodash.js: font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),Bor=Por,For={parser:oor,db:IWe,renderer:_or,styles:Bor};const zor=Object.freeze(Object.defineProperty({__proto__:null,diagram:For},Symbol.toStringTag,{value:"Module"}));var o_={exports:{}},Hor=o_.exports,I1e;function Vor(){return I1e||(I1e=1,(function(t,e){(function(r,n){t.exports=n()})(Hor,(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)}}}))})(o_)),o_.exports}var Wor=Vor();const qor=ky(Wor);var l_={exports:{}},Gor=l_.exports,$1e;function Uor(){return $1e||($1e=1,(function(t,e){(function(r,n){t.exports=n()})(Gor,(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 x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[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 x,b=l.meridiem;if(b){for(var T=1;T<=24;T+=1)if(y.indexOf(b(T,0,v))>-1){x=T>12;break}}else x=y===(v?"pm":"PM");return x},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,x=y.match(/\d+/);if(this.day=x[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"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],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,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,L,P){var N=P&&P.toUpperCase();return L||x[P]||r[P]||x[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,I,O){return I||O.slice(1)}))}))).match(n),T=b.length,k=0;k-1)return new Date(($==="X"?1e3:1)*D);var H=m($)(D),B=H.year,V=H.month,q=H.day,G=H.hours,Q=H.minutes,j=H.seconds,ae=H.milliseconds,Z=H.zone,J=H.week,re=new Date,ee=q||(B||V?1:re.getDate()),me=B||re.getFullYear(),te=0;B&&!V||(te=V>0?V-1:re.getMonth());var $e,Oe=G||0,He=Q||0,ue=j||0,ce=ae||0;return Z?new Date(Date.UTC(me,te,ee,Oe,He,ue,ce+60*Z.offset*1e3)):F?new Date(Date.UTC(me,te,ee,Oe,He,ue,ce)):($e=new Date(me,te,ee,Oe,He,ue,ce),J&&($e=z($e).week(J).toDate()),$e)}catch{return new Date("")}})(S,A,C,x),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),P&&S!=this.format(A)&&(this.$d=new Date("")),l={}}else if(A instanceof Array)for(var _=A.length,I=1;I<=_;I+=1){E[1]=A[I-1];var O=x.apply(this,E);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}I===_&&(this.$d=new Date(""))}else T.call(this,k)}}}))})(l_)),l_.exports}var Yor=Uor();const jor=ky(Yor);var c_={exports:{}},Xor=c_.exports,N1e;function Kor(){return N1e||(N1e=1,(function(t,e){(function(r,n){t.exports=n()})(Xor,(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)}}}))})(c_)),c_.exports}var Zor=Kor();const Qor=ky(Zor);var u_={exports:{}},Jor=u_.exports,D1e;function elr(){return D1e||(D1e=1,(function(t,e){(function(r,n){t.exports=n()})(Jor,(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 T},g=function(S,C,E){return new T(S,E,C.$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)},x=function(S){return Math.abs(S)},b=function(S,C){return S?y(S)?{negative:!0,format:""+x(S)+C}:{negative:!1,format:""+S+C}:{negative:!1,format:""}},T=(function(){function S(E,A,M){var L=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return g(E*f[m(A)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(_){L.$d[m(_)]=E[_]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var N=P.slice(2).map((function(_){return _!=null?Number(_):0}));return this.$d.years=N[0],this.$d.months=N[1],this.$d.weeks=N[2],this.$d.days=N[3],this.$d.hours=N[4],this.$d.minutes=N[5],this.$d.seconds=N[6],this.calMilliseconds(),this}}return this}var C=S.prototype;return C.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(A,M){return A+(E.$d[M]||0)*f[M]}),0)},C.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},C.toISOString=function(){var E=b(this.$d.years,"Y"),A=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"),N=b(this.$d.minutes,"M"),_=this.$d.seconds||0;this.$d.milliseconds&&(_+=this.$d.milliseconds/1e3,_=Math.round(1e3*_)/1e3);var I=b(_,"S"),O=E.negative||A.negative||L.negative||P.negative||N.negative||I.negative,D=P.format||N.format||I.format?"T":"",$=(O?"-":"")+"P"+E.format+A.format+L.format+D+P.format+N.format+I.format;return $==="P"||$==="-P"?"P0D":$},C.toJSON=function(){return this.toISOString()},C.format=function(E){var A=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 A.replace(d,(function(L,P){return P||String(M[L])}))},C.as=function(E){return this.$ms/f[m(E)]},C.get=function(E){var A=this.$ms,M=m(E);return M==="milliseconds"?A%=1e3:A=M==="weeks"?v(A/f[M]):this.$d[M],A||0},C.add=function(E,A,M){var L;return L=A?E*f[m(A)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+L*(M?-1:1),this)},C.subtract=function(E,A){return this.add(E,A,!0)},C.locale=function(E){var A=this.clone();return A.$l=E,A},C.clone=function(){return g(this.$ms,this)},C.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},S})(),k=function(S,C,E){return S.add(C.years()*E,"y").add(C.months()*E,"M").add(C.days()*E,"d").add(C.hours()*E,"h").add(C.minutes()*E,"m").add(C.seconds()*E,"s").add(C.milliseconds()*E,"ms")};return function(S,C,E){r=E,n=E().$utils(),E.duration=function(L,P){var N=E.locale();return g(L,{$l:N},P)},E.isDuration=p;var A=C.prototype.add,M=C.prototype.subtract;C.prototype.add=function(L,P){return p(L)?k(this,L,1):A.bind(this)(L,P)},C.prototype.subtract=function(L,P){return p(L)?k(this,L,-1):M.bind(this)(L,P)}}}))})(u_)),u_.exports}var tlr=elr();const rlr=ky(tlr);var pj=(function(){var t=w(function(N,_,I,O){for(I=I||{},O=N.length;O--;I[N[O]]=_);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],x=[1,16],b=[1,19],T=[1,20],k=[1,21],S=[1,22],C=[1,23],E=[1,25],A=[1,35],M={trace:w(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:w(function(_,I,O,D,$,F,z){var H=F.length-1;switch($){case 1:return F[H-1];case 2:this.$=[];break;case 3:F[H-1].push(F[H]),this.$=F[H-1];break;case 4:case 5:this.$=F[H];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat(F[H].substr(11)),this.$=F[H].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=F[H].substr(18);break;case 19:D.TopAxis(),this.$=F[H].substr(8);break;case 20:D.setAxisFormat(F[H].substr(11)),this.$=F[H].substr(11);break;case 21:D.setTickInterval(F[H].substr(13)),this.$=F[H].substr(13);break;case 22:D.setExcludes(F[H].substr(9)),this.$=F[H].substr(9);break;case 23:D.setIncludes(F[H].substr(9)),this.$=F[H].substr(9);break;case 24:D.setTodayMarker(F[H].substr(12)),this.$=F[H].substr(12);break;case 27:D.setDiagramTitle(F[H].substr(6)),this.$=F[H].substr(6);break;case 28:this.$=F[H].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=F[H].trim(),D.setAccDescription(this.$);break;case 31:D.addSection(F[H].substr(8)),this.$=F[H].substr(8);break;case 33:D.addTask(F[H-1],F[H]),this.$="task";break;case 34:this.$=F[H-1],D.setClickEvent(F[H-1],F[H],null);break;case 35:this.$=F[H-2],D.setClickEvent(F[H-2],F[H-1],F[H]);break;case 36:this.$=F[H-2],D.setClickEvent(F[H-2],F[H-1],null),D.setLink(F[H-2],F[H]);break;case 37:this.$=F[H-3],D.setClickEvent(F[H-3],F[H-2],F[H-1]),D.setLink(F[H-3],F[H]);break;case 38:this.$=F[H-2],D.setClickEvent(F[H-2],F[H],null),D.setLink(F[H-2],F[H-1]);break;case 39:this.$=F[H-3],D.setClickEvent(F[H-3],F[H-1],F[H]),D.setLink(F[H-3],F[H-2]);break;case 40:this.$=F[H-1],D.setLink(F[H-1],F[H]);break;case 41:case 47:this.$=F[H-1]+" "+F[H];break;case 42:case 43:case 45:this.$=F[H-2]+" "+F[H-1]+" "+F[H];break;case 44:case 46:this.$=F[H-3]+" "+F[H-2]+" "+F[H-1]+" "+F[H];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:x,30:b,31:T,33:k,35:S,36:C,37:24,38:E,40:A},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:x,30:b,31:T,33:k,35:S,36:C,37:24,38:E,40:A},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:w(function(_,I){if(I.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=I,O}},"parseError"),parse:w(function(_){var I=this,O=[0],D=[],$=[null],F=[],z=this.table,H="",B=0,V=0,q=2,G=1,Q=F.slice.call(arguments,1),j=Object.create(this.lexer),ae={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(ae.yy[Z]=this.yy[Z]);j.setInput(_,ae.yy),ae.yy.lexer=j,ae.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var J=j.yylloc;F.push(J);var re=j.options&&j.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ee(Ae){O.length=O.length-2*Ae,$.length=$.length-Ae,F.length=F.length-Ae}w(ee,"popStack");function me(){var Ae;return Ae=D.pop()||j.lex()||G,typeof Ae!="number"&&(Ae instanceof Array&&(D=Ae,Ae=D.pop()),Ae=I.symbols_[Ae]||Ae),Ae}w(me,"lex");for(var te,$e,Oe,He,ue={},ce,Te,ge,Ve;;){if($e=O[O.length-1],this.defaultActions[$e]?Oe=this.defaultActions[$e]:((te===null||typeof te>"u")&&(te=me()),Oe=z[$e]&&z[$e][te]),typeof Oe>"u"||!Oe.length||!Oe[0]){var we="";Ve=[];for(ce in z[$e])this.terminals_[ce]&&ce>q&&Ve.push("'"+this.terminals_[ce]+"'");j.showPosition?we="Parse error on line "+(B+1)+`: +`},"getStyles"),qor=Wor,Gor={parser:por,db:DWe,renderer:Dor,styles:qor};const Uor=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gor},Symbol.toStringTag,{value:"Module"}));var l_={exports:{}},Yor=l_.exports,$1e;function jor(){return $1e||($1e=1,(function(t,e){(function(r,n){t.exports=n()})(Yor,(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)}}}))})(l_)),l_.exports}var Xor=jor();const Kor=ky(Xor);var c_={exports:{}},Zor=c_.exports,N1e;function Qor(){return N1e||(N1e=1,(function(t,e){(function(r,n){t.exports=n()})(Zor,(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 x=v.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[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 x,b=l.meridiem;if(b){for(var T=1;T<=24;T+=1)if(y.indexOf(b(T,0,v))>-1){x=T>12;break}}else x=y===(v?"pm":"PM");return x},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,x=y.match(/\d+/);if(this.day=x[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"),x=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],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,x;v=y,x=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,L,P){var N=P&&P.toUpperCase();return L||x[P]||r[P]||x[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,I,O){return I||O.slice(1)}))}))).match(n),T=b.length,k=0;k-1)return new Date(($==="X"?1e3:1)*D);var H=m($)(D),B=H.year,V=H.month,q=H.day,G=H.hours,Q=H.minutes,j=H.seconds,ae=H.milliseconds,Z=H.zone,J=H.week,re=new Date,ee=q||(B||V?1:re.getDate()),me=B||re.getFullYear(),te=0;B&&!V||(te=V>0?V-1:re.getMonth());var $e,Oe=G||0,He=Q||0,ue=j||0,ce=ae||0;return Z?new Date(Date.UTC(me,te,ee,Oe,He,ue,ce+60*Z.offset*1e3)):F?new Date(Date.UTC(me,te,ee,Oe,He,ue,ce)):($e=new Date(me,te,ee,Oe,He,ue,ce),J&&($e=z($e).week(J).toDate()),$e)}catch{return new Date("")}})(S,A,C,x),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),P&&S!=this.format(A)&&(this.$d=new Date("")),l={}}else if(A instanceof Array)for(var _=A.length,I=1;I<=_;I+=1){E[1]=A[I-1];var O=x.apply(this,E);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}I===_&&(this.$d=new Date(""))}else T.call(this,k)}}}))})(c_)),c_.exports}var Jor=Qor();const elr=ky(Jor);var u_={exports:{}},tlr=u_.exports,D1e;function rlr(){return D1e||(D1e=1,(function(t,e){(function(r,n){t.exports=n()})(tlr,(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)}}}))})(u_)),u_.exports}var nlr=rlr();const ilr=ky(nlr);var h_={exports:{}},alr=h_.exports,O1e;function slr(){return O1e||(O1e=1,(function(t,e){(function(r,n){t.exports=n()})(alr,(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 T},g=function(S,C,E){return new T(S,E,C.$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)},x=function(S){return Math.abs(S)},b=function(S,C){return S?y(S)?{negative:!0,format:""+x(S)+C}:{negative:!1,format:""+S+C}:{negative:!1,format:""}},T=(function(){function S(E,A,M){var L=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),A)return g(E*f[m(A)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(_){L.$d[m(_)]=E[_]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var N=P.slice(2).map((function(_){return _!=null?Number(_):0}));return this.$d.years=N[0],this.$d.months=N[1],this.$d.weeks=N[2],this.$d.days=N[3],this.$d.hours=N[4],this.$d.minutes=N[5],this.$d.seconds=N[6],this.calMilliseconds(),this}}return this}var C=S.prototype;return C.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(A,M){return A+(E.$d[M]||0)*f[M]}),0)},C.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},C.toISOString=function(){var E=b(this.$d.years,"Y"),A=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"),N=b(this.$d.minutes,"M"),_=this.$d.seconds||0;this.$d.milliseconds&&(_+=this.$d.milliseconds/1e3,_=Math.round(1e3*_)/1e3);var I=b(_,"S"),O=E.negative||A.negative||L.negative||P.negative||N.negative||I.negative,D=P.format||N.format||I.format?"T":"",$=(O?"-":"")+"P"+E.format+A.format+L.format+D+P.format+N.format+I.format;return $==="P"||$==="-P"?"P0D":$},C.toJSON=function(){return this.toISOString()},C.format=function(E){var A=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 A.replace(d,(function(L,P){return P||String(M[L])}))},C.as=function(E){return this.$ms/f[m(E)]},C.get=function(E){var A=this.$ms,M=m(E);return M==="milliseconds"?A%=1e3:A=M==="weeks"?v(A/f[M]):this.$d[M],A||0},C.add=function(E,A,M){var L;return L=A?E*f[m(A)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+L*(M?-1:1),this)},C.subtract=function(E,A){return this.add(E,A,!0)},C.locale=function(E){var A=this.clone();return A.$l=E,A},C.clone=function(){return g(this.$ms,this)},C.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},C.valueOf=function(){return this.asMilliseconds()},C.milliseconds=function(){return this.get("milliseconds")},C.asMilliseconds=function(){return this.as("milliseconds")},C.seconds=function(){return this.get("seconds")},C.asSeconds=function(){return this.as("seconds")},C.minutes=function(){return this.get("minutes")},C.asMinutes=function(){return this.as("minutes")},C.hours=function(){return this.get("hours")},C.asHours=function(){return this.as("hours")},C.days=function(){return this.get("days")},C.asDays=function(){return this.as("days")},C.weeks=function(){return this.get("weeks")},C.asWeeks=function(){return this.as("weeks")},C.months=function(){return this.get("months")},C.asMonths=function(){return this.as("months")},C.years=function(){return this.get("years")},C.asYears=function(){return this.as("years")},S})(),k=function(S,C,E){return S.add(C.years()*E,"y").add(C.months()*E,"M").add(C.days()*E,"d").add(C.hours()*E,"h").add(C.minutes()*E,"m").add(C.seconds()*E,"s").add(C.milliseconds()*E,"ms")};return function(S,C,E){r=E,n=E().$utils(),E.duration=function(L,P){var N=E.locale();return g(L,{$l:N},P)},E.isDuration=p;var A=C.prototype.add,M=C.prototype.subtract;C.prototype.add=function(L,P){return p(L)?k(this,L,1):A.bind(this)(L,P)},C.prototype.subtract=function(L,P){return p(L)?k(this,L,-1):M.bind(this)(L,P)}}}))})(h_)),h_.exports}var olr=slr();const llr=ky(olr);var mj=(function(){var t=w(function(N,_,I,O){for(I=I||{},O=N.length;O--;I[N[O]]=_);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],x=[1,16],b=[1,19],T=[1,20],k=[1,21],S=[1,22],C=[1,23],E=[1,25],A=[1,35],M={trace:w(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:w(function(_,I,O,D,$,F,z){var H=F.length-1;switch($){case 1:return F[H-1];case 2:this.$=[];break;case 3:F[H-1].push(F[H]),this.$=F[H-1];break;case 4:case 5:this.$=F[H];break;case 6:case 7:this.$=[];break;case 8:D.setWeekday("monday");break;case 9:D.setWeekday("tuesday");break;case 10:D.setWeekday("wednesday");break;case 11:D.setWeekday("thursday");break;case 12:D.setWeekday("friday");break;case 13:D.setWeekday("saturday");break;case 14:D.setWeekday("sunday");break;case 15:D.setWeekend("friday");break;case 16:D.setWeekend("saturday");break;case 17:D.setDateFormat(F[H].substr(11)),this.$=F[H].substr(11);break;case 18:D.enableInclusiveEndDates(),this.$=F[H].substr(18);break;case 19:D.TopAxis(),this.$=F[H].substr(8);break;case 20:D.setAxisFormat(F[H].substr(11)),this.$=F[H].substr(11);break;case 21:D.setTickInterval(F[H].substr(13)),this.$=F[H].substr(13);break;case 22:D.setExcludes(F[H].substr(9)),this.$=F[H].substr(9);break;case 23:D.setIncludes(F[H].substr(9)),this.$=F[H].substr(9);break;case 24:D.setTodayMarker(F[H].substr(12)),this.$=F[H].substr(12);break;case 27:D.setDiagramTitle(F[H].substr(6)),this.$=F[H].substr(6);break;case 28:this.$=F[H].trim(),D.setAccTitle(this.$);break;case 29:case 30:this.$=F[H].trim(),D.setAccDescription(this.$);break;case 31:D.addSection(F[H].substr(8)),this.$=F[H].substr(8);break;case 33:D.addTask(F[H-1],F[H]),this.$="task";break;case 34:this.$=F[H-1],D.setClickEvent(F[H-1],F[H],null);break;case 35:this.$=F[H-2],D.setClickEvent(F[H-2],F[H-1],F[H]);break;case 36:this.$=F[H-2],D.setClickEvent(F[H-2],F[H-1],null),D.setLink(F[H-2],F[H]);break;case 37:this.$=F[H-3],D.setClickEvent(F[H-3],F[H-2],F[H-1]),D.setLink(F[H-3],F[H]);break;case 38:this.$=F[H-2],D.setClickEvent(F[H-2],F[H],null),D.setLink(F[H-2],F[H-1]);break;case 39:this.$=F[H-3],D.setClickEvent(F[H-3],F[H-1],F[H]),D.setLink(F[H-3],F[H-2]);break;case 40:this.$=F[H-1],D.setLink(F[H-1],F[H]);break;case 41:case 47:this.$=F[H-1]+" "+F[H];break;case 42:case 43:case 45:this.$=F[H-2]+" "+F[H-1]+" "+F[H];break;case 44:case 46:this.$=F[H-3]+" "+F[H-2]+" "+F[H-1]+" "+F[H];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:x,30:b,31:T,33:k,35:S,36:C,37:24,38:E,40:A},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:x,30:b,31:T,33:k,35:S,36:C,37:24,38:E,40:A},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:w(function(_,I){if(I.recoverable)this.trace(_);else{var O=new Error(_);throw O.hash=I,O}},"parseError"),parse:w(function(_){var I=this,O=[0],D=[],$=[null],F=[],z=this.table,H="",B=0,V=0,q=2,G=1,Q=F.slice.call(arguments,1),j=Object.create(this.lexer),ae={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(ae.yy[Z]=this.yy[Z]);j.setInput(_,ae.yy),ae.yy.lexer=j,ae.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var J=j.yylloc;F.push(J);var re=j.options&&j.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ee(Ae){O.length=O.length-2*Ae,$.length=$.length-Ae,F.length=F.length-Ae}w(ee,"popStack");function me(){var Ae;return Ae=D.pop()||j.lex()||G,typeof Ae!="number"&&(Ae instanceof Array&&(D=Ae,Ae=D.pop()),Ae=I.symbols_[Ae]||Ae),Ae}w(me,"lex");for(var te,$e,Oe,He,ue={},ce,Te,ge,Ve;;){if($e=O[O.length-1],this.defaultActions[$e]?Oe=this.defaultActions[$e]:((te===null||typeof te>"u")&&(te=me()),Oe=z[$e]&&z[$e][te]),typeof Oe>"u"||!Oe.length||!Oe[0]){var we="";Ve=[];for(ce in z[$e])this.terminals_[ce]&&ce>q&&Ve.push("'"+this.terminals_[ce]+"'");j.showPosition?we="Parse error on line "+(B+1)+`: `+j.showPosition()+` Expecting `+Ve.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse error on line "+(B+1)+": Unexpected "+(te==G?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(we,{text:j.match,token:this.terminals_[te]||te,line:j.yylineno,loc:J,expected:Ve})}if(Oe[0]instanceof Array&&Oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$e+", token: "+te);switch(Oe[0]){case 1:O.push(te),$.push(j.yytext),F.push(j.yylloc),O.push(Oe[1]),te=null,V=j.yyleng,H=j.yytext,B=j.yylineno,J=j.yylloc;break;case 2:if(Te=this.productions_[Oe[1]][1],ue.$=$[$.length-Te],ue._$={first_line:F[F.length-(Te||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(Te||1)].first_column,last_column:F[F.length-1].last_column},re&&(ue._$.range=[F[F.length-(Te||1)].range[0],F[F.length-1].range[1]]),He=this.performAction.apply(ue,[H,V,B,ae.yy,Oe[1],$,F].concat(Q)),typeof He<"u")return He;Te&&(O=O.slice(0,-1*Te*2),$=$.slice(0,-1*Te),F=F.slice(0,-1*Te)),O.push(this.productions_[Oe[1]][0]),$.push(ue.$),F.push(ue._$),ge=z[O[O.length-2]][O[O.length-1]],O.push(ge);break;case 3:return!0}}return!0},"parse")},L=(function(){var N={EOF:1,parseError:w(function(I,O){if(this.yy.parser)this.yy.parser.parseError(I,O);else throw new Error(I)},"parseError"),setInput:w(function(_,I){return this.yy=I||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var I=_.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),_},"input"),unput:w(function(_){var I=_.length,O=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;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),O.length-1&&(this.yylineno-=O.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:O?(O.length===D.length?this.yylloc.first_column:0)+D[D.length-O.length].length-O[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[$[0],$[0]+this.yyleng-I]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(_){this.unput(this.match.slice(_))},"less"),pastInput:w(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var _=this.pastInput(),I=new Array(_.length+1).join("-");return _+this.upcomingInput()+` `+I+"^"},"showPosition"),test_match:w(function(_,I){var O,D,$;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))),D=_[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+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],O=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),O)return O;if(this._backtrack){for(var F in $)this[F]=$[F];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,I,O,D;this._more||(this.yytext="",this.match="");for(var $=this._currentRules(),F=0;F<$.length;F++)if(O=this._input.match(this.rules[$[F]]),O&&(!I||O[0].length>I[0].length)){if(I=O,D=F,this.options.backtrack_lexer){if(_=this.test_match(O,$[F]),_!==!1)return _;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(_=this.test_match(I,$[D]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var I=this.next();return I||this.lex()},"lex"),begin:w(function(I){this.conditionStack.push(I)},"begin"),popState:w(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:w(function(I){this.begin(I)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(I,O,D,$){switch(D){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 N})();M.lexer=L;function P(){this.yy={}}return w(P,"Parser"),P.prototype=M,M.Parser=P,new P})();pj.parser=pj;var nlr=pj;_s.extend(qor);_s.extend(jor);_s.extend(Qor);var O1e={friday:5,saturday:6},jh="",kne="",Cne=void 0,Sne="",m3=[],y3=[],Ene=new Map,Ane=[],FI=[],v3="",Rne="",PWe=["active","done","crit","milestone","vert"],_ne=[],J2="",b7=!1,Mne=!1,Lne="sunday",zI="saturday",gj=0,ilr=w(function(){Ane=[],FI=[],v3="",_ne=[],h_=0,yj=void 0,d_=void 0,as=[],jh="",kne="",Rne="",Cne=void 0,Sne="",m3=[],y3=[],b7=!1,Mne=!1,gj=0,Ene=new Map,J2="",wi(),Lne="sunday",zI="saturday"},"clear"),alr=w(function(t){J2=t},"setDiagramId"),slr=w(function(t){kne=t},"setAxisFormat"),olr=w(function(){return kne},"getAxisFormat"),llr=w(function(t){Cne=t},"setTickInterval"),clr=w(function(){return Cne},"getTickInterval"),ulr=w(function(t){Sne=t},"setTodayMarker"),hlr=w(function(){return Sne},"getTodayMarker"),dlr=w(function(t){jh=t},"setDateFormat"),flr=w(function(){b7=!0},"enableInclusiveEndDates"),plr=w(function(){return b7},"endDatesAreInclusive"),glr=w(function(){Mne=!0},"enableTopAxis"),mlr=w(function(){return Mne},"topAxisEnabled"),ylr=w(function(t){Rne=t},"setDisplayMode"),vlr=w(function(){return Rne},"getDisplayMode"),blr=w(function(){return jh},"getDateFormat"),BWe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),xlr=w(function(t){m3=BWe(m3,t)},"setIncludes"),wlr=w(function(){return m3},"getIncludes"),Tlr=w(function(t){y3=BWe(y3,t)},"setExcludes"),klr=w(function(){return y3},"getExcludes"),Clr=w(function(){return Ene},"getLinks"),Slr=w(function(t){v3=t,Ane.push(t)},"addSection"),Elr=w(function(){return Ane},"getSections"),Alr=w(function(){let t=P1e();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"),mj=w(function(t,e,r){if(r=r.trim(),w(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=pv(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=_s(r,e.trim(),!0);if(s.isValid())return s.toDate();{he.debug("Invalid date:"+r),he.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"),HWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),VWe=w(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=pv(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),Ene.set(n,r))}),qWe(t,"clickable")},"setLink"),qWe=w(function(t,e){t.split(",").forEach(function(r){let n=pv(r);n!==void 0&&n.classes.push(e)})},"setClass"),Plr=w(function(t,e,r){if(We().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Vr.runFunc(e,...n)})},"setClickFun"),GWe=w(function(t,e){_ne.push(function(){const r=J2?`${J2}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=J2?`${J2}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),Blr=w(function(t,e,r){t.split(",").forEach(function(n){Plr(n,e,r)}),qWe(t,"clickable")},"setClickEvent"),Flr=w(function(t){_ne.forEach(function(e){e(t)})},"bindFunctions"),zlr={getConfig:w(()=>We().gantt,"getConfig"),clear:ilr,setDateFormat:dlr,getDateFormat:blr,enableInclusiveEndDates:flr,endDatesAreInclusive:plr,enableTopAxis:glr,topAxisEnabled:mlr,setAxisFormat:slr,getAxisFormat:olr,setTickInterval:llr,getTickInterval:clr,setTodayMarker:ulr,getTodayMarker:hlr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,setDiagramId:alr,setDisplayMode:ylr,getDisplayMode:vlr,setAccDescription:ji,getAccDescription:Xi,addSection:Slr,getSections:Elr,getTasks:Alr,addTask:Nlr,findTaskById:pv,addTaskOrg:Dlr,setIncludes:xlr,getIncludes:wlr,setExcludes:Tlr,getExcludes:klr,setClickEvent:Blr,setLink:Olr,getLinks:Clr,bindFunctions:Flr,parseDuration:HWe,isInvalidDate:FWe,setWeekday:Rlr,getWeekday:_lr,setWeekend:Mlr};function Ine(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)})}w(Ine,"getTaskTags");_s.extend(rlr);var Hlr=w(function(){he.debug("Something is calling, setConf, remove the call")},"setConf"),B1e={monday:CS,tuesday:M4e,wednesday:L4e,thursday:G1,friday:I4e,saturday:$4e,sunday:hE},Vlr=w((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"),Xd,xH=1e4,Wlr=w(function(t,e,r,n){const i=We().gantt;n.db.setDiagramId(e);const a=We().securityLevel;let s;a==="sandbox"&&(s=bt("#i"+e));const o=bt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Xd=u.parentElement.offsetWidth,Xd===void 0&&(Xd=1200),i.useWidth!==void 0&&(Xd=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=A(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 N=Vlr(M[P],L)+1;L+=N,g+=N*(i.barHeight+i.barGap),p[P]=N}}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 "+Xd+" "+g);const m=o.select(`[id="${e}"]`),y=ydt().domain([Cst(h,function(M){return M.startTime}),kst(h,function(M){return M.endTime})]).rangeRound([0,Xd-i.leftPadding-i.rightPadding]);function v(M,L){const P=M.startTime,N=L.startTime;let _=0;return P>N?_=1:PV.vert===q.vert?0:V.vert?1:-1);const D=M.filter(V=>!V.vert),F=[...new Set(D.map(V=>V.order))].map(V=>D.find(q=>q.order===V));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(V,q){return q=V.order,q*L+P-2}).attr("width",function(){return O-i.rightPadding/2}).attr("height",L).attr("class",function(V){for(const[q,G]of f.entries())if(V.type===G)return"section section"+q%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),H=n.db.getLinks();if(z.append("rect").attr("id",function(V){return e+"-"+V.id}).attr("rx",3).attr("ry",3).attr("x",function(V){return V.milestone?y(V.startTime)+N+.5*(y(V.endTime)-y(V.startTime))-.5*_:y(V.startTime)+N}).attr("y",function(V,q){return q=V.order,V.vert?i.gridLineStartPadding:q*L+P}).attr("width",function(V){return V.milestone?_:V.vert?.08*_:y(V.renderEndTime||V.endTime)-y(V.startTime)}).attr("height",function(V){return V.vert?D.length*(i.barHeight+i.barGap)+i.barHeight*2:_}).attr("transform-origin",function(V,q){return q=V.order,(y(V.startTime)+N+.5*(y(V.endTime)-y(V.startTime))).toString()+"px "+(q*L+P+.5*_).toString()+"px"}).attr("class",function(V){const q="task";let G="";V.classes.length>0&&(G=V.classes.join(" "));let Q=0;for(const[ae,Z]of f.entries())V.type===Z&&(Q=ae%i.numberSectionStyles);let j="";return V.active?V.crit?j+=" activeCrit":j=" active":V.done?V.crit?j=" doneCrit":j=" done":V.crit&&(j+=" crit"),j.length===0&&(j=" task"),V.milestone&&(j=" milestone "+j),V.vert&&(j=" vert "+j),j+=Q,j+=" "+G,q+j}),z.append("text").attr("id",function(V){return e+"-"+V.id+"-text"}).text(function(V){return V.task}).attr("font-size",i.fontSize).attr("x",function(V){let q=y(V.startTime),G=y(V.renderEndTime||V.endTime);if(V.milestone&&(q+=.5*(y(V.endTime)-y(V.startTime))-.5*_,G=q+_),V.vert)return y(V.startTime)+N;const Q=this.getBBox().width;return Q>G-q?G+Q+1.5*i.leftPadding>O?q+N-5:G+N+5:(G-q)/2+q+N}).attr("y",function(V,q){return V.vert?i.gridLineStartPadding+D.length*(i.barHeight+i.barGap)+60:(q=V.order,q*L+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",_).attr("class",function(V){const q=y(V.startTime);let G=y(V.endTime);V.milestone&&(G=q+_);const Q=this.getBBox().width;let j="";V.classes.length>0&&(j=V.classes.join(" "));let ae=0;for(const[J,re]of f.entries())V.type===re&&(ae=J%i.numberSectionStyles);let Z="";return V.active&&(V.crit?Z="activeCritText"+ae:Z="activeText"+ae),V.done?V.crit?Z=Z+" doneCritText"+ae:Z=Z+" doneText"+ae:V.crit&&(Z=Z+" critText"+ae),V.milestone&&(Z+=" milestoneText"),V.vert&&(Z+=" vertText"),Q>G-q?G+Q+1.5*i.leftPadding>O?j+" taskTextOutsideLeft taskTextOutside"+ae+" "+Z:j+" taskTextOutsideRight taskTextOutside"+ae+" "+Z+" width-"+Q:j+" taskText taskText"+ae+" "+Z+" width-"+Q}),We().securityLevel==="sandbox"){let V;V=bt("#i"+e);const q=V.nodes()[0].contentDocument;z.filter(function(G){return H.has(G.id)}).each(function(G){var Q=q.querySelector("#"+CSS.escape(e+"-"+G.id)),j=q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const ae=Q.parentNode;var Z=q.createElement("a");Z.setAttribute("xlink:href",H.get(G.id)),Z.setAttribute("target","_top"),ae.appendChild(Z),Z.appendChild(Q),Z.appendChild(j)})}}w(b,"drawRects");function T(M,L,P,N,_,I,O,D){if(O.length===0&&D.length===0)return;let $,F;for(const{startTime:G,endTime:Q}of I)($===void 0||G<$)&&($=G),(F===void 0||Q>F)&&(F=Q);if(!$||!F)return;if(_s(F).diff(_s($),"year")>5){he.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(),H=[];let B=null,V=_s($);for(;V.valueOf()<=F;)n.db.isInvalidDate(V,z,O,D)?B?B.end=V:B={start:V,end:V}:B&&(H.push(B),B=null),V=V.add(1,"d");m.append("g").selectAll("rect").data(H).enter().append("rect").attr("id",G=>e+"-exclude-"+G.start.format("YYYY-MM-DD")).attr("x",G=>y(G.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",G=>y(G.end.endOf("day"))-y(G.start.startOf("day"))).attr("height",_-L-i.gridLineStartPadding).attr("transform-origin",function(G,Q){return(y(G.start)+P+.5*(y(G.end)-y(G.start))).toString()+"px "+(Q*M+.5*_).toString()+"px"}).attr("class","exclude-range")}w(T,"drawExcludeDays");function k(M,L,P,N){if(P<=0||M>L)return 1/0;const _=L-M,I=_s.duration({[N??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(_/I)}w(k,"getEstimatedTickCount");function S(M,L,P,N){const _=n.db.getDateFormat(),I=n.db.getAxisFormat();let O;I?O=I:_==="D"?O="%d":O=i.axisFormat??"%Y-%m-%d";let D=$st(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(N9(O));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)he.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const H=F[2],B=n.db.getWeekday()||i.weekday,V=y.domain(),q=V[0],G=V[1],Q=k(q,G,z,H);if(Q>xH)he.warn(`The tick interval "${z}${H}" would generate ${Q} ticks, which exceeds the maximum allowed (${xH}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(H){case"millisecond":D.ticks(RT.every(z));break;case"second":D.ticks(dp.every(z));break;case"minute":D.ticks(TS.every(z));break;case"hour":D.ticks(kS.every(z));break;case"day":D.ticks(q1.every(z));break;case"week":D.ticks(B1e[B].every(z));break;case"month":D.ticks(SS.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(N-50)+")").call(D).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=Ist(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(N9(O));if(F!==null){const H=parseInt(F[1],10);if(isNaN(H)||H<=0)he.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],V=n.db.getWeekday()||i.weekday,q=y.domain(),G=q[0],Q=q[1];if(k(G,Q,H,B)<=xH)switch(B){case"millisecond":z.ticks(RT.every(H));break;case"second":z.ticks(dp.every(H));break;case"minute":z.ticks(TS.every(H));break;case"hour":z.ticks(kS.every(H));break;case"day":z.ticks(q1.every(H));break;case"week":z.ticks(B1e[V].every(H));break;case"month":z.ticks(SS.every(H));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)}}w(S,"makeGrid");function C(M,L){let P=0;const N=Object.keys(p).map(_=>[_,p[_]]);m.append("g").selectAll("text").data(N).enter().append(function(_){const I=_[0].split(Ft.lineBreakRegex),O=-(I.length-1)/2,D=l.createElementNS("http://www.w3.org/2000/svg","text");D.setAttribute("dy",O+"em");for(const[$,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),$>0&&z.setAttribute("dy","1em"),z.textContent=F,D.appendChild(z)}return D}).attr("x",10).attr("y",function(_,I){if(I>0)for(let O=0;O` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var I=this.next();return I||this.lex()},"lex"),begin:w(function(I){this.conditionStack.push(I)},"begin"),popState:w(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:w(function(I){this.begin(I)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(I,O,D,$){switch(D){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 N})();M.lexer=L;function P(){this.yy={}}return w(P,"Parser"),P.prototype=M,M.Parser=P,new P})();mj.parser=mj;var clr=mj;_s.extend(Kor);_s.extend(elr);_s.extend(ilr);var P1e={friday:5,saturday:6},Xh="",Sne="",Ene=void 0,Ane="",m3=[],y3=[],Rne=new Map,_ne=[],HI=[],v3="",Mne="",zWe=["active","done","crit","milestone","vert"],Lne=[],J2="",x7=!1,Ine=!1,$ne="sunday",VI="saturday",yj=0,ulr=w(function(){_ne=[],HI=[],v3="",Lne=[],d_=0,bj=void 0,f_=void 0,as=[],Xh="",Sne="",Mne="",Ene=void 0,Ane="",m3=[],y3=[],x7=!1,Ine=!1,yj=0,Rne=new Map,J2="",wi(),$ne="sunday",VI="saturday"},"clear"),hlr=w(function(t){J2=t},"setDiagramId"),dlr=w(function(t){Sne=t},"setAxisFormat"),flr=w(function(){return Sne},"getAxisFormat"),plr=w(function(t){Ene=t},"setTickInterval"),glr=w(function(){return Ene},"getTickInterval"),mlr=w(function(t){Ane=t},"setTodayMarker"),ylr=w(function(){return Ane},"getTodayMarker"),vlr=w(function(t){Xh=t},"setDateFormat"),blr=w(function(){x7=!0},"enableInclusiveEndDates"),xlr=w(function(){return x7},"endDatesAreInclusive"),wlr=w(function(){Ine=!0},"enableTopAxis"),Tlr=w(function(){return Ine},"topAxisEnabled"),klr=w(function(t){Mne=t},"setDisplayMode"),Clr=w(function(){return Mne},"getDisplayMode"),Slr=w(function(){return Xh},"getDateFormat"),HWe=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Elr=w(function(t){m3=HWe(m3,t)},"setIncludes"),Alr=w(function(){return m3},"getIncludes"),Rlr=w(function(t){y3=HWe(y3,t)},"setExcludes"),_lr=w(function(){return y3},"getExcludes"),Mlr=w(function(){return Rne},"getLinks"),Llr=w(function(t){v3=t,_ne.push(t)},"addSection"),Ilr=w(function(){return _ne},"getSections"),$lr=w(function(){let t=B1e();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"),vj=w(function(t,e,r){if(r=r.trim(),w(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=pv(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=_s(r,e.trim(),!0);if(s.isValid())return s.toDate();{he.debug("Invalid date:"+r),he.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"),qWe=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),GWe=w(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=pv(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),Rne.set(n,r))}),YWe(t,"clickable")},"setLink"),YWe=w(function(t,e){t.split(",").forEach(function(r){let n=pv(r);n!==void 0&&n.classes.push(e)})},"setClass"),Wlr=w(function(t,e,r){if(We().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Vr.runFunc(e,...n)})},"setClickFun"),jWe=w(function(t,e){Lne.push(function(){const r=J2?`${J2}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=J2?`${J2}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),qlr=w(function(t,e,r){t.split(",").forEach(function(n){Wlr(n,e,r)}),YWe(t,"clickable")},"setClickEvent"),Glr=w(function(t){Lne.forEach(function(e){e(t)})},"bindFunctions"),Ulr={getConfig:w(()=>We().gantt,"getConfig"),clear:ulr,setDateFormat:vlr,getDateFormat:Slr,enableInclusiveEndDates:blr,endDatesAreInclusive:xlr,enableTopAxis:wlr,topAxisEnabled:Tlr,setAxisFormat:dlr,getAxisFormat:flr,setTickInterval:plr,getTickInterval:glr,setTodayMarker:mlr,getTodayMarker:ylr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,setDiagramId:hlr,setDisplayMode:klr,getDisplayMode:Clr,setAccDescription:ji,getAccDescription:Xi,addSection:Llr,getSections:Ilr,getTasks:$lr,addTask:zlr,findTaskById:pv,addTaskOrg:Hlr,setIncludes:Elr,getIncludes:Alr,setExcludes:Rlr,getExcludes:_lr,setClickEvent:qlr,setLink:Vlr,getLinks:Mlr,bindFunctions:Glr,parseDuration:qWe,isInvalidDate:VWe,setWeekday:Nlr,getWeekday:Dlr,setWeekend:Olr};function Nne(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)})}w(Nne,"getTaskTags");_s.extend(llr);var Ylr=w(function(){he.debug("Something is calling, setConf, remove the call")},"setConf"),F1e={monday:CS,tuesday:L4e,wednesday:I4e,thursday:G1,friday:$4e,saturday:N4e,sunday:dE},jlr=w((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"),Kd,TH=1e4,Xlr=w(function(t,e,r,n){const i=We().gantt;n.db.setDiagramId(e);const a=We().securityLevel;let s;a==="sandbox"&&(s=bt("#i"+e));const o=bt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Kd=u.parentElement.offsetWidth,Kd===void 0&&(Kd=1200),i.useWidth!==void 0&&(Kd=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=A(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 N=jlr(M[P],L)+1;L+=N,g+=N*(i.barHeight+i.barGap),p[P]=N}}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 "+Kd+" "+g);const m=o.select(`[id="${e}"]`),y=xdt().domain([Ast(h,function(M){return M.startTime}),Est(h,function(M){return M.endTime})]).rangeRound([0,Kd-i.leftPadding-i.rightPadding]);function v(M,L){const P=M.startTime,N=L.startTime;let _=0;return P>N?_=1:PV.vert===q.vert?0:V.vert?1:-1);const D=M.filter(V=>!V.vert),F=[...new Set(D.map(V=>V.order))].map(V=>D.find(q=>q.order===V));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(V,q){return q=V.order,q*L+P-2}).attr("width",function(){return O-i.rightPadding/2}).attr("height",L).attr("class",function(V){for(const[q,G]of f.entries())if(V.type===G)return"section section"+q%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),H=n.db.getLinks();if(z.append("rect").attr("id",function(V){return e+"-"+V.id}).attr("rx",3).attr("ry",3).attr("x",function(V){return V.milestone?y(V.startTime)+N+.5*(y(V.endTime)-y(V.startTime))-.5*_:y(V.startTime)+N}).attr("y",function(V,q){return q=V.order,V.vert?i.gridLineStartPadding:q*L+P}).attr("width",function(V){return V.milestone?_:V.vert?.08*_:y(V.renderEndTime||V.endTime)-y(V.startTime)}).attr("height",function(V){return V.vert?D.length*(i.barHeight+i.barGap)+i.barHeight*2:_}).attr("transform-origin",function(V,q){return q=V.order,(y(V.startTime)+N+.5*(y(V.endTime)-y(V.startTime))).toString()+"px "+(q*L+P+.5*_).toString()+"px"}).attr("class",function(V){const q="task";let G="";V.classes.length>0&&(G=V.classes.join(" "));let Q=0;for(const[ae,Z]of f.entries())V.type===Z&&(Q=ae%i.numberSectionStyles);let j="";return V.active?V.crit?j+=" activeCrit":j=" active":V.done?V.crit?j=" doneCrit":j=" done":V.crit&&(j+=" crit"),j.length===0&&(j=" task"),V.milestone&&(j=" milestone "+j),V.vert&&(j=" vert "+j),j+=Q,j+=" "+G,q+j}),z.append("text").attr("id",function(V){return e+"-"+V.id+"-text"}).text(function(V){return V.task}).attr("font-size",i.fontSize).attr("x",function(V){let q=y(V.startTime),G=y(V.renderEndTime||V.endTime);if(V.milestone&&(q+=.5*(y(V.endTime)-y(V.startTime))-.5*_,G=q+_),V.vert)return y(V.startTime)+N;const Q=this.getBBox().width;return Q>G-q?G+Q+1.5*i.leftPadding>O?q+N-5:G+N+5:(G-q)/2+q+N}).attr("y",function(V,q){return V.vert?i.gridLineStartPadding+D.length*(i.barHeight+i.barGap)+60:(q=V.order,q*L+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",_).attr("class",function(V){const q=y(V.startTime);let G=y(V.endTime);V.milestone&&(G=q+_);const Q=this.getBBox().width;let j="";V.classes.length>0&&(j=V.classes.join(" "));let ae=0;for(const[J,re]of f.entries())V.type===re&&(ae=J%i.numberSectionStyles);let Z="";return V.active&&(V.crit?Z="activeCritText"+ae:Z="activeText"+ae),V.done?V.crit?Z=Z+" doneCritText"+ae:Z=Z+" doneText"+ae:V.crit&&(Z=Z+" critText"+ae),V.milestone&&(Z+=" milestoneText"),V.vert&&(Z+=" vertText"),Q>G-q?G+Q+1.5*i.leftPadding>O?j+" taskTextOutsideLeft taskTextOutside"+ae+" "+Z:j+" taskTextOutsideRight taskTextOutside"+ae+" "+Z+" width-"+Q:j+" taskText taskText"+ae+" "+Z+" width-"+Q}),We().securityLevel==="sandbox"){let V;V=bt("#i"+e);const q=V.nodes()[0].contentDocument;z.filter(function(G){return H.has(G.id)}).each(function(G){var Q=q.querySelector("#"+CSS.escape(e+"-"+G.id)),j=q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const ae=Q.parentNode;var Z=q.createElement("a");Z.setAttribute("xlink:href",H.get(G.id)),Z.setAttribute("target","_top"),ae.appendChild(Z),Z.appendChild(Q),Z.appendChild(j)})}}w(b,"drawRects");function T(M,L,P,N,_,I,O,D){if(O.length===0&&D.length===0)return;let $,F;for(const{startTime:G,endTime:Q}of I)($===void 0||G<$)&&($=G),(F===void 0||Q>F)&&(F=Q);if(!$||!F)return;if(_s(F).diff(_s($),"year")>5){he.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(),H=[];let B=null,V=_s($);for(;V.valueOf()<=F;)n.db.isInvalidDate(V,z,O,D)?B?B.end=V:B={start:V,end:V}:B&&(H.push(B),B=null),V=V.add(1,"d");m.append("g").selectAll("rect").data(H).enter().append("rect").attr("id",G=>e+"-exclude-"+G.start.format("YYYY-MM-DD")).attr("x",G=>y(G.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",G=>y(G.end.endOf("day"))-y(G.start.startOf("day"))).attr("height",_-L-i.gridLineStartPadding).attr("transform-origin",function(G,Q){return(y(G.start)+P+.5*(y(G.end)-y(G.start))).toString()+"px "+(Q*M+.5*_).toString()+"px"}).attr("class","exclude-range")}w(T,"drawExcludeDays");function k(M,L,P,N){if(P<=0||M>L)return 1/0;const _=L-M,I=_s.duration({[N??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(_/I)}w(k,"getEstimatedTickCount");function S(M,L,P,N){const _=n.db.getDateFormat(),I=n.db.getAxisFormat();let O;I?O=I:_==="D"?O="%d":O=i.axisFormat??"%Y-%m-%d";let D=Ost(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(D9(O));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)he.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const H=F[2],B=n.db.getWeekday()||i.weekday,V=y.domain(),q=V[0],G=V[1],Q=k(q,G,z,H);if(Q>TH)he.warn(`The tick interval "${z}${H}" would generate ${Q} ticks, which exceeds the maximum allowed (${TH}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(H){case"millisecond":D.ticks(RT.every(z));break;case"second":D.ticks(dp.every(z));break;case"minute":D.ticks(TS.every(z));break;case"hour":D.ticks(kS.every(z));break;case"day":D.ticks(q1.every(z));break;case"week":D.ticks(F1e[B].every(z));break;case"month":D.ticks(SS.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(N-50)+")").call(D).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=Dst(y).tickSize(-N+L+i.gridLineStartPadding).tickFormat(D9(O));if(F!==null){const H=parseInt(F[1],10);if(isNaN(H)||H<=0)he.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],V=n.db.getWeekday()||i.weekday,q=y.domain(),G=q[0],Q=q[1];if(k(G,Q,H,B)<=TH)switch(B){case"millisecond":z.ticks(RT.every(H));break;case"second":z.ticks(dp.every(H));break;case"minute":z.ticks(TS.every(H));break;case"hour":z.ticks(kS.every(H));break;case"day":z.ticks(q1.every(H));break;case"week":z.ticks(F1e[V].every(H));break;case"month":z.ticks(SS.every(H));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)}}w(S,"makeGrid");function C(M,L){let P=0;const N=Object.keys(p).map(_=>[_,p[_]]);m.append("g").selectAll("text").data(N).enter().append(function(_){const I=_[0].split(Ft.lineBreakRegex),O=-(I.length-1)/2,D=l.createElementNS("http://www.w3.org/2000/svg","text");D.setAttribute("dy",O+"em");for(const[$,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),$>0&&z.setAttribute("dy","1em"),z.textContent=F,D.appendChild(z)}return D}).attr("x",10).attr("y",function(_,I){if(I>0)for(let O=0;O` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -3085,8 +3098,8 @@ Expecting `+Ve.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),Ulr=Glr,Ylr={parser:nlr,db:zlr,renderer:qlr,styles:Ulr};const jlr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ylr},Symbol.toStringTag,{value:"Module"}));var Xlr={parse:w(async t=>{const e=await xu("info",t);he.debug(e)},"parse")},Klr={version:"11.16.1"},Zlr=w(()=>Klr.version,"getVersion"),Qlr={getVersion:Zlr},Jlr=w((t,e,r)=>{he.debug(`rendering info diagram -`+t);const n=Po(e);_a(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"),ecr={draw:Jlr},tcr={parser:Xlr,db:Qlr,renderer:ecr};const rcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:tcr},Symbol.toStringTag,{value:"Module"}));var ncr=xn.pie,$ne={sections:new Map,showData:!1},HI=$ne.sections,Nne=$ne.showData,icr=structuredClone(ncr),acr=w(()=>structuredClone(icr),"getConfig"),scr=w(()=>{HI=new Map,Nne=$ne.showData,wi()},"clear"),ocr=w(({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.`);HI.has(t)||(HI.set(t,e),he.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),lcr=w(()=>HI,"getSections"),ccr=w(t=>{Nne=t},"setShowData"),ucr=w(()=>Nne,"getShowData"),UWe={getConfig:acr,clear:scr,setDiagramTitle:qi,getDiagramTitle:Di,setAccTitle:$i,getAccTitle:Yi,setAccDescription:ji,getAccDescription:Xi,addSection:ocr,getSections:lcr,setShowData:ccr,getShowData:ucr},hcr=w((t,e)=>{Al(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),dcr={parse:w(async t=>{const e=await xu("pie",t);he.debug(e),hcr(e,UWe)},"parse")},fcr=w(t=>` +`,"getStyles"),Qlr=Zlr,Jlr={parser:clr,db:Ulr,renderer:Klr,styles:Qlr};const ecr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jlr},Symbol.toStringTag,{value:"Module"}));var tcr={parse:w(async t=>{const e=await xu("info",t);he.debug(e)},"parse")},rcr={version:"11.16.1"},ncr=w(()=>rcr.version,"getVersion"),icr={getVersion:ncr},acr=w((t,e,r)=>{he.debug(`rendering info diagram +`+t);const n=Po(e);_a(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"),scr={draw:acr},ocr={parser:tcr,db:icr,renderer:scr};const lcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ocr},Symbol.toStringTag,{value:"Module"}));var ccr=xn.pie,Dne={sections:new Map,showData:!1},WI=Dne.sections,One=Dne.showData,ucr=structuredClone(ccr),hcr=w(()=>structuredClone(ucr),"getConfig"),dcr=w(()=>{WI=new Map,One=Dne.showData,wi()},"clear"),fcr=w(({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.`);WI.has(t)||(WI.set(t,e),he.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),pcr=w(()=>WI,"getSections"),gcr=w(t=>{One=t},"setShowData"),mcr=w(()=>One,"getShowData"),XWe={getConfig:hcr,clear:dcr,setDiagramTitle:qi,getDiagramTitle:Di,setAccTitle:$i,getAccTitle:Yi,setAccDescription:ji,getAccDescription:Xi,addSection:fcr,getSections:pcr,setShowData:gcr,getShowData:mcr},ycr=w((t,e)=>{Al(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),vcr={parse:w(async t=>{const e=await xu("pie",t);he.debug(e),ycr(e,XWe)},"parse")},bcr=w(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -3123,25 +3136,25 @@ Expecting `+Ve.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),pcr=fcr,gcr=w(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 Idt().value(i=>i.value).sort(null)(r)},"createPieArcs"),mcr=w((t,e,r,n)=>{var j;he.debug(`rendering pie chart -`+t);const i=n.db,a=We(),s=Gi(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=Po(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=c0(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,x=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,T=MT().innerRadius(x*b).outerRadius(b),k=MT().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 C=i.getSections(),E=gcr(C),A=[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;C.forEach(ae=>{M+=ae});const L=E.filter(ae=>(ae.data.value/M*100).toFixed(0)!=="0"),P=w1(A).domain([...C.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",T).attr("fill",ae=>P(ae.data.label)).attr("class",ae=>{let Z="pieCircle";return s.highlightSlice==="hover"?Z+=" highlightedOnHover":s.highlightSlice===ae.data.label&&(Z+=" highlighted"),Z}),S.selectAll("mySlices").data(L).enter().append("text").text(ae=>(ae.data.value/M*100).toFixed(0)+"%").attr("transform",ae=>"translate("+k.centroid(ae)+")").style("text-anchor","middle").attr("class","slice");const N=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),_=[...C.entries()].map(([ae,Z])=>({label:ae,value:Z})),I=p.selectAll(".legend").data(_).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",ae=>P(ae.label)).style("stroke",ae=>P(ae.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(ae=>i.getShowData()?`${ae.label} [${ae.value}]`:ae.label);const O=Math.max(...I.selectAll("text").nodes().map(ae=>(ae==null?void 0:ae.getBoundingClientRect().width)??0));let D=h,$=d+o;const F=l+u,z=_.length*F;switch(y){case"center":I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=-O/2-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"});break;case"top":D+=z,I.attr("transform",(ae,Z)=>{const J=b,re=-O/2-(l+u),ee=Z*F-J;return`translate(${re}, ${ee})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":D+=z,I.attr("transform",(ae,Z)=>{const J=-b-F,re=-O/2-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"});break;case"left":$+=l+u+O,I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=-b-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"}),S.attr("transform",()=>`translate(${O+l+u}, 0)`);break;case"right":default:$+=l+u+O,I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=12*l,ee=Z*F-J;return"translate("+re+","+ee+")"});break}const H=((j=N.node())==null?void 0:j.getBoundingClientRect().width)??0,B=d/2-H/2,V=d/2+H/2,q=Math.min(0,B),Q=Math.max($,V)-q;f.attr("viewBox",`${q} 0 ${Q} ${D}`),_a(f,D,Q,s.useMaxWidth)},"draw"),ycr={draw:mcr},vcr={parser:dcr,db:UWe,renderer:ycr,styles:pcr};const bcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:vcr},Symbol.toStringTag,{value:"Module"}));var vj=(function(){var t=w(function(K,de,X,Fe){for(X=X||{},Fe=K.length;Fe--;X[K[Fe]]=de);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],x=[1,23],b=[1,18],T=[1,19],k=[1,20],S=[1,21],C=[1,22],E=[1,24],A=[1,25],M=[1,26],L=[1,27],P=[1,28],N=[1,29],_=[1,32],I=[1,33],O=[1,34],D=[1,39],$=[1,40],F=[1,42],z=[1,44],H=[1,63],B=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],q=[1,66],G=[1,67],Q=[1,68],j=[1,69],ae=[1,70],Z=[1,71],J=[1,72],re=[1,73],ee=[1,74],me=[1,75],te=[1,76],$e=[1,77],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],He=[1,91],ue=[1,92],ce=[1,93],Te=[1,100],ge=[1,94],Ve=[1,97],we=[1,95],Ae=[1,96],Ue=[1,98],le=[1,99],pe=[1,103],Ce=[10,55,56,57],oe=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],fe={trace:w(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:w(function(de,X,Fe,ke,Ye,Ie,ze){var De=Ie.length-1;switch(Ye){case 23:this.$=Ie[De];break;case 24:this.$=Ie[De-1]+""+Ie[De];break;case 26:this.$=Ie[De-1]+Ie[De];break;case 27:this.$=[Ie[De].trim()];break;case 28:Ie[De-2].push(Ie[De].trim()),this.$=Ie[De-2];break;case 29:this.$=Ie[De-4],ke.addClass(Ie[De-2],Ie[De]);break;case 37:this.$=[];break;case 42:this.$=Ie[De].trim(),ke.setDiagramTitle(this.$);break;case 43:this.$=Ie[De].trim(),ke.setAccTitle(this.$);break;case 44:case 45:this.$=Ie[De].trim(),ke.setAccDescription(this.$);break;case 46:ke.addSection(Ie[De].substr(8)),this.$=Ie[De].substr(8);break;case 47:ke.addPoint(Ie[De-3],"",Ie[De-1],Ie[De],[]);break;case 48:ke.addPoint(Ie[De-4],Ie[De-3],Ie[De-1],Ie[De],[]);break;case 49:ke.addPoint(Ie[De-4],"",Ie[De-2],Ie[De-1],Ie[De]);break;case 50:ke.addPoint(Ie[De-5],Ie[De-4],Ie[De-2],Ie[De-1],Ie[De]);break;case 51:ke.setXAxisLeftText(Ie[De-2]),ke.setXAxisRightText(Ie[De]);break;case 52:Ie[De-1].text+=" ⟶ ",ke.setXAxisLeftText(Ie[De-1]);break;case 53:ke.setXAxisLeftText(Ie[De]);break;case 54:ke.setYAxisBottomText(Ie[De-2]),ke.setYAxisTopText(Ie[De]);break;case 55:Ie[De-1].text+=" ⟶ ",ke.setYAxisBottomText(Ie[De-1]);break;case 56:ke.setYAxisBottomText(Ie[De]);break;case 57:ke.setQuadrant1Text(Ie[De]);break;case 58:ke.setQuadrant2Text(Ie[De]);break;case 59:ke.setQuadrant3Text(Ie[De]);break;case 60:ke.setQuadrant4Text(Ie[De]);break;case 64:this.$={text:Ie[De],type:"text"};break;case 65:this.$={text:Ie[De-1].text+""+Ie[De],type:Ie[De-1].type};break;case 66:this.$={text:Ie[De],type:"text"};break;case 67:this.$={text:Ie[De],type:"markdown"};break;case 68:this.$=Ie[De];break;case 69:this.$=Ie[De-1]+""+Ie[De];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:x,35:b,37:T,39:k,41:S,42:C,48:E,50:A,51:M,52:L,53:P,54:N,60:_,61:I,63:O,64:D,65:$,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:x,35:b,37:T,39:k,41:S,42:C,48:E,50:A,51:M,52:L,53:P,54:N,60:_,61:I,63:O,64:D,65:$,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:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:O,64:D,65:$,66:F,67:z},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[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:q,5:G,6:Q,7:j,8:ae,9:Z,10:J,11:re,12:ee,13:me,14:te,15:$e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:O,64:D,65:$,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:O,64:D,65:$,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:q,5:G,6:Q,7:j,8:ae,9:Z,10:J,11:re,12:ee,13:me,14:te,15:$e,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[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:_,61:I,63:O,64:D,65:$,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:_,61:I,63:O,64:D,65:$,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,16:90,17:we,18:Ae,19:Ue,20:le,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Ce,[2,27],{16:104,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),t(oe,[2,25]),t(oe,[2,13]),t(oe,[2,14]),t(oe,[2,15]),t(oe,[2,16]),t(oe,[2,17]),t(oe,[2,18]),t(oe,[2,19]),t(oe,[2,20]),t(oe,[2,21]),t(oe,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),{4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,16:90,17:we,18:Ae,19:Ue,20:le,22:106},t(oe,[2,26]),t(l,[2,50],{10:pe}),t(Ce,[2,28],{16:104,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:w(function(de,X){if(X.recoverable)this.trace(de);else{var Fe=new Error(de);throw Fe.hash=X,Fe}},"parseError"),parse:w(function(de){var X=this,Fe=[0],ke=[],Ye=[null],Ie=[],ze=this.table,De="",Ke=0,Be=0,nt=2,Le=1,pt=Ie.slice.call(arguments,1),Me=Object.create(this.lexer),Ct={yy:{}};for(var wt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,wt)&&(Ct.yy[wt]=this.yy[wt]);Me.setInput(de,Ct.yy),Ct.yy.lexer=Me,Ct.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var ht=Me.yylloc;Ie.push(ht);var Bt=Me.options&&Me.options.ranges;typeof Ct.yy.parseError=="function"?this.parseError=Ct.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function At(Kt){Fe.length=Fe.length-2*Kt,Ye.length=Ye.length-Kt,Ie.length=Ie.length-Kt}w(At,"popStack");function mt(){var Kt;return Kt=ke.pop()||Me.lex()||Le,typeof Kt!="number"&&(Kt instanceof Array&&(ke=Kt,Kt=ke.pop()),Kt=X.symbols_[Kt]||Kt),Kt}w(mt,"lex");for(var ye,Nt,yt,gt,St={},tn,_e,Je,ut;;){if(Nt=Fe[Fe.length-1],this.defaultActions[Nt]?yt=this.defaultActions[Nt]:((ye===null||typeof ye>"u")&&(ye=mt()),yt=ze[Nt]&&ze[Nt][ye]),typeof yt>"u"||!yt.length||!yt[0]){var Dt="";ut=[];for(tn in ze[Nt])this.terminals_[tn]&&tn>nt&&ut.push("'"+this.terminals_[tn]+"'");Me.showPosition?Dt="Parse error on line "+(Ke+1)+`: +`,"getStyles"),xcr=bcr,wcr=w(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 Ddt().value(i=>i.value).sort(null)(r)},"createPieArcs"),Tcr=w((t,e,r,n)=>{var j;he.debug(`rendering pie chart +`+t);const i=n.db,a=We(),s=Gi(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=Po(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=c0(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,x=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,T=MT().innerRadius(x*b).outerRadius(b),k=MT().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 C=i.getSections(),E=wcr(C),A=[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;C.forEach(ae=>{M+=ae});const L=E.filter(ae=>(ae.data.value/M*100).toFixed(0)!=="0"),P=w1(A).domain([...C.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",T).attr("fill",ae=>P(ae.data.label)).attr("class",ae=>{let Z="pieCircle";return s.highlightSlice==="hover"?Z+=" highlightedOnHover":s.highlightSlice===ae.data.label&&(Z+=" highlighted"),Z}),S.selectAll("mySlices").data(L).enter().append("text").text(ae=>(ae.data.value/M*100).toFixed(0)+"%").attr("transform",ae=>"translate("+k.centroid(ae)+")").style("text-anchor","middle").attr("class","slice");const N=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),_=[...C.entries()].map(([ae,Z])=>({label:ae,value:Z})),I=p.selectAll(".legend").data(_).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",ae=>P(ae.label)).style("stroke",ae=>P(ae.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(ae=>i.getShowData()?`${ae.label} [${ae.value}]`:ae.label);const O=Math.max(...I.selectAll("text").nodes().map(ae=>(ae==null?void 0:ae.getBoundingClientRect().width)??0));let D=h,$=d+o;const F=l+u,z=_.length*F;switch(y){case"center":I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=-O/2-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"});break;case"top":D+=z,I.attr("transform",(ae,Z)=>{const J=b,re=-O/2-(l+u),ee=Z*F-J;return`translate(${re}, ${ee})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":D+=z,I.attr("transform",(ae,Z)=>{const J=-b-F,re=-O/2-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"});break;case"left":$+=l+u+O,I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=-b-(l+u),ee=Z*F-J;return"translate("+re+","+ee+")"}),S.attr("transform",()=>`translate(${O+l+u}, 0)`);break;case"right":default:$+=l+u+O,I.attr("transform",(ae,Z)=>{const J=F*_.length/2,re=12*l,ee=Z*F-J;return"translate("+re+","+ee+")"});break}const H=((j=N.node())==null?void 0:j.getBoundingClientRect().width)??0,B=d/2-H/2,V=d/2+H/2,q=Math.min(0,B),Q=Math.max($,V)-q;f.attr("viewBox",`${q} 0 ${Q} ${D}`),_a(f,D,Q,s.useMaxWidth)},"draw"),kcr={draw:Tcr},Ccr={parser:vcr,db:XWe,renderer:kcr,styles:xcr};const Scr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ccr},Symbol.toStringTag,{value:"Module"}));var xj=(function(){var t=w(function(K,de,X,Fe){for(X=X||{},Fe=K.length;Fe--;X[K[Fe]]=de);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],x=[1,23],b=[1,18],T=[1,19],k=[1,20],S=[1,21],C=[1,22],E=[1,24],A=[1,25],M=[1,26],L=[1,27],P=[1,28],N=[1,29],_=[1,32],I=[1,33],O=[1,34],D=[1,39],$=[1,40],F=[1,42],z=[1,44],H=[1,63],B=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],q=[1,66],G=[1,67],Q=[1,68],j=[1,69],ae=[1,70],Z=[1,71],J=[1,72],re=[1,73],ee=[1,74],me=[1,75],te=[1,76],$e=[1,77],Oe=[4,5,6,7,8,9,10,11,12,13,14,15,18],He=[1,91],ue=[1,92],ce=[1,93],Te=[1,100],ge=[1,94],Ve=[1,97],we=[1,95],Ae=[1,96],Ue=[1,98],le=[1,99],pe=[1,103],Ce=[10,55,56,57],oe=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],fe={trace:w(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:w(function(de,X,Fe,ke,Ye,Ie,ze){var De=Ie.length-1;switch(Ye){case 23:this.$=Ie[De];break;case 24:this.$=Ie[De-1]+""+Ie[De];break;case 26:this.$=Ie[De-1]+Ie[De];break;case 27:this.$=[Ie[De].trim()];break;case 28:Ie[De-2].push(Ie[De].trim()),this.$=Ie[De-2];break;case 29:this.$=Ie[De-4],ke.addClass(Ie[De-2],Ie[De]);break;case 37:this.$=[];break;case 42:this.$=Ie[De].trim(),ke.setDiagramTitle(this.$);break;case 43:this.$=Ie[De].trim(),ke.setAccTitle(this.$);break;case 44:case 45:this.$=Ie[De].trim(),ke.setAccDescription(this.$);break;case 46:ke.addSection(Ie[De].substr(8)),this.$=Ie[De].substr(8);break;case 47:ke.addPoint(Ie[De-3],"",Ie[De-1],Ie[De],[]);break;case 48:ke.addPoint(Ie[De-4],Ie[De-3],Ie[De-1],Ie[De],[]);break;case 49:ke.addPoint(Ie[De-4],"",Ie[De-2],Ie[De-1],Ie[De]);break;case 50:ke.addPoint(Ie[De-5],Ie[De-4],Ie[De-2],Ie[De-1],Ie[De]);break;case 51:ke.setXAxisLeftText(Ie[De-2]),ke.setXAxisRightText(Ie[De]);break;case 52:Ie[De-1].text+=" ⟶ ",ke.setXAxisLeftText(Ie[De-1]);break;case 53:ke.setXAxisLeftText(Ie[De]);break;case 54:ke.setYAxisBottomText(Ie[De-2]),ke.setYAxisTopText(Ie[De]);break;case 55:Ie[De-1].text+=" ⟶ ",ke.setYAxisBottomText(Ie[De-1]);break;case 56:ke.setYAxisBottomText(Ie[De]);break;case 57:ke.setQuadrant1Text(Ie[De]);break;case 58:ke.setQuadrant2Text(Ie[De]);break;case 59:ke.setQuadrant3Text(Ie[De]);break;case 60:ke.setQuadrant4Text(Ie[De]);break;case 64:this.$={text:Ie[De],type:"text"};break;case 65:this.$={text:Ie[De-1].text+""+Ie[De],type:Ie[De-1].type};break;case 66:this.$={text:Ie[De],type:"text"};break;case 67:this.$={text:Ie[De],type:"markdown"};break;case 68:this.$=Ie[De];break;case 69:this.$=Ie[De-1]+""+Ie[De];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:x,35:b,37:T,39:k,41:S,42:C,48:E,50:A,51:M,52:L,53:P,54:N,60:_,61:I,63:O,64:D,65:$,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:x,35:b,37:T,39:k,41:S,42:C,48:E,50:A,51:M,52:L,53:P,54:N,60:_,61:I,63:O,64:D,65:$,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:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:_,61:I,63:O,64:D,65:$,66:F,67:z},{4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:O,64:D,65:$,66:F,67:z},t(V,[2,64]),t(V,[2,66]),t(V,[2,67]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),t(V,[2,79]),t(V,[2,80]),t(V,[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:q,5:G,6:Q,7:j,8:ae,9:Z,10:J,11:re,12:ee,13:me,14:te,15:$e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:O,64:D,65:$,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:O,64:D,65:$,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(V,[2,65]),t(V,[2,82]),t(V,[2,83]),t(V,[2,84]),{3:83,4:q,5:G,6:Q,7:j,8:ae,9:Z,10:J,11:re,12:ee,13:me,14:te,15:$e,18:[1,82]},t(Oe,[2,23]),t(Oe,[2,1]),t(Oe,[2,2]),t(Oe,[2,3]),t(Oe,[2,4]),t(Oe,[2,5]),t(Oe,[2,6]),t(Oe,[2,7]),t(Oe,[2,8]),t(Oe,[2,9]),t(Oe,[2,10]),t(Oe,[2,11]),t(Oe,[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:_,61:I,63:O,64:D,65:$,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:_,61:I,63:O,64:D,65:$,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,16:90,17:we,18:Ae,19:Ue,20:le,22:89,23:88},t(Oe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:H,10:f,12:p,13:g,14:m,15:y,18:B,63:O,64:D,65:$,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Ce,[2,27],{16:104,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),t(oe,[2,25]),t(oe,[2,13]),t(oe,[2,14]),t(oe,[2,15]),t(oe,[2,16]),t(oe,[2,17]),t(oe,[2,18]),t(oe,[2,19]),t(oe,[2,20]),t(oe,[2,21]),t(oe,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le}),{4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,16:90,17:we,18:Ae,19:Ue,20:le,22:106},t(oe,[2,26]),t(l,[2,50],{10:pe}),t(Ce,[2,28],{16:104,4:He,5:ue,6:ce,8:Te,11:ge,13:Ve,17:we,18:Ae,19:Ue,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:w(function(de,X){if(X.recoverable)this.trace(de);else{var Fe=new Error(de);throw Fe.hash=X,Fe}},"parseError"),parse:w(function(de){var X=this,Fe=[0],ke=[],Ye=[null],Ie=[],ze=this.table,De="",Ke=0,Be=0,nt=2,Le=1,pt=Ie.slice.call(arguments,1),Me=Object.create(this.lexer),Ct={yy:{}};for(var wt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,wt)&&(Ct.yy[wt]=this.yy[wt]);Me.setInput(de,Ct.yy),Ct.yy.lexer=Me,Ct.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var ht=Me.yylloc;Ie.push(ht);var Bt=Me.options&&Me.options.ranges;typeof Ct.yy.parseError=="function"?this.parseError=Ct.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function At(Kt){Fe.length=Fe.length-2*Kt,Ye.length=Ye.length-Kt,Ie.length=Ie.length-Kt}w(At,"popStack");function mt(){var Kt;return Kt=ke.pop()||Me.lex()||Le,typeof Kt!="number"&&(Kt instanceof Array&&(ke=Kt,Kt=ke.pop()),Kt=X.symbols_[Kt]||Kt),Kt}w(mt,"lex");for(var ye,Nt,yt,gt,St={},tn,_e,Je,ut;;){if(Nt=Fe[Fe.length-1],this.defaultActions[Nt]?yt=this.defaultActions[Nt]:((ye===null||typeof ye>"u")&&(ye=mt()),yt=ze[Nt]&&ze[Nt][ye]),typeof yt>"u"||!yt.length||!yt[0]){var Dt="";ut=[];for(tn in ze[Nt])this.terminals_[tn]&&tn>nt&&ut.push("'"+this.terminals_[tn]+"'");Me.showPosition?Dt="Parse error on line "+(Ke+1)+`: `+Me.showPosition()+` Expecting `+ut.join(", ")+", got '"+(this.terminals_[ye]||ye)+"'":Dt="Parse error on line "+(Ke+1)+": Unexpected "+(ye==Le?"end of input":"'"+(this.terminals_[ye]||ye)+"'"),this.parseError(Dt,{text:Me.match,token:this.terminals_[ye]||ye,line:Me.yylineno,loc:ht,expected:ut})}if(yt[0]instanceof Array&&yt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Nt+", token: "+ye);switch(yt[0]){case 1:Fe.push(ye),Ye.push(Me.yytext),Ie.push(Me.yylloc),Fe.push(yt[1]),ye=null,Be=Me.yyleng,De=Me.yytext,Ke=Me.yylineno,ht=Me.yylloc;break;case 2:if(_e=this.productions_[yt[1]][1],St.$=Ye[Ye.length-_e],St._$={first_line:Ie[Ie.length-(_e||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(_e||1)].first_column,last_column:Ie[Ie.length-1].last_column},Bt&&(St._$.range=[Ie[Ie.length-(_e||1)].range[0],Ie[Ie.length-1].range[1]]),gt=this.performAction.apply(St,[De,Be,Ke,Ct.yy,yt[1],Ye,Ie].concat(pt)),typeof gt<"u")return gt;_e&&(Fe=Fe.slice(0,-1*_e*2),Ye=Ye.slice(0,-1*_e),Ie=Ie.slice(0,-1*_e)),Fe.push(this.productions_[yt[1]][0]),Ye.push(St.$),Ie.push(St._$),Je=ze[Fe[Fe.length-2]][Fe[Fe.length-1]],Fe.push(Je);break;case 3:return!0}}return!0},"parse")},W=(function(){var K={EOF:1,parseError:w(function(X,Fe){if(this.yy.parser)this.yy.parser.parseError(X,Fe);else throw new Error(X)},"parseError"),setInput:w(function(de,X){return this.yy=X||this.yy||{},this._input=de,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:w(function(){var de=this._input[0];this.yytext+=de,this.yyleng++,this.offset++,this.match+=de,this.matched+=de;var X=de.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),de},"input"),unput:w(function(de){var X=de.length,Fe=de.split(/(?:\r\n?|\n)/g);this._input=de+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-X),this.offset-=X;var ke=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),Fe.length-1&&(this.yylineno-=Fe.length-1);var Ye=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:Fe?(Fe.length===ke.length?this.yylloc.first_column:0)+ke[ke.length-Fe.length].length-Fe[0].length:this.yylloc.first_column-X},this.options.ranges&&(this.yylloc.range=[Ye[0],Ye[0]+this.yyleng-X]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(de){this.unput(this.match.slice(de))},"less"),pastInput:w(function(){var de=this.matched.substr(0,this.matched.length-this.match.length);return(de.length>20?"...":"")+de.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var de=this.match;return de.length<20&&(de+=this._input.substr(0,20-de.length)),(de.substr(0,20)+(de.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var de=this.pastInput(),X=new Array(de.length+1).join("-");return de+this.upcomingInput()+` `+X+"^"},"showPosition"),test_match:w(function(de,X){var Fe,ke,Ye;if(this.options.backtrack_lexer&&(Ye={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&&(Ye.yylloc.range=this.yylloc.range.slice(0))),ke=de[0].match(/(?:\r\n?|\n).*/g),ke&&(this.yylineno+=ke.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ke?ke[ke.length-1].length-ke[ke.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+de[0].length},this.yytext+=de[0],this.match+=de[0],this.matches=de,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(de[0].length),this.matched+=de[0],Fe=this.performAction.call(this,this.yy,this,X,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Fe)return Fe;if(this._backtrack){for(var Ie in Ye)this[Ie]=Ye[Ie];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var de,X,Fe,ke;this._more||(this.yytext="",this.match="");for(var Ye=this._currentRules(),Ie=0;IeX[0].length)){if(X=Fe,ke=Ie,this.options.backtrack_lexer){if(de=this.test_match(Fe,Ye[Ie]),de!==!1)return de;if(this._backtrack){X=!1;continue}else return!1}else if(!this.options.flex)break}return X?(de=this.test_match(X,Ye[ke]),de!==!1?de:!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:w(function(){var X=this.next();return X||this.lex()},"lex"),begin:w(function(X){this.conditionStack.push(X)},"begin"),popState:w(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:w(function(X){this.begin(X)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(X,Fe,ke,Ye){switch(ke){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 K})();fe.lexer=W;function se(){this.yy={}}return w(se,"Parser"),se.prototype=fe,fe.Parser=se,new se})();vj.parser=vj;var xcr=vj,Uo=l0(),Ww,wcr=(Ww=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,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=xn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=xn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=xn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=xn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=xn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=xn.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=xn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=xn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=xn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=xn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=xn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=xn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=xn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=xn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=xn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=xn.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=xn.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=xn.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Uo.quadrant1Fill,quadrant2Fill:Uo.quadrant2Fill,quadrant3Fill:Uo.quadrant3Fill,quadrant4Fill:Uo.quadrant4Fill,quadrant1TextFill:Uo.quadrant1TextFill,quadrant2TextFill:Uo.quadrant2TextFill,quadrant3TextFill:Uo.quadrant3TextFill,quadrant4TextFill:Uo.quadrant4TextFill,quadrantPointFill:Uo.quadrantPointFill,quadrantPointTextFill:Uo.quadrantPointTextFill,quadrantXAxisTextFill:Uo.quadrantXAxisTextFill,quadrantYAxisTextFill:Uo.quadrantYAxisTextFill,quadrantTitleFill:Uo.quadrantTitleFill,quadrantInternalBorderStrokeFill:Uo.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Uo.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,he.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){he.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){he.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=AT().domain([0,1]).range([i,s+i]),l=AT().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)}}},w(Ww,"QuadrantBuilder"),Ww),qw,S8=(qw=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(qw,"InvalidStyleError"),qw);function bj(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(bj,"validateHexCode");function YWe(t){return!/^\d+$/.test(t)}w(YWe,"validateNumber");function jWe(t){return!/^\d+px$/.test(t)}w(jWe,"validateSizeInPixels");function Ld(t){return Tn(t.trim(),We())}w(Ld,"textSanitizer");var lo=new wcr;function XWe(t){lo.setData({quadrant1Text:Ld(t.text)})}w(XWe,"setQuadrant1Text");function KWe(t){lo.setData({quadrant2Text:Ld(t.text)})}w(KWe,"setQuadrant2Text");function ZWe(t){lo.setData({quadrant3Text:Ld(t.text)})}w(ZWe,"setQuadrant3Text");function QWe(t){lo.setData({quadrant4Text:Ld(t.text)})}w(QWe,"setQuadrant4Text");function JWe(t){lo.setData({xAxisLeftText:Ld(t.text)})}w(JWe,"setXAxisLeftText");function eqe(t){lo.setData({xAxisRightText:Ld(t.text)})}w(eqe,"setXAxisRightText");function tqe(t){lo.setData({yAxisTopText:Ld(t.text)})}w(tqe,"setYAxisTopText");function rqe(t){lo.setData({yAxisBottomText:Ld(t.text)})}w(rqe,"setYAxisBottomText");function CO(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(YWe(i))throw new S8(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(bj(i))throw new S8(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(bj(i))throw new S8(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(jWe(i))throw new S8(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(CO,"parseStyles");function nqe(t,e,r,n,i){const a=CO(i);lo.addPoints([{x:r,y:n,text:Ld(t.text),className:e,...a}])}w(nqe,"addPoint");function iqe(t,e){lo.addClass(t,CO(e))}w(iqe,"addClass");function aqe(t){lo.setConfig({chartWidth:t})}w(aqe,"setWidth");function sqe(t){lo.setConfig({chartHeight:t})}w(sqe,"setHeight");function oqe(){const t=We(),{themeVariables:e,quadrantChart:r}=t;return r&&lo.setConfig(r),lo.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}),lo.setData({titleText:Di()}),lo.build()}w(oqe,"getQuadrantData");var Tcr=w(function(){lo.clear(),wi()},"clear"),kcr={setWidth:aqe,setHeight:sqe,setQuadrant1Text:XWe,setQuadrant2Text:KWe,setQuadrant3Text:ZWe,setQuadrant4Text:QWe,setXAxisLeftText:JWe,setXAxisRightText:eqe,setYAxisTopText:tqe,setYAxisBottomText:rqe,parseStyles:CO,addPoint:nqe,addClass:iqe,getQuadrantData:oqe,clear:Tcr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},Ccr=w((t,e,r,n)=>{var E,A,M;function i(L){return L==="top"?"hanging":"middle"}w(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}w(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}w(s,"getTransformation");const o=We();he.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=bt("#i"+e));const d=bt(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=((A=o.quadrantChart)==null?void 0:A.chartHeight)??500;_a(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"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),T=f.append("g").attr("class","title");m.title&&T.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 k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.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),k.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 C=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.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),C.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"),Scr={draw:Ccr},Ecr={parser:xcr,db:kcr,renderer:Scr,styles:w(()=>"","styles")};const Acr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ecr},Symbol.toStringTag,{value:"Module"}));var xj=(function(){var t=w(function(O,D,$,F){for($=$||{},F=O.length;F--;$[O[F]]=D);return $},"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],x=[1,36],b=[1,37],T=[1,43],k=[1,42],S=[1,47],C=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],A=[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],N={trace:w(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:w(function(D,$,F,z,H,B,V){var q=B.length-1;switch(H){case 5:z.setOrientation(B[q]);break;case 9:z.setDiagramTitle(B[q].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[q]);break;case 13:z.setLineData(B[q-1],B[q]);break;case 14:z.setBarData({text:"",type:"text"},B[q]);break;case 15:z.setBarData(B[q-1],B[q]);break;case 16:this.$=B[q].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[q].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[q-1];break;case 20:case 30:this.$=[B[q-2],...B[q]];break;case 21:case 31:this.$=[B[q]];break;case 22:this.$={value:Number(B[q-1]),label:B[q]};break;case 23:this.$={value:Number(B[q]),label:""};break;case 24:z.setXAxisTitle(B[q]);break;case 25:z.setXAxisTitle(B[q-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[q]);break;case 28:z.setXAxisRangeData(Number(B[q-2]),Number(B[q]));break;case 29:this.$=B[q-1];break;case 32:z.setYAxisTitle(B[q]);break;case 33:z.setYAxisTitle(B[q-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[q-2]),Number(B[q]));break;case 39:this.$={text:B[q],type:"text"};break;case 40:this.$={text:B[q],type:"text"};break;case 41:this.$={text:B[q],type:"markdown"};break;case 42:this.$=B[q];break;case 43:this.$=B[q-1]+""+B[q];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:x,51:b},{11:39,13:38,24:T,29:k,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:x,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:x,51:b},{11:49,17:48,24:C,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:x,51:b},{11:52,17:51,24:C,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:x,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(A,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b}),t(A,[2,40]),t(A,[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:T,29:k}),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:x,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:C},{25:63,27:64,29:L},t(E,[2,14]),{17:66,24:C},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:x,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:w(function(D,$){if($.recoverable)this.trace(D);else{var F=new Error(D);throw F.hash=$,F}},"parseError"),parse:w(function(D){var $=this,F=[0],z=[],H=[null],B=[],V=this.table,q="",G=0,Q=0,j=2,ae=1,Z=B.slice.call(arguments,1),J=Object.create(this.lexer),re={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(re.yy[ee]=this.yy[ee]);J.setInput(D,re.yy),re.yy.lexer=J,re.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var me=J.yylloc;B.push(me);var te=J.options&&J.options.ranges;typeof re.yy.parseError=="function"?this.parseError=re.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $e(pe){F.length=F.length-2*pe,H.length=H.length-pe,B.length=B.length-pe}w($e,"popStack");function Oe(){var pe;return pe=z.pop()||J.lex()||ae,typeof pe!="number"&&(pe instanceof Array&&(z=pe,pe=z.pop()),pe=$.symbols_[pe]||pe),pe}w(Oe,"lex");for(var He,ue,ce,Te,ge={},Ve,we,Ae,Ue;;){if(ue=F[F.length-1],this.defaultActions[ue]?ce=this.defaultActions[ue]:((He===null||typeof He>"u")&&(He=Oe()),ce=V[ue]&&V[ue][He]),typeof ce>"u"||!ce.length||!ce[0]){var le="";Ue=[];for(Ve in V[ue])this.terminals_[Ve]&&Ve>j&&Ue.push("'"+this.terminals_[Ve]+"'");J.showPosition?le="Parse error on line "+(G+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var X=this.next();return X||this.lex()},"lex"),begin:w(function(X){this.conditionStack.push(X)},"begin"),popState:w(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:w(function(X){this.begin(X)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(X,Fe,ke,Ye){switch(ke){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 K})();fe.lexer=W;function se(){this.yy={}}return w(se,"Parser"),se.prototype=fe,fe.Parser=se,new se})();xj.parser=xj;var Ecr=xj,Uo=l0(),Ww,Acr=(Ww=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,x;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=xn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=xn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=xn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=xn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=xn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=xn.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=xn.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=xn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=xn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=xn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=xn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=xn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=xn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=xn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=xn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=xn.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=xn.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((x=xn.quadrantChart)==null?void 0:x.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:Uo.quadrant1Fill,quadrant2Fill:Uo.quadrant2Fill,quadrant3Fill:Uo.quadrant3Fill,quadrant4Fill:Uo.quadrant4Fill,quadrant1TextFill:Uo.quadrant1TextFill,quadrant2TextFill:Uo.quadrant2TextFill,quadrant3TextFill:Uo.quadrant3TextFill,quadrant4TextFill:Uo.quadrant4TextFill,quadrantPointFill:Uo.quadrantPointFill,quadrantPointTextFill:Uo.quadrantPointTextFill,quadrantXAxisTextFill:Uo.quadrantXAxisTextFill,quadrantYAxisTextFill:Uo.quadrantYAxisTextFill,quadrantTitleFill:Uo.quadrantTitleFill,quadrantInternalBorderStrokeFill:Uo.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:Uo.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,he.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){he.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){he.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=AT().domain([0,1]).range([i,s+i]),l=AT().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)}}},w(Ww,"QuadrantBuilder"),Ww),qw,E8=(qw=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(qw,"InvalidStyleError"),qw);function wj(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(wj,"validateHexCode");function KWe(t){return!/^\d+$/.test(t)}w(KWe,"validateNumber");function ZWe(t){return!/^\d+px$/.test(t)}w(ZWe,"validateSizeInPixels");function Id(t){return Tn(t.trim(),We())}w(Id,"textSanitizer");var lo=new Acr;function QWe(t){lo.setData({quadrant1Text:Id(t.text)})}w(QWe,"setQuadrant1Text");function JWe(t){lo.setData({quadrant2Text:Id(t.text)})}w(JWe,"setQuadrant2Text");function eqe(t){lo.setData({quadrant3Text:Id(t.text)})}w(eqe,"setQuadrant3Text");function tqe(t){lo.setData({quadrant4Text:Id(t.text)})}w(tqe,"setQuadrant4Text");function rqe(t){lo.setData({xAxisLeftText:Id(t.text)})}w(rqe,"setXAxisLeftText");function nqe(t){lo.setData({xAxisRightText:Id(t.text)})}w(nqe,"setXAxisRightText");function iqe(t){lo.setData({yAxisTopText:Id(t.text)})}w(iqe,"setYAxisTopText");function aqe(t){lo.setData({yAxisBottomText:Id(t.text)})}w(aqe,"setYAxisBottomText");function EO(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(KWe(i))throw new E8(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(wj(i))throw new E8(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(wj(i))throw new E8(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(ZWe(i))throw new E8(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(EO,"parseStyles");function sqe(t,e,r,n,i){const a=EO(i);lo.addPoints([{x:r,y:n,text:Id(t.text),className:e,...a}])}w(sqe,"addPoint");function oqe(t,e){lo.addClass(t,EO(e))}w(oqe,"addClass");function lqe(t){lo.setConfig({chartWidth:t})}w(lqe,"setWidth");function cqe(t){lo.setConfig({chartHeight:t})}w(cqe,"setHeight");function uqe(){const t=We(),{themeVariables:e,quadrantChart:r}=t;return r&&lo.setConfig(r),lo.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}),lo.setData({titleText:Di()}),lo.build()}w(uqe,"getQuadrantData");var Rcr=w(function(){lo.clear(),wi()},"clear"),_cr={setWidth:lqe,setHeight:cqe,setQuadrant1Text:QWe,setQuadrant2Text:JWe,setQuadrant3Text:eqe,setQuadrant4Text:tqe,setXAxisLeftText:rqe,setXAxisRightText:nqe,setYAxisTopText:iqe,setYAxisBottomText:aqe,parseStyles:EO,addPoint:sqe,addClass:oqe,getQuadrantData:uqe,clear:Rcr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},Mcr=w((t,e,r,n)=>{var E,A,M;function i(L){return L==="top"?"hanging":"middle"}w(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}w(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}w(s,"getTransformation");const o=We();he.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=bt("#i"+e));const d=bt(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=((A=o.quadrantChart)==null?void 0:A.chartHeight)??500;_a(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"),x=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),T=f.append("g").attr("class","title");m.title&&T.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 k=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");k.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),k.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 C=x.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.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),C.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"),Lcr={draw:Mcr},Icr={parser:Ecr,db:_cr,renderer:Lcr,styles:w(()=>"","styles")};const $cr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Icr},Symbol.toStringTag,{value:"Module"}));var Tj=(function(){var t=w(function(O,D,$,F){for($=$||{},F=O.length;F--;$[O[F]]=D);return $},"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],x=[1,36],b=[1,37],T=[1,43],k=[1,42],S=[1,47],C=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],A=[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],N={trace:w(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:w(function(D,$,F,z,H,B,V){var q=B.length-1;switch(H){case 5:z.setOrientation(B[q]);break;case 9:z.setDiagramTitle(B[q].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[q]);break;case 13:z.setLineData(B[q-1],B[q]);break;case 14:z.setBarData({text:"",type:"text"},B[q]);break;case 15:z.setBarData(B[q-1],B[q]);break;case 16:this.$=B[q].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[q].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[q-1];break;case 20:case 30:this.$=[B[q-2],...B[q]];break;case 21:case 31:this.$=[B[q]];break;case 22:this.$={value:Number(B[q-1]),label:B[q]};break;case 23:this.$={value:Number(B[q]),label:""};break;case 24:z.setXAxisTitle(B[q]);break;case 25:z.setXAxisTitle(B[q-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[q]);break;case 28:z.setXAxisRangeData(Number(B[q-2]),Number(B[q]));break;case 29:this.$=B[q-1];break;case 32:z.setYAxisTitle(B[q]);break;case 33:z.setYAxisTitle(B[q-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[q-2]),Number(B[q]));break;case 39:this.$={text:B[q],type:"text"};break;case 40:this.$={text:B[q],type:"text"};break;case 41:this.$={text:B[q],type:"markdown"};break;case 42:this.$=B[q];break;case 43:this.$=B[q-1]+""+B[q];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:x,51:b},{11:39,13:38,24:T,29:k,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:x,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:x,51:b},{11:49,17:48,24:C,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:x,51:b},{11:52,17:51,24:C,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:x,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(A,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:x,51:b}),t(A,[2,40]),t(A,[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:T,29:k}),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:x,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:C},{25:63,27:64,29:L},t(E,[2,14]),{17:66,24:C},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:x,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:w(function(D,$){if($.recoverable)this.trace(D);else{var F=new Error(D);throw F.hash=$,F}},"parseError"),parse:w(function(D){var $=this,F=[0],z=[],H=[null],B=[],V=this.table,q="",G=0,Q=0,j=2,ae=1,Z=B.slice.call(arguments,1),J=Object.create(this.lexer),re={yy:{}};for(var ee in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ee)&&(re.yy[ee]=this.yy[ee]);J.setInput(D,re.yy),re.yy.lexer=J,re.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var me=J.yylloc;B.push(me);var te=J.options&&J.options.ranges;typeof re.yy.parseError=="function"?this.parseError=re.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $e(pe){F.length=F.length-2*pe,H.length=H.length-pe,B.length=B.length-pe}w($e,"popStack");function Oe(){var pe;return pe=z.pop()||J.lex()||ae,typeof pe!="number"&&(pe instanceof Array&&(z=pe,pe=z.pop()),pe=$.symbols_[pe]||pe),pe}w(Oe,"lex");for(var He,ue,ce,Te,ge={},Ve,we,Ae,Ue;;){if(ue=F[F.length-1],this.defaultActions[ue]?ce=this.defaultActions[ue]:((He===null||typeof He>"u")&&(He=Oe()),ce=V[ue]&&V[ue][He]),typeof ce>"u"||!ce.length||!ce[0]){var le="";Ue=[];for(Ve in V[ue])this.terminals_[Ve]&&Ve>j&&Ue.push("'"+this.terminals_[Ve]+"'");J.showPosition?le="Parse error on line "+(G+1)+`: `+J.showPosition()+` Expecting `+Ue.join(", ")+", got '"+(this.terminals_[He]||He)+"'":le="Parse error on line "+(G+1)+": Unexpected "+(He==ae?"end of input":"'"+(this.terminals_[He]||He)+"'"),this.parseError(le,{text:J.match,token:this.terminals_[He]||He,line:J.yylineno,loc:me,expected:Ue})}if(ce[0]instanceof Array&&ce.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ue+", token: "+He);switch(ce[0]){case 1:F.push(He),H.push(J.yytext),B.push(J.yylloc),F.push(ce[1]),He=null,Q=J.yyleng,q=J.yytext,G=J.yylineno,me=J.yylloc;break;case 2:if(we=this.productions_[ce[1]][1],ge.$=H[H.length-we],ge._$={first_line:B[B.length-(we||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(we||1)].first_column,last_column:B[B.length-1].last_column},te&&(ge._$.range=[B[B.length-(we||1)].range[0],B[B.length-1].range[1]]),Te=this.performAction.apply(ge,[q,Q,G,re.yy,ce[1],H,B].concat(Z)),typeof Te<"u")return Te;we&&(F=F.slice(0,-1*we*2),H=H.slice(0,-1*we),B=B.slice(0,-1*we)),F.push(this.productions_[ce[1]][0]),H.push(ge.$),B.push(ge._$),Ae=V[F[F.length-2]][F[F.length-1]],F.push(Ae);break;case 3:return!0}}return!0},"parse")},_=(function(){var O={EOF:1,parseError:w(function($,F){if(this.yy.parser)this.yy.parser.parseError($,F);else throw new Error($)},"parseError"),setInput:w(function(D,$){return this.yy=$||this.yy||{},this._input=D,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:w(function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var $=D.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),D},"input"),unput:w(function(D){var $=D.length,F=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$),this.offset-=$;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 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:F?(F.length===z.length?this.yylloc.first_column:0)+z[z.length-F.length].length-F[0].length:this.yylloc.first_column-$},this.options.ranges&&(this.yylloc.range=[H[0],H[0]+this.yyleng-$]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(D){this.unput(this.match.slice(D))},"less"),pastInput:w(function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var D=this.match;return D.length<20&&(D+=this._input.substr(0,20-D.length)),(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var D=this.pastInput(),$=new Array(D.length+1).join("-");return D+this.upcomingInput()+` `+$+"^"},"showPosition"),test_match:w(function(D,$){var F,z,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))),z=D[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+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,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(D[0].length),this.matched+=D[0],F=this.performAction.call(this,this.yy,this,$,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var B in H)this[B]=H[B];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var D,$,F,z;this._more||(this.yytext="",this.match="");for(var H=this._currentRules(),B=0;B$[0].length)){if($=F,z=B,this.options.backtrack_lexer){if(D=this.test_match(F,H[B]),D!==!1)return D;if(this._backtrack){$=!1;continue}else return!1}else if(!this.options.flex)break}return $?(D=this.test_match($,H[z]),D!==!1?D:!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:w(function(){var $=this.next();return $||this.lex()},"lex"),begin:w(function($){this.conditionStack.push($)},"begin"),popState:w(function(){var $=this.conditionStack.length-1;return $>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},"topState"),pushState:w(function($){this.begin($)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function($,F,z,H){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 O})();N.lexer=_;function I(){this.yy={}}return w(I,"Parser"),I.prototype=N,N.Parser=I,new I})();xj.parser=xj;var Rcr=xj;function wj(t){return t.type==="bar"}w(wj,"isBarPlot");function VI(t){return t.type==="band"}w(VI,"isBandAxisData");function Rb(t){return t.type==="linear"}w(Rb,"isLinearAxisData");var Gw,lqe=(Gw=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=Y3e(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}},w(Gw,"TextDimensionCalculatorWithFont"),Gw),F1e=.7,z1e=.2,Uw,cqe=(Uw=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(){F1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(F1e*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=z1e*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=z1e*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():[]}},w(Uw,"BaseAxis"),Uw),Yw,_cr=(Yw=class extends cqe{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=ZV().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=ZV().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),he.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},w(Yw,"BandAxis"),Yw),jw,Mcr=(jw=class extends cqe{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=AT().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=AT().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(jw,"LinearAxis"),jw);function Tj(t,e,r,n){const i=new lqe(n);return VI(t)?new _cr(e,r,t.categories,t.title,i):new Mcr(e,r,[t.min,t.max],t.title,i)}w(Tj,"getAxis");var Xw,Lcr=(Xw=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}},w(Xw,"ChartTitle"),Xw);function uqe(t,e,r,n){const i=new lqe(n);return new Lcr(i,t,e,r)}w(uqe,"getChartTitleComponent");var Kw,Icr=(Kw=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=AS().y(i=>i[0]).x(i=>i[1])(e):r=AS().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}},w(Kw,"LinePlot"),Kw),Zw,$cr=(Zw=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}))}]}},w(Zw,"BarPlot"),Zw),Qw,Ncr=(Qw=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 Icr(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new $cr(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(Qw,"BasePlot"),Qw);function hqe(t,e,r){return new Ncr(t,e,r)}w(hqe,"getPlotComponent");var Jw,Dcr=(Jw=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:uqe(e,r,n,i),plot:hqe(e,r,n),xAxis:Tj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:Tj(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=>wj(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=>wj(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}},w(Jw,"Orchestrator"),Jw),eT,Ocr=(eT=class{static build(e,r,n,i){return new Dcr(e,r,n,i).getDrawableElement()}},w(eT,"XYChartBuilder"),eT),V6=0,dqe,W6=Pne(),q6=One(),Bn=Bne(),kj=q6.plotColorPalette.split(",").map(t=>t.trim()),SO=!1,Dne=!1;function One(){const t=l0(),e=pr();return Gi(t.xyChart,e.themeVariables.xyChart)}w(One,"getChartDefaultThemeConfig");function Pne(){const t=pr();return Gi(xn.xyChart,t.xyChart)}w(Pne,"getChartDefaultConfig");function Bne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(Bne,"getChartDefaultData");function x7(t){const e=pr();return Tn(t.trim(),e)}w(x7,"textSanitizer");function fqe(t){dqe=t}w(fqe,"setTmpSVGG");function pqe(t){t==="horizontal"?W6.chartOrientation="horizontal":W6.chartOrientation="vertical"}w(pqe,"setOrientation");function gqe(t){Bn.xAxis.title=x7(t.text)}w(gqe,"setXAxisTitle");function Fne(t,e){Bn.xAxis={type:"linear",title:Bn.xAxis.title,min:t,max:e},SO=!0}w(Fne,"setXAxisRangeData");function mqe(t){Bn.xAxis={type:"band",title:Bn.xAxis.title,categories:t.map(e=>x7(e.text))},SO=!0}w(mqe,"setXAxisBand");function yqe(t){Bn.yAxis.title=x7(t.text)}w(yqe,"setYAxisTitle");function vqe(t,e){Bn.yAxis={type:"linear",title:Bn.yAxis.title,min:t,max:e},Dne=!0}w(vqe,"setYAxisRangeData");function bqe(t){const e=Math.min(...t),r=Math.max(...t),n=Rb(Bn.yAxis)?Bn.yAxis.min:1/0,i=Rb(Bn.yAxis)?Bn.yAxis.max:-1/0;Bn.yAxis={type:"linear",title:Bn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}w(bqe,"setYAxisRangeFromPlotData");function zne(t){let e=[];if(t.length===0)return e;if(!SO){const r=Rb(Bn.xAxis)?Bn.xAxis.min:1/0,n=Rb(Bn.xAxis)?Bn.xAxis.max:-1/0;Fne(Math.min(r,1),Math.max(n,t.length))}if(VI(Bn.xAxis)&&t.length>Bn.xAxis.categories.length&&(t=t.slice(0,Bn.xAxis.categories.length)),Dne||bqe(t),VI(Bn.xAxis)&&(e=Bn.xAxis.categories.map((r,n)=>[r,t[n]])),Rb(Bn.xAxis)){const r=Bn.xAxis.min,n=Bn.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}w(zne,"transformDataWithoutCategory");function Hne(t){return kj[t===0?0:t%kj.length]}w(Hne,"getPlotColorFromPalette");function xqe(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?x7(s.label):""),i=zne(r),a=n.some(s=>s!=="");Bn.plots.push({type:"line",strokeFill:Hne(V6),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),V6++}w(xqe,"setLineData");function wqe(t,e){const r=e.map(i=>i.value),n=zne(r);Bn.plots.push({type:"bar",fill:Hne(V6),data:n}),V6++}w(wqe,"setBarData");function Tqe(){if(Bn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Bn.title=Di(),Ocr.build(W6,Bn,q6,dqe)}w(Tqe,"getDrawableElem");function kqe(){return q6}w(kqe,"getChartThemeConfig");function Cqe(){return W6}w(Cqe,"getChartConfig");function Sqe(){return Bn}w(Sqe,"getXYChartData");var Pcr=w(function(){wi(),V6=0,W6=Pne(),Bn=Bne(),q6=One(),kj=q6.plotColorPalette.split(",").map(t=>t.trim()),SO=!1,Dne=!1},"clear"),Bcr={getDrawableElem:Tqe,clear:Pcr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji,setOrientation:pqe,setXAxisTitle:gqe,setXAxisRangeData:Fne,setXAxisBand:mqe,setYAxisTitle:yqe,setYAxisRangeData:vqe,setLineData:xqe,setBarData:wqe,setTmpSVGG:fqe,getChartThemeConfig:kqe,getChartConfig:Cqe,getXYChartData:Sqe},Fcr=w((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"}w(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}w(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}w(h,"getTextTransformation"),he.debug(`Rendering xychart chart -`+t);const d=Po(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");_a(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 x=f,b="";for(const[T]of v.entries()){let k=f;T>0&&m[b]&&(k=m[b]),b+=v[T],x=m[b],x||(x=m[b]=k.append("g").attr("class",v[T]))}return x}w(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.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 T=function(L,P){const{data:N,label:_}=L;return P*_.length*k<=N.width-S};w(T,"fitsHorizontally");const k=.7,S=10,C=v.data.map((L,P)=>({data:L,label:o[P].toString()})).filter(L=>L.data.width>0&&L.data.height>0),E=C.map(L=>{const{data:P}=L;let N=P.height*.7;for(;!T(L,N)&&N>0;)N-=1;return N}),A=Math.floor(Math.min(...E)),M=w(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");x.selectAll("text").data(C).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",`${A}px`).text(L=>L.label)}else{let T=function(M,L,P){const{data:N,label:_}=M,O=L*_.length*.7,D=N.x+N.width/2,$=D-O/2,F=D+O/2,z=$>=N.x&&F<=N.x+N.width,H=N.y+P+L<=N.y+N.height;return z&&H};w(T,"fitsInBar");const k=10,S=v.data.map((M,L)=>({data:M,label:o[L].toString()})).filter(M=>M.data.width>0&&M.data.height>0),C=S.map(M=>{const{data:L,label:P}=M;let N=L.width/(P.length*.7);for(;!T(M,N,k)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...C)),A=w(M=>b?M.data.y-k:M.data.y+k,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",A).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":x.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":x.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"),zcr={draw:Fcr},Hcr={parser:Rcr,db:Bcr,renderer:zcr};const Vcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hcr},Symbol.toStringTag,{value:"Module"}));var Cj=(function(){var t=w(function(oe,fe,W,se){for(W=W||{},se=oe.length;se--;W[oe[se]]=fe);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],x=[1,24],b=[1,31],T=[1,32],k=[1,30],S=[1,39],C=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[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],N=[1,70],_=[1,71],I=[1,72],O=[1,73],D=[1,74],$=[1,75],F=[1,76],z=[1,83],H=[1,80],B=[1,84],V=[1,85],q=[1,86],G=[1,87],Q=[1,88],j=[1,89],ae=[1,90],Z=[1,91],J=[1,92],re=[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],ee=[63,64],me=[1,101],te=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],$e=[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],Oe=[1,110],He=[1,106],ue=[1,107],ce=[1,108],Te=[1,109],ge=[1,111],Ve=[1,116],we=[1,117],Ae=[1,114],Ue=[1,115],le={trace:w(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:w(function(fe,W,se,K,de,X,Fe){var ke=X.length-1;switch(de){case 4:this.$=X[ke].trim(),K.setAccTitle(this.$);break;case 5:case 6:this.$=X[ke].trim(),K.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:K.setDirection("TB");break;case 18:K.setDirection("BT");break;case 19:K.setDirection("RL");break;case 20:K.setDirection("LR");break;case 21:K.addRequirement(X[ke-3],X[ke-4]);break;case 22:K.addRequirement(X[ke-5],X[ke-6]),K.setClass([X[ke-5]],X[ke-3]);break;case 23:K.setNewReqId(X[ke-2]);break;case 24:K.setNewReqText(X[ke-2]);break;case 25:K.setNewReqRisk(X[ke-2]);break;case 26:K.setNewReqVerifyMethod(X[ke-2]);break;case 29:this.$=K.RequirementType.REQUIREMENT;break;case 30:this.$=K.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=K.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=K.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=K.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=K.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=K.RiskLevel.LOW_RISK;break;case 36:this.$=K.RiskLevel.MED_RISK;break;case 37:this.$=K.RiskLevel.HIGH_RISK;break;case 38:this.$=K.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=K.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=K.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=K.VerifyType.VERIFY_TEST;break;case 42:K.addElement(X[ke-3]);break;case 43:K.addElement(X[ke-5]),K.setClass([X[ke-5]],X[ke-3]);break;case 44:K.setNewElementType(X[ke-2]);break;case 45:K.setNewElementDocRef(X[ke-2]);break;case 48:K.addRelationship(X[ke-2],X[ke],X[ke-4]);break;case 49:K.addRelationship(X[ke-2],X[ke-4],X[ke]);break;case 50:this.$=K.Relationships.CONTAINS;break;case 51:this.$=K.Relationships.COPIES;break;case 52:this.$=K.Relationships.DERIVES;break;case 53:this.$=K.Relationships.SATISFIES;break;case 54:this.$=K.Relationships.VERIFIES;break;case 55:this.$=K.Relationships.REFINES;break;case 56:this.$=K.Relationships.TRACES;break;case 57:this.$=X[ke-2],K.defineClass(X[ke-1],X[ke]);break;case 58:K.setClass(X[ke-1],X[ke]);break;case 59:K.setClass([X[ke-2]],X[ke]);break;case 60:case 62:this.$=[X[ke]];break;case 61:case 63:this.$=X[ke-2].concat([X[ke]]);break;case 64:this.$=X[ke-2],K.setCssStyle(X[ke-1],X[ke]);break;case 65:this.$=[X[ke]];break;case 66:X[ke-2].push(X[ke]),this.$=X[ke-2];break;case 68:this.$=X[ke-1]+X[ke];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:x,72:b,74:T,77:k,89:S,90:C},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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:A,89:S,90:C},{30:63,33:62,75:A,89:S,90:C},{30:64,33:62,75:A,89:S,90:C},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:N,66:_,67:I,68:O,69:D,70:$,71:F},{62:77,65:N,66:_,67:I,68:O,69:D,70:$,71:F},{30:78,33:62,75:A,89:S,90:C},{73:79,75:z,76:H,78:81,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},t(re,[2,60]),t(re,[2,62]),{73:93,75:z,76:H,78:81,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},{30:94,33:62,75:A,76:H,89:S,90:C},{5:[1,95]},{30:96,33:62,75:A,89:S,90:C},{5:[1,97]},{30:98,33:62,75:A,89:S,90:C},{63:[1,99]},t(ee,[2,50]),t(ee,[2,51]),t(ee,[2,52]),t(ee,[2,53]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),{64:[1,100]},t(E,[2,59],{76:H}),t(E,[2,64],{76:me}),{33:103,75:[1,102],89:S,90:C},t(te,[2,65],{79:104,75:z,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J}),t($e,[2,67]),t($e,[2,69]),t($e,[2,70]),t($e,[2,71]),t($e,[2,72]),t($e,[2,73]),t($e,[2,74]),t($e,[2,75]),t($e,[2,76]),t($e,[2,77]),t($e,[2,78]),t(E,[2,57],{76:me}),t(E,[2,58],{76:H}),{5:Oe,28:105,31:He,34:ue,36:ce,38:Te,40:ge},{27:[1,112],76:H},{5:Ve,40:we,56:113,57:Ae,59:Ue},{27:[1,118],76:H},{33:119,89:S,90:C},{33:120,89:S,90:C},{75:z,78:121,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},t(re,[2,61]),t(re,[2,63]),t($e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Oe,28:126,31:He,34:ue,36:ce,38:Te,40:ge},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ve,40:we,56:130,57:Ae,59:Ue},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(te,[2,66],{79:104,75:z,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J}),{33:132,89:S,90:C},{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:Oe,28:145,31:He,34:ue,36:ce,38:Te,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:Ve,40:we,56:152,57:Ae,59:Ue},{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:Oe,28:159,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:160,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:161,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:162,31:He,34:ue,36:ce,38:Te,40:ge},{5:Ve,40:we,56:163,57:Ae,59:Ue},{5:Ve,40:we,56:164,57:Ae,59:Ue},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:w(function(fe,W){if(W.recoverable)this.trace(fe);else{var se=new Error(fe);throw se.hash=W,se}},"parseError"),parse:w(function(fe){var W=this,se=[0],K=[],de=[null],X=[],Fe=this.table,ke="",Ye=0,Ie=0,ze=2,De=1,Ke=X.slice.call(arguments,1),Be=Object.create(this.lexer),nt={yy:{}};for(var Le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Le)&&(nt.yy[Le]=this.yy[Le]);Be.setInput(fe,nt.yy),nt.yy.lexer=Be,nt.yy.parser=this,typeof Be.yylloc>"u"&&(Be.yylloc={});var pt=Be.yylloc;X.push(pt);var Me=Be.options&&Be.options.ranges;typeof nt.yy.parseError=="function"?this.parseError=nt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(_e){se.length=se.length-2*_e,de.length=de.length-_e,X.length=X.length-_e}w(Ct,"popStack");function wt(){var _e;return _e=K.pop()||Be.lex()||De,typeof _e!="number"&&(_e instanceof Array&&(K=_e,_e=K.pop()),_e=W.symbols_[_e]||_e),_e}w(wt,"lex");for(var ht,Bt,At,mt,ye={},Nt,yt,gt,St;;){if(Bt=se[se.length-1],this.defaultActions[Bt]?At=this.defaultActions[Bt]:((ht===null||typeof ht>"u")&&(ht=wt()),At=Fe[Bt]&&Fe[Bt][ht]),typeof At>"u"||!At.length||!At[0]){var tn="";St=[];for(Nt in Fe[Bt])this.terminals_[Nt]&&Nt>ze&&St.push("'"+this.terminals_[Nt]+"'");Be.showPosition?tn="Parse error on line "+(Ye+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var $=this.next();return $||this.lex()},"lex"),begin:w(function($){this.conditionStack.push($)},"begin"),popState:w(function(){var $=this.conditionStack.length-1;return $>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function($){return $=this.conditionStack.length-1-Math.abs($||0),$>=0?this.conditionStack[$]:"INITIAL"},"topState"),pushState:w(function($){this.begin($)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function($,F,z,H){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 O})();N.lexer=_;function I(){this.yy={}}return w(I,"Parser"),I.prototype=N,N.Parser=I,new I})();Tj.parser=Tj;var Ncr=Tj;function kj(t){return t.type==="bar"}w(kj,"isBarPlot");function qI(t){return t.type==="band"}w(qI,"isBandAxisData");function Rb(t){return t.type==="linear"}w(Rb,"isLinearAxisData");var Gw,hqe=(Gw=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=j3e(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}},w(Gw,"TextDimensionCalculatorWithFont"),Gw),z1e=.7,H1e=.2,Uw,dqe=(Uw=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(){z1e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(z1e*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=H1e*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=H1e*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():[]}},w(Uw,"BaseAxis"),Uw),Yw,Dcr=(Yw=class extends dqe{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=JV().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=JV().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),he.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},w(Yw,"BandAxis"),Yw),jw,Ocr=(jw=class extends dqe{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=AT().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=AT().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(jw,"LinearAxis"),jw);function Cj(t,e,r,n){const i=new hqe(n);return qI(t)?new Dcr(e,r,t.categories,t.title,i):new Ocr(e,r,[t.min,t.max],t.title,i)}w(Cj,"getAxis");var Xw,Pcr=(Xw=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}},w(Xw,"ChartTitle"),Xw);function fqe(t,e,r,n){const i=new hqe(n);return new Pcr(i,t,e,r)}w(fqe,"getChartTitleComponent");var Kw,Bcr=(Kw=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=AS().y(i=>i[0]).x(i=>i[1])(e):r=AS().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}},w(Kw,"LinePlot"),Kw),Zw,Fcr=(Zw=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}))}]}},w(Zw,"BarPlot"),Zw),Qw,zcr=(Qw=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 Bcr(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Fcr(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(Qw,"BasePlot"),Qw);function pqe(t,e,r){return new zcr(t,e,r)}w(pqe,"getPlotComponent");var Jw,Hcr=(Jw=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:fqe(e,r,n,i),plot:pqe(e,r,n),xAxis:Cj(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:Cj(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=>kj(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=>kj(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}},w(Jw,"Orchestrator"),Jw),eT,Vcr=(eT=class{static build(e,r,n,i){return new Hcr(e,r,n,i).getDrawableElement()}},w(eT,"XYChartBuilder"),eT),W6=0,gqe,q6=Fne(),G6=Bne(),Bn=zne(),Sj=G6.plotColorPalette.split(",").map(t=>t.trim()),AO=!1,Pne=!1;function Bne(){const t=l0(),e=pr();return Gi(t.xyChart,e.themeVariables.xyChart)}w(Bne,"getChartDefaultThemeConfig");function Fne(){const t=pr();return Gi(xn.xyChart,t.xyChart)}w(Fne,"getChartDefaultConfig");function zne(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(zne,"getChartDefaultData");function w7(t){const e=pr();return Tn(t.trim(),e)}w(w7,"textSanitizer");function mqe(t){gqe=t}w(mqe,"setTmpSVGG");function yqe(t){t==="horizontal"?q6.chartOrientation="horizontal":q6.chartOrientation="vertical"}w(yqe,"setOrientation");function vqe(t){Bn.xAxis.title=w7(t.text)}w(vqe,"setXAxisTitle");function Hne(t,e){Bn.xAxis={type:"linear",title:Bn.xAxis.title,min:t,max:e},AO=!0}w(Hne,"setXAxisRangeData");function bqe(t){Bn.xAxis={type:"band",title:Bn.xAxis.title,categories:t.map(e=>w7(e.text))},AO=!0}w(bqe,"setXAxisBand");function xqe(t){Bn.yAxis.title=w7(t.text)}w(xqe,"setYAxisTitle");function wqe(t,e){Bn.yAxis={type:"linear",title:Bn.yAxis.title,min:t,max:e},Pne=!0}w(wqe,"setYAxisRangeData");function Tqe(t){const e=Math.min(...t),r=Math.max(...t),n=Rb(Bn.yAxis)?Bn.yAxis.min:1/0,i=Rb(Bn.yAxis)?Bn.yAxis.max:-1/0;Bn.yAxis={type:"linear",title:Bn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}w(Tqe,"setYAxisRangeFromPlotData");function Vne(t){let e=[];if(t.length===0)return e;if(!AO){const r=Rb(Bn.xAxis)?Bn.xAxis.min:1/0,n=Rb(Bn.xAxis)?Bn.xAxis.max:-1/0;Hne(Math.min(r,1),Math.max(n,t.length))}if(qI(Bn.xAxis)&&t.length>Bn.xAxis.categories.length&&(t=t.slice(0,Bn.xAxis.categories.length)),Pne||Tqe(t),qI(Bn.xAxis)&&(e=Bn.xAxis.categories.map((r,n)=>[r,t[n]])),Rb(Bn.xAxis)){const r=Bn.xAxis.min,n=Bn.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}w(Vne,"transformDataWithoutCategory");function Wne(t){return Sj[t===0?0:t%Sj.length]}w(Wne,"getPlotColorFromPalette");function kqe(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?w7(s.label):""),i=Vne(r),a=n.some(s=>s!=="");Bn.plots.push({type:"line",strokeFill:Wne(W6),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),W6++}w(kqe,"setLineData");function Cqe(t,e){const r=e.map(i=>i.value),n=Vne(r);Bn.plots.push({type:"bar",fill:Wne(W6),data:n}),W6++}w(Cqe,"setBarData");function Sqe(){if(Bn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Bn.title=Di(),Vcr.build(q6,Bn,G6,gqe)}w(Sqe,"getDrawableElem");function Eqe(){return G6}w(Eqe,"getChartThemeConfig");function Aqe(){return q6}w(Aqe,"getChartConfig");function Rqe(){return Bn}w(Rqe,"getXYChartData");var Wcr=w(function(){wi(),W6=0,q6=Fne(),Bn=zne(),G6=Bne(),Sj=G6.plotColorPalette.split(",").map(t=>t.trim()),AO=!1,Pne=!1},"clear"),qcr={getDrawableElem:Sqe,clear:Wcr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji,setOrientation:yqe,setXAxisTitle:vqe,setXAxisRangeData:Hne,setXAxisBand:bqe,setYAxisTitle:xqe,setYAxisRangeData:wqe,setLineData:kqe,setBarData:Cqe,setTmpSVGG:mqe,getChartThemeConfig:Eqe,getChartConfig:Aqe,getXYChartData:Rqe},Gcr=w((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"}w(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}w(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}w(h,"getTextTransformation"),he.debug(`Rendering xychart chart +`+t);const d=Po(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");_a(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 x=f,b="";for(const[T]of v.entries()){let k=f;T>0&&m[b]&&(k=m[b]),b+=v[T],x=m[b],x||(x=m[b]=k.append("g").attr("class",v[T]))}return x}w(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const x=y(v.groupTexts);switch(v.type){case"rect":if(x.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 T=function(L,P){const{data:N,label:_}=L;return P*_.length*k<=N.width-S};w(T,"fitsHorizontally");const k=.7,S=10,C=v.data.map((L,P)=>({data:L,label:o[P].toString()})).filter(L=>L.data.width>0&&L.data.height>0),E=C.map(L=>{const{data:P}=L;let N=P.height*.7;for(;!T(L,N)&&N>0;)N-=1;return N}),A=Math.floor(Math.min(...E)),M=w(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");x.selectAll("text").data(C).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",`${A}px`).text(L=>L.label)}else{let T=function(M,L,P){const{data:N,label:_}=M,O=L*_.length*.7,D=N.x+N.width/2,$=D-O/2,F=D+O/2,z=$>=N.x&&F<=N.x+N.width,H=N.y+P+L<=N.y+N.height;return z&&H};w(T,"fitsInBar");const k=10,S=v.data.map((M,L)=>({data:M,label:o[L].toString()})).filter(M=>M.data.width>0&&M.data.height>0),C=S.map(M=>{const{data:L,label:P}=M;let N=L.width/(P.length*.7);for(;!T(M,N,k)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...C)),A=w(M=>b?M.data.y-k:M.data.y+k,"determineLabelYPosition");x.selectAll("text").data(S).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",A).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":x.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":x.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"),Ucr={draw:Gcr},Ycr={parser:Ncr,db:qcr,renderer:Ucr};const jcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ycr},Symbol.toStringTag,{value:"Module"}));var Ej=(function(){var t=w(function(oe,fe,W,se){for(W=W||{},se=oe.length;se--;W[oe[se]]=fe);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],x=[1,24],b=[1,31],T=[1,32],k=[1,30],S=[1,39],C=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[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],N=[1,70],_=[1,71],I=[1,72],O=[1,73],D=[1,74],$=[1,75],F=[1,76],z=[1,83],H=[1,80],B=[1,84],V=[1,85],q=[1,86],G=[1,87],Q=[1,88],j=[1,89],ae=[1,90],Z=[1,91],J=[1,92],re=[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],ee=[63,64],me=[1,101],te=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],$e=[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],Oe=[1,110],He=[1,106],ue=[1,107],ce=[1,108],Te=[1,109],ge=[1,111],Ve=[1,116],we=[1,117],Ae=[1,114],Ue=[1,115],le={trace:w(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:w(function(fe,W,se,K,de,X,Fe){var ke=X.length-1;switch(de){case 4:this.$=X[ke].trim(),K.setAccTitle(this.$);break;case 5:case 6:this.$=X[ke].trim(),K.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:K.setDirection("TB");break;case 18:K.setDirection("BT");break;case 19:K.setDirection("RL");break;case 20:K.setDirection("LR");break;case 21:K.addRequirement(X[ke-3],X[ke-4]);break;case 22:K.addRequirement(X[ke-5],X[ke-6]),K.setClass([X[ke-5]],X[ke-3]);break;case 23:K.setNewReqId(X[ke-2]);break;case 24:K.setNewReqText(X[ke-2]);break;case 25:K.setNewReqRisk(X[ke-2]);break;case 26:K.setNewReqVerifyMethod(X[ke-2]);break;case 29:this.$=K.RequirementType.REQUIREMENT;break;case 30:this.$=K.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=K.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=K.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=K.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=K.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=K.RiskLevel.LOW_RISK;break;case 36:this.$=K.RiskLevel.MED_RISK;break;case 37:this.$=K.RiskLevel.HIGH_RISK;break;case 38:this.$=K.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=K.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=K.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=K.VerifyType.VERIFY_TEST;break;case 42:K.addElement(X[ke-3]);break;case 43:K.addElement(X[ke-5]),K.setClass([X[ke-5]],X[ke-3]);break;case 44:K.setNewElementType(X[ke-2]);break;case 45:K.setNewElementDocRef(X[ke-2]);break;case 48:K.addRelationship(X[ke-2],X[ke],X[ke-4]);break;case 49:K.addRelationship(X[ke-2],X[ke-4],X[ke]);break;case 50:this.$=K.Relationships.CONTAINS;break;case 51:this.$=K.Relationships.COPIES;break;case 52:this.$=K.Relationships.DERIVES;break;case 53:this.$=K.Relationships.SATISFIES;break;case 54:this.$=K.Relationships.VERIFIES;break;case 55:this.$=K.Relationships.REFINES;break;case 56:this.$=K.Relationships.TRACES;break;case 57:this.$=X[ke-2],K.defineClass(X[ke-1],X[ke]);break;case 58:K.setClass(X[ke-1],X[ke]);break;case 59:K.setClass([X[ke-2]],X[ke]);break;case 60:case 62:this.$=[X[ke]];break;case 61:case 63:this.$=X[ke-2].concat([X[ke]]);break;case 64:this.$=X[ke-2],K.setCssStyle(X[ke-1],X[ke]);break;case 65:this.$=[X[ke]];break;case 66:X[ke-2].push(X[ke]),this.$=X[ke-2];break;case 68:this.$=X[ke-1]+X[ke];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:x,72:b,74:T,77:k,89:S,90:C},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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:x,72:b,74:T,77:k,89:S,90:C},{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:A,89:S,90:C},{30:63,33:62,75:A,89:S,90:C},{30:64,33:62,75:A,89:S,90:C},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:N,66:_,67:I,68:O,69:D,70:$,71:F},{62:77,65:N,66:_,67:I,68:O,69:D,70:$,71:F},{30:78,33:62,75:A,89:S,90:C},{73:79,75:z,76:H,78:81,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},t(re,[2,60]),t(re,[2,62]),{73:93,75:z,76:H,78:81,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},{30:94,33:62,75:A,76:H,89:S,90:C},{5:[1,95]},{30:96,33:62,75:A,89:S,90:C},{5:[1,97]},{30:98,33:62,75:A,89:S,90:C},{63:[1,99]},t(ee,[2,50]),t(ee,[2,51]),t(ee,[2,52]),t(ee,[2,53]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),{64:[1,100]},t(E,[2,59],{76:H}),t(E,[2,64],{76:me}),{33:103,75:[1,102],89:S,90:C},t(te,[2,65],{79:104,75:z,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J}),t($e,[2,67]),t($e,[2,69]),t($e,[2,70]),t($e,[2,71]),t($e,[2,72]),t($e,[2,73]),t($e,[2,74]),t($e,[2,75]),t($e,[2,76]),t($e,[2,77]),t($e,[2,78]),t(E,[2,57],{76:me}),t(E,[2,58],{76:H}),{5:Oe,28:105,31:He,34:ue,36:ce,38:Te,40:ge},{27:[1,112],76:H},{5:Ve,40:we,56:113,57:Ae,59:Ue},{27:[1,118],76:H},{33:119,89:S,90:C},{33:120,89:S,90:C},{75:z,78:121,79:82,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J},t(re,[2,61]),t(re,[2,63]),t($e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Oe,28:126,31:He,34:ue,36:ce,38:Te,40:ge},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ve,40:we,56:130,57:Ae,59:Ue},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(te,[2,66],{79:104,75:z,80:B,81:V,82:q,83:G,84:Q,85:j,86:ae,87:Z,88:J}),{33:132,89:S,90:C},{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:Oe,28:145,31:He,34:ue,36:ce,38:Te,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:Ve,40:we,56:152,57:Ae,59:Ue},{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:Oe,28:159,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:160,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:161,31:He,34:ue,36:ce,38:Te,40:ge},{5:Oe,28:162,31:He,34:ue,36:ce,38:Te,40:ge},{5:Ve,40:we,56:163,57:Ae,59:Ue},{5:Ve,40:we,56:164,57:Ae,59:Ue},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:w(function(fe,W){if(W.recoverable)this.trace(fe);else{var se=new Error(fe);throw se.hash=W,se}},"parseError"),parse:w(function(fe){var W=this,se=[0],K=[],de=[null],X=[],Fe=this.table,ke="",Ye=0,Ie=0,ze=2,De=1,Ke=X.slice.call(arguments,1),Be=Object.create(this.lexer),nt={yy:{}};for(var Le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Le)&&(nt.yy[Le]=this.yy[Le]);Be.setInput(fe,nt.yy),nt.yy.lexer=Be,nt.yy.parser=this,typeof Be.yylloc>"u"&&(Be.yylloc={});var pt=Be.yylloc;X.push(pt);var Me=Be.options&&Be.options.ranges;typeof nt.yy.parseError=="function"?this.parseError=nt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(_e){se.length=se.length-2*_e,de.length=de.length-_e,X.length=X.length-_e}w(Ct,"popStack");function wt(){var _e;return _e=K.pop()||Be.lex()||De,typeof _e!="number"&&(_e instanceof Array&&(K=_e,_e=K.pop()),_e=W.symbols_[_e]||_e),_e}w(wt,"lex");for(var ht,Bt,At,mt,ye={},Nt,yt,gt,St;;){if(Bt=se[se.length-1],this.defaultActions[Bt]?At=this.defaultActions[Bt]:((ht===null||typeof ht>"u")&&(ht=wt()),At=Fe[Bt]&&Fe[Bt][ht]),typeof At>"u"||!At.length||!At[0]){var tn="";St=[];for(Nt in Fe[Bt])this.terminals_[Nt]&&Nt>ze&&St.push("'"+this.terminals_[Nt]+"'");Be.showPosition?tn="Parse error on line "+(Ye+1)+`: `+Be.showPosition()+` Expecting `+St.join(", ")+", got '"+(this.terminals_[ht]||ht)+"'":tn="Parse error on line "+(Ye+1)+": Unexpected "+(ht==De?"end of input":"'"+(this.terminals_[ht]||ht)+"'"),this.parseError(tn,{text:Be.match,token:this.terminals_[ht]||ht,line:Be.yylineno,loc:pt,expected:St})}if(At[0]instanceof Array&&At.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Bt+", token: "+ht);switch(At[0]){case 1:se.push(ht),de.push(Be.yytext),X.push(Be.yylloc),se.push(At[1]),ht=null,Ie=Be.yyleng,ke=Be.yytext,Ye=Be.yylineno,pt=Be.yylloc;break;case 2:if(yt=this.productions_[At[1]][1],ye.$=de[de.length-yt],ye._$={first_line:X[X.length-(yt||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(yt||1)].first_column,last_column:X[X.length-1].last_column},Me&&(ye._$.range=[X[X.length-(yt||1)].range[0],X[X.length-1].range[1]]),mt=this.performAction.apply(ye,[ke,Ie,Ye,nt.yy,At[1],de,X].concat(Ke)),typeof mt<"u")return mt;yt&&(se=se.slice(0,-1*yt*2),de=de.slice(0,-1*yt),X=X.slice(0,-1*yt)),se.push(this.productions_[At[1]][0]),de.push(ye.$),X.push(ye._$),gt=Fe[se[se.length-2]][se[se.length-1]],se.push(gt);break;case 3:return!0}}return!0},"parse")},pe=(function(){var oe={EOF:1,parseError:w(function(W,se){if(this.yy.parser)this.yy.parser.parseError(W,se);else throw new Error(W)},"parseError"),setInput:w(function(fe,W){return this.yy=W||this.yy||{},this._input=fe,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:w(function(){var fe=this._input[0];this.yytext+=fe,this.yyleng++,this.offset++,this.match+=fe,this.matched+=fe;var W=fe.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),fe},"input"),unput:w(function(fe){var W=fe.length,se=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;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),se.length-1&&(this.yylineno-=se.length-1);var de=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===K.length?this.yylloc.first_column:0)+K[K.length-se.length].length-se[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[de[0],de[0]+this.yyleng-W]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(fe){this.unput(this.match.slice(fe))},"less"),pastInput:w(function(){var fe=this.matched.substr(0,this.matched.length-this.match.length);return(fe.length>20?"...":"")+fe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var fe=this.match;return fe.length<20&&(fe+=this._input.substr(0,20-fe.length)),(fe.substr(0,20)+(fe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var fe=this.pastInput(),W=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+` `+W+"^"},"showPosition"),test_match:w(function(fe,W){var se,K,de;if(this.options.backtrack_lexer&&(de={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&&(de.yylloc.range=this.yylloc.range.slice(0))),K=fe[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+fe[0].length},this.yytext+=fe[0],this.match+=fe[0],this.matches=fe,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(fe[0].length),this.matched+=fe[0],se=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var X in de)this[X]=de[X];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,W,se,K;this._more||(this.yytext="",this.match="");for(var de=this._currentRules(),X=0;XW[0].length)){if(W=se,K=X,this.options.backtrack_lexer){if(fe=this.test_match(se,de[X]),fe!==!1)return fe;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(fe=this.test_match(W,de[K]),fe!==!1?fe:!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:w(function(){var W=this.next();return W||this.lex()},"lex"),begin:w(function(W){this.conditionStack.push(W)},"begin"),popState:w(function(){var W=this.conditionStack.length-1;return W>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:w(function(W){this.begin(W)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(W,se,K,de){switch(K){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 se.yytext=se.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 oe})();le.lexer=pe;function Ce(){this.yy={}}return w(Ce,"Parser"),Ce.prototype=le,le.Parser=Ce,new Ce})();Cj.parser=Cj;var Wcr=Cj,tT,qcr=(tT=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=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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"]}),he.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,wi()}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=We(),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()}}},w(tT,"RequirementDB"),tT),Gcr=w(t=>{const e=pr(),{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:w(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:w(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:w(function(W){this.begin(W)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(W,se,K,de){switch(K){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 se.yytext=se.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 oe})();le.lexer=pe;function Ce(){this.yy={}}return w(Ce,"Parser"),Ce.prototype=le,le.Parser=Ce,new Ce})();Ej.parser=Ej;var Xcr=Ej,tT,Kcr=(tT=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=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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"]}),he.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,wi()}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=We(),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()}}},w(tT,"RequirementDB"),tT),Zcr=w(t=>{const e=pr(),{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=pr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${Gcr(t)} + `;return s},"genColor"),Qcr=w(t=>{const e=pr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${Zcr(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -3219,16 +3232,16 @@ Expecting `+St.join(", ")+", got '"+(this.terminals_[ht]||ht)+"'":tn="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Ycr=Ucr,Eqe={};g$(Eqe,{draw:()=>jcr});var jcr=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=We(),l=n.db.getData(),u=Q3(e,i);l.type=n.type,l.layoutAlgorithm=vE(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 I3(l,u);const h=8;Vr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Xcr={parser:Wcr,get db(){return new qcr},renderer:Eqe,styles:Ycr};const Kcr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xcr},Symbol.toStringTag,{value:"Module"}));var Sj=(function(){var t=w(function(Ie,ze,De,Ke){for(De=De||{},Ke=Ie.length;Ke--;De[Ie[Ke]]=ze);return De},"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],x=[1,30],b=[1,31],T=[1,32],k=[1,33],S=[1,34],C=[1,35],E=[1,36],A=[1,37],M=[1,38],L=[1,39],P=[1,40],N=[1,42],_=[1,43],I=[1,44],O=[1,45],D=[1,46],$=[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],H=[1,80],B=[1,81],V=[1,82],q=[1,83],G=[1,84],Q=[1,85],j=[1,86],ae=[1,87],Z=[1,88],J=[1,89],re=[1,90],ee=[1,91],me=[1,92],te=[1,93],$e=[1,94],Oe=[1,95],He=[1,96],ue=[1,97],ce=[1,98],Te=[1,99],ge=[1,100],Ve=[1,101],we=[1,102],Ae=[1,103],Ue=[1,104],le=[1,105],pe=[2,78],Ce=[4,5,17,51,53,54],oe=[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],fe=[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],se=[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],K=[5,52],de=[70,71,72,73],X=[1,151],Fe={trace:w(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:w(function(ze,De,Ke,Be,nt,Le,pt){var Me=Le.length-1;switch(nt){case 3:return Be.apply(Le[Me]),Le[Me];case 4:case 10:this.$=[];break;case 5:case 11:Le[Me-1].push(Le[Me]),this.$=Le[Me-1];break;case 6:case 7:case 12:case 13:this.$=Le[Me];break;case 8:case 9:case 14:this.$=[];break;case 16:Le[Me].type="createParticipant",this.$=Le[Me];break;case 17:Le[Me-1].unshift({type:"boxStart",boxData:Be.parseBoxData(Le[Me-2])}),Le[Me-1].push({type:"boxEnd",boxText:Le[Me-2]}),this.$=Le[Me-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Le[Me-2]),sequenceIndexStep:Number(Le[Me-1]),sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Le[Me-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Be.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Be.LINETYPE.ACTIVE_START,actor:Le[Me-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Be.LINETYPE.ACTIVE_END,actor:Le[Me-1].actor};break;case 30:Be.setDiagramTitle(Le[Me].substring(6)),this.$=Le[Me].substring(6);break;case 31:Be.setDiagramTitle(Le[Me].substring(7)),this.$=Le[Me].substring(7);break;case 32:this.$=Le[Me].trim(),Be.setAccTitle(this.$);break;case 33:case 34:this.$=Le[Me].trim(),Be.setAccDescription(this.$);break;case 35:Le[Me-1].unshift({type:"loopStart",loopText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.LOOP_START}),Le[Me-1].push({type:"loopEnd",loopText:Le[Me-2],signalType:Be.LINETYPE.LOOP_END}),this.$=Le[Me-1];break;case 36:Le[Me-1].unshift({type:"rectStart",color:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.RECT_START}),Le[Me-1].push({type:"rectEnd",color:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.RECT_END}),this.$=Le[Me-1];break;case 37:Le[Me-1].unshift({type:"optStart",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.OPT_START}),Le[Me-1].push({type:"optEnd",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.OPT_END}),this.$=Le[Me-1];break;case 38:Le[Me-1].unshift({type:"altStart",altText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.ALT_START}),Le[Me-1].push({type:"altEnd",signalType:Be.LINETYPE.ALT_END}),this.$=Le[Me-1];break;case 39:Le[Me-1].unshift({type:"parStart",parText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.PAR_START}),Le[Me-1].push({type:"parEnd",signalType:Be.LINETYPE.PAR_END}),this.$=Le[Me-1];break;case 40:Le[Me-1].unshift({type:"parStart",parText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.PAR_OVER_START}),Le[Me-1].push({type:"parEnd",signalType:Be.LINETYPE.PAR_END}),this.$=Le[Me-1];break;case 41:Le[Me-1].unshift({type:"criticalStart",criticalText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.CRITICAL_START}),Le[Me-1].push({type:"criticalEnd",signalType:Be.LINETYPE.CRITICAL_END}),this.$=Le[Me-1];break;case 42:Le[Me-1].unshift({type:"breakStart",breakText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.BREAK_START}),Le[Me-1].push({type:"breakEnd",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.BREAK_END}),this.$=Le[Me-1];break;case 44:this.$=Le[Me-3].concat([{type:"option",optionText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.CRITICAL_OPTION},Le[Me]]);break;case 46:this.$=Le[Me-3].concat([{type:"and",parText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.PAR_AND},Le[Me]]);break;case 48:this.$=Le[Me-3].concat([{type:"else",altText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.ALT_ELSE},Le[Me]]);break;case 49:Le[Me-3].draw="participant",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 50:Le[Me-1].draw="participant",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 51:Le[Me-3].draw="actor",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 52:case 57:Le[Me-1].draw="actor",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 53:Le[Me-1].type="destroyParticipant",this.$=Le[Me-1];break;case 54:Le[Me-3].draw="participant",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 55:Le[Me-1].draw="participant",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 56:Le[Me-3].draw="actor",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 58:this.$=[Le[Me-1],{type:"addNote",placement:Le[Me-2],actor:Le[Me-1].actor,text:Le[Me]}];break;case 59:Le[Me-2]=[].concat(Le[Me-1],Le[Me-1]).slice(0,2),Le[Me-2][0]=Le[Me-2][0].actor,Le[Me-2][1]=Le[Me-2][1].actor,this.$=[Le[Me-1],{type:"addNote",placement:Be.PLACEMENT.OVER,actor:Le[Me-2].slice(0,2),text:Le[Me]}];break;case 60:this.$=[Le[Me-1],{type:"addLinks",actor:Le[Me-1].actor,text:Le[Me]}];break;case 61:this.$=[Le[Me-1],{type:"addALink",actor:Le[Me-1].actor,text:Le[Me]}];break;case 62:this.$=[Le[Me-1],{type:"addProperties",actor:Le[Me-1].actor,text:Le[Me]}];break;case 63:this.$=[Le[Me-1],{type:"addDetails",actor:Le[Me-1].actor,text:Le[Me]}];break;case 66:this.$=[Le[Me-2],Le[Me]];break;case 67:this.$=Le[Me];break;case 68:this.$=Be.PLACEMENT.LEFTOF;break;case 69:this.$=Be.PLACEMENT.RIGHTOF;break;case 70:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0},{type:"activeStart",signalType:Be.LINETYPE.ACTIVE_START,actor:Le[Me-1].actor}];break;case 71:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me]},{type:"activeEnd",signalType:Be.LINETYPE.ACTIVE_END,actor:Le[Me-4].actor}];break;case 72:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Be.LINETYPE.CENTRAL_CONNECTION,actor:Le[Me-1].actor}];break;case 73:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-2],msg:Le[Me],activate:!1,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Le[Me-4].actor}];break;case 74:this.$=[Le[Me-5],Le[Me-1],{type:"addMessage",from:Le[Me-5].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Be.LINETYPE.CENTRAL_CONNECTION,actor:Le[Me-1].actor},{type:"centralConnectionReverse",signalType:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Le[Me-5].actor}];break;case 75:this.$=[Le[Me-3],Le[Me-1],{type:"addMessage",from:Le[Me-3].actor,to:Le[Me-1].actor,signalType:Le[Me-2],msg:Le[Me]}];break;case 76:this.$={type:"addParticipant",actor:Le[Me-1],config:Le[Me]};break;case 77:this.$=Le[Me-1].trim();break;case 78:this.$={type:"addParticipant",actor:Le[Me]};break;case 79:this.$=Be.LINETYPE.SOLID_OPEN;break;case 80:this.$=Be.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Be.LINETYPE.SOLID;break;case 82:this.$=Be.LINETYPE.SOLID_TOP;break;case 83:this.$=Be.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Be.LINETYPE.STICK_TOP;break;case 85:this.$=Be.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Be.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Be.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Be.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Be.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Be.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Be.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Be.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Be.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Be.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Be.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Be.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Be.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Be.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Be.LINETYPE.DOTTED;break;case 100:this.$=Be.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Be.LINETYPE.SOLID_CROSS;break;case 102:this.$=Be.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Be.LINETYPE.SOLID_POINT;break;case 104:this.$=Be.LINETYPE.DOTTED_POINT;break;case 105:this.$=Be.parseMessage(Le[Me].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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},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:$},{23:56,73:$},{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:$},{69:78,72:[1,79],78:H,79:B,80:V,81:q,82:G,83:Q,84:j,85:ae,86:Z,87:J,88:re,89:ee,90:me,91:te,92:$e,93:Oe,94:He,95:ue,96:ce,97:Te,98:ge,99:Ve,100:we,101:Ae,102:Ue,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:$},{23:111,73:$},{23:112,73:$},{23:113,73:$},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],pe),t(F,[2,6]),t(F,[2,16]),t(Ce,[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(oe,i,{7:120}),t(oe,i,{7:121}),t(oe,i,{7:122}),t(fe,i,{41:123,7:124}),t(W,i,{43:125,7:126}),t(W,i,{7:126,43:127}),t(se,i,{46:128,7:129}),t(oe,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(K,pe,{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:$},{69:146,78:H,79:B,80:V,81:q,82:G,83:Q,84:j,85:ae,86:Z,87:J,88:re,89:ee,90:me,91:te,92:$e,93:Oe,94:He,95:ue,96:ce,97:Te,98:ge,99:Ve,100:we,101:Ae,102:Ue,103:le},t(de,[2,79]),t(de,[2,80]),t(de,[2,81]),t(de,[2,82]),t(de,[2,83]),t(de,[2,84]),t(de,[2,85]),t(de,[2,86]),t(de,[2,87]),t(de,[2,88]),t(de,[2,89]),t(de,[2,90]),t(de,[2,91]),t(de,[2,92]),t(de,[2,93]),t(de,[2,94]),t(de,[2,95]),t(de,[2,96]),t(de,[2,97]),t(de,[2,98]),t(de,[2,99]),t(de,[2,100]),t(de,[2,101]),t(de,[2,102]),t(de,[2,103]),t(de,[2,104]),{23:147,73:$},{23:149,60:148,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,50:[1,165],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,49:[1,167],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,48:[1,170],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(K,[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:$},{23:178,73:$},{23:179,73:$},{58:180,104:X},{23:181,72:[1,182],73:$},{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(Ce,[2,11]),{13:186,51:M,53:L,54:P},t(Ce,[2,13]),t(Ce,[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:$},{5:[2,58]},{5:[2,59]},{23:200,73:$},t(Ce,[2,12]),t(fe,i,{7:124,41:201}),t(W,i,{7:126,43:202}),t(se,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(K,[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:w(function(ze,De){if(De.recoverable)this.trace(ze);else{var Ke=new Error(ze);throw Ke.hash=De,Ke}},"parseError"),parse:w(function(ze){var De=this,Ke=[0],Be=[],nt=[null],Le=[],pt=this.table,Me="",Ct=0,wt=0,ht=2,Bt=1,At=Le.slice.call(arguments,1),mt=Object.create(this.lexer),ye={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(ye.yy[Nt]=this.yy[Nt]);mt.setInput(ze,ye.yy),ye.yy.lexer=mt,ye.yy.parser=this,typeof mt.yylloc>"u"&&(mt.yylloc={});var yt=mt.yylloc;Le.push(yt);var gt=mt.options&&mt.options.ranges;typeof ye.yy.parseError=="function"?this.parseError=ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(mr){Ke.length=Ke.length-2*mr,nt.length=nt.length-mr,Le.length=Le.length-mr}w(St,"popStack");function tn(){var mr;return mr=Be.pop()||mt.lex()||Bt,typeof mr!="number"&&(mr instanceof Array&&(Be=mr,mr=Be.pop()),mr=De.symbols_[mr]||mr),mr}w(tn,"lex");for(var _e,Je,ut,Dt,Kt={},Sr,yr,qr,Tr;;){if(Je=Ke[Ke.length-1],this.defaultActions[Je]?ut=this.defaultActions[Je]:((_e===null||typeof _e>"u")&&(_e=tn()),ut=pt[Je]&&pt[Je][_e]),typeof ut>"u"||!ut.length||!ut[0]){var rn="";Tr=[];for(Sr in pt[Je])this.terminals_[Sr]&&Sr>ht&&Tr.push("'"+this.terminals_[Sr]+"'");mt.showPosition?rn="Parse error on line "+(Ct+1)+`: +`},"getStyles"),Jcr=Qcr,_qe={};y$(_qe,{draw:()=>eur});var eur=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=We(),l=n.db.getData(),u=Q3(e,i);l.type=n.type,l.layoutAlgorithm=bE(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 I3(l,u);const h=8;Vr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),tur={parser:Xcr,get db(){return new Kcr},renderer:_qe,styles:Jcr};const rur=Object.freeze(Object.defineProperty({__proto__:null,diagram:tur},Symbol.toStringTag,{value:"Module"}));var Aj=(function(){var t=w(function(Ie,ze,De,Ke){for(De=De||{},Ke=Ie.length;Ke--;De[Ie[Ke]]=ze);return De},"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],x=[1,30],b=[1,31],T=[1,32],k=[1,33],S=[1,34],C=[1,35],E=[1,36],A=[1,37],M=[1,38],L=[1,39],P=[1,40],N=[1,42],_=[1,43],I=[1,44],O=[1,45],D=[1,46],$=[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],H=[1,80],B=[1,81],V=[1,82],q=[1,83],G=[1,84],Q=[1,85],j=[1,86],ae=[1,87],Z=[1,88],J=[1,89],re=[1,90],ee=[1,91],me=[1,92],te=[1,93],$e=[1,94],Oe=[1,95],He=[1,96],ue=[1,97],ce=[1,98],Te=[1,99],ge=[1,100],Ve=[1,101],we=[1,102],Ae=[1,103],Ue=[1,104],le=[1,105],pe=[2,78],Ce=[4,5,17,51,53,54],oe=[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],fe=[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],se=[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],K=[5,52],de=[70,71,72,73],X=[1,151],Fe={trace:w(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:w(function(ze,De,Ke,Be,nt,Le,pt){var Me=Le.length-1;switch(nt){case 3:return Be.apply(Le[Me]),Le[Me];case 4:case 10:this.$=[];break;case 5:case 11:Le[Me-1].push(Le[Me]),this.$=Le[Me-1];break;case 6:case 7:case 12:case 13:this.$=Le[Me];break;case 8:case 9:case 14:this.$=[];break;case 16:Le[Me].type="createParticipant",this.$=Le[Me];break;case 17:Le[Me-1].unshift({type:"boxStart",boxData:Be.parseBoxData(Le[Me-2])}),Le[Me-1].push({type:"boxEnd",boxText:Le[Me-2]}),this.$=Le[Me-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Le[Me-2]),sequenceIndexStep:Number(Le[Me-1]),sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Le[Me-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Be.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Be.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Be.LINETYPE.ACTIVE_START,actor:Le[Me-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Be.LINETYPE.ACTIVE_END,actor:Le[Me-1].actor};break;case 30:Be.setDiagramTitle(Le[Me].substring(6)),this.$=Le[Me].substring(6);break;case 31:Be.setDiagramTitle(Le[Me].substring(7)),this.$=Le[Me].substring(7);break;case 32:this.$=Le[Me].trim(),Be.setAccTitle(this.$);break;case 33:case 34:this.$=Le[Me].trim(),Be.setAccDescription(this.$);break;case 35:Le[Me-1].unshift({type:"loopStart",loopText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.LOOP_START}),Le[Me-1].push({type:"loopEnd",loopText:Le[Me-2],signalType:Be.LINETYPE.LOOP_END}),this.$=Le[Me-1];break;case 36:Le[Me-1].unshift({type:"rectStart",color:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.RECT_START}),Le[Me-1].push({type:"rectEnd",color:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.RECT_END}),this.$=Le[Me-1];break;case 37:Le[Me-1].unshift({type:"optStart",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.OPT_START}),Le[Me-1].push({type:"optEnd",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.OPT_END}),this.$=Le[Me-1];break;case 38:Le[Me-1].unshift({type:"altStart",altText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.ALT_START}),Le[Me-1].push({type:"altEnd",signalType:Be.LINETYPE.ALT_END}),this.$=Le[Me-1];break;case 39:Le[Me-1].unshift({type:"parStart",parText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.PAR_START}),Le[Me-1].push({type:"parEnd",signalType:Be.LINETYPE.PAR_END}),this.$=Le[Me-1];break;case 40:Le[Me-1].unshift({type:"parStart",parText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.PAR_OVER_START}),Le[Me-1].push({type:"parEnd",signalType:Be.LINETYPE.PAR_END}),this.$=Le[Me-1];break;case 41:Le[Me-1].unshift({type:"criticalStart",criticalText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.CRITICAL_START}),Le[Me-1].push({type:"criticalEnd",signalType:Be.LINETYPE.CRITICAL_END}),this.$=Le[Me-1];break;case 42:Le[Me-1].unshift({type:"breakStart",breakText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.BREAK_START}),Le[Me-1].push({type:"breakEnd",optText:Be.parseMessage(Le[Me-2]),signalType:Be.LINETYPE.BREAK_END}),this.$=Le[Me-1];break;case 44:this.$=Le[Me-3].concat([{type:"option",optionText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.CRITICAL_OPTION},Le[Me]]);break;case 46:this.$=Le[Me-3].concat([{type:"and",parText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.PAR_AND},Le[Me]]);break;case 48:this.$=Le[Me-3].concat([{type:"else",altText:Be.parseMessage(Le[Me-1]),signalType:Be.LINETYPE.ALT_ELSE},Le[Me]]);break;case 49:Le[Me-3].draw="participant",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 50:Le[Me-1].draw="participant",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 51:Le[Me-3].draw="actor",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 52:case 57:Le[Me-1].draw="actor",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 53:Le[Me-1].type="destroyParticipant",this.$=Le[Me-1];break;case 54:Le[Me-3].draw="participant",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 55:Le[Me-1].draw="participant",Le[Me-1].type="addParticipant",this.$=Le[Me-1];break;case 56:Le[Me-3].draw="actor",Le[Me-3].type="addParticipant",Le[Me-3].description=Be.parseMessage(Le[Me-1]),this.$=Le[Me-3];break;case 58:this.$=[Le[Me-1],{type:"addNote",placement:Le[Me-2],actor:Le[Me-1].actor,text:Le[Me]}];break;case 59:Le[Me-2]=[].concat(Le[Me-1],Le[Me-1]).slice(0,2),Le[Me-2][0]=Le[Me-2][0].actor,Le[Me-2][1]=Le[Me-2][1].actor,this.$=[Le[Me-1],{type:"addNote",placement:Be.PLACEMENT.OVER,actor:Le[Me-2].slice(0,2),text:Le[Me]}];break;case 60:this.$=[Le[Me-1],{type:"addLinks",actor:Le[Me-1].actor,text:Le[Me]}];break;case 61:this.$=[Le[Me-1],{type:"addALink",actor:Le[Me-1].actor,text:Le[Me]}];break;case 62:this.$=[Le[Me-1],{type:"addProperties",actor:Le[Me-1].actor,text:Le[Me]}];break;case 63:this.$=[Le[Me-1],{type:"addDetails",actor:Le[Me-1].actor,text:Le[Me]}];break;case 66:this.$=[Le[Me-2],Le[Me]];break;case 67:this.$=Le[Me];break;case 68:this.$=Be.PLACEMENT.LEFTOF;break;case 69:this.$=Be.PLACEMENT.RIGHTOF;break;case 70:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0},{type:"activeStart",signalType:Be.LINETYPE.ACTIVE_START,actor:Le[Me-1].actor}];break;case 71:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me]},{type:"activeEnd",signalType:Be.LINETYPE.ACTIVE_END,actor:Le[Me-4].actor}];break;case 72:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Be.LINETYPE.CENTRAL_CONNECTION,actor:Le[Me-1].actor}];break;case 73:this.$=[Le[Me-4],Le[Me-1],{type:"addMessage",from:Le[Me-4].actor,to:Le[Me-1].actor,signalType:Le[Me-2],msg:Le[Me],activate:!1,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Le[Me-4].actor}];break;case 74:this.$=[Le[Me-5],Le[Me-1],{type:"addMessage",from:Le[Me-5].actor,to:Le[Me-1].actor,signalType:Le[Me-3],msg:Le[Me],activate:!0,centralConnection:Be.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Be.LINETYPE.CENTRAL_CONNECTION,actor:Le[Me-1].actor},{type:"centralConnectionReverse",signalType:Be.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Le[Me-5].actor}];break;case 75:this.$=[Le[Me-3],Le[Me-1],{type:"addMessage",from:Le[Me-3].actor,to:Le[Me-1].actor,signalType:Le[Me-2],msg:Le[Me]}];break;case 76:this.$={type:"addParticipant",actor:Le[Me-1],config:Le[Me]};break;case 77:this.$=Le[Me-1].trim();break;case 78:this.$={type:"addParticipant",actor:Le[Me]};break;case 79:this.$=Be.LINETYPE.SOLID_OPEN;break;case 80:this.$=Be.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Be.LINETYPE.SOLID;break;case 82:this.$=Be.LINETYPE.SOLID_TOP;break;case 83:this.$=Be.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Be.LINETYPE.STICK_TOP;break;case 85:this.$=Be.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Be.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Be.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Be.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Be.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Be.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Be.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Be.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Be.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Be.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Be.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Be.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Be.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Be.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Be.LINETYPE.DOTTED;break;case 100:this.$=Be.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Be.LINETYPE.SOLID_CROSS;break;case 102:this.$=Be.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Be.LINETYPE.SOLID_POINT;break;case 104:this.$=Be.LINETYPE.DOTTED_POINT;break;case 105:this.$=Be.parseMessage(Le[Me].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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},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:$},{23:56,73:$},{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:$},{69:78,72:[1,79],78:H,79:B,80:V,81:q,82:G,83:Q,84:j,85:ae,86:Z,87:J,88:re,89:ee,90:me,91:te,92:$e,93:Oe,94:He,95:ue,96:ce,97:Te,98:ge,99:Ve,100:we,101:Ae,102:Ue,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:$},{23:111,73:$},{23:112,73:$},{23:113,73:$},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],pe),t(F,[2,6]),t(F,[2,16]),t(Ce,[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(oe,i,{7:120}),t(oe,i,{7:121}),t(oe,i,{7:122}),t(fe,i,{41:123,7:124}),t(W,i,{43:125,7:126}),t(W,i,{7:126,43:127}),t(se,i,{46:128,7:129}),t(oe,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(K,pe,{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:$},{69:146,78:H,79:B,80:V,81:q,82:G,83:Q,84:j,85:ae,86:Z,87:J,88:re,89:ee,90:me,91:te,92:$e,93:Oe,94:He,95:ue,96:ce,97:Te,98:ge,99:Ve,100:we,101:Ae,102:Ue,103:le},t(de,[2,79]),t(de,[2,80]),t(de,[2,81]),t(de,[2,82]),t(de,[2,83]),t(de,[2,84]),t(de,[2,85]),t(de,[2,86]),t(de,[2,87]),t(de,[2,88]),t(de,[2,89]),t(de,[2,90]),t(de,[2,91]),t(de,[2,92]),t(de,[2,93]),t(de,[2,94]),t(de,[2,95]),t(de,[2,96]),t(de,[2,97]),t(de,[2,98]),t(de,[2,99]),t(de,[2,100]),t(de,[2,101]),t(de,[2,102]),t(de,[2,103]),t(de,[2,104]),{23:147,73:$},{23:149,60:148,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,50:[1,165],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,49:[1,167],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,48:[1,170],51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{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:x,38:b,39:T,40:k,42:S,44:C,45:E,47:A,51:M,53:L,54:P,56:N,61:_,62:I,63:O,64:D,73:$},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(K,[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:$},{23:178,73:$},{23:179,73:$},{58:180,104:X},{23:181,72:[1,182],73:$},{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(Ce,[2,11]),{13:186,51:M,53:L,54:P},t(Ce,[2,13]),t(Ce,[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:$},{5:[2,58]},{5:[2,59]},{23:200,73:$},t(Ce,[2,12]),t(fe,i,{7:124,41:201}),t(W,i,{7:126,43:202}),t(se,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(K,[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:w(function(ze,De){if(De.recoverable)this.trace(ze);else{var Ke=new Error(ze);throw Ke.hash=De,Ke}},"parseError"),parse:w(function(ze){var De=this,Ke=[0],Be=[],nt=[null],Le=[],pt=this.table,Me="",Ct=0,wt=0,ht=2,Bt=1,At=Le.slice.call(arguments,1),mt=Object.create(this.lexer),ye={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(ye.yy[Nt]=this.yy[Nt]);mt.setInput(ze,ye.yy),ye.yy.lexer=mt,ye.yy.parser=this,typeof mt.yylloc>"u"&&(mt.yylloc={});var yt=mt.yylloc;Le.push(yt);var gt=mt.options&&mt.options.ranges;typeof ye.yy.parseError=="function"?this.parseError=ye.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(mr){Ke.length=Ke.length-2*mr,nt.length=nt.length-mr,Le.length=Le.length-mr}w(St,"popStack");function tn(){var mr;return mr=Be.pop()||mt.lex()||Bt,typeof mr!="number"&&(mr instanceof Array&&(Be=mr,mr=Be.pop()),mr=De.symbols_[mr]||mr),mr}w(tn,"lex");for(var _e,Je,ut,Dt,Kt={},Er,yr,qr,kr;;){if(Je=Ke[Ke.length-1],this.defaultActions[Je]?ut=this.defaultActions[Je]:((_e===null||typeof _e>"u")&&(_e=tn()),ut=pt[Je]&&pt[Je][_e]),typeof ut>"u"||!ut.length||!ut[0]){var rn="";kr=[];for(Er in pt[Je])this.terminals_[Er]&&Er>ht&&kr.push("'"+this.terminals_[Er]+"'");mt.showPosition?rn="Parse error on line "+(Ct+1)+`: `+mt.showPosition()+` -Expecting `+Tr.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":rn="Parse error on line "+(Ct+1)+": Unexpected "+(_e==Bt?"end of input":"'"+(this.terminals_[_e]||_e)+"'"),this.parseError(rn,{text:mt.match,token:this.terminals_[_e]||_e,line:mt.yylineno,loc:yt,expected:Tr})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Je+", token: "+_e);switch(ut[0]){case 1:Ke.push(_e),nt.push(mt.yytext),Le.push(mt.yylloc),Ke.push(ut[1]),_e=null,wt=mt.yyleng,Me=mt.yytext,Ct=mt.yylineno,yt=mt.yylloc;break;case 2:if(yr=this.productions_[ut[1]][1],Kt.$=nt[nt.length-yr],Kt._$={first_line:Le[Le.length-(yr||1)].first_line,last_line:Le[Le.length-1].last_line,first_column:Le[Le.length-(yr||1)].first_column,last_column:Le[Le.length-1].last_column},gt&&(Kt._$.range=[Le[Le.length-(yr||1)].range[0],Le[Le.length-1].range[1]]),Dt=this.performAction.apply(Kt,[Me,wt,Ct,ye.yy,ut[1],nt,Le].concat(At)),typeof Dt<"u")return Dt;yr&&(Ke=Ke.slice(0,-1*yr*2),nt=nt.slice(0,-1*yr),Le=Le.slice(0,-1*yr)),Ke.push(this.productions_[ut[1]][0]),nt.push(Kt.$),Le.push(Kt._$),qr=pt[Ke[Ke.length-2]][Ke[Ke.length-1]],Ke.push(qr);break;case 3:return!0}}return!0},"parse")},ke=(function(){var Ie={EOF:1,parseError:w(function(De,Ke){if(this.yy.parser)this.yy.parser.parseError(De,Ke);else throw new Error(De)},"parseError"),setInput:w(function(ze,De){return this.yy=De||this.yy||{},this._input=ze,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:w(function(){var ze=this._input[0];this.yytext+=ze,this.yyleng++,this.offset++,this.match+=ze,this.matched+=ze;var De=ze.match(/(?:\r\n?|\n).*/g);return De?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ze},"input"),unput:w(function(ze){var De=ze.length,Ke=ze.split(/(?:\r\n?|\n)/g);this._input=ze+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var Be=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),Ke.length-1&&(this.yylineno-=Ke.length-1);var nt=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:Ke?(Ke.length===Be.length?this.yylloc.first_column:0)+Be[Be.length-Ke.length].length-Ke[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[nt[0],nt[0]+this.yyleng-De]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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 `+kr.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":rn="Parse error on line "+(Ct+1)+": Unexpected "+(_e==Bt?"end of input":"'"+(this.terminals_[_e]||_e)+"'"),this.parseError(rn,{text:mt.match,token:this.terminals_[_e]||_e,line:mt.yylineno,loc:yt,expected:kr})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Je+", token: "+_e);switch(ut[0]){case 1:Ke.push(_e),nt.push(mt.yytext),Le.push(mt.yylloc),Ke.push(ut[1]),_e=null,wt=mt.yyleng,Me=mt.yytext,Ct=mt.yylineno,yt=mt.yylloc;break;case 2:if(yr=this.productions_[ut[1]][1],Kt.$=nt[nt.length-yr],Kt._$={first_line:Le[Le.length-(yr||1)].first_line,last_line:Le[Le.length-1].last_line,first_column:Le[Le.length-(yr||1)].first_column,last_column:Le[Le.length-1].last_column},gt&&(Kt._$.range=[Le[Le.length-(yr||1)].range[0],Le[Le.length-1].range[1]]),Dt=this.performAction.apply(Kt,[Me,wt,Ct,ye.yy,ut[1],nt,Le].concat(At)),typeof Dt<"u")return Dt;yr&&(Ke=Ke.slice(0,-1*yr*2),nt=nt.slice(0,-1*yr),Le=Le.slice(0,-1*yr)),Ke.push(this.productions_[ut[1]][0]),nt.push(Kt.$),Le.push(Kt._$),qr=pt[Ke[Ke.length-2]][Ke[Ke.length-1]],Ke.push(qr);break;case 3:return!0}}return!0},"parse")},ke=(function(){var Ie={EOF:1,parseError:w(function(De,Ke){if(this.yy.parser)this.yy.parser.parseError(De,Ke);else throw new Error(De)},"parseError"),setInput:w(function(ze,De){return this.yy=De||this.yy||{},this._input=ze,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:w(function(){var ze=this._input[0];this.yytext+=ze,this.yyleng++,this.offset++,this.match+=ze,this.matched+=ze;var De=ze.match(/(?:\r\n?|\n).*/g);return De?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ze},"input"),unput:w(function(ze){var De=ze.length,Ke=ze.split(/(?:\r\n?|\n)/g);this._input=ze+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var Be=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),Ke.length-1&&(this.yylineno-=Ke.length-1);var nt=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:Ke?(Ke.length===Be.length?this.yylloc.first_column:0)+Be[Be.length-Ke.length].length-Ke[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[nt[0],nt[0]+this.yyleng-De]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(ze){this.unput(this.match.slice(ze))},"less"),pastInput:w(function(){var ze=this.matched.substr(0,this.matched.length-this.match.length);return(ze.length>20?"...":"")+ze.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var ze=this.match;return ze.length<20&&(ze+=this._input.substr(0,20-ze.length)),(ze.substr(0,20)+(ze.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var ze=this.pastInput(),De=new Array(ze.length+1).join("-");return ze+this.upcomingInput()+` `+De+"^"},"showPosition"),test_match:w(function(ze,De){var Ke,Be,nt;if(this.options.backtrack_lexer&&(nt={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&&(nt.yylloc.range=this.yylloc.range.slice(0))),Be=ze[0].match(/(?:\r\n?|\n).*/g),Be&&(this.yylineno+=Be.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Be?Be[Be.length-1].length-Be[Be.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ze[0].length},this.yytext+=ze[0],this.match+=ze[0],this.matches=ze,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(ze[0].length),this.matched+=ze[0],Ke=this.performAction.call(this,this.yy,this,De,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ke)return Ke;if(this._backtrack){for(var Le in nt)this[Le]=nt[Le];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ze,De,Ke,Be;this._more||(this.yytext="",this.match="");for(var nt=this._currentRules(),Le=0;LeDe[0].length)){if(De=Ke,Be=Le,this.options.backtrack_lexer){if(ze=this.test_match(Ke,nt[Le]),ze!==!1)return ze;if(this._backtrack){De=!1;continue}else return!1}else if(!this.options.flex)break}return De?(ze=this.test_match(De,nt[Be]),ze!==!1?ze:!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:w(function(){var De=this.next();return De||this.lex()},"lex"),begin:w(function(De){this.conditionStack.push(De)},"begin"),popState:w(function(){var De=this.conditionStack.length-1;return De>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:w(function(De){this.begin(De)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(De,Ke,Be,nt){switch(Be){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 Ke.yytext=Ke.yytext.trim(),73;case 12:return Ke.yytext=Ke.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ke.yytext=Ke.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ke.yytext=Ke.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 Ke.yytext=Ke.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 Ie})();Fe.lexer=ke;function Ye(){this.yy={}}return w(Ye,"Parser"),Ye.prototype=Fe,Fe.Parser=Ye,new Ye})();Sj.parser=Sj;var Zcr=Sj,Qcr={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},Jcr={FILLED:0,OPEN:1},eur={LEFTOF:0,RIGHTOF:1,OVER:2},E8={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rT,tur=(rT=class{constructor(){this.state=new Mee(()=>({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=$i,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getAccTitle=Yi,this.getAccDescription=Xi,this.getDiagramTitle=Di,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(We().wrap),this.LINETYPE=Qcr,this.ARROWTYPE=Jcr,this.PLACEMENT=eur}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:w(function(){var De=this.next();return De||this.lex()},"lex"),begin:w(function(De){this.conditionStack.push(De)},"begin"),popState:w(function(){var De=this.conditionStack.length-1;return De>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:w(function(De){this.begin(De)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(De,Ke,Be,nt){switch(Be){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 Ke.yytext=Ke.yytext.trim(),73;case 12:return Ke.yytext=Ke.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ke.yytext=Ke.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ke.yytext=Ke.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 Ke.yytext=Ke.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 Ie})();Fe.lexer=ke;function Ye(){this.yy={}}return w(Ye,"Parser"),Ye.prototype=Fe,Fe.Parser=Ye,new Ye})();Aj.parser=Aj;var nur=Aj,iur={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},aur={FILLED:0,OPEN:1},sur={LEFTOF:0,RIGHTOF:1,OVER:2},A8={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rT,our=(rT=class{constructor(){this.state=new Iee(()=>({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=$i,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getAccTitle=Yi,this.getAccDescription=Xi,this.getDiagramTitle=Di,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(We().wrap),this.LINETYPE=iur,this.ARROWTYPE=aur,this.PLACEMENT=sur}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=M$(u,{schema:_$})}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=We().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),wi()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return he.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?Tn(s,We()):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=Tn(r.text,We());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){he.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Tn(r.text,We());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){he.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=Tn(r.text,We()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){he.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){he.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":$i(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 We().sequence}},w(rT,"SequenceDB"),rT),rur=w(t=>{const e=t.dropShadow??"none",{look:r}=We();return`.actor { +}`,o=I$(u,{schema:L$})}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=We().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),wi()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return he.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?Tn(s,We()):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=Tn(r.text,We());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){he.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Tn(r.text,We());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){he.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=Tn(r.text,We()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){he.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){he.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":$i(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 We().sequence}},w(rT,"SequenceDB"),rT),lur=w(t=>{const e=t.dropShadow??"none",{look:r}=We();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -3367,25 +3380,25 @@ Expecting `+Tr.join(", ")+", got '"+(this.terminals_[_e]||_e)+"'":rn="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),nur=rur,f1=36,Pg="actor-top",Bg="actor-bottom",EO="actor-box",vy="actor-man",E0=new Set(["redux-color","redux-dark-color"]),G6=w(function(t,e){const r=hD(t,e);return pr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),iur=w(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=Ay.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),Aur(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"),AO=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),WI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await v$(e.text,pr()),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"),b3=w(function(t,e){let r=0,n=0;const i=e.text.split(Ft.lineBreakRegex),[a,s]=c0(e.fontSize);let o=[],l=0,u=w(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=w(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=w(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=w(()=>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||h3e;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"),Aqe=w(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)}w(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,b3(t,e),n},"drawLabel"),Sn=-1,Rqe=w((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"),aur=w(function(t,e,r,n,i){var T,k;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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AO(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();var y="actor";(T=e.properties)!=null&&T.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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=G6(g,m),x=i.get(e.name)??0;if(E0.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?wee(g,m.x+m.width-20,m.y+10,S.substr(1)):xee(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)),A0(r,Ha(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${EO}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),sur=w(function(t,e,r,n,i){var C,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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AO(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=G6(g,m),T=G6(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(E0.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),T.style("stroke",f[k%f.length]),T.style("fill",d[k%f.length])),(E=e.properties)!=null&&E.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?wee(g,m.x+m.width-20,m.y+10,A.substr(1)):xee(g,m.x+m.width-20,m.y+10,A)}A0(r,Ha(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${EO}`},r);let S=e.height;if(b.node){const A=b.node().getBBox();e.height=A.height,S=A.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),our=w(function(t,e,r,n,i){var A,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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",AO(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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,x=v/(2.5+m.height/50),b=g.append("g"),T=g.append("g"),k=`M ${m.x},${m.y+v} +`},"getStyles"),cur=lur,f1=36,Pg="actor-top",Bg="actor-bottom",RO="actor-box",vy="actor-man",E0=new Set(["redux-color","redux-dark-color"]),U6=w(function(t,e){const r=fD(t,e);return pr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),uur=w(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=Ay.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),$ur(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"),_O=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),GI=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await x$(e.text,pr()),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"),b3=w(function(t,e){let r=0,n=0;const i=e.text.split(Ft.lineBreakRegex),[a,s]=c0(e.fontSize);let o=[],l=0,u=w(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=w(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=w(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=w(()=>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||d3e;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"),Mqe=w(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)}w(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,b3(t,e),n},"drawLabel"),Sn=-1,Lqe=w((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"),hur=w(function(t,e,r,n,i){var T,k;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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_O(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();var y="actor";(T=e.properties)!=null&&T.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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=U6(g,m),x=i.get(e.name)??0;if(E0.has(u)&&(v.style("stroke",f[x%f.length]),v.style("fill",d[x%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(k=e.properties)!=null&&k.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?kee(g,m.x+m.width-20,m.y+10,S.substr(1)):Tee(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)),A0(r,Ha(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${RO}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),dur=w(function(t,e,r,n,i){var C,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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_O(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();var y="actor";(C=e.properties)!=null&&C.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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,x={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=U6(g,m),T=U6(g,x);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(E0.has(u)&&(b.style("stroke",f[k%f.length]),b.style("fill",d[k%f.length]),T.style("stroke",f[k%f.length]),T.style("fill",d[k%f.length])),(E=e.properties)!=null&&E.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?kee(g,m.x+m.width-20,m.y+10,A.substr(1)):Tee(g,m.x+m.width-20,m.y+10,A)}A0(r,Ha(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${RO}`},r);let S=e.height;if(b.node){const A=b.node().getBBox();e.height=A.height,S=A.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),fur=w(function(t,e,r,n,i){var A,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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",_O(`actor${Sn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&g.attr("id","root-"+Sn),l==="neo"&&g.attr("data-look","neo"));const m=Nc();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Bg}`:y+=` ${Pg}`,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,x=v/(2.5+m.height/50),b=g.append("g"),T=g.append("g"),k=`M ${m.x},${m.y+v} a ${x},${v} 0 0 0 0,${m.height} h ${m.width-2*x} a ${x},${v} 0 0 0 0,-${m.height} Z `;b.append("path").attr("d",k),T.append("path").attr("d",`M ${m.x},${m.y+v} - a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),T.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(E0.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),T.style("stroke",f[S%f.length]),T.style("fill",d[S%f.length])),(M=e.properties)!=null&&M.icon){const L=e.properties.icon.trim(),P=m.x+m.width-20,N=m.y+10;L.charAt(0)==="@"?wee(g,P,N,L.substr(1)):xee(g,P,N,L)}A0(r,Ha(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${EO}`},r);let C=e.height;const E=b.select("path:last-child");if(E.node()){const L=E.node().getBBox();e.height=L.height,C=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),lur=w(function(t,e,r,n,i,a){var A;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||(Sn++,y.append("line").attr("id","actor"+Sn).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=Sn);const v=t.append("g");let x=vy;n?x+=` ${Bg}`:x+=` ${Pg}`,v.attr("class",x),v.attr("name",e.name);const b=Nc();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const T=e.x+e.width/2,k=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",T).attr("cy",k).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${T}, ${k-S})`);const C=a.get(e.name)??0;E0.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),A0(r,Ha(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${vy}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),cur=w(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+=` ${Bg}`:m+=` ${Pg}`,g.attr("class",m),g.attr("name",e.name);const y=Nc();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,x=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;E0.has(u)&&(g.style("stroke",f[T%f.length]),g.style("fill",d[T%f.length]));const k=g.node().getBBox();return e.height=k.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Sn++,p.append("line").attr("id","actor"+Sn).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=Sn),A0(r,Ha(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${vy}`},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"),uur=w(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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",AO(`actor${Sn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&m.attr("id","root-"+Sn),h==="neo"&&m.attr("data-look","neo"));const y=Nc();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Bg}`:v+=` ${Pg}`,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 x=y.width/3,b=y.width/3,T=x/2,k=T/(2.5+x/50),S=m.append("g");S.attr("class",v);const C=` + a ${x},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${x}, ${-(m.height/2)})`),T.attr("transform",`translate(${m.width-x}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(E0.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),T.style("stroke",f[S%f.length]),T.style("fill",d[S%f.length])),(M=e.properties)!=null&&M.icon){const L=e.properties.icon.trim(),P=m.x+m.width-20,N=m.y+10;L.charAt(0)==="@"?kee(g,P,N,L.substr(1)):Tee(g,P,N,L)}A0(r,Ha(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${RO}`},r);let C=e.height;const E=b.select("path:last-child");if(E.node()){const L=E.node().getBBox();e.height=L.height,C=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),pur=w(function(t,e,r,n,i,a){var A;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||(Sn++,y.append("line").attr("id","actor"+Sn).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=Sn);const v=t.append("g");let x=vy;n?x+=` ${Bg}`:x+=` ${Pg}`,v.attr("class",x),v.attr("name",e.name);const b=Nc();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const T=e.x+e.width/2,k=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",T).attr("cy",k).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${T}, ${k-S})`);const C=a.get(e.name)??0;E0.has(h)?(v.style("stroke",p[C%p.length]),v.style("fill",f[C%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),A0(r,Ha(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${vy}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),gur=w(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+=` ${Bg}`:m+=` ${Pg}`,g.attr("class",m),g.attr("name",e.name);const y=Nc();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,x=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",x).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",x+b).attr("y2",x+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;E0.has(u)&&(g.style("stroke",f[T%f.length]),g.style("fill",d[T%f.length]));const k=g.node().getBBox();return e.height=k.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Sn++,p.append("line").attr("id","actor"+Sn).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=Sn),A0(r,Ha(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${vy}`},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"),mur=w(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||(Sn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",_O(`actor${Sn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Sn).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=Sn,e.links!=null&&m.attr("id","root-"+Sn),h==="neo"&&m.attr("data-look","neo"));const y=Nc();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Bg}`:v+=` ${Pg}`,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 x=y.width/3,b=y.width/3,T=x/2,k=T/(2.5+x/50),S=m.append("g");S.attr("class",v);const C=` M ${y.x},${y.y+k} a ${T},${k} 0 0 0 ${x},0 a ${T},${k} 0 0 0 -${x},0 l 0,${b-2*k} a ${T},${k} 0 0 0 ${x},0 l 0,-${b-2*k} -`;S.append("path").attr("d",C),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;E0.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${k})`),e.rectData=y,A0(r,Ha(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${EO}`},r);const A=S.select("path:last-child");if(A.node()){const L=A.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"),hur=w(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||(Sn++,u.append("line").attr("id","actor"+Sn).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=Sn);const y=t.append("g");let v=vy;n?v+=` ${Bg}`:v+=` ${Pg}`,y.attr("class",v),y.attr("name",e.name);const x=Nc();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Sn).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"+Sn).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;E0.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const T=y.node().getBBox();return e.height=T.height+(r.sequence.labelBoxHeight??0),A0(r,Ha(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${vy}`},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"),dur=w(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||(Sn++,g.append("line").attr("id","actor"+Sn).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=Sn);const m=t.append("g");let y=vy;n?y+=` ${Bg}`:y+=` ${Pg}`,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,x=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Sn).attr("x1",s).attr("y1",x+25*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Sn).attr("x1",s-f1/2*v).attr("y1",x+33*v).attr("x2",s+f1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",s-f1/2*v).attr("y1",x+60*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("x1",s).attr("y1",x+45*v).attr("x2",s+(f1/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const T=m.node().getBBox();e.height=T.height;const k=Nc();k.x=e.x,k.y=x,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const S=i.get(e.name)??0;return E0.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),A0(r,Ha(e.description))(e.description,m,k.x,x+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${vy}`},r),e.height},"drawActorTypeActor"),fur=w(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 dur(t,e,r,n,o);case"participant":return await aur(t,e,r,n,o);case"boundary":return await hur(t,e,r,n,o);case"control":return await lur(t,e,r,n,i,o);case"entity":return await cur(t,e,r,n,o);case"database":return await uur(t,e,r,n,o);case"collections":return await sur(t,e,r,n,o);case"queue":return await our(t,e,r,n,o)}},"drawActor"),pur=w(function(t,e,r){const i=t.append("g");_qe(i,e),e.name&&A0(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),gur=w(function(t){return t.append("g")},"anchorElement"),mur=w(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Nc(),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=G6(p,f),v=(s??new Map([...a.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;E0.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),yur=w(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=w(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).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=Tee();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",Aqe(f,g),g=Mqe(),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=Ha(g.text)?await WI(f,g,e):b3(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,Ha(g.text)?(e.starty=e.sections[y].y,await WI(f,g,e)):b3(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,T)=>b+T));e.sections[y].height+=x-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),_qe=w(function(t,e){qLe(t,e)},"drawBackgroundRect"),vur=w(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"),bur=w(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"),xur=w(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"),wur=w(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"),Tur=w(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"),kur=w(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"),Cur=w(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"),Sur=w(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"),Mqe=w(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"),Eur=w(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),A0=(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)}w(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=c0(p),x=a.split(Ft.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:w(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:w(function(t){this.boxes.push(t)},"addBox"),addActor:w(function(t){this.actors.push(t)},"addActor"),addLoop:w(function(t){this.loops.push(t)},"addLoop"),addMessage:w(function(t){this.messages.push(t)},"addMessage"),addNote:w(function(t){this.notes.push(t)},"addNote"),lastActor:w(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:w(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:w(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:w(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:w(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,$qe(We())},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=this;let a=0;function s(o){return w(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*et.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*et.boxMargin,Math.max),i.updateVal(_t.data,"startx",t-h*et.boxMargin,Math.min),i.updateVal(_t.data,"stopx",r+h*et.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*et.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*et.boxMargin,Math.max),i.updateVal(_t.data,"starty",e-h*et.boxMargin,Math.min),i.updateVal(_t.data,"stopy",n+h*et.boxMargin,Math.max))},"updateItemBounds")}w(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:w(function(t,e,r,n){const i=Ft.getMin(t,r),a=Ft.getMax(t,r),s=Ft.getMin(e,n),o=Ft.getMax(e,n);this.updateVal(_t.data,"startx",i,Math.min),this.updateVal(_t.data,"starty",s,Math.min),this.updateVal(_t.data,"stopx",a,Math.max),this.updateVal(_t.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:w(function(t,e,r){const n=r.get(t.from),i=RO(t.from).length||0,a=n.x+n.width/2+(i-1)*et.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+et.activationWidth,stopy:void 0,actor:t.from,anchored:Ei.anchorElement(e)})},"newActivation"),endActivation:w(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:w(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:w(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:w(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:w(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:w(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:_t.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:w(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:w(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Ft.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return{bounds:this.data,models:this.models}},"getBounds")},Iur=w(async function(t,e,r){_t.bumpVerticalPos(et.boxMargin),e.height=et.boxMargin,e.starty=_t.getVerticalPos();const n=Nc();n.x=e.startx,n.y=e.starty,n.width=e.width||et.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Ei.drawRect(i,n),s=Tee();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=et.noteFontFamily,s.fontSize=et.noteFontSize,s.fontWeight=et.noteFontWeight,s.anchor=et.noteAlign,s.textMargin=et.noteMargin,s.valign="center";const o=Ha(s.text)?await WI(i,s):b3(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*et.noteMargin),e.height+=l+2*et.noteMargin,_t.bumpVerticalPos(l+2*et.noteMargin),e.stopy=e.starty+l+2*et.noteMargin,e.stopx=e.startx+n.width,_t.insert(e.startx,e.starty,e.stopx,e.stopy),_t.models.addNote(e)},"drawNote"),H1e=w(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=Pqe(e,n),m=t.append("g"),y=16.5,v=w((S,C)=>{const E=S?y:-y;return C?-E:E},"getCircleOffset"),x=w(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:T,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case T:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case T:x(d);break;case k:x(d),x(f);break}},"drawCentralConnection"),by=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),_2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Ej=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Lqe(t,e){_t.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Ft.splitBreaks(i).length,s=Ha(i),o=s?await lE(i,We()):Vr.calculateTextDimensions(i,by(et));if(!s){const d=o.height/a;e.height+=d,_t.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=_t.getVerticalPos()+u,et.rightAngles||(u+=et.boxMargin,l=_t.getVerticalPos()+u),u+=30;const d=Ft.getMax(h/2,et.width/2);_t.insert(r-d,_t.getVerticalPos()-10+u,n+d,_t.getVerticalPos()+30+u)}else u+=et.boxMargin,l=_t.getVerticalPos()+u,_t.insert(r,l-10,n,l);return _t.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,_t.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}w(Lqe,"boundMessage");var $ur=w(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=Vr.calculateTextDimensions(u,by(et)),g=Tee();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=et.messageFontFamily,g.fontSize=et.messageFontSize,g.fontWeight=et.messageFontWeight,g.anchor=et.messageAlign,g.valign="center",g.textMargin=et.wrapPadding,g.tspan=!1,Ha(g.text)?await WI(t,g,{startx:s,stopx:o,starty:r}):b3(t,g);const m=p.width;let y;if(s===o){const x=f||et.showSequenceNumbers,b=Pqe(i,n),T=zur(i,n),k=s+(x&&(b||T)?10:0);et.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+Ft.getMax(et.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),wH(i,n)&&H1e(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),wH(i,n)&&H1e(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(et.arrowMarkerAbsolute&&(v=y$(!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||et.showSequenceNumbers){const x=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,T=6,k=wH(i,n);let S=s,C=o;x?(ss?C=o-2*T:(C=o-T,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),C+=k?15:0,y.attr("x2",C),y.attr("x1",S)):y.attr("x1",s+T);let E=0;const A=s===o,M=s<=o;A?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"),Nur=w(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||_t.models.addBox(u),l+=et.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Ft.getMax(f.width||et.width,et.width),f.height=Ft.getMax(f.height||et.height,et.height),f.margin=f.margin||et.actorMargin,h=Ft.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=_t.getVerticalPos(),_t.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,_t.models.addActor(f)}u&&!s&&_t.models.addBox(u),_t.bumpVerticalPos(h)},"addActorRenderingData"),Aj=w(async function(t,e,r,n,i,a,s){if(n){let o=0;_t.bumpVerticalPos(et.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=_t.getVerticalPos());const h=await Ei.drawActor(t,u,et,!0,i,a,s);o=Ft.getMax(o,h)}_t.bumpVerticalPos(o+et.boxMargin)}else for(const o of r){const l=e.get(o);await Ei.drawActor(t,l,et,!1,i,a,s)}},"drawActors"),Iqe=w(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=Our(o),u=Ei.drawPopup(t,o,l,et,et.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),$qe=w(function(t){ja(et,t),t.fontFamily&&(et.actorFontFamily=et.noteFontFamily=et.messageFontFamily=t.fontFamily),t.fontSize&&(et.actorFontSize=et.noteFontSize=et.messageFontSize=t.fontSize),t.fontWeight&&(et.actorFontWeight=et.noteFontWeight=et.messageFontWeight=t.fontWeight)},"setConf"),RO=w(function(t){return _t.activations.filter(function(e){return e.actor===t})},"actorActivations"),V1e=w(function(t,e){const r=e.get(t),n=RO(t),i=n.reduce(function(s,o){return Ft.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Ft.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function ku(t,e,r,n,i){_t.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=by(et);e.message=Vr.wrapLabel(`[${e.message}]`,s-2*et.wrapPadding,o),e.width=s,e.wrap=!0;const l=Vr.calculateTextDimensions(e.message,o),u=Ft.getMax(l.height,et.labelBoxHeight);a=n+u,he.debug(`${u} - ${e.message}`)}i(e),_t.bumpVerticalPos(a)}w(ku,"adjustLoopHeightForWrap");function Nqe(t,e,r,n,i,a,s){function o(h,d){h.x{B.add(V.from),B.add(V.to)}),y=y.filter(V=>B.has(V))}const S=new Map(y.map((B,V)=>{var q;return[((q=f.get(B))==null?void 0:q.name)??B,V]}));Nur(d,f,p,y,0,v,!1);const C=await Vur(v,f,k,n);Ei.insertArrowHead(d,e),Ei.insertArrowCrossHead(d,e),Ei.insertArrowFilledHead(d,e),Ei.insertSequenceNumber(d,e),Ei.insertSolidTopArrowHead(d,e),Ei.insertSolidBottomArrowHead(d,e),Ei.insertStickTopArrowHead(d,e),Ei.insertStickBottomArrowHead(d,e),s==="neo"&&Ei.insertDropShadow(d,et);function E(B,V){const q=_t.endActivation(B);q.starty+18>V&&(q.starty=V-6,V+=12),Ei.drawActivation(d,q,V,et,RO(B.from).length,n,S),_t.insert(q.startx,V-10,q.stopx,V)}w(E,"activeEnd");let A=1,M=1;const L=[],P=[];let N=0;for(const B of v){let V,q,G;switch(B.type){case n.db.LINETYPE.NOTE:_t.resetVerticalPos(),q=B.noteModel,await Iur(d,q,B.id);break;case n.db.LINETYPE.ACTIVE_START:_t.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:_t.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:_t.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,_t.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.LOOP_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"loop",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.RECT_START:ku(C,B,et.boxMargin,et.boxMargin,Q=>{let j=Q.message;j||(j=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),_t.newLoop(void 0,j)});break;case n.db.LINETYPE.RECT_END:V=_t.endLoop(),P.push(V),_t.models.addLoop(V),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos());break;case n.db.LINETYPE.OPT_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.OPT_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"opt",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.ALT_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.ALT_ELSE:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.ALT_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"alt",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q)),_t.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.PAR_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"par",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.AUTONUMBER:A=B.message.start||A,M=B.message.step||M,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.CRITICAL_OPTION:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.CRITICAL_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"critical",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.BREAK_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.BREAK_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"break",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;default:try{G=B.msgModel,G.starty=_t.getVerticalPos(),G.sequenceIndex=A,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=B.id,G.from=B.from,G.to=B.to;const Q=await Lqe(d,G);Nqe(B,G,Q,N,f,p,g),L.push({messageModel:G,lineStartY:Q,msg:B}),_t.models.addMessage(G)}catch(Q){he.error("error while drawing message",Q)}}[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)&&(A=Math.round((A+M)*100)/100),N++}he.debug("createdActors",p),he.debug("destroyedActors",g),await Aj(d,f,y,!1,e,n,S);for(const B of L)await $ur(d,B.messageModel,B.lineStartY,n,B.msg,e);et.mirrorActors&&await Aj(d,f,y,!0,e,n,S),P.forEach(B=>Ei.drawBackgroundRect(d,B)),Rqe(d,f,y,et);for(const B of _t.models.boxes){B.height=_t.getVerticalPos()-B.y,_t.insert(B.x,B.y,B.x+B.width,B.height);const V=et.boxMargin*2;B.startx=B.x-V,B.starty=B.y-V*.25,B.stopx=B.startx+B.width+2*V,B.stopy=B.starty+B.height+V*.75,B.stroke="rgb(0,0,0, 0.5)",Ei.drawBox(d,B,et)}b&&_t.bumpVerticalPos(et.boxMargin);const _=Iqe(d,f,y,h),{bounds:I}=_t.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 O=I.stopy-I.starty;O<_.maxHeight&&(O=_.maxHeight);let D=O+2*et.diagramMarginY;et.mirrorActors&&(D=D-et.boxMargin+et.bottomMarginAdj);let $=I.stopx-I.startx;$<_.maxWidth&&($=_.maxWidth);const F=$+2*et.diagramMarginX;x&&d.append("text").text(x).attr("x",(I.stopx-I.startx)/2-2*et.diagramMarginX).attr("y",-25),_a(d,D,F,et.useMaxWidth);const z=x?40:0,H=f.size&&s==="neo"?30:0;d.attr("viewBox",I.startx-et.diagramMarginX+" -"+(et.diagramMarginY+z)+" "+F+" "+(D+z+H)),he.debug("models:",_t.models)},"draw");async function Dqe(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const a=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!a.prevActor||i.placement===r.db.PLACEMENT.RIGHTOF&&!a.nextActor)continue;const s=i.placement!==void 0,o=!s,l=s?_2(et):by(et),u=i.wrap?Vr.wrapLabel(i.message,et.width-2*et.wrapPadding,l):i.message,d=(Ha(u)?await lE(i.message,We()):Vr.calculateTextDimensions(u,l)).width+2*et.wrapPadding;o&&i.from===a.nextActor?n[i.to]=Ft.getMax(n[i.to]||0,d):o&&i.from===a.prevActor?n[i.from]=Ft.getMax(n[i.from]||0,d):o&&i.from===i.to?(n[i.from]=Ft.getMax(n[i.from]||0,d/2),n[i.to]=Ft.getMax(n[i.to]||0,d/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=Ft.getMax(n[i.from]||0,d):i.placement===r.db.PLACEMENT.LEFTOF?n[a.prevActor]=Ft.getMax(n[a.prevActor]||0,d):i.placement===r.db.PLACEMENT.OVER&&(a.prevActor&&(n[a.prevActor]=Ft.getMax(n[a.prevActor]||0,d/2)),a.nextActor&&(n[i.from]=Ft.getMax(n[i.from]||0,d/2)))}return he.debug("maxMessageWidthPerActor:",n),n}w(Dqe,"getMaxMessageWidthPerActor");var Our=w(function(t){let e=0;const r=Ej(et);for(const n in t.links){const a=Vr.calculateTextDimensions(n,r).width+2*et.wrapPadding+2*et.boxMargin;e{const s=by(et);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=et.boxMargin*8;o+=l,o-=2*et.boxTextMargin,a.wrap&&(a.name=Vr.wrapLabel(a.name,o-2*et.wrapPadding,s));const u=Vr.calculateTextDimensions(a.name,s);i=Ft.getMax(u.height,i);const h=Ft.getMax(o,u.width+2*et.wrapPadding);if(a.margin=et.boxTextMargin,oa.textMaxHeight=i),Ft.getMax(n,et.height)}w(Oqe,"calculateActorMargins");var Pur=w(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=Ha(t.message)?await lE(t.message,We()):Vr.calculateTextDimensions(o?Vr.wrapLabel(t.message,et.width,_2(et)):t.message,_2(et));const u={width:o?et.width:Ft.getMax(et.width,l.width+2*et.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?Ft.getMax(et.width,l.width):Ft.getMax(n.width/2+i.width/2,l.width+2*et.noteMargin),u.startx=a+(n.width+et.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Ft.getMax(et.width,l.width+2*et.noteMargin):Ft.getMax(n.width/2+i.width/2,l.width+2*et.noteMargin),u.startx=a-u.width+(n.width-et.actorMargin)/2):t.to===t.from?(l=Vr.calculateTextDimensions(o?Vr.wrapLabel(t.message,Ft.getMax(et.width,n.width),_2(et)):t.message,_2(et)),u.width=o?Ft.getMax(et.width,n.width):Ft.getMax(n.width,et.width,l.width+2*et.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+et.actorMargin,u.startx=a2,f=w(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(et.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=Vr.wrapLabel(t.message,Ft.getMax(g+2*et.wrapPadding,et.width),by(et)));const m=Vr.calculateTextDimensions(t.message,by(et));return{width:Ft.getMax(t.wrap?0:m.width+2*et.wrapPadding,g+2*et.wrapPadding,et.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"),Vur=w(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=RO(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*et.activationWidth/2,g={startx:p,stopx:p+et.activationWidth,actor:u.from,enabled:!0};_t.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=_t.activations.map(f=>f.actor).lastIndexOf(u.from);_t.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await Pur(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Ft.getMin(s.from,o.startx),s.to=Ft.getMax(s.to,o.startx+o.width),s.width=Ft.getMax(s.width,Math.abs(s.from-s.to))-et.labelBoxWidth})):(l=Hur(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=Ft.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Ft.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Ft.getMax(s.width,Math.abs(s.to-s.from))-et.labelBoxWidth}else s.from=Ft.getMin(l.startx,s.from),s.to=Ft.getMax(l.stopx,s.to),s.width=Ft.getMax(s.width,l.width)-et.labelBoxWidth}))}return _t.activations=[],he.debug("Loop type widths:",i),i},"calculateLoopBounds"),Wur={bounds:_t,drawActors:Aj,drawActorsPopup:Iqe,setConf:$qe,draw:Dur},qur={parser:Zcr,get db(){return new tur},renderer:Wur,styles:nur,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,OV({sequence:{wrap:t.wrap}}))},"init")};const Gur=Object.freeze(Object.defineProperty({__proto__:null,diagram:qur},Symbol.toStringTag,{value:"Module"}));var Rj=(function(){var t=w(function(pe,Ce,oe,fe){for(oe=oe||{},fe=pe.length;fe--;oe[pe[fe]]=Ce);return oe},"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],x=[1,28],b=[1,29],T=[1,30],k=[1,31],S=[1,44],C=[1,46],E=[1,43],A=[1,47],M=[1,9],L=[1,8,9],P=[1,58],N=[1,59],_=[1,60],I=[1,61],O=[1,62],D=[1,63],$=[1,64],F=[1,8,9,41],z=[1,77],H=[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],V=[13,60,86,100,102,103],q=[13,60,73,74,86,100,102,103],G=[13,60,68,69,70,71,72,86,100,102,103],Q=[1,103],j=[1,121],ae=[1,117],Z=[1,113],J=[1,119],re=[1,114],ee=[1,115],me=[1,116],te=[1,118],$e=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],He=[1,128],ue=[12,39],ce=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],Ve=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ae={trace:w(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:w(function(Ce,oe,fe,W,se,K,de){var X=K.length-1;switch(se){case 8:this.$=K[X-1];break;case 9:case 10:case 13:case 15:this.$=K[X];break;case 11:case 14:this.$=K[X-2]+"."+K[X];break;case 12:case 16:this.$=K[X-1]+K[X];break;case 17:case 18:this.$=K[X-1]+"~"+K[X]+"~";break;case 19:W.addRelation(K[X]);break;case 20:K[X-1].title=W.cleanupLabel(K[X]),W.addRelation(K[X-1]);break;case 31:this.$=K[X].trim(),W.setAccTitle(this.$);break;case 32:case 33:this.$=K[X].trim(),W.setAccDescription(this.$);break;case 34:W.addClassesToNamespace(K[X-3],K[X-1][0],K[X-1][1]),W.popNamespace();break;case 35:W.addClassesToNamespace(K[X-4],K[X-1][0],K[X-1][1]),W.popNamespace();break;case 36:this.$=W.addNamespace(K[X]);break;case 37:this.$=W.addNamespace(K[X-1],K[X]);break;case 38:this.$=[[K[X]],[]];break;case 39:this.$=[[K[X-1]],[]];break;case 40:K[X][0].unshift(K[X-2]),this.$=K[X];break;case 41:this.$=[[],[K[X]]];break;case 42:this.$=[[],[K[X-1]]];break;case 43:K[X][1].unshift(K[X-2]),this.$=K[X];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=K[X];break;case 48:W.setCssClass(K[X-2],K[X]);break;case 49:W.addMembers(K[X-3],K[X-1]);break;case 51:W.setCssClass(K[X-5],K[X-3]),W.addMembers(K[X-5],K[X-1]);break;case 52:W.addAnnotation(K[X-3],K[X-1]);break;case 53:W.addAnnotation(K[X-6],K[X-4]),W.addMembers(K[X-6],K[X-1]);break;case 54:W.addAnnotation(K[X-5],K[X-3]);break;case 55:this.$=K[X],W.addClass(K[X]);break;case 56:this.$=K[X-1],W.addClass(K[X-1]),W.setClassLabel(K[X-1],K[X]);break;case 60:W.addAnnotation(K[X],K[X-2]);break;case 61:case 74:this.$=[K[X]];break;case 62:K[X].push(K[X-1]),this.$=K[X];break;case 63:break;case 64:W.addMember(K[X-1],W.cleanupLabel(K[X]));break;case 65:break;case 66:break;case 67:this.$={id1:K[X-2],id2:K[X],relation:K[X-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:K[X-3],id2:K[X],relation:K[X-1],relationTitle1:K[X-2],relationTitle2:"none"};break;case 69:this.$={id1:K[X-3],id2:K[X],relation:K[X-2],relationTitle1:"none",relationTitle2:K[X-1]};break;case 70:this.$={id1:K[X-4],id2:K[X],relation:K[X-2],relationTitle1:K[X-3],relationTitle2:K[X-1]};break;case 71:this.$=W.addNote(K[X],K[X-1]);break;case 72:this.$=W.addNote(K[X]);break;case 73:this.$=K[X-2],W.defineClass(K[X-1],K[X]);break;case 75:this.$=K[X-2].concat([K[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:K[X-2],type2:K[X],lineType:K[X-1]};break;case 81:this.$={type1:"none",type2:K[X],lineType:K[X-1]};break;case 82:this.$={type1:K[X-1],type2:"none",lineType:K[X]};break;case 83:this.$={type1:"none",type2:"none",lineType:K[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.$=K[X-2],W.setClickEvent(K[X-1],K[X]);break;case 92:case 98:this.$=K[X-3],W.setClickEvent(K[X-2],K[X-1]),W.setTooltip(K[X-2],K[X]);break;case 93:this.$=K[X-2],W.setLink(K[X-1],K[X]);break;case 94:this.$=K[X-3],W.setLink(K[X-2],K[X-1],K[X]);break;case 95:this.$=K[X-3],W.setLink(K[X-2],K[X-1]),W.setTooltip(K[X-2],K[X]);break;case 96:this.$=K[X-4],W.setLink(K[X-3],K[X-2],K[X]),W.setTooltip(K[X-3],K[X-1]);break;case 99:this.$=K[X-3],W.setClickEvent(K[X-2],K[X-1],K[X]);break;case 100:this.$=K[X-4],W.setClickEvent(K[X-3],K[X-2],K[X-1]),W.setTooltip(K[X-3],K[X]);break;case 101:this.$=K[X-3],W.setLink(K[X-2],K[X]);break;case 102:this.$=K[X-4],W.setLink(K[X-3],K[X-1],K[X]);break;case 103:this.$=K[X-4],W.setLink(K[X-3],K[X-1]),W.setTooltip(K[X-3],K[X]);break;case 104:this.$=K[X-5],W.setLink(K[X-4],K[X-2],K[X]),W.setTooltip(K[X-4],K[X-1]);break;case 105:this.$=K[X-2],W.setCssStyle(K[X-1],K[X]);break;case 106:W.setCssClass(K[X-1],K[X]);break;case 107:this.$=[K[X]];break;case 108:K[X-2].push(K[X]),this.$=K[X-2];break;case 110:this.$=K[X-1]+K[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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A},{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:N,70:_,71:I,72:O,73:D,74:$}),{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:C,102:E},{16:39,17:40,19:70,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:71,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:72,60:f,86:S,100:C,102:E,103:A},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:C,102:E,103:A},{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(H,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:C,102:E,103:A}),t(H,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:87,60:f,86:S,100:C,102:E,103:A},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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A}),{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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A},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:C,102:E,103:A},{53:92,66:56,67:57,68:P,69:N,70:_,71:I,72:O,73:D,74:$},t(L,[2,64]),{67:93,73:D,74:$},t(V,[2,83],{66:94,68:P,69:N,70:_,71:I,72:O}),t(q,[2,84]),t(q,[2,85]),t(q,[2,86]),t(q,[2,87]),t(q,[2,88]),t(G,[2,89]),t(G,[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:C,102:E},{41:[1,102],45:101,51:Q},{16:104,60:f,86:S,100:C,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:j,50:ae,59:110,60:Z,82:J,84:111,85:112,86:re,87:ee,88:me,89:te,90:$e},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:j,50:ae,59:124,60:Z,61:[1,125],82:J,84:111,85:112,86:re,87:ee,88:me,89:te,90:$e},t(Oe,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:C,102:E,103:A},t(H,[2,16]),t(H,[2,17]),t(H,[2,18]),{11:127,12:He,39:[2,36]},t(ue,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:C,102:E,103:A}),t(ue,[2,10]),t(ce,[2,55],{11:131,12:He}),t(M,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:C,102:E,103:A},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:C,102:E,103:A},t(V,[2,82],{66:136,68:P,69:N,70:_,71:I,72:O}),t(V,[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:Q},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:C,102:E,103:A},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:ge}),t(Ve,[2,107],{85:154,22:j,50:ae,60:Z,82:J,86:re,87:ee,88:me,89:te,90:$e}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[2,119]),t(L,[2,106]),t(F,[2,71]),t(L,[2,73],{61:ge}),{60:[1,155]},t(H,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:C,102:E,103:A},t(ue,[2,12]),t(ce,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:C,102:E,103:A},t(V,[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:Q},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:j,50:ae,60:Z,82:J,84:169,85:112,86:re,87:ee,88:me,89:te,90:$e},t(we,[2,110]),t(Oe,[2,75]),{14:[1,170]},t(ue,[2,11]),t(Te,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Q},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Ve,[2,108],{85:154,22:j,50:ae,60:Z,82:J,86:re,87:ee,88:me,89:te,90:$e}),t(ce,[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:w(function(Ce,oe){if(oe.recoverable)this.trace(Ce);else{var fe=new Error(Ce);throw fe.hash=oe,fe}},"parseError"),parse:w(function(Ce){var oe=this,fe=[0],W=[],se=[null],K=[],de=this.table,X="",Fe=0,ke=0,Ye=2,Ie=1,ze=K.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(Ke.yy[Be]=this.yy[Be]);De.setInput(Ce,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var nt=De.yylloc;K.push(nt);var Le=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(St){fe.length=fe.length-2*St,se.length=se.length-St,K.length=K.length-St}w(pt,"popStack");function Me(){var St;return St=W.pop()||De.lex()||Ie,typeof St!="number"&&(St instanceof Array&&(W=St,St=W.pop()),St=oe.symbols_[St]||St),St}w(Me,"lex");for(var Ct,wt,ht,Bt,At={},mt,ye,Nt,yt;;){if(wt=fe[fe.length-1],this.defaultActions[wt]?ht=this.defaultActions[wt]:((Ct===null||typeof Ct>"u")&&(Ct=Me()),ht=de[wt]&&de[wt][Ct]),typeof ht>"u"||!ht.length||!ht[0]){var gt="";yt=[];for(mt in de[wt])this.terminals_[mt]&&mt>Ye&&yt.push("'"+this.terminals_[mt]+"'");De.showPosition?gt="Parse error on line "+(Fe+1)+`: +`;S.append("path").attr("d",C),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;E0.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${x}, ${k})`),e.rectData=y,A0(r,Ha(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${RO}`},r);const A=S.select("path:last-child");if(A.node()){const L=A.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"),yur=w(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||(Sn++,u.append("line").attr("id","actor"+Sn).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=Sn);const y=t.append("g");let v=vy;n?v+=` ${Bg}`:v+=` ${Pg}`,y.attr("class",v),y.attr("name",e.name);const x=Nc();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor",y.append("line").attr("id","actor-man-torso"+Sn).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"+Sn).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;E0.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const T=y.node().getBBox();return e.height=T.height+(r.sequence.labelBoxHeight??0),A0(r,Ha(e.description))(e.description,y,x.x,x.y+15,x.width,x.height,{class:`actor ${vy}`},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"),vur=w(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||(Sn++,g.append("line").attr("id","actor"+Sn).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=Sn);const m=t.append("g");let y=vy;n?y+=` ${Bg}`:y+=` ${Pg}`,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,x=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Sn).attr("x1",s).attr("y1",x+25*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("id","actor-man-arms"+Sn).attr("x1",s-f1/2*v).attr("y1",x+33*v).attr("x2",s+f1/2*v).attr("y2",x+33*v),m.append("line").attr("x1",s-f1/2*v).attr("y1",x+60*v).attr("x2",s).attr("y2",x+45*v),m.append("line").attr("x1",s).attr("y1",x+45*v).attr("x2",s+(f1/2-2)*v).attr("y2",x+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",x+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const T=m.node().getBBox();e.height=T.height;const k=Nc();k.x=e.x,k.y=x,k.fill="#eaeaea",k.width=e.width,k.height=e.height/v,k.class="actor",k.rx=3,k.ry=3;const S=i.get(e.name)??0;return E0.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),A0(r,Ha(e.description))(e.description,m,k.x,x+35*v-(l==="neo"?10:0),k.width,k.height,{class:`actor ${vy}`},r),e.height},"drawActorTypeActor"),bur=w(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 vur(t,e,r,n,o);case"participant":return await hur(t,e,r,n,o);case"boundary":return await yur(t,e,r,n,o);case"control":return await pur(t,e,r,n,i,o);case"entity":return await gur(t,e,r,n,o);case"database":return await mur(t,e,r,n,o);case"collections":return await dur(t,e,r,n,o);case"queue":return await fur(t,e,r,n,o)}},"drawActor"),xur=w(function(t,e,r){const i=t.append("g");Iqe(i,e),e.name&&A0(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),wur=w(function(t){return t.append("g")},"anchorElement"),Tur=w(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Nc(),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=U6(p,f),v=(s??new Map([...a.db.getActors().values()].map((x,b)=>[x.name,b]))).get(g)??0;E0.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),kur=w(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=w(function(y,v,x,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",x).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=Cee();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",Mqe(f,g),g=$qe(),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=Ha(g.text)?await GI(f,g,e):b3(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,Ha(g.text)?(e.starty=e.sections[y].y,await GI(f,g,e)):b3(f,g);let x=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,T)=>b+T));e.sections[y].height+=x-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),Iqe=w(function(t,e){YLe(t,e)},"drawBackgroundRect"),Cur=w(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"),Sur=w(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"),Eur=w(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"),Aur=w(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"),Rur=w(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"),_ur=w(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"),Mur=w(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"),Lur=w(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"),$qe=w(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"),Iur=w(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),A0=(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)}w(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=c0(p),x=a.split(Ft.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:w(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:w(function(t){this.boxes.push(t)},"addBox"),addActor:w(function(t){this.actors.push(t)},"addActor"),addLoop:w(function(t){this.loops.push(t)},"addLoop"),addMessage:w(function(t){this.messages.push(t)},"addMessage"),addNote:w(function(t){this.notes.push(t)},"addNote"),lastActor:w(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:w(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:w(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:w(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:w(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,Oqe(We())},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=this;let a=0;function s(o){return w(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*et.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*et.boxMargin,Math.max),i.updateVal(_t.data,"startx",t-h*et.boxMargin,Math.min),i.updateVal(_t.data,"stopx",r+h*et.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*et.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*et.boxMargin,Math.max),i.updateVal(_t.data,"starty",e-h*et.boxMargin,Math.min),i.updateVal(_t.data,"stopy",n+h*et.boxMargin,Math.max))},"updateItemBounds")}w(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:w(function(t,e,r,n){const i=Ft.getMin(t,r),a=Ft.getMax(t,r),s=Ft.getMin(e,n),o=Ft.getMax(e,n);this.updateVal(_t.data,"startx",i,Math.min),this.updateVal(_t.data,"starty",s,Math.min),this.updateVal(_t.data,"stopx",a,Math.max),this.updateVal(_t.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:w(function(t,e,r){const n=r.get(t.from),i=MO(t.from).length||0,a=n.x+n.width/2+(i-1)*et.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+et.activationWidth,stopy:void 0,actor:t.from,anchored:Ei.anchorElement(e)})},"newActivation"),endActivation:w(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:w(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:w(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:w(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:w(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:w(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:_t.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:w(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:w(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Ft.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return{bounds:this.data,models:this.models}},"getBounds")},Bur=w(async function(t,e,r){_t.bumpVerticalPos(et.boxMargin),e.height=et.boxMargin,e.starty=_t.getVerticalPos();const n=Nc();n.x=e.startx,n.y=e.starty,n.width=e.width||et.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Ei.drawRect(i,n),s=Cee();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=et.noteFontFamily,s.fontSize=et.noteFontSize,s.fontWeight=et.noteFontWeight,s.anchor=et.noteAlign,s.textMargin=et.noteMargin,s.valign="center";const o=Ha(s.text)?await GI(i,s):b3(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*et.noteMargin),e.height+=l+2*et.noteMargin,_t.bumpVerticalPos(l+2*et.noteMargin),e.stopy=e.starty+l+2*et.noteMargin,e.stopx=e.startx+n.width,_t.insert(e.startx,e.starty,e.stopx,e.stopy),_t.models.addNote(e)},"drawNote"),V1e=w(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=zqe(e,n),m=t.append("g"),y=16.5,v=w((S,C)=>{const E=S?y:-y;return C?-E:E},"getCircleOffset"),x=w(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:T,CENTRAL_CONNECTION_DUAL:k}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case T:g||(d+=v(p,!1));break;case k:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:x(f);break;case T:x(d);break;case k:x(d),x(f);break}},"drawCentralConnection"),by=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),_2=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Rj=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Nqe(t,e){_t.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Ft.splitBreaks(i).length,s=Ha(i),o=s?await cE(i,We()):Vr.calculateTextDimensions(i,by(et));if(!s){const d=o.height/a;e.height+=d,_t.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=_t.getVerticalPos()+u,et.rightAngles||(u+=et.boxMargin,l=_t.getVerticalPos()+u),u+=30;const d=Ft.getMax(h/2,et.width/2);_t.insert(r-d,_t.getVerticalPos()-10+u,n+d,_t.getVerticalPos()+30+u)}else u+=et.boxMargin,l=_t.getVerticalPos()+u,_t.insert(r,l-10,n,l);return _t.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,_t.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}w(Nqe,"boundMessage");var Fur=w(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=Vr.calculateTextDimensions(u,by(et)),g=Cee();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=et.messageFontFamily,g.fontSize=et.messageFontSize,g.fontWeight=et.messageFontWeight,g.anchor=et.messageAlign,g.valign="center",g.textMargin=et.wrapPadding,g.tspan=!1,Ha(g.text)?await GI(t,g,{startx:s,stopx:o,starty:r}):b3(t,g);const m=p.width;let y;if(s===o){const x=f||et.showSequenceNumbers,b=zqe(i,n),T=Uur(i,n),k=s+(x&&(b||T)?10:0);et.rightAngles?y=t.append("path").attr("d",`M ${k},${r} H ${s+Ft.getMax(et.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+k+","+r+" C "+(k+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),kH(i,n)&&V1e(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),kH(i,n)&&V1e(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(et.arrowMarkerAbsolute&&(v=b$(!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||et.showSequenceNumbers){const x=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,T=6,k=kH(i,n);let S=s,C=o;x?(ss?C=o-2*T:(C=o-T,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),C+=k?15:0,y.attr("x2",C),y.attr("x1",S)):y.attr("x1",s+T);let E=0;const A=s===o,M=s<=o;A?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"),zur=w(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||_t.models.addBox(u),l+=et.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Ft.getMax(f.width||et.width,et.width),f.height=Ft.getMax(f.height||et.height,et.height),f.margin=f.margin||et.actorMargin,h=Ft.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=_t.getVerticalPos(),_t.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,_t.models.addActor(f)}u&&!s&&_t.models.addBox(u),_t.bumpVerticalPos(h)},"addActorRenderingData"),_j=w(async function(t,e,r,n,i,a,s){if(n){let o=0;_t.bumpVerticalPos(et.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=_t.getVerticalPos());const h=await Ei.drawActor(t,u,et,!0,i,a,s);o=Ft.getMax(o,h)}_t.bumpVerticalPos(o+et.boxMargin)}else for(const o of r){const l=e.get(o);await Ei.drawActor(t,l,et,!1,i,a,s)}},"drawActors"),Dqe=w(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=Vur(o),u=Ei.drawPopup(t,o,l,et,et.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),Oqe=w(function(t){ja(et,t),t.fontFamily&&(et.actorFontFamily=et.noteFontFamily=et.messageFontFamily=t.fontFamily),t.fontSize&&(et.actorFontSize=et.noteFontSize=et.messageFontSize=t.fontSize),t.fontWeight&&(et.actorFontWeight=et.noteFontWeight=et.messageFontWeight=t.fontWeight)},"setConf"),MO=w(function(t){return _t.activations.filter(function(e){return e.actor===t})},"actorActivations"),W1e=w(function(t,e){const r=e.get(t),n=MO(t),i=n.reduce(function(s,o){return Ft.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Ft.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function ku(t,e,r,n,i){_t.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=by(et);e.message=Vr.wrapLabel(`[${e.message}]`,s-2*et.wrapPadding,o),e.width=s,e.wrap=!0;const l=Vr.calculateTextDimensions(e.message,o),u=Ft.getMax(l.height,et.labelBoxHeight);a=n+u,he.debug(`${u} - ${e.message}`)}i(e),_t.bumpVerticalPos(a)}w(ku,"adjustLoopHeightForWrap");function Pqe(t,e,r,n,i,a,s){function o(h,d){h.x{B.add(V.from),B.add(V.to)}),y=y.filter(V=>B.has(V))}const S=new Map(y.map((B,V)=>{var q;return[((q=f.get(B))==null?void 0:q.name)??B,V]}));zur(d,f,p,y,0,v,!1);const C=await jur(v,f,k,n);Ei.insertArrowHead(d,e),Ei.insertArrowCrossHead(d,e),Ei.insertArrowFilledHead(d,e),Ei.insertSequenceNumber(d,e),Ei.insertSolidTopArrowHead(d,e),Ei.insertSolidBottomArrowHead(d,e),Ei.insertStickTopArrowHead(d,e),Ei.insertStickBottomArrowHead(d,e),s==="neo"&&Ei.insertDropShadow(d,et);function E(B,V){const q=_t.endActivation(B);q.starty+18>V&&(q.starty=V-6,V+=12),Ei.drawActivation(d,q,V,et,MO(B.from).length,n,S),_t.insert(q.startx,V-10,q.stopx,V)}w(E,"activeEnd");let A=1,M=1;const L=[],P=[];let N=0;for(const B of v){let V,q,G;switch(B.type){case n.db.LINETYPE.NOTE:_t.resetVerticalPos(),q=B.noteModel,await Bur(d,q,B.id);break;case n.db.LINETYPE.ACTIVE_START:_t.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:_t.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:_t.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,_t.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.LOOP_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"loop",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.RECT_START:ku(C,B,et.boxMargin,et.boxMargin,Q=>{let j=Q.message;j||(j=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),_t.newLoop(void 0,j)});break;case n.db.LINETYPE.RECT_END:V=_t.endLoop(),P.push(V),_t.models.addLoop(V),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos());break;case n.db.LINETYPE.OPT_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.OPT_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"opt",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.ALT_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.ALT_ELSE:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.ALT_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"alt",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q)),_t.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.PAR_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"par",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.AUTONUMBER:A=B.message.start||A,M=B.message.step||M,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.CRITICAL_OPTION:ku(C,B,et.boxMargin+et.boxTextMargin,et.boxMargin,Q=>_t.addSectionToLoop(Q));break;case n.db.LINETYPE.CRITICAL_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"critical",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;case n.db.LINETYPE.BREAK_START:ku(C,B,et.boxMargin,et.boxMargin+et.boxTextMargin,Q=>_t.newLoop(Q));break;case n.db.LINETYPE.BREAK_END:V=_t.endLoop(),await Ei.drawLoop(d,V,"break",et,B),_t.bumpVerticalPos(V.stopy-_t.getVerticalPos()),_t.models.addLoop(V);break;default:try{G=B.msgModel,G.starty=_t.getVerticalPos(),G.sequenceIndex=A,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=B.id,G.from=B.from,G.to=B.to;const Q=await Nqe(d,G);Pqe(B,G,Q,N,f,p,g),L.push({messageModel:G,lineStartY:Q,msg:B}),_t.models.addMessage(G)}catch(Q){he.error("error while drawing message",Q)}}[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)&&(A=Math.round((A+M)*100)/100),N++}he.debug("createdActors",p),he.debug("destroyedActors",g),await _j(d,f,y,!1,e,n,S);for(const B of L)await Fur(d,B.messageModel,B.lineStartY,n,B.msg,e);et.mirrorActors&&await _j(d,f,y,!0,e,n,S),P.forEach(B=>Ei.drawBackgroundRect(d,B)),Lqe(d,f,y,et);for(const B of _t.models.boxes){B.height=_t.getVerticalPos()-B.y,_t.insert(B.x,B.y,B.x+B.width,B.height);const V=et.boxMargin*2;B.startx=B.x-V,B.starty=B.y-V*.25,B.stopx=B.startx+B.width+2*V,B.stopy=B.starty+B.height+V*.75,B.stroke="rgb(0,0,0, 0.5)",Ei.drawBox(d,B,et)}b&&_t.bumpVerticalPos(et.boxMargin);const _=Dqe(d,f,y,h),{bounds:I}=_t.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 O=I.stopy-I.starty;O<_.maxHeight&&(O=_.maxHeight);let D=O+2*et.diagramMarginY;et.mirrorActors&&(D=D-et.boxMargin+et.bottomMarginAdj);let $=I.stopx-I.startx;$<_.maxWidth&&($=_.maxWidth);const F=$+2*et.diagramMarginX;x&&d.append("text").text(x).attr("x",(I.stopx-I.startx)/2-2*et.diagramMarginX).attr("y",-25),_a(d,D,F,et.useMaxWidth);const z=x?40:0,H=f.size&&s==="neo"?30:0;d.attr("viewBox",I.startx-et.diagramMarginX+" -"+(et.diagramMarginY+z)+" "+F+" "+(D+z+H)),he.debug("models:",_t.models)},"draw");async function Bqe(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const a=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!a.prevActor||i.placement===r.db.PLACEMENT.RIGHTOF&&!a.nextActor)continue;const s=i.placement!==void 0,o=!s,l=s?_2(et):by(et),u=i.wrap?Vr.wrapLabel(i.message,et.width-2*et.wrapPadding,l):i.message,d=(Ha(u)?await cE(i.message,We()):Vr.calculateTextDimensions(u,l)).width+2*et.wrapPadding;o&&i.from===a.nextActor?n[i.to]=Ft.getMax(n[i.to]||0,d):o&&i.from===a.prevActor?n[i.from]=Ft.getMax(n[i.from]||0,d):o&&i.from===i.to?(n[i.from]=Ft.getMax(n[i.from]||0,d/2),n[i.to]=Ft.getMax(n[i.to]||0,d/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=Ft.getMax(n[i.from]||0,d):i.placement===r.db.PLACEMENT.LEFTOF?n[a.prevActor]=Ft.getMax(n[a.prevActor]||0,d):i.placement===r.db.PLACEMENT.OVER&&(a.prevActor&&(n[a.prevActor]=Ft.getMax(n[a.prevActor]||0,d/2)),a.nextActor&&(n[i.from]=Ft.getMax(n[i.from]||0,d/2)))}return he.debug("maxMessageWidthPerActor:",n),n}w(Bqe,"getMaxMessageWidthPerActor");var Vur=w(function(t){let e=0;const r=Rj(et);for(const n in t.links){const a=Vr.calculateTextDimensions(n,r).width+2*et.wrapPadding+2*et.boxMargin;e{const s=by(et);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=et.boxMargin*8;o+=l,o-=2*et.boxTextMargin,a.wrap&&(a.name=Vr.wrapLabel(a.name,o-2*et.wrapPadding,s));const u=Vr.calculateTextDimensions(a.name,s);i=Ft.getMax(u.height,i);const h=Ft.getMax(o,u.width+2*et.wrapPadding);if(a.margin=et.boxTextMargin,oa.textMaxHeight=i),Ft.getMax(n,et.height)}w(Fqe,"calculateActorMargins");var Wur=w(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=Ha(t.message)?await cE(t.message,We()):Vr.calculateTextDimensions(o?Vr.wrapLabel(t.message,et.width,_2(et)):t.message,_2(et));const u={width:o?et.width:Ft.getMax(et.width,l.width+2*et.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?Ft.getMax(et.width,l.width):Ft.getMax(n.width/2+i.width/2,l.width+2*et.noteMargin),u.startx=a+(n.width+et.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Ft.getMax(et.width,l.width+2*et.noteMargin):Ft.getMax(n.width/2+i.width/2,l.width+2*et.noteMargin),u.startx=a-u.width+(n.width-et.actorMargin)/2):t.to===t.from?(l=Vr.calculateTextDimensions(o?Vr.wrapLabel(t.message,Ft.getMax(et.width,n.width),_2(et)):t.message,_2(et)),u.width=o?Ft.getMax(et.width,n.width):Ft.getMax(n.width,et.width,l.width+2*et.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+et.actorMargin,u.startx=a2,f=w(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(et.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=Vr.wrapLabel(t.message,Ft.getMax(g+2*et.wrapPadding,et.width),by(et)));const m=Vr.calculateTextDimensions(t.message,by(et));return{width:Ft.getMax(t.wrap?0:m.width+2*et.wrapPadding,g+2*et.wrapPadding,et.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"),jur=w(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=MO(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*et.activationWidth/2,g={startx:p,stopx:p+et.activationWidth,actor:u.from,enabled:!0};_t.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=_t.activations.map(f=>f.actor).lastIndexOf(u.from);_t.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await Wur(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Ft.getMin(s.from,o.startx),s.to=Ft.getMax(s.to,o.startx+o.width),s.width=Ft.getMax(s.width,Math.abs(s.from-s.to))-et.labelBoxWidth})):(l=Yur(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=Ft.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Ft.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Ft.getMax(s.width,Math.abs(s.to-s.from))-et.labelBoxWidth}else s.from=Ft.getMin(l.startx,s.from),s.to=Ft.getMax(l.stopx,s.to),s.width=Ft.getMax(s.width,l.width)-et.labelBoxWidth}))}return _t.activations=[],he.debug("Loop type widths:",i),i},"calculateLoopBounds"),Xur={bounds:_t,drawActors:_j,drawActorsPopup:Dqe,setConf:Oqe,draw:Hur},Kur={parser:nur,get db(){return new our},renderer:Xur,styles:cur,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,BV({sequence:{wrap:t.wrap}}))},"init")};const Zur=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kur},Symbol.toStringTag,{value:"Module"}));var Mj=(function(){var t=w(function(pe,Ce,oe,fe){for(oe=oe||{},fe=pe.length;fe--;oe[pe[fe]]=Ce);return oe},"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],x=[1,28],b=[1,29],T=[1,30],k=[1,31],S=[1,44],C=[1,46],E=[1,43],A=[1,47],M=[1,9],L=[1,8,9],P=[1,58],N=[1,59],_=[1,60],I=[1,61],O=[1,62],D=[1,63],$=[1,64],F=[1,8,9,41],z=[1,77],H=[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],V=[13,60,86,100,102,103],q=[13,60,73,74,86,100,102,103],G=[13,60,68,69,70,71,72,86,100,102,103],Q=[1,103],j=[1,121],ae=[1,117],Z=[1,113],J=[1,119],re=[1,114],ee=[1,115],me=[1,116],te=[1,118],$e=[1,120],Oe=[22,50,60,61,82,86,87,88,89,90],He=[1,128],ue=[12,39],ce=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],Ve=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ae={trace:w(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:w(function(Ce,oe,fe,W,se,K,de){var X=K.length-1;switch(se){case 8:this.$=K[X-1];break;case 9:case 10:case 13:case 15:this.$=K[X];break;case 11:case 14:this.$=K[X-2]+"."+K[X];break;case 12:case 16:this.$=K[X-1]+K[X];break;case 17:case 18:this.$=K[X-1]+"~"+K[X]+"~";break;case 19:W.addRelation(K[X]);break;case 20:K[X-1].title=W.cleanupLabel(K[X]),W.addRelation(K[X-1]);break;case 31:this.$=K[X].trim(),W.setAccTitle(this.$);break;case 32:case 33:this.$=K[X].trim(),W.setAccDescription(this.$);break;case 34:W.addClassesToNamespace(K[X-3],K[X-1][0],K[X-1][1]),W.popNamespace();break;case 35:W.addClassesToNamespace(K[X-4],K[X-1][0],K[X-1][1]),W.popNamespace();break;case 36:this.$=W.addNamespace(K[X]);break;case 37:this.$=W.addNamespace(K[X-1],K[X]);break;case 38:this.$=[[K[X]],[]];break;case 39:this.$=[[K[X-1]],[]];break;case 40:K[X][0].unshift(K[X-2]),this.$=K[X];break;case 41:this.$=[[],[K[X]]];break;case 42:this.$=[[],[K[X-1]]];break;case 43:K[X][1].unshift(K[X-2]),this.$=K[X];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=K[X];break;case 48:W.setCssClass(K[X-2],K[X]);break;case 49:W.addMembers(K[X-3],K[X-1]);break;case 51:W.setCssClass(K[X-5],K[X-3]),W.addMembers(K[X-5],K[X-1]);break;case 52:W.addAnnotation(K[X-3],K[X-1]);break;case 53:W.addAnnotation(K[X-6],K[X-4]),W.addMembers(K[X-6],K[X-1]);break;case 54:W.addAnnotation(K[X-5],K[X-3]);break;case 55:this.$=K[X],W.addClass(K[X]);break;case 56:this.$=K[X-1],W.addClass(K[X-1]),W.setClassLabel(K[X-1],K[X]);break;case 60:W.addAnnotation(K[X],K[X-2]);break;case 61:case 74:this.$=[K[X]];break;case 62:K[X].push(K[X-1]),this.$=K[X];break;case 63:break;case 64:W.addMember(K[X-1],W.cleanupLabel(K[X]));break;case 65:break;case 66:break;case 67:this.$={id1:K[X-2],id2:K[X],relation:K[X-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:K[X-3],id2:K[X],relation:K[X-1],relationTitle1:K[X-2],relationTitle2:"none"};break;case 69:this.$={id1:K[X-3],id2:K[X],relation:K[X-2],relationTitle1:"none",relationTitle2:K[X-1]};break;case 70:this.$={id1:K[X-4],id2:K[X],relation:K[X-2],relationTitle1:K[X-3],relationTitle2:K[X-1]};break;case 71:this.$=W.addNote(K[X],K[X-1]);break;case 72:this.$=W.addNote(K[X]);break;case 73:this.$=K[X-2],W.defineClass(K[X-1],K[X]);break;case 75:this.$=K[X-2].concat([K[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:K[X-2],type2:K[X],lineType:K[X-1]};break;case 81:this.$={type1:"none",type2:K[X],lineType:K[X-1]};break;case 82:this.$={type1:K[X-1],type2:"none",lineType:K[X]};break;case 83:this.$={type1:"none",type2:"none",lineType:K[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.$=K[X-2],W.setClickEvent(K[X-1],K[X]);break;case 92:case 98:this.$=K[X-3],W.setClickEvent(K[X-2],K[X-1]),W.setTooltip(K[X-2],K[X]);break;case 93:this.$=K[X-2],W.setLink(K[X-1],K[X]);break;case 94:this.$=K[X-3],W.setLink(K[X-2],K[X-1],K[X]);break;case 95:this.$=K[X-3],W.setLink(K[X-2],K[X-1]),W.setTooltip(K[X-2],K[X]);break;case 96:this.$=K[X-4],W.setLink(K[X-3],K[X-2],K[X]),W.setTooltip(K[X-3],K[X-1]);break;case 99:this.$=K[X-3],W.setClickEvent(K[X-2],K[X-1],K[X]);break;case 100:this.$=K[X-4],W.setClickEvent(K[X-3],K[X-2],K[X-1]),W.setTooltip(K[X-3],K[X]);break;case 101:this.$=K[X-3],W.setLink(K[X-2],K[X]);break;case 102:this.$=K[X-4],W.setLink(K[X-3],K[X-1],K[X]);break;case 103:this.$=K[X-4],W.setLink(K[X-3],K[X-1]),W.setTooltip(K[X-3],K[X]);break;case 104:this.$=K[X-5],W.setLink(K[X-4],K[X-2],K[X]),W.setTooltip(K[X-4],K[X-1]);break;case 105:this.$=K[X-2],W.setCssStyle(K[X-1],K[X]);break;case 106:W.setCssClass(K[X-1],K[X]);break;case 107:this.$=[K[X]];break;case 108:K[X-2].push(K[X]),this.$=K[X-2];break;case 110:this.$=K[X-1]+K[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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A},{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:N,70:_,71:I,72:O,73:D,74:$}),{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:C,102:E},{16:39,17:40,19:70,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:71,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:72,60:f,86:S,100:C,102:E,103:A},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:C,102:E,103:A},{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(H,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:C,102:E,103:A}),t(H,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:C,102:E,103:A},{16:39,17:40,19:87,60:f,86:S,100:C,102:E,103:A},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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A}),{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:x,78:b,82:T,83:k,86:S,100:C,102:E,103:A},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:C,102:E,103:A},{53:92,66:56,67:57,68:P,69:N,70:_,71:I,72:O,73:D,74:$},t(L,[2,64]),{67:93,73:D,74:$},t(V,[2,83],{66:94,68:P,69:N,70:_,71:I,72:O}),t(q,[2,84]),t(q,[2,85]),t(q,[2,86]),t(q,[2,87]),t(q,[2,88]),t(G,[2,89]),t(G,[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:C,102:E},{41:[1,102],45:101,51:Q},{16:104,60:f,86:S,100:C,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:j,50:ae,59:110,60:Z,82:J,84:111,85:112,86:re,87:ee,88:me,89:te,90:$e},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:j,50:ae,59:124,60:Z,61:[1,125],82:J,84:111,85:112,86:re,87:ee,88:me,89:te,90:$e},t(Oe,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:C,102:E,103:A},t(H,[2,16]),t(H,[2,17]),t(H,[2,18]),{11:127,12:He,39:[2,36]},t(ue,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:C,102:E,103:A}),t(ue,[2,10]),t(ce,[2,55],{11:131,12:He}),t(M,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:C,102:E,103:A},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:C,102:E,103:A},t(V,[2,82],{66:136,68:P,69:N,70:_,71:I,72:O}),t(V,[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:Q},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:C,102:E,103:A},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:ge}),t(Ve,[2,107],{85:154,22:j,50:ae,60:Z,82:J,86:re,87:ee,88:me,89:te,90:$e}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[2,119]),t(L,[2,106]),t(F,[2,71]),t(L,[2,73],{61:ge}),{60:[1,155]},t(H,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:C,102:E,103:A},t(ue,[2,12]),t(ce,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:C,102:E,103:A},t(V,[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:Q},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:j,50:ae,60:Z,82:J,84:169,85:112,86:re,87:ee,88:me,89:te,90:$e},t(we,[2,110]),t(Oe,[2,75]),{14:[1,170]},t(ue,[2,11]),t(Te,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Q},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Ve,[2,108],{85:154,22:j,50:ae,60:Z,82:J,86:re,87:ee,88:me,89:te,90:$e}),t(ce,[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:w(function(Ce,oe){if(oe.recoverable)this.trace(Ce);else{var fe=new Error(Ce);throw fe.hash=oe,fe}},"parseError"),parse:w(function(Ce){var oe=this,fe=[0],W=[],se=[null],K=[],de=this.table,X="",Fe=0,ke=0,Ye=2,Ie=1,ze=K.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var Be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Be)&&(Ke.yy[Be]=this.yy[Be]);De.setInput(Ce,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var nt=De.yylloc;K.push(nt);var Le=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(St){fe.length=fe.length-2*St,se.length=se.length-St,K.length=K.length-St}w(pt,"popStack");function Me(){var St;return St=W.pop()||De.lex()||Ie,typeof St!="number"&&(St instanceof Array&&(W=St,St=W.pop()),St=oe.symbols_[St]||St),St}w(Me,"lex");for(var Ct,wt,ht,Bt,At={},mt,ye,Nt,yt;;){if(wt=fe[fe.length-1],this.defaultActions[wt]?ht=this.defaultActions[wt]:((Ct===null||typeof Ct>"u")&&(Ct=Me()),ht=de[wt]&&de[wt][Ct]),typeof ht>"u"||!ht.length||!ht[0]){var gt="";yt=[];for(mt in de[wt])this.terminals_[mt]&&mt>Ye&&yt.push("'"+this.terminals_[mt]+"'");De.showPosition?gt="Parse error on line "+(Fe+1)+`: `+De.showPosition()+` Expecting `+yt.join(", ")+", got '"+(this.terminals_[Ct]||Ct)+"'":gt="Parse error on line "+(Fe+1)+": Unexpected "+(Ct==Ie?"end of input":"'"+(this.terminals_[Ct]||Ct)+"'"),this.parseError(gt,{text:De.match,token:this.terminals_[Ct]||Ct,line:De.yylineno,loc:nt,expected:yt})}if(ht[0]instanceof Array&&ht.length>1)throw new Error("Parse Error: multiple actions possible at state: "+wt+", token: "+Ct);switch(ht[0]){case 1:fe.push(Ct),se.push(De.yytext),K.push(De.yylloc),fe.push(ht[1]),Ct=null,ke=De.yyleng,X=De.yytext,Fe=De.yylineno,nt=De.yylloc;break;case 2:if(ye=this.productions_[ht[1]][1],At.$=se[se.length-ye],At._$={first_line:K[K.length-(ye||1)].first_line,last_line:K[K.length-1].last_line,first_column:K[K.length-(ye||1)].first_column,last_column:K[K.length-1].last_column},Le&&(At._$.range=[K[K.length-(ye||1)].range[0],K[K.length-1].range[1]]),Bt=this.performAction.apply(At,[X,ke,Fe,Ke.yy,ht[1],se,K].concat(ze)),typeof Bt<"u")return Bt;ye&&(fe=fe.slice(0,-1*ye*2),se=se.slice(0,-1*ye),K=K.slice(0,-1*ye)),fe.push(this.productions_[ht[1]][0]),se.push(At.$),K.push(At._$),Nt=de[fe[fe.length-2]][fe[fe.length-1]],fe.push(Nt);break;case 3:return!0}}return!0},"parse")},Ue=(function(){var pe={EOF:1,parseError:w(function(oe,fe){if(this.yy.parser)this.yy.parser.parseError(oe,fe);else throw new Error(oe)},"parseError"),setInput:w(function(Ce,oe){return this.yy=oe||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:w(function(){var Ce=this._input[0];this.yytext+=Ce,this.yyleng++,this.offset++,this.match+=Ce,this.matched+=Ce;var oe=Ce.match(/(?:\r\n?|\n).*/g);return oe?(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:w(function(Ce){var oe=Ce.length,fe=Ce.split(/(?:\r\n?|\n)/g);this._input=Ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-oe),this.offset-=oe;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),fe.length-1&&(this.yylineno-=fe.length-1);var se=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:fe?(fe.length===W.length?this.yylloc.first_column:0)+W[W.length-fe.length].length-fe[0].length:this.yylloc.first_column-oe},this.options.ranges&&(this.yylloc.range=[se[0],se[0]+this.yyleng-oe]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(Ce){this.unput(this.match.slice(Ce))},"less"),pastInput:w(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:w(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:w(function(){var Ce=this.pastInput(),oe=new Array(Ce.length+1).join("-");return Ce+this.upcomingInput()+` `+oe+"^"},"showPosition"),test_match:w(function(Ce,oe){var fe,W,se;if(this.options.backtrack_lexer&&(se={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(se.yylloc.range=this.yylloc.range.slice(0))),W=Ce[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+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],fe=this.performAction.call(this,this.yy,this,oe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),fe)return fe;if(this._backtrack){for(var K in se)this[K]=se[K];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ce,oe,fe,W;this._more||(this.yytext="",this.match="");for(var se=this._currentRules(),K=0;Koe[0].length)){if(oe=fe,W=K,this.options.backtrack_lexer){if(Ce=this.test_match(fe,se[K]),Ce!==!1)return Ce;if(this._backtrack){oe=!1;continue}else return!1}else if(!this.options.flex)break}return oe?(Ce=this.test_match(oe,se[W]),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:w(function(){var oe=this.next();return oe||this.lex()},"lex"),begin:w(function(oe){this.conditionStack.push(oe)},"begin"),popState:w(function(){var oe=this.conditionStack.length-1;return oe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(oe){return oe=this.conditionStack.length-1-Math.abs(oe||0),oe>=0?this.conditionStack[oe]:"INITIAL"},"topState"),pushState:w(function(oe){this.begin(oe)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(oe,fe,W,se){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 pe})();Ae.lexer=Ue;function le(){this.yy={}}return w(le,"Parser"),le.prototype=Ae,Ae.Parser=le,new le})();Rj.parser=Rj;var Bqe=Rj,W1e=["#","+","~","-",""],nT,q1e=(nT=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Tn(e,We());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+K0(this.id);this.memberType==="method"&&(e+=`(${K0(this.parameters.trim())})`,this.returnType&&(e+=" : "+K0(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(W1e.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);W1e.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:""}${K0(this.id)}${this.memberType==="method"?`(${K0(this.parameters)})${this.returnType?" : "+K0(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""}}},w(nT,"ClassMember"),nT),A8="classId-",G1e=0,am=w(t=>Ft.sanitizeText(t,We()),"sanitizeText"),Pp,Fqe=(Pp=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=w(e=>{const r=kee();bt(e).select("svg").selectAll("g").filter(function(){return bt(this).attr("title")!==null}).on("mouseover",a=>{const s=bt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(Ff.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),bt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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=Ft.sanitizeText(e,We());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=am(a[0]),n=am(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Ft.sanitizeText(e,We());r&&(r=am(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=Ft.sanitizeText(e,We()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Ft.sanitizeText(n,We());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:A8+a+"-"+G1e}),G1e++}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=Ft.sanitizeText(e,We());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",wi()}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){he.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=Ft.sanitizeText(e.relationTitle1.trim(),We()),e.relationTitle2=Ft.sanitizeText(e.relationTitle2.trim(),We()),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(am(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new q1e(a,"method")):a&&i.members.push(new q1e(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)),am(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=A8+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=am(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=We();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=A8+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=Vr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=am(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=Ft.sanitizeText(e,We());if(We().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",()=>{Vr.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=We(),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:ob(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()}}},w(Pp,"ClassDB"),Pp),Uur=w(t=>`g.classGroup text { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var oe=this.next();return oe||this.lex()},"lex"),begin:w(function(oe){this.conditionStack.push(oe)},"begin"),popState:w(function(){var oe=this.conditionStack.length-1;return oe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(oe){return oe=this.conditionStack.length-1-Math.abs(oe||0),oe>=0?this.conditionStack[oe]:"INITIAL"},"topState"),pushState:w(function(oe){this.begin(oe)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(oe,fe,W,se){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 pe})();Ae.lexer=Ue;function le(){this.yy={}}return w(le,"Parser"),le.prototype=Ae,Ae.Parser=le,new le})();Mj.parser=Mj;var Hqe=Mj,q1e=["#","+","~","-",""],nT,G1e=(nT=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Tn(e,We());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+K0(this.id);this.memberType==="method"&&(e+=`(${K0(this.parameters.trim())})`,this.returnType&&(e+=" : "+K0(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(q1e.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);q1e.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:""}${K0(this.id)}${this.memberType==="method"?`(${K0(this.parameters)})${this.returnType?" : "+K0(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""}}},w(nT,"ClassMember"),nT),R8="classId-",U1e=0,am=w(t=>Ft.sanitizeText(t,We()),"sanitizeText"),Pp,Vqe=(Pp=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=w(e=>{const r=See();bt(e).select("svg").selectAll("g").filter(function(){return bt(this).attr("title")!==null}).on("mouseover",a=>{const s=bt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(Ff.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),bt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=$i,this.getAccTitle=Yi,this.setAccDescription=ji,this.getAccDescription=Xi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getConfig=w(()=>We().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=Ft.sanitizeText(e,We());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=am(a[0]),n=am(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Ft.sanitizeText(e,We());r&&(r=am(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=Ft.sanitizeText(e,We()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Ft.sanitizeText(n,We());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:R8+a+"-"+U1e}),U1e++}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=Ft.sanitizeText(e,We());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",wi()}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){he.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=Ft.sanitizeText(e.relationTitle1.trim(),We()),e.relationTitle2=Ft.sanitizeText(e.relationTitle2.trim(),We()),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(am(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new G1e(a,"method")):a&&i.members.push(new G1e(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)),am(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=R8+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=am(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=We();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=R8+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=Vr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=am(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=Ft.sanitizeText(e,We());if(We().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",()=>{Vr.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=We(),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:ob(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()}}},w(Pp,"ClassDB"),Pp),Qur=w(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -3584,13 +3597,13 @@ g.classGroup line { } text-align: center; } - ${XE()} -`,"getStyles"),zqe=Uur,Yur=w((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"),jur=w(function(t,e){return e.db.getClasses()},"getClasses"),Xur=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=We();n.db.setDiagramId(e);const o=n.db.getData(),l=Q3(e,i);o.type=n.type,o.layoutAlgorithm=vE(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 I3(o,l);const u=8;Vr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Hqe={getClasses:jur,draw:Xur,getDir:Yur},Kur={parser:Bqe,get db(){return new Fqe},renderer:Hqe,styles:zqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Zur=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kur},Symbol.toStringTag,{value:"Module"}));var Qur={parser:Bqe,get db(){return new Fqe},renderer:Hqe,styles:zqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Jur=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qur},Symbol.toStringTag,{value:"Module"}));var _j=(function(){var t=w(function(F,z,H,B){for(H=H||{},B=F.length;B--;H[F[B]]=z);return H},"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],x=[1,27],b=[1,28],T=[1,29],k=[1,30],S=[1,31],C=[1,32],E=[1,35],A=[1,36],M=[1,37],L=[1,38],P=[1,34],N=[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],_=[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],O={trace:w(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:w(function(z,H,B,V,q,G,Q){var j=G.length-1;switch(q){case 3:return V.setRootDoc(G[j]),G[j];case 4:this.$=[];break;case 5:G[j]!="nl"&&(G[j-1].push(G[j]),this.$=G[j-1]);break;case 6:case 7:this.$=G[j];break;case 8:this.$="nl";break;case 12:this.$=G[j];break;case 13:const re=G[j-1];re.description=V.trimColon(G[j]),this.$=re;break;case 14:this.$={stmt:"relation",state1:G[j-2],state2:G[j]};break;case 15:const ee=V.trimColon(G[j]);this.$={stmt:"relation",state1:G[j-3],state2:G[j-1],description:ee};break;case 19:this.$={stmt:"state",id:G[j-3],type:"default",description:"",doc:G[j-1]};break;case 20:var ae=G[j],Z=G[j-2].trim();if(G[j].match(":")){var J=G[j].split(":");ae=J[0],Z=[Z,J[1]]}this.$={stmt:"state",id:ae,type:"default",description:Z};break;case 21:this.$={stmt:"state",id:G[j-3],type:"default",description:G[j-5],doc:G[j-1]};break;case 22:this.$={stmt:"state",id:G[j],type:"fork"};break;case 23:this.$={stmt:"state",id:G[j],type:"join"};break;case 24:this.$={stmt:"state",id:G[j],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:G[j-1].trim(),note:{position:G[j-2].trim(),text:G[j].trim()}};break;case 29:this.$=G[j].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=G[j].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:G[j-3],url:G[j-2],tooltip:G[j-1]};break;case 33:this.$={stmt:"click",id:G[j-3],url:G[j-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:G[j-1].trim(),classes:G[j].trim()};break;case 36:this.$={stmt:"style",id:G[j-1].trim(),styleClass:G[j].trim()};break;case 37:this.$={stmt:"applyClass",id:G[j-1].trim(),styleClass:G[j].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:G[j].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:G[j-2].trim(),classes:[G[j].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:G[j-2].trim(),classes:[G[j].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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,7]),t(N,[2,8]),t(N,[2,9]),t(N,[2,10]),t(N,[2,11]),t(N,[2,12],{14:[1,40],15:[1,41]}),t(N,[2,16]),{18:[1,42]},t(N,[2,18],{20:[1,43]}),{23:[1,44]},t(N,[2,22]),t(N,[2,23]),t(N,[2,24]),t(N,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(N,[2,28]),{34:[1,49]},{36:[1,50]},t(N,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(_,[2,44],{58:[1,56]}),t(_,[2,45],{58:[1,57]}),t(N,[2,38]),t(N,[2,39]),t(N,[2,40]),t(N,[2,41]),t(N,[2,6]),t(N,[2,13]),{13:58,24:d,57:P},t(N,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(N,[2,29]),t(N,[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(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(N,[2,34]),t(N,[2,35]),t(N,[2,36]),t(N,[2,37]),t(_,[2,46]),t(_,[2,47]),t(N,[2,15]),t(N,[2,19]),t(I,i,{7:78}),t(N,[2,26]),t(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,32]),t(N,[2,33]),t(N,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:w(function(z,H){if(H.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=H,B}},"parseError"),parse:w(function(z){var H=this,B=[0],V=[],q=[null],G=[],Q=this.table,j="",ae=0,Z=0,J=2,re=1,ee=G.slice.call(arguments,1),me=Object.create(this.lexer),te={yy:{}};for(var $e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$e)&&(te.yy[$e]=this.yy[$e]);me.setInput(z,te.yy),te.yy.lexer=me,te.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var Oe=me.yylloc;G.push(Oe);var He=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(fe){B.length=B.length-2*fe,q.length=q.length-fe,G.length=G.length-fe}w(ue,"popStack");function ce(){var fe;return fe=V.pop()||me.lex()||re,typeof fe!="number"&&(fe instanceof Array&&(V=fe,fe=V.pop()),fe=H.symbols_[fe]||fe),fe}w(ce,"lex");for(var Te,ge,Ve,we,Ae={},Ue,le,pe,Ce;;){if(ge=B[B.length-1],this.defaultActions[ge]?Ve=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=ce()),Ve=Q[ge]&&Q[ge][Te]),typeof Ve>"u"||!Ve.length||!Ve[0]){var oe="";Ce=[];for(Ue in Q[ge])this.terminals_[Ue]&&Ue>J&&Ce.push("'"+this.terminals_[Ue]+"'");me.showPosition?oe="Parse error on line "+(ae+1)+`: + ${KE()} +`,"getStyles"),Wqe=Qur,Jur=w((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"),ehr=w(function(t,e){return e.db.getClasses()},"getClasses"),thr=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=We();n.db.setDiagramId(e);const o=n.db.getData(),l=Q3(e,i);o.type=n.type,o.layoutAlgorithm=bE(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 I3(o,l);const u=8;Vr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),qqe={getClasses:ehr,draw:thr,getDir:Jur},rhr={parser:Hqe,get db(){return new Vqe},renderer:qqe,styles:Wqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const nhr=Object.freeze(Object.defineProperty({__proto__:null,diagram:rhr},Symbol.toStringTag,{value:"Module"}));var ihr={parser:Hqe,get db(){return new Vqe},renderer:qqe,styles:Wqe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const ahr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ihr},Symbol.toStringTag,{value:"Module"}));var Lj=(function(){var t=w(function(F,z,H,B){for(H=H||{},B=F.length;B--;H[F[B]]=z);return H},"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],x=[1,27],b=[1,28],T=[1,29],k=[1,30],S=[1,31],C=[1,32],E=[1,35],A=[1,36],M=[1,37],L=[1,38],P=[1,34],N=[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],_=[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],O={trace:w(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:w(function(z,H,B,V,q,G,Q){var j=G.length-1;switch(q){case 3:return V.setRootDoc(G[j]),G[j];case 4:this.$=[];break;case 5:G[j]!="nl"&&(G[j-1].push(G[j]),this.$=G[j-1]);break;case 6:case 7:this.$=G[j];break;case 8:this.$="nl";break;case 12:this.$=G[j];break;case 13:const re=G[j-1];re.description=V.trimColon(G[j]),this.$=re;break;case 14:this.$={stmt:"relation",state1:G[j-2],state2:G[j]};break;case 15:const ee=V.trimColon(G[j]);this.$={stmt:"relation",state1:G[j-3],state2:G[j-1],description:ee};break;case 19:this.$={stmt:"state",id:G[j-3],type:"default",description:"",doc:G[j-1]};break;case 20:var ae=G[j],Z=G[j-2].trim();if(G[j].match(":")){var J=G[j].split(":");ae=J[0],Z=[Z,J[1]]}this.$={stmt:"state",id:ae,type:"default",description:Z};break;case 21:this.$={stmt:"state",id:G[j-3],type:"default",description:G[j-5],doc:G[j-1]};break;case 22:this.$={stmt:"state",id:G[j],type:"fork"};break;case 23:this.$={stmt:"state",id:G[j],type:"join"};break;case 24:this.$={stmt:"state",id:G[j],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:G[j-1].trim(),note:{position:G[j-2].trim(),text:G[j].trim()}};break;case 29:this.$=G[j].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=G[j].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:G[j-3],url:G[j-2],tooltip:G[j-1]};break;case 33:this.$={stmt:"click",id:G[j-3],url:G[j-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:G[j-1].trim(),classes:G[j].trim()};break;case 36:this.$={stmt:"style",id:G[j-1].trim(),styleClass:G[j].trim()};break;case 37:this.$={stmt:"applyClass",id:G[j-1].trim(),styleClass:G[j].trim()};break;case 38:V.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:V.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:V.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:V.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:G[j].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:G[j-2].trim(),classes:[G[j].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:G[j-2].trim(),classes:[G[j].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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,7]),t(N,[2,8]),t(N,[2,9]),t(N,[2,10]),t(N,[2,11]),t(N,[2,12],{14:[1,40],15:[1,41]}),t(N,[2,16]),{18:[1,42]},t(N,[2,18],{20:[1,43]}),{23:[1,44]},t(N,[2,22]),t(N,[2,23]),t(N,[2,24]),t(N,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(N,[2,28]),{34:[1,49]},{36:[1,50]},t(N,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(_,[2,44],{58:[1,56]}),t(_,[2,45],{58:[1,57]}),t(N,[2,38]),t(N,[2,39]),t(N,[2,40]),t(N,[2,41]),t(N,[2,6]),t(N,[2,13]),{13:58,24:d,57:P},t(N,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(N,[2,29]),t(N,[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(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(N,[2,34]),t(N,[2,35]),t(N,[2,36]),t(N,[2,37]),t(_,[2,46]),t(_,[2,47]),t(N,[2,15]),t(N,[2,19]),t(I,i,{7:78}),t(N,[2,26]),t(N,[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:x,37:b,38:T,41:k,45:S,48:C,51:E,52:A,53:M,54:L,57:P},t(N,[2,32]),t(N,[2,33]),t(N,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:w(function(z,H){if(H.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=H,B}},"parseError"),parse:w(function(z){var H=this,B=[0],V=[],q=[null],G=[],Q=this.table,j="",ae=0,Z=0,J=2,re=1,ee=G.slice.call(arguments,1),me=Object.create(this.lexer),te={yy:{}};for(var $e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$e)&&(te.yy[$e]=this.yy[$e]);me.setInput(z,te.yy),te.yy.lexer=me,te.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var Oe=me.yylloc;G.push(Oe);var He=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(fe){B.length=B.length-2*fe,q.length=q.length-fe,G.length=G.length-fe}w(ue,"popStack");function ce(){var fe;return fe=V.pop()||me.lex()||re,typeof fe!="number"&&(fe instanceof Array&&(V=fe,fe=V.pop()),fe=H.symbols_[fe]||fe),fe}w(ce,"lex");for(var Te,ge,Ve,we,Ae={},Ue,le,pe,Ce;;){if(ge=B[B.length-1],this.defaultActions[ge]?Ve=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=ce()),Ve=Q[ge]&&Q[ge][Te]),typeof Ve>"u"||!Ve.length||!Ve[0]){var oe="";Ce=[];for(Ue in Q[ge])this.terminals_[Ue]&&Ue>J&&Ce.push("'"+this.terminals_[Ue]+"'");me.showPosition?oe="Parse error on line "+(ae+1)+`: `+me.showPosition()+` Expecting `+Ce.join(", ")+", got '"+(this.terminals_[Te]||Te)+"'":oe="Parse error on line "+(ae+1)+": Unexpected "+(Te==re?"end of input":"'"+(this.terminals_[Te]||Te)+"'"),this.parseError(oe,{text:me.match,token:this.terminals_[Te]||Te,line:me.yylineno,loc:Oe,expected:Ce})}if(Ve[0]instanceof Array&&Ve.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Te);switch(Ve[0]){case 1:B.push(Te),q.push(me.yytext),G.push(me.yylloc),B.push(Ve[1]),Te=null,Z=me.yyleng,j=me.yytext,ae=me.yylineno,Oe=me.yylloc;break;case 2:if(le=this.productions_[Ve[1]][1],Ae.$=q[q.length-le],Ae._$={first_line:G[G.length-(le||1)].first_line,last_line:G[G.length-1].last_line,first_column:G[G.length-(le||1)].first_column,last_column:G[G.length-1].last_column},He&&(Ae._$.range=[G[G.length-(le||1)].range[0],G[G.length-1].range[1]]),we=this.performAction.apply(Ae,[j,Z,ae,te.yy,Ve[1],q,G].concat(ee)),typeof we<"u")return we;le&&(B=B.slice(0,-1*le*2),q=q.slice(0,-1*le),G=G.slice(0,-1*le)),B.push(this.productions_[Ve[1]][0]),q.push(Ae.$),G.push(Ae._$),pe=Q[B[B.length-2]][B[B.length-1]],B.push(pe);break;case 3:return!0}}return!0},"parse")},D=(function(){var F={EOF:1,parseError:w(function(H,B){if(this.yy.parser)this.yy.parser.parseError(H,B);else throw new Error(H)},"parseError"),setInput:w(function(z,H){return this.yy=H||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:w(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var H=z.match(/(?:\r\n?|\n).*/g);return H?(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:w(function(z){var H=z.length,B=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-H),this.offset-=H;var V=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 q=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===V.length?this.yylloc.first_column:0)+V[V.length-B.length].length-B[0].length:this.yylloc.first_column-H},this.options.ranges&&(this.yylloc.range=[q[0],q[0]+this.yyleng-H]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(z){this.unput(this.match.slice(z))},"less"),pastInput:w(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:w(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:w(function(){var z=this.pastInput(),H=new Array(z.length+1).join("-");return z+this.upcomingInput()+` `+H+"^"},"showPosition"),test_match:w(function(z,H){var B,V,q;if(this.options.backtrack_lexer&&(q={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&&(q.yylloc.range=this.yylloc.range.slice(0))),V=z[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.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,H,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var G in q)this[G]=q[G];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,H,B,V;this._more||(this.yytext="",this.match="");for(var q=this._currentRules(),G=0;GH[0].length)){if(H=B,V=G,this.options.backtrack_lexer){if(z=this.test_match(B,q[G]),z!==!1)return z;if(this._backtrack){H=!1;continue}else return!1}else if(!this.options.flex)break}return H?(z=this.test_match(H,q[V]),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:w(function(){var H=this.next();return H||this.lex()},"lex"),begin:w(function(H){this.conditionStack.push(H)},"begin"),popState:w(function(){var H=this.conditionStack.length-1;return H>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(H){return H=this.conditionStack.length-1-Math.abs(H||0),H>=0?this.conditionStack[H]:"INITIAL"},"topState"),pushState:w(function(H){this.begin(H)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(H,B,V,q){function G(){const Q=B.yytext.indexOf("%%");if(Q===0)return!1;if(Q>0){const j=B.yytext.slice(0,Q),ae=B.yytext.slice(Q);ae&&H.lexer.unput(ae),B.yytext=j}return!0}switch(w(G,"processId"),V){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 G()?(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 G()?(this.popState(),"ID"):void 0;case 66:return G()?(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 G()?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})();O.lexer=D;function $(){this.yy={}}return w($,"Parser"),$.prototype=O,O.Parser=$,new $})();_j.parser=_j;var Vqe=_j,ehr="TB",Wqe="TB",U1e="dir",M2="state",Gv="root",Mj="relation",thr="classDef",rhr="style",nhr="applyClass",sS="default",qqe="divider",Gqe="fill:none",Uqe="fill: #333",Yqe="c",jqe="markdown",Xqe="normal",TH="rect",kH="rectWithTitle",ihr="stateStart",ahr="stateEnd",Y1e="divider",j1e="roundedWithTitle",shr="note",ohr="noteGroup",w7="statediagram",lhr="state",chr=`${w7}-${lhr}`,Kqe="transition",uhr="note",hhr="note-edge",dhr=`${Kqe} ${hhr}`,fhr=`${w7}-${uhr}`,phr="cluster",ghr=`${w7}-${phr}`,mhr="cluster-alt",yhr=`${w7}-${mhr}`,Zqe="parent",Qqe="note",vhr="state",Vne="----",bhr=`${Vne}${Qqe}`,X1e=`${Vne}${Zqe}`,Jqe=w((t,e=Wqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),xhr=w(function(t,e){return e.db.getClasses()},"getClasses"),whr=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=We();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Q3(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,We().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await I3(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var k;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){he.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(k=l.node())==null?void 0:k.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const C=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||C===g)&&(v=S)}),!v){he.warn("⚠️ Could not find node matching text:",g);return}const x=v.parentNode;if(!x){he.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),T=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",T),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}x.replaceChild(b,v),b.appendChild(v),he.info("🔗 Wrapped node in
tag for:",g,f.url)})}catch(d){he.error("❌ Error injecting clickable links:",d)}Vr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,h,w7,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Thr={getClasses:xhr,draw:whr,getDir:Jqe},f_=new Map,hp=0;function p_(t="",e=0,r="",n=Vne){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${vhr}-${t}${i}-${e}`}w(p_,"stateDomId");var khr=w((t,e,r,n,i,a,s,o)=>{he.trace("items",e),e.forEach(l=>{switch(l.stmt){case M2:rC(t,l,r,n,i,a,s,o);break;case sS:rC(t,l,r,n,i,a,s,o);break;case Mj:{rC(t,l.state1,r,n,i,a,s,o),rC(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+hp,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Gqe,labelStyle:"",label:Ft.sanitizeText(l.description??"",We()),arrowheadStyle:Uqe,labelpos:Yqe,labelType:jqe,thickness:Xqe,classes:Kqe,look:s};i.push(h),hp++}break}})},"setupDoc"),K1e=w((t,e=Wqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function tC(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)}w(tC,"insertOrUpdateNode");function eGe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(eGe,"getClassesFromDbInfo");function tGe(t){return(t==null?void 0:t.styles)??[]}w(tGe,"getStylesFromDbInfo");var rC=w((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=eGe(u),d=tGe(u),f=We();if(he.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=TH;e.start===!0?y=ihr:e.start===!1&&(y=ahr),e.type!==sS&&(y=e.type),f_.get(l)||f_.set(l,{id:l,shape:y,description:Ft.sanitizeText(l,f),cssClasses:`${h} ${chr}`,cssStyles:d});const v=f_.get(l);e.description&&(Array.isArray(v.description)?(v.shape=kH,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=kH,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=TH,v.description=e.description),v.description=Ft.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===kH&&(v.type==="group"?v.shape=j1e:v.shape=TH),!v.type&&e.doc&&(he.info("Setting cluster for XCX",l,K1e(e)),v.type="group",v.isGroup=!0,v.dir=K1e(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===qqe?Y1e:j1e,v.cssClasses=`${v.cssClasses} ${ghr} ${a?yhr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:p_(l,hp),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(x.shape===Y1e&&(x.label=""),t&&t.id!=="root"&&(he.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:shr,label:e.note.text,labelType:"markdown",cssClasses:fhr,cssStyles:[],cssCompiledStyles:[],id:l+bhr+"-"+hp,domId:p_(l,hp,Qqe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},T=l+X1e,k={labelStyle:"",shape:ohr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+X1e,domId:p_(l,hp,Zqe),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};hp++,k.id=T,b.parentId=T,tC(n,k,o),tC(n,b,o),tC(n,x,o);let S=l,C=b.id;e.note.position==="left of"&&(S=b.id,C=l),i.push({id:S+"-"+C,start:S,end:C,arrowhead:"none",arrowTypeEnd:"",style:Gqe,labelStyle:"",classes:dhr,arrowheadStyle:Uqe,labelpos:Yqe,labelType:jqe,thickness:Xqe,look:s})}else tC(n,x,o)}e.doc&&(he.trace("Adding nodes children "),khr(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),Chr=w(()=>{f_.clear(),hp=0},"reset"),Yo={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Z1e=w(()=>new Map,"newClassesList"),Q1e=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),R8=w(t=>JSON.parse(JSON.stringify(t)),"clone"),$1,Um=($1=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Z1e(),this.documents={root:Q1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Yi,this.setAccTitle=$i,this.getAccDescription=Xi,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getDiagramTitle=Di,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 M2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case Mj:this.addRelation(i.state1,i.state2,i.description);break;case thr:this.addStyleClass(i.id.trim(),i.classes);break;case rhr:this.handleStyleDef(i);break;case nhr:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=We();Chr(),rC(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){he.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===Mj){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===M2&&(r.id===Yo.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==Gv&&r.stmt!==M2||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===qqe){const o=R8(s);o.doc=R8(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:M2,id:y3e(),type:"divider",doc:R8(a)};i.push(R8(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:Gv,stmt:Gv},{id:Gv,stmt:Gv,doc:this.rootDoc},!0),{id:Gv,doc:this.rootDoc}}addState(e,r=sS,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))he.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:M2,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&&(he.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=Ft.sanitizeText(h.note.text,We())}s&&(he.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(he.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(he.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:Q1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Z1e(),e||(this.links=new Map,wi())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){he.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),he.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===Yo.START_NODE?(this.startEndCount++,`${Yo.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=sS){return e===Yo.START_NODE?Yo.START_TYPE:r}endIdIfNeeded(e=""){return e===Yo.END_NODE?(this.startEndCount++,`${Yo.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=sS){return e===Yo.END_NODE?Yo.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:Ft.sanitizeText(n,We())})}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?Ft.sanitizeText(n,We()):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(Ft.sanitizeText(i,We()))}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(Yo.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Yo.COLOR_KEYWORD).exec(i)){const o=a.replace(Yo.FILL_KEYWORD,Yo.BG_FILL).replace(Yo.COLOR_KEYWORD,Yo.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=kee();bt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=bt(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(Ff.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),bt(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===U1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??ehr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:U1e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=We();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Jqe(this.getRootDocV2())}}getConfig(){return We().state}},w($1,"StateDB"),$1.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},$1),Shr=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var H=this.next();return H||this.lex()},"lex"),begin:w(function(H){this.conditionStack.push(H)},"begin"),popState:w(function(){var H=this.conditionStack.length-1;return H>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(H){return H=this.conditionStack.length-1-Math.abs(H||0),H>=0?this.conditionStack[H]:"INITIAL"},"topState"),pushState:w(function(H){this.begin(H)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(H,B,V,q){function G(){const Q=B.yytext.indexOf("%%");if(Q===0)return!1;if(Q>0){const j=B.yytext.slice(0,Q),ae=B.yytext.slice(Q);ae&&H.lexer.unput(ae),B.yytext=j}return!0}switch(w(G,"processId"),V){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 G()?(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 G()?(this.popState(),"ID"):void 0;case 66:return G()?(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 G()?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})();O.lexer=D;function $(){this.yy={}}return w($,"Parser"),$.prototype=O,O.Parser=$,new $})();Lj.parser=Lj;var Gqe=Lj,shr="TB",Uqe="TB",Y1e="dir",M2="state",Gv="root",Ij="relation",ohr="classDef",lhr="style",chr="applyClass",sS="default",Yqe="divider",jqe="fill:none",Xqe="fill: #333",Kqe="c",Zqe="markdown",Qqe="normal",CH="rect",SH="rectWithTitle",uhr="stateStart",hhr="stateEnd",j1e="divider",X1e="roundedWithTitle",dhr="note",fhr="noteGroup",T7="statediagram",phr="state",ghr=`${T7}-${phr}`,Jqe="transition",mhr="note",yhr="note-edge",vhr=`${Jqe} ${yhr}`,bhr=`${T7}-${mhr}`,xhr="cluster",whr=`${T7}-${xhr}`,Thr="cluster-alt",khr=`${T7}-${Thr}`,eGe="parent",tGe="note",Chr="state",qne="----",Shr=`${qne}${tGe}`,K1e=`${qne}${eGe}`,rGe=w((t,e=Uqe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Ehr=w(function(t,e){return e.db.getClasses()},"getClasses"),Ahr=w(async function(t,e,r,n){he.info("REF0:"),he.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=We();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Q3(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,We().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await I3(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var k;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){he.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(k=l.node())==null?void 0:k.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const C=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||C===g)&&(v=S)}),!v){he.warn("⚠️ Could not find node matching text:",g);return}const x=v.parentNode;if(!x){he.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),T=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",T),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}x.replaceChild(b,v),b.appendChild(v),he.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){he.error("❌ Error injecting clickable links:",d)}Vr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Gy(l,h,T7,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Rhr={getClasses:Ehr,draw:Ahr,getDir:rGe},p_=new Map,hp=0;function g_(t="",e=0,r="",n=qne){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Chr}-${t}${i}-${e}`}w(g_,"stateDomId");var _hr=w((t,e,r,n,i,a,s,o)=>{he.trace("items",e),e.forEach(l=>{switch(l.stmt){case M2:rC(t,l,r,n,i,a,s,o);break;case sS:rC(t,l,r,n,i,a,s,o);break;case Ij:{rC(t,l.state1,r,n,i,a,s,o),rC(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+hp,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:jqe,labelStyle:"",label:Ft.sanitizeText(l.description??"",We()),arrowheadStyle:Xqe,labelpos:Kqe,labelType:Zqe,thickness:Qqe,classes:Jqe,look:s};i.push(h),hp++}break}})},"setupDoc"),Z1e=w((t,e=Uqe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function tC(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)}w(tC,"insertOrUpdateNode");function nGe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(nGe,"getClassesFromDbInfo");function iGe(t){return(t==null?void 0:t.styles)??[]}w(iGe,"getStylesFromDbInfo");var rC=w((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=nGe(u),d=iGe(u),f=We();if(he.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=CH;e.start===!0?y=uhr:e.start===!1&&(y=hhr),e.type!==sS&&(y=e.type),p_.get(l)||p_.set(l,{id:l,shape:y,description:Ft.sanitizeText(l,f),cssClasses:`${h} ${ghr}`,cssStyles:d});const v=p_.get(l);e.description&&(Array.isArray(v.description)?(v.shape=SH,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=SH,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=CH,v.description=e.description),v.description=Ft.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===SH&&(v.type==="group"?v.shape=X1e:v.shape=CH),!v.type&&e.doc&&(he.info("Setting cluster for XCX",l,Z1e(e)),v.type="group",v.isGroup=!0,v.dir=Z1e(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===Yqe?j1e:X1e,v.cssClasses=`${v.cssClasses} ${whr} ${a?khr:""}`);const x={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:g_(l,hp),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(x.shape===j1e&&(x.label=""),t&&t.id!=="root"&&(he.trace("Setting node ",l," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){const b={labelStyle:"",shape:dhr,label:e.note.text,labelType:"markdown",cssClasses:bhr,cssStyles:[],cssCompiledStyles:[],id:l+Shr+"-"+hp,domId:g_(l,hp,tGe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},T=l+K1e,k={labelStyle:"",shape:fhr,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+K1e,domId:g_(l,hp,eGe),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};hp++,k.id=T,b.parentId=T,tC(n,k,o),tC(n,b,o),tC(n,x,o);let S=l,C=b.id;e.note.position==="left of"&&(S=b.id,C=l),i.push({id:S+"-"+C,start:S,end:C,arrowhead:"none",arrowTypeEnd:"",style:jqe,labelStyle:"",classes:vhr,arrowheadStyle:Xqe,labelpos:Kqe,labelType:Zqe,thickness:Qqe,look:s})}else tC(n,x,o)}e.doc&&(he.trace("Adding nodes children "),_hr(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),Mhr=w(()=>{p_.clear(),hp=0},"reset"),Yo={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Q1e=w(()=>new Map,"newClassesList"),J1e=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),_8=w(t=>JSON.parse(JSON.stringify(t)),"clone"),$1,Um=($1=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Q1e(),this.documents={root:J1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Yi,this.setAccTitle=$i,this.getAccDescription=Xi,this.setAccDescription=ji,this.setDiagramTitle=qi,this.getDiagramTitle=Di,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 M2:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case Ij:this.addRelation(i.state1,i.state2,i.description);break;case ohr:this.addStyleClass(i.id.trim(),i.classes);break;case lhr:this.handleStyleDef(i);break;case chr:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=We();Mhr(),rC(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){he.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===Ij){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===M2&&(r.id===Yo.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==Gv&&r.stmt!==M2||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===Yqe){const o=_8(s);o.doc=_8(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:M2,id:v3e(),type:"divider",doc:_8(a)};i.push(_8(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:Gv,stmt:Gv},{id:Gv,stmt:Gv,doc:this.rootDoc},!0),{id:Gv,doc:this.rootDoc}}addState(e,r=sS,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))he.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:M2,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&&(he.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=Ft.sanitizeText(h.note.text,We())}s&&(he.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(he.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(he.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:J1e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Q1e(),e||(this.links=new Map,wi())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){he.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),he.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===Yo.START_NODE?(this.startEndCount++,`${Yo.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=sS){return e===Yo.START_NODE?Yo.START_TYPE:r}endIdIfNeeded(e=""){return e===Yo.END_NODE?(this.startEndCount++,`${Yo.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=sS){return e===Yo.END_NODE?Yo.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:Ft.sanitizeText(n,We())})}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?Ft.sanitizeText(n,We()):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(Ft.sanitizeText(i,We()))}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(Yo.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Yo.COLOR_KEYWORD).exec(i)){const o=a.replace(Yo.FILL_KEYWORD,Yo.BG_FILL).replace(Yo.COLOR_KEYWORD,Yo.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=See();bt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=bt(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(Ff.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),bt(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===Y1e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??shr}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Y1e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=We();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:rGe(this.getRootDocV2())}}getConfig(){return We().state}},w($1,"StateDB"),$1.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},$1),Lhr=w(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -3815,12 +3828,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),rGe=Shr,Ehr=w(t=>t.append("circle").attr("class","start-state").attr("r",We().state.sizeUnit).attr("cx",We().state.padding+We().state.sizeUnit).attr("cy",We().state.padding+We().state.sizeUnit),"drawStartState"),Ahr=w(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",We().state.textHeight).attr("class","divider").attr("x2",We().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Rhr=w((t,e)=>{const r=t.append("text").attr("x",2*We().state.padding).attr("y",We().state.textHeight+2*We().state.padding).attr("font-size",We().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",We().state.padding).attr("y",We().state.padding).attr("width",n.width+2*We().state.padding).attr("height",n.height+2*We().state.padding).attr("rx",We().state.radius),r},"drawSimpleState"),_hr=w((t,e)=>{const r=w(function(f,p,g){const m=f.append("tspan").attr("x",2*We().state.padding).text(p);g||m.attr("dy",We().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*We().state.padding).attr("y",We().state.textHeight+1.3*We().state.padding).attr("font-size",We().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",We().state.padding).attr("y",a+We().state.padding*.4+We().state.dividerMargin+We().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",We().state.padding).attr("y1",We().state.padding+a+We().state.dividerMargin/2).attr("y2",We().state.padding+a+We().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*We().state.padding),t.insert("rect",":first-child").attr("x",We().state.padding).attr("y",We().state.padding).attr("width",d+2*We().state.padding).attr("height",h.height+a+2*We().state.padding).attr("rx",We().state.radius),t},"drawDescrState"),Mhr=w((t,e,r)=>{const n=We().state.padding,i=2*We().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",We().state.titleShift).attr("font-size",We().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-We().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+We().state.textHeight+We().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",We().state.titleShift-We().state.textHeight-We().state.padding).attr("width",d).attr("height",We().state.textHeight*3).attr("rx",We().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",We().state.titleShift-We().state.textHeight-We().state.padding).attr("width",d).attr("height",p.height+3+2*We().state.textHeight).attr("rx",We().state.radius),t},"addTitleAndBox"),Lhr=w(t=>(t.append("circle").attr("class","end-state-outer").attr("r",We().state.sizeUnit+We().state.miniPadding).attr("cx",We().state.padding+We().state.sizeUnit+We().state.miniPadding).attr("cy",We().state.padding+We().state.sizeUnit+We().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",We().state.sizeUnit).attr("cx",We().state.padding+We().state.sizeUnit+2).attr("cy",We().state.padding+We().state.sizeUnit+2)),"drawEndState"),Ihr=w((t,e)=>{let r=We().state.forkWidth,n=We().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",We().state.padding).attr("y",We().state.padding)},"drawForkJoinState"),$hr=w((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(Ft.lineBreakRegex);let l=1.25*We().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+We().state.noteMargin),d.attr("y",r+i+1.25*We().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),Nhr=w((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",We().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=$hr(t,0,0,n);return r.attr("height",a+2*We().state.noteMargin),r.attr("width",i+We().state.noteMargin*2),r},"drawNote"),J1e=w(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"&&Ehr(i),e.type==="end"&&Lhr(i),(e.type==="fork"||e.type==="join")&&Ihr(i,e),e.type==="note"&&Nhr(e.note.text,i),e.type==="divider"&&Ahr(i),e.type==="default"&&e.descriptions.length===0&&Rhr(i,e),e.type==="default"&&e.descriptions.length>0&&_hr(i,e);const a=i.node().getBBox();return n.width=a.width+2*We().state.padding,n.height=a.height+2*We().state.padding,n},"drawState"),eye=0,Dhr=w(function(t,e,r){const n=w(function(l){switch(l){case Um.relationType.AGGREGATION:return"aggregation";case Um.relationType.EXTENSION:return"extension";case Um.relationType.COMPOSITION:return"composition";case Um.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=AS().x(function(l){return l.x}).y(function(l){return l.y}).curve(RS),s=t.append("path").attr("d",a(i)).attr("id","edge"+eye).attr("class","transition");let o="";if(We().state.arrowMarkerAbsolute&&(o=y$(!0)),s.attr("marker-end","url("+o+"#"+n(Um.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Vr.calcLabelPosition(e.points),d=Ft.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),T=b.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),he.info(T.x,u,h+f),f===0&&(f=b.node().getBBox().height,he.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,T)=>b.attr("y",h+T*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-We().state.padding/2).attr("y",h-y/2-We().state.padding/2-3.5).attr("width",g+We().state.padding).attr("height",y+We().state.padding),he.info(v)}eye++},"drawEdge"),uc,CH={},Ohr=w(function(){},"setConf"),Phr=w(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"),Bhr=w(function(t,e,r,n){uc=We().state;const i=We().securityLevel;let a;i==="sandbox"&&(a=bt("#i"+e));const s=bt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;he.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Phr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");nGe(u,h,void 0,!1,s,o,n);const d=uc.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;_a(l,g,m,uc.useMaxWidth),l.attr("viewBox",`${f.x-uc.padding} ${f.y-uc.padding} `+p+" "+g)},"draw"),Fhr=w(t=>t?t.length*uc.fontSizeFactor:1,"getLabelWidth"),nGe=w((t,e,r,n,i,a,s)=>{const o=new $o({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const T=b.parentElement;let k=0,S=0;T&&(T.parentElement&&(k=T.parentElement.getBBox().width),S=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",k-S-8)})):he.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&&(he.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Dhr(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*uc.padding,y.height=m.height+2*uc.padding,he.debug("Doc rendered",y,o),y},"renderDoc"),zhr={setConf:Ohr,draw:Bhr},Hhr={parser:Vqe,get db(){return new Um(1)},renderer:zhr,styles:rGe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Vhr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hhr},Symbol.toStringTag,{value:"Module"}));var Whr={parser:Vqe,get db(){return new Um(2)},renderer:Thr,styles:rGe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const qhr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Whr},Symbol.toStringTag,{value:"Module"}));var Lj=(function(){var t=w(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:w(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:w(function(f,p,g,m,y,v,x){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:w(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:w(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",T=0,k=0,S=2,C=1,E=v.slice.call(arguments,1),A=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]);A.setInput(f,M.yy),M.yy.lexer=A,M.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var P=A.yylloc;v.push(P);var N=A.options&&A.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _(Q){g.length=g.length-2*Q,y.length=y.length-Q,v.length=v.length-Q}w(_,"popStack");function I(){var Q;return Q=m.pop()||A.lex()||C,typeof Q!="number"&&(Q instanceof Array&&(m=Q,Q=m.pop()),Q=p.symbols_[Q]||Q),Q}w(I,"lex");for(var O,D,$,F,z={},H,B,V,q;;){if(D=g[g.length-1],this.defaultActions[D]?$=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=I()),$=x[D]&&x[D][O]),typeof $>"u"||!$.length||!$[0]){var G="";q=[];for(H in x[D])this.terminals_[H]&&H>S&&q.push("'"+this.terminals_[H]+"'");A.showPosition?G="Parse error on line "+(T+1)+`: +`,"getStyles"),aGe=Lhr,Ihr=w(t=>t.append("circle").attr("class","start-state").attr("r",We().state.sizeUnit).attr("cx",We().state.padding+We().state.sizeUnit).attr("cy",We().state.padding+We().state.sizeUnit),"drawStartState"),$hr=w(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",We().state.textHeight).attr("class","divider").attr("x2",We().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Nhr=w((t,e)=>{const r=t.append("text").attr("x",2*We().state.padding).attr("y",We().state.textHeight+2*We().state.padding).attr("font-size",We().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",We().state.padding).attr("y",We().state.padding).attr("width",n.width+2*We().state.padding).attr("height",n.height+2*We().state.padding).attr("rx",We().state.radius),r},"drawSimpleState"),Dhr=w((t,e)=>{const r=w(function(f,p,g){const m=f.append("tspan").attr("x",2*We().state.padding).text(p);g||m.attr("dy",We().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*We().state.padding).attr("y",We().state.textHeight+1.3*We().state.padding).attr("font-size",We().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",We().state.padding).attr("y",a+We().state.padding*.4+We().state.dividerMargin+We().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",We().state.padding).attr("y1",We().state.padding+a+We().state.dividerMargin/2).attr("y2",We().state.padding+a+We().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*We().state.padding),t.insert("rect",":first-child").attr("x",We().state.padding).attr("y",We().state.padding).attr("width",d+2*We().state.padding).attr("height",h.height+a+2*We().state.padding).attr("rx",We().state.radius),t},"drawDescrState"),Ohr=w((t,e,r)=>{const n=We().state.padding,i=2*We().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",We().state.titleShift).attr("font-size",We().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-We().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+We().state.textHeight+We().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",We().state.titleShift-We().state.textHeight-We().state.padding).attr("width",d).attr("height",We().state.textHeight*3).attr("rx",We().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",We().state.titleShift-We().state.textHeight-We().state.padding).attr("width",d).attr("height",p.height+3+2*We().state.textHeight).attr("rx",We().state.radius),t},"addTitleAndBox"),Phr=w(t=>(t.append("circle").attr("class","end-state-outer").attr("r",We().state.sizeUnit+We().state.miniPadding).attr("cx",We().state.padding+We().state.sizeUnit+We().state.miniPadding).attr("cy",We().state.padding+We().state.sizeUnit+We().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",We().state.sizeUnit).attr("cx",We().state.padding+We().state.sizeUnit+2).attr("cy",We().state.padding+We().state.sizeUnit+2)),"drawEndState"),Bhr=w((t,e)=>{let r=We().state.forkWidth,n=We().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",We().state.padding).attr("y",We().state.padding)},"drawForkJoinState"),Fhr=w((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(Ft.lineBreakRegex);let l=1.25*We().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+We().state.noteMargin),d.attr("y",r+i+1.25*We().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),zhr=w((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",We().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=Fhr(t,0,0,n);return r.attr("height",a+2*We().state.noteMargin),r.attr("width",i+We().state.noteMargin*2),r},"drawNote"),eye=w(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"&&Ihr(i),e.type==="end"&&Phr(i),(e.type==="fork"||e.type==="join")&&Bhr(i,e),e.type==="note"&&zhr(e.note.text,i),e.type==="divider"&&$hr(i),e.type==="default"&&e.descriptions.length===0&&Nhr(i,e),e.type==="default"&&e.descriptions.length>0&&Dhr(i,e);const a=i.node().getBBox();return n.width=a.width+2*We().state.padding,n.height=a.height+2*We().state.padding,n},"drawState"),tye=0,Hhr=w(function(t,e,r){const n=w(function(l){switch(l){case Um.relationType.AGGREGATION:return"aggregation";case Um.relationType.EXTENSION:return"extension";case Um.relationType.COMPOSITION:return"composition";case Um.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=AS().x(function(l){return l.x}).y(function(l){return l.y}).curve(RS),s=t.append("path").attr("d",a(i)).attr("id","edge"+tye).attr("class","transition");let o="";if(We().state.arrowMarkerAbsolute&&(o=b$(!0)),s.attr("marker-end","url("+o+"#"+n(Um.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Vr.calcLabelPosition(e.points),d=Ft.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let x=0;x<=d.length;x++){const b=l.append("text").attr("text-anchor","middle").text(d[x]).attr("x",u).attr("y",h+f),T=b.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),he.info(T.x,u,h+f),f===0&&(f=b.node().getBBox().height,he.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const x=(d.length-1)*f*.5;p.forEach((b,T)=>b.attr("y",h+T*f-x)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-We().state.padding/2).attr("y",h-y/2-We().state.padding/2-3.5).attr("width",g+We().state.padding).attr("height",y+We().state.padding),he.info(v)}tye++},"drawEdge"),cc,EH={},Vhr=w(function(){},"setConf"),Whr=w(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"),qhr=w(function(t,e,r,n){cc=We().state;const i=We().securityLevel;let a;i==="sandbox"&&(a=bt("#i"+e));const s=bt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;he.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);Whr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");sGe(u,h,void 0,!1,s,o,n);const d=cc.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;_a(l,g,m,cc.useMaxWidth),l.attr("viewBox",`${f.x-cc.padding} ${f.y-cc.padding} `+p+" "+g)},"draw"),Ghr=w(t=>t?t.length*cc.fontSizeFactor:1,"getLabelWidth"),sGe=w((t,e,r,n,i,a,s)=>{const o=new $o({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const T=b.parentElement;let k=0,S=0;T&&(T.parentElement&&(k=T.parentElement.getBBox().width),S=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",k-S-8)})):he.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&&(he.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),Hhr(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*cc.padding,y.height=m.height+2*cc.padding,he.debug("Doc rendered",y,o),y},"renderDoc"),Uhr={setConf:Vhr,draw:qhr},Yhr={parser:Gqe,get db(){return new Um(1)},renderer:Uhr,styles:aGe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const jhr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Yhr},Symbol.toStringTag,{value:"Module"}));var Xhr={parser:Gqe,get db(){return new Um(2)},renderer:Rhr,styles:aGe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Khr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xhr},Symbol.toStringTag,{value:"Module"}));var $j=(function(){var t=w(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:w(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:w(function(f,p,g,m,y,v,x){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:w(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:w(function(f){var p=this,g=[0],m=[],y=[null],v=[],x=this.table,b="",T=0,k=0,S=2,C=1,E=v.slice.call(arguments,1),A=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]);A.setInput(f,M.yy),M.yy.lexer=A,M.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var P=A.yylloc;v.push(P);var N=A.options&&A.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _(Q){g.length=g.length-2*Q,y.length=y.length-Q,v.length=v.length-Q}w(_,"popStack");function I(){var Q;return Q=m.pop()||A.lex()||C,typeof Q!="number"&&(Q instanceof Array&&(m=Q,Q=m.pop()),Q=p.symbols_[Q]||Q),Q}w(I,"lex");for(var O,D,$,F,z={},H,B,V,q;;){if(D=g[g.length-1],this.defaultActions[D]?$=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=I()),$=x[D]&&x[D][O]),typeof $>"u"||!$.length||!$[0]){var G="";q=[];for(H in x[D])this.terminals_[H]&&H>S&&q.push("'"+this.terminals_[H]+"'");A.showPosition?G="Parse error on line "+(T+1)+`: `+A.showPosition()+` Expecting `+q.join(", ")+", got '"+(this.terminals_[O]||O)+"'":G="Parse error on line "+(T+1)+": Unexpected "+(O==C?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(G,{text:A.match,token:this.terminals_[O]||O,line:A.yylineno,loc:P,expected:q})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+O);switch($[0]){case 1:g.push(O),y.push(A.yytext),v.push(A.yylloc),g.push($[1]),O=null,k=A.yyleng,b=A.yytext,T=A.yylineno,P=A.yylloc;break;case 2:if(B=this.productions_[$[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},N&&(z._$.range=[v[v.length-(B||1)].range[0],v[v.length-1].range[1]]),F=this.performAction.apply(z,[b,k,T,M.yy,$[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_[$[1]][0]),y.push(z.$),v.push(z._$),V=x[g[g.length-2]][g[g.length-1]],g.push(V);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:w(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:w(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:w(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:w(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:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(f){this.unput(this.match.slice(f))},"less"),pastInput:w(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:w(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:w(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:w(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:w(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:w(function(){var p=this.next();return p||this.lex()},"lex"),begin:w(function(p){this.conditionStack.push(p)},"begin"),popState:w(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:w(function(p){this.begin(p)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(h,"Parser"),h.prototype=l,l.Parser=h,new h})();Lj.parser=Lj;var Ghr=Lj,x3="",Wne=[],U6=[],Y6=[],Uhr=w(function(){Wne.length=0,U6.length=0,x3="",Y6.length=0,wi()},"clear"),Yhr=w(function(t){x3=t,Wne.push(t)},"addSection"),jhr=w(function(){return Wne},"getSections"),Xhr=w(function(){let t=tye();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Zhr=w(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:x3,type:x3,people:a,task:t,score:n};Y6.push(s)},"addTask"),Qhr=w(function(t){const e={section:x3,type:x3,description:t,task:t,classes:[]};U6.push(e)},"addTaskOrg"),tye=w(function(){const t=w(function(r){return Y6[r].processed},"compileTask");let e=!0;for(const[r,n]of Y6.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Jhr=w(function(){return Khr()},"getActors"),rye={getConfig:w(()=>We().journey,"getConfig"),clear:Uhr,setDiagramTitle:qi,getDiagramTitle:Di,setAccTitle:$i,getAccTitle:Yi,setAccDescription:ji,getAccDescription:Xi,addSection:Yhr,getSections:jhr,getTasks:Xhr,addTask:Zhr,addTaskOrg:Qhr,getActors:Jhr},edr=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var p=this.next();return p||this.lex()},"lex"),begin:w(function(p){this.conditionStack.push(p)},"begin"),popState:w(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:w(function(p){this.begin(p)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(h,"Parser"),h.prototype=l,l.Parser=h,new h})();$j.parser=$j;var Zhr=$j,x3="",Gne=[],Y6=[],j6=[],Qhr=w(function(){Gne.length=0,Y6.length=0,x3="",j6.length=0,wi()},"clear"),Jhr=w(function(t){x3=t,Gne.push(t)},"addSection"),edr=w(function(){return Gne},"getSections"),tdr=w(function(){let t=rye();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),ndr=w(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:x3,type:x3,people:a,task:t,score:n};j6.push(s)},"addTask"),idr=w(function(t){const e={section:x3,type:x3,description:t,task:t,classes:[]};Y6.push(e)},"addTaskOrg"),rye=w(function(){const t=w(function(r){return j6[r].processed},"compileTask");let e=!0;for(const[r,n]of j6.entries())t(r),e=e&&n.processed;return e},"compileTasks"),adr=w(function(){return rdr()},"getActors"),nye={getConfig:w(()=>We().journey,"getConfig"),clear:Qhr,setDiagramTitle:qi,getDiagramTitle:Di,setAccTitle:$i,getAccTitle:Yi,setAccDescription:ji,getAccDescription:Xi,addSection:Jhr,getSections:edr,getTasks:tdr,addTask:ndr,addTaskOrg:idr,getActors:adr},sdr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -3952,13 +3965,13 @@ Expecting `+q.join(", ")+", got '"+(this.terminals_[O]||O)+"'":G="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${XE()} -`,"getStyles"),tdr=edr,qne=w(function(t,e){return hD(t,e)},"drawRect"),rdr=w(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=MT().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)+")")}w(a,"smile");function s(l){const u=MT().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)+")")}w(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 w(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),iGe=w(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"),aGe=w(function(t,e){return vGt(t,e)},"drawText"),ndr=w(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)}w(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,aGe(t,e)},"drawLabel"),idr=w(function(t,e,r){const n=t.append("g"),i=Nc();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,qne(n,i),sGe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Ij=-1,adr=w(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");Ij++,a.append("line").attr("id",n+"-task"+Ij).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"),rdr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Nc();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,qne(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};iGe(a,d),l+=10}),sGe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),sdr=w(function(t,e){qLe(t,e)},"drawBackgroundRect"),sGe=(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)}w(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=Sf[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Sf[i].position};j6.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=j6.drawText(t,f).node().getBoundingClientRect().width;g>g_&&g>e.leftMargin-g&&(g_=g)}),n+=Math.max(20,u.length*20)})}w(oGe,"drawActorLegend");var Eu=We().journey,sp=0,cdr=w(function(t,e,r,n){const i=We(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=bt("#i"+e));const h=bt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Yc.init();const d=h.select("#"+e);j6.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in Sf)delete Sf[T];let m=0;g.forEach(T=>{Sf[T]={color:Eu.actorColours[m%Eu.actorColours.length],position:m},m++}),oGe(d),sp=Eu.leftMargin+g_,Yc.insert(0,0,sp,Object.keys(Sf).length*50),udr(d,f,0,e);const y=Yc.getBounds();p&&d.append("text").text(p).attr("x",sp).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*Eu.diagramMarginY,x=sp+y.stopx+2*Eu.diagramMarginX;_a(d,v,x,Eu.useMaxWidth),d.append("line").attr("x1",sp).attr("y1",Eu.height*4).attr("x2",x-sp-4).attr("y2",Eu.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 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),Yc={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:w(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=We().journey,a=this;let s=0;function o(l){return w(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(Yc.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Yc.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(Yc.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Yc.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}w(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:w(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(Yc.data,"startx",i,Math.min),this.updateVal(Yc.data,"starty",s,Math.min),this.updateVal(Yc.data,"stopx",a,Math.max),this.updateVal(Yc.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return this.data},"getBounds")},SH=Eu.sectionFills,nye=Eu.sectionColours,udr=w(function(t,e,r,n){const i=We().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=SH[l%SH.length],d=l%SH.length,h=nye[l%nye.length];let m=0;const y=p.section;for(let x=f;x(Sf[y]&&(m[y]=Sf[y]),m),{});p.x=f*i.taskMargin+f*i.width+sp,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,j6.drawTask(t,p,i,n),Yc.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),iye={setConf:ldr,draw:cdr},hdr={parser:Ghr,db:rye,renderer:iye,styles:tdr,init:w(t=>{iye.setConf(t.journey),rye.clear()},"init")};const ddr=Object.freeze(Object.defineProperty({__proto__:null,diagram:hdr},Symbol.toStringTag,{value:"Module"}));var $j=(function(){var t=w(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:w(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:w(function(p,g,m,y,v,x,b){var T=x.length-1;switch(v){case 1:return x[T-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[T-1].push(x[T]),this.$=x[T-1];break;case 7:case 8:this.$=x[T];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[T].substr(6)),this.$=x[T].substr(6);break;case 12:this.$=x[T].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[T].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[T].substr(8)),this.$=x[T].substr(8);break;case 18:y.addTask(x[T],0,""),this.$=x[T];break;case 19:y.addEvent(x[T].substr(2)),this.$=x[T];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:w(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:w(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,T="",k=0,S=0,C=2,E=1,A=x.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 N=M.yylloc;x.push(N);var _=M.options&&M.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(j){m.length=m.length-2*j,v.length=v.length-j,x.length=x.length-j}w(I,"popStack");function O(){var j;return j=y.pop()||M.lex()||E,typeof j!="number"&&(j instanceof Array&&(y=j,j=y.pop()),j=g.symbols_[j]||j),j}w(O,"lex");for(var D,$,F,z,H={},B,V,q,G;;){if($=m[m.length-1],this.defaultActions[$]?F=this.defaultActions[$]:((D===null||typeof D>"u")&&(D=O()),F=b[$]&&b[$][D]),typeof F>"u"||!F.length||!F[0]){var Q="";G=[];for(B in b[$])this.terminals_[B]&&B>C&&G.push("'"+this.terminals_[B]+"'");M.showPosition?Q="Parse error on line "+(k+1)+`: + ${KE()} +`,"getStyles"),odr=sdr,Une=w(function(t,e){return fD(t,e)},"drawRect"),ldr=w(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=MT().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)+")")}w(a,"smile");function s(l){const u=MT().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)+")")}w(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 w(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),oGe=w(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"),lGe=w(function(t,e){return CGt(t,e)},"drawText"),cdr=w(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)}w(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,lGe(t,e)},"drawLabel"),udr=w(function(t,e,r){const n=t.append("g"),i=Nc();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,Une(n,i),cGe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Nj=-1,hdr=w(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");Nj++,a.append("line").attr("id",n+"-task"+Nj).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"),ldr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Nc();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,Une(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};oGe(a,d),l+=10}),cGe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),ddr=w(function(t,e){YLe(t,e)},"drawBackgroundRect"),cGe=(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)}w(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=Sf[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Sf[i].position};X6.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=X6.drawText(t,f).node().getBoundingClientRect().width;g>m_&&g>e.leftMargin-g&&(m_=g)}),n+=Math.max(20,u.length*20)})}w(uGe,"drawActorLegend");var Eu=We().journey,sp=0,gdr=w(function(t,e,r,n){const i=We(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=bt("#i"+e));const h=bt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Yc.init();const d=h.select("#"+e);X6.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in Sf)delete Sf[T];let m=0;g.forEach(T=>{Sf[T]={color:Eu.actorColours[m%Eu.actorColours.length],position:m},m++}),uGe(d),sp=Eu.leftMargin+m_,Yc.insert(0,0,sp,Object.keys(Sf).length*50),mdr(d,f,0,e);const y=Yc.getBounds();p&&d.append("text").text(p).attr("x",sp).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*Eu.diagramMarginY,x=sp+y.stopx+2*Eu.diagramMarginX;_a(d,v,x,Eu.useMaxWidth),d.append("line").attr("x1",sp).attr("y1",Eu.height*4).attr("x2",x-sp-4).attr("y2",Eu.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 ${x} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),Yc={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:w(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:w(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:w(function(t,e,r,n){const i=We().journey,a=this;let s=0;function o(l){return w(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(Yc.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Yc.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(Yc.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Yc.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}w(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:w(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(Yc.data,"startx",i,Math.min),this.updateVal(Yc.data,"starty",s,Math.min),this.updateVal(Yc.data,"stopx",a,Math.max),this.updateVal(Yc.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:w(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:w(function(){return this.verticalPos},"getVerticalPos"),getBounds:w(function(){return this.data},"getBounds")},AH=Eu.sectionFills,iye=Eu.sectionColours,mdr=w(function(t,e,r,n){const i=We().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=AH[l%AH.length],d=l%AH.length,h=iye[l%iye.length];let m=0;const y=p.section;for(let x=f;x(Sf[y]&&(m[y]=Sf[y]),m),{});p.x=f*i.taskMargin+f*i.width+sp,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,X6.drawTask(t,p,i,n),Yc.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),aye={setConf:pdr,draw:gdr},ydr={parser:Zhr,db:nye,renderer:aye,styles:odr,init:w(t=>{aye.setConf(t.journey),nye.clear()},"init")};const vdr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ydr},Symbol.toStringTag,{value:"Module"}));var Dj=(function(){var t=w(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:w(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:w(function(p,g,m,y,v,x,b){var T=x.length-1;switch(v){case 1:return x[T-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:x[T-1].push(x[T]),this.$=x[T-1];break;case 7:case 8:this.$=x[T];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(x[T].substr(6)),this.$=x[T].substr(6);break;case 12:this.$=x[T].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[T].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(x[T].substr(8)),this.$=x[T].substr(8);break;case 18:y.addTask(x[T],0,""),this.$=x[T];break;case 19:y.addEvent(x[T].substr(2)),this.$=x[T];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:w(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:w(function(p){var g=this,m=[0],y=[],v=[null],x=[],b=this.table,T="",k=0,S=0,C=2,E=1,A=x.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 N=M.yylloc;x.push(N);var _=M.options&&M.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(j){m.length=m.length-2*j,v.length=v.length-j,x.length=x.length-j}w(I,"popStack");function O(){var j;return j=y.pop()||M.lex()||E,typeof j!="number"&&(j instanceof Array&&(y=j,j=y.pop()),j=g.symbols_[j]||j),j}w(O,"lex");for(var D,$,F,z,H={},B,V,q,G;;){if($=m[m.length-1],this.defaultActions[$]?F=this.defaultActions[$]:((D===null||typeof D>"u")&&(D=O()),F=b[$]&&b[$][D]),typeof F>"u"||!F.length||!F[0]){var Q="";G=[];for(B in b[$])this.terminals_[B]&&B>C&&G.push("'"+this.terminals_[B]+"'");M.showPosition?Q="Parse error on line "+(k+1)+`: `+M.showPosition()+` Expecting `+G.join(", ")+", got '"+(this.terminals_[D]||D)+"'":Q="Parse error on line "+(k+1)+": Unexpected "+(D==E?"end of input":"'"+(this.terminals_[D]||D)+"'"),this.parseError(Q,{text:M.match,token:this.terminals_[D]||D,line:M.yylineno,loc:N,expected:G})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+D);switch(F[0]){case 1:m.push(D),v.push(M.yytext),x.push(M.yylloc),m.push(F[1]),D=null,S=M.yyleng,T=M.yytext,k=M.yylineno,N=M.yylloc;break;case 2:if(V=this.productions_[F[1]][1],H.$=v[v.length-V],H._$={first_line:x[x.length-(V||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(V||1)].first_column,last_column:x[x.length-1].last_column},_&&(H._$.range=[x[x.length-(V||1)].range[0],x[x.length-1].range[1]]),z=this.performAction.apply(H,[T,S,k,L.yy,F[1],v,x].concat(A)),typeof z<"u")return z;V&&(m=m.slice(0,-1*V*2),v=v.slice(0,-1*V),x=x.slice(0,-1*V)),m.push(this.productions_[F[1]][0]),v.push(H.$),x.push(H._$),q=b[m[m.length-2]][m[m.length-1]],m.push(q);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:w(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:w(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:w(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:w(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:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(p){this.unput(this.match.slice(p))},"less"),pastInput:w(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:w(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:w(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:w(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 x in v)this[x]=v[x];return!1}return!1},"test_match"),next:w(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(),x=0;xg[0].length)){if(g=m,y=x,this.options.backtrack_lexer){if(p=this.test_match(m,v[x]),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:w(function(){var g=this.next();return g||this.lex()},"lex"),begin:w(function(g){this.conditionStack.push(g)},"begin"),popState:w(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:w(function(g){this.begin(g)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(d,"Parser"),d.prototype=u,u.Parser=d,new d})();$j.parser=$j;var fdr=$j,lGe={};g$(lGe,{addEvent:()=>vGe,addSection:()=>pGe,addTask:()=>yGe,addTaskOrg:()=>bGe,clear:()=>hGe,default:()=>pdr,getCommonDb:()=>uGe,getDirection:()=>fGe,getSections:()=>gGe,getTasks:()=>mGe,setDirection:()=>dGe});var w3="",cGe=0,Gne="LR",Une=[],qI=[],T3=[],uGe=w(()=>oK,"getCommonDb"),hGe=w(function(){Une.length=0,qI.length=0,w3="",T3.length=0,Gne="LR",wi()},"clear"),dGe=w(function(t){Gne=t},"setDirection"),fGe=w(function(){return Gne},"getDirection"),pGe=w(function(t){w3=t,Une.push(t)},"addSection"),gGe=w(function(){return Une},"getSections"),mGe=w(function(){let t=aye();const e=100;let r=0;for(;!t&&rr.id===cGe-1).events.push(t)},"addEvent"),bGe=w(function(t){const e={section:w3,type:w3,description:t,task:t,classes:[]};qI.push(e)},"addTaskOrg"),aye=w(function(){const t=w(function(r){return T3[r].processed},"compileTask");let e=!0;for(const[r,n]of T3.entries())t(r),e=e&&n.processed;return e},"compileTasks"),pdr={clear:hGe,getCommonDb:uGe,getDirection:fGe,setDirection:dGe,addSection:pGe,getSections:gGe,getTasks:mGe,addTask:yGe,addTaskOrg:bGe,addEvent:vGe},xGe=0,_O=w(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"),gdr=w(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=MT().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)+")")}w(a,"smile");function s(l){const u=MT().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)+")")}w(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 w(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),mdr=w(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"),wGe=w(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"),ydr=w(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)}w(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,wGe(t,e)},"drawLabel"),vdr=w(function(t,e,r){const n=t.append("g"),i=Yne();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,_O(n,i),TGe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Nj=-1,bdr=w(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");Nj++,a.append("line").attr("id",n+"-task"+Nj).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"),gdr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Yne();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,_O(a,o),TGe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),xdr=w(function(t,e){_O(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),wdr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Yne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),TGe=(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)}w(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))})}w(jne,"wrap");var kdr=w(function(t,e,r,n,i,a=!1){var v,x,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(jne,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.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})`),Sdr(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const T=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=bt(k),C=S.attr("id")??"",E=C?`${C}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const A=S.select("defs");(A.empty()?S.append("defs"):A).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",T?"0.2":"0.06").attr("flood-color",T?"#FFFFFF":"#000000")}}return e},"drawNode"),Cdr=w(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(jne,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"),Sdr=w(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-"+xGe++).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"),ql={drawRect:_O,drawCircle:mdr,drawSection:vdr,drawText:wGe,drawLabel:ydr,drawTask:bdr,drawBackgroundRect:xdr,getTextObj:wdr,getNoteRect:Yne,initGraphics:Tdr,drawNode:kdr,getVirtualNodeHeight:Cdr},Edr=w(function(t,e,r,n){var I,O,D;const i=We(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=bt("#i"+e));const m=bt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();he.debug("task",y),ql.initGraphics(m,e);const x=n.db.getSections();he.debug("sections",x);let b=0,T=0,k=0,S=0,C=50+d,E=50;S=50;let A=0,M=!0;x.forEach(function($){const F={number:A,descr:$,section:A,width:150,padding:20,maxHeight:b},z=ql.getVirtualNodeHeight(m,F,i);he.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let L=0,P=0;he.debug("tasks.length",y.length);for(const[$,F]of y.entries()){const z={number:$,descr:F,section:F.section,width:150,padding:20,maxHeight:T},H=ql.getVirtualNodeHeight(m,z,i);he.debug("taskHeight before draw",H),T=Math.max(T,H+20),L=Math.max(L,F.events.length);let B=0;for(const V of F.events){const q={descr:V,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=ql.getVirtualNodeHeight(m,q,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}he.debug("maxSectionHeight before draw",b),he.debug("maxTaskHeight before draw",T),x&&x.length>0?x.forEach($=>{const F=y.filter(V=>V.section===$),z={number:A,descr:$,section:A,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};he.debug("sectionNode",z);const H=m.append("g"),B=ql.drawNode(H,z,A,i,e);he.debug("sectionNode output",B),H.attr("transform",`translate(${C}, ${S})`),E+=b+50,F.length>0&&sye(m,F,A,C,E,T,i,L,P,b,!1,e),C+=200*Math.max(F.length,1),E=S,A++}):(M=!1,sye(m,y,A,C,E,T,i,L,P,b,!0,e));const N=m.node().getBBox();if(he.debug("bounds",N),v&&m.append("text").text(v).attr("x",a==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=M?b+T+150:T+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",N.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const $=m.select("defs"),z=($.empty()?m.append("defs"):$).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)}R3(void 0,m,((O=i.timeline)==null?void 0:O.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),sye=w(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};he.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=ql.drawNode(m,g,r,s,d).height;if(he.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+Adr(t,p.events,r,n,i,s,d),i-=100,x.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"),Adr=w(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};he.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=ql.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"),Rdr={setConf:w(()=>{},"setConf"),draw:Edr},MO=200,ff=5,_dr=MO+ff*2,Xne=MO+100,Mdr=Xne+ff*2,kGe=10,Ldr=0,oye=20,CGe=20,lye=30,SGe=50,Idr=w(function(t,e,r,n){var I,O,D,$,F;const i=We(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const s=Po(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();he.debug("task",o),ql.initGraphics(s);const u=n.db.getSections();he.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=_dr+CGe,v=Mdr+SGe,x=m+y;let b=0;const T=u&&u.length>0,k=T?x:f+y,S=Math.max(50,y+v-ff*2);u.forEach(function(z){const H={number:b,descr:z,section:b,width:S,padding:ff,maxHeight:h},B=ql.getVirtualNodeHeight(s,H,i);he.debug("sectionHeight before draw",B),h=Math.max(h,B)});let C=0;he.debug("tasks.length",o.length);for(const[z,H]of o.entries()){const B={number:z,descr:H,section:H.section,width:MO,padding:ff,maxHeight:d},V=ql.getVirtualNodeHeight(s,B,i);he.debug("taskHeight before draw",V),d=Math.max(d,V);let q=0;for(const G of H.events){const Q={descr:G,section:H.section,number:H.section,width:Xne,padding:ff,maxHeight:50};q+=ql.getVirtualNodeHeight(s,Q,i)}H.events.length>0&&(q+=(H.events.length-1)*kGe),C=Math.max(C,q)+Ldr}he.debug("maxSectionHeight before draw",h),he.debug("maxTaskHeight before draw",d);const A=Math.max(d,C)+lye;T?u.forEach(z=>{const H=o.filter(Z=>Z.section===z),B={number:b,descr:z,section:b,width:S,padding:ff,maxHeight:h};he.debug("sectionNode",B);const V=s.append("g"),q=ql.drawNode(V,B,b,i);he.debug("sectionNode output",q);const G=k-y;V.attr("transform",`translate(${G}, ${p})`);const Q=p+q.height+oye;H.length>0&&cye(s,H,b,k,Q,d,i,A,!1);const j=H.length,ae=q.height+oye+A*Math.max(j,1)-(j>0?lye*2:0);p+=ae,b++}):cye(s,o,b,k,p,d,i,A,!0);let M=(O=s.node())==null?void 0:O.getBBox();if(!M)throw new Error("bbox not found");if(he.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=(D=s.node())==null?void 0:D.getBBox(),!M)throw new Error("bbox not found");he.debug("bounds after title",M)}const[L]=c0(i.fontSize),P=(L??16)*2,N=(L??16)*.5+20,_=s.append("g").attr("class","lineWrapper");_.append("line").attr("x1",k).attr("y1",g-P).attr("x2",k).attr("y2",M.y+M.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),_.lower(),R3(void 0,s,(($=i.timeline)==null?void 0:$.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),cye=w(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:MO,padding:ff,maxHeight:a};he.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=ql.drawNode(f,d,r,s),g=p.height;he.debug("taskHeight after draw",g);const m=n-CGe-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+SGe;$dr(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),$dr=w(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:Xne,padding:ff,maxHeight:0};he.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=ql.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+kGe}return o-a},"drawEvents"),Ndr={setConf:w(()=>{},"setConf"),draw:Idr},Ddr=w(t=>{var o;const{theme:e}=pr(),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:w(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:w(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:w(function(g){this.begin(g)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(d,"Parser"),d.prototype=u,u.Parser=d,new d})();Dj.parser=Dj;var bdr=Dj,hGe={};y$(hGe,{addEvent:()=>wGe,addSection:()=>yGe,addTask:()=>xGe,addTaskOrg:()=>TGe,clear:()=>pGe,default:()=>xdr,getCommonDb:()=>fGe,getDirection:()=>mGe,getSections:()=>vGe,getTasks:()=>bGe,setDirection:()=>gGe});var w3="",dGe=0,Yne="LR",jne=[],UI=[],T3=[],fGe=w(()=>cK,"getCommonDb"),pGe=w(function(){jne.length=0,UI.length=0,w3="",T3.length=0,Yne="LR",wi()},"clear"),gGe=w(function(t){Yne=t},"setDirection"),mGe=w(function(){return Yne},"getDirection"),yGe=w(function(t){w3=t,jne.push(t)},"addSection"),vGe=w(function(){return jne},"getSections"),bGe=w(function(){let t=sye();const e=100;let r=0;for(;!t&&rr.id===dGe-1).events.push(t)},"addEvent"),TGe=w(function(t){const e={section:w3,type:w3,description:t,task:t,classes:[]};UI.push(e)},"addTaskOrg"),sye=w(function(){const t=w(function(r){return T3[r].processed},"compileTask");let e=!0;for(const[r,n]of T3.entries())t(r),e=e&&n.processed;return e},"compileTasks"),xdr={clear:pGe,getCommonDb:fGe,getDirection:mGe,setDirection:gGe,addSection:yGe,getSections:vGe,getTasks:bGe,addTask:xGe,addTaskOrg:TGe,addEvent:wGe},kGe=0,LO=w(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"),wdr=w(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=MT().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)+")")}w(a,"smile");function s(l){const u=MT().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)+")")}w(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 w(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Tdr=w(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"),CGe=w(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"),kdr=w(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)}w(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,CGe(t,e)},"drawLabel"),Cdr=w(function(t,e,r){const n=t.append("g"),i=Xne();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,LO(n,i),SGe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),Oj=-1,Sdr=w(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");Oj++,a.append("line").attr("id",n+"-task"+Oj).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"),wdr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Xne();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,LO(a,o),SGe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Edr=w(function(t,e){LO(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Adr=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Xne=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),SGe=(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)}w(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))})}w(Kne,"wrap");var _dr=w(function(t,e,r,n,i,a=!1){var v,x,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(Kne,e.width).node().getBBox(),y=(x=n.fontSize)!=null&&x.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})`),Ldr(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const T=s.includes("dark"),k=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=bt(k),C=S.attr("id")??"",E=C?`${C}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const A=S.select("defs");(A.empty()?S.append("defs"):A).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",T?"0.2":"0.06").attr("flood-color",T?"#FFFFFF":"#000000")}}return e},"drawNode"),Mdr=w(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(Kne,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"),Ldr=w(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-"+kGe++).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"),ql={drawRect:LO,drawCircle:Tdr,drawSection:Cdr,drawText:CGe,drawLabel:kdr,drawTask:Sdr,drawBackgroundRect:Edr,getTextObj:Adr,getNoteRect:Xne,initGraphics:Rdr,drawNode:_dr,getVirtualNodeHeight:Mdr},Idr=w(function(t,e,r,n){var I,O,D;const i=We(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=bt("#i"+e));const m=bt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();he.debug("task",y),ql.initGraphics(m,e);const x=n.db.getSections();he.debug("sections",x);let b=0,T=0,k=0,S=0,C=50+d,E=50;S=50;let A=0,M=!0;x.forEach(function($){const F={number:A,descr:$,section:A,width:150,padding:20,maxHeight:b},z=ql.getVirtualNodeHeight(m,F,i);he.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let L=0,P=0;he.debug("tasks.length",y.length);for(const[$,F]of y.entries()){const z={number:$,descr:F,section:F.section,width:150,padding:20,maxHeight:T},H=ql.getVirtualNodeHeight(m,z,i);he.debug("taskHeight before draw",H),T=Math.max(T,H+20),L=Math.max(L,F.events.length);let B=0;for(const V of F.events){const q={descr:V,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=ql.getVirtualNodeHeight(m,q,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}he.debug("maxSectionHeight before draw",b),he.debug("maxTaskHeight before draw",T),x&&x.length>0?x.forEach($=>{const F=y.filter(V=>V.section===$),z={number:A,descr:$,section:A,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};he.debug("sectionNode",z);const H=m.append("g"),B=ql.drawNode(H,z,A,i,e);he.debug("sectionNode output",B),H.attr("transform",`translate(${C}, ${S})`),E+=b+50,F.length>0&&oye(m,F,A,C,E,T,i,L,P,b,!1,e),C+=200*Math.max(F.length,1),E=S,A++}):(M=!1,oye(m,y,A,C,E,T,i,L,P,b,!0,e));const N=m.node().getBBox();if(he.debug("bounds",N),v&&m.append("text").text(v).attr("x",a==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),k=M?b+T+150:T+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",k).attr("x2",N.width+3*d).attr("y2",k).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const $=m.select("defs"),z=($.empty()?m.append("defs"):$).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)}R3(void 0,m,((O=i.timeline)==null?void 0:O.padding)??50,((D=i.timeline)==null?void 0:D.useMaxWidth)??!1)},"draw"),oye=w(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};he.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=ql.drawNode(m,g,r,s,d).height;if(he.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const x=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+$dr(t,p.events,r,n,i,s,d),i-=100,x.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"),$dr=w(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};he.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=ql.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"),Ndr={setConf:w(()=>{},"setConf"),draw:Idr},IO=200,ff=5,Ddr=IO+ff*2,Zne=IO+100,Odr=Zne+ff*2,EGe=10,Pdr=0,lye=20,AGe=20,cye=30,RGe=50,Bdr=w(function(t,e,r,n){var I,O,D,$,F;const i=We(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;he.debug("timeline",n.db);const s=Po(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();he.debug("task",o),ql.initGraphics(s);const u=n.db.getSections();he.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=Ddr+AGe,v=Odr+RGe,x=m+y;let b=0;const T=u&&u.length>0,k=T?x:f+y,S=Math.max(50,y+v-ff*2);u.forEach(function(z){const H={number:b,descr:z,section:b,width:S,padding:ff,maxHeight:h},B=ql.getVirtualNodeHeight(s,H,i);he.debug("sectionHeight before draw",B),h=Math.max(h,B)});let C=0;he.debug("tasks.length",o.length);for(const[z,H]of o.entries()){const B={number:z,descr:H,section:H.section,width:IO,padding:ff,maxHeight:d},V=ql.getVirtualNodeHeight(s,B,i);he.debug("taskHeight before draw",V),d=Math.max(d,V);let q=0;for(const G of H.events){const Q={descr:G,section:H.section,number:H.section,width:Zne,padding:ff,maxHeight:50};q+=ql.getVirtualNodeHeight(s,Q,i)}H.events.length>0&&(q+=(H.events.length-1)*EGe),C=Math.max(C,q)+Pdr}he.debug("maxSectionHeight before draw",h),he.debug("maxTaskHeight before draw",d);const A=Math.max(d,C)+cye;T?u.forEach(z=>{const H=o.filter(Z=>Z.section===z),B={number:b,descr:z,section:b,width:S,padding:ff,maxHeight:h};he.debug("sectionNode",B);const V=s.append("g"),q=ql.drawNode(V,B,b,i);he.debug("sectionNode output",q);const G=k-y;V.attr("transform",`translate(${G}, ${p})`);const Q=p+q.height+lye;H.length>0&&uye(s,H,b,k,Q,d,i,A,!1);const j=H.length,ae=q.height+lye+A*Math.max(j,1)-(j>0?cye*2:0);p+=ae,b++}):uye(s,o,b,k,p,d,i,A,!0);let M=(O=s.node())==null?void 0:O.getBBox();if(!M)throw new Error("bbox not found");if(he.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=(D=s.node())==null?void 0:D.getBBox(),!M)throw new Error("bbox not found");he.debug("bounds after title",M)}const[L]=c0(i.fontSize),P=(L??16)*2,N=(L??16)*.5+20,_=s.append("g").attr("class","lineWrapper");_.append("line").attr("x1",k).attr("y1",g-P).attr("x2",k).attr("y2",M.y+M.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),_.lower(),R3(void 0,s,(($=i.timeline)==null?void 0:$.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),uye=w(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:IO,padding:ff,maxHeight:a};he.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=ql.drawNode(f,d,r,s),g=p.height;he.debug("taskHeight after draw",g);const m=n-AGe-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+RGe;Fdr(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Fdr=w(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:Zne,padding:ff,maxHeight:0};he.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=ql.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+EGe}return o-a},"drawEvents"),zdr={setConf:w(()=>{},"setConf"),draw:Bdr},Hdr=w(t=>{var o;const{theme:e}=pr(),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}=pr(),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}=pr(),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:w((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"?Ndr.draw(t,e,r,n):Rdr.draw(t,e,r,n)},"draw")},zdr={db:lGe,renderer:Fdr,parser:fdr,styles:Bdr};const Hdr=Object.freeze(Object.defineProperty({__proto__:null,diagram:zdr},Symbol.toStringTag,{value:"Module"})),Ks=[];for(let t=0;t<256;++t)Ks.push((t+256).toString(16).slice(1));function Vdr(t,e=0){return(Ks[t[e+0]]+Ks[t[e+1]]+Ks[t[e+2]]+Ks[t[e+3]]+"-"+Ks[t[e+4]]+Ks[t[e+5]]+"-"+Ks[t[e+6]]+Ks[t[e+7]]+"-"+Ks[t[e+8]]+Ks[t[e+9]]+"-"+Ks[t[e+10]]+Ks[t[e+11]]+Ks[t[e+12]]+Ks[t[e+13]]+Ks[t[e+14]]+Ks[t[e+15]]).toLowerCase()}const Wdr=new Uint8Array(16);function qdr(){return crypto.getRandomValues(Wdr)}function Gdr(t,e,r){return crypto.randomUUID?crypto.randomUUID():Udr(t)}function Udr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??qdr();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,Vdr(n)}var Dj=(function(){var t=w(function(T,k,S,C){for(S=S||{},C=T.length;C--;S[T[C]]=k);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:w(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:w(function(k,S,C,E,A,M,L){var P=M.length-1;switch(A){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:w(function(k,S){if(S.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=S,C}},"parseError"),parse:w(function(k){var S=this,C=[0],E=[],A=[null],M=[],L=this.table,P="",N=0,_=0,I=2,O=1,D=M.slice.call(arguments,1),$=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]);$.setInput(k,F.yy),F.yy.lexer=$,F.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var H=$.yylloc;M.push(H);var B=$.options&&$.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V($e){C.length=C.length-2*$e,A.length=A.length-$e,M.length=M.length-$e}w(V,"popStack");function q(){var $e;return $e=E.pop()||$.lex()||O,typeof $e!="number"&&($e instanceof Array&&(E=$e,$e=E.pop()),$e=S.symbols_[$e]||$e),$e}w(q,"lex");for(var G,Q,j,ae,Z={},J,re,ee,me;;){if(Q=C[C.length-1],this.defaultActions[Q]?j=this.defaultActions[Q]:((G===null||typeof G>"u")&&(G=q()),j=L[Q]&&L[Q][G]),typeof j>"u"||!j.length||!j[0]){var te="";me=[];for(J in L[Q])this.terminals_[J]&&J>I&&me.push("'"+this.terminals_[J]+"'");$.showPosition?te="Parse error on line "+(N+1)+`: +`},"getStyles"),qdr=Wdr,Gdr={setConf:w(()=>{},"setConf"),draw:w((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"?zdr.draw(t,e,r,n):Ndr.draw(t,e,r,n)},"draw")},Udr={db:hGe,renderer:Gdr,parser:bdr,styles:qdr};const Ydr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Udr},Symbol.toStringTag,{value:"Module"})),Ks=[];for(let t=0;t<256;++t)Ks.push((t+256).toString(16).slice(1));function jdr(t,e=0){return(Ks[t[e+0]]+Ks[t[e+1]]+Ks[t[e+2]]+Ks[t[e+3]]+"-"+Ks[t[e+4]]+Ks[t[e+5]]+"-"+Ks[t[e+6]]+Ks[t[e+7]]+"-"+Ks[t[e+8]]+Ks[t[e+9]]+"-"+Ks[t[e+10]]+Ks[t[e+11]]+Ks[t[e+12]]+Ks[t[e+13]]+Ks[t[e+14]]+Ks[t[e+15]]).toLowerCase()}const Xdr=new Uint8Array(16);function Kdr(){return crypto.getRandomValues(Xdr)}function Zdr(t,e,r){return crypto.randomUUID?crypto.randomUUID():Qdr(t)}function Qdr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Kdr();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,jdr(n)}var Pj=(function(){var t=w(function(T,k,S,C){for(S=S||{},C=T.length;C--;S[T[C]]=k);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:w(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:w(function(k,S,C,E,A,M,L){var P=M.length-1;switch(A){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:w(function(k,S){if(S.recoverable)this.trace(k);else{var C=new Error(k);throw C.hash=S,C}},"parseError"),parse:w(function(k){var S=this,C=[0],E=[],A=[null],M=[],L=this.table,P="",N=0,_=0,I=2,O=1,D=M.slice.call(arguments,1),$=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]);$.setInput(k,F.yy),F.yy.lexer=$,F.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var H=$.yylloc;M.push(H);var B=$.options&&$.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V($e){C.length=C.length-2*$e,A.length=A.length-$e,M.length=M.length-$e}w(V,"popStack");function q(){var $e;return $e=E.pop()||$.lex()||O,typeof $e!="number"&&($e instanceof Array&&(E=$e,$e=E.pop()),$e=S.symbols_[$e]||$e),$e}w(q,"lex");for(var G,Q,j,ae,Z={},J,re,ee,me;;){if(Q=C[C.length-1],this.defaultActions[Q]?j=this.defaultActions[Q]:((G===null||typeof G>"u")&&(G=q()),j=L[Q]&&L[Q][G]),typeof j>"u"||!j.length||!j[0]){var te="";me=[];for(J in L[Q])this.terminals_[J]&&J>I&&me.push("'"+this.terminals_[J]+"'");$.showPosition?te="Parse error on line "+(N+1)+`: `+$.showPosition()+` Expecting `+me.join(", ")+", got '"+(this.terminals_[G]||G)+"'":te="Parse error on line "+(N+1)+": Unexpected "+(G==O?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(te,{text:$.match,token:this.terminals_[G]||G,line:$.yylineno,loc:H,expected:me})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+G);switch(j[0]){case 1:C.push(G),A.push($.yytext),M.push($.yylloc),C.push(j[1]),G=null,_=$.yyleng,P=$.yytext,N=$.yylineno,H=$.yylloc;break;case 2:if(re=this.productions_[j[1]][1],Z.$=A[A.length-re],Z._$={first_line:M[M.length-(re||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(re||1)].first_column,last_column:M[M.length-1].last_column},B&&(Z._$.range=[M[M.length-(re||1)].range[0],M[M.length-1].range[1]]),ae=this.performAction.apply(Z,[P,_,N,F.yy,j[1],A,M].concat(D)),typeof ae<"u")return ae;re&&(C=C.slice(0,-1*re*2),A=A.slice(0,-1*re),M=M.slice(0,-1*re)),C.push(this.productions_[j[1]][0]),A.push(Z.$),M.push(Z._$),ee=L[C[C.length-2]][C[C.length-1]],C.push(ee);break;case 3:return!0}}return!0},"parse")},x=(function(){var T={EOF:1,parseError:w(function(S,C){if(this.yy.parser)this.yy.parser.parseError(S,C);else throw new Error(S)},"parseError"),setInput:w(function(k,S){return this.yy=S||this.yy||{},this._input=k,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:w(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var S=k.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),k},"input"),unput:w(function(k){var S=k.length,C=k.split(/(?:\r\n?|\n)/g);this._input=k+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),C.length-1&&(this.yylineno-=C.length-1);var A=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===E.length?this.yylloc.first_column:0)+E[E.length-C.length].length-C[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(k){this.unput(this.match.slice(k))},"less"),pastInput:w(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var k=this.pastInput(),S=new Array(k.length+1).join("-");return k+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:w(function(k,S){var C,E,A;if(this.options.backtrack_lexer&&(A={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&&(A.yylloc.range=this.yylloc.range.slice(0))),E=k[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+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,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(k[0].length),this.matched+=k[0],C=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var M in A)this[M]=A[M];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,S,C,E;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),M=0;MS[0].length)){if(S=C,E=M,this.options.backtrack_lexer){if(k=this.test_match(C,A[M]),k!==!1)return k;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(k=this.test_match(S,A[E]),k!==!1?k:!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:w(function(){var S=this.next();return S||this.lex()},"lex"),begin:w(function(S){this.conditionStack.push(S)},"begin"),popState:w(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:w(function(S){this.begin(S)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(S,C,E,A){switch(E){case 0:return S.getLogger().trace("Found comment",C.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:",C.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 ...",C.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:",C.yytext),20;case 36:return S.getLogger().trace("Long description:",C.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 T})();v.lexer=x;function b(){this.yy={}}return w(b,"Parser"),b.prototype=v,v.Parser=b,new b})();Dj.parser=Dj;var Ydr=Dj,jdr=12,Kd={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iT,Xdr=(iT=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Kd,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;he.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=We();let o=((h=s.mindmap)==null?void 0:h.padding)??xn.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:Tn(r,s),level:e,descr:Tn(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??xn.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(he.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=We(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Tn(e.icon,r)),e.class&&(n.class=Tn(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%(jdr-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=We(),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=w(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Kd.CIRCLE:return"mindmapCircle";case Kd.RECT:return"rect";case Kd.ROUNDED_RECT:return"rounded";case Kd.CLOUD:return"cloud";case Kd.BANG:return"bang";case Kd.HEXAGON:return"hexagon";case Kd.DEFAULT:return h?"rounded":"defaultMindmapNode";case Kd.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=We();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=We(),i=Bxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};he.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),he.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-"+Gdr()}}getLogger(){return he}},w(iT,"MindmapDB"),iT),Kdr=w(async(t,e,r,n)=>{var f,p;he.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),s=Q3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=vE(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 I3(a,s);const{themeVariables:l}=pr(),{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)}Gy(s,((f=a.config.mindmap)==null?void 0:f.padding)??xn.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??xn.mindmap.useMaxWidth)},"draw"),Zdr={draw:Kdr},Qdr=w(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:w(function(S){this.begin(S)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(S,C,E,A){switch(E){case 0:return S.getLogger().trace("Found comment",C.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:",C.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 ...",C.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:",C.yytext),20;case 36:return S.getLogger().trace("Long description:",C.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 T})();v.lexer=x;function b(){this.yy={}}return w(b,"Parser"),b.prototype=v,v.Parser=b,new b})();Pj.parser=Pj;var Jdr=Pj,efr=12,Zd={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iT,tfr=(iT=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Zd,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;he.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=We();let o=((h=s.mindmap)==null?void 0:h.padding)??xn.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:Tn(r,s),level:e,descr:Tn(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??xn.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(he.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=We(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Tn(e.icon,r)),e.class&&(n.class=Tn(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%(efr-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=We(),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=w(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Zd.CIRCLE:return"mindmapCircle";case Zd.RECT:return"rect";case Zd.ROUNDED_RECT:return"rounded";case Zd.CLOUD:return"cloud";case Zd.BANG:return"bang";case Zd.HEXAGON:return"hexagon";case Zd.DEFAULT:return h?"rounded":"defaultMindmapNode";case Zd.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=We();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=We(),i=Fxe().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};he.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),he.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-"+Zdr()}}getLogger(){return he}},w(iT,"MindmapDB"),iT),rfr=w(async(t,e,r,n)=>{var f,p;he.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=Q3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=bE(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 I3(a,s);const{themeVariables:l}=pr(),{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)}Gy(s,((f=a.config.mindmap)==null?void 0:f.padding)??xn.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??xn.mindmap.useMaxWidth)},"draw"),nfr={draw:rfr},ifr=w(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"),sfr=w(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; } - ${Qdr(t)} + ${ifr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -4166,18 +4179,18 @@ Expecting `+me.join(", ")+", got '"+(this.terminals_[G]||G)+"'":te="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?Jdr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),tfr=efr,rfr={get db(){return new Xdr},renderer:Zdr,parser:Ydr,styles:tfr};const nfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:rfr},Symbol.toStringTag,{value:"Module"}));var Oj=(function(){var t=w(function(C,E,A,M){for(A=A||{},M=C.length;M--;A[C[M]]=E);return A},"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],x=[1,6,7,11,13,16,17,20,23],b=[1,38],T={trace:w(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:w(function(E,A,M,L,P,N,_){var I=N.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: ",N[I-1].id),L.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:L.getLogger().info("Node: ",N[I].id),L.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:L.getLogger().trace("Icon: ",N[I]),L.decorateNode({icon:N[I]});break;case 18:case 23:L.decorateNode({class:N[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",N[I-1].id),L.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:L.getLogger().trace("Node: ",N[I].id),L.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:L.decorateNode({icon:N[I]});break;case 27:L.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:L.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:L.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:L.getType(N[I-2],N[I])};break;case 30:this.$=N[I-1]+N[I];break;case 31:this.$=N[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(x,[2,8]),t(x,[2,9]),t(x,[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(x,[2,11]),t(x,[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:w(function(E,A){if(A.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=A,M}},"parseError"),parse:w(function(E){var A=this,M=[0],L=[],P=[null],N=[],_=this.table,I="",O=0,D=0,$=2,F=1,z=N.slice.call(arguments,1),H=Object.create(this.lexer),B={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(B.yy[V]=this.yy[V]);H.setInput(E,B.yy),B.yy.lexer=H,B.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var q=H.yylloc;N.push(q);var G=H.options&&H.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Q(ue){M.length=M.length-2*ue,P.length=P.length-ue,N.length=N.length-ue}w(Q,"popStack");function j(){var ue;return ue=L.pop()||H.lex()||F,typeof ue!="number"&&(ue instanceof Array&&(L=ue,ue=L.pop()),ue=A.symbols_[ue]||ue),ue}w(j,"lex");for(var ae,Z,J,re,ee={},me,te,$e,Oe;;){if(Z=M[M.length-1],this.defaultActions[Z]?J=this.defaultActions[Z]:((ae===null||typeof ae>"u")&&(ae=j()),J=_[Z]&&_[Z][ae]),typeof J>"u"||!J.length||!J[0]){var He="";Oe=[];for(me in _[Z])this.terminals_[me]&&me>$&&Oe.push("'"+this.terminals_[me]+"'");H.showPosition?He="Parse error on line "+(O+1)+`: + ${t.useGradient&&r&&t.mainBkg?afr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),ofr=sfr,lfr={get db(){return new tfr},renderer:nfr,parser:Jdr,styles:ofr};const cfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:lfr},Symbol.toStringTag,{value:"Module"}));var Bj=(function(){var t=w(function(C,E,A,M){for(A=A||{},M=C.length;M--;A[C[M]]=E);return A},"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],x=[1,6,7,11,13,16,17,20,23],b=[1,38],T={trace:w(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:w(function(E,A,M,L,P,N,_){var I=N.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: ",N[I-1].id),L.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:L.getLogger().info("Node: ",N[I].id),L.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:L.getLogger().trace("Icon: ",N[I]),L.decorateNode({icon:N[I]});break;case 18:case 23:L.decorateNode({class:N[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",N[I-1].id),L.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:L.getLogger().trace("Node: ",N[I].id),L.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:L.decorateNode({icon:N[I]});break;case 27:L.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:L.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:L.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:L.getType(N[I-2],N[I])};break;case 30:this.$=N[I-1]+N[I];break;case 31:this.$=N[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(x,[2,8]),t(x,[2,9]),t(x,[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(x,[2,11]),t(x,[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:w(function(E,A){if(A.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=A,M}},"parseError"),parse:w(function(E){var A=this,M=[0],L=[],P=[null],N=[],_=this.table,I="",O=0,D=0,$=2,F=1,z=N.slice.call(arguments,1),H=Object.create(this.lexer),B={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(B.yy[V]=this.yy[V]);H.setInput(E,B.yy),B.yy.lexer=H,B.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var q=H.yylloc;N.push(q);var G=H.options&&H.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Q(ue){M.length=M.length-2*ue,P.length=P.length-ue,N.length=N.length-ue}w(Q,"popStack");function j(){var ue;return ue=L.pop()||H.lex()||F,typeof ue!="number"&&(ue instanceof Array&&(L=ue,ue=L.pop()),ue=A.symbols_[ue]||ue),ue}w(j,"lex");for(var ae,Z,J,re,ee={},me,te,$e,Oe;;){if(Z=M[M.length-1],this.defaultActions[Z]?J=this.defaultActions[Z]:((ae===null||typeof ae>"u")&&(ae=j()),J=_[Z]&&_[Z][ae]),typeof J>"u"||!J.length||!J[0]){var He="";Oe=[];for(me in _[Z])this.terminals_[me]&&me>$&&Oe.push("'"+this.terminals_[me]+"'");H.showPosition?He="Parse error on line "+(O+1)+`: `+H.showPosition()+` Expecting `+Oe.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":He="Parse error on line "+(O+1)+": Unexpected "+(ae==F?"end of input":"'"+(this.terminals_[ae]||ae)+"'"),this.parseError(He,{text:H.match,token:this.terminals_[ae]||ae,line:H.yylineno,loc:q,expected:Oe})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+ae);switch(J[0]){case 1:M.push(ae),P.push(H.yytext),N.push(H.yylloc),M.push(J[1]),ae=null,D=H.yyleng,I=H.yytext,O=H.yylineno,q=H.yylloc;break;case 2:if(te=this.productions_[J[1]][1],ee.$=P[P.length-te],ee._$={first_line:N[N.length-(te||1)].first_line,last_line:N[N.length-1].last_line,first_column:N[N.length-(te||1)].first_column,last_column:N[N.length-1].last_column},G&&(ee._$.range=[N[N.length-(te||1)].range[0],N[N.length-1].range[1]]),re=this.performAction.apply(ee,[I,D,O,B.yy,J[1],P,N].concat(z)),typeof re<"u")return re;te&&(M=M.slice(0,-1*te*2),P=P.slice(0,-1*te),N=N.slice(0,-1*te)),M.push(this.productions_[J[1]][0]),P.push(ee.$),N.push(ee._$),$e=_[M[M.length-2]][M[M.length-1]],M.push($e);break;case 3:return!0}}return!0},"parse")},k=(function(){var C={EOF:1,parseError:w(function(A,M){if(this.yy.parser)this.yy.parser.parseError(A,M);else throw new Error(A)},"parseError"),setInput:w(function(E,A){return this.yy=A||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:w(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var A=E.match(/(?:\r\n?|\n).*/g);return A?(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:w(function(E){var A=E.length,M=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;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-A},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(E){this.unput(this.match.slice(E))},"less"),pastInput:w(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:w(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:w(function(){var E=this.pastInput(),A=new Array(E.length+1).join("-");return E+this.upcomingInput()+` `+A+"^"},"showPosition"),test_match:w(function(E,A){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,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var N in P)this[N]=P[N];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,A,M,L;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),N=0;NA[0].length)){if(A=M,L=N,this.options.backtrack_lexer){if(E=this.test_match(M,P[N]),E!==!1)return E;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(E=this.test_match(A,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:w(function(){var A=this.next();return A||this.lex()},"lex"),begin:w(function(A){this.conditionStack.push(A)},"begin"),popState:w(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:w(function(A){this.begin(A)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(A,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 N=/\n\s*/g;return M.yytext=M.yytext.replace(N,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return A.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:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return A.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:A.getLogger().trace("end icon"),this.popState();break;case 16:return A.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return A.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return A.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:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return A.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),A.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 41:return A.getLogger().trace("Long description:",M.yytext),21;case 42:return A.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 C})();T.lexer=k;function S(){this.yy={}}return w(S,"Parser"),S.prototype=T,T.Parser=S,new S})();Oj.parser=Oj;var ifr=Oj,Kc=[],Kne=[],Pj=0,Zne={},afr=w(()=>{Kc=[],Kne=[],Pj=0,Zne={}},"clear"),sfr=w(t=>{if(Kc.length===0)return null;const e=Kc[0].level;let r=null;for(let n=Kc.length-1;n>=0;n--)if(Kc[n].level===e&&!r&&(r=Kc[n]),Kc[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Tn(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:We()}},"getData"),lfr=w((t,e,r,n,i)=>{var u,h;const a=We();let s=((u=a.mindmap)==null?void 0:u.padding)??xn.mindmap.padding;switch(n){case us.ROUNDED_RECT:case us.RECT:case us.HEXAGON:s*=2}const o={id:Tn(e,a)||"kbn"+Pj++,level:t,label:Tn(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??xn.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var A=this.next();return A||this.lex()},"lex"),begin:w(function(A){this.conditionStack.push(A)},"begin"),popState:w(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:w(function(A){this.begin(A)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(A,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 N=/\n\s*/g;return M.yytext=M.yytext.replace(N,"
"),24;case 4:return 24;case 5:this.popState();break;case 6:return A.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:A.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return A.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:A.getLogger().trace("end icon"),this.popState();break;case 16:return A.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return A.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return A.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return A.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:A.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return A.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),A.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),A.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),A.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),A.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),A.getLogger().trace("node end (("),"NODE_DEND";case 41:return A.getLogger().trace("Long description:",M.yytext),21;case 42:return A.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 C})();T.lexer=k;function S(){this.yy={}}return w(S,"Parser"),S.prototype=T,T.Parser=S,new S})();Bj.parser=Bj;var ufr=Bj,Kc=[],Qne=[],Fj=0,Jne={},hfr=w(()=>{Kc=[],Qne=[],Fj=0,Jne={}},"clear"),dfr=w(t=>{if(Kc.length===0)return null;const e=Kc[0].level;let r=null;for(let n=Kc.length-1;n>=0;n--)if(Kc[n].level===e&&!r&&(r=Kc[n]),Kc[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Tn(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:We()}},"getData"),pfr=w((t,e,r,n,i)=>{var u,h;const a=We();let s=((u=a.mindmap)==null?void 0:u.padding)??xn.mindmap.padding;switch(n){case us.ROUNDED_RECT:case us.RECT:case us.HEXAGON:s*=2}const o={id:Tn(e,a)||"kbn"+Fj++,level:t,label:Tn(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??xn.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=M$(d,{schema:_$});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=sfr(t);l?o.parentId=l.id||"kbn"+Pj++:Kne.push(o),Kc.push(o)},"addNode"),us={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},cfr=w((t,e)=>{switch(he.debug("In get type",t,e),t){case"[":return us.RECT;case"(":return e===")"?us.ROUNDED_RECT:us.CLOUD;case"((":return us.CIRCLE;case")":return us.CLOUD;case"))":return us.BANG;case"{{":return us.HEXAGON;default:return us.DEFAULT}},"getType"),ufr=w((t,e)=>{Zne[t]=e},"setElementForId"),hfr=w(t=>{if(!t)return;const e=We(),r=Kc[Kc.length-1];t.icon&&(r.icon=Tn(t.icon,e)),t.class&&(r.cssClasses=Tn(t.class,e))},"decorateNode"),dfr=w(t=>{switch(t){case us.DEFAULT:return"no-border";case us.RECT:return"rect";case us.ROUNDED_RECT:return"rounded-rect";case us.CIRCLE:return"circle";case us.CLOUD:return"cloud";case us.BANG:return"bang";case us.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),ffr=w(()=>he,"getLogger"),pfr=w(t=>Zne[t],"getElementById"),gfr={clear:afr,addNode:lfr,getSections:EGe,getData:ofr,nodeType:us,getType:cfr,setElementForId:ufr,decorateNode:hfr,type2Str:dfr,getLogger:ffr,getElementById:pfr},mfr=gfr,yfr=w(async(t,e,r,n)=>{var y,v,x,b,T;he.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),s=We();s.htmlLabels=!1;const o=Po(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=S*d+(d-1)*f/2,k.width=S,k.y=0,k.height=S*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await B$(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const S=p[m];m=m+1;const C=((x=s==null?void 0:s.kanban)==null?void 0:x.sectionWidth)||200,E=-C*3/2+g;let A=E;const M=a.nodes.filter(N=>N.parentId===k.id);for(const N of M){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=k.x,N.width=C-1.5*f;const I=(await yE(u,N,{config:s})).node().getBBox();N.y=A+I.height/2,await tM(N),A=N.y+I.height/2+f/2}const L=S.cluster.select("rect"),P=Math.max(A-E+3*f,50)+(g-25);L.attr("height",P)}R3(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??xn.kanban.padding,((T=s.mindmap)==null?void 0:T.useMaxWidth)??xn.kanban.useMaxWidth)},"draw"),vfr={draw:yfr},bfr=w(t=>{let e="";for(let n=0;nt.darkMode?ct(n,i):lt(n,i),"adjuster");for(let n=0;n{switch(he.debug("In get type",t,e),t){case"[":return us.RECT;case"(":return e===")"?us.ROUNDED_RECT:us.CLOUD;case"((":return us.CIRCLE;case")":return us.CLOUD;case"))":return us.BANG;case"{{":return us.HEXAGON;default:return us.DEFAULT}},"getType"),mfr=w((t,e)=>{Jne[t]=e},"setElementForId"),yfr=w(t=>{if(!t)return;const e=We(),r=Kc[Kc.length-1];t.icon&&(r.icon=Tn(t.icon,e)),t.class&&(r.cssClasses=Tn(t.class,e))},"decorateNode"),vfr=w(t=>{switch(t){case us.DEFAULT:return"no-border";case us.RECT:return"rect";case us.ROUNDED_RECT:return"rounded-rect";case us.CIRCLE:return"circle";case us.CLOUD:return"cloud";case us.BANG:return"bang";case us.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),bfr=w(()=>he,"getLogger"),xfr=w(t=>Jne[t],"getElementById"),wfr={clear:hfr,addNode:pfr,getSections:_Ge,getData:ffr,nodeType:us,getType:gfr,setElementForId:mfr,decorateNode:yfr,type2Str:vfr,getLogger:bfr,getElementById:xfr},Tfr=wfr,kfr=w(async(t,e,r,n)=>{var y,v,x,b,T;he.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=We();s.htmlLabels=!1;const o=Po(e);for(const k of a.nodes)k.domId=`${e}-${k.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(k=>k.isGroup);let d=0;const f=10,p=[];let g=25;for(const k of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,k.x=S*d+(d-1)*f/2,k.width=S,k.y=0,k.height=S*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+d;const C=await z$(l,k);g=Math.max(g,(v=C==null?void 0:C.labelBBox)==null?void 0:v.height),p.push(C)}let m=0;for(const k of h){const S=p[m];m=m+1;const C=((x=s==null?void 0:s.kanban)==null?void 0:x.sectionWidth)||200,E=-C*3/2+g;let A=E;const M=a.nodes.filter(N=>N.parentId===k.id);for(const N of M){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=k.x,N.width=C-1.5*f;const I=(await vE(u,N,{config:s})).node().getBBox();N.y=A+I.height/2,await rM(N),A=N.y+I.height/2+f/2}const L=S.cluster.select("rect"),P=Math.max(A-E+3*f,50)+(g-25);L.attr("height",P)}R3(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??xn.kanban.padding,((T=s.mindmap)==null?void 0:T.useMaxWidth)??xn.kanban.useMaxWidth)},"draw"),Cfr={draw:kfr},Sfr=w(t=>{let e="";for(let n=0;nt.darkMode?ct(n,i):lt(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),Efr=w(t=>` .edge { stroke-width: 3; } - ${bfr(t)} + ${Sfr(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -4254,15 +4267,15 @@ Expecting `+Oe.join(", ")+", got '"+(this.terminals_[ae]||ae)+"'":He="Parse erro dominant-baseline: middle; text-align: center; } - ${XE()} -`,"getStyles"),wfr=xfr,Tfr={db:mfr,renderer:vfr,parser:ifr,styles:wfr};const kfr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tfr},Symbol.toStringTag,{value:"Module"}));function uye(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 AGe(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 EH(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 Cfr(t){return t.target.depth}function Sfr(t){return t.depth}function Efr(t,e){return e-1-t.height}function RGe(t,e){return t.sourceLinks.length?t.depth:e-1}function Afr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?AGe(t.sourceLinks,Cfr)-1:0}function _8(t){return function(){return t}}function hye(t,e){return GI(t.source,e.source)||t.index-e.index}function dye(t,e){return GI(t.target,e.target)||t.index-e.index}function GI(t,e){return t.y0-e.y0}function AH(t){return t.value}function Rfr(t){return t.index}function _fr(t){return t.nodes}function Mfr(t){return t.links}function fye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function pye({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 Lfr(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=Rfr,l=RGe,u,h,d=_fr,f=Mfr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),x(I),k(I),pye(I),I}g.update=function(I){return pye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:_8(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:_8(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:_8(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:_8(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:O}){for(const[$,F]of I.entries())F.index=$,F.sourceLinks=[],F.targetLinks=[];const D=new Map(I.map(($,F)=>[o($,F,I),$]));for(const[$,F]of O.entries()){F.index=$;let{source:z,target:H}=F;typeof z!="object"&&(z=F.source=fye(D,z)),typeof H!="object"&&(H=F.target=fye(D,H)),z.sourceLinks.push(F),H.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:$,targetLinks:F}of I)$.sort(h),F.sort(h)}function y({nodes:I}){for(const O of I)O.value=O.fixedValue===void 0?Math.max(EH(O.sourceLinks,AH),EH(O.targetLinks,AH)):O.fixedValue}function v({nodes:I}){const O=I.length;let D=new Set(I),$=new Set,F=0;for(;D.size;){for(const z of D){z.depth=F;for(const{target:H}of z.sourceLinks)$.add(H)}if(++F>O)throw new Error("circular link");D=$,$=new Set}}function x({nodes:I}){const O=I.length;let D=new Set(I),$=new Set,F=0;for(;D.size;){for(const z of D){z.height=F;for(const{source:H}of z.targetLinks)$.add(H)}if(++F>O)throw new Error("circular link");D=$,$=new Set}}function b({nodes:I}){const O=uye(I,F=>F.depth)+1,D=(r-t-i)/(O-1),$=new Array(O);for(const F of I){const z=Math.max(0,Math.min(O-1,Math.floor(l.call(null,F,O))));F.layer=z,F.x0=t+z*D,F.x1=F.x0+i,$[z]?$[z].push(F):$[z]=[F]}if(u)for(const F of $)F.sort(u);return $}function T(I){const O=AGe(I,D=>(n-e-(D.length-1)*s)/EH(D,AH));for(const D of I){let $=e;for(const F of D){F.y0=$,F.y1=$+F.value*O,$=F.y1+s;for(const z of F.sourceLinks)z.width=z.value*O}$=(n-$+s)/(D.length+1);for(let F=0;FD.length)-1)),T(O);for(let D=0;D0))continue;let q=(B/V-H.y0)*O;H.y0+=q,H.y1+=q,L(H)}u===void 0&&z.sort(GI),E(z,D)}}function C(I,O,D){for(let $=I.length,F=$-2;F>=0;--F){const z=I[F];for(const H of z){let B=0,V=0;for(const{target:G,value:Q}of H.sourceLinks){let j=Q*(G.layer-H.layer);B+=_(H,G)*j,V+=j}if(!(V>0))continue;let q=(B/V-H.y0)*O;H.y0+=q,H.y1+=q,L(H)}u===void 0&&z.sort(GI),E(z,D)}}function E(I,O){const D=I.length>>1,$=I[D];M(I,$.y0-s,D-1,O),A(I,$.y1+s,D+1,O),M(I,n,I.length-1,O),A(I,e,0,O)}function A(I,O,D,$){for(;D1e-6&&(F.y0+=z,F.y1+=z),O=F.y1+s}}function M(I,O,D,$){for(;D>=0;--D){const F=I[D],z=(F.y1-O)*$;z>1e-6&&(F.y0-=z,F.y1-=z),O=F.y0-s}}function L({sourceLinks:I,targetLinks:O}){if(h===void 0){for(const{source:{sourceLinks:D}}of O)D.sort(dye);for(const{target:{targetLinks:D}}of I)D.sort(hye)}}function P(I){if(h===void 0)for(const{sourceLinks:O,targetLinks:D}of I)O.sort(dye),D.sort(hye)}function N(I,O){let D=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:$,width:F}of I.sourceLinks){if($===O)break;D+=F+s}for(const{source:$,width:F}of O.targetLinks){if($===I)break;D-=F}return D}function _(I,O){let D=O.y0-(O.targetLinks.length-1)*s/2;for(const{source:$,width:F}of O.targetLinks){if($===I)break;D+=F+s}for(const{target:$,width:F}of I.sourceLinks){if($===O)break;D-=F}return D}return g}var Bj=Math.PI,Fj=2*Bj,km=1e-6,Ifr=Fj-km;function zj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _Ge(){return new zj}zj.prototype=_Ge.prototype={constructor:zj,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>km)if(!(Math.abs(h*o-l*u)>km)||!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),x=i*Math.tan((Bj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>km&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+T*o)+","+(this._y1=e+T*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)>km||Math.abs(this._y1-u)>km)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%Fj+Fj),d>Ifr?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>km&&(this._+="A"+r+","+r+",0,"+ +(d>=Bj)+","+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 gye(t){return function(){return t}}function $fr(t){return t[0]}function Nfr(t){return t[1]}var Dfr=Array.prototype.slice;function Ofr(t){return t.source}function Pfr(t){return t.target}function Bfr(t){var e=Ofr,r=Pfr,n=$fr,i=Nfr,a=null;function s(){var o,l=Dfr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=_Ge()),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:gye(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:gye(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function Ffr(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function zfr(){return Bfr(Ffr)}function Hfr(t){return[t.source.x1,t.y0]}function Vfr(t){return[t.target.x0,t.y1]}function Wfr(){return zfr().source(Hfr).target(Vfr)}var Hj=(function(){var t=w(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:w(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:w(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('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);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:w(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:w(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,T=p.slice.call(arguments,1),k=Object.create(this.lexer),S={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(S.yy[C]=this.yy[C]);k.setInput(l,S.yy),S.yy.lexer=k,S.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var E=k.yylloc;p.push(E);var A=k.options&&k.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}w(M,"popStack");function L(){var B;return B=d.pop()||k.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}w(L,"lex");for(var P,N,_,I,O={},D,$,F,z;;){if(N=h[h.length-1],this.defaultActions[N]?_=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=L()),_=g[N]&&g[N][P]),typeof _>"u"||!_.length||!_[0]){var H="";z=[];for(D in g[N])this.terminals_[D]&&D>x&&z.push("'"+this.terminals_[D]+"'");k.showPosition?H="Parse error on line "+(y+1)+`: + ${KE()} +`,"getStyles"),Afr=Efr,Rfr={db:Tfr,renderer:Cfr,parser:ufr,styles:Afr};const _fr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rfr},Symbol.toStringTag,{value:"Module"}));function hye(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 MGe(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 RH(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 Mfr(t){return t.target.depth}function Lfr(t){return t.depth}function Ifr(t,e){return e-1-t.height}function LGe(t,e){return t.sourceLinks.length?t.depth:e-1}function $fr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?MGe(t.sourceLinks,Mfr)-1:0}function M8(t){return function(){return t}}function dye(t,e){return YI(t.source,e.source)||t.index-e.index}function fye(t,e){return YI(t.target,e.target)||t.index-e.index}function YI(t,e){return t.y0-e.y0}function _H(t){return t.value}function Nfr(t){return t.index}function Dfr(t){return t.nodes}function Ofr(t){return t.links}function pye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function gye({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 Pfr(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=Nfr,l=LGe,u,h,d=Dfr,f=Ofr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),x(I),k(I),gye(I),I}g.update=function(I){return gye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:M8(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:M8(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:M8(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:M8(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:O}){for(const[$,F]of I.entries())F.index=$,F.sourceLinks=[],F.targetLinks=[];const D=new Map(I.map(($,F)=>[o($,F,I),$]));for(const[$,F]of O.entries()){F.index=$;let{source:z,target:H}=F;typeof z!="object"&&(z=F.source=pye(D,z)),typeof H!="object"&&(H=F.target=pye(D,H)),z.sourceLinks.push(F),H.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:$,targetLinks:F}of I)$.sort(h),F.sort(h)}function y({nodes:I}){for(const O of I)O.value=O.fixedValue===void 0?Math.max(RH(O.sourceLinks,_H),RH(O.targetLinks,_H)):O.fixedValue}function v({nodes:I}){const O=I.length;let D=new Set(I),$=new Set,F=0;for(;D.size;){for(const z of D){z.depth=F;for(const{target:H}of z.sourceLinks)$.add(H)}if(++F>O)throw new Error("circular link");D=$,$=new Set}}function x({nodes:I}){const O=I.length;let D=new Set(I),$=new Set,F=0;for(;D.size;){for(const z of D){z.height=F;for(const{source:H}of z.targetLinks)$.add(H)}if(++F>O)throw new Error("circular link");D=$,$=new Set}}function b({nodes:I}){const O=hye(I,F=>F.depth)+1,D=(r-t-i)/(O-1),$=new Array(O);for(const F of I){const z=Math.max(0,Math.min(O-1,Math.floor(l.call(null,F,O))));F.layer=z,F.x0=t+z*D,F.x1=F.x0+i,$[z]?$[z].push(F):$[z]=[F]}if(u)for(const F of $)F.sort(u);return $}function T(I){const O=MGe(I,D=>(n-e-(D.length-1)*s)/RH(D,_H));for(const D of I){let $=e;for(const F of D){F.y0=$,F.y1=$+F.value*O,$=F.y1+s;for(const z of F.sourceLinks)z.width=z.value*O}$=(n-$+s)/(D.length+1);for(let F=0;FD.length)-1)),T(O);for(let D=0;D0))continue;let q=(B/V-H.y0)*O;H.y0+=q,H.y1+=q,L(H)}u===void 0&&z.sort(YI),E(z,D)}}function C(I,O,D){for(let $=I.length,F=$-2;F>=0;--F){const z=I[F];for(const H of z){let B=0,V=0;for(const{target:G,value:Q}of H.sourceLinks){let j=Q*(G.layer-H.layer);B+=_(H,G)*j,V+=j}if(!(V>0))continue;let q=(B/V-H.y0)*O;H.y0+=q,H.y1+=q,L(H)}u===void 0&&z.sort(YI),E(z,D)}}function E(I,O){const D=I.length>>1,$=I[D];M(I,$.y0-s,D-1,O),A(I,$.y1+s,D+1,O),M(I,n,I.length-1,O),A(I,e,0,O)}function A(I,O,D,$){for(;D1e-6&&(F.y0+=z,F.y1+=z),O=F.y1+s}}function M(I,O,D,$){for(;D>=0;--D){const F=I[D],z=(F.y1-O)*$;z>1e-6&&(F.y0-=z,F.y1-=z),O=F.y0-s}}function L({sourceLinks:I,targetLinks:O}){if(h===void 0){for(const{source:{sourceLinks:D}}of O)D.sort(fye);for(const{target:{targetLinks:D}}of I)D.sort(dye)}}function P(I){if(h===void 0)for(const{sourceLinks:O,targetLinks:D}of I)O.sort(fye),D.sort(dye)}function N(I,O){let D=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:$,width:F}of I.sourceLinks){if($===O)break;D+=F+s}for(const{source:$,width:F}of O.targetLinks){if($===I)break;D-=F}return D}function _(I,O){let D=O.y0-(O.targetLinks.length-1)*s/2;for(const{source:$,width:F}of O.targetLinks){if($===I)break;D+=F+s}for(const{target:$,width:F}of I.sourceLinks){if($===O)break;D-=F}return D}return g}var zj=Math.PI,Hj=2*zj,km=1e-6,Bfr=Hj-km;function Vj(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function IGe(){return new Vj}Vj.prototype=IGe.prototype={constructor:Vj,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>km)if(!(Math.abs(h*o-l*u)>km)||!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),x=i*Math.tan((zj-Math.acos((g+d-m)/(2*y*v)))/2),b=x/v,T=x/y;Math.abs(b-1)>km&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+T*o)+","+(this._y1=e+T*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)>km||Math.abs(this._y1-u)>km)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%Hj+Hj),d>Bfr?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>km&&(this._+="A"+r+","+r+",0,"+ +(d>=zj)+","+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 mye(t){return function(){return t}}function Ffr(t){return t[0]}function zfr(t){return t[1]}var Hfr=Array.prototype.slice;function Vfr(t){return t.source}function Wfr(t){return t.target}function qfr(t){var e=Vfr,r=Wfr,n=Ffr,i=zfr,a=null;function s(){var o,l=Hfr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=IGe()),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:mye(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:mye(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function Gfr(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Ufr(){return qfr(Gfr)}function Yfr(t){return[t.source.x1,t.y0]}function jfr(t){return[t.target.x0,t.y1]}function Xfr(){return Ufr().source(Yfr).target(jfr)}var Wj=(function(){var t=w(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:w(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:w(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('""','"')),x=parseFloat(p[m].trim());d.addLink(y,v,x);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:w(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:w(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,x=2,b=1,T=p.slice.call(arguments,1),k=Object.create(this.lexer),S={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(S.yy[C]=this.yy[C]);k.setInput(l,S.yy),S.yy.lexer=k,S.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var E=k.yylloc;p.push(E);var A=k.options&&k.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}w(M,"popStack");function L(){var B;return B=d.pop()||k.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}w(L,"lex");for(var P,N,_,I,O={},D,$,F,z;;){if(N=h[h.length-1],this.defaultActions[N]?_=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=L()),_=g[N]&&g[N][P]),typeof _>"u"||!_.length||!_[0]){var H="";z=[];for(D in g[N])this.terminals_[D]&&D>x&&z.push("'"+this.terminals_[D]+"'");k.showPosition?H="Parse error on line "+(y+1)+`: `+k.showPosition()+` Expecting `+z.join(", ")+", got '"+(this.terminals_[P]||P)+"'":H="Parse error on line "+(y+1)+": Unexpected "+(P==b?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(H,{text:k.match,token:this.terminals_[P]||P,line:k.yylineno,loc:E,expected:z})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+P);switch(_[0]){case 1:h.push(P),f.push(k.yytext),p.push(k.yylloc),h.push(_[1]),P=null,v=k.yyleng,m=k.yytext,y=k.yylineno,E=k.yylloc;break;case 2:if($=this.productions_[_[1]][1],O.$=f[f.length-$],O._$={first_line:p[p.length-($||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-($||1)].first_column,last_column:p[p.length-1].last_column},A&&(O._$.range=[p[p.length-($||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply(O,[m,v,y,S.yy,_[1],f,p].concat(T)),typeof I<"u")return I;$&&(h=h.slice(0,-1*$*2),f=f.slice(0,-1*$),p=p.slice(0,-1*$)),h.push(this.productions_[_[1]][0]),f.push(O.$),p.push(O._$),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:w(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:w(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:w(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:w(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:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(l){this.unput(this.match.slice(l))},"less"),pastInput:w(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:w(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:w(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:w(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:w(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:w(function(){var u=this.next();return u||this.lex()},"lex"),begin:w(function(u){this.conditionStack.push(u)},"begin"),popState:w(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:w(function(u){this.begin(u)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(s,"Parser"),s.prototype=i,i.Parser=s,new s})();Hj.parser=Hj;var UI=Hj,LO=[],IO=[],YI=new Map,qfr=w(()=>{LO=[],IO=[],YI=new Map,wi()},"clear"),aT,Gfr=(aT=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(aT,"SankeyLink"),aT),Ufr=w((t,e,r)=>{LO.push(new Gfr(t,e,r))},"addLink"),sT,Yfr=(sT=class{constructor(e){this.ID=e}},w(sT,"SankeyNode"),sT),jfr=w(t=>{t=Ft.sanitizeText(t,We());let e=YI.get(t);return e===void 0&&(e=new Yfr(t),YI.set(t,e),IO.push(e)),e},"findOrCreateNode"),Xfr=w(()=>IO,"getNodes"),Kfr=w(()=>LO,"getLinks"),Zfr=w(()=>({nodes:IO.map(t=>({id:t.ID})),links:LO.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Qfr={nodesMap:YI,getConfig:w(()=>We().sankey,"getConfig"),getNodes:Xfr,getLinks:Kfr,getGraph:Zfr,addLink:Ufr,findOrCreateNode:jfr,getAccTitle:Yi,setAccTitle:$i,getAccDescription:Xi,setAccDescription:ji,getDiagramTitle:Di,setDiagramTitle:qi,clear:qfr},Ef,mye=(Ef=class{static next(e){return new Ef(e+ ++Ef.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},w(Ef,"Uid"),Ef.count=0,Ef),Jfr={left:Sfr,right:Efr,center:Afr,justify:RGe},e0r=w(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"),t0r=w(function(t,e,r,n){const{securityLevel:i,sankey:a}=We(),s=Gxe.sankey;let o;i==="sandbox"&&(o=bt("#i"+e));const l=bt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):bt(`[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,x=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",T=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),S=Jfr[p];Lfr().nodeId($=>$.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(k);const E=e0r(k.nodes),A=w1(bdt),M=w($=>T[$]??A($),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",$=>($.uid=mye.next("node-")).id).attr("transform",function($){return"translate("+$.x0+","+$.y0+")"}).attr("x",$=>$.x0).attr("y",$=>$.y0).append("rect").attr("height",$=>$.y1-$.y0).attr("width",$=>$.x1-$.x0).attr("fill",$=>M($.id));const L=w(({id:$,value:F})=>y?`${$} -${g}${Math.round(F*100)/100}${m}`:$,"getText"),P=w($=>b==="outlined"?($.layer??0)N.selectAll($?`.${$}`:"text").data(k.nodes).join("text").attr("class",$??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"?(_("sankey-label-bg"),_("sankey-label-fg")):_();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(a==null?void 0:a.linkColor)??"gradient";if(O==="gradient"){const $=I.append("linearGradient").attr("id",F=>(F.uid=mye.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);$.append("stop").attr("offset","0%").attr("stop-color",F=>M(F.source.id)),$.append("stop").attr("offset","100%").attr("stop-color",F=>M(F.target.id))}let D;switch(O){case"gradient":D=w($=>$.uid,"coloring");break;case"source":D=w($=>M($.source.id),"coloring");break;case"target":D=w($=>M($.target.id),"coloring");break;default:D=O}I.append("path").attr("d",Wfr()).attr("stroke",D).attr("stroke-width",$=>Math.max(1,$.width)),R3(void 0,u,0,f)},"draw"),r0r={draw:t0r},n0r=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),i0r=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var u=this.next();return u||this.lex()},"lex"),begin:w(function(u){this.conditionStack.push(u)},"begin"),popState:w(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:w(function(u){this.begin(u)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(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 w(s,"Parser"),s.prototype=i,i.Parser=s,new s})();Wj.parser=Wj;var jI=Wj,$O=[],NO=[],XI=new Map,Kfr=w(()=>{$O=[],NO=[],XI=new Map,wi()},"clear"),aT,Zfr=(aT=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(aT,"SankeyLink"),aT),Qfr=w((t,e,r)=>{$O.push(new Zfr(t,e,r))},"addLink"),sT,Jfr=(sT=class{constructor(e){this.ID=e}},w(sT,"SankeyNode"),sT),e0r=w(t=>{t=Ft.sanitizeText(t,We());let e=XI.get(t);return e===void 0&&(e=new Jfr(t),XI.set(t,e),NO.push(e)),e},"findOrCreateNode"),t0r=w(()=>NO,"getNodes"),r0r=w(()=>$O,"getLinks"),n0r=w(()=>({nodes:NO.map(t=>({id:t.ID})),links:$O.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),i0r={nodesMap:XI,getConfig:w(()=>We().sankey,"getConfig"),getNodes:t0r,getLinks:r0r,getGraph:n0r,addLink:Qfr,findOrCreateNode:e0r,getAccTitle:Yi,setAccTitle:$i,getAccDescription:Xi,setAccDescription:ji,getDiagramTitle:Di,setDiagramTitle:qi,clear:Kfr},Ef,yye=(Ef=class{static next(e){return new Ef(e+ ++Ef.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},w(Ef,"Uid"),Ef.count=0,Ef),a0r={left:Lfr,right:Ifr,center:$fr,justify:LGe},s0r=w(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"),o0r=w(function(t,e,r,n){const{securityLevel:i,sankey:a}=We(),s=Uxe.sankey;let o;i==="sandbox"&&(o=bt("#i"+e));const l=bt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):bt(`[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,x=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",T=(a==null?void 0:a.nodeColors)??{},k=n.db.getGraph(),S=a0r[p];Pfr().nodeId($=>$.id).nodeWidth(v).nodePadding(x+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(k);const E=s0r(k.nodes),A=w1(Tdt),M=w($=>T[$]??A($),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(k.nodes).join("g").attr("class","node").attr("id",$=>($.uid=yye.next("node-")).id).attr("transform",function($){return"translate("+$.x0+","+$.y0+")"}).attr("x",$=>$.x0).attr("y",$=>$.y0).append("rect").attr("height",$=>$.y1-$.y0).attr("width",$=>$.x1-$.x0).attr("fill",$=>M($.id));const L=w(({id:$,value:F})=>y?`${$} +${g}${Math.round(F*100)/100}${m}`:$,"getText"),P=w($=>b==="outlined"?($.layer??0)N.selectAll($?`.${$}`:"text").data(k.nodes).join("text").attr("class",$??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"?(_("sankey-label-bg"),_("sankey-label-fg")):_();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(k.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(a==null?void 0:a.linkColor)??"gradient";if(O==="gradient"){const $=I.append("linearGradient").attr("id",F=>(F.uid=yye.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);$.append("stop").attr("offset","0%").attr("stop-color",F=>M(F.source.id)),$.append("stop").attr("offset","100%").attr("stop-color",F=>M(F.target.id))}let D;switch(O){case"gradient":D=w($=>$.uid,"coloring");break;case"source":D=w($=>M($.source.id),"coloring");break;case"target":D=w($=>M($.target.id),"coloring");break;default:D=O}I.append("path").attr("d",Xfr()).attr("stroke",D).attr("stroke-width",$=>Math.max(1,$.width)),R3(void 0,u,0,f)},"draw"),l0r={draw:o0r},c0r=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),u0r=w(t=>`.label { font-family: ${t.fontFamily}; } @@ -4294,7 +4307,7 @@ ${g}${Math.round(F*100)/100}${m}`:$,"getText"),P=w($=>b==="outlined"?($.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),a0r=i0r,s0r=UI.parse.bind(UI);UI.parse=t=>s0r(n0r(t));var o0r={styles:a0r,parser:UI,db:Qfr,renderer:r0r};const l0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:o0r},Symbol.toStringTag,{value:"Module"}));var c0r=xn.packet,oT,MGe=(oT=class{constructor(){this.packet=[],this.setAccTitle=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji}getConfig(){const e=Gi({...c0r,...pr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){wi(),this.packet=[]}},w(oT,"PacketDB"),oT),u0r=1e4,h0r=w((t,e)=>{Al(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"),LGe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("packet",t),r=(n=LGe.parser)==null?void 0:n.yy;if(!(r instanceof MGe))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.");he.debug(e),h0r(e,r)},"parse")},f0r=w((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=Po(e);m.attr("viewBox",`0 0 ${g} ${p}`),_a(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())p0r(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"),p0r=w((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"),g0r={draw:f0r},m0r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},y0r=w(({packet:t}={})=>{const e=Gi(m0r,t);return` +`,"getStyles"),h0r=u0r,d0r=jI.parse.bind(jI);jI.parse=t=>d0r(c0r(t));var f0r={styles:h0r,parser:jI,db:i0r,renderer:l0r};const p0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:f0r},Symbol.toStringTag,{value:"Module"}));var g0r=xn.packet,oT,$Ge=(oT=class{constructor(){this.packet=[],this.setAccTitle=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji}getConfig(){const e=Gi({...g0r,...pr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){wi(),this.packet=[]}},w(oT,"PacketDB"),oT),m0r=1e4,y0r=w((t,e)=>{Al(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"),NGe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("packet",t),r=(n=NGe.parser)==null?void 0:n.yy;if(!(r instanceof $Ge))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.");he.debug(e),y0r(e,r)},"parse")},b0r=w((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=Po(e);m.attr("viewBox",`0 0 ${g} ${p}`),_a(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())x0r(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"),x0r=w((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"),w0r={draw:b0r},T0r={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},k0r=w(({packet:t}={})=>{const e=Gi(T0r,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -4317,7 +4330,7 @@ ${g}${Math.round(F*100)/100}${m}`:$,"getText"),P=w($=>b==="outlined"?($.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),v0r={parser:LGe,get db(){return new MGe},renderer:g0r,styles:y0r};const b0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:v0r},Symbol.toStringTag,{value:"Module"}));var L2={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},M8=32,IGe={axes:[],curves:[],options:L2},Xh=structuredClone(IGe),x0r=xn.radar,w0r=w(()=>Gi({...x0r,...pr().radar}),"getConfig"),$Ge=w(()=>Xh.axes,"getAxes"),T0r=w(()=>Xh.curves,"getCurves"),k0r=w(()=>Xh.options,"getOptions"),C0r=w(t=>{Xh.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),S0r=w(t=>{Xh.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:E0r(e.entries)}))},"setCurves"),E0r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=$Ge();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"),A0r=w(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Xh.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??L2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??L2.ticks,max:((i=e.max)==null?void 0:i.value)??L2.max,min:((a=e.min)==null?void 0:a.value)??L2.min,graticule:((s=e.graticule)==null?void 0:s.value)??L2.graticule},Xh.options.ticks>M8&&(he.warn(`Radar diagram ticks (${Xh.options.ticks}) exceeds maximum allowed (${M8}). Using ${M8} instead.`),Xh.options.ticks=M8)},"setOptions"),R0r=w(()=>{wi(),Xh=structuredClone(IGe)},"clear"),nC={getAxes:$Ge,getCurves:T0r,getOptions:k0r,setAxes:C0r,setCurves:S0r,setOptions:A0r,getConfig:w0r,clear:R0r,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},_0r=w(t=>{Al(t,nC);const{axes:e,curves:r,options:n}=t;nC.setAxes(e),nC.setCurves(r),nC.setOptions(n)},"populate"),M0r={parse:w(async t=>{const e=await xu("radar",t);he.debug(e),_0r(e)},"parse")},L0r=w((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Po(e),d=I0r(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;$0r(d,a,g,o.ticks,o.graticule),N0r(d,a,g,l),NGe(d,a,s,p,f,o.graticule,l),PGe(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),I0r=w((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 _a(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"),$0r=w((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"),N0r=w((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 NGe(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=DGe(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",OGe(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}`)})}w(NGe,"drawCurves");function DGe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(DGe,"relativeRadius");function OGe(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)})}w(PGe,"drawLegend");var D0r={draw:L0r},O0r=w((t,e)=>{let r="";for(let n=0;nGi({...E0r,...pr().radar}),"getConfig"),OGe=w(()=>Kh.axes,"getAxes"),R0r=w(()=>Kh.curves,"getCurves"),_0r=w(()=>Kh.options,"getOptions"),M0r=w(t=>{Kh.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),L0r=w(t=>{Kh.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:I0r(e.entries)}))},"setCurves"),I0r=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=OGe();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"),$0r=w(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Kh.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??L2.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??L2.ticks,max:((i=e.max)==null?void 0:i.value)??L2.max,min:((a=e.min)==null?void 0:a.value)??L2.min,graticule:((s=e.graticule)==null?void 0:s.value)??L2.graticule},Kh.options.ticks>L8&&(he.warn(`Radar diagram ticks (${Kh.options.ticks}) exceeds maximum allowed (${L8}). Using ${L8} instead.`),Kh.options.ticks=L8)},"setOptions"),N0r=w(()=>{wi(),Kh=structuredClone(DGe)},"clear"),nC={getAxes:OGe,getCurves:R0r,getOptions:_0r,setAxes:M0r,setCurves:L0r,setOptions:$0r,getConfig:A0r,clear:N0r,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},D0r=w(t=>{Al(t,nC);const{axes:e,curves:r,options:n}=t;nC.setAxes(e),nC.setCurves(r),nC.setOptions(n)},"populate"),O0r={parse:w(async t=>{const e=await xu("radar",t);he.debug(e),D0r(e)},"parse")},P0r=w((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=Po(e),d=B0r(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;F0r(d,a,g,o.ticks,o.graticule),z0r(d,a,g,l),PGe(d,a,s,p,f,o.graticule,l),zGe(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),B0r=w((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 _a(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"),F0r=w((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"),z0r=w((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 PGe(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=BGe(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",FGe(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}`)})}w(PGe,"drawCurves");function BGe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(BGe,"relativeRadius");function FGe(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)})}w(zGe,"drawLegend");var H0r={draw:P0r},V0r=w((t,e)=>{let r="";for(let n=0;nb==="outlined"?($.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),P0r=w(t=>{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),B0r=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=P0r(t);return` + `}return r},"genIndexStyles"),W0r=w(t=>{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),q0r=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=W0r(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -4356,13 +4369,13 @@ ${g}${Math.round(F*100)/100}${m}`:$,"getText"),P=w($=>b==="outlined"?($.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${O0r(e,r)} - `},"styles"),F0r={parser:M0r,db:nC,renderer:D0r,styles:B0r};const z0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:F0r},Symbol.toStringTag,{value:"Module"}));var Vj=(function(){var t=w(function(b,T,k,S){for(k=k||{},S=b.length;S--;k[b[S]]=T);return k},"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:w(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:w(function(T,k,S,C,E,A,M){var L=A.length-1;switch(E){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",A[L-1]),C.setHierarchy(A[L-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",A[L]),typeof A[L].length=="number"?this.$=A[L]:this.$=[A[L]];break;case 13:C.getLogger().debug("Rule: statement #2: ",A[L-1]),this.$=[A[L-1]].concat(A[L]);break;case 14:C.getLogger().debug("Rule: link: ",A[L],T),this.$={edgeTypeStr:A[L],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",A[L-3],A[L-1],A[L]),this.$={edgeTypeStr:A[L],label:A[L-1]};break;case 18:const P=parseInt(A[L]),N=C.generateId();this.$={id:N,type:"space",label:"",width:P,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",A[L-2],A[L-1],A[L]," typestr: ",A[L-1].edgeTypeStr);const _=C.edgeStrToEdgeData(A[L-1].edgeTypeStr),I=C.edgeStrToEdgeStartData(A[L-1].edgeTypeStr),O=C.edgeStrToThickness(A[L-1].edgeTypeStr),D=C.edgeStrToPattern(A[L-1].edgeTypeStr);this.$=[{id:A[L-2].id,label:A[L-2].label,type:A[L-2].type,directions:A[L-2].directions},{id:A[L-2].id+"-"+A[L].id,start:A[L-2].id,end:A[L].id,label:A[L-1].label,type:"edge",thickness:O,pattern:D,directions:A[L].directions,arrowTypeEnd:_,arrowTypeStart:I},{id:A[L].id,label:A[L].label,type:C.typeStr2Type(A[L].typeStr),directions:A[L].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[L-1],A[L]),this.$={id:A[L-1].id,label:A[L-1].label,type:C.typeStr2Type(A[L-1].typeStr),directions:A[L-1].directions,widthInColumns:parseInt(A[L],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",A[L]),this.$={id:A[L].id,label:A[L].label,type:C.typeStr2Type(A[L].typeStr),directions:A[L].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",A[L]),this.$={type:"column-setting",columns:A[L]==="auto"?-1:parseInt(A[L])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",A[L-2],A[L-1]),C.generateId(),this.$={...A[L-2],type:"composite",children:A[L-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",A[L-2],A[L-1],A[L]);const $=C.generateId();this.$={id:$,type:"composite",label:"",children:A[L-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",A[L]),this.$={id:A[L]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[L-1],A[L]),this.$={id:A[L-1],label:A[L].label,typeStr:A[L].typeStr,directions:A[L].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",A[L]),this.$=[A[L]];break;case 32:C.getLogger().debug("Rule: dirList: ",A[L-1],A[L]),this.$=[A[L-1]].concat(A[L]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",A[L-2],A[L-1],A[L]),this.$={typeStr:A[L-2]+A[L],label:A[L-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[L-3],A[L-2]," #3:",A[L-1],A[L]),this.$={typeStr:A[L-3]+A[L],label:A[L-2],directions:A[L-1]};break;case 35:case 36:this.$={type:"classDef",id:A[L-1].trim(),css:A[L].trim()};break;case 37:this.$={type:"applyClass",id:A[L-1].trim(),styleClass:A[L].trim()};break;case 38:this.$={type:"applyStyles",id:A[L-1].trim(),stylesStr:A[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:w(function(T,k){if(k.recoverable)this.trace(T);else{var S=new Error(T);throw S.hash=k,S}},"parseError"),parse:w(function(T){var k=this,S=[0],C=[],E=[null],A=[],M=this.table,L="",P=0,N=0,_=2,I=1,O=A.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&($.yy[F]=this.yy[F]);D.setInput(T,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var z=D.yylloc;A.push(z);var H=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(te){S.length=S.length-2*te,E.length=E.length-te,A.length=A.length-te}w(B,"popStack");function V(){var te;return te=C.pop()||D.lex()||I,typeof te!="number"&&(te instanceof Array&&(C=te,te=C.pop()),te=k.symbols_[te]||te),te}w(V,"lex");for(var q,G,Q,j,ae={},Z,J,re,ee;;){if(G=S[S.length-1],this.defaultActions[G]?Q=this.defaultActions[G]:((q===null||typeof q>"u")&&(q=V()),Q=M[G]&&M[G][q]),typeof Q>"u"||!Q.length||!Q[0]){var me="";ee=[];for(Z in M[G])this.terminals_[Z]&&Z>_&&ee.push("'"+this.terminals_[Z]+"'");D.showPosition?me="Parse error on line "+(P+1)+`: + ${V0r(e,r)} + `},"styles"),G0r={parser:O0r,db:nC,renderer:H0r,styles:q0r};const U0r=Object.freeze(Object.defineProperty({__proto__:null,diagram:G0r},Symbol.toStringTag,{value:"Module"}));var qj=(function(){var t=w(function(b,T,k,S){for(k=k||{},S=b.length;S--;k[b[S]]=T);return k},"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:w(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:w(function(T,k,S,C,E,A,M){var L=A.length-1;switch(E){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",A[L-1]),C.setHierarchy(A[L-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",A[L]),typeof A[L].length=="number"?this.$=A[L]:this.$=[A[L]];break;case 13:C.getLogger().debug("Rule: statement #2: ",A[L-1]),this.$=[A[L-1]].concat(A[L]);break;case 14:C.getLogger().debug("Rule: link: ",A[L],T),this.$={edgeTypeStr:A[L],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",A[L-3],A[L-1],A[L]),this.$={edgeTypeStr:A[L],label:A[L-1]};break;case 18:const P=parseInt(A[L]),N=C.generateId();this.$={id:N,type:"space",label:"",width:P,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",A[L-2],A[L-1],A[L]," typestr: ",A[L-1].edgeTypeStr);const _=C.edgeStrToEdgeData(A[L-1].edgeTypeStr),I=C.edgeStrToEdgeStartData(A[L-1].edgeTypeStr),O=C.edgeStrToThickness(A[L-1].edgeTypeStr),D=C.edgeStrToPattern(A[L-1].edgeTypeStr);this.$=[{id:A[L-2].id,label:A[L-2].label,type:A[L-2].type,directions:A[L-2].directions},{id:A[L-2].id+"-"+A[L].id,start:A[L-2].id,end:A[L].id,label:A[L-1].label,type:"edge",thickness:O,pattern:D,directions:A[L].directions,arrowTypeEnd:_,arrowTypeStart:I},{id:A[L].id,label:A[L].label,type:C.typeStr2Type(A[L].typeStr),directions:A[L].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[L-1],A[L]),this.$={id:A[L-1].id,label:A[L-1].label,type:C.typeStr2Type(A[L-1].typeStr),directions:A[L-1].directions,widthInColumns:parseInt(A[L],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",A[L]),this.$={id:A[L].id,label:A[L].label,type:C.typeStr2Type(A[L].typeStr),directions:A[L].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",A[L]),this.$={type:"column-setting",columns:A[L]==="auto"?-1:parseInt(A[L])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",A[L-2],A[L-1]),C.generateId(),this.$={...A[L-2],type:"composite",children:A[L-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",A[L-2],A[L-1],A[L]);const $=C.generateId();this.$={id:$,type:"composite",label:"",children:A[L-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",A[L]),this.$={id:A[L]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[L-1],A[L]),this.$={id:A[L-1],label:A[L].label,typeStr:A[L].typeStr,directions:A[L].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",A[L]),this.$=[A[L]];break;case 32:C.getLogger().debug("Rule: dirList: ",A[L-1],A[L]),this.$=[A[L-1]].concat(A[L]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",A[L-2],A[L-1],A[L]),this.$={typeStr:A[L-2]+A[L],label:A[L-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[L-3],A[L-2]," #3:",A[L-1],A[L]),this.$={typeStr:A[L-3]+A[L],label:A[L-2],directions:A[L-1]};break;case 35:case 36:this.$={type:"classDef",id:A[L-1].trim(),css:A[L].trim()};break;case 37:this.$={type:"applyClass",id:A[L-1].trim(),styleClass:A[L].trim()};break;case 38:this.$={type:"applyStyles",id:A[L-1].trim(),stylesStr:A[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:w(function(T,k){if(k.recoverable)this.trace(T);else{var S=new Error(T);throw S.hash=k,S}},"parseError"),parse:w(function(T){var k=this,S=[0],C=[],E=[null],A=[],M=this.table,L="",P=0,N=0,_=2,I=1,O=A.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&($.yy[F]=this.yy[F]);D.setInput(T,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var z=D.yylloc;A.push(z);var H=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(te){S.length=S.length-2*te,E.length=E.length-te,A.length=A.length-te}w(B,"popStack");function V(){var te;return te=C.pop()||D.lex()||I,typeof te!="number"&&(te instanceof Array&&(C=te,te=C.pop()),te=k.symbols_[te]||te),te}w(V,"lex");for(var q,G,Q,j,ae={},Z,J,re,ee;;){if(G=S[S.length-1],this.defaultActions[G]?Q=this.defaultActions[G]:((q===null||typeof q>"u")&&(q=V()),Q=M[G]&&M[G][q]),typeof Q>"u"||!Q.length||!Q[0]){var me="";ee=[];for(Z in M[G])this.terminals_[Z]&&Z>_&&ee.push("'"+this.terminals_[Z]+"'");D.showPosition?me="Parse error on line "+(P+1)+`: `+D.showPosition()+` Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":me="Parse error on line "+(P+1)+": Unexpected "+(q==I?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(me,{text:D.match,token:this.terminals_[q]||q,line:D.yylineno,loc:z,expected:ee})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+q);switch(Q[0]){case 1:S.push(q),E.push(D.yytext),A.push(D.yylloc),S.push(Q[1]),q=null,N=D.yyleng,L=D.yytext,P=D.yylineno,z=D.yylloc;break;case 2:if(J=this.productions_[Q[1]][1],ae.$=E[E.length-J],ae._$={first_line:A[A.length-(J||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(J||1)].first_column,last_column:A[A.length-1].last_column},H&&(ae._$.range=[A[A.length-(J||1)].range[0],A[A.length-1].range[1]]),j=this.performAction.apply(ae,[L,N,P,$.yy,Q[1],E,A].concat(O)),typeof j<"u")return j;J&&(S=S.slice(0,-1*J*2),E=E.slice(0,-1*J),A=A.slice(0,-1*J)),S.push(this.productions_[Q[1]][0]),E.push(ae.$),A.push(ae._$),re=M[S[S.length-2]][S[S.length-1]],S.push(re);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:w(function(k,S){if(this.yy.parser)this.yy.parser.parseError(k,S);else throw new Error(k)},"parseError"),setInput:w(function(T,k){return this.yy=k||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:w(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var k=T.match(/(?:\r\n?|\n).*/g);return k?(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:w(function(T){var k=T.length,S=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;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),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===C.length?this.yylloc.first_column:0)+C[C.length-S.length].length-S[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(T){this.unput(this.match.slice(T))},"less"),pastInput:w(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:w(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:w(function(){var T=this.pastInput(),k=new Array(T.length+1).join("-");return T+this.upcomingInput()+` `+k+"^"},"showPosition"),test_match:w(function(T,k){var S,C,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))),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],S=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var A in E)this[A]=E[A];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,k,S,C;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),A=0;Ak[0].length)){if(k=S,C=A,this.options.backtrack_lexer){if(T=this.test_match(S,E[A]),T!==!1)return T;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(T=this.test_match(k,E[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:w(function(){var k=this.next();return k||this.lex()},"lex"),begin:w(function(k){this.conditionStack.push(k)},"begin"),popState:w(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:w(function(k){this.begin(k)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(k,S,C,E){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",S.yytext);break;case 4:k.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+/,""),k.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:k.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",k.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(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.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 k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return k.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:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return k.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 x(){this.yy={}}return w(x,"Parser"),x.prototype=y,y.Parser=x,new x})();Vj.parser=Vj;var H0r=Vj,th=new Map,Qne=[],Wj=new Map,yye="color",vye="fill",V0r="bgFill",BGe=",",jI=new Map,Jne="",W0r=w(t=>Ft.sanitizeText(t,We()),"sanitizeText"),q0r=w(function(t,e=""){let r=jI.get(t);r||(r={id:t,styles:[],textStyles:[]},jI.set(t,r)),e!=null&&e.split(BGe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(yye).exec(n)){const s=i.replace(vye,V0r).replace(yye,vye);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),G0r=w(function(t,e=""){const r=th.get(t);e!=null&&(r.styles=e.split(BGe))},"addStyle2Node"),U0r=w(function(t,e){t.split(",").forEach(function(r){let n=th.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},th.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),FGe=w((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&&he.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=W0r(s.label)),s.type==="classDef"){q0r(s.id,s.css);continue}if(s.type==="applyClass"){U0r(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&G0r(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=(Wj.get(s.id)??0)+1;Wj.set(s.id,o),s.id=o+"-"+s.id,Qne.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=th.get(s.id);if(o===void 0?th.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&FGe(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{he.debug("Clear called"),wi(),oS={id:"root",type:"composite",children:[],columns:-1},th=new Map([["root",oS]]),eie=[],jI=new Map,Qne=[],Wj=new Map,Jne=""},"clear");function zGe(t){switch(he.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return he.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"}}w(zGe,"typeStr2Type");function HGe(t){switch(he.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(HGe,"edgeTypeStr2Type");function VGe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(VGe,"edgeStrToEdgeData");function WGe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}w(WGe,"edgeStrToEdgeStartData");function qGe(t){return t.includes("==")?"thick":"normal"}w(qGe,"edgeStrToThickness");function GGe(t){return t.includes(".-")?"dotted":"solid"}w(GGe,"edgeStrToPattern");var bye=0,j0r=w(()=>(bye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+bye),"generateId"),X0r=w(t=>{oS.children=t,FGe(t,oS),eie=oS.children},"setHierarchy"),K0r=w(t=>{const e=th.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Z0r=w(()=>[...th.values()],"getBlocksFlat"),Q0r=w(()=>eie||[],"getBlocks"),J0r=w(()=>Qne,"getEdges"),epr=w(t=>th.get(t),"getBlock"),tpr=w(t=>{th.set(t.id,t)},"setBlock"),rpr=w(t=>{Jne=t},"setDiagramId"),npr=w(()=>Jne,"getDiagramId"),ipr=w(()=>he,"getLogger"),apr=w(function(){return jI},"getClasses"),spr={getConfig:w(()=>pr().block,"getConfig"),typeStr2Type:zGe,edgeTypeStr2Type:HGe,edgeStrToEdgeData:VGe,edgeStrToEdgeStartData:WGe,edgeStrToThickness:qGe,edgeStrToPattern:GGe,getLogger:ipr,getBlocksFlat:Z0r,getBlocks:Q0r,getEdges:J0r,setHierarchy:X0r,getBlock:epr,setBlock:tpr,getColumns:K0r,getClasses:apr,clear:Y0r,generateId:j0r,setDiagramId:rpr,getDiagramId:npr},opr=spr,RH=w((t,e)=>{const r=iK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),lpr=w(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var k=this.next();return k||this.lex()},"lex"),begin:w(function(k){this.conditionStack.push(k)},"begin"),popState:w(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:w(function(k){this.begin(k)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(k,S,C,E){switch(C){case 0:return k.getLogger().debug("Found block-beta"),10;case 1:return k.getLogger().debug("Found id-block"),29;case 2:return k.getLogger().debug("Found block"),10;case 3:k.getLogger().debug(".",S.yytext);break;case 4:k.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+/,""),k.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:k.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return k.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),k.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",k.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(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),k.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),k.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),k.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),k.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),k.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),k.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),k.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),k.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),k.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),k.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),k.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),k.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return k.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return k.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return k.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return k.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return k.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return k.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return k.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return k.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 k.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),k.getLogger().debug("LEX ARR START"),37;case 74:return k.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return k.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:k.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:k.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return k.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:k.getLogger().debug("LEX POPPING"),this.popState();break;case 84:k.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),k.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",k.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return k.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return k.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return k.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),k.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),k.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return k.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 x(){this.yy={}}return w(x,"Parser"),x.prototype=y,y.Parser=x,new x})();qj.parser=qj;var Y0r=qj,th=new Map,eie=[],Gj=new Map,vye="color",bye="fill",j0r="bgFill",HGe=",",KI=new Map,tie="",X0r=w(t=>Ft.sanitizeText(t,We()),"sanitizeText"),K0r=w(function(t,e=""){let r=KI.get(t);r||(r={id:t,styles:[],textStyles:[]},KI.set(t,r)),e!=null&&e.split(HGe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(vye).exec(n)){const s=i.replace(bye,j0r).replace(vye,bye);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),Z0r=w(function(t,e=""){const r=th.get(t);e!=null&&(r.styles=e.split(HGe))},"addStyle2Node"),Q0r=w(function(t,e){t.split(",").forEach(function(r){let n=th.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},th.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),VGe=w((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&&he.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=X0r(s.label)),s.type==="classDef"){K0r(s.id,s.css);continue}if(s.type==="applyClass"){Q0r(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Z0r(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=(Gj.get(s.id)??0)+1;Gj.set(s.id,o),s.id=o+"-"+s.id,eie.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=th.get(s.id);if(o===void 0?th.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&VGe(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{he.debug("Clear called"),wi(),oS={id:"root",type:"composite",children:[],columns:-1},th=new Map([["root",oS]]),rie=[],KI=new Map,eie=[],Gj=new Map,tie=""},"clear");function WGe(t){switch(he.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return he.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"}}w(WGe,"typeStr2Type");function qGe(t){switch(he.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(qGe,"edgeTypeStr2Type");function GGe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(GGe,"edgeStrToEdgeData");function UGe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}w(UGe,"edgeStrToEdgeStartData");function YGe(t){return t.includes("==")?"thick":"normal"}w(YGe,"edgeStrToThickness");function jGe(t){return t.includes(".-")?"dotted":"solid"}w(jGe,"edgeStrToPattern");var xye=0,epr=w(()=>(xye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+xye),"generateId"),tpr=w(t=>{oS.children=t,VGe(t,oS),rie=oS.children},"setHierarchy"),rpr=w(t=>{const e=th.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),npr=w(()=>[...th.values()],"getBlocksFlat"),ipr=w(()=>rie||[],"getBlocks"),apr=w(()=>eie,"getEdges"),spr=w(t=>th.get(t),"getBlock"),opr=w(t=>{th.set(t.id,t)},"setBlock"),lpr=w(t=>{tie=t},"setDiagramId"),cpr=w(()=>tie,"getDiagramId"),upr=w(()=>he,"getLogger"),hpr=w(function(){return KI},"getClasses"),dpr={getConfig:w(()=>pr().block,"getConfig"),typeStr2Type:WGe,edgeTypeStr2Type:qGe,edgeStrToEdgeData:GGe,edgeStrToEdgeStartData:UGe,edgeStrToThickness:YGe,edgeStrToPattern:jGe,getLogger:upr,getBlocksFlat:npr,getBlocks:ipr,getEdges:apr,setHierarchy:tpr,getBlock:spr,setBlock:opr,getColumns:rpr,getClasses:hpr,clear:J0r,generateId:epr,setDiagramId:lpr,getDiagramId:cpr},fpr=dpr,MH=w((t,e)=>{const r=sK,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return qu(n,i,a,e)},"fade"),ppr=w(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -4447,9 +4460,9 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":me="Parse error } .node .cluster { - // fill: ${RH(t.mainBkg,.5)}; - fill: ${RH(t.clusterBkg,.5)}; - stroke: ${RH(t.clusterBorder,.2)}; + // fill: ${MH(t.mainBkg,.5)}; + fill: ${MH(t.clusterBkg,.5)}; + stroke: ${MH(t.clusterBorder,.2)}; box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; stroke-width: 1px; } @@ -4484,14 +4497,14 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":me="Parse error font-size: 18px; fill: ${t.textColor}; } - ${XE()} -`,"getStyles"),cpr=lpr,upr=w((t,e,r,n)=>{e.forEach(i=>{xpr[i](t,r,n)})},"insertMarkers"),hpr=w((t,e,r)=>{he.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"),dpr=w((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"),fpr=w((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"),ppr=w((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"),gpr=w((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"),mpr=w((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"),ypr=w((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"),vpr=w((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"),bpr=w((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"),xpr={extension:hpr,composition:dpr,aggregation:fpr,dependency:ppr,lollipop:gpr,point:mpr,circle:ypr,cross:vpr,barb:bpr},wpr=upr;function qj(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}}w(qj,"calculateBlockPosition");var Tpr=w(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(he.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 XI(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;he.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 A of t.children)XI(A,e,0,0,i);const x=Tpr(t);a=x.width,s=x.height,he.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const A of t.children)A.size&&(he.debug(`abc95 Setting size of children of ${t.id} id=${A.id} ${a} ${s} ${JSON.stringify(A.size)}`),A.size.width=a*(A.widthInColumns??1)+i*((A.widthInColumns??1)-1),A.size.height=s,A.size.x=0,A.size.y=0,he.debug(`abc95 updating size of ${t.id} children child:${A.id} maxWidth:${a} maxHeight:${s}`));for(const A of t.children)XI(A,e,a,s,i);const b=t.columns??-1;let T=0;for(const A of t.children)T+=A.widthInColumns??1;let k=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(A>0){const M=(C-A*i-i)/A;he.debug("abc95 (growing to fit) width",t.id,C,(p=t.size)==null?void 0:p.width,M);for(const L of t.children)L.size&&(L.size.width=M)}}t.size={width:C,height:E,x:0,y:0}}he.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)}w(XI,"setBlockSizes");function tie(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,T;he.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(he.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const k=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*k+(t.children.length-1)*r;he.debug("widthOfChildren 88",S,"posX");const C=new Map;{let P=0;for(const N of t.children){if(!N.size)continue;const{py:_}=qj(n,P),I=C.get(_)??0;N.size.height>I&&C.set(_,N.size.height);let O=(N==null?void 0:N.widthInColumns)??1;n>0&&(O=Math.min(O,n-P%n)),P+=O}}const E=new Map;{let P=0;const N=[...C.keys()].sort((_,I)=>_-I);for(const _ of N)E.set(_,P),P+=(C.get(_)??0)+r}let A=0;he.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 N=t;if(!P.size)continue;const{width:_,height:I}=P.size,{px:O,py:D}=qj(n,A);if(D!=L&&(L=D,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,he.debug("New row in layout for block",t.id," and child ",P.id,L)),he.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${A} (px, py) ${O},${D} (${(y=N==null?void 0:N.size)==null?void 0:y.x},${(v=N==null?void 0:N.size)==null?void 0:v.y}) parent: ${N.id} width: ${_}${r}`),N.size){const F=_/2;P.size.x=M+r+F,he.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${F} padding=${r} width=${_} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${_*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+F;const z=E.get(D)??0,H=C.get(D)??I;P.size.y=N.size.y-N.size.height/2+z+H/2+r,he.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${_*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&tie(P,e,r);let $=(P==null?void 0:P.widthInColumns)??1;n>0&&($=Math.min($,n-A%n)),A+=$,he.debug("abc88 columnsPos",P,A)}}he.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(x=t==null?void 0:t.size)==null?void 0:x.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(T=t==null?void 0:t.size)==null?void 0:T.width}`)}w(tie,"layoutBlocks");function rie(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}=rie(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(rie,"findBounds");function UGe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=We())==null?void 0:u.block)==null?void 0:h.padding)??8;XI(e,t,0,0,r),tie(e,t,r),he.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=rie(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}w(UGe,"layout");var kpr=w(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=We(),o=ti(s);return await Fo(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Vu=kpr,Cpr=w((t,e,r,n,i)=>{e.arrowTypeStart&&xye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&xye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Spr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},xye=w((t,e,r,n,i,a)=>{const s=Spr[r];if(!s){he.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),Gj={},ko={},Epr=w(async(t,e)=>{const r=We(),n=ti(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Fo(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=bt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=bt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Hh(u,n)),Gj[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 Vu(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Hh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].startLeft=d,iC(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Hh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].startRight=d,iC(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Hh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].endLeft=d,iC(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Hh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].endRight=d,iC(h,e.endLabelRight)}return o},"insertEdgeLabel");function iC(t,e){ti(We())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(iC,"setTerminalWidth");var Apr=w((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,Gj[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=We(),{subGraphTitleTotalMargin:i}=M3(n);if(t.label){const a=Gj[t.id];let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=ko[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Rpr=w((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"),_pr=w((t,e,r)=>{he.debug(`intersection calc abc89: + ${KE()} +`,"getStyles"),gpr=ppr,mpr=w((t,e,r,n)=>{e.forEach(i=>{Epr[i](t,r,n)})},"insertMarkers"),ypr=w((t,e,r)=>{he.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"),vpr=w((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"),bpr=w((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"),xpr=w((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"),wpr=w((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"),Tpr=w((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"),kpr=w((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"),Cpr=w((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"),Spr=w((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"),Epr={extension:ypr,composition:vpr,aggregation:bpr,dependency:xpr,lollipop:wpr,point:Tpr,circle:kpr,cross:Cpr,barb:Spr},Apr=mpr;function Uj(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}}w(Uj,"calculateBlockPosition");var Rpr=w(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(he.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 ZI(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;he.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 A of t.children)ZI(A,e,0,0,i);const x=Rpr(t);a=x.width,s=x.height,he.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const A of t.children)A.size&&(he.debug(`abc95 Setting size of children of ${t.id} id=${A.id} ${a} ${s} ${JSON.stringify(A.size)}`),A.size.width=a*(A.widthInColumns??1)+i*((A.widthInColumns??1)-1),A.size.height=s,A.size.x=0,A.size.y=0,he.debug(`abc95 updating size of ${t.id} children child:${A.id} maxWidth:${a} maxHeight:${s}`));for(const A of t.children)ZI(A,e,a,s,i);const b=t.columns??-1;let T=0;for(const A of t.children)T+=A.widthInColumns??1;let k=t.children.length;b>0&&b0?Math.min(t.children.length,b):t.children.length;if(A>0){const M=(C-A*i-i)/A;he.debug("abc95 (growing to fit) width",t.id,C,(p=t.size)==null?void 0:p.width,M);for(const L of t.children)L.size&&(L.size.width=M)}}t.size={width:C,height:E,x:0,y:0}}he.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)}w(ZI,"setBlockSizes");function nie(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,x,b,T;he.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(he.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const k=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*k+(t.children.length-1)*r;he.debug("widthOfChildren 88",S,"posX");const C=new Map;{let P=0;for(const N of t.children){if(!N.size)continue;const{py:_}=Uj(n,P),I=C.get(_)??0;N.size.height>I&&C.set(_,N.size.height);let O=(N==null?void 0:N.widthInColumns)??1;n>0&&(O=Math.min(O,n-P%n)),P+=O}}const E=new Map;{let P=0;const N=[...C.keys()].sort((_,I)=>_-I);for(const _ of N)E.set(_,P),P+=(C.get(_)??0)+r}let A=0;he.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 N=t;if(!P.size)continue;const{width:_,height:I}=P.size,{px:O,py:D}=Uj(n,A);if(D!=L&&(L=D,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,he.debug("New row in layout for block",t.id," and child ",P.id,L)),he.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${A} (px, py) ${O},${D} (${(y=N==null?void 0:N.size)==null?void 0:y.x},${(v=N==null?void 0:N.size)==null?void 0:v.y}) parent: ${N.id} width: ${_}${r}`),N.size){const F=_/2;P.size.x=M+r+F,he.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${F} padding=${r} width=${_} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${_*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+F;const z=E.get(D)??0,H=C.get(D)??I;P.size.y=N.size.y-N.size.height/2+z+H/2+r,he.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${_*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&nie(P,e,r);let $=(P==null?void 0:P.widthInColumns)??1;n>0&&($=Math.min($,n-A%n)),A+=$,he.debug("abc88 columnsPos",P,A)}}he.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(x=t==null?void 0:t.size)==null?void 0:x.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(T=t==null?void 0:t.size)==null?void 0:T.width}`)}w(nie,"layoutBlocks");function iie(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}=iie(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(iie,"findBounds");function XGe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=We())==null?void 0:u.block)==null?void 0:h.padding)??8;ZI(e,t,0,0,r),nie(e,t,r),he.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=iie(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}w(XGe,"layout");var _pr=w(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=We(),o=ti(s);return await Fo(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Vu=_pr,Mpr=w((t,e,r,n,i)=>{e.arrowTypeStart&&wye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&wye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Lpr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},wye=w((t,e,r,n,i,a)=>{const s=Lpr[r];if(!s){he.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),Yj={},ko={},Ipr=w(async(t,e)=>{const r=We(),n=ti(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await Fo(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=bt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=bt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Vh(u,n)),Yj[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 Vu(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Vh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].startLeft=d,iC(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Vh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].startRight=d,iC(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Vh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].endLeft=d,iC(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Vu(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=bt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Vh(g,n)),ko[e.id]||(ko[e.id]={}),ko[e.id].endRight=d,iC(h,e.endLabelRight)}return o},"insertEdgeLabel");function iC(t,e){ti(We())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(iC,"setTerminalWidth");var $pr=w((t,e)=>{he.debug("Moving label abc88 ",t.id,t.label,Yj[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=We(),{subGraphTitleTotalMargin:i}=M3(n);if(t.label){const a=Yj[t.id];let s=t.x,o=t.y;if(r){const l=Vr.calcLabelPosition(r);he.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=ko[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Vr.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=ko[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Vr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),Npr=w((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"),Dpr=w((t,e,r)=>{he.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{he.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Rpr(e,a)&&!i){const s=_pr(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"),Mpr=w(function(t,e,r,n,i,a,s){let o=r.points;he.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&&(he.debug("to cluster abc88",n[r.toCluster]),o=wye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(he.debug("from cluster abc88",n[r.fromCluster]),o=wye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=RS;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=E5e(r),m=AS().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 x="";(We().flowchart.arrowMarkerAbsolute||We().state.arrowMarkerAbsolute)&&(x=y$(!0)),Cpr(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Lpr=w(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"),Ipr=w((t,e,r,n)=>{const i=Lpr(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 YGe(t,e){return t.intersect(e)}w(YGe,"intersectNode");var $pr=YGe;function jGe(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}w(Uj,"sameSign");var Dpr=ZGe,Opr=QGe;function QGe(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,x=Math.sqrt(y*y+v*v),b=m.x-r.x,T=m.y-r.y,k=Math.sqrt(b*b+T*T);return x{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"),Bpr=Ppr,ia={node:$pr,circle:Npr,ellipse:XGe,polygon:Opr,rect:Bpr},Ws=w(async(t,e,r,n)=>{const i=We();let a;const s=e.useHtmlLabels||ti(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=Fo(l,Tn(Wf(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Vu(l,Tn(Wf(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(ti(i)){const p=h.children[0],g=bt(h);await XK(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"),$a=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function dh(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+")")}w(dh,"insertPolygonShape");var Fpr=w(async(t,e)=>{e.useHtmlLabels||ti(We())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Ws(t,e,"node "+e.classes,!0);he.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),$a(e,s),e.intersect=function(o){return ia.rect(e,o)},n},"note"),zpr=Fpr,Tye=w(t=>t?" "+t:"","formatClass"),Pc=w((t,e)=>`${e||"node default"}${Tye(t.classes)} ${Tye(t.class)}`,"getClassesFromNode"),kye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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}];he.info("Question main (Circle)");const l=dh(r,s,s,o);return l.attr("style",e.style),$a(e,l),e.intersect=function(u){return he.warn("Intersect called"),ia.polygon(e,o,u)},r},"question"),Hpr=w((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 ia.circle(e,14,s)},r},"choice"),Vpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,o,a,l);return u.attr("style",e.style),$a(e,u),e.intersect=function(h){return ia.polygon(e,l,h)},r},"hexagon"),Wpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(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=Ipr(e.directions,n,e,u),d=dh(r,u,a,h);return d.attr("style",e.style),$a(e,d),e.intersect=function(f){return ia.polygon(e,h,f)},r},"block_arrow"),qpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 dh(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ia.polygon(e,s,l)},r},"rect_left_inv_arrow"),Gpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"lean_right"),Upr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"lean_left"),Ypr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"trapezoid"),jpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"inv_trapezoid"),Xpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"rect_right_inv_arrow"),Kpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 $a(e,u),e.intersect=function(h){const d=ia.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"),Zpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(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&&($O(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return $a(e,a),e.intersect=function(h){return ia.rect(e,h)},r},"rect"),Qpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(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&&($O(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return $a(e,a),e.intersect=function(h){return ia.rect(e,h)},r},"composite"),Jpr=w(async(t,e)=>{const{shapeSvg:r}=await Ws(t,e,"label",!0);he.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&&($O(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{he.warn(`Unknown node property ${o}`)})}return $a(e,n),e.intersect=function(s){return ia.rect(e,s)},r},"labelRect");function $O(t,e,r,n){const i=[],a=w(o=>{i.push(o,0)},"addBorder"),s=w(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(he.debug("add top border"),a(r)):s(r),e.includes("r")?(he.debug("add right border"),a(n)):s(n),e.includes("b")?(he.debug("add bottom border"),a(r)):s(r),e.includes("l")?(he.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}w($O,"applyNodePropertyBorders");var egr=w(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,he.info("Label text abc79",l,o,typeof o=="object");const u=await Vu(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(ti(We())){const m=u.children[0],y=bt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}he.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Vu(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(ti(We())){const m=p.children[0],y=bt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return bt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),bt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 $a(e,s),e.intersect=function(o){return ia.rect(e,o)},r},"stadium"),rgr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(t,e,Pc(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),he.info("Circle main"),$a(e,a),e.intersect=function(s){return he.info("Circle intersect",e,n.width/2+i,s),ia.circle(e,n.width/2+i,s)},r},"circle"),ngr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(t,e,Pc(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),he.info("DoubleCircle main"),$a(e,o),e.intersect=function(u){return he.info("DoubleCircle intersect",e,n.width/2+i+a,u),ia.circle(e,n.width/2+i+a,u)},r},"doublecircle"),igr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"subroutine"),agr=w((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),$a(e,n),e.intersect=function(i){return ia.circle(e,7,i)},r},"start"),Cye=w((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 $a(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ia.rect(e,o)},n},"forkJoin"),sgr=w((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),$a(e,i),e.intersect=function(a){return ia.circle(e,7,a)},r},"end"),ogr=w(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 Vu(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(ti(We())){const A=y.children[0],M=bt(y);v=A.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(ti(We())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await Vu(f,x,e.labelStyle,!0,!0);bt(b).attr("class","classTitle");let T=b.getBBox();if(ti(We())){const A=b.children[0],M=bt(b);T=A.getBoundingClientRect(),M.attr("width",T.width),M.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const k=[];e.classData.members.forEach(async A=>{const M=A.getDisplayDetails();let L=M.displayText;ti(We())&&(L=L.replace(//g,">"));const P=await Vu(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ti(We())){const _=P.children[0],I=bt(P);N=_.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,k.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async A=>{const M=A.getDisplayDetails();let L=M.displayText;ti(We())&&(L=L.replace(//g,">"));const P=await Vu(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ti(We())){const _=P.children[0],I=bt(P);N=_.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,S.push(P)}),d+=i,g){let A=(h-v.width)/2;bt(y).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=v.height+n}let C=(h-T.width)/2;return bt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=T.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,k.forEach(A=>{bt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=A==null?void 0:A.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(A=>{bt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=A==null?void 0:A.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),$a(e,o),e.intersect=function(A){return ia.rect(e,A)},s},"class_box"),Sye={rhombus:kye,composite:Qpr,question:kye,rect:Zpr,labelRect:Jpr,rectWithTitle:egr,choice:Hpr,circle:rgr,doublecircle:ngr,stadium:tgr,hexagon:Vpr,block_arrow:Wpr,rect_left_inv_arrow:qpr,lean_right:Gpr,lean_left:Upr,trapezoid:Ypr,inv_trapezoid:jpr,rect_right_inv_arrow:Xpr,cylinder:Kpr,start:agr,end:sgr,note:zpr,subroutine:igr,fork:Cye,join:Cye,class_box:ogr},m_={},JGe=w(async(t,e,r)=>{let n,i;if(e.link){let a;We().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 Sye[e.shape](n,e,r)}else i=await Sye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),m_[e.id]=n,e.haveCallback&&m_[e.id].attr("class",m_[e.id].attr("class")+" clickable"),n},"insertNode"),lgr=w(t=>{const e=m_[t.id];he.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 nie(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=YK((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=pr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}w(nie,"getNodeFromBlock");async function eUe(t,e,r){const n=nie(e,r,!1);if(n.type==="group")return;const i=pr(),a=await JGe(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()}w(eUe,"calculateBlockSize");async function tUe(t,e,r){const n=nie(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=pr();await JGe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,lgr(n)}}w(tUe,"insertBlockPositioned");async function NO(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await NO(t,i.children,r,n)}w(NO,"performOperations");async function rUe(t,e,r){await NO(t,e,r,eUe)}w(rUe,"calculateBlockSizes");async function nUe(t,e,r){await NO(t,e,r,tUe)}w(nUe,"insertBlocks");async function iUe(t,e,r,n,i){const a=new $o({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`;Mpr(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 Epr(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),Apr({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(iUe,"insertEdges");var cgr=w(function(t,e){return e.db.getClasses()},"getClasses"),ugr=w(async function(t,e,r,n){const{securityLevel:i,block:a}=pr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=bt("#i"+e));const l=bt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):bt(`[id="${e}"]`);wpr(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 rUe(g,d,s);const m=UGe(s);if(await nUe(g,d,s),await iUe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:T}=a;_a(u,x,b,!!T),he.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),hgr={draw:ugr,getClasses:cgr},dgr={parser:H0r,db:opr,renderer:hgr,styles:cpr};const fgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:dgr},Symbol.toStringTag,{value:"Module"}));var aUe=/[─━│┃└┗├┣]/,sUe=/[└┗├┣]/,pgr=/[─━]/,Eye=/^[\s│┃]+$/,Aye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Rye=/^\s*%%/,ggr=" ";function oUe(t){return t.some(e=>aUe.test(e))}w(oUe,"isBoxDrawingFormat");function lUe(t){for(const e of t){const r=sUe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(lUe,"inferSegmentWidth");function cUe(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})}w(cUe,"remapErrorLines");function uUe(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:[]}]})),mgr=w(()=>{Ph.reset(),wi()},"clear"),ygr=w(()=>Ph.records.stack[0],"getRoot"),vgr=w(()=>Ph.records.cnt,"getCount"),bgr=xn.treeView,xgr=w(()=>Gi(bgr,pr().treeView),"getConfig"),wgr=w((t,e,r,n,i,a)=>{for(;t<=Ph.records.stack[Ph.records.stack.length-1].level;)Ph.records.stack.pop();const s={id:Ph.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Ph.records.stack[Ph.records.stack.length-1].children.push(s),Ph.records.stack.push(s)},"addNode"),Tgr={clear:mgr,addNode:wgr,getRoot:ygr,getCount:vgr,getConfig:xgr,getAccTitle:Yi,getAccDescription:Xi,getDiagramTitle:Di,setAccDescription:ji,setAccTitle:$i,setDiagramTitle:qi},Yj=Tgr,kgr=w(t=>{Al(t,Yj);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?Tn(u,pr()):void 0;Yj.addNode(r,n,a,s,l,h)}},"populate"),Cgr={parse:w(async t=>{const{text:e,lineMap:r}=uUe(t);try{const n=await xu("treeView",e);he.debug(n),kgr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=cUe(n.message,r)),n}},"parse")},X6={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function hUe(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)])}}w(hUe,"detectIcon");function jj(t,e){return t.includes(":")?t:t in X6.icons||!e?`${X6.prefix}:${t}`:`${e}:${t}`}w(jj,"qualifyIcon");function iie(t,e){if(t.icon!=="none"){if(t.icon)return jj(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=hUe(t.name,e);if(r==="none")return;if(r)return jj(r,e.defaultIconPack)}return`${X6.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(iie,"getNodeIcon");KK([{name:X6.prefix,icons:X6}]);var Xj=14,Sgr=4,Egr=16,dUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),Agr=w(async(t,e,r,n)=>{const i=new Set,a=w(l=>{const u=iie(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 qf(l,{height:Xj,width:Xj})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",dUe(n,l)).html(u)},"injectIconDefs"),Rgr=w((t,e,r,n,i,a)=>{var x;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=Xj+Sgr,u=iie(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${dUe(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},(x=r.cssClass)!=null&&x.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"),_ye=w((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"),_gr=w((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=w((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=Rgr(m,i,f,d,p,n);s.push(y);const{height:v,width:x}=f.BBox;_ye(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+x),i+=v},"drawNode"),l=w((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;_ye(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))+Egr;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"),Mgr=w(async(t,e,r,n)=>{he.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=Po(e);await Agr(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=_gr(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),_a(o,u,h,s.useMaxWidth)},"draw"),Lgr={draw:Mgr},Igr=Lgr,$gr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ngr=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=Gi($gr,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{he.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!Npr(e,a)&&!i){const s=Dpr(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"),Opr=w(function(t,e,r,n,i,a,s){let o=r.points;he.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&&(he.debug("to cluster abc88",n[r.toCluster]),o=Tye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(he.debug("from cluster abc88",n[r.fromCluster]),o=Tye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=RS;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=A5e(r),m=AS().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 x="";(We().flowchart.arrowMarkerAbsolute||We().state.arrowMarkerAbsolute)&&(x=b$(!0)),Mpr(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),Ppr=w(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"),Bpr=w((t,e,r,n)=>{const i=Ppr(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 KGe(t,e){return t.intersect(e)}w(KGe,"intersectNode");var Fpr=KGe;function ZGe(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}w(jj,"sameSign");var Hpr=eUe,Vpr=tUe;function tUe(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,x=Math.sqrt(y*y+v*v),b=m.x-r.x,T=m.y-r.y,k=Math.sqrt(b*b+T*T);return x{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"),qpr=Wpr,ia={node:Fpr,circle:zpr,ellipse:QGe,polygon:Vpr,rect:qpr},Ws=w(async(t,e,r,n)=>{const i=We();let a;const s=e.useHtmlLabels||ti(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=Fo(l,Tn(Wf(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Vu(l,Tn(Wf(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(ti(i)){const p=h.children[0],g=bt(h);await ZK(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"),$a=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function dh(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+")")}w(dh,"insertPolygonShape");var Gpr=w(async(t,e)=>{e.useHtmlLabels||ti(We())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Ws(t,e,"node "+e.classes,!0);he.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),$a(e,s),e.intersect=function(o){return ia.rect(e,o)},n},"note"),Upr=Gpr,kye=w(t=>t?" "+t:"","formatClass"),Pc=w((t,e)=>`${e||"node default"}${kye(t.classes)} ${kye(t.class)}`,"getClassesFromNode"),Cye=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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}];he.info("Question main (Circle)");const l=dh(r,s,s,o);return l.attr("style",e.style),$a(e,l),e.intersect=function(u){return he.warn("Intersect called"),ia.polygon(e,o,u)},r},"question"),Ypr=w((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 ia.circle(e,14,s)},r},"choice"),jpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,o,a,l);return u.attr("style",e.style),$a(e,u),e.intersect=function(h){return ia.polygon(e,l,h)},r},"hexagon"),Xpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(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=Bpr(e.directions,n,e,u),d=dh(r,u,a,h);return d.attr("style",e.style),$a(e,d),e.intersect=function(f){return ia.polygon(e,h,f)},r},"block_arrow"),Kpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 dh(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ia.polygon(e,s,l)},r},"rect_left_inv_arrow"),Zpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"lean_right"),Qpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"lean_left"),Jpr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"trapezoid"),egr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"inv_trapezoid"),tgr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"rect_right_inv_arrow"),rgr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 $a(e,u),e.intersect=function(h){const d=ia.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"),ngr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(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&&(DO(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return $a(e,a),e.intersect=function(h){return ia.rect(e,h)},r},"rect"),igr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(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&&(DO(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{he.warn(`Unknown node property ${d}`)})}return $a(e,a),e.intersect=function(h){return ia.rect(e,h)},r},"composite"),agr=w(async(t,e)=>{const{shapeSvg:r}=await Ws(t,e,"label",!0);he.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&&(DO(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{he.warn(`Unknown node property ${o}`)})}return $a(e,n),e.intersect=function(s){return ia.rect(e,s)},r},"labelRect");function DO(t,e,r,n){const i=[],a=w(o=>{i.push(o,0)},"addBorder"),s=w(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(he.debug("add top border"),a(r)):s(r),e.includes("r")?(he.debug("add right border"),a(n)):s(n),e.includes("b")?(he.debug("add bottom border"),a(r)):s(r),e.includes("l")?(he.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}w(DO,"applyNodePropertyBorders");var sgr=w(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,he.info("Label text abc79",l,o,typeof o=="object");const u=await Vu(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(ti(We())){const m=u.children[0],y=bt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}he.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Vu(s,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(ti(We())){const m=p.children[0],y=bt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return bt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),bt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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 $a(e,s),e.intersect=function(o){return ia.rect(e,o)},r},"stadium"),lgr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(t,e,Pc(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),he.info("Circle main"),$a(e,a),e.intersect=function(s){return he.info("Circle intersect",e,n.width/2+i,s),ia.circle(e,n.width/2+i,s)},r},"circle"),cgr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Ws(t,e,Pc(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),he.info("DoubleCircle main"),$a(e,o),e.intersect=function(u){return he.info("DoubleCircle intersect",e,n.width/2+i+a,u),ia.circle(e,n.width/2+i+a,u)},r},"doublecircle"),ugr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Ws(t,e,Pc(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=dh(r,i,a,s);return o.attr("style",e.style),$a(e,o),e.intersect=function(l){return ia.polygon(e,s,l)},r},"subroutine"),hgr=w((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),$a(e,n),e.intersect=function(i){return ia.circle(e,7,i)},r},"start"),Sye=w((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 $a(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ia.rect(e,o)},n},"forkJoin"),dgr=w((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),$a(e,i),e.intersect=function(a){return ia.circle(e,7,a)},r},"end"),fgr=w(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 Vu(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(ti(We())){const A=y.children[0],M=bt(y);v=A.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let x=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(ti(We())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await Vu(f,x,e.labelStyle,!0,!0);bt(b).attr("class","classTitle");let T=b.getBBox();if(ti(We())){const A=b.children[0],M=bt(b);T=A.getBoundingClientRect(),M.attr("width",T.width),M.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const k=[];e.classData.members.forEach(async A=>{const M=A.getDisplayDetails();let L=M.displayText;ti(We())&&(L=L.replace(//g,">"));const P=await Vu(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ti(We())){const _=P.children[0],I=bt(P);N=_.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,k.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async A=>{const M=A.getDisplayDetails();let L=M.displayText;ti(We())&&(L=L.replace(//g,">"));const P=await Vu(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(ti(We())){const _=P.children[0],I=bt(P);N=_.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,S.push(P)}),d+=i,g){let A=(h-v.width)/2;bt(y).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=v.height+n}let C=(h-T.width)/2;return bt(b).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=T.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,k.forEach(A=>{bt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=A==null?void 0:A.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(A=>{bt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=A==null?void 0:A.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),$a(e,o),e.intersect=function(A){return ia.rect(e,A)},s},"class_box"),Eye={rhombus:Cye,composite:igr,question:Cye,rect:ngr,labelRect:agr,rectWithTitle:sgr,choice:Ypr,circle:lgr,doublecircle:cgr,stadium:ogr,hexagon:jpr,block_arrow:Xpr,rect_left_inv_arrow:Kpr,lean_right:Zpr,lean_left:Qpr,trapezoid:Jpr,inv_trapezoid:egr,rect_right_inv_arrow:tgr,cylinder:rgr,start:hgr,end:dgr,note:Upr,subroutine:ugr,fork:Sye,join:Sye,class_box:fgr},y_={},rUe=w(async(t,e,r)=>{let n,i;if(e.link){let a;We().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 Eye[e.shape](n,e,r)}else i=await Eye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),y_[e.id]=n,e.haveCallback&&y_[e.id].attr("class",y_[e.id].attr("class")+" clickable"),n},"insertNode"),pgr=w(t=>{const e=y_[t.id];he.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 aie(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=XK((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=pr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}w(aie,"getNodeFromBlock");async function nUe(t,e,r){const n=aie(e,r,!1);if(n.type==="group")return;const i=pr(),a=await rUe(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()}w(nUe,"calculateBlockSize");async function iUe(t,e,r){const n=aie(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=pr();await rUe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,pgr(n)}}w(iUe,"insertBlockPositioned");async function OO(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await OO(t,i.children,r,n)}w(OO,"performOperations");async function aUe(t,e,r){await OO(t,e,r,nUe)}w(aUe,"calculateBlockSizes");async function sUe(t,e,r){await OO(t,e,r,iUe)}w(sUe,"insertBlocks");async function oUe(t,e,r,n,i){const a=new $o({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`;Opr(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 Ipr(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),$pr({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(oUe,"insertEdges");var ggr=w(function(t,e){return e.db.getClasses()},"getClasses"),mgr=w(async function(t,e,r,n){const{securityLevel:i,block:a}=pr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=bt("#i"+e));const l=bt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):bt(`[id="${e}"]`);Apr(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 aUe(g,d,s);const m=XGe(s);if(await sUe(g,d,s),await oUe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),x=y.height+v+10,b=y.width+10,{useMaxWidth:T}=a;_a(u,x,b,!!T),he.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),ygr={draw:mgr,getClasses:ggr},vgr={parser:Y0r,db:fpr,renderer:ygr,styles:gpr};const bgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:vgr},Symbol.toStringTag,{value:"Module"}));var lUe=/[─━│┃└┗├┣]/,cUe=/[└┗├┣]/,xgr=/[─━]/,Aye=/^[\s│┃]+$/,Rye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,_ye=/^\s*%%/,wgr=" ";function uUe(t){return t.some(e=>lUe.test(e))}w(uUe,"isBoxDrawingFormat");function hUe(t){for(const e of t){const r=cUe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(hUe,"inferSegmentWidth");function dUe(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})}w(dUe,"remapErrorLines");function fUe(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:[]}]})),Tgr=w(()=>{Bh.reset(),wi()},"clear"),kgr=w(()=>Bh.records.stack[0],"getRoot"),Cgr=w(()=>Bh.records.cnt,"getCount"),Sgr=xn.treeView,Egr=w(()=>Gi(Sgr,pr().treeView),"getConfig"),Agr=w((t,e,r,n,i,a)=>{for(;t<=Bh.records.stack[Bh.records.stack.length-1].level;)Bh.records.stack.pop();const s={id:Bh.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Bh.records.stack[Bh.records.stack.length-1].children.push(s),Bh.records.stack.push(s)},"addNode"),Rgr={clear:Tgr,addNode:Agr,getRoot:kgr,getCount:Cgr,getConfig:Egr,getAccTitle:Yi,getAccDescription:Xi,getDiagramTitle:Di,setAccDescription:ji,setAccTitle:$i,setDiagramTitle:qi},Xj=Rgr,_gr=w(t=>{Al(t,Xj);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?Tn(u,pr()):void 0;Xj.addNode(r,n,a,s,l,h)}},"populate"),Mgr={parse:w(async t=>{const{text:e,lineMap:r}=fUe(t);try{const n=await xu("treeView",e);he.debug(n),_gr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=dUe(n.message,r)),n}},"parse")},K6={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function pUe(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)])}}w(pUe,"detectIcon");function Kj(t,e){return t.includes(":")?t:t in K6.icons||!e?`${K6.prefix}:${t}`:`${e}:${t}`}w(Kj,"qualifyIcon");function sie(t,e){if(t.icon!=="none"){if(t.icon)return Kj(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=pUe(t.name,e);if(r==="none")return;if(r)return Kj(r,e.defaultIconPack)}return`${K6.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(sie,"getNodeIcon");QK([{name:K6.prefix,icons:K6}]);var Zj=14,Lgr=4,Igr=16,gUe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),$gr=w(async(t,e,r,n)=>{const i=new Set,a=w(l=>{const u=sie(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 qf(l,{height:Zj,width:Zj})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",gUe(n,l)).html(u)},"injectIconDefs"),Ngr=w((t,e,r,n,i,a)=>{var x;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=Zj+Lgr,u=sie(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${gUe(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},(x=r.cssClass)!=null&&x.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"),Mye=w((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"),Dgr=w((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=w((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=Ngr(m,i,f,d,p,n);s.push(y);const{height:v,width:x}=f.BBox;Mye(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+x),i+=v},"drawNode"),l=w((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;Mye(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))+Igr;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"),Ogr=w(async(t,e,r,n)=>{he.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=Po(e);await $gr(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=Dgr(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),_a(o,u,h,s.useMaxWidth)},"draw"),Pgr={draw:Ogr},Bgr=Pgr,Fgr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},zgr=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=Gi(Fgr,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -4517,7 +4530,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":me="Parse error stroke: ${o}; stroke-width: 1; } - `},"styles"),Dgr=Ngr,Ogr={db:Yj,renderer:Igr,parser:Cgr,styles:Dgr};const Pgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ogr},Symbol.toStringTag,{value:"Module"}));var y_={exports:{}},v_={exports:{}},b_={exports:{}},Bgr=b_.exports,Mye;function Fgr(){return Mye||(Mye=1,(function(t,e){(function(n,i){t.exports=i()})(Bgr,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,x){a.call(this,x),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,x){if(v==null&&x==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 T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},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 x=v.edges.slice(),b,T=x.length,k=0;k-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,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,x,b,T,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?T=k[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,T=-s.MAX_VALUE,k,S,C,E,A,M=this.nodes,L=M.length,P=0;Pk&&(v=k),xC&&(b=C),Tk&&(v=k),xC&&(b=C),T=this.nodes.length){var L=0;x.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]=x,_=!0):(u[0]=y,u[1]=m,_=!0):O===$&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=b,u[1]=x,_=!0)),-D===$?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=C,I=!0):D===$&&(f>h?(u[2]=S,u[3]=C,I=!0):(u[2]=L,u[3]=M,I=!0)),_&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection(O,$,4),z=this.getCardinalDirection(D,$,2)):(F=this.getCardinalDirection(-O,$,3),z=this.getCardinalDirection(-D,$,1)):d>p?(F=this.getCardinalDirection(-O,$,1),z=this.getCardinalDirection(-D,$,3)):(F=this.getCardinalDirection(O,$,2),z=this.getCardinalDirection(D,$,4)),!_)switch(F){case 1:B=m,H=h+-k/$,u[0]=H,u[1]=B;break;case 2:H=b,B=d+T*$,u[0]=H,u[1]=B;break;case 3:B=x,H=h+k/$,u[0]=H,u[1]=B;break;case 4:H=v,B=d+-T*$,u[0]=H,u[1]=B;break}if(!I)switch(z){case 1:q=C,V=f+-N/$,u[2]=V,u[3]=q;break;case 2:V=L,q=p+P*$,u[2]=V,u[3]=q;break;case 3:q=M,V=f+N/$,u[2]=V,u[3]=q;break;case 4:V=A,q=p+-P*$,u[2]=V,u[3]=q;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,x=h.y,b=void 0,T=void 0,k=void 0,S=void 0,C=void 0,E=void 0,A=void 0,M=void 0,L=void 0;return k=g-f,C=d-p,A=p*f-d*g,S=x-y,E=m-v,M=v*y-m*x,L=k*E-S*C,L===0?null:(b=(C*M-E*A)/L,T=(S*A-k*M)/L,new a(b,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),T=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:T}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(k.push(C[0]);k.length>0&&y;){var E=k[0];k.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&C.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(_){if(v.indexOf(_)<0){var I=x.get(_),O=I-1;O==1&&E.push(_),x.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},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,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mk||T>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||T>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*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||k>=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(At){for(var mt=[];At-- >0;)mt.push(0);return mt})(Math.min(this.m+1,this.n)),this.U=(function(At){var mt=function ye(Nt){if(Nt.length==0)return 0;for(var yt=[],gt=0;gt0;)mt.push(0);return mt})(this.n),u=(function(At){for(var mt=[];At-- >0;)mt.push(0);return mt})(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;D--)if(this.s[D]!==0){for(var $=D+1;$=0;G--){if((function(At,mt){return At&&mt})(G0;){var te=void 0,$e=void 0;for(te=_-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ee*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===_-2)$e=4;else{var Oe=void 0;for(Oe=_-1;Oe>=te&&Oe!==te;Oe--){var He=(Oe!==_?Math.abs(l[Oe]):0)+(Oe!==te+1?Math.abs(l[Oe-1]):0);if(Math.abs(this.s[Oe])<=me+ee*He){this.s[Oe]=0;break}}Oe===te?$e=3:Oe===_-1?$e=1:($e=2,te=Oe)}switch(te++,$e){case 1:{var ue=l[_-2];l[_-2]=0;for(var ce=_-2;ce>=te;ce--){var Te=a.hypot(this.s[ce],ue),ge=this.s[ce]/Te,Ve=ue/Te;this.s[ce]=Te,ce!==te&&(ue=-Ve*l[ce-1],l[ce-1]=ge*l[ce-1]);for(var we=0;we=this.s[te+1]);){var Ct=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=Ct,teMath.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,x=u(551).LayoutConstants,b=u(551).Point,T=u(551).PointD,k=u(551).DimensionD,S=u(551).Layout,C=u(551).Integer,E=u(551).IGeometry,A=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 N in h)P[N]=h[N];P.prototype.newGraphManager=function(){var _=new d(this);return this.graphManager=_,_},P.prototype.newGraph=function(_){return new f(null,this.graphManager,_)},P.prototype.newNode=function(_){return new p(this.graphManager,_)},P.prototype.newEdge=function(_){return new g(null,null,_)},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 _=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return _&&(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()),O=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation(O)}}else{var _=this.getFlatForest();if(_.length>0)this.positionNodesRadially(_);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(D){return I.has(D)});this.graphManager.setAllNodesToApplyGravitation(O),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 _=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function($){return _.has($)});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 O=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(O,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var _=this.graphManager.getAllNodes(),I={},O=0;O<_.length;O++){var D=_[O].rect,$=_[O].id;I[$]={id:$,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return I},P.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var _=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!_;)_=this.tick();this.graphManager.updateBounds()}},P.prototype.moveNodes=function(){for(var _=this.getAllNodes(),I,O=0;O<_.length;O++)I=_[O],I.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var O=0;O<_.length;O++)I=_[O],I.move()},P.prototype.initConstraintVariables=function(){var _=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var I=this.graphManager.getAllNodes(),O=0;O0&&(D.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,H=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Z){_.fixedNodesOnHorizontal.add(Z),_.fixedNodesOnVertical.add(Z)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,O=0;O=2*Z.length/3;ee--)J=Math.floor(Math.random()*(ee+1)),re=Z[ee],Z[ee]=Z[J],Z[J]=re;return Z},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(Z){if(Z.left){var J=z.has(Z.left)?z.get(Z.left):Z.left,re=z.has(Z.right)?z.get(Z.right):Z.right;_.nodesInRelativeHorizontal.includes(J)||(_.nodesInRelativeHorizontal.push(J),_.nodeToRelativeConstraintMapHorizontal.set(J,[]),_.dummyToNodeForVerticalAlignment.has(J)?_.nodeToTempPositionMapHorizontal.set(J,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(J,_.idToNodeMap.get(J).getCenterX())),_.nodesInRelativeHorizontal.includes(re)||(_.nodesInRelativeHorizontal.push(re),_.nodeToRelativeConstraintMapHorizontal.set(re,[]),_.dummyToNodeForVerticalAlignment.has(re)?_.nodeToTempPositionMapHorizontal.set(re,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(re)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(re,_.idToNodeMap.get(re).getCenterX())),_.nodeToRelativeConstraintMapHorizontal.get(J).push({right:re,gap:Z.gap}),_.nodeToRelativeConstraintMapHorizontal.get(re).push({left:J,gap:Z.gap})}else{var ee=H.has(Z.top)?H.get(Z.top):Z.top,me=H.has(Z.bottom)?H.get(Z.bottom):Z.bottom;_.nodesInRelativeVertical.includes(ee)||(_.nodesInRelativeVertical.push(ee),_.nodeToRelativeConstraintMapVertical.set(ee,[]),_.dummyToNodeForHorizontalAlignment.has(ee)?_.nodeToTempPositionMapVertical.set(ee,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(ee,_.idToNodeMap.get(ee).getCenterY())),_.nodesInRelativeVertical.includes(me)||(_.nodesInRelativeVertical.push(me),_.nodeToRelativeConstraintMapVertical.set(me,[]),_.dummyToNodeForHorizontalAlignment.has(me)?_.nodeToTempPositionMapVertical.set(me,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(me,_.idToNodeMap.get(me).getCenterY())),_.nodeToRelativeConstraintMapVertical.get(ee).push({bottom:me,gap:Z.gap}),_.nodeToRelativeConstraintMapVertical.get(me).push({top:ee,gap:Z.gap})}});else{var q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(Z){if(Z.left){var J=z.has(Z.left)?z.get(Z.left):Z.left,re=z.has(Z.right)?z.get(Z.right):Z.right;q.has(J)?q.get(J).push(re):q.set(J,[re]),q.has(re)?q.get(re).push(J):q.set(re,[J])}else{var ee=H.has(Z.top)?H.get(Z.top):Z.top,me=H.has(Z.bottom)?H.get(Z.bottom):Z.bottom;G.has(ee)?G.get(ee).push(me):G.set(ee,[me]),G.has(me)?G.get(me).push(ee):G.set(me,[ee])}});var Q=function(J,re){var ee=[],me=[],te=new L,$e=new Set,Oe=0;return J.forEach(function(He,ue){if(!$e.has(ue)){ee[Oe]=[],me[Oe]=!1;var ce=ue;for(te.push(ce),$e.add(ce),ee[Oe].push(ce);te.length!=0;){ce=te.shift(),re.has(ce)&&(me[Oe]=!0);var Te=J.get(ce);Te.forEach(function(ge){$e.has(ge)||(te.push(ge),$e.add(ge),ee[Oe].push(ge))})}Oe++}}),{components:ee,isFixed:me}},j=Q(q,_.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var ae=Q(G,_.fixedNodesOnVertical);this.componentsOnVertical=ae.components,this.fixedComponentsOnVertical=ae.isFixed}}},P.prototype.updateDisplacements=function(){var _=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ae){var Z=_.idToNodeMap.get(ae.nodeId);Z.displacementX=0,Z.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,O=0;O1){var H;for(H=0;HD&&(D=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(x.WORLD_CENTER_X-z.x/2,x.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(_,I,O){var D=Math.max(this.maxDiagonalInTree(_),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,D);var $=A.calculateBounds(_),F=new M;F.setDeviceOrgX($.getMinX()),F.setDeviceOrgY($.getMinY()),F.setWorldOrgX(O.x),F.setWorldOrgY(O.y);for(var z=0;z<_.length;z++){var H=_[z];H.transform(F)}var B=new T($.getMaxX(),$.getMaxY());return F.inverseTransformPoint(B)},P.branchRadialLayout=function(_,I,O,D,$,F){var z=(D-O+1)/2;z<0&&(z+=180);var H=(z+O)%360,B=H*E.TWO_PI/360,V=$*Math.cos(B),q=$*Math.sin(B);_.setCenter(V,q);var G=[];G=G.concat(_.getEdges());var Q=G.length;I!=null&&Q--;for(var j=0,ae=G.length,Z,J=_.getEdgesBetween(I);J.length>1;){var re=J[0];J.splice(0,1);var ee=G.indexOf(re);ee>=0&&G.splice(ee,1),ae--,Q--}I!=null?Z=(G.indexOf(J[0])+1)%ae:Z=0;for(var me=Math.abs(D-O)/Q,te=Z;j!=Q;te=++te%ae){var $e=G[te].getOtherEnd(_);if($e!=I){var Oe=(O+j*me)%360,He=(Oe+me)%360;P.branchRadialLayout($e,_,Oe,He,$+F,F),j++}}},P.maxDiagonalInTree=function(_){for(var I=C.MIN_VALUE,O=0;O<_.length;O++){var D=_[O],$=D.getDiagonal();$>I&&(I=$)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var _=this,I={};this.memberGroups={},this.idToDummyNode={};for(var O=[],D=this.graphManager.getAllNodes(),$=0;$"u"&&(I[H]=[]),I[H]=I[H].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var V="DummyCompound_"+B;_.memberGroups[V]=I[B];var q=I[B][0].getParent(),G=new p(_.graphManager);G.id=V,G.paddingLeft=q.paddingLeft||0,G.paddingRight=q.paddingRight||0,G.paddingBottom=q.paddingBottom||0,G.paddingTop=q.paddingTop||0,_.idToDummyNode[V]=G;var Q=_.getGraphManager().add(_.newGraph(),G),j=q.getChild();j.add(G);for(var ae=0;ae$?(D.rect.x-=(D.labelWidth-$)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-$)/2):D.labelPosHorizontal=="right"&&D.setWidth($+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(F+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>F?(D.rect.y-=(D.labelHeight-F)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-F)/2):D.labelPosVertical=="bottom"&&D.setHeight(F+D.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var _=this.compoundOrder.length-1;_>=0;_--){var I=this.compoundOrder[_],O=I.id,D=I.paddingLeft,$=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[O],I.rect.x,I.rect.y,D,$,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var _=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(O){var D=_.idToDummyNode[O],$=D.paddingLeft,F=D.paddingTop,z=D.labelMarginLeft,H=D.labelMarginTop;_.adjustLocations(I[O],D.rect.x,D.rect.y,$,F,z,H)})},P.prototype.getToBeTiled=function(_){var I=_.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var O=_.getChild();if(O==null)return this.toBeTiled[I]=!1,!1;for(var D=O.getNodes(),$=0;$0)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(_){_.id;for(var I=_.getEdges(),O=0,D=0;Dq&&(q=Q.rect.height)}O+=q+_.verticalPadding}},P.prototype.tileCompoundMembers=function(_,I){var O=this;this.tiledMemberPack=[],Object.keys(_).forEach(function(D){var $=I[D];if(O.tiledMemberPack[D]=O.tileNodes(_[D],$.paddingLeft+$.paddingRight),$.rect.width=O.tiledMemberPack[D].width,$.rect.height=O.tiledMemberPack[D].height,$.setCenter(O.tiledMemberPack[D].centerX,O.tiledMemberPack[D].centerY),$.labelMarginLeft=0,$.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=$.rect.width,z=$.rect.height;$.labelWidth&&($.labelPosHorizontal=="left"?($.rect.x-=$.labelWidth,$.setWidth(F+$.labelWidth),$.labelMarginLeft=$.labelWidth):$.labelPosHorizontal=="center"&&$.labelWidth>F?($.rect.x-=($.labelWidth-F)/2,$.setWidth($.labelWidth),$.labelMarginLeft=($.labelWidth-F)/2):$.labelPosHorizontal=="right"&&$.setWidth(F+$.labelWidth)),$.labelHeight&&($.labelPosVertical=="top"?($.rect.y-=$.labelHeight,$.setHeight(z+$.labelHeight),$.labelMarginTop=$.labelHeight):$.labelPosVertical=="center"&&$.labelHeight>z?($.rect.y-=($.labelHeight-z)/2,$.setHeight($.labelHeight),$.labelMarginTop=($.labelHeight-z)/2):$.labelPosVertical=="bottom"&&$.setHeight(z+$.labelHeight))}})},P.prototype.tileNodes=function(_,I){var O=this.tileNodesByFavoringDim(_,I,!0),D=this.tileNodesByFavoringDim(_,I,!1),$=this.getOrgRatio(O),F=this.getOrgRatio(D),z;return F<$?z=D:z=O,z},P.prototype.getOrgRatio=function(_){var I=_.width,O=_.height,D=I/O;return D<1&&(D=1/D),D},P.prototype.calcIdealRowWidth=function(_,I){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,$=_.length,F=0,z=0,H=0;_.forEach(function(ae){F+=ae.getWidth(),z+=ae.getHeight(),ae.getWidth()>H&&(H=ae.getWidth())});var B=F/$,V=z/$,q=Math.pow(O-D,2)+4*(B+D)*(V+O)*$,G=(D-O+Math.sqrt(q))/(2*(B+D)),Q;I?(Q=Math.ceil(G),Q==G&&Q++):Q=Math.floor(G);var j=Q*(B+D)-D;return H>j&&(j=H),j+=D*2,j},P.prototype.tileNodesByFavoringDim=function(_,I,O){var D=m.TILING_PADDING_VERTICAL,$=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:D,horizontalPadding:$,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(_,O));var H=function(Z){return Z.rect.width*Z.rect.height},B=function(Z,J){return H(J)-H(Z)};_.sort(function(ae,Z){var J=B;return z.idealRowWidth?(J=F,J(ae.id,Z.id)):J(ae,Z)});for(var V=0,q=0,G=0;G<_.length;G++){var Q=_[G];V+=Q.getCenterX(),q+=Q.getCenterY()}z.centerX=V/_.length,z.centerY=q/_.length;for(var G=0;G<_.length;G++){var Q=_[G];if(z.rows.length==0)this.insertNodeToRow(z,Q,0,I);else if(this.canAddHorizontal(z,Q.rect.width,Q.rect.height)){var j=z.rows.length-1;z.idealRowWidth||(j=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Q,j,I)}else this.insertNodeToRow(z,Q,z.rows.length,I);this.shiftToLastRow(z)}return z},P.prototype.insertNodeToRow=function(_,I,O,D){var $=D;if(O==_.rows.length){var F=[];_.rows.push(F),_.rowWidth.push($),_.rowHeight.push(0)}var z=_.rowWidth[O]+I.rect.width;_.rows[O].length>0&&(z+=_.horizontalPadding),_.rowWidth[O]=z,_.width0&&(H+=_.verticalPadding);var B=0;H>_.rowHeight[O]&&(B=_.rowHeight[O],_.rowHeight[O]=H,B=_.rowHeight[O]-B),_.height+=B,_.rows[O].push(I)},P.prototype.getShortestRowIndex=function(_){for(var I=-1,O=Number.MAX_VALUE,D=0;D<_.rows.length;D++)_.rowWidth[D]O&&(I=D,O=_.rowWidth[D]);return I},P.prototype.canAddHorizontal=function(_,I,O){if(_.idealRowWidth){var D=_.rows.length-1,$=_.rowWidth[D];return $+I+_.horizontalPadding<=_.idealRowWidth}var F=this.getShortestRowIndex(_);if(F<0)return!0;var z=_.rowWidth[F];if(z+_.horizontalPadding+I<=_.width)return!0;var H=0;_.rowHeight[F]0&&(H=O+_.verticalPadding-_.rowHeight[F]);var B;_.width-z>=I+_.horizontalPadding?B=(_.height+H)/(z+I+_.horizontalPadding):B=(_.height+H)/_.width,H=O+_.verticalPadding;var V;return _.widthF&&I!=O){D.splice(-1,1),_.rows[O].push($),_.rowWidth[I]=_.rowWidth[I]-F,_.rowWidth[O]=_.rowWidth[O]+F,_.width=_.rowWidth[instance.getLongestRowIndex(_)];for(var z=Number.MIN_VALUE,H=0;Hz&&(z=D[H].height);I>0&&(z+=_.verticalPadding);var B=_.rowHeight[I]+_.rowHeight[O];_.rowHeight[I]=z,_.rowHeight[O]<$.height+_.verticalPadding&&(_.rowHeight[O]=$.height+_.verticalPadding);var V=_.rowHeight[I]+_.rowHeight[O];_.height+=V-B,this.shiftToLastRow(_)}},P.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},P.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},P.prototype.reduceTrees=function(){for(var _=[],I=!0,O;I;){var D=this.graphManager.getAllNodes(),$=[];I=!1;for(var F=0;F0)for(var j=$;j<=F;j++)Q[0]+=this.grid[j][z-1].length+this.grid[j][z].length-1;if(F0)for(var j=z;j<=H;j++)Q[3]+=this.grid[$-1][j].length+this.grid[$][j].length-1;for(var ae=C.MAX_VALUE,Z,J,re=0;re{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,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var Ct=0;Me.forEach(function(ht){de=="horizontal"?(ze.set(ht,b.has(ht)?T[b.get(ht)]:Fe.get(ht)),Ct+=ze.get(ht)):(ze.set(ht,b.has(ht)?k[b.get(ht)]:Fe.get(ht)),Ct+=ze.get(ht))}),Ct=Ct/Me.length,pt.forEach(function(ht){X.has(ht)||ze.set(ht,Ct)})}else{var wt=0;pt.forEach(function(ht){de=="horizontal"?wt+=b.has(ht)?T[b.get(ht)]:Fe.get(ht):wt+=b.has(ht)?k[b.get(ht)]:Fe.get(ht)}),wt=wt/pt.length,pt.forEach(function(ht){ze.set(ht,wt)})}});for(var Be=function(){var Me=Ke.shift(),Ct=K.get(Me);Ct.forEach(function(wt){if(ze.get(wt.id)ht&&(ht=St),tnBt&&(Bt=tn)}}catch(qr){mt=!0,ye=qr}finally{try{!At&&Nt.return&&Nt.return()}finally{if(mt)throw ye}}var _e=(Ct+ht)/2-(wt+Bt)/2,Je=!0,ut=!1,Dt=void 0;try{for(var Kt=pt[Symbol.iterator](),Sr;!(Je=(Sr=Kt.next()).done);Je=!0){var yr=Sr.value;ze.set(yr,ze.get(yr)+_e)}}catch(qr){ut=!0,Dt=qr}finally{try{!Je&&Kt.return&&Kt.return()}finally{if(ut)throw Dt}}})}return ze},N=function(K){var de=0,X=0,Fe=0,ke=0;if(K.forEach(function(De){De.left?T[b.get(De.left)]-T[b.get(De.right)]>=0?de++:X++:k[b.get(De.top)]-k[b.get(De.bottom)]>=0?Fe++:ke++}),de>X&&Fe>ke)for(var Ye=0;YeX)for(var Ie=0;Ieke)for(var ze=0;ze1)v.fixedNodeConstraint.forEach(function(se,K){D[K]=[se.position.x,se.position.y],$[K]=[T[b.get(se.nodeId)],k[b.get(se.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var se=0;if(v.alignmentConstraint.vertical){for(var K=v.alignmentConstraint.vertical,de=function(ze){var De=new Set;K[ze].forEach(function(nt){De.add(nt)});var Ke=new Set([].concat(h(De)).filter(function(nt){return H.has(nt)})),Be=void 0;Ke.size>0?Be=T[b.get(Ke.values().next().value)]:Be=L(De).x,K[ze].forEach(function(nt){D[se]=[Be,k[b.get(nt)]],$[se]=[T[b.get(nt)],k[b.get(nt)]],se++})},X=0;X0?Be=T[b.get(Ke.values().next().value)]:Be=L(De).y,Fe[ze].forEach(function(nt){D[se]=[T[b.get(nt)],Be],$[se]=[T[b.get(nt)],k[b.get(nt)]],se++})},Ye=0;YeG&&(G=q[j].length,Q=j);if(G0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(se,K){var de={x:T[b.get(se.nodeId)],y:k[b.get(se.nodeId)]},X=se.position,Fe=M(X,de);we.x+=Fe.x,we.y+=Fe.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,T.forEach(function(se,K){T[K]+=we.x}),k.forEach(function(se,K){k[K]+=we.y}),v.fixedNodeConstraint.forEach(function(se){T[b.get(se.nodeId)]=se.position.x,k[b.get(se.nodeId)]=se.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ae=v.alignmentConstraint.vertical,Ue=function(K){var de=new Set;Ae[K].forEach(function(ke){de.add(ke)});var X=new Set([].concat(h(de)).filter(function(ke){return H.has(ke)})),Fe=void 0;X.size>0?Fe=T[b.get(X.values().next().value)]:Fe=L(de).x,de.forEach(function(ke){H.has(ke)||(T[b.get(ke)]=Fe)})},le=0;le0?Fe=k[b.get(X.values().next().value)]:Fe=L(de).y,de.forEach(function(ke){H.has(ke)||(k[b.get(ke)]=Fe)})},oe=0;oe{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})()})})(v_)),v_.exports}var Vgr=y_.exports,Iye;function Wgr(){return Iye||(Iye=1,(function(t,e){(function(n,i){t.exports=i(Hgr())})(Vgr,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,x=!1,b=void 0;try{for(var T=g[Symbol.iterator](),k;!(v=(k=T.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&T.return&&T.return()}finally{if(x)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(V)});for(var z=0;z1){k=b[0],S=k.connectedEdges().length,b.forEach(function($){$.connectedEdges().length0&&y.set("dummy"+(y.size+1),A),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,k=!1,S=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),E;!(T=(E=C.next()).done);T=!0){var A=E.value,M=h(A,2),L=M[0],P=M[1],N=m.cy.getElementById(L);if(N){var _=N.boundingBox(),I=g.xCoords[P]-_.w/2,O=g.xCoords[P]+_.w/2,D=g.yCoords[P]-_.h/2,$=g.yCoords[P]+_.h/2;Iv&&(v=O),Db&&(b=$)}}}catch(V){k=!0,S=V}finally{try{!T&&C.return&&C.return()}finally{if(k)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(V){return V+F}),g.yCoords=g.yCoords.map(function(V){return V+z})}else{Object.keys(g).forEach(function(V){var q=g[V],G=q.getRect().x,Q=q.getRect().x+q.getRect().width,j=q.getRect().y,ae=q.getRect().y+q.getRect().height;Gv&&(v=Q),jb&&(b=ae)});var H=p.x-(v+y)/2,B=p.y-(b+x)/2;Object.keys(g).forEach(function(V){var q=g[V];q.setCenter(q.getCenterX()+H,q.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,k=void 0,S=void 0,C=void 0,E=void 0,A=p.descendants().not(":parent"),M=A.length,L=0;Lk&&(v=k),xC&&(b=C),T{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,x=function(T,k){var S=T.cy,C=T.eles,E=C.nodes(),A=C.edges(),M=void 0,L=void 0,P=void 0,N={};T.randomize&&(M=k.nodeIndexes,L=k.xCoords,P=k.yCoords);var _=function(V){return typeof V=="function"},I=function(V,q){return _(V)?V(q):V},O=h.calcParentsWithoutChildren(S,C),D=function B(V,q,G,Q){for(var j=q.length,ae=0;ae0){var te=void 0;te=G.getGraphManager().add(G.newGraph(),re),B(te,J,G,Q)}}},$=function(V,q,G){for(var Q=0,j=0,ae=0;ae0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=Q/j:_(T.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(V,q){q.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(V.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};T.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=T.animate,v.TILE=T.tile,v.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),T.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),T.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,H=z.newGraphManager();return D(H.addRoot(),h.getTopMostNodes(E),z,T),$(z,H,A),F(z,T),z.runLayout(),N};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function T(k,S){for(var C=0;C0)if(O){var F=p.getTopMostNodes(C.eles.nodes());if(P=p.connectComponents(E,C.eles,F),P.forEach(function(He){var ue=He.boundingBox();N.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2})}),C.randomize&&P.forEach(function(He){C.eles=He,M.push(m(C))}),C.quality=="default"||C.quality=="proof"){var z=E.collection();if(C.tile){var H=new Map,B=[],V=[],q=0,G={nodeIndexes:H,xCoords:B,yCoords:V},Q=[];if(P.forEach(function(He,ue){He.edges().length==0&&(He.nodes().forEach(function(ce,Te){z.merge(He.nodes()[Te]),ce.isParent()||(G.nodeIndexes.set(He.nodes()[Te].id(),q++),G.xCoords.push(He.nodes()[0].position().x),G.yCoords.push(He.nodes()[0].position().y))}),Q.push(ue))}),z.length>1){var j=z.boundingBox();N.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),P.push(z),M.push(G);for(var ae=Q.length-1;ae>=0;ae--)P.splice(Q[ae],1),M.splice(Q[ae],1),N.splice(Q[ae],1)}}P.forEach(function(He,ue){C.eles=He,L.push(v(C,M[ue])),p.relocateComponent(N[ue],L[ue],C)})}else P.forEach(function(He,ue){p.relocateComponent(N[ue],M[ue],C)});var Z=new Set;if(P.length>1){var J=[],re=A.filter(function(He){return He.css("display")=="none"});P.forEach(function(He,ue){var ce=void 0;if(C.quality=="draft"&&(ce=M[ue].nodeIndexes),He.nodes().not(re).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;He.nodes().not(re).forEach(function(Ve){if(C.quality=="draft")if(!Ve.isParent())ge=ce.get(Ve.id()),Te.nodes.push({x:M[ue].xCoords[ge]-Ve.boundingbox().w/2,y:M[ue].yCoords[ge]-Ve.boundingbox().h/2,width:Ve.boundingbox().w,height:Ve.boundingbox().h});else{var we=p.calcBoundingBox(Ve,M[ue].xCoords,M[ue].yCoords,ce);Te.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else L[ue][Ve.id()]&&Te.nodes.push({x:L[ue][Ve.id()].getLeft(),y:L[ue][Ve.id()].getTop(),width:L[ue][Ve.id()].getWidth(),height:L[ue][Ve.id()].getHeight()})}),He.edges().forEach(function(Ve){var we=Ve.source(),Ae=Ve.target();if(we.css("display")!="none"&&Ae.css("display")!="none")if(C.quality=="draft"){var Ue=ce.get(we.id()),le=ce.get(Ae.id()),pe=[],Ce=[];if(we.isParent()){var oe=p.calcBoundingBox(we,M[ue].xCoords,M[ue].yCoords,ce);pe.push(oe.topLeftX+oe.width/2),pe.push(oe.topLeftY+oe.height/2)}else pe.push(M[ue].xCoords[Ue]),pe.push(M[ue].yCoords[Ue]);if(Ae.isParent()){var fe=p.calcBoundingBox(Ae,M[ue].xCoords,M[ue].yCoords,ce);Ce.push(fe.topLeftX+fe.width/2),Ce.push(fe.topLeftY+fe.height/2)}else Ce.push(M[ue].xCoords[le]),Ce.push(M[ue].yCoords[le]);Te.edges.push({startX:pe[0],startY:pe[1],endX:Ce[0],endY:Ce[1]})}else L[ue][we.id()]&&L[ue][Ae.id()]&&Te.edges.push({startX:L[ue][we.id()].getCenterX(),startY:L[ue][we.id()].getCenterY(),endX:L[ue][Ae.id()].getCenterX(),endY:L[ue][Ae.id()].getCenterY()})}),Te.nodes.length>0&&(J.push(Te),Z.add(ue))}});var ee=I.packComponents(J,C.randomize).shifts;if(C.quality=="draft")M.forEach(function(He,ue){var ce=He.xCoords.map(function(ge){return ge+ee[ue].dx}),Te=He.yCoords.map(function(ge){return ge+ee[ue].dy});He.xCoords=ce,He.yCoords=Te});else{var me=0;Z.forEach(function(He){Object.keys(L[He]).forEach(function(ue){var ce=L[He][ue];ce.setCenter(ce.getCenterX()+ee[me].dx,ce.getCenterY()+ee[me].dy)}),me++})}}}else{var D=C.eles.boundingBox();if(N.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),C.randomize){var $=m(C);M.push($)}C.quality=="default"||C.quality=="proof"?(L.push(v(C,M[0])),p.relocateComponent(N[0],L[0],C)):p.relocateComponent(N[0],M[0],C)}var te=function(ue,ce){if(C.quality=="default"||C.quality=="proof"){typeof ue=="number"&&(ue=ce);var Te=void 0,ge=void 0,Ve=ue.data("id");return L.forEach(function(Ae){Ve in Ae&&(Te={x:Ae[Ve].getRect().getCenterX(),y:Ae[Ve].getRect().getCenterY()},ge=Ae[Ve])}),C.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Te.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Te.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Te.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Te.y-=ge.labelHeight/2))),Te==null&&(Te={x:ue.position("x"),y:ue.position("y")}),{x:Te.x,y:Te.y}}else{var we=void 0;return M.forEach(function(Ae){var Ue=Ae.nodeIndexes.get(ue.id());Ue!=null&&(we={x:Ae.xCoords[Ue],y:Ae.yCoords[Ue]})}),we==null&&(we={x:ue.position("x"),y:ue.position("y")}),{x:we.x,y:we.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var $e=p.calcParentsWithoutChildren(E,A),Oe=A.filter(function(He){return He.css("display")=="none"});C.eles=A.not(Oe),A.nodes().not(":parent").not(Oe).layoutPositions(S,C,te),$e.length>0&&$e.forEach(function(He){He.position(te(He))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T})();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,x=v.nodes(),b=v.nodes(":parent"),T=new Map,k=new Map,S=new Map,C=[],E=[],A=[],M=[],L=[],P=[],N=[],_=[],I=void 0,O=1e8,D=1e-9,$=m.piTol,F=m.samplingType,z=m.nodeSeparation,H=void 0,B=function(){for(var K=0,de=0,X=!1;de=ke;){Ie=Fe[ke++];for(var Le=C[Ie],pt=0;ptKe&&(Ke=L[Ct],Be=Ct)}return Be},q=function(K){var de=void 0;if(K){de=Math.floor(Math.random()*I);for(var Fe=0;Fe=1)break;De=ze}for(var nt=0;nt=1)break;De=ze}for(var pt=0;pt0&&(de.isParent()?C[K].push(S.get(de.id())):C[K].push(de.id()))})});var Oe=function(K){var de=k.get(K),X=void 0;T.get(K).forEach(function(Fe){y.getElementById(Fe).isParent()?X=S.get(Fe):X=Fe,C[de].push(X),C[k.get(X)].push(K)})},He=!0,ue=!1,ce=void 0;try{for(var Te=T.keys()[Symbol.iterator](),ge;!(He=(ge=Te.next()).done);He=!0){var Ve=ge.value;Oe(Ve)}}catch(se){ue=!0,ce=se}finally{try{!He&&Te.return&&Te.return()}finally{if(ue)throw ce}}I=k.size;var we=void 0;if(I>2){H=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})()})})(y_)),y_.exports}var qgr=Wgr();const Ggr=ky(qgr);var $ye={L:"left",R:"right",T:"top",B:"bottom"},Nye={L:w(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:w(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:w(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:w(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},L8={L:w((t,e)=>t-e+2,"L"),R:w((t,e)=>t-2,"R"),T:w((t,e)=>t-e+2,"T"),B:w((t,e)=>t-2,"B")},Ugr=w(function(t){return tl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Dye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),tl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),hg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),aie=w(function(t,e){const r=tl(t)&&hg(e),n=hg(t)&&tl(e);return r||n},"isArchitectureDirectionXY"),Ygr=w(function(t){const e=t[0],r=t[1],n=tl(e)&&hg(r),i=hg(e)&&tl(r);return n||i},"isArchitecturePairXY"),jgr=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Kj=w(function(t,e){const r=`${t}${e}`;return jgr(r)?r:void 0},"getArchitectureDirectionPair"),Xgr=w(function([t,e],r){const n=r[0],i=r[1];return tl(n)?hg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:tl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Kgr=w(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Zgr=w(function(t,e){return aie(t,e)?"bend":tl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Qgr=w(function(t){return t.type==="service"},"isArchitectureService"),Jgr=w(function(t){return t.type==="junction"},"isArchitectureJunction"),fUe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),pUe=w(t=>t.data(),"edgeData"),eb=w(t=>t.data(),"nodeData"),emr=xn.architecture,lT,gUe=(lT=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=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji,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="",wi()}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(Qgr)}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(Jgr)}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(!Dye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Dye(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=Zgr(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(fUe(p,g),m)}if(f.lhsId===u){const m=Kj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Kj(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=w(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,x)=>{a.has(v)||(h.set(v,Xgr([m,y],x)),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 Gi({...emr,...pr().architecture})}getConfigField(e){return this.getConfig()[e]}},w(lT,"ArchitectureDB"),lT),tmr=w((t,e)=>{var r;Al(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"),mUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("architecture",t);he.debug(e);const r=(n=mUe.parser)==null?void 0:n.yy;if(!(r instanceof gUe))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.");tmr(e,r)},"parse")},rmr=w(t=>` + `},"styles"),Hgr=zgr,Vgr={db:Xj,renderer:Bgr,parser:Mgr,styles:Hgr};const Wgr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vgr},Symbol.toStringTag,{value:"Module"}));var v_={exports:{}},b_={exports:{}},x_={exports:{}},qgr=x_.exports,Lye;function Ggr(){return Lye||(Lye=1,(function(t,e){(function(n,i){t.exports=i()})(qgr,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,x){a.call(this,x),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,x){if(v==null&&x==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 T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(v.owner==x.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=x.owner?null:(T.source=v,T.target=x,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),x!=v&&x.edges.push(T),T)}},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 x=v.edges.slice(),b,T=x.length,k=0;k-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(C,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,x,b,T,k=this.getNodes(),S=k.length,C=0;Cx&&(y=x),v>b&&(v=b)}return y==s.MAX_VALUE?null:(k[0].getParent().paddingLeft!=null?T=k[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=y-T,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,x=-s.MAX_VALUE,b=s.MAX_VALUE,T=-s.MAX_VALUE,k,S,C,E,A,M=this.nodes,L=M.length,P=0;Pk&&(v=k),xC&&(b=C),Tk&&(v=k),xC&&(b=C),T=this.nodes.length){var L=0;x.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]=x,_=!0):(u[0]=y,u[1]=m,_=!0):O===$&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=b,u[1]=x,_=!0)),-D===$?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=C,I=!0):D===$&&(f>h?(u[2]=S,u[3]=C,I=!0):(u[2]=L,u[3]=M,I=!0)),_&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection(O,$,4),z=this.getCardinalDirection(D,$,2)):(F=this.getCardinalDirection(-O,$,3),z=this.getCardinalDirection(-D,$,1)):d>p?(F=this.getCardinalDirection(-O,$,1),z=this.getCardinalDirection(-D,$,3)):(F=this.getCardinalDirection(O,$,2),z=this.getCardinalDirection(D,$,4)),!_)switch(F){case 1:B=m,H=h+-k/$,u[0]=H,u[1]=B;break;case 2:H=b,B=d+T*$,u[0]=H,u[1]=B;break;case 3:B=x,H=h+k/$,u[0]=H,u[1]=B;break;case 4:H=v,B=d+-T*$,u[0]=H,u[1]=B;break}if(!I)switch(z){case 1:q=C,V=f+-N/$,u[2]=V,u[3]=q;break;case 2:V=L,q=p+P*$,u[2]=V,u[3]=q;break;case 3:q=M,V=f+N/$,u[2]=V,u[3]=q;break;case 4:V=A,q=p+-P*$,u[2]=V,u[3]=q;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,x=h.y,b=void 0,T=void 0,k=void 0,S=void 0,C=void 0,E=void 0,A=void 0,M=void 0,L=void 0;return k=g-f,C=d-p,A=p*f-d*g,S=x-y,E=m-v,M=v*y-m*x,L=k*E-S*C,L===0?null:(b=(C*M-E*A)/L,T=(S*A-k*M)/L,new a(b,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var x=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),T=null;return x>=0&&x<=1?[x]:b>=0&&b<=1?[b]:T}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(k.push(C[0]);k.length>0&&y;){var E=k[0];k.splice(0,1),T.add(E);for(var A=E.getEdges(),b=0;b-1&&C.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,x=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b0){for(var x=this.edgeToDummyNodes.get(v),b=0;b=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(_){if(v.indexOf(_)<0){var I=x.get(_),O=I-1;O==1&&E.push(_),x.set(_,O)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,T=y[0])}return T},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,x,b=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mk||T>k)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*x)):(k=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>k||T>k)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*x*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||k>=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(At){for(var mt=[];At-- >0;)mt.push(0);return mt})(Math.min(this.m+1,this.n)),this.U=(function(At){var mt=function ye(Nt){if(Nt.length==0)return 0;for(var yt=[],gt=0;gt0;)mt.push(0);return mt})(this.n),u=(function(At){for(var mt=[];At-- >0;)mt.push(0);return mt})(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;D--)if(this.s[D]!==0){for(var $=D+1;$=0;G--){if((function(At,mt){return At&&mt})(G0;){var te=void 0,$e=void 0;for(te=_-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ee*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===_-2)$e=4;else{var Oe=void 0;for(Oe=_-1;Oe>=te&&Oe!==te;Oe--){var He=(Oe!==_?Math.abs(l[Oe]):0)+(Oe!==te+1?Math.abs(l[Oe-1]):0);if(Math.abs(this.s[Oe])<=me+ee*He){this.s[Oe]=0;break}}Oe===te?$e=3:Oe===_-1?$e=1:($e=2,te=Oe)}switch(te++,$e){case 1:{var ue=l[_-2];l[_-2]=0;for(var ce=_-2;ce>=te;ce--){var Te=a.hypot(this.s[ce],ue),ge=this.s[ce]/Te,Ve=ue/Te;this.s[ce]=Te,ce!==te&&(ue=-Ve*l[ce-1],l[ce-1]=ge*l[ce-1]);for(var we=0;we=this.s[te+1]);){var Ct=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=Ct,teMath.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,x=u(551).LayoutConstants,b=u(551).Point,T=u(551).PointD,k=u(551).DimensionD,S=u(551).Layout,C=u(551).Integer,E=u(551).IGeometry,A=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 N in h)P[N]=h[N];P.prototype.newGraphManager=function(){var _=new d(this);return this.graphManager=_,_},P.prototype.newGraph=function(_){return new f(null,this.graphManager,_)},P.prototype.newNode=function(_){return new p(this.graphManager,_)},P.prototype.newEdge=function(_){return new g(null,null,_)},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 _=x.DEFAULT_CREATE_BENDS_AS_NEEDED;return _&&(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()),O=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation(O)}}else{var _=this.getFlatForest();if(_.length>0)this.positionNodesRadially(_);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),O=this.nodesWithGravity.filter(function(D){return I.has(D)});this.graphManager.setAllNodesToApplyGravitation(O),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 _=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function($){return _.has($)});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 O=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(O,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var _=this.graphManager.getAllNodes(),I={},O=0;O<_.length;O++){var D=_[O].rect,$=_[O].id;I[$]={id:$,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return I},P.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var _=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!_;)_=this.tick();this.graphManager.updateBounds()}},P.prototype.moveNodes=function(){for(var _=this.getAllNodes(),I,O=0;O<_.length;O++)I=_[O],I.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var O=0;O<_.length;O++)I=_[O],I.move()},P.prototype.initConstraintVariables=function(){var _=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var I=this.graphManager.getAllNodes(),O=0;O0&&(D.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,H=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Z){_.fixedNodesOnHorizontal.add(Z),_.fixedNodesOnVertical.add(Z)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,O=0;O=2*Z.length/3;ee--)J=Math.floor(Math.random()*(ee+1)),re=Z[ee],Z[ee]=Z[J],Z[J]=re;return Z},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(Z){if(Z.left){var J=z.has(Z.left)?z.get(Z.left):Z.left,re=z.has(Z.right)?z.get(Z.right):Z.right;_.nodesInRelativeHorizontal.includes(J)||(_.nodesInRelativeHorizontal.push(J),_.nodeToRelativeConstraintMapHorizontal.set(J,[]),_.dummyToNodeForVerticalAlignment.has(J)?_.nodeToTempPositionMapHorizontal.set(J,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(J,_.idToNodeMap.get(J).getCenterX())),_.nodesInRelativeHorizontal.includes(re)||(_.nodesInRelativeHorizontal.push(re),_.nodeToRelativeConstraintMapHorizontal.set(re,[]),_.dummyToNodeForVerticalAlignment.has(re)?_.nodeToTempPositionMapHorizontal.set(re,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(re)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(re,_.idToNodeMap.get(re).getCenterX())),_.nodeToRelativeConstraintMapHorizontal.get(J).push({right:re,gap:Z.gap}),_.nodeToRelativeConstraintMapHorizontal.get(re).push({left:J,gap:Z.gap})}else{var ee=H.has(Z.top)?H.get(Z.top):Z.top,me=H.has(Z.bottom)?H.get(Z.bottom):Z.bottom;_.nodesInRelativeVertical.includes(ee)||(_.nodesInRelativeVertical.push(ee),_.nodeToRelativeConstraintMapVertical.set(ee,[]),_.dummyToNodeForHorizontalAlignment.has(ee)?_.nodeToTempPositionMapVertical.set(ee,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(ee)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(ee,_.idToNodeMap.get(ee).getCenterY())),_.nodesInRelativeVertical.includes(me)||(_.nodesInRelativeVertical.push(me),_.nodeToRelativeConstraintMapVertical.set(me,[]),_.dummyToNodeForHorizontalAlignment.has(me)?_.nodeToTempPositionMapVertical.set(me,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(me,_.idToNodeMap.get(me).getCenterY())),_.nodeToRelativeConstraintMapVertical.get(ee).push({bottom:me,gap:Z.gap}),_.nodeToRelativeConstraintMapVertical.get(me).push({top:ee,gap:Z.gap})}});else{var q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(Z){if(Z.left){var J=z.has(Z.left)?z.get(Z.left):Z.left,re=z.has(Z.right)?z.get(Z.right):Z.right;q.has(J)?q.get(J).push(re):q.set(J,[re]),q.has(re)?q.get(re).push(J):q.set(re,[J])}else{var ee=H.has(Z.top)?H.get(Z.top):Z.top,me=H.has(Z.bottom)?H.get(Z.bottom):Z.bottom;G.has(ee)?G.get(ee).push(me):G.set(ee,[me]),G.has(me)?G.get(me).push(ee):G.set(me,[ee])}});var Q=function(J,re){var ee=[],me=[],te=new L,$e=new Set,Oe=0;return J.forEach(function(He,ue){if(!$e.has(ue)){ee[Oe]=[],me[Oe]=!1;var ce=ue;for(te.push(ce),$e.add(ce),ee[Oe].push(ce);te.length!=0;){ce=te.shift(),re.has(ce)&&(me[Oe]=!0);var Te=J.get(ce);Te.forEach(function(ge){$e.has(ge)||(te.push(ge),$e.add(ge),ee[Oe].push(ge))})}Oe++}}),{components:ee,isFixed:me}},j=Q(q,_.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var ae=Q(G,_.fixedNodesOnVertical);this.componentsOnVertical=ae.components,this.fixedComponentsOnVertical=ae.isFixed}}},P.prototype.updateDisplacements=function(){var _=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ae){var Z=_.idToNodeMap.get(ae.nodeId);Z.displacementX=0,Z.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,O=0;O1){var H;for(H=0;HD&&(D=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(x.WORLD_CENTER_X-z.x/2,x.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(_,I,O){var D=Math.max(this.maxDiagonalInTree(_),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,D);var $=A.calculateBounds(_),F=new M;F.setDeviceOrgX($.getMinX()),F.setDeviceOrgY($.getMinY()),F.setWorldOrgX(O.x),F.setWorldOrgY(O.y);for(var z=0;z<_.length;z++){var H=_[z];H.transform(F)}var B=new T($.getMaxX(),$.getMaxY());return F.inverseTransformPoint(B)},P.branchRadialLayout=function(_,I,O,D,$,F){var z=(D-O+1)/2;z<0&&(z+=180);var H=(z+O)%360,B=H*E.TWO_PI/360,V=$*Math.cos(B),q=$*Math.sin(B);_.setCenter(V,q);var G=[];G=G.concat(_.getEdges());var Q=G.length;I!=null&&Q--;for(var j=0,ae=G.length,Z,J=_.getEdgesBetween(I);J.length>1;){var re=J[0];J.splice(0,1);var ee=G.indexOf(re);ee>=0&&G.splice(ee,1),ae--,Q--}I!=null?Z=(G.indexOf(J[0])+1)%ae:Z=0;for(var me=Math.abs(D-O)/Q,te=Z;j!=Q;te=++te%ae){var $e=G[te].getOtherEnd(_);if($e!=I){var Oe=(O+j*me)%360,He=(Oe+me)%360;P.branchRadialLayout($e,_,Oe,He,$+F,F),j++}}},P.maxDiagonalInTree=function(_){for(var I=C.MIN_VALUE,O=0;O<_.length;O++){var D=_[O],$=D.getDiagonal();$>I&&(I=$)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var _=this,I={};this.memberGroups={},this.idToDummyNode={};for(var O=[],D=this.graphManager.getAllNodes(),$=0;$"u"&&(I[H]=[]),I[H]=I[H].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var V="DummyCompound_"+B;_.memberGroups[V]=I[B];var q=I[B][0].getParent(),G=new p(_.graphManager);G.id=V,G.paddingLeft=q.paddingLeft||0,G.paddingRight=q.paddingRight||0,G.paddingBottom=q.paddingBottom||0,G.paddingTop=q.paddingTop||0,_.idToDummyNode[V]=G;var Q=_.getGraphManager().add(_.newGraph(),G),j=q.getChild();j.add(G);for(var ae=0;ae$?(D.rect.x-=(D.labelWidth-$)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-$)/2):D.labelPosHorizontal=="right"&&D.setWidth($+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(F+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>F?(D.rect.y-=(D.labelHeight-F)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-F)/2):D.labelPosVertical=="bottom"&&D.setHeight(F+D.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var _=this.compoundOrder.length-1;_>=0;_--){var I=this.compoundOrder[_],O=I.id,D=I.paddingLeft,$=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[O],I.rect.x,I.rect.y,D,$,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var _=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(O){var D=_.idToDummyNode[O],$=D.paddingLeft,F=D.paddingTop,z=D.labelMarginLeft,H=D.labelMarginTop;_.adjustLocations(I[O],D.rect.x,D.rect.y,$,F,z,H)})},P.prototype.getToBeTiled=function(_){var I=_.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var O=_.getChild();if(O==null)return this.toBeTiled[I]=!1,!1;for(var D=O.getNodes(),$=0;$0)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(_){_.id;for(var I=_.getEdges(),O=0,D=0;Dq&&(q=Q.rect.height)}O+=q+_.verticalPadding}},P.prototype.tileCompoundMembers=function(_,I){var O=this;this.tiledMemberPack=[],Object.keys(_).forEach(function(D){var $=I[D];if(O.tiledMemberPack[D]=O.tileNodes(_[D],$.paddingLeft+$.paddingRight),$.rect.width=O.tiledMemberPack[D].width,$.rect.height=O.tiledMemberPack[D].height,$.setCenter(O.tiledMemberPack[D].centerX,O.tiledMemberPack[D].centerY),$.labelMarginLeft=0,$.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=$.rect.width,z=$.rect.height;$.labelWidth&&($.labelPosHorizontal=="left"?($.rect.x-=$.labelWidth,$.setWidth(F+$.labelWidth),$.labelMarginLeft=$.labelWidth):$.labelPosHorizontal=="center"&&$.labelWidth>F?($.rect.x-=($.labelWidth-F)/2,$.setWidth($.labelWidth),$.labelMarginLeft=($.labelWidth-F)/2):$.labelPosHorizontal=="right"&&$.setWidth(F+$.labelWidth)),$.labelHeight&&($.labelPosVertical=="top"?($.rect.y-=$.labelHeight,$.setHeight(z+$.labelHeight),$.labelMarginTop=$.labelHeight):$.labelPosVertical=="center"&&$.labelHeight>z?($.rect.y-=($.labelHeight-z)/2,$.setHeight($.labelHeight),$.labelMarginTop=($.labelHeight-z)/2):$.labelPosVertical=="bottom"&&$.setHeight(z+$.labelHeight))}})},P.prototype.tileNodes=function(_,I){var O=this.tileNodesByFavoringDim(_,I,!0),D=this.tileNodesByFavoringDim(_,I,!1),$=this.getOrgRatio(O),F=this.getOrgRatio(D),z;return F<$?z=D:z=O,z},P.prototype.getOrgRatio=function(_){var I=_.width,O=_.height,D=I/O;return D<1&&(D=1/D),D},P.prototype.calcIdealRowWidth=function(_,I){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,$=_.length,F=0,z=0,H=0;_.forEach(function(ae){F+=ae.getWidth(),z+=ae.getHeight(),ae.getWidth()>H&&(H=ae.getWidth())});var B=F/$,V=z/$,q=Math.pow(O-D,2)+4*(B+D)*(V+O)*$,G=(D-O+Math.sqrt(q))/(2*(B+D)),Q;I?(Q=Math.ceil(G),Q==G&&Q++):Q=Math.floor(G);var j=Q*(B+D)-D;return H>j&&(j=H),j+=D*2,j},P.prototype.tileNodesByFavoringDim=function(_,I,O){var D=m.TILING_PADDING_VERTICAL,$=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:D,horizontalPadding:$,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(_,O));var H=function(Z){return Z.rect.width*Z.rect.height},B=function(Z,J){return H(J)-H(Z)};_.sort(function(ae,Z){var J=B;return z.idealRowWidth?(J=F,J(ae.id,Z.id)):J(ae,Z)});for(var V=0,q=0,G=0;G<_.length;G++){var Q=_[G];V+=Q.getCenterX(),q+=Q.getCenterY()}z.centerX=V/_.length,z.centerY=q/_.length;for(var G=0;G<_.length;G++){var Q=_[G];if(z.rows.length==0)this.insertNodeToRow(z,Q,0,I);else if(this.canAddHorizontal(z,Q.rect.width,Q.rect.height)){var j=z.rows.length-1;z.idealRowWidth||(j=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Q,j,I)}else this.insertNodeToRow(z,Q,z.rows.length,I);this.shiftToLastRow(z)}return z},P.prototype.insertNodeToRow=function(_,I,O,D){var $=D;if(O==_.rows.length){var F=[];_.rows.push(F),_.rowWidth.push($),_.rowHeight.push(0)}var z=_.rowWidth[O]+I.rect.width;_.rows[O].length>0&&(z+=_.horizontalPadding),_.rowWidth[O]=z,_.width0&&(H+=_.verticalPadding);var B=0;H>_.rowHeight[O]&&(B=_.rowHeight[O],_.rowHeight[O]=H,B=_.rowHeight[O]-B),_.height+=B,_.rows[O].push(I)},P.prototype.getShortestRowIndex=function(_){for(var I=-1,O=Number.MAX_VALUE,D=0;D<_.rows.length;D++)_.rowWidth[D]O&&(I=D,O=_.rowWidth[D]);return I},P.prototype.canAddHorizontal=function(_,I,O){if(_.idealRowWidth){var D=_.rows.length-1,$=_.rowWidth[D];return $+I+_.horizontalPadding<=_.idealRowWidth}var F=this.getShortestRowIndex(_);if(F<0)return!0;var z=_.rowWidth[F];if(z+_.horizontalPadding+I<=_.width)return!0;var H=0;_.rowHeight[F]0&&(H=O+_.verticalPadding-_.rowHeight[F]);var B;_.width-z>=I+_.horizontalPadding?B=(_.height+H)/(z+I+_.horizontalPadding):B=(_.height+H)/_.width,H=O+_.verticalPadding;var V;return _.widthF&&I!=O){D.splice(-1,1),_.rows[O].push($),_.rowWidth[I]=_.rowWidth[I]-F,_.rowWidth[O]=_.rowWidth[O]+F,_.width=_.rowWidth[instance.getLongestRowIndex(_)];for(var z=Number.MIN_VALUE,H=0;Hz&&(z=D[H].height);I>0&&(z+=_.verticalPadding);var B=_.rowHeight[I]+_.rowHeight[O];_.rowHeight[I]=z,_.rowHeight[O]<$.height+_.verticalPadding&&(_.rowHeight[O]=$.height+_.verticalPadding);var V=_.rowHeight[I]+_.rowHeight[O];_.height+=V-B,this.shiftToLastRow(_)}},P.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},P.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},P.prototype.reduceTrees=function(){for(var _=[],I=!0,O;I;){var D=this.graphManager.getAllNodes(),$=[];I=!1;for(var F=0;F0)for(var j=$;j<=F;j++)Q[0]+=this.grid[j][z-1].length+this.grid[j][z].length-1;if(F0)for(var j=z;j<=H;j++)Q[3]+=this.grid[$-1][j].length+this.grid[$][j].length-1;for(var ae=C.MAX_VALUE,Z,J,re=0;re{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,x=0;x{function h(y){if(Array.isArray(y)){for(var v=0,x=Array(y.length);v0){var Ct=0;Me.forEach(function(ht){de=="horizontal"?(ze.set(ht,b.has(ht)?T[b.get(ht)]:Fe.get(ht)),Ct+=ze.get(ht)):(ze.set(ht,b.has(ht)?k[b.get(ht)]:Fe.get(ht)),Ct+=ze.get(ht))}),Ct=Ct/Me.length,pt.forEach(function(ht){X.has(ht)||ze.set(ht,Ct)})}else{var wt=0;pt.forEach(function(ht){de=="horizontal"?wt+=b.has(ht)?T[b.get(ht)]:Fe.get(ht):wt+=b.has(ht)?k[b.get(ht)]:Fe.get(ht)}),wt=wt/pt.length,pt.forEach(function(ht){ze.set(ht,wt)})}});for(var Be=function(){var Me=Ke.shift(),Ct=K.get(Me);Ct.forEach(function(wt){if(ze.get(wt.id)ht&&(ht=St),tnBt&&(Bt=tn)}}catch(qr){mt=!0,ye=qr}finally{try{!At&&Nt.return&&Nt.return()}finally{if(mt)throw ye}}var _e=(Ct+ht)/2-(wt+Bt)/2,Je=!0,ut=!1,Dt=void 0;try{for(var Kt=pt[Symbol.iterator](),Er;!(Je=(Er=Kt.next()).done);Je=!0){var yr=Er.value;ze.set(yr,ze.get(yr)+_e)}}catch(qr){ut=!0,Dt=qr}finally{try{!Je&&Kt.return&&Kt.return()}finally{if(ut)throw Dt}}})}return ze},N=function(K){var de=0,X=0,Fe=0,ke=0;if(K.forEach(function(De){De.left?T[b.get(De.left)]-T[b.get(De.right)]>=0?de++:X++:k[b.get(De.top)]-k[b.get(De.bottom)]>=0?Fe++:ke++}),de>X&&Fe>ke)for(var Ye=0;YeX)for(var Ie=0;Ieke)for(var ze=0;ze1)v.fixedNodeConstraint.forEach(function(se,K){D[K]=[se.position.x,se.position.y],$[K]=[T[b.get(se.nodeId)],k[b.get(se.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var se=0;if(v.alignmentConstraint.vertical){for(var K=v.alignmentConstraint.vertical,de=function(ze){var De=new Set;K[ze].forEach(function(nt){De.add(nt)});var Ke=new Set([].concat(h(De)).filter(function(nt){return H.has(nt)})),Be=void 0;Ke.size>0?Be=T[b.get(Ke.values().next().value)]:Be=L(De).x,K[ze].forEach(function(nt){D[se]=[Be,k[b.get(nt)]],$[se]=[T[b.get(nt)],k[b.get(nt)]],se++})},X=0;X0?Be=T[b.get(Ke.values().next().value)]:Be=L(De).y,Fe[ze].forEach(function(nt){D[se]=[T[b.get(nt)],Be],$[se]=[T[b.get(nt)],k[b.get(nt)]],se++})},Ye=0;YeG&&(G=q[j].length,Q=j);if(G0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(se,K){var de={x:T[b.get(se.nodeId)],y:k[b.get(se.nodeId)]},X=se.position,Fe=M(X,de);we.x+=Fe.x,we.y+=Fe.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,T.forEach(function(se,K){T[K]+=we.x}),k.forEach(function(se,K){k[K]+=we.y}),v.fixedNodeConstraint.forEach(function(se){T[b.get(se.nodeId)]=se.position.x,k[b.get(se.nodeId)]=se.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ae=v.alignmentConstraint.vertical,Ue=function(K){var de=new Set;Ae[K].forEach(function(ke){de.add(ke)});var X=new Set([].concat(h(de)).filter(function(ke){return H.has(ke)})),Fe=void 0;X.size>0?Fe=T[b.get(X.values().next().value)]:Fe=L(de).x,de.forEach(function(ke){H.has(ke)||(T[b.get(ke)]=Fe)})},le=0;le0?Fe=k[b.get(X.values().next().value)]:Fe=L(de).y,de.forEach(function(ke){H.has(ke)||(k[b.get(ke)]=Fe)})},oe=0;oe{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})()})})(b_)),b_.exports}var jgr=v_.exports,$ye;function Xgr(){return $ye||($ye=1,(function(t,e){(function(n,i){t.exports=i(Ygr())})(jgr,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,x=!1,b=void 0;try{for(var T=g[Symbol.iterator](),k;!(v=(k=T.next()).done)&&(y.push(k.value),!(m&&y.length===m));v=!0);}catch(S){x=!0,b=S}finally{try{!v&&T.return&&T.return()}finally{if(x)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(V)});for(var z=0;z1){k=b[0],S=k.connectedEdges().length,b.forEach(function($){$.connectedEdges().length0&&y.set("dummy"+(y.size+1),A),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,k=!1,S=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),E;!(T=(E=C.next()).done);T=!0){var A=E.value,M=h(A,2),L=M[0],P=M[1],N=m.cy.getElementById(L);if(N){var _=N.boundingBox(),I=g.xCoords[P]-_.w/2,O=g.xCoords[P]+_.w/2,D=g.yCoords[P]-_.h/2,$=g.yCoords[P]+_.h/2;Iv&&(v=O),Db&&(b=$)}}}catch(V){k=!0,S=V}finally{try{!T&&C.return&&C.return()}finally{if(k)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+x)/2;g.xCoords=g.xCoords.map(function(V){return V+F}),g.yCoords=g.yCoords.map(function(V){return V+z})}else{Object.keys(g).forEach(function(V){var q=g[V],G=q.getRect().x,Q=q.getRect().x+q.getRect().width,j=q.getRect().y,ae=q.getRect().y+q.getRect().height;Gv&&(v=Q),jb&&(b=ae)});var H=p.x-(v+y)/2,B=p.y-(b+x)/2;Object.keys(g).forEach(function(V){var q=g[V];q.setCenter(q.getCenterX()+H,q.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,x=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,k=void 0,S=void 0,C=void 0,E=void 0,A=p.descendants().not(":parent"),M=A.length,L=0;Lk&&(v=k),xC&&(b=C),T{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,x=function(T,k){var S=T.cy,C=T.eles,E=C.nodes(),A=C.edges(),M=void 0,L=void 0,P=void 0,N={};T.randomize&&(M=k.nodeIndexes,L=k.xCoords,P=k.yCoords);var _=function(V){return typeof V=="function"},I=function(V,q){return _(V)?V(q):V},O=h.calcParentsWithoutChildren(S,C),D=function B(V,q,G,Q){for(var j=q.length,ae=0;ae0){var te=void 0;te=G.getGraphManager().add(G.newGraph(),re),B(te,J,G,Q)}}},$=function(V,q,G){for(var Q=0,j=0,ae=0;ae0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=Q/j:_(T.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(V,q){q.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=q.fixedNodeConstraint),q.alignmentConstraint&&(V.constraints.alignmentConstraint=q.alignmentConstraint),q.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=q.relativePlacementConstraint)};T.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=T.animate,v.TILE=T.tile,v.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),T.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),T.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,H=z.newGraphManager();return D(H.addRoot(),h.getTopMostNodes(E),z,T),$(z,H,A),F(z,T),z.runLayout(),N};o.exports={coseLayout:x}}),212:((o,l,u)=>{var h=(function(){function T(k,S){for(var C=0;C0)if(O){var F=p.getTopMostNodes(C.eles.nodes());if(P=p.connectComponents(E,C.eles,F),P.forEach(function(He){var ue=He.boundingBox();N.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2})}),C.randomize&&P.forEach(function(He){C.eles=He,M.push(m(C))}),C.quality=="default"||C.quality=="proof"){var z=E.collection();if(C.tile){var H=new Map,B=[],V=[],q=0,G={nodeIndexes:H,xCoords:B,yCoords:V},Q=[];if(P.forEach(function(He,ue){He.edges().length==0&&(He.nodes().forEach(function(ce,Te){z.merge(He.nodes()[Te]),ce.isParent()||(G.nodeIndexes.set(He.nodes()[Te].id(),q++),G.xCoords.push(He.nodes()[0].position().x),G.yCoords.push(He.nodes()[0].position().y))}),Q.push(ue))}),z.length>1){var j=z.boundingBox();N.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),P.push(z),M.push(G);for(var ae=Q.length-1;ae>=0;ae--)P.splice(Q[ae],1),M.splice(Q[ae],1),N.splice(Q[ae],1)}}P.forEach(function(He,ue){C.eles=He,L.push(v(C,M[ue])),p.relocateComponent(N[ue],L[ue],C)})}else P.forEach(function(He,ue){p.relocateComponent(N[ue],M[ue],C)});var Z=new Set;if(P.length>1){var J=[],re=A.filter(function(He){return He.css("display")=="none"});P.forEach(function(He,ue){var ce=void 0;if(C.quality=="draft"&&(ce=M[ue].nodeIndexes),He.nodes().not(re).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;He.nodes().not(re).forEach(function(Ve){if(C.quality=="draft")if(!Ve.isParent())ge=ce.get(Ve.id()),Te.nodes.push({x:M[ue].xCoords[ge]-Ve.boundingbox().w/2,y:M[ue].yCoords[ge]-Ve.boundingbox().h/2,width:Ve.boundingbox().w,height:Ve.boundingbox().h});else{var we=p.calcBoundingBox(Ve,M[ue].xCoords,M[ue].yCoords,ce);Te.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else L[ue][Ve.id()]&&Te.nodes.push({x:L[ue][Ve.id()].getLeft(),y:L[ue][Ve.id()].getTop(),width:L[ue][Ve.id()].getWidth(),height:L[ue][Ve.id()].getHeight()})}),He.edges().forEach(function(Ve){var we=Ve.source(),Ae=Ve.target();if(we.css("display")!="none"&&Ae.css("display")!="none")if(C.quality=="draft"){var Ue=ce.get(we.id()),le=ce.get(Ae.id()),pe=[],Ce=[];if(we.isParent()){var oe=p.calcBoundingBox(we,M[ue].xCoords,M[ue].yCoords,ce);pe.push(oe.topLeftX+oe.width/2),pe.push(oe.topLeftY+oe.height/2)}else pe.push(M[ue].xCoords[Ue]),pe.push(M[ue].yCoords[Ue]);if(Ae.isParent()){var fe=p.calcBoundingBox(Ae,M[ue].xCoords,M[ue].yCoords,ce);Ce.push(fe.topLeftX+fe.width/2),Ce.push(fe.topLeftY+fe.height/2)}else Ce.push(M[ue].xCoords[le]),Ce.push(M[ue].yCoords[le]);Te.edges.push({startX:pe[0],startY:pe[1],endX:Ce[0],endY:Ce[1]})}else L[ue][we.id()]&&L[ue][Ae.id()]&&Te.edges.push({startX:L[ue][we.id()].getCenterX(),startY:L[ue][we.id()].getCenterY(),endX:L[ue][Ae.id()].getCenterX(),endY:L[ue][Ae.id()].getCenterY()})}),Te.nodes.length>0&&(J.push(Te),Z.add(ue))}});var ee=I.packComponents(J,C.randomize).shifts;if(C.quality=="draft")M.forEach(function(He,ue){var ce=He.xCoords.map(function(ge){return ge+ee[ue].dx}),Te=He.yCoords.map(function(ge){return ge+ee[ue].dy});He.xCoords=ce,He.yCoords=Te});else{var me=0;Z.forEach(function(He){Object.keys(L[He]).forEach(function(ue){var ce=L[He][ue];ce.setCenter(ce.getCenterX()+ee[me].dx,ce.getCenterY()+ee[me].dy)}),me++})}}}else{var D=C.eles.boundingBox();if(N.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),C.randomize){var $=m(C);M.push($)}C.quality=="default"||C.quality=="proof"?(L.push(v(C,M[0])),p.relocateComponent(N[0],L[0],C)):p.relocateComponent(N[0],M[0],C)}var te=function(ue,ce){if(C.quality=="default"||C.quality=="proof"){typeof ue=="number"&&(ue=ce);var Te=void 0,ge=void 0,Ve=ue.data("id");return L.forEach(function(Ae){Ve in Ae&&(Te={x:Ae[Ve].getRect().getCenterX(),y:Ae[Ve].getRect().getCenterY()},ge=Ae[Ve])}),C.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?Te.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(Te.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?Te.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(Te.y-=ge.labelHeight/2))),Te==null&&(Te={x:ue.position("x"),y:ue.position("y")}),{x:Te.x,y:Te.y}}else{var we=void 0;return M.forEach(function(Ae){var Ue=Ae.nodeIndexes.get(ue.id());Ue!=null&&(we={x:Ae.xCoords[Ue],y:Ae.yCoords[Ue]})}),we==null&&(we={x:ue.position("x"),y:ue.position("y")}),{x:we.x,y:we.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var $e=p.calcParentsWithoutChildren(E,A),Oe=A.filter(function(He){return He.css("display")=="none"});C.eles=A.not(Oe),A.nodes().not(":parent").not(Oe).layoutPositions(S,C,te),$e.length>0&&$e.forEach(function(He){He.position(te(He))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T})();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,x=v.nodes(),b=v.nodes(":parent"),T=new Map,k=new Map,S=new Map,C=[],E=[],A=[],M=[],L=[],P=[],N=[],_=[],I=void 0,O=1e8,D=1e-9,$=m.piTol,F=m.samplingType,z=m.nodeSeparation,H=void 0,B=function(){for(var K=0,de=0,X=!1;de=ke;){Ie=Fe[ke++];for(var Le=C[Ie],pt=0;ptKe&&(Ke=L[Ct],Be=Ct)}return Be},q=function(K){var de=void 0;if(K){de=Math.floor(Math.random()*I);for(var Fe=0;Fe=1)break;De=ze}for(var nt=0;nt=1)break;De=ze}for(var pt=0;pt0&&(de.isParent()?C[K].push(S.get(de.id())):C[K].push(de.id()))})});var Oe=function(K){var de=k.get(K),X=void 0;T.get(K).forEach(function(Fe){y.getElementById(Fe).isParent()?X=S.get(Fe):X=Fe,C[de].push(X),C[k.get(X)].push(K)})},He=!0,ue=!1,ce=void 0;try{for(var Te=T.keys()[Symbol.iterator](),ge;!(He=(ge=Te.next()).done);He=!0){var Ve=ge.value;Oe(Ve)}}catch(se){ue=!0,ce=se}finally{try{!He&&Te.return&&Te.return()}finally{if(ue)throw ce}}I=k.size;var we=void 0;if(I>2){H=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})()})})(v_)),v_.exports}var Kgr=Xgr();const Zgr=ky(Kgr);var Nye={L:"left",R:"right",T:"top",B:"bottom"},Dye={L:w(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:w(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:w(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:w(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},I8={L:w((t,e)=>t-e+2,"L"),R:w((t,e)=>t-2,"R"),T:w((t,e)=>t-e+2,"T"),B:w((t,e)=>t-2,"B")},Qgr=w(function(t){return tl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Oye=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),tl=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),hg=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),oie=w(function(t,e){const r=tl(t)&&hg(e),n=hg(t)&&tl(e);return r||n},"isArchitectureDirectionXY"),Jgr=w(function(t){const e=t[0],r=t[1],n=tl(e)&&hg(r),i=hg(e)&&tl(r);return n||i},"isArchitecturePairXY"),emr=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),Qj=w(function(t,e){const r=`${t}${e}`;return emr(r)?r:void 0},"getArchitectureDirectionPair"),tmr=w(function([t,e],r){const n=r[0],i=r[1];return tl(n)?hg(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:tl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),rmr=w(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),nmr=w(function(t,e){return oie(t,e)?"bend":tl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),imr=w(function(t){return t.type==="service"},"isArchitectureService"),amr=w(function(t){return t.type==="junction"},"isArchitectureJunction"),mUe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),yUe=w(t=>t.data(),"edgeData"),eb=w(t=>t.data(),"nodeData"),smr=xn.architecture,lT,vUe=(lT=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=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji,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="",wi()}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(imr)}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(amr)}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(!Oye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Oye(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=nmr(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(mUe(p,g),m)}if(f.lhsId===u){const m=Qj(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=Qj(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=w(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,x)=>{a.has(v)||(h.set(v,tmr([m,y],x)),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 Gi({...smr,...pr().architecture})}getConfigField(e){return this.getConfig()[e]}},w(lT,"ArchitectureDB"),lT),omr=w((t,e)=>{var r;Al(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"),bUe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("architecture",t);he.debug(e);const r=(n=bUe.parser)==null?void 0:n.yy;if(!(r instanceof vUe))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.");omr(e,r)},"parse")},lmr=w(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -4548,19 +4561,19 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[q]||q)+"'":me="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),nmr=rmr;function Zj(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}}w(Zj,"withSeededRandom");var Uv=w(t=>`${t}`,"wrapIcon"),K6={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Uv('')},server:{body:Uv('')},disk:{body:Uv('')},internet:{body:Uv('')},cloud:{body:Uv('')},unknown:T3e,blank:{body:Uv("")}}},imr=w(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:x}=pUe(u);let{x:b,y:T}=u[0].sourceEndpoint();const{x:k,y:S}=u[0].midpoint();let{x:C,y:E}=u[0].targetEndpoint();const A=i+4;if(p&&(tl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(tl(m)?C+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(tl(d)?b+=d==="L"?s:-s:T+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(tl(m)?C+=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},${T} L ${k},${S} L${C},${E} `).attr("class","edge").attr("id",`${n}-${ob(h,g,{prefix:"L"})}`),f){const N=tl(d)?L8[d](b,o):b-l,_=hg(d)?L8[d](T,o):T-l;P.insert("polygon").attr("points",Nye[d](o)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(y){const N=tl(m)?L8[m](C,o):C-l,_=hg(m)?L8[m](E,o):E-l;P.insert("polygon").attr("points",Nye[m](o)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(x){const N=aie(d,m)?"XY":tl(d)?"X":"Y";let _=0;N==="X"?_=Math.abs(b-C):N==="Y"?_=Math.abs(T-E)/1.5:_=Math.abs(b-C)/2;const I=P.append("g");if(await Fo(I,x,{useHtmlLabels:!1,width:_,classes:"architecture-service-label"},We()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+k+", "+S+")");else if(N==="Y")I.attr("transform","translate("+k+", "+S+") rotate(-90)");else if(N==="XY"){const O=Kj(d,m);if(O&&Ygr(O)){const D=I.node().getBoundingClientRect(),[$,F]=Kgr(O);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*$*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` +`,"getStyles"),cmr=lmr;function Jj(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}}w(Jj,"withSeededRandom");var Uv=w(t=>`${t}`,"wrapIcon"),Z6={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Uv('')},server:{body:Uv('')},disk:{body:Uv('')},internet:{body:Uv('')},cloud:{body:Uv('')},unknown:k3e,blank:{body:Uv("")}}},umr=w(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:x}=yUe(u);let{x:b,y:T}=u[0].sourceEndpoint();const{x:k,y:S}=u[0].midpoint();let{x:C,y:E}=u[0].targetEndpoint();const A=i+4;if(p&&(tl(d)?b+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(tl(m)?C+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(tl(d)?b+=d==="L"?s:-s:T+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(tl(m)?C+=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},${T} L ${k},${S} L${C},${E} `).attr("class","edge").attr("id",`${n}-${ob(h,g,{prefix:"L"})}`),f){const N=tl(d)?I8[d](b,o):b-l,_=hg(d)?I8[d](T,o):T-l;P.insert("polygon").attr("points",Dye[d](o)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(y){const N=tl(m)?I8[m](C,o):C-l,_=hg(m)?I8[m](E,o):E-l;P.insert("polygon").attr("points",Dye[m](o)).attr("transform",`translate(${N},${_})`).attr("class","arrow")}if(x){const N=oie(d,m)?"XY":tl(d)?"X":"Y";let _=0;N==="X"?_=Math.abs(b-C):N==="Y"?_=Math.abs(T-E)/1.5:_=Math.abs(b-C)/2;const I=P.append("g");if(await Fo(I,x,{useHtmlLabels:!1,width:_,classes:"architecture-service-label"},We()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+k+", "+S+")");else if(N==="Y")I.attr("transform","translate("+k+", "+S+") rotate(-90)");else if(N==="XY"){const O=Qj(d,m);if(O&&Jgr(O)){const D=I.node().getBoundingClientRect(),[$,F]=rmr(O);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*$*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` translate(${k}, ${S-D.height/2}) translate(${$*z.width/2}, ${F*z.height/2}) rotate(${-1*$*F*45}, 0, ${D.height/2}) - `)}}}}}))},"drawEdges"),amr=w(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=eb(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,x=g;if(h.icon){const b=y.append("g");b.html(`${await qf(h.icon,{height:a,width:a,fallbackPrefix:K6.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=a,x+=s/2-1-2}if(h.label){const b=y.append("g");await Fo(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},We()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),smr=w(async function(t,e,r,n){const i=We();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Fo(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 qf(a.icon,{height:o,width:o,fallbackPrefix:K6.prefix})}`);else if(a.iconText){l.html(`${await qf("blank",{height:o,width:o,fallbackPrefix:K6.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(Tn(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"),omr=w(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");KK([{name:K6.prefix,icons:K6}]);ld.use(Ggr);function yUe(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"})})}w(yUe,"addServices");function vUe(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"})})}w(vUe,"addJunctions");function bUe(t,e){e.nodes().map(r=>{const n=eb(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)+")")})}w(bUe,"positionNodes");function xUe(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"})})}w(xUe,"addGroups");function wUe(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=aie(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})})}w(wUe,"addEdges");function TUe(t,e,r,n=[]){const i=w((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let x=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let T=0;T{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var k;const x=((k=t.getNode(v))==null?void 0:k.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const T=g.get(m)??new Map;g.has(m)||g.set(m,T);for(const S of[b,T]){const C=S.get(x)??[];S.has(x)||S.set(x,C),C.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=w(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}}w(TUe,"getAlignments");function kUe(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=w(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(([x,b])=>{const T=l([v[0]+b[0],v[1]+b[1]]),k=d.get(T);if(k&&!p[T]){if(f.push(T),o.has(`${y}|${k}`))return;n.push({[$ye[x]]:k,[$ye[Ugr(x)]]:y,gap:a*i})}})}}}}),n}w(kUe,"getRelativeConstraints");function CUe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=bt("body").append("div").attr("id","cy").attr("style","display:none"),u=ld({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(),xUe(r,u),yUe(t,u,i),vUe(e,u,i),wUe(n,u);const h=i.getLayoutHints(),d=TUe(i,a,s,h),f=kUe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),x=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[T,k]=b.connectedNodes(),{parent:S}=eb(T),{parent:C}=eb(k);return S===C?g:m},edgeElasticity(b){const[T,k]=b.connectedNodes(),{parent:S}=eb(T),{parent:C}=eb(k);return S===C?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});x.one("layoutstop",()=>{var T;function b(k,S,C,E){let A,M;const{x:L,y:P}=k,{x:N,y:_}=S;M=(E-P+(L-C)*(P-_)/(L-N))/Math.sqrt(1+Math.pow((P-_)/(L-N),2)),A=Math.sqrt(Math.pow(E-P,2)+Math.pow(C-L,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(N-L,2)+Math.pow(_-P,2));A=A/I;let O=(N-L)*(E-P)-(_-P)*(C-L);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}let D=(N-L)*(C-L)+(_-P)*(E-P);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}return M=Math.abs(M)*O,A=A*D,{distances:M,weights:A}}w(b,"getSegmentWeights"),u.startBatch();for(const k of Object.values(u.edges()))if((T=k.data)!=null&&T.call(k)){const{x:S,y:C}=k.source().position(),{x:E,y:A}=k.target().position();if(S!==E&&C!==A){const M=k.sourceEndpoint(),L=k.targetEndpoint(),{sourceDir:P}=pUe(k),[N,_]=hg(P)?[M.x,L.y]:[L.x,M.y],{weights:I,distances:O}=b(M,L,N,_);k.style("segment-distances",O),k.style("segment-weights",I)}}u.endBatch(),Zj(v,()=>x.run())});try{Zj(v,()=>x.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=>{he.info("Ready",b),o(u)})})}w(CUe,"layoutArchitecture");var lmr=w(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=Po(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 smr(i,f,a,e),omr(i,f,s,e);const g=await CUe(a,s,o,l,i,u);await imr(d,g,i,e),await amr(p,g,i,e),bUe(i,g),R3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),cmr={draw:lmr},umr={parser:mUe,get db(){return new gUe},renderer:cmr,styles:nmr};const hmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:umr},Symbol.toStringTag,{value:"Module"}));var SUe="position frame",EUe="frame positioned",Qj="position relation",AUe="relation positioned",dmr=w(function(t){he.debug("options str",t)},"setOptions"),fmr=w(function(){return{}},"getOptions"),pmr=w(function(){RUe(),wi()},"clear");function RUe(){sie={}}w(RUe,"reset");var gmr=xn.eventmodeling,mmr=w(()=>Gi({...gmr,...pr().eventmodeling}),"getConfig"),sie={};function _Ue(){let t=ymr;const{ast:e}=sie,r=oie();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=OUe(n,e.dataEntities,r);t=w_(t,{$kind:SUe,index:i,frame:n,textProps:a});let s;VUe(n)?(he.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=w_(t,{$kind:Qj,index:i,frame:n,sourceFrame:o})})):t=w_(t,{$kind:Qj,index:i,frame:n})}),t={...t,sortedSwimlanesArray:lie(t.swimlanes)},t}w(_Ue,"getState");function MUe(t){sie.ast=t}w(MUe,"setAst");var Gn={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 oie(){return Gn}w(oie,"getDiagramProps");var ymr={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function LUe(t){const e=t.split(".");if(e.length===2)return e[0]}w(LUe,"extractNamespace");function IUe(t){const e=t.split(".");return e.length===2?e[1]:t}w(IUe,"extractName");function $Ue(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w($Ue,"findSwimlaneByNamespace");function x_(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}w(x_,"findNextAvailableIndex");function NUe(t,e){const r=LUe(t.entityIdentifier),n=$Ue(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Gn.labelUiAutomation}:r?{index:x_(e,0,100),label:Gn.labelUiAutomationPrefix+r}:{index:0,label:Gn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Gn.labelCommandReadModel}:r?{index:x_(e,100,200),label:Gn.labelCommandReadModelPrefix+r}:{index:100,label:Gn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Gn.labelEvents}:r?{index:x_(e,200,300),label:Gn.labelEventsPrefix+r}:{index:200,label:Gn.labelEvents}}}w(NUe,"calculateSwimlaneProps");function DUe(t){const{themeVariables:e}=pr();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"}}}w(DUe,"calculateEntityVisualProps");function OUe(t,e,r){const n=pr(),i=Tn(IUe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${CC(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Tn(a,n),a=CC(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=Tn(a,n),a=CC(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=I$(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return he.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}w(OUe,"calculateTextProps");function PUe(t,e){const r=e,n=DUe(r.frame),i={width:r.textProps.width+2*Gn.boxTextPadding,height:r.textProps.height+2*Gn.boxTextPadding};return[{$kind:EUe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(PUe,"decidePositionFrame");function BUe(t,e,r){return e===void 0?Gn.contentStartX:e.index===t.index&&t.r?t.r+Gn.boxPadding:r===void 0?Gn.contentStartX:r.r-Gn.boxOverlap+Gn.boxPadding}w(BUe,"calculateX");function FUe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(FUe,"calculateMaxRight");function lie(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(lie,"sortedSwimlanesArray");function zUe(t,e){const r=e,n=NUe(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*Gn.swimlaneMinHeight+Gn.swimlaneGap,height:Gn.swimlaneMinHeight,maxHeight:Gn.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(Gn.boxMinWidth,Math.min(Gn.boxMaxWidth,r.dimension.width))+2*Gn.boxPadding,height:Math.max(Gn.boxMinHeight,Math.min(Gn.boxMaxHeight,r.dimension.height))+2*Gn.boxPadding},l=BUe(i,s,a),u=l+o.width+Gn.boxPadding,h=FUe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Gn.swimlaneMinHeight,i.maxHeight)+2*Gn.swimlanePadding;const d={x:l,y:Gn.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=lie(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}w(VUe,"hasSourceFrame");function Jj(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(Jj,"findBoxByFrame");function WUe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}w(WUe,"findBoxByLineIndex");function qUe(t,e){const r=e;if(JVe(r.frame)||HUe(r.index,r.frame))return[];const n=Jj(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=Jj(t.boxes,r.sourceFrame):i=WUe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:AUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(qUe,"decidePositionRelation");function GUe(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]}}w(GUe,"evolveRelationPositioned");var vmr={[SUe]:PUe,[Qj]:qUe},bmr={[EUe]:zUe,[AUe]:GUe};function UUe(t,e){const r=vmr[e.$kind];if(r==null)return[];const n=r(t,e);return he.debug("decided events",n),n}w(UUe,"decide");function YUe(t,e){const r=e.reduce((n,i)=>{const a=bmr[i.$kind];return a==null?n:a(n,i)},t);return he.debug("evolve events",{state:t,newState:r,events:e}),r}w(YUe,"evolve");function w_(t,e){const r=UUe(t,e);return YUe(t,r)}w(w_,"dispatch");var eX={getConfig:mmr,setOptions:dmr,getOptions:fmr,clear:pmr,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,setDiagramTitle:qi,getDiagramTitle:Di,setAst:MUe,getDiagramProps:oie,getState:_Ue},xmr={parse:w(async t=>{const e=await xu("eventmodeling",t);he.debug(e),eX.setAst(e),Al(e,eX)},"parse")},_H=We(),wmr=_H==null?void 0:_H.eventmodeling;function jUe(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)}}w(jUe,"renderD3Box");function XUe(t,e){return t>e}w(XUe,"dirUpwards");function KUe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=XUe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;he.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}`)}}w(KUe,"renderD3Relation");function ZUe(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)}}w(ZUe,"renderD3Swimlane");var Tmr=w(function(t,e,r,n){if(he.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!wmr)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=We(),o=bt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(ZUe(o,u.maxR,l,a)),u.boxes.forEach(jUe(o,l)),u.relations.forEach(KUe(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),fK(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),kmr={draw:Tmr},Cmr=w(t=>"","getStyles"),Smr=Cmr,Emr={parser:xmr,db:eX,renderer:kmr,styles:Smr};const Amr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Emr},Symbol.toStringTag,{value:"Module"}));var tX=(function(){var t=w(function(v,x,b,T){for(b=b||{},T=v.length;T--;b[v[T]]=x);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:w(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:w(function(x,b,T,k,S,C,E){var A=C.length-1;switch(S){case 6:case 7:return k;case 15:k.addNode(C[A-1].length,C[A].trim());break;case 16:k.addNode(0,C[A].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:w(function(x,b){if(b.recoverable)this.trace(x);else{var T=new Error(x);throw T.hash=b,T}},"parseError"),parse:w(function(x){var b=this,T=[0],k=[],S=[null],C=[],E=this.table,A="",M=0,L=0,P=2,N=1,_=C.slice.call(arguments,1),I=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);I.setInput(x,O.yy),O.yy.lexer=I,O.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var $=I.yylloc;C.push($);var F=I.options&&I.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ee){T.length=T.length-2*ee,S.length=S.length-ee,C.length=C.length-ee}w(z,"popStack");function H(){var ee;return ee=k.pop()||I.lex()||N,typeof ee!="number"&&(ee instanceof Array&&(k=ee,ee=k.pop()),ee=b.symbols_[ee]||ee),ee}w(H,"lex");for(var B,V,q,G,Q={},j,ae,Z,J;;){if(V=T[T.length-1],this.defaultActions[V]?q=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=H()),q=E[V]&&E[V][B]),typeof q>"u"||!q.length||!q[0]){var re="";J=[];for(j in E[V])this.terminals_[j]&&j>P&&J.push("'"+this.terminals_[j]+"'");I.showPosition?re="Parse error on line "+(M+1)+`: + `)}}}}}))},"drawEdges"),hmr=w(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=eb(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,x=g;if(h.icon){const b=y.append("g");b.html(`${await qf(h.icon,{height:a,width:a,fallbackPrefix:Z6.prefix})}`),b.attr("transform","translate("+(v+l+1)+", "+(x+l+1)+")"),v+=a,x+=s/2-1-2}if(h.label){const b=y.append("g");await Fo(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},We()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(x+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),dmr=w(async function(t,e,r,n){const i=We();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await Fo(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 qf(a.icon,{height:o,width:o,fallbackPrefix:Z6.prefix})}`);else if(a.iconText){l.html(`${await qf("blank",{height:o,width:o,fallbackPrefix:Z6.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(Tn(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"),fmr=w(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");QK([{name:Z6.prefix,icons:Z6}]);cd.use(Zgr);function xUe(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"})})}w(xUe,"addServices");function wUe(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"})})}w(wUe,"addJunctions");function TUe(t,e){e.nodes().map(r=>{const n=eb(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)+")")})}w(TUe,"positionNodes");function kUe(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"})})}w(kUe,"addGroups");function CUe(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=oie(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})})}w(CUe,"addEdges");function SUe(t,e,r,n=[]){const i=w((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let x=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let T=0;T{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var k;const x=((k=t.getNode(v))==null?void 0:k.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const T=g.get(m)??new Map;g.has(m)||g.set(m,T);for(const S of[b,T]){const C=S.get(x)??[];S.has(x)||S.set(x,C),C.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=w(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}}w(SUe,"getAlignments");function EUe(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=w(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(([x,b])=>{const T=l([v[0]+b[0],v[1]+b[1]]),k=d.get(T);if(k&&!p[T]){if(f.push(T),o.has(`${y}|${k}`))return;n.push({[Nye[x]]:k,[Nye[Qgr(x)]]:y,gap:a*i})}})}}}}),n}w(EUe,"getRelativeConstraints");function AUe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=bt("body").append("div").attr("id","cy").attr("style","display:none"),u=cd({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(),kUe(r,u),xUe(t,u,i),wUe(e,u,i),CUe(n,u);const h=i.getLayoutHints(),d=SUe(i,a,s,h),f=EUe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),x=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[T,k]=b.connectedNodes(),{parent:S}=eb(T),{parent:C}=eb(k);return S===C?g:m},edgeElasticity(b){const[T,k]=b.connectedNodes(),{parent:S}=eb(T),{parent:C}=eb(k);return S===C?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});x.one("layoutstop",()=>{var T;function b(k,S,C,E){let A,M;const{x:L,y:P}=k,{x:N,y:_}=S;M=(E-P+(L-C)*(P-_)/(L-N))/Math.sqrt(1+Math.pow((P-_)/(L-N),2)),A=Math.sqrt(Math.pow(E-P,2)+Math.pow(C-L,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(N-L,2)+Math.pow(_-P,2));A=A/I;let O=(N-L)*(E-P)-(_-P)*(C-L);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}let D=(N-L)*(C-L)+(_-P)*(E-P);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}return M=Math.abs(M)*O,A=A*D,{distances:M,weights:A}}w(b,"getSegmentWeights"),u.startBatch();for(const k of Object.values(u.edges()))if((T=k.data)!=null&&T.call(k)){const{x:S,y:C}=k.source().position(),{x:E,y:A}=k.target().position();if(S!==E&&C!==A){const M=k.sourceEndpoint(),L=k.targetEndpoint(),{sourceDir:P}=yUe(k),[N,_]=hg(P)?[M.x,L.y]:[L.x,M.y],{weights:I,distances:O}=b(M,L,N,_);k.style("segment-distances",O),k.style("segment-weights",I)}}u.endBatch(),Jj(v,()=>x.run())});try{Jj(v,()=>x.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=>{he.info("Ready",b),o(u)})})}w(AUe,"layoutArchitecture");var pmr=w(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=Po(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 dmr(i,f,a,e),fmr(i,f,s,e);const g=await AUe(a,s,o,l,i,u);await umr(d,g,i,e),await hmr(p,g,i,e),TUe(i,g),R3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),gmr={draw:pmr},mmr={parser:bUe,get db(){return new vUe},renderer:gmr,styles:cmr};const ymr=Object.freeze(Object.defineProperty({__proto__:null,diagram:mmr},Symbol.toStringTag,{value:"Module"}));var RUe="position frame",_Ue="frame positioned",eX="position relation",MUe="relation positioned",vmr=w(function(t){he.debug("options str",t)},"setOptions"),bmr=w(function(){return{}},"getOptions"),xmr=w(function(){LUe(),wi()},"clear");function LUe(){lie={}}w(LUe,"reset");var wmr=xn.eventmodeling,Tmr=w(()=>Gi({...wmr,...pr().eventmodeling}),"getConfig"),lie={};function IUe(){let t=kmr;const{ast:e}=lie,r=cie();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=FUe(n,e.dataEntities,r);t=T_(t,{$kind:RUe,index:i,frame:n,textProps:a});let s;GUe(n)?(he.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=T_(t,{$kind:eX,index:i,frame:n,sourceFrame:o})})):t=T_(t,{$kind:eX,index:i,frame:n})}),t={...t,sortedSwimlanesArray:uie(t.swimlanes)},t}w(IUe,"getState");function $Ue(t){lie.ast=t}w($Ue,"setAst");var Gn={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 cie(){return Gn}w(cie,"getDiagramProps");var kmr={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function NUe(t){const e=t.split(".");if(e.length===2)return e[0]}w(NUe,"extractNamespace");function DUe(t){const e=t.split(".");return e.length===2?e[1]:t}w(DUe,"extractName");function OUe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(OUe,"findSwimlaneByNamespace");function w_(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}w(w_,"findNextAvailableIndex");function PUe(t,e){const r=NUe(t.entityIdentifier),n=OUe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Gn.labelUiAutomation}:r?{index:w_(e,0,100),label:Gn.labelUiAutomationPrefix+r}:{index:0,label:Gn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Gn.labelCommandReadModel}:r?{index:w_(e,100,200),label:Gn.labelCommandReadModelPrefix+r}:{index:100,label:Gn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Gn.labelEvents}:r?{index:w_(e,200,300),label:Gn.labelEventsPrefix+r}:{index:200,label:Gn.labelEvents}}}w(PUe,"calculateSwimlaneProps");function BUe(t){const{themeVariables:e}=pr();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"}}}w(BUe,"calculateEntityVisualProps");function FUe(t,e,r){const n=pr(),i=Tn(DUe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${CC(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Tn(a,n),a=CC(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=Tn(a,n),a=CC(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=N$(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return he.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}w(FUe,"calculateTextProps");function zUe(t,e){const r=e,n=BUe(r.frame),i={width:r.textProps.width+2*Gn.boxTextPadding,height:r.textProps.height+2*Gn.boxTextPadding};return[{$kind:_Ue,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(zUe,"decidePositionFrame");function HUe(t,e,r){return e===void 0?Gn.contentStartX:e.index===t.index&&t.r?t.r+Gn.boxPadding:r===void 0?Gn.contentStartX:r.r-Gn.boxOverlap+Gn.boxPadding}w(HUe,"calculateX");function VUe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(VUe,"calculateMaxRight");function uie(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(uie,"sortedSwimlanesArray");function WUe(t,e){const r=e,n=PUe(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*Gn.swimlaneMinHeight+Gn.swimlaneGap,height:Gn.swimlaneMinHeight,maxHeight:Gn.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(Gn.boxMinWidth,Math.min(Gn.boxMaxWidth,r.dimension.width))+2*Gn.boxPadding,height:Math.max(Gn.boxMinHeight,Math.min(Gn.boxMaxHeight,r.dimension.height))+2*Gn.boxPadding},l=HUe(i,s,a),u=l+o.width+Gn.boxPadding,h=VUe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(Gn.swimlaneMinHeight,i.maxHeight)+2*Gn.swimlanePadding;const d={x:l,y:Gn.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=uie(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}w(GUe,"hasSourceFrame");function tX(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(tX,"findBoxByFrame");function UUe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}w(UUe,"findBoxByLineIndex");function YUe(t,e){const r=e;if(rWe(r.frame)||qUe(r.index,r.frame))return[];const n=tX(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=tX(t.boxes,r.sourceFrame):i=UUe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:MUe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(YUe,"decidePositionRelation");function jUe(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]}}w(jUe,"evolveRelationPositioned");var Cmr={[RUe]:zUe,[eX]:YUe},Smr={[_Ue]:WUe,[MUe]:jUe};function XUe(t,e){const r=Cmr[e.$kind];if(r==null)return[];const n=r(t,e);return he.debug("decided events",n),n}w(XUe,"decide");function KUe(t,e){const r=e.reduce((n,i)=>{const a=Smr[i.$kind];return a==null?n:a(n,i)},t);return he.debug("evolve events",{state:t,newState:r,events:e}),r}w(KUe,"evolve");function T_(t,e){const r=XUe(t,e);return KUe(t,r)}w(T_,"dispatch");var rX={getConfig:Tmr,setOptions:vmr,getOptions:bmr,clear:xmr,setAccTitle:$i,getAccTitle:Yi,getAccDescription:Xi,setAccDescription:ji,setDiagramTitle:qi,getDiagramTitle:Di,setAst:$Ue,getDiagramProps:cie,getState:IUe},Emr={parse:w(async t=>{const e=await xu("eventmodeling",t);he.debug(e),rX.setAst(e),Al(e,rX)},"parse")},LH=We(),Amr=LH==null?void 0:LH.eventmodeling;function ZUe(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)}}w(ZUe,"renderD3Box");function QUe(t,e){return t>e}w(QUe,"dirUpwards");function JUe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=QUe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;he.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}`)}}w(JUe,"renderD3Relation");function eYe(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)}}w(eYe,"renderD3Swimlane");var Rmr=w(function(t,e,r,n){if(he.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!Amr)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=We(),o=bt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(eYe(o,u.maxR,l,a)),u.boxes.forEach(ZUe(o,l)),u.relations.forEach(JUe(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),gK(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),_mr={draw:Rmr},Mmr=w(t=>"","getStyles"),Lmr=Mmr,Imr={parser:Emr,db:rX,renderer:_mr,styles:Lmr};const $mr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Imr},Symbol.toStringTag,{value:"Module"}));var nX=(function(){var t=w(function(v,x,b,T){for(b=b||{},T=v.length;T--;b[v[T]]=x);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:w(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:w(function(x,b,T,k,S,C,E){var A=C.length-1;switch(S){case 6:case 7:return k;case 15:k.addNode(C[A-1].length,C[A].trim());break;case 16:k.addNode(0,C[A].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:w(function(x,b){if(b.recoverable)this.trace(x);else{var T=new Error(x);throw T.hash=b,T}},"parseError"),parse:w(function(x){var b=this,T=[0],k=[],S=[null],C=[],E=this.table,A="",M=0,L=0,P=2,N=1,_=C.slice.call(arguments,1),I=Object.create(this.lexer),O={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(O.yy[D]=this.yy[D]);I.setInput(x,O.yy),O.yy.lexer=I,O.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var $=I.yylloc;C.push($);var F=I.options&&I.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ee){T.length=T.length-2*ee,S.length=S.length-ee,C.length=C.length-ee}w(z,"popStack");function H(){var ee;return ee=k.pop()||I.lex()||N,typeof ee!="number"&&(ee instanceof Array&&(k=ee,ee=k.pop()),ee=b.symbols_[ee]||ee),ee}w(H,"lex");for(var B,V,q,G,Q={},j,ae,Z,J;;){if(V=T[T.length-1],this.defaultActions[V]?q=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=H()),q=E[V]&&E[V][B]),typeof q>"u"||!q.length||!q[0]){var re="";J=[];for(j in E[V])this.terminals_[j]&&j>P&&J.push("'"+this.terminals_[j]+"'");I.showPosition?re="Parse error on line "+(M+1)+`: `+I.showPosition()+` Expecting `+J.join(", ")+", got '"+(this.terminals_[B]||B)+"'":re="Parse error on line "+(M+1)+": Unexpected "+(B==N?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(re,{text:I.match,token:this.terminals_[B]||B,line:I.yylineno,loc:$,expected:J})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(q[0]){case 1:T.push(B),S.push(I.yytext),C.push(I.yylloc),T.push(q[1]),B=null,L=I.yyleng,A=I.yytext,M=I.yylineno,$=I.yylloc;break;case 2:if(ae=this.productions_[q[1]][1],Q.$=S[S.length-ae],Q._$={first_line:C[C.length-(ae||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(ae||1)].first_column,last_column:C[C.length-1].last_column},F&&(Q._$.range=[C[C.length-(ae||1)].range[0],C[C.length-1].range[1]]),G=this.performAction.apply(Q,[A,L,M,O.yy,q[1],S,C].concat(_)),typeof G<"u")return G;ae&&(T=T.slice(0,-1*ae*2),S=S.slice(0,-1*ae),C=C.slice(0,-1*ae)),T.push(this.productions_[q[1]][0]),S.push(Q.$),C.push(Q._$),Z=E[T[T.length-2]][T[T.length-1]],T.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:w(function(b,T){if(this.yy.parser)this.yy.parser.parseError(b,T);else throw new Error(b)},"parseError"),setInput:w(function(x,b){return this.yy=b||this.yy||{},this._input=x,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:w(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var b=x.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),x},"input"),unput:w(function(x){var b=x.length,T=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;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),T.length-1&&(this.yylineno-=T.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:T?(T.length===k.length?this.yylloc.first_column:0)+k[k.length-T.length].length-T[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:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(x){this.unput(this.match.slice(x))},"less"),pastInput:w(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var x=this.pastInput(),b=new Array(x.length+1).join("-");return x+this.upcomingInput()+` `+b+"^"},"showPosition"),test_match:w(function(x,b){var T,k,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))),k=x[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+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],T=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var C in S)this[C]=S[C];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,b,T,k;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),C=0;Cb[0].length)){if(b=T,k=C,this.options.backtrack_lexer){if(x=this.test_match(T,S[C]),x!==!1)return x;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(x=this.test_match(b,S[k]),x!==!1?x:!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:w(function(){var b=this.next();return b||this.lex()},"lex"),begin:w(function(b){this.conditionStack.push(b)},"begin"),popState:w(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:w(function(b){this.begin(b)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(b,T,k,S){switch(k){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 w(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tX.parser=tX;var Rmr=tX,cT,_mr=(cT=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,wi()}getRoot(){return this.root}addNode(e,r){const n=Ft.sanitizeText(r,We());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],qi(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 Yi()}setAccTitle(e){$i(e)}getAccDescription(){return Xi()}setAccDescription(e){ji(e)}getDiagramTitle(){return Di()}setDiagramTitle(e){qi(e)}},w(cT,"IshikawaDB"),cT),Mmr=14,Yv=250,Lmr=30,Imr=60,$mr=5,QUe=82*Math.PI/180,Oye=Math.cos(QUe),Pye=Math.sin(QUe),Bye=w((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;_a(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),Nmr=w((t,e,r,n)=>{var O,D;const a=n.db.getRoot();if(!a)return;const s=We(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=c0(s.fontSize)[0]??Mmr,d=o==="handDrawn",f=a.children??[],p=((O=s.ishikawa)==null?void 0:O.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=Po(e),y=m.append("g").attr("class","ishikawa"),v=d?lr.svg(m.node()):void 0,x=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 T=0,k=Yv;const S=d?void 0:_b(y,T,k,T,k,"ishikawa-spine");if(Dmr(y,T,k,a.text,h,x),!f.length){d&&_b(y,T,k,T,k,"ishikawa-spine",x),Bye(m,p,g);return}T-=20;const C=f.filter(($,F)=>F%2===0),E=f.filter(($,F)=>F%2===1),A=Fye(C),M=Fye(E),L=A.total+M.total;let P=Yv,N=Yv;if(L>0){const $=Yv*2,F=Yv*.3;P=Math.max(F,$*(A.total/L)),N=Math.max(F,$*(M.total/L))}const _=h*2;P=Math.max(P,A.max*_),N=Math.max(N,M.max*_),k=Math.max(P,Yv),S&&S.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const I=Math.ceil(f.length/2);for(let $=0;$Math.min(z,H.getBBox().x),1/0)}if(d)_b(y,T,k,0,k,"ishikawa-spine",x);else{S.attr("x1",T);const $=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",$)}Bye(m,p,g)},"draw"),Fye=w(t=>{const e=w(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"),Dmr=w((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=KI(o,JUe(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"),Omr=w((t,e)=>{const r=[],n=[],i=w((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:JUe(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"),Pmr=w((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=KI(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"),MH=w((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"),Bmr=w((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-Oye*u,d=Pye*u*i,f=r+h,p=n+d;if(_b(t,r,n,f,p,"ishikawa-branch",o),o&&MH(t,r,n,r-f,n-p,o),Pmr(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Omr(l,i),y=g.length,v=new Array(y);for(const[S,C]of m.entries())v[C]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-Oye,T=Pye*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,C]of g.entries()){const E=v[S],A=x.get(C.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let L=0,P=0,N=0;if(C.depth%2===0){const _=A.y1-A.y0;L=zye(A.x0,A.x1,_?(E-A.y0)/_:.5),P=E,N=L-(C.childCount>0?Imr+C.childCount*$mr:Lmr),_b(M,L,E,N,E,"ishikawa-sub-branch",o),o&&MH(M,L,E,1,0,o),KI(M,C.text,N,E,"ishikawa-label align","end",s)}else{const _=A.childrenDrawn++;L=zye(A.x0,A.x1,(A.childCount-_)/(A.childCount+1)),P=A.y0,N=L+b*((E-P)/T),_b(M,L,P,N,E,"ishikawa-sub-branch",o),o&&MH(M,L,P,L-N,P-E,o),KI(M,C.text,N,E,k,"end",s)}C.childCount>0&&x.set(S,{x0:L,y0:P,x1:N,y1:E,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),Fmr=w(t=>t.split(/|\n/),"splitLines"),JUe=w((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"),KI=w((t,e,r,n,i,a,s)=>{const o=Fmr(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"),zye=w((t,e,r)=>t+(e-t)*r,"lerp"),_b=w((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"),zmr={draw:Nmr},Hmr=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var b=this.next();return b||this.lex()},"lex"),begin:w(function(b){this.conditionStack.push(b)},"begin"),popState:w(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:w(function(b){this.begin(b)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(b,T,k,S){switch(k){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 w(y,"Parser"),y.prototype=g,g.Parser=y,new y})();nX.parser=nX;var Nmr=nX,cT,Dmr=(cT=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,wi()}getRoot(){return this.root}addNode(e,r){const n=Ft.sanitizeText(r,We());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],qi(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 Yi()}setAccTitle(e){$i(e)}getAccDescription(){return Xi()}setAccDescription(e){ji(e)}getDiagramTitle(){return Di()}setDiagramTitle(e){qi(e)}},w(cT,"IshikawaDB"),cT),Omr=14,Yv=250,Pmr=30,Bmr=60,Fmr=5,tYe=82*Math.PI/180,Pye=Math.cos(tYe),Bye=Math.sin(tYe),Fye=w((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;_a(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),zmr=w((t,e,r,n)=>{var O,D;const a=n.db.getRoot();if(!a)return;const s=We(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=c0(s.fontSize)[0]??Omr,d=o==="handDrawn",f=a.children??[],p=((O=s.ishikawa)==null?void 0:O.diagramPadding)??20,g=((D=s.ishikawa)==null?void 0:D.useMaxWidth)??!1,m=Po(e),y=m.append("g").attr("class","ishikawa"),v=d?lr.svg(m.node()):void 0,x=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 T=0,k=Yv;const S=d?void 0:_b(y,T,k,T,k,"ishikawa-spine");if(Hmr(y,T,k,a.text,h,x),!f.length){d&&_b(y,T,k,T,k,"ishikawa-spine",x),Fye(m,p,g);return}T-=20;const C=f.filter(($,F)=>F%2===0),E=f.filter(($,F)=>F%2===1),A=zye(C),M=zye(E),L=A.total+M.total;let P=Yv,N=Yv;if(L>0){const $=Yv*2,F=Yv*.3;P=Math.max(F,$*(A.total/L)),N=Math.max(F,$*(M.total/L))}const _=h*2;P=Math.max(P,A.max*_),N=Math.max(N,M.max*_),k=Math.max(P,Yv),S&&S.attr("y1",k).attr("y2",k),y.select(".ishikawa-head-group").attr("transform",`translate(0,${k})`);const I=Math.ceil(f.length/2);for(let $=0;$Math.min(z,H.getBBox().x),1/0)}if(d)_b(y,T,k,0,k,"ishikawa-spine",x);else{S.attr("x1",T);const $=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",$)}Fye(m,p,g)},"draw"),zye=w(t=>{const e=w(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"),Hmr=w((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=QI(o,rYe(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"),Vmr=w((t,e)=>{const r=[],n=[],i=w((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:rYe(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"),Wmr=w((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=QI(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"),IH=w((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"),qmr=w((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-Pye*u,d=Bye*u*i,f=r+h,p=n+d;if(_b(t,r,n,f,p,"ishikawa-branch",o),o&&IH(t,r,n,r-f,n-p,o),Wmr(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=Vmr(l,i),y=g.length,v=new Array(y);for(const[S,C]of m.entries())v[C]=n+d*((S+1)/(y+1));const x=new Map;x.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-Pye,T=Bye*i,k=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,C]of g.entries()){const E=v[S],A=x.get(C.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let L=0,P=0,N=0;if(C.depth%2===0){const _=A.y1-A.y0;L=Hye(A.x0,A.x1,_?(E-A.y0)/_:.5),P=E,N=L-(C.childCount>0?Bmr+C.childCount*Fmr:Pmr),_b(M,L,E,N,E,"ishikawa-sub-branch",o),o&&IH(M,L,E,1,0,o),QI(M,C.text,N,E,"ishikawa-label align","end",s)}else{const _=A.childrenDrawn++;L=Hye(A.x0,A.x1,(A.childCount-_)/(A.childCount+1)),P=A.y0,N=L+b*((E-P)/T),_b(M,L,P,N,E,"ishikawa-sub-branch",o),o&&IH(M,L,P,L-N,P-E,o),QI(M,C.text,N,E,k,"end",s)}C.childCount>0&&x.set(S,{x0:L,y0:P,x1:N,y1:E,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),Gmr=w(t=>t.split(/|\n/),"splitLines"),rYe=w((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"),QI=w((t,e,r,n,i,a,s)=>{const o=Gmr(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"),Hye=w((t,e,r)=>t+(e-t)*r,"lerp"),_b=w((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"),Umr={draw:zmr},Ymr=w(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -4623,18 +4636,18 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[B]||B)+"'":re="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),Vmr=Hmr,Wmr={parser:Rmr,get db(){return new _mr},renderer:zmr,styles:Vmr};const qmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Wmr},Symbol.toStringTag,{value:"Module"})),eYe=1e-10;function DO(t,e){const r=Umr(t),n=r.filter(o=>Gmr(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=rYe(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+=rX(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-eYe,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 Gmr(t,e){return e.every(r=>Kl(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 rX(t,n)+rX(e,i)}function tYe(t,e){const r=Kl(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 rYe(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 Ymr(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)nX(e))}function Mb(t,e){let r=0;for(let n=0;nk.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),T=e.slice();for(let k=0;k{const A=E.slice();return A.fx=E.fx,A.id=E.id,A});C.sort((E,A)=>E.id-A.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(x.fx>S.fx?(pf(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(pf(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Mb(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 Xmr(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(),aX(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fcie(t,e,n)-r,0,t+e)}function Kmr(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=sX(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 Qmr(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 Jmr(t,e={}){let r=t1r(t,e);const n=e.lossFunction||k3;if(t.length>=8){const i=e1r(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>Qmr(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+aYe>=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 sYe(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=cie(o.radius,l.radius,Kl(o,l))}else i=DO(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 r1r(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&&Kl(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 n1r(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 oX(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 oYe(t,e,r){e==null&&(e=Math.PI/2);let n=uYe(t).map(u=>Object.assign({},u));const i=n1r(n);for(const u of i){r1r(u,e,r);const h=oX(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 cYe(t){const e={};for(const r of t)e[r.setid]=r;return e}function uYe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function i1r(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"],x=0,b=function(C){if(C in y)return y[C];var E=y[C]=v[x];return x+=1,x>=v.length&&(x=0),E},T=iYe,k=k3;function S(C){let E=C.datum();const A=new Set;E.forEach(j=>{j.size==0&&j.sets.length==1&&A.add(j.sets[0])}),E=E.filter(j=>!j.sets.some(ae=>A.has(ae)));let M={},L={};if(E.length>0){let j=T(E,{lossFunction:k,distinct:p});o&&(j=oYe(j,s,f)),M=lYe(j,r,n,i,l),L=dYe(M,E,m)}const P={};E.forEach(j=>{j.label&&(P[j.sets]=j.label)});function N(j){if(j.sets in P)return P[j.sets];if(j.sets.length==1)return""+j.sets[0]}C.selectAll("svg").data([M]).enter().append("svg");const _=C.select("svg");e?_.attr("viewBox",`0 0 ${r} ${n}`):_.attr("width",r).attr("height",n);const I={};let O=!1;_.selectAll(".venn-area path").each(function(j){const ae=this.getAttribute("d");j.sets.length==1&&ae&&!p&&(O=!0,I[j.sets[0]]=o1r(ae))});function D(j){return ae=>{const Z=j.sets.map(J=>{let re=I[J],ee=M[J];return re||(re={x:r/2,y:n/2,radius:1}),ee||(ee={x:r/2,y:n/2,radius:1}),{x:re.x*(1-ae)+ee.x*ae,y:re.y*(1-ae)+ee.y*ae,radius:re.radius*(1-ae)+ee.radius*ae}});return Vye(Z,g)}}const $=_.selectAll(".venn-area").data(E,j=>j.sets),F=$.enter().append("g").attr("class",j=>`venn-area venn-${j.sets.length==1?"circle":"intersection"}${j.colour||j.color?" venn-coloured":""}`).attr("data-venn-sets",j=>j.sets.join("_")),z=F.append("path"),H=F.append("text").attr("class","label").text(j=>N(j)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(j=>j.sets.length==1).style("fill",j=>j.colour?j.colour:j.color?j.color:b(j.sets)).style("fill-opacity",".25"),H.style("fill",j=>j.colour||j.color?"#FFF":t.textFill?t.textFill:j.sets.length==1?b(j.sets):"#444"));function B(j){return typeof j.transition=="function"?j.transition("venn").duration(a):j}let V=C;O&&typeof V.transition=="function"?(V=B(C),V.selectAll("path").attrTween("d",D)):V.selectAll("path").attr("d",j=>Vye(j.sets.map(ae=>M[ae])),g);const q=V.selectAll("text").filter(j=>j.sets in L).text(j=>N(j)).attr("x",j=>Math.floor(L[j.sets].x)).attr("y",j=>Math.floor(L[j.sets].y));u&&(O?"on"in q?q.on("end",LH(M,N)):q.each("end",LH(M,N)):q.each(LH(M,N)));const G=B($.exit()).remove();typeof $.transition=="function"&&G.selectAll("path").attrTween("d",D);const Q=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(H.style("font-size","0px"),q.style("font-size",d),Q.style("font-size","0px")),{circles:M,textCentres:L,nodes:$,enter:F,update:V,exit:G}}return S.wrap=function(C){return arguments.length?(u=C,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(C){return arguments.length?(r=C,S):r},S.height=function(C){return arguments.length?(n=C,S):n},S.padding=function(C){return arguments.length?(i=C,S):i},S.distinct=function(C){return arguments.length?(p=C,S):p},S.colours=function(C){return arguments.length?(b=C,S):b},S.colors=function(C){return arguments.length?(b=C,S):b},S.fontSize=function(C){return arguments.length?(d=C,S):d},S.round=function(C){return arguments.length?(g=C,S):g},S.duration=function(C){return arguments.length?(a=C,S):a},S.layoutFunction=function(C){return arguments.length?(T=C,S):T},S.normalize=function(C){return arguments.length?(o=C,S):o},S.scaleToFit=function(C){return arguments.length?(l=C,S):l},S.styled=function(C){return arguments.length?(h=C,S):h},S.orientation=function(C){return arguments.length?(s=C,S):s},S.orientationOrder=function(C){return arguments.length?(f=C,S):f},S.lossFunction=function(C){return arguments.length?(k=C==="default"?k3:C==="logRatio"?sYe:C,S):k},S}function LH(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 T=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return T.textContent=b,p.push(T),n.append(T),T}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"),x=n.getAttribute("y");p.forEach((b,T)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+T*f}em`)})}}function IH(t,e,r){let n=e[0].radius-Kl(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=nYe(h=>-1*IH({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(Kl(o,h)>h.radius){l=!1;break}for(const h of e)if(Kl(o,h)h.p1))}function a1r(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 s1r(t,e,r){const n=[];return n.push(` +`,"getStyles"),jmr=Ymr,Xmr={parser:Nmr,get db(){return new Dmr},renderer:Umr,styles:jmr};const Kmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xmr},Symbol.toStringTag,{value:"Module"})),nYe=1e-10;function PO(t,e){const r=Qmr(t),n=r.filter(o=>Zmr(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=aYe(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+=iX(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-nYe,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 Zmr(t,e){return e.every(r=>Xl(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 iX(t,n)+iX(e,i)}function iYe(t,e){const r=Xl(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 aYe(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 Jmr(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)aX(e))}function Mb(t,e){let r=0;for(let n=0;nk.fx-S.fx,v=e.slice(),x=e.slice(),b=e.slice(),T=e.slice();for(let k=0;k{const A=E.slice();return A.fx=E.fx,A.id=E.id,A});C.sort((E,A)=>E.id-A.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:C})}f=0;for(let C=0;C=g[p-1].fx){let C=!1;if(x.fx>S.fx?(pf(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(pf(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Mb(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 t1r(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(),oX(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fhie(t,e,n)-r,0,t+e)}function r1r(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=lX(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 i1r(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 a1r(t,e={}){let r=o1r(t,e);const n=e.lossFunction||k3;if(t.length>=8){const i=s1r(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>i1r(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+lYe>=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 cYe(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=hie(o.radius,l.radius,Xl(o,l))}else i=PO(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 l1r(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&&Xl(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 c1r(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 cX(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 uYe(t,e,r){e==null&&(e=Math.PI/2);let n=fYe(t).map(u=>Object.assign({},u));const i=c1r(n);for(const u of i){l1r(u,e,r);const h=cX(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 dYe(t){const e={};for(const r of t)e[r.setid]=r;return e}function fYe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function u1r(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"],x=0,b=function(C){if(C in y)return y[C];var E=y[C]=v[x];return x+=1,x>=v.length&&(x=0),E},T=oYe,k=k3;function S(C){let E=C.datum();const A=new Set;E.forEach(j=>{j.size==0&&j.sets.length==1&&A.add(j.sets[0])}),E=E.filter(j=>!j.sets.some(ae=>A.has(ae)));let M={},L={};if(E.length>0){let j=T(E,{lossFunction:k,distinct:p});o&&(j=uYe(j,s,f)),M=hYe(j,r,n,i,l),L=gYe(M,E,m)}const P={};E.forEach(j=>{j.label&&(P[j.sets]=j.label)});function N(j){if(j.sets in P)return P[j.sets];if(j.sets.length==1)return""+j.sets[0]}C.selectAll("svg").data([M]).enter().append("svg");const _=C.select("svg");e?_.attr("viewBox",`0 0 ${r} ${n}`):_.attr("width",r).attr("height",n);const I={};let O=!1;_.selectAll(".venn-area path").each(function(j){const ae=this.getAttribute("d");j.sets.length==1&&ae&&!p&&(O=!0,I[j.sets[0]]=f1r(ae))});function D(j){return ae=>{const Z=j.sets.map(J=>{let re=I[J],ee=M[J];return re||(re={x:r/2,y:n/2,radius:1}),ee||(ee={x:r/2,y:n/2,radius:1}),{x:re.x*(1-ae)+ee.x*ae,y:re.y*(1-ae)+ee.y*ae,radius:re.radius*(1-ae)+ee.radius*ae}});return Wye(Z,g)}}const $=_.selectAll(".venn-area").data(E,j=>j.sets),F=$.enter().append("g").attr("class",j=>`venn-area venn-${j.sets.length==1?"circle":"intersection"}${j.colour||j.color?" venn-coloured":""}`).attr("data-venn-sets",j=>j.sets.join("_")),z=F.append("path"),H=F.append("text").attr("class","label").text(j=>N(j)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(j=>j.sets.length==1).style("fill",j=>j.colour?j.colour:j.color?j.color:b(j.sets)).style("fill-opacity",".25"),H.style("fill",j=>j.colour||j.color?"#FFF":t.textFill?t.textFill:j.sets.length==1?b(j.sets):"#444"));function B(j){return typeof j.transition=="function"?j.transition("venn").duration(a):j}let V=C;O&&typeof V.transition=="function"?(V=B(C),V.selectAll("path").attrTween("d",D)):V.selectAll("path").attr("d",j=>Wye(j.sets.map(ae=>M[ae])),g);const q=V.selectAll("text").filter(j=>j.sets in L).text(j=>N(j)).attr("x",j=>Math.floor(L[j.sets].x)).attr("y",j=>Math.floor(L[j.sets].y));u&&(O?"on"in q?q.on("end",$H(M,N)):q.each("end",$H(M,N)):q.each($H(M,N)));const G=B($.exit()).remove();typeof $.transition=="function"&&G.selectAll("path").attrTween("d",D);const Q=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(H.style("font-size","0px"),q.style("font-size",d),Q.style("font-size","0px")),{circles:M,textCentres:L,nodes:$,enter:F,update:V,exit:G}}return S.wrap=function(C){return arguments.length?(u=C,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(C){return arguments.length?(r=C,S):r},S.height=function(C){return arguments.length?(n=C,S):n},S.padding=function(C){return arguments.length?(i=C,S):i},S.distinct=function(C){return arguments.length?(p=C,S):p},S.colours=function(C){return arguments.length?(b=C,S):b},S.colors=function(C){return arguments.length?(b=C,S):b},S.fontSize=function(C){return arguments.length?(d=C,S):d},S.round=function(C){return arguments.length?(g=C,S):g},S.duration=function(C){return arguments.length?(a=C,S):a},S.layoutFunction=function(C){return arguments.length?(T=C,S):T},S.normalize=function(C){return arguments.length?(o=C,S):o},S.scaleToFit=function(C){return arguments.length?(l=C,S):l},S.styled=function(C){return arguments.length?(h=C,S):h},S.orientation=function(C){return arguments.length?(s=C,S):s},S.orientationOrder=function(C){return arguments.length?(f=C,S):f},S.lossFunction=function(C){return arguments.length?(k=C==="default"?k3:C==="logRatio"?cYe:C,S):k},S}function $H(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 T=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return T.textContent=b,p.push(T),n.append(T),T}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"),x=n.getAttribute("y");p.forEach((b,T)=>{b.setAttribute("x",v),b.setAttribute("y",x),b.setAttribute("dy",`${y+T*f}em`)})}}function NH(t,e,r){let n=e[0].radius-Xl(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=sYe(h=>-1*NH({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(Xl(o,h)>h.radius){l=!1;break}for(const h of e)if(Xl(o,h)h.p1))}function h1r(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 d1r(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 o1r(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function fYe(t){if(t.length===0)return[];const e={};return DO(t,e),e.arcs}function pYe(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 s1r(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function f1r(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function mYe(t){if(t.length===0)return[];const e={};return PO(t,e),e.arcs}function yYe(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 d1r(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 Vye(t,e){return pYe(fYe(t),e)}function l1r(t,e={}){const{lossFunction:r,layoutFunction:n=iYe,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?k3:r==="logRatio"?sYe:r,distinct:f});i&&(g=oYe(g,a,s));const m=lYe(g,o,l,u,h),y=dYe(m,t,d),v=new Map(Object.keys(m).map(T=>[T,{set:T,x:m[T].x,y:m[T].y,radius:m[T].radius}])),x=t.map(T=>{const k=T.sets.map(E=>v.get(E)),S=fYe(k),C=pYe(S,p);return{circles:k,arcs:S,path:C,area:T,has:new Set(T.sets)}});function b(T){let k="";for(const S of x)S.has.size>T.length&&T.every(C=>S.has.has(C))&&(k+=" "+S.path);return k}return x.map(({circles:T,arcs:k,path:S,area:C})=>({data:C,text:y[C.sets],circles:T,arcs:k,path:S,distinctPath:S+b(C.sets)}))}var lX=(function(){var t=w(function(x,b,T,k){for(T=T||{},k=x.length;k--;T[x[k]]=b);return T},"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:w(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:w(function(b,T,k,S,C,E,A){var M=E.length-1;switch(C){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:w(function(b,T){if(T.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=T,k}},"parseError"),parse:w(function(b){var T=this,k=[0],S=[],C=[null],E=[],A=this.table,M="",L=0,P=0,N=2,_=1,I=E.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(D.yy[$]=this.yy[$]);O.setInput(b,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;E.push(F);var z=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(me){k.length=k.length-2*me,C.length=C.length-me,E.length=E.length-me}w(H,"popStack");function B(){var me;return me=S.pop()||O.lex()||_,typeof me!="number"&&(me instanceof Array&&(S=me,me=S.pop()),me=T.symbols_[me]||me),me}w(B,"lex");for(var V,q,G,Q,j={},ae,Z,J,re;;){if(q=k[k.length-1],this.defaultActions[q]?G=this.defaultActions[q]:((V===null||typeof V>"u")&&(V=B()),G=A[q]&&A[q][V]),typeof G>"u"||!G.length||!G[0]){var ee="";re=[];for(ae in A[q])this.terminals_[ae]&&ae>N&&re.push("'"+this.terminals_[ae]+"'");O.showPosition?ee="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 Wye(t,e){return yYe(mYe(t),e)}function p1r(t,e={}){const{lossFunction:r,layoutFunction:n=oYe,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?k3:r==="logRatio"?cYe:r,distinct:f});i&&(g=uYe(g,a,s));const m=hYe(g,o,l,u,h),y=gYe(m,t,d),v=new Map(Object.keys(m).map(T=>[T,{set:T,x:m[T].x,y:m[T].y,radius:m[T].radius}])),x=t.map(T=>{const k=T.sets.map(E=>v.get(E)),S=mYe(k),C=yYe(S,p);return{circles:k,arcs:S,path:C,area:T,has:new Set(T.sets)}});function b(T){let k="";for(const S of x)S.has.size>T.length&&T.every(C=>S.has.has(C))&&(k+=" "+S.path);return k}return x.map(({circles:T,arcs:k,path:S,area:C})=>({data:C,text:y[C.sets],circles:T,arcs:k,path:S,distinctPath:S+b(C.sets)}))}var uX=(function(){var t=w(function(x,b,T,k){for(T=T||{},k=x.length;k--;T[x[k]]=b);return T},"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:w(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:w(function(b,T,k,S,C,E,A){var M=E.length-1;switch(C){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:w(function(b,T){if(T.recoverable)this.trace(b);else{var k=new Error(b);throw k.hash=T,k}},"parseError"),parse:w(function(b){var T=this,k=[0],S=[],C=[null],E=[],A=this.table,M="",L=0,P=0,N=2,_=1,I=E.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var $ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$)&&(D.yy[$]=this.yy[$]);O.setInput(b,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var F=O.yylloc;E.push(F);var z=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(me){k.length=k.length-2*me,C.length=C.length-me,E.length=E.length-me}w(H,"popStack");function B(){var me;return me=S.pop()||O.lex()||_,typeof me!="number"&&(me instanceof Array&&(S=me,me=S.pop()),me=T.symbols_[me]||me),me}w(B,"lex");for(var V,q,G,Q,j={},ae,Z,J,re;;){if(q=k[k.length-1],this.defaultActions[q]?G=this.defaultActions[q]:((V===null||typeof V>"u")&&(V=B()),G=A[q]&&A[q][V]),typeof G>"u"||!G.length||!G[0]){var ee="";re=[];for(ae in A[q])this.terminals_[ae]&&ae>N&&re.push("'"+this.terminals_[ae]+"'");O.showPosition?ee="Parse error on line "+(L+1)+`: `+O.showPosition()+` Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error on line "+(L+1)+": Unexpected "+(V==_?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ee,{text:O.match,token:this.terminals_[V]||V,line:O.yylineno,loc:F,expected:re})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+V);switch(G[0]){case 1:k.push(V),C.push(O.yytext),E.push(O.yylloc),k.push(G[1]),V=null,P=O.yyleng,M=O.yytext,L=O.yylineno,F=O.yylloc;break;case 2:if(Z=this.productions_[G[1]][1],j.$=C[C.length-Z],j._$={first_line:E[E.length-(Z||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(Z||1)].first_column,last_column:E[E.length-1].last_column},z&&(j._$.range=[E[E.length-(Z||1)].range[0],E[E.length-1].range[1]]),Q=this.performAction.apply(j,[M,P,L,D.yy,G[1],C,E].concat(I)),typeof Q<"u")return Q;Z&&(k=k.slice(0,-1*Z*2),C=C.slice(0,-1*Z),E=E.slice(0,-1*Z)),k.push(this.productions_[G[1]][0]),C.push(j.$),E.push(j._$),J=A[k[k.length-2]][k[k.length-1]],k.push(J);break;case 3:return!0}}return!0},"parse")},y=(function(){var x={EOF:1,parseError:w(function(T,k){if(this.yy.parser)this.yy.parser.parseError(T,k);else throw new Error(T)},"parseError"),setInput:w(function(b,T){return this.yy=T||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:w(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var T=b.match(/(?:\r\n?|\n).*/g);return T?(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:w(function(b){var T=b.length,k=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;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),k.length-1&&(this.yylineno-=k.length-1);var C=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===S.length?this.yylloc.first_column:0)+S[S.length-k.length].length-k[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-T]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(b){this.unput(this.match.slice(b))},"less"),pastInput:w(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:w(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:w(function(){var b=this.pastInput(),T=new Array(b.length+1).join("-");return b+this.upcomingInput()+` `+T+"^"},"showPosition"),test_match:w(function(b,T){var k,S,C;if(this.options.backtrack_lexer&&(C={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&&(C.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],k=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var E in C)this[E]=C[E];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,T,k,S;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),E=0;ET[0].length)){if(T=k,S=E,this.options.backtrack_lexer){if(b=this.test_match(k,C[E]),b!==!1)return b;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(b=this.test_match(T,C[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:w(function(){var T=this.next();return T||this.lex()},"lex"),begin:w(function(T){this.conditionStack.push(T)},"begin"),popState:w(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:w(function(T){this.begin(T)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(T,k,S,C){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(T.getIndentMode&&T.getIndentMode())return T.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:T.setIndentMode&&T.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.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(T.consumeIndentText)T.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.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 x})();m.lexer=y;function v(){this.yy={}}return w(v,"Parser"),v.prototype=m,m.Parser=v,new v})();lX.parser=lX;var c1r=lX,uie=[],hie=[],die=[],fie=new Set,pie,gie=!1,u1r=w((t,e,r)=>{const n=OO(t).sort(),i=r??10/Math.pow(t.length,2);pie=n,n.length===1&&fie.add(n[0]),uie.push({sets:n,size:i,label:e?Z6(e):void 0})},"addSubsetData"),h1r=w(()=>uie,"getSubsetData"),Z6=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),d1r=w(t=>t&&Z6(t),"normalizeStyleValue"),f1r=w((t,e,r)=>{const n=Z6(e);hie.push({sets:OO(t).sort(),id:n,label:r?Z6(r):void 0})},"addTextData"),p1r=w((t,e)=>{const r=OO(t).sort(),n={};for(const[i,a]of e)n[i]=d1r(a)??a;die.push({targets:r,styles:n})},"addStyleData"),g1r=w(()=>die,"getStyleData"),OO=w(t=>t.map(e=>Z6(e)),"normalizeIdentifierList"),m1r=w(t=>{const r=OO(t).filter(n=>!fie.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),y1r=w(()=>hie,"getTextData"),v1r=w(()=>pie,"getCurrentSets"),b1r=w(()=>gie,"getIndentMode"),x1r=w(t=>{gie=t},"setIndentMode"),w1r=xn.venn;function gYe(){return Gi(w1r,pr().venn)}w(gYe,"getConfig");var T1r=w(()=>{wi(),uie.length=0,hie.length=0,die.length=0,fie.clear(),pie=void 0,gie=!1},"customClear"),k1r={getConfig:gYe,clear:T1r,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji,addSubsetData:u1r,getSubsetData:h1r,addTextData:f1r,addStyleData:p1r,validateUnionIdentifiers:m1r,getTextData:y1r,getStyleData:g1r,getCurrentSets:v1r,getIndentMode:b1r,setIndentMode:x1r},C1r=w(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var T=this.next();return T||this.lex()},"lex"),begin:w(function(T){this.conditionStack.push(T)},"begin"),popState:w(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:w(function(T){this.begin(T)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(T,k,S,C){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(T.getIndentMode&&T.getIndentMode())return T.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:T.setIndentMode&&T.setIndentMode(!1),this.begin("INITIAL"),this.unput(k.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(T.consumeIndentText)T.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return k.yytext=k.yytext.slice(2,-2),14;case 17:return k.yytext=k.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 x})();m.lexer=y;function v(){this.yy={}}return w(v,"Parser"),v.prototype=m,m.Parser=v,new v})();uX.parser=uX;var g1r=uX,die=[],fie=[],pie=[],gie=new Set,mie,yie=!1,m1r=w((t,e,r)=>{const n=BO(t).sort(),i=r??10/Math.pow(t.length,2);mie=n,n.length===1&&gie.add(n[0]),die.push({sets:n,size:i,label:e?Q6(e):void 0})},"addSubsetData"),y1r=w(()=>die,"getSubsetData"),Q6=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),v1r=w(t=>t&&Q6(t),"normalizeStyleValue"),b1r=w((t,e,r)=>{const n=Q6(e);fie.push({sets:BO(t).sort(),id:n,label:r?Q6(r):void 0})},"addTextData"),x1r=w((t,e)=>{const r=BO(t).sort(),n={};for(const[i,a]of e)n[i]=v1r(a)??a;pie.push({targets:r,styles:n})},"addStyleData"),w1r=w(()=>pie,"getStyleData"),BO=w(t=>t.map(e=>Q6(e)),"normalizeIdentifierList"),T1r=w(t=>{const r=BO(t).filter(n=>!gie.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),k1r=w(()=>fie,"getTextData"),C1r=w(()=>mie,"getCurrentSets"),S1r=w(()=>yie,"getIndentMode"),E1r=w(t=>{yie=t},"setIndentMode"),A1r=xn.venn;function vYe(){return Gi(A1r,pr().venn)}w(vYe,"getConfig");var R1r=w(()=>{wi(),die.length=0,fie.length=0,pie.length=0,gie.clear(),mie=void 0,yie=!1},"customClear"),_1r={getConfig:vYe,clear:R1r,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji,addSubsetData:m1r,getSubsetData:y1r,addTextData:b1r,addStyleData:x1r,validateUnionIdentifiers:T1r,getTextData:k1r,getStyleData:w1r,getCurrentSets:C1r,getIndentMode:S1r,setIndentMode:E1r},M1r=w(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -4656,7 +4669,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),S1r=C1r;function mYe(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}w(mYe,"buildStyleByKey");var E1r=w((t,e,r,n)=>{var I,O,D;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=pr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(O=i.getDiagramTitle)==null?void 0:O.call(i),f=i.getSubsetData(),p=i.getTextData(),g=mYe(i.getStyleData()),m=vYe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,T=d?48*b:0,k=s.primaryTextColor??s.textColor,S=Po(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 C=bt(document.createElement("div")),E=i1r().width(y).height(v-T);C.datum(m).call(E);const A=u?lr.svg(C.select("svg").node()):void 0,M=l1r(m,{width:y,height:v-T,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const $ of M){const F=op([...$.data.sets].sort());L.set(F,$)}p.length>0&&yYe(a,L,C,p,b,g);const P=kl(s.background||"#f4f4f4");C.selectAll(".venn-circle").each(function($,F){var Z;const z=bt(this),B=op([...$.sets].sort()),V=g.get(B),q=(V==null?void 0:V.fill)||h[F%h.length]||s.primaryColor;z.classed(`venn-set-${F%8}`,!0);const G=(V==null?void 0:V["fill-opacity"])??.1,Q=(V==null?void 0:V.stroke)||q,j=(V==null?void 0:V["stroke-width"])||`${5*b}`;if(u&&A){const J=L.get(B);if(J&&J.circles.length>0){const re=J.circles[0],ee=A.circle(re.x,re.y,re.radius*2,{roughness:.7,seed:l,fill:Rse(q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Q,strokeWidth:parseFloat(String(j))});z.select("path").remove(),(Z=z.node())==null||Z.insertBefore(ee,z.select("text").node())}}else z.select("path").style("fill",q).style("fill-opacity",G).style("stroke",Q).style("stroke-width",j).style("stroke-opacity",.95);const ae=(V==null?void 0:V.color)||(P?lt(q,30):ct(q,30));z.select("text").style("font-size",`${48*b}px`).style("fill",ae)}),u&&A?C.selectAll(".venn-intersection").each(function($){var q;const F=bt(this),H=op([...$.sets].sort()),B=g.get(H),V=B==null?void 0:B.fill;if(V){const G=F.select("path"),Q=G.attr("d");if(Q){const j=A.path(Q,{roughness:.7,seed:l,fill:Rse(V,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ae=G.node();(q=ae==null?void 0:ae.parentNode)==null||q.insertBefore(j,ae),G.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??k)}):(C.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",$=>{var H;const z=op([...$.sets].sort());return((H=g.get(z))==null?void 0:H.color)??s.vennSetTextColor??k}),C.selectAll(".venn-intersection path").style("fill-opacity",$=>{var H;const z=op([...$.sets].sort());return(H=g.get(z))!=null&&H.fill?1:0}).style("fill",$=>{var H;const z=op([...$.sets].sort());return((H=g.get(z))==null?void 0:H.fill)??"transparent"}));const N=S.append("g").attr("transform",`translate(0, ${T})`),_=C.select("svg").node();if(_&&"childNodes"in _)for(const $ of[..._.childNodes])(D=N.node())==null||D.appendChild($);_a(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function op(t){return t.join("|")}w(op,"stableSetsKey");function yYe(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=op(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 x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=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",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const T=Math.max(80*i,x*2*.95),k=Math.max(60*i,x*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),A=g-T/2,M=m-k/2+E,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/L)),N=T/L,_=k/P;for(const[I,O]of f.entries()){const D=I%L,$=Math.floor(I/L),F=A+N*(D+.5),z=M+_*($+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",A+N*D).attr("y",M+_*$).attr("width",N).attr("height",_).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const H=N*.9,B=_*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",H).attr("height",B).attr("x",F-H/2).attr("y",z-B/2).attr("overflow","visible"),q=(h=a.get(O.id))==null?void 0:h.color,G=V.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(O.label??O.id);q&&G.style("color",q)}}}w(yYe,"renderTextNodes");function vYe(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}w(vYe,"ensurePairwiseSubsets");var A1r={draw:E1r},R1r={parser:c1r,db:k1r,renderer:A1r,styles:S1r};const _1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:R1r},Symbol.toStringTag,{value:"Module"}));var uT,bYe=(uT=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji}getNodes(){return this.nodes}getConfig(){const e=xn,r=pr();return Gi({...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=>{PK(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(){wi(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(uT,"TreeMapDB"),uT);function xYe(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}w(xYe,"buildHierarchy");var M1r=w((t,e)=>{Al(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=L1r(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=xYe(r),i=w((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"),L1r=w(t=>t.name?String(t.name):"","getItemName"),wYe={parser:{yy:void 0},parse:w(async t=>{var e;try{const n=await xu("treemap",t);he.debug("Treemap AST:",n);const i=(e=wYe.parser)==null?void 0:e.yy;if(!(i instanceof bYe))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.");M1r(n,i)}catch(r){throw he.error("Error parsing treemap:",r),r}},"parse")},I1r=10,jv=10,r5=25,$1r=w((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??I1r,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=pr();if(!l)return;const h=o?30:0,d=Po(e),f=a.nodeWidth?a.nodeWidth*jv:960,p=a.nodeHeight?a.nodeHeight*jv:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),_a(d,m,g,a.useMaxWidth);let y;try{const B=a.valueFormat||",";if(B==="$0,0")y=w(V=>"$"+Em(",")(V),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const V=/\.\d+/.exec(B),q=V?V[0]:"";y=w(G=>"$"+Em(","+q)(G),"valueFormat")}else if(B.startsWith("$")){const V=B.substring(1);y=w(q=>"$"+Em(V||"")(q),"valueFormat")}else y=Em(B)}catch(B){he.error("Error creating format function:",B),y=Em(",")}const v=w1().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]),x=w1().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=w1().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 T=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=TK(l).sum(B=>B.value??0).sort((B,V)=>(V.value??0)-(B.value??0)),C=Yut().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?r5+jv:0).paddingInner(s).paddingLeft(B=>B.children&&B.children.length>0?jv:0).paddingRight(B=>B.children&&B.children.length>0?jv:0).paddingBottom(B=>B.children&&B.children.length>0?jv:0).round(!0)(k),E=C.descendants().filter(B=>B.children&&B.children.length>0),A=T.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",r5).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),A.append("clipPath").attr("id",(B,V)=>`clip-section-${e}-${V}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",r5),A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,V)=>`treemapSection section${V}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>x(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const V=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V.nodeStyles+";"+V.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",r5/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,V)=>`url(#clip-section-${e}-${V})`).attr("style",B=>{if(B.depth===0)return"display: none;";const V="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const V=bt(this),q=B.data.name;V.text(q);const G=B.x1-B.x0,Q=6;let j;a.showValues!==!1&&B.value?j=G-10-30-10-Q:j=G-Q-6;const Z=Math.max(15,j),J=V.node();if(J.getComputedTextLength()>Z){let me=q;for(;me.length>0;){if(me=q.substring(0,me.length-1),me.length===0){V.text("..."),J.getComputedTextLength()>Z&&V.text("");break}if(V.text(me+"..."),J.getComputedTextLength()<=Z)break}}}),a.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",r5/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 V="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")});const M=C.leaves(),L=M.length>20,P=L?16:38,N=L?14:28,_=L?4:8,I=L?4:6,O=L?2:4,D=L?8:10,$=L?1:2,F=T.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(B,V)=>`treemapNode treemapLeafGroup leaf${V}${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=>ar({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,V)=>`clip-${e}-${V}`).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 V=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,V)=>`url(#clip-${e}-${V})`).text(B=>B.data.name).each(function(B){const V=bt(this),q=B.x1-B.x0,G=B.y1-B.y0,Q=V.node(),j=q-2*O,ae=G-2*O;if(jj&&Z>_;)Z--,V.style("font-size",`${Z}px`);let re=Math.max(I,Math.min(N,Math.round(Z*J))),ee=Z+$+re;for(;ee>ae&&Z>_&&(Z--,re=Math.max(I,Math.min(N,Math.round(Z*J))),!(rej||Z<_||ae(V.x1-V.x0)/2).attr("y",function(V){return(V.y1-V.y0)/2}).attr("style",V=>{const q=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+b(V.data.name)+";",G=ar({cssCompiledStyles:V.data.cssCompiledStyles});return q+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(V,q)=>`url(#clip-${e}-${q})`).text(V=>V.value?y(V.value):"").each(function(V){const q=bt(this),G=this.parentNode;if(!G){q.style("display","none");return}const Q=bt(G).select(".treemapLabel");if(Q.empty()||Q.style("display")==="none"){q.style("display","none");return}const j=parseFloat(Q.style("font-size")),Z=Math.max(I,Math.min(N,Math.round(j*.6)));q.style("font-size",`${Z}px`);const re=(V.y1-V.y0)/2+j/2+$;q.attr("y",re);const ee=V.x1-V.x0,$e=V.y1-V.y0-4,Oe=ee-2*O;q.node().getComputedTextLength()>Oe||re+Z>$e||Z{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(O1r,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),L1r=M1r;function bYe(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}w(bYe,"buildStyleByKey");var I1r=w((t,e,r,n)=>{var I,O,D;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=pr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(O=i.getDiagramTitle)==null?void 0:O.call(i),f=i.getSubsetData(),p=i.getTextData(),g=bYe(i.getStyleData()),m=wYe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,T=d?48*b:0,k=s.primaryTextColor??s.textColor,S=Po(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 C=bt(document.createElement("div")),E=u1r().width(y).height(v-T);C.datum(m).call(E);const A=u?lr.svg(C.select("svg").node()):void 0,M=p1r(m,{width:y,height:v-T,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const $ of M){const F=op([...$.data.sets].sort());L.set(F,$)}p.length>0&&xYe(a,L,C,p,b,g);const P=kl(s.background||"#f4f4f4");C.selectAll(".venn-circle").each(function($,F){var Z;const z=bt(this),B=op([...$.sets].sort()),V=g.get(B),q=(V==null?void 0:V.fill)||h[F%h.length]||s.primaryColor;z.classed(`venn-set-${F%8}`,!0);const G=(V==null?void 0:V["fill-opacity"])??.1,Q=(V==null?void 0:V.stroke)||q,j=(V==null?void 0:V["stroke-width"])||`${5*b}`;if(u&&A){const J=L.get(B);if(J&&J.circles.length>0){const re=J.circles[0],ee=A.circle(re.x,re.y,re.radius*2,{roughness:.7,seed:l,fill:Mse(q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Q,strokeWidth:parseFloat(String(j))});z.select("path").remove(),(Z=z.node())==null||Z.insertBefore(ee,z.select("text").node())}}else z.select("path").style("fill",q).style("fill-opacity",G).style("stroke",Q).style("stroke-width",j).style("stroke-opacity",.95);const ae=(V==null?void 0:V.color)||(P?lt(q,30):ct(q,30));z.select("text").style("font-size",`${48*b}px`).style("fill",ae)}),u&&A?C.selectAll(".venn-intersection").each(function($){var q;const F=bt(this),H=op([...$.sets].sort()),B=g.get(H),V=B==null?void 0:B.fill;if(V){const G=F.select("path"),Q=G.attr("d");if(Q){const j=A.path(Q,{roughness:.7,seed:l,fill:Mse(V,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ae=G.node();(q=ae==null?void 0:ae.parentNode)==null||q.insertBefore(j,ae),G.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??k)}):(C.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",$=>{var H;const z=op([...$.sets].sort());return((H=g.get(z))==null?void 0:H.color)??s.vennSetTextColor??k}),C.selectAll(".venn-intersection path").style("fill-opacity",$=>{var H;const z=op([...$.sets].sort());return(H=g.get(z))!=null&&H.fill?1:0}).style("fill",$=>{var H;const z=op([...$.sets].sort());return((H=g.get(z))==null?void 0:H.fill)??"transparent"}));const N=S.append("g").attr("transform",`translate(0, ${T})`),_=C.select("svg").node();if(_&&"childNodes"in _)for(const $ of[..._.childNodes])(D=N.node())==null||D.appendChild($);_a(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function op(t){return t.join("|")}w(op,"stableSetsKey");function xYe(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=op(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 x=Number.isFinite(v)?Math.max(0,v):0;x===0&&Number.isFinite(y)&&(x=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",x).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const T=Math.max(80*i,x*2*.95),k=Math.max(60*i,x*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,x*.25):0)+(f.length<=2?30*i:0),A=g-T/2,M=m-k/2+E,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/L)),N=T/L,_=k/P;for(const[I,O]of f.entries()){const D=I%L,$=Math.floor(I/L),F=A+N*(D+.5),z=M+_*($+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",A+N*D).attr("y",M+_*$).attr("width",N).attr("height",_).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const H=N*.9,B=_*.9,V=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",H).attr("height",B).attr("x",F-H/2).attr("y",z-B/2).attr("overflow","visible"),q=(h=a.get(O.id))==null?void 0:h.color,G=V.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(O.label??O.id);q&&G.style("color",q)}}}w(xYe,"renderTextNodes");function wYe(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}w(wYe,"ensurePairwiseSubsets");var $1r={draw:I1r},N1r={parser:g1r,db:_1r,renderer:$1r,styles:L1r};const D1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:N1r},Symbol.toStringTag,{value:"Module"}));var uT,TYe=(uT=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=$i,this.getAccTitle=Yi,this.setDiagramTitle=qi,this.getDiagramTitle=Di,this.getAccDescription=Xi,this.setAccDescription=ji}getNodes(){return this.nodes}getConfig(){const e=xn,r=pr();return Gi({...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=>{FK(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(){wi(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(uT,"TreeMapDB"),uT);function kYe(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}w(kYe,"buildHierarchy");var O1r=w((t,e)=>{Al(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=P1r(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=kYe(r),i=w((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"),P1r=w(t=>t.name?String(t.name):"","getItemName"),CYe={parser:{yy:void 0},parse:w(async t=>{var e;try{const n=await xu("treemap",t);he.debug("Treemap AST:",n);const i=(e=CYe.parser)==null?void 0:e.yy;if(!(i instanceof TYe))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.");O1r(n,i)}catch(r){throw he.error("Error parsing treemap:",r),r}},"parse")},B1r=10,jv=10,r5=25,F1r=w((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??B1r,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=pr();if(!l)return;const h=o?30:0,d=Po(e),f=a.nodeWidth?a.nodeWidth*jv:960,p=a.nodeHeight?a.nodeHeight*jv:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),_a(d,m,g,a.useMaxWidth);let y;try{const B=a.valueFormat||",";if(B==="$0,0")y=w(V=>"$"+Em(",")(V),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const V=/\.\d+/.exec(B),q=V?V[0]:"";y=w(G=>"$"+Em(","+q)(G),"valueFormat")}else if(B.startsWith("$")){const V=B.substring(1);y=w(q=>"$"+Em(V||"")(q),"valueFormat")}else y=Em(B)}catch(B){he.error("Error creating format function:",B),y=Em(",")}const v=w1().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]),x=w1().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=w1().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 T=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),k=CK(l).sum(B=>B.value??0).sort((B,V)=>(V.value??0)-(B.value??0)),C=Kut().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?r5+jv:0).paddingInner(s).paddingLeft(B=>B.children&&B.children.length>0?jv:0).paddingRight(B=>B.children&&B.children.length>0?jv:0).paddingBottom(B=>B.children&&B.children.length>0?jv:0).round(!0)(k),E=C.descendants().filter(B=>B.children&&B.children.length>0),A=T.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",r5).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),A.append("clipPath").attr("id",(B,V)=>`clip-section-${e}-${V}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",r5),A.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,V)=>`treemapSection section${V}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>x(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const V=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V.nodeStyles+";"+V.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",r5/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,V)=>`url(#clip-section-${e}-${V})`).attr("style",B=>{if(B.depth===0)return"display: none;";const V="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const V=bt(this),q=B.data.name;V.text(q);const G=B.x1-B.x0,Q=6;let j;a.showValues!==!1&&B.value?j=G-10-30-10-Q:j=G-Q-6;const Z=Math.max(15,j),J=V.node();if(J.getComputedTextLength()>Z){let me=q;for(;me.length>0;){if(me=q.substring(0,me.length-1),me.length===0){V.text("..."),J.getComputedTextLength()>Z&&V.text("");break}if(V.text(me+"..."),J.getComputedTextLength()<=Z)break}}}),a.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",r5/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 V="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")});const M=C.leaves(),L=M.length>20,P=L?16:38,N=L?14:28,_=L?4:8,I=L?4:6,O=L?2:4,D=L?8:10,$=L?1:2,F=T.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(B,V)=>`treemapNode treemapLeafGroup leaf${V}${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=>ar({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,V)=>`clip-${e}-${V}`).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 V=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",q=ar({cssCompiledStyles:B.data.cssCompiledStyles});return V+q.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,V)=>`url(#clip-${e}-${V})`).text(B=>B.data.name).each(function(B){const V=bt(this),q=B.x1-B.x0,G=B.y1-B.y0,Q=V.node(),j=q-2*O,ae=G-2*O;if(jj&&Z>_;)Z--,V.style("font-size",`${Z}px`);let re=Math.max(I,Math.min(N,Math.round(Z*J))),ee=Z+$+re;for(;ee>ae&&Z>_&&(Z--,re=Math.max(I,Math.min(N,Math.round(Z*J))),!(rej||Z<_||ae(V.x1-V.x0)/2).attr("y",function(V){return(V.y1-V.y0)/2}).attr("style",V=>{const q=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+b(V.data.name)+";",G=ar({cssCompiledStyles:V.data.cssCompiledStyles});return q+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(V,q)=>`url(#clip-${e}-${q})`).text(V=>V.value?y(V.value):"").each(function(V){const q=bt(this),G=this.parentNode;if(!G){q.style("display","none");return}const Q=bt(G).select(".treemapLabel");if(Q.empty()||Q.style("display")==="none"){q.style("display","none");return}const j=parseFloat(Q.style("font-size")),Z=Math.max(I,Math.min(N,Math.round(j*.6)));q.style("font-size",`${Z}px`);const re=(V.y1-V.y0)/2+j/2+$;q.attr("y",re);const ee=V.x1-V.x0,$e=V.y1-V.y0-4,Oe=ee-2*O;q.node().getComputedTextLength()>Oe||re+Z>$e||Z{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(V1r,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}; @@ -4679,8 +4692,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),B1r=P1r,F1r={parser:wYe,get db(){return new bYe},renderer:D1r,styles:B1r};const z1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:F1r},Symbol.toStringTag,{value:"Module"}));var ZI=w((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"),sm=w((t,e,r)=>({x:ZI(e,`${r} evolution`),y:ZI(t,`${r} visibility`)}),"toCoordinates"),Wye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),H1r=w(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"),V1r=w((t,e)=>{if(Al(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=sm(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=sm(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=sm(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=ZI(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=Wye(r.fromPort)??Wye(r.toPort);const{flow:a,label:s}=H1r(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=ZI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=sm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=sm(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=sm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=sm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),TYe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("wardley",t);he.debug(e);const r=(n=TYe.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.");V1r(e,r)},"parse")},hT,W1r=(hT=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}},w(hT,"WardleyBuilder"),hT),Vo=new W1r;function kYe(){return We()["wardley-beta"]}w(kYe,"getConfig");function CYe(t,e,r,n,i,a,s,o,l){Vo.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}w(CYe,"addNode");function SYe(t,e,r=!1,n,i){Vo.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(SYe,"addLink");function EYe(t,e,r){Vo.addTrend({nodeId:t,targetX:e,targetY:r})}w(EYe,"addTrend");function AYe(t,e,r){Vo.addAnnotation({number:t,coordinates:e,text:r})}w(AYe,"addAnnotation");function RYe(t,e,r){Vo.addNote({text:t,x:e,y:r})}w(RYe,"addNote");function _Ye(t,e,r){Vo.addAccelerator({name:t,x:e,y:r})}w(_Ye,"addAccelerator");function MYe(t,e,r){Vo.addDeaccelerator({name:t,x:e,y:r})}w(MYe,"addDeaccelerator");function LYe(t,e){Vo.setAnnotationsBox(t,e)}w(LYe,"setAnnotationsBox");function IYe(t,e){Vo.setSize(t,e)}w(IYe,"setSize");function $Ye(t){Vo.startPipeline(t)}w($Ye,"startPipeline");function NYe(t,e){Vo.addPipelineComponent(t,e)}w(NYe,"addPipelineComponent");function DYe(t){Vo.setAxes(t)}w(DYe,"updateAxes");function OYe(t){return Vo.getNode(t)}w(OYe,"getNode");function PYe(t){return Vo.resolveNodeId(t)}w(PYe,"resolveNodeId");function BYe(){return Vo.build()}w(BYe,"getWardleyData");function FYe(){Vo.clear(),wi()}w(FYe,"clear");var q1r={getConfig:kYe,addNode:CYe,addLink:SYe,addTrend:EYe,addAnnotation:AYe,addNote:RYe,addAccelerator:_Ye,addDeaccelerator:MYe,setAnnotationsBox:LYe,setSize:IYe,startPipeline:$Ye,addPipelineComponent:NYe,updateAxes:DYe,getNode:OYe,resolveNodeId:PYe,getWardleyData:BYe,clear:FYe,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},G1r=["Genesis","Custom Built","Product","Commodity"],U1r=w(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=We();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"),Y1r=w(()=>{const t=We()["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"),j1r=w((t,e,r,n)=>{var $,F;he.debug(`Rendering Wardley map -`+t);const i=Y1r(),a=U1r(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=(($=l.size)==null?void 0:$.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=Po(e);f.selectAll("*").remove(),_a(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=w(z=>i.padding+z/100*m,"projectX"),x=w(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 T=l.axes.xLabel??"Evolution",k=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(T),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(k);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:G1r;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),H=l.axes.stageBoundaries,B=[];if(H&&H.length===S.length){let V=0;H.forEach(q=>{B.push({start:V,end:q}),V=q})}else{const V=1/S.length;S.forEach((q,G)=>{B.push({start:G*V,end:(G+1)*V})})}S.forEach((V,q)=>{const G=B[q],Q=i.padding+G.start*m,j=i.padding+G.end*m,ae=(Q+j)/2;q>0&&z.append("line").attr("x1",Q).attr("x2",Q).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",ae).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let H=1;H<4;H++){const B=H/4,V=i.padding+m*B;z.append("line").attr("x1",V).attr("x2",V).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 C=new Map;if(l.nodes.forEach(z=>{C.set(z.id,{x:v(z.x),y:x(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),H=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const V=B.componentIds.map(j=>({id:j,pos:C.get(j),node:l.nodes.find(ae=>ae.id===j)})).filter(j=>j.pos&&j.node).sort((j,ae)=>j.node.x-ae.node.x);for(let j=0;j{const ae=C.get(j);ae&&(q=Math.min(q,ae.x),G=Math.max(G,ae.x),Q=ae.y)}),q!==1/0&&G!==-1/0){const ae=i.nodeRadius*4,Z=Q-ae/2,J=C.get(B.nodeId);if(J){const re=(q+G)/2;J.x=re,J.y=Z-s/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",q-15).attr("y",Z).attr("width",G-q+30).attr("height",ae).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"),A=new Map;l.pipelines.forEach(z=>{A.set(z.nodeId,new Set(z.componentIds))});const M=l.links.filter(z=>{if(!C.has(z.source)||!C.has(z.target))return!1;const H=A.get(z.target);return!(H!=null&&H.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 H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q);return H.x+G/j*q}).attr("y1",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q);return H.y+Q/j*q}).attr("x2",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=H.x-B.x,Q=H.y-B.y,j=Math.sqrt(G*G+Q*Q);return B.x+G/j*q}).attr("y2",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=H.x-B.x,Q=H.y-B.y,j=Math.sqrt(G*G+Q*Q);return B.y+Q/j*q}).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 H=C.get(z.source),B=C.get(z.target),V=(H.x+B.x)/2,q=B.y-H.y,G=B.x-H.x,Q=Math.sqrt(G*G+q*q),j=8,ae=q/Q;return V+ae*j}).attr("y",z=>{const H=C.get(z.source),B=C.get(z.target),V=(H.y+B.y)/2,q=B.x-H.x,G=B.y-H.y,Q=Math.sqrt(q*q+G*G),j=8,ae=-q/Q;return V+ae*j}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const H=C.get(z.source),B=C.get(z.target),V=(H.x+B.x)/2,q=(H.y+B.y)/2,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q),ae=8,Z=Q/j,J=-G/j,re=V+Z*ae,ee=q+J*ae;let me=Math.atan2(Q,G)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${re} ${ee})`}).text(z=>z.label);const L=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const H=C.get(z.nodeId);if(!H)return null;const B=v(z.targetX),V=x(z.targetY),q=B-H.x,G=V-H.y,Q=Math.sqrt(q*q+G*G),j=i.nodeRadius+2,ae=Q>j?B-q/Q*j:B,Z=Q>j?V-G/Q*j:V;return{origin:H,targetX:B,targetY:V,adjustedX2:ae,adjustedY2:Z}}).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 _=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(" "));_.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=_.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const O=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x).attr("y1",z=>C.get(z.id).y-D).attr("x2",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("y2",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("y1",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("x2",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("y2",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("y1",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("x2",z=>C.get(z.id).x).attr("y2",z=>C.get(z.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y-D).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("cy",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("cy",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),_.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>C.get(z.id).x-s/2).attr("y",z=>C.get(z.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const H=C.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),H.x+B}).attr("y1",z=>{const H=C.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return H.y-B/2}).attr("x2",z=>{const H=C.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),H.x+B}).attr("y2",z=>{const H=C.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return H.y+B/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),_.append("text").attr("x",z=>{const H=C.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?H.x+z.labelOffsetX:H.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const V=z.labelOffsetX??B;return H.x+V}).attr("y",z=>{const H=C.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?H.y+z.labelOffsetY:H.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const V=z.labelOffsetY??B;return H.y+V}).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(H=>{const B=H.coordinates.map(V=>({x:v(V.x),y:x(V.y)}));if(B.length>1)for(let V=0;V{const q=z.append("g").attr("class","wardley-annotation");q.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),q.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.number)})}),l.annotationsBox){let H=v(l.annotationsBox.x),B=x(l.annotationsBox.y);const V=10,q=16,G=11,Q=z.append("g").attr("class","wardley-annotations-box"),j=[...l.annotations].filter(Z=>Z.text).sort((Z,J)=>Z.number-J.number),ae=[];if(j.forEach((Z,J)=>{const re=Q.append("text").attr("x",H+V).attr("y",B+V+(J+1)*q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Z.number}. ${Z.text}`);ae.push(re)}),ae.length>0){let Z=0,J=0;ae.forEach(He=>{const ue=He.node(),ce=ue.getComputedTextLength();Z=Math.max(Z,ce);const Te=ue.getBBox();J=Math.max(J,Te.height)});const re=Z+V*2+105,ee=j.length*q+V*2+J/2,me=i.padding,te=h-i.padding-re,$e=i.padding,Oe=d-i.padding-ee;H=Math.max(me,Math.min(H,te)),B=Math.max($e,Math.min(B,Oe)),ae.forEach((He,ue)=>{He.attr("x",H+V).attr("y",B+V+(ue+1)*q)}),Q.insert("rect","text").attr("x",H).attr("y",B).attr("width",re).attr("height",ee).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(H=>{const B=v(H.x),V=x(H.y);z.append("text").attr("x",B).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(H=>{const B=v(H.x),V=x(H.y),q=60,G=30,Q=20,j=` + `},"getStyles"),q1r=W1r,G1r={parser:CYe,get db(){return new TYe},renderer:H1r,styles:q1r};const U1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:G1r},Symbol.toStringTag,{value:"Module"}));var JI=w((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"),sm=w((t,e,r)=>({x:JI(e,`${r} evolution`),y:JI(t,`${r} visibility`)}),"toCoordinates"),qye=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),Y1r=w(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"),j1r=w((t,e)=>{if(Al(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=sm(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=sm(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=sm(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=JI(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=qye(r.fromPort)??qye(r.toPort);const{flow:a,label:s}=Y1r(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=JI(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=sm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=sm(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=sm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=sm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),SYe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await xu("wardley",t);he.debug(e);const r=(n=SYe.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.");j1r(e,r)},"parse")},hT,X1r=(hT=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}},w(hT,"WardleyBuilder"),hT),Vo=new X1r;function EYe(){return We()["wardley-beta"]}w(EYe,"getConfig");function AYe(t,e,r,n,i,a,s,o,l){Vo.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}w(AYe,"addNode");function RYe(t,e,r=!1,n,i){Vo.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(RYe,"addLink");function _Ye(t,e,r){Vo.addTrend({nodeId:t,targetX:e,targetY:r})}w(_Ye,"addTrend");function MYe(t,e,r){Vo.addAnnotation({number:t,coordinates:e,text:r})}w(MYe,"addAnnotation");function LYe(t,e,r){Vo.addNote({text:t,x:e,y:r})}w(LYe,"addNote");function IYe(t,e,r){Vo.addAccelerator({name:t,x:e,y:r})}w(IYe,"addAccelerator");function $Ye(t,e,r){Vo.addDeaccelerator({name:t,x:e,y:r})}w($Ye,"addDeaccelerator");function NYe(t,e){Vo.setAnnotationsBox(t,e)}w(NYe,"setAnnotationsBox");function DYe(t,e){Vo.setSize(t,e)}w(DYe,"setSize");function OYe(t){Vo.startPipeline(t)}w(OYe,"startPipeline");function PYe(t,e){Vo.addPipelineComponent(t,e)}w(PYe,"addPipelineComponent");function BYe(t){Vo.setAxes(t)}w(BYe,"updateAxes");function FYe(t){return Vo.getNode(t)}w(FYe,"getNode");function zYe(t){return Vo.resolveNodeId(t)}w(zYe,"resolveNodeId");function HYe(){return Vo.build()}w(HYe,"getWardleyData");function VYe(){Vo.clear(),wi()}w(VYe,"clear");var K1r={getConfig:EYe,addNode:AYe,addLink:RYe,addTrend:_Ye,addAnnotation:MYe,addNote:LYe,addAccelerator:IYe,addDeaccelerator:$Ye,setAnnotationsBox:NYe,setSize:DYe,startPipeline:OYe,addPipelineComponent:PYe,updateAxes:BYe,getNode:FYe,resolveNodeId:zYe,getWardleyData:HYe,clear:VYe,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},Z1r=["Genesis","Custom Built","Product","Commodity"],Q1r=w(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=We();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"),J1r=w(()=>{const t=We()["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"),eyr=w((t,e,r,n)=>{var $,F;he.debug(`Rendering Wardley map +`+t);const i=J1r(),a=Q1r(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=(($=l.size)==null?void 0:$.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=Po(e);f.selectAll("*").remove(),_a(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=w(z=>i.padding+z/100*m,"projectX"),x=w(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 T=l.axes.xLabel??"Evolution",k=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(T),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(k);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:Z1r;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),H=l.axes.stageBoundaries,B=[];if(H&&H.length===S.length){let V=0;H.forEach(q=>{B.push({start:V,end:q}),V=q})}else{const V=1/S.length;S.forEach((q,G)=>{B.push({start:G*V,end:(G+1)*V})})}S.forEach((V,q)=>{const G=B[q],Q=i.padding+G.start*m,j=i.padding+G.end*m,ae=(Q+j)/2;q>0&&z.append("line").attr("x1",Q).attr("x2",Q).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",ae).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(V)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let H=1;H<4;H++){const B=H/4,V=i.padding+m*B;z.append("line").attr("x1",V).attr("x2",V).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 C=new Map;if(l.nodes.forEach(z=>{C.set(z.id,{x:v(z.x),y:x(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),H=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const V=B.componentIds.map(j=>({id:j,pos:C.get(j),node:l.nodes.find(ae=>ae.id===j)})).filter(j=>j.pos&&j.node).sort((j,ae)=>j.node.x-ae.node.x);for(let j=0;j{const ae=C.get(j);ae&&(q=Math.min(q,ae.x),G=Math.max(G,ae.x),Q=ae.y)}),q!==1/0&&G!==-1/0){const ae=i.nodeRadius*4,Z=Q-ae/2,J=C.get(B.nodeId);if(J){const re=(q+G)/2;J.x=re,J.y=Z-s/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",q-15).attr("y",Z).attr("width",G-q+30).attr("height",ae).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"),A=new Map;l.pipelines.forEach(z=>{A.set(z.nodeId,new Set(z.componentIds))});const M=l.links.filter(z=>{if(!C.has(z.source)||!C.has(z.target))return!1;const H=A.get(z.target);return!(H!=null&&H.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 H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q);return H.x+G/j*q}).attr("y1",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q);return H.y+Q/j*q}).attr("x2",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=H.x-B.x,Q=H.y-B.y,j=Math.sqrt(G*G+Q*Q);return B.x+G/j*q}).attr("y2",z=>{const H=C.get(z.source),B=C.get(z.target),q=l.nodes.find(ae=>ae.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=H.x-B.x,Q=H.y-B.y,j=Math.sqrt(G*G+Q*Q);return B.y+Q/j*q}).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 H=C.get(z.source),B=C.get(z.target),V=(H.x+B.x)/2,q=B.y-H.y,G=B.x-H.x,Q=Math.sqrt(G*G+q*q),j=8,ae=q/Q;return V+ae*j}).attr("y",z=>{const H=C.get(z.source),B=C.get(z.target),V=(H.y+B.y)/2,q=B.x-H.x,G=B.y-H.y,Q=Math.sqrt(q*q+G*G),j=8,ae=-q/Q;return V+ae*j}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const H=C.get(z.source),B=C.get(z.target),V=(H.x+B.x)/2,q=(H.y+B.y)/2,G=B.x-H.x,Q=B.y-H.y,j=Math.sqrt(G*G+Q*Q),ae=8,Z=Q/j,J=-G/j,re=V+Z*ae,ee=q+J*ae;let me=Math.atan2(Q,G)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${re} ${ee})`}).text(z=>z.label);const L=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const H=C.get(z.nodeId);if(!H)return null;const B=v(z.targetX),V=x(z.targetY),q=B-H.x,G=V-H.y,Q=Math.sqrt(q*q+G*G),j=i.nodeRadius+2,ae=Q>j?B-q/Q*j:B,Z=Q>j?V-G/Q*j:V;return{origin:H,targetX:B,targetY:V,adjustedX2:ae,adjustedY2:Z}}).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 _=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(" "));_.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=_.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const O=i.nodeRadius*.7,D=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x).attr("y1",z=>C.get(z.id).y-D).attr("x2",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("y2",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("y1",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("x2",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("y2",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("y1",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("x2",z=>C.get(z.id).x).attr("y2",z=>C.get(z.id).y-D).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x).attr("cy",z=>C.get(z.id).y-D).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x-D*Math.cos(Math.PI/6)).attr("cy",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>C.get(z.id).x+D*Math.cos(Math.PI/6)).attr("cy",z=>C.get(z.id).y+D*Math.sin(Math.PI/6)).attr("r",O).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),_.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>C.get(z.id).x-s/2).attr("y",z=>C.get(z.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),_.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const H=C.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),H.x+B}).attr("y1",z=>{const H=C.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return H.y-B/2}).attr("x2",z=>{const H=C.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),H.x+B}).attr("y2",z=>{const H=C.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return H.y+B/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),_.append("text").attr("x",z=>{const H=C.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?H.x+z.labelOffsetX:H.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const V=z.labelOffsetX??B;return H.x+V}).attr("y",z=>{const H=C.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?H.y+z.labelOffsetY:H.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const V=z.labelOffsetY??B;return H.y+V}).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(H=>{const B=H.coordinates.map(V=>({x:v(V.x),y:x(V.y)}));if(B.length>1)for(let V=0;V{const q=z.append("g").attr("class","wardley-annotation");q.append("circle").attr("cx",V.x).attr("cy",V.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),q.append("text").attr("x",V.x).attr("y",V.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.number)})}),l.annotationsBox){let H=v(l.annotationsBox.x),B=x(l.annotationsBox.y);const V=10,q=16,G=11,Q=z.append("g").attr("class","wardley-annotations-box"),j=[...l.annotations].filter(Z=>Z.text).sort((Z,J)=>Z.number-J.number),ae=[];if(j.forEach((Z,J)=>{const re=Q.append("text").attr("x",H+V).attr("y",B+V+(J+1)*q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Z.number}. ${Z.text}`);ae.push(re)}),ae.length>0){let Z=0,J=0;ae.forEach(He=>{const ue=He.node(),ce=ue.getComputedTextLength();Z=Math.max(Z,ce);const Te=ue.getBBox();J=Math.max(J,Te.height)});const re=Z+V*2+105,ee=j.length*q+V*2+J/2,me=i.padding,te=h-i.padding-re,$e=i.padding,Oe=d-i.padding-ee;H=Math.max(me,Math.min(H,te)),B=Math.max($e,Math.min(B,Oe)),ae.forEach((He,ue)=>{He.attr("x",H+V).attr("y",B+V+(ue+1)*q)}),Q.insert("rect","text").attr("x",H).attr("y",B).attr("width",re).attr("height",ee).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(H=>{const B=v(H.x),V=x(H.y);z.append("text").attr("x",B).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(H=>{const B=v(H.x),V=x(H.y),q=60,G=30,Q=20,j=` M ${B} ${V-G/2} L ${B+q-Q} ${V-G/2} L ${B+q-Q} ${V-G/2-8} @@ -4698,7 +4711,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error L ${B+Q} ${V+G/2} L ${B+q} ${V+G/2} Z - `;z.append("path").attr("d",j).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+q/2).attr("y",V+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.name)})}},"draw"),X1r={draw:j1r},K1r=w(({wardley:t}={})=>{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(n.wardley,t);return` + `;z.append("path").attr("d",j).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+q/2).attr("y",V+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(H.name)})}},"draw"),tyr={draw:eyr},ryr=w(({wardley:t}={})=>{const e=l0(),r=pr(),n=Gi(e,r.themeVariables),i=Gi(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -4756,7 +4769,7 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Z1r={parser:TYe,db:q1r,renderer:X1r,styles:K1r};const Q1r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Z1r},Symbol.toStringTag,{value:"Module"}));var zYe=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),T7=zYe(),J1r=w(()=>T7.domains,"getDomains"),eyr=w(()=>T7.transitions,"getTransitions"),tyr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));T7.domains.set(r,{name:r,items:n})}},"setDomains"),ryr=w(t=>{t&&(T7.transitions=t.filter(e=>e.from===e.to?(he.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"),nyr=w(()=>Gi({...xn.cynefin,...pr().cynefin}),"getConfig"),iyr=w(()=>{wi(),T7=zYe()},"clear"),T_={getDomains:J1r,getTransitions:eyr,setDomains:tyr,setTransitions:ryr,getConfig:nyr,clear:iyr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},ayr=w(t=>{Al(t,T_),T_.setDomains(t.domains),T_.setTransitions(t.transitions)},"populate"),syr={parse:w(async t=>{const e=await xu("cynefin",t);he.debug(e),ayr(e)},"parse")};function Q6(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}w(Q6,"seededRandom");function HYe(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"),lyr=w(()=>{const t=l0(),e=pr();return Gi(t,e.themeVariables).cynefin},"getCynefinDomainColors"),$H=3,cyr=w((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=lyr();he.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,x=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},T=Po(e);_a(T,x,v,h.useMaxWidth??!0),T.attr("viewBox",`0 0 ${v} ${x}`),l&&T.append("title").text(l),u&&T.append("desc").text(u);const k=T.append("g").attr("transform",`translate(${g}, ${g})`),S=oyr(f,p),C=VYe(h.seed,e),E=k.append("g").attr("class","cynefin-backgrounds"),A=["complex","complicated","chaotic","clear"];for(const $ of A){const F=S[$];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[$]).attr("fill-opacity",.4).attr("stroke","none")}const M=k.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",WYe(f,p,C,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",qYe(f,p,C+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",GYe(f,p)).attr("fill","none");const L=f*.15,P=p*.15;k.append("path").attr("class","cynefinConfusion").attr("d",UYe(f/2,p/2,L,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const N=k.append("g").attr("class","cynefin-labels");for(const $ of A){const F=S[$];N.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($.charAt(0).toUpperCase()+$.slice(1))}if(N.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 $=k.append("g").attr("class","cynefin-subtitles");for(const F of A){const z=S[F],H=qye[F];$.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(H.model),$.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(H.practice)}$.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(qye.confusion.practice)}const _=k.append("g").attr("class","cynefin-items"),I=26,O=10,D=["complex","complicated","chaotic","clear","confusion"];for(const $ of D){const F=a.get($);if(!F||F.items.length===0)continue;const z=S[$],H=$==="confusion";let B=F.items,V=0;H&&F.items.length>$H&&(V=F.items.length-$H,B=F.items.slice(0,$H));let q;if(H){const G=m?22:14;q=z.cy+G}else q=z.cy+(m?25:15);if([...B].forEach((G,Q)=>{const j=q+Q*(I+4),ae=_.append("g"),Z=ae.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let J=G.label.length*7;const re=Z.node();if(re&&typeof re.getBBox=="function"){const te=re.getBBox();te.width>0&&(J=te.width)}const ee=J+O*2,me=z.cx-ee/2;ae.attr("transform",`translate(${me}, ${j})`),ae.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ee).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[$]).attr("fill-opacity",.95),Z.attr("x",ee/2).attr("y",I/2)}),V>0){const G=q+B.length*(I+4),Q=`+${V} more`,j=_.append("g"),ae=j.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Q);let Z=Q.length*7;const J=ae.node();if(J&&typeof J.getBBox=="function"){const me=J.getBBox();me.width>0&&(Z=me.width)}const re=Z+O*2,ee=z.cx-re/2;j.attr("transform",`translate(${ee}, ${G})`),j.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",re).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[$]).attr("fill-opacity",.6),ae.attr("x",re/2).attr("y",I/2)}}if(s.length>0){const $=T.select("defs").empty()?T.append("defs"):T.select("defs"),F=`cynefin-arrow-${e}`;$.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=k.append("g").attr("class","cynefin-arrows");s.forEach(H=>{const B=S[H.from],V=S[H.to];if(!B||!V)return;if(H.from===H.to){he.warn(`Cynefin renderer: skipping self-loop on domain "${H.from}"`);return}const q=B.cx,G=B.cy,Q=V.cx,j=V.cy,ae=(q+Q)/2,Z=(G+j)/2,J=Q-q,re=j-G,ee=Math.sqrt(J*J+re*re),me=ee*.15,te=-re/ee,$e=J/ee,Oe=ae+te*me,He=Z+$e*me;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${q},${G} Q${Oe},${He} ${Q},${j}`).attr("fill","none").attr("marker-end",`url(#${F})`),H.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",Oe).attr("y",He-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(H.label)})}o&&k.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),uyr={draw:cyr},hyr=w(()=>{const t=l0(),e=pr();return Gi(t,e.themeVariables).cynefin},"getCynefinTheme"),dyr=w(()=>{const t=hyr();return` + `},"styles"),nyr={parser:SYe,db:K1r,renderer:tyr,styles:ryr};const iyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:nyr},Symbol.toStringTag,{value:"Module"}));var WYe=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),k7=WYe(),ayr=w(()=>k7.domains,"getDomains"),syr=w(()=>k7.transitions,"getTransitions"),oyr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));k7.domains.set(r,{name:r,items:n})}},"setDomains"),lyr=w(t=>{t&&(k7.transitions=t.filter(e=>e.from===e.to?(he.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"),cyr=w(()=>Gi({...xn.cynefin,...pr().cynefin}),"getConfig"),uyr=w(()=>{wi(),k7=WYe()},"clear"),k_={getDomains:ayr,getTransitions:syr,setDomains:oyr,setTransitions:lyr,getConfig:cyr,clear:uyr,setAccTitle:$i,getAccTitle:Yi,setDiagramTitle:qi,getDiagramTitle:Di,getAccDescription:Xi,setAccDescription:ji},hyr=w(t=>{Al(t,k_),k_.setDomains(t.domains),k_.setTransitions(t.transitions)},"populate"),dyr={parse:w(async t=>{const e=await xu("cynefin",t);he.debug(e),hyr(e)},"parse")};function J6(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}w(J6,"seededRandom");function qYe(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"),pyr=w(()=>{const t=l0(),e=pr();return Gi(t,e.themeVariables).cynefin},"getCynefinDomainColors"),DH=3,gyr=w((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=pyr();he.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,x=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},T=Po(e);_a(T,x,v,h.useMaxWidth??!0),T.attr("viewBox",`0 0 ${v} ${x}`),l&&T.append("title").text(l),u&&T.append("desc").text(u);const k=T.append("g").attr("transform",`translate(${g}, ${g})`),S=fyr(f,p),C=GYe(h.seed,e),E=k.append("g").attr("class","cynefin-backgrounds"),A=["complex","complicated","chaotic","clear"];for(const $ of A){const F=S[$];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[$]).attr("fill-opacity",.4).attr("stroke","none")}const M=k.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",UYe(f,p,C,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",YYe(f,p,C+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",jYe(f,p)).attr("fill","none");const L=f*.15,P=p*.15;k.append("path").attr("class","cynefinConfusion").attr("d",XYe(f/2,p/2,L,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const N=k.append("g").attr("class","cynefin-labels");for(const $ of A){const F=S[$];N.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($.charAt(0).toUpperCase()+$.slice(1))}if(N.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 $=k.append("g").attr("class","cynefin-subtitles");for(const F of A){const z=S[F],H=Gye[F];$.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(H.model),$.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(H.practice)}$.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Gye.confusion.practice)}const _=k.append("g").attr("class","cynefin-items"),I=26,O=10,D=["complex","complicated","chaotic","clear","confusion"];for(const $ of D){const F=a.get($);if(!F||F.items.length===0)continue;const z=S[$],H=$==="confusion";let B=F.items,V=0;H&&F.items.length>DH&&(V=F.items.length-DH,B=F.items.slice(0,DH));let q;if(H){const G=m?22:14;q=z.cy+G}else q=z.cy+(m?25:15);if([...B].forEach((G,Q)=>{const j=q+Q*(I+4),ae=_.append("g"),Z=ae.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let J=G.label.length*7;const re=Z.node();if(re&&typeof re.getBBox=="function"){const te=re.getBBox();te.width>0&&(J=te.width)}const ee=J+O*2,me=z.cx-ee/2;ae.attr("transform",`translate(${me}, ${j})`),ae.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ee).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[$]).attr("fill-opacity",.95),Z.attr("x",ee/2).attr("y",I/2)}),V>0){const G=q+B.length*(I+4),Q=`+${V} more`,j=_.append("g"),ae=j.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Q);let Z=Q.length*7;const J=ae.node();if(J&&typeof J.getBBox=="function"){const me=J.getBBox();me.width>0&&(Z=me.width)}const re=Z+O*2,ee=z.cx-re/2;j.attr("transform",`translate(${ee}, ${G})`),j.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",re).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[$]).attr("fill-opacity",.6),ae.attr("x",re/2).attr("y",I/2)}}if(s.length>0){const $=T.select("defs").empty()?T.append("defs"):T.select("defs"),F=`cynefin-arrow-${e}`;$.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=k.append("g").attr("class","cynefin-arrows");s.forEach(H=>{const B=S[H.from],V=S[H.to];if(!B||!V)return;if(H.from===H.to){he.warn(`Cynefin renderer: skipping self-loop on domain "${H.from}"`);return}const q=B.cx,G=B.cy,Q=V.cx,j=V.cy,ae=(q+Q)/2,Z=(G+j)/2,J=Q-q,re=j-G,ee=Math.sqrt(J*J+re*re),me=ee*.15,te=-re/ee,$e=J/ee,Oe=ae+te*me,He=Z+$e*me;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${q},${G} Q${Oe},${He} ${Q},${j}`).attr("fill","none").attr("marker-end",`url(#${F})`),H.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",Oe).attr("y",He-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(H.label)})}o&&k.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),myr={draw:gyr},yyr=w(()=>{const t=l0(),e=pr();return Gi(t,e.themeVariables).cynefin},"getCynefinTheme"),vyr=w(()=>{const t=yyr();return` .cynefinDomain { stroke: none; } @@ -4817,8 +4830,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),fyr=dyr,pyr={parser:syr,db:T_,renderer:uyr,styles:fyr};const gyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:pyr},Symbol.toStringTag,{value:"Module"}));var mie="",yie="",vie="",bie=[],QI=new Map,Dp=w(t=>Tn(t,We()),"sanitizeText"),I2=w(t=>{switch(t.type){case"terminal":return{...t,value:Dp(t.value)};case"nonterminal":return{...t,name:Dp(t.name)};case"sequence":return{...t,elements:t.elements.map(I2)};case"choice":return{...t,alternatives:t.alternatives.map(I2)};case"optional":return{...t,element:I2(t.element)};case"repetition":return{...t,element:I2(t.element),separator:t.separator?I2(t.separator):void 0};case"special":return{...t,text:Dp(t.text)}}},"sanitizeAstNode"),myr=w(()=>{mie="",yie="",vie="",bie.length=0,QI.clear(),wi(),he.debug("[Railroad] Database cleared")},"clear"),YYe=w(t=>{mie=Dp(t),he.debug("[Railroad] Title set:",t)},"setTitle"),jYe=w(()=>mie,"getTitle"),yyr=w(t=>{const e={...t,name:Dp(t.name),definition:I2(t.definition),comment:t.comment?Dp(t.comment):void 0};he.debug("[Railroad] Adding rule:",e.name),QI.has(e.name)&&he.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),bie.push(e),QI.set(e.name,e)},"addRule"),vyr=w(()=>bie,"getRules"),byr=w(t=>QI.get(t),"getRule"),xyr=w(t=>{yie=Dp(t).replace(/^\s+/g,""),he.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),wyr=w(()=>yie,"getAccTitle"),Tyr=w(t=>{vie=Dp(t).replace(/\n\s+/g,` -`),he.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),kyr=w(()=>vie,"getAccDescription"),Cyr=YYe,Syr=jYe,Wi={clear:myr,setTitle:YYe,getTitle:jYe,addRule:yyr,getRules:vyr,getRule:byr,setAccTitle:xyr,getAccTitle:wyr,setAccDescription:Tyr,getAccDescription:kyr,setDiagramTitle:Cyr,getDiagramTitle:Syr},Us={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},Eyr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Ayr=/^[\w "',.-]+$/,Ryr=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"]),XYe=w(t=>t?Object.keys(t).every(e=>e==="railroad"||Ryr.has(e)):!1,"isRailroadStyleOptions"),_yr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:XYe(t)?t:{}:{},"extractRailroadOverrides"),Myr=w(t=>{if(!t||XYe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),fi=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Eyr.test(r)?r:e},"sanitizeColorValue"),KYe=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Ayr.test(r)?r:e},"sanitizeFontFamilyValue"),om=w((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"),Lyr=w(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"),Iyr=w(t=>{const e=KYe(t.fontFamily,Us.fontFamily),r=Lyr(t.fontSize)??Us.fontSize;return{...Us,fontFamily:e,fontSize:r,terminalFill:fi(t.secondBkg??t.secondaryColor,Us.terminalFill),terminalStroke:fi(t.secondaryBorderColor??t.lineColor,Us.terminalStroke),terminalTextColor:fi(t.secondaryTextColor??t.textColor,Us.terminalTextColor),nonTerminalFill:fi(t.mainBkg??t.background,Us.nonTerminalFill),nonTerminalStroke:fi(t.primaryBorderColor??t.lineColor,Us.nonTerminalStroke),nonTerminalTextColor:fi(t.primaryTextColor??t.textColor,Us.nonTerminalTextColor),lineColor:fi(t.lineColor,Us.lineColor),markerFill:fi(t.lineColor,Us.markerFill),commentFill:fi(t.labelBackground??t.tertiaryColor,Us.commentFill),commentStroke:fi(t.tertiaryBorderColor??t.lineColor,Us.commentStroke),commentTextColor:fi(t.tertiaryTextColor??t.textColor,Us.commentTextColor),specialFill:fi(t.tertiaryColor??t.secondaryColor,Us.specialFill),specialStroke:fi(t.tertiaryBorderColor??t.secondaryBorderColor,Us.specialStroke),ruleNameColor:fi(t.titleColor??t.textColor,Us.ruleNameColor)}},"buildThemeDefaults"),xie=w(t=>{const e=pr(),r={...l0(),...e.themeVariables??{},...Myr(t)},n=Iyr(r),i={...e.railroad??{},..._yr(t)};return{compactMode:i.compactMode??n.compactMode,padding:om(i.padding,n.padding),verticalSeparation:om(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:om(i.horizontalSeparation,n.horizontalSeparation),arcRadius:om(i.arcRadius,n.arcRadius),fontSize:om(i.fontSize,n.fontSize),fontFamily:KYe(i.fontFamily,n.fontFamily),terminalFill:fi(i.terminalFill,n.terminalFill),terminalStroke:fi(i.terminalStroke,n.terminalStroke),terminalTextColor:fi(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:fi(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:fi(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:fi(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:fi(i.lineColor,n.lineColor),strokeWidth:om(i.strokeWidth,n.strokeWidth),markerFill:fi(i.markerFill,n.markerFill),commentFill:fi(i.commentFill,n.commentFill),commentStroke:fi(i.commentStroke,n.commentStroke),commentTextColor:fi(i.commentTextColor,n.commentTextColor),specialFill:fi(i.specialFill,n.specialFill),specialStroke:fi(i.specialStroke,n.specialStroke),ruleNameColor:fi(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:om(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),PO=w(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}=xie(t);return` + `},"styles"),byr=vyr,xyr={parser:dyr,db:k_,renderer:myr,styles:byr};const wyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xyr},Symbol.toStringTag,{value:"Module"}));var vie="",bie="",xie="",wie=[],e$=new Map,Dp=w(t=>Tn(t,We()),"sanitizeText"),I2=w(t=>{switch(t.type){case"terminal":return{...t,value:Dp(t.value)};case"nonterminal":return{...t,name:Dp(t.name)};case"sequence":return{...t,elements:t.elements.map(I2)};case"choice":return{...t,alternatives:t.alternatives.map(I2)};case"optional":return{...t,element:I2(t.element)};case"repetition":return{...t,element:I2(t.element),separator:t.separator?I2(t.separator):void 0};case"special":return{...t,text:Dp(t.text)}}},"sanitizeAstNode"),Tyr=w(()=>{vie="",bie="",xie="",wie.length=0,e$.clear(),wi(),he.debug("[Railroad] Database cleared")},"clear"),KYe=w(t=>{vie=Dp(t),he.debug("[Railroad] Title set:",t)},"setTitle"),ZYe=w(()=>vie,"getTitle"),kyr=w(t=>{const e={...t,name:Dp(t.name),definition:I2(t.definition),comment:t.comment?Dp(t.comment):void 0};he.debug("[Railroad] Adding rule:",e.name),e$.has(e.name)&&he.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),wie.push(e),e$.set(e.name,e)},"addRule"),Cyr=w(()=>wie,"getRules"),Syr=w(t=>e$.get(t),"getRule"),Eyr=w(t=>{bie=Dp(t).replace(/^\s+/g,""),he.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Ayr=w(()=>bie,"getAccTitle"),Ryr=w(t=>{xie=Dp(t).replace(/\n\s+/g,` +`),he.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),_yr=w(()=>xie,"getAccDescription"),Myr=KYe,Lyr=ZYe,Wi={clear:Tyr,setTitle:KYe,getTitle:ZYe,addRule:kyr,getRules:Cyr,getRule:Syr,setAccTitle:Eyr,getAccTitle:Ayr,setAccDescription:Ryr,getAccDescription:_yr,setDiagramTitle:Myr,getDiagramTitle:Lyr},Us={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},Iyr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,$yr=/^[\w "',.-]+$/,Nyr=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"]),QYe=w(t=>t?Object.keys(t).every(e=>e==="railroad"||Nyr.has(e)):!1,"isRailroadStyleOptions"),Dyr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:QYe(t)?t:{}:{},"extractRailroadOverrides"),Oyr=w(t=>{if(!t||QYe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),fi=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Iyr.test(r)?r:e},"sanitizeColorValue"),JYe=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return $yr.test(r)?r:e},"sanitizeFontFamilyValue"),om=w((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"),Pyr=w(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"),Byr=w(t=>{const e=JYe(t.fontFamily,Us.fontFamily),r=Pyr(t.fontSize)??Us.fontSize;return{...Us,fontFamily:e,fontSize:r,terminalFill:fi(t.secondBkg??t.secondaryColor,Us.terminalFill),terminalStroke:fi(t.secondaryBorderColor??t.lineColor,Us.terminalStroke),terminalTextColor:fi(t.secondaryTextColor??t.textColor,Us.terminalTextColor),nonTerminalFill:fi(t.mainBkg??t.background,Us.nonTerminalFill),nonTerminalStroke:fi(t.primaryBorderColor??t.lineColor,Us.nonTerminalStroke),nonTerminalTextColor:fi(t.primaryTextColor??t.textColor,Us.nonTerminalTextColor),lineColor:fi(t.lineColor,Us.lineColor),markerFill:fi(t.lineColor,Us.markerFill),commentFill:fi(t.labelBackground??t.tertiaryColor,Us.commentFill),commentStroke:fi(t.tertiaryBorderColor??t.lineColor,Us.commentStroke),commentTextColor:fi(t.tertiaryTextColor??t.textColor,Us.commentTextColor),specialFill:fi(t.tertiaryColor??t.secondaryColor,Us.specialFill),specialStroke:fi(t.tertiaryBorderColor??t.secondaryBorderColor,Us.specialStroke),ruleNameColor:fi(t.titleColor??t.textColor,Us.ruleNameColor)}},"buildThemeDefaults"),Tie=w(t=>{const e=pr(),r={...l0(),...e.themeVariables??{},...Oyr(t)},n=Byr(r),i={...e.railroad??{},...Dyr(t)};return{compactMode:i.compactMode??n.compactMode,padding:om(i.padding,n.padding),verticalSeparation:om(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:om(i.horizontalSeparation,n.horizontalSeparation),arcRadius:om(i.arcRadius,n.arcRadius),fontSize:om(i.fontSize,n.fontSize),fontFamily:JYe(i.fontFamily,n.fontFamily),terminalFill:fi(i.terminalFill,n.terminalFill),terminalStroke:fi(i.terminalStroke,n.terminalStroke),terminalTextColor:fi(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:fi(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:fi(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:fi(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:fi(i.lineColor,n.lineColor),strokeWidth:om(i.strokeWidth,n.strokeWidth),markerFill:fi(i.markerFill,n.markerFill),commentFill:fi(i.commentFill,n.commentFill),commentStroke:fi(i.commentStroke,n.commentStroke),commentTextColor:fi(i.commentTextColor,n.commentTextColor),specialFill:fi(i.specialFill,n.specialFill),specialStroke:fi(i.specialStroke,n.specialStroke),ruleNameColor:fi(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:om(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),FO=w(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}=Tie(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -4903,8 +4916,8 @@ Expecting `+re.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ee="Parse error .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),dT,Wc=(dT=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()}},w(dT,"PathBuilder"),dT),fT,$yr=(fT=class{constructor(e,r=xie()){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 Wc,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,x,s,d+(x?s:-s)).lineTo(s,g-(x?s:-s)).arcTo(s,s,0,!1,!x,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new Wc,T=m+f.dimensions.width,k=l-s*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(k,g).arcTo(s,s,0,!1,!x,l-s,g+(x?-s:s)).lineTo(l-s,d+(x?s:-s)).arcTo(s,s,0,!1,x,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 Wc().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Wc().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Wc().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 Wc().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Wc().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new Wc().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 Wc().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 Wc().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Wc().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}}},w(fT,"RailroadRenderer"),fT),Gye=w((t,e,r)=>{_a(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),Nyr=w((t,e,r)=>{he.debug(`[Railroad] Rendering diagram -`+t);try{const n=Po(e);n.attr("class","railroad-diagram");const i=pr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=Wi.getRules();if(he.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){he.warn("[Railroad] No rules to render"),Gye(n,{height:100,width:200},a);return}const l=new $yr(n,xie()).renderDiagram(s);Gye(n,l,a),he.debug("[Railroad] Render complete")}catch(n){throw he.error("[Railroad] Render error:",n),n}},"draw"),BO={draw:Nyr},Dyr=yne().Railroad.parser.LangiumParser,$2=w(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($2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map($2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:$2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:$2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:$2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),Oyr=w(t=>({name:t.name,definition:$2(t.definition)}),"transformRule"),Pyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Oyr(e)))},"populateDb"),Byr={parse:w(t=>{Wi.clear(),he.debug("[Railroad Parser] Starting Langium parse");const e=Dyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new v7(e);const r=e.value;he.debug("[Railroad Parser] Parsed rules:",r.rules.length),Pyr(r),he.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Wi}},Fyr={parser:Byr,db:Wi,renderer:BO,styles:PO};const zyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fyr},Symbol.toStringTag,{value:"Module"}));var Hyr=vne().RailroadEbnf.parser.LangiumParser,k_=w(t=>{const e=t.alternatives.map(Vyr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),Vyr=w(t=>{const e=t.elements.map(qyr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),ZYe=w(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 k_(t.element);case"EbnfOptional":return{type:"optional",element:k_(t.element)};case"EbnfRepetition":return{type:"repetition",element:k_(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),Wyr=w((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:"-"},ZYe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),qyr=w(t=>t.postfixes.reduce((e,r)=>Wyr(e,r),ZYe(t.base)),"transformTerm"),Gyr=w(t=>({name:t.name,definition:k_(t.definition)}),"transformRule"),Uyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Gyr(e)))},"populateDb"),Yyr={parse:w(t=>{Wi.clear(),he.debug("[EBNF Parser] Starting Langium parse");const e=Hyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new v7(e);const r=e.value;he.debug("[EBNF Parser] Parsed rules:",r.rules.length),Uyr(r),he.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},jyr={parser:Yyr,db:Wi,renderer:BO,styles:PO};const Xyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:jyr},Symbol.toStringTag,{value:"Module"}));var Kyr=bne().RailroadAbnf.parser.LangiumParser,cX=w(t=>{const e=t.alternatives.map(Zyr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Zyr=w(t=>{const e=t.elements.map(Jyr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),Qyr=w(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"),Jyr=w(t=>{const e=evr(t.primary);if(!t.repeat)return e;const{min:r,max:n}=Qyr(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),evr=w(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 cX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:cX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),tvr=w(t=>({name:t.name,definition:cX(t.definition)}),"transformRule"),rvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(tvr(e)))},"populateDb"),nvr={parse:w(t=>{Wi.clear(),he.debug("[ABNF Parser] Starting Langium parse");const e=Kyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new v7(e);const r=e.value;he.debug("[ABNF Parser] Parsed rules:",r.rules.length),rvr(r),he.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},ivr={parser:nvr,db:Wi,renderer:BO,styles:PO};const avr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ivr},Symbol.toStringTag,{value:"Module"}));var svr=xne().RailroadPeg.parser.LangiumParser,QYe=w(t=>{const e=t.alternatives.map(ovr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),ovr=w(t=>{const e=t.elements.map(lvr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),lvr=w(t=>{const e=cvr(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Uye(e)}`:`!${Uye(e)}`}:e},"transformPrefix"),Uye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),cvr=w(t=>{const e=uvr(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"),uvr=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return QYe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),hvr=w(t=>({name:t.name,definition:QYe(t.definition)}),"transformRule"),dvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(hvr(e)))},"populateDb"),fvr={parse:w(t=>{Wi.clear(),he.debug("[PEG Parser] Starting Langium parse");const e=svr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new v7(e);const r=e.value;he.debug("[PEG Parser] Parsed rules:",r.rules.length),dvr(r),he.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Wi}},pvr={parser:fvr,db:Wi,renderer:BO,styles:PO};const gvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:pvr},Symbol.toStringTag,{value:"Module"}));var mvr=1;function wie(){if(!(typeof globalThis>"u"))return globalThis}w(wie,"getCaptureGlobal");function JYe(){var t;return!!((t=wie())!=null&&t.mermaidCaptureSizes)}w(JYe,"shouldCaptureSizes");function eje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(eje,"capturedFromLocation");function tje(t,e){const r=wie();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}w(tje,"emitCapturedSizes");function rje(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&&tje({metadata:{captureVersion:mvr,capturedAt:new Date().toISOString(),capturedFrom:eje()},nodes:r},t)}w(rje,"captureNodeSizes");const yvr=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:rje,shouldCaptureSizes:JYe},Symbol.toStringTag,{value:"Module"})),vvr=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:mWe,createInfoServices:yWe},Symbol.toStringTag,{value:"Module"})),bvr=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:vWe,createPacketServices:bWe},Symbol.toStringTag,{value:"Module"})),xvr=Object.freeze(Object.defineProperty({__proto__:null,PieModule:xWe,createPieServices:wWe},Symbol.toStringTag,{value:"Module"})),wvr=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:TWe,createTreeViewServices:kWe},Symbol.toStringTag,{value:"Module"})),Tvr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:CWe,createArchitectureServices:SWe},Symbol.toStringTag,{value:"Module"})),kvr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:pWe,createGitGraphServices:gWe},Symbol.toStringTag,{value:"Module"})),Cvr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:AWe,createEventModelingServices:RWe},Symbol.toStringTag,{value:"Module"})),Svr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:tWe,createRadarServices:rWe},Symbol.toStringTag,{value:"Module"})),Evr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:nWe,createRailroadServices:yne},Symbol.toStringTag,{value:"Module"})),Avr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:iWe,createRailroadEbnfServices:vne},Symbol.toStringTag,{value:"Module"})),Rvr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:aWe,createRailroadAbnfServices:bne},Symbol.toStringTag,{value:"Module"})),_vr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:sWe,createRailroadPegServices:xne},Symbol.toStringTag,{value:"Module"})),Mvr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:lWe,createTreemapServices:cWe},Symbol.toStringTag,{value:"Module"})),Lvr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:uWe,createWardleyServices:hWe},Symbol.toStringTag,{value:"Module"})),Ivr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:dWe,createCynefinServices:fWe},Symbol.toStringTag,{value:"Module"})); +`},"getStyles"),dT,Wc=(dT=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()}},w(dT,"PathBuilder"),dT),fT,Fyr=(fT=class{constructor(e,r=Tie()){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 Wc,x=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,x,s,d+(x?s:-s)).lineTo(s,g-(x?s:-s)).arcTo(s,s,0,!1,!x,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new Wc,T=m+f.dimensions.width,k=l-s*2;g===d?b.moveTo(T,g).lineTo(l,d):b.moveTo(T,g).lineTo(k,g).arcTo(s,s,0,!1,!x,l-s,g+(x?-s:s)).lineTo(l-s,d+(x?s:-s)).arcTo(s,s,0,!1,x,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 Wc().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Wc().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Wc().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 Wc().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Wc().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new Wc().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 Wc().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 Wc().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Wc().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}}},w(fT,"RailroadRenderer"),fT),Uye=w((t,e,r)=>{_a(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),zyr=w((t,e,r)=>{he.debug(`[Railroad] Rendering diagram +`+t);try{const n=Po(e);n.attr("class","railroad-diagram");const i=pr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=Wi.getRules();if(he.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){he.warn("[Railroad] No rules to render"),Uye(n,{height:100,width:200},a);return}const l=new Fyr(n,Tie()).renderDiagram(s);Uye(n,l,a),he.debug("[Railroad] Render complete")}catch(n){throw he.error("[Railroad] Render error:",n),n}},"draw"),zO={draw:zyr},Hyr=bne().Railroad.parser.LangiumParser,$2=w(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($2);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map($2);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:$2(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:$2(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:$2(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),Vyr=w(t=>({name:t.name,definition:$2(t.definition)}),"transformRule"),Wyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Vyr(e)))},"populateDb"),qyr={parse:w(t=>{Wi.clear(),he.debug("[Railroad Parser] Starting Langium parse");const e=Hyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[Railroad Parser] Parsed rules:",r.rules.length),Wyr(r),he.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:Wi}},Gyr={parser:qyr,db:Wi,renderer:zO,styles:FO};const Uyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Gyr},Symbol.toStringTag,{value:"Module"}));var Yyr=xne().RailroadEbnf.parser.LangiumParser,C_=w(t=>{const e=t.alternatives.map(jyr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),jyr=w(t=>{const e=t.elements.map(Kyr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),eje=w(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 C_(t.element);case"EbnfOptional":return{type:"optional",element:C_(t.element)};case"EbnfRepetition":return{type:"repetition",element:C_(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),Xyr=w((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:"-"},eje(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),Kyr=w(t=>t.postfixes.reduce((e,r)=>Xyr(e,r),eje(t.base)),"transformTerm"),Zyr=w(t=>({name:t.name,definition:C_(t.definition)}),"transformRule"),Qyr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(Zyr(e)))},"populateDb"),Jyr={parse:w(t=>{Wi.clear(),he.debug("[EBNF Parser] Starting Langium parse");const e=Yyr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[EBNF Parser] Parsed rules:",r.rules.length),Qyr(r),he.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},evr={parser:Jyr,db:Wi,renderer:zO,styles:FO};const tvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:evr},Symbol.toStringTag,{value:"Module"}));var rvr=wne().RailroadAbnf.parser.LangiumParser,hX=w(t=>{const e=t.alternatives.map(nvr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),nvr=w(t=>{const e=t.elements.map(avr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),ivr=w(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"),avr=w(t=>{const e=svr(t.primary);if(!t.repeat)return e;const{min:r,max:n}=ivr(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),svr=w(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 hX(t.element);case"AbnfOptionalGroup":return{type:"optional",element:hX(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),ovr=w(t=>({name:t.name,definition:hX(t.definition)}),"transformRule"),lvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(ovr(e)))},"populateDb"),cvr={parse:w(t=>{Wi.clear(),he.debug("[ABNF Parser] Starting Langium parse");const e=rvr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[ABNF Parser] Parsed rules:",r.rules.length),lvr(r),he.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:Wi}},uvr={parser:cvr,db:Wi,renderer:zO,styles:FO};const hvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:uvr},Symbol.toStringTag,{value:"Module"}));var dvr=Tne().RailroadPeg.parser.LangiumParser,tje=w(t=>{const e=t.alternatives.map(fvr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),fvr=w(t=>{const e=t.elements.map(pvr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),pvr=w(t=>{const e=gvr(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Yye(e)}`:`!${Yye(e)}`}:e},"transformPrefix"),Yye=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),gvr=w(t=>{const e=mvr(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"),mvr=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return tje(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),yvr=w(t=>({name:t.name,definition:tje(t.definition)}),"transformRule"),vvr=w(t=>{Al(t,Wi),t.title&&Wi.setTitle(t.title),t.rules.map(e=>Wi.addRule(yvr(e)))},"populateDb"),bvr={parse:w(t=>{Wi.clear(),he.debug("[PEG Parser] Starting Langium parse");const e=dvr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new b7(e);const r=e.value;he.debug("[PEG Parser] Parsed rules:",r.rules.length),vvr(r),he.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:Wi}},xvr={parser:bvr,db:Wi,renderer:zO,styles:FO};const wvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xvr},Symbol.toStringTag,{value:"Module"}));var Tvr=1;function kie(){if(!(typeof globalThis>"u"))return globalThis}w(kie,"getCaptureGlobal");function rje(){var t;return!!((t=kie())!=null&&t.mermaidCaptureSizes)}w(rje,"shouldCaptureSizes");function nje(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(nje,"capturedFromLocation");function ije(t,e){const r=kie();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}w(ije,"emitCapturedSizes");function aje(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&&ije({metadata:{captureVersion:Tvr,capturedAt:new Date().toISOString(),capturedFrom:nje()},nodes:r},t)}w(aje,"captureNodeSizes");const kvr=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:aje,shouldCaptureSizes:rje},Symbol.toStringTag,{value:"Module"})),Cvr=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:bWe,createInfoServices:xWe},Symbol.toStringTag,{value:"Module"})),Svr=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:wWe,createPacketServices:TWe},Symbol.toStringTag,{value:"Module"})),Evr=Object.freeze(Object.defineProperty({__proto__:null,PieModule:kWe,createPieServices:CWe},Symbol.toStringTag,{value:"Module"})),Avr=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:SWe,createTreeViewServices:EWe},Symbol.toStringTag,{value:"Module"})),Rvr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:AWe,createArchitectureServices:RWe},Symbol.toStringTag,{value:"Module"})),_vr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:yWe,createGitGraphServices:vWe},Symbol.toStringTag,{value:"Module"})),Mvr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:MWe,createEventModelingServices:LWe},Symbol.toStringTag,{value:"Module"})),Lvr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:iWe,createRadarServices:aWe},Symbol.toStringTag,{value:"Module"})),Ivr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:sWe,createRailroadServices:bne},Symbol.toStringTag,{value:"Module"})),$vr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:oWe,createRailroadEbnfServices:xne},Symbol.toStringTag,{value:"Module"})),Nvr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:lWe,createRailroadAbnfServices:wne},Symbol.toStringTag,{value:"Module"})),Dvr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:cWe,createRailroadPegServices:Tne},Symbol.toStringTag,{value:"Module"})),Ovr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:hWe,createTreemapServices:dWe},Symbol.toStringTag,{value:"Module"})),Pvr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:fWe,createWardleyServices:pWe},Symbol.toStringTag,{value:"Module"})),Bvr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:gWe,createCynefinServices:mWe},Symbol.toStringTag,{value:"Module"})); diff --git a/apps/ios/EditorSource/src/main.ts b/apps/ios/EditorSource/src/main.ts index 4dd4ee3f..034b9555 100644 --- a/apps/ios/EditorSource/src/main.ts +++ b/apps/ios/EditorSource/src/main.ts @@ -36,6 +36,11 @@ import { generateCardCss, } from "@edgeever/shared/note-image-card"; import { createEdgeEverMathematics } from "./mathematics"; +import { createImageInsertTransaction, createNativeImageGalleryView, groupUploadedImages, NATIVE_IMAGE_GALLERY_CSS } from "@edgeever/shared/native-image-gallery"; + +const galleryStyle = document.createElement("style"); +galleryStyle.textContent = NATIVE_IMAGE_GALLERY_CSS; +document.head.append(galleryStyle); /** Keep in sync with packages/shared MergeDivider (iOS bundle cannot import monorepo shared). */ const MERGE_DIVIDER_MARKDOWN_MARKER = ""; @@ -91,6 +96,7 @@ const ImageGallery = Node.create({ content: "image+", defining: true, isolating: true, + addNodeView() { return createNativeImageGalleryView(() => locale); }, addAttributes() { return { layout: { @@ -1302,6 +1308,7 @@ export type EdgeEverEditorAPI = { exec: (actionId: string) => void; beginImageUpload: (uploadId: string, previewDataUrl: string) => void; completeImageUpload: (uploadId: string, imageUrl: string, alt: string) => void; + groupImages: (sources: string[]) => boolean; cancelImageUpload: (uploadId: string) => void; search: (query: string, requestedIndex: number) => void; exportImage: (request: ImageExportRequest) => void; @@ -1504,22 +1511,19 @@ const api: EdgeEverEditorAPI = { }, completeImageUpload(uploadId, imageUrl, alt) { - // Always mutate ProseMirror via setImage — DOM-only attr writes do not persist. - // Native hydrate rewrites display src under file:// after emitChange. - editor - .chain() - .focus() - .setImage({ src: imageUrl, alt: alt || uploadId || "" }) - .run(); - const imgs = editorEl.querySelectorAll("img"); - const last = imgs[imgs.length - 1] as HTMLImageElement | undefined; - if (last) { - last.dataset.originalSrc = imageUrl; - delete last.dataset.uploadId; - } + if (!editor.isEditable) return; + editor.view.dispatch(createImageInsertTransaction(editor.state, { + src: imageUrl, alt: alt || uploadId || "", + })); emitChange(editor); }, + groupImages(sources) { + const grouped = groupUploadedImages(editor, sources); + if (grouped) emitChange(editor); + return grouped; + }, + cancelImageUpload(uploadId) { const img = editorEl.querySelector(`img[data-upload-id="${uploadId}"]`); img?.remove(); diff --git a/apps/ios/Tests/EdgeEverTests/EditorBundleTests.swift b/apps/ios/Tests/EdgeEverTests/EditorBundleTests.swift index 526efc09..8126c9b5 100644 --- a/apps/ios/Tests/EdgeEverTests/EditorBundleTests.swift +++ b/apps/ios/Tests/EdgeEverTests/EditorBundleTests.swift @@ -1,8 +1,57 @@ import XCTest +import WebKit @testable import EdgeEver /// Ensures the TipTap editor HTML is actually shipped in the app (not the plain-text fallback). final class EditorBundleTests: XCTestCase { + @MainActor + func testNativeImageBatchCreatesAnEditableGallery() async throws { + let url = try XCTUnwrap(TipTapWebView.Coordinator.packagedEditorHTMLURL()) + let loaded = expectation(description: "editor bridge ready") + final class Loader: NSObject, WKScriptMessageHandler { + let loaded: XCTestExpectation + init(_ loaded: XCTestExpectation) { self.loaded = loaded } + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { + if (message.body as? [String: Any])?["type"] as? String == "ready" { loaded.fulfill() } + } + } + let loader = Loader(loaded) + let config = WKWebViewConfiguration() + config.preferences.setValue(true, forKey: "allowFileAccessFromFileURLs") + config.userContentController.add(loader, name: "edgeever") + let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: 390, height: 844), configuration: config) + webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) + await fulfillment(of: [loaded], timeout: 30) + let result = try await webView.evaluateJavaScript(""" + (() => { + const api = window.EdgeEverEditor; + api.configure({mode:'editor', locale:'en-US'}); + api.setDocumentFromJSON(JSON.stringify({type:'doc',content:[{type:'paragraph'}]})); + const images = ['green','red','blue'].map(color => 'data:image/svg+xml,' + encodeURIComponent( + '')); + images.forEach((src, i) => api.completeImageUpload('test-' + i, src, 'photo-' + i)); + const grouped = api.groupImages(images); + const toolbar = document.querySelector('.edgeever-native-gallery-toolbar'); + toolbar?.querySelectorAll('button')[3].click(); + const doc = JSON.parse(api.getDocument()); + const gallery = doc.content.find(node => node.type === 'edgeeverImageGallery'); + const controlsHidden = [...document.querySelectorAll('.edgeever-native-gallery-content .edgeever-image-size-controls')] + .every(node => getComputedStyle(node).display === 'none'); + api.configure({mode:'viewer', locale:'en-US'}); + return { grouped, layout:gallery?.attrs.layout, sources:gallery?.content.map(node => node.attrs.src), + orderPreserved:JSON.stringify(gallery?.content.map(node => node.attrs.src)) === JSON.stringify(images), + controlsHidden, viewerToolbarHidden:toolbar?.hidden }; + })() + """) as? [String: Any] + XCTAssertEqual(result?["grouped"] as? Bool, true) + XCTAssertEqual(result?["layout"] as? String, "1") + XCTAssertEqual((result?["sources"] as? [String])?.count, 3) + XCTAssertEqual(result?["orderPreserved"] as? Bool, true) + XCTAssertEqual(result?["controlsHidden"] as? Bool, true) + XCTAssertEqual(result?["viewerToolbarHidden"] as? Bool, true) + config.userContentController.removeScriptMessageHandler(forName: "edgeever") + } + func testPackagedEditorHTMLIsPresentAndLarge() throws { let url = TipTapWebView.Coordinator.packagedEditorHTMLURL() XCTAssertNotNil(url, "EditorBundle/index.html must be in the app bundle so Markdown renders") diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsx index 1d3cfa9a..169bc1e0 100644 --- a/apps/mobile/src/components/LocalTiptapEditor.tsx +++ b/apps/mobile/src/components/LocalTiptapEditor.tsx @@ -73,6 +73,7 @@ import { generateCardCss, } from "@edgeever/shared/note-image-card"; import { useDOMImperativeHandle, type DOMImperativeFactory, type DOMProps } from "expo/dom"; +import { createImageInsertTransaction, createNativeImageGalleryView, groupUploadedImages, NATIVE_IMAGE_GALLERY_CSS } from "@edgeever/shared/native-image-gallery"; import { useCallback, useEffect, useMemo, useRef, useState, type Dispatch, type ReactNode, type Ref, type SetStateAction } from "react"; import { createMobileImageUploadPlaceholderSource, @@ -103,6 +104,7 @@ export interface LocalTiptapEditorRef extends DOMImperativeFactory { beginImageUpload: (uploadId: DOMValue, previewDataUrl: DOMValue) => void; cancelImageUpload: (uploadId: DOMValue) => void; completeImageUpload: (uploadId: DOMValue, imageUrl: DOMValue, alt: DOMValue) => void; + finishImageBatch: (sources: DOMValue) => void; appendAttachment: (attachmentUrl: DOMValue, filename: DOMValue, mimeType: DOMValue, byteSize: DOMValue) => void; removeResource: (targetJson: DOMValue) => void; renameResource: (targetJson: DOMValue, filename: DOMValue) => void; @@ -694,7 +696,9 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { MergeDivider, ...createEdgeEverMathematics(), mermaidCodeBlockExtension, - ImageGallery, + ImageGallery.extend({ + addNodeView() { return createNativeImageGalleryView(() => props.locale); }, + }), protectedImageExtension, searchHighlightExtension, TableKit.configure({ @@ -841,6 +845,9 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { previewDataUrlValue, pendingImageSelectionRef.current ); + // The initial selection is consumed once; subsequent batch images follow + // the previous placeholder instead of replacing it. + pendingImageSelectionRef.current = null; }, [editor, isViewer, props.locale]); const cancelImageUpload = useCallback((uploadIdValue: DOMValue) => { @@ -862,6 +869,12 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { ); }, [editor, props.baseUrl]); + const finishImageBatch = useCallback((sources: DOMValue) => { + if (!editor || !Array.isArray(sources)) return; + groupUploadedImages(editor, sources.filter((source): source is string => typeof source === "string") + .map((source) => resolveUrl(source, props.baseUrl))); + }, [editor, props.baseUrl]); + const appendAttachment = useCallback(( attachmentUrlValue: DOMValue, filenameValue: DOMValue, @@ -1246,6 +1259,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { beginImageUpload, cancelImageUpload, completeImageUpload, + finishImageBatch, appendAttachment, setContent, flush, @@ -1264,7 +1278,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { pushAiStreamEvent, exportImage, }), - [appendAttachment, beginImageUpload, cancelImageUpload, completeImageUpload, editor, exportImage, flush, isViewer, pushAiStreamEvent, removeResource, renameResource, replaceAll, search, setContent] + [appendAttachment, beginImageUpload, cancelImageUpload, completeImageUpload, finishImageBatch, editor, exportImage, flush, isViewer, pushAiStreamEvent, removeResource, renameResource, replaceAll, search, setContent] ); useEffect(() => { @@ -2763,19 +2777,14 @@ const insertImageUploadPlaceholder = ( if (!imageType) { return; } - editor.chain().command(({ tr, dispatch }) => { - const from = Math.min(selection?.from ?? tr.selection.from, tr.doc.content.size); - const to = Math.min(Math.max(selection?.to ?? tr.selection.to, from), tr.doc.content.size); - tr.replaceRangeWith(from, to, imageType.create({ + const tr = createImageInsertTransaction(editor.state, { alt, src: source, title: previewDataUrl, width: DEFAULT_IMAGE_WIDTH_PERCENT, - })); - tr.setMeta(TRANSIENT_IMAGE_UPLOAD_META, true); - dispatch?.(tr); - return true; - }).run(); + }, selection ?? editor.state.selection); + tr.setMeta(TRANSIENT_IMAGE_UPLOAD_META, true); + editor.view.dispatch(tr); }; const replaceImageUploadPlaceholder = ( @@ -3181,6 +3190,7 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean } [data-edgeever-image-gallery][data-image-gallery-layout="1"] { grid-template-columns: minmax(0, 1fr); } [data-edgeever-image-gallery] > .edgeever-image-node, [data-edgeever-image-gallery] > img { width: 100% !important; min-width: 0; height: 100%; min-height: 112px; max-height: 220px; margin: 0 !important; overflow: hidden; border-radius: 10px; background: ${theme === "dark" ? "#1e293b" : "#f1f5f9"}; } [data-edgeever-image-gallery] > .edgeever-image-node > img, [data-edgeever-image-gallery] > img { width: 100%; height: 100%; min-height: 112px; max-height: 220px; object-fit: cover; } + ${NATIVE_IMAGE_GALLERY_CSS} .edgeever-image-node.is-selected > img, .edgeever-image-upload-result.is-selected > img { outline: 2px solid #0f766e; outline-offset: 3px; } .edgeever-image-actions { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: inline-flex; width: 42px; height: 42px; appearance: none; align-items: center; justify-content: center; border: 1px solid ${theme === "dark" ? "#475569" : "#cbd5e1"}; border-radius: 999px; background: ${theme === "dark" ? "rgba(15, 23, 42, 0.9)" : "rgba(255, 255, 255, 0.92)"}; color: ${theme === "dark" ? "#e2e8f0" : "#334155"}; font-size: 24px; font-weight: 700; line-height: 1; box-shadow: 0 3px 12px rgba(15, 23, 42, 0.2); } .edgeever-image-actions[hidden] { display: none; } diff --git a/apps/mobile/src/hooks/useMobileEditorUploadAsset.tsx b/apps/mobile/src/hooks/useMobileEditorUploadAsset.tsx index f8762339..f0578e62 100644 --- a/apps/mobile/src/hooks/useMobileEditorUploadAsset.tsx +++ b/apps/mobile/src/hooks/useMobileEditorUploadAsset.tsx @@ -6,19 +6,14 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Camera, FileText, Image as ImageIcon, X } from "../components/icons"; import { Alert, Pressable, Text } from "../components/LocalizedText"; import type { MobileImageUploadAsset } from "../lib/mobile-image-upload"; -import { normalizeMobileImagePickerAsset } from "../lib/mobile-image-picker"; +import { normalizeMobileImagePickerAssets } from "../lib/mobile-image-picker"; import { resolveMobileThemeStyles, useMobileTheme } from "../lib/mobile-theme"; type MobileEditorUploadSource = "camera" | "file" | "library"; type SourceResolver = (source: MobileEditorUploadSource | null) => void; const NATIVE_PICKER_PRESENTATION_DELAY_MS = 120; -const getImagePickerAsset = (result: ImagePicker.ImagePickerResult): MobileImageUploadAsset | null => { - if (result.canceled || !result.assets[0]) { - return null; - } - return normalizeMobileImagePickerAsset(result.assets[0]); -}; +const getImagePickerAssets = normalizeMobileImagePickerAssets; const requestCameraAccess = async () => { const current = await ImagePicker.getCameraPermissionsAsync(); @@ -44,17 +39,18 @@ const requestCameraAccess = async () => { const pickWithImagePicker = async (source: "camera" | "library") => { if (source === "camera" && !(await requestCameraAccess())) { - return null; + return []; } const options: ImagePicker.ImagePickerOptions = { allowsEditing: false, mediaTypes: ["images"], quality: 1, + ...(source === "library" ? { allowsMultipleSelection: true, selectionLimit: 20, orderedSelection: true } : {}), }; const result = source === "camera" ? await ImagePicker.launchCameraAsync(options) : await ImagePicker.launchImageLibraryAsync(options); - return getImagePickerAsset(result); + return getImagePickerAssets(result); }; const pickWithDocumentPicker = async (): Promise => { @@ -83,7 +79,7 @@ const getPendingAndroidImage = async () => { return null; } if ("canceled" in pending) { - return getImagePickerAsset(pending); + return getImagePickerAssets(pending); } throw new Error(pending.message || "系统未能恢复上次选择的图片,请重试"); }; @@ -170,23 +166,25 @@ export const useMobileEditorUploadAsset = () => { setSourcePickerVisible(true); }), []); - const pickUploadAsset = useCallback(async (): Promise => { + const pickUploadAssets = useCallback(async (): Promise => { const pendingImage = await getPendingAndroidImage(); if (pendingImage) { return pendingImage; } const source = await chooseSource(); if (!source) { - return null; + return []; } // Let the native source sheet finish dismissing before presenting another // native controller. This avoids intermittent "already presenting" errors. await new Promise((resolve) => setTimeout(resolve, NATIVE_PICKER_PRESENTATION_DELAY_MS)); - return source === "file" ? pickWithDocumentPicker() : pickWithImagePicker(source); + if (source !== "file") return pickWithImagePicker(source); + const asset = await pickWithDocumentPicker(); + return asset ? [asset] : []; }, [chooseSource]); return { - pickUploadAsset, + pickUploadAssets, uploadSourcePicker: ( settleSource(null)} diff --git a/apps/mobile/src/lib/mobile-image-picker.test.ts b/apps/mobile/src/lib/mobile-image-picker.test.ts index f45b9636..07807fd0 100644 --- a/apps/mobile/src/lib/mobile-image-picker.test.ts +++ b/apps/mobile/src/lib/mobile-image-picker.test.ts @@ -1,5 +1,15 @@ import { expect, test } from "bun:test"; -import { normalizeMobileImagePickerAsset } from "./mobile-image-picker"; +import { normalizeMobileImagePickerAsset, normalizeMobileImagePickerAssets } from "./mobile-image-picker"; + +test("keeps every picked image in selection order and handles cancellation", () => { + const assets = [ + { uri: "file:///first.png", fileName: "first.png" }, + { uri: "file:///second.jpg", fileName: "second.jpg" }, + ]; + expect(normalizeMobileImagePickerAssets({ canceled: false, assets }).map((asset) => asset.name)) + .toEqual(["first.png", "second.jpg"]); + expect(normalizeMobileImagePickerAssets({ canceled: true, assets: null })).toEqual([]); +}); test("normalizes an image-picker asset for the existing upload pipeline", () => { expect(normalizeMobileImagePickerAsset({ diff --git a/apps/mobile/src/lib/mobile-image-picker.ts b/apps/mobile/src/lib/mobile-image-picker.ts index 54522f12..93f1cb97 100644 --- a/apps/mobile/src/lib/mobile-image-picker.ts +++ b/apps/mobile/src/lib/mobile-image-picker.ts @@ -25,6 +25,11 @@ const getFilenameExtension = (filename?: string | null) => { const getTimestampedPhotoFilename = (timestamp: number) => `photo-${new Date(timestamp).toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z")}.jpg`; +export const normalizeMobileImagePickerAssets = (result: { + canceled: boolean; + assets: MobileImagePickerAsset[] | null; +}): MobileImageUploadAsset[] => result.canceled ? [] : (result.assets ?? []).map((asset) => normalizeMobileImagePickerAsset(asset)); + export const normalizeMobileImagePickerAsset = ( asset: MobileImagePickerAsset, timestamp = Date.now() diff --git a/apps/mobile/src/lib/mobile-image-upload-placeholder.test.ts b/apps/mobile/src/lib/mobile-image-upload-placeholder.test.ts index 0036c89a..71de6f75 100644 --- a/apps/mobile/src/lib/mobile-image-upload-placeholder.test.ts +++ b/apps/mobile/src/lib/mobile-image-upload-placeholder.test.ts @@ -4,6 +4,15 @@ import { stripMobileImageUploadPlaceholders, } from "./mobile-image-upload-placeholder"; +test("cleans up empty or singleton galleries after removing failed upload placeholders", () => { + const pending = { type: "image", attrs: { src: createMobileImageUploadPlaceholderSource("batch") } }; + const saved = { type: "image", attrs: { src: "/api/v1/resources/done/blob" } }; + expect(stripMobileImageUploadPlaceholders({ type: "doc", content: [ + { type: "edgeeverImageGallery", content: [pending] }, + { type: "edgeeverImageGallery", content: [pending, saved] }, + ] }).content).toEqual([saved]); +}); + test("removes transient image upload placeholders before a note is persisted", () => { const placeholderSource = createMobileImageUploadPlaceholderSource("upload-1"); const result = stripMobileImageUploadPlaceholders({ diff --git a/apps/mobile/src/lib/mobile-image-upload-placeholder.ts b/apps/mobile/src/lib/mobile-image-upload-placeholder.ts index c603309b..f8f81aac 100644 --- a/apps/mobile/src/lib/mobile-image-upload-placeholder.ts +++ b/apps/mobile/src/lib/mobile-image-upload-placeholder.ts @@ -1,4 +1,4 @@ -import type { TiptapDoc, TiptapNode } from "@edgeever/shared"; +import { normalizeImageGalleries, type TiptapDoc, type TiptapNode } from "@edgeever/shared"; const IMAGE_UPLOAD_PLACEHOLDER_PREFIX = "edgeever-image-upload://"; @@ -21,8 +21,8 @@ export const stripMobileImageUploadPlaceholders = (doc: TiptapDoc): TiptapDoc => }); const content = stripNodes(doc.content); - return { + return normalizeImageGalleries({ ...doc, content: content.length > 0 ? content : [{ type: "paragraph" }], - }; + }); }; diff --git a/apps/mobile/src/screens/WorkspaceEditors.tsx b/apps/mobile/src/screens/WorkspaceEditors.tsx index 2b00ad41..0062292d 100644 --- a/apps/mobile/src/screens/WorkspaceEditors.tsx +++ b/apps/mobile/src/screens/WorkspaceEditors.tsx @@ -209,7 +209,7 @@ export const CreateMemoModal = ({ const [submitStarted, setSubmitStarted] = useState(false); const [resourceTarget, setResourceTarget] = useState(null); const editorStartup = useMobileEditorStartupGuard({ active: draftLoaded && Boolean(baseUrl), ready: editorReady }); - const { pickUploadAsset, uploadSourcePicker } = useMobileEditorUploadAsset(); + const { pickUploadAssets, uploadSourcePicker } = useMobileEditorUploadAsset(); const targetNotebookId = notebookId || fallbackNotebookId; const selectedNotebookName = notebooks.find((notebook) => notebook.id === targetNotebookId)?.name ?? "选择笔记本"; const titleRef = useRef(title); @@ -518,7 +518,7 @@ export const CreateMemoModal = ({ return response.memo; }; - const uploadImageAsset = async (asset: MobileImageUploadAsset | null) => { + const uploadImageAsset = async (asset: MobileImageUploadAsset | null, keepBusy = false) => { let uploadId: string | null = null; try { if (!asset) { @@ -535,17 +535,30 @@ export const CreateMemoModal = ({ const uploadAsset = await prepareUploadAsset(asset, imageCompressionEnabled); const { resource } = await client!.uploadMemoResource(memo.id, new ExpoFile(uploadAsset.uri)); applyMobileEditorUpload(editorRef, resource, uploadId, uploadAsset.name || (resource.kind === "image" ? "图片" : "附件")); + return resource.kind === "image" ? resource.url : null; } catch (error) { cancelMobileEditorUpload(editorRef, uploadId); Alert.alert("附件上传失败", error instanceof Error ? error.message : "请检查网络连接后重试"); } finally { - setImageOperation("idle"); + if (!keepBusy) setImageOperation("idle"); } }; const pickAndUploadImage = async () => { - const asset = await pickUploadAsset(); - await uploadImageAsset(asset); + const assets = await pickUploadAssets(); + if (!assets.length) return; + const sources: string[] = []; + setImageOperation("uploading"); + try { + for (const asset of assets) { + const source = await uploadImageAsset(asset, true); + if (source === undefined) break; + if (source) sources.push(source); + } + safeDomCall(() => editorRef.current?.finishImageBatch(sources)); + } finally { + setImageOperation("idle"); + } }; useEffect(() => { @@ -842,7 +855,7 @@ export const RichEditorModal = ({ const [startupMs, setStartupMs] = useState(null); const [resourceTarget, setResourceTarget] = useState(null); const editorStartup = useMobileEditorStartupGuard({ active: Boolean(memo && baseUrl), ready }); - const { pickUploadAsset, uploadSourcePicker } = useMobileEditorUploadAsset(); + const { pickUploadAssets, uploadSourcePicker } = useMobileEditorUploadAsset(); const notebookLabel = notebooks.find((notebook) => notebook.id === notebookId)?.name ?? "未分类"; const saveLabel = error ? "保存失败" : saving ? "保存中" : uploading ? "上传中" : dirty ? (draftRestored ? "本地草稿" : "未保存") : ready ? "已保存" : "加载中"; const titleRef = useRef(title); @@ -986,28 +999,35 @@ export const RichEditorModal = ({ Alert.alert("正在同步新笔记", "首次同步完成后即可上传本地图片;图片链接现在就可以直接粘贴到正文。"); return; } - const asset = await pickUploadAsset(); - if (!asset) { + const assets = await pickUploadAssets(); + if (!assets.length) { return; } - const isImage = asset.mimeType?.startsWith("image/") ?? false; - const uploadId = isImage ? createMobileImageUploadId() : null; + let uploadId: string | null = null; + const sources: string[] = []; uploadingRef.current = true; setUploading(true); setError(null); try { - if (isImage && uploadId) { - const previewDataUrl = await createLocalImagePreviewDataUrl(asset); - safeDomCall(() => editorRef.current?.beginImageUpload(uploadId, previewDataUrl)); + for (const asset of assets) { + const isImage = asset.mimeType?.startsWith("image/") ?? false; + uploadId = isImage ? createMobileImageUploadId() : null; + if (isImage && uploadId) { + const previewDataUrl = await createLocalImagePreviewDataUrl(asset); + safeDomCall(() => editorRef.current?.beginImageUpload(uploadId, previewDataUrl)); + } + const uploadAsset = await prepareUploadAsset(asset, imageCompressionEnabled); + const { resource } = await client.uploadMemoResource(memo.id, new ExpoFile(uploadAsset.uri)); + applyMobileEditorUpload(editorRef, resource, uploadId, uploadAsset.name || (resource.kind === "image" ? "图片" : "附件")); + if (resource.kind === "image") sources.push(resource.url); + uploadId = null; } - const uploadAsset = await prepareUploadAsset(asset, imageCompressionEnabled); - const { resource } = await client.uploadMemoResource(memo.id, new ExpoFile(uploadAsset.uri)); - applyMobileEditorUpload(editorRef, resource, uploadId, uploadAsset.name || (resource.kind === "image" ? "图片" : "附件")); } catch (uploadError) { cancelMobileEditorUpload(editorRef, uploadId); setError(uploadError instanceof Error ? uploadError.message : "附件上传失败"); } finally { + safeDomCall(() => editorRef.current?.finishImageBatch(sources)); uploadingRef.current = false; setUploading(false); } diff --git a/packages/shared/package.json b/packages/shared/package.json index 61cc0dd0..e3de635d 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -7,6 +7,7 @@ ".": "./src/index.ts", "./ai-prompt-seeds": "./src/ai-prompt-seeds.ts", "./image-display": "./src/image-display.ts", + "./native-image-gallery": "./src/native-image-gallery.ts", "./i18n": "./src/i18n/index.ts", "./memo-template-seeds": "./src/memo-template-seeds.ts", "./mathematics": "./src/mathematics.ts", diff --git a/packages/shared/src/native-image-gallery.test.mjs b/packages/shared/src/native-image-gallery.test.mjs new file mode 100644 index 00000000..a69c389f --- /dev/null +++ b/packages/shared/src/native-image-gallery.test.mjs @@ -0,0 +1,70 @@ +import { describe, expect, test } from "bun:test"; +import { getSchema } from "@tiptap/core"; +import StarterKit from "@tiptap/starter-kit"; +import Image from "@tiptap/extension-image"; +import { EditorState, NodeSelection } from "@tiptap/pm/state"; +import { history, undo } from "@tiptap/pm/history"; +import { ImageGallery, IMAGE_GALLERY_NODE_TYPE } from "./image-gallery"; +import { createImageInsertTransaction, getImageInsertionRange, groupUploadedImages, NATIVE_IMAGE_GALLERY_CSS } from "./native-image-gallery"; + +const schema = getSchema([StarterKit, Image, ImageGallery]); +const image = (src) => schema.nodes.image.create({ src, alt: src }); +const paragraph = (text) => schema.nodes.paragraph.create(null, text ? schema.text(text) : null); +const gallery = () => schema.nodes[IMAGE_GALLERY_NODE_TYPE].create({ layout: "3" }, [image("old-a"), image("old-b")]); +const makeEditor = (nodes) => { + const editor = { + schema, isEditable: true, isDestroyed: false, + state: EditorState.create({ schema, doc: schema.nodes.doc.create(null, nodes), plugins: [history()] }), + }; + editor.view = { dispatch: (tr) => { editor.state = editor.state.apply(tr); } }; + return editor; +}; + +describe("native gallery editing", () => { + test("advances the insertion target through a three-image upload batch", () => { + const editor = makeEditor([paragraph()]); + for (const src of ["one", "two", "three"]) { + editor.view.dispatch(createImageInsertTransaction(editor.state, { src })); + } + expect(editor.state.doc.content.content.map((node) => node.attrs.src)).toEqual(["one", "two", "three"]); + expect(groupUploadedImages(editor, ["one", "two", "three"])).toBe(true); + expect(editor.state.doc.firstChild.content.content.map((node) => node.attrs.src)).toEqual(["one", "two", "three"]); + }); + test("groups only this batch, preserves order and is undoable", () => { + const editor = makeEditor([image("old"), image("one"), image("two"), paragraph("text")]); + expect(groupUploadedImages(editor, ["one", "two"])).toBe(true); + expect(editor.state.doc.child(0).attrs.src).toBe("old"); + const group = editor.state.doc.child(1); + expect(group.type.name).toBe(IMAGE_GALLERY_NODE_TYPE); + expect(group.attrs.layout).toBe("auto"); + expect(group.content.content.map((node) => node.attrs.src)).toEqual(["one", "two"]); + undo(editor.state, editor.view.dispatch); + expect(editor.state.doc.childCount).toBe(4); + expect(editor.state.doc.child(1).attrs.src).toBe("one"); + }); + + test("never crosses text, nests a gallery or groups a single successful upload", () => { + const editor = makeEditor([gallery(), image("one"), paragraph("keep"), image("two")]); + const original = editor.state.doc; + expect(groupUploadedImages(editor, ["old-a", "old-b", "one", "two"])).toBe(false); + expect(groupUploadedImages(editor, ["one"])).toBe(false); + expect(editor.state.doc).toBe(original); + editor.isEditable = false; + expect(groupUploadedImages(editor, ["one", "two"])).toBe(false); + }); + + test("inserts after selected media instead of replacing it or nesting a gallery", () => { + const doc = schema.nodes.doc.create(null, [gallery(), image("last"), paragraph("text")]); + expect(getImageInsertionRange(doc, NodeSelection.create(doc, 0))).toEqual({ from: 4, to: 4 }); + expect(getImageInsertionRange(doc, NodeSelection.create(doc, 1))).toEqual({ from: 4, to: 4 }); + expect(getImageInsertionRange(doc, NodeSelection.create(doc, 4))).toEqual({ from: 5, to: 5 }); + expect(getImageInsertionRange(doc, { from: 6, to: 8 })).toEqual({ from: 6, to: 8 }); + }); + + test("layout and source metadata survive JSON round trips", () => { + const doc = schema.nodes.doc.create(null, [gallery()]); + expect(schema.nodeFromJSON(doc.toJSON()).toJSON()).toEqual(doc.toJSON()); + expect(NATIVE_IMAGE_GALLERY_CSS).toContain("min-height: 44px"); + expect(NATIVE_IMAGE_GALLERY_CSS).toContain(".edgeever-native-gallery-content .edgeever-image-size-controls { display: none !important; }"); + }); +}); diff --git a/packages/shared/src/native-image-gallery.ts b/packages/shared/src/native-image-gallery.ts new file mode 100644 index 00000000..0961ccd7 --- /dev/null +++ b/packages/shared/src/native-image-gallery.ts @@ -0,0 +1,151 @@ +import type { Editor, NodeViewRenderer } from "@tiptap/core"; +import type { Node as ProseMirrorNode } from "@tiptap/pm/model"; +import { NodeSelection, type EditorState } from "@tiptap/pm/state"; +import { IMAGE_GALLERY_LAYOUTS, IMAGE_GALLERY_NODE_TYPE, resolveImageGalleryLayout } from "./image-gallery"; + +/** Adding images while an image/gallery is selected must not replace that content. */ +export const getImageInsertionRange = (doc: ProseMirrorNode, selection: { from: number; to: number }) => { + const from = Math.min(selection.from, doc.content.size); + const to = Math.min(selection.to, doc.content.size); + const resolved = doc.resolve(from); + for (let depth = resolved.depth; depth > 0; depth -= 1) { + if (resolved.node(depth).type.name === IMAGE_GALLERY_NODE_TYPE) { + const after = resolved.after(depth); + return { from: after, to: after }; + } + } + const node = doc.nodeAt(from); + if (to > from && (node?.type.name === "image" || node?.type.name === IMAGE_GALLERY_NODE_TYPE)) { + const after = from + node.nodeSize; + return { from: after, to: after }; + } + return { from, to }; +}; + +export const createImageInsertTransaction = ( + state: EditorState, + attrs: Record, + selection = state.selection as { from: number; to: number }, +) => { + const { from, to } = getImageInsertionRange(state.doc, selection); + const image = state.schema.nodes.image.create(attrs); + const tr = state.tr.replaceRangeWith(from, to, image); + // ProseMirror may keep the first image selected after an insertion. Explicitly + // advance to the inserted node so a batch of 3+ images cannot reverse order. + tr.doc.descendants((node, pos) => { + if (node === image) tr.setSelection(NodeSelection.create(tr.doc, pos)); + }); + return tr; +}; + +/** Group only consecutive top-level images from this upload batch. Never move user text. */ +export const groupUploadedImages = (editor: Editor, sources: readonly string[]): boolean => { + if (!editor.isEditable || editor.isDestroyed || sources.length < 2) return false; + const type = editor.schema.nodes[IMAGE_GALLERY_NODE_TYPE]; + if (!type) return false; + const wanted = new Set(sources); + const groups: Array<{ from: number; to: number; images: ProseMirrorNode[] }> = []; + let current: typeof groups[number] | null = null; + editor.state.doc.forEach((node, pos) => { + if (node.type.name === "image" && wanted.has(node.attrs.src)) { + if (!current) current = { from: pos, to: pos, images: [] }; + current.images.push(node); + current.to = pos + node.nodeSize; + } else { + if (current && current.images.length > 1) groups.push(current); + current = null; + } + }); + if (current && (current as typeof groups[number]).images.length > 1) groups.push(current); + if (!groups.length) return false; + const tr = editor.state.tr; + for (const group of groups.reverse()) { + tr.replaceWith(group.from, group.to, type.create({ layout: "auto" }, group.images)); + } + editor.view.dispatch(tr); + return true; +}; + +/** A shared touch-sized, in-flow toolbar for Android and iOS WebView editors. */ +export const createNativeImageGalleryView = (getLocale: () => string): NodeViewRenderer => ( + ({ editor, node, getPos }) => { + let current = node; + const dom = document.createElement("div"); + dom.className = "edgeever-native-image-gallery"; + dom.dataset.edgeeverImageGallery = "true"; + const toolbar = document.createElement("div"); + toolbar.className = "edgeever-native-gallery-toolbar"; + toolbar.contentEditable = "false"; + toolbar.setAttribute("role", "toolbar"); + const contentDOM = document.createElement("div"); + contentDOM.className = "edgeever-native-gallery-content"; + const buttons = IMAGE_GALLERY_LAYOUTS.map((layout) => { + const button = document.createElement("button"); + button.type = "button"; + button.addEventListener("pointerdown", (event) => event.stopPropagation()); + button.addEventListener("mousedown", (event) => event.preventDefault()); + button.addEventListener("click", (event) => { + event.preventDefault(); + event.stopPropagation(); + const pos = getPos(); + if (!editor.isEditable || typeof pos !== "number") return; + const target = editor.state.doc.nodeAt(pos); + if (target?.type.name !== IMAGE_GALLERY_NODE_TYPE) return; + editor.view.dispatch(editor.state.tr.setNodeMarkup(pos, undefined, { ...target.attrs, layout })); + }); + toolbar.appendChild(button); + return { button, layout }; + }); + dom.appendChild(toolbar); + dom.appendChild(contentDOM); + const sync = () => { + const english = getLocale() === "en-US"; + const layout = resolveImageGalleryLayout(current.attrs.layout); + dom.dataset.imageGalleryLayout = layout; + dom.dataset.imageCount = String(current.childCount); + toolbar.hidden = !editor.isEditable; + toolbar.setAttribute("aria-label", english ? "Image gallery layout" : "图片画廊布局"); + for (const item of buttons) { + item.button.textContent = item.layout === "auto" ? (english ? "Auto" : "自动") + : item.layout === "1" ? (english ? "Single" : "单列") + : `${item.layout} ${english ? "columns" : "栏"}`; + item.button.setAttribute("aria-pressed", String(item.layout === layout)); + } + }; + sync(); + editor.on("transaction", sync); + // setEditable emits update without a document transaction. + editor.on("update", sync); + return { + dom, + contentDOM, + update: (next) => { + if (next.type !== current.type) return false; + current = next; + sync(); + return true; + }, + stopEvent: (event) => toolbar.contains(event.target as globalThis.Node), + ignoreMutation: (mutation) => mutation.type !== "selection" && !contentDOM.contains(mutation.target), + destroy: () => { + editor.off("transaction", sync); + editor.off("update", sync); + }, + }; + } +); + +export const NATIVE_IMAGE_GALLERY_CSS = ` +[data-edgeever-image-gallery].edgeever-native-image-gallery { display: block; } +.edgeever-native-gallery-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; line-height: 1.2; } +.edgeever-native-gallery-toolbar[hidden] { display: none; } +.edgeever-native-gallery-toolbar button { min-height: 44px; padding: 8px 12px; border: 1px solid #16a06e55; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; } +.edgeever-native-gallery-toolbar button[aria-pressed="true"] { color: #16a06e; background: #16a06e22; } +.edgeever-native-gallery-toolbar button:focus-visible { outline: 2px solid #16a06e; outline-offset: 2px; } +.edgeever-native-gallery-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } +[data-image-gallery-layout="1"] > .edgeever-native-gallery-content { grid-template-columns: minmax(0, 1fr); } +@media (min-width: 600px) { [data-image-gallery-layout="3"] > .edgeever-native-gallery-content { grid-template-columns: repeat(3, minmax(0, 1fr)); } } +.edgeever-native-gallery-content > * { width: 100% !important; min-width: 0; height: 100%; margin: 0 !important; overflow: hidden; border-radius: 10px; background: transparent; } +.edgeever-native-gallery-content > img, .edgeever-native-gallery-content > * > img { width: 100% !important; height: 100%; min-height: 112px; max-height: 220px; object-fit: cover; } +.edgeever-native-gallery-content .edgeever-image-size-controls { display: none !important; } +`;