diff --git a/apps/ios/EdgeEver.xcodeproj/project.pbxproj b/apps/ios/EdgeEver.xcodeproj/project.pbxproj index d451a490..5e327757 100644 --- a/apps/ios/EdgeEver.xcodeproj/project.pbxproj +++ b/apps/ios/EdgeEver.xcodeproj/project.pbxproj @@ -57,6 +57,7 @@ 88A1141343A4E255A8050CB6 /* RevisionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 328A2DAC7E7DC89F4782B5FB /* RevisionsView.swift */; }; 88C20914237162E295798B54 /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = 1B167394120674FECA86D42F /* GRDB */; }; 8C761DABADB93F2F15E21E80 /* EditFabButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2829CE5DF5C15ACF41CC17DA /* EditFabButton.swift */; }; + 8E1CB597E6534EBFAD4B43FE /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 01D34117A78B1F5C367ACDBB /* assets */; }; 90FFFFD00B2D19F96EA299C8 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5126510AFB9AFBF7ABADB45 /* Models.swift */; }; 93556FDCB87BB93990221E01 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8691859094F8C08AE49FE27D /* Assets.xcassets */; }; 94456E5BCAB7496FAD4685A6 /* Pow in Frameworks */ = {isa = PBXBuildFile; productRef = E37BD605D826474D3E842F31 /* Pow */; }; @@ -120,6 +121,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 01D34117A78B1F5C367ACDBB /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = EdgeEver/Resources/EditorBundle/assets; sourceTree = SOURCE_ROOT; }; 033565CE2E96EC2D23105188 /* ListActionsSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListActionsSheet.swift; sourceTree = ""; }; 0531FC6AA81DAF0A55B42362 /* AppDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = ""; }; 0EF7E97C950002FA22EFB7C8 /* AiDirectStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AiDirectStream.swift; sourceTree = ""; }; @@ -342,6 +344,7 @@ 821234A55C8B7CF544B28EE6 /* EditorBundle */ = { isa = PBXGroup; children = ( + 01D34117A78B1F5C367ACDBB /* assets */, AB02424D0412FE36C4BCD116 /* index.html */, ); path = EditorBundle; @@ -618,6 +621,7 @@ 93556FDCB87BB93990221E01 /* Assets.xcassets in Resources */, 06D2661CAB0ADED27F322649 /* Localizable.xcstrings in Resources */, C37DA99E090A783562506CDA /* PrivacyInfo.xcprivacy in Resources */, + 8E1CB597E6534EBFAD4B43FE /* assets in Resources */, 08D0159B8F194E04C02B69BF /* index.html in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/apps/ios/EdgeEver/Data/Preferences/PreferencesStore.swift b/apps/ios/EdgeEver/Data/Preferences/PreferencesStore.swift index 4f02ff83..8e4e51c2 100644 --- a/apps/ios/EdgeEver/Data/Preferences/PreferencesStore.swift +++ b/apps/ios/EdgeEver/Data/Preferences/PreferencesStore.swift @@ -32,6 +32,55 @@ enum AppUILocale { } } +/// Local image-share choices, independent of the current note or sheet lifetime. +struct NoteImageSharePreferences: Codable, Equatable { + var theme: String = "gradient" + var fontStyle: String = "auto" + var fontSize: String = "lg" + var cardWidth: String = "wide" + var format: String = "png" + var showTitle: Bool = true + var showNotebook: Bool = false + var showTags: Bool = false + var showUpdatedAt: Bool = true + var showBranding: Bool = true + + init() {} + + private enum CodingKeys: String, CodingKey { + case theme, fontStyle, fontSize, cardWidth, format, showTitle, showNotebook, showTags, showUpdatedAt, showBranding + } + + init(from decoder: Decoder) throws { + let values = try decoder.container(keyedBy: CodingKeys.self) + if let value = try? values.decode(String.self, forKey: .theme), + ["gradient", "glass", "quote", "book", "memo", "bento", "black-sun", "frame", "handwritten", "code"].contains(value) { + theme = value + } + if let value = try? values.decode(String.self, forKey: .fontStyle), + ["auto", "serif", "sans", "mono", "kai"].contains(value) { + fontStyle = value + } + if let value = try? values.decode(String.self, forKey: .fontSize), + ["sm", "md", "lg"].contains(value) { + fontSize = value + } + if let value = try? values.decode(String.self, forKey: .cardWidth), + ["compact", "standard", "wide"].contains(value) { + cardWidth = value + } + if let value = try? values.decode(String.self, forKey: .format), + ["png", "jpeg"].contains(value) { + format = value + } + showTitle = (try? values.decode(Bool.self, forKey: .showTitle)) ?? true + showNotebook = (try? values.decode(Bool.self, forKey: .showNotebook)) ?? false + showTags = (try? values.decode(Bool.self, forKey: .showTags)) ?? false + showUpdatedAt = (try? values.decode(Bool.self, forKey: .showUpdatedAt)) ?? true + showBranding = (try? values.decode(Bool.self, forKey: .showBranding)) ?? true + } +} + @Observable @MainActor final class PreferencesStore { @@ -64,8 +113,22 @@ final class PreferencesStore { didSet { persistAiAssistantLastAction() } } + var noteImageShare: NoteImageSharePreferences { + didSet { + if let data = try? JSONEncoder().encode(noteImageShare) { + defaults.set(data, forKey: Keys.noteImageShare) + } + } + } + init(defaults: UserDefaults = .standard) { self.defaults = defaults + if let data = defaults.data(forKey: Keys.noteImageShare), + let saved = try? JSONDecoder().decode(NoteImageSharePreferences.self, from: data) { + self.noteImageShare = saved + } else { + self.noteImageShare = NoteImageSharePreferences() + } self.localeCode = defaults.string(forKey: Keys.locale) ?? "system" self.useCompression = defaults.object(forKey: Keys.compression) as? Bool ?? true self.showDescendantNotes = defaults.object(forKey: Keys.showDescendantNotes) as? Bool ?? true @@ -157,6 +220,7 @@ final class PreferencesStore { } private enum Keys { + static let noteImageShare = "edgeever.ios.noteImagePreferences" static let locale = "edgeever.ios.locale" static let compression = "edgeever.ios.imageCompression" static let showDescendantNotes = "edgeever.ios.showDescendantNotes" diff --git a/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift b/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift index 1b70740f..d18afa53 100644 --- a/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift +++ b/apps/ios/EdgeEver/Features/Workspace/MemoDetailView.swift @@ -23,16 +23,6 @@ struct MemoDetailView: View { @State private var imageExportRequestId: String? @State private var imageExportBuffer = MemoImageExportBuffer() @State private var imageShareOptionsOpen = false - @State private var imageShareFormat = "png" - @State private var imageShareTheme = "mint" - @State private var imageShareFontStyle = "auto" - @State private var imageShareFontSize = "lg" - @State private var imageShareCardWidth = "wide" - @State private var imageShareTitle = true - @State private var imageShareNotebook = false - @State private var imageShareTags = false - @State private var imageShareUpdatedAt = true - @State private var imageShareBranding = true @State private var imageExportIntent: MemoImageExportIntent = .share @State private var error: String? @State private var conflictItem: OutboxItem? @@ -56,7 +46,8 @@ struct MemoDetailView: View { @State private var initialShareImageHandled = false var body: some View { - VStack(spacing: 0) { + @Bindable var preferences = env.preferences + return VStack(spacing: 0) { detailHeader if syncStatus == .conflict, memo != nil { conflictBanner @@ -187,19 +178,22 @@ struct MemoDetailView: View { NavigationStack { Form { Section(env.preferences.t("主题风格", en: "Theme", pl: "Motyw")) { - Picker(env.preferences.t("主题风格", en: "Theme", pl: "Motyw"), selection: $imageShareTheme) { - Text(env.preferences.t("纯白", en: "Pure White", pl: "Czysta biel")).tag("slate") - Text(env.preferences.t("薄荷", en: "Mint", pl: "Mięta")).tag("mint") - Text(env.preferences.t("极光渐变", en: "Aurora", pl: "Zorza")).tag("aurora") - Text(env.preferences.t("暮色晚霞", en: "Sunset", pl: "Zachód słońca")).tag("sunset") - Text(env.preferences.t("黑白编辑", en: "Black & White", pl: "Czerń i biel")).tag("editorial") - Text(env.preferences.t("极客终端", en: "Terminal", pl: "Terminal")).tag("terminal") - Text(env.preferences.t("书页", en: "Book Page", pl: "Strona książki")).tag("film") + Picker(env.preferences.t("主题风格", en: "Theme", pl: "Motyw"), selection: $preferences.noteImageShare.theme) { + Text(env.preferences.t("默认", en: "Classic", pl: "Klasyczny")).tag("gradient") + Text(env.preferences.t("透明", en: "Glass", pl: "Szkło")).tag("glass") + Text(env.preferences.t("金句", en: "Quote", pl: "Cytat")).tag("quote") + Text(env.preferences.t("书摘", en: "Book excerpt", pl: "Fragment książki")).tag("book") + Text(env.preferences.t("备忘录", en: "Memo", pl: "Notatka")).tag("memo") + Text(env.preferences.t("便当", en: "Bento", pl: "Bento")).tag("bento") + Text(env.preferences.t("黑日", en: "Black Sun", pl: "Czarne słońce")).tag("black-sun") + Text(env.preferences.t("框界", en: "Frame", pl: "Ramka")).tag("frame") + Text(env.preferences.t("手写", en: "Handwritten", pl: "Pismo odręczne")).tag("handwritten") + Text(env.preferences.t("代码", en: "Code", pl: "Kod")).tag("code") } .pickerStyle(.menu) } Section(env.preferences.t("字体风格", en: "Typography", pl: "Typografia")) { - Picker(env.preferences.t("字体风格", en: "Typography", pl: "Typografia"), selection: $imageShareFontStyle) { + Picker(env.preferences.t("字体风格", en: "Typography", pl: "Typografia"), selection: $preferences.noteImageShare.fontStyle) { Text(env.preferences.t("跟随主题", en: "Follow Theme", pl: "Zgodnie z motywem")).tag("auto") Text(env.preferences.t("文艺衬线", en: "Serif", pl: "Szeryfowa")).tag("serif") Text(env.preferences.t("现代无衬线", en: "Sans", pl: "Bezszeryfowa")).tag("sans") @@ -208,7 +202,7 @@ struct MemoDetailView: View { .pickerStyle(.menu) } Section(env.preferences.t("字号大小", en: "Font size", pl: "Rozmiar czcionki")) { - Picker(env.preferences.t("字号大小", en: "Font size", pl: "Rozmiar czcionki"), selection: $imageShareFontSize) { + Picker(env.preferences.t("字号大小", en: "Font size", pl: "Rozmiar czcionki"), selection: $preferences.noteImageShare.fontSize) { Text(env.preferences.t("紧凑", en: "Compact", pl: "Kompaktowy")).tag("sm") Text(env.preferences.t("标准", en: "Standard", pl: "Standardowy")).tag("md") Text(env.preferences.t("舒适", en: "Comfortable", pl: "Wygodny")).tag("lg") @@ -216,7 +210,7 @@ struct MemoDetailView: View { .pickerStyle(.segmented) } Section(env.preferences.t("卡片宽度", en: "Card width", pl: "Szerokość karty")) { - Picker(env.preferences.t("卡片宽度", en: "Card width", pl: "Szerokość karty"), selection: $imageShareCardWidth) { + Picker(env.preferences.t("卡片宽度", en: "Card width", pl: "Szerokość karty"), selection: $preferences.noteImageShare.cardWidth) { Text(env.preferences.t("紧凑", en: "Compact", pl: "Kompaktowy")).tag("compact") Text(env.preferences.t("标准", en: "Standard", pl: "Standardowy")).tag("standard") Text(env.preferences.t("宽屏", en: "Wide", pl: "Szeroka")).tag("wide") @@ -224,14 +218,14 @@ struct MemoDetailView: View { .pickerStyle(.segmented) } Section(env.preferences.t("显示内容", en: "Content elements", pl: "Elementy treści")) { - Toggle(env.preferences.t("笔记标题", en: "Note title", pl: "Tytuł notatki"), isOn: $imageShareTitle) - Toggle(env.preferences.t("笔记本", en: "Notebook", pl: "Notatnik"), isOn: $imageShareNotebook) - Toggle(env.preferences.t("标签", en: "Tags", pl: "Tagi"), isOn: $imageShareTags) - Toggle(env.preferences.t("更新时间", en: "Updated time", pl: "Czas aktualizacji"), isOn: $imageShareUpdatedAt) - Toggle(env.preferences.t("EdgeEver 品牌标识", en: "EdgeEver branding", pl: "Oznaczenie EdgeEver"), isOn: $imageShareBranding) + Toggle(env.preferences.t("笔记标题", en: "Note title", pl: "Tytuł notatki"), isOn: $preferences.noteImageShare.showTitle) + Toggle(env.preferences.t("笔记本", en: "Notebook", pl: "Notatnik"), isOn: $preferences.noteImageShare.showNotebook) + Toggle(env.preferences.t("标签", en: "Tags", pl: "Tagi"), isOn: $preferences.noteImageShare.showTags) + Toggle(env.preferences.t("更新时间", en: "Updated time", pl: "Czas aktualizacji"), isOn: $preferences.noteImageShare.showUpdatedAt) + Toggle(env.preferences.t("EdgeEver 品牌标识", en: "EdgeEver branding", pl: "Oznaczenie EdgeEver"), isOn: $preferences.noteImageShare.showBranding) } Section(env.preferences.t("图片格式", en: "Image format", pl: "Format obrazu")) { - Picker(env.preferences.t("图片格式", en: "Image format", pl: "Format obrazu"), selection: $imageShareFormat) { + Picker(env.preferences.t("图片格式", en: "Image format", pl: "Format obrazu"), selection: $preferences.noteImageShare.format) { Text(env.preferences.t("PNG · 超清无损", en: "PNG · Best for text", pl: "PNG · Najlepszy do tekstu")).tag("png") Text(env.preferences.t("JPEG · 体积小", en: "JPEG · Smaller file", pl: "JPEG · Mniejszy plik")).tag("jpeg") } @@ -250,16 +244,16 @@ struct MemoDetailView: View { imageShareOptionsOpen = false exportMemoImage( memo, - format: imageShareFormat, - theme: imageShareTheme, - fontStyle: imageShareFontStyle, - fontSize: imageShareFontSize, - cardWidth: imageShareCardWidth, - showTitle: imageShareTitle, - showNotebook: imageShareNotebook, - showTags: imageShareTags, - showUpdatedAt: imageShareUpdatedAt, - showBranding: imageShareBranding, + format: env.preferences.noteImageShare.format, + theme: env.preferences.noteImageShare.theme, + fontStyle: env.preferences.noteImageShare.fontStyle, + fontSize: env.preferences.noteImageShare.fontSize, + cardWidth: env.preferences.noteImageShare.cardWidth, + showTitle: env.preferences.noteImageShare.showTitle, + showNotebook: env.preferences.noteImageShare.showNotebook, + showTags: env.preferences.noteImageShare.showTags, + showUpdatedAt: env.preferences.noteImageShare.showUpdatedAt, + showBranding: env.preferences.noteImageShare.showBranding, intent: .preview ) } diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/0102836d-BNU7ssoN.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/0102836d-BNU7ssoN.woff2 new file mode 100644 index 00000000..eb56b333 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/0102836d-BNU7ssoN.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/020fd7d8-FDcE1YaV.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/020fd7d8-FDcE1YaV.woff2 new file mode 100644 index 00000000..dd2f1880 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/020fd7d8-FDcE1YaV.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/02ee1677-72BFkFOV.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/02ee1677-72BFkFOV.woff2 new file mode 100644 index 00000000..a56d3149 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/02ee1677-72BFkFOV.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/06937cd9-zTyvAiTN.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/06937cd9-zTyvAiTN.woff2 new file mode 100644 index 00000000..f72066b4 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/06937cd9-zTyvAiTN.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/0b091a88-B5pOTIFf.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/0b091a88-B5pOTIFf.woff2 new file mode 100644 index 00000000..caa1cd1e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/0b091a88-B5pOTIFf.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/16680299-CKJkoaeR.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/16680299-CKJkoaeR.woff2 new file mode 100644 index 00000000..43075348 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/16680299-CKJkoaeR.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/17d9b0c9-XiQ4_92O.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/17d9b0c9-XiQ4_92O.woff2 new file mode 100644 index 00000000..1315b437 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/17d9b0c9-XiQ4_92O.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/182f21d5-3O_QjnYF.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/182f21d5-3O_QjnYF.woff2 new file mode 100644 index 00000000..396f6e51 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/182f21d5-3O_QjnYF.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/19d3f828-oqSEBOzm.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/19d3f828-oqSEBOzm.woff2 new file mode 100644 index 00000000..a2a8934a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/19d3f828-oqSEBOzm.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/1be2c28b-C_nC0hYp.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/1be2c28b-C_nC0hYp.woff2 new file mode 100644 index 00000000..8851297e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/1be2c28b-C_nC0hYp.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/20740682-Bd27ja1d.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/20740682-Bd27ja1d.woff2 new file mode 100644 index 00000000..602eb71f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/20740682-Bd27ja1d.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/227fd1ab-DW7fJy9i.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/227fd1ab-DW7fJy9i.woff2 new file mode 100644 index 00000000..1ef49233 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/227fd1ab-DW7fJy9i.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/23249574-Blktn09R.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/23249574-Blktn09R.woff2 new file mode 100644 index 00000000..70a67222 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/23249574-Blktn09R.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/26e008cd-B0KZn7Bu.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/26e008cd-B0KZn7Bu.woff2 new file mode 100644 index 00000000..0936c0c6 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/26e008cd-B0KZn7Bu.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/2dda088b-RIM-2Rus.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/2dda088b-RIM-2Rus.woff2 new file mode 100644 index 00000000..b1cd1f9e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/2dda088b-RIM-2Rus.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/301b7546-CAec1gq5.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/301b7546-CAec1gq5.woff2 new file mode 100644 index 00000000..db8c1b5c Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/301b7546-CAec1gq5.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/337f2131-0l1G9cSo.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/337f2131-0l1G9cSo.woff2 new file mode 100644 index 00000000..3564f2a6 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/337f2131-0l1G9cSo.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/3573d10a-DX8NCPH0.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3573d10a-DX8NCPH0.woff2 new file mode 100644 index 00000000..3f5ca6b1 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3573d10a-DX8NCPH0.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/387e99e8-2WoYRSgy.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/387e99e8-2WoYRSgy.woff2 new file mode 100644 index 00000000..02537cbc Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/387e99e8-2WoYRSgy.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/3a4b22f4-tJ27zGGb.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3a4b22f4-tJ27zGGb.woff2 new file mode 100644 index 00000000..1b1015bc Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3a4b22f4-tJ27zGGb.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/3c472988-F70bwRXI.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3c472988-F70bwRXI.woff2 new file mode 100644 index 00000000..978406ac Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/3c472988-F70bwRXI.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/41a1ce17-DoXtNW-M.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/41a1ce17-DoXtNW-M.woff2 new file mode 100644 index 00000000..d81be0f0 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/41a1ce17-DoXtNW-M.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/42ec73d1-CZwgVh0D.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/42ec73d1-CZwgVh0D.woff2 new file mode 100644 index 00000000..acacdd4c Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/42ec73d1-CZwgVh0D.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/43f1e8f0-RtWxxiQD.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/43f1e8f0-RtWxxiQD.woff2 new file mode 100644 index 00000000..dfc18d04 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/43f1e8f0-RtWxxiQD.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/462ccc04-DKlqUxOR.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/462ccc04-DKlqUxOR.woff2 new file mode 100644 index 00000000..cd81c5d9 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/462ccc04-DKlqUxOR.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/48b63d0d-2Lr35y-X.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/48b63d0d-2Lr35y-X.woff2 new file mode 100644 index 00000000..fae56dd8 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/48b63d0d-2Lr35y-X.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/4b5dd3c7-qr2XXXgw.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4b5dd3c7-qr2XXXgw.woff2 new file mode 100644 index 00000000..95833fff Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4b5dd3c7-qr2XXXgw.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/4ccb7939-Cev46cHC.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4ccb7939-Cev46cHC.woff2 new file mode 100644 index 00000000..5de7ad9f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4ccb7939-Cev46cHC.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/4dd21d3a-BJUHvdJ8.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4dd21d3a-BJUHvdJ8.woff2 new file mode 100644 index 00000000..8a2bde08 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/4dd21d3a-BJUHvdJ8.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5201e37a-Dzmdi1Eh.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5201e37a-Dzmdi1Eh.woff2 new file mode 100644 index 00000000..d3b09d7b Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5201e37a-Dzmdi1Eh.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/550528c8-DTJzeIz9.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/550528c8-DTJzeIz9.woff2 new file mode 100644 index 00000000..d0f64554 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/550528c8-DTJzeIz9.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5513e1aa-CYwXkyCl.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5513e1aa-CYwXkyCl.woff2 new file mode 100644 index 00000000..81d9e86a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5513e1aa-CYwXkyCl.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/562341ba-DF5bVP7I.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/562341ba-DF5bVP7I.woff2 new file mode 100644 index 00000000..a067fbb4 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/562341ba-DF5bVP7I.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/56f1aec8-DXRTxmS8.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/56f1aec8-DXRTxmS8.woff2 new file mode 100644 index 00000000..f0035164 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/56f1aec8-DXRTxmS8.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/584f6234-UOq4ckvT.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/584f6234-UOq4ckvT.woff2 new file mode 100644 index 00000000..4c6d81f8 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/584f6234-UOq4ckvT.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a4bccb9-pQo8xIV3.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a4bccb9-pQo8xIV3.woff2 new file mode 100644 index 00000000..5c734bec Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a4bccb9-pQo8xIV3.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a608b11-xl3mZ4-y.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a608b11-xl3mZ4-y.woff2 new file mode 100644 index 00000000..cd1ebf75 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5a608b11-xl3mZ4-y.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5d23163e-DoNrvu9X.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5d23163e-DoNrvu9X.woff2 new file mode 100644 index 00000000..7b2882eb Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5d23163e-DoNrvu9X.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/5edc68fa-DgppaUqy.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5edc68fa-DgppaUqy.woff2 new file mode 100644 index 00000000..0b9ec961 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/5edc68fa-DgppaUqy.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/624f240b-8hjRvEeI.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/624f240b-8hjRvEeI.woff2 new file mode 100644 index 00000000..422069ef Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/624f240b-8hjRvEeI.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/62a95b91-Csb1oEpO.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/62a95b91-Csb1oEpO.woff2 new file mode 100644 index 00000000..b6c24402 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/62a95b91-Csb1oEpO.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/62b5cc7e-Cm8MV52R.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/62b5cc7e-Cm8MV52R.woff2 new file mode 100644 index 00000000..99369dfe Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/62b5cc7e-Cm8MV52R.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6492a981-Clc1coPA.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6492a981-Clc1coPA.woff2 new file mode 100644 index 00000000..da041ab2 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6492a981-Clc1coPA.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6501caba-Ck8L8Z4F.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6501caba-Ck8L8Z4F.woff2 new file mode 100644 index 00000000..c8d76b6d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6501caba-Ck8L8Z4F.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/668b1bf5-Ct9VOqgL.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/668b1bf5-Ct9VOqgL.woff2 new file mode 100644 index 00000000..be4f98cb Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/668b1bf5-Ct9VOqgL.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/67621f47-BeptiLAr.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/67621f47-BeptiLAr.woff2 new file mode 100644 index 00000000..d5e42ee0 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/67621f47-BeptiLAr.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/67a3cdde-CkP34kjz.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/67a3cdde-CkP34kjz.woff2 new file mode 100644 index 00000000..6e15479b Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/67a3cdde-CkP34kjz.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6880f229-DtKqOD3w.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6880f229-DtKqOD3w.woff2 new file mode 100644 index 00000000..e008aa1c Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6880f229-DtKqOD3w.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/689dad6f-jwUfx50S.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/689dad6f-jwUfx50S.woff2 new file mode 100644 index 00000000..ed45fc96 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/689dad6f-jwUfx50S.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/69aba650-BR_bR6GB.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/69aba650-BR_bR6GB.woff2 new file mode 100644 index 00000000..b3e535a8 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/69aba650-BR_bR6GB.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6a1f04cc-sj3yrMN-.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6a1f04cc-sj3yrMN-.woff2 new file mode 100644 index 00000000..fc0f48bc Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6a1f04cc-sj3yrMN-.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6dd16229-ju8WF-Km.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6dd16229-ju8WF-Km.woff2 new file mode 100644 index 00000000..8a0fee63 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6dd16229-ju8WF-Km.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/6defc511-m-EPHHiP.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6defc511-m-EPHHiP.woff2 new file mode 100644 index 00000000..4b53d99b Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/6defc511-m-EPHHiP.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/71b36260-BUfjfZeT.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/71b36260-BUfjfZeT.woff2 new file mode 100644 index 00000000..d248f8be Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/71b36260-BUfjfZeT.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/73fa0c45-CedUorUY.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/73fa0c45-CedUorUY.woff2 new file mode 100644 index 00000000..ac27aaad Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/73fa0c45-CedUorUY.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/7639be88-CtSrNVbX.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7639be88-CtSrNVbX.woff2 new file mode 100644 index 00000000..d34ca6c1 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7639be88-CtSrNVbX.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/79088b33-C2zbYTPS.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/79088b33-C2zbYTPS.woff2 new file mode 100644 index 00000000..fc50f8f1 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/79088b33-C2zbYTPS.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/7ce74f0c-BAk17e57.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7ce74f0c-BAk17e57.woff2 new file mode 100644 index 00000000..291e2f2f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7ce74f0c-BAk17e57.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/7efb8990-C8qimqf7.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7efb8990-C8qimqf7.woff2 new file mode 100644 index 00000000..b7e75885 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7efb8990-C8qimqf7.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f4db008-BYK_oLpH.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f4db008-BYK_oLpH.woff2 new file mode 100644 index 00000000..82122c44 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f4db008-BYK_oLpH.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f8eb8b4-f1m5JiVC.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f8eb8b4-f1m5JiVC.woff2 new file mode 100644 index 00000000..61dc914b Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/7f8eb8b4-f1m5JiVC.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/830e4d9e-B6nQphQ1.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/830e4d9e-B6nQphQ1.woff2 new file mode 100644 index 00000000..4bbaa04d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/830e4d9e-B6nQphQ1.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/83ea2cba-DY-byk2F.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/83ea2cba-DY-byk2F.woff2 new file mode 100644 index 00000000..48c98f79 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/83ea2cba-DY-byk2F.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/8609d775-BLSbfjza.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/8609d775-BLSbfjza.woff2 new file mode 100644 index 00000000..62ba5f68 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/8609d775-BLSbfjza.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/874104a4-D-MT3v9t.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/874104a4-D-MT3v9t.woff2 new file mode 100644 index 00000000..b6b1b5be Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/874104a4-D-MT3v9t.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/88c36a6e-CZa5XRku.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/88c36a6e-CZa5XRku.woff2 new file mode 100644 index 00000000..9871e882 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/88c36a6e-CZa5XRku.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/8c02979a-CykE0_36.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/8c02979a-CykE0_36.woff2 new file mode 100644 index 00000000..66925a88 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/8c02979a-CykE0_36.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/90e67073-CV24_7yQ.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/90e67073-CV24_7yQ.woff2 new file mode 100644 index 00000000..71f1616f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/90e67073-CV24_7yQ.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/920f4cca-C6QhU-NY.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/920f4cca-C6QhU-NY.woff2 new file mode 100644 index 00000000..4e703729 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/920f4cca-C6QhU-NY.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/96c7a439-D_9FZvkv.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/96c7a439-D_9FZvkv.woff2 new file mode 100644 index 00000000..ae144d75 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/96c7a439-D_9FZvkv.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/9bc91d93-BM9ai5B1.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/9bc91d93-BM9ai5B1.woff2 new file mode 100644 index 00000000..3df3ee8a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/9bc91d93-BM9ai5B1.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/9e217aaa-BLBMYKsy.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/9e217aaa-BLBMYKsy.woff2 new file mode 100644 index 00000000..9623d4a7 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/9e217aaa-BLBMYKsy.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/GeistMono-Cfl0yKzG.ttf b/apps/ios/EdgeEver/Resources/EditorBundle/assets/GeistMono-Cfl0yKzG.ttf new file mode 100644 index 00000000..173867dc Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/GeistMono-Cfl0yKzG.ttf differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/a2d2ee87-D00CFqkq.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a2d2ee87-D00CFqkq.woff2 new file mode 100644 index 00000000..df6cac48 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a2d2ee87-D00CFqkq.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/a70208e3-BySIhIO0.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a70208e3-BySIhIO0.woff2 new file mode 100644 index 00000000..6ca1db80 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a70208e3-BySIhIO0.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/a703591d-Bx8FILqw.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a703591d-Bx8FILqw.woff2 new file mode 100644 index 00000000..5e34993d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a703591d-Bx8FILqw.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/a78d6046-DV7S-faL.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a78d6046-DV7S-faL.woff2 new file mode 100644 index 00000000..2f5ca170 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a78d6046-DV7S-faL.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/a9b5b5a2-DlBdDJJ3.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a9b5b5a2-DlBdDJJ3.woff2 new file mode 100644 index 00000000..f4c03155 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/a9b5b5a2-DlBdDJJ3.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/b04d2f05-BokaYcAj.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b04d2f05-BokaYcAj.woff2 new file mode 100644 index 00000000..845d3153 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b04d2f05-BokaYcAj.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/b2523abb-896Jq_mD.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b2523abb-896Jq_mD.woff2 new file mode 100644 index 00000000..3ab98abe Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b2523abb-896Jq_mD.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/b3149c79-CexJi769.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b3149c79-CexJi769.woff2 new file mode 100644 index 00000000..b180e6e9 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b3149c79-CexJi769.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/b50d627f-CHd-b1Bq.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b50d627f-CHd-b1Bq.woff2 new file mode 100644 index 00000000..9f47e280 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/b50d627f-CHd-b1Bq.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/ba987875-CJvhLdJ7.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ba987875-CJvhLdJ7.woff2 new file mode 100644 index 00000000..56f15418 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ba987875-CJvhLdJ7.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/bb0a13c3-DmnFC7rX.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bb0a13c3-DmnFC7rX.woff2 new file mode 100644 index 00000000..276e20fd Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bb0a13c3-DmnFC7rX.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/bbc24ab8-BDKMNak6.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bbc24ab8-BDKMNak6.woff2 new file mode 100644 index 00000000..97ced9f9 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bbc24ab8-BDKMNak6.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/bc7cfa5c-BcMcSMEK.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bc7cfa5c-BcMcSMEK.woff2 new file mode 100644 index 00000000..76eaea56 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bc7cfa5c-BcMcSMEK.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/bf4f0cec-Bt5eV7Mx.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bf4f0cec-Bt5eV7Mx.woff2 new file mode 100644 index 00000000..0608ca8a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/bf4f0cec-Bt5eV7Mx.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c0a40189-h-pd3hCK.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c0a40189-h-pd3hCK.woff2 new file mode 100644 index 00000000..c0a1bb95 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c0a40189-h-pd3hCK.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2062f2d-BpKk2ixb.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2062f2d-BpKk2ixb.woff2 new file mode 100644 index 00000000..1123ba69 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2062f2d-BpKk2ixb.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c27f9909-Dc2kghpz.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c27f9909-Dc2kghpz.woff2 new file mode 100644 index 00000000..a50b2dab Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c27f9909-Dc2kghpz.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2f7cd5e-3HXwf3my.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2f7cd5e-3HXwf3my.woff2 new file mode 100644 index 00000000..ec8d5b4d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c2f7cd5e-3HXwf3my.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c43d20a2-COG0c7rx.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c43d20a2-COG0c7rx.woff2 new file mode 100644 index 00000000..8346d036 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c43d20a2-COG0c7rx.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c6e97809-CSpWOcs8.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c6e97809-CSpWOcs8.woff2 new file mode 100644 index 00000000..9f9bbe2f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c6e97809-CSpWOcs8.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/c754c613-CXIrrCyE.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c754c613-CXIrrCyE.woff2 new file mode 100644 index 00000000..f45cd8c2 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/c754c613-CXIrrCyE.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/ca658d72-Bp3q3qfn.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ca658d72-Bp3q3qfn.woff2 new file mode 100644 index 00000000..fbef1f31 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ca658d72-Bp3q3qfn.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/cdac0154-Cluk0ASU.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/cdac0154-Cluk0ASU.woff2 new file mode 100644 index 00000000..0ab9156a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/cdac0154-Cluk0ASU.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/d1ab5ca3-BXt44gBC.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d1ab5ca3-BXt44gBC.woff2 new file mode 100644 index 00000000..148fcd7e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d1ab5ca3-BXt44gBC.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6820235-CYOJso7N.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6820235-CYOJso7N.woff2 new file mode 100644 index 00000000..fc6000b8 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6820235-CYOJso7N.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6b5c292-D3SNrSIT.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6b5c292-D3SNrSIT.woff2 new file mode 100644 index 00000000..3000205d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/d6b5c292-D3SNrSIT.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/db53347f-C2u4n_gf.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/db53347f-C2u4n_gf.woff2 new file mode 100644 index 00000000..4b7e8477 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/db53347f-C2u4n_gf.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/dcb1ff4a-ScdlV2Al.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/dcb1ff4a-ScdlV2Al.woff2 new file mode 100644 index 00000000..7fa2c15f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/dcb1ff4a-ScdlV2Al.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/dd2bb5c1-CbM8p1LQ.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/dd2bb5c1-CbM8p1LQ.woff2 new file mode 100644 index 00000000..b7ff9ca9 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/dd2bb5c1-CbM8p1LQ.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/e084fc75-DHyAckYl.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e084fc75-DHyAckYl.woff2 new file mode 100644 index 00000000..b0a6644e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e084fc75-DHyAckYl.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/e0d8cfc8-CfxkBv2c.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e0d8cfc8-CfxkBv2c.woff2 new file mode 100644 index 00000000..34a28b1f Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e0d8cfc8-CfxkBv2c.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/e16b3f49-Blh9L1yP.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e16b3f49-Blh9L1yP.woff2 new file mode 100644 index 00000000..1ca3dcef Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e16b3f49-Blh9L1yP.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/e378c475-DTBeZLuo.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e378c475-DTBeZLuo.woff2 new file mode 100644 index 00000000..fe2ff6c0 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e378c475-DTBeZLuo.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/e776ebdb-ChWeS5tV.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e776ebdb-ChWeS5tV.woff2 new file mode 100644 index 00000000..f5ad20bf Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/e776ebdb-ChWeS5tV.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/eba750fc-W4uMvIEl.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/eba750fc-W4uMvIEl.woff2 new file mode 100644 index 00000000..fd95245a Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/eba750fc-W4uMvIEl.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/ecf8047c-wCzj_S6z.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ecf8047c-wCzj_S6z.woff2 new file mode 100644 index 00000000..2cdfb78b Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ecf8047c-wCzj_S6z.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f0b3c-B5npNH7i.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f0b3c-B5npNH7i.woff2 new file mode 100644 index 00000000..cabc4dc9 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f0b3c-B5npNH7i.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f25c7-BddUKBsc.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f25c7-BddUKBsc.woff2 new file mode 100644 index 00000000..88d14a32 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/ed0f25c7-BddUKBsc.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/edbfaf60-BFQCOTkX.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/edbfaf60-BFQCOTkX.woff2 new file mode 100644 index 00000000..e1cc5beb Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/edbfaf60-BFQCOTkX.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/f1da1a83-Btc3ezpN.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f1da1a83-Btc3ezpN.woff2 new file mode 100644 index 00000000..7049870e Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f1da1a83-Btc3ezpN.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/f2e6ea1a-CRQaqAq-.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f2e6ea1a-CRQaqAq-.woff2 new file mode 100644 index 00000000..978f5721 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f2e6ea1a-CRQaqAq-.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/f68c886a-D41nu4MZ.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f68c886a-D41nu4MZ.woff2 new file mode 100644 index 00000000..2b04fff7 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f68c886a-D41nu4MZ.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/f692aa37-DgYY5xcu.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f692aa37-DgYY5xcu.woff2 new file mode 100644 index 00000000..1e778c97 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f692aa37-DgYY5xcu.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/f8002d41-BeJbsz1r.woff2 b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f8002d41-BeJbsz1r.woff2 new file mode 100644 index 00000000..b0176102 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/f8002d41-BeJbsz1r.woff2 differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-Cn8TMtqS.png b/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-Cn8TMtqS.png new file mode 100644 index 00000000..6c23899d Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-Cn8TMtqS.png differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-text-BDxN5rcD.png b/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-text-BDxN5rcD.png new file mode 100644 index 00000000..b6c3c441 Binary files /dev/null and b/apps/ios/EdgeEver/Resources/EditorBundle/assets/paper-text-BDxN5rcD.png differ diff --git a/apps/ios/EdgeEver/Resources/EditorBundle/index.html b/apps/ios/EdgeEver/Resources/EditorBundle/index.html index 76e7ab0a..8a5fbad8 100644 --- a/apps/ios/EdgeEver/Resources/EditorBundle/index.html +++ b/apps/ios/EdgeEver/Resources/EditorBundle/index.html @@ -7,18 +7,688 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> EdgeEver Editor - - +`},"getStyles"),dv,vu=(dv=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(dv,"PathBuilder"),dv),fv,h3r=(fv=class{constructor(e,r=Ase()){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 y=new vu,b=g>d;g===d?y.moveTo(0,d).lineTo(m,g):y.moveTo(0,d).arcTo(s,s,0,!1,b,s,d+(b?s:-s)).lineTo(s,g-(b?s:-s)).arcTo(s,s,0,!1,!b,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",y.build());const v=new vu,w=m+f.dimensions.width,T=l-s*2;g===d?v.moveTo(w,g).lineTo(l,d):v.moveTo(w,g).lineTo(T,g).arcTo(s,s,0,!1,!b,l-s,g+(b?-s:s)).lineTo(l-s,d+(b?s:-s)).arcTo(s,s,0,!1,b,l,d),u.append("path").attr("class","railroad-line").attr("d",v.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 vu().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new vu().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new vu().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 vu().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new vu().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,U=new vu().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",U.build()),l){const y=new vu().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",y.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 vu().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new vu().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fv,"RailroadRenderer"),fv),Hye=x((t,e,r)=>{Ga(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),d3r=x((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=sl(e);n.attr("class","railroad-diagram");const i=xr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ta.getRules();if(de.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){de.warn("[Railroad] No rules to render"),Hye(n,{height:100,width:200},a);return}const l=new h3r(n,Ase()).renderDiagram(s);Hye(n,l,a),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),vB={draw:d3r},f3r=kae().Railroad.parser.LangiumParser,Sy=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Sy);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Sy);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Sy(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Sy(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Sy(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),p3r=x(t=>({name:t.name,definition:Sy(t.definition)}),"transformRule"),g3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(p3r(e)))},"populateDb"),m3r={parse:x(t=>{ta.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=f3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),g3r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ta}},U3r={parser:m3r,db:ta,renderer:vB,styles:bB};const y3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:U3r},Symbol.toStringTag,{value:"Module"}));var b3r=Sae().RailroadEbnf.parser.LangiumParser,hR=x(t=>{const e=t.alternatives.map(v3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),v3r=x(t=>{const e=t.elements.map(w3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),YZe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return hR(t.element);case"EbnfOptional":return{type:"optional",element:hR(t.element)};case"EbnfRepetition":return{type:"repetition",element:hR(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),x3r=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},YZe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),w3r=x(t=>t.postfixes.reduce((e,r)=>x3r(e,r),YZe(t.base)),"transformTerm"),T3r=x(t=>({name:t.name,definition:hR(t.definition)}),"transformRule"),C3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(T3r(e)))},"populateDb"),k3r={parse:x(t=>{ta.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=b3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),C3r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ta}},S3r={parser:k3r,db:ta,renderer:vB,styles:bB};const E3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:S3r},Symbol.toStringTag,{value:"Module"}));var A3r=Eae().RailroadAbnf.parser.LangiumParser,lZ=x(t=>{const e=t.alternatives.map(M3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),M3r=x(t=>{const e=t.elements.map(L3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),R3r=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),L3r=x(t=>{const e=I3r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=R3r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),I3r=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return lZ(t.element);case"AbnfOptionalGroup":return{type:"optional",element:lZ(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),N3r=x(t=>({name:t.name,definition:lZ(t.definition)}),"transformRule"),D3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(N3r(e)))},"populateDb"),O3r={parse:x(t=>{ta.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=A3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),D3r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ta}},_3r={parser:O3r,db:ta,renderer:vB,styles:bB};const P3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:_3r},Symbol.toStringTag,{value:"Module"}));var B3r=Aae().RailroadPeg.parser.LangiumParser,XZe=x(t=>{const e=t.alternatives.map($3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),$3r=x(t=>{const e=t.elements.map(F3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),F3r=x(t=>{const e=z3r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Gye(e)}`:`!${Gye(e)}`}:e},"transformPrefix"),Gye=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),z3r=x(t=>{const e=V3r(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"),V3r=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return XZe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),H3r=x(t=>({name:t.name,definition:XZe(t.definition)}),"transformRule"),G3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(H3r(e)))},"populateDb"),W3r={parse:x(t=>{ta.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=B3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),G3r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ta}},q3r={parser:W3r,db:ta,renderer:vB,styles:bB};const j3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:q3r},Symbol.toStringTag,{value:"Module"}));var Y3r=1;function Mse(){if(!(typeof globalThis>"u"))return globalThis}x(Mse,"getCaptureGlobal");function KZe(){var t;return!!((t=Mse())!=null&&t.mermaidCaptureSizes)}x(KZe,"shouldCaptureSizes");function ZZe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(ZZe,"capturedFromLocation");function JZe(t,e){const r=Mse();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(JZe,"emitCapturedSizes");function QZe(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&&JZe({metadata:{captureVersion:Y3r,capturedAt:new Date().toISOString(),capturedFrom:ZZe()},nodes:r},t)}x(QZe,"captureNodeSizes");const X3r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:QZe,shouldCaptureSizes:KZe},Symbol.toStringTag,{value:"Module"})),K3r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:fje,createInfoServices:pje},Symbol.toStringTag,{value:"Module"})),Z3r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:gje,createPacketServices:mje},Symbol.toStringTag,{value:"Module"})),J3r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Uje,createPieServices:yje},Symbol.toStringTag,{value:"Module"})),Q3r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:bje,createTreeViewServices:vje},Symbol.toStringTag,{value:"Module"})),exr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:xje,createArchitectureServices:wje},Symbol.toStringTag,{value:"Module"})),txr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:hje,createGitGraphServices:dje},Symbol.toStringTag,{value:"Module"})),rxr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Cje,createEventModelingServices:kje},Symbol.toStringTag,{value:"Module"})),nxr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Jqe,createRadarServices:Qqe},Symbol.toStringTag,{value:"Module"})),ixr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:eje,createRailroadServices:kae},Symbol.toStringTag,{value:"Module"})),axr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:tje,createRailroadEbnfServices:Sae},Symbol.toStringTag,{value:"Module"})),sxr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:rje,createRailroadAbnfServices:Eae},Symbol.toStringTag,{value:"Module"})),oxr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:nje,createRailroadPegServices:Aae},Symbol.toStringTag,{value:"Module"})),lxr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:aje,createTreemapServices:sje},Symbol.toStringTag,{value:"Module"})),cxr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:oje,createWardleyServices:lje},Symbol.toStringTag,{value:"Module"})),uxr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:cje,createCynefinServices:uje},Symbol.toStringTag,{value:"Module"})); + "),typeof Pt!="string"&&!vs(Pt)&&(Pt=svt(Pt),typeof Pt!="string"))throw Ep("dirty is not a string, aborting");if(!e.isSupported)return Pt;re?(te=Y,$e=J):jr(De),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(te=Bc(te)),G.uponSanitizeAttribute.length>0&&($e=Bc($e)),e.removed=[];const On=je&&typeof Pt!="string"&&vs(Pt);if(On){ft(Pt);const pu=E(Pt);if(typeof pu=="string"){const Nc=bt(pu);if(!te[Nc]||he[Nc])throw Br(Pt),Ep("root node is forbidden and cannot be sanitized in-place")}if(cn(Pt))throw Br(Pt),Ep("root node is clobbered and cannot be sanitized in-place");try{Tp(Pt)}catch(Nc){throw Br(Pt),Nc}}else if(vs(Pt))nt=ar("\x3C!---->"),It=nt.ownerDocument.importNode(Pt,!0),It.nodeType===Oc.element&&It.nodeName==="BODY"||It.nodeName==="HTML"?nt=It:nt.appendChild(It),Tp(nt);else{if(!X&&!le&&!Ce&&Pt.indexOf("<")===-1)return A&&ee?I(Pt):Pt;if(nt=ar(Pt),!nt)return X?null:ee?M:""}nt&&ue&&yt(nt.firstChild);const Wn=On?Pt:nt;try{const pu=Ie(Wn);for(;Bt=pu.nextNode();)Hm(Bt,Wn),na(Bt,Wn),Mn(Bt.content)&&Ic(Bt.content)}catch(pu){throw On&&(Br(Pt),g1(e.removed,Nc=>{Nc.element&&vt(Nc.element)})),pu}if(On){let pu=!1;if(g1(e.removed,Nc=>{Nc.element&&(Nc.element===Pt&&(pu=!0),vt(Nc.element))}),pu)throw Ep("a node selected for removal could not be safely returned; refusing to sanitize in place");return le&&Be(Pt),Pt}if(X){if(le&&Be(nt),fe)for(Dr=V.call(nt.ownerDocument);nt.firstChild;)Dr.appendChild(nt.firstChild);else Dr=nt;return($e.shadowroot||$e.shadowrootmode)&&(Dr=H.call(n,Dr,!0)),Dr}let _s=Ce?nt.outerHTML:nt.innerHTML;return Ce&&te["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&Ho(mvt,nt.ownerDocument.doctype.name)&&(_s=" -`+_s),le&&(_s=ci(_s)),A&&ee?I(_s):_s},e.setConfig=function(){let Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jr(Pt),re=!0,Y=te,J=$e},e.clearConfig=function(){nr=null,re=!1,Y=null,J=null,A=R,M=""},e.isValidAttribute=function(Pt,De,nt){nr||jr({});const It=bt(Pt),Bt=bt(De);return Gm(It,Bt,nt)},e.addHook=function(Pt,De){typeof De=="function"&&uc(G,Pt)&&LC(G[Pt],De)},e.removeHook=function(Pt,De){if(uc(G,Pt)){if(De!==void 0){const nt=Qyt(G[Pt],De);return nt===-1?void 0:Jyt(G[Pt],nt,1)[0]}return Jce(G[Pt])}},e.removeHooks=function(Pt){uc(G,Pt)&&(G[Pt]=[])},e.removeAllHooks=function(){G=hue()},e}var M0=V3e(),xW=w((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>xW(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(([s,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(t,s)||Object.defineProperty(t,s,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[s]===void 0&&(i[s]=Array.isArray(a)?[]:{}),typeof i[s]=="object"&&(i[s]=xW(i[s],a,{depth:r-1}))}else typeof i[s]!="object"&&(Object.hasOwn(t,s)?i[s]=a:Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),oa=xW,rf="#ffffff",nf="#f2f2f2",rn=w((t,e)=>e?ye(t,{s:-40,l:10}):ye(t,{s:-40,l:-10}),"mkBorder"),Ax,kvt=(Ax=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,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T,C,S,k,E,A,M,R,P,N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(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(Ax,"Theme"),Ax),Svt=w(t=>{const e=new kvt;return e.calculate(t),e},"getThemeVariables"),Mx,Evt=(Mx=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ah(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=Ah(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ah(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,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T,C,S,k,E,A,M,R,P,N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,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=rt(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=ye(this.primaryColor,{h:64}),this.fillType3=ye(this.secondaryColor,{h:64}),this.fillType4=ye(this.primaryColor,{h:-64}),this.fillType5=ye(this.secondaryColor,{h:-64}),this.fillType6=ye(this.primaryColor,{h:128}),this.fillType7=ye(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||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Mx,"Theme"),Mx),Avt=w(t=>{const e=new Evt;return e.calculate(t),e},"getThemeVariables"),Rx,Mvt=(Rx=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ye(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=rn(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=Ah(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,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T,C,S,k,E,A,M,R,P,N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(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(Rx,"Theme"),Rx),rp=w(t=>{const e=new Mvt;return e.calculate(t),e},"getThemeVariables"),_x,Rvt=(_x=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=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.primaryColor),this.lineColor=rt(this.background),this.textColor=rt(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,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T,C,S,k,E,A,M,R,P,N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,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||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(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(_x,"Theme"),_x),_vt=w(t=>{const e=new Rvt;return e.calculate(t),e},"getThemeVariables"),Lx,Lvt=(Lx=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=lt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(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,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T,C,S,k,E,A,M,R,P,N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,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(Lx,"Theme"),Lx),Ivt=w(t=>{const e=new Lvt;return e.calculate(t),e},"getThemeVariables"),Ix,Nvt=(Ix=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=rn(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 s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(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||ye(e,{h:30}),this.cScale4=this.cScale4||ye(e,{h:60}),this.cScale5=this.cScale5||ye(e,{h:90}),this.cScale6=this.cScale6||ye(e,{h:120}),this.cScale7=this.cScale7||ye(e,{h:150}),this.cScale8=this.cScale8||ye(e,{h:210,l:150}),this.cScale9=this.cScale9||ye(e,{h:270}),this.cScale10=this.cScale10||ye(e,{h:300}),this.cScale11=this.cScale11||ye(e,{h:330}),this.darkMode)for(let y=0;y{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},w(Ix,"Theme"),Ix),Ovt=w(t=>{const e=new Nvt;return e.calculate(t),e},"getThemeVariables"),Nx,Dvt=(Nx=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Ah(255,255,255,.25),this.arrowheadColor=rt(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,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(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(Nx,"Theme"),Nx),Pvt=w(t=>{const e=new Dvt;return e.calculate(t),e},"getThemeVariables"),Ox,$vt=(Ox=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=rn("#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 s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(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(Ox,"Theme"),Ox),Bvt=w(t=>{const e=new $vt;return e.calculate(t),e},"getThemeVariables"),Dx,Fvt=(Dx=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Ah(255,255,255,.25),this.arrowheadColor=rt(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,s,a,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||ye(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ye(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ye(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ye(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ye(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ye(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ye(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ye(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ye(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(Dx,"Theme"),Dx),zvt=w(t=>{const e=new Fvt;return e.calculate(t),e},"getThemeVariables"),Px,Vvt=(Px=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=rn(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 s,a,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=ye(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(Px,"Theme"),Px),Hvt=w(t=>{const e=new Vvt;return e.calculate(t),e},"getThemeVariables"),$x,Gvt=($x=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=ye(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Ah(255,255,255,.25),this.arrowheadColor=rt(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,s,a,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||ye(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ye(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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($x,"Theme"),$x),Wvt=w(t=>{const e=new Gvt;return e.calculate(t),e},"getThemeVariables"),b0={base:{getThemeVariables:Svt},dark:{getThemeVariables:Avt},default:{getThemeVariables:rp},forest:{getThemeVariables:_vt},neutral:{getThemeVariables:Ivt},neo:{getThemeVariables:Ovt},"neo-dark":{getThemeVariables:Pvt},redux:{getThemeVariables:Bvt},"redux-dark":{getThemeVariables:zvt},"redux-color":{getThemeVariables:Hvt},"redux-dark-color":{getThemeVariables:Wvt}},mo={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},H3e={...mo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:b0.default.getThemeVariables(),sequence:{...mo.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:{...mo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...mo.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...mo.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:{...mo.pie,useWidth:984},xyChart:{...mo.xyChart,useWidth:void 0},requirement:{...mo.requirement,useWidth:void 0},packet:{...mo.packet},eventmodeling:{...mo.eventmodeling},treeView:{...mo.treeView,useWidth:void 0},radar:{...mo.radar},railroad:{...mo.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:{...mo.ishikawa},sankey:{...mo.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:{...mo.venn},cynefin:{...mo.cynefin}},G3e=w((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...G3e(t[n],"")]:[...r,e+n],[]),"keyify"),qvt=new Set(G3e(H3e,"")),En=H3e,Uvt={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},jvt=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))&&(de.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),P_=w(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>P_(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!qvt.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Uvt[e];n?jvt(t[e],n):(de.debug("sanitizing object",e),P_(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=W3e(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]="")}de.debug("After sanitization",t)}},"sanitizeDirective"),W3e=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"),pc=oa({},I5),$_,Wy=[],DS=oa({},I5),XA=w((t,e)=>{let r=oa({},t),n={};for(const i of e)j3e(i),n=oa(n,i);if(r=oa(r,n),n.theme&&n.theme in b0){const i=oa({},$_),s=oa(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in b0&&(r.themeVariables=b0[r.theme].getThemeVariables(s))}return DS=r,Jvt(DS),DS},"updateCurrentConfig"),Yvt=w(t=>(pc=oa({},I5),pc=oa(pc,t),t.theme&&b0[t.theme]&&(pc.themeVariables=b0[t.theme].getThemeVariables(t.themeVariables)),XA(pc,Wy),pc),"setSiteConfig"),Xvt=w(t=>{$_=oa({},t)},"saveConfigFromInitialize"),Kvt=w(t=>(pc=oa(pc,t),XA(pc,Wy),pc),"updateSiteConfig"),q3e=w(()=>oa({},pc),"getSiteConfig"),U3e=w(t=>(XA(DS,[t]),xr()),"setConfig"),xr=w(()=>oa({},DS),"getConfig"),j3e=w(t=>{t&&(["secure",...pc.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(de.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"&&j3e(t[e])}))},"sanitize"),Zvt=w(t=>{var e;P_(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Wy.push(t),XA(pc,Wy)},"addDirective"),B_=w((t=pc)=>{Wy=[],XA(t,Wy)},"reset"),Qvt={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."},due={},Y3e=w(t=>{due[t]||(de.warn(Qvt[t]),due[t]=!0)},"issueWarning"),Jvt=w(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Y3e("LAZY_LOAD_DEPRECATED")},"checkConfig"),X3e=w(()=>{let t={};$_&&(t=oa(t,$_));for(const e of Wy)t=oa(t,e);return t},"getUserDefinedConfig"),yi=w(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Y3e("FLOWCHART_HTML_LABELS_DEPRECATED"),sf(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),K3e=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,PS=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,e2t=/\s*%%.*\n/gm,Bx,Z3e=(Bx=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},w(Bx,"UnknownDiagramError"),Bx),qy={},AQ=w(function(t,e){t=t.replace(K3e,"").replace(PS,"").replace(e2t,` -`);for(const[r,{detector:n}]of Object.entries(qy))if(n(t,e))return r;throw new Z3e(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),wW=w((...t)=>{for(const{id:e,detector:r,loader:n}of t)Q3e(e,r,n)},"registerLazyLoadedDiagrams"),Q3e=w((t,e,r)=>{qy[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),qy[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),t2t=w(t=>qy[t].loader,"getDiagramLoader"),G3=//gi,r2t=w(t=>t?tCe(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),n2t=(()=>{let t=!1;return()=>{t||(J3e(),t=!0)}})();function J3e(){const t="data-temp-href-target";M0.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),M0.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(J3e,"setupDompurifyHooks");var eCe=w(t=>(n2t(),M0.sanitize(t)),"removeScript"),fue=w((t,e)=>{if(yi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=eCe(t):r!=="loose"&&(t=tCe(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=o2t(t))}return t},"sanitizeMore"),Nn=w((t,e)=>t&&(e.dompurifyConfig?t=M0.sanitize(fue(t,e),e.dompurifyConfig).toString():t=M0.sanitize(fue(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),i2t=w((t,e)=>typeof t=="string"?Nn(t,e):t.flat().map(r=>Nn(r,e)),"sanitizeTextOrArray"),s2t=w(t=>G3.test(t),"hasBreaks"),a2t=w(t=>t.split(G3),"splitBreaks"),o2t=w(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),tCe=w(t=>t.replace(G3,"#br#"),"breakToPlaceholder"),tD=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"),l2t=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),c2t=w(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),Up=w(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),u2t=w((t,e)=>{const r=TW(t,"~"),n=TW(e,"~");return r===1&&n===1},"shouldCombineSets"),h2t=w(t=>{const e=TW(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("~"),s=n.lastIndexOf("~");for(;i!==-1&&s!==-1&&i!==s;)n[i]="<",n[s]=">",i=n.indexOf("~"),s=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),pue=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),CW=/\$\$(.*?)\$\$/g,ea=w(t=>{var e;return(((e=t.match(CW))==null?void 0:e.length)??0)>0},"hasKatex"),KA=w(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await rD(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"),d2t=w(async(t,e)=>{if(!ea(t))return t;if(!(pue()||e.legacyMathML||e.forceLegacyMathML))return t.replace(CW,"MathML is unsupported in this environment.");{const{default:r}=await Mr(async()=>{const{default:i}=await Promise.resolve().then(()=>TUt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!pue()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(G3).map(i=>ea(i)?`
${i}
`:`
${i}
`).join("").replace(CW,(i,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),rD=w(async(t,e)=>Nn(await d2t(t,e),e),"renderKatexSanitized"),Gt={getRows:r2t,sanitizeText:Nn,sanitizeTextOrArray:i2t,hasBreaks:s2t,splitBreaks:a2t,lineBreakRegex:G3,removeScript:eCe,getUrl:tD,evaluate:sf,getMax:l2t,getMin:c2t},f2t=w(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),p2t=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"),qs=w(function(t,e,r,n){const i=p2t(e,r,n);f2t(t,i)},"configureSvgSize"),W3=w(function(t,e,r,n){const i=e.node().getBBox(),s=i.width,a=i.height;de.info(`SVG bounds: ${s}x${a}`,i);let o=0,l=0;de.info(`Graph bounds: ${o}x${l}`,t),o=s+r*2,l=a+r*2,de.info(`Calculated bounds: ${o}x${l}`),qs(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"),MR={};function kW(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}w(kW,"cssStyleSheetToString");var g2t=w((t,e,r,n)=>{let i="";return t in MR&&MR[t]?i=MR[t]({...r,svgId:n}):de.warn(`No theme found for ${t}`),`& { +`);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(Hr.near(n.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[TG({find:i5t,type:this.type,getAttributes:t=>({language:t[1]})}),TG({find:a5t,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ci({key:new Mi("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(yr.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});var s5t=W4e;const o5t="modulepreload",l5t=function(t,e){return new URL(t,e).href},sue={},Mr=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=l5t(h,n),h in sue)return;sue[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const U=o[m];if(U.href===h&&(!d||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":o5t,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,U)=>{g.addEventListener("load",m),g.addEventListener("error",()=>U(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 q4e=Object.defineProperty,x=(t,e)=>q4e(t,"name",{value:e,configurable:!0}),rO=(t,e)=>{for(var r in e)q4e(t,r,{get:e[r],enumerable:!0})},MA={exports:{}},c5t=MA.exports,oue;function u5t(){return oue||(oue=1,(function(t,e){(function(r,n){t.exports=n()})(c5t,(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",U=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,b={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(L){var I=["th","st","nd","rd"],P=L%100;return"["+L+(I[(P-20)%10]||I[P]||I[0])+"]"}},v=function(L,I,P){var O=String(L);return!O||O.length>=I?L:""+Array(I+1-O.length).join(P)+L},w={s:v,z:function(L){var I=-L.utcOffset(),P=Math.abs(I),O=Math.floor(P/60),D=P%60;return(I<=0?"+":"-")+v(O,2,"0")+":"+v(D,2,"0")},m:function L(I,P){if(I.date()1)return L(F[0])}else{var z=I.name;k[z]=I,D=z}return!O&&D&&(T=D),D||!O&&T},A=function(L,I){if(S(L))return L.clone();var P=typeof I=="object"?I:{};return P.date=L,P.args=arguments,new _(P)},R=w;R.l=E,R.i=S,R.w=function(L,I){return A(L,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var _=(function(){function L(P){this.$L=E(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[C]=!0}var I=L.prototype;return I.parse=function(P){this.$d=(function(O){var D=O.date,B=O.utc;if(D===null)return new Date(NaN);if(R.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(U);if(F){var z=F[2]-1||0,$=(F[7]||"0").substring(0,3);return B?new Date(Date.UTC(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)):new Date(F[1],z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,$)}}return new Date(D)})(P),this.init()},I.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},I.$utils=function(){return R},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(P,O){var D=A(P);return this.startOf(O)<=D&&D<=this.endOf(O)},I.isAfter=function(P,O){return A(P){},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},LJ=x(function(t="fatal"){let e=kf.fatal;typeof t=="string"?t.toLowerCase()in kf&&(e=kf[t]):typeof t=="number"&&(e=t),de.trace=()=>{},de.debug=()=>{},de.info=()=>{},de.warn=()=>{},de.error=()=>{},de.fatal=()=>{},e<=kf.fatal&&(de.fatal=console.error?console.error.bind(console,mu("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",mu("FATAL"))),e<=kf.error&&(de.error=console.error?console.error.bind(console,mu("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",mu("ERROR"))),e<=kf.warn&&(de.warn=console.warn?console.warn.bind(console,mu("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",mu("WARN"))),e<=kf.info&&(de.info=console.info?console.info.bind(console,mu("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",mu("INFO"))),e<=kf.debug&&(de.debug=console.debug?console.debug.bind(console,mu("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mu("DEBUG"))),e<=kf.trace&&(de.trace=console.debug?console.debug.bind(console,mu("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",mu("TRACE")))},"setLogLevel"),mu=x(t=>`%c${Qs().format("ss.SSS")} : ${t} : `,"format");const RA={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 RA.hue2rgb(a,i,t+1/3)*255;case"g":return RA.hue2rgb(a,i,t)*255;case"b":return RA.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},f5t={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},ln={channel:RA,lang:d5t,unit:f5t},Hp={};for(let t=0;t<=255;t++)Hp[t]=ln.unit.dec2hex(t);const Ho={ALL:0,RGB:1,HSL:2};let p5t=class{constructor(){this.type=Ho.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=Ho.ALL}is(e){return this.type===e}};class g5t{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new p5t}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Ho.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=ln.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=ln.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=ln.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=ln.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=ln.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=ln.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Ho.HSL)&&r!==void 0?r:(this._ensureHSL(),ln.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Ho.HSL)&&r!==void 0?r:(this._ensureHSL(),ln.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Ho.HSL)&&r!==void 0?r:(this._ensureHSL(),ln.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Ho.RGB)&&r!==void 0?r:(this._ensureRGB(),ln.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Ho.RGB)&&r!==void 0?r:(this._ensureRGB(),ln.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Ho.RGB)&&r!==void 0?r:(this._ensureRGB(),ln.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Ho.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Ho.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Ho.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Ho.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Ho.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Ho.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const nO=new g5t({r:0,g:0,b:0,a:0},"transparent"),l6={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(l6.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 nO.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?`#${Hp[Math.round(e)]}${Hp[Math.round(r)]}${Hp[Math.round(n)]}${Hp[Math.round(i*255)]}`:`#${Hp[Math.round(e)]}${Hp[Math.round(r)]}${Hp[Math.round(n)]}`}},lU={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(lU.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return ln.channel.clamp.h(parseFloat(r)*.9);case"rad":return ln.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ln.channel.clamp.h(parseFloat(r)*360)}}return ln.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(lU.re);if(!r)return;const[,n,i,a,s,o]=r;return nO.set({h:lU._hue2deg(n),s:ln.channel.clamp.s(parseFloat(i)),l:ln.channel.clamp.l(parseFloat(a)),a:s?ln.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(${ln.lang.round(e)}, ${ln.lang.round(r)}%, ${ln.lang.round(n)}%, ${i})`:`hsl(${ln.lang.round(e)}, ${ln.lang.round(r)}%, ${ln.lang.round(n)}%)`}},Bx={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=Bx.colors[t];if(e)return l6.parse(e)},stringify:t=>{const e=l6.stringify(t);for(const r in Bx.colors)if(Bx.colors[r]===e)return r}},I3={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(I3.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return nO.set({r:ln.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:ln.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:ln.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?ln.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(${ln.lang.round(e)}, ${ln.lang.round(r)}, ${ln.lang.round(n)}, ${ln.lang.round(i)})`:`rgb(${ln.lang.round(e)}, ${ln.lang.round(r)}, ${ln.lang.round(n)})`}},zh={format:{keyword:Bx,hex:l6,rgb:I3,rgba:I3,hsl:lU,hsla:lU},parse:t=>{if(typeof t!="string")return t;const e=l6.parse(t)||I3.parse(t)||lU.parse(t)||Bx.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Ho.HSL)||t.data.r===void 0?lU.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?I3.stringify(t):l6.stringify(t)},j4e=(t,e)=>{const r=zh.parse(t);for(const n in e)r[n]=ln.channel.clamp[n](e[n]);return zh.stringify(r)},Eh=(t,e,r=0,n=1)=>{if(typeof t!="number")return j4e(t,{a:e});const i=nO.set({r:ln.channel.clamp.r(t),g:ln.channel.clamp.g(e),b:ln.channel.clamp.b(r),a:ln.channel.clamp.a(n)});return zh.stringify(i)},IJ=(t,e)=>ln.lang.round(zh.parse(t)[e]),m5t=t=>{const{r:e,g:r,b:n}=zh.parse(t),i=.2126*ln.channel.toLinear(e)+.7152*ln.channel.toLinear(r)+.0722*ln.channel.toLinear(n);return ln.lang.round(i)},U5t=t=>m5t(t)>=.5,Kl=t=>!U5t(t),NJ=(t,e,r)=>{const n=zh.parse(t),i=n[e],a=ln.channel.clamp[e](i+r);return i!==a&&(n[e]=a),zh.stringify(n)},lt=(t,e)=>NJ(t,"l",e),ct=(t,e)=>NJ(t,"l",-e),lue=(t,e)=>NJ(t,"a",-e),Ue=(t,e)=>{const r=zh.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return j4e(t,n)},y5t=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=zh.parse(t),{r:o,g:l,b:u,a:h}=zh.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,U=1-m,y=n*m+o*U,b=i*m+l*U,v=a*m+u*U,w=s*d+h*(1-d);return Eh(y,b,v,w)},rt=(t,e=100)=>{const r=zh.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,y5t(r,t,e)};/*! @license DOMPurify 3.4.16 | (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.16/LICENSE */function cue(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:Us(BigInt.prototype.toString),gue=typeof Symbol>"u"?null:Us(Symbol.prototype.toString),uc=Us(Object.prototype.hasOwnProperty),_9=Us(Object.prototype.toString),Vo=Us(RegExp.prototype.test),Ap=I5t(TypeError);function Us(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]:N3;if(uue&&uue(t,null),!c6(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(C5t(e)||(e[n]=a),i=a)}t[i]=!0}return t}function N5t(t){for(let e=0;e/g),F5t=so(/\${[\w\W]*/g),z5t=so(/^data-[\-\w.\u00B7-\uFFFF]+$/),V5t=so(/^aria-[\-\w]+$/),vue=so(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H5t=so(/^(?:\w+script|data):/i),G5t=so(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W5t=so(/^html$/i),q5t=so(/^[a-z][.\w]*(-[.\w]+)+$/i),xue=so(/<[/\w!]/g),wue=so(/<[/\w]/g),j5t=so(/<\/no(script|embed|frames)/i),Y5t=so(/\/>/i),Dc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},K4e=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],X5t=Ns(Xn({},K4e)),K5t=(function(){const t={};return ym(K4e,e=>{t[e]=so(new RegExp("])","i"))}),Ns(t)})(),Z5t=function(){return typeof window>"u"?null:window},J5t=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}},Tue=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Mp=function(e,r,n,i){return uc(e,r)&&c6(e[r])?Xn(i.base?Bc(i.base):{},e[r],i.transform):n},g$=function(e,r,n){const i=uc(e,r)?e[r]:void 0;return i&&typeof i=="object"?Bc(i):n()};function Z4e(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Z5t();const e=Pt=>Z4e(Pt);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Dc.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;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const u=t.DOMParser,h=t.trustedTypes,d=o.prototype,f=xu(d,"cloneNode"),p=xu(d,"remove"),g=xu(d,"removeAttributeNode"),m=xu(d,"nextSibling"),U=xu(d,"childNodes"),y=xu(d,"parentNode"),b=xu(d,"shadowRoot"),v=xu(d,"attributes"),w=s&&s.prototype?xu(s.prototype,"nodeType"):null,T=s&&s.prototype?xu(s.prototype,"nodeName"):null,k=s&&s.prototype?xu(s.prototype,"ownerDocument"):null,C=function(Oe){return w?w(Oe):Oe.nodeType},S=function(Oe){return T?T(Oe):Oe.nodeName};if(typeof a=="function"){const Pt=r.createElement("template");Pt.content&&Pt.content.ownerDocument&&(r=Pt.content.ownerDocument)}let E,A="",R,_=!1,N=0;const L=function(){if(N>0)throw Ap('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.')},I=function(Oe){L(),N++;try{return E.createHTML(Oe)}finally{N--}},P=function(Oe){L(),N++;try{return E.createScriptURL(Oe)}finally{N--}},O=function(){return _||(R=J5t(h,i),_=!0),R},D=r,B=D.implementation,F=D.createNodeIterator,z=D.createDocumentFragment,$=D.getElementsByTagName,V=n.importNode;let H=Tue();e.isSupported=typeof Y4e=="function"&&typeof y=="function"&&B&&B.createHTMLDocument!==void 0;const G=B5t,K=$5t,W=F5t,oe=z5t,Z=V5t,J=H5t,ne=G5t,ie=q5t;let me=vue,te=null;const Re=Xn({},[...mue,...h$,...d$,...f$,...Uue]);let Pe=null;const Ve=Xn({},[...yue,...p$,...bue,...ES]);let ce=Object.seal(Q2(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,we=null;const ge=Object.seal(Q2(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ze=!0,xe=!0,Ee=!1,qe=!0,le=!1,pe=!0,Te=!1,re=!1,Y=null,Q=null,ue=!1,X=!1,fe=!1,ee=!1,Ae=!0,Me=!1;const Ke="user-content-";let Ne=!0,je=!1,De={},Ze=null;const Fe=Xn({},["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 at=null;const _e=Xn({},["audio","video","img","source","image","track"]);let gt=null;const Le=Xn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",Et="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Vt=ot,Lt=!1,dt=null;const ve=Xn({},[kt,Et,ot],u$),It=Ns(["mi","mo","mn","ms","mtext"]);let xt=Xn({},It);const mt=Ns(["annotation-xml"]);let Mt=Xn({},mt);const Or=Xn({},["title","style","font","a","script"]);let Se=null;const it=["application/xhtml+xml","text/html"],pt="text/html";let bt=null,ir=null;const Br=r.createElement("form"),kr=function(Oe){return Oe instanceof RegExp||Oe instanceof Function},jr=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ir&&ir===Oe)return;(!Oe||typeof Oe!="object")&&(Oe={}),Oe=Bc(Oe),Se=it.indexOf(Oe.PARSER_MEDIA_TYPE)===-1?pt:Oe.PARSER_MEDIA_TYPE,bt=Se==="application/xhtml+xml"?u$:N3,te=Mp(Oe,"ALLOWED_TAGS",Re,{transform:bt}),Pe=Mp(Oe,"ALLOWED_ATTR",Ve,{transform:bt}),dt=Mp(Oe,"ALLOWED_NAMESPACES",ve,{transform:u$}),gt=Mp(Oe,"ADD_URI_SAFE_ATTR",Le,{transform:bt,base:Le}),at=Mp(Oe,"ADD_DATA_URI_TAGS",_e,{transform:bt,base:_e}),Ze=Mp(Oe,"FORBID_CONTENTS",Fe,{transform:bt}),he=Mp(Oe,"FORBID_TAGS",Bc({}),{transform:bt}),we=Mp(Oe,"FORBID_ATTR",Bc({}),{transform:bt}),De=uc(Oe,"USE_PROFILES")?Oe.USE_PROFILES&&typeof Oe.USE_PROFILES=="object"?Bc(Oe.USE_PROFILES):Oe.USE_PROFILES:!1,ze=Oe.ALLOW_ARIA_ATTR!==!1,xe=Oe.ALLOW_DATA_ATTR!==!1,Ee=Oe.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=Oe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,le=Oe.SAFE_FOR_TEMPLATES||!1,pe=Oe.SAFE_FOR_XML!==!1,Te=Oe.WHOLE_DOCUMENT||!1,X=Oe.RETURN_DOM||!1,fe=Oe.RETURN_DOM_FRAGMENT||!1,ee=Oe.RETURN_TRUSTED_TYPE||!1,ue=Oe.FORCE_BODY||!1,Ae=Oe.SANITIZE_DOM!==!1,Me=Oe.SANITIZE_NAMED_PROPS||!1,Ne=Oe.KEEP_CONTENT!==!1,je=Oe.IN_PLACE||!1,me=O5t(Oe.ALLOWED_URI_REGEXP)?Oe.ALLOWED_URI_REGEXP:vue,Vt=typeof Oe.NAMESPACE=="string"?Oe.NAMESPACE:ot,xt=g$(Oe,"MATHML_TEXT_INTEGRATION_POINTS",()=>Xn({},It)),Mt=g$(Oe,"HTML_INTEGRATION_POINTS",()=>Xn({},mt));const nt=g$(Oe,"CUSTOM_ELEMENT_HANDLING",()=>Q2(null));if(ce=Q2(null),uc(nt,"tagNameCheck")&&kr(nt.tagNameCheck)&&(ce.tagNameCheck=nt.tagNameCheck),uc(nt,"attributeNameCheck")&&kr(nt.attributeNameCheck)&&(ce.attributeNameCheck=nt.attributeNameCheck),uc(nt,"allowCustomizedBuiltInElements")&&typeof nt.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=nt.allowCustomizedBuiltInElements),so(ce),le&&(xe=!1),fe&&(X=!0),De&&(te=Xn({},Uue),Pe=Q2(null),De.html===!0&&(Xn(te,mue),Xn(Pe,yue)),De.svg===!0&&(Xn(te,h$),Xn(Pe,p$),Xn(Pe,ES)),De.svgFilters===!0&&(Xn(te,d$),Xn(Pe,p$),Xn(Pe,ES)),De.mathMl===!0&&(Xn(te,f$),Xn(Pe,bue),Xn(Pe,ES))),ge.tagCheck=null,ge.attributeCheck=null,uc(Oe,"ADD_TAGS")&&(typeof Oe.ADD_TAGS=="function"?ge.tagCheck=Oe.ADD_TAGS:c6(Oe.ADD_TAGS)&&(te===Re&&(te=Bc(te)),Xn(te,Oe.ADD_TAGS,bt))),uc(Oe,"ADD_ATTR")&&(typeof Oe.ADD_ATTR=="function"?ge.attributeCheck=Oe.ADD_ATTR:c6(Oe.ADD_ATTR)&&(Pe===Ve&&(Pe=Bc(Pe)),Xn(Pe,Oe.ADD_ATTR,bt))),uc(Oe,"ADD_FORBID_CONTENTS")&&c6(Oe.ADD_FORBID_CONTENTS)&&(Ze===Fe&&(Ze=Bc(Ze)),Xn(Ze,Oe.ADD_FORBID_CONTENTS,bt)),Ne&&(te["#text"]=!0),Te&&Xn(te,["html","head","body"]),te.table&&(Xn(te,["tbody"]),delete he.tbody),Oe.TRUSTED_TYPES_POLICY){if(typeof Oe.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ap('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Oe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ap('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Nt=E;E=Oe.TRUSTED_TYPES_POLICY;try{A=I("")}catch($t){throw E=Nt,$t}}else Oe.TRUSTED_TYPES_POLICY===null?(E=void 0,A=""):(E===void 0&&(E=O()),E&&typeof A=="string"&&(A=I("")));Ns&&Ns(Oe),ir=Oe},Er=Xn({},[...h$,...d$,..._5t]),an=Xn({},[...f$,...P5t]),Cr=function(Oe,nt,Nt){return nt.namespaceURI===ot?Oe==="svg":nt.namespaceURI===kt?Oe==="svg"&&(Nt==="annotation-xml"||xt[Nt]):!!Er[Oe]},Yr=function(Oe,nt,Nt){return nt.namespaceURI===ot?Oe==="math":nt.namespaceURI===Et?Oe==="math"&&Mt[Nt]:!!an[Oe]},Cn=function(Oe,nt,Nt){return nt.namespaceURI===Et&&!Mt[Nt]||nt.namespaceURI===kt&&!xt[Nt]?!1:!an[Oe]&&(Or[Oe]||!Er[Oe])},ut=function(Oe){let nt=y(Oe);(!nt||!nt.tagName)&&(nt={namespaceURI:Vt,tagName:"template"});const Nt=N3(Oe.tagName),$t=N3(nt.tagName);return dt[Oe.namespaceURI]?Oe.namespaceURI===Et?Cr(Nt,nt,$t):Oe.namespaceURI===kt?Yr(Nt,nt,$t):Oe.namespaceURI===ot?Cn(Nt,nt,$t):!!(Se==="application/xhtml+xml"&&dt[Oe.namespaceURI]):!1},Ut=function(Oe){D9(e.removed,{element:Oe});try{y(Oe).removeChild(Oe)}catch{if(p(Oe),!y(Oe))throw Ap("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Zt=function(Oe,nt,Nt){try{g(Oe,nt)}catch{try{Oe.removeAttribute(Nt)}catch{}}},$r=function(Oe){yt(Oe);const nt=U(Oe);if(nt){const $t=[];ym(nt,_r=>{D9($t,_r)}),ym($t,_r=>{try{p(_r)}catch{}})}const Nt=v(Oe);if(Nt)for(let $t=Nt.length-1;$t>=0;--$t){const _r=Nt[$t],On=_r&&_r.name;typeof On=="string"&&Zt(Oe,_r,On)}},un=function(Oe,nt,Nt){if(!Nt)try{Nt=nt.getAttributeNode(Oe)}catch{Nt=null}D9(e.removed,{attribute:Nt||null,from:nt});try{Nt?g(nt,Nt):nt.removeAttribute(Oe)}catch{try{nt.removeAttribute(Oe)}catch{}}if(Oe==="is")if(X||fe)try{Ut(nt)}catch{}else try{nt.setAttribute(Oe,"")}catch{}},Tt=function(Oe){const nt=v(Oe);if(nt)for(let Nt=nt.length-1;Nt>=0;--Nt){const $t=nt[Nt],_r=$t&&$t.name;typeof _r!="string"||Pe[bt(_r)]||Zt(Oe,$t,_r)}},yt=function(Oe){const nt=[Oe];for(;nt.length>0;){const Nt=nt.pop();C(Nt)===Dc.element&&Tt(Nt);const $t=U(Nt);if($t)for(let _r=$t.length-1;_r>=0;--_r)nt.push($t[_r])}},_t=function(Oe,nt){return pe?Oe==="patchsrc"?!0:Oe==="for"&&nt!=="label"&&nt!=="output":!1},ft=function(Oe){if(!pe)return;const nt=[Oe];for(;nt.length>0;){const Nt=nt.pop(),$t=C(Nt);if($t===Dc.processingInstruction||$t===Dc.comment&&Vo(wue,Nt.data)){try{p(Nt)}catch{}continue}if($t===Dc.element){const On=Nt,Gn=bt(S(Nt));try{On.hasAttribute&&On.hasAttribute("patchsrc")&&On.removeAttribute("patchsrc"),On.hasAttribute&&On.hasAttribute("for")&&_t("for",Gn)&&On.removeAttribute("for")}catch{}}const _r=U(Nt);if(_r)for(let On=_r.length-1;On>=0;--On)nt.push(_r[On])}},or=function(Oe){let nt=null,Nt=null;if(ue)Oe=""+Oe;else{const On=due(Oe,/^[\r\n\t ]+/);Nt=On&&On[0]}Se==="application/xhtml+xml"&&Vt===ot&&(Oe=''+Oe+"");const $t=E?I(Oe):Oe;if(Vt===ot)try{nt=new u().parseFromString($t,Se)}catch{}if(!nt||!nt.documentElement){nt=B.createDocument(Vt,"template",null);try{nt.documentElement.innerHTML=Lt?A:$t}catch{}}const _r=nt.body||nt.documentElement;return Oe&&Nt&&_r.insertBefore(r.createTextNode(Nt),_r.childNodes[0]||null),Vt===ot?$.call(nt,Te?"html":"body")[0]:Te?nt.documentElement:_r},Ie=function(Oe){const nt=k?k(Oe):Oe.ownerDocument;return F.call(nt||Oe,Oe,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ui=function(Oe){return Oe=O9(Oe,G," "),Oe=O9(Oe,K," "),Oe=O9(Oe,W," "),Oe},Be=function(Oe){var nt;Oe.normalize();const Nt=k?k(Oe):Oe.ownerDocument,$t=F.call(Nt||Oe,Oe,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let _r=$t.nextNode();for(;_r;)_r.data=ui(_r.data),_r=$t.nextNode();const On=(nt=Oe.querySelectorAll)===null||nt===void 0?void 0:nt.call(Oe,"template");On&&ym(On,Gn=>{Mn(Gn.content)&&Be(Gn.content)})},hn=function(Oe){const nt=T?T(Oe):null;return typeof nt!="string"||bt(nt)!=="form"?!1:typeof Oe.nodeName!="string"||typeof Oe.textContent!="string"||typeof Oe.removeChild!="function"||Oe.attributes!==v(Oe)||typeof Oe.removeAttribute!="function"||typeof Oe.removeAttributeNode!="function"||typeof Oe.getAttributeNode!="function"||typeof Oe.setAttribute!="function"||typeof Oe.namespaceURI!="string"||typeof Oe.insertBefore!="function"||typeof Oe.hasChildNodes!="function"||Oe.nodeType!==w(Oe)||Oe.childNodes!==U(Oe)},Mn=function(Oe){if(!w||typeof Oe!="object"||Oe===null)return!1;try{return w(Oe)===Dc.documentFragment}catch{return!1}},Ua=function(Oe){if(!w||typeof Oe!="object"||Oe===null)return!1;try{return typeof w(Oe)=="number"}catch{return!1}};function bn(Pt,Oe,nt){Pt.length!==0&&ym(Pt,Nt=>{Nt.call(e,Oe,nt,ir)})}const wi=function(Oe,nt){return!!(pe&&Oe.hasChildNodes()&&!Ua(Oe.firstElementChild)&&Vo(xue,Oe.textContent)&&Vo(xue,Oe.innerHTML)||pe&&Oe.namespaceURI===ot&&X5t[nt]&&(Ua(Oe.firstElementChild)||typeof Oe.textContent=="string"&&Vo(K5t[nt],Oe.textContent))||Oe.nodeType===Dc.processingInstruction||pe&&Oe.nodeType===Dc.comment&&Vo(wue,Oe.data))},Rn=function(Oe,nt){if(Oe instanceof RegExp)return Vo(Oe,nt);if(Oe instanceof Function){for(var Nt=arguments.length,$t=new Array(Nt>2?Nt-2:0),_r=2;_r=0;--Gn){const Ma=Oe===Nt?f(_r[Gn],!0):_r[Gn];$t.insertBefore(Ma,m(Oe))}}}return Ut(Oe),!0},eh=function(Oe,nt,Nt,$t){return Oe.length===0?nt:nt===Nt||nt===$t?Bc(nt):nt},ic=function(Oe,nt){return Oe===nt||y(Oe)!==null?!1:(je&&yt(Oe),!0)},G1=function(Oe,nt){if(bn(H.beforeSanitizeElements,Oe,null),ic(Oe,nt))return!0;if(hn(Oe))return Ut(Oe),!0;const Nt=bt(S(Oe));if(te=eh(H.uponSanitizeElement,te,Re,Y),bn(H.uponSanitizeElement,Oe,{tagName:Nt,allowedTags:te}),ic(Oe,nt))return!0;if(wi(Oe,Nt))return Ut(Oe),!0;if(he[Nt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Nt))&&!te[Nt]){const $t=Fo(Oe,Nt,nt);return $t===!1&&(bn(H.afterSanitizeElements,Oe,null),ic(Oe,nt))?!0:$t}if(C(Oe)===Dc.element&&!ut(Oe)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&Vo(j5t,Oe.innerHTML))return Ut(Oe),!0;if(le&&Oe.nodeType===Dc.text){const $t=ui(Oe.textContent);Oe.textContent!==$t&&(D9(e.removed,{element:Oe.cloneNode()}),Oe.textContent=$t)}return bn(H.afterSanitizeElements,Oe,null),ic(Oe,nt)},W1=function(Oe,nt,Nt){if(we[nt]||_t(nt,Oe)||Ae&&(nt==="id"||nt==="name")&&(Nt in r||Nt in Br))return!1;const $t=Pe[nt]||ge.attributeCheck instanceof Function&&ge.attributeCheck(nt,Oe);return xe&&Vo(oe,nt)||ze&&Vo(Z,nt)?!0:$t?gt[nt]||Vo(me,O9(Nt,ne,""))||(nt==="src"||nt==="xlink:href"||nt==="href")&&Oe!=="script"&&fue(Nt,"data:")===0&&at[Oe]||Ee&&!Vo(J,O9(Nt,ne,""))?!0:!Nt:vs(Oe)&&Rn(ce.tagNameCheck,Oe)&&Rn(ce.attributeNameCheck,nt,Oe)||nt==="is"&&ce.allowCustomizedBuiltInElements&&Rn(ce.tagNameCheck,Nt)},q1=Xn({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vs=function(Oe){return!q1[N3(Oe)]&&Vo(ie,Oe)},ac=function(Oe,nt,Nt,$t){if(E&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Nt)switch(h.getAttributeType(Oe,nt)){case"TrustedHTML":return I($t);case"TrustedScriptURL":return P($t)}return $t},go=function(Oe,nt,Nt,$t){try{return Nt?Oe.setAttributeNS(Nt,nt,$t):Oe.setAttribute(nt,$t),hn(Oe)?(Ut(Oe),!1):!0}catch{return un(nt,Oe),!1}},rs=function(Oe,nt){if(bn(H.beforeSanitizeAttributes,Oe,null),ic(Oe,nt))return;const Nt=Oe.attributes;if(!Nt||hn(Oe))return;Pe=eh(H.uponSanitizeAttribute,Pe,Ve,Q);const $t={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let _r=Nt.length;const On=bt(Oe.nodeName);for(;_r--;){const Gn=Nt[_r],Ma=Gn.name,pu=Gn.namespaceURI,Nc=Gn.value,o2=bt(Ma),xB=Nc;let hl=Ma==="value"?xB:M5t(xB),Rse=!1;if($t.attrName=o2,$t.attrValue=hl,$t.keepAttr=!0,$t.forceKeepAttr=void 0,bn(H.uponSanitizeAttribute,Oe,$t),hl=$t.attrValue,Me&&(o2==="id"||o2==="name")&&fue(hl,Ke)!==0&&(un(Ma,Oe,Gn),hl=Ke+hl,Rse=!0),pe&&Vo(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,hl)){un(Ma,Oe,Gn);continue}if(o2==="attributename"&&due(hl,"href")){un(Ma,Oe,Gn);continue}if(!$t.forceKeepAttr){if(!$t.keepAttr){un(Ma,Oe,Gn);continue}if(!qe&&Vo(Y5t,hl)){un(Ma,Oe,Gn);continue}if(le&&(hl=ui(hl)),!W1(On,o2,hl)){un(Ma,Oe,Gn);continue}hl=ac(On,o2,pu,hl),hl!==xB&&go(Oe,Ma,pu,hl)&&Rse&&hue(e.removed)}}bn(H.afterSanitizeAttributes,Oe,null),ic(Oe,nt)},Ic=function(Oe){let nt=null;const Nt=Ie(Oe);for(bn(H.beforeSanitizeShadowDOM,Oe,null);nt=Nt.nextNode();)if(bn(H.uponSanitizeShadowNode,nt,null),G1(nt,Oe),rs(nt,Oe),Mn(nt.content)&&Ic(nt.content),C(nt)===Dc.element){const $t=b(nt);Mn($t)&&(Tp($t),Ic($t))}bn(H.afterSanitizeShadowDOM,Oe,null)},Tp=function(Oe){const nt=[{node:Oe,shadow:null}];for(;nt.length>0;){const Nt=nt.pop();if(Nt.shadow){Ic(Nt.shadow);continue}const $t=Nt.node,_r=C($t)===Dc.element,On=U($t);if(On)for(let Gn=On.length-1;Gn>=0;--Gn)nt.push({node:On[Gn],shadow:null});if(_r){const Gn=T?T($t):null;if(typeof Gn=="string"&&bt(Gn)==="template"){const Ma=$t.content;Mn(Ma)&&nt.push({node:Ma,shadow:null})}}if(_r){const Gn=b($t);Mn(Gn)&&nt.push({node:null,shadow:Gn},{node:Gn,shadow:null})}}};return e.sanitize=function(Pt){let Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt=null,Nt=null,$t=null,_r=null;if(Lt=!Pt,Lt&&(Pt="\x3C!-->"),typeof Pt!="string"&&!Ua(Pt)&&(Pt=D5t(Pt),typeof Pt!="string"))throw Ap("dirty is not a string, aborting");if(!e.isSupported)return Pt;re?(te=Y,Pe=Q):jr(Oe),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(te=Bc(te)),H.uponSanitizeAttribute.length>0&&(Pe=Bc(Pe)),e.removed=[];const On=je&&typeof Pt!="string"&&Ua(Pt);if(On){ft(Pt);const pu=S(Pt);if(typeof pu=="string"){const Nc=bt(pu);if(!te[Nc]||he[Nc])throw $r(Pt),Ap("root node is forbidden and cannot be sanitized in-place")}if(hn(Pt))throw $r(Pt),Ap("root node is clobbered and cannot be sanitized in-place");try{Tp(Pt)}catch(Nc){throw $r(Pt),Nc}}else if(Ua(Pt))nt=or("\x3C!---->"),Nt=nt.ownerDocument.importNode(Pt,!0),Nt.nodeType===Dc.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?nt=Nt:nt.appendChild(Nt),Tp(nt);else{if(!X&&!le&&!Te&&Pt.indexOf("<")===-1)return E&&ee?I(Pt):Pt;if(nt=or(Pt),!nt)return X?null:ee?A:""}nt&&ue&&Ut(nt.firstChild);const Gn=On?Pt:nt;try{const pu=Ie(Gn);for(;$t=pu.nextNode();)G1($t,Gn),rs($t,Gn),Mn($t.content)&&Ic($t.content)}catch(pu){throw On&&($r(Pt),ym(e.removed,Nc=>{Nc.element&&yt(Nc.element)})),pu}if(On){let pu=!1;if(ym(e.removed,Nc=>{Nc.element&&(Nc.element===Pt&&(pu=!0),yt(Nc.element))}),pu)throw Ap("a node selected for removal could not be safely returned; refusing to sanitize in place");return le&&Be(Pt),Pt}if(X){if(le&&Be(nt),fe)for(_r=z.call(nt.ownerDocument);nt.firstChild;)_r.appendChild(nt.firstChild);else _r=nt;return(Pe.shadowroot||Pe.shadowrootmode)&&(_r=V.call(n,_r,!0)),_r}let Ma=Te?nt.outerHTML:nt.innerHTML;return Te&&te["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&&Vo(W5t,nt.ownerDocument.doctype.name)&&(Ma=" +`+Ma),le&&(Ma=ui(Ma)),E&&ee?I(Ma):Ma},e.setConfig=function(){let Pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jr(Pt),re=!0,Y=te,Q=Pe},e.clearConfig=function(){ir=null,re=!1,Y=null,Q=null,E=R,A=""},e.isValidAttribute=function(Pt,Oe,nt){ir||jr({});const Nt=bt(Pt),$t=bt(Oe);return W1(Nt,$t,nt)},e.addHook=function(Pt,Oe){typeof Oe=="function"&&uc(H,Pt)&&D9(H[Pt],Oe)},e.removeHook=function(Pt,Oe){if(uc(H,Pt)){if(Oe!==void 0){const nt=E5t(H[Pt],Oe);return nt===-1?void 0:A5t(H[Pt],nt,1)[0]}return hue(H[Pt])}},e.removeHooks=function(Pt){uc(H,Pt)&&(H[Pt]=[])},e.removeAllHooks=function(){H=Tue()},e}var M0=Z4e(),EG=x((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>EG(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]=EG(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"),ss=EG,nf="#ffffff",af="#f2f2f2",rn=x((t,e)=>e?Ue(t,{s:-40,l:10}):Ue(t,{s:-40,l:-10}),"mkBorder"),L6,Q5t=(L6=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,U,y,b,v,w,T,k,C,S,E,A,R,_,N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,me,te;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(this.primaryColor,{h:330}),this.darkMode)for(let Re=0;Re{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(L6,"Theme"),L6),e2t=x(t=>{const e=new Q5t;return e.calculate(t),e},"getThemeVariables"),I6,t2t=(I6=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Eh(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=Eh(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Eh(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,U,y,b,v,w,T,k,C,S,E,A,R,_,N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,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=rt(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=Ue(this.primaryColor,{h:64}),this.fillType3=Ue(this.secondaryColor,{h:64}),this.fillType4=Ue(this.primaryColor,{h:-64}),this.fillType5=Ue(this.secondaryColor,{h:-64}),this.fillType6=Ue(this.primaryColor,{h:128}),this.fillType7=Ue(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||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(this.primaryColor,{h:330});for(let te=0;te{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(I6,"Theme"),I6),r2t=x(t=>{const e=new t2t;return e.calculate(t),e},"getThemeVariables"),N6,n2t=(N6=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Ue(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=rn(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=Eh(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,U,y,b,v,w,T,k,C,S,E,A,R,_,N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,me;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(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]})}},x(N6,"Theme"),N6),np=x(t=>{const e=new n2t;return e.calculate(t),e},"getThemeVariables"),D6,i2t=(D6=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=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.primaryColor),this.lineColor=rt(this.background),this.textColor=rt(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,U,y,b,v,w,T,k,C,S,E,A,R,_,N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,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||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(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]})}},x(D6,"Theme"),D6),a2t=x(t=>{const e=new i2t;return e.calculate(t),e},"getThemeVariables"),O6,s2t=(O6=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=lt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.lineColor=rt(this.background),this.textColor=rt(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,U,y,b,v,w,T,k,C,S,E,A,R,_,N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,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]})}},x(O6,"Theme"),O6),o2t=x(t=>{const e=new s2t;return e.calculate(t),e},"getThemeVariables"),_6,l2t=(_6=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=rn(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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ue(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||Ue(e,{h:30}),this.cScale4=this.cScale4||Ue(e,{h:60}),this.cScale5=this.cScale5||Ue(e,{h:90}),this.cScale6=this.cScale6||Ue(e,{h:120}),this.cScale7=this.cScale7||Ue(e,{h:150}),this.cScale8=this.cScale8||Ue(e,{h:210,l:150}),this.cScale9=this.cScale9||Ue(e,{h:270}),this.cScale10=this.cScale10||Ue(e,{h:300}),this.cScale11=this.cScale11||Ue(e,{h:330}),this.darkMode)for(let U=0;U{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(_6,"Theme"),_6),c2t=x(t=>{const e=new l2t;return e.calculate(t),e},"getThemeVariables"),P6,u2t=(P6=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Eh(255,255,255,.25),this.arrowheadColor=rt(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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(P6,"Theme"),P6),h2t=x(t=>{const e=new u2t;return e.calculate(t),e},"getThemeVariables"),B6,d2t=(B6=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=rn("#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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ue(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 U=0;U{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(B6,"Theme"),B6),f2t=x(t=>{const e=new d2t;return e.calculate(t),e},"getThemeVariables"),$6,p2t=($6=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Eh(255,255,255,.25),this.arrowheadColor=rt(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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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||Ue(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ue(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ue(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ue(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ue(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ue(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ue(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ue(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ue(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x($6,"Theme"),$6),g2t=x(t=>{const e=new p2t;return e.calculate(t),e},"getThemeVariables"),F6,m2t=(F6=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=rn(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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ue(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 U=0;U{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(F6,"Theme"),F6),U2t=x(t=>{const e=new m2t;return e.calculate(t),e},"getThemeVariables"),z6,y2t=(z6=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=lt(this.primaryColor,16),this.tertiaryColor=Ue(this.primaryColor,{h:-160}),this.primaryBorderColor=rt(this.background),this.secondaryBorderColor=rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=rn(this.tertiaryColor,this.darkMode),this.primaryTextColor=rt(this.primaryColor),this.secondaryTextColor=rt(this.secondaryColor),this.tertiaryTextColor=rt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=lt(rt("#323D47"),10),this.border1="#ccc",this.border2=Eh(255,255,255,.25),this.arrowheadColor=rt(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||Ue(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ue(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||rn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||rn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||rn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||rn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||rt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||rt(this.tertiaryColor),this.lineColor=this.lineColor||rt(this.background),this.arrowheadColor=this.arrowheadColor||rt(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||rt(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]})}},x(z6,"Theme"),z6),b2t=x(t=>{const e=new y2t;return e.calculate(t),e},"getThemeVariables"),v0={base:{getThemeVariables:e2t},dark:{getThemeVariables:r2t},default:{getThemeVariables:np},forest:{getThemeVariables:a2t},neutral:{getThemeVariables:o2t},neo:{getThemeVariables:c2t},"neo-dark":{getThemeVariables:h2t},redux:{getThemeVariables:f2t},"redux-dark":{getThemeVariables:g2t},"redux-color":{getThemeVariables:U2t},"redux-dark-color":{getThemeVariables:b2t}},mo={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},J4e={...mo,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:v0.default.getThemeVariables(),sequence:{...mo.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...mo.gantt,tickInterval:void 0,useWidth:void 0},c4:{...mo.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...mo.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...mo.pie,useWidth:984},xyChart:{...mo.xyChart,useWidth:void 0},requirement:{...mo.requirement,useWidth:void 0},packet:{...mo.packet},eventmodeling:{...mo.eventmodeling},treeView:{...mo.treeView,useWidth:void 0},radar:{...mo.radar},railroad:{...mo.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:{...mo.ishikawa},sankey:{...mo.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:{...mo.venn},cynefin:{...mo.cynefin}},Q4e=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...Q4e(t[n],"")]:[...r,e+n],[]),"keyify"),v2t=new Set(Q4e(J4e,"")),An=J4e,x2t={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},w2t=x((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(de.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),FR=x(t=>{if(de.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>FR(e));return}for(const e of Object.keys(t)){if(de.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!v2t.has(e)||t[e]==null){de.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=x2t[e];n?w2t(t[e],n):(de.debug("sanitizing object",e),FR(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(de.debug("sanitizing css option",e),t[e]=e9e(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]="")}de.debug("After sanitization",t)}},"sanitizeDirective"),e9e=x(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),pc=ss({},_v),zR,jU=[],$x=ss({},_v),QC=x((t,e)=>{let r=ss({},t),n={};for(const i of e)n9e(i),n=ss(n,i);if(r=ss(r,n),n.theme&&n.theme in v0){const i=ss({},zR),a=ss(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in v0&&(r.themeVariables=v0[r.theme].getThemeVariables(a))}return $x=r,A2t($x),$x},"updateCurrentConfig"),T2t=x(t=>(pc=ss({},_v),pc=ss(pc,t),t.theme&&v0[t.theme]&&(pc.themeVariables=v0[t.theme].getThemeVariables(t.themeVariables)),QC(pc,jU),pc),"setSiteConfig"),C2t=x(t=>{zR=ss({},t)},"saveConfigFromInitialize"),k2t=x(t=>(pc=ss(pc,t),QC(pc,jU),pc),"updateSiteConfig"),t9e=x(()=>ss({},pc),"getSiteConfig"),r9e=x(t=>(QC($x,[t]),xr()),"setConfig"),xr=x(()=>ss({},$x),"getConfig"),n9e=x(t=>{t&&(["secure",...pc.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(de.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"&&n9e(t[e])}))},"sanitize"),S2t=x(t=>{var e;FR(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),jU.push(t),QC(pc,jU)},"addDirective"),VR=x((t=pc)=>{jU=[],QC(t,jU)},"reset"),E2t={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."},Cue={},i9e=x(t=>{Cue[t]||(de.warn(E2t[t]),Cue[t]=!0)},"issueWarning"),A2t=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&i9e("LAZY_LOAD_DEPRECATED")},"checkConfig"),a9e=x(()=>{let t={};zR&&(t=ss(t,zR));for(const e of jU)t=ss(t,e);return t},"getUserDefinedConfig"),yi=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&i9e("FLOWCHART_HTML_LABELS_DEPRECATED"),sf(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),s9e=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Fx=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,M2t=/\s*%%.*\n/gm,V6,o9e=(V6=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(V6,"UnknownDiagramError"),V6),YU={},DJ=x(function(t,e){t=t.replace(s9e,"").replace(Fx,"").replace(M2t,` +`);for(const[r,{detector:n}]of Object.entries(YU))if(n(t,e))return r;throw new o9e(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),AG=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)l9e(e,r,n)},"registerLazyLoadedDiagrams"),l9e=x((t,e,r)=>{YU[t]&&de.warn(`Detector with key ${t} already exists. Overwriting.`),YU[t]={detector:e,loader:r},de.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),R2t=x(t=>YU[t].loader,"getDiagramLoader"),q4=//gi,L2t=x(t=>t?h9e(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),I2t=(()=>{let t=!1;return()=>{t||(c9e(),t=!0)}})();function c9e(){const t="data-temp-href-target";M0.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),M0.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(c9e,"setupDompurifyHooks");var u9e=x(t=>(I2t(),M0.sanitize(t)),"removeScript"),kue=x((t,e)=>{if(yi(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=u9e(t):r!=="loose"&&(t=h9e(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=_2t(t))}return t},"sanitizeMore"),Dn=x((t,e)=>t&&(e.dompurifyConfig?t=M0.sanitize(kue(t,e),e.dompurifyConfig).toString():t=M0.sanitize(kue(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),N2t=x((t,e)=>typeof t=="string"?Dn(t,e):t.flat().map(r=>Dn(r,e)),"sanitizeTextOrArray"),D2t=x(t=>q4.test(t),"hasBreaks"),O2t=x(t=>t.split(q4),"splitBreaks"),_2t=x(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),h9e=x(t=>t.replace(q4,"#br#"),"breakToPlaceholder"),iO=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),P2t=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),B2t=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),jp=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),$2t=x((t,e)=>{const r=MG(t,"~"),n=MG(e,"~");return r===1&&n===1},"shouldCombineSets"),F2t=x(t=>{const e=MG(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"),Sue=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),RG=/\$\$(.*?)\$\$/g,Qa=x(t=>{var e;return(((e=t.match(RG))==null?void 0:e.length)??0)>0},"hasKatex"),ek=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await aO(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"),z2t=x(async(t,e)=>{if(!Qa(t))return t;if(!(Sue()||e.legacyMathML||e.forceLegacyMathML))return t.replace(RG,"MathML is unsupported in this environment.");{const{default:r}=await Mr(async()=>{const{default:i}=await Promise.resolve().then(()=>Wqt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Sue()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(q4).map(i=>Qa(i)?`
${i}
`:`
${i}
`).join("").replace(RG,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),aO=x(async(t,e)=>Dn(await z2t(t,e),e),"renderKatexSanitized"),Ht={getRows:L2t,sanitizeText:Dn,sanitizeTextOrArray:N2t,hasBreaks:D2t,splitBreaks:O2t,lineBreakRegex:q4,removeScript:u9e,getUrl:iO,evaluate:sf,getMax:P2t,getMin:B2t},V2t=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),H2t=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Ga=x(function(t,e,r,n){const i=H2t(e,r,n);V2t(t,i)},"configureSvgSize"),j4=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;de.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;de.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,de.info(`Calculated bounds: ${o}x${l}`),Ga(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"),LA={};function LG(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}x(LG,"cssStyleSheetToString");var G2t=x((t,e,r,n)=>{let i="";return t in LA&&LA[t]?i=LA[t]({...r,svgId:n}):de.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -1058,122 +1728,122 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),m2t=w((t,e)=>{e!==void 0&&(MR[t]=e)},"addStylesForDiagram"),y2t=g2t,MQ={};JO(MQ,{clear:()=>Oi,getAccDescription:()=>ss,getAccTitle:()=>ns,getDiagramTitle:()=>ji,setAccDescription:()=>is,setAccTitle:()=>qi,setDiagramTitle:()=>ts});var RQ="",_Q="",LQ="",IQ=w(t=>Nn(t,xr()),"sanitizeText"),Oi=w(()=>{RQ="",LQ="",_Q=""},"clear"),qi=w(t=>{RQ=IQ(t).replace(/^\s+/g,"")},"setAccTitle"),ns=w(()=>RQ,"getAccTitle"),is=w(t=>{LQ=IQ(t).replace(/\n\s+/g,` -`)},"setAccDescription"),ss=w(()=>LQ,"getAccDescription"),ts=w(t=>{_Q=IQ(t)},"setDiagramTitle"),ji=w(()=>_Q,"getDiagramTitle"),gue=de,v2t=kQ,He=xr,SW=U3e,rCe=I5,NQ=w(t=>Nn(t,He()),"sanitizeText"),OQ=W3,b2t=w(()=>MQ,"getCommonDb"),F_={},z_=w((t,e,r)=>{var n;F_[t]&&gue.warn(`Diagram with id ${t} already registered. Overwriting.`),F_[t]=e,r&&Q3e(t,r),m2t(t,e.styles),(n=e.injectUtils)==null||n.call(e,gue,v2t,He,NQ,OQ,b2t(),()=>{})},"registerDiagram"),EW=w(t=>{if(t in F_)return F_[t];throw new x2t(t)},"getDiagram"),Fx,x2t=(Fx=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},w(Fx,"DiagramNotFoundError"),Fx);function RR(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function w2t(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function DQ(t){let e,r,n;t.length!==2?(e=RR,r=(o,l)=>RR(t(o),l),n=(o,l)=>t(o)-l):(e=t===RR||t===w2t?t:T2t,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:a,right:s}}function T2t(){return 0}function C2t(t){return t===null?NaN:+t}const k2t=DQ(RR),S2t=k2t.right;DQ(C2t).center;class mue extends Map{constructor(e,r=M2t){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(yue(this,e))}has(e){return super.has(yue(this,e))}set(e,r){return super.set(E2t(this,e),r)}delete(e){return super.delete(A2t(this,e))}}function yue({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function E2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function A2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function M2t(t){return t!==null&&typeof t=="object"?t.valueOf():t}const R2t=Math.sqrt(50),_2t=Math.sqrt(10),L2t=Math.sqrt(2);function V_(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),a=s>=R2t?10:s>=_2t?5:s>=L2t?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(t*u),l=Math.round(e*u),o/ue&&--l,u=-u):(u=Math.pow(10,i)*a,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=s-i+1,l=new Array(o);if(n)if(a<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 O2t(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 D2t(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,s=new Array(i);++n+t(e)}function z2t(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function V2t(){return!this.__axis}function nCe(t,e){var r=[],n=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===_R||t===S8?-1:1,h=t===S8||t===hF?"x":"y",d=t===_R||t===RW?$2t:B2t;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):P2t),y=Math.max(s,0)+o,v=e.range(),b=+v[0]+l,x=+v[v.length-1]+l,T=(e.bandwidth?z2t:F2t)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),A=k.enter().append("g").attr("class","tick"),M=k.select("line"),R=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(A),M=M.merge(A.append("line").attr("stroke","currentColor").attr(h+"2",u*s)),R=R.merge(A.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===_R?"0em":t===RW?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),M=M.transition(p),R=R.transition(p),E=E.transition(p).attr("opacity",vue).attr("transform",function(P){return isFinite(P=T(P))?d(P+l):this.getAttribute("transform")}),A.attr("opacity",vue).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===S8||t===hF?a?"M"+u*a+","+b+"H"+l+"V"+x+"H"+u*a:"M"+l+","+b+"V"+x:a?"M"+b+","+u*a+"V"+l+"H"+x+"V"+u*a:"M"+b+","+l+"H"+x),k.attr("opacity",1).attr("transform",function(P){return d(T(P)+l)}),M.attr(h+"2",u*s),R.attr(h,u*y).text(m),C.filter(V2t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===hF?"start":t===S8?"end":"middle"),C.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?(s=a=+p,f):s},f.tickSizeInner=function(p){return arguments.length?(s=+p,f):s},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function H2t(t){return nCe(_R,t)}function G2t(t){return nCe(RW,t)}var W2t={value:()=>{}};function iCe(){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}})}LR.prototype=iCe.prototype={constructor:LR,on:function(t,e){var r=this._,n=q2t(t+"",r),i,s=-1,a=n.length;if(arguments.length<2){for(;++s0)for(var r=new Array(i),n=0,i,s;n=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),xue.hasOwnProperty(e)?{space:xue[e],local:t}:t}function j2t(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===_W&&e.documentElement.namespaceURI===_W?e.createElement(t):e.createElementNS(r,t)}}function Y2t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function sCe(t){var e=nD(t);return(e.local?Y2t:j2t)(e)}function X2t(){}function PQ(t){return t==null?X2t:function(){return this.querySelector(t)}}function K2t(t){typeof t!="function"&&(t=PQ(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=x&&(x=b+1);!(C=y[x])&&++x=0;)(a=n[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function wbt(t){t||(t=Tbt);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),s=0;se?1:t>=e?0:NaN}function Cbt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function kbt(){return Array.from(this)}function Sbt(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?Pbt:typeof e=="function"?Bbt:$bt)(t,e,r??"")):N5(this.node(),t)}function N5(t,e){return t.style.getPropertyValue(e)||uCe(t).getComputedStyle(t,null).getPropertyValue(e)}function zbt(t){return function(){delete this[t]}}function Vbt(t,e){return function(){this[t]=e}}function Hbt(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Gbt(t,e){return arguments.length>1?this.each((e==null?zbt:typeof e=="function"?Hbt:Vbt)(t,e)):this.node()[t]}function hCe(t){return t.trim().split(/^|\s+/)}function $Q(t){return t.classList||new dCe(t)}function dCe(t){this._node=t,this._names=hCe(t.getAttribute("class")||"")}dCe.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 fCe(t,e){for(var r=$Q(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function yxt(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,s;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?E8(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?E8(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=Ext.exec(t))?new Xo(e[1],e[2],e[3],1):(e=Axt.exec(t))?new Xo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Mxt.exec(t))?E8(e[1],e[2],e[3],e[4]):(e=Rxt.exec(t))?E8(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_xt.exec(t))?Aue(e[1],e[2]/100,e[3]/100,1):(e=Lxt.exec(t))?Aue(e[1],e[2]/100,e[3]/100,e[4]):wue.hasOwnProperty(t)?kue(wue[t]):t==="transparent"?new Xo(NaN,NaN,NaN,0):null}function kue(t){return new Xo(t>>16&255,t>>8&255,t&255,1)}function E8(t,e,r,n){return n<=0&&(t=e=r=NaN),new Xo(t,e,r,n)}function yCe(t){return t instanceof wv||(t=Uy(t)),t?(t=t.rgb(),new Xo(t.r,t.g,t.b,t.opacity)):new Xo}function LW(t,e,r,n){return arguments.length===1?yCe(t):new Xo(t,e,r,n??1)}function Xo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}QA(Xo,LW,iD(wv,{brighter(t){return t=t==null?G_:Math.pow(G_,t),new Xo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?r6:Math.pow(r6,t),new Xo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Xo(Sy(this.r),Sy(this.g),Sy(this.b),W_(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:Sue,formatHex:Sue,formatHex8:Oxt,formatRgb:Eue,toString:Eue}));function Sue(){return`#${ay(this.r)}${ay(this.g)}${ay(this.b)}`}function Oxt(){return`#${ay(this.r)}${ay(this.g)}${ay(this.b)}${ay((isNaN(this.opacity)?1:this.opacity)*255)}`}function Eue(){const t=W_(this.opacity);return`${t===1?"rgb(":"rgba("}${Sy(this.r)}, ${Sy(this.g)}, ${Sy(this.b)}${t===1?")":`, ${t})`}`}function W_(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Sy(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ay(t){return t=Sy(t),(t<16?"0":"")+t.toString(16)}function Aue(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new yh(t,e,r,n)}function vCe(t){if(t instanceof yh)return new yh(t.h,t.s,t.l,t.opacity);if(t instanceof wv||(t=Uy(t)),!t)return new yh;if(t instanceof yh)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),s=Math.max(e,r,n),a=NaN,o=s-i,l=(s+i)/2;return o?(e===s?a=(r-n)/o+(r0&&l<1?0:a,new yh(a,o,l,t.opacity)}function Dxt(t,e,r,n){return arguments.length===1?vCe(t):new yh(t,e,r,n??1)}function yh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}QA(yh,Dxt,iD(wv,{brighter(t){return t=t==null?G_:Math.pow(G_,t),new yh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?r6:Math.pow(r6,t),new yh(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 Xo(dF(t>=240?t-240:t+120,i,n),dF(t,i,n),dF(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new yh(Mue(this.h),A8(this.s),A8(this.l),W_(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=W_(this.opacity);return`${t===1?"hsl(":"hsla("}${Mue(this.h)}, ${A8(this.s)*100}%, ${A8(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Mue(t){return t=(t||0)%360,t<0?t+360:t}function A8(t){return Math.max(0,Math.min(1,t||0))}function dF(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 Pxt=Math.PI/180,$xt=180/Math.PI,q_=18,bCe=.96422,xCe=1,wCe=.82521,TCe=4/29,ox=6/29,CCe=3*ox*ox,Bxt=ox*ox*ox;function kCe(t){if(t instanceof Fd)return new Fd(t.l,t.a,t.b,t.opacity);if(t instanceof n0)return SCe(t);t instanceof Xo||(t=yCe(t));var e=mF(t.r),r=mF(t.g),n=mF(t.b),i=fF((.2225045*e+.7168786*r+.0606169*n)/xCe),s,a;return e===r&&r===n?s=a=i:(s=fF((.4360747*e+.3850649*r+.1430804*n)/bCe),a=fF((.0139322*e+.0971045*r+.7141733*n)/wCe)),new Fd(116*i-16,500*(s-i),200*(i-a),t.opacity)}function Fxt(t,e,r,n){return arguments.length===1?kCe(t):new Fd(t,e,r,n??1)}function Fd(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}QA(Fd,Fxt,iD(wv,{brighter(t){return new Fd(this.l+q_*(t??1),this.a,this.b,this.opacity)},darker(t){return new Fd(this.l-q_*(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=bCe*pF(e),t=xCe*pF(t),r=wCe*pF(r),new Xo(gF(3.1338561*e-1.6168667*t-.4906146*r),gF(-.9787684*e+1.9161415*t+.033454*r),gF(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function fF(t){return t>Bxt?Math.pow(t,1/3):t/CCe+TCe}function pF(t){return t>ox?t*t*t:CCe*(t-TCe)}function gF(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mF(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function zxt(t){if(t instanceof n0)return new n0(t.h,t.c,t.l,t.opacity);if(t instanceof Fd||(t=kCe(t)),t.a===0&&t.b===0)return new n0(NaN,0()=>t;function ECe(t,e){return function(r){return t+r*e}}function Vxt(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 Hxt(t,e){var r=e-t;return r?ECe(t,r>180||r<-180?r-360*Math.round(r/360):r):sD(isNaN(t)?e:t)}function Gxt(t){return(t=+t)==1?$S:function(e,r){return r-e?Vxt(e,r,t):sD(isNaN(e)?r:e)}}function $S(t,e){var r=e-t;return r?ECe(t,r):sD(isNaN(t)?e:t)}const U_=(function t(e){var r=Gxt(e);function n(i,s){var a=r((i=LW(i)).r,(s=LW(s)).r),o=r(i.g,s.g),l=r(i.b,s.b),u=$S(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function Wxt(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(s){for(i=0;ir&&(s=e.slice(r,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:uh(n,i)})),r=yF.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:uh(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:uh(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:uh(u,d)},{i:m-2,x:uh(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),s(u.translateX,u.translateY,h.translateX,h.translateY,d,f),a(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;--O5}function _ue(){jy=(Y_=i6.now())+aD,O5=Lk=0;try{swt()}finally{O5=0,owt(),jy=0}}function awt(){var t=i6.now(),e=t-Y_;e>_Ce&&(aD-=e,Y_=t)}function owt(){for(var t,e=j_,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:j_=r);Ik=t,DW(n)}function DW(t){if(!O5){Lk&&(Lk=clearTimeout(Lk));var e=t-jy;e>24?(t<1/0&&(Lk=setTimeout(_ue,t-i6.now()-aD)),OC&&(OC=clearInterval(OC))):(OC||(Y_=i6.now(),OC=setInterval(awt,_Ce)),O5=1,LCe(_ue))}}function Lue(t,e,r){var n=new X_;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var lwt=iCe("start","end","cancel","interrupt"),cwt=[],NCe=0,Iue=1,PW=2,IR=3,Nue=4,$W=5,NR=6;function oD(t,e,r,n,i,s){var a=t.__transition;if(!a)t.__transition={};else if(r in a)return;uwt(t,r,{name:e,index:n,group:i,on:lwt,tween:cwt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:NCe})}function zQ(t,e){var r=Zh(t,e);if(r.state>NCe)throw new Error("too late; already scheduled");return r}function af(t,e){var r=Zh(t,e);if(r.state>IR)throw new Error("too late; already running");return r}function Zh(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function uwt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=ICe(s,0,r.time);function s(u){r.state=Iue,r.timer.restart(a,r.delay,r.time),r.delay<=u&&a(u-r.delay)}function a(u){var h,d,f,p;if(r.state!==Iue)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===IR)return Lue(a);p.state===Nue?(p.state=NR,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hPW&&n.state<$W,n.state=NR,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[a]}s&&delete t.__transition}}function dwt(t){return this.each(function(){hwt(this,t)})}function fwt(t,e){var r,n;return function(){var i=af(this,t),s=i.tween;if(s!==r){n=r=s;for(var a=0,o=n.length;a=0&&(e=e.slice(0,r)),!e||e==="start"})}function Vwt(t,e,r){var n,i,s=zwt(e)?zQ:af;return function(){var a=s(this,t),o=a.on;o!==n&&(i=(n=o).copy()).on(e,r),a.on=i}}function Hwt(t,e){var r=this._id;return arguments.length<2?Zh(this.node(),r).on.on(t):this.each(Vwt(r,t,e))}function Gwt(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Wwt(){return this.on("end.remove",Gwt(this._id))}function qwt(t){var e=this._name,r=this._id;typeof t!="function"&&(t=PQ(t));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a=0))throw new Error(`invalid digits: ${t}`);if(e>15)return $Ce;const r=10**e;return function(n){this._+=n[0];for(let i=1,s=n.length;im1)if(!(Math.abs(d*l-u*h)>m1)||!s)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-a,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),b=Math.sqrt(f),x=s*Math.tan((BW-Math.acos((m+f-y)/(2*v*b)))/2),T=x/b,C=x/v;Math.abs(T-1)>m1&&this._append`L${e+T*h},${r+T*d}`,this._append`A${s},${s},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,s,a){if(e=+e,r=+r,n=+n,a=!!a,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^a,f=a?i-s:s-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>m1||Math.abs(this._y1-h)>m1)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%FW+FW),f>m4t?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>m1&&this._append`A${n},${n},0,${+(f>=BW)},${d},${this._x1=e+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}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 b4t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function K_(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 D5(t){return t=K_(Math.abs(t)),t?t[1]:NaN}function x4t(t,e){return function(r,n){for(var i=r.length,s=[],a=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[a=(a+1)%t.length];return s.reverse().join(e)}}function w4t(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var T4t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Z_(t){if(!(e=T4t.exec(t)))throw new Error("invalid format: "+t);var e;return new HQ({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]})}Z_.prototype=HQ.prototype;function HQ(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+""}HQ.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 C4t(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 Q_;function k4t(t,e){var r=K_(t,e);if(!r)return Q_=void 0,t.toPrecision(e);var n=r[0],i=r[1],s=i-(Q_=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+K_(t,Math.max(0,e+s-1))[0]}function Oue(t,e){var r=K_(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 Due={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:b4t,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)=>Oue(t*100,e),r:Oue,s:k4t,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Pue(t){return t}var $ue=Array.prototype.map,Bue=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function S4t(t){var e=t.grouping===void 0||t.thousands===void 0?Pue:x4t($ue.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+"",s=t.numerals===void 0?Pue:w4t($ue.call(t.numerals,String)),a=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=Z_(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,b=d.width,x=d.comma,T=d.precision,C=d.trim,S=d.type;S==="n"?(x=!0,S="g"):Due[S]||(T===void 0&&(T=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?a:"")+(f&&f.suffix!==void 0?f.suffix:""),A=Due[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 R(P){var N=k,L=E,I,$,O;if(S==="c")L=A(P)+L,P="";else{P=+P;var D=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),T),C&&(P=C4t(P)),D&&+P==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(S==="s"&&!isNaN(P)&&Q_!==void 0?Bue[8+Q_/3]:"")+L+(D&&m==="("?")":""),M){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){L=(O===46?i+P.slice(I+1):P.slice(I))+L,P=P.slice(0,I);break}}}x&&!v&&(P=e(P,1/0));var B=N.length+P.length+L.length,z=B>1)+N+P+L+z.slice(B);break;default:P=z+N+P+L;break}return s(P)}return R.toString=function(){return d+""},R}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(D5(f)/3)))*3,g=Math.pow(10,-p),m=u((d=Z_(d),d.type="f",d),{suffix:Bue[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var R8,O1,BCe;E4t({thousands:",",grouping:[3],currency:["$",""]});function E4t(t){return R8=S4t(t),O1=R8.format,BCe=R8.formatPrefix,R8}function A4t(t){return Math.max(0,-D5(Math.abs(t)))}function M4t(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(D5(e)/3)))*3-D5(Math.abs(t)))}function R4t(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,D5(e)-D5(t))+1}function _4t(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 L4t(){return this.eachAfter(_4t)}function I4t(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function N4t(t,e){for(var r=this,n=[r],i,s,a=-1;r=n.pop();)if(t.call(e,r,++a,this),i=r.children)for(s=i.length-1;s>=0;--s)n.push(i[s]);return this}function O4t(t,e){for(var r=this,n=[r],i=[],s,a,o,l=-1;r=n.pop();)if(i.push(r),s=r.children)for(a=0,o=s.length;a=0;)r+=n[i].value;e.value=r})}function $4t(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function B4t(t){for(var e=this,r=F4t(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 F4t(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 z4t(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function V4t(){return Array.from(this)}function H4t(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function G4t(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*W4t(){var t=this,e,r=[t],n,i,s;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,s=n.length;i=0;--o)i.push(s=a[o]=new J_(a[o])),s.parent=n,s.depth=n.depth+1;return r.eachBefore(X4t)}function q4t(){return GQ(this).eachBefore(Y4t)}function U4t(t){return t.children}function j4t(t){return Array.isArray(t)?t[1]:null}function Y4t(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function X4t(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function J_(t){this.data=t,this.depth=this.height=0,this.parent=null}J_.prototype=GQ.prototype={constructor:J_,count:L4t,each:I4t,eachAfter:O4t,eachBefore:N4t,find:D4t,sum:P4t,sort:$4t,path:B4t,ancestors:z4t,descendants:V4t,leaves:H4t,links:G4t,copy:q4t,[Symbol.iterator]:W4t};function K4t(t){if(typeof t!="function")throw new Error;return t}function DC(){return 0}function PC(t){return function(){return t}}function Z4t(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 Q4t(t,e,r,n,i){for(var s=t.children,a,o=-1,l=s.length,u=t.value&&(n-e)/t.value;++ob&&(b=u),S=y*y*C,x=Math.max(b/S,S/v),x>T){y-=u;break}T=x}a.push(l={value:y,dice:p1?n:1)},r})(eTt);function nTt(){var t=rTt,e=!1,r=1,n=1,i=[0],s=DC,a=DC,o=DC,l=DC,u=DC;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Z4t),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 oTt(t,e,r){var n=t[0],i=t[1],s=e[0],a=e[1];return i2?lTt:oTt,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(t.map(n),e,r)))(n(a(f)))}return d.invert=function(f){return a(i((u||(u=o(e,t.map(n),uh)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,sTt),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=Zxt,h()},d.clamp=function(f){return arguments.length?(a=f?!0:Ab,h()):a!==Ab},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,p){return n=f,i=p,h()}}function zCe(){return cTt()(Ab,Ab)}function uTt(t,e,r,n){var i=MW(t,e,r),s;switch(n=Z_(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(s=M4t(i,a))&&(n.precision=s),BCe(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=R4t(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=A4t(i))&&(n.precision=s-(n.type==="%")*2);break}}return O1(n)}function hTt(t){var e=t.domain;return t.ticks=function(r){var n=e();return I2t(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return uTt(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,s=n.length-1,a=n[i],o=n[s],l,u,h=10;for(o0;){if(u=AW(a,o,r),u===l)return n[i]=a,n[s]=o,e(n);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function P5(){var t=zCe();return t.copy=function(){return FCe(t,P5())},lD.apply(t,arguments),hTt(t)}function dTt(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],s=t[n],a;return s(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s0))return l;let u;do l.push(u=new Date(+s)),e(s,o),t(s);while(uVa(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;e(a,-1),!s(a););else for(;--o>=0;)for(;e(a,1),!s(a););}),r&&(i.count=(s,a)=>(vF.setTime(+s),bF.setTime(+a),t(vF),t(bF),Math.floor(r(vF,bF))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?a=>n(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const $5=Va(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);$5.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Va(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):$5);$5.range;const i0=1e3,Nu=i0*60,s0=Nu*60,_0=s0*24,WQ=_0*7,Vue=_0*30,xF=_0*365,lg=Va(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*i0)},(t,e)=>(e-t)/i0,t=>t.getUTCSeconds());lg.range;const s6=Va(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*i0)},(t,e)=>{t.setTime(+t+e*Nu)},(t,e)=>(e-t)/Nu,t=>t.getMinutes());s6.range;const fTt=Va(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Nu)},(t,e)=>(e-t)/Nu,t=>t.getUTCMinutes());fTt.range;const a6=Va(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*i0-t.getMinutes()*Nu)},(t,e)=>{t.setTime(+t+e*s0)},(t,e)=>(e-t)/s0,t=>t.getHours());a6.range;const pTt=Va(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*s0)},(t,e)=>(e-t)/s0,t=>t.getUTCHours());pTt.range;const Yy=Va(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nu)/_0,t=>t.getDate()-1);Yy.range;const qQ=Va(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/_0,t=>t.getUTCDate()-1);qQ.range;const gTt=Va(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/_0,t=>Math.floor(t/_0));gTt.range;function Tv(t){return Va(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())*Nu)/WQ)}const JA=Tv(0),o6=Tv(1),VCe=Tv(2),HCe=Tv(3),Xy=Tv(4),GCe=Tv(5),WCe=Tv(6);JA.range;o6.range;VCe.range;HCe.range;Xy.range;GCe.range;WCe.range;function Cv(t){return Va(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)/WQ)}const qCe=Cv(0),eL=Cv(1),mTt=Cv(2),yTt=Cv(3),B5=Cv(4),vTt=Cv(5),bTt=Cv(6);qCe.range;eL.range;mTt.range;yTt.range;B5.range;vTt.range;bTt.range;const l6=Va(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());l6.range;const xTt=Va(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());xTt.range;const L0=Va(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());L0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Va(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)});L0.range;const Ky=Va(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());Ky.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Va(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)});Ky.range;function wTt(t,e,r,n,i,s){const a=[[lg,1,i0],[lg,5,5*i0],[lg,15,15*i0],[lg,30,30*i0],[s,1,Nu],[s,5,5*Nu],[s,15,15*Nu],[s,30,30*Nu],[i,1,s0],[i,3,3*s0],[i,6,6*s0],[i,12,12*s0],[n,1,_0],[n,2,2*_0],[r,1,WQ],[e,1,Vue],[e,3,3*Vue],[t,1,xF]];function o(u,h,d){const f=hy).right(a,f);if(p===a.length)return t.every(MW(u/xF,h/xF,d));if(p===0)return $5.every(Math.max(MW(u,h,d),1));const[g,m]=a[f/a[p-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(te=TF($C(ie.y,0,1)),_e=te.getUTCDay(),te=_e>4||_e===0?eL.ceil(te):eL(te),te=qQ.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=wF($C(ie.y,0,1)),_e=te.getDay(),te=_e>4||_e===0?o6.ceil(te):o6(te),te=Yy.offset(te,(ie.V-1)*7),ie.y=te.getFullYear(),ie.m=te.getMonth(),ie.d=te.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),_e="Z"in ie?TF($C(ie.y,0,1)).getUTCDay():wF($C(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(_e+5)%7:ie.w+ie.U*7-(_e+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,TF(ie)):wF(ie)}}function E(Z,Q,ne,ie){for(var me=0,te=Q.length,_e=ne.length,$e,Ve;me=_e)return-1;if($e=Q.charCodeAt(me++),$e===37){if($e=Q.charAt(me++),Ve=C[$e in Hue?Q.charAt(me++):$e],!Ve||(ie=Ve(Z,ne,ie))<0)return-1}else if($e!=ne.charCodeAt(ie++))return-1}return ie}function A(Z,Q,ne){var ie=u.exec(Q.slice(ne));return ie?(Z.p=h.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function M(Z,Q,ne){var ie=p.exec(Q.slice(ne));return ie?(Z.w=g.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function R(Z,Q,ne){var ie=d.exec(Q.slice(ne));return ie?(Z.w=f.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function P(Z,Q,ne){var ie=v.exec(Q.slice(ne));return ie?(Z.m=b.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function N(Z,Q,ne){var ie=m.exec(Q.slice(ne));return ie?(Z.m=y.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function L(Z,Q,ne){return E(Z,e,Q,ne)}function I(Z,Q,ne){return E(Z,r,Q,ne)}function $(Z,Q,ne){return E(Z,n,Q,ne)}function O(Z){return a[Z.getDay()]}function D(Z){return s[Z.getDay()]}function B(Z){return l[Z.getMonth()]}function z(Z){return o[Z.getMonth()]}function V(Z){return i[+(Z.getHours()>=12)]}function F(Z){return 1+~~(Z.getMonth()/3)}function H(Z){return a[Z.getUTCDay()]}function G(Z){return s[Z.getUTCDay()]}function W(Z){return l[Z.getUTCMonth()]}function K(Z){return o[Z.getUTCMonth()]}function q(Z){return i[+(Z.getUTCHours()>=12)]}function oe(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var Q=S(Z+="",x);return Q.toString=function(){return Z},Q},parse:function(Z){var Q=k(Z+="",!1);return Q.toString=function(){return Z},Q},utcFormat:function(Z){var Q=S(Z+="",T);return Q.toString=function(){return Z},Q},utcParse:function(Z){var Q=k(Z+="",!0);return Q.toString=function(){return Z},Q}}}var Hue={"-":"",_:" ",0:"0"},lo=/^\s*\d+/,STt=/^%/,ETt=/[\\^$*+?|[\]().{}]/g;function ai(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",s=i.length;return n+(s[e.toLowerCase(),r]))}function MTt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function RTt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function _Tt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function LTt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function ITt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Gue(t,e,r){var n=lo.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Wue(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function NTt(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 OTt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function DTt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function que(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function PTt(t,e,r){var n=lo.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Uue(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function $Tt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function BTt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function FTt(t,e,r){var n=lo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function zTt(t,e,r){var n=lo.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function VTt(t,e,r){var n=STt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function HTt(t,e,r){var n=lo.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function GTt(t,e,r){var n=lo.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function jue(t,e){return ai(t.getDate(),e,2)}function WTt(t,e){return ai(t.getHours(),e,2)}function qTt(t,e){return ai(t.getHours()%12||12,e,2)}function UTt(t,e){return ai(1+Yy.count(L0(t),t),e,3)}function UCe(t,e){return ai(t.getMilliseconds(),e,3)}function jTt(t,e){return UCe(t,e)+"000"}function YTt(t,e){return ai(t.getMonth()+1,e,2)}function XTt(t,e){return ai(t.getMinutes(),e,2)}function KTt(t,e){return ai(t.getSeconds(),e,2)}function ZTt(t){var e=t.getDay();return e===0?7:e}function QTt(t,e){return ai(JA.count(L0(t)-1,t),e,2)}function jCe(t){var e=t.getDay();return e>=4||e===0?Xy(t):Xy.ceil(t)}function JTt(t,e){return t=jCe(t),ai(Xy.count(L0(t),t)+(L0(t).getDay()===4),e,2)}function e5t(t){return t.getDay()}function t5t(t,e){return ai(o6.count(L0(t)-1,t),e,2)}function r5t(t,e){return ai(t.getFullYear()%100,e,2)}function n5t(t,e){return t=jCe(t),ai(t.getFullYear()%100,e,2)}function i5t(t,e){return ai(t.getFullYear()%1e4,e,4)}function s5t(t,e){var r=t.getDay();return t=r>=4||r===0?Xy(t):Xy.ceil(t),ai(t.getFullYear()%1e4,e,4)}function a5t(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ai(e/60|0,"0",2)+ai(e%60,"0",2)}function Yue(t,e){return ai(t.getUTCDate(),e,2)}function o5t(t,e){return ai(t.getUTCHours(),e,2)}function l5t(t,e){return ai(t.getUTCHours()%12||12,e,2)}function c5t(t,e){return ai(1+qQ.count(Ky(t),t),e,3)}function YCe(t,e){return ai(t.getUTCMilliseconds(),e,3)}function u5t(t,e){return YCe(t,e)+"000"}function h5t(t,e){return ai(t.getUTCMonth()+1,e,2)}function d5t(t,e){return ai(t.getUTCMinutes(),e,2)}function f5t(t,e){return ai(t.getUTCSeconds(),e,2)}function p5t(t){var e=t.getUTCDay();return e===0?7:e}function g5t(t,e){return ai(qCe.count(Ky(t)-1,t),e,2)}function XCe(t){var e=t.getUTCDay();return e>=4||e===0?B5(t):B5.ceil(t)}function m5t(t,e){return t=XCe(t),ai(B5.count(Ky(t),t)+(Ky(t).getUTCDay()===4),e,2)}function y5t(t){return t.getUTCDay()}function v5t(t,e){return ai(eL.count(Ky(t)-1,t),e,2)}function b5t(t,e){return ai(t.getUTCFullYear()%100,e,2)}function x5t(t,e){return t=XCe(t),ai(t.getUTCFullYear()%100,e,2)}function w5t(t,e){return ai(t.getUTCFullYear()%1e4,e,4)}function T5t(t,e){var r=t.getUTCDay();return t=r>=4||r===0?B5(t):B5.ceil(t),ai(t.getUTCFullYear()%1e4,e,4)}function C5t(){return"+0000"}function Xue(){return"%"}function Kue(t){return+t}function Zue(t){return Math.floor(+t/1e3)}var p2,tL;k5t({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 k5t(t){return p2=kTt(t),tL=p2.format,p2.parse,p2.utcFormat,p2.utcParse,p2}function S5t(t){return new Date(t)}function E5t(t){return t instanceof Date?+t:+new Date(+t)}function KCe(t,e,r,n,i,s,a,o,l,u){var h=zCe(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),b=u("%b %d"),x=u("%B"),T=u("%Y");function C(S){return(l(S)1?0:t<-1?c6:Math.acos(t)}function Jue(t){return t>=1?rL:t<=-1?-rL:Math.asin(t)}function ZCe(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 v4t(e)}function I5t(t){return t.innerRadius}function N5t(t){return t.outerRadius}function O5t(t){return t.startAngle}function D5t(t){return t.endAngle}function P5t(t){return t&&t.padAngle}function $5t(t,e,r,n,i,s,a,o){var l=r-t,u=n-e,h=a-i,d=o-s,f=d*l-h*u;if(!(f*fL*L+I*I&&(E=M,A=R),{cx:E,cy:A,x01:-h,y01:-d,x11:E*(i/C-1),y11:A*(i/C-1)}}function F5(){var t=I5t,e=N5t,r=Xs(0),n=null,i=O5t,s=D5t,a=P5t,o=null,l=ZCe(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-rL,m=s.apply(this,arguments)-rL,y=Que(m-g),v=m>g;if(o||(o=h=l()),pWo))o.moveTo(0,0);else if(y>OR-Wo)o.moveTo(p*Xm(g),p*td(g)),o.arc(0,0,p,g,m,!v),f>Wo&&(o.moveTo(f*Xm(m),f*td(m)),o.arc(0,0,f,m,g,v));else{var b=g,x=m,T=g,C=m,S=y,k=y,E=a.apply(this,arguments)/2,A=E>Wo&&(n?+n.apply(this,arguments):Mb(f*f+p*p)),M=CF(Que(p-f)/2,+r.apply(this,arguments)),R=M,P=M,N,L;if(A>Wo){var I=Jue(A/f*td(E)),$=Jue(A/p*td(E));(S-=I*2)>Wo?(I*=v?1:-1,T+=I,C-=I):(S=0,T=C=(g+m)/2),(k-=$*2)>Wo?($*=v?1:-1,b+=$,x-=$):(k=0,b=x=(g+m)/2)}var O=p*Xm(b),D=p*td(b),B=f*Xm(C),z=f*td(C);if(M>Wo){var V=p*Xm(x),F=p*td(x),H=f*Xm(T),G=f*td(T),W;if(yWo?P>Wo?(N=_8(H,G,O,D,p,P,v),L=_8(V,F,B,z,p,P,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),PWo)||!(S>Wo)?o.lineTo(B,z):R>Wo?(N=_8(B,z,V,F,f,-R,v),L=_8(O,D,H,G,f,-R,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),Rt?1:e>=t?0:NaN}function V5t(t){return t}function H5t(){var t=V5t,e=z5t,r=null,n=Xs(0),i=Xs(OR),s=Xs(0);function a(o){var l,u=(o=QCe(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(OR,Math.max(-OR,i.apply(this,arguments)-m)),v,b=Math.min(Math.abs(y)/u,s.apply(this,arguments)),x=b*(y<0?-1:1),T;for(l=0;l0&&(f+=T);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*x)/f:0;l0?T*d:0)+x,g[h]={data:o[h],index:l,value:T,startAngle:m,endAngle:v,padAngle:b};return g}return a.value=function(o){return arguments.length?(t=typeof o=="function"?o:Xs(+o),a):t},a.sortValues=function(o){return arguments.length?(e=o,r=null,a):e},a.sort=function(o){return arguments.length?(r=o,e=null,a):r},a.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Xs(+o),a):n},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Xs(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Xs(+o),a):s},a}class eke{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 tke(t){return new eke(t,!0)}function rke(t){return new eke(t,!1)}function Fg(){}function nL(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 cD(t){this._context=t}cD.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:nL(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:nL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function h6(t){return new cD(t)}function nke(t){this._context=t}nke.prototype={areaStart:Fg,areaEnd:Fg,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:nL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function G5t(t){return new nke(t)}function ike(t){this._context=t}ike.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:nL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function W5t(t){return new ike(t)}function ske(t,e){this._basis=new cD(t),this._beta=e}ske.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],s=t[r]-n,a=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*s),this._beta*e[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const q5t=(function t(e){function r(n){return e===1?new cD(n):new ske(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function iL(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 UQ(t,e){this._context=t,this._k=(1-e)/6}UQ.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:iL(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:iL(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 ake=(function t(e){function r(n){return new UQ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function jQ(t,e){this._context=t,this._k=(1-e)/6}jQ.prototype={areaStart:Fg,areaEnd:Fg,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:iL(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 U5t=(function t(e){function r(n){return new jQ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function YQ(t,e){this._context=t,this._k=(1-e)/6}YQ.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:iL(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 j5t=(function t(e){function r(n){return new YQ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function XQ(t,e,r){var n=t._x1,i=t._y1,s=t._x2,a=t._y2;if(t._l01_a>Wo){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>Wo){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);s=(s*u+t._x1*t._l23_2a-e*t._l12_2a)/h,a=(a*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,s,a,t._x2,t._y2)}function oke(t,e){this._context=t,this._alpha=e}oke.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:XQ(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 lke=(function t(e){function r(n){return e?new oke(n,e):new UQ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function cke(t,e){this._context=t,this._alpha=e}cke.prototype={areaStart:Fg,areaEnd:Fg,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:XQ(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 Y5t=(function t(e){function r(n){return e?new cke(n,e):new jQ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function uke(t,e){this._context=t,this._alpha=e}uke.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:XQ(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 X5t=(function t(e){function r(n){return e?new uke(n,e):new YQ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function hke(t){this._context=t}hke.prototype={areaStart:Fg,areaEnd:Fg,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 K5t(t){return new hke(t)}function ehe(t){return t<0?-1:1}function the(t,e,r){var n=t._x1-t._x0,i=e-t._x1,s=(t._y1-t._y0)/(n||i<0&&-0),a=(r-t._y1)/(i||n<0&&-0),o=(s*i+a*n)/(n+i);return(ehe(s)+ehe(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function rhe(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function kF(t,e,r){var n=t._x0,i=t._y0,s=t._x1,a=t._y1,o=(s-n)/3;t._context.bezierCurveTo(n+o,i+o*e,s-o,a-o*r,s,a)}function sL(t){this._context=t}sL.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:kF(this,this._t0,rhe(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,kF(this,rhe(this,r=the(this,t,e)),r);break;default:kF(this,this._t0,r=the(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function dke(t){this._context=new fke(t)}(dke.prototype=Object.create(sL.prototype)).point=function(t,e){sL.prototype.point.call(this,e,t)};function fke(t){this._context=t}fke.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,s){this._context.bezierCurveTo(e,t,n,r,s,i)}};function pke(t){return new sL(t)}function gke(t){return new dke(t)}function mke(t){this._context=t}mke.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=nhe(t),i=nhe(e),s=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/s[e];for(s[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 vke(t){return new uD(t,.5)}function bke(t){return new uD(t,0)}function xke(t){return new uD(t,1)}function Nk(t,e,r){this.k=t,this.x=e,this.y=r}Nk.prototype={constructor:Nk,scale:function(t){return t===1?this:new Nk(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Nk(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+")"}};Nk.prototype;var al=w(t=>{var i;const{securityLevel:e}=He();let r=xt("body");if(e==="sandbox"){const a=((i=xt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=xt(a.body)}return r.select(`#${t}`)},"selectSvgElement");function KQ(t){return typeof t>"u"||t===null}w(KQ,"isNothing");function wke(t){return typeof t=="object"&&t!==null}w(wke,"isObject");function Tke(t){return Array.isArray(t)?t:KQ(t)?[]:[t]}w(Tke,"toArray");function Cke(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r{e!==void 0&&(LA[t]=e)},"addStylesForDiagram"),q2t=G2t,OJ={};rO(OJ,{clear:()=>Oi,getAccDescription:()=>sa,getAccTitle:()=>ia,getDiagramTitle:()=>Yi,setAccDescription:()=>aa,setAccTitle:()=>qi,setDiagramTitle:()=>ra});var _J="",PJ="",BJ="",$J=x(t=>Dn(t,xr()),"sanitizeText"),Oi=x(()=>{_J="",BJ="",PJ=""},"clear"),qi=x(t=>{_J=$J(t).replace(/^\s+/g,"")},"setAccTitle"),ia=x(()=>_J,"getAccTitle"),aa=x(t=>{BJ=$J(t).replace(/\n\s+/g,` +`)},"setAccDescription"),sa=x(()=>BJ,"getAccDescription"),ra=x(t=>{PJ=$J(t)},"setDiagramTitle"),Yi=x(()=>PJ,"getDiagramTitle"),Eue=de,j2t=LJ,He=xr,IG=r9e,d9e=_v,FJ=x(t=>Dn(t,He()),"sanitizeText"),zJ=j4,Y2t=x(()=>OJ,"getCommonDb"),HR={},GR=x((t,e,r)=>{var n;HR[t]&&Eue.warn(`Diagram with id ${t} already registered. Overwriting.`),HR[t]=e,r&&l9e(t,r),W2t(t,e.styles),(n=e.injectUtils)==null||n.call(e,Eue,j2t,He,FJ,zJ,Y2t(),()=>{})},"registerDiagram"),NG=x(t=>{if(t in HR)return HR[t];throw new X2t(t)},"getDiagram"),H6,X2t=(H6=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(H6,"DiagramNotFoundError"),H6);function IA(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function K2t(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function VJ(t){let e,r,n;t.length!==2?(e=IA,r=(o,l)=>IA(t(o),l),n=(o,l)=>t(o)-l):(e=t===IA||t===K2t?t:Z2t,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 Z2t(){return 0}function J2t(t){return t===null?NaN:+t}const Q2t=VJ(IA),eyt=Q2t.right;VJ(J2t).center;class Aue extends Map{constructor(e,r=nyt){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(Mue(this,e))}has(e){return super.has(Mue(this,e))}set(e,r){return super.set(tyt(this,e),r)}delete(e){return super.delete(ryt(this,e))}}function Mue({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function tyt({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function ryt({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function nyt(t){return t!==null&&typeof t=="object"?t.valueOf():t}const iyt=Math.sqrt(50),ayt=Math.sqrt(10),syt=Math.sqrt(2);function WR(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>=iyt?10:a>=ayt?5:a>=syt?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 cyt(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 uyt(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 gyt(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function myt(){return!this.__axis}function f9e(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===NA||t===AS?-1:1,h=t===AS||t===m$?"x":"y",d=t===NA||t===_G?dyt:fyt;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):hyt),U=Math.max(a,0)+o,y=e.range(),b=+y[0]+l,v=+y[y.length-1]+l,w=(e.bandwidth?gyt:pyt)(e.copy(),l),T=p.selection?p.selection():p,k=T.selectAll(".domain").data([null]),C=T.selectAll(".tick").data(g,e).order(),S=C.exit(),E=C.enter().append("g").attr("class","tick"),A=C.select("line"),R=C.select("text");k=k.merge(k.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(E),A=A.merge(E.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),R=R.merge(E.append("text").attr("fill","currentColor").attr(h,u*U).attr("dy",t===NA?"0em":t===_G?"0.71em":"0.32em")),p!==T&&(k=k.transition(p),C=C.transition(p),A=A.transition(p),R=R.transition(p),S=S.transition(p).attr("opacity",Rue).attr("transform",function(_){return isFinite(_=w(_))?d(_+l):this.getAttribute("transform")}),E.attr("opacity",Rue).attr("transform",function(_){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(_))?N:w(_))+l)})),S.remove(),k.attr("d",t===AS||t===m$?s?"M"+u*s+","+b+"H"+l+"V"+v+"H"+u*s:"M"+l+","+b+"V"+v:s?"M"+b+","+u*s+"V"+l+"H"+v+"V"+u*s:"M"+b+","+l+"H"+v),C.attr("opacity",1).attr("transform",function(_){return d(w(_)+l)}),A.attr(h+"2",u*a),R.attr(h,u*U).text(m),T.filter(myt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===m$?"start":t===AS?"end":"middle"),T.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Uyt(t){return f9e(NA,t)}function yyt(t){return f9e(_G,t)}var byt={value:()=>{}};function p9e(){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}})}DA.prototype=p9e.prototype={constructor:DA,on:function(t,e){var r=this._,n=vyt(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)),Iue.hasOwnProperty(e)?{space:Iue[e],local:t}:t}function wyt(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===PG&&e.documentElement.namespaceURI===PG?e.createElement(t):e.createElementNS(r,t)}}function Tyt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function g9e(t){var e=sO(t);return(e.local?Tyt:wyt)(e)}function Cyt(){}function HJ(t){return t==null?Cyt:function(){return this.querySelector(t)}}function kyt(t){typeof t!="function"&&(t=HJ(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i=v&&(v=b+1);!(T=U[v])&&++v=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Kyt(t){t||(t=Zyt);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 Jyt(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Qyt(){return Array.from(this)}function e6t(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?h6t:typeof e=="function"?f6t:d6t)(t,e,r??"")):Pv(this.node(),t)}function Pv(t,e){return t.style.getPropertyValue(e)||v9e(t).getComputedStyle(t,null).getPropertyValue(e)}function g6t(t){return function(){delete this[t]}}function m6t(t,e){return function(){this[t]=e}}function U6t(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function y6t(t,e){return arguments.length>1?this.each((e==null?g6t:typeof e=="function"?U6t:m6t)(t,e)):this.node()[t]}function x9e(t){return t.trim().split(/^|\s+/)}function GJ(t){return t.classList||new w9e(t)}function w9e(t){this._node=t,this._names=x9e(t.getAttribute("class")||"")}w9e.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 T9e(t,e){for(var r=GJ(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function q6t(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?MS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?MS(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=tbt.exec(t))?new Xo(e[1],e[2],e[3],1):(e=rbt.exec(t))?new Xo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=nbt.exec(t))?MS(e[1],e[2],e[3],e[4]):(e=ibt.exec(t))?MS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=abt.exec(t))?$ue(e[1],e[2]/100,e[3]/100,1):(e=sbt.exec(t))?$ue(e[1],e[2]/100,e[3]/100,e[4]):Nue.hasOwnProperty(t)?_ue(Nue[t]):t==="transparent"?new Xo(NaN,NaN,NaN,0):null}function _ue(t){return new Xo(t>>16&255,t>>8&255,t&255,1)}function MS(t,e,r,n){return n<=0&&(t=e=r=NaN),new Xo(t,e,r,n)}function E9e(t){return t instanceof C5||(t=XU(t)),t?(t=t.rgb(),new Xo(t.r,t.g,t.b,t.opacity)):new Xo}function BG(t,e,r,n){return arguments.length===1?E9e(t):new Xo(t,e,r,n??1)}function Xo(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}rk(Xo,BG,oO(C5,{brighter(t){return t=t==null?jR:Math.pow(jR,t),new Xo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?sT:Math.pow(sT,t),new Xo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Xo(AU(this.r),AU(this.g),AU(this.b),YR(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:Pue,formatHex:Pue,formatHex8:cbt,formatRgb:Bue,toString:Bue}));function Pue(){return`#${cU(this.r)}${cU(this.g)}${cU(this.b)}`}function cbt(){return`#${cU(this.r)}${cU(this.g)}${cU(this.b)}${cU((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bue(){const t=YR(this.opacity);return`${t===1?"rgb(":"rgba("}${AU(this.r)}, ${AU(this.g)}, ${AU(this.b)}${t===1?")":`, ${t})`}`}function YR(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function AU(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function cU(t){return t=AU(t),(t<16?"0":"")+t.toString(16)}function $ue(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Uh(t,e,r,n)}function A9e(t){if(t instanceof Uh)return new Uh(t.h,t.s,t.l,t.opacity);if(t instanceof C5||(t=XU(t)),!t)return new Uh;if(t instanceof Uh)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 Uh(s,o,l,t.opacity)}function ubt(t,e,r,n){return arguments.length===1?A9e(t):new Uh(t,e,r,n??1)}function Uh(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}rk(Uh,ubt,oO(C5,{brighter(t){return t=t==null?jR:Math.pow(jR,t),new Uh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?sT:Math.pow(sT,t),new Uh(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 Xo(U$(t>=240?t-240:t+120,i,n),U$(t,i,n),U$(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Uh(Fue(this.h),RS(this.s),RS(this.l),YR(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=YR(this.opacity);return`${t===1?"hsl(":"hsla("}${Fue(this.h)}, ${RS(this.s)*100}%, ${RS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Fue(t){return t=(t||0)%360,t<0?t+360:t}function RS(t){return Math.max(0,Math.min(1,t||0))}function U$(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 hbt=Math.PI/180,dbt=180/Math.PI,XR=18,M9e=.96422,R9e=1,L9e=.82521,I9e=4/29,h6=6/29,N9e=3*h6*h6,fbt=h6*h6*h6;function D9e(t){if(t instanceof Fd)return new Fd(t.l,t.a,t.b,t.opacity);if(t instanceof i0)return O9e(t);t instanceof Xo||(t=E9e(t));var e=x$(t.r),r=x$(t.g),n=x$(t.b),i=y$((.2225045*e+.7168786*r+.0606169*n)/R9e),a,s;return e===r&&r===n?a=s=i:(a=y$((.4360747*e+.3850649*r+.1430804*n)/M9e),s=y$((.0139322*e+.0971045*r+.7141733*n)/L9e)),new Fd(116*i-16,500*(a-i),200*(i-s),t.opacity)}function pbt(t,e,r,n){return arguments.length===1?D9e(t):new Fd(t,e,r,n??1)}function Fd(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}rk(Fd,pbt,oO(C5,{brighter(t){return new Fd(this.l+XR*(t??1),this.a,this.b,this.opacity)},darker(t){return new Fd(this.l-XR*(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=M9e*b$(e),t=R9e*b$(t),r=L9e*b$(r),new Xo(v$(3.1338561*e-1.6168667*t-.4906146*r),v$(-.9787684*e+1.9161415*t+.033454*r),v$(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function y$(t){return t>fbt?Math.pow(t,1/3):t/N9e+I9e}function b$(t){return t>h6?t*t*t:N9e*(t-I9e)}function v$(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x$(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function gbt(t){if(t instanceof i0)return new i0(t.h,t.c,t.l,t.opacity);if(t instanceof Fd||(t=D9e(t)),t.a===0&&t.b===0)return new i0(NaN,0()=>t;function _9e(t,e){return function(r){return t+r*e}}function mbt(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 Ubt(t,e){var r=e-t;return r?_9e(t,r>180||r<-180?r-360*Math.round(r/360):r):lO(isNaN(t)?e:t)}function ybt(t){return(t=+t)==1?zx:function(e,r){return r-e?mbt(e,r,t):lO(isNaN(e)?r:e)}}function zx(t,e){var r=e-t;return r?_9e(t,r):lO(isNaN(t)?e:t)}const KR=(function t(e){var r=ybt(e);function n(i,a){var s=r((i=BG(i)).r,(a=BG(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=zx(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 bbt(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:uh(n,i)})),r=w$.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:uh(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:uh(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:uh(u,d)},{i:m-2,x:uh(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,U;++g=0&&t._call.call(void 0,e),t=t._next;--Bv}function Vue(){KU=(JR=lT.now())+cO,Bv=D3=0;try{Dbt()}finally{Bv=0,_bt(),KU=0}}function Obt(){var t=lT.now(),e=t-JR;e>F9e&&(cO-=e,JR=t)}function _bt(){for(var t,e=ZR,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:ZR=r);O3=t,VG(n)}function VG(t){if(!Bv){D3&&(D3=clearTimeout(D3));var e=t-KU;e>24?(t<1/0&&(D3=setTimeout(Vue,t-lT.now()-cO)),P9&&(P9=clearInterval(P9))):(P9||(JR=lT.now(),P9=setInterval(Obt,F9e)),Bv=1,z9e(Vue))}}function Hue(t,e,r){var n=new QR;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var Pbt=p9e("start","end","cancel","interrupt"),Bbt=[],H9e=0,Gue=1,HG=2,OA=3,Wue=4,GG=5,_A=6;function uO(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;$bt(t,r,{name:e,index:n,group:i,on:Pbt,tween:Bbt,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:H9e})}function jJ(t,e){var r=Zh(t,e);if(r.state>H9e)throw new Error("too late; already scheduled");return r}function of(t,e){var r=Zh(t,e);if(r.state>OA)throw new Error("too late; already running");return r}function Zh(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function $bt(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=V9e(a,0,r.time);function a(u){r.state=Gue,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!==Gue)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===OA)return Hue(s);p.state===Wue?(p.state=_A,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hHG&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function m7t(t,e,r){var n,i,a=g7t(e)?jJ:of;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function U7t(t,e){var r=this._id;return arguments.length<2?Zh(this.node(),r).on.on(t):this.each(m7t(r,t,e))}function y7t(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function b7t(){return this.on("end.remove",y7t(this._id))}function v7t(t){var e=this._name,r=this._id;typeof t!="function"&&(t=HJ(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 j9e;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;ibm)if(!(Math.abs(d*l-u*h)>bm)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,U=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),v=a*Math.tan((WG-Math.acos((m+f-U)/(2*y*b)))/2),w=v/b,T=v/y;Math.abs(w-1)>bm&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+T*l},${this._y1=r+T*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)>bm||Math.abs(this._y1-h)>bm)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%qG+qG),f>W7t?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>bm&&this._append`A${n},${n},0,${+(f>=WG)},${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 Y7t(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function eL(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 $v(t){return t=eL(Math.abs(t)),t?t[1]:NaN}function X7t(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 K7t(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Z7t=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tL(t){if(!(e=Z7t.exec(t)))throw new Error("invalid format: "+t);var e;return new XJ({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]})}tL.prototype=XJ.prototype;function XJ(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+""}XJ.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 J7t(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 rL;function Q7t(t,e){var r=eL(t,e);if(!r)return rL=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(rL=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")+eL(t,Math.max(0,e+a-1))[0]}function que(t,e){var r=eL(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 jue={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Y7t,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)=>que(t*100,e),r:que,s:Q7t,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Yue(t){return t}var Xue=Array.prototype.map,Kue=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function e8t(t){var e=t.grouping===void 0||t.thousands===void 0?Yue:X7t(Xue.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?Yue:K7t(Xue.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=tL(d);var p=d.fill,g=d.align,m=d.sign,U=d.symbol,y=d.zero,b=d.width,v=d.comma,w=d.precision,T=d.trim,k=d.type;k==="n"?(v=!0,k="g"):jue[k]||(w===void 0&&(w=12),T=!0,k="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var C=(f&&f.prefix!==void 0?f.prefix:"")+(U==="$"?r:U==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),S=(U==="$"?n:/[%p]/.test(k)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),E=jue[k],A=/[defgprs%]/.test(k);w=w===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function R(_){var N=C,L=S,I,P,O;if(k==="c")L=E(_)+L,_="";else{_=+_;var D=_<0||1/_<0;if(_=isNaN(_)?l:E(Math.abs(_),w),T&&(_=J7t(_)),D&&+_==0&&m!=="+"&&(D=!1),N=(D?m==="("?m:o:m==="-"||m==="("?"":m)+N,L=(k==="s"&&!isNaN(_)&&rL!==void 0?Kue[8+rL/3]:"")+L+(D&&m==="("?")":""),A){for(I=-1,P=_.length;++IO||O>57){L=(O===46?i+_.slice(I+1):_.slice(I))+L,_=_.slice(0,I);break}}}v&&!y&&(_=e(_,1/0));var B=N.length+_.length+L.length,F=B>1)+N+_+L+F.slice(B);break;default:_=F+N+_+L;break}return a(_)}return R.toString=function(){return d+""},R}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor($v(f)/3)))*3,g=Math.pow(10,-p),m=u((d=tL(d),d.type="f",d),{suffix:Kue[8+p/3]});return function(U){return m(g*U)}}return{format:u,formatPrefix:h}}var IS,Pm,Y9e;t8t({thousands:",",grouping:[3],currency:["$",""]});function t8t(t){return IS=e8t(t),Pm=IS.format,Y9e=IS.formatPrefix,IS}function r8t(t){return Math.max(0,-$v(Math.abs(t)))}function n8t(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($v(e)/3)))*3-$v(Math.abs(t)))}function i8t(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$v(e)-$v(t))+1}function a8t(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 s8t(){return this.eachAfter(a8t)}function o8t(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function l8t(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 c8t(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 d8t(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function f8t(t){for(var e=this,r=p8t(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 p8t(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 g8t(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function m8t(){return Array.from(this)}function U8t(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function y8t(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*b8t(){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 nL(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(C8t)}function v8t(){return KJ(this).eachBefore(T8t)}function x8t(t){return t.children}function w8t(t){return Array.isArray(t)?t[1]:null}function T8t(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function C8t(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function nL(t){this.data=t,this.depth=this.height=0,this.parent=null}nL.prototype=KJ.prototype={constructor:nL,count:s8t,each:o8t,eachAfter:c8t,eachBefore:l8t,find:u8t,sum:h8t,sort:d8t,path:f8t,ancestors:g8t,descendants:m8t,leaves:U8t,links:y8t,copy:v8t,[Symbol.iterator]:b8t};function k8t(t){if(typeof t!="function")throw new Error;return t}function B9(){return 0}function $9(t){return function(){return t}}function S8t(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 E8t(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++ob&&(b=u),k=U*U*T,v=Math.max(b/k,k/y),v>w){U-=u;break}w=v}s.push(l={value:U,dice:p1?n:1)},r})(M8t);function I8t(){var t=L8t,e=!1,r=1,n=1,i=[0],a=B9,s=B9,o=B9,l=B9,u=B9;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(S8t),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,U=f.x1-p,y=f.y1-p;Ue&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function _8t(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i2?P8t:_8t,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),uh)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,D8t),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=Sbt,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Ly,h()):s!==Ly},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 K9e(){return B8t()(Ly,Ly)}function $8t(t,e,r,n){var i=OG(t,e,r),a;switch(n=tL(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=n8t(i,s))&&(n.precision=a),Y9e(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=i8t(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=r8t(i))&&(n.precision=a-(n.type==="%")*2);break}}return Pm(n)}function F8t(t){var e=t.domain;return t.ticks=function(r){var n=e();return oyt(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return $8t(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=DG(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 Fv(){var t=K9e();return t.copy=function(){return X9e(t,Fv())},hO.apply(t,arguments),F8t(t)}function z8t(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(uzs(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)=>(T$.setTime(+a),C$.setTime(+s),t(T$),t(C$),Math.floor(r(T$,C$))),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 zv=zs(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);zv.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?zs(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):zv);zv.range;const a0=1e3,Nu=a0*60,s0=Nu*60,L0=s0*24,ZJ=L0*7,Que=L0*30,k$=L0*365,cg=zs(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*a0)},(t,e)=>(e-t)/a0,t=>t.getUTCSeconds());cg.range;const cT=zs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*a0)},(t,e)=>{t.setTime(+t+e*Nu)},(t,e)=>(e-t)/Nu,t=>t.getMinutes());cT.range;const V8t=zs(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Nu)},(t,e)=>(e-t)/Nu,t=>t.getUTCMinutes());V8t.range;const uT=zs(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*a0-t.getMinutes()*Nu)},(t,e)=>{t.setTime(+t+e*s0)},(t,e)=>(e-t)/s0,t=>t.getHours());uT.range;const H8t=zs(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*s0)},(t,e)=>(e-t)/s0,t=>t.getUTCHours());H8t.range;const ZU=zs(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Nu)/L0,t=>t.getDate()-1);ZU.range;const JJ=zs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/L0,t=>t.getUTCDate()-1);JJ.range;const G8t=zs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/L0,t=>Math.floor(t/L0));G8t.range;function k5(t){return zs(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())*Nu)/ZJ)}const nk=k5(0),hT=k5(1),Z9e=k5(2),J9e=k5(3),JU=k5(4),Q9e=k5(5),e3e=k5(6);nk.range;hT.range;Z9e.range;J9e.range;JU.range;Q9e.range;e3e.range;function S5(t){return zs(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)/ZJ)}const t3e=S5(0),iL=S5(1),W8t=S5(2),q8t=S5(3),Vv=S5(4),j8t=S5(5),Y8t=S5(6);t3e.range;iL.range;W8t.range;q8t.range;Vv.range;j8t.range;Y8t.range;const dT=zs(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());dT.range;const X8t=zs(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());X8t.range;const I0=zs(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());I0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:zs(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)});I0.range;const QU=zs(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());QU.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:zs(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)});QU.range;function K8t(t,e,r,n,i,a){const s=[[cg,1,a0],[cg,5,5*a0],[cg,15,15*a0],[cg,30,30*a0],[a,1,Nu],[a,5,5*Nu],[a,15,15*Nu],[a,30,30*Nu],[i,1,s0],[i,3,3*s0],[i,6,6*s0],[i,12,12*s0],[n,1,L0],[n,2,2*L0],[r,1,ZJ],[e,1,Que],[e,3,3*Que],[t,1,k$]];function o(u,h,d){const f=hU).right(s,f);if(p===s.length)return t.every(OG(u/k$,h/k$,d));if(p===0)return zv.every(Math.max(OG(u,h,d),1));const[g,m]=s[f/s[p-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(te=E$(F9(ie.y,0,1)),Re=te.getUTCDay(),te=Re>4||Re===0?iL.ceil(te):iL(te),te=JJ.offset(te,(ie.V-1)*7),ie.y=te.getUTCFullYear(),ie.m=te.getUTCMonth(),ie.d=te.getUTCDate()+(ie.w+6)%7):(te=S$(F9(ie.y,0,1)),Re=te.getDay(),te=Re>4||Re===0?hT.ceil(te):hT(te),te=ZU.offset(te,(ie.V-1)*7),ie.y=te.getFullYear(),ie.m=te.getMonth(),ie.d=te.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),Re="Z"in ie?E$(F9(ie.y,0,1)).getUTCDay():S$(F9(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(Re+5)%7:ie.w+ie.U*7-(Re+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,E$(ie)):S$(ie)}}function S(Z,J,ne,ie){for(var me=0,te=J.length,Re=ne.length,Pe,Ve;me=Re)return-1;if(Pe=J.charCodeAt(me++),Pe===37){if(Pe=J.charAt(me++),Ve=T[Pe in ehe?J.charAt(me++):Pe],!Ve||(ie=Ve(Z,ne,ie))<0)return-1}else if(Pe!=ne.charCodeAt(ie++))return-1}return ie}function E(Z,J,ne){var ie=u.exec(J.slice(ne));return ie?(Z.p=h.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function A(Z,J,ne){var ie=p.exec(J.slice(ne));return ie?(Z.w=g.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function R(Z,J,ne){var ie=d.exec(J.slice(ne));return ie?(Z.w=f.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function _(Z,J,ne){var ie=y.exec(J.slice(ne));return ie?(Z.m=b.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function N(Z,J,ne){var ie=m.exec(J.slice(ne));return ie?(Z.m=U.get(ie[0].toLowerCase()),ne+ie[0].length):-1}function L(Z,J,ne){return S(Z,e,J,ne)}function I(Z,J,ne){return S(Z,r,J,ne)}function P(Z,J,ne){return S(Z,n,J,ne)}function O(Z){return s[Z.getDay()]}function D(Z){return a[Z.getDay()]}function B(Z){return l[Z.getMonth()]}function F(Z){return o[Z.getMonth()]}function z(Z){return i[+(Z.getHours()>=12)]}function $(Z){return 1+~~(Z.getMonth()/3)}function V(Z){return s[Z.getUTCDay()]}function H(Z){return a[Z.getUTCDay()]}function G(Z){return l[Z.getUTCMonth()]}function K(Z){return o[Z.getUTCMonth()]}function W(Z){return i[+(Z.getUTCHours()>=12)]}function oe(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var J=k(Z+="",v);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=k(Z+="",w);return J.toString=function(){return Z},J},utcParse:function(Z){var J=C(Z+="",!0);return J.toString=function(){return Z},J}}}var ehe={"-":"",_:" ",0:"0"},lo=/^\s*\d+/,evt=/^%/,tvt=/[\\^$*+?|[\]().{}]/g;function oi(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function nvt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function ivt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function avt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function svt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function ovt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function the(t,e,r){var n=lo.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function rhe(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function lvt(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 cvt(t,e,r){var n=lo.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function uvt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function nhe(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function hvt(t,e,r){var n=lo.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function ihe(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function dvt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function fvt(t,e,r){var n=lo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function pvt(t,e,r){var n=lo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function gvt(t,e,r){var n=lo.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function mvt(t,e,r){var n=evt.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Uvt(t,e,r){var n=lo.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function yvt(t,e,r){var n=lo.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function ahe(t,e){return oi(t.getDate(),e,2)}function bvt(t,e){return oi(t.getHours(),e,2)}function vvt(t,e){return oi(t.getHours()%12||12,e,2)}function xvt(t,e){return oi(1+ZU.count(I0(t),t),e,3)}function r3e(t,e){return oi(t.getMilliseconds(),e,3)}function wvt(t,e){return r3e(t,e)+"000"}function Tvt(t,e){return oi(t.getMonth()+1,e,2)}function Cvt(t,e){return oi(t.getMinutes(),e,2)}function kvt(t,e){return oi(t.getSeconds(),e,2)}function Svt(t){var e=t.getDay();return e===0?7:e}function Evt(t,e){return oi(nk.count(I0(t)-1,t),e,2)}function n3e(t){var e=t.getDay();return e>=4||e===0?JU(t):JU.ceil(t)}function Avt(t,e){return t=n3e(t),oi(JU.count(I0(t),t)+(I0(t).getDay()===4),e,2)}function Mvt(t){return t.getDay()}function Rvt(t,e){return oi(hT.count(I0(t)-1,t),e,2)}function Lvt(t,e){return oi(t.getFullYear()%100,e,2)}function Ivt(t,e){return t=n3e(t),oi(t.getFullYear()%100,e,2)}function Nvt(t,e){return oi(t.getFullYear()%1e4,e,4)}function Dvt(t,e){var r=t.getDay();return t=r>=4||r===0?JU(t):JU.ceil(t),oi(t.getFullYear()%1e4,e,4)}function Ovt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+oi(e/60|0,"0",2)+oi(e%60,"0",2)}function she(t,e){return oi(t.getUTCDate(),e,2)}function _vt(t,e){return oi(t.getUTCHours(),e,2)}function Pvt(t,e){return oi(t.getUTCHours()%12||12,e,2)}function Bvt(t,e){return oi(1+JJ.count(QU(t),t),e,3)}function i3e(t,e){return oi(t.getUTCMilliseconds(),e,3)}function $vt(t,e){return i3e(t,e)+"000"}function Fvt(t,e){return oi(t.getUTCMonth()+1,e,2)}function zvt(t,e){return oi(t.getUTCMinutes(),e,2)}function Vvt(t,e){return oi(t.getUTCSeconds(),e,2)}function Hvt(t){var e=t.getUTCDay();return e===0?7:e}function Gvt(t,e){return oi(t3e.count(QU(t)-1,t),e,2)}function a3e(t){var e=t.getUTCDay();return e>=4||e===0?Vv(t):Vv.ceil(t)}function Wvt(t,e){return t=a3e(t),oi(Vv.count(QU(t),t)+(QU(t).getUTCDay()===4),e,2)}function qvt(t){return t.getUTCDay()}function jvt(t,e){return oi(iL.count(QU(t)-1,t),e,2)}function Yvt(t,e){return oi(t.getUTCFullYear()%100,e,2)}function Xvt(t,e){return t=a3e(t),oi(t.getUTCFullYear()%100,e,2)}function Kvt(t,e){return oi(t.getUTCFullYear()%1e4,e,4)}function Zvt(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Vv(t):Vv.ceil(t),oi(t.getUTCFullYear()%1e4,e,4)}function Jvt(){return"+0000"}function ohe(){return"%"}function lhe(t){return+t}function che(t){return Math.floor(+t/1e3)}var U2,aL;Qvt({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 Qvt(t){return U2=Q8t(t),aL=U2.format,U2.parse,U2.utcFormat,U2.utcParse,U2}function e4t(t){return new Date(t)}function t4t(t){return t instanceof Date?+t:+new Date(+t)}function s3e(t,e,r,n,i,a,s,o,l,u){var h=K9e(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),U=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),w=u("%Y");function T(k){return(l(k)1?0:t<-1?fT:Math.acos(t)}function hhe(t){return t>=1?sL:t<=-1?-sL:Math.asin(t)}function o3e(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 j7t(e)}function o4t(t){return t.innerRadius}function l4t(t){return t.outerRadius}function c4t(t){return t.startAngle}function u4t(t){return t.endAngle}function h4t(t){return t&&t.padAngle}function d4t(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*fL*L+I*I&&(S=A,E=R),{cx:S,cy:E,x01:-h,y01:-d,x11:S*(i/T-1),y11:E*(i/T-1)}}function Hv(){var t=o4t,e=l4t,r=Ya(0),n=null,i=c4t,a=u4t,s=h4t,o=null,l=o3e(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-sL,m=a.apply(this,arguments)-sL,U=uhe(m-g),y=m>g;if(o||(o=h=l()),pGo))o.moveTo(0,0);else if(U>PA-Go)o.moveTo(p*Z1(g),p*rd(g)),o.arc(0,0,p,g,m,!y),f>Go&&(o.moveTo(f*Z1(m),f*rd(m)),o.arc(0,0,f,m,g,y));else{var b=g,v=m,w=g,T=m,k=U,C=U,S=s.apply(this,arguments)/2,E=S>Go&&(n?+n.apply(this,arguments):Iy(f*f+p*p)),A=A$(uhe(p-f)/2,+r.apply(this,arguments)),R=A,_=A,N,L;if(E>Go){var I=hhe(E/f*rd(S)),P=hhe(E/p*rd(S));(k-=I*2)>Go?(I*=y?1:-1,w+=I,T-=I):(k=0,w=T=(g+m)/2),(C-=P*2)>Go?(P*=y?1:-1,b+=P,v-=P):(C=0,b=v=(g+m)/2)}var O=p*Z1(b),D=p*rd(b),B=f*Z1(T),F=f*rd(T);if(A>Go){var z=p*Z1(v),$=p*rd(v),V=f*Z1(w),H=f*rd(w),G;if(UGo?_>Go?(N=NS(V,H,O,D,p,_,y),L=NS(z,$,B,F,p,_,y),o.moveTo(N.cx+N.x01,N.cy+N.y01),_Go)||!(k>Go)?o.lineTo(B,F):R>Go?(N=NS(B,F,z,$,f,-R,y),L=NS(O,D,V,H,f,-R,y),o.lineTo(N.cx+N.x01,N.cy+N.y01),Rt?1:e>=t?0:NaN}function m4t(t){return t}function U4t(){var t=m4t,e=g4t,r=null,n=Ya(0),i=Ya(PA),a=Ya(0);function s(o){var l,u=(o=l3e(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),U=Math.min(PA,Math.max(-PA,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(U)/u,a.apply(this,arguments)),v=b*(U<0?-1:1),w;for(l=0;l0&&(f+=w);for(e!=null?p.sort(function(T,k){return e(g[T],g[k])}):r!=null&&p.sort(function(T,k){return r(o[T],o[k])}),l=0,d=f?(U-u*v)/f:0;l0?w*d:0)+v,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:y,padAngle:b};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Ya(+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:Ya(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Ya(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Ya(+o),s):a},s}class u3e{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 h3e(t){return new u3e(t,!0)}function d3e(t){return new u3e(t,!1)}function zg(){}function oL(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 dO(t){this._context=t}dO.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:oL(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:oL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function gT(t){return new dO(t)}function f3e(t){this._context=t}f3e.prototype={areaStart:zg,areaEnd:zg,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:oL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function y4t(t){return new f3e(t)}function p3e(t){this._context=t}p3e.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:oL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function b4t(t){return new p3e(t)}function g3e(t,e){this._basis=new dO(t),this._beta=e}g3e.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 v4t=(function t(e){function r(n){return e===1?new dO(n):new g3e(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function lL(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 QJ(t,e){this._context=t,this._k=(1-e)/6}QJ.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:lL(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:lL(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 m3e=(function t(e){function r(n){return new QJ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function eQ(t,e){this._context=t,this._k=(1-e)/6}eQ.prototype={areaStart:zg,areaEnd:zg,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:lL(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 x4t=(function t(e){function r(n){return new eQ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function tQ(t,e){this._context=t,this._k=(1-e)/6}tQ.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:lL(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 w4t=(function t(e){function r(n){return new tQ(n,e)}return r.tension=function(n){return t(+n)},r})(0);function rQ(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>Go){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>Go){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 U3e(t,e){this._context=t,this._alpha=e}U3e.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:rQ(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 y3e=(function t(e){function r(n){return e?new U3e(n,e):new QJ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function b3e(t,e){this._context=t,this._alpha=e}b3e.prototype={areaStart:zg,areaEnd:zg,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:rQ(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 T4t=(function t(e){function r(n){return e?new b3e(n,e):new eQ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function v3e(t,e){this._context=t,this._alpha=e}v3e.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:rQ(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 C4t=(function t(e){function r(n){return e?new v3e(n,e):new tQ(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function x3e(t){this._context=t}x3e.prototype={areaStart:zg,areaEnd:zg,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 k4t(t){return new x3e(t)}function dhe(t){return t<0?-1:1}function fhe(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(dhe(a)+dhe(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function phe(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function M$(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 cL(t){this._context=t}cL.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:M$(this,this._t0,phe(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,M$(this,phe(this,r=fhe(this,t,e)),r);break;default:M$(this,this._t0,r=fhe(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function w3e(t){this._context=new T3e(t)}(w3e.prototype=Object.create(cL.prototype)).point=function(t,e){cL.prototype.point.call(this,e,t)};function T3e(t){this._context=t}T3e.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 C3e(t){return new cL(t)}function k3e(t){return new w3e(t)}function S3e(t){this._context=t}S3e.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=ghe(t),i=ghe(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 A3e(t){return new fO(t,.5)}function M3e(t){return new fO(t,0)}function R3e(t){return new fO(t,1)}function _3(t,e,r){this.k=t,this.x=e,this.y=r}_3.prototype={constructor:_3,scale:function(t){return t===1?this:new _3(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new _3(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+")"}};_3.prototype;var sl=x(t=>{var i;const{securityLevel:e}=He();let r=vt("body");if(e==="sandbox"){const s=((i=vt(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=vt(s.body)}return r.select(`#${t}`)},"selectSvgElement");function nQ(t){return typeof t>"u"||t===null}x(nQ,"isNothing");function L3e(t){return typeof t=="object"&&t!==null}x(L3e,"isObject");function I3e(t){return Array.isArray(t)?t:nQ(t)?[]:[t]}x(I3e,"toArray");function N3e(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;ro&&(s=" ... ",e=n-o+s.length),r-n>o&&(a=" ...",r=n+o-a.length),{str:s+t.slice(e,r).replace(/\t/g,"→")+a,pos:n-e+s.length}}w(DR,"getLine");function PR(t,e){return Ra.repeat(" ",e-t.length)+t}w(PR,"padStart");function Eke(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=[],s,a=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=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&&!(a-l<0);l++)u=DR(t.buffer,n[a-l],i[a-l],t.position-(n[a]-n[a-l]),d),o=Ra.repeat(" ",e.indent)+PR((t.line-l+1).toString(),h)+" | "+u.str+` -`+o;for(u=DR(t.buffer,n[a],i[a],t.position,d),o+=Ra.repeat(" ",e.indent)+PR((t.line+1).toString(),h)+" | "+u.str+` -`,o+=Ra.repeat("-",e.indent+h+3+u.pos)+`^ -`,l=1;l<=e.linesAfter&&!(a+l>=i.length);l++)u=DR(t.buffer,n[a+l],i[a+l],t.position-(n[a]-n[a+l]),d),o+=Ra.repeat(" ",e.indent)+PR((t.line+l+1).toString(),h)+" | "+u.str+` -`;return o.replace(/\n$/,"")}w(Eke,"makeSnippet");var n3t=Eke,i3t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],s3t=["scalar","sequence","mapping"];function Ake(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}w(Ake,"compileStyleAliases");function Mke(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(i3t.indexOf(r)===-1)throw new yc('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=Ake(e.styleAliases||null),s3t.indexOf(this.kind)===-1)throw new yc('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}w(Mke,"Type$1");var Ko=Mke;function HW(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}w(HW,"compileList");function Rke(){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"]}}),p3t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hke(t){return!(t===null||!p3t.test(t)||t[t.length-1]==="_")}w(Hke,"resolveYamlFloat");function Gke(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(Gke,"constructYamlFloat");var g3t=/^[-+]?[0-9]+e/;function Wke(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(Ra.isNegativeZero(t))return"-0.0";return r=t.toString(10),g3t.test(r)?r.replace("e",".e"):r}w(Wke,"representYamlFloat");function qke(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Ra.isNegativeZero(t))}w(qke,"isFloat");var m3t=new Ko("tag:yaml.org,2002:float",{kind:"scalar",resolve:Hke,construct:Gke,predicate:qke,represent:Wke,defaultStyle:"lowercase"}),Uke=u3t.extend({implicit:[h3t,d3t,f3t,m3t]}),y3t=Uke,jke=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yke=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 Xke(t){return t===null?!1:jke.exec(t)!==null||Yke.exec(t)!==null}w(Xke,"resolveYamlTimestamp");function Kke(t){var e,r,n,i,s,a,o,l=0,u=null,h,d,f;if(e=jke.exec(t),e===null&&(e=Yke.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(s=+e[4],a=+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,s,a,o,l)),u&&f.setTime(f.getTime()-u),f}w(Kke,"constructYamlTimestamp");function Zke(t){return t.toISOString()}w(Zke,"representYamlTimestamp");var v3t=new Ko("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xke,construct:Kke,instanceOf:Date,represent:Zke});function Qke(t){return t==="<<"||t===null}w(Qke,"resolveYamlMerge");var b3t=new Ko("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Qke}),QQ=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function Jke(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=QQ;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}w(Jke,"resolveYamlBinary");function eSe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=QQ,a=0,o=[];for(e=0;e>16&255),o.push(a>>8&255),o.push(a&255)),a=a<<6|s.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(a>>16&255),o.push(a>>8&255),o.push(a&255)):r===18?(o.push(a>>10&255),o.push(a>>2&255)):r===12&&o.push(a>>4&255),new Uint8Array(o)}w(eSe,"constructYamlBinary");function tSe(t){var e="",r=0,n,i,s=t.length,a=QQ;for(n=0;n>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]),r=(r<<8)+t[n];return i=s%3,i===0?(e+=a[r>>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]):i===2?(e+=a[r>>10&63],e+=a[r>>4&63],e+=a[r<<2&63],e+=a[64]):i===1&&(e+=a[r>>2&63],e+=a[r<<4&63],e+=a[64],e+=a[64]),e}w(tSe,"representYamlBinary");function rSe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}w(rSe,"isBinary");var x3t=new Ko("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Jke,construct:eSe,predicate:rSe,represent:tSe}),w3t=Object.prototype.hasOwnProperty,T3t=Object.prototype.toString;function nSe(t){if(t===null)return!0;var e=[],r,n,i,s,a,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}w(ySe,"charFromCodepoint");function JQ(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}w(JQ,"setProperty");var vSe=new Array(256),bSe=new Array(256);for(Km=0;Km<256;Km++)vSe[Km]=WW(Km)?1:0,bSe[Km]=WW(Km);var Km;function xSe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||cSe,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(xSe,"State$1");function eJ(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=n3t(r),new yc(e,r)}w(eJ,"generateError");function Lr(t,e){throw eJ(t,e)}w(Lr,"throwError");function d6(t,e){t.onWarning&&t.onWarning.call(null,eJ(t,e))}w(d6,"throwWarning");var she={YAML:w(function(e,r,n){var i,s,a;e.version!==null&&Lr(e,"duplication of %YAML directive"),n.length!==1&&Lr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Lr(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&Lr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&d6(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(e,r,n){var i,s;n.length!==2&&Lr(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],dSe.test(i)||Lr(e,"ill-formed tag handle (first argument) of the TAG directive"),zg.call(e.tagMap,i)&&Lr(e,'there is a previously declared suffix for "'+i+'" tag handle'),fSe.test(s)||Lr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Lr(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function x0(t,e,r,n){var i,s,a,o;if(e1&&(t.result+=Ra.repeat(` -`,e-1))}w(dD,"writeFoldedLines");function wSe(t,e,r){var n,i,s,a,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Ll(p)||oy(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),Ll(i)||r&&oy(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Ll(i)||r&&oy(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Ll(n))break}else{if(t.position===t.lineStart&&e7(t)||r&&oy(p))break;if(Mh(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Qs(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(x0(t,s,a,!1),dD(t,t.line-l),s=a=t.position,o=!1),kg(p)||(a=t.position+1),p=t.input.charCodeAt(++t.position)}return x0(t,s,a,!1),t.result?!0:(t.kind=d,t.result=f,!1)}w(wSe,"readPlainScalar");function TSe(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(x0(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 Mh(r)?(x0(t,n,i,!0),dD(t,Qs(t,!1,e)),n=i=t.position):t.position===t.lineStart&&e7(t)?Lr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Lr(t,"unexpected end of the stream within a single quoted scalar")}w(TSe,"readSingleQuotedScalar");function CSe(t,e){var r,n,i,s,a,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 x0(t,r,t.position,!0),t.position++,!0;if(o===92){if(x0(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Mh(o))Qs(t,!1,e);else if(o<256&&vSe[o])t.result+=bSe[o],t.position++;else if((a=gSe(o))>0){for(i=a,s=0;i>0;i--)o=t.input.charCodeAt(++t.position),(a=pSe(o))>=0?s=(s<<4)+a:Lr(t,"expected hexadecimal character");t.result+=ySe(s),t.position++}else Lr(t,"unknown escape sequence");r=n=t.position}else Mh(o)?(x0(t,r,n,!0),dD(t,Qs(t,!1,e)),r=n=t.position):t.position===t.lineStart&&e7(t)?Lr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Lr(t,"unexpected end of the stream within a double quoted scalar")}w(CSe,"readDoubleQuotedScalar");function kSe(t,e){var r=!0,n,i,s,a=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,p=!1,o=[];else if(b===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(Qs(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=a,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?b===44&&Lr(t,"expected the node content, but found ','"):Lr(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Ll(u)&&(d=f=!0,t.position++,Qs(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,Zy(t,e,oL,!1,!0),y=t.tag,m=t.result,Qs(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),Qs(t,!0,e),Zy(t,e,oL,!1,!0),v=t.result),p?ly(t,o,g,y,m,v,n,i,s):d?o.push(ly(t,null,g,y,m,v,n,i,s)):o.push(m),Qs(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Lr(t,"unexpected end of the stream within a flow collection")}w(kSe,"readFlowCollection");function SSe(t,e){var r,n,i=SF,s=!1,a=!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)SF===i?i=d===43?ihe:M3t:Lr(t,"repeat of a chomping mode identifier");else if((h=mSe(d))>=0)h===0?Lr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Lr(t,"repeat of an indentation width identifier"):(o=e+h-1,a=!0);else break;if(kg(d)){do d=t.input.charCodeAt(++t.position);while(kg(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Mh(d)&&d!==0)}for(;d!==0;){for(hD(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!a||t.lineIndento&&(o=t.lineIndent),Mh(d)){l++;continue}if(t.lineIndente)&&l!==0)Lr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(a=t.line,o=t.lineStart,l=t.position),Zy(t,e,lL,!0,i)&&(y?g=t.result:m=t.result),y||(ly(t,d,f,p,g,m,a,o,l),p=g=m=null),Qs(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&b!==0)Lr(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&&Lr(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)):Lr(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(Zy,"composeNode");function _Se(t){var e=t.position,r,n,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Qs(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),r=t.position;a!==0&&!Ll(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Lr(t,"directive name must not be less than one character in length");a!==0;){for(;kg(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!Mh(a));break}if(Mh(a))break;for(r=t.position;a!==0&&!Ll(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&hD(t),zg.call(she,n)?she[n](t,n,i):d6(t,'unknown document directive "'+n+'"')}if(Qs(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,Qs(t,!0,-1)):s&&Lr(t,"directives end mark is expected"),Zy(t,t.lineIndent-1,lL,!1,!0),Qs(t,!0,-1),t.checkLineBreaks&&_3t.test(t.input.slice(e,t.position))&&d6(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&e7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Qs(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=tJ(t,r);if(typeof e!="function")return n;for(var i=0,s=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}w(Rb,"codePointAt");function nJ(t){var e=/^\n* /;return e.test(t)}w(nJ,"needIndentIndicator");var qSe=1,ZW=2,USe=3,jSe=4,Z2=5;function YSe(t,e,r,n,i,s,a,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=GSe(Rb(t,0))&&WSe(Rb(t,t.length-1));if(e||a)for(l=0;l=65536?l+=2:l++){if(u=Rb(t,l),!V5(u))return Z2;m=m&&KW(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=Rb(t,l),u===f6)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!V5(u))return Z2;m=m&&KW(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!a&&!i(t)?qSe:s===p6?Z2:ZW:r>9&&nJ(t)?Z2:a?s===p6?Z2:ZW:f?jSe:USe}w(YSe,"chooseScalarStyle");function XSe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===p6?'""':"''";if(!t.noCompatMode&&(Z3t.indexOf(e)!==-1||Q3t.test(e)))return t.quotingType===p6?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return HSe(t,u)}switch(w(l,"testAmbiguity"),YSe(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!n,i)){case qSe:return e;case ZW:return"'"+e.replace(/'/g,"''")+"'";case USe:return"|"+QW(e,t.indent)+JW(YW(e,s));case jSe:return">"+QW(e,t.indent)+JW(YW(KSe(e,a),s));case Z2:return'"'+ZSe(e)+'"';default:throw new yc("impossible error: invalid scalar style")}})()}w(XSe,"writeScalar");function QW(t,e){var r=nJ(t)?String(e):"",n=t[t.length-1]===` +`+t.mark.snippet),n+" "+r):n}x(iQ,"formatError");function Gv(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=iQ(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(Gv,"YAMLException$1");Gv.prototype=Object.create(Error.prototype);Gv.prototype.constructor=Gv;Gv.prototype.toString=x(function(e){return this.name+": "+iQ(this,e)},"toString");var Uc=Gv;function BA(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(BA,"getLine");function $A(t,e){return Ms.repeat(" ",e-t.length)+t}x($A,"padStart");function _3e(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=BA(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=Ms.repeat(" ",e.indent)+$A((t.line-l+1).toString(),h)+" | "+u.str+` +`+o;for(u=BA(t.buffer,n[s],i[s],t.position,d),o+=Ms.repeat(" ",e.indent)+$A((t.line+1).toString(),h)+" | "+u.str+` +`,o+=Ms.repeat("-",e.indent+h+3+u.pos)+`^ +`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=BA(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=Ms.repeat(" ",e.indent)+$A((t.line+l+1).toString(),h)+" | "+u.str+` +`;return o.replace(/\n$/,"")}x(_3e,"makeSnippet");var I4t=_3e,N4t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],D4t=["scalar","sequence","mapping"];function P3e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(P3e,"compileStyleAliases");function B3e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(N4t.indexOf(r)===-1)throw new Uc('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=P3e(e.styleAliases||null),D4t.indexOf(this.kind)===-1)throw new Uc('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(B3e,"Type$1");var Ko=B3e;function XG(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(XG,"compileList");function $3e(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),H4t=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J3e(t){return!(t===null||!H4t.test(t)||t[t.length-1]==="_")}x(J3e,"resolveYamlFloat");function Q3e(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(Q3e,"constructYamlFloat");var G4t=/^[-+]?[0-9]+e/;function exe(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(Ms.isNegativeZero(t))return"-0.0";return r=t.toString(10),G4t.test(r)?r.replace("e",".e"):r}x(exe,"representYamlFloat");function txe(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Ms.isNegativeZero(t))}x(txe,"isFloat");var W4t=new Ko("tag:yaml.org,2002:float",{kind:"scalar",resolve:J3e,construct:Q3e,predicate:txe,represent:exe,defaultStyle:"lowercase"}),rxe=$4t.extend({implicit:[F4t,z4t,V4t,W4t]}),q4t=rxe,nxe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ixe=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 axe(t){return t===null?!1:nxe.exec(t)!==null||ixe.exec(t)!==null}x(axe,"resolveYamlTimestamp");function sxe(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=nxe.exec(t),e===null&&(e=ixe.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(sxe,"constructYamlTimestamp");function oxe(t){return t.toISOString()}x(oxe,"representYamlTimestamp");var j4t=new Ko("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:axe,construct:sxe,instanceOf:Date,represent:oxe});function lxe(t){return t==="<<"||t===null}x(lxe,"resolveYamlMerge");var Y4t=new Ko("tag:yaml.org,2002:merge",{kind:"scalar",resolve:lxe}),aQ=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function cxe(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=aQ;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}x(cxe,"resolveYamlBinary");function uxe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=aQ,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(uxe,"constructYamlBinary");function hxe(t){var e="",r=0,n,i,a=t.length,s=aQ;for(n=0;n>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(hxe,"representYamlBinary");function dxe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(dxe,"isBinary");var X4t=new Ko("tag:yaml.org,2002:binary",{kind:"scalar",resolve:cxe,construct:uxe,predicate:dxe,represent:hxe}),K4t=Object.prototype.hasOwnProperty,Z4t=Object.prototype.toString;function fxe(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r>10)+55296,(t-65536&1023)+56320)}x(Exe,"charFromCodepoint");function sQ(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x(sQ,"setProperty");var Axe=new Array(256),Mxe=new Array(256);for(J1=0;J1<256;J1++)Axe[J1]=ZG(J1)?1:0,Mxe[J1]=ZG(J1);var J1;function Rxe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||bxe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(Rxe,"State$1");function oQ(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=I4t(r),new Uc(e,r)}x(oQ,"generateError");function Ir(t,e){throw oQ(t,e)}x(Ir,"throwError");function mT(t,e){t.onWarning&&t.onWarning.call(null,oQ(t,e))}x(mT,"throwWarning");var Uhe={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&Ir(e,"duplication of %YAML directive"),n.length!==1&&Ir(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Ir(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&Ir(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&mT(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&Ir(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],wxe.test(i)||Ir(e,"ill-formed tag handle (first argument) of the TAG directive"),Vg.call(e.tagMap,i)&&Ir(e,'there is a previously declared suffix for "'+i+'" tag handle'),Txe.test(a)||Ir(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Ir(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function x0(t,e,r,n){var i,a,s,o;if(e1&&(t.result+=Ms.repeat(` +`,e-1))}x(gO,"writeFoldedLines");function Lxe(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),Ll(p)||uU(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),Ll(i)||r&&uU(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),Ll(i)||r&&uU(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Ll(n))break}else{if(t.position===t.lineStart&&ik(t)||r&&uU(p))break;if(Ah(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Za(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&&(x0(t,a,s,!1),gO(t,t.line-l),a=s=t.position,o=!1),kg(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return x0(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(Lxe,"readPlainScalar");function Ixe(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(x0(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 Ah(r)?(x0(t,n,i,!0),gO(t,Za(t,!1,e)),n=i=t.position):t.position===t.lineStart&&ik(t)?Ir(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Ir(t,"unexpected end of the stream within a single quoted scalar")}x(Ixe,"readSingleQuotedScalar");function Nxe(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 x0(t,r,t.position,!0),t.position++,!0;if(o===92){if(x0(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Ah(o))Za(t,!1,e);else if(o<256&&Axe[o])t.result+=Mxe[o],t.position++;else if((s=kxe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=Cxe(o))>=0?a=(a<<4)+s:Ir(t,"expected hexadecimal character");t.result+=Exe(a),t.position++}else Ir(t,"unknown escape sequence");r=n=t.position}else Ah(o)?(x0(t,r,n,!0),gO(t,Za(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ik(t)?Ir(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Ir(t,"unexpected end of the stream within a double quoted scalar")}x(Nxe,"readDoubleQuotedScalar");function Dxe(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,U,y,b;if(b=t.input.charCodeAt(t.position),b===91)h=93,p=!1,o=[];else if(b===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(Za(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?b===44&&Ir(t,"expected the node content, but found ','"):Ir(t,"missed comma between flow collection entries"),U=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),Ll(u)&&(d=f=!0,t.position++,Za(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,e5(t,e,hL,!1,!0),U=t.tag,m=t.result,Za(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),Za(t,!0,e),e5(t,e,hL,!1,!0),y=t.result),p?hU(t,o,g,U,m,y,n,i,a):d?o.push(hU(t,null,g,U,m,y,n,i,a)):o.push(m),Za(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Ir(t,"unexpected end of the stream within a flow collection")}x(Dxe,"readFlowCollection");function Oxe(t,e){var r,n,i=R$,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)R$===i?i=d===43?mhe:n9t:Ir(t,"repeat of a chomping mode identifier");else if((h=Sxe(d))>=0)h===0?Ir(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Ir(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(kg(d)){do d=t.input.charCodeAt(++t.position);while(kg(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Ah(d)&&d!==0)}for(;d!==0;){for(pO(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),Ah(d)){l++;continue}if(t.lineIndente)&&l!==0)Ir(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(U&&(s=t.line,o=t.lineStart,l=t.position),e5(t,e,dL,!0,i)&&(U?g=t.result:m=t.result),U||(hU(t,d,f,p,g,m,s,o,l),p=g=m=null),Za(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Ir(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&&Ir(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)):Ir(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(e5,"composeNode");function Fxe(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&&(Za(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&&!Ll(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Ir(t,"directive name must not be less than one character in length");s!==0;){for(;kg(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Ah(s));break}if(Ah(s))break;for(r=t.position;s!==0&&!Ll(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&pO(t),Vg.call(Uhe,n)?Uhe[n](t,n,i):mT(t,'unknown document directive "'+n+'"')}if(Za(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,Za(t,!0,-1)):a&&Ir(t,"directives end mark is expected"),e5(t,t.lineIndent-1,dL,!1,!0),Za(t,!0,-1),t.checkLineBreaks&&a9t.test(t.input.slice(e,t.position))&&mT(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ik(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Za(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=lQ(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(Ny,"codePointAt");function uQ(t){var e=/^\n* /;return e.test(t)}x(uQ,"needIndentIndicator");var twe=1,iW=2,rwe=3,nwe=4,ey=5;function iwe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=Qxe(Ny(t,0))&&ewe(Ny(t,t.length-1));if(e||s)for(l=0;l=65536?l+=2:l++){if(u=Ny(t,l),!Wv(u))return ey;m=m&&nW(u,h,o),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=Ny(t,l),u===UT)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Wv(u))return ey;m=m&&nW(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?twe:a===yT?ey:iW:r>9&&uQ(t)?ey:s?a===yT?ey:iW:f?nwe:rwe}x(iwe,"chooseScalarStyle");function awe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===yT?'""':"''";if(!t.noCompatMode&&(S9t.indexOf(e)!==-1||E9t.test(e)))return t.quotingType===yT?'"'+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 Jxe(t,u)}switch(x(l,"testAmbiguity"),iwe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case twe:return e;case iW:return"'"+e.replace(/'/g,"''")+"'";case rwe:return"|"+aW(e,t.indent)+sW(tW(e,a));case nwe:return">"+aW(e,t.indent)+sW(tW(swe(e,s),a));case ey:return'"'+owe(e)+'"';default:throw new Uc("impossible error: invalid scalar style")}})()}x(awe,"writeScalar");function aW(t,e){var r=uQ(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` -`),s=i?"+":n?"":"-";return r+s+` -`}w(QW,"blockHeader");function JW(t){return t[t.length-1]===` -`?t.slice(0,-1):t}w(JW,"dropEndingNewline");function KSe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(` -`);return u=u!==-1?u:t.length,r.lastIndex=u,eq(t.slice(0,u),e)})(),i=t[0]===` -`||t[0]===" ",s,a;a=r.exec(t);){var o=a[1],l=a[2];s=l[0]===" ",n+=o+(!i&&!s&&l!==""?` -`:"")+eq(l,e),i=s}return n}w(KSe,"foldString");function eq(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,s,a=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(s=a>i?a:o,l+=` -`+t.slice(i,s),i=s+1),a=o;return l+=` -`,t.length-i>e&&a>i?l+=t.slice(i,a)+` -`+t.slice(a+1):l+=t.slice(i),l.slice(1)}w(eq,"foldLine");function ZSe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=Rb(t,i),n=ol[r],!n&&V5(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||zSe(r);return e}w(ZSe,"escapeString");function QSe(t,e,r){var n="",i=t.tag,s,a,o;for(s=0,a=r.length;s"u"&&jd(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}w(QSe,"writeFlowSequence");function tq(t,e,r,n){var i="",s=t.tag,a,o,l;for(a=0,o=r.length;a"u"&&jd(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=uL(t,e)),t.dump&&f6===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}w(tq,"writeBlockSequence");function JSe(t,e,r){var n="",i=t.tag,s=Object.keys(r),a,o,l,u,h;for(a=0,o=s.length;a1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),jd(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}w(JSe,"writeFlowMapping");function eEe(t,e,r,n){var i="",s=t.tag,a=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new yc("sortKeys must be a boolean or a function");for(o=0,l=a.length;o1024,d&&(t.dump&&f6===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=uL(t,e)),jd(t,e+1,h,!0,d)&&(t.dump&&f6===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}w(eEe,"writeBlockMapping");function rq(t,e,r){var n,i,s,a,o,l;for(i=r?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}w(rq,"detectType");function jd(t,e,r,n,i,s,a){t.tag=null,t.dump=r,rq(t,r,!1)||rq(t,r,!0);var o=ISe.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?(eEe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(JSe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?tq(t,e-1,t.dump,i):tq(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(QSe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&XSe(t,t.dump,e,s,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new yc("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(jd,"writeNode");function tEe(t,e){var r=[],n=[],i,s;for(hL(t,r,n),i=0,s=n.length;ie&&(a=s>i?s:o,l+=` +`+t.slice(i,a),i=a+1),s=o;return l+=` +`,t.length-i>e&&s>i?l+=t.slice(i,s)+` +`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(oW,"foldLine");function owe(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=Ny(t,i),n=ol[r],!n&&Wv(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||Kxe(r);return e}x(owe,"escapeString");function lwe(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a"u"&&Yd(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(lwe,"writeFlowSequence");function lW(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s"u"&&Yd(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=pL(t,e)),t.dump&&UT===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(lW,"writeBlockSequence");function cwe(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?"":" "),Yd(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(cwe,"writeFlowMapping");function uwe(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 Uc("sortKeys must be a boolean or a function");for(o=0,l=s.length;o1024,d&&(t.dump&&UT===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=pL(t,e)),Yd(t,e+1,h,!0,d)&&(t.dump&&UT===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(uwe,"writeBlockMapping");function cW(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(cW,"detectType");function Yd(t,e,r,n,i,a,s){t.tag=null,t.dump=r,cW(t,r,!1)||cW(t,r,!0);var o=Vxe.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?(uwe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(cwe(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?lW(t,e-1,t.dump,i):lW(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(lwe(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&awe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Uc("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(Yd,"writeNode");function hwe(t,e){var r=[],n=[],i,a;for(gL(t,r,n),i=0,a=n.length;i{const{handDrawnSeed:e}=He();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),q3=w(t=>{const e=nCt([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),nCt=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"),iJ=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"),cr=w(t=>{const{stylesArray:e}=q3(t),r=[],n=[],i=[],s=[];return e.forEach(a=>{const o=a[0];iJ(o)?r.push(a.join(":")+" !important"):(n.push(a.join(":")+" !important"),o.includes("stroke")&&i.push(a.join(":")+" !important"),o==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:s}},"styles2String"),fr=w((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=He(),{nodeBorder:i,mainBkg:s}=r,{stylesMap:a}=q3(t);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||i,seed:n,strokeWidth:((l=a.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:iCt(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),iCt=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"),L8={},wa={},ahe;function sCt(){return ahe||(ahe=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.BLANK_URL=wa.relativeFirstCharacters=wa.whitespaceEscapeCharsRegex=wa.urlSchemeRegex=wa.ctrlCharactersRegex=wa.htmlCtrlEntityRegex=wa.htmlEntitiesRegex=wa.invalidProtocolRegex=void 0,wa.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,wa.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,wa.htmlCtrlEntityRegex=/&(newline|tab);/gi,wa.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,wa.urlSchemeRegex=/^.+(:|:)/gim,wa.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,wa.relativeFirstCharacters=[".","/"],wa.BLANK_URL="about:blank"),wa}var ohe;function aCt(){if(ohe)return L8;ohe=1,Object.defineProperty(L8,"__esModule",{value:!0}),L8.sanitizeUrl=s;var t=sCt();function e(a){return t.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var o=a.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(a){return URL.canParse(a)}function i(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return t.BLANK_URL;var o,l=i(a.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 L8}var kv=aCt();function oCt(t){return Array.isArray(t)}function EF(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 lCt(){}function rEe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function t7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const nEe="[object RegExp]",sJ="[object String]",aJ="[object Number]",oJ="[object Boolean]",lJ="[object Arguments]",iEe="[object Symbol]",sEe="[object Date]",aEe="[object Map]",oEe="[object Set]",lEe="[object Array]",cEe="[object ArrayBuffer]",uEe="[object Object]",hEe="[object DataView]",dEe="[object Uint8Array]",fEe="[object Uint8ClampedArray]",pEe="[object Uint16Array]",gEe="[object Uint32Array]",mEe="[object Int8Array]",yEe="[object Int16Array]",vEe="[object Int32Array]",bEe="[object Float32Array]",xEe="[object Float64Array]",lhe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function cJ(t){return typeof lhe.Buffer<"u"&&lhe.Buffer.isBuffer(t)}function cCt(t){return Number.isSafeInteger(t)&&t>=0}function wEe(t){return t!=null&&typeof t!="function"&&cCt(t.length)}function uCt(t){return t==="__proto__"}function gD(t){return t==null||typeof t!="object"&&typeof t!="function"}function uJ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hCt(t,e){return _b(t,void 0,t,new Map,e)}function _b(t,e,r,n=new Map,i=void 0){const s=i==null?void 0:i(t,e,r,n);if(s!==void 0)return s;if(gD(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const a=new Array(t.length);n.set(t,a);for(let o=0;o{if(typeof t=="object"){if(t7(t)==="[object Object]"&&typeof t.constructor!="function"){const a={};return s.set(t,a),ah(a,t,i,s),a}switch(Object.prototype.toString.call(t)){case aJ:case sJ:case oJ:{const a=new t.constructor(t==null?void 0:t.valueOf());return ah(a,t),a}case lJ:{const a={};return ah(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function che(t){return fCt(t)}function nq(t){return t!==null&&typeof t=="object"&&t7(t)==="[object Arguments]"}function iq(t){return typeof t=="object"&&t!==null}function pCt(t){return iq(t)&&wEe(t)}function FS(t){return uJ(t)}function gCt(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function r7(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],s=r.cache;if(s.has(i))return s.get(i);const a=t.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(r7.Cache||Map),r}r7.Cache=Map;function mCt(t){if(gD(t))return t;const e=t7(t);if(!yCt(t))return{};if(oCt(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(FS(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,s=n.byteOffset,a=n.byteLength,o=new ArrayBuffer(a),l=new Uint8Array(i,s,a);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]"?bCt(i,t):AF(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((s,a)=>{i.set(a,s)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(s=>{i.add(s)}),i}if(e==="[object Arguments]"){const n=t,i={};return AF(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return xCt(r,t),AF(r,t),vCt(r,t),r}function yCt(t){switch(t7(t)){case lJ:case lEe:case cEe:case hEe:case oJ:case sEe:case bEe:case xEe:case mEe:case yEe:case vEe:case aEe:case aJ:case uEe:case nEe:case oEe:case sJ:case iEe:case dEe:case fEe:case pEe:case gEe:return!0;default:return!1}}function AF(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function vCt(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function xCt(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function wCt(t){if(gD(t))return t;if(Array.isArray(t)||uJ(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 TCt(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let s=0;sr!=="constructor").length===0:e.length===0}return!0}var TEe="​",kCt={curveBasis:h6,curveBasisClosed:G5t,curveBasisOpen:W5t,curveBumpX:tke,curveBumpY:rke,curveBundle:q5t,curveCardinalClosed:U5t,curveCardinalOpen:j5t,curveCardinal:ake,curveCatmullRomClosed:Y5t,curveCatmullRomOpen:X5t,curveCatmullRom:lke,curveLinear:BS,curveLinearClosed:K5t,curveMonotoneX:pke,curveMonotoneY:gke,curveNatural:yke,curveStep:vke,curveStepAfter:xke,curveStepBefore:bke},SCt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ECt=w(function(t,e){const r=CEe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const a=r.map(o=>o.args);P_(a),n=oa(n,[...a])}else n=r.args;if(!n)return;let i=AQ(t,e);const s="config";return n[s]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[s],delete n[s]),n},"detectInit"),CEe=w(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${SCt.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),de.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let s;const a=[];for(;(s=PS.exec(t))!==null;)if(s.index===PS.lastIndex&&PS.lastIndex++,s&&!e||e&&((r=s[1])!=null&&r.match(e))||e&&((n=s[2])!=null&&n.match(e))){const o=s[1]?s[1]:s[2],l=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;a.push({type:o,args:l})}return a.length===0?{type:t,args:null}:a.length===1?a[0]:a}catch(i){return de.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),ACt=w(function(t){return t.replace(PS,"")},"removeDirectives"),MCt=w(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function hJ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return kCt[r]??e}w(hJ,"interpolateToCurve");function kEe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?kv.sanitizeUrl(r):r}w(kEe,"formatUrl");var RCt=w((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let s=window;for(let a=0;a{r+=dJ(i,e),e=i});const n=r/2;return fJ(t,n)}w(SEe,"traverseEdge");function EEe(t){return t.length===1?t[0]:SEe(t)}w(EEe,"calcLabelPosition");var hhe=w((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),fJ=w((t,e)=>{let r,n=e;for(const i of t){if(r){const s=dJ(i,r);if(s===0)return r;if(s=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:hhe((1-a)*r.x+a*i.x,5),y:hhe((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),_Ct=w((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=fJ(e,25),s=t?10:5,a=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(a)*s+(e[0].x+i.x)/2,o.y=-Math.cos(a)*s+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function AEe(t,e,r){const n=structuredClone(r);de.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,s=fJ(n,i),a=10+t*.5,o=Math.atan2(n[0].y-s.y,n[0].x-s.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o+Math.PI)*a+(n[0].y+s.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o-Math.PI)*a+(n[0].y+s.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*a+(n[0].x+s.x)/2-5,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2-5):(l.x=Math.sin(o)*a+(n[0].x+s.x)/2,l.y=-Math.cos(o)*a+(n[0].y+s.y)/2),l}w(AEe,"calcTerminalLabelPosition");function pJ(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(pJ,"getStylesFromArray");var dhe=0,MEe=w(()=>(dhe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+dhe),"generateId");function REe(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;iREe(t.length),"random"),LCt=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"),ICt=w(function(t,e){const r=e.text.replace(Gt.lineBreakRegex," "),[,n]=np(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 s=i.append("tspan");return s.attr("x",e.x+e.textMargin*2),s.attr("fill",e.fill),s.text(r),i},"drawSimpleText"),zS=r7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Gt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let s="";return n.forEach((a,o)=>{const l=Bl(`${a} `,r),u=Bl(s,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=NCt(a,e,"-",r);i.push(s,...f),s=p}else u+l>=e?(i.push(s),s=a):s=[s,a].filter(Boolean).join(" ");o+1===n.length&&i.push(s)}),i.filter(a=>a!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),NCt=r7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],s=[];let a="";return i.forEach((o,l)=>{const u=`${a}${o}`;if(Bl(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;s.push(f?u:p),a=""}else a=u}),{hyphenatedStrings:s,remainingWord:a}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function dL(t,e){return mD(t,e).height}w(dL,"calculateTextHeight");function Bl(t,e){return mD(t,e).width}w(Bl,"calculateTextWidth");var mD=r7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,s]=np(r),a=["sans-serif",n],o=t.split(Gt.lineBreakRegex),l=[],u=xt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of a){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=LCt();y.text=m||TEe;const v=ICt(h,y).style("font-size",s).style("font-weight",i).style("font-family",f),b=(v._groups||v)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),p=Math.round(b.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}`),zx,OCt=(zx=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},w(zx,"InitIDGenerator"),zx),I8,DCt=w(function(t){return I8=I8||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),I8.innerHTML=t,unescape(I8.textContent)},"entityDecode");function gJ(t){return"str"in t}w(gJ,"isDetailedError");var PCt=w((t,e,r,n)=>{var s;if(!n)return;const i=(s=t.node())==null?void 0:s.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"),np=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 rs(t,e){return CCt({},t,e)}w(rs,"cleanAndMerge");var Kr={assignWithDepth:oa,wrapLabel:zS,calculateTextHeight:dL,calculateTextWidth:Bl,calculateTextDimensions:mD,cleanAndMerge:rs,detectInit:ECt,detectDirective:CEe,isSubstringInArray:MCt,interpolateToCurve:hJ,calcLabelPosition:EEe,calcCardinalityPosition:_Ct,calcTerminalLabelPosition:AEe,formatUrl:kEe,getStylesFromArray:pJ,generateId:MEe,random:_Ee,runFunc:RCt,entityDecode:DCt,insertTitle:PCt,isLabelCoordinateInPath:LEe,parseFontSize:np,InitIDGenerator:OCt},$Ct=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"),I0=w(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),lx=w((t,e,{counter:r=0,prefix:n,suffix:i},s)=>s||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function ro(t){return t??null}w(ro,"handleUndefinedAttr");function LEe(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return i.includes(r.toString())||i.includes(n.toString())}w(LEe,"isLabelCoordinateInPath");var U3=w(({flowchart:t})=>{var i,s;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((s=t==null?void 0:t.subGraphTitleMargin)==null?void 0:s.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function mJ(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(s=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=He().fontSize?He().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=En.fontSize]=np(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";s(i)}w(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}w(mJ,"configureLabelImages");const BCt=Object.freeze({left:0,top:0,width:16,height:16}),fL=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),IEe=Object.freeze({...BCt,...fL}),FCt=Object.freeze({...IEe,body:"",hidden:!1}),zCt=Object.freeze({width:null,height:null}),VCt=Object.freeze({...zCt,...fL}),HCt=(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 MF(u)?u:null}const s=i[0],a=s.split("-");if(a.length>1){const o={provider:n,prefix:a.shift(),name:a.join("-")};return MF(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:s};return MF(o,r)?o:null}return null},MF=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function GCt(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 fhe(t,e){const r=GCt(t,e);for(const n in FCt)n in fL?n in t&&!(n in r)&&(r[n]=fL[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function WCt(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function s(a){if(r[a])return i[a]=[];if(!(a in i)){i[a]=null;const o=n[a]&&n[a].parent,l=o&&s(o);l&&(i[a]=[o].concat(l))}return i[a]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(s),i}function phe(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let s={};function a(o){s=fhe(n[o]||i[o],s)}return a(e),r.forEach(a),fhe(t,s)}function qCt(t,e){if(t.icons[e])return phe(t,e,[]);const r=WCt(t,[e])[e];return r?phe(t,e,r):null}const UCt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,jCt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ghe(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(UCt);if(n===null||!n.length)return t;const i=[];let s=n.shift(),a=jCt.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?i.push(s):i.push(Math.ceil(o*e*r)/r)}else i.push(s);if(s=n.shift(),s===void 0)return i.join("");a=!a}}function YCt(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),s=t.indexOf("",s);if(a===-1)break;r+=t.slice(i+1,s).trim(),t=t.slice(0,n).trim()+t.slice(a+1)}return{defs:r,content:t}}function XCt(t,e){return t?""+t+""+e:e}function KCt(t,e,r){const n=YCt(t);return XCt(n.defs,e+n.content+r)}const ZCt=t=>t==="unset"||t==="undefined"||t==="none";function QCt(t,e){const r={...IEe,...t},n={...VCt,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,b=m.vFlip;let x=m.rotate;v?b?x+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):b&&(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(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){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()+")")}x%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&&(s=KCt(s,'',""))});const a=n.width,o=n.height,l=i.width,u=i.height;let h,d;a===null?(d=o===null?"1em":o==="auto"?u:o,h=ghe(d,l/u)):(h=a==="auto"?l:a,d=o===null?ghe(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{ZCt(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:s}}const JCt=/\sid="(\S+)"/g,mhe=new Map;function ekt(t){t=t.replace(/[0-9]+$/,"")||"a";const e=mhe.get(t)||0;return mhe.set(t,e+1),e?`${t}${e}`:t}function tkt(t){const e=[];let r;for(;r=JCt.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 s=ekt(i),a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function rkt(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 NEe={body:'?',height:80,width:80},sq=new Map,OEe=new Map,yJ=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(de.debug("Registering icon pack:",e.name),"loader"in e)OEe.set(e.name,e.loader);else if("icons"in e)sq.set(e.name,e.icons);else throw de.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),DEe=w(async(t,e)=>{const r=HCt(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=sq.get(n);if(!i){const a=OEe.get(n);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await a(),prefix:n},sq.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=qCt(i,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),nkt=w(async t=>{try{return await DEe(t),!0}catch{return!1}},"isIconAvailable"),N0=w(async(t,e,r)=>{let n;try{n=await DEe(t,e==null?void 0:e.fallbackPrefix)}catch(a){de.error(a),n=NEe}const i=QCt(n,e),s=rkt(tkt(i.body),{...i.attributes,...r});return Nn(s,xr())},"getIconSVG");function vJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sv=vJ();function PEe(t){Sv=t}var VS={exec:()=>null};function oi(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Il.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var ikt=(()=>{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")},skt=/^(?:[ \t]*(?:\n|$))+/,akt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,okt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,n7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lkt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bJ=/(?:[*+-]|\d{1,9}[.)])/,$Ee=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,BEe=oi($Ee).replace(/bull/g,bJ).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(),ckt=oi($Ee).replace(/bull/g,bJ).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(),xJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ukt=/^[^\n]+/,wJ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hkt=oi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dkt=oi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bJ).getRegex(),yD="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",TJ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,fkt=oi("^ {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",TJ).replace("tag",yD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),FEe=oi(xJ).replace("hr",n7).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",yD).getRegex(),pkt=oi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",FEe).getRegex(),CJ={blockquote:pkt,code:akt,def:hkt,fences:okt,heading:lkt,hr:n7,html:fkt,lheading:BEe,list:dkt,newline:skt,paragraph:FEe,table:VS,text:ukt},yhe=oi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",n7).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",yD).getRegex(),gkt={...CJ,lheading:ckt,table:yhe,paragraph:oi(xJ).replace("hr",n7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yhe).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",yD).getRegex()},mkt={...CJ,html:oi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",TJ).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:VS,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oi(xJ).replace("hr",n7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",BEe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ykt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vkt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zEe=/^( {2,}|\\)\n(?!\s*$)/,bkt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ikt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),GEe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,kkt=oi(GEe,"u").replace(/punct/g,vD).getRegex(),Skt=oi(GEe,"u").replace(/punct/g,HEe).getRegex(),WEe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ekt=oi(WEe,"gu").replace(/notPunctSpace/g,VEe).replace(/punctSpace/g,kJ).replace(/punct/g,vD).getRegex(),Akt=oi(WEe,"gu").replace(/notPunctSpace/g,Tkt).replace(/punctSpace/g,wkt).replace(/punct/g,HEe).getRegex(),Mkt=oi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,VEe).replace(/punctSpace/g,kJ).replace(/punct/g,vD).getRegex(),Rkt=oi(/\\(punct)/,"gu").replace(/punct/g,vD).getRegex(),_kt=oi(/^<(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(),Lkt=oi(TJ).replace("(?:-->|$)","-->").getRegex(),Ikt=oi("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Lkt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pL=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Nkt=oi(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",pL).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qEe=oi(/^!?\[(label)\]\[(ref)\]/).replace("label",pL).replace("ref",wJ).getRegex(),UEe=oi(/^!?\[(ref)\](?:\[\])?/).replace("ref",wJ).getRegex(),Okt=oi("reflink|nolink(?!\\()","g").replace("reflink",qEe).replace("nolink",UEe).getRegex(),vhe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,SJ={_backpedal:VS,anyPunctuation:Rkt,autolink:_kt,blockSkip:Ckt,br:zEe,code:vkt,del:VS,emStrongLDelim:kkt,emStrongRDelimAst:Ekt,emStrongRDelimUnd:Mkt,escape:ykt,link:Nkt,nolink:UEe,punctuation:xkt,reflink:qEe,reflinkSearch:Okt,tag:Ikt,text:bkt,url:VS},Dkt={...SJ,link:oi(/^!?\[(label)\]\((.*?)\)/).replace("label",pL).getRegex(),reflink:oi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pL).getRegex()},aq={...SJ,emStrongRDelimAst:Akt,emStrongLDelim:Skt,url:oi(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",vhe).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:oi(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},bhe=t=>$kt[t];function ad(t,e){if(e){if(Il.escapeTest.test(t))return t.replace(Il.escapeReplace,bhe)}else if(Il.escapeTestNoEncode.test(t))return t.replace(Il.escapeReplaceNoEncode,bhe);return t}function xhe(t){try{t=encodeURI(t).replace(Il.percentDecode,"%")}catch{return null}return t}function whe(t,e){var s;let r=t.replace(Il.findPipe,(a,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&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function The(t,e,r,n,i){let s=e.href,a=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:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Fkt(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` -`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(` -`)}var gL=class{constructor(e){wr(this,"options");wr(this,"rules");wr(this,"lexer");this.options=e||Sv}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:VC(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Fkt(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=VC(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:VC(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=VC(r[0],` +*/var L9t=x(t=>{const{handDrawnSeed:e}=He();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),Y4=x(t=>{const e=I9t([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),I9t=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),hQ=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),ur=x(t=>{const{stylesArray:e}=Y4(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];hQ(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"),pr=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=He(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=Y4(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:N9t(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),N9t=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),DS={},xs={},yhe;function D9t(){return yhe||(yhe=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.BLANK_URL=xs.relativeFirstCharacters=xs.whitespaceEscapeCharsRegex=xs.urlSchemeRegex=xs.ctrlCharactersRegex=xs.htmlCtrlEntityRegex=xs.htmlEntitiesRegex=xs.invalidProtocolRegex=void 0,xs.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,xs.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,xs.htmlCtrlEntityRegex=/&(newline|tab);/gi,xs.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,xs.urlSchemeRegex=/^.+(:|:)/gim,xs.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,xs.relativeFirstCharacters=[".","/"],xs.BLANK_URL="about:blank"),xs}var bhe;function O9t(){if(bhe)return DS;bhe=1,Object.defineProperty(DS,"__esModule",{value:!0}),DS.sanitizeUrl=a;var t=D9t();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 DS}var E5=O9t();function _9t(t){return Array.isArray(t)}function L$(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 P9t(){}function dwe(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function ak(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const fwe="[object RegExp]",dQ="[object String]",fQ="[object Number]",pQ="[object Boolean]",gQ="[object Arguments]",pwe="[object Symbol]",gwe="[object Date]",mwe="[object Map]",Uwe="[object Set]",ywe="[object Array]",bwe="[object ArrayBuffer]",vwe="[object Object]",xwe="[object DataView]",wwe="[object Uint8Array]",Twe="[object Uint8ClampedArray]",Cwe="[object Uint16Array]",kwe="[object Uint32Array]",Swe="[object Int8Array]",Ewe="[object Int16Array]",Awe="[object Int32Array]",Mwe="[object Float32Array]",Rwe="[object Float64Array]",vhe=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function mQ(t){return typeof vhe.Buffer<"u"&&vhe.Buffer.isBuffer(t)}function B9t(t){return Number.isSafeInteger(t)&&t>=0}function Lwe(t){return t!=null&&typeof t!="function"&&B9t(t.length)}function $9t(t){return t==="__proto__"}function yO(t){return t==null||typeof t!="object"&&typeof t!="function"}function UQ(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function F9t(t,e){return Dy(t,void 0,t,new Map,e)}function Dy(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(yO(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(ak(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),sh(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case fQ:case dQ:case pQ:{const s=new t.constructor(t==null?void 0:t.valueOf());return sh(s,t),s}case gQ:{const s={};return sh(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function xhe(t){return V9t(t)}function uW(t){return t!==null&&typeof t=="object"&&ak(t)==="[object Arguments]"}function hW(t){return typeof t=="object"&&t!==null}function H9t(t){return hW(t)&&Lwe(t)}function Hx(t){return UQ(t)}function G9t(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function sk(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(sk.Cache||Map),r}sk.Cache=Map;function W9t(t){if(yO(t))return t;const e=ak(t);if(!q9t(t))return{};if(_9t(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(Hx(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]"?Y9t(i,t):I$(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 I$(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return X9t(r,t),I$(r,t),j9t(r,t),r}function q9t(t){switch(ak(t)){case gQ:case ywe:case bwe:case xwe:case pQ:case gwe:case Mwe:case Rwe:case Swe:case Ewe:case Awe:case mwe:case fQ:case vwe:case fwe:case Uwe:case dQ:case pwe:case wwe:case Twe:case Cwe:case kwe:return!0;default:return!1}}function I$(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function j9t(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function X9t(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function K9t(t){if(yO(t))return t;if(Array.isArray(t)||UQ(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 Z9t(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 Iwe="​",Q9t={curveBasis:gT,curveBasisClosed:y4t,curveBasisOpen:b4t,curveBumpX:h3e,curveBumpY:d3e,curveBundle:v4t,curveCardinalClosed:x4t,curveCardinalOpen:w4t,curveCardinal:m3e,curveCatmullRomClosed:T4t,curveCatmullRomOpen:C4t,curveCatmullRom:y3e,curveLinear:Vx,curveLinearClosed:k4t,curveMonotoneX:C3e,curveMonotoneY:k3e,curveNatural:E3e,curveStep:A3e,curveStepAfter:R3e,curveStepBefore:M3e},e3t=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,t3t=x(function(t,e){const r=Nwe(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);FR(s),n=ss(n,[...s])}else n=r.args;if(!n)return;let i=DJ(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Nwe=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${e3t.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),de.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=Fx.exec(t))!==null;)if(a.index===Fx.lastIndex&&Fx.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 de.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),r3t=x(function(t){return t.replace(Fx,"")},"removeDirectives"),n3t=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function yQ(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Q9t[r]??e}x(yQ,"interpolateToCurve");function Dwe(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?E5.sanitizeUrl(r):r}x(Dwe,"formatUrl");var i3t=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s{r+=bQ(i,e),e=i});const n=r/2;return vQ(t,n)}x(Owe,"traverseEdge");function _we(t){return t.length===1?t[0]:Owe(t)}x(_we,"calcLabelPosition");var The=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),vQ=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=bQ(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:The((1-s)*r.x+s*i.x,5),y:The((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),a3t=x((t,e,r)=>{de.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=vQ(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 Pwe(t,e,r){const n=structuredClone(r);de.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=vQ(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(Pwe,"calcTerminalLabelPosition");function xQ(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(xQ,"getStylesFromArray");var Che=0,Bwe=x(()=>(Che++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Che),"generateId");function $we(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;i$we(t.length),"random"),s3t=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),o3t=x(function(t,e){const r=e.text.replace(Ht.lineBreakRegex," "),[,n]=ip(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"),Gx=sk((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Ht.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=Bl(`${s} `,r),u=Bl(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=l3t(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}`),l3t=sk((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(Bl(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 mL(t,e){return bO(t,e).height}x(mL,"calculateTextHeight");function Bl(t,e){return bO(t,e).width}x(Bl,"calculateTextWidth");var bO=sk((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=ip(r),s=["sans-serif",n],o=t.split(Ht.lineBreakRegex),l=[],u=vt("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 U=s3t();U.text=m||Iwe;const y=o3t(h,U).style("font-size",a).style("font-weight",i).style("font-family",f),b=(y._groups||y)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),p=Math.round(b.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}`),G6,c3t=(G6=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(G6,"InitIDGenerator"),G6),OS,u3t=x(function(t){return OS=OS||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),OS.innerHTML=t,unescape(OS.textContent)},"entityDecode");function wQ(t){return"str"in t}x(wQ,"isDetailedError");var h3t=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),ip=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function na(t,e){return J9t({},t,e)}x(na,"cleanAndMerge");var Kr={assignWithDepth:ss,wrapLabel:Gx,calculateTextHeight:mL,calculateTextWidth:Bl,calculateTextDimensions:bO,cleanAndMerge:na,detectInit:t3t,detectDirective:Nwe,isSubstringInArray:n3t,interpolateToCurve:yQ,calcLabelPosition:_we,calcCardinalityPosition:a3t,calcTerminalLabelPosition:Pwe,formatUrl:Dwe,getStylesFromArray:xQ,generateId:Bwe,random:Fwe,runFunc:i3t,entityDecode:u3t,insertTitle:h3t,isLabelCoordinateInPath:zwe,parseFontSize:ip,InitIDGenerator:c3t},d3t=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),N0=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),d6=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function ro(t){return t??null}x(ro,"handleUndefinedAttr");function zwe(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(zwe,"isLabelCoordinateInPath");var X4=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function TQ(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=He().fontSize?He().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=An.fontSize]=ip(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(TQ,"configureLabelImages");const f3t=Object.freeze({left:0,top:0,width:16,height:16}),UL=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Vwe=Object.freeze({...f3t,...UL}),p3t=Object.freeze({...Vwe,body:"",hidden:!1}),g3t=Object.freeze({width:null,height:null}),m3t=Object.freeze({...g3t,...UL}),U3t=(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 N$(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 N$(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return N$(o,r)?o:null}return null},N$=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function y3t(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 khe(t,e){const r=y3t(t,e);for(const n in p3t)n in UL?n in t&&!(n in r)&&(r[n]=UL[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function b3t(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 She(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=khe(n[o]||i[o],a)}return s(e),r.forEach(s),khe(t,a)}function v3t(t,e){if(t.icons[e])return She(t,e,[]);const r=b3t(t,[e])[e];return r?She(t,e,r):null}const x3t=/(-?[0-9.]*[0-9]+[0-9.]*)/g,w3t=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ehe(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(x3t);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=w3t.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 T3t(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 C3t(t,e){return t?""+t+""+e:e}function k3t(t,e,r){const n=T3t(t);return C3t(n.defs,e+n.content+r)}const S3t=t=>t==="unset"||t==="undefined"||t==="none";function E3t(t,e){const r={...Vwe,...t},n={...m3t,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const U=[],y=m.hFlip,b=m.vFlip;let v=m.rotate;y?b?v+=2:(U.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),U.push("scale(-1 1)"),i.top=i.left=0):b&&(U.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),U.push("scale(1 -1)"),i.top=i.left=0);let w;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:w=i.height/2+i.top,U.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:U.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,U.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")")}v%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),U.length&&(a=k3t(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=Ehe(d,l/u)):(h=s==="auto"?l:s,d=o===null?Ehe(h,u/l):o==="auto"?u:o);const f={},p=(m,U)=>{S3t(U)||(f[m]=U.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 A3t=/\sid="(\S+)"/g,Ahe=new Map;function M3t(t){t=t.replace(/[0-9]+$/,"")||"a";const e=Ahe.get(t)||0;return Ahe.set(t,e+1),e?`${t}${e}`:t}function R3t(t){const e=[];let r;for(;r=A3t.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=M3t(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 L3t(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 Hwe={body:'?',height:80,width:80},dW=new Map,Gwe=new Map,CQ=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(de.debug("Registering icon pack:",e.name),"loader"in e)Gwe.set(e.name,e.loader);else if("icons"in e)dW.set(e.name,e.icons);else throw de.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Wwe=x(async(t,e)=>{const r=U3t(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=dW.get(n);if(!i){const s=Gwe.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},dW.set(n,i)}catch(o){throw de.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=v3t(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),I3t=x(async t=>{try{return await Wwe(t),!0}catch{return!1}},"isIconAvailable"),D0=x(async(t,e,r)=>{let n;try{n=await Wwe(t,e==null?void 0:e.fallbackPrefix)}catch(s){de.error(s),n=Hwe}const i=E3t(n,e),a=L3t(R3t(i.body),{...i.attributes,...r});return Dn(a,xr())},"getIconSVG");function kQ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A5=kQ();function qwe(t){A5=t}var Wx={exec:()=>null};function li(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 N3t=(()=>{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")},D3t=/^(?:[ \t]*(?:\n|$))+/,O3t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_3t=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ok=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,P3t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,SQ=/(?:[*+-]|\d{1,9}[.)])/,jwe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ywe=li(jwe).replace(/bull/g,SQ).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(),B3t=li(jwe).replace(/bull/g,SQ).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(),EQ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$3t=/^[^\n]+/,AQ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F3t=li(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",AQ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),z3t=li(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,SQ).getRegex(),vO="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",MQ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,V3t=li("^ {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",MQ).replace("tag",vO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xwe=li(EQ).replace("hr",ok).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",vO).getRegex(),H3t=li(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xwe).getRegex(),RQ={blockquote:H3t,code:O3t,def:F3t,fences:_3t,heading:P3t,hr:ok,html:V3t,lheading:Ywe,list:z3t,newline:D3t,paragraph:Xwe,table:Wx,text:$3t},Mhe=li("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ok).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",vO).getRegex(),G3t={...RQ,lheading:B3t,table:Mhe,paragraph:li(EQ).replace("hr",ok).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mhe).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",vO).getRegex()},W3t={...RQ,html:li(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",MQ).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:Wx,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:li(EQ).replace("hr",ok).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ywe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q3t=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,j3t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Kwe=/^( {2,}|\\)\n(?!\s*$)/,Y3t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",N3t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qwe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Q3t=li(Qwe,"u").replace(/punct/g,xO).getRegex(),ext=li(Qwe,"u").replace(/punct/g,Jwe).getRegex(),eTe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",txt=li(eTe,"gu").replace(/notPunctSpace/g,Zwe).replace(/punctSpace/g,LQ).replace(/punct/g,xO).getRegex(),rxt=li(eTe,"gu").replace(/notPunctSpace/g,Z3t).replace(/punctSpace/g,K3t).replace(/punct/g,Jwe).getRegex(),nxt=li("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zwe).replace(/punctSpace/g,LQ).replace(/punct/g,xO).getRegex(),ixt=li(/\\(punct)/,"gu").replace(/punct/g,xO).getRegex(),axt=li(/^<(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(),sxt=li(MQ).replace("(?:-->|$)","-->").getRegex(),oxt=li("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",sxt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yL=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,lxt=li(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yL).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tTe=li(/^!?\[(label)\]\[(ref)\]/).replace("label",yL).replace("ref",AQ).getRegex(),rTe=li(/^!?\[(ref)\](?:\[\])?/).replace("ref",AQ).getRegex(),cxt=li("reflink|nolink(?!\\()","g").replace("reflink",tTe).replace("nolink",rTe).getRegex(),Rhe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,IQ={_backpedal:Wx,anyPunctuation:ixt,autolink:axt,blockSkip:J3t,br:Kwe,code:j3t,del:Wx,emStrongLDelim:Q3t,emStrongRDelimAst:txt,emStrongRDelimUnd:nxt,escape:q3t,link:lxt,nolink:rTe,punctuation:X3t,reflink:tTe,reflinkSearch:cxt,tag:oxt,text:Y3t,url:Wx},uxt={...IQ,link:li(/^!?\[(label)\]\((.*?)\)/).replace("label",yL).getRegex(),reflink:li(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yL).getRegex()},fW={...IQ,emStrongRDelimAst:rxt,emStrongLDelim:ext,url:li(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Rhe).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:li(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Lhe=t=>dxt[t];function od(t,e){if(e){if(Il.escapeTest.test(t))return t.replace(Il.escapeReplace,Lhe)}else if(Il.escapeTestNoEncode.test(t))return t.replace(Il.escapeReplaceNoEncode,Lhe);return t}function Ihe(t){try{t=encodeURI(t).replace(Il.percentDecode,"%")}catch{return null}return t}function Nhe(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 Dhe(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 pxt(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 bL=class{constructor(e){wr(this,"options");wr(this,"rules");wr(this,"lexer");this.options=e||A5}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:G9(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=pxt(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=G9(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:G9(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=G9(r[0],` `).split(` -`),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u0;){let o=!1,l=[],u;for(u=0;u1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=a.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` +`),U=this.list(m);s[s.length-1]=U,i=i.substring(0,i.length-p.raw.length)+U.raw,a=a.substring(0,a.length-g.raw.length)+U.raw,n=m.substring(s.at(-1).raw.length).split(` +`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),p=e.split(` `,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+` -`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),T=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let k=e.split(` -`,1)[0],E;if(p=k,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),T.test(p)||C.test(p)||S.test(p)||b.test(p)||x.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=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)||C.test(f)||x.test(f))break;d+=` -`+p}!g&&!p.trim()&&(g=!0),h+=k+` -`,e=e.substring(k.length+1),f=E.slice(m)}}s.loose||(o?s.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,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let u=0;uf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let u=0;u({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}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 a=VC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Bkt(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=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)),The(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.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," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return The(n,s,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 s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+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,s+i.index+d+o);if(Math.min(s,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),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(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,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,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}}}},hh=class oq{constructor(e){wr(this,"tokens");wr(this,"options");wr(this,"state");wr(this,"tokenizer");wr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Sv,this.options.tokenizer=this.options.tokenizer||new gL,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:N8.normal,inline:zC.normal};this.options.pedantic?(r.block=N8.pedantic,r.inline=zC.pedantic):this.options.gfm&&(r.block=N8.gfm,this.options.breaks?r.inline=zC.breaks:r.inline=zC.gfm),this.tokenizer.rules=r}static get rules(){return{block:N8,inline:zC}}static lex(e,r){return new oq(r).lex(e)}static lexInline(e,r){return new oq(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+=` +`,e=e.substring(p.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(m),v=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),T=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(` +`,1)[0],S;if(p=C,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),S=p):S=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||T.test(p)||k.test(p)||b.test(p)||v.test(p))break;if(S.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=` +`+S.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||T.test(f)||v.test(f))break;d+=` +`+p}!g&&!p.trim()&&(g=!0),h+=C+` +`,e=e.substring(C.length+1),f=S.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let U=null,y;this.options.gfm&&(U=this.rules.other.listIsTask.exec(d),U&&(y=U[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!U,checked:y,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=G9(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=fxt(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)),Dhe(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 Dhe(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}}}},hh=class pW{constructor(e){wr(this,"tokens");wr(this,"options");wr(this,"state");wr(this,"tokenizer");wr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A5,this.options.tokenizer=this.options.tokenizer||new bL,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:_S.normal,inline:H9.normal};this.options.pedantic?(r.block=_S.pedantic,r.inline=H9.pedantic):this.options.gfm&&(r.block=_S.gfm,this.options.breaks?r.inline=H9.breaks:r.inline=H9.gfm),this.tokenizer.rules=r}static get rules(){return{block:_S,inline:H9}}static lex(e,r){return new pW(r).lex(e)}static lexInline(e,r){return new pW(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(` `)?"":` `)+o.raw,u.text+=` `+o.text,this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(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(` `)?"":` `)+o.raw,u.text+=` -`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(` +`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+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 s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-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 a=!1,o="";for(;e;){a||(o=""),a=!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(b=>{v=b.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)),a=!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}},mL=class{constructor(e){wr(this,"options");wr(this,"parser");this.options=e||Sv}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(Il.notSpaceStart))==null?void 0:a[0],s=e.replace(Il.endingNewline,"")+` -`;return i?'
'+(n?s:ad(s,!0))+`
-`:"
"+(n?s:ad(s,!0))+`
+`+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,U=e.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},U),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),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}},vL=class{constructor(e){wr(this,"options");wr(this,"parser");this.options=e||A5}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:od(a,!0))+`
+`:"
"+(n?a:od(a,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
-`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o -`+i+" -`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+ad(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • +`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o +`+i+" +`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+od(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    -`}table(e){let r="",n="";for(let s=0;s${i}`),` +`}table(e){let r="",n="";for(let a=0;a${i}`),`
    `+r+` `+i+`
    `}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`${ad(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),s=xhe(e);if(s===null)return i;e=s;let a='
    ",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=xhe(e);if(s===null)return ad(n);e=s;let a=`${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(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new mL(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new gL(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Ok;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];Ok.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&Ok.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return hh.lex(e,r??this.defaults)}parser(e,r){return dh.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():e?hh.lex:hh.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?dh.parse:dh.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer():e?hh.lex:hh.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?dh.parse:dh.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+ad(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},Qy=new zkt;function bi(t,e){return Qy.parse(t,e)}bi.options=bi.setOptions=function(t){return Qy.setOptions(t),bi.defaults=Qy.defaults,PEe(bi.defaults),bi};bi.getDefaults=vJ;bi.defaults=Sv;bi.use=function(...t){return Qy.use(...t),bi.defaults=Qy.defaults,PEe(bi.defaults),bi};bi.walkTokens=function(t,e){return Qy.walkTokens(t,e)};bi.parseInline=Qy.parseInline;bi.Parser=dh;bi.parser=dh.parse;bi.Renderer=mL;bi.TextRenderer=EJ;bi.Lexer=hh;bi.lexer=hh.lex;bi.Tokenizer=gL;bi.Hooks=Ok;bi.parse=bi;bi.options;bi.setOptions;bi.use;bi.walkTokens;bi.parseInline;dh.parse;hh.lex;function jEe(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${od(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=Ihe(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=Ihe(e);if(a===null)return od(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 vL(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 bL(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 P3;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];P3.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&P3.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 hh.lex(e,r??this.defaults)}parser(e,r){return dh.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?hh.lex:hh.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?dh.parse:dh.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?hh.lex:hh.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?dh.parse:dh.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:

    "+od(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},t5=new gxt;function vi(t,e){return t5.parse(t,e)}vi.options=vi.setOptions=function(t){return t5.setOptions(t),vi.defaults=t5.defaults,qwe(vi.defaults),vi};vi.getDefaults=kQ;vi.defaults=A5;vi.use=function(...t){return t5.use(...t),vi.defaults=t5.defaults,qwe(vi.defaults),vi};vi.walkTokens=function(t,e){return t5.walkTokens(t,e)};vi.parseInline=t5.parseInline;vi.Parser=dh;vi.parser=dh.parse;vi.Renderer=vL;vi.TextRenderer=NQ;vi.Lexer=hh;vi.lexer=hh.lex;vi.Tokenizer=bL;vi.Hooks=P3;vi.parse=vi;vi.options;vi.setOptions;vi.use;vi.walkTokens;vi.parseInline;dh.parse;hh.lex;function nTe(t){for(var e=[],r=1;r/g,` +`)),s+=d+n[l+1]}),s}function iTe(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return jEe(n)}w(YEe,"preprocessMarkdown");function XEe(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(XEe,"nonMarkdownToLines");function KEe(t,e={}){const r=YEe(t,e),n=bi.lexer(r),i=[[]];let s=0;function a(o,l="normal"){o.type==="text"?o.text.split(` -`).forEach((h,d)=>{d!==0&&(s++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[s].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{a(u,o.type)}):o.type==="html"&&i[s].push({content:o.text,type:"normal"})}return w(a,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{a(u)}):o.type==="html"?i[s].push({content:o.text,type:"normal"}):i[s].push({content:o.raw,type:"normal"})}),i}w(KEe,"markdownToLines");function ZEe(t){return t?`

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

    `:""}w(ZEe,"nonMarkdownToHTML");function QEe(t,{markdownAutoWrap:e}={}){const r=bi.lexer(t);function n(i){var s,a,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"
    ").replace(/ /g," "):i.text.replace(/\n */g,"
    "):i.type==="strong"?`${(s=i.tokens)==null?void 0:s.map(n).join("")}`:i.type==="em"?`${(a=i.tokens)==null?void 0:a.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:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return w(n,"output"),r.map(n).join("")}w(QEe,"markdownToHTML");function JEe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}w(JEe,"splitTextToChars");function e6e(t,e){const r=JEe(e.content);return AJ(t,[],r,e.type)}w(e6e,"splitWordToFitWidth");function AJ(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...s]=r,a=[...e,i];return t([{content:a.join(""),type:n}])?AJ(t,a,s,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}w(AJ,"splitWordToFitWidthRecursion");function t6e(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return yL(t,e)}w(t6e,"splitLineToFitWidth");function yL(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 s=t.shift()??{content:" ",type:"normal"},a=[...n];if(i!==""&&a.push({content:i,type:"normal"}),a.push(s),e(a))return yL(t,e,r,a);if(n.length>0)r.push(n),t.unshift(s);else if(s.content){const[o,l]=e6e(e,s);r.push([o]),l.content&&t.unshift(l)}return yL(t,e,r)}w(yL,"splitLineToFitWidthRecursion");function cq(t,e){e&&t.attr("style",e)}w(cq,"applyStyle");var Che=16384;async function r6e(t,e,r,n,i=!1,s=xr()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,Che)}px`),a.attr("height",`${Math.min(10*r,Che)}px`);const o=a.append("xhtml:div"),l=ea(e.label)?await rD(e.label.replace(Gt.lineBreakRegex,` -`),s):Nn(e.label,s),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),cq(h,e.labelStyle),h.attr("class",`${u} ${n}`),cq(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()),a.node()}w(r6e,"addHtmlSpan");function bD(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(bD,"createTspan");function n6e(t,e,r){const n=t.append("text"),i=bD(n,1,e);xD(i,r);const s=i.node().getComputedTextLength();return n.remove(),s}w(n6e,"computeWidthOfText");function i6e(t,e,r){var a;const n=t.append("text"),i=bD(n,1,e);xD(i,[{content:r,type:"normal"}]);const s=(a=i.node())==null?void 0:a.getBoundingClientRect();return s&&n.remove(),s}w(i6e,"computeDimensionOfText");function s6e(t,e,r,n=!1,i=!1){const a=e.append("g"),o=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=w(p=>n6e(a,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:t6e(h,d);for(const p of f){const g=bD(l,u,1.1,i);xD(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),a.node()}else return l.node()}w(s6e,"createFormattedText");function uq(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(uq,"decodeHTMLEntities");function xD(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(uq(r.content)):i.text(" "+uq(r.content))})}w(xD,"updateTextContentAndStyles");async function a6e(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,s,a)=>(r.push((async()=>{const o=`${s}:${a}`;return await nkt(o)?await N0(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(a6e,"replaceIconSubstring");var ll=w(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:s=!0,markdown:a=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(de.debug("XYZ createText",e,r,n,i,s,o,"addSvgBackground: ",u),s){const d=a?QEe(e,h):ZEe(e),f=await a6e(I0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:ea(e)?p:f,labelStyle:r.replace("fill:","color:")};return await r6e(t,g,l,i,u,h)}else{const d=I0(e.replace(//g,"
    ")),f=a?KEe(d.replace("
    ","
    "),h):XEe(d),p=s6e(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:");xt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");xt(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:");xt(p).select("text").attr("style",m)}return n?xt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):xt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function RF(t,e,r){if(t&&t.length){const[n,i]=e,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const l of t){const[u,h]=l;l[0]=(u-n)*a-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*a+i}}}function Vkt(t,e){return t[0]===e[0]&&t[1]===e[1]}function Hkt(t,e,r,n=1){const i=r,s=Math.max(e,.1),a=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of a)RF(u,o,i);const l=(function(u,h,d){const f=[];for(const b of u){const x=[...b];Vkt(x[0],x[x.length-1])||x.push([x[0][0],x[0][1]]),x.length>2&&f.push(x)}const p=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let x=0;xb.yminx.ymin?1:b.xx.x?1:b.ymax===x.ymax?0:(b.ymax-x.ymax)/Math.abs(b.ymax-x.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let x=0;xy);x++)b=x;g.splice(0,b+1).forEach((x=>{m.push({s:y,edge:x})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,x)=>b.edge.x===x.edge.x?0:(b.edge.x-x.edge.x)/Math.abs(b.edge.x-x.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let b=0;b=m.length)break;const T=m[b].edge,C=m[x].edge;p.push([[Math.round(T.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),v++}return p})(a,s,n);if(i){for(const u of a)RF(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),RF(f,h,d)})(l,o,-i)}return l}function i7(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 s=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=i),Hkt(t,i,n,s||1)}class MJ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=i7(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 wD(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 Gkt=class extends MJ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=i7(e,Object.assign({},r,{hachureGap:n})),s=Math.PI/180*r.hachureAngle,a=[],o=.5*n*Math.cos(s),l=.5*n*Math.sin(s);for(const[u,h]of i)wD([u,h])&&a.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}};class Wkt extends MJ{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(e,i);return n.ops=n.ops.concat(s.ops),n}}let qkt=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=i7(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 s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=i/4;for(const o of e){const l=wD(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=wD(a),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const a=wD(s),o=Math.round(a/(2*r));let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;dh%2?u+r:u+e));s.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":s.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));s.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.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));s.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,r=i}return s}function l6e(t){const e=[];let r="",n=0,i=0,s=0,a=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,[s,a]=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,b=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,b,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,b=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,b,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)&&(c6e(n,i,y,v,d,f,p,g,m).forEach((function(b){e.push({key:"C",data:b})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=s,i=a}r=u}return e}function HC(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function c6e(t,e,r,n,i,s,a,o,l,u){const h=(d=a,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]=HC(t,e,-h),[r,n]=HC(r,n,-h);const N=(t-r)/2,L=(e-n)/2;let I=N*N/(i*i)+L*L/(s*s);I>1&&(I=Math.sqrt(I),i*=I,s*=I);const $=i*i,O=s*s,D=$*O-$*L*L-O*N*N,B=$*L*L+O*N*N,z=(o===l?-1:1)*Math.sqrt(Math.abs(D/B));m=z*i*L/s+(t+r)/2,y=z*-s*N/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/s).toFixed(9))),g=Math.asin(parseFloat(((n-y)/s).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,L=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=c6e(r=m+i*Math.cos(g),n=y+s*Math.sin(g),L,I,i,s,a,0,l,[g,N,m,y])}v=g-p;const b=Math.cos(p),x=Math.sin(p),T=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*s*S,A=[t,e],M=[t+k*x,e-E*b],R=[r+k*C,n-E*T],P=[r,n];if(M[0]=2*A[0]-M[0],M[1]=2*A[1]-M[1],u)return[M,R,P].concat(f);{f=[M,R,P].concat(f);const N=[];for(let L=0;L2){const i=[];for(let s=0;s2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=_he(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=_he(y,u,h,d,f,p,g,1.5,l);v.push(...b)}return a&&(o?v.push(...Vg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Vg(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 Ahe(t,e){const r=l6e(o6e(RJ(t))),n=[];let i=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...Vg(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...Qkt(l,u,h,d,f,p,s,e)),s=[f,p];break}case"Z":n.push(...Vg(s[0],s[1],i[0],i[1],e)),s=[i[0],i[1]]}return{type:"path",ops:n}}function IF(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,s=n.length;if(s>2){r.push({op:"move",data:[n[0][0]+en(i,e),n[0][1]+en(i,e)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*d6e(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=en(p,i,u),g=en(g,i,u);const m=[],y=()=>en(d,i,u),v=()=>en(h,i,u),b=i.preserveVertices;return a?m.push({op:"move",data:[t+(b?0:y()),e+(b?0:y())]}):m.push({op:"move",data:[t+(b?0:en(h,i,u)),e+(b?0:en(h,i,u))]}),a?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+(b?0:y()),n+(b?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+(b?0:v()),n+(b?0:v())]}),m}function D8(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]),n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]);for(let i=1;i3){const s=[],a=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=y1(l,u,.5),p=y1(u,h,.5),g=y1(h,d,.5),m=y1(f,p,.5),y=y1(p,g,.5),v=y1(m,y,.5);fq([l,f,m,v],0,r,i),fq([v,y,g,d],0,r,i)}var s,a;return i}function eSt(t,e){return xL(t,0,t.length,e)}function xL(t,e,r,n,i){const s=i||[],a=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?(xL(t,e,u+1,n,s),xL(t,u,r,n,s)):(s.length||s.push(a),s.push(o)),s}function NF(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let s=0;s0?xL(n,0,n.length,r):n}const Dc="none";let wL=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,s){const a=this._o(s);return this._d("line",[u6e(e,r,n,i,a)],a)}rectangle(e,r,n,i,s){const a=this._o(s),o=[],l=Zkt(e,r,n,i,a);if(a.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];a.fillStyle==="solid"?o.push(IF([u],a)):o.push(g2([u],a))}return a.stroke!==Dc&&o.push(l),this._d("rectangle",o,a)}ellipse(e,r,n,i,s){const a=this._o(s),o=[],l=h6e(n,i,a),u=hq(e,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=hq(e,r,a,l).opset;h.type="fillPath",o.push(h)}else o.push(g2([u.estimatedPoints],a));return a.stroke!==Dc&&o.push(u.opset),this._d("ellipse",o,a)}circle(e,r,n,i){const s=this.ellipse(e,r,n,n,i);return s.shape="circle",s}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[BR(e,!1,n)],n)}arc(e,r,n,i,s,a,o=!1,l){const u=this._o(l),h=[],d=Ehe(e,r,n,i,s,a,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=Ehe(e,r,n,i,s,a,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,b){const x=f,T=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=en(.01*C,b),S+=en(.01*S,b);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const A=(E-k)/b.curveStepCount,M=[];for(let R=k;R<=E;R+=A)M.push([x+C*Math.cos(R),T+S*Math.sin(R)]);return M.push([x+C*Math.cos(E),T+S*Math.sin(E)]),M.push([x,T]),g2([M],b)})(e,r,n,i,s,a,u));return u.stroke!==Dc&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],s=She(e,n);if(n.fill&&n.fill!==Dc)if(n.fillStyle==="solid"){const a=She(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?a.push(...u):u.length===3?a.push(...NF(Lhe([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):a.push(...NF(Lhe(u),10,(1+n.roughness)/2))}a.length&&i.push(g2([a],n))}return n.stroke!==Dc&&i.push(s),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],s=BR(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(IF([e],n)):i.push(g2([e],n))),n.stroke!==Dc&&i.push(s),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 s=n.fill&&n.fill!=="transparent"&&n.fill!==Dc,a=n.stroke!==Dc,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=l6e(o6e(RJ(h))),g=[];let m=[],y=[0,0],v=[];const b=()=>{v.length>=4&&m.push(...NF(v,d)),v=[]},x=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":x(),y=[S[0],S[1]],m.push(y);break;case"L":b(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(x(),!f)return g;const T=[];for(const C of g){const S=eSt(C,f);S.length&&T.push(S)}return T})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=Ahe(e,n);if(s)if(n.fillStyle==="solid")if(l.length===1){const h=Ahe(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(IF(l,n));else i.push(g2(l,n));return a&&(o?l.forEach((h=>{i.push(BR(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const s=typeof r=="number"&&r>=0?i.data.map((a=>+a.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":n+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":n+=`L${s[0]} ${s[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Dc};break;case"fillPath":a={d:this.opsToPath(s),stroke:Dc,strokeWidth:0,fill:n.fill||Dc};break;case"fillSketch":a=this.fillSketch(s,n)}a&&i.push(a)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Dc,strokeWidth:n,fill:Dc}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}};class tSt{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new wL(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.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,a,s),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,a,s,o),i.restore();break}case"fillSketch":this.fillSketch(i,a,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 s of r.ops){const a=typeof n=="number"&&n>=0?s.data.map((o=>+o.toFixed(n))):s.data;switch(s.op){case"move":e.moveTo(a[0],a[1]);break;case"bcurveTo":e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":e.lineTo(a[0],a[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a),a}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a),a}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a),a}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s),s}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,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,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 P8="http://www.w3.org/2000/svg";class rSt{constructor(e,r){this.svg=e,this.gen=new wL(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,s=i.createElementNS(P8,"g"),a=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(P8,"path"),l.setAttribute("d",this.opsToPath(o,a)),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(P8,"path"),l.setAttribute("d",this.opsToPath(o,a)),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&&s.appendChild(l)}return s}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const s=e.createElementNS(P8,"path");return s.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),s.setAttribute("stroke",n.fill||""),s.setAttribute("stroke-width",i+""),s.setAttribute("fill","none"),n.fillLineDash&&s.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,s){const a=this.gen.line(e,r,n,i,s);return this.draw(a)}rectangle(e,r,n,i,s){const a=this.gen.rectangle(e,r,n,i,s);return this.draw(a)}ellipse(e,r,n,i,s){const a=this.gen.ellipse(e,r,n,i,s);return this.draw(a)}circle(e,r,n,i){const s=this.gen.circle(e,r,n,i);return this.draw(s)}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,s,a,o=!1,l){const u=this.gen.arc(e,r,n,i,s,a,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 dr={canvas:(t,e)=>new tSt(t,e),svg:(t,e)=>new rSt(t,e),generator:t=>new wL(t),newSeed:()=>wL.newSeed()},Qr=w(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||sf((p=He())==null?void 0:p.htmlLabels);r?n=r:n="node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",ro(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 ll(a,Nn(I0(o),He()),{useHtmlLabels:i,width:e.width||((g=He().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},He());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=xt(h);await mJ(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),OF=w(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??yi(He()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await ll(i,Nn(I0(e),He()),{useHtmlLabels:n,width:r.width||((u=(l=He())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(yi(He())){const h=s.children[0],d=xt(s);a=h.getBoundingClientRect(),d.attr("width",a.width),d.attr("height",a.height)}return n?i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):i.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:a,halfPadding:o,label:i}},"insertLabel"),Tr=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),qr=w((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Hn(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}w(Hn,"createPathFromPoints");function Hg(t,e,r,n,i,s){const a=[],l=r-t,u=n-e,h=l/s,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));a.push({x:m,y})}return a}w(Hg,"generateFullSineWavePoints");function m6(t,e,r,n,i,s){const a=[],o=i*Math.PI/180,h=(s*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"),s=e.find(l=>l.getAttribute("stroke")!=="none"),a=w((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:a(i,"fill"),"fill-opacity":a(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"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(pq,"mergePaths");var nSt=w((t,e)=>{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),Ev=nSt,iSt=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=He(),o=yi(a);return await ll(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),cg=iSt,Cm=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"),sSt=w(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,o=a,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=cr(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=sf(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await ll(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const N=y.children[0],L=xt(y);v=N.getBoundingClientRect(),L.attr("width",v.width),L.attr("height",v.height)}const b=e.padding??0,x=e.width<=v.width+b?v.width+b:e.width;e.width<=v.width+b?e.diff=(x-e.width)/2-b:e.diff=-b;const T=e.height,C=e.y-T/2,S=e.y+T/2,k=e.x-x/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+T/3,A=g?4:0,M=v.height+2*A;let R,P;if(g){const N=Math.max(M,v.height+2*A),L=k+N,I=Math.max(0,x-N);if(e.look==="handDrawn"){const D=dr.svg(f),B=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),z=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=D.rectangle(k,C,N,T,B);R=f.insert(()=>V,":first-child");const F=D.rectangle(L,C,I,T,z);P=f.insert(()=>F,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",N).attr("height",T).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",L).attr("y",C).attr("width",I).attr("height",T).attr("fill","none").attr("stroke",o);const $=k+N/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const N=Math.max(0,E-C),L=Math.min(M,N),I=C+L,$=Math.max(0,S-I),O=e.x-x/2;if(e.look==="handDrawn"){const z=dr.svg(f),V=fr(e,{roughness:.7,fill:s,stroke:o,fillWeight:3,seed:i}),F=fr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),H=z.rectangle(O,C,x,L,V);R=f.insert(()=>H,":first-child");const G=z.rectangle(O,I,x,$,F);P=f.insert(()=>G,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",x).attr("height",L).attr("fill",s).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",x).attr("height",$).attr("fill","none").attr("stroke",o);const D=e.x-v.width/2,B=C+(L-v.height)/2;m.attr("transform",`translate(${D}, ${B})`)}if(de.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=x,e.height=T,e.offsetY=v.height-b/2,e.intersect=function(N){return Ev(e,N)},{cluster:f,labelBBox:v}},"swimlane"),f6e=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=yi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ll(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await cg(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(yi(r)){const k=g.children[0],E=xt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,b=e.x-y/2,x=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:i}),A=k.path(Cm(b,x,y,v,0),E);T=d.insert(()=>(de.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",b).attr("y",x).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=U3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=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(k){return Ev(e,k)},{cluster:d,labelBBox:m}},"rect"),aSt=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,s=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const a=n.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(o){return Ev(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),oSt=w(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:s,compositeBackground:a,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 cg(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(yi(r)){const A=p.children[0],M=xt(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 b=e.height+m,x=e.height+m-g.height-6,T=e.x-v/2,C=e.y-b/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const A=e.cssClasses.includes("statediagram-cluster-alt"),M=dr.svg(u),R=e.rx||e.ry?M.path(Cm(T,C,v,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(T,C,v,b,{seed:i});k=u.insert(()=>R,":first-child");const P=M.rectangle(T,S,v,x,{fill:A?s:a,fillStyle:A?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>R,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",T).attr("y",C).attr("width",v).attr("height",b).attr("data-look",e.look),f.attr("class","inner").attr("x",T).attr("y",S).attr("width",v).attr("height",x);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(yi(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(A){return Ev(e,A)},{cluster:u,labelBBox:g}},"roundedWithTitle"),lSt=w(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:s,clusterBorder:a}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=cr(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=yi(r),p=d.insert("g").attr("class","cluster-label "),g=await ll(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(yi(r)){const k=g.children[0],E=xt(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,b=e.x-y/2,x=e.y-v/2;de.trace("Data ",e,JSON.stringify(e));let T;if(e.look==="handDrawn"){const k=dr.svg(d),E=fr(e,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:i}),A=k.path(Cm(b,x,y,v,e.rx),E);T=d.insert(()=>(de.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",b).attr("y",x).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=U3(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=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(k){return Ev(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),cSt=w((t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:s}=n,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=a.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=dr.svg(a).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:i});p=a.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 Ev(e,m)},{cluster:a,labelBBox:{}}},"divider"),uSt=f6e,hSt={rect:f6e,squareRect:uSt,roundedWithTitle:oSt,noteGroup:aSt,divider:cSt,kanbanSection:lSt,swimlane:sSt},p6e=new Map,TD=w(async(t,e)=>{const r=e.shape||"rect",n=await hSt[r](t,e);return p6e.set(e.id,n),n},"insertCluster"),g6e=w(()=>{p6e=new Map},"clear");function m6e(t,e){return t.intersect(e)}w(m6e,"intersectNode");var dSt=m6e;function y6e(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(gq,"sameSign");var pSt=x6e;function w6e(t,e,r){let n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){a=Math.min(a,h.x),o=Math.min(o,h.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));let l=n-t.width/2-a,u=i-t.height/2-o;for(let h=0;h1&&s.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",ro(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,a,f),or.circle(e,a,f)},s}w(T6e,"anchor");function mq(t,e,r,n,i,s,a){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/s,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*s*Math.sin(h)*(a?-1:1),b=u-y*i*Math.cos(h)*(a?-1:1),x=Math.atan2((e-b)/s,(t-v)/i);let C=Math.atan2((n-b)/s,(r-v)/i)-x;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,A=x+E*C,M=v+i*Math.cos(A),R=b+s*Math.sin(A);S.push({x:M,y:R})}return S}w(mq,"generateArcPoints");function C6e(t,e,r){const[n,i]=[e,r].sort((s,a)=>a-s);return i*(1-Math.sqrt(1-(t/n/2)**2))}w(C6e,"calculateArcSagitta");async function k6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=w(A=>A+a,"calcTotalHeight"),l=w(A=>{const M=A/2;return[M/(2.5+A/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Qr(t,e,qr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=C6e(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+s*2+g-g,v=d,{cssStyles:b}=e,x=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...mq(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...mq(y/2,v/2,y/2,-v/2,f,p,!0)],T=dr.svg(u),C=fr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Hn(x),k=T.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Tr(e,E),e.intersect=function(A){return or.polygon(e,x,A)},u}w(k6e,"bowTieRect");function ip(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(ip,"insertPolygonShape");var $8=12;async function S6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?28:i,a=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s+$8),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),d=0,f=u,p=-h,g=0,m=[{x:d+$8,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+$8},{x:d+$8,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const b=dr.svg(o),x=fr(e,{}),T=Hn(m),C=b.path(T,x);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=ip(o,u,h,m);return n&&y.attr("style",n),Tr(e,y),e.intersect=function(b){return or.polygon(e,m,b)},o}w(S6e,"card");function E6e(t,e){const{nodeStyles:r}=cr(e);e.label="";const n=t.insert("g").attr("class",qr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,s=Math.max(28,e.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=dr.svg(n),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Hn(a),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 or.polygon(e,a,f)},n}w(E6e,"choice");async function _J(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a,halfPadding:o}=await Qr(t,e,qr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?a.width/2+l*2:a.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=dr.svg(s),g=fr(e,{}),m=p.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",ro(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Tr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return or.circle(p,m,g)},e.intersect=function(p){return de.info("Circle intersect",e,h,p),or.circle(e,h,p)},s}w(_J,"circle");function A6e(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},s={x:-(n/2)*e,y:n/2*r},a={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${s.x},${s.y} L ${o.x},${o.y} - M ${i.x},${i.y} L ${a.x},${a.y}`}w(A6e,"createLine");function M6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",qr(e)).attr("id",e.domId??e.id),s=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:a}=e,o=dr.svg(i),l=fr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,s*2,l),h=A6e(s),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Tr(e,f),e.intersect=function(p){return de.info("crossedCircle intersect",e,{radius:s,point:p}),or.circle(e,s,p)},i}w(M6e,"crossedCircle");function $f(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>x,":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)`),a.attr("transform",`translate(${-u/2+d-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(R6e,"curlyBraceLeft");function Bf(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dC,":first-child").attr("stroke-opacity",0),S.insert(()=>x,":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)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,g,k)},i}w(_6e,"curlyBraceRight");function vo(t,e,r,n=100,i=0,s=180){const a=[],o=i*Math.PI/180,h=(s*Math.PI/180-o)/(n-1);for(let d=0;dA,":first-child").attr("stroke-opacity",0),M.insert(()=>T,":first-child"),M.insert(()=>k,":first-child"),M.attr("class","text"),f&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-u/2+(e.padding??0)/2-(s.x-(s.left??0))},${-h/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Tr(e,M),e.intersect=function(R){return or.polygon(e,m,R)},i}w(L6e,"curlyBraces");async function I6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await Qr(t,e,qr(e)),d=Math.max(o,(h.width+s*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+a*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,b=f,x=v-p,T=b/4,C=[{x,y:0},{x:T,y:0},{x:0,y:b/2},{x:T,y:b},{x,y:b},...m6(-x,-b/2,p,50,270,90)],S=Hn(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},u}w(I6e,"curvedTrapezoid");var mSt=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),ySt=w((t,e,r,n,i,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),vSt=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Ihe=8,Nhe=8;async function N6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?24:i,a=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-a,e.widthC,":first-child"),g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=mSt(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",ro(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(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=or.rect(e,y),b=v.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let x=f*f*(1-b*b/(d*d));x>0&&(x=Math.sqrt(x)),x=f-x,y.y-(e.y??0)>0&&(x=-x),v.y+=x}return v},o}w(N6e,"cylinder");async function j3(t,e,r){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{shapeSvg:s,bbox:a}=await Qr(t,e,qr(e)),o=Math.max(a.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(a.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=dr.svg(s),y=fr(e,{}),v=f||p?m.path(Cm(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=s.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",ro(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ro(f)).attr("ry",ro(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Tr(e,d),e.calcIntersect=function(m,y){return or.rect(m,y)},e.intersect=function(m){return or.rect(e,m)},s}w(j3,"drawRect");async function O6e(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:s,width:a,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(s??0)*2,labelPaddingY:i??s??0},u=await j3(t,e,l);if(e.look==="handDrawn"){const p=dr.svg(u),g=fr(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"))||a)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}w(O6e,"datastore");async function D6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?16:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,qr(e)),u=o.width+i,h=o.height+s,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=dr.svg(a),y=fr(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}],b=m.polygon(v.map(T=>[T.x,T.y]),y),x=a.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.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))})`),Tr(e,x),e.intersect=function(T){return or.rect(e,T)},a}w(D6e,"dividedRectangle");async function P6e(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?12:5;e.labelStyle=r;const s=e.padding??0,a=e.look==="neo"?16:s,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(a??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=dr.svg(o),y=fr(e,{roughness:.2,strokeWidth:2.5}),v=fr(e,{roughness:.2,strokeWidth:1.5}),b=m.circle(0,0,u*2,y),x=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",ro(e.cssClasses)).attr("style",ro(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(x)}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 Tr(e,d),e.intersect=function(m){return de.info("DoubleCircle intersect",e,u,m),or.circle(e,u,m)},o}w(P6e,"doublecircle");function $6e(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.label="",e.labelStyle=n;const s=t.insert("g").attr("class",qr(e)).attr("id",e.domId??e.id),a=7,{cssStyles:o}=e,l=dr.svg(s),{nodeBorder:u}=r,h=fr(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.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),Tr(e,f),e.intersect=function(p){return de.info("filledCircle intersect",e,{radius:a,point:p}),or.circle(e,a,p)},s}w($6e,"filledCircle");var Ohe=10,Dhe=10;async function B6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=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"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=u,e.height=h,Tr(e,b),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(x){return de.info("Triangle intersect",e,f,x),or.polygon(e,f,x)},a}w(B6e,"flippedTriangle");function F6e(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:s}=cr(e);e.label="";const a=t.insert("g").attr("class",qr(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=dr.svg(a),p=fr(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=a.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Tr(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 or.rect(e,v)},a}w(F6e,"forkJoin");async function z6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=15,s=10,a=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.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Tr(e,x),e.intersect=function(T){return de.info("Pill intersect",e,{radius:f,point:T}),or.polygon(e,y,T)},l}w(z6e,"halfRoundedRectangle");var bSt=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 V6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const s=e.padding??0,a=70,o=32,l=e.look==="neo"?a:s,u=e.look==="neo"?o:s;if(e.width||e.height){const x=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*x-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Qr(t,e,qr(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 b=dr.svg(h),x=fr(e,{}),T=bSt(0,0,g,f,p),C=b.path(T,x);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=ip(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Tr(e,y),e.intersect=function(b){return or.polygon(e,m,b)},h}w(V6e,"hexagon");async function H6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Qr(t,e,qr(e)),s=Math.max(30,(e==null?void 0:e.width)??0),a=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=dr.svg(i),u=fr(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Hn(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(${-s/2}, ${-a/2})`),Tr(e,p),e.intersect=function(g){return de.info("Pill intersect",e,{points:h}),or.polygon(e,h,g)},i}w(H6e,"hourglass");async function G6e(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=q3(e),v=-g/2,b=-p/2,x=e.label?8:0,T=dr.svg(u),C=fr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=T.rectangle(v,b,g,p,C),k=Math.max(g,h.width),E=p+h.height+x,A=T.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),R=u.insert(()=>A);if(e.icon){const P=u.append("g");P.html(`${await N0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=P.node().getBBox(),L=N.width,I=N.height,$=N.x,O=N.y;P.attr("transform",`translate(${-L/2-$},${f?h.height/2+x/2-I/2-O:-h.height/2-x/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),Tr(e,R),e.intersect=function(P){if(de.info("iconSquare intersect",e,P),!e.label)return or.rect(e,P);const N=e.x??0,L=e.y??0,I=e.height??0;let $=[];return f?$=[{x:N-h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2+h.height+x},{x:N+g/2,y:L-I/2+h.height+x},{x:N+g/2,y:L+I/2},{x:N-g/2,y:L+I/2},{x:N-g/2,y:L-I/2+h.height+x},{x:N-h.width/2,y:L-I/2+h.height+x}]:$=[{x:N-g/2,y:L-I/2},{x:N+g/2,y:L-I/2},{x:N+g/2,y:L-I/2+p},{x:N+h.width/2,y:L-I/2+p},{x:N+h.width/2/2,y:L+I/2},{x:N-h.width/2,y:L+I/2},{x:N-h.width/2,y:L-I/2+p},{x:N-g/2,y:L-I/2+p}],or.polygon(e,$,P)},u}w(G6e,"icon");async function W6e(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await Qr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=q3(e),b=dr.svg(u),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const T=v.get("fill");x.stroke=T??y;const C=u.append("g");e.icon&&C.html(`${await N0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const S=C.node().getBBox(),k=S.width,E=S.height,A=S.x,M=S.y,R=Math.max(k,E)*Math.SQRT2+f*2,P=b.circle(0,0,R,x),N=Math.max(R,h.width),L=R+h.height+p,I=b.rectangle(-N/2,-L/2,N,L,{...x,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-A},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-L/2:L/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Tr(e,O),e.intersect=function(D){return de.info("iconSquare intersect",e,D),or.rect(e,D)},u}w(W6e,"iconCircle");async function q6e(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:b}=q3(e),x=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=b.get("fill");k.stroke=E??v;const A=S.path(Cm(x,T,m,g,5),k),M=Math.max(m,h.width),R=g+h.height+C,P=S.rectangle(-M/2,-R/2,M,R,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child").attr("class","icon-shape2"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await N0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,B=$.x,z=$.y;I.attr("transform",`translate(${-O/2-B},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-R/2:R/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let B=[];return p?B=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:B=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,B,I)},u}w(q6e,"iconRounded");async function U6e(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=cr(e);e.labelStyle=i;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await Qr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:b}=q3(e),x=-m/2,T=-g/2,C=e.label?8:0,S=dr.svg(u),k=fr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=b.get("fill");k.stroke=E??v;const A=S.path(Cm(x,T,m,g,.1),k),M=Math.max(m,h.width),R=g+h.height+C,P=S.rectangle(-M/2,-R/2,M,R,{...k,fill:"transparent",stroke:"none"}),N=u.insert(()=>A,":first-child"),L=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`${await N0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const $=I.node().getBBox(),O=$.width,D=$.height,B=$.x,z=$.y;I.attr("transform",`translate(${-O/2-B},${p?h.height/2+C/2-D/2-z:-h.height/2-C/2-D/2-z})`),I.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-R/2:R/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return or.rect(e,I);const $=e.x??0,O=e.y??0,D=e.height??0;let B=[];return p?B=[{x:$-h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2},{x:$+h.width/2,y:O-D/2+h.height+C},{x:$+m/2,y:O-D/2+h.height+C},{x:$+m/2,y:O+D/2},{x:$-m/2,y:O+D/2},{x:$-m/2,y:O-D/2+h.height+C},{x:$-h.width/2,y:O-D/2+h.height+C}]:B=[{x:$-m/2,y:O-D/2},{x:$+m/2,y:O-D/2},{x:$+m/2,y:O-D/2+g},{x:$+h.width/2,y:O-D/2+g},{x:$+h.width/2/2,y:O+D/2},{x:$-h.width/2,y:O+D/2},{x:$-h.width/2,y:O-D/2+g},{x:$-m/2,y:O-D/2+g}],or.polygon(e,B,I)},u}w(U6e,"iconSquare");async function j6e(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","")),s=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;const{labelStyles:a}=cr(e);e.labelStyle=a;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)??s;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await Qr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,b=dr.svg(d),x=fr(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const T=b.rectangle(m,y,u,h,x),C=Math.max(u,f.width),S=h+f.height+v,k=b.rectangle(-C/2,-S/2,C,S,{...x,fill:"none",stroke:"none"}),E=d.insert(()=>T,":first-child"),A=d.insert(()=>k);if(e.img){const M=d.append("image");M.attr("href",e.img),M.attr("width",u),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Tr(e,A),e.intersect=function(M){if(de.info("iconSquare intersect",e,M),!e.label)return or.rect(e,M);const R=e.x??0,P=e.y??0,N=e.height??0;let L=[];return g?L=[{x:R-f.width/2,y:P-N/2},{x:R+f.width/2,y:P-N/2},{x:R+f.width/2,y:P-N/2+f.height+v},{x:R+u/2,y:P-N/2+f.height+v},{x:R+u/2,y:P+N/2},{x:R-u/2,y:P+N/2},{x:R-u/2,y:P-N/2+f.height+v},{x:R-f.width/2,y:P-N/2+f.height+v}]:L=[{x:R-u/2,y:P-N/2},{x:R+u/2,y:P-N/2},{x:R+u/2,y:P-N/2+h},{x:R+f.width/2,y:P-N/2+h},{x:R+f.width/2/2,y:P+N/2},{x:R-f.width/2,y:P+N/2},{x:R-f.width/2,y:P-N/2+h},{x:R-u/2,y:P-N/2+h}],or.polygon(e,L,M)},d}w(j6e,"imageSquare");async function Y6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=Math.max(l.width+(a??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(s??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=dr.svg(o),m=fr(e,{}),y=Hn(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=ip(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(Y6e,"inv_trapezoid");async function X6e(t,e){const{shapeSvg:r,bbox:n,label:i}=await Qr(t,e,"label"),s=r.insert("rect",":first-child");return s.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))})`),Tr(e,s),e.intersect=function(l){return or.rect(e,l)},r}w(X6e,"labelRect");async function K6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,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=dr.svg(o),m=fr(e,{}),y=Hn(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=ip(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(K6e,"lean_left");async function Z6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=i,a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,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=dr.svg(o),m=fr(e,{}),y=Hn(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=ip(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(Z6e,"lean_right");function Q6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",qr(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,a=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:a,y:0},{x:0,y:o+l/2},{x:a-2*l,y:o+l/2},{x:0,y:2*o},{x:a,y:o-l/2},{x:2*l,y:o-l/2}],h=dr.svg(i),d=fr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Hn(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),s&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${a/2},${-o})`),Tr(e,g),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),or.polygon(e,u,m)},i}w(Q6e,"lightningBolt");var xSt=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`a${i},${s} 0,0,0 ${r},0`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),wSt=w((t,e,r,n,i,s,a)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${i},${s} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${s} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+s+a}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),TSt=w((t,e,r,n,i,s)=>[`M${t-r/2},${-n/2}`,`a${i},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Phe=10,$he=10;async function J6e(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-s,e.width<$he&&(e.width=$he);const x=v/2/(2.5+v/50);e.height=(e.height??0)-a-x*3,e.heightS,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=xSt(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",ro(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(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 b=or.rect(e,v),x=b.x-(e.x??0);if(d!=0&&(Math.abs(x)<(e.width??0)/2||Math.abs(x)==(e.width??0)/2&&Math.abs(b.y-(e.y??0))>(e.height??0)/2-f)){let T=f*f*(1-x*x/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,v.y-(e.y??0)>0&&(T=-T),b.y+=T}return b},o}w(J6e,"linedCylinder");async function eAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;if(e.width||e.height){const T=e.width;e.width=(T??0)*10/11-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,qr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(s??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(a??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=dr.svg(o),y=fr(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},...Hg(-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}],b=m.polygon(v.map(T=>[T.x,T.y]),y),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),x.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))})`),Tr(e,x),e.intersect=function(T){return or.polygon(e,v,T)},o}w(eAe,"linedWaveEdgedRect");async function tAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=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)-s*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,qr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+s*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+a*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,b=dr.svg(l),x=fr(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}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=Hn(T);let k=b.path(S,x);const E=Hn(C);let A=b.path(E,x);e.look!=="handDrawn"&&(k=pq(k),A=pq(A));const M=l.insert("g",":first-child");return M.insert(()=>k),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))})`),Tr(e,M),e.intersect=function(R){return or.polygon(e,T,R)},l}w(tAe,"multiRect");async function rAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,qr(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(s.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(s.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:b}=e,x=Hg(m-v,y+g+v,m+d-v,y+g+v,p,.8),T=x==null?void 0:x[x.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...x,{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}],k=dr.svg(i),E=fr(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const A=Hn(C),M=k.path(A,E),R=Hn(S),P=k.path(R,E),N=i.insert(()=>M,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-(s.width/2)-v-(s.x-(s.left??0))}, ${-(s.height/2)+v-p/2-(s.y-(s.top??0))})`),Tr(e,N),e.intersect=function(L){return or.polygon(e,C,L)},i}w(rAe,"multiWaveEdgedRectangle");async function nAe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n,e.useHtmlLabels||yi(xr())||(e.centerLabel=!0);const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,qr(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=dr.svg(a),m=fr(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=a.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))})`),Tr(e,v),e.intersect=function(b){return or.rect(e,b)},a}w(nAe,"note");var CSt=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 iAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,qr(e)),a=s.width+(e.padding??0),o=s.height+(e.padding??0),l=a+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=dr.svg(i),g=fr(e,{}),m=CSt(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=ip(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Tr(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=or.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}w(iAe,"question");async function sAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?21:i??0,a=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,qr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?s*2:s),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?a*2:a),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=dr.svg(o),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=Hn(m),T=v.path(x,b),C=o.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,m,S)},o}w(sAe,"rect_left_inv_arrow");async function aAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await cg(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(yi(He())){const E=h.children[0],A=xt(h);d=E.getBoundingClientRect(),A.attr("width",d.width),A.attr("height",d.height)}de.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await cg(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],y=xt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;xt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),xt(h).attr("transform","translate( "+(d.width(de.debug("Rough node insert CXC",M),R),":first-child"),S=s.insert(()=>(de.debug("Rough node insert CXC",M),M),":first-child")}else S=a.insert("rect",":first-child"),k=a.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Tr(e,S),e.intersect=function(E){return or.rect(e,E)},s}w(aAe,"rectWithTitle");async function oAe(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 j3(t,e,i)}w(oAe,"roundedRect");var Zm=8;async function lAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0,{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?Zm:Zm*2),h=((e==null?void 0:e.height)??o.height)+s*2,d=u-Zm,f=h,p=Zm-u/2,g=-h/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-Zm,y:g+f},{x:p-Zm,y:g},{x:p,y:g},{x:p,y:g+f}],x=y.polygon(b.map(C=>[C.x,C.y]),v),T=a.insert(()=>x,":first-child");return T.attr("class","basic label-container outer-path").attr("style",ro(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(${Zm/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,T),e.intersect=function(C){return or.rect(e,C)},a}w(lAe,"shadedProcess");async function cAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-s*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-a*2,10));const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,qr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=dr.svg(o),b=fr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],T=Hn(x),C=v.path(T,b),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Tr(e,S),e.intersect=function(k){return or.polygon(e,x,k)},o}w(cAe,"slopedRect");async function uAe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return j3(t,e,s)}w(uAe,"squareRect");async function hAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?20:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=l.height+(e.look==="neo"?a*2:a),h=l.width+u/4+(e.look==="neo"?s*2:s),d=u/2,{cssStyles:f}=e,p=dr.svg(o),g=fr(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},...m6(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...m6(h/2-d,0,d,50,270,450)],y=Hn(m),v=p.path(y,g),b=o.insert(()=>v,":first-child");return b.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(x){return or.polygon(e,m,x)},o}w(hAe,"stadium");async function dAe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return j3(t,e,r)}w(dAe,"state");function fAe(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n;const{cssStyles:s}=e,{lineColor:a,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=dr.svg(h),f=fr(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:a,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"),s&&v.selectAll("path").attr("style",s),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const T=((x=(b=t.node())==null?void 0:b.ownerSVGElement)==null?void 0:x.id)??"",C=T?`${T}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Tr(e,v),e.intersect=function(T){return or.circle(e,(e.width??0)/2,T)},h}w(fAe,"stateEnd");function pAe(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 s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const h=dr.svg(s).circle(0,0,e.width,rCt(n));a=s.insert(()=>h),a.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else a=s.insert("circle",":first-child"),a.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";a.attr("style",`filter:url(#${h})`)}return Tr(e,a),e.intersect=function(u){return or.circle(e,(e.width??7)/2,u)},s}w(pAe,"stateStart");var m2=8;async function gAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,s=e.look==="neo"?28:i,a=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.width)??l.width)+2*m2+s,h=((e==null?void 0:e.height)??l.height)+a,d=u-2*m2,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=dr.svg(o),v=fr(e,{}),b=y.rectangle(p,g,d+16,f,v),x=y.line(p+m2,g,p+m2,g+f,v),T=y.line(p+m2+d,g,p+m2+d,g+f,v);o.insert(()=>x,":first-child"),o.insert(()=>T,":first-child");const C=o.insert(()=>b,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",ro(S)),Tr(e,C)}else{const y=ip(o,d,f,m);n&&y.attr("style",n),Tr(e,y)}return e.intersect=function(y){return or.polygon(e,m,y)},o}w(gAe,"subroutine");var DF=.2;async function mAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-a*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-s*2-DF*(e.height+a*2),10));const{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a*2,h=DF*u,d=DF*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,b=dr.svg(o),x=fr(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}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=Hn(T),k=b.path(S,x),E=Hn(C),A=b.path(E,{...x,fillStyle:"solid"}),M=o.insert(()=>A,":first-child");return M.insert(()=>k,":first-child"),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),Tr(e,M),e.intersect=function(R){return or.polygon(e,T,R)},o}w(mAe,"taggedRect");async function yAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,label:a}=await Qr(t,e,qr(e)),o=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(s.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=dr.svg(i),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...Hg(-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,b=-f/2-d*.4,x=[{x:v+o-h,y:(b+l)*1.3},{x:v+o,y:b+l-d},{x:v+o,y:(b+l)*.9},...Hg(v+o,(b+l)*1.25,v+o-h,(b+l)*1.3,-l*.02,.5)],T=Hn(y),C=g.path(T,m),S=Hn(x),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-u/2-(s.y-(s.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,y,A)},i}w(yAe,"taggedWaveEdgedRectangle");async function vAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s}=await Qr(t,e,qr(e)),a=Math.max(s.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(s.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-a/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",a).attr("height",o),Tr(e,h),e.intersect=function(d){return or.rect(e,d)},i}w(vAe,"text");var kSt=w((t,e,r,n,i,s)=>`M${t},${e} - a${i},${s} 0,0,1 0,${-n} +`);return nTe(n)}x(iTe,"preprocessMarkdown");function aTe(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(aTe,"nonMarkdownToLines");function sTe(t,e={}){const r=iTe(t,e),n=vi.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(` +`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(sTe,"markdownToLines");function oTe(t){return t?`

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

    `:""}x(oTe,"nonMarkdownToHTML");function lTe(t,{markdownAutoWrap:e}={}){const r=vi.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:(de.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(lTe,"markdownToHTML");function cTe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(cTe,"splitTextToChars");function uTe(t,e){const r=cTe(e.content);return DQ(t,[],r,e.type)}x(uTe,"splitWordToFitWidth");function DQ(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}])?DQ(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(DQ,"splitWordToFitWidthRecursion");function hTe(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return xL(t,e)}x(hTe,"splitLineToFitWidth");function xL(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 xL(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=uTe(e,a);r.push([o]),l.content&&t.unshift(l)}return xL(t,e,r)}x(xL,"splitLineToFitWidthRecursion");function mW(t,e){e&&t.attr("style",e)}x(mW,"applyStyle");var Ohe=16384;async function dTe(t,e,r,n,i=!1,a=xr()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,Ohe)}px`),s.attr("height",`${Math.min(10*r,Ohe)}px`);const o=s.append("xhtml:div"),l=Qa(e.label)?await aO(e.label.replace(Ht.lineBreakRegex,` +`),a):Dn(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),mW(h,e.labelStyle),h.attr("class",`${u} ${n}`),mW(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(dTe,"addHtmlSpan");function wO(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(wO,"createTspan");function fTe(t,e,r){const n=t.append("text"),i=wO(n,1,e);TO(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(fTe,"computeWidthOfText");function pTe(t,e,r){var s;const n=t.append("text"),i=wO(n,1,e);TO(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(pTe,"computeDimensionOfText");function gTe(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>fTe(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:hTe(h,d);for(const p of f){const g=wO(l,u,1.1,i);TO(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(gTe,"createFormattedText");function UW(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(UW,"decodeHTMLEntities");function TO(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(UW(r.content)):i.text(" "+UW(r.content))})}x(TO,"updateTextContentAndStyles");async function mTe(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await I3t(o)?await D0(o,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(mTe,"replaceIconSubstring");var ll=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(de.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?lTe(e,h):oTe(e),f=await mTe(N0(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:Qa(e)?p:f,labelStyle:r.replace("fill:","color:")};return await dTe(t,g,l,i,u,h)}else{const d=N0(e.replace(//g,"
    ")),f=s?sTe(d.replace("
    ","
    "),h):aTe(d),p=gTe(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:");vt(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");vt(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:");vt(p).select("text").attr("style",m)}return n?vt(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):vt(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function D$(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 mxt(t,e){return t[0]===e[0]&&t[1]===e[1]}function Uxt(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)D$(u,o,i);const l=(function(u,h,d){const f=[];for(const b of u){const v=[...b];mxt(v[0],v[v.length-1])||v.push([v[0][0],v[0][1]]),v.length>2&&f.push(v)}const p=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let v=0;vb.yminv.ymin?1:b.xv.x?1:b.ymax===v.ymax?0:(b.ymax-v.ymax)/Math.abs(b.ymax-v.ymax))),!g.length)return p;let m=[],U=g[0].ymin,y=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let v=0;vU);v++)b=v;g.splice(0,b+1).forEach((v=>{m.push({s:U,edge:v})}))}if(m=m.filter((b=>!(b.edge.ymax<=U))),m.sort(((b,v)=>b.edge.x===v.edge.x?0:(b.edge.x-v.edge.x)/Math.abs(b.edge.x-v.edge.x))),(d!==1||y%h==0)&&m.length>1)for(let b=0;b=m.length)break;const w=m[b].edge,T=m[v].edge;p.push([[Math.round(w.x),U],[Math.round(T.x),U]])}U+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),y++}return p})(s,a,n);if(i){for(const u of s)D$(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),D$(f,h,d)})(l,o,-i)}return l}function lk(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),Uxt(t,i,n,a||1)}class OQ{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=lk(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 CO(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 yxt=class extends OQ{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=lk(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)CO([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 bxt extends OQ{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 vxt=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=lk(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=CO(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=CO(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=CO(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 yTe(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,U=i+2*(g-i)/3,y=d+2*(p-d)/3,b=f+2*(g-f)/3;e.push({key:"C",data:[m,U,y,b,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,U=i+2*(f-i)/3,y=p+2*(d-p)/3,b=g+2*(f-g)/3;e.push({key:"C",data:[m,U,y,b,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],U=h[5],y=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,U,y,U,y]}),n=U,i=y):(n!==U||i!==y)&&(bTe(n,i,U,y,d,f,p,g,m).forEach((function(b){e.push({key:"C",data:b})})),n=U,i=y);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function W9(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function bTe(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,U=0;if(u)[p,g,m,U]=u;else{[t,e]=W9(t,e,-h),[r,n]=W9(r,n,-h);const N=(t-r)/2,L=(e-n)/2;let I=N*N/(i*i)+L*L/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const P=i*i,O=a*a,D=P*O-P*L*L-O*N*N,B=P*L*L+O*N*N,F=(o===l?-1:1)*Math.sqrt(Math.abs(D/B));m=F*i*L/a+(t+r)/2,U=F*-a*N/i+(e+n)/2,p=Math.asin(parseFloat(((e-U)/a).toFixed(9))),g=Math.asin(parseFloat(((n-U)/a).toFixed(9))),tg&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const N=g,L=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=bTe(r=m+i*Math.cos(g),n=U+a*Math.sin(g),L,I,i,a,s,0,l,[g,N,m,U])}y=g-p;const b=Math.cos(p),v=Math.sin(p),w=Math.cos(g),T=Math.sin(g),k=Math.tan(y/4),C=4/3*i*k,S=4/3*a*k,E=[t,e],A=[t+C*v,e-S*b],R=[r+C*T,n-S*w],_=[r,n];if(A[0]=2*E[0]-A[0],A[1]=2*E[1]-A[1],u)return[A,R,_].concat(f);{f=[A,R,_].concat(f);const N=[];for(let L=0;L2){const i=[];for(let a=0;a2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,U=Math.min(m/2,(g-p)/2),y=Vhe(U,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=Vhe(U,u,h,d,f,p,g,1.5,l);y.push(...b)}return s&&(o?y.push(...Hg(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...Hg(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):y.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:y}}function $he(t,e){const r=yTe(UTe(_Q(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(...Hg(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(...Ext(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...Hg(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function P$(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]+en(i,e),n[0][1]+en(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*wTe(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=en(p,i,u),g=en(g,i,u);const m=[],U=()=>en(d,i,u),y=()=>en(h,i,u),b=i.preserveVertices;return s?m.push({op:"move",data:[t+(b?0:U()),e+(b?0:U())]}):m.push({op:"move",data:[t+(b?0:en(h,i,u)),e+(b?0:en(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+U(),g+e+(n-e)*f+U(),p+t+2*(r-t)*f+U(),g+e+2*(n-e)*f+U(),r+(b?0:U()),n+(b?0:U())]}):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+(b?0:y()),n+(b?0:y())]}),m}function BS(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+en(e,r),t[0][1]+en(e,r)]),n.push([t[0][0]+en(e,r),t[0][1]+en(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=vm(l,u,.5),p=vm(u,h,.5),g=vm(h,d,.5),m=vm(f,p,.5),U=vm(p,g,.5),y=vm(m,U,.5);vW([l,f,m,y],0,r,i),vW([y,U,g,d],0,r,i)}var a,s;return i}function Mxt(t,e){return CL(t,0,t.length,e)}function CL(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?(CL(t,e,u+1,n,a),CL(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function B$(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?CL(n,0,n.length,r):n}const Oc="none";let kL=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",[vTe(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=Sxt(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(P$([u],s)):o.push(y2([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=xTe(n,i,s),u=yW(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=yW(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(y2([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",[zA(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=Bhe(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=Bhe(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,U,y,b){const v=f,w=p;let T=Math.abs(g/2),k=Math.abs(m/2);T+=en(.01*T,b),k+=en(.01*k,b);let C=U,S=y;for(;C<0;)C+=2*Math.PI,S+=2*Math.PI;S-C>2*Math.PI&&(C=0,S=2*Math.PI);const E=(S-C)/b.curveStepCount,A=[];for(let R=C;R<=S;R+=E)A.push([v+T*Math.cos(R),w+k*Math.sin(R)]);return A.push([v+T*Math.cos(S),w+k*Math.sin(S)]),A.push([v,w]),y2([A],b)})(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=Phe(e,n);if(n.fill&&n.fill!==Oc)if(n.fillStyle==="solid"){const s=Phe(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(...B$(Hhe([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...B$(Hhe(u),10,(1+n.roughness)/2))}s.length&&i.push(y2([s],n))}return n.stroke!==Oc&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=zA(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(P$([e],n)):i.push(y2([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=yTe(UTe(_Q(h))),g=[];let m=[],U=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...B$(y,d)),y=[]},v=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:T,data:k}of p)switch(T){case"M":v(),U=[k[0],k[1]],m.push(U);break;case"L":b(),m.push([k[0],k[1]]);break;case"C":if(!y.length){const C=m.length?m[m.length-1]:U;y.push([C[0],C[1]])}y.push([k[0],k[1]]),y.push([k[2],k[3]]),y.push([k[4],k[5]]);break;case"Z":b(),m.push([U[0],U[1]])}if(v(),!f)return g;const w=[];for(const T of g){const k=Mxt(T,f);k.length&&w.push(k)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=$he(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=$he(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(P$(l,n));else i.push(y2(l,n));return s&&(o?l.forEach((h=>{i.push(zA(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 Rxt{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new kL(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 $S="http://www.w3.org/2000/svg";class Lxt{constructor(e,r){this.svg=e,this.gen=new kL(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS($S,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS($S,"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($S,"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($S,"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 fr={canvas:(t,e)=>new Rxt(t,e),svg:(t,e)=>new Lxt(t,e),generator:t=>new kL(t),newSeed:()=>kL.newSeed()},Jr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||sf((p=He())==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",ro(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 ll(s,Dn(N0(o),He()),{useHtmlLabels:i,width:e.width||((g=He().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},He());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],U=vt(h);await TQ(m,o),d=m.getBoundingClientRect(),U.attr("width",d.width),U.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"),$$=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??yi(He()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ll(i,Dn(N0(e),He()),{useHtmlLabels:n,width:r.width||((u=(l=He())==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(yi(He())){const h=a.children[0],d=vt(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"),Tr=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Wr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Hn(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Hn,"createPathFromPoints");function Gg(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,U=f+i*Math.sin(d*(m-t));s.push({x:m,y:U})}return s}x(Gg,"generateFullSineWavePoints");function vT(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(xW,"mergePaths");var Ixt=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),M5=Ixt,Nxt=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=yi(s);return await ll(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),ug=Nxt,k1=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),Dxt=x(async(t,e)=>{const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=ur(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=sf(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),U=await ll(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let y=U.getBBox();if(p){const N=U.children[0],L=vt(U);y=N.getBoundingClientRect(),L.attr("width",y.width),L.attr("height",y.height)}const b=e.padding??0,v=e.width<=y.width+b?y.width+b:e.width;e.width<=y.width+b?e.diff=(v-e.width)/2-b:e.diff=-b;const w=e.height,T=e.y-w/2,k=e.y+w/2,C=e.x-v/2,S=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:T+w/3,E=g?4:0,A=y.height+2*E;let R,_;if(g){const N=Math.max(A,y.height+2*E),L=C+N,I=Math.max(0,v-N);if(e.look==="handDrawn"){const D=fr.svg(f),B=pr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),F=pr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),z=D.rectangle(C,T,N,w,B);R=f.insert(()=>z,":first-child");const $=D.rectangle(L,T,I,w,F);_=f.insert(()=>$,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),_=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",u).attr("x",C).attr("y",T).attr("width",N).attr("height",w).attr("fill",a).attr("stroke",o),_.attr("class","swimlane-body").attr("style",u).attr("x",L).attr("y",T).attr("width",I).attr("height",w).attr("fill","none").attr("stroke",o);const P=C+N/2,O=e.y;m.attr("transform",`translate(${P}, ${O}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const N=Math.max(0,S-T),L=Math.min(A,N),I=T+L,P=Math.max(0,k-I),O=e.x-v/2;if(e.look==="handDrawn"){const F=fr.svg(f),z=pr(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),$=pr(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=F.rectangle(O,T,v,L,z);R=f.insert(()=>V,":first-child");const H=F.rectangle(O,I,v,P,$);_=f.insert(()=>H,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),_=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",T).attr("width",v).attr("height",L).attr("fill",a).attr("stroke",o),_.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",v).attr("height",P).attr("fill","none").attr("stroke",o);const D=e.x-y.width/2,B=T+(L-y.height)/2;m.attr("transform",`translate(${D}, ${B})`)}if(de.trace("Swimlane data ",e,JSON.stringify(e)),l){const N=m.select("span");N&&N.attr("style",l)}return e.offsetX=0,e.width=v,e.height=w,e.offsetY=y.height-b/2,e.intersect=function(N){return M5(e,N)},{cluster:f,labelBBox:y}},"swimlane"),TTe=x(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ur(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=yi(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ll(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await ug(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(yi(r)){const C=g.children[0],S=vt(g);m=C.getBoundingClientRect(),S.attr("width",m.width),S.attr("height",m.height)}const U=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(U-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-U/2,v=e.y-y/2;de.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=fr.svg(d),S=pr(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),E=C.path(k1(b,v,U,y,0),S);w=d.insert(()=>(de.debug("Rough node insert CXC",E),E),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",v).attr("width",U).attr("height",y);const{subGraphTitleTopMargin:T}=X4(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+T})`),o){const C=p.select("span");C&&C.attr("style",o)}const k=w.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return M5(e,C)},{cluster:d,labelBBox:m}},"rect"),Oxt=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return M5(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),_xt=x(async(t,e)=>{const r=He(),{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 ug(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(yi(r)){const E=p.children[0],A=vt(p);g=E.getBoundingClientRect(),A.attr("width",g.width),A.attr("height",g.height)}const m=0*e.padding,U=m/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+m,v=e.height+m-g.height-6,w=e.x-y/2,T=e.y-b/2;e.width=y;const k=e.y-e.height/2-U+g.height+2;let C;if(e.look==="handDrawn"){const E=e.cssClasses.includes("statediagram-cluster-alt"),A=fr.svg(u),R=e.rx||e.ry?A.path(k1(w,T,y,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):A.rectangle(w,T,y,b,{seed:i});C=u.insert(()=>R,":first-child");const _=A.rectangle(w,k,y,v,{fill:E?a:s,fillStyle:E?"hachure":"solid",stroke:l,seed:i});C=u.insert(()=>R,":first-child"),f=u.insert(()=>_)}else C=h.insert("rect",":first-child"),C.attr("class","outer").attr("x",w).attr("y",T).attr("width",y).attr("height",b).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",k).attr("width",y).attr("height",v);d.attr("transform",`translate(${e.x-g.width/2}, ${T+1-(yi(r)?0:3)})`);const S=C.node().getBBox();return e.height=S.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(E){return M5(e,E)},{cluster:u,labelBBox:g}},"roundedWithTitle"),Pxt=x(async(t,e)=>{de.info("Creating subgraph rect for ",e.id,e);const r=He(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=ur(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=yi(r),p=d.insert("g").attr("class","cluster-label "),g=await ll(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(yi(r)){const C=g.children[0],S=vt(g);m=C.getBoundingClientRect(),S.attr("width",m.width),S.attr("height",m.height)}const U=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(U-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,b=e.x-U/2,v=e.y-y/2;de.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const C=fr.svg(d),S=pr(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),E=C.path(k1(b,v,U,y,e.rx),S);w=d.insert(()=>(de.debug("Rough node insert CXC",E),E),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",v).attr("width",U).attr("height",y);const{subGraphTitleTopMargin:T}=X4(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+T})`),o){const C=p.select("span");C&&C.attr("style",o)}const k=w.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=m.height-e.padding/2,e.intersect=function(C){return M5(e,C)},{cluster:d,labelBBox:m}},"kanbanSection"),Bxt=x((t,e)=>{const r=He(),{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 U=fr.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>U,":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 M5(e,m)},{cluster:s,labelBBox:{}}},"divider"),$xt=TTe,Fxt={rect:TTe,squareRect:$xt,roundedWithTitle:_xt,noteGroup:Oxt,divider:Bxt,kanbanSection:Pxt,swimlane:Dxt},CTe=new Map,kO=x(async(t,e)=>{const r=e.shape||"rect",n=await Fxt[r](t,e);return CTe.set(e.id,n),n},"insertCluster"),kTe=x(()=>{CTe=new Map},"clear");function STe(t,e){return t.intersect(e)}x(STe,"intersectNode");var zxt=STe;function ETe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(wW,"sameSign");var Hxt=RTe;function LTe(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,U=d.y-r.y,y=Math.sqrt(m*m+U*U);return gh,":first-child");return d.attr("class","anchor").attr("style",ro(o)),Tr(e,d),e.intersect=function(f){return de.info("Circle intersect",e,s,f),lr.circle(e,s,f)},a}x(ITe,"anchor");function TW(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 U=Math.sqrt(1-m**2),y=l+U*a*Math.sin(h)*(s?-1:1),b=u-U*i*Math.cos(h)*(s?-1:1),v=Math.atan2((e-b)/a,(t-y)/i);let T=Math.atan2((n-b)/a,(r-y)/i)-v;s&&T<0&&(T+=2*Math.PI),!s&&T>0&&(T-=2*Math.PI);const k=[];for(let C=0;C<20;C++){const S=C/19,E=v+S*T,A=y+i*Math.cos(E),R=b+a*Math.sin(E);k.push({x:A,y:R})}return k}x(TW,"generateArcPoints");function NTe(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(NTe,"calculateArcSagitta");async function DTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(E=>E+s,"calcTotalHeight"),l=x(E=>{const A=E/2;return[A/(2.5+E/50),A]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await Jr(t,e,Wr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=NTe(d,f,p),U=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,y=d,{cssStyles:b}=e,v=[{x:U/2,y:-y/2},{x:-U/2,y:-y/2},...TW(-U/2,-y/2,-U/2,y/2,f,p,!1),{x:U/2,y:y/2},...TW(U/2,y/2,U/2,-y/2,f,p,!0)],w=fr.svg(u),T=pr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=Hn(v),C=w.path(k,T),S=u.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${f/2}, 0)`),Tr(e,S),e.intersect=function(E){return lr.polygon(e,v,E)},u}x(DTe,"bowTieRect");function ap(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(ap,"insertPolygonShape");var FS=12;async function OTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+FS),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+FS,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+FS},{x:d+FS,y:p}];let U;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=fr.svg(o),v=pr(e,{}),w=Hn(m),T=b.path(w,v);U=o.insert(()=>T,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),y&&U.attr("style",y)}else U=ap(o,u,h,m);return n&&U.attr("style",n),Tr(e,U),e.intersect=function(b){return lr.polygon(e,m,b)},o}x(OTe,"card");function _Te(t,e){const{nodeStyles:r}=ur(e);e.label="";const n=t.insert("g").attr("class",Wr(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=fr.svg(n),l=pr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Hn(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 lr.polygon(e,s,f)},n}x(_Te,"choice");async function PQ(t,e,r){const{labelStyles:n,nodeStyles:i}=ur(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await Jr(t,e,Wr(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=fr.svg(a),g=pr(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",ro(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 Tr(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return lr.circle(p,m,g)},e.intersect=function(p){return de.info("Circle intersect",e,h,p),lr.circle(e,h,p)},a}x(PQ,"circle");function PTe(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y} + M ${i.x},${i.y} L ${s.x},${s.y}`}x(PTe,"createLine");function BTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=fr.svg(i),l=pr(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=PTe(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),Tr(e,f),e.intersect=function(p){return de.info("crossedCircle intersect",e,{radius:a,point:p}),lr.circle(e,a,p)},i}x(BTe,"crossedCircle");function Bf(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;dT,":first-child").attr("stroke-opacity",0),k.insert(()=>v,":first-child"),k.attr("class","text"),f&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.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))})`),Tr(e,k),e.intersect=function(C){return lr.polygon(e,g,C)},i}x($Te,"curlyBraceLeft");function $f(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;dT,":first-child").attr("stroke-opacity",0),k.insert(()=>v,":first-child"),k.attr("class","text"),f&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.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))})`),Tr(e,k),e.intersect=function(C){return lr.polygon(e,g,C)},i}x(FTe,"curlyBraceRight");function yo(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;dE,":first-child").attr("stroke-opacity",0),A.insert(()=>w,":first-child"),A.insert(()=>C,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.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))})`),Tr(e,A),e.intersect=function(R){return lr.polygon(e,m,R)},i}x(zTe,"curlyBraces");async function VTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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=fr.svg(u),U=pr(e,{});e.look!=="handDrawn"&&(U.roughness=0,U.fillStyle="solid");const y=d,b=f,v=y-p,w=b/4,T=[{x:v,y:0},{x:w,y:0},{x:0,y:b/2},{x:w,y:b},{x:v,y:b},...vT(-v,-b/2,p,50,270,90)],k=Hn(T),C=m.path(k,U),S=u.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(${-d/2}, ${-f/2})`),Tr(e,S),e.intersect=function(E){return lr.polygon(e,T,E)},u}x(VTe,"curvedTrapezoid");var Wxt=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),qxt=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),jxt=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Ghe=8,Whe=8;async function HTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 U=e.width??0;e.width=(e.width??0)-s,e.widthT,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const U=Wxt(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",U).attr("class","basic label-container outer-path").attr("style",ro(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(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(U){const y=lr.rect(e,U),b=y.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(y.y-(e.y??0))>(e.height??0)/2-f)){let v=f*f*(1-b*b/(d*d));v>0&&(v=Math.sqrt(v)),v=f-v,U.y-(e.y??0)>0&&(v=-v),y.y+=v}return y},o}x(HTe,"cylinder");async function K4(t,e,r){const{labelStyles:n,nodeStyles:i}=ur(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await Jr(t,e,Wr(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=fr.svg(a),U=pr(e,{}),y=f||p?m.path(k1(u,h,o,l,f||0),U):m.rectangle(u,h,o,l,U);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",ro(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ro(f)).attr("ry",ro(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Tr(e,d),e.calcIntersect=function(m,U){return lr.rect(m,U)},e.intersect=function(m){return lr.rect(e,m)},a}x(K4,"drawRect");async function GTe(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 K4(t,e,l);if(e.look==="handDrawn"){const p=fr.svg(u),g=pr(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),U=m.node();if(!U)return u;let y=null;if(U instanceof SVGGraphicsElement)y=U.getBBox();else return u;return u.insert(()=>p.line(y.x,y.y,y.x+y.width,y.y,g),".basic.label-container g.label"),u.insert(()=>p.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x(GTe,"datastore");async function WTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=fr.svg(s),U=pr(e,{});e.look!=="handDrawn"&&(U.roughness=0,U.fillStyle="solid");const y=[{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}],b=m.polygon(y.map(w=>[w.x,w.y]),U),v=s.insert(()=>b,":first-child");return v.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&v.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))})`),Tr(e,v),e.intersect=function(w){return lr.rect(e,w)},s}x(WTe,"dividedRectangle");async function qTe(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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=fr.svg(o),U=pr(e,{roughness:.2,strokeWidth:2.5}),y=pr(e,{roughness:.2,strokeWidth:1.5}),b=m.circle(0,0,u*2,U),v=m.circle(0,0,h*2,y);d=o.insert("g",":first-child"),d.attr("class",ro(e.cssClasses)).attr("style",ro(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(v)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),U=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),U.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Tr(e,d),e.intersect=function(m){return de.info("DoubleCircle intersect",e,u,m),lr.circle(e,u,m)},o}x(qTe,"doublecircle");function jTe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ur(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",Wr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=fr.svg(a),{nodeBorder:u}=r,h=pr(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),Tr(e,f),e.intersect=function(p){return de.info("filledCircle intersect",e,{radius:s,point:p}),lr.circle(e,s,p)},a}x(jTe,"filledCircle");var qhe=10,jhe=10;async function YTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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.heighty,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=u,e.height=h,Tr(e,b),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(v){return de.info("Triangle intersect",e,f,v),lr.polygon(e,f,v)},s}x(YTe,"flippedTriangle");function XTe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=ur(e);e.label="";const s=t.insert("g").attr("class",Wr(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=fr.svg(s),p=pr(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),Tr(e,m);const U=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=U/2||0,e.height+=U/2||0),e.intersect=function(y){return lr.rect(e,y)},s}x(XTe,"forkJoin");async function KTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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.heightb,":first-child");return v.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),Tr(e,v),e.intersect=function(w){return de.info("Pill intersect",e,{radius:f,point:w}),lr.polygon(e,U,w)},l}x(KTe,"halfRoundedRectangle");var Yxt=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function ZTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 v=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*v-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await Jr(t,e,Wr(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 U;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=fr.svg(h),v=pr(e,{}),w=Yxt(0,0,g,f,p),T=b.path(w,v);U=h.insert(()=>T,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),y&&U.attr("style",y)}else U=ap(h,g,f,m);return n&&U.attr("style",n),e.width=g,e.height=f,Tr(e,U),e.intersect=function(b){return lr.polygon(e,m,b)},h}x(ZTe,"hexagon");async function JTe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await Jr(t,e,Wr(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=fr.svg(i),u=pr(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=Hn(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})`),Tr(e,p),e.intersect=function(g){return de.info("Pill intersect",e,{points:h}),lr.polygon(e,h,g)},i}x(JTe,"hourglass");async function QTe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ur(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 Jr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:U}=Y4(e),y=-g/2,b=-p/2,v=e.label?8:0,w=fr.svg(u),T=pr(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=w.rectangle(y,b,g,p,T),C=Math.max(g,h.width),S=p+h.height+v,E=w.rectangle(-C/2,-S/2,C,S,{...T,fill:"transparent",stroke:"none"}),A=u.insert(()=>k,":first-child"),R=u.insert(()=>E);if(e.icon){const _=u.append("g");_.html(`${await D0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const N=_.node().getBBox(),L=N.width,I=N.height,P=N.x,O=N.y;_.attr("transform",`translate(${-L/2-P},${f?h.height/2+v/2-I/2-O:-h.height/2-v/2-I/2-O})`),_.attr("style",`color: ${U.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-S/2:S/2-h.height})`),A.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),Tr(e,R),e.intersect=function(_){if(de.info("iconSquare intersect",e,_),!e.label)return lr.rect(e,_);const N=e.x??0,L=e.y??0,I=e.height??0;let P=[];return f?P=[{x:N-h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2},{x:N+h.width/2,y:L-I/2+h.height+v},{x:N+g/2,y:L-I/2+h.height+v},{x:N+g/2,y:L+I/2},{x:N-g/2,y:L+I/2},{x:N-g/2,y:L-I/2+h.height+v},{x:N-h.width/2,y:L-I/2+h.height+v}]:P=[{x:N-g/2,y:L-I/2},{x:N+g/2,y:L-I/2},{x:N+g/2,y:L-I/2+p},{x:N+h.width/2,y:L-I/2+p},{x:N+h.width/2/2,y:L+I/2},{x:N-h.width/2,y:L+I/2},{x:N-h.width/2,y:L-I/2+p},{x:N-g/2,y:L-I/2+p}],lr.polygon(e,P,_)},u}x(QTe,"icon");async function eCe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ur(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 Jr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:U}=r,{stylesMap:y}=Y4(e),b=fr.svg(u),v=pr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.get("fill");v.stroke=w??U;const T=u.append("g");e.icon&&T.html(`${await D0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const k=T.node().getBBox(),C=k.width,S=k.height,E=k.x,A=k.y,R=Math.max(C,S)*Math.SQRT2+f*2,_=b.circle(0,0,R,v),N=Math.max(R,h.width),L=R+h.height+p,I=b.rectangle(-N/2,-L/2,N,L,{...v,fill:"transparent",stroke:"none"}),P=u.insert(()=>_,":first-child"),O=u.insert(()=>I);return T.attr("transform",`translate(${-C/2-E},${g?h.height/2+p/2-S/2-A:-h.height/2-p/2-S/2-A})`),T.attr("style",`color: ${y.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-L/2:L/2-h.height})`),P.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Tr(e,O),e.intersect=function(D){return de.info("iconSquare intersect",e,D),lr.rect(e,D)},u}x(eCe,"iconCircle");async function tCe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ur(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 Jr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:U,mainBkg:y}=r,{stylesMap:b}=Y4(e),v=-m/2,w=-g/2,T=e.label?8:0,k=fr.svg(u),C=pr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=b.get("fill");C.stroke=S??y;const E=k.path(k1(v,w,m,g,5),C),A=Math.max(m,h.width),R=g+h.height+T,_=k.rectangle(-A/2,-R/2,A,R,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>E,":first-child").attr("class","icon-shape2"),L=u.insert(()=>_);if(e.icon){const I=u.append("g");I.html(`${await D0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const P=I.node().getBBox(),O=P.width,D=P.height,B=P.x,F=P.y;I.attr("transform",`translate(${-O/2-B},${p?h.height/2+T/2-D/2-F:-h.height/2-T/2-D/2-F})`),I.attr("style",`color: ${b.get("stroke")??U};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-R/2:R/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+T/2:-h.height/2-T/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return lr.rect(e,I);const P=e.x??0,O=e.y??0,D=e.height??0;let B=[];return p?B=[{x:P-h.width/2,y:O-D/2},{x:P+h.width/2,y:O-D/2},{x:P+h.width/2,y:O-D/2+h.height+T},{x:P+m/2,y:O-D/2+h.height+T},{x:P+m/2,y:O+D/2},{x:P-m/2,y:O+D/2},{x:P-m/2,y:O-D/2+h.height+T},{x:P-h.width/2,y:O-D/2+h.height+T}]:B=[{x:P-m/2,y:O-D/2},{x:P+m/2,y:O-D/2},{x:P+m/2,y:O-D/2+g},{x:P+h.width/2,y:O-D/2+g},{x:P+h.width/2/2,y:O+D/2},{x:P-h.width/2,y:O+D/2},{x:P-h.width/2,y:O-D/2+g},{x:P-m/2,y:O-D/2+g}],lr.polygon(e,B,I)},u}x(tCe,"iconRounded");async function rCe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=ur(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 Jr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:U,mainBkg:y}=r,{stylesMap:b}=Y4(e),v=-m/2,w=-g/2,T=e.label?8:0,k=fr.svg(u),C=pr(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=b.get("fill");C.stroke=S??y;const E=k.path(k1(v,w,m,g,.1),C),A=Math.max(m,h.width),R=g+h.height+T,_=k.rectangle(-A/2,-R/2,A,R,{...C,fill:"transparent",stroke:"none"}),N=u.insert(()=>E,":first-child"),L=u.insert(()=>_);if(e.icon){const I=u.append("g");I.html(`${await D0(e.icon,{height:o,width:o,fallbackPrefix:""})}`);const P=I.node().getBBox(),O=P.width,D=P.height,B=P.x,F=P.y;I.attr("transform",`translate(${-O/2-B},${p?h.height/2+T/2-D/2-F:-h.height/2-T/2-D/2-F})`),I.attr("style",`color: ${b.get("stroke")??U};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-R/2:R/2-h.height})`),N.attr("transform",`translate(0,${p?h.height/2+T/2:-h.height/2-T/2})`),Tr(e,L),e.intersect=function(I){if(de.info("iconSquare intersect",e,I),!e.label)return lr.rect(e,I);const P=e.x??0,O=e.y??0,D=e.height??0;let B=[];return p?B=[{x:P-h.width/2,y:O-D/2},{x:P+h.width/2,y:O-D/2},{x:P+h.width/2,y:O-D/2+h.height+T},{x:P+m/2,y:O-D/2+h.height+T},{x:P+m/2,y:O+D/2},{x:P-m/2,y:O+D/2},{x:P-m/2,y:O-D/2+h.height+T},{x:P-h.width/2,y:O-D/2+h.height+T}]:B=[{x:P-m/2,y:O-D/2},{x:P+m/2,y:O-D/2},{x:P+m/2,y:O-D/2+g},{x:P+h.width/2,y:O-D/2+g},{x:P+h.width/2/2,y:O+D/2},{x:P-h.width/2,y:O+D/2},{x:P-h.width/2,y:O-D/2+g},{x:P-m/2,y:O-D/2+g}],lr.polygon(e,B,I)},u}x(rCe,"iconSquare");async function nCe(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}=ur(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 Jr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,U=-h/2,y=e.label?8:0,b=fr.svg(d),v=pr(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=b.rectangle(m,U,u,h,v),T=Math.max(u,f.width),k=h+f.height+y,C=b.rectangle(-T/2,-k/2,T,k,{...v,fill:"none",stroke:"none"}),S=d.insert(()=>w,":first-child"),E=d.insert(()=>C);if(e.img){const A=d.append("image");A.attr("href",e.img),A.attr("width",u),A.attr("height",h),A.attr("preserveAspectRatio","none"),A.attr("transform",`translate(${-u/2},${g?k/2-h:-k/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-y/2:h/2-f.height/2+y/2})`),S.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Tr(e,E),e.intersect=function(A){if(de.info("iconSquare intersect",e,A),!e.label)return lr.rect(e,A);const R=e.x??0,_=e.y??0,N=e.height??0;let L=[];return g?L=[{x:R-f.width/2,y:_-N/2},{x:R+f.width/2,y:_-N/2},{x:R+f.width/2,y:_-N/2+f.height+y},{x:R+u/2,y:_-N/2+f.height+y},{x:R+u/2,y:_+N/2},{x:R-u/2,y:_+N/2},{x:R-u/2,y:_-N/2+f.height+y},{x:R-f.width/2,y:_-N/2+f.height+y}]:L=[{x:R-u/2,y:_-N/2},{x:R+u/2,y:_-N/2},{x:R+u/2,y:_-N/2+h},{x:R+f.width/2,y:_-N/2+h},{x:R+f.width/2/2,y:_+N/2},{x:R-f.width/2,y:_+N/2},{x:R-f.width/2,y:_-N/2+h},{x:R-u/2,y:_-N/2+h}],lr.polygon(e,L,A)},d}x(nCe,"imageSquare");async function iCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Jr(t,e,Wr(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=fr.svg(o),m=pr(e,{}),U=Hn(d),y=g.path(U,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=ap(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Tr(e,f),e.intersect=function(g){return lr.polygon(e,d,g)},o}x(iCe,"inv_trapezoid");async function aCe(t,e){const{shapeSvg:r,bbox:n,label:i}=await Jr(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))})`),Tr(e,a),e.intersect=function(l){return lr.rect(e,l)},r}x(aCe,"labelRect");async function sCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Jr(t,e,Wr(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=fr.svg(o),m=pr(e,{}),U=Hn(d),y=g.path(U,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=ap(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return lr.polygon(e,d,g)},o}x(sCe,"lean_left");async function oCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Jr(t,e,Wr(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=fr.svg(o),m=pr(e,{}),U=Hn(d),y=g.path(U,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=ap(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return lr.polygon(e,d,g)},o}x(oCe,"lean_right");function lCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",Wr(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=fr.svg(i),d=pr(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Hn(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})`),Tr(e,g),e.intersect=function(m){return de.info("lightningBolt intersect",e,m),lr.polygon(e,u,m)},i}x(lCe,"lightningBolt");var Xxt=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Kxt=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Zxt=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Yhe=10,Xhe=10;async function cCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 y=e.width??0;e.width=(e.width??0)-a,e.widthk,":first-child").attr("class","line"),m=o.insert(()=>T,":first-child"),m.attr("class","basic label-container"),U&&m.attr("style",U)}else{const y=Xxt(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",ro(U)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Tr(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(y){const b=lr.rect(e,y),v=b.x-(e.x??0);if(d!=0&&(Math.abs(v)<(e.width??0)/2||Math.abs(v)==(e.width??0)/2&&Math.abs(b.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-v*v/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(e.y??0)>0&&(w=-w),b.y+=w}return b},o}x(cCe,"linedCylinder");async function uCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await Jr(t,e,Wr(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=fr.svg(o),U=pr(e,{});e.look!=="handDrawn"&&(U.roughness=0,U.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...Gg(-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}],b=m.polygon(y.map(w=>[w.x,w.y]),U),v=o.insert(()=>b,":first-child");return v.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.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))})`),Tr(e,v),e.intersect=function(w){return lr.polygon(e,y,w)},o}x(uCe,"linedWaveEdgedRect");async function hCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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,U=-g/2,{cssStyles:y}=e,b=fr.svg(l),v=pr(e,{}),w=[{x:m-o,y:U+o},{x:m-o,y:U+g+o},{x:m+p-o,y:U+g+o},{x:m+p-o,y:U+g},{x:m+p,y:U+g},{x:m+p,y:U+g-o},{x:m+p+o,y:U+g-o},{x:m+p+o,y:U-o},{x:m+o,y:U-o},{x:m+o,y:U},{x:m,y:U},{x:m,y:U+o}],T=[{x:m,y:U+o},{x:m+p-o,y:U+o},{x:m+p-o,y:U+g},{x:m+p,y:U+g},{x:m+p,y:U},{x:m,y:U}];e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=Hn(w);let C=b.path(k,v);const S=Hn(T);let E=b.path(S,v);e.look!=="handDrawn"&&(C=xW(C),E=xW(E));const A=l.insert("g",":first-child");return A.insert(()=>C),A.insert(()=>E),A.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&A.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))})`),Tr(e,A),e.intersect=function(R){return lr.polygon(e,w,R)},l}x(hCe,"multiRect");async function dCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Jr(t,e,Wr(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,U=-g/2,y=10,{cssStyles:b}=e,v=Gg(m-y,U+g+y,m+d-y,U+g+y,p,.8),w=v==null?void 0:v[v.length-1],T=[{x:m-y,y:U+y},{x:m-y,y:U+g+y},...v,{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:w.y-2*y},{x:m+d+y,y:w.y-2*y},{x:m+d+y,y:U-y},{x:m+y,y:U-y},{x:m+y,y:U},{x:m,y:U},{x:m,y:U+y}],k=[{x:m,y:U+y},{x:m+d-y,y:U+y},{x:m+d-y,y:w.y-y},{x:m+d,y:w.y-y},{x:m+d,y:U},{x:m,y:U}],C=fr.svg(i),S=pr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const E=Hn(T),A=C.path(E,S),R=Hn(k),_=C.path(R,S),N=i.insert(()=>A,":first-child");return N.insert(()=>_),N.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",n),N.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-p/2-(a.y-(a.top??0))})`),Tr(e,N),e.intersect=function(L){return lr.polygon(e,T,L)},i}x(dCe,"multiWaveEdgedRectangle");async function fCe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=ur(e);e.labelStyle=n,e.useHtmlLabels||yi(xr())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await Jr(t,e,Wr(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=fr.svg(s),m=pr(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const U=g.rectangle(d,f,u,h,m),y=s.insert(()=>U,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&y.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))})`),Tr(e,y),e.intersect=function(b){return lr.rect(e,b)},s}x(fCe,"note");var Jxt=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function pCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Jr(t,e,Wr(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=fr.svg(i),g=pr(e,{}),m=Jxt(0,0,l),U=p.path(m,g);d=i.insert(()=>U,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=ap(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Tr(e,d),e.calcIntersect=function(p,g){const m=p.width,U=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],y=lr.polygon(p,U,g);return{x:y.x-.5,y:y.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(pCe,"question");async function gCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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:U}=e,y=fr.svg(o),b=pr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=Hn(m),w=y.path(v,b),T=o.insert(()=>w,":first-child");return T.attr("class","basic label-container outer-path"),U&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",U),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),T.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))})`),Tr(e,T),e.intersect=function(k){return lr.polygon(e,m,k)},o}x(gCe,"rect_left_inv_arrow");async function mCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 ug(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(yi(He())){const S=h.children[0],E=vt(h);d=S.getBoundingClientRect(),E.attr("width",d.width),E.attr("height",d.height)}de.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await ug(o,Array.isArray(f)?f.join("
    "):f,e.labelStyle,!0,!0),m=g.children[0],U=vt(g);d=m.getBoundingClientRect(),U.attr("width",d.width),U.attr("height",d.height);const y=(e.padding||0)/2;vt(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),vt(h).attr("transform","translate( "+(d.width(de.debug("Rough node insert CXC",A),R),":first-child"),k=a.insert(()=>(de.debug("Rough node insert CXC",A),A),":first-child")}else k=s.insert("rect",":first-child"),C=s.insert("line"),k.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),C.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+p.height+y).attr("y2",-d.height/2-y+p.height+y);return Tr(e,k),e.intersect=function(S){return lr.rect(e,S)},a}x(mCe,"rectWithTitle");async function UCe(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 K4(t,e,i)}x(UCe,"roundedRect");var Q1=8;async function yCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?Q1:Q1*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-Q1,f=h,p=Q1-u/2,g=-h/2,{cssStyles:m}=e,U=fr.svg(s),y=pr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-Q1,y:g+f},{x:p-Q1,y:g},{x:p,y:g},{x:p,y:g+f}],v=U.polygon(b.map(T=>[T.x,T.y]),y),w=s.insert(()=>v,":first-child");return w.attr("class","basic label-container outer-path").attr("style",ro(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${Q1/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Tr(e,w),e.intersect=function(T){return lr.rect(e,T)},s}x(yCe,"shadedProcess");async function bCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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:U}=e,y=fr.svg(o),b=pr(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const v=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Hn(v),T=y.path(w,b),k=o.insert(()=>T,":first-child");return k.attr("class","basic label-container outer-path"),U&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",U),n&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),k.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))})`),Tr(e,k),e.intersect=function(C){return lr.polygon(e,v,C)},o}x(bCe,"slopedRect");async function vCe(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 K4(t,e,a)}x(vCe,"squareRect");async function xCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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=fr.svg(o),g=pr(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},...vT(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...vT(h/2-d,0,d,50,270,450)],U=Hn(m),y=p.path(U,g),b=o.insert(()=>y,":first-child");return b.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Tr(e,b),e.intersect=function(v){return lr.polygon(e,m,v)},o}x(xCe,"stadium");async function wCe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return K4(t,e,r)}x(wCe,"state");function TCe(t,e,{config:{themeVariables:r}}){var b,v;const{labelStyles:n,nodeStyles:i}=ur(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=fr.svg(h),f=pr(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,U=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>p,":first-child");if(y.insert(()=>U),e.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),i&&y.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((v=(b=t.node())==null?void 0:b.ownerSVGElement)==null?void 0:v.id)??"",T=w?`${w}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${T})`)}return Tr(e,y),e.intersect=function(w){return lr.circle(e,(e.width??0)/2,w)},h}x(TCe,"stateEnd");function CCe(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=fr.svg(a).circle(0,0,e.width,L9t(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 Tr(e,s),e.intersect=function(u){return lr.circle(e,(e.width??7)/2,u)},a}x(CCe,"stateStart");var b2=8;async function kCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(e)),u=((e==null?void 0:e.width)??l.width)+2*b2+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*b2,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 U=fr.svg(o),y=pr(e,{}),b=U.rectangle(p,g,d+16,f,y),v=U.line(p+b2,g,p+b2,g+f,y),w=U.line(p+b2+d,g,p+b2+d,g+f,y);o.insert(()=>v,":first-child"),o.insert(()=>w,":first-child");const T=o.insert(()=>b,":first-child"),{cssStyles:k}=e;T.attr("class","basic label-container").attr("style",ro(k)),Tr(e,T)}else{const U=ap(o,d,f,m);n&&U.attr("style",n),Tr(e,U)}return e.intersect=function(U){return lr.polygon(e,m,U)},o}x(kCe,"subroutine");var F$=.2;async function SCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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-F$*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await Jr(t,e,Wr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=F$*u,d=F$*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,U=-g/2,{cssStyles:y}=e,b=fr.svg(o),v=pr(e,{}),w=[{x:m-h/2,y:U},{x:m+p+h/2,y:U},{x:m+p+h/2,y:U+g},{x:m-h/2,y:U+g}],T=[{x:m+p-h/2,y:U+g},{x:m+p+h/2,y:U+g},{x:m+p+h/2,y:U+g-d}];e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=Hn(w),C=b.path(k,v),S=Hn(T),E=b.path(S,{...v,fillStyle:"solid"}),A=o.insert(()=>E,":first-child");return A.insert(()=>C,":first-child"),A.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),Tr(e,A),e.intersect=function(R){return lr.polygon(e,w,R)},o}x(SCe,"taggedRect");async function ECe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await Jr(t,e,Wr(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=fr.svg(i),m=pr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const U=[{x:-o/2-o/2*.1,y:f/2},...Gg(-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}],y=-o/2+o/2*.1,b=-f/2-d*.4,v=[{x:y+o-h,y:(b+l)*1.3},{x:y+o,y:b+l-d},{x:y+o,y:(b+l)*.9},...Gg(y+o,(b+l)*1.25,y+o-h,(b+l)*1.3,-l*.02,.5)],w=Hn(U),T=g.path(w,m),k=Hn(v),C=g.path(k,{...m,fillStyle:"solid"}),S=i.insert(()=>C,":first-child");return S.insert(()=>T,":first-child"),S.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.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))})`),Tr(e,S),e.intersect=function(E){return lr.polygon(e,U,E)},i}x(ECe,"taggedWaveEdgedRectangle");async function ACe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await Jr(t,e,Wr(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),Tr(e,h),e.intersect=function(d){return lr.rect(e,d)},i}x(ACe,"text");var Qxt=x((t,e,r,n,i,a)=>`M${t},${e} + a${i},${a} 0,0,1 0,${-n} l${r},0 - a${i},${s} 0,0,1 0,${n} + a${i},${a} 0,0,1 0,${n} M${r},${-n} - a${i},${s} 0,0,0 0,${n} - l${-r},0`,"createCylinderPathD"),SSt=w((t,e,r,n,i,s)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${s} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${s} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),ESt=w((t,e,r,n,i,s)=>[`M${t+r/2},${-n/2}`,`a${i},${s} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Bhe=5,Fhe=10;async function bAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-s,e.heightx,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=kSt(0,0,f,u,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ro(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))})`),Tr(e,g),e.intersect=function(m){const y=or.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 b=d*d*(1-v*v/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),y.x+=b}return y},a}w(bAe,"tiltedCylinder");async function xAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=(e.look==="neo",i),a=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=((e==null?void 0:e.height)??l.height)+s,h=((e==null?void 0:e.width)??l.width)+a,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=dr.svg(o),m=fr(e,{}),y=Hn(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=ip(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return or.polygon(e,d,g)},o}w(xAe,"trapezoid");async function wAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-a*2,e.heightb,":first-child");return x.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Tr(e,x),e.intersect=function(T){return or.polygon(e,y,T)},u}w(wAe,"trapezoidalPentagon");var zhe=10,Vhe=10;async function TAe(t,e){var T;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-s)/2,e.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=h,e.height=d,Tr(e,x),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return de.info("Triangle intersect",e,p,C),or.polygon(e,p,C)},a}w(TAe,"triangle");async function CAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-s*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-a*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await Qr(t,e,qr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(s??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(a??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,b=v>0?v/2:0,x=dr.svg(l),T=fr(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const C=[{x:-d/2-b,y:g/2},...Hg(-d/2-b,g/2,d/2+b,g/2,p,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],S=Hn(C),k=x.path(S,T),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Tr(e,E),e.intersect=function(A){return or.polygon(e,C,A)},l}w(CAe,"waveEdgedRectangle");async function kAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.padding??0,s=e.look==="neo"?16:i,a=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-a-T*(20/9)),e.width=e.width-s*2}const{shapeSvg:o,bbox:l}=await Qr(t,e,qr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+s*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:p}=e,g=dr.svg(o),m=fr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...Hg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Hg(u/2,-f/2,-u/2,-f/2,d,-1)],v=Hn(y),b=g.path(v,m),x=o.insert(()=>b,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),Tr(e,x),e.intersect=function(T){return or.polygon(e,y,T)},o}w(kAe,"waveRectangle");var Ls=10;async function SAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-Ls,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-Ls,10));const{shapeSvg:a,bbox:o,label:l}=await Qr(t,e,qr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+Ls,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+s*2+Ls,d=u-Ls,f=h-Ls,p=-d/2,g=-f/2,{cssStyles:m}=e,y=dr.svg(a),v=fr(e,{}),b=[{x:p-Ls,y:g-Ls},{x:p-Ls,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Ls}],x=`M${p-Ls},${g-Ls} L${p+d},${g-Ls} L${p+d},${g+f} L${p-Ls},${g+f} L${p-Ls},${g-Ls} - M${p-Ls},${g} L${p+d},${g} - M${p},${g-Ls} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(x,v),C=a.insert(()=>T,":first-child");return C.attr("transform",`translate(${Ls/2}, ${Ls/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+Ls/2-(o.x-(o.left??0))}, ${-(o.height/2)+Ls/2-(o.y-(o.top??0))})`),Tr(e,C),e.intersect=function(S){return or.polygon(e,b,S)},a}w(SAe,"windowPane");var Hhe=new Set(["redux-color","redux-dark-color"]),ASt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function LJ(t,e){var K,q,oe,Z;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:s,rowOdd:a,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Q}=xr(),{background:ne}=Q,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ne}`]};await LJ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((q=u.er)==null?void 0:q.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=cr(e);if(r.attributes.length===0&&e.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Bl(e.label,u)+Q.labelPaddingX*20){const Q=v.width+h*2-(C+S+k+E);C+=Q/R,S+=Q/R,k>0&&(k+=Q/R),E>0&&(E+=Q/R)}const N=C+S+k+E,L=dr.svg(y),I=fr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;T.length>0&&($=T.reduce((Q,ne)=>Q+((ne==null?void 0:ne.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),B=-O/2,z=-D/2;if(y.selectAll("g:not(:first-child)").each((Q,ne,ie)=>{const me=xt(ie[ne]),te=me.attr("transform");let _e=0,$e=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(_e=parseFloat(ce[1]),$e=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?_e+=C:me.attr("class").includes("attribute-keys")?_e+=C+S:me.attr("class").includes("attribute-comment")&&(_e+=C+S+k))}me.attr("transform",`translate(${B+h/2+_e}, ${$e+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&Hhe.has(n)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const V=L.rectangle(B,z,O,D,I),F=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[Q,ne]of T.entries()){const me=(Q+1)%2===0&&ne.yOffset!==0,te=L.rectangle(B,v.height+z+(ne==null?void 0:ne.yOffset),O,ne==null?void 0:ne.rowHeight,{...I,fill:me?s:a,stroke:o});y.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const H=1e-4;let G=J2(B,v.height+z,O+B,v.height+z,H),W=L.polygon(G.map(Q=>[Q.x,Q.y]),I);if(y.insert(()=>W).attr("class","divider"),G=J2(C+B,v.height+z,C+B,D+z,H),W=L.polygon(G.map(Q=>[Q.x,Q.y]),I),y.insert(()=>W).attr("class","divider"),A){const Q=C+S+B;G=J2(Q,v.height+z,Q,D+z,H),W=L.polygon(G.map(ne=>[ne.x,ne.y]),I),y.insert(()=>W).attr("class","divider")}if(M){const Q=C+S+k+B;G=J2(Q,v.height+z,Q,D+z,H),W=L.polygon(G.map(ne=>[ne.x,ne.y]),I),y.insert(()=>W).attr("class","divider")}for(const Q of x){const ne=v.height+z+Q;G=J2(B,ne,O+B,ne,H),W=L.polygon(G.map(ie=>[ie.x,ie.y]),I),y.insert(()=>W).attr("class","divider")}if(Tr(e,F),g&&e.look!=="handDrawn")if(n!=null&&ASt.has(n))y.selectAll("path").attr("style",g);else{const Q=g.split(";"),ne=(Z=Q==null?void 0:Q.filter(ie=>ie.includes("stroke")))==null?void 0:Z.map(ie=>`${ie}`).join("; ");y.selectAll("path").attr("style",ne??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Q){return or.rect(e,Q)},y}w(LJ,"erBox");async function Q2(t,e,r,n=0,i=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",a);e!==Up(e)&&(e=Up(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ll(o,e,{width:Bl(e,r)+100,style:a,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(sf(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=xt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}w(Q2,"addText");function J2(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(J2,"lineToPolygon");async function EAe(t,e,r,n,i=r.class.padding??12){const s=n?0:3,a=t.insert("g").attr("class",qr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await Dk(o,{text:`«${b}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Dk(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=a.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await Dk(u,b,m,[b.parseClassifier()]);m+=x+s}p=u.node().getBBox().height,p<=0&&(p=i/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const b of e.methods){const x=await Dk(h,b,y,[b.parseClassifier()]);y+=x+s}let v=a.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=a.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=a.node().getBBox(),{shapeSvg:a,bbox:v}}w(EAe,"textHelper");async function Dk(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),s=xr();let a="useHtmlLabels"in e?e.useHtmlLabels:sf(s.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),ea(o)&&(a=!0);const l=await ll(i,NQ(I0(o)),{width:Bl(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let u,h=1;if(a){const d=l.children[0],f=xt(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 b;if(m.style.display="flex",m.style.flexDirection="column",g){const x=((b=s.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(x,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}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")&&xt(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(Dk,"addText");async function AAe(t,e){var L,I;const r=He(),{themeVariables:n}=r,{useGradient:i}=n,s=r.class.padding??12,a=s,o=e.useHtmlLabels??sf(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await EAe(t,e,r,o,a),{labelStyles:d,nodeStyles:f}=cr(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.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=dr.svg(u),y=fr(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let b=Math.max(e.height??0,h.height);const x=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=a:l.members.length>0&&l.methods.length===0&&(b+=a*2);const T=-v/2,C=-b/2;let S=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;x&&(S=s*2);const k=m.rectangle(T-s,C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),v+2*s,b+2*s+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const A=E.node().getBBox(),M=u.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,R=u.select(".label-group").node().getBBox().height-(g?s/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(M+R+C+s-(C-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(u.selectAll(".text").each(($,O,D)=>{var G,W;const B=xt(D[O]),z=B.attr("transform");let V=0;if(z){const q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);q&&(V=parseFloat(q[2]))}let F=V+C+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(B.attr("class").includes("methods-group")){const K=Math.max(P,a/2);x?F=Math.max(N,M+R+K+C+a*2+s)+a*2:F=M+R+K+C+a*4+s}l.members.length===0&&l.methods.length===0&&((G=r.class)!=null&&G.hideEmptyMembersBox)&&(l.annotations.length>0?F=V-a:F=V),o||(F-=4);let H=T;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(H=-((W=B.node())==null?void 0:W.getBBox().width)/2||0,u.selectAll("text").each(function(K,q,oe){window.getComputedStyle(oe[q]).textAnchor==="middle"&&(H=0)})),B.attr("transform",`translate(${H}, ${F})`)}),l.members.length>0||l.methods.length>0||g){const $=M+R+C+s,O=m.line(A.x,$,A.x+A.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=M+R+P+C+a*2+s,O=m.line(A.x,x?Math.max(N,$):$,A.x+A.width,(x?Math.max(N,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=$.exec(d);if(D){const B=D[0].replace("color","fill");u.selectAll("tspan").attr("style",B)}}}return Tr(e,E),e.intersect=function($){return or.rect(e,$)},u}w(AAe,"classBox");async function MAe(t,e){var A,M;const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const i=e,s=e,a=20,o=20,l="verifyMethod"in e,u=qr(e),{themeVariables:h}=He(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await od(p,`<<${i.type}>>`,0,e.labelStyle):g=await od(p,"<<Element>>",0,e.labelStyle);let m=g;const y=await od(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const R=await od(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=R;const P=await od(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const N=await od(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await od(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const R=await od(p,`${s.type?`Type: ${s.type}`:""}`,m,e.labelStyle);m+=R,await od(p,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,e.labelStyle)}const v=(((A=p.node())==null?void 0:A.getBBox().width)??200)+a,b=(((M=p.node())==null?void 0:M.getBBox().height)??200)+a,x=-v/2,T=-b/2,C=dr.svg(p),S=fr(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(x,T,v,b,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const R=e.colorIndex??0;p.attr("data-color-id",`color-${R%d.length}`)}if(p.selectAll(".label").each((R,P,N)=>{const L=xt(N[P]),I=L.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const D=O-b/2;let B=x+a/2;(P===0||P===1)&&(B=$),L.attr("transform",`translate(${B}, ${D+a})`)}),m>g+y+o){const R=T+g+y+o;let P;if(e.look==="neo"){const I=[[x,R],[x+v,R],[x+v,R+.001],[x,R+.001]];P=C.polygon(I,S)}else P=C.line(x,R,x+v,R,S);p.insert(()=>P).attr("class","divider")}return Tr(e,E),e.intersect=function(R){return or.rect(e,R)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}w(MAe,"requirementBox");async function od(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),s=He(),a=s.htmlLabels??!0,o=await ll(i,NQ(I0(e)),{width:Bl(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:n},s);let l;if(a){const u=o.children[0],h=xt(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(od,"addText");var MSt=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 RAe(t,e,{config:r}){var P,N;const{labelStyles:n,nodeStyles:i}=cr(e);e.labelStyle=n||"";const s=10,a=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Qr(t,e,qr(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 OF(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await OF(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await OF(o,"assigned"in e&&e.assigned||"",p);e.width=a;const b=10,x=(e==null?void 0:e.width)||0,T=Math.max(m.height,v.height)/2,C=Math.max(l.height+b*2,(e==null?void 0:e.height)||0)+T,S=-x/2,k=-C/2;u.attr("transform","translate("+(h-x/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-x/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+x/2-v.width-2*s)+", "+(-T+l.height/2)+")");let E;const{rx:A,ry:M}=e,{cssStyles:R}=e;if(e.look==="handDrawn"){const L=dr.svg(o),I=fr(e,{}),$=A||M?L.path(Cm(S,k,x,C,A||0),I):L.rectangle(S,k,x,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",R||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",k).attr("width",x).attr("height",C);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),$=S+2,O=k+Math.floor((A??0)/2),D=k+C-Math.floor((A??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",D).attr("stroke-width","4").attr("stroke",MSt(L))}}return Tr(e,E),e.height=C,e.intersect=function(L){return or.rect(e,L)},o}w(RAe,"kanbanItem");async function _Ae(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,qr(e)),l=s.width+10*a,u=s.height+8*a,h=.15*l,{cssStyles:d}=e,f=s.width+20,p=s.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const v=`M0 0 + a${i},${a} 0,0,0 0,${n} + l${-r},0`,"createCylinderPathD"),ewt=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),twt=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Khe=5,Zhe=10;async function MCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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.heightv,":first-child"),g=s.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Qxt(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ro(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))})`),Tr(e,g),e.intersect=function(m){const U=lr.rect(e,m),y=U.y-(e.y??0);if(h!=0&&(Math.abs(y)<(e.height??0)/2||Math.abs(y)==(e.height??0)/2&&Math.abs(U.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-y*y/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),U.x+=b}return U},s}x(MCe,"tiltedCylinder");async function RCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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=fr.svg(o),m=pr(e,{}),U=Hn(d),y=g.path(U,m);f=o.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=ap(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Tr(e,f),e.intersect=function(g){return lr.polygon(e,d,g)},o}x(RCe,"trapezoid");async function LCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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.heightb,":first-child");return v.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),Tr(e,v),e.intersect=function(w){return lr.polygon(e,U,w)},u}x(LCe,"trapezoidalPentagon");var Jhe=10,Qhe=10;async function ICe(t,e){var w;const{labelStyles:r,nodeStyles:n}=ur(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.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),e.width=h,e.height=d,Tr(e,v),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(T){return de.info("Triangle intersect",e,p,T),lr.polygon(e,p,T)},s}x(ICe,"triangle");async function NCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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 Jr(t,e,Wr(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,y=14-d,b=y>0?y/2:0,v=fr.svg(l),w=pr(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const T=[{x:-d/2-b,y:g/2},...Gg(-d/2-b,g/2,d/2+b,g/2,p,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],k=Hn(T),C=v.path(k,w),S=l.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.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))})`),Tr(e,S),e.intersect=function(E){return lr.polygon(e,T,E)},l}x(NCe,"waveEdgedRectangle");async function DCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await Jr(t,e,Wr(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=fr.svg(o),m=pr(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const U=[{x:-u/2,y:f/2},...Gg(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...Gg(u/2,-f/2,-u/2,-f/2,d,-1)],y=Hn(U),b=g.path(y,m),v=o.insert(()=>b,":first-child");return v.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),Tr(e,v),e.intersect=function(w){return lr.polygon(e,U,w)},o}x(DCe,"waveRectangle");var Ra=10;async function OCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(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-Ra,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Ra,10));const{shapeSvg:s,bbox:o,label:l}=await Jr(t,e,Wr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+Ra,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+Ra,d=u-Ra,f=h-Ra,p=-d/2,g=-f/2,{cssStyles:m}=e,U=fr.svg(s),y=pr(e,{}),b=[{x:p-Ra,y:g-Ra},{x:p-Ra,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Ra}],v=`M${p-Ra},${g-Ra} L${p+d},${g-Ra} L${p+d},${g+f} L${p-Ra},${g+f} L${p-Ra},${g-Ra} + M${p-Ra},${g} L${p+d},${g} + M${p},${g-Ra} L${p},${g+f}`;e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const w=U.path(v,y),T=s.insert(()=>w,":first-child");return T.attr("transform",`translate(${Ra/2}, ${Ra/2})`),T.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&T.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+Ra/2-(o.x-(o.left??0))}, ${-(o.height/2)+Ra/2-(o.y-(o.top??0))})`),Tr(e,T),e.intersect=function(k){return lr.polygon(e,b,k)},s}x(OCe,"windowPane");var ede=new Set(["redux-color","redux-dark-color"]),rwt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function BQ(t,e){var K,W,oe,Z;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=xr(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:J}=xr(),{background:ne}=J,ie={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ne}`]};await BQ(t,ie)}const u=xr();e.useHtmlLabels=u.htmlLabels;let h=((K=u.er)==null?void 0:K.diagramPadding)??10,d=((W=u.er)==null?void 0:W.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=ur(e);if(r.attributes.length===0&&e.label){const J={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Bl(e.label,u)+J.labelPaddingX*20){const J=y.width+h*2-(T+k+C+S);T+=J/R,k+=J/R,C>0&&(C+=J/R),S>0&&(S+=J/R)}const N=T+k+C+S,L=fr.svg(U),I=pr(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let P=0;w.length>0&&(P=w.reduce((J,ne)=>J+((ne==null?void 0:ne.rowHeight)??0),0));const O=Math.max(_.width+h*2,(e==null?void 0:e.width)||0,N),D=Math.max((P??0)+y.height,(e==null?void 0:e.height)||0),B=-O/2,F=-D/2;if(U.selectAll("g:not(:first-child)").each((J,ne,ie)=>{const me=vt(ie[ne]),te=me.attr("transform");let Re=0,Pe=0;if(te){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(te);ce&&(Re=parseFloat(ce[1]),Pe=parseFloat(ce[2]),me.attr("class").includes("attribute-name")?Re+=T:me.attr("class").includes("attribute-keys")?Re+=T+k:me.attr("class").includes("attribute-comment")&&(Re+=T+k+C))}me.attr("transform",`translate(${B+h/2+Re}, ${Pe+F+y.height+d/2})`)}),U.select(".name").attr("transform","translate("+-y.width/2+", "+(F+d/2)+")"),n!=null&&ede.has(n)){const J=r.colorIndex??0;U.attr("data-color-id",`color-${J%l.length}`)}const z=L.rectangle(B,F,O,D,I),$=U.insert(()=>z,":first-child").attr("class","outer-path").attr("style",f.join(""));v.push(0);for(const[J,ne]of w.entries()){const me=(J+1)%2===0&&ne.yOffset!==0,te=L.rectangle(B,y.height+F+(ne==null?void 0:ne.yOffset),O,ne==null?void 0:ne.rowHeight,{...I,fill:me?a:s,stroke:o});U.insert(()=>te,"g.label").attr("style",f.join("")).attr("class",`row-rect-${me?"even":"odd"}`)}const V=1e-4;let H=ry(B,y.height+F,O+B,y.height+F,V),G=L.polygon(H.map(J=>[J.x,J.y]),I);if(U.insert(()=>G).attr("class","divider"),H=ry(T+B,y.height+F,T+B,D+F,V),G=L.polygon(H.map(J=>[J.x,J.y]),I),U.insert(()=>G).attr("class","divider"),E){const J=T+k+B;H=ry(J,y.height+F,J,D+F,V),G=L.polygon(H.map(ne=>[ne.x,ne.y]),I),U.insert(()=>G).attr("class","divider")}if(A){const J=T+k+C+B;H=ry(J,y.height+F,J,D+F,V),G=L.polygon(H.map(ne=>[ne.x,ne.y]),I),U.insert(()=>G).attr("class","divider")}for(const J of v){const ne=y.height+F+J;H=ry(B,ne,O+B,ne,V),G=L.polygon(H.map(ie=>[ie.x,ie.y]),I),U.insert(()=>G).attr("class","divider")}if(Tr(e,$),g&&e.look!=="handDrawn")if(n!=null&&rwt.has(n))U.selectAll("path").attr("style",g);else{const J=g.split(";"),ne=(Z=J==null?void 0:J.filter(ie=>ie.includes("stroke")))==null?void 0:Z.map(ie=>`${ie}`).join("; ");U.selectAll("path").attr("style",ne??""),U.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(J){return lr.rect(e,J)},U}x(BQ,"erBox");async function ty(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!==jp(e)&&(e=jp(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=o.node().appendChild(await ll(o,e,{width:Bl(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(sf(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=vt(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(ty,"addText");function ry(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(ry,"lineToPolygon");async function _Ce(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",Wr(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 b=e.annotations[0];await B3(o,{text:`«${b}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await B3(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 b of e.members){const v=await B3(u,b,m,[b.parseClassifier()]);m+=v+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let U=0;for(const b of e.methods){const v=await B3(h,b,U,[b.parseClassifier()]);U+=v+a}let y=s.node().getBBox();if(o!==null){const b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}x(_Ce,"textHelper");async function B3(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=xr();let s="useHtmlLabels"in e?e.useHtmlLabels:sf(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Qa(o)&&(s=!0);const l=await ll(i,FJ(N0(o)),{width:Bl(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=vt(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(U=>{function y(){var b;if(m.style.display="flex",m.style.flexDirection="column",g){const v=((b=a.fontSize)==null?void 0:b.toString())??window.getComputedStyle(document.body).fontSize,T=parseInt(v,10)*5+"px";m.style.minWidth=T,m.style.maxWidth=T}else m.style.width="100%";U(m)}x(y,"setupImage"),setTimeout(()=>{m.complete&&y()}),m.addEventListener("error",y),m.addEventListener("load",y)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&vt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(B3,"addText");async function PCe(t,e){var L,I;const r=He(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??sf(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await _Ce(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=ur(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((L=l.styles)==null?void 0:L.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=fr.svg(u),U=pr(e,{});e.look!=="handDrawn"&&(U.roughness=0,U.fillStyle="solid");const y=Math.max(e.width??0,h.width);let b=Math.max(e.height??0,h.height);const v=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=s:l.members.length>0&&l.methods.length===0&&(b+=s*2);const w=-y/2,T=-b/2;let k=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;v&&(k=a*2);const C=m.rectangle(w-a,T-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),y+2*a,b+2*a+k,U),S=u.insert(()=>C,":first-child");S.attr("class","basic label-container outer-path");const E=S.node().getBBox(),A=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,R=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,_=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,N=(A+R+T+a-(T-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each((P,O,D)=>{var H,G;const B=vt(D[O]),F=B.attr("transform");let z=0;if(F){const W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);W&&(z=parseFloat(W[2]))}let $=z+T+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(B.attr("class").includes("methods-group")){const K=Math.max(_,s/2);v?$=Math.max(N,A+R+K+T+s*2+a)+s*2:$=A+R+K+T+s*4+a}l.members.length===0&&l.methods.length===0&&((H=r.class)!=null&&H.hideEmptyMembersBox)&&(l.annotations.length>0?$=z-s:$=z),o||($-=4);let V=w;(B.attr("class").includes("label-group")||B.attr("class").includes("annotation-group"))&&(V=-((G=B.node())==null?void 0:G.getBBox().width)/2||0,u.selectAll("text").each(function(K,W,oe){window.getComputedStyle(oe[W]).textAnchor==="middle"&&(V=0)})),B.attr("transform",`translate(${V}, ${$})`)}),l.members.length>0||l.methods.length>0||g){const P=A+R+T+a,O=m.line(E.x,P,E.x+E.width,P+.001,U);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const P=A+R+_+T+s*2+a,O=m.line(E.x,v?Math.max(N,P):P,E.x+E.width,(v?Math.max(N,P):P)+.001,U);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),S.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 P=RegExp(/color\s*:\s*([^;]*)/),O=P.exec(p);if(O){const D=O[0].replace("color","fill");u.selectAll("tspan").attr("style",D)}else if(d){const D=P.exec(d);if(D){const B=D[0].replace("color","fill");u.selectAll("tspan").attr("style",B)}}}return Tr(e,S),e.intersect=function(P){return lr.rect(e,P)},u}x(PCe,"classBox");async function BCe(t,e){var E,A;const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=Wr(e),{themeVariables:h}=He(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await ld(p,`<<${i.type}>>`,0,e.labelStyle):g=await ld(p,"<<Element>>",0,e.labelStyle);let m=g;const U=await ld(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=U+o,l){const R=await ld(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=R;const _=await ld(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=_;const N=await ld(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=N,await ld(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const R=await ld(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=R,await ld(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((E=p.node())==null?void 0:E.getBBox().width)??200)+s,b=(((A=p.node())==null?void 0:A.getBBox().height)??200)+s,v=-y/2,w=-b/2,T=fr.svg(p),k=pr(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const C=T.rectangle(v,w,y,b,k),S=p.insert(()=>C,":first-child");if(S.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const R=e.colorIndex??0;p.attr("data-color-id",`color-${R%d.length}`)}if(p.selectAll(".label").each((R,_,N)=>{const L=vt(N[_]),I=L.attr("transform");let P=0,O=0;if(I){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);z&&(P=parseFloat(z[1]),O=parseFloat(z[2]))}const D=O-b/2;let B=v+s/2;(_===0||_===1)&&(B=P),L.attr("transform",`translate(${B}, ${D+s})`)}),m>g+U+o){const R=w+g+U+o;let _;if(e.look==="neo"){const I=[[v,R],[v+y,R],[v+y,R+.001],[v,R+.001]];_=T.polygon(I,k)}else _=T.line(v,R,v+y,R,k);p.insert(()=>_).attr("class","divider")}return Tr(e,S),e.intersect=function(R){return lr.rect(e,R)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(BCe,"requirementBox");async function ld(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=He(),s=a.htmlLabels??!0,o=await ll(i,FJ(N0(e)),{width:Bl(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=vt(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(ld,"addText");var nwt=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function $Ce(t,e,{config:r}){var _,N;const{labelStyles:n,nodeStyles:i}=ur(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await Jr(t,e,Wr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((_=r==null?void 0:r.kanban)!=null&&_.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 $$(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await $$(o,"ticket"in e&&e.ticket||"",p);const{label:U,bbox:y}=await $$(o,"assigned"in e&&e.assigned||"",p);e.width=s;const b=10,v=(e==null?void 0:e.width)||0,w=Math.max(m.height,y.height)/2,T=Math.max(l.height+b*2,(e==null?void 0:e.height)||0)+w,k=-v/2,C=-T/2;u.attr("transform","translate("+(h-v/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-v/2)+", "+(-w+l.height/2)+")"),U.attr("transform","translate("+(h+v/2-y.width-2*a)+", "+(-w+l.height/2)+")");let S;const{rx:E,ry:A}=e,{cssStyles:R}=e;if(e.look==="handDrawn"){const L=fr.svg(o),I=pr(e,{}),P=E||A?L.path(k1(k,C,v,T,E||0),I):L.rectangle(k,C,v,T,I);S=o.insert(()=>P,":first-child"),S.attr("class","basic label-container").attr("style",R||null)}else{S=o.insert("rect",":first-child"),S.attr("class","basic label-container __APA__").attr("style",i).attr("rx",E??5).attr("ry",A??5).attr("x",k).attr("y",C).attr("width",v).attr("height",T);const L="priority"in e&&e.priority;if(L){const I=o.append("line"),P=k+2,O=C+Math.floor((E??0)/2),D=C+T-Math.floor((E??0)/2);I.attr("x1",P).attr("y1",O).attr("x2",P).attr("y2",D).attr("stroke-width","4").attr("stroke",nwt(L))}}return Tr(e,S),e.height=T,e.intersect=function(L){return lr.rect(e,L)},o}x($Ce,"kanbanItem");async function FCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Jr(t,e,Wr(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 U;const y=`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 @@ -1191,7 +1861,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 b=dr.svg(i),x=fr(e,{}),T=b.path(v,x);y=i.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",ro(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})`),Tr(e,y),e.calcIntersect=function(b,x){return or.rect(b,x)},e.intersect=function(b){return de.info("Bang intersect",e,b),or.rect(e,b)},i}w(_Ae,"bang");async function LAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,qr(e)),l=s.width+2*a,u=s.height+2*a,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 b=fr.svg(i),v=pr(e,{}),w=b.path(y,v);U=i.insert(()=>w,":first-child"),U.attr("class","basic label-container").attr("style",ro(d))}else U=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return U.attr("transform",`translate(${-g/2}, ${-m/2})`),Tr(e,U),e.calcIntersect=function(b,v){return lr.rect(b,v)},e.intersect=function(b){return de.info("Bang intersect",e,b),lr.rect(e,b)},i}x(FCe,"bang");async function zCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Jr(t,e,Wr(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 U=`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} @@ -1205,7 +1875,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=dr.svg(i),b=fr(e,{}),x=v.path(y,b);m=i.insert(()=>x,":first-child"),m.attr("class","basic label-container").attr("style",ro(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Tr(e,m),e.calcIntersect=function(v,b){return or.rect(v,b)},e.intersect=function(v){return de.info("Cloud intersect",e,v),or.rect(e,v)},i}w(LAe,"cloud");async function IAe(t,e){const{labelStyles:r,nodeStyles:n}=cr(e);e.labelStyle=r;const{shapeSvg:i,bbox:s,halfPadding:a,label:o}=await Qr(t,e,qr(e)),l=s.width+8*a,u=s.height+2*a,h=5,d=e.look==="neo"?` + H0 V0 Z`;if(e.look==="handDrawn"){const y=fr.svg(i),b=pr(e,{}),v=y.path(U,b);m=i.insert(()=>v,":first-child"),m.attr("class","basic label-container").attr("style",ro(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",U);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Tr(e,m),e.calcIntersect=function(y,b){return lr.rect(y,b)},e.intersect=function(y){return de.info("Cloud intersect",e,y),lr.rect(e,y)},i}x(zCe,"cloud");async function VCe(t,e){const{labelStyles:r,nodeStyles:n}=ur(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await Jr(t,e,Wr(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} @@ -1225,147 +1895,147 @@ 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(${-s.width/2}, ${-s.height/2})`),i.append(()=>o.node()),Tr(e,f),e.calcIntersect=function(p,g){return or.rect(p,g)},e.intersect=function(p){return or.rect(e,p)},i}w(IAe,"defaultMindmapNode");async function NAe(t,e){const r={padding:e.padding??0};return _J(t,e,r)}w(NAe,"mindmapCircle");var RSt=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:uAe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:oAe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:hAe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:gAe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:N6e},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:O6e},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:_J},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:_Ae},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:LAe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:iAe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:V6e},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Z6e},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:K6e},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:xAe},{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:Y6e},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:P6e},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:vAe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:S6e},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:lAe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:pAe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:fAe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:F6e},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:H6e},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:R6e},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_6e},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:L6e},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Q6e},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:CAe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:z6e},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:bAe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:J6e},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:I6e},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:D6e},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:TAe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:SAe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:$6e},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:wAe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:B6e},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:cAe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:rAe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tAe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:k6e},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:M6e},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:yAe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:mAe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:kAe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:sAe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:eAe}],_St=w(()=>{const e=[...Object.entries({state:dAe,choice:E6e,note:nAe,rectWithTitle:aAe,labelRect:X6e,iconSquare:U6e,iconCircle:W6e,icon:G6e,iconRounded:q6e,imageSquare:j6e,anchor:T6e,kanbanItem:RAe,mindmapCircle:NAe,defaultMindmapNode:IAe,classBox:AAe,erBox:LJ,requirementBox:MAe}),...RSt.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),OAe=_St();function DAe(t){return t in OAe}w(DAe,"isValidShape");var CD=new Map;async function s7(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?OAe[e.shape]:void 0;if(!s)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let a;r.config.securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a??null),i=await s(n,e,r)}else i=await s(t,e,r),n=i;return n.attr("data-look",ro(e.look)),e.tooltip&&i.attr("title",e.tooltip),CD.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(s7,"insertNode");var LSt=w((t,e)=>{CD.set(e.id,t)},"setNodeElem"),PAe=w(()=>{CD.clear()},"clear"),TL=w(t=>{const e=CD.get(t.id);de.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"),Ad=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"),Wa={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},Ghe={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Pk(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=as(t),e=as(e);const[r,n]=[t.x,t.y],[i,s]=[e.x,e.y],a=i-r,o=s-n;return{angle:Math.atan(o/a),deltaX:a,deltaY:o}}w(Pk,"calculateDeltaAndAngle");var as=w(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),$Ae=w(t=>({x:w(function(e,r,n){let i=0;const s=as(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Wa,t.arrowTypeEnd)){const{angle:p,deltaX:g}=Pk(n[n.length-1],n[n.length-2]);i=Wa[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const a=Math.abs(as(e).x-as(n[n.length-1]).x),o=Math.abs(as(e).y-as(n[n.length-1]).y),l=Math.abs(as(e).x-as(n[0]).x),u=Math.abs(as(e).y-as(n[0]).y),h=Wa[t.arrowTypeStart],d=Wa[t.arrowTypeEnd],f=1;if(a0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Wa,t.arrowTypeEnd)){const{angle:p,deltaY:g}=Pk(n[n.length-1],n[n.length-2]);i=Wa[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const a=Math.abs(as(e).y-as(n[n.length-1]).y),o=Math.abs(as(e).x-as(n[n.length-1]).x),l=Math.abs(as(e).y-as(n[0]).y),u=Math.abs(as(e).x-as(n[0]).x),h=Wa[t.arrowTypeStart],d=Wa[t.arrowTypeEnd],f=1;if(a0&&o0&&u{e.arrowTypeStart&&Whe(t,"start",e.arrowTypeStart,r,n,i,s,a),e.arrowTypeEnd&&Whe(t,"end",e.arrowTypeEnd,r,n,i,s,a)},"addEdgeMarkers"),NSt={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}},OSt=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Whe=w((t,e,r,n,i,s,a=!1,o)=>{var g;const l=NSt[r],u=l&&OSt.includes(l.type);if(!l){de.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${s}-${h}${e==="start"?"Start":"End"}${a&&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 b=v.cloneNode(!0);b.id=y,b.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",o),l.fill&&T.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),DSt=w(t=>{var e,r;return typeof t=="string"?t:(r=(e=He())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),y6=new Map,Ys=new Map,BAe=w(()=>{y6.clear(),Ys.clear()},"clear"),WC=w(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),CL=w(async(t,e)=>{const r=He();let n=yi(r);const{labelStyles:i}=cr(e);e.labelStyle=i;const s=t.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await ll(t,e.label,{style:WC(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);a.node().appendChild(u),de.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=xt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=xt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}a.attr("transform",Ad(d,n)),y6.set(e.id,s),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 cg(g,e.startLabelLeft,WC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],b=xt(m);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Ad(y,n)),Ys.get(e.id)||Ys.set(e.id,{}),Ys.get(e.id).startLeft=p,$k(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await cg(g,e.startLabelRight,WC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],b=xt(m);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Ad(y,n)),Ys.get(e.id)||Ys.set(e.id,{}),Ys.get(e.id).startRight=p,$k(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await cg(p,e.endLabelLeft,WC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],b=xt(m);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Ad(y,n)),Ys.get(e.id)||Ys.set(e.id,{}),Ys.get(e.id).endLeft=p,$k(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await cg(p,e.endLabelRight,WC(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],b=xt(m);y=v.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",Ad(y,n)),Ys.get(e.id)||Ys.set(e.id,{}),Ys.get(e.id).endRight=p,$k(f,e.endLabelRight)}return u},"insertEdgeLabel");function $k(t,e){yi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w($k,"setTerminalWidth");var FAe=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,y6.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=U3(n);if(t.label){const s=y6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=Ys.get(t.id).startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Ys.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Ys.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Ys.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),PSt=w((t,e)=>{var a;if(!(t!=null&&t.isLabelEdge)||!((a=t==null?void 0:t.id)!=null&&a.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y);return i<.001||s<.001?e:s>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),$St=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),BSt=w((t,e,r)=>{de.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()),Tr(e,f),e.calcIntersect=function(p,g){return lr.rect(p,g)},e.intersect=function(p){return lr.rect(e,p)},i}x(VCe,"defaultMindmapNode");async function HCe(t,e){const r={padding:e.padding??0};return PQ(t,e,r)}x(HCe,"mindmapCircle");var iwt=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:vCe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:UCe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:xCe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:kCe},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:HTe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:GTe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:PQ},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:FCe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zCe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:pCe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ZTe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:oCe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:sCe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:RCe},{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:iCe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:qTe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:ACe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:OTe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:yCe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:CCe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:TCe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:XTe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:JTe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:$Te},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:FTe},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:zTe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:lCe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:NCe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:KTe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:MCe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:cCe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:VTe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:WTe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:ICe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:OCe},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:jTe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:LCe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:YTe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:bCe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:dCe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:hCe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:DTe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:BTe},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:ECe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:SCe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:DCe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:gCe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:uCe}],awt=x(()=>{const e=[...Object.entries({state:wCe,choice:_Te,note:fCe,rectWithTitle:mCe,labelRect:aCe,iconSquare:rCe,iconCircle:eCe,icon:QTe,iconRounded:tCe,imageSquare:nCe,anchor:ITe,kanbanItem:$Ce,mindmapCircle:HCe,defaultMindmapNode:VCe,classBox:PCe,erBox:BQ,requirementBox:BCe}),...iwt.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),GCe=awt();function WCe(t){return t in GCe}x(WCe,"isValidShape");var SO=new Map;async function ck(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?GCe[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",ro(e.look)),e.tooltip&&i.attr("title",e.tooltip),SO.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(ck,"insertNode");var swt=x((t,e)=>{SO.set(e.id,t)},"setNodeElem"),qCe=x(()=>{SO.clear()},"clear"),SL=x(t=>{const e=SO.get(t.id);de.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"),Ad=x((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),Gs={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},tde={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function $3(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=oa(t),e=oa(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x($3,"calculateDeltaAndAngle");var oa=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),jCe=x(t=>({x:x(function(e,r,n){let i=0;const a=oa(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Gs,t.arrowTypeEnd)){const{angle:p,deltaX:g}=$3(n[n.length-1],n[n.length-2]);i=Gs[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(oa(e).x-oa(n[n.length-1]).x),o=Math.abs(oa(e).y-oa(n[n.length-1]).y),l=Math.abs(oa(e).x-oa(n[0]).x),u=Math.abs(oa(e).y-oa(n[0]).y),h=Gs[t.arrowTypeStart],d=Gs[t.arrowTypeEnd],f=1;if(s0&&o0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Gs,t.arrowTypeEnd)){const{angle:p,deltaY:g}=$3(n[n.length-1],n[n.length-2]);i=Gs[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(oa(e).y-oa(n[n.length-1]).y),o=Math.abs(oa(e).x-oa(n[n.length-1]).x),l=Math.abs(oa(e).y-oa(n[0]).y),u=Math.abs(oa(e).x-oa(n[0]).x),h=Gs[t.arrowTypeStart],d=Gs[t.arrowTypeEnd],f=1;if(s0&&o0&&u{e.arrowTypeStart&&rde(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&rde(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),lwt={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}},cwt=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],rde=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=lwt[r],u=l&&cwt.includes(l.type);if(!l){de.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,"_"),U=`${p}_${m}`;if(!document.getElementById(U)){const y=document.getElementById(p);if(y){const b=y.cloneNode(!0);b.id=U,b.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=y.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${U})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),uwt=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=He())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),xT=new Map,ja=new Map,YCe=x(()=>{xT.clear(),ja.clear()},"clear"),j9=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),EL=x(async(t,e)=>{const r=He();let n=yi(r);const{labelStyles:i}=ur(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 ll(t,e.label,{style:j9(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),de.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=vt(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=vt(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Ad(d,n)),xT.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 ug(g,e.startLabelLeft,j9(e.labelStyle)||"",!1,!1);f=m;let U=m.getBBox();if(n){const y=m.children[0],b=vt(m);U=y.getBoundingClientRect(),b.attr("width",U.width),b.attr("height",U.height)}g.attr("transform",Ad(U,n)),ja.get(e.id)||ja.set(e.id,{}),ja.get(e.id).startLeft=p,F3(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await ug(g,e.startLabelRight,j9(e.labelStyle)||"",!1,!1);f=m;let U=m.getBBox();if(n){const y=m.children[0],b=vt(m);U=y.getBoundingClientRect(),b.attr("width",U.width),b.attr("height",U.height)}g.attr("transform",Ad(U,n)),ja.get(e.id)||ja.set(e.id,{}),ja.get(e.id).startRight=p,F3(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await ug(p,e.endLabelLeft,j9(e.labelStyle)||"",!1,!1);f=m;let U=m.getBBox();if(n){const y=m.children[0],b=vt(m);U=y.getBoundingClientRect(),b.attr("width",U.width),b.attr("height",U.height)}g.attr("transform",Ad(U,n)),ja.get(e.id)||ja.set(e.id,{}),ja.get(e.id).endLeft=p,F3(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await ug(p,e.endLabelRight,j9(e.labelStyle)||"",!1,!1);f=m;let U=m.getBBox();if(n){const y=m.children[0],b=vt(m);U=y.getBoundingClientRect(),b.attr("width",U.width),b.attr("height",U.height)}g.attr("transform",Ad(U,n)),ja.get(e.id)||ja.set(e.id,{}),ja.get(e.id).endRight=p,F3(f,e.endLabelRight)}return u},"insertEdgeLabel");function F3(t,e){yi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(F3,"setTerminalWidth");var XCe=x((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,xT.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=X4(n);if(t.label){const a=xT.get(t.id);let s=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.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=ja.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=Kr.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=ja.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Kr.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=ja.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Kr.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=ja.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),hwt=x((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),dwt=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),fwt=x((t,e,r)=>{de.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,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(de.info("abc88 checking point",s,e),!$St(e,s)&&!i){const a=BSt(e,n,s);de.debug("abc88 inside",s,n,a),de.debug("abc88 intersection",a,e);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?de.warn("abc88 no intersect",a,r):r.push(a),i=!0}else de.warn("abc88 outside",s,n),n=s,i||r.push(s)}),de.debug("returning points",r),r},"cutPathAtIntersect");function zAe(t){const e=[],r=[];for(let n=1;n5&&Math.abs(s.y-i.y)>5||i.y===s.y&&s.x===a.x&&Math.abs(s.x-i.x)>5&&Math.abs(s.y-a.y)>5)&&(e.push(s),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}w(zAe,"extractCornerPoints");var Uhe=w(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,s=Math.sqrt(n*n+i*i),a=r/s;return{x:e.x-a*n,y:e.y-a*i}},"findAdjacentPoint"),FSt=w(function(t){const{cornerPointPositions:e}=zAe(t),r=[];for(let n=0;n10&&Math.abs(s.y-i.y)>=10){de.debug("Corner point fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));const p=5;a.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 de.debug("Corner point skipping fixing",Math.abs(s.x-i.x),Math.abs(s.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),zSt=w((t,e,r)=>{const n=t-e-r,i=2,s=2,a=i+s,o=Math.floor(n/a),l=Array(o).fill(`${i} ${s}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),IJ=w(function(t,e,r,n,i,s,a,o=!1){var D;if(!a)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=He();let h=e.points,d=!1;const f=i;var p=s;const g=[];for(const B in e.cssCompiledStyles)iJ(B)||g.push(e.cssCompiledStyles[B]);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 B=h.slice(1,-1),z=B[0],V=B[B.length-1],F=.5,H=Math.abs(h[h.length-1].x-V.x)!Number.isNaN(B.y));const v=DSt(e.curve);v!=="rounded"&&(y=FSt(y));let b=BS;switch(v){case"linear":b=BS;break;case"basis":b=h6;break;case"cardinal":b=ake;break;case"bumpX":b=tke;break;case"bumpY":b=rke;break;case"catmullRom":b=lke;break;case"monotoneX":b=pke;break;case"monotoneY":b=gke;break;case"natural":b=yke;break;case"step":b=vke;break;case"stepAfter":b=xke;break;case"stepBefore":b=bke;break;case"rounded":b=BS;break;default:b=h6}const{x,y:T}=$Ae(e),C=u6().x(x).y(T).curve(b);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?VAe(HAe(y,e),5):C(y);const A=Array.isArray(e.style)?e.style:[e.style];let M=A.find(B=>B==null?void 0:B.startsWith("stroke:")),R="";e.animate&&(R="edge-animation-fast"),e.animation&&(R="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const B=dr.svg(t);Object.assign([],y);const z=B.path(E,{roughness:.3,seed:l});S+=" transition",k=xt(z).select("path").attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(R?" "+R:"")).attr("style",A?A.reduce((F,H)=>F+";"+H,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const B=g.join(";"),z=A?A.reduce((K,q)=>K+q+";",""):"",V=(B?B+";"+z+";":z)+";"+(A?A.reduce((K,q)=>K+";"+q,""):"");k=t.append("path").attr("d",E).attr("id",`${a}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(R?" "+R:"")).attr("style",V),M=(D=V.match(/stroke:([^;]+)/))==null?void 0:D[1],P=e.animate===!0||!!e.animation||B.includes("animation");const F=k.node(),H=typeof F.getTotalLength=="function"?F.getTotalLength():0,G=Ghe[e.arrowTypeStart]||0,W=Ghe[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const q=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?zSt(H,G,W):`0 ${G} ${H-G-W} ${W}`}; stroke-dashoffset: 0;`;k.attr("style",q+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",ro(e.look)),e.showPoints&&y.forEach(B=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",B.x).attr("cy",B.y)});let N="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),de.info("arrowTypeStart",e.arrowTypeStart),de.info("arrowTypeEnd",e.arrowTypeEnd);const L=!P&&(e==null?void 0:e.look)==="neo";ISt(k,e,N,a,n,L,M);const I=Math.floor(h.length/2),$=h[I];Kr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function VAe(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let s=0;s({...i}));if(t.length>=2&&Wa[e.arrowTypeStart]){const i=Wa[e.arrowTypeStart],s=t[0],a=t[1],{angle:o}=yq(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=s.x+l,r[0].y=s.y+u}const n=t.length;if(n>=2&&Wa[e.arrowTypeEnd]){const i=Wa[e.arrowTypeEnd],s=t[n-1],a=t[n-2],{angle:o}=yq(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=s.x-l,r[n-1].y=s.y-u}return r}w(HAe,"applyMarkerOffsetsToPoints");var VSt=w((t,e,r,n)=>{e.forEach(i=>{uEt[i](t,r,n)})},"insertMarkers"),HSt=w((t,e,r)=>{de.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"),GSt=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"),WSt=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"),qSt=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"),USt=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"),jSt=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"),YSt=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"),XSt=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"),KSt=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"),ZSt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{transitionColor:s}=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",`${s}`)},"barbNeo"),QSt=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"),JSt=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"),eEt=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"),tEt=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"),rEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s}=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",`${s}`),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",`${s}`)},"only_one_neo"),nEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=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",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);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",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),iEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s}=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",`${s}`),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",`${s}`)},"one_or_more_neo"),sEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s,mainBkg:a}=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",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);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",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),aEt=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{de.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(de.info("abc88 checking point",a,e),!dwt(e,a)&&!i){const s=fwt(e,n,a);de.debug("abc88 inside",a,n,s),de.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)?de.warn("abc88 no intersect",s,r):r.push(s),i=!0}else de.warn("abc88 outside",a,n),n=a,i||r.push(a)}),de.debug("returning points",r),r},"cutPathAtIntersect");function KCe(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(KCe,"extractCornerPoints");var ide=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),pwt=x(function(t){const{cornerPointPositions:e}=KCe(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){de.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 de.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"),gwt=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),$Q=x(function(t,e,r,n,i,a,s,o=!1){var D;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}=He();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const B in e.cssCompiledStyles)hQ(B)||g.push(e.cssCompiledStyles[B]);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 B=h.slice(1,-1),F=B[0],z=B[B.length-1],$=.5,V=Math.abs(h[h.length-1].x-z.x)<$&&Math.abs(h[h.length-1].y-z.y)<$,H=f.intersect(F),G=V?z:p.intersect(z),K=Math.abs(G.x-z.x)<$&&Math.abs(G.y-z.y)<$,oe=Math.abs(H.x-F.x)<$&&Math.abs(H.y-F.y)<$?[]:[H],Z=K?[]:[G];h=[...oe,...B,...Z]}h=hwt(e,h)}else p.intersect&&f.intersect&&!o&&(h=h.slice(1,e.points.length-1),h.unshift(f.intersect(h[0])),h.push(p.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));e.toCluster&&(de.info("to cluster abc88",r.get(e.toCluster)),h=nde(e.points,r.get(e.toCluster).node),d=!0),e.fromCluster&&(de.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(h,null,2)),h=nde(h.reverse(),r.get(e.fromCluster).node).reverse(),d=!0);let U=h.filter(B=>!Number.isNaN(B.y));const y=uwt(e.curve);y!=="rounded"&&(U=pwt(U));let b=Vx;switch(y){case"linear":b=Vx;break;case"basis":b=gT;break;case"cardinal":b=m3e;break;case"bumpX":b=h3e;break;case"bumpY":b=d3e;break;case"catmullRom":b=y3e;break;case"monotoneX":b=C3e;break;case"monotoneY":b=k3e;break;case"natural":b=E3e;break;case"step":b=A3e;break;case"stepAfter":b=R3e;break;case"stepBefore":b=M3e;break;case"rounded":b=Vx;break;default:b=gT}const{x:v,y:w}=jCe(e),T=pT().x(v).y(w).curve(b);let k;switch(e.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-invisible";break;default:k="edge-thickness-normal"}switch(e.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break;default:k+=" edge-pattern-solid"}let C,S=y==="rounded"?ZCe(JCe(U,e),5):T(U);const E=Array.isArray(e.style)?e.style:[e.style];let A=E.find(B=>B==null?void 0:B.startsWith("stroke:")),R="";e.animate&&(R="edge-animation-fast"),e.animation&&(R="edge-animation-"+e.animation);let _=!1;if(e.look==="handDrawn"){const B=fr.svg(t);Object.assign([],U);const F=B.path(S,{roughness:.3,seed:l});k+=" transition",C=vt(F).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(R?" "+R:"")).attr("style",E?E.reduce(($,V)=>$+";"+V,""):"");let z=C.attr("d");C.attr("d",z),t.node().appendChild(C.node())}else{const B=g.join(";"),F=E?E.reduce((K,W)=>K+W+";",""):"",z=(B?B+";"+F+";":F)+";"+(E?E.reduce((K,W)=>K+";"+W,""):"");C=t.append("path").attr("d",S).attr("id",`${s}-${e.id}`).attr("class"," "+k+(e.classes?" "+e.classes:"")+(R?" "+R:"")).attr("style",z),A=(D=z.match(/stroke:([^;]+)/))==null?void 0:D[1],_=e.animate===!0||!!e.animation||B.includes("animation");const $=C.node(),V=typeof $.getTotalLength=="function"?$.getTotalLength():0,H=tde[e.arrowTypeStart]||0,G=tde[e.arrowTypeEnd]||0;if(e.look==="neo"&&!_){const W=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?gwt(V,H,G):`0 ${H} ${V-H-G} ${G}`}; stroke-dashoffset: 0;`;C.attr("style",W+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",ro(e.look)),e.showPoints&&U.forEach(B=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",B.x).attr("cy",B.y)});let N="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),de.info("arrowTypeStart",e.arrowTypeStart),de.info("arrowTypeEnd",e.arrowTypeEnd);const L=!_&&(e==null?void 0:e.look)==="neo";owt(C,e,N,s,n,L,A);const I=Math.floor(h.length/2),P=h[I];Kr.isLabelCoordinateInPath(P,C.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function ZCe(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&&Gs[e.arrowTypeStart]){const i=Gs[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=CW(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&&Gs[e.arrowTypeEnd]){const i=Gs[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=CW(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(JCe,"applyMarkerOffsetsToPoints");var mwt=x((t,e,r,n)=>{e.forEach(i=>{$wt[i](t,r,n)})},"insertMarkers"),Uwt=x((t,e,r)=>{de.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"),ywt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),bwt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),vwt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),xwt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),wwt=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),Twt=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),Cwt=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),kwt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Swt=x((t,e,r)=>{const n=xr(),{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"),Ewt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),Awt=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Mwt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),Rwt=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),Lwt=x((t,e,r)=>{const n=xr(),{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"),Iwt=x((t,e,r)=>{const n=xr(),{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"),Nwt=x((t,e,r)=>{const n=xr(),{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"),Dwt=x((t,e,r)=>{const n=xr(),{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"),Owt=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 L20,10 M20,10 - L0,20`)},"requirement_arrow"),oEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s}=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",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L0,20`)},"requirement_arrow"),_wt=x((t,e,r)=>{const n=xr(),{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"),lEt=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"),cEt=w((t,e,r)=>{const n=xr(),{themeVariables:i}=n,{strokeWidth:s}=i,a=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");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),uEt={extension:HSt,composition:GSt,aggregation:WSt,dependency:qSt,lollipop:USt,point:jSt,circle:YSt,cross:XSt,barb:KSt,barbNeo:ZSt,only_one:QSt,zero_or_one:JSt,one_or_more:eEt,zero_or_more:tEt,only_one_neo:rEt,zero_or_one_neo:nEt,one_or_more_neo:iEt,zero_or_more_neo:sEt,requirement_arrow:aEt,requirement_contains:lEt,requirement_arrow_neo:oEt,requirement_contains_neo:cEt},NJ=VSt,hEt={common:Gt,getConfig:xr,insertCluster:TD,insertEdge:IJ,insertEdgeLabel:CL,insertMarkers:NJ,insertNode:s7,interpolateToCurve:hJ,labelHelper:Qr,log:de,positionEdgeLabel:FAe},v6={},GAe=w(t=>{for(const e of t)v6[e.name]=e},"registerLayoutLoaders"),dEt=w(()=>{GAe([{name:"dagre",loader:w(async()=>await Mr(()=>Promise.resolve().then(()=>kYt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Mr(()=>Promise.resolve().then(()=>PYt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Mr(()=>Promise.resolve().then(()=>Etr),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");dEt();var Y3=w(async(t,e,r)=>{if(!(t.layoutAlgorithm in v6))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=v6[t.layoutAlgorithm],i=await n.loader(),{theme:s,themeVariables:a}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=a,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",`${s!=null&&s.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",`${s!=null&&s.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,hEt,{algorithm:n.algorithm},r)},"render"),a7=w((t="",{fallback:e="dagre"}={})=>{if(t in v6)return t;if(e in v6)return de.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"),OJ="comm",WAe="rule",qAe="decl",fEt="@media",pEt="@import",gEt="@supports",mEt="@namespace",vq="@keyframes",UAe="@layer",yEt="@scope",vEt=Math.abs,HS=String.fromCharCode;function jAe(t){return t.trim()}function bq(t,e,r){return t.replace(e,r)}function cx(t,e){return t.charCodeAt(e)|0}function H5(t,e,r){return t.slice(e,r)}function bd(t){return t.length}function YAe(t){return t.length}function B8(t,e){return e.push(t),t}var kD=1,G5=1,XAe=0,Gu=0,aa=0,X3="";function DJ(t,e,r,n,i,s,a,o){return{value:t,root:e,parent:r,type:n,props:i,children:s,line:kD,column:G5,length:a,return:"",siblings:o}}function bEt(){return aa}function xEt(){return aa=Gu>0?cx(X3,--Gu):0,G5--,aa===10&&(G5=1,kD--),aa}function Rh(){return aa=Gu2||b6(aa)>3?"":" "}function kEt(t,e){for(;--e&&Rh()&&!(aa<48||aa>102||aa>57&&aa<65||aa>70&&aa<97););return SD(t,zR()+(e<6&&ug()==32&&Rh()==32))}function xq(t){for(;Rh();)switch(aa){case t:return Gu;case 34:case 39:t!==34&&t!==39&&xq(aa);break;case 40:t===41&&xq(t);break;case 92:Rh();break}return Gu}function SEt(t,e){for(;Rh()&&t+aa!==57;)if(t+aa===84&&ug()===47)break;return"/*"+SD(e,Gu-1)+"*"+HS(t===47?t:Rh())}function EEt(t){for(;!b6(ug());)Rh();return SD(t,Gu)}function AEt(t){return TEt(VR("",null,null,null,[""],t=wEt(t),0,[0],t))}function VR(t,e,r,n,i,s,a,o,l){for(var u=0,h=0,d=a,f=0,p=0,g=0,m=1,y=1,v=1,b=0,x=0,T="",C=i,S=s,k=n,E=T;y;)switch(g=x,x=Rh()){case 40:g!=108&&cx(E,d-1)==58?(b++,E+="("):E+=PF(x);break;case 41:b--,E+=")";break;case 34:case 39:case 91:E+=PF(x);break;case 9:case 10:case 13:case 32:if(b>0){E+=HS(x);break}E+=CEt(g);break;case 92:E+=kEt(zR()-1,7);continue;case 47:switch(ug()){case 42:case 47:B8(MEt(SEt(Rh(),zR()),e,r,l),l),(b6(g||1)==5||b6(ug()||1)==5)&&bd(E)&&H5(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=bd(E)*v;case 125*m:case 59:case 0:if(b>0&&x){E+=HS(x);break}switch(x){case 0:case 125:y=0;case 59+h:v==-1&&(E=bq(E,/\f/g,"")),p>0&&(bd(E)-d||m===0)&&B8(p>32?Yhe(E+";",n,r,d-1,l):Yhe(bq(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(B8(k=jhe(E,e,r,u,h,i,o,T,C=[],S=[],d,s),s),x===123)if(h===0)VR(E,e,k,k,C,s,d,o,S);else{switch(f){case 99:if(cx(E,3)===110)break;case 108:if(cx(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?VR(t,k,k,n&&B8(jhe(t,k,k,0,0,i,o,T,i,C=[],d,S),S),i,S,d,o,n?C:S):VR(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,T=E="",d=a;break;case 58:d=1+bd(E),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&xEt()==125)continue}switch(E+=HS(x),x*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(b>0)break;o[u++]=(bd(E)-1)*v,v=1;break;case 64:ug()===45&&(E+=PF(Rh())),f=ug(),h=d=bd(T=E+=EEt(zR())),x++;break;case 45:g===45&&bd(E)==2&&(m=0)}}return s}function jhe(t,e,r,n,i,s,a,o,l,u,h,d){for(var f=i-1,p=i===0?s:[""],g=YAe(p),m=0,y=0,v=0;m0?p[b]+" "+x:bq(x,/&\f/g,p[b])))&&(l[v++]=T);return DJ(t,e,r,i===0?WAe:o,l,u,h,d)}function MEt(t,e,r,n){return DJ(t,e,r,OJ,HS(bEt()),H5(t,2,-2),0,n)}function Yhe(t,e,r,n,i){return DJ(t,e,r,qAe,H5(t,0,n),H5(t,n+1,-1),n,i)}function wq(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),IEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wrr);return{diagram:e}},void 0,import.meta.url);return{id:KAe,diagram:t}},"loader"),NEt={id:KAe,detector:LEt,loader:IEt},OEt=NEt,ZAe="flowchart",DEt=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"),PEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Rre);return{diagram:e}},void 0,import.meta.url);return{id:ZAe,diagram:t}},"loader"),$Et={id:ZAe,detector:DEt,loader:PEt},BEt=$Et,QAe="flowchart-v2",FEt=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"),zEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Rre);return{diagram:e}},void 0,import.meta.url);return{id:QAe,diagram:t}},"loader"),VEt={id:QAe,detector:FEt,loader:zEt},HEt=VEt,JAe="swimlane",GEt=w(t=>/^\s*swimlane-beta\b/.test(t),"detector"),WEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Prr);return{diagram:e}},void 0,import.meta.url);return{id:JAe,diagram:t}},"loader"),qEt={id:JAe,detector:GEt,loader:WEt},UEt=qEt,e7e="er",jEt=w(t=>/^\s*erDiagram/.test(t),"detector"),YEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Wrr);return{diagram:e}},void 0,import.meta.url);return{id:e7e,diagram:t}},"loader"),XEt={id:e7e,detector:jEt,loader:YEt},KEt=XEt,t7e="gitGraph",ZEt=w(t=>/^\s*gitGraph/.test(t),"detector"),QEt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Xmr);return{diagram:e}},void 0,import.meta.url);return{id:t7e,diagram:t}},"loader"),JEt={id:t7e,detector:ZEt,loader:QEt},e6t=JEt,r7e="gantt",t6t=w(t=>/^\s*gantt/.test(t),"detector"),r6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nyr);return{diagram:e}},void 0,import.meta.url);return{id:r7e,diagram:t}},"loader"),n6t={id:r7e,detector:t6t,loader:r6t},i6t=n6t,n7e="info",s6t=w(t=>/^\s*info/.test(t),"detector"),a6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>hyr);return{diagram:e}},void 0,import.meta.url);return{id:n7e,diagram:t}},"loader"),o6t={id:n7e,detector:s6t,loader:a6t},i7e="pie",l6t=w(t=>/^\s*pie/.test(t),"detector"),c6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Myr);return{diagram:e}},void 0,import.meta.url);return{id:i7e,diagram:t}},"loader"),u6t={id:i7e,detector:l6t,loader:c6t},s7e="quadrantChart",h6t=w(t=>/^\s*quadrantChart/.test(t),"detector"),d6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pyr);return{diagram:e}},void 0,import.meta.url);return{id:s7e,diagram:t}},"loader"),f6t={id:s7e,detector:h6t,loader:d6t},p6t=f6t,a7e="xychart",g6t=w(t=>/^\s*xychart(-beta)?/.test(t),"detector"),m6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zyr);return{diagram:e}},void 0,import.meta.url);return{id:a7e,diagram:t}},"loader"),y6t={id:a7e,detector:g6t,loader:m6t},v6t=y6t,o7e="requirement",b6t=w(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),x6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>svr);return{diagram:e}},void 0,import.meta.url);return{id:o7e,diagram:t}},"loader"),w6t={id:o7e,detector:b6t,loader:x6t},T6t=w6t,l7e="sequence",C6t=w(t=>/^\s*sequenceDiagram/.test(t),"detector"),k6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>e2r);return{diagram:e}},void 0,import.meta.url);return{id:l7e,diagram:t}},"loader"),S6t={id:l7e,detector:C6t,loader:k6t},E6t=S6t,c7e="class",A6t=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"),M6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a2r);return{diagram:e}},void 0,import.meta.url);return{id:c7e,diagram:t}},"loader"),R6t={id:c7e,detector:A6t,loader:M6t},_6t=R6t,u7e="classDiagram",L6t=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"),I6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>l2r);return{diagram:e}},void 0,import.meta.url);return{id:u7e,diagram:t}},"loader"),N6t={id:u7e,detector:L6t,loader:I6t},O6t=N6t,h7e="state",D6t=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"),P6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Z2r);return{diagram:e}},void 0,import.meta.url);return{id:h7e,diagram:t}},"loader"),$6t={id:h7e,detector:D6t,loader:P6t},B6t=$6t,d7e="stateDiagram",F6t=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"),z6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>J2r);return{diagram:e}},void 0,import.meta.url);return{id:d7e,diagram:t}},"loader"),V6t={id:d7e,detector:F6t,loader:z6t},H6t=V6t,f7e="journey",G6t=w(t=>/^\s*journey/.test(t),"detector"),W6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wbr);return{diagram:e}},void 0,import.meta.url);return{id:f7e,diagram:t}},"loader"),q6t={id:f7e,detector:G6t,loader:W6t},U6t=q6t,j6t=w((t,e,r)=>{de.debug(`rendering svg for syntax error -`);const n=al(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),qs(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"),p7e={draw:j6t},Y6t=p7e,X6t={db:{},renderer:p7e,parser:{parse:w(()=>{},"parse")}},K6t=X6t,g7e="flowchart-elk",Z6t=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"),Q6t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Rre);return{diagram:e}},void 0,import.meta.url);return{id:g7e,diagram:t}},"loader"),J6t={id:g7e,detector:Z6t,loader:Q6t},eAt=J6t,m7e="timeline",tAt=w(t=>/^\s*timeline/.test(t),"detector"),rAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Kbr);return{diagram:e}},void 0,import.meta.url);return{id:m7e,diagram:t}},"loader"),nAt={id:m7e,detector:tAt,loader:rAt},iAt=nAt,y7e="mindmap",sAt=w(t=>/^\s*mindmap/.test(t),"detector"),aAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dxr);return{diagram:e}},void 0,import.meta.url);return{id:y7e,diagram:t}},"loader"),oAt={id:y7e,detector:sAt,loader:aAt},lAt=oAt,v7e="kanban",cAt=w(t=>/^\s*kanban/.test(t),"detector"),uAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Ixr);return{diagram:e}},void 0,import.meta.url);return{id:v7e,diagram:t}},"loader"),hAt={id:v7e,detector:cAt,loader:uAt},dAt=hAt,b7e="sankey",fAt=w(t=>/^\s*sankey(-beta)?/.test(t),"detector"),pAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ywr);return{diagram:e}},void 0,import.meta.url);return{id:b7e,diagram:t}},"loader"),gAt={id:b7e,detector:fAt,loader:pAt},mAt=gAt,x7e="packet",yAt=w(t=>/^\s*packet(-beta)?/.test(t),"detector"),vAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Mwr);return{diagram:e}},void 0,import.meta.url);return{id:x7e,diagram:t}},"loader"),bAt={id:x7e,detector:yAt,loader:vAt},w7e="radar",xAt=w(t=>/^\s*radar-beta/.test(t),"detector"),wAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Xwr);return{diagram:e}},void 0,import.meta.url);return{id:w7e,diagram:t}},"loader"),TAt={id:w7e,detector:xAt,loader:wAt},T7e="block",CAt=w(t=>/^\s*block(-beta)?/.test(t),"detector"),kAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>TTr);return{diagram:e}},void 0,import.meta.url);return{id:T7e,diagram:t}},"loader"),SAt={id:T7e,detector:CAt,loader:kAt},EAt=SAt,C7e="treeView",AAt=w(t=>/^\s*treeView-beta/.test(t),"detector"),MAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>UTr);return{diagram:e}},void 0,import.meta.url);return{id:C7e,diagram:t}},"loader"),RAt={id:C7e,detector:AAt,loader:MAt},_At=RAt,k7e="architecture",LAt=w(t=>/^\s*architecture/.test(t),"detector"),IAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>x5r);return{diagram:e}},void 0,import.meta.url);return{id:k7e,diagram:t}},"loader"),NAt={id:k7e,detector:LAt,loader:IAt},OAt=NAt,S7e="eventmodeling",DAt=w(t=>/^\s*eventmodeling/.test(t),"detector"),PAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>P5r);return{diagram:e}},void 0,import.meta.url);return{id:S7e,diagram:t}},"loader"),$At={id:S7e,detector:DAt,loader:PAt},BAt=$At,E7e="ishikawa",FAt=w(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),zAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>J5r);return{diagram:e}},void 0,import.meta.url);return{id:E7e,diagram:t}},"loader"),VAt={id:E7e,detector:FAt,loader:zAt},A7e="venn",HAt=w(t=>/^\s*venn-beta/.test(t),"detector"),GAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>B3r);return{diagram:e}},void 0,import.meta.url);return{id:A7e,diagram:t}},"loader"),WAt={id:A7e,detector:HAt,loader:GAt},qAt=WAt,M7e="treemap",UAt=w(t=>/^\s*treemap/.test(t),"detector"),jAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>X3r);return{diagram:e}},void 0,import.meta.url);return{id:M7e,diagram:t}},"loader"),YAt={id:M7e,detector:UAt,loader:jAt},R7e="wardley",XAt=w(t=>/^\s*wardley-beta/i.test(t),"detector"),KAt=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>oCr);return{diagram:e}},void 0,import.meta.url);return{id:R7e,diagram:t}},"loader"),ZAt={id:R7e,detector:XAt,loader:KAt},QAt=ZAt,_7e="cynefin",JAt=w(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),e7t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>kCr);return{diagram:e}},void 0,import.meta.url);return{id:_7e,diagram:t}},"loader"),t7t={id:_7e,detector:JAt,loader:e7t},L7e="railroad",r7t=w(t=>/^\s*railroad-beta/i.test(t),"detector"),n7t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>XCr);return{diagram:e}},void 0,import.meta.url);return{id:L7e,diagram:t}},"loader"),i7t={id:L7e,detector:r7t,loader:n7t},I7e="railroadEbnf",s7t=w(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),a7t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ikr);return{diagram:e}},void 0,import.meta.url);return{id:I7e,diagram:t}},"loader"),o7t={id:I7e,detector:s7t,loader:a7t},N7e="railroadAbnf",l7t=w(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),c7t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>pkr);return{diagram:e}},void 0,import.meta.url);return{id:N7e,diagram:t}},"loader"),u7t={id:N7e,detector:l7t,loader:c7t},O7e="railroadPeg",h7t=w(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),d7t=w(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>kkr);return{diagram:e}},void 0,import.meta.url);return{id:O7e,diagram:t}},"loader"),f7t={id:O7e,detector:h7t,loader:d7t},Xhe=!1,ED=w(()=>{Xhe||(Xhe=!0,z_("error",K6t,t=>t.toLowerCase().trim()==="error"),z_("---",{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("---")),wW(eAt,lAt,OAt),wW(OEt,dAt,O6t,_6t,KEt,i6t,o6t,u6t,T6t,E6t,UEt,HEt,BEt,iAt,e6t,H6t,B6t,U6t,p6t,mAt,bAt,v6t,EAt,BAt,_At,TAt,VAt,YAt,i7t,o7t,u7t,f7t,qAt,QAt,t7t))},"addDiagrams"),p7t=w(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(qy).map(async([r,{detector:n,loader:i}])=>{if(i)try{EW(r)}catch{try{const{diagram:s,id:a}=await i();z_(a,s,n)}catch(s){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete qy[r],s}}}))).filter(r=>r.status==="rejected");if(e.length>0){de.error(`Failed to load ${e.length} external diagrams`);for(const r of e)de.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),g7t="graphics-document document";function D7e(t,e){t.attr("role",g7t),e!==""&&t.attr("aria-roledescription",e)}w(D7e,"setA11yDiagramInfo");function P7e(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(P7e,"addSVGa11yTitleDescription");var Iy,Tq=(Iy=class{constructor(e,r,n,i,s){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=s}static async fromText(e,r={}){var u,h;const n=xr(),i=AQ(e,n);e=$Ct(e)+` -`;try{EW(i)}catch{const d=t2t(i);if(!d)throw new Z3e(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();z_(f,p)}const{db:s,parser:a,renderer:o,init:l}=EW(i);return a.parser&&(a.parser.yy=s),(u=s.clear)==null||u.call(s),l==null||l(n),r.title&&((h=s.setDiagramTitle)==null||h.call(s,r.title)),await a.parse(e),new Iy(i,e,s,a,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},w(Iy,"Diagram"),Iy),Khe=[],m7t=w(()=>{Khe.forEach(t=>{t()}),Khe=[]},"attachFunctions"),y7t=w(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function $7e(t){const e=t.match(K3e);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` -`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` -`):e[2];let i=pD(n,{schema:fD})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const s={};return i.displayMode&&(s.displayMode=i.displayMode.toString()),i.title&&(s.title=i.title.toString()),i.config&&(s.config=i.config),{text:t.slice(e[0].length),metadata:s}}w($7e,"extractFrontMatter");var v7t=w(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),b7t=w(t=>{const{text:e,metadata:r}=$7e(t),{displayMode:n,title:i,config:s={}}=r;return n&&(s.gantt||(s.gantt={}),s.gantt.displayMode=n),{title:i,config:s,text:e}},"processFrontmatter"),x7t=w(t=>{const e=Kr.detectInit(t)??{},r=Kr.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:ACt(t),directive:e}},"processDirectives");function PJ(t){const e=v7t(t),r=b7t(e),n=x7t(r.text),i=rs(r.config,n.directive);return t=y7t(n.text),{code:t,title:r.title,config:i}}w(PJ,"preprocessDiagram");function B7e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(B7e,"toBase64");var w7t=5e4,T7t="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",C7t="sandbox",k7t="loose",S7t="http://www.w3.org/2000/svg",E7t="http://www.w3.org/1999/xlink",A7t="http://www.w3.org/1999/xhtml",M7t="100%",R7t="100%",_7t="border:0;margin:0;",L7t="margin:0",I7t="allow-top-navigation-by-user-activation allow-popups",N7t='The "iframe" tag is not supported by your browser.',O7t=["foreignobject"],D7t=["dominant-baseline"];function $J(t){const e=PJ(t);return B_(),Zvt(e.config??{}),e}w($J,"processAndSetConfigs");async function F7e(t,e){ED();try{const{code:r,config:n}=$J(t);return{diagramType:(await V7e(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}w(F7e,"parse");var Zhe=w((t,e,r=[])=>{const n=W3e(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),P7t=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=yi(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{uhe(l.styles)||o.forEach(u=>{r.insertRule(Zhe(l.id,u,l.styles),r.cssRules.length)}),uhe(l.textStyles)||r.insertRule(Zhe(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=kW(i)+` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),Pwt=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),Bwt=x((t,e,r)=>{const n=xr(),{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"),$wt={extension:Uwt,composition:ywt,aggregation:bwt,dependency:vwt,lollipop:xwt,point:wwt,circle:Twt,cross:Cwt,barb:kwt,barbNeo:Swt,only_one:Ewt,zero_or_one:Awt,one_or_more:Mwt,zero_or_more:Rwt,only_one_neo:Lwt,zero_or_one_neo:Iwt,one_or_more_neo:Nwt,zero_or_more_neo:Dwt,requirement_arrow:Owt,requirement_contains:Pwt,requirement_arrow_neo:_wt,requirement_contains_neo:Bwt},FQ=mwt,Fwt={common:Ht,getConfig:xr,insertCluster:kO,insertEdge:$Q,insertEdgeLabel:EL,insertMarkers:FQ,insertNode:ck,interpolateToCurve:yQ,labelHelper:Jr,log:de,positionEdgeLabel:XCe},wT={},QCe=x(t=>{for(const e of t)wT[e.name]=e},"registerLayoutLoaders"),zwt=x(()=>{QCe([{name:"dagre",loader:x(async()=>await Mr(()=>Promise.resolve().then(()=>jYt),void 0,import.meta.url),"loader")},{name:"swimlane",loader:x(async()=>await Mr(()=>Promise.resolve().then(()=>aXt),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:x(async()=>await Mr(()=>Promise.resolve().then(()=>Xtr),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");zwt();var Z4=x(async(t,e,r)=>{if(!(t.layoutAlgorithm in wT))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=wT[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,Fwt,{algorithm:n.algorithm},r)},"render"),uk=x((t="",{fallback:e="dagre"}={})=>{if(t in wT)return t;if(e in wT)return de.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"),zQ="comm",eke="rule",tke="decl",Vwt="@media",Hwt="@import",Gwt="@supports",Wwt="@namespace",kW="@keyframes",rke="@layer",qwt="@scope",jwt=Math.abs,qx=String.fromCharCode;function nke(t){return t.trim()}function SW(t,e,r){return t.replace(e,r)}function f6(t,e){return t.charCodeAt(e)|0}function qv(t,e,r){return t.slice(e,r)}function vd(t){return t.length}function ike(t){return t.length}function zS(t,e){return e.push(t),t}var EO=1,jv=1,ake=0,Hu=0,as=0,J4="";function VQ(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:EO,column:jv,length:s,return:"",siblings:o}}function Ywt(){return as}function Xwt(){return as=Hu>0?f6(J4,--Hu):0,jv--,as===10&&(jv=1,EO--),as}function Mh(){return as=Hu2||TT(as)>3?"":" "}function Qwt(t,e){for(;--e&&Mh()&&!(as<48||as>102||as>57&&as<65||as>70&&as<97););return AO(t,HA()+(e<6&&hg()==32&&Mh()==32))}function EW(t){for(;Mh();)switch(as){case t:return Hu;case 34:case 39:t!==34&&t!==39&&EW(as);break;case 40:t===41&&EW(t);break;case 92:Mh();break}return Hu}function eTt(t,e){for(;Mh()&&t+as!==57;)if(t+as===84&&hg()===47)break;return"/*"+AO(e,Hu-1)+"*"+qx(t===47?t:Mh())}function tTt(t){for(;!TT(hg());)Mh();return AO(t,Hu)}function rTt(t){return Zwt(GA("",null,null,null,[""],t=Kwt(t),0,[0],t))}function GA(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,U=1,y=1,b=0,v=0,w="",T=i,k=a,C=n,S=w;U;)switch(g=v,v=Mh()){case 40:g!=108&&f6(S,d-1)==58?(b++,S+="("):S+=z$(v);break;case 41:b--,S+=")";break;case 34:case 39:case 91:S+=z$(v);break;case 9:case 10:case 13:case 32:if(b>0){S+=qx(v);break}S+=Jwt(g);break;case 92:S+=Qwt(HA()-1,7);continue;case 47:switch(hg()){case 42:case 47:zS(nTt(eTt(Mh(),HA()),e,r,l),l),(TT(g||1)==5||TT(hg()||1)==5)&&vd(S)&&qv(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*m:o[u++]=vd(S)*y;case 125*m:case 59:case 0:if(b>0&&v){S+=qx(v);break}switch(v){case 0:case 125:U=0;case 59+h:y==-1&&(S=SW(S,/\f/g,"")),p>0&&(vd(S)-d||m===0)&&zS(p>32?sde(S+";",n,r,d-1,l):sde(SW(S," ","")+";",n,r,d-2,l),l);break;case 59:S+=";";default:if(zS(C=ade(S,e,r,u,h,i,o,w,T=[],k=[],d,a),a),v===123)if(h===0)GA(S,e,C,C,T,a,d,o,k);else{switch(f){case 99:if(f6(S,3)===110)break;case 108:if(f6(S,2)===97)break;default:h=0;case 100:case 109:case 115:}h?GA(t,C,C,n&&zS(ade(t,C,C,0,0,i,o,w,i,T=[],d,k),k),i,k,d,o,n?T:k):GA(S,C,C,C,[""],k,0,o,k)}}u=h=p=0,m=y=1,w=S="",d=s;break;case 58:d=1+vd(S),p=g;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&Xwt()==125)continue}switch(S+=qx(v),v*m){case 38:y=h>0?1:(S+="\f",-1);break;case 44:if(b>0)break;o[u++]=(vd(S)-1)*y,y=1;break;case 64:hg()===45&&(S+=z$(Mh())),f=hg(),h=d=vd(w=S+=tTt(HA())),v++;break;case 45:g===45&&vd(S)==2&&(m=0)}}return a}function ade(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=ike(p),m=0,U=0,y=0;m0?p[b]+" "+v:SW(v,/&\f/g,p[b])))&&(l[y++]=w);return VQ(t,e,r,i===0?eke:o,l,u,h,d)}function nTt(t,e,r,n){return VQ(t,e,r,zQ,qx(Ywt()),qv(t,2,-2),0,n)}function sde(t,e,r,n,i){return VQ(t,e,r,tke,qv(t,0,n),qv(t,n+1,-1),n,i)}function AW(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),oTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Grr);return{diagram:e}},void 0,import.meta.url);return{id:ske,diagram:t}},"loader"),lTt={id:ske,detector:sTt,loader:oTt},cTt=lTt,oke="flowchart",uTt=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),hTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pre);return{diagram:e}},void 0,import.meta.url);return{id:oke,diagram:t}},"loader"),dTt={id:oke,detector:uTt,loader:hTt},fTt=dTt,lke="flowchart-v2",pTt=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),gTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pre);return{diagram:e}},void 0,import.meta.url);return{id:lke,diagram:t}},"loader"),mTt={id:lke,detector:pTt,loader:gTt},UTt=mTt,cke="swimlane",yTt=x(t=>/^\s*swimlane-beta\b/.test(t),"detector"),bTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>anr);return{diagram:e}},void 0,import.meta.url);return{id:cke,diagram:t}},"loader"),vTt={id:cke,detector:yTt,loader:bTt},xTt=vTt,uke="er",wTt=x(t=>/^\s*erDiagram/.test(t),"detector"),TTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>fnr);return{diagram:e}},void 0,import.meta.url);return{id:uke,diagram:t}},"loader"),CTt={id:uke,detector:wTt,loader:TTt},kTt=CTt,hke="gitGraph",STt=x(t=>/^\s*gitGraph/.test(t),"detector"),ETt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ymr);return{diagram:e}},void 0,import.meta.url);return{id:hke,diagram:t}},"loader"),ATt={id:hke,detector:STt,loader:ETt},MTt=ATt,dke="gantt",RTt=x(t=>/^\s*gantt/.test(t),"detector"),LTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>SUr);return{diagram:e}},void 0,import.meta.url);return{id:dke,diagram:t}},"loader"),ITt={id:dke,detector:RTt,loader:LTt},NTt=ITt,fke="info",DTt=x(t=>/^\s*info/.test(t),"detector"),OTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DUr);return{diagram:e}},void 0,import.meta.url);return{id:fke,diagram:t}},"loader"),_Tt={id:fke,detector:DTt,loader:OTt},pke="pie",PTt=x(t=>/^\s*pie/.test(t),"detector"),BTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ZUr);return{diagram:e}},void 0,import.meta.url);return{id:pke,diagram:t}},"loader"),$Tt={id:pke,detector:PTt,loader:BTt},gke="quadrantChart",FTt=x(t=>/^\s*quadrantChart/.test(t),"detector"),zTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a5r);return{diagram:e}},void 0,import.meta.url);return{id:gke,diagram:t}},"loader"),VTt={id:gke,detector:FTt,loader:zTt},HTt=VTt,mke="xychart",GTt=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),WTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>v5r);return{diagram:e}},void 0,import.meta.url);return{id:mke,diagram:t}},"loader"),qTt={id:mke,detector:GTt,loader:WTt},jTt=qTt,Uke="requirement",YTt=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),XTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>A5r);return{diagram:e}},void 0,import.meta.url);return{id:Uke,diagram:t}},"loader"),KTt={id:Uke,detector:YTt,loader:XTt},ZTt=KTt,yke="sequence",JTt=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),QTt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>T2r);return{diagram:e}},void 0,import.meta.url);return{id:yke,diagram:t}},"loader"),eCt={id:yke,detector:JTt,loader:QTt},tCt=eCt,bke="class",rCt=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),nCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>M2r);return{diagram:e}},void 0,import.meta.url);return{id:bke,diagram:t}},"loader"),iCt={id:bke,detector:rCt,loader:nCt},aCt=iCt,vke="classDiagram",sCt=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),oCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>L2r);return{diagram:e}},void 0,import.meta.url);return{id:vke,diagram:t}},"loader"),lCt={id:vke,detector:sCt,loader:oCt},cCt=lCt,xke="state",uCt=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),hCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vyr);return{diagram:e}},void 0,import.meta.url);return{id:xke,diagram:t}},"loader"),dCt={id:xke,detector:uCt,loader:hCt},fCt=dCt,wke="stateDiagram",pCt=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),gCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>wyr);return{diagram:e}},void 0,import.meta.url);return{id:wke,diagram:t}},"loader"),mCt={id:wke,detector:pCt,loader:gCt},UCt=mCt,Tke="journey",yCt=x(t=>/^\s*journey/.test(t),"detector"),bCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Gyr);return{diagram:e}},void 0,import.meta.url);return{id:Tke,diagram:t}},"loader"),vCt={id:Tke,detector:yCt,loader:bCt},xCt=vCt,wCt=x((t,e,r)=>{de.debug(`rendering svg for syntax error +`);const n=sl(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Ga(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"),Cke={draw:wCt},TCt=Cke,CCt={db:{},renderer:Cke,parser:{parse:x(()=>{},"parse")}},kCt=CCt,kke="flowchart-elk",SCt=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),ECt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Pre);return{diagram:e}},void 0,import.meta.url);return{id:kke,diagram:t}},"loader"),ACt={id:kke,detector:SCt,loader:ECt},MCt=ACt,Ske="timeline",RCt=x(t=>/^\s*timeline/.test(t),"detector"),LCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>b6r);return{diagram:e}},void 0,import.meta.url);return{id:Ske,diagram:t}},"loader"),ICt={id:Ske,detector:RCt,loader:LCt},NCt=ICt,Eke="mindmap",DCt=x(t=>/^\s*mindmap/.test(t),"detector"),OCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>O6r);return{diagram:e}},void 0,import.meta.url);return{id:Eke,diagram:t}},"loader"),_Ct={id:Eke,detector:DCt,loader:OCt},PCt=_Ct,Ake="kanban",BCt=x(t=>/^\s*kanban/.test(t),"detector"),$Ct=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>tbr);return{diagram:e}},void 0,import.meta.url);return{id:Ake,diagram:t}},"loader"),FCt={id:Ake,detector:BCt,loader:$Ct},zCt=FCt,Mke="sankey",VCt=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),HCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Fbr);return{diagram:e}},void 0,import.meta.url);return{id:Mke,diagram:t}},"loader"),GCt={id:Mke,detector:VCt,loader:HCt},WCt=GCt,Rke="packet",qCt=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),jCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Zbr);return{diagram:e}},void 0,import.meta.url);return{id:Rke,diagram:t}},"loader"),YCt={id:Rke,detector:qCt,loader:jCt},Lke="radar",XCt=x(t=>/^\s*radar-beta/.test(t),"detector"),KCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>y7r);return{diagram:e}},void 0,import.meta.url);return{id:Lke,diagram:t}},"loader"),ZCt={id:Lke,detector:XCt,loader:KCt},Ike="block",JCt=x(t=>/^\s*block(-beta)?/.test(t),"detector"),QCt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>W8r);return{diagram:e}},void 0,import.meta.url);return{id:Ike,diagram:t}},"loader"),ekt={id:Ike,detector:JCt,loader:QCt},tkt=ekt,Nke="treeView",rkt=x(t=>/^\s*treeView-beta/.test(t),"detector"),nkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>gvr);return{diagram:e}},void 0,import.meta.url);return{id:Nke,diagram:t}},"loader"),ikt={id:Nke,detector:rkt,loader:nkt},akt=ikt,Dke="architecture",skt=x(t=>/^\s*architecture/.test(t),"detector"),okt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Hvr);return{diagram:e}},void 0,import.meta.url);return{id:Dke,diagram:t}},"loader"),lkt={id:Dke,detector:skt,loader:okt},ckt=lkt,Oke="eventmodeling",ukt=x(t=>/^\s*eventmodeling/.test(t),"detector"),hkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>a4r);return{diagram:e}},void 0,import.meta.url);return{id:Oke,diagram:t}},"loader"),dkt={id:Oke,detector:ukt,loader:hkt},fkt=dkt,_ke="ishikawa",pkt=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),gkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>w4r);return{diagram:e}},void 0,import.meta.url);return{id:_ke,diagram:t}},"loader"),mkt={id:_ke,detector:pkt,loader:gkt},Pke="venn",Ukt=x(t=>/^\s*venn-beta/.test(t),"detector"),ykt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>o9r);return{diagram:e}},void 0,import.meta.url);return{id:Pke,diagram:t}},"loader"),bkt={id:Pke,detector:Ukt,loader:ykt},vkt=bkt,Bke="treemap",xkt=x(t=>/^\s*treemap/.test(t),"detector"),wkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>y9r);return{diagram:e}},void 0,import.meta.url);return{id:Bke,diagram:t}},"loader"),Tkt={id:Bke,detector:xkt,loader:wkt},$ke="wardley",Ckt=x(t=>/^\s*wardley-beta/i.test(t),"detector"),kkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R9r);return{diagram:e}},void 0,import.meta.url);return{id:$ke,diagram:t}},"loader"),Skt={id:$ke,detector:Ckt,loader:kkt},Ekt=Skt,Fke="cynefin",Akt=x(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),Mkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>j9r);return{diagram:e}},void 0,import.meta.url);return{id:Fke,diagram:t}},"loader"),Rkt={id:Fke,detector:Akt,loader:Mkt},zke="railroad",Lkt=x(t=>/^\s*railroad-beta/i.test(t),"detector"),Ikt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>y3r);return{diagram:e}},void 0,import.meta.url);return{id:zke,diagram:t}},"loader"),Nkt={id:zke,detector:Lkt,loader:Ikt},Vke="railroadEbnf",Dkt=x(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),Okt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>E3r);return{diagram:e}},void 0,import.meta.url);return{id:Vke,diagram:t}},"loader"),_kt={id:Vke,detector:Dkt,loader:Okt},Hke="railroadAbnf",Pkt=x(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),Bkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>P3r);return{diagram:e}},void 0,import.meta.url);return{id:Hke,diagram:t}},"loader"),$kt={id:Hke,detector:Pkt,loader:Bkt},Gke="railroadPeg",Fkt=x(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),zkt=x(async()=>{const{diagram:t}=await Mr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>j3r);return{diagram:e}},void 0,import.meta.url);return{id:Gke,diagram:t}},"loader"),Vkt={id:Gke,detector:Fkt,loader:zkt},ode=!1,MO=x(()=>{ode||(ode=!0,GR("error",kCt,t=>t.toLowerCase().trim()==="error"),GR("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),AG(MCt,PCt,ckt),AG(cTt,zCt,cCt,aCt,kTt,NTt,_Tt,$Tt,ZTt,tCt,xTt,UTt,fTt,NCt,MTt,UCt,fCt,xCt,HTt,WCt,YCt,jTt,tkt,fkt,akt,ZCt,mkt,Tkt,Nkt,_kt,$kt,Vkt,vkt,Ekt,Rkt))},"addDiagrams"),Hkt=x(async()=>{de.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(YU).map(async([r,{detector:n,loader:i}])=>{if(i)try{NG(r)}catch{try{const{diagram:a,id:s}=await i();GR(s,a,n)}catch(a){throw de.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete YU[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){de.error(`Failed to load ${e.length} external diagrams`);for(const r of e)de.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),Gkt="graphics-document document";function Wke(t,e){t.attr("role",Gkt),e!==""&&t.attr("aria-roledescription",e)}x(Wke,"setA11yDiagramInfo");function qke(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(qke,"addSVGa11yTitleDescription");var OU,MW=(OU=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=xr(),i=DJ(e,n);e=d3t(e)+` +`;try{NG(i)}catch{const d=R2t(i);if(!d)throw new o9e(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();GR(f,p)}const{db:a,parser:s,renderer:o,init:l}=NG(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 OU(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(OU,"Diagram"),OU),lde=[],Wkt=x(()=>{lde.forEach(t=>{t()}),lde=[]},"attachFunctions"),qkt=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function jke(t){const e=t.match(s9e);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=UO(n,{schema:mO})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}x(jke,"extractFrontMatter");var jkt=x(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Ykt=x(t=>{const{text:e,metadata:r}=jke(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"),Xkt=x(t=>{const e=Kr.detectInit(t)??{},r=Kr.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:r3t(t),directive:e}},"processDirectives");function HQ(t){const e=jkt(t),r=Ykt(e),n=Xkt(r.text),i=na(r.config,n.directive);return t=qkt(n.text),{code:t,title:r.title,config:i}}x(HQ,"preprocessDiagram");function Yke(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(Yke,"toBase64");var Kkt=5e4,Zkt="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Jkt="sandbox",Qkt="loose",eSt="http://www.w3.org/2000/svg",tSt="http://www.w3.org/1999/xlink",rSt="http://www.w3.org/1999/xhtml",nSt="100%",iSt="100%",aSt="border:0;margin:0;",sSt="margin:0",oSt="allow-top-navigation-by-user-activation allow-popups",lSt='The "iframe" tag is not supported by your browser.',cSt=["foreignobject"],uSt=["dominant-baseline"];function GQ(t){const e=HQ(t);return VR(),S2t(e.config??{}),e}x(GQ,"processAndSetConfigs");async function Xke(t,e){MO();try{const{code:r,config:n}=GQ(t);return{diagramType:(await Zke(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(Xke,"parse");var cde=x((t,e,r=[])=>{const n=e9e(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),hSt=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=yi(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{whe(l.styles)||o.forEach(u=>{r.insertRule(cde(l.id,u,l.styles),r.cssRules.length)}),whe(l.textStyles)||r.insertRule(cde(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=LG(i)+` `}else n+=`${t.themeCSS} -`;return n+kW(r)},"createCssStyles"),$7t=w((t,e)=>wq(AEt(`${t}{${e}}`),_Et([w(function(n,i,s,a){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===vq)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("@")&&([...[fEt,gEt,UAe,yEt,"@container","@starting-style"],vq].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=OJ))},"addNamespace"),REt])),"compileCSS"),B7t=w((t,e,r,n)=>{const i=P7t(t,r),s=y2t(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return $7t(n,s)},"createUserStyles"),F7t=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=I0(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),z7t=w((t="",e)=>{var i,s;const r=(s=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&s.height?e.viewBox.baseVal.height+"px":R7t,n=B7e(`${t}`);return``},"putIntoIFrame"),Qhe=w((t,e,r,n,i)=>{const s=t.append("div");s.attr("id",r),n&&s.attr("style",n);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns",S7t);return i&&a.attr("xmlns:xlink",i),a.append("g"),t},"appendDivSvgG");function Cq(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(Cq,"sandboxedIframe");var V7t=w((t,e,r,n)=>{var i,s,a;(i=t.getElementById(e))==null||i.remove(),(s=t.getElementById(r))==null||s.remove(),(a=t.getElementById(n))==null||a.remove()},"removeExistingElements"),H7t=w(async function(t,e,r){var P,N,L,I,$,O;ED();const n=$J(e);e=n.code;const i=xr();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??w7t)&&(e=T7t);const s=`#${t}`,a="i"+t,o="#"+a,l="d"+t,u="#"+l,h=w(()=>{const B=xt(f?o:u).node();B&&"remove"in B&&B.remove()},"removeTempElements");let d=xt(document.body);const f=i.securityLevel===C7t,p=i.securityLevel===k7t,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=Cq(xt(r),a);d=xt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=xt(r);Qhe(d,t,l,`font-family: ${g}`,E7t)}else{if(V7t(document,t,l,a),f){const D=Cq(xt(document.body),a);d=xt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=xt("body");Qhe(d,t,l)}let m,y;try{m=await Tq.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await Tq.fromText("error"),y=D}const v=d.select(u).node(),b=m.type,x=v.firstChild,T=x.firstChild,C=(N=(P=m.renderer).getClasses)==null?void 0:N.call(P,e,m),S=B7t(i,b,C,s),k=document.createElement("style");k.innerHTML=S,x.insertBefore(k,T);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(D){throw i.suppressErrorRendering?h():Y6t.draw(e,t,"11.16.1"),D}const E=d.select(`${u} svg`),A=(I=(L=m.db).getAccTitle)==null?void 0:I.call(L),M=(O=($=m.db).getAccDescription)==null?void 0:O.call($);H7e(b,E,A,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",A7t);let R=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),R=F7t(R,f,sf(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();R=z7t(R,D)}else p||(R=M0.sanitize(R,{ADD_TAGS:O7t,ADD_ATTR:D7t,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(m7t(),y)throw y;return h(),{diagramType:b,svg:R,bindFunctions:m.db.bindFunctions}},"render");function z7e(t={}){var n;const e=oa({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Xvt(e),e!=null&&e.theme&&e.theme in b0?e.themeVariables=b0[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=b0.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Yvt(e):q3e();kQ(r.logLevel),ED()}w(z7e,"initialize");var V7e=w((t,e={})=>{const{code:r}=PJ(t);return Tq.fromText(r,e)},"getDiagramFromText");function H7e(t,e,r,n){D7e(e,t),P7e(e,r,n,e.attr("id"))}w(H7e,"addA11yInfo");var Jy=Object.freeze({render:H7t,parse:F7e,getDiagramFromText:V7e,initialize:z7e,getConfig:xr,setConfig:U3e,getSiteConfig:q3e,updateSiteConfig:Kvt,reset:w(()=>{B_()},"reset"),globalReset:w(()=>{B_(I5)},"globalReset"),defaultConfig:I5});kQ(xr().logLevel);B_(xr());var G7t=w((t,e,r)=>{de.warn(t),gJ(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"),G7e=w(async function(t={querySelector:".mermaid"}){try{await W7t(t)}catch(e){if(gJ(e)&&de.error(e.str),Kc.parseError&&Kc.parseError(e),!t.suppressErrors)throw de.error("Use the suppressErrors option to suppress these errors"),e}},"run"),W7t=w(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=Jy.getConfig();de.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");de.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(de.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),Jy.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const s=new Kr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let a;const o=[];for(const l of Array.from(i)){if(de.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${s.next()}`;a=l.innerHTML,a=jEe(Kr.entityDecode(a)).trim().replace(//gi,"
    ");const h=Kr.detectInit(a);h&&de.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await j7e(u,a,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){G7t(d,o,Kc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),W7e=w(function(t){Jy.initialize(t)},"initialize"),q7t=w(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&W7e(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await G7e(n)},"init"),U7t=w(async(t,{lazyLoad:e=!0}={})=>{ED(),wW(...t),e===!1&&await p7t()},"registerExternalDiagrams"),q7e=w(function(){if(Kc.startOnLoad){const{startOnLoad:t}=Jy.getConfig();t&&Kc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",q7e,!1);var j7t=w(function(t){Kc.parseError=t},"setParseErrorHandler"),kL=[],$F=!1,U7e=w(async()=>{if(!$F){for($F=!0;kL.length>0;){const t=kL.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}$F=!1}},"executeQueue"),Y7t=w(async(t,e)=>new Promise((r,n)=>{const i=w(()=>new Promise((s,a)=>{Jy.parse(t,e).then(o=>{s(o),r(o)},o=>{var l;de.error("Error parsing",o),(l=Kc.parseError)==null||l.call(Kc,o),a(o),n(o)})}),"performCall");kL.push(i),U7e().catch(n)}),"parse"),j7e=w((t,e,r)=>new Promise((n,i)=>{const s=w(()=>new Promise((a,o)=>{Jy.render(t,e,r).then(l=>{a(l),n(l)},l=>{var u;de.error("Error parsing",l),(u=Kc.parseError)==null||u.call(Kc,l),o(l),i(l)})}),"performCall");kL.push(s),U7e().catch(i)}),"render"),X7t=w(()=>Object.keys(qy).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Kc={startOnLoad:!0,mermaidAPI:Jy,parse:Y7t,render:j7e,init:q7t,run:G7e,registerExternalDiagrams:U7t,registerLayoutLoaders:GAe,initialize:W7e,parseError:void 0,contentLoaded:q7e,setParseErrorHandler:j7t,detectType:AQ,registerIconPacks:yJ,getRegisteredDiagramsMetadata:X7t},Jhe=Kc;/*! Check if previously processed *//*! +`;return n+LG(r)},"createCssStyles"),dSt=x((t,e)=>AW(rTt(`${t}{${e}}`),aTt([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===kW)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("@")&&([...[Vwt,Gwt,rke,qwt,"@container","@starting-style"],kW].includes(n.type)||(de.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=zQ))},"addNamespace"),iTt])),"compileCSS"),fSt=x((t,e,r,n)=>{const i=hSt(t,r),a=q2t(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return dSt(n,a)},"createUserStyles"),pSt=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=N0(n),n=n.replace(/
    /g,"
    "),n},"cleanUpSvgCode"),gSt=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":iSt,n=Yke(`${t}`);return``},"putIntoIFrame"),ude=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",eSt);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function RW(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(RW,"sandboxedIframe");var mSt=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),USt=x(async function(t,e,r){var _,N,L,I,P,O;MO();const n=GQ(e);e=n.code;const i=xr();de.debug(i),e.length>((i==null?void 0:i.maxTextSize)??Kkt)&&(e=Zkt);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const B=vt(f?o:u).node();B&&"remove"in B&&B.remove()},"removeTempElements");let d=vt(document.body);const f=i.securityLevel===Jkt,p=i.securityLevel===Qkt,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=RW(vt(r),s);d=vt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=vt(r);ude(d,t,l,`font-family: ${g}`,tSt)}else{if(mSt(document,t,l,s),f){const D=RW(vt(document.body),s);d=vt(D.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=vt("body");ude(d,t,l)}let m,U;try{m=await MW.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await MW.fromText("error"),U=D}const y=d.select(u).node(),b=m.type,v=y.firstChild,w=v.firstChild,T=(N=(_=m.renderer).getClasses)==null?void 0:N.call(_,e,m),k=fSt(i,b,T,a),C=document.createElement("style");C.innerHTML=k,v.insertBefore(C,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(D){throw i.suppressErrorRendering?h():TCt.draw(e,t,"11.16.1"),D}const S=d.select(`${u} svg`),E=(I=(L=m.db).getAccTitle)==null?void 0:I.call(L),A=(O=(P=m.db).getAccDescription)==null?void 0:O.call(P);Jke(b,S,E,A),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",rSt);let R=d.select(u).node().innerHTML;if(de.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),R=pSt(R,f,sf(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();R=gSt(R,D)}else p||(R=M0.sanitize(R,{ADD_TAGS:cSt,ADD_ATTR:uSt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Wkt(),U)throw U;return h(),{diagramType:b,svg:R,bindFunctions:m.db.bindFunctions}},"render");function Kke(t={}){var n;const e=ss({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),C2t(e),e!=null&&e.theme&&e.theme in v0?e.themeVariables=v0[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=v0.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?T2t(e):t9e();LJ(r.logLevel),MO()}x(Kke,"initialize");var Zke=x((t,e={})=>{const{code:r}=HQ(t);return MW.fromText(r,e)},"getDiagramFromText");function Jke(t,e,r,n){Wke(e,t),qke(e,r,n,e.attr("id"))}x(Jke,"addA11yInfo");var r5=Object.freeze({render:USt,parse:Xke,getDiagramFromText:Zke,initialize:Kke,getConfig:xr,setConfig:r9e,getSiteConfig:t9e,updateSiteConfig:k2t,reset:x(()=>{VR()},"reset"),globalReset:x(()=>{VR(_v)},"globalReset"),defaultConfig:_v});LJ(xr().logLevel);VR(xr());var ySt=x((t,e,r)=>{de.warn(t),wQ(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"),Qke=x(async function(t={querySelector:".mermaid"}){try{await bSt(t)}catch(e){if(wQ(e)&&de.error(e.str),Kc.parseError&&Kc.parseError(e),!t.suppressErrors)throw de.error("Use the suppressErrors option to suppress these errors"),e}},"run"),bSt=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=r5.getConfig();de.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");de.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(de.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),r5.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Kr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(de.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=nTe(Kr.entityDecode(s)).trim().replace(//gi,"
    ");const h=Kr.detectInit(s);h&&de.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await nSe(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){ySt(d,o,Kc.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),eSe=x(function(t){r5.initialize(t)},"initialize"),vSt=x(async function(t,e,r){de.warn("mermaid.init is deprecated. Please use run instead."),t&&eSe(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await Qke(n)},"init"),xSt=x(async(t,{lazyLoad:e=!0}={})=>{MO(),AG(...t),e===!1&&await Hkt()},"registerExternalDiagrams"),tSe=x(function(){if(Kc.startOnLoad){const{startOnLoad:t}=r5.getConfig();t&&Kc.run().catch(e=>de.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",tSe,!1);var wSt=x(function(t){Kc.parseError=t},"setParseErrorHandler"),AL=[],V$=!1,rSe=x(async()=>{if(!V$){for(V$=!0;AL.length>0;){const t=AL.shift();if(t)try{await t()}catch(e){de.error("Error executing queue",e)}}V$=!1}},"executeQueue"),TSt=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{r5.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;de.error("Error parsing",o),(l=Kc.parseError)==null||l.call(Kc,o),s(o),n(o)})}),"performCall");AL.push(i),rSe().catch(n)}),"parse"),nSe=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{r5.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;de.error("Error parsing",l),(u=Kc.parseError)==null||u.call(Kc,l),o(l),i(l)})}),"performCall");AL.push(a),rSe().catch(i)}),"render"),CSt=x(()=>Object.keys(YU).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Kc={startOnLoad:!0,mermaidAPI:r5,parse:TSt,render:nSe,init:vSt,run:Qke,registerExternalDiagrams:xSt,registerLayoutLoaders:QCe,initialize:eSe,parseError:void 0,contentLoaded:tSe,setParseErrorHandler:wSt,detectType:DJ,registerIconPacks:CQ,getRegisteredDiagramsMetadata:CSt},hde=Kc;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */function K7t(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 Z7t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Sg(t){const e=[];for(let r=0,n=t.length;rPc||t.height>Pc)&&(t.width>Pc&&t.height>Pc?t.width>t.height?(t.height*=Pc/t.width,t.width=Pc):(t.width*=Pc/t.height,t.height=Pc):t.width>Pc?(t.height*=Pc/t.width,t.width=Pc):(t.width*=Pc/t.height,t.height=Pc))}function EL(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 r8t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function n8t(t,e,r){const n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${e} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(t),r8t(i)}const Tc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||Tc(r,e)};function i8t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function s8t(t,e){return Y7e(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function a8t(t,e,r,n){const i=`.${t}:${e}`,s=r.cssText?i8t(r):s8t(r,n);return document.createTextNode(`${i}{${s}}`)}function ede(t,e,r,n){const i=window.getComputedStyle(t,r),s=i.getPropertyValue("content");if(s===""||s==="none")return;const a=Z7t();try{e.className=`${e.className} ${a}`}catch{return}const o=document.createElement("style");o.appendChild(a8t(a,r,i,n)),e.appendChild(o)}function o8t(t,e,r){ede(t,e,":before",r),ede(t,e,":after",r)}const tde="application/font-woff",rde="image/jpeg",l8t={woff:tde,woff2:tde,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rde,jpeg:rde,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function c8t(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function BJ(t){const e=c8t(t).toLowerCase();return l8t[e]||""}function u8t(t){return t.split(/,/)[1]}function kq(t){return t.search(/^(data:)/)!==-1}function h8t(t,e){return`data:${e};base64,${t}`}async function K7e(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((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(r({res:n,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const BF={};function d8t(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 FJ(t,e,r){const n=d8t(t,e,r.includeQueryParams);if(BF[n]!=null)return BF[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const s=await K7e(t,r.fetchRequestInit,({res:a,result:o})=>(e||(e=a.headers.get("Content-Type")||""),u8t(o)));i=h8t(s,e)}catch(s){i=r.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return BF[n]=i,i}async function f8t(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):EL(e)}async function p8t(t,e){if(t.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=t.clientWidth,s.height=t.clientHeight,a==null||a.drawImage(t,0,0,s.width,s.height);const o=s.toDataURL();return EL(o)}const r=t.poster,n=BJ(r),i=await FJ(r,n,e);return EL(i)}async function g8t(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await AD(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function m8t(t,e){return Tc(t,HTMLCanvasElement)?f8t(t):Tc(t,HTMLVideoElement)?p8t(t,e):Tc(t,HTMLIFrameElement)?g8t(t,e):t.cloneNode(Z7e(t))}const y8t=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Z7e=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function v8t(t,e,r){var n,i;if(Z7e(e))return e;let s=[];return y8t(t)&&t.assignedNodes?s=Sg(t.assignedNodes()):Tc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?s=Sg(t.contentDocument.body.childNodes):s=Sg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),s.length===0||Tc(t,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>AD(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function b8t(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):Y7e(r).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Tc(t,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),n.setProperty(s,a,i.getPropertyPriority(s))})}function x8t(t,e){Tc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),Tc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function w8t(t,e){if(Tc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function T8t(t,e,r){return Tc(e,Element)&&(b8t(t,e,r),o8t(t,e,r),x8t(t,e),w8t(t,e)),e}async function C8t(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let s=0;sm8t(n,e)).then(n=>v8t(t,n,e)).then(n=>T8t(t,n,e)).then(n=>C8t(n,e))}const Q7e=/url\((['"]?)([^'"]+?)\1\)/g,k8t=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,S8t=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function E8t(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function A8t(t){const e=[];return t.replace(Q7e,(r,n,i)=>(e.push(i),r)),e.filter(r=>!kq(r))}async function M8t(t,e,r,n,i){try{const s=r?K7t(e,r):e,a=BJ(e);let o;return i||(o=await FJ(s,a,n)),t.replace(E8t(e),`$1${o}$3`)}catch{}return t}function R8t(t,{preferredFontFormat:e}){return e?t.replace(S8t,r=>{for(;;){const[n,,i]=k8t.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function J7e(t){return t.search(Q7e)!==-1}async function e8e(t,e,r){if(!J7e(t))return t;const n=R8t(t,r);return A8t(n).reduce((s,a)=>s.then(o=>M8t(o,a,e,r)),Promise.resolve(n))}async function v2(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const s=await e8e(i,null,r);return e.style.setProperty(t,s,e.style.getPropertyPriority(t)),!0}return!1}async function _8t(t,e){await v2("background",t,e)||await v2("background-image",t,e),await v2("mask",t,e)||await v2("-webkit-mask",t,e)||await v2("mask-image",t,e)||await v2("-webkit-mask-image",t,e)}async function L8t(t,e){const r=Tc(t,HTMLImageElement);if(!(r&&!kq(t.src))&&!(Tc(t,SVGImageElement)&&!kq(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await FJ(n,BJ(n),e);await new Promise((s,a)=>{t.onload=s,t.onerror=e.onImageErrorHandler?(...l)=>{try{s(e.onImageErrorHandler(...l))}catch(u){a(u)}}:a;const o=t;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),r?(t.srcset="",t.src=i):t.href.baseVal=i})}async function I8t(t,e){const n=Sg(t.childNodes).map(i=>t8e(i,e));await Promise.all(n).then(()=>t)}async function t8e(t,e){Tc(t,Element)&&(await _8t(t,e),await L8t(t,e),await I8t(t,e))}function N8t(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 nde={};async function ide(t){let e=nde[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},nde[t]=e,e}async function sde(t,e){let r=t.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(n,"$1");return o.startsWith("https://")||(o=new URL(o,t.url).href),K7e(o,e.fetchRequestInit,({result:l})=>(r=r.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>r)}function ade(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 s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(n);if(l===null){if(l=o.exec(n),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;e.push(l[0])}return e}async function O8t(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,u=ide(l).then(h=>sde(h,e)).then(h=>ade(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(s){const a=t.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&n.push(ide(i.href).then(o=>sde(o,e)).then(o=>ade(o).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),r))}function D8t(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>J7e(e.style.getPropertyValue("src")))}async function P8t(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Sg(t.ownerDocument.styleSheets),n=await O8t(r,e);return D8t(n)}function r8e(t){return t.trim().replace(/["']/g,"")}function $8t(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{e.add(r8e(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(t),e}async function B8t(t,e){const r=await P8t(t,e),n=$8t(t);return(await Promise.all(r.filter(s=>n.has(r8e(s.style.fontFamily))).map(s=>{const a=s.parentStyleSheet?s.parentStyleSheet.href:null;return e8e(s.cssText,a,e)}))).join(` -`)}async function F8t(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await B8t(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 z8t(t,e={}){const{width:r,height:n}=X7e(t,e),i=await AD(t,e,!0);return await F8t(i,e),await t8e(i,e),N8t(i,e),await n8t(i,r,n)}async function V8t(t,e={}){const{width:r,height:n}=X7e(t,e),i=await z8t(t,e),s=await EL(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=e.pixelRatio||e8t(),u=e.canvasWidth||r,h=e.canvasHeight||n;return a.width=u*l,a.height=h*l,e.skipAutoScale||t8t(a),a.style.width=`${u}`,a.style.height=`${h}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}function zJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Av=zJ();function n8e(t){Av=t}var D1={exec:()=>null};function Un(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Nl.caret,"$1"),r=r.replace(i,a),n},getRegex:()=>new RegExp(r,e)};return n}var H8t=(()=>{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)}}>`)},G8t=/^(?:[ \t]*(?:\n|$))+/,W8t=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,q8t=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,o7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,U8t=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,VJ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,i8e=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,s8e=Un(i8e).replace(/bull/g,VJ).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(),j8t=Un(i8e).replace(/bull/g,VJ).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(),HJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Y8t=/^[^\n]+/,GJ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,X8t=Un(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",GJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),K8t=Un(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,VJ).getRegex(),MD="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",WJ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,Z8t=Un("^ {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",WJ).replace("tag",MD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),a8e=Un(HJ).replace("hr",o7).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",MD).getRegex(),Q8t=Un(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",a8e).getRegex(),qJ={blockquote:Q8t,code:W8t,def:X8t,fences:q8t,heading:U8t,hr:o7,html:Z8t,lheading:s8e,list:K8t,newline:G8t,paragraph:a8e,table:D1,text:Y8t},ode=Un("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o7).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",MD).getRegex(),J8t={...qJ,lheading:j8t,table:ode,paragraph:Un(HJ).replace("hr",o7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ode).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",MD).getRegex()},eMt={...qJ,html:Un(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",WJ).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:D1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Un(HJ).replace("hr",o7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",s8e).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},tMt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rMt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,o8e=/^( {2,}|\\)\n(?!\s*$)/,nMt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",H8t?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),c8e=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lMt=Un(c8e,"u").replace(/punct/g,K3).getRegex(),cMt=Un(c8e,"u").replace(/punct/g,l8e).getRegex(),u8e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",uMt=Un(u8e,"gu").replace(/notPunctSpace/g,UJ).replace(/punctSpace/g,RD).replace(/punct/g,K3).getRegex(),hMt=Un(u8e,"gu").replace(/notPunctSpace/g,aMt).replace(/punctSpace/g,sMt).replace(/punct/g,l8e).getRegex(),dMt=Un("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,UJ).replace(/punctSpace/g,RD).replace(/punct/g,K3).getRegex(),fMt=Un(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,K3).getRegex(),pMt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gMt=Un(pMt,"gu").replace(/notPunctSpace/g,UJ).replace(/punctSpace/g,RD).replace(/punct/g,K3).getRegex(),mMt=Un(/\\(punct)/,"gu").replace(/punct/g,K3).getRegex(),yMt=Un(/^<(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(),vMt=Un(WJ).replace("(?:-->|$)","-->").getRegex(),bMt=Un("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",vMt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),AL=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,xMt=Un(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",AL).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),h8e=Un(/^!?\[(label)\]\[(ref)\]/).replace("label",AL).replace("ref",GJ).getRegex(),d8e=Un(/^!?\[(ref)\](?:\[\])?/).replace("ref",GJ).getRegex(),wMt=Un("reflink|nolink(?!\\()","g").replace("reflink",h8e).replace("nolink",d8e).getRegex(),lde=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jJ={_backpedal:D1,anyPunctuation:mMt,autolink:yMt,blockSkip:oMt,br:o8e,code:rMt,del:D1,delLDelim:D1,delRDelim:D1,emStrongLDelim:lMt,emStrongRDelimAst:uMt,emStrongRDelimUnd:dMt,escape:tMt,link:xMt,nolink:d8e,punctuation:iMt,reflink:h8e,reflinkSearch:wMt,tag:bMt,text:nMt,url:D1},TMt={...jJ,link:Un(/^!?\[(label)\]\((.*?)\)/).replace("label",AL).getRegex(),reflink:Un(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",AL).getRegex()},Sq={...jJ,emStrongRDelimAst:hMt,emStrongLDelim:cMt,delLDelim:fMt,delRDelim:gMt,url:Un(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",lde).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:Un(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},cde=t=>kMt[t];function ld(t,e){if(e){if(Nl.escapeTest.test(t))return t.replace(Nl.escapeReplace,cde)}else if(Nl.escapeTestNoEncode.test(t))return t.replace(Nl.escapeReplaceNoEncode,cde);return t}function ude(t){try{t=encodeURI(t).replace(Nl.percentDecode,"%")}catch{return null}return t}function hde(t,e){var s;let r=t.replace(Nl.findPipe,(a,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Nl.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function EMt(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let s=4-r%4;n+=" ".repeat(s),r+=s}else n+=i,r++;return n}function dde(t,e,r,n,i){let s=e.href,a=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:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function AMt(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` -`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(` -`)}var ML=class{constructor(e){wr(this,"options");wr(this,"rules");wr(this,"lexer");this.options=e||Av}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:UC(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=AMt(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=UC(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:UC(r[0],` -`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=UC(r[0],` + */function kSt(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 SSt=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Sg(t){const e=[];for(let r=0,n=t.length;r_c||t.height>_c)&&(t.width>_c&&t.height>_c?t.width>t.height?(t.height*=_c/t.width,t.width=_c):(t.width*=_c/t.height,t.height=_c):t.width>_c?(t.height*=_c/t.width,t.width=_c):(t.width*=_c/t.height,t.height=_c))}function RL(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 LSt(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function ISt(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),LSt(i)}const wc=(t,e)=>{if(t instanceof e)return!0;const r=Object.getPrototypeOf(t);return r===null?!1:r.constructor.name===e.name||wc(r,e)};function NSt(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function DSt(t,e){return iSe(e).map(r=>{const n=t.getPropertyValue(r),i=t.getPropertyPriority(r);return`${r}: ${n}${i?" !important":""};`}).join(" ")}function OSt(t,e,r,n){const i=`.${t}:${e}`,a=r.cssText?NSt(r):DSt(r,n);return document.createTextNode(`${i}{${a}}`)}function dde(t,e,r,n){const i=window.getComputedStyle(t,r),a=i.getPropertyValue("content");if(a===""||a==="none")return;const s=SSt();try{e.className=`${e.className} ${s}`}catch{return}const o=document.createElement("style");o.appendChild(OSt(s,r,i,n)),e.appendChild(o)}function _St(t,e,r){dde(t,e,":before",r),dde(t,e,":after",r)}const fde="application/font-woff",pde="image/jpeg",PSt={woff:fde,woff2:fde,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:pde,jpeg:pde,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function BSt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function WQ(t){const e=BSt(t).toLowerCase();return PSt[e]||""}function $St(t){return t.split(/,/)[1]}function LW(t){return t.search(/^(data:)/)!==-1}function FSt(t,e){return`data:${e};base64,${t}`}async function sSe(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 H$={};function zSt(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 qQ(t,e,r){const n=zSt(t,e,r.includeQueryParams);if(H$[n]!=null)return H$[n];r.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const a=await sSe(t,r.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),$St(o)));i=FSt(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 H$[n]=i,i}async function VSt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):RL(e)}async function HSt(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 RL(o)}const r=t.poster,n=WQ(r),i=await qQ(r,n,e);return RL(i)}async function GSt(t,e){var r;try{if(!((r=t==null?void 0:t.contentDocument)===null||r===void 0)&&r.body)return await RO(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function WSt(t,e){return wc(t,HTMLCanvasElement)?VSt(t):wc(t,HTMLVideoElement)?HSt(t,e):wc(t,HTMLIFrameElement)?GSt(t,e):t.cloneNode(oSe(t))}const qSt=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",oSe=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function jSt(t,e,r){var n,i;if(oSe(e))return e;let a=[];return qSt(t)&&t.assignedNodes?a=Sg(t.assignedNodes()):wc(t,HTMLIFrameElement)&&(!((n=t.contentDocument)===null||n===void 0)&&n.body)?a=Sg(t.contentDocument.body.childNodes):a=Sg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),a.length===0||wc(t,HTMLVideoElement)||await a.reduce((s,o)=>s.then(()=>RO(o,r)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function YSt(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):iSe(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`),wc(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 XSt(t,e){wc(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),wc(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function KSt(t,e){if(wc(t,HTMLSelectElement)){const n=Array.from(e.children).find(i=>t.value===i.getAttribute("value"));n&&n.setAttribute("selected","")}}function ZSt(t,e,r){return wc(e,Element)&&(YSt(t,e,r),_St(t,e,r),XSt(t,e),KSt(t,e)),e}async function JSt(t,e){const r=t.querySelectorAll?t.querySelectorAll("use"):[];if(r.length===0)return t;const n={};for(let a=0;aWSt(n,e)).then(n=>jSt(t,n,e)).then(n=>ZSt(t,n,e)).then(n=>JSt(n,e))}const lSe=/url\((['"]?)([^'"]+?)\1\)/g,QSt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,eEt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function tEt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function rEt(t){const e=[];return t.replace(lSe,(r,n,i)=>(e.push(i),r)),e.filter(r=>!LW(r))}async function nEt(t,e,r,n,i){try{const a=r?kSt(e,r):e,s=WQ(e);let o;return i||(o=await qQ(a,s,n)),t.replace(tEt(e),`$1${o}$3`)}catch{}return t}function iEt(t,{preferredFontFormat:e}){return e?t.replace(eEt,r=>{for(;;){const[n,,i]=QSt.exec(r)||[];if(!i)return"";if(i===e)return`src: ${n};`}}):t}function cSe(t){return t.search(lSe)!==-1}async function uSe(t,e,r){if(!cSe(t))return t;const n=iEt(t,r);return rEt(n).reduce((a,s)=>a.then(o=>nEt(o,s,e,r)),Promise.resolve(n))}async function x2(t,e,r){var n;const i=(n=e.style)===null||n===void 0?void 0:n.getPropertyValue(t);if(i){const a=await uSe(i,null,r);return e.style.setProperty(t,a,e.style.getPropertyPriority(t)),!0}return!1}async function aEt(t,e){await x2("background",t,e)||await x2("background-image",t,e),await x2("mask",t,e)||await x2("-webkit-mask",t,e)||await x2("mask-image",t,e)||await x2("-webkit-mask-image",t,e)}async function sEt(t,e){const r=wc(t,HTMLImageElement);if(!(r&&!LW(t.src))&&!(wc(t,SVGImageElement)&&!LW(t.href.baseVal)))return;const n=r?t.src:t.href.baseVal,i=await qQ(n,WQ(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 oEt(t,e){const n=Sg(t.childNodes).map(i=>hSe(i,e));await Promise.all(n).then(()=>t)}async function hSe(t,e){wc(t,Element)&&(await aEt(t,e),await sEt(t,e),await oEt(t,e))}function lEt(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 gde={};async function mde(t){let e=gde[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},gde[t]=e,e}async function Ude(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),sSe(o,e.fetchRequestInit,({result:l})=>(r=r.replace(s,`url(${l})`),[s,l]))});return Promise.all(a).then(()=>r)}function yde(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 cEt(t,e){const r=[],n=[];return t.forEach(i=>{if("cssRules"in i)try{Sg(i.cssRules||[]).forEach((a,s)=>{if(a.type===CSSRule.IMPORT_RULE){let o=s+1;const l=a.href,u=mde(l).then(h=>Ude(h,e)).then(h=>yde(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(mde(i.href).then(o=>Ude(o,e)).then(o=>yde(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{Sg(i.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),r))}function uEt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>cSe(e.style.getPropertyValue("src")))}async function hEt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Sg(t.ownerDocument.styleSheets),n=await cEt(r,e);return uEt(n)}function dSe(t){return t.trim().replace(/["']/g,"")}function dEt(t){const e=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(a=>{e.add(dSe(a))}),Array.from(n.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(t),e}async function fEt(t,e){const r=await hEt(t,e),n=dEt(t);return(await Promise.all(r.filter(a=>n.has(dSe(a.style.fontFamily))).map(a=>{const s=a.parentStyleSheet?a.parentStyleSheet.href:null;return uSe(a.cssText,s,e)}))).join(` +`)}async function pEt(t,e){const r=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await fEt(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 gEt(t,e={}){const{width:r,height:n}=aSe(t,e),i=await RO(t,e,!0);return await pEt(i,e),await hSe(i,e),lEt(i,e),await ISt(i,r,n)}async function mEt(t,e={}){const{width:r,height:n}=aSe(t,e),i=await gEt(t,e),a=await RL(i),s=document.createElement("canvas"),o=s.getContext("2d"),l=e.pixelRatio||MSt(),u=e.canvasWidth||r,h=e.canvasHeight||n;return s.width=u*l,s.height=h*l,e.skipAutoScale||RSt(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}function jQ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R5=jQ();function fSe(t){R5=t}var Bm={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(Nl.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var UEt=(()=>{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)}}>`)},yEt=/^(?:[ \t]*(?:\n|$))+/,bEt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vEt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xEt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,YQ=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pSe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gSe=jn(pSe).replace(/bull/g,YQ).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(),wEt=jn(pSe).replace(/bull/g,YQ).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(),XQ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,TEt=/^[^\n]+/,KQ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,CEt=jn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",KQ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kEt=jn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,YQ).getRegex(),LO="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",ZQ=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,SEt=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",ZQ).replace("tag",LO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mSe=jn(XQ).replace("hr",hk).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",LO).getRegex(),EEt=jn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mSe).getRegex(),JQ={blockquote:EEt,code:bEt,def:CEt,fences:vEt,heading:xEt,hr:hk,html:SEt,lheading:gSe,list:kEt,newline:yEt,paragraph:mSe,table:Bm,text:TEt},bde=jn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hk).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",LO).getRegex(),AEt={...JQ,lheading:wEt,table:bde,paragraph:jn(XQ).replace("hr",hk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bde).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",LO).getRegex()},MEt={...JQ,html:jn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ZQ).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:Bm,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jn(XQ).replace("hr",hk).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",gSe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},REt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,LEt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,USe=/^( {2,}|\\)\n(?!\s*$)/,IEt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",UEt?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bSe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,PEt=jn(bSe,"u").replace(/punct/g,Q4).getRegex(),BEt=jn(bSe,"u").replace(/punct/g,ySe).getRegex(),vSe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$Et=jn(vSe,"gu").replace(/notPunctSpace/g,QQ).replace(/punctSpace/g,IO).replace(/punct/g,Q4).getRegex(),FEt=jn(vSe,"gu").replace(/notPunctSpace/g,OEt).replace(/punctSpace/g,DEt).replace(/punct/g,ySe).getRegex(),zEt=jn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,QQ).replace(/punctSpace/g,IO).replace(/punct/g,Q4).getRegex(),VEt=jn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Q4).getRegex(),HEt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",GEt=jn(HEt,"gu").replace(/notPunctSpace/g,QQ).replace(/punctSpace/g,IO).replace(/punct/g,Q4).getRegex(),WEt=jn(/\\(punct)/,"gu").replace(/punct/g,Q4).getRegex(),qEt=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(),jEt=jn(ZQ).replace("(?:-->|$)","-->").getRegex(),YEt=jn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",jEt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),LL=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,XEt=jn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",LL).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xSe=jn(/^!?\[(label)\]\[(ref)\]/).replace("label",LL).replace("ref",KQ).getRegex(),wSe=jn(/^!?\[(ref)\](?:\[\])?/).replace("ref",KQ).getRegex(),KEt=jn("reflink|nolink(?!\\()","g").replace("reflink",xSe).replace("nolink",wSe).getRegex(),vde=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,eee={_backpedal:Bm,anyPunctuation:WEt,autolink:qEt,blockSkip:_Et,br:USe,code:LEt,del:Bm,delLDelim:Bm,delRDelim:Bm,emStrongLDelim:PEt,emStrongRDelimAst:$Et,emStrongRDelimUnd:zEt,escape:REt,link:XEt,nolink:wSe,punctuation:NEt,reflink:xSe,reflinkSearch:KEt,tag:YEt,text:IEt,url:Bm},ZEt={...eee,link:jn(/^!?\[(label)\]\((.*?)\)/).replace("label",LL).getRegex(),reflink:jn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",LL).getRegex()},IW={...eee,emStrongRDelimAst:FEt,emStrongLDelim:BEt,delLDelim:VEt,delRDelim:GEt,url:jn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",vde).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]*?(?:(?=[\\":">",'"':""","'":"'"},xde=t=>QEt[t];function cd(t,e){if(e){if(Nl.escapeTest.test(t))return t.replace(Nl.escapeReplace,xde)}else if(Nl.escapeTestNoEncode.test(t))return t.replace(Nl.escapeReplaceNoEncode,xde);return t}function wde(t){try{t=encodeURI(t).replace(Nl.percentDecode,"%")}catch{return null}return t}function Tde(t,e){var a;let r=t.replace(Nl.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Nl.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 tAt(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 Cde(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 rAt(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 IL=class{constructor(e){wr(this,"options");wr(this,"rules");wr(this,"lexer");this.options=e||R5}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:X9(n,` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=rAt(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=X9(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:X9(r[0],` +`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=X9(r[0],` `).split(` -`),i="",s="",a=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u0;){let o=!1,l=[],u;for(u=0;u1,o={type:"list",raw:"",ordered:a,start:a?+s.slice(0,-1):"",loose:!1,items:[]};s=a?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=a?s:"[*+-]");let l=this.rules.other.listItemRegex(s),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=EMt(r[2].split(` +`),U=this.list(m);s[s.length-1]=U,i=i.substring(0,i.length-p.raw.length)+U.raw,a=a.substring(0,a.length-g.raw.length)+U.raw,n=m.substring(s.at(-1).raw.length).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=tAt(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 b=this.rules.other.nextBulletRegex(v),x=this.rules.other.hrRegex(v),T=this.rules.other.fencesBeginRegex(v),C=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),k=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(` -`,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)||C.test(m)||S.test(m)||k.test(m)||b.test(m)||x.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)||C.test(g)||x.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"):"",s=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:s}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=hde(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[h]})));return a}}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 a=UC(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=SMt(r[2],"()");if(a===-2)return;if(a>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],s=a[3])}else s=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)),dde(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.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," "),s=r[i.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return dde(n,s,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 s=[...i[0]].length-1,a,o,l=s,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+s);(i=h.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+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,s+i.index+d+o);if(Math.min(s,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),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(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 s=[...i[0]].length-1,a,o,l=s,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+s);(i=u.exec(r))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==s))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,s+i.index+h+o),f=d.slice(s,-s);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,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let a;do a=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(a!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,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}}}},fh=class Eq{constructor(e){wr(this,"tokens");wr(this,"options");wr(this,"state");wr(this,"inlineQueue");wr(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Av,this.options.tokenizer=this.options.tokenizer||new ML,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:Nl,block:F8.normal,inline:qC.normal};this.options.pedantic?(r.block=F8.pedantic,r.inline=qC.pedantic):this.options.gfm&&(r.block=F8.gfm,this.options.breaks?r.inline=qC.breaks:r.inline=qC.gfm),this.tokenizer.rules=r}static get rules(){return{block:F8,inline:qC}}static lex(e,r){return new Eq(r).lex(e)}static lexInline(e,r){return new Eq(r).inlineTokens(e)}lex(e){e=e.replace(Nl.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+=` +`,1)[0],U=!g.trim(),y=0;if(this.options.pedantic?(y=2,p=g.trimStart()):U?y=r[1].length+1:(y=g.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=g.slice(y),y+=r[1].length),U&&this.rules.other.blankLine.test(m)&&(f+=m+` +`,e=e.substring(m.length+1),d=!0),!d){let b=this.rules.other.nextBulletRegex(y),v=this.rules.other.hrRegex(y),w=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),k=this.rules.other.htmlBeginRegex(y),C=this.rules.other.blockquoteBeginRegex(y);for(;e;){let S=e.split(` +`,1)[0],E;if(m=S,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),E=m):E=m.replace(this.rules.other.tabCharGlobal," "),w.test(m)||T.test(m)||k.test(m)||C.test(m)||b.test(m)||v.test(m))break;if(E.search(this.rules.other.nonSpaceChar)>=y||!m.trim())p+=` +`+E.slice(y);else{if(U||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(g)||T.test(g)||v.test(g))break;p+=` +`+m}U=!m.trim(),f+=S+` +`,e=e.substring(S.length+1),g=E.slice(y)}}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=Tde(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=X9(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=eAt(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)),Cde(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 Cde(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}}}},fh=class NW{constructor(e){wr(this,"tokens");wr(this,"options");wr(this,"state");wr(this,"inlineQueue");wr(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R5,this.options.tokenizer=this.options.tokenizer||new IL,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:Nl,block:VS.normal,inline:Y9.normal};this.options.pedantic?(r.block=VS.pedantic,r.inline=Y9.pedantic):this.options.gfm&&(r.block=VS.gfm,this.options.breaks?r.inline=Y9.breaks:r.inline=Y9.gfm),this.tokenizer.rules=r}static get rules(){return{block:VS,inline:Y9}}static lex(e,r){return new NW(r).lex(e)}static lexInline(e,r){return new NW(r).inlineTokens(e)}lex(e){e=e.replace(Nl.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(` `)?"":` `)+o.raw,u.text+=` `+o.text,this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(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(` `)?"":` `)+o.raw,u.text+=` -`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(` +`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+o.raw,u.text+=` `+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 s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)s=i[2]?i[2].length:0,n=n.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-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 a=!1,o="";for(;e;){a||(o=""),a=!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(b=>{v=b.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)),a=!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}},RL=class{constructor(e){wr(this,"options");wr(this,"parser");this.options=e||Av}space(e){return""}code({text:e,lang:r,escaped:n}){var a;let i=(a=(r||"").match(Nl.notSpaceStart))==null?void 0:a[0],s=e.replace(Nl.endingNewline,"")+` -`;return i?'

    '+(n?s:ld(s,!0))+`
    -`:"
    "+(n?s:ld(s,!0))+`
    +`+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,U=e.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},U),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),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}},NL=class{constructor(e){wr(this,"options");wr(this,"parser");this.options=e||R5}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Nl.notSpaceStart))==null?void 0:s[0],a=e.replace(Nl.endingNewline,"")+` +`;return i?'
    '+(n?a:cd(a,!0))+`
    +`:"
    "+(n?a:cd(a,!0))+`
    `}blockquote({tokens:e}){return`
    ${this.parser.parse(e)}
    `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
    -`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o -`+i+" +`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o +`+i+" `}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • `}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    -`}table(e){let r="",n="";for(let s=0;s${i}`),` +`}table(e){let r="",n="";for(let a=0;a${i}`),`
    `+r+` `+i+`
    `}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`${ld(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),s=ude(e);if(s===null)return i;e=s;let a='
    ",a}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=ude(e);if(s===null)return ld(n);e=s;let a=`${ld(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(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),i.extensions=r),n.renderer){let s=this.defaults.renderer||new RL(this.defaults);for(let a in n.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=n.renderer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d||""}}i.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new ML(this.defaults);for(let a in n.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=n.tokenizer[o],u=s[o];s[o]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new Bk;for(let a in n.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=n.hooks[o],u=s[o];Bk.passThroughHooks.has(a)?s[o]=h=>{if(this.defaults.async&&Bk.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return u.call(s,f)})();let d=l.call(s,h);return u.call(s,d)}:s[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await u.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=u.apply(s,h)),d}}i.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return fh.lex(e,r??this.defaults)}parser(e,r){return ph.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer(e):e?fh.lex:fh.lexInline)(o,s),u=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(u,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(e):e?ph.parse:ph.parseInline)(u,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let o=(s.hooks?s.hooks.provideLexer(e):e?fh.lex:fh.lexInline)(r,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(e):e?ph.parse:ph.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+ld(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},ev=new MMt;function Ci(t,e){return ev.parse(t,e)}Ci.options=Ci.setOptions=function(t){return ev.setOptions(t),Ci.defaults=ev.defaults,n8e(Ci.defaults),Ci};Ci.getDefaults=zJ;Ci.defaults=Av;Ci.use=function(...t){return ev.use(...t),Ci.defaults=ev.defaults,n8e(Ci.defaults),Ci};Ci.walkTokens=function(t,e){return ev.walkTokens(t,e)};Ci.parseInline=ev.parseInline;Ci.Parser=ph;Ci.parser=ph.parse;Ci.Renderer=RL;Ci.TextRenderer=YJ;Ci.Lexer=fh;Ci.lexer=fh.lex;Ci.Tokenizer=ML;Ci.Hooks=Bk;Ci.parse=Ci;Ci.options;Ci.setOptions;Ci.use;Ci.walkTokens;Ci.parseInline;ph.parse;fh.lex;const RMt=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function _Mt(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(RMt);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function LMt(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`${cd(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=wde(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=wde(e);if(a===null)return cd(n);e=a;let s=`${cd(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 NL(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 IL(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 z3;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];z3.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&z3.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 fh.lex(e,r??this.defaults)}parser(e,r){return ph.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?fh.lex:fh.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?ph.parse:ph.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?fh.lex:fh.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?ph.parse:ph.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:

    "+cd(n.message+"",!0)+"
    ";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},n5=new nAt;function Ci(t,e){return n5.parse(t,e)}Ci.options=Ci.setOptions=function(t){return n5.setOptions(t),Ci.defaults=n5.defaults,fSe(Ci.defaults),Ci};Ci.getDefaults=jQ;Ci.defaults=R5;Ci.use=function(...t){return n5.use(...t),Ci.defaults=n5.defaults,fSe(Ci.defaults),Ci};Ci.walkTokens=function(t,e){return n5.walkTokens(t,e)};Ci.parseInline=n5.parseInline;Ci.Parser=ph;Ci.parser=ph.parse;Ci.Renderer=NL;Ci.TextRenderer=tee;Ci.Lexer=fh;Ci.lexer=fh.lex;Ci.Tokenizer=IL;Ci.Hooks=z3;Ci.parse=Ci;Ci.options;Ci.setOptions;Ci.use;Ci.walkTokens;Ci.parseInline;ph.parse;fh.lex;const iAt=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function aAt(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(iAt);return i?[{...e,raw:(e.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[e]})}function sAt(t,e){const r=e.split(` `).flatMap(n=>[n,""]).map(n=>`${t}${n}`).join(` -`);return r.slice(0,r.length-1)}function fde(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&R5(s.attrs,i.attrs))||r.push(n)}),r}function IMt(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const s=t.get(n);(!s||!R5(s.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function NMt(t,e,r,n){const i=!r,s=r&&(!r.marks||r.marks.length===0),a=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||s||a)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(h=>h.type===l&&R5(h.attrs,u.attrs))||o.push(l)}):(i||s)&&o.push(...Array.from(t.keys()).reverse())),o}function OMt(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 DMt(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,s])=>{const a=r(i,s);a&&(n+=a),e.set(i,s)}),n}function FF(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 z8(t,e){return typeof t!="string"?"json":e}function PMt(t){const e=t.map(()=>new Map),r=new Map,n=i=>{const s=r.get(i);s&&(s.indexes.forEach(a=>e[a].set(i,s.text)),r.delete(i))};return t.forEach((i,s)=>{if(i.type!=="text"){Array.from(r.keys()).forEach(n);return}const a=new Set((i.marks||[]).map(o=>o.type));Array.from(r.keys()).filter(o=>!a.has(o)).forEach(n),a.forEach(o=>{const l=r.get(o)||{indexes:[],text:""};l.indexes.push(s),l.text+=i.text||"",r.set(o,l)})}),Array.from(r.keys()).forEach(n),e}const $Mt=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"]),BMt=/<\/?([a-zA-Z][\w-]*)/g;function FMt(t){const e=[];let r;for(;(r=BMt.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function zMt(t){const e=t.toLowerCase();return e.includes("-")?!1:!$Mt.has(e)}function VMt(t,e){return FMt(t).some(r=>zMt(r)?!e.has(r):!1)}var Mq=class{constructor(t){var e,r,n,i,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=(e=t==null?void 0:t.marked)!==null&&e!==void 0?e:Ci,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||(s=t.indentation)===null||s===void 0?void 0:s.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,nx(ZO(t.extensions)).forEach(a=>this.registerExtension(a)))}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=ri(gr(t,"code")),i=t.name,s={name:i,options:t.options,storage:t.storage};n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=gr(t,"markdownTokenName",s)||i,o=gr(t,"parseMarkdown",s),l=gr(t,"renderMarkdown",s),u=gr(t,"markdownTokenizer",s),h=(e=gr(t,"markdownOptions",s))!==null&&e!==void 0?e:null,d={tokenName:a,nodeName:i,parseMarkdown:o,renderMarkdown:l,isIndenting:(r=h==null?void 0:h.indentsContent)!==null&&r!==void 0?r:!1,htmlReopen:h==null?void 0:h.htmlReopen,tokenizer:u};if(a&&o){const f=this.registry.get(a)||[];f.push(d),this.registry.set(a,f)}if(l){const f=this.nodeTypeRegistry.get(i)||[];f.push(d),this.nodeTypeRegistry.set(i,f)}u&&this.hasMarked()&&this.registerTokenizer(u)}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,s=this.createTokenizerHelpers.bind(this),a=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?s(this.lexer):s(a()),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?_Mt(t):t,n=r.reduce((a,o,l)=>(o.type!=="space"&&a.push(l),a),[]);let i=-1,s=0;return r.flatMap((a,o)=>{for(;s({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 s=i.parseMarkdown(t,n),a=this.normalizeParseResult(s);return a&&(!Array.isArray(a)||a.length>0)?(this.lastParseResult=a,!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=>FF(o).isTask),r=t.items.some(o=>!FF(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],s=null;for(let o=0;o1&&g.slice(1).join(` -`).trim()){const b=g.slice(1),x=b.filter(T=>T.trim());if(x.length>0){const T=Math.min(...x.map(S=>S.length-S.trimStart().length)),C=b.map(S=>S.trim()?S.slice(T):"").join(` -`).trim();C&&(v=this.markedInstance.lexer(`${C} -`))}}f={type:"taskItem",raw:"",mainContent:y,indentLevel:d,checked:h??!1,text:y,tokens:this.tokenizeInline(y),nestedTokens:v}}const p=u?"taskList":"list";s!==p?(i.length>0&&n.push({type:s,items:i}),i=[f],s=p):i.push(f)}i.length>0&&n.push({type:s,items:i});const a=[];for(let o=0;o0?a: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),s=this.normalizeParseResult(i);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!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 a=0;a|\/|$)/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=a+1;v0;a-=1){const o=e[a],l=e[a-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];E1t(u,h)&&(l.text=(l.text||"")+(o.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],s=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,s]}}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:Fce(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=dmt(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=fW(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return VMt(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=fW(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(s=>{if(typeof(s==null?void 0:s.tag)=="string"){const a=s.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[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(h1t(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var s;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)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=a.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=a.isIndenting?n+1:n;return this.renderNodeToMarkdown(h,t,d,f)},indent:h=>this.indentString+h,wrapInBlock:LMt},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((s=a.renderMarkdown)===null||s===void 0?void 0:s.call(a,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=[],s=new Map,a=new Set,o=new Map,l=PMt(t);return t.forEach((u,h)=>{const d=h[S.type,S])),g=this.getMarksToOpenForSerialization(s,p,d),m=fde(p,d);if(f.length>0&&f.trim().length===0&&p.size>0){const S=new Set(m.filter(k=>!s.has(k)));S.size>0&&(p=new Map(Array.from(p).filter(([k])=>!S.has(k))),g=this.getMarksToOpenForSerialization(s,p,d),m=fde(p,d))}const y=m.filter(S=>s.has(S)),v=y.length>0&&g.length>0;let b="";if(m.length>0&&!v){const S=f.match(/(\s+)$/);S&&(b=S[1],f=f.slice(0,-b.length))}v||m.slice().reverse().forEach(S=>{var k;if(!s.has(S))return;const E=p.get(S),A=this.getMarkClosing(S,E,o.get(S),(k=l[h])===null||k===void 0?void 0:k.get(S));A&&(f+=A),s.has(S)&&(s.delete(S),o.delete(S))});let x="";if(g.length>0){const S=f.match(/^(\s+)/);S&&(x=S[1],f=f.slice(x.length))}g.forEach(({type:S,mark:k})=>{var E;const A=a.has(S)?"html":"markdown",M=this.getMarkOpening(S,k,A,(E=l[h])===null||E===void 0?void 0:E.get(S));M&&(f=M+f),o.set(S,A),a.delete(S)}),v||g.slice().reverse().forEach(({type:S,mark:k})=>{s.set(S,k)}),f=x+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)&&a.add(A)});const k=Array.from(s.keys()),E=y.slice().sort((A,M)=>k.indexOf(M)-k.indexOf(A));T=[...g.map(A=>A.type),...E]}else T=NMt(s,p,d,this.markSetsEqual.bind(this));let C="";if(T.length>0){const S=f.match(/(\s+)$/);S&&(C=S[1],f=f.slice(0,-C.length))}T.forEach(S=>{var k,E;const A=(k=s.get(S))!==null&&k!==void 0?k:p.get(S),M=this.getMarkClosing(S,A,o.get(S),(E=l[h])===null||E===void 0?void 0:E.get(S));M&&(f+=M),s.delete(S),o.delete(S)}),f+=C,f+=b,i.push(f)}else{const f=new Set((u.marks||[]).map(b=>b.type)),p=new Map,g=new Map;s.forEach((b,x)=>{if(f.has(x)){var T;p.set(x,b),g.set(x,(T=o.get(x))!==null&&T!==void 0?T:"markdown")}});const m=OMt(s,(b,x)=>{var T;return this.getMarkClosing(b,x,o.get(b),(T=l[h-1])===null||T===void 0?void 0:T.get(b))});o.clear();const y=this.renderNodeToMarkdown(u,e,h,n),v=u.type==="hardBreak"?"":DMt(p,s,(b,x)=>{var T,C;const S=(T=g.get(b))!==null&&T!==void 0?T:"markdown";return o.set(b,S),this.getMarkOpening(b,x,S,(C=l[h+1])===null||C===void 0?void 0:C.get(b))});i.push(m+y+v)}}),i.join(r)}getMarkOpening(t,e,r="markdown",n){if(r==="html"){var i;return((i=this.getHtmlReopenTags(t))===null||i===void 0?void 0:i.open)||""}const s=this.getHandlersForNodeType(t),a=s.length>0?s[0]:void 0;if(!a||!a.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const u=a.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{markText:n}}),h=u.indexOf(o);return h>=0?u.substring(0,h):""}catch(u){throw new Error(`Failed to get mark opening for ${t}: ${u}`)}}getMarkClosing(t,e,r="markdown",n){if(r==="html"){var i;return((i=this.getHtmlReopenTags(t))===null||i===void 0?void 0:i.close)||""}const s=this.getHandlersForNodeType(t),a=s.length>0?s[0]:void 0;if(!a||!a.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:o}]};try{const u=a.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:f=>f,wrapInBlock:(f,p)=>f+p},{index:0,level:0,parentType:"text",meta:{markText:n}}),h=u.indexOf(o),d=h+33;return h>=0?u.substring(d):""}catch(u){throw new Error(`Failed to get mark closing for ${t}: ${u}`)}}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&&R5(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=IMt(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],s=(u,h)=>i.some(d=>d.type===u&&R5(d.attrs,h)),a=(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=>!s(u.type,u.mark.attrs)).sort(a),l=n.filter(u=>s(u.type,u.mark.attrs)).sort(a);return[...o,...l]}};const HMt=Ni.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||z8(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return sd.setContent(t,e);const r=this.editor.markdown.parse(t);return sd.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||z8(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return sd.insertContent(t,e);const r=this.editor.markdown.parse(t);return sd.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||z8(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return sd.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return sd.insertContentAt(t,n,r)}}},addStorage(){return{manager:new Mq({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 Mq({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||z8(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)}}),GMt="listItem",pde="textStyle",gde=/^\s*([-+*])\s$/,f8e=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",mn(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(GMt,this.editor.getAttributes(pde)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=L5({find:gde,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=L5({find:gde,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pde),editor:this.editor})),[t]}}),WMt=(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 s=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){s=p;break}if(s<0)return null;const a=i.node(s),o=i.index(s);if(o+1>=a.childCount)return null;const l=a.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:s,nestedList:d,nestedListPos:i.after(),insertPos:i.after(s),items:f}},qMt=(t,e,r,n)=>{const i=WMt(t,r,n);if(!i)return!1;const{selection:s}=t,{nestedList:a,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+a.nodeSize);const d=h.mapping.map(l);return h.insert(d,At.from(u)),h.setSelection(s.map(h.doc,h.mapping)),e&&e(h),!0},UMt=(t,e,r)=>qMt(t.state,t.view.dispatch,e,r),p8e=(t,e)=>Ni.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>UMt(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),g8e=[[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"]],V8="abcdefghijklmnopqrstuvwxyz",m8e=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function _D(t){let e=t,r="";for(const[n,i]of g8e)for(;e>=n;)r+=i,e-=n;return r}function XJ(t){return _D(t).toUpperCase()}function y8e(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 XMt(t,e){if(t==="numeric")return String(e);switch(t){case"a":return _L(e);case"A":return _L(e).toUpperCase();case"i":return _D(e);case"I":return XJ(e);default:return String(e)}}function KMt(t){var e;if(t.length===0)return!1;const r=(e=LD(t[0]))!==null&&e!==void 0?e:"numeric",n=KJ(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(eRt(t))return{type:"listItem",content:[{type:"paragraph",content:tRt(t.text||"",e)}]};if(t.tokens.some(s=>s.type==="paragraph"))i=n(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const a=n(t.tokens.slice(1));i.push(...a)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>T3e(t,e,n=>{if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){var i,s;const a=((i=n.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.start)||1;return JMt((s=n.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.type,a-1+(n.index||0),". ")}return"- "},r,{alignNestedToPrefix:(r==null?void 0:r.parentType)==="orderedList"}),addExtensions(){return[p8e(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)}}}),ZJ=(t,e)=>{const{$from:r}=e.selection,n=Pa(t,e.schema);let i=null,s=r.depth,a=r.pos,o=null;for(;s>0&&o===null;)i=r.node(s),i.type===n?o=s:(s-=1,a-=1);return o===null?null:{$pos:e.doc.resolve(a),depth:o}},b8e=(t,e)=>{const r=ZJ(t,e);if(!r)return!1;const[,n]=ymt(e,t,r.$pos.pos+4);return n},rRt=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),s=t.doc.resolve(i).node();return!(!s||!r.includes(s.type.name))},mde=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!A0(t.state,e)&&rRt(t.state,e,r)){const{$anchor:s}=t.state.selection,a=t.state.doc.resolve(s.before()-1),o=[];a.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(a.start()+l.pos+1);return t.chain().cut({from:s.start()-1,to:s.end()+1},u.end()).joinForward().run()}if(!A0(t.state,e)||!wmt(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()},nRt=(t,e)=>{const r=b8e(t,e),n=ZJ(t,e);return!n||!r?!1:r>n.depth},iRt=(t,e)=>{const r=b8e(t,e),n=ZJ(t,e);return!n||!r?!1:r{if(!A0(t.state,e)||!xmt(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:nRt(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():iRt(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},sRt=(t,e,r)=>{const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0||!s.parent.isTextblock||A0(n,e))return!1;const a=vmt(s);if(!a||!r.includes(a.type.name))return!1;const o=a.lastChild;if(!o||o.type.name!==e)return!1;const l=s.parent;if(!o.canReplace(o.childCount,o.childCount,At.from(l)))return!1;const u=s.before(),h=s.after(),d=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,h).insert(d,At.from(l)),f.setSelection(yr.create(f.doc,d+1)),f.scrollIntoView()),!0))},x8e=Ni.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&&yde(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&&yde(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&&mde(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&&mde(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&&sRt(t,e,r))return!0;return!1}}}}),LL=new RegExp(`^(\\s*)(${m8e})([.)])\\s+(.*)$`),aRt=/^\s/,eb={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function oRt(t){return LL.test(t.trimStart())}function lRt(t){const e=t.trimStart();return eb.bulletItem.test(e)||oRt(e)||eb.heading.test(e)||eb.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||eb.codeFence.test(e)||eb.blockMath.test(e)}function cRt(t){return Object.values(eb).some(e=>e.test(t))}function uRt(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&&lRt(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function vde(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(hRt);if(!i)return null;r.push({marker:i[1],content:i[3]})}return KMt(r.map(n=>n.marker))?{type:"orderedList",attrs:QMt(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function w8e(t,e,r){const n=[];let i=0;for(;i{if(!e){r.push(n);return}(e.marks||[]).find(a=>a.type===n&&Nv(a.attrs,i.attrs))||r.push(n)}),r}function oAt(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!Nv(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function lAt(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&&Nv(h.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function cAt(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 uAt(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 G$(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 HS(t,e){return typeof t!="string"?"json":e}function hAt(t){const e=t.map(()=>new Map),r=new Map,n=i=>{const a=r.get(i);a&&(a.indexes.forEach(s=>e[s].set(i,a.text)),r.delete(i))};return t.forEach((i,a)=>{if(i.type!=="text"){Array.from(r.keys()).forEach(n);return}const s=new Set((i.marks||[]).map(o=>o.type));Array.from(r.keys()).filter(o=>!s.has(o)).forEach(n),s.forEach(o=>{const l=r.get(o)||{indexes:[],text:""};l.indexes.push(a),l.text+=i.text||"",r.set(o,l)})}),Array.from(r.keys()).forEach(n),e}const dAt=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"]),fAt=/<\/?([a-zA-Z][\w-]*)/g;function pAt(t){const e=[];let r;for(;(r=fAt.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function gAt(t){const e=t.toLowerCase();return e.includes("-")?!1:!dAt.has(e)}function mAt(t,e){return pAt(t).some(r=>gAt(r)?!e.has(r):!1)}var OW=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:Ci,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,o6(eO(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=ni(mr(t,"code")),i=t.name,a={name:i,options:t.options,storage:t.storage};n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const s=mr(t,"markdownTokenName",a)||i,o=mr(t,"parseMarkdown",a),l=mr(t,"renderMarkdown",a),u=mr(t,"markdownTokenizer",a),h=(e=mr(t,"markdownOptions",a))!==null&&e!==void 0?e:null,d={tokenName:s,nodeName:i,parseMarkdown:o,renderMarkdown:l,isIndenting:(r=h==null?void 0:h.indentsContent)!==null&&r!==void 0?r:!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(i)||[];f.push(d),this.nodeTypeRegistry.set(i,f)}u&&this.hasMarked()&&this.registerTokenizer(u)}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?aAt(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=>G$(o).isTask),r=t.items.some(o=>!G$(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 b=g.slice(1),v=b.filter(w=>w.trim());if(v.length>0){const w=Math.min(...v.map(k=>k.length-k.trimStart().length)),T=b.map(k=>k.trim()?k.slice(w):"").join(` +`).trim();T&&(y=this.markedInstance.lexer(`${T} +`))}}f={type:"taskItem",raw:"",mainContent:U,indentLevel:d,checked:h??!1,text:U,tokens:this.tokenizeInline(U),nestedTokens:y}}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 U=[l];for(let y=s+1;y0;s-=1){const o=e[s],l=e[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];tUt(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:Zce(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=z1t(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=vG(this.baseExtensions);Object.values(e.nodes).forEach(r=>{r.isInline&&t.add(r.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return mAt(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=vG(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(Fmt(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:sAt},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,l=hAt(t);return t.forEach((u,h)=>{const d=h[k.type,k])),g=this.getMarksToOpenForSerialization(a,p,d),m=kde(p,d);if(f.length>0&&f.trim().length===0&&p.size>0){const k=new Set(m.filter(C=>!a.has(C)));k.size>0&&(p=new Map(Array.from(p).filter(([C])=>!k.has(C))),g=this.getMarksToOpenForSerialization(a,p,d),m=kde(p,d))}const U=m.filter(k=>a.has(k)),y=U.length>0&&g.length>0;let b="";if(m.length>0&&!y){const k=f.match(/(\s+)$/);k&&(b=k[1],f=f.slice(0,-b.length))}y||m.slice().reverse().forEach(k=>{var C;if(!a.has(k))return;const S=p.get(k),E=this.getMarkClosing(k,S,o.get(k),(C=l[h])===null||C===void 0?void 0:C.get(k));E&&(f+=E),a.has(k)&&(a.delete(k),o.delete(k))});let v="";if(g.length>0){const k=f.match(/^(\s+)/);k&&(v=k[1],f=f.slice(v.length))}g.forEach(({type:k,mark:C})=>{var S;const E=s.has(k)?"html":"markdown",A=this.getMarkOpening(k,C,E,(S=l[h])===null||S===void 0?void 0:S.get(k));A&&(f=A+f),o.set(k,E),s.delete(k)}),y||g.slice().reverse().forEach(({type:k,mark:C})=>{a.set(k,C)}),f=v+f;let w;if(y){const k=new Set(((d==null?void 0:d.marks)||[]).map(E=>E.type));g.forEach(({type:E})=>{k.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const C=Array.from(a.keys()),S=U.slice().sort((E,A)=>C.indexOf(A)-C.indexOf(E));w=[...g.map(E=>E.type),...S]}else w=lAt(a,p,d,this.markSetsEqual.bind(this));let T="";if(w.length>0){const k=f.match(/(\s+)$/);k&&(T=k[1],f=f.slice(0,-T.length))}w.forEach(k=>{var C,S;const E=(C=a.get(k))!==null&&C!==void 0?C:p.get(k),A=this.getMarkClosing(k,E,o.get(k),(S=l[h])===null||S===void 0?void 0:S.get(k));A&&(f+=A),a.delete(k),o.delete(k)}),f+=T,f+=b,i.push(f)}else{const f=new Set((u.marks||[]).map(b=>b.type)),p=new Map,g=new Map;a.forEach((b,v)=>{if(f.has(v)){var w;p.set(v,b),g.set(v,(w=o.get(v))!==null&&w!==void 0?w:"markdown")}});const m=cAt(a,(b,v)=>{var w;return this.getMarkClosing(b,v,o.get(b),(w=l[h-1])===null||w===void 0?void 0:w.get(b))});o.clear();const U=this.renderNodeToMarkdown(u,e,h,n),y=u.type==="hardBreak"?"":uAt(p,a,(b,v)=>{var w,T;const k=(w=g.get(b))!==null&&w!==void 0?w:"markdown";return o.set(b,k),this.getMarkOpening(b,v,k,(T=l[h+1])===null||T===void 0?void 0:T.get(b))});i.push(m+U+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown",n){if(r==="html"){var i;return((i=this.getHtmlReopenTags(t))===null||i===void 0?void 0:i.open)||""}const a=this.getHandlersForNodeType(t),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.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:{markText:n}}),h=u.indexOf(o);return h>=0?u.substring(0,h):""}catch(u){throw new Error(`Failed to get mark opening for ${t}: ${u}`)}}getMarkClosing(t,e,r="markdown",n){if(r==="html"){var i;return((i=this.getHtmlReopenTags(t))===null||i===void 0?void 0:i.close)||""}const a=this.getHandlersForNodeType(t),s=a.length>0?a[0]:void 0;if(!s||!s.renderMarkdown)return"";const o="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.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:{markText:n}}),h=u.indexOf(o),d=h+33;return h>=0?u.substring(d):""}catch(u){throw new Error(`Failed to get mark closing for ${t}: ${u}`)}}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&&Nv(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=oAt(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&&Nv(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 UAt=Di.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||HS(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return sd.setContent(t,e);const r=this.editor.markdown.parse(t);return sd.setContent(r,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||HS(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return sd.insertContent(t,e);const r=this.editor.markdown.parse(t);return sd.insertContent(r,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||HS(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return sd.insertContentAt(t,e,r);const n=this.editor.markdown.parse(e);return sd.insertContentAt(t,n,r)}}},addStorage(){return{manager:new OW({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 OW({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||HS(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)}}),yAt="listItem",Sde="textStyle",Ede=/^\s*([-+*])\s$/,TSe=ri.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",yn(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(yAt,this.editor.getAttributes(Sde)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ov({find:Ede,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ov({find:Ede,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Sde),editor:this.editor})),[t]}}),bAt=(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}},vAt=(t,e,r,n)=>{const i=bAt(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,At.from(u)),h.setSelection(a.map(h.doc,h.mapping)),e&&e(h),!0},xAt=(t,e,r)=>vAt(t.state,t.view.dispatch,e,r),CSe=(t,e)=>Di.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>xAt(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),kSe=[[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"]],GS="abcdefghijklmnopqrstuvwxyz",SSe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function NO(t){let e=t,r="";for(const[n,i]of kSe)for(;e>=n;)r+=i,e-=n;return r}function ree(t){return NO(t).toUpperCase()}function ESe(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 CAt(t,e){if(t==="numeric")return String(e);switch(t){case"a":return DL(e);case"A":return DL(e).toUpperCase();case"i":return NO(e);case"I":return ree(e);default:return String(e)}}function kAt(t){var e;if(t.length===0)return!1;const r=(e=DO(t[0]))!==null&&e!==void 0?e:"numeric",n=nee(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(MAt(t))return{type:"listItem",content:[{type:"paragraph",content:RAt(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)=>I4e(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 AAt((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[CSe(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)}}}),iee=(t,e)=>{const{$from:r}=e.selection,n=_s(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}},MSe=(t,e)=>{const r=iee(t,e);if(!r)return!1;const[,n]=q1t(e,t,r.$pos.pos+4);return n},LAt=(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))},Ade=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!A0(t.state,e)&&LAt(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(!A0(t.state,e)||!K1t(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()},IAt=(t,e)=>{const r=MSe(t,e),n=iee(t,e);return!n||!r?!1:r>n.depth},NAt=(t,e)=>{const r=MSe(t,e),n=iee(t,e);return!n||!r?!1:r{if(!A0(t.state,e)||!X1t(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:IAt(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():NAt(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},DAt=(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||A0(n,e))return!1;const s=j1t(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,At.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,At.from(l)),f.setSelection(yr.create(f.doc,d+1)),f.scrollIntoView()),!0))},RSe=Di.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&&Mde(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&&Mde(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&&Ade(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&&Ade(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&&DAt(t,e,r))return!0;return!1}}}}),OL=new RegExp(`^(\\s*)(${SSe})([.)])\\s+(.*)$`),OAt=/^\s/,ny={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function _At(t){return OL.test(t.trimStart())}function PAt(t){const e=t.trimStart();return ny.bulletItem.test(e)||_At(e)||ny.heading.test(e)||ny.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||ny.codeFence.test(e)||ny.blockMath.test(e)}function BAt(t){return Object.values(ny).some(e=>e.test(t))}function $At(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&&PAt(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function Rde(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(FAt);if(!i)return null;r.push({marker:i[1],content:i[3]})}return kAt(r.map(n=>n.marker))?{type:"orderedList",attrs:EAt(r[0].marker),content:r.map(n=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:n.content}]}]}))}:null}function LSe(t,e,r){const n=[];let i=0;for(;ie;)f.push(t[d]),d+=1;if(f.length>0){const p=w8e(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:s.raw,tokens:u}),i=d}else i+=1}return n}function fRt(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 s=e.parseChildren([i]);n.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&n.push(...s)}}),{type:"listItem",content:n}})}const pRt=64;function bde(t,e){const r=[];let n=0;for(;r.lengtht.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=Tde(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const s=Tde(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=mn(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?fRt(t.items,e):[],s={};return r!==1&&(s.start=r),n&&(s.type=n),Object.keys(s).length>0?{type:"orderedList",attrs:s,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[s,a,o]=gRt(t);if(s.length===0)return;const l=w8e(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:o.slice(0,a).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(mRt,this.editor.getAttributes(xde)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new li({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 s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!s)return!1;const a=dRt(s);if(!a)return!1;try{const o=t.state.schema.nodeFromJSON(a),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=L5({find:wde,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=L5({find:wde,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(xde)}),joinPredicate:t,editor:this.editor})),[e]}}),yRt=/^\s*(\[([( |x])?\])\s$/,vRt="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",bRt=(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"}`},C8e=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",mn(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 T3e(t,e,n)},addExtensions(){return this.options.nested?[p8e(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"),s=document.createElement("label"),a=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div");a.style.cssText=vRt;const u=d=>{const f=bRt(d,d.attrs.checked,this.options.a11y);o.setAttribute("aria-label",f),a.textContent=f};u(t),s.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,s.append(o,a),i.append(s,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=M5(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[L5({find:yRt,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),k8e=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",mn(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=s=>{const a=Vce(s,{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(a){const o={type:"taskList",raw:a.raw,items:a.items},l=s.slice(a.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(s)},i=Vce(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:r.inlineTokens(s.mainContent),nestedTokens:a}),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()}}});Ni.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(f8e.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(v8e.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(x8e.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(T8e.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(C8e.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(k8e.configure(this.options.taskList)),t}});let Rq,_q;if(typeof WeakMap<"u"){let t=new WeakMap;Rq=e=>t.get(e),_q=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;Rq=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var zs=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){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:v-x});break}const T=i+x*e;for(let C=0;Cn&&(s+=u.attrs.colspan)}}for(let a=0;a1&&(r=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function TRt(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 kRt(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 Qh(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 ID(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=tv(e.$head)||SRt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function SRt(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 Lq(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function ERt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function QJ(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function S8e(t,e,r){const n=t.node(-1),i=zs.get(n),s=t.start(-1),a=i.nextCell(t.pos-s,e,r);return a==null?null:t.node(0).resolve(s+a)}function rv(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 E8e(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-s);l.unshift(r.pos-s);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=s+h+1;return new qTe(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(Lq(n)&&Lq(i)&&QJ(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?Ff.rowSelection(n,i):s&&this.isColSelection()?Ff.colSelection(n,i):new Ff(n,i)}return yr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=zs.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},a=[];for(let l=i.top;l0||y>0){let v=g.attrs;if(m>0&&(v=rv(v,0,m)),y>0&&(v=rv(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=zs.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.top<=o.top?(a.top>0&&(e=l.resolve(s+i.map[a.left])),o.bottom0&&(r=l.resolve(s+i.map[o.left])),a.bottom0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,o=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==r.width}eq(e){return e instanceof Ff&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=zs.get(n),s=e.start(-1),a=i.findCell(e.pos-s),o=i.findCell(r.pos-s),l=e.node(0);return a.left<=o.left?(a.left>0&&(e=l.resolve(s+i.map[a.top*i.width])),o.right0&&(r=l.resolve(s+i.map[o.top*i.width])),a.right{e.push(Qa.node(n,n+r.nodeSize,{class:"selectedCell"}))}),qn.create(t.doc,e)}function _Rt({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(s+1)>e.start(s));s--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function LRt({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}return r!==n&&e.parentOffset===0}function IRt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let s,a;if(n instanceof Ir&&(a=n.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Wi.create(i,n.from);else if(a=="row"){const o=i.resolve(n.from+1);s=Wi.rowSelection(o,o)}else if(!r){const o=zs.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];s=Wi.create(i,l+1,u)}}else n instanceof yr&&_Rt(n)?s=yr.create(i,n.from):n instanceof yr&&LRt(n)&&(s=yr.create(i,n.$from.start(),n.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const NRt=new Mi("fix-tables");function M8e(t,e,r,n){const i=t.childCount,s=e.childCount;e:for(let a=0,o=0;a{i.type.spec.tableRole=="table"&&(r=ORt(t,i,s,r))};return e?e.doc!=t.doc&&M8e(e.doc,t.doc,0,n):t.doc.descendants(n),r}function ORt(t,e,r,n){const i=zs.get(e);if(!i.problems)return n;n||(n=t.tr);const s=[];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;ARt(e,n,i+s)&&(s=i==0||i==e.width?null:0);for(let a=0;a0&&i0&&e.map[o-1]==l||i0?-1:0;FRt(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[s]==r[s-1]||n.right0&&r[i]==r[i-t]||n.bottom0){const h=l+1+u.content.size,d=Cde(u)?l+1:h;s.replaceWith(d+n.tableStart,h+n.tableStart,o)}s.setSelection(new Wi(s.doc.resolve(l+n.tableStart))),e(s)}return!0}function Sde(t,e){const r=tl(t.schema);return qRt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function qRt(t){return(e,r)=>{const n=e.selection;let i,s;if(n instanceof Wi){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,s=n.$anchorCell.pos}else{var a;if(i=kRt(n.$from),!i)return!1;s=(a=tv(n.$from))===null||a===void 0?void 0:a.pos}if(i==null||s==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=of(e),d=e.tr;for(let p=0;p{a.attrs[t]!==e&&s.setNodeMarkup(o,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(s)}return!0}}function jRt(t){return function(e,r){if(!Qh(e))return!1;if(r){const n=tl(e.schema),i=of(e),s=e.tr,a=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=a.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=f+s.tableStart,g=a.doc.nodeAt(p);g&&a.setNodeMarkup(p,d,g.attrs)}),n(a)}return!0}}x6("row",{useDeprecatedLogic:!0});x6("column",{useDeprecatedLogic:!0});const YRt=x6("cell",{useDeprecatedLogic:!0});function XRt(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 s=t.node(-1).child(n),a=s.lastChild;if(a)return i-1-a.nodeSize;i-=s.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 H8(t,e){const r=t.selection;if(!(r instanceof Wi))return!1;if(e){const n=t.tr,i=tl(t.schema).cell.createAndFill().content;r.forEachCell((s,a)=>{s.content.eq(i)||n.replace(n.mapping.map(a+1),n.mapping.map(a+s.nodeSize-1),new er(i,0,0))}),n.docChanged&&e(n)}return!0}function ZRt(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),s=i.type.spec.tableRole,a=i.type.schema,o=[];if(s=="row")for(let l=0;l=0;a--){const{rowspan:o,colspan:l}=s.child(a).attrs;for(let u=i;u=e.length&&e.push(At.empty),r[i]n&&(f=f.type.createChecked(rv(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)}s.push(At.from(l))}r=s,e=i}return{width:t,height:e,rows:r}}function e9t(t,e,r,n,i,s,a){const o=t.doc.type.schema,l=tl(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,At.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const s=r.selection;if(s instanceof Wi)return HR(r,n,Gr.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=I8e(i,t,e);if(a==null)return!1;if(t=="horiz")return HR(r,n,Gr.near(r.doc.resolve(s.head+e),e));{const o=r.doc.resolve(a),l=S8e(o,t,e);let u;return l?u=Gr.near(l,1):e<0?u=Gr.near(r.doc.resolve(o.before(-1)),-1):u=Gr.near(r.doc.resolve(o.after(-1)),1),HR(r,n,u)}}}function W8(t,e){return(r,n,i)=>{if(!i)return!1;const s=r.selection;let a;if(s instanceof Wi)a=s;else{const l=I8e(i,t,e);if(l==null)return!1;a=new Wi(r.doc.resolve(l))}const o=S8e(a.$headCell,t,e);return o?HR(r,n,new Wi(a.$anchorCell,o)):!1}}function r9t(t,e){const r=t.state.doc,n=tv(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Wi(n))),!0):!1}function n9t(t,e,r){if(!Qh(t.state))return!1;let n=ZRt(r);const i=t.state.selection;if(i instanceof Wi){n||(n={width:1,height:1,rows:[At.from(Iq(tl(t.state.schema).cell,r))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=zs.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return n=JRt(n,o.right-o.left,o.bottom-o.top),_de(t.state,t.dispatch,a,o,n),!0}else if(n){const s=ID(t.state),a=s.start(-1);return _de(t.state,t.dispatch,a,zs.get(s.node(-1)).findCell(s.pos-a),n),!0}else return!1}function i9t(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=Lde(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Wi)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=tv(t.state.selection.$anchor))!=null&&((r=zF(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)s(i,e),e.preventDefault();else if(!n)return;function s(l,u){let h=zF(t,u);const d=ig.getState(t.state)==null;if(!h||!QJ(l,h))if(d)h=l;else return;const f=new Wi(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(ig,l.pos),t.dispatch(p)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",o),ig.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ig,-1))}function o(l){const u=l,h=ig.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(Lde(t,u.target)!=n&&(d=zF(t,e),!d))return a();d&&s(d,u)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",o)}function I8e(t,e,r){if(!(t.state.selection instanceof yr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?a:null}}return null}function Lde(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function zF(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&&tv(t.state.doc.resolve(n))||tv(t.state.doc.resolve(i))}var s9t=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,s){let a=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;dnew n(d,r,f)),new o9t(-1,!1)},apply(a,o){return o.apply(a)}},props:{attributes:a=>{const o=Gc.getState(a);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,o)=>{l9t(a,o,t,i)},mouseleave:a=>{c9t(a)},mousedown:(a,o)=>{u9t(a,o,e,r)}},decorations:a=>{const o=Gc.getState(a);if(o&&o.activeHandle>-1)return g9t(a,o.activeHandle)},nodeViews:{}}});return s}var o9t=class GR{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 GR(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new GR(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return Lq(e.doc.resolve(i))||(i=-1),new GR(i,r.dragging)}return r}};function l9t(t,e,r,n){if(!t.editable)return;const i=Gc.getState(t.state);if(i&&!i.dragging){const s=d9t(e.target);let a=-1;if(s){const{left:o,right:l}=s.getBoundingClientRect();e.clientX-o<=r?a=Ide(t,e,"left",r):l-e.clientX<=r&&(a=Ide(t,e,"right",r))}if(a!=i.activeHandle){if(!n&&a!==-1){const o=t.state.doc.resolve(a),l=o.node(-1),u=zs.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}N8e(t,a)}}}function c9t(t){if(!t.editable)return;const e=Gc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&N8e(t,-1)}function u9t(t,e,r,n){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,a=Gc.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const o=t.state.doc.nodeAt(a.activeHandle),l=h9t(t,a.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Gc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",h);const f=Gc.getState(t.state);f!=null&&f.dragging&&(f9t(t,f.activeHandle,Nde(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=Nde(f.dragging,d,r);Ode(t,f.activeHandle,p,n)}}return Ode(t,a.activeHandle,l,n),s.addEventListener("mouseup",u),s.addEventListener("mousemove",h),e.preventDefault(),!0}function h9t(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const s=t.domAtPos(e);let a=s.node.childNodes[s.offset].offsetWidth,o=r;if(n)for(let l=0;ly9t(t),renderHTML:t=>{const e=w6(t.align);return p1t(e)?{style:`text-align: ${e}`}:{}}}}function b9t(t){var e;const r=t.parentElement,n=t.closest("table");if(!r||!n)return null;const i=Array.from(r.children).indexOf(t),s=(e=n.querySelectorAll("colgroup > col")[i])===null||e===void 0?void 0:e.getAttribute("width");return s?[parseInt(s,10)]:null}function D8e(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):b9t(t)}const x9t=/[ \t\r\n\f]+/g;function P8e(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(x9t,"")===""}function $8e(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}function IL(t,e,r){if(!(r in e))return;const n=e[r];(n===1||n==="1"||n===null||n===void 0)&&delete t[r]}const w9t=ti.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:D8e},align:O8e()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>P8e(t)?{}:!1,getContent:(t,e)=>$8e(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){const e=mn(this.options.HTMLAttributes,t);return IL(e,t,"colspan"),IL(e,t,"rowspan"),["td",e,0]}}),T9t=ti.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:D8e},align:O8e()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>P8e(t)?{}:!1,getContent:(t,e)=>$8e(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){const e=mn(this.options.HTMLAttributes,t);return IL(e,t,"colspan"),IL(e,t,"rowspan"),["th",e,0]}}),C9t=ti.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",mn(this.options.HTMLAttributes,t),0]}});function Oq(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Dde(t,e,r,n,i,s){let a=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 A9t(t,e,r,n,i){const s=E9t(t),a=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!B8e(e))return!1;let r=0;const n=t6(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 $de(t,e){const r=t.mapping.map(e),n=t6(t.selection.$from,a=>a.type.name==="table");if((n==null?void 0:n.pos)===r)return;const i=t.doc.nodeAt(r);if(!i)return;const s=r+i.nodeSize-1;t.setSelection(yr.near(t.doc.resolve(s),-1))}function M9t(t){let e="",r=0;for(;rl==="|"?"\\|":l)+t.slice(i,i+n),r=i+n,s=!0;break}i+=a}s||(e+=t.slice(r,r+n),r+=n)}return e}function R9t(t){return t.split(` -`).map(e=>!e.includes("|")||!e.includes("`")?e:M9t(e)).join(` -`)}function _9t(t){return(t||"").replaceAll(""," ").replace(/\s+/g," ").trim()}function Bde(t,e){return e?t.split(e).join(` -`):t}function L9t(t){return t.replace(/\\.|\|/g,e=>e==="|"?"\\|":e)}function I9t(t,e,r={}){if(!t||!t.content||t.content.length===0)return"";const n=[];t.content.forEach(f=>{const p=[];f.content&&f.content.forEach(g=>{let m="";g.content&&Array.isArray(g.content)&&g.content.length>1?m=g.content.map(x=>Bde(e.renderChildren(x),r.cellLineSeparator)).join(` -`):m=Bde(g.content?e.renderChildren(g.content):"",r.cellLineSeparator);const y=L9t(_9t(m.replace(/[ \t]*\r?\n[ \t]*/g,"
    "))),v=g.type==="tableHeader",b=v9t(g.attrs);p.push({text:y,isHeader:v,align:b})}),n.push(p)});const i=n.reduce((f,p)=>Math.max(f,p.length),0);if(i===0)return"";const s=Array.from({length:i}).fill(0);n.forEach(f=>{for(let g=0;gs[g]&&(s[g]=m),s[g]<3&&(s[g]=3)}});const a=(f,p)=>f+" ".repeat(Math.max(0,p-f.length)),o=n[0],l=o.some(f=>f.isHeader),u=Array.from({length:i}).fill(null);n.forEach(f=>{for(let g=0;gl&&o[p]&&o[p].text||"");return h+=`| ${d.map((f,p)=>a(f,s[p])).join(" | ")} | -`,h+=`| ${s.map((f,p)=>{const g=Math.max(3,f),m=u[p];return m==="left"?`:${"-".repeat(g)}`:m==="right"?`${"-".repeat(g)}:`:m==="center"?`:${"-".repeat(g)}:`:"-".repeat(g)}).join(" | ")} | -`,(l?n.slice(1):n).forEach(f=>{h+=`| ${Array.from({length:i}).fill(0).map((p,g)=>a(f[g]&&f[g].text||"",s[g])).join(" | ")} | -`}),h}const N9t=new Mi("preserveCellSelectionOnContextMenu");function O9t(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(r)return r.pos;if(!(e.target instanceof Node))return null;try{return t.posAtDOM(e.target,0)}catch{return null}}function D9t(t,e){let r=!1;return t.forEachCell((n,i)=>{e>=i&&e{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((s,a)=>{var o;const l=w6((o=n[a])!==null&&o!==void 0?o:s.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),r.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const s=[];i.forEach((a,o)=>{var l;const u=w6((l=n[o])!==null&&l!==void 0?l:a.align),h=u?{align:u}:{};s.push(e.createNode("tableCell",h,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),r.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,r)},renderMarkdown:(t,e)=>I9t(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{const e=t.split(` +`).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=LSe(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 VAt(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 HAt=64;function Lde(t,e){const r=[];let n=0;for(;r.lengtht.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=Dde(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const a=Dde(i);if(a)return a}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=yn(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?VAt(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,s,o]=GAt(t);if(a.length===0)return;const l=LSe(a,a[0].indent,r);if(l.length!==0)return{type:"list",ordered:!0,start:((n=a[0])===null||n===void 0?void 0:n.number)||1,typeMarker:(i=a[0])===null||i===void 0?void 0:i.type,items:l,raw:o.slice(0,s).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(WAt,this.editor.getAttributes(Ide)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ci({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=zAt(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=Ov({find:Nde,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ov({find:Nde,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(Ide)}),joinPredicate:t,editor:this.editor})),[e]}}),qAt=/^\s*(\[([( |x])?\])\s$/,jAt="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",YAt=(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"}`},NSe=ri.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",yn(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 I4e(t,e,n)},addExtensions(){return this.options.nested?[CSe(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=jAt;const u=d=>{const f=YAt(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=Iv(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(U=>{g.has(U)||(U in m?i.setAttribute(U,m[U]):i.removeAttribute(U))}),Object.entries(p).forEach(([U,y])=>{y==null?U in m?i.setAttribute(U,m[U]):i.removeAttribute(U):i.setAttribute(U,y)}),h=g,!0}}}},addInputRules(){return[Ov({find:qAt,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),DSe=ri.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",yn(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=Qce(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=Qce(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()}}});Di.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(TSe.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(ASe.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(RSe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(ISe.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(NSe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(DSe.configure(this.options.taskList)),t}});let _W,PW;if(typeof WeakMap<"u"){let t=new WeakMap;_W=e=>t.get(e),PW=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;_W=n=>{for(let i=0;i(r==10&&(r=0),t[r++]=n,t[r++]=i)}var $a=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:y-v});break}const w=i+v*e;for(let T=0;Tn&&(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 ZAt(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 QAt(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 Jh(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 OO(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=i5(e.$head)||eMt(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function eMt(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 BW(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function tMt(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function aee(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function OSe(t,e,r){const n=t.node(-1),i=$a.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 a5(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 _Se(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 tve(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(BW(n)&&BW(i)&&aee(n,i)){const a=this.$anchorCell.node(-1)!=n.node(-1);return a&&this.isRowSelection()?Ff.rowSelection(n,i):a&&this.isColSelection()?Ff.colSelection(n,i):new Ff(n,i)}return yr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=$a.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||U>0){let y=g.attrs;if(m>0&&(y=a5(y,0,m)),U>0&&(y=a5(y,y.colspan-U,U)),p.lefti.bottom){const y={...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=$a.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 Ff&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=$a.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(Js.node(n,n+r.nodeSize,{class:"selectedCell"}))}),qn.create(t.doc,e)}function aMt({$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 sMt({$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 oMt(t,e,r){const n=(e||t).selection,i=(e||t).doc;let a,s;if(n instanceof Nr&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")a=Wi.create(i,n.from);else if(s=="row"){const o=i.resolve(n.from+1);a=Wi.rowSelection(o,o)}else if(!r){const o=$a.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];a=Wi.create(i,l+1,u)}}else n instanceof yr&&aMt(n)?a=yr.create(i,n.from):n instanceof yr&&sMt(n)&&(a=yr.create(i,n.$from.start(),n.$from.end()));return a&&(e||(e=t.tr)).setSelection(a),e}const lMt=new Mi("fix-tables");function BSe(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=cMt(t,i,a,r))};return e?e.doc!=t.doc&&BSe(e.doc,t.doc,0,n):t.doc.descendants(n),r}function cMt(t,e,r,n){const i=$a.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 U=0;U0?-1:0;rMt(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;pMt(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=Ode(u)?l+1:h;a.replaceWith(d+n.tableStart,h+n.tableStart,o)}a.setSelection(new Wi(a.doc.resolve(l+n.tableStart))),e(a)}return!0}function Pde(t,e){const r=tl(t.schema);return vMt(({node:n})=>r[n.type.spec.tableRole])(t,e)}function vMt(t){return(e,r)=>{const n=e.selection;let i,a;if(n instanceof Wi){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,a=n.$anchorCell.pos}else{var s;if(i=QAt(n.$from),!i)return!1;a=(s=i5(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=lf(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 wMt(t){return function(e,r){if(!Jh(e))return!1;if(r){const n=tl(e.schema),i=lf(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}}CT("row",{useDeprecatedLogic:!0});CT("column",{useDeprecatedLogic:!0});const TMt=CT("cell",{useDeprecatedLogic:!0});function CMt(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 WS(t,e){const r=t.selection;if(!(r instanceof Wi))return!1;if(e){const n=t.tr,i=tl(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 tr(i,0,0))}),n.docChanged&&e(n)}return!0}function SMt(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(At.empty),r[i]n&&(f=f.type.createChecked(a5(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(At.from(l))}r=a,e=i}return{width:t,height:e,rows:r}}function MMt(t,e,r,n,i,a,s){const o=t.doc.type.schema,l=tl(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(U?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,At.from(d)),p=[];for(let g=e.height;g{if(!i)return!1;const a=r.selection;if(a instanceof Wi)return WA(r,n,Hr.near(a.$headCell,e));if(t!="horiz"&&!a.empty)return!1;const s=VSe(i,t,e);if(s==null)return!1;if(t=="horiz")return WA(r,n,Hr.near(r.doc.resolve(a.head+e),e));{const o=r.doc.resolve(s),l=OSe(o,t,e);let u;return l?u=Hr.near(l,1):e<0?u=Hr.near(r.doc.resolve(o.before(-1)),-1):u=Hr.near(r.doc.resolve(o.after(-1)),1),WA(r,n,u)}}}function jS(t,e){return(r,n,i)=>{if(!i)return!1;const a=r.selection;let s;if(a instanceof Wi)s=a;else{const l=VSe(i,t,e);if(l==null)return!1;s=new Wi(r.doc.resolve(l))}const o=OSe(s.$headCell,t,e);return o?WA(r,n,new Wi(s.$anchorCell,o)):!1}}function LMt(t,e){const r=t.state.doc,n=i5(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Wi(n))),!0):!1}function IMt(t,e,r){if(!Jh(t.state))return!1;let n=SMt(r);const i=t.state.selection;if(i instanceof Wi){n||(n={width:1,height:1,rows:[At.from($W(tl(t.state.schema).cell,r))]});const a=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),o=$a.get(a).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=AMt(n,o.right-o.left,o.bottom-o.top),Vde(t.state,t.dispatch,s,o,n),!0}else if(n){const a=OO(t.state),s=a.start(-1);return Vde(t.state,t.dispatch,s,$a.get(a.node(-1)).findCell(a.pos-s),n),!0}else return!1}function NMt(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=Hde(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Wi)a(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=i5(t.state.selection.$anchor))!=null&&((r=W$(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=W$(t,u);const d=ag.getState(t.state)==null;if(!h||!aee(l,h))if(d)h=l;else return;const f=new Wi(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(ag,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),ag.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ag,-1))}function o(l){const u=l,h=ag.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(Hde(t,u.target)!=n&&(d=W$(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 VSe(t,e,r){if(!(t.state.selection instanceof yr))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 Hde(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function W$(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&&i5(t.state.doc.resolve(n))||i5(t.state.doc.resolve(i))}var DMt=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")),FW(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,FW(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function FW(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 _Mt(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes:s=>{const o=Hc.getState(s);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,o)=>{PMt(s,o,t,i)},mouseleave:s=>{BMt(s)},mousedown:(s,o)=>{$Mt(s,o,e,r)}},decorations:s=>{const o=Hc.getState(s);if(o&&o.activeHandle>-1)return GMt(s,o.activeHandle)},nodeViews:{}}});return a}var _Mt=class qA{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(Hc);if(n&&n.setHandle!=null)return new qA(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new qA(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return BW(e.doc.resolve(i))||(i=-1),new qA(i,r.dragging)}return r}};function PMt(t,e,r,n){if(!t.editable)return;const i=Hc.getState(t.state);if(i&&!i.dragging){const a=zMt(e.target);let s=-1;if(a){const{left:o,right:l}=a.getBoundingClientRect();e.clientX-o<=r?s=Gde(t,e,"left",r):l-e.clientX<=r&&(s=Gde(t,e,"right",r))}if(s!=i.activeHandle){if(!n&&s!==-1){const o=t.state.doc.resolve(s),l=o.node(-1),u=$a.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}HSe(t,s)}}}function BMt(t){if(!t.editable)return;const e=Hc.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&HSe(t,-1)}function $Mt(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=Hc.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const o=t.state.doc.nodeAt(s.activeHandle),l=FMt(t,s.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Hc,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",h);const f=Hc.getState(t.state);f!=null&&f.dragging&&(VMt(t,f.activeHandle,Wde(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(Hc,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=Hc.getState(t.state);if(f&&f.dragging){const p=Wde(f.dragging,d,r);qde(t,f.activeHandle,p,n)}}return qde(t,s.activeHandle,l,n),a.addEventListener("mouseup",u),a.addEventListener("mousemove",h),e.preventDefault(),!0}function FMt(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;lqMt(t),renderHTML:t=>{const e=kT(t.align);return Hmt(e)?{style:`text-align: ${e}`}:{}}}}function YMt(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 WSe(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):YMt(t)}const XMt=/[ \t\r\n\f]+/g;function qSe(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(XMt,"")===""}function jSe(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}function _L(t,e,r){if(!(r in e))return;const n=e[r];(n===1||n==="1"||n===null||n===void 0)&&delete t[r]}const KMt=ri.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:WSe},align:GSe()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>qSe(t)?{}:!1,getContent:(t,e)=>jSe(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){const e=yn(this.options.HTMLAttributes,t);return _L(e,t,"colspan"),_L(e,t,"rowspan"),["td",e,0]}}),ZMt=ri.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:WSe},align:GSe()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>qSe(t)?{}:!1,getContent:(t,e)=>jSe(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){const e=yn(this.options.HTMLAttributes,t);return _L(e,t,"colspan"),_L(e,t,"rowspan"),["th",e,0]}}),JMt=ri.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",yn(this.options.HTMLAttributes,t),0]}});function zW(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function jde(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 rRt(t,e,r,n,i){const a=tRt(t),s=[],o=[];for(let u=0;u{const{selection:e}=t.state;if(!YSe(e))return!1;let r=0;const n=aT(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 Xde(t,e){const r=t.mapping.map(e),n=aT(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(yr.near(t.doc.resolve(a),-1))}function nRt(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 iRt(t){return t.split(` +`).map(e=>!e.includes("|")||!e.includes("`")?e:nRt(e)).join(` +`)}function aRt(t){return(t||"").replaceAll(""," ").replace(/\s+/g," ").trim()}function Kde(t,e){return e?t.split(e).join(` +`):t}function sRt(t){return t.replace(/\\.|\|/g,e=>e==="|"?"\\|":e)}function oRt(t,e,r={}){if(!t||!t.content||t.content.length===0)return"";const n=[];t.content.forEach(f=>{const p=[];f.content&&f.content.forEach(g=>{let m="";g.content&&Array.isArray(g.content)&&g.content.length>1?m=g.content.map(v=>Kde(e.renderChildren(v),r.cellLineSeparator)).join(` +`):m=Kde(g.content?e.renderChildren(g.content):"",r.cellLineSeparator);const U=sRt(aRt(m.replace(/[ \t]*\r?\n[ \t]*/g,"
    "))),y=g.type==="tableHeader",b=jMt(g.attrs);p.push({text:U,isHeader:y,align:b})}),n.push(p)});const i=n.reduce((f,p)=>Math.max(f,p.length),0);if(i===0)return"";const a=Array.from({length:i}).fill(0);n.forEach(f=>{for(let g=0;ga[g]&&(a[g]=m),a[g]<3&&(a[g]=3)}});const s=(f,p)=>f+" ".repeat(Math.max(0,p-f.length)),o=n[0],l=o.some(f=>f.isHeader),u=Array.from({length:i}).fill(null);n.forEach(f=>{for(let g=0;gl&&o[p]&&o[p].text||"");return h+=`| ${d.map((f,p)=>s(f,a[p])).join(" | ")} | +`,h+=`| ${a.map((f,p)=>{const g=Math.max(3,f),m=u[p];return m==="left"?`:${"-".repeat(g)}`:m==="right"?`${"-".repeat(g)}:`:m==="center"?`:${"-".repeat(g)}:`:"-".repeat(g)}).join(" | ")} | +`,(l?n.slice(1):n).forEach(f=>{h+=`| ${Array.from({length:i}).fill(0).map((p,g)=>s(f[g]&&f[g].text||"",a[g])).join(" | ")} | +`}),h}const lRt=new Mi("preserveCellSelectionOnContextMenu");function cRt(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(r)return r.pos;if(!(e.target instanceof Node))return null;try{return t.posAtDOM(e.target,0)}catch{return null}}function uRt(t,e){let r=!1;return t.forEachCell((n,i)=>{e>=i&&e{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((a,s)=>{var o;const l=kT((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=kT((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)=>oRt(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,s=i.split(` -`);if(s.length<2)return;const a=s[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const o=R9t(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(` +`),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=iRt(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:s})=>{const a=A9t(s.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(a).scrollIntoView().setSelection(yr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>DRt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>PRt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=t6(t.selection.$from,n=>n.type.name==="table");return BRt(t,e&&(n=>{r&&$de(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>zRt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>VRt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=t6(t.selection.$from,n=>n.type.name==="table");return GRt(t,e&&(n=>{r&&$de(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>KRt(t,e),mergeCells:()=>({state:t,dispatch:e})=>kde(t,e),splitCell:()=>({state:t,dispatch:e})=>Sde(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>x6("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>x6("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>YRt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>kde(t,e)?!0:Sde(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>URt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>Ade(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Ade(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&R8e(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Wi.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:q8,"Mod-Backspace":q8,Delete:q8,"Mod-Delete":q8}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[a9t({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],m9t({allowTableNodeSelection:this.options.allowTableNodeSelection}),P9t()]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:r,view:n,HTMLAttributes:i})=>{const s=mn(this.options.HTMLAttributes,i);return new e(r,this.options.cellMinWidth,n,s)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ri(gr(t,"tableRole",e))}}}),Fde=Ni.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push($9t.configure(this.options.table)),this.options.tableCell!==!1&&t.push(w9t.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(T9t.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(C9t.configure(this.options.tableRow)),t}}),F8e=new WeakSet,z8e=new WeakSet;function Qm(t){const e=t;return F8e.add(e),e}function Dq(t){return Array.isArray(t)&&F8e.has(t)}function V8e(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&z8e.has(e)&&!Dq(e)?V8e(e):[e])}function B9t(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!Dq(i)&&!z8e.has(i)?Qm(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(Dq(r))return Qm([t,n,r]);if(r.length===0)return Qm([t,n]);const i=V8e(r);return i.length===0?Qm([t,n]):Qm([t,n,...i])}return r!=null?Qm([t,n,r]):Qm([t,n])}const NL=(t,e)=>B9t(t,e),F9t=(t,e)=>{var r;const{state:n}=t,{selection:i}=n;if(!i.empty)return!1;const{$from:s}=i;if(s.parentOffset!==0)return!1;const a=s.depth-1;if(a<0)return!1;const o=s.node(a),l=s.index(a);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=s.before()-1-1;return t.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;const p=s.parent.content,g=new er(p,0,0);return d.replace(h,s.after(),g),d.setSelection(yr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},z9t=/^\s*>\s$/,V9t=ti.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return NL("blockquote",{...mn(this.options.HTMLAttributes,t),children:NL("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,s)=>{var a,o;const l=((a=(o=e.renderChild)===null||o===void 0?void 0:o.call(e,i,s))!==null&&a!==void 0?a:e.renderChildren([i])).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=rRt(a.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(yr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>uMt(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hMt(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const r=aT(t.selection.$from,n=>n.type.name==="table");return fMt(t,e&&(n=>{r&&Xde(n,r.pos),e(n)}))},addRowBefore:()=>({state:t,dispatch:e})=>gMt(t,e),addRowAfter:()=>({state:t,dispatch:e})=>mMt(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const r=aT(t.selection.$from,n=>n.type.name==="table");return yMt(t,e&&(n=>{r&&Xde(n,r.pos),e(n)}))},deleteTable:()=>({state:t,dispatch:e})=>kMt(t,e),mergeCells:()=>({state:t,dispatch:e})=>_de(t,e),splitCell:()=>({state:t,dispatch:e})=>Pde(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>CT("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>CT("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>TMt(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>_de(t,e)?!0:Pde(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>xMt(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>$de(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>$de(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&$Se(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Wi.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:YS,"Mod-Backspace":YS,Delete:YS,"Mod-Delete":YS}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[OMt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],WMt({allowTableNodeSelection:this.options.allowTableNodeSelection}),hRt()]},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=yn(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:ni(mr(t,"tableRole",e))}}}),fRt=Di.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(dRt.configure(this.options.table)),this.options.tableCell!==!1&&t.push(KMt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(ZMt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(JMt.configure(this.options.tableRow)),t}}),XSe=t=>t.map(e=>e.type==="html"&&/^$/i.test(e.raw||"")?{type:"br",raw:e.raw}:e.tokens?{...e,tokens:XSe(e.tokens)}:e),Zde=fRt.extend({addExtensions(){var t;return(((t=this.parent)==null?void 0:t.call(this))??[]).map(e=>{if(e.name!=="table")return e;const r=e.config.parseMarkdown;return e.extend({parseMarkdown(n,i){var s,o;const a=l=>({...l,tokens:XSe(l.tokens)});return r.call(this,{...n,header:(s=n.header)==null?void 0:s.map(a),rows:(o=n.rows)==null?void 0:o.map(l=>l.map(a))},i)}})})}}),KSe=new WeakSet,ZSe=new WeakSet;function em(t){const e=t;return KSe.add(e),e}function VW(t){return Array.isArray(t)&&KSe.has(t)}function JSe(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&ZSe.has(e)&&!VW(e)?JSe(e):[e])}function pRt(t,e){if(t==="slot")return 0;if(t instanceof Function){const i=t(e);return Array.isArray(i)&&!VW(i)&&!ZSe.has(i)?em(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(VW(r))return em([t,n,r]);if(r.length===0)return em([t,n]);const i=JSe(r);return i.length===0?em([t,n]):em([t,n,...i])}return r!=null?em([t,n,r]):em([t,n])}const PL=(t,e)=>pRt(t,e),gRt=(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 tr(p,0,0);return d.replace(h,a.after(),g),d.setSelection(yr.create(d.doc,h+p.size)),d.scrollIntoView(),f(d),!0})},mRt=/^\s*>\s$/,URt=ri.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return PL("blockquote",{...yn(this.options.HTMLAttributes,t),children:PL("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:()=>F9t(this.editor,this.type)}},addInputRules(){return[L5({find:z9t,type:this.type})]}}),H9t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,G9t=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,W9t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,q9t=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,U9t=tp.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 NL("strong",{...mn(this.options.HTMLAttributes,t),children:NL("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[Bg({find:H9t,type:this.type}),Bg({find:W9t,type:this.type})]},addPasteRules(){return[Ud({find:G9t,type:this.type}),Ud({find:q9t,type:this.type})]}}),j9t=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Y9t=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};function X9t(t){const e=new Set((t.match(/`+/g)||[]).map(n=>n.length));let r=1;for(;e.has(r);)r+=1;return r}const K9t=tp.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",mn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e,r)=>{var n;if(!t.content)return"";const i=typeof(r==null||(n=r.meta)===null||n===void 0?void 0:n.markText)=="string"?r.meta.markText:"",s="`".repeat(X9t(i)),a=i.startsWith("`")||i.endsWith("`")?" ":"";return`${s}${a}${e.renderChildren(t.content)}${a}${s}`},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[Bg({find:j9t,type:this.type})]},addPasteRules(){return[Ud({find:Y9t,type:this.type})]}}),Z9t=ti.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`)},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:()=>gRt(this.editor,this.type)}},addInputRules(){return[Ov({find:mRt,type:this.type})]}}),yRt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,bRt=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,vRt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,xRt=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,wRt=rp.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 PL("strong",{...yn(this.options.HTMLAttributes,t),children:PL("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[Fg({find:yRt,type:this.type}),Fg({find:vRt,type:this.type})]},addPasteRules(){return[jd({find:bRt,type:this.type}),jd({find:xRt,type:this.type})]}}),TRt=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},CRt=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};function kRt(t){const e=new Set((t.match(/`+/g)||[]).map(n=>n.length));let r=1;for(;e.has(r);)r+=1;return r}const SRt=rp.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",yn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e,r)=>{var n;if(!t.content)return"";const i=typeof(r==null||(n=r.meta)===null||n===void 0?void 0:n.markText)=="string"?r.meta.markText:"",a="`".repeat(kRt(i)),s=i.startsWith("`")||i.endsWith("`")?" ":"";return`${a}${s}${e.renderChildren(t.content)}${s}${a}`},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[Fg({find:TRt,type:this.type})]},addPasteRules(){return[jd({find:CRt,type:this.type})]}}),ERt=ri.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):""}),Q9t=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",mn(this.options.HTMLAttributes,t)]},renderText(){return` +`):""}),ARt=ri.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",yn(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:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&a){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()}}}),J9t=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]}`,mn(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=>mW({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),e_t=ti.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",mn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!o1t(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return f3e(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:l}=a.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?a.setSelection(yr.create(a.doc,l.pos+1)):l.nodeAfter.isBlock?a.setSelection(Ir.create(a.doc,l.pos)):a.setSelection(yr.create(a.doc,l.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(a.insert(u,d),a.setSelection(yr.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[E3e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),t_t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,r_t=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,n_t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,i_t=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,s_t=tp.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",mn(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[Bg({find:t_t,type:this.type}),Bg({find:n_t,type:this.type})]},addPasteRules(){return[Ud({find:r_t,type:this.type}),Ud({find:i_t,type:this.type})]}}),a_t="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",o_t="ελ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",Pq="numeric",$q="ascii",Bq="alpha",GS="asciinumeric",Fk="alphanumeric",Fq="domain",H8e="emoji",l_t="scheme",c_t="slashscheme",VF="whitespace";function u_t(t,e){return t in e||(e[t]=[]),e[t]}function cy(t,e,r){e[Pq]&&(e[GS]=!0,e[Fk]=!0),e[$q]&&(e[GS]=!0,e[Bq]=!0),e[GS]&&(e[Fk]=!0),e[Bq]&&(e[Fk]=!0),e[Fk]&&(e[Fq]=!0),e[H8e]&&(e[Fq]=!0);for(const n in e){const i=u_t(n,r);i.indexOf(t)<0&&i.push(t)}}function h_t(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function gc(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}gc.groups={};gc.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),Is=(t,e,r,n,i)=>t.tr(e,r,n,i),zde=(t,e,r,n,i)=>t.ts(e,r,n,i),qt=(t,e,r,n,i)=>t.tt(e,r,n,i),zf="WORD",zq="UWORD",G8e="ASCIINUMERICAL",W8e="ALPHANUMERICAL",T6="LOCALHOST",Vq="TLD",Hq="UTLD",WR="SCHEME",tb="SLASH_SCHEME",JJ="NUM",Gq="WS",eee="NL",WS="OPENBRACE",qS="CLOSEBRACE",OL="OPENBRACKET",DL="CLOSEBRACKET",PL="OPENPAREN",$L="CLOSEPAREN",BL="OPENANGLEBRACKET",FL="CLOSEANGLEBRACKET",zL="FULLWIDTHLEFTPAREN",VL="FULLWIDTHRIGHTPAREN",HL="LEFTCORNERBRACKET",GL="RIGHTCORNERBRACKET",WL="LEFTWHITECORNERBRACKET",qL="RIGHTWHITECORNERBRACKET",UL="FULLWIDTHLESSTHAN",jL="FULLWIDTHGREATERTHAN",YL="AMPERSAND",XL="APOSTROPHE",KL="ASTERISK",jp="AT",ZL="BACKSLASH",QL="BACKTICK",JL="CARET",uy="COLON",tee="COMMA",eI="DOLLAR",fd="DOT",tI="EQUALS",ree="EXCLAMATION",Cu="HYPHEN",US="PERCENT",rI="PIPE",nI="PLUS",iI="POUND",jS="QUERY",nee="QUOTE",q8e="FULLWIDTHMIDDLEDOT",iee="SEMI",pd="SLASH",YS="TILDE",sI="UNDERSCORE",U8e="EMOJI",aI="SYM";var j8e=Object.freeze({__proto__:null,ALPHANUMERICAL:W8e,AMPERSAND:YL,APOSTROPHE:XL,ASCIINUMERICAL:G8e,ASTERISK:KL,AT:jp,BACKSLASH:ZL,BACKTICK:QL,CARET:JL,CLOSEANGLEBRACKET:FL,CLOSEBRACE:qS,CLOSEBRACKET:DL,CLOSEPAREN:$L,COLON:uy,COMMA:tee,DOLLAR:eI,DOT:fd,EMOJI:U8e,EQUALS:tI,EXCLAMATION:ree,FULLWIDTHGREATERTHAN:jL,FULLWIDTHLEFTPAREN:zL,FULLWIDTHLESSTHAN:UL,FULLWIDTHMIDDLEDOT:q8e,FULLWIDTHRIGHTPAREN:VL,HYPHEN:Cu,LEFTCORNERBRACKET:HL,LEFTWHITECORNERBRACKET:WL,LOCALHOST:T6,NL:eee,NUM:JJ,OPENANGLEBRACKET:BL,OPENBRACE:WS,OPENBRACKET:OL,OPENPAREN:PL,PERCENT:US,PIPE:rI,PLUS:nI,POUND:iI,QUERY:jS,QUOTE:nee,RIGHTCORNERBRACKET:GL,RIGHTWHITECORNERBRACKET:qL,SCHEME:WR,SEMI:iee,SLASH:pd,SLASH_SCHEME:tb,SYM:aI,TILDE:YS,TLD:Vq,UNDERSCORE:sI,UTLD:Hq,UWORD:zq,WORD:zf,WS:Gq});const Ef=/[a-z]/,jC=new RegExp("\\p{L}","u"),HF=new RegExp("\\p{Emoji}","u"),Af=/\d/,GF=/\s/,Vde="\r",WF=` -`,d_t="️",f_t="‍",qF="";let U8=null,j8=null;function p_t(t=[]){const e={};gc.groups=e;const r=new gc;U8==null&&(U8=Hde(a_t)),j8==null&&(j8=Hde(o_t)),qt(r,"'",XL),qt(r,"{",WS),qt(r,"}",qS),qt(r,"[",OL),qt(r,"]",DL),qt(r,"(",PL),qt(r,")",$L),qt(r,"<",BL),qt(r,">",FL),qt(r,"(",zL),qt(r,")",VL),qt(r,"「",HL),qt(r,"」",GL),qt(r,"『",WL),qt(r,"』",qL),qt(r,"<",UL),qt(r,">",jL),qt(r,"&",YL),qt(r,"*",KL),qt(r,"@",jp),qt(r,"`",QL),qt(r,"^",JL),qt(r,":",uy),qt(r,",",tee),qt(r,"$",eI),qt(r,".",fd),qt(r,"=",tI),qt(r,"!",ree),qt(r,"-",Cu),qt(r,"%",US),qt(r,"|",rI),qt(r,"+",nI),qt(r,"#",iI),qt(r,"?",jS),qt(r,'"',nee),qt(r,"/",pd),qt(r,";",iee),qt(r,"~",YS),qt(r,"_",sI),qt(r,"\\",ZL),qt(r,"・",q8e);const n=Is(r,Af,JJ,{[Pq]:!0});Is(n,Af,n);const i=Is(n,Ef,G8e,{[GS]:!0}),s=Is(n,jC,W8e,{[Fk]:!0}),a=Is(r,Ef,zf,{[$q]:!0});Is(a,Af,i),Is(a,Ef,a),Is(i,Af,i),Is(i,Ef,i);const o=Is(r,jC,zq,{[Bq]:!0});Is(o,Ef),Is(o,Af,s),Is(o,jC,o),Is(s,Af,s),Is(s,Ef),Is(s,jC,s);const l=qt(r,WF,eee,{[VF]:!0}),u=qt(r,Vde,Gq,{[VF]:!0}),h=Is(r,GF,Gq,{[VF]:!0});qt(r,qF,h),qt(u,WF,l),qt(u,qF,h),Is(u,GF,h),qt(h,Vde),qt(h,WF),Is(h,GF,h),qt(h,qF,h);const d=Is(r,HF,U8e,{[H8e]:!0});qt(d,"#"),Is(d,HF,d),qt(d,d_t,d);const f=qt(d,f_t);qt(f,"#"),Is(f,HF,d);const p=[[Ef,a],[Af,i]],g=[[Ef,null],[jC,o],[Af,s]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?b[Fq]=!0:Ef.test(y)?Af.test(y)?b[GS]=!0:b[$q]=!0:b[Pq]=!0,zde(r,y,y,b)}return zde(r,"localhost",T6,{ascii:!0}),r.jd=new gc(aI),{start:r,tokens:Object.assign({groups:e},j8e)}}function Y8e(t,e){const r=g_t(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let s=0,a=0;for(;a=0&&(d+=r[a].length,f++),u+=r[a].length,s+=r[a].length,a++;s-=d,a-=f,u-=d,i.push({t:h.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function g_t(t){const e=[],r=t.length;let n=0;for(;n56319||n+1===r||(s=t.charCodeAt(n+1))<56320||s>57343?t[n]:t.slice(n,n+2);e.push(a),n+=a.length}return e}function Mp(t,e,r,n,i){let s;const a=e.length;for(let o=0;o=0;)s++;if(s>0){e.push(r.join(""));for(let a=parseInt(t.substring(n,n+s),10);a>0;a--)r.pop();n+=s}else r.push(t[n]),n++}return e}const C6={defaultProtocol:"http",events:null,format:Gde,formatHref:Gde,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function see(t,e=null){let r=Object.assign({},C6);t&&(r=Object.assign(r,t instanceof see?t.o:t));const n=r.ignoreTags,i=[];for(let s=0;sr?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=C6.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),s=this.toFormattedString(t),a={},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 a.href=n,o&&(a.class=o),l&&(a.target=l),u&&(a.rel=u),h&&Object.assign(a,h),{tagName:i,attributes:a,content:s,eventListeners:d}}};function ND(t,e){class r extends X8e{constructor(i,s){super(i,s),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const m_t=ND("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Wde=ND("text"),y_t=ND("nl"),Y8=ND("url",{isLink:!0,toHref(t=C6.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==T6&&t[1].t===uy}}),yu=t=>new gc(t);function v_t({groups:t}){const e=t.domain.concat([YL,KL,jp,ZL,QL,JL,eI,tI,Cu,JJ,US,rI,nI,iI,pd,aI,YS,sI]),r=[XL,uy,tee,fd,ree,US,jS,nee,iee,BL,FL,WS,qS,DL,OL,PL,$L,zL,VL,HL,GL,WL,qL,UL,jL],n=[YL,XL,KL,ZL,QL,JL,eI,tI,Cu,WS,qS,US,rI,nI,iI,jS,pd,aI,YS,sI],i=yu(),s=qt(i,YS);Cn(s,n,s),Cn(s,t.domain,s);const a=yu(),o=yu(),l=yu();Cn(i,t.domain,a),Cn(i,t.scheme,o),Cn(i,t.slashscheme,l),Cn(a,n,s),Cn(a,t.domain,a);const u=qt(a,jp);qt(s,jp,u),qt(o,jp,u),qt(l,jp,u);const h=qt(s,fd);Cn(h,n,s),Cn(h,t.domain,s);const d=yu();Cn(u,t.domain,d),Cn(d,t.domain,d);const f=qt(d,fd);Cn(f,t.domain,d);const p=yu(m_t);Cn(f,t.tld,p),Cn(f,t.utld,p),qt(u,T6,p);const g=qt(d,Cu);qt(g,Cu,g),Cn(g,t.domain,d),Cn(p,t.domain,d),qt(p,fd,f),qt(p,Cu,g);const m=qt(a,Cu),y=qt(a,fd);qt(m,Cu,m),Cn(m,t.domain,a),Cn(y,n,s),Cn(y,t.domain,a);const v=yu(Y8);Cn(y,t.tld,v),Cn(y,t.utld,v),Cn(v,t.domain,a),Cn(v,n,s),qt(v,fd,y),qt(v,Cu,m),qt(v,jp,u);const b=qt(v,uy),x=yu(Y8);Cn(b,t.numeric,x);const T=yu(Y8),C=yu();Cn(T,e,T),Cn(T,r,C),Cn(C,e,T),Cn(C,r,C),qt(v,pd,T),qt(x,pd,T);const S=qt(o,uy),k=qt(l,uy),E=qt(k,pd),A=qt(E,pd);Cn(o,t.domain,a),qt(o,fd,y),qt(o,Cu,m),Cn(l,t.domain,a),qt(l,fd,y),qt(l,Cu,m),Cn(S,t.domain,T),qt(S,pd,T),qt(S,jS,T),Cn(A,t.domain,T),Cn(A,e,T),qt(A,pd,T);const M=[[WS,qS],[OL,DL],[PL,$L],[BL,FL],[zL,VL],[HL,GL],[WL,qL],[UL,jL]];for(let R=0;R=0&&f++,i++,h++;if(f<0)i-=h,i0&&(s.push(UF(Wde,e,a)),a=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);s.push(UF(p,e,g))}}return a.length>0&&s.push(UF(Wde,e,a)),s}function UF(t,e,r){const n=r[0].s,i=r[r.length-1].e,s=e.slice(n,i);return new t(s,r)}const x_t=typeof console<"u"&&console&&console.warn||(()=>{}),w_t="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 K8e(){return gc.groups={},Zi.scanner=null,Zi.parser=null,Zi.tokenQueue=[],Zi.pluginQueue=[],Zi.customSchemes=[],Zi.initialized=!1,Zi}function oI(t,e=!1){if(Zi.initialized&&x_t(`linkifyjs: already initialized - will not register custom scheme "${t}" ${w_t}`),!/^[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()}}}),MRt=ri.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]}`,yn(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=>TG({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),RRt=ri.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",yn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!_mt(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return T4e(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(yr.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(Nr.create(s.doc,l.pos)):s.setSelection(yr.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(yr.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_4e({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),LRt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,IRt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,NRt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,DRt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ORt=rp.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",yn(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[Fg({find:LRt,type:this.type}),Fg({find:NRt,type:this.type})]},addPasteRules(){return[jd({find:IRt,type:this.type}),jd({find:DRt,type:this.type})]}}),_Rt="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",PRt="ελ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",HW="numeric",GW="ascii",WW="alpha",jx="asciinumeric",V3="alphanumeric",qW="domain",QSe="emoji",BRt="scheme",$Rt="slashscheme",q$="whitespace";function FRt(t,e){return t in e||(e[t]=[]),e[t]}function dU(t,e,r){e[HW]&&(e[jx]=!0,e[V3]=!0),e[GW]&&(e[jx]=!0,e[WW]=!0),e[jx]&&(e[V3]=!0),e[WW]&&(e[V3]=!0),e[V3]&&(e[qW]=!0),e[QSe]&&(e[qW]=!0);for(const n in e){const i=FRt(n,r);i.indexOf(t)<0&&i.push(t)}}function zRt(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function gc(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}gc.groups={};gc.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),La=(t,e,r,n,i)=>t.tr(e,r,n,i),Jde=(t,e,r,n,i)=>t.ts(e,r,n,i),Wt=(t,e,r,n,i)=>t.tt(e,r,n,i),zf="WORD",jW="UWORD",eEe="ASCIINUMERICAL",tEe="ALPHANUMERICAL",ST="LOCALHOST",YW="TLD",XW="UTLD",jA="SCHEME",iy="SLASH_SCHEME",see="NUM",KW="WS",oee="NL",Yx="OPENBRACE",Xx="CLOSEBRACE",BL="OPENBRACKET",$L="CLOSEBRACKET",FL="OPENPAREN",zL="CLOSEPAREN",VL="OPENANGLEBRACKET",HL="CLOSEANGLEBRACKET",GL="FULLWIDTHLEFTPAREN",WL="FULLWIDTHRIGHTPAREN",qL="LEFTCORNERBRACKET",jL="RIGHTCORNERBRACKET",YL="LEFTWHITECORNERBRACKET",XL="RIGHTWHITECORNERBRACKET",KL="FULLWIDTHLESSTHAN",ZL="FULLWIDTHGREATERTHAN",JL="AMPERSAND",QL="APOSTROPHE",eI="ASTERISK",Yp="AT",tI="BACKSLASH",rI="BACKTICK",nI="CARET",fU="COLON",lee="COMMA",iI="DOLLAR",pd="DOT",aI="EQUALS",cee="EXCLAMATION",Tu="HYPHEN",Kx="PERCENT",sI="PIPE",oI="PLUS",lI="POUND",Zx="QUERY",uee="QUOTE",rEe="FULLWIDTHMIDDLEDOT",hee="SEMI",gd="SLASH",Jx="TILDE",cI="UNDERSCORE",nEe="EMOJI",uI="SYM";var iEe=Object.freeze({__proto__:null,ALPHANUMERICAL:tEe,AMPERSAND:JL,APOSTROPHE:QL,ASCIINUMERICAL:eEe,ASTERISK:eI,AT:Yp,BACKSLASH:tI,BACKTICK:rI,CARET:nI,CLOSEANGLEBRACKET:HL,CLOSEBRACE:Xx,CLOSEBRACKET:$L,CLOSEPAREN:zL,COLON:fU,COMMA:lee,DOLLAR:iI,DOT:pd,EMOJI:nEe,EQUALS:aI,EXCLAMATION:cee,FULLWIDTHGREATERTHAN:ZL,FULLWIDTHLEFTPAREN:GL,FULLWIDTHLESSTHAN:KL,FULLWIDTHMIDDLEDOT:rEe,FULLWIDTHRIGHTPAREN:WL,HYPHEN:Tu,LEFTCORNERBRACKET:qL,LEFTWHITECORNERBRACKET:YL,LOCALHOST:ST,NL:oee,NUM:see,OPENANGLEBRACKET:VL,OPENBRACE:Yx,OPENBRACKET:BL,OPENPAREN:FL,PERCENT:Kx,PIPE:sI,PLUS:oI,POUND:lI,QUERY:Zx,QUOTE:uee,RIGHTCORNERBRACKET:jL,RIGHTWHITECORNERBRACKET:XL,SCHEME:jA,SEMI:hee,SLASH:gd,SLASH_SCHEME:iy,SYM:uI,TILDE:Jx,TLD:YW,UNDERSCORE:cI,UTLD:XW,UWORD:jW,WORD:zf,WS:KW});const Ef=/[a-z]/,K9=new RegExp("\\p{L}","u"),j$=new RegExp("\\p{Emoji}","u"),Af=/\d/,Y$=/\s/,Qde="\r",X$=` +`,VRt="️",HRt="‍",K$="";let XS=null,KS=null;function GRt(t=[]){const e={};gc.groups=e;const r=new gc;XS==null&&(XS=efe(_Rt)),KS==null&&(KS=efe(PRt)),Wt(r,"'",QL),Wt(r,"{",Yx),Wt(r,"}",Xx),Wt(r,"[",BL),Wt(r,"]",$L),Wt(r,"(",FL),Wt(r,")",zL),Wt(r,"<",VL),Wt(r,">",HL),Wt(r,"(",GL),Wt(r,")",WL),Wt(r,"「",qL),Wt(r,"」",jL),Wt(r,"『",YL),Wt(r,"』",XL),Wt(r,"<",KL),Wt(r,">",ZL),Wt(r,"&",JL),Wt(r,"*",eI),Wt(r,"@",Yp),Wt(r,"`",rI),Wt(r,"^",nI),Wt(r,":",fU),Wt(r,",",lee),Wt(r,"$",iI),Wt(r,".",pd),Wt(r,"=",aI),Wt(r,"!",cee),Wt(r,"-",Tu),Wt(r,"%",Kx),Wt(r,"|",sI),Wt(r,"+",oI),Wt(r,"#",lI),Wt(r,"?",Zx),Wt(r,'"',uee),Wt(r,"/",gd),Wt(r,";",hee),Wt(r,"~",Jx),Wt(r,"_",cI),Wt(r,"\\",tI),Wt(r,"・",rEe);const n=La(r,Af,see,{[HW]:!0});La(n,Af,n);const i=La(n,Ef,eEe,{[jx]:!0}),a=La(n,K9,tEe,{[V3]:!0}),s=La(r,Ef,zf,{[GW]:!0});La(s,Af,i),La(s,Ef,s),La(i,Af,i),La(i,Ef,i);const o=La(r,K9,jW,{[WW]:!0});La(o,Ef),La(o,Af,a),La(o,K9,o),La(a,Af,a),La(a,Ef),La(a,K9,a);const l=Wt(r,X$,oee,{[q$]:!0}),u=Wt(r,Qde,KW,{[q$]:!0}),h=La(r,Y$,KW,{[q$]:!0});Wt(r,K$,h),Wt(u,X$,l),Wt(u,K$,h),La(u,Y$,h),Wt(h,Qde),Wt(h,X$),La(h,Y$,h),Wt(h,K$,h);const d=La(r,j$,nEe,{[QSe]:!0});Wt(d,"#"),La(d,j$,d),Wt(d,VRt,d);const f=Wt(d,HRt);Wt(f,"#"),La(f,j$,d);const p=[[Ef,s],[Af,i]],g=[[Ef,null],[K9,o],[Af,a]];for(let m=0;mm[0]>U[0]?1:-1);for(let m=0;m=0?b[qW]=!0:Ef.test(U)?Af.test(U)?b[jx]=!0:b[GW]=!0:b[HW]=!0,Jde(r,U,U,b)}return Jde(r,"localhost",ST,{ascii:!0}),r.jd=new gc(uI),{start:r,tokens:Object.assign({groups:e},iEe)}}function aEe(t,e){const r=WRt(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 WRt(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 Rp(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 ET={defaultProtocol:"http",events:null,format:tfe,formatHref:tfe,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dee(t,e=null){let r=Object.assign({},ET);t&&(r=Object.assign(r,t instanceof dee?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=ET.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 _O(t,e){class r extends sEe{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 qRt=_O("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rfe=_O("text"),jRt=_O("nl"),ZS=_O("url",{isLink:!0,toHref(t=ET.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ST&&t[1].t===fU}}),Uu=t=>new gc(t);function YRt({groups:t}){const e=t.domain.concat([JL,eI,Yp,tI,rI,nI,iI,aI,Tu,see,Kx,sI,oI,lI,gd,uI,Jx,cI]),r=[QL,fU,lee,pd,cee,Kx,Zx,uee,hee,VL,HL,Yx,Xx,$L,BL,FL,zL,GL,WL,qL,jL,YL,XL,KL,ZL],n=[JL,QL,eI,tI,rI,nI,iI,aI,Tu,Yx,Xx,Kx,sI,oI,lI,Zx,gd,uI,Jx,cI],i=Uu(),a=Wt(i,Jx);kn(a,n,a),kn(a,t.domain,a);const s=Uu(),o=Uu(),l=Uu();kn(i,t.domain,s),kn(i,t.scheme,o),kn(i,t.slashscheme,l),kn(s,n,a),kn(s,t.domain,s);const u=Wt(s,Yp);Wt(a,Yp,u),Wt(o,Yp,u),Wt(l,Yp,u);const h=Wt(a,pd);kn(h,n,a),kn(h,t.domain,a);const d=Uu();kn(u,t.domain,d),kn(d,t.domain,d);const f=Wt(d,pd);kn(f,t.domain,d);const p=Uu(qRt);kn(f,t.tld,p),kn(f,t.utld,p),Wt(u,ST,p);const g=Wt(d,Tu);Wt(g,Tu,g),kn(g,t.domain,d),kn(p,t.domain,d),Wt(p,pd,f),Wt(p,Tu,g);const m=Wt(s,Tu),U=Wt(s,pd);Wt(m,Tu,m),kn(m,t.domain,s),kn(U,n,a),kn(U,t.domain,s);const y=Uu(ZS);kn(U,t.tld,y),kn(U,t.utld,y),kn(y,t.domain,s),kn(y,n,a),Wt(y,pd,U),Wt(y,Tu,m),Wt(y,Yp,u);const b=Wt(y,fU),v=Uu(ZS);kn(b,t.numeric,v);const w=Uu(ZS),T=Uu();kn(w,e,w),kn(w,r,T),kn(T,e,w),kn(T,r,T),Wt(y,gd,w),Wt(v,gd,w);const k=Wt(o,fU),C=Wt(l,fU),S=Wt(C,gd),E=Wt(S,gd);kn(o,t.domain,s),Wt(o,pd,U),Wt(o,Tu,m),kn(l,t.domain,s),Wt(l,pd,U),Wt(l,Tu,m),kn(k,t.domain,w),Wt(k,gd,w),Wt(k,Zx,w),kn(E,t.domain,w),kn(E,e,w),Wt(E,gd,w);const A=[[Yx,Xx],[BL,$L],[FL,zL],[VL,HL],[GL,WL],[qL,jL],[YL,XL],[KL,ZL]];for(let R=0;R=0&&f++,i++,h++;if(f<0)i-=h,i0&&(a.push(Z$(rfe,e,s)),s=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);a.push(Z$(p,e,g))}}return s.length>0&&a.push(Z$(rfe,e,s)),a}function Z$(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 KRt=typeof console<"u"&&console&&console.warn||(()=>{}),ZRt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ji={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function oEe(){return gc.groups={},Ji.scanner=null,Ji.parser=null,Ji.tokenQueue=[],Ji.pluginQueue=[],Ji.customSchemes=[],Ji.initialized=!1,Ji}function hI(t,e=!1){if(Ji.initialized&&KRt(`linkifyjs: already initialized - will not register custom scheme "${t}" ${ZRt}`),!/^[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 T_t(){Zi.scanner=p_t(Zi.customSchemes);for(let t=0;td.mark.type===r);if(!l.length)return;const{nodeAfter:u}=s;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;const h=t.storedMarks;t.removeMark(o,e.to,r),t.setStoredMarks(h),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(r)}function M_t(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function R_t(t){return new li({key:new Mi("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=n,o=mQ(r.doc,[...e]);if(!e.some(K5e)){const l=[];o.steps.forEach((u,h)=>{if(!(u instanceof ws)||!u.slice.size)return;const d=o.mapping.slice(h+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);fh.to-u.to),l.forEach(u=>A_t(a,u,t.type))}if(UA(o).forEach(({newRange:l})=>{const u=o3e(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(!k_t.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(C_t).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=OD(p).map(y=>y.toObject(t.defaultProtocol));if(!M_t(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=>{H3(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||a.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function __t(t){return new li({key:new Mi("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 s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,o;const l=bQ(e.state,t.type.name),u=(a=i.href)!==null&&a!==void 0?a:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),s=!0)}return s}}})}const L_t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,I_t=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Z8e(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function N_t(t,e){let r=0,n=0;for(;n0}function Q8e(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||Z8e(t,(n=e.index)!==null&&n!==void 0?n:0)||N_t(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function J8e(t){var e,r;const[n,i,s,,a,o,l]=t,u=(e=a??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:s,title:u||null,markdown:!0}}}function O_t(t,e){return t.index{const n=L_t.exec(r);return!n||!Q8e(r,n,t.isAllowedHref)?null:J8e(n)},type:t.type,getAttributes:eMe});return new Kh({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 P_t(t){const e=Ud({find:r=>{var n,i;const s=[];for(const o of r.matchAll(I_t))Q8e(r,o,t.isAllowedHref)&&s.push(J8e(o));const a=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!s.some(l=>O_t(l,o)));return[...s,...a]},type:t.type,getAttributes:eMe});return new YA({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 $_t(t){return new li({key:new Mi("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:o}=a;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=DD(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 Mf(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(E_t,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const B_t=tp.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"){oI(t);return}oI(t.scheme,t.optionalSlashes)})},onDestroy(){K8e()},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)=>!!Mf(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=>!!Mf(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=>!!Mf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",mn(this.options.HTMLAttributes,t),0]:["a",mn(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,s;const a=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${a} "${o}")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Mf(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=>!!Mf(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?[D_t({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Mf(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;DD(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Mf(a,n),protocols:n,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&r.push({text:s.value,data:{href:s.href},index:s.start})})}return r};return this.options.markdownLinks?[P_t({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Mf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Ud({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(R_t({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Mf(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(__t({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push($_t({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),X8=" ",jF=" ",F_t=ti.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",mn(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===X8||r[0].text===X8||r[0].raw===jF||r[0].text===jF)&&n.length===1&&n[0].type==="text"&&(n[0].text===X8||n[0].text===jF)?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,s;const a=Array.isArray(r==null||(i=r.previousNode)===null||i===void 0?void 0:i.content)?r.previousNode.content:[];return(r==null||(s=r.previousNode)===null||s===void 0?void 0:s.type)==="paragraph"&&a.length===0?X8:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),z_t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,V_t=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,H_t=tp.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",mn(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[Bg({find:z_t,type:this.type})]},addPasteRules(){return[Ud({find:V_t,type:this.type})]}}),G_t=ti.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),W_t=tp.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",mn(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()}}}),q_t=Ni.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(U9t.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(V9t.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(f8e.configure(this.options.bulletList)),this.options.code!==!1&&t.push(K9t.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(D3e.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Z9t.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(hyt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(dyt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(Q9t.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(J9t.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(Ayt.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(e_t.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(s_t.configure(this.options.italic)),this.options.listItem!==!1&&t.push(v8e.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(x8e.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(B_t.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(T8e.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(F_t.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(H_t.configure(this.options.strike)),this.options.text!==!1&&t.push(G_t.configure(this.options.text)),this.options.underline!==!1){var n;t.push(W_t.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(Eyt.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var YF=q_t;const lI=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},U_t=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),s=e(i),a=lI(t.start(n),r);if(s&&a)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},qde=(t,e)=>{const{state:r,view:n,extensionManager:i}=t,{schema:s,selection:a}=r,{empty:o,$anchor:l}=a,u=!!i.extensions.find(y=>y.name==="gapCursor");if(!o||l.parent.type!==s.nodes.detailsSummary||!u||e==="right"&&l.parentOffset!==l.parent.nodeSize-2)return!1;const h=xv(y=>y.type===s.nodes.details)(a);if(!h)return!1;const d=kR(h.node,y=>y.type===s.nodes.detailsContent);if(!d.length||lI(h.start+d[0].pos+1,t))return!1;const f=r.doc.resolve(h.pos+h.node.nodeSize),p=ls.findFrom(f,1,!1);if(!p)return!1;const{tr:g}=r,m=new ls(p);return g.setSelection(m),g.scrollIntoView(),n.dispatch(g),!0},j_t=ti.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",mn(this.options.HTMLAttributes,t),0]},...wQ({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:r,HTMLAttributes:n})=>{const i=document.createElement("div"),s=mn(this.options.HTMLAttributes,n,{"data-type":this.name});Object.entries(s).forEach(([h,d])=>i.setAttribute(h,d));const a=document.createElement("button");a.type="button";const o=h=>{this.options.renderToggleButton({element:a,...h})};i.append(a);const l=document.createElement("div");i.append(l);const u=h=>{const{setToValue:d,node:f=r}=h||{};if(d!==void 0)if(d){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);const p=i.classList.contains(this.options.openClassName);o({isOpen:p,node:f});const g=new Event("toggleDetailsContent"),m=l.querySelector(':scope > div[data-type="detailsContent"]');m==null||m.dispatchEvent(g)};return o({isOpen:!!r.attrs.open,node:r}),r.attrs.open&&setTimeout(()=>u()),a.addEventListener("click",()=>{if(u(),!this.options.persist){t.commands.focus(void 0,{scrollIntoView:!1});return}if(t.isEditable&&typeof e=="function"){const{from:h,to:d}=t.state.selection;t.chain().command(({tr:f})=>{const p=e();if(typeof p!="number")return!1;const g=f.doc.nodeAt(p);return(g==null?void 0:g.type)!==this.type?!1:(f.setNodeMarkup(p,void 0,{open:!g.attrs.open}),!0)}).setTextSelection({from:h,to:d}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:l,ignoreMutation(h){if(h.type==="selection")return!1;const d=h.target,f=i.contains(d);return a.contains(d)||!f||i===d},update:h=>h.type!==this.type?!1:(h.attrs.open!==void 0?u({setToValue:h.attrs.open,node:h}):o({isOpen:i.classList.contains(this.options.openClassName),node:h}),!0)}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var r;const{schema:n,selection:i}=t,{$from:s,$to:a}=i,o=s.blockRange(a);if(!o)return!1;const l=t.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;const u=((r=l.toJSON())===null||r===void 0?void 0:r.content)||[];return e().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{const{selection:r,schema:n}=t,i=xv(m=>m.type===this.type)(r);if(!i)return!1;const s=kR(i.node,m=>m.type===n.nodes.detailsSummary),a=kR(i.node,m=>m.type===n.nodes.detailsContent);if(!s.length||!a.length)return!1;const o=s[0],l=a[0],u=i.pos,h=t.doc.resolve(u),d={from:u,to:u+i.node.nodeSize},f=l.node.content.toJSON()||[],p=h.parent.type.contentMatch.defaultType,g=[p==null?void 0:p.create(null,o.node.content).toJSON(),...f];return e().insertContentAt(d,g).setTextSelection(u+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{const{schema:t,selection:e}=this.editor.state,{empty:r,$anchor:n}=e;return!r||n.parent.type!==t.nodes.detailsSummary?!1:n.parentOffset!==0?this.editor.commands.command(({tr:i})=>{const s=n.pos-1,a=n.pos;return i.delete(s,a),!0}):this.editor.commands.unsetDetails()},Enter:({editor:t})=>{const{state:e,view:r}=t,{schema:n,selection:i}=e,{$head:s}=i;if(s.parent.type!==n.nodes.detailsSummary)return!1;const a=lI(s.after()+1,t),o=a?e.doc.nodeAt(s.after()):s.node(-2);if(!o)return!1;const l=a?0:s.indexAfter(-1),u=XO(o.contentMatchAt(l));if(!u||!o.canReplaceWith(l,l,u))return!1;const h=u.createAndFill();if(!h)return!1;const d=a?s.after()+1:s.after(-1),f=e.tr.replaceWith(d,d,h),p=f.doc.resolve(d),g=Gr.near(p,1);return f.setSelection(g),f.scrollIntoView(),r.dispatch(f),!0},ArrowRight:({editor:t})=>qde(t,"right"),ArrowDown:({editor:t})=>qde(t,"down")}},addProseMirrorPlugins(){return[new li({key:new Mi("detailsSelection"),appendTransaction:(t,e,r)=>{const{editor:n,type:i}=this;if(n.view.composing||!t.some(d=>d.selectionSet)||!e.selection.empty||!r.selection.empty||!d3e(r,i.name))return;const{$from:s}=r.selection;if(lI(s.pos,n))return;const a=U_t(s,d=>d.type===i,n);if(!a)return;const o=kR(a.node,d=>d.type===r.schema.nodes.detailsSummary);if(!o.length)return;const l=o[0],u=(e.selection.from{const e=document.createElement("div"),r=mn(this.options.HTMLAttributes,t,{"data-type":this.name,hidden:"hidden"});return Object.entries(r).forEach(([n,i])=>e.setAttribute(n,i)),e.addEventListener("toggleDetailsContent",()=>{e.toggleAttribute("hidden")}),{dom:e,contentDOM:e,ignoreMutation(n){return n.type==="selection"?!1:!e.contains(n.target)||e===n.target},update:n=>n.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{state:e,view:r}=t,{selection:n}=e,{$from:i,empty:s}=n,a=xv(A=>A.type===this.type)(n);if(!s||!a||!a.node.childCount)return!1;const o=i.index(a.depth),{childCount:l}=a.node;if(l!==o+1)return!1;const u=a.node.type.contentMatch.defaultType,h=u==null?void 0:u.createAndFill();if(!h)return!1;const d=e.doc.resolve(a.pos+1),f=l-1,p=a.node.child(f),g=d.posAtIndex(f,a.depth);if(!p.eq(h))return!1;const m=i.node(-3);if(!m)return!1;const y=i.indexAfter(-3),v=XO(m.contentMatchAt(y));if(!v||!m.canReplaceWith(y,y,v))return!1;const b=v.createAndFill();if(!b)return!1;const{tr:x}=e,T=i.after(-2);x.replaceWith(T,T,b);const C=x.doc.resolve(T),S=Gr.near(C,1);x.setSelection(S);const k=g,E=g+p.nodeSize;return x.delete(k,E),x.scrollIntoView(),r.dispatch(x),!0}}},...wQ({nodeName:"detailsContent"})}),X_t=ti.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",mn(this.options.HTMLAttributes,t),0]},...wQ({nodeName:"detailsSummary",content:"inline"})}),aee=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},K_t={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"},Z_t=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:K_t[aee(e)]??null},Q_t={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},oee=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:Q_t[aee(e)]??null},W5=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=aee(e);return r.startsWith("image/")?"image":Z_t(r,e)?"audio":oee(r,e)?"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")||r.includes("keynote")||["ppt","pptx","odp","keynote"].includes(n)||n==="key"&&r.includes("keynote")?"presentation":r.includes("android.package-archive")||["apk","xapk","apks","aab"].includes(n)?"apk":r.includes("application/x-msdownload")||r.includes("application/x-msdos-program")||r.includes("application/x-msi")||["exe","msi"].includes(n)?"exe":r.includes("application/x-apple-diskimage")||["dmg","pkg","ipa"].includes(n)?"dmg":r.includes("application/x-debian-package")||r.includes("application/x-redhat-package-manager")||["appimage","deb","rpm","flatpak"].includes(n)?"linux":r.includes("application/x-executable")||["run","elf"].includes(n)?"executable":r.includes("epub")||r.includes("mobipocket")||["epub","mobi","azw","azw3","fb2","djvu"].includes(n)?"book":r.startsWith("font/")||r.includes("font")||["ttf","otf","woff","woff2","eot"].includes(n)?"font":r.includes("iso9660")||["iso","img","vmdk","qcow2","vdi"].includes(n)?"diskimage":r.includes("sqlite")||["sqlite","sqlite3","db","db3"].includes(n)?"database":r.includes("photoshop")||["psd","psb","ai","sketch","fig","xd","afphoto","afdesign","cdr"].includes(n)?"design":r.startsWith("model/")||["blend","obj","stl","fbx","gltf","glb","step","stp","iges","igs","dwg","dxf"].includes(n)?"model3d":r.includes("pkix")||r.includes("x-x509")||r.includes("pkcs")||["pem","crt","cer","key","pub","pfx","p12","der","csr"].includes(n)?"certificate":["xmind","drawio","excalidraw","vsdx","vsd","mindnode","mmap"].includes(n)?"diagram":["log","crash","out","trace"].includes(n)?"log":["sh","bash","zsh","fish","bat","cmd","ps1"].includes(n)?"script":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","scss","less","py","java","go","rs","c","cpp","h","hpp","cs","swift","kt","kts","rb","php","lua","sql","toml","ini","conf","env"].includes(n)?"code":r.startsWith("text/")||["txt","md"].includes(n)?"text":"file"},J_t=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,eLt=t=>{if(t.startsWith("edgeever-resource://"))try{const e=new URL(t);return decodeURIComponent(e.pathname.replace(/^\//,""))||null}catch{return null}try{const r=new URL(t,"http://edgeever.local").pathname.match(J_t);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},lee=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),tLt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",script:"SHELL",text:"TXT",apk:"APK",exe:"EXE",dmg:"DMG",linux:"LINUX",executable:"BIN",book:"BOOK",font:"FONT",diskimage:"ISO",database:"DB",design:"DESIGN",model3d:"3D",log:"LOG",certificate:"KEY",diagram:"DIAGRAM",file:"FILE"},Ude={msi:"MSI",appimage:"APPIMAGE",deb:"DEB",rpm:"RPM",pkg:"PKG",ipa:"IPA",aab:"AAB",psd:"PSD",ai:"AI",sketch:"SKETCH",fig:"FIG",xd:"XD",stl:"STL",obj:"OBJ",blend:"BLEND",fbx:"FBX",gltf:"GLTF",glb:"GLB",dwg:"DWG",sh:"SH",bash:"BASH",zsh:"ZSH",bat:"BAT",cmd:"CMD",ps1:"PS1",pem:"PEM",crt:"CERT",cer:"CERT",pub:"PUB",key:"KEY",xmind:"XMIND",drawio:"DRAWIO",vsdx:"VSDX",epub:"EPUB",mobi:"MOBI",woff2:"WOFF2",woff:"WOFF",ttf:"TTF",otf:"OTF",csv:"CSV",tsv:"TSV",md:"MD","7z":"7Z",tar:"TAR",gz:"GZ"},Gg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},rLt=t=>{const e=Gg(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]}`},nLt=(t,e)=>{var n;const r=((n=e==null?void 0:e.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:n[1])??"";return Ude[r]?Ude[r]:tLt[W5(t,e)]},iLt=(t,e,r)=>[nLt(t,e),rLt(r)].filter(Boolean).join(" · "),a0="edgeeverFileAttachment",jde=t=>t==="compact"?"compact":"inline",sLt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,aLt=/^\s*(?:附件[::]|Attachment:)\s*/i,oLt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,lLt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),cLt=(t,e)=>W5(null,lee(t))==="pdf"||W5(null,e)==="pdf"?!1:aLt.test(t)||oLt.test(e),uLt=ti.create({name:a0,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=>Gg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=Gg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>jde(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=jde(t.displayMode);return e==="compact"?{"data-file-display-mode":e}:{}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",mn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:a0,attrs:{url:t.url||"",label:e,filename:lee(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${lLt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:a0,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=sLt.exec(t);if(!(!e||!cLt(e[1],e[2])))return{type:a0,raw:e[0],label:e[1],url:e[2]}}}}),hLt=25,dLt=100,fLt=[{id:"small",width:35,labelKey:"editor.imageSizeSmall"},{id:"medium",width:50,labelKey:"editor.imageSizeMedium"},{id:"large",width:72,labelKey:"editor.imageSizeLarge"},{id:"full",width:100,labelKey:"editor.imageSizeFull"}],Yde=fLt[1].width,pLt=640,gLt=` -@media screen and (max-width: ${pLt}px) { +3. "-" cannot repeat`);Ji.customSchemes.push([t,e])}function JRt(){Ji.scanner=GRt(Ji.customSchemes);for(let t=0;td.mark.type===r);if(!l.length)return;const{nodeAfter:u}=a;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;const h=t.storedMarks;t.removeMark(o,e.to,r),t.setStoredMarks(h),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(r)}function iLt(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function aLt(t){return new ci({key:new Mi("autolink"),appendTransaction:(e,r,n)=>{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=TJ(r.doc,[...e]);if(!e.some(s4e)){const l=[];o.steps.forEach((u,h)=>{if(!(u instanceof va)||!u.slice.size)return;const d=o.mapping.slice(h+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);fh.to-u.to),l.forEach(u=>nLt(s,u,t.type))}if(KC(o).forEach(({newRange:l})=>{const u=U4e(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(!eLt.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(QRt).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=PO(p).map(U=>U.toObject(t.defaultProtocol));if(!iLt(m))return!1;m.filter(U=>U.isLink).map(U=>({...U,from:g+U.start+1,to:g+U.end+1})).filter(U=>n.schema.marks.code?!n.doc.rangeHasMark(U.from,U.to,n.schema.marks.code):!0).filter(U=>t.validate(U.value)).filter(U=>t.shouldAutoLink(U.value)).forEach(U=>{W4(U.from,U.to,n.doc).some(y=>y.mark.type===t.type)||s.addMark(U.from,U.to,t.type.create({href:U.href}))})}}),!!s.steps.length)return s}})}function sLt(t){return new ci({key:new Mi("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=SJ(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 oLt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,lLt=/\[([^[\]]+)\]\(((?:[^\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 cLt(t,e){let r=0,n=0;for(;n0}function cEe(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)||cLt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!a.trim()&&r(s)}function uEe(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 uLt(t,e){return t.index{const n=oLt.exec(r);return!n||!cEe(r,n,t.isAllowedHref)?null:uEe(n)},type:t.type,getAttributes:hEe});return new Kh({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 dLt(t){const e=jd({find:r=>{var n,i;const a=[];for(const o of r.matchAll(lLt))cEe(r,o,t.isAllowedHref)&&a.push(uEe(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=>uLt(l,o)));return[...a,...s]},type:t.type,getAttributes:hEe});return new JC({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 fLt(t){return new ci({key:new Mi("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=BO(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 Mf(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(rLt,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const pLt=rp.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"){hI(t);return}hI(t.scheme,t.optionalSlashes)})},onDestroy(){oEe()},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)=>!!Mf(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=>!!Mf(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=>!!Mf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",yn(this.options.HTMLAttributes,t),0]:["a",yn(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=>!!Mf(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=>!!Mf(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?[hLt({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Mf(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;BO(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:s=>!!Mf(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?[dLt({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Mf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[jd({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(aLt({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Mf(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(sLt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(fLt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),JS=" ",J$=" ",gLt=ri.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",yn(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===JS||r[0].text===JS||r[0].raw===J$||r[0].text===J$)&&n.length===1&&n[0].type==="text"&&(n[0].text===JS||n[0].text===J$)?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?JS:""}return e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mLt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ULt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yLt=rp.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",yn(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[Fg({find:mLt,type:this.type})]},addPasteRules(){return[jd({find:ULt,type:this.type})]}}),bLt=ri.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),vLt=rp.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",yn(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()}}}),xLt=Di.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(wRt.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(URt.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(TSe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(SRt.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(W4e.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(ERt.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(FUt.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(zUt.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(ARt.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(MRt.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(r5t.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(RRt.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(ORt.configure(this.options.italic)),this.options.listItem!==!1&&t.push(ASe.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(RSe.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var r;t.push(pLt.configure((r=this.options)===null||r===void 0?void 0:r.link))}if(this.options.orderedList!==!1&&t.push(ISe.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(gLt.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(yLt.configure(this.options.strike)),this.options.text!==!1&&t.push(bLt.configure(this.options.text)),this.options.underline!==!1){var n;t.push(vLt.configure((n=this.options)===null||n===void 0?void 0:n.underline))}if(this.options.trailingNode!==!1){var i;t.push(t5t.configure((i=this.options)===null||i===void 0?void 0:i.trailingNode))}return t}});var Q$=xLt;const dI=(t,e)=>{const r=e.view.domAtPos(t).node,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;return n?n.offsetParent!==null:!1},wLt=(t,e,r)=>{for(let n=t.depth;n>0;n-=1){const i=t.node(n),a=e(i),s=dI(t.start(n),r);if(a&&s)return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}},nfe=(t,e)=>{const{state:r,view:n,extensionManager:i}=t,{schema:a,selection:s}=r,{empty:o,$anchor:l}=s,u=!!i.extensions.find(U=>U.name==="gapCursor");if(!o||l.parent.type!==a.nodes.detailsSummary||!u||e==="right"&&l.parentOffset!==l.parent.nodeSize-2)return!1;const h=T5(U=>U.type===a.nodes.details)(s);if(!h)return!1;const d=EA(h.node,U=>U.type===a.nodes.detailsContent);if(!d.length||dI(h.start+d[0].pos+1,t))return!1;const f=r.doc.resolve(h.pos+h.node.nodeSize),p=la.findFrom(f,1,!1);if(!p)return!1;const{tr:g}=r,m=new la(p);return g.setSelection(m),g.scrollIntoView(),n.dispatch(g),!0},TLt=ri.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",yn(this.options.HTMLAttributes,t),0]},...AJ({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:r,HTMLAttributes:n})=>{const i=document.createElement("div"),a=yn(this.options.HTMLAttributes,n,{"data-type":this.name});Object.entries(a).forEach(([h,d])=>i.setAttribute(h,d));const s=document.createElement("button");s.type="button";const o=h=>{this.options.renderToggleButton({element:s,...h})};i.append(s);const l=document.createElement("div");i.append(l);const u=h=>{const{setToValue:d,node:f=r}=h||{};if(d!==void 0)if(d){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);const p=i.classList.contains(this.options.openClassName);o({isOpen:p,node:f});const g=new Event("toggleDetailsContent"),m=l.querySelector(':scope > div[data-type="detailsContent"]');m==null||m.dispatchEvent(g)};return o({isOpen:!!r.attrs.open,node:r}),r.attrs.open&&setTimeout(()=>u()),s.addEventListener("click",()=>{if(u(),!this.options.persist){t.commands.focus(void 0,{scrollIntoView:!1});return}if(t.isEditable&&typeof e=="function"){const{from:h,to:d}=t.state.selection;t.chain().command(({tr:f})=>{const p=e();if(typeof p!="number")return!1;const g=f.doc.nodeAt(p);return(g==null?void 0:g.type)!==this.type?!1:(f.setNodeMarkup(p,void 0,{open:!g.attrs.open}),!0)}).setTextSelection({from:h,to:d}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:l,ignoreMutation(h){if(h.type==="selection")return!1;const d=h.target,f=i.contains(d);return s.contains(d)||!f||i===d},update:h=>h.type!==this.type?!1:(h.attrs.open!==void 0?u({setToValue:h.attrs.open,node:h}):o({isOpen:i.classList.contains(this.options.openClassName),node:h}),!0)}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var r;const{schema:n,selection:i}=t,{$from:a,$to:s}=i,o=a.blockRange(s);if(!o)return!1;const l=t.doc.slice(o.start,o.end);if(!n.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;const u=((r=l.toJSON())===null||r===void 0?void 0:r.content)||[];return e().insertContentAt({from:o.start,to:o.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:u}]}).setTextSelection(o.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{const{selection:r,schema:n}=t,i=T5(m=>m.type===this.type)(r);if(!i)return!1;const a=EA(i.node,m=>m.type===n.nodes.detailsSummary),s=EA(i.node,m=>m.type===n.nodes.detailsContent);if(!a.length||!s.length)return!1;const o=a[0],l=s[0],u=i.pos,h=t.doc.resolve(u),d={from:u,to:u+i.node.nodeSize},f=l.node.content.toJSON()||[],p=h.parent.type.contentMatch.defaultType,g=[p==null?void 0:p.create(null,o.node.content).toJSON(),...f];return e().insertContentAt(d,g).setTextSelection(u+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{const{schema:t,selection:e}=this.editor.state,{empty:r,$anchor:n}=e;return!r||n.parent.type!==t.nodes.detailsSummary?!1:n.parentOffset!==0?this.editor.commands.command(({tr:i})=>{const a=n.pos-1,s=n.pos;return i.delete(a,s),!0}):this.editor.commands.unsetDetails()},Enter:({editor:t})=>{const{state:e,view:r}=t,{schema:n,selection:i}=e,{$head:a}=i;if(a.parent.type!==n.nodes.detailsSummary)return!1;const s=dI(a.after()+1,t),o=s?e.doc.nodeAt(a.after()):a.node(-2);if(!o)return!1;const l=s?0:a.indexAfter(-1),u=JD(o.contentMatchAt(l));if(!u||!o.canReplaceWith(l,l,u))return!1;const h=u.createAndFill();if(!h)return!1;const d=s?a.after()+1:a.after(-1),f=e.tr.replaceWith(d,d,h),p=f.doc.resolve(d),g=Hr.near(p,1);return f.setSelection(g),f.scrollIntoView(),r.dispatch(f),!0},ArrowRight:({editor:t})=>nfe(t,"right"),ArrowDown:({editor:t})=>nfe(t,"down")}},addProseMirrorPlugins(){return[new ci({key:new Mi("detailsSelection"),appendTransaction:(t,e,r)=>{const{editor:n,type:i}=this;if(n.view.composing||!t.some(d=>d.selectionSet)||!e.selection.empty||!r.selection.empty||!w4e(r,i.name))return;const{$from:a}=r.selection;if(dI(a.pos,n))return;const s=wLt(a,d=>d.type===i,n);if(!s)return;const o=EA(s.node,d=>d.type===r.schema.nodes.detailsSummary);if(!o.length)return;const l=o[0],u=(e.selection.from{const e=document.createElement("div"),r=yn(this.options.HTMLAttributes,t,{"data-type":this.name,hidden:"hidden"});return Object.entries(r).forEach(([n,i])=>e.setAttribute(n,i)),e.addEventListener("toggleDetailsContent",()=>{e.toggleAttribute("hidden")}),{dom:e,contentDOM:e,ignoreMutation(n){return n.type==="selection"?!1:!e.contains(n.target)||e===n.target},update:n=>n.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{state:e,view:r}=t,{selection:n}=e,{$from:i,empty:a}=n,s=T5(E=>E.type===this.type)(n);if(!a||!s||!s.node.childCount)return!1;const o=i.index(s.depth),{childCount:l}=s.node;if(l!==o+1)return!1;const u=s.node.type.contentMatch.defaultType,h=u==null?void 0:u.createAndFill();if(!h)return!1;const d=e.doc.resolve(s.pos+1),f=l-1,p=s.node.child(f),g=d.posAtIndex(f,s.depth);if(!p.eq(h))return!1;const m=i.node(-3);if(!m)return!1;const U=i.indexAfter(-3),y=JD(m.contentMatchAt(U));if(!y||!m.canReplaceWith(U,U,y))return!1;const b=y.createAndFill();if(!b)return!1;const{tr:v}=e,w=i.after(-2);v.replaceWith(w,w,b);const T=v.doc.resolve(w),k=Hr.near(T,1);v.setSelection(k);const C=g,S=g+p.nodeSize;return v.delete(C,S),v.scrollIntoView(),r.dispatch(v),!0}}},...AJ({nodeName:"detailsContent"})}),kLt=ri.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",yn(this.options.HTMLAttributes,t),0]},...AJ({nodeName:"detailsSummary",content:"inline"})}),fee=t=>{var e;return((e=t==null?void 0:t.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:e[1])??""},SLt={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"},ELt=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("audio/")?r:SLt[fee(e)]??null},ALt={m4v:"video/mp4",mov:"video/quicktime",mp4:"video/mp4",ogv:"video/ogg",webm:"video/webm"},pee=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"";return r.startsWith("video/")?r:ALt[fee(e)]??null},Yv=(t,e)=>{const r=(t==null?void 0:t.trim().toLowerCase())??"",n=fee(e);return r.startsWith("image/")?"image":ELt(r,e)?"audio":pee(r,e)?"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")||r.includes("keynote")||["ppt","pptx","odp","keynote"].includes(n)||n==="key"&&r.includes("keynote")?"presentation":r.includes("android.package-archive")||["apk","xapk","apks","aab"].includes(n)?"apk":r.includes("application/x-msdownload")||r.includes("application/x-msdos-program")||r.includes("application/x-msi")||["exe","msi"].includes(n)?"exe":r.includes("application/x-apple-diskimage")||["dmg","pkg","ipa"].includes(n)?"dmg":r.includes("application/x-debian-package")||r.includes("application/x-redhat-package-manager")||["appimage","deb","rpm","flatpak"].includes(n)?"linux":r.includes("application/x-executable")||["run","elf"].includes(n)?"executable":r.includes("epub")||r.includes("mobipocket")||["epub","mobi","azw","azw3","fb2","djvu"].includes(n)?"book":r.startsWith("font/")||r.includes("font")||["ttf","otf","woff","woff2","eot"].includes(n)?"font":r.includes("iso9660")||["iso","img","vmdk","qcow2","vdi"].includes(n)?"diskimage":r.includes("sqlite")||["sqlite","sqlite3","db","db3"].includes(n)?"database":r.includes("photoshop")||["psd","psb","ai","sketch","fig","xd","afphoto","afdesign","cdr"].includes(n)?"design":r.startsWith("model/")||["blend","obj","stl","fbx","gltf","glb","step","stp","iges","igs","dwg","dxf"].includes(n)?"model3d":r.includes("pkix")||r.includes("x-x509")||r.includes("pkcs")||["pem","crt","cer","key","pub","pfx","p12","der","csr"].includes(n)?"certificate":["xmind","drawio","excalidraw","vsdx","vsd","mindnode","mmap"].includes(n)?"diagram":["log","crash","out","trace"].includes(n)?"log":["sh","bash","zsh","fish","bat","cmd","ps1"].includes(n)?"script":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","scss","less","py","java","go","rs","c","cpp","h","hpp","cs","swift","kt","kts","rb","php","lua","sql","toml","ini","conf","env"].includes(n)?"code":r.startsWith("text/")||["txt","md"].includes(n)?"text":"file"},MLt=/\/api\/v1\/resources\/([^/]+)\/blob(?:$|[?#])/,RLt=t=>{if(t.startsWith("edgeever-resource://"))try{const e=new URL(t);return decodeURIComponent(e.pathname.replace(/^\//,""))||null}catch{return null}try{const r=new URL(t,"http://edgeever.local").pathname.match(MLt);return r!=null&&r[1]?decodeURIComponent(r[1]):null}catch{return null}},gee=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),LLt={image:"IMAGE",audio:"AUDIO",video:"VIDEO",pdf:"PDF",spreadsheet:"XLS",document:"DOC",presentation:"PPT",archive:"ZIP",code:"CODE",script:"SHELL",text:"TXT",apk:"APK",exe:"EXE",dmg:"DMG",linux:"LINUX",executable:"BIN",book:"BOOK",font:"FONT",diskimage:"ISO",database:"DB",design:"DESIGN",model3d:"3D",log:"LOG",certificate:"KEY",diagram:"DIAGRAM",file:"FILE"},ife={msi:"MSI",appimage:"APPIMAGE",deb:"DEB",rpm:"RPM",pkg:"PKG",ipa:"IPA",aab:"AAB",psd:"PSD",ai:"AI",sketch:"SKETCH",fig:"FIG",xd:"XD",stl:"STL",obj:"OBJ",blend:"BLEND",fbx:"FBX",gltf:"GLTF",glb:"GLB",dwg:"DWG",sh:"SH",bash:"BASH",zsh:"ZSH",bat:"BAT",cmd:"CMD",ps1:"PS1",pem:"PEM",crt:"CERT",cer:"CERT",pub:"PUB",key:"KEY",xmind:"XMIND",drawio:"DRAWIO",vsdx:"VSDX",epub:"EPUB",mobi:"MOBI",woff2:"WOFF2",woff:"WOFF",ttf:"TTF",otf:"OTF",csv:"CSV",tsv:"TSV",md:"MD","7z":"7Z",tar:"TAR",gz:"GZ"},Wg=t=>{const e=typeof t=="number"?t:typeof t=="string"?Number(t):Number.NaN;return Number.isFinite(e)&&e>0?Math.round(e):null},ILt=t=>{const e=Wg(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]}`},NLt=(t,e)=>{var n;const r=((n=e==null?void 0:e.trim().toLowerCase().match(/\.([a-z0-9]+)(?:[?#].*)?$/))==null?void 0:n[1])??"";return ife[r]?ife[r]:LLt[Yv(t,e)]},DLt=(t,e,r)=>[NLt(t,e),ILt(r)].filter(Boolean).join(" · "),o0="edgeeverFileAttachment",afe=t=>t==="compact"?"compact":"inline",OLt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,_Lt=/^\s*(?:附件[::]|Attachment:)\s*/i,PLt=/(?:\/api\/v1\/resources\/|edgeever-(?:resource|staged):\/\/)/i,BLt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),$Lt=(t,e)=>Yv(null,gee(t))==="pdf"||Yv(null,e)==="pdf"?!1:_Lt.test(t)||PLt.test(e),FLt=ri.create({name:o0,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=>Wg(t.getAttribute("data-file-byte-size")),renderHTML:t=>{const e=Wg(t.byteSize);return e===null?{}:{"data-file-byte-size":String(e)}}},displayMode:{default:"inline",parseHTML:t=>afe(t.getAttribute("data-file-display-mode")),renderHTML:t=>{const e=afe(t.displayMode);return e==="compact"?{"data-file-display-mode":e}:{}}}}},parseHTML(){return[{tag:'span[data-type="edgeever-file-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",yn(t,{"data-type":"edgeever-file-attachment",class:"edgeever-file-attachment"})]},parseMarkdown:t=>{const e=t.label||"Attachment";return{type:o0,attrs:{url:t.url||"",label:e,filename:gee(e),mimeType:"",byteSize:null,displayMode:"inline"}}},renderMarkdown:t=>{var e,r;return`[${BLt(String(((e=t.attrs)==null?void 0:e.label)||"Attachment"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:o0,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=OLt.exec(t);if(!(!e||!$Lt(e[1],e[2])))return{type:o0,raw:e[0],label:e[1],url:e[2]}}}}),zLt=25,VLt=100,HLt=[{id:"small",width:35,labelKey:"editor.imageSizeSmall"},{id:"medium",width:50,labelKey:"editor.imageSizeMedium"},{id:"large",width:72,labelKey:"editor.imageSizeLarge"},{id:"full",width:100,labelKey:"editor.imageSizeFull"}],sfe=HLt[1].width,GLt=640,WLt=` +@media screen and (max-width: ${GLt}px) { :is(.edgeever-image-node, .edgeever-image-upload-result, .edgeever-image-upload-placeholder, .ProseMirror img[data-width]):not(.edgeever-image-card *) { width: 100% !important; max-width: 100% !important; } } -`,mLt=()=>{if(typeof document>"u"||document.head.querySelector("style[data-edgeever-phone-image-fill]"))return;const t=document.createElement("style");t.dataset.edgeeverPhoneImageFill="true",t.textContent=gLt,document.head.appendChild(t)},Xde=t=>Math.min(dLt,Math.max(hLt,Math.round(t))),tMe=t=>{if(typeof t=="number"&&Number.isFinite(t))return Xde(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?Xde(Number(e[1])):null},Wq="details",rMe="detailsSummary",nMe="detailsContent",yLt=/^]*)>/i,vLt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,bLt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,iMe=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>iMe(e)).join(""):"":"",cee=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),sMe=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),xLt=t=>sMe(t.replace(/<[^>]+>/g,"")).trim(),wLt=(t,e)=>{const r=new RegExp(`^<${e}\\b([^>]*)>`,"i").exec(t);if(!r)return null;const n=r[0];let i=1,s=n.length;const a=new RegExp(`<${e}\\b`,"ig"),o=new RegExp(``,"ig");for(;s0;){a.lastIndex=s,o.lastIndex=s;const l=a.exec(t),u=o.exec(t);if(!u)return null;if(l&&l.index{const e=bLt.exec(t.trim());return e?e[1]:t},CLt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),YC=(t,e)=>{const r=CLt(e).exec(t);return sMe(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},kLt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),aMe=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||eLt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},SLt=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t))return!1;if(t.startsWith("edgeever-resource://")||t.startsWith("edgeever-staged://")||t.startsWith("/")&&!t.startsWith("//"))return!0;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},ELt=t=>{const e=t.trim();return/^\d+(?:\.\d+)?%$/.test(e)?tMe(e):null},oMe=t=>{const e=t.trim();if(!aMe(e))return null;let r="";try{r=decodeURIComponent(new URL(e).pathname.split("/").filter(Boolean).pop()||"").trim()}catch{r=""}(!r||r.length>120||/[\\/\[\]()<>]/.test(r))&&(r="");const n=r||"video";return{src:e,label:`附件:${n}`,filename:n,mimeType:oee(null,n)??"video/mp4"}},Kde=(t,e,r)=>t.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g).map(n=>n.startsWith("```")||n.startsWith("~~~")?n:(e.lastIndex=0,n.replace(e,r))).join(""),ALt=t=>{const e=[],r=[],n=Kde(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(s,a,o,l)=>{const u=oMe(YC(a||l||"","src"));return u?(r.push(u.src),` +`,qLt=()=>{if(typeof document>"u"||document.head.querySelector("style[data-edgeever-phone-image-fill]"))return;const t=document.createElement("style");t.dataset.edgeeverPhoneImageFill="true",t.textContent=WLt,document.head.appendChild(t)},ofe=t=>Math.min(VLt,Math.max(zLt,Math.round(t))),dEe=t=>{if(typeof t=="number"&&Number.isFinite(t))return ofe(t);if(typeof t!="string")return null;const e=/(\d+(?:\.\d+)?)/.exec(t);return e?ofe(Number(e[1])):null},ZW="details",fEe="detailsSummary",pEe="detailsContent",jLt=/^]*)>/i,YLt=/^\s*]*>([\s\S]*?)<\/summary\s*>\s*/i,XLt=/^\s*]*data-type=["']detailsContent["'][^>]*>([\s\S]*)<\/div>\s*$/i,gEe=t=>t?typeof t.text=="string"?t.text:Array.isArray(t.content)?t.content.map(e=>gEe(e)).join(""):"":"",mee=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),mEe=t=>t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&"),KLt=t=>mEe(t.replace(/<[^>]+>/g,"")).trim(),ZLt=(t,e)=>{const r=new RegExp(`^<${e}\\b([^>]*)>`,"i").exec(t);if(!r)return null;const n=r[0];let i=1,a=n.length;const s=new RegExp(`<${e}\\b`,"ig"),o=new RegExp(``,"ig");for(;a0;){s.lastIndex=a,o.lastIndex=a;const l=s.exec(t),u=o.exec(t);if(!u)return null;if(l&&l.index{const e=XLt.exec(t.trim());return e?e[1]:t},QLt=t=>new RegExp(`\\b${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"),Z9=(t,e)=>{const r=QLt(e).exec(t);return mEe(((r==null?void 0:r[1])??(r==null?void 0:r[2])??(r==null?void 0:r[3])??"").trim())},eIt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),UEe=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t)||RLt(t))return!1;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},tIt=t=>{if(!t||/[\u0000-\u0020"'<>`]/.test(t))return!1;if(t.startsWith("edgeever-resource://")||t.startsWith("edgeever-staged://")||t.startsWith("/")&&!t.startsWith("//"))return!0;try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},rIt=t=>{const e=t.trim();return/^\d+(?:\.\d+)?%$/.test(e)?dEe(e):null},yEe=t=>{const e=t.trim();if(!UEe(e))return null;let r="";try{r=decodeURIComponent(new URL(e).pathname.split("/").filter(Boolean).pop()||"").trim()}catch{r=""}(!r||r.length>120||/[\\/\[\]()<>]/.test(r))&&(r="");const n=r||"video";return{src:e,label:`附件:${n}`,filename:n,mimeType:pee(null,n)??"video/mp4"}},lfe=(t,e,r)=>t.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/g).map(n=>n.startsWith("```")||n.startsWith("~~~")?n:(e.lastIndex=0,n.replace(e,r))).join(""),nIt=t=>{const e=[],r=[],n=lfe(t,/]*)>([\s\S]*?)<\/video\s*>|]*)\/>/gi,(a,s,o,l)=>{const u=yEe(Z9(s||l||"","src"));return u?(r.push(u.src),` -[${kLt(u.label)}](${u.src}) +[${eIt(u.label)}](${u.src}) -`):""});return{markdown:Kde(n,/]*)\/?>/gi,(s,a)=>{const o=YC(a||"","src");if(!o)return s;const l=YC(a||"","alt"),u=YC(a||"","title");return e.push({src:o,width:ELt(YC(a||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},MLt=(t,e,r)=>{const n=new Set(r);let i=0;const s=a=>{var o,l,u;if(a.type==="image"){const h=e[i],d=typeof((o=a.attrs)==null?void 0:o.src)=="string"?a.attrs.src:"";return h&&h.src===d&&(i+=1,h.width!=null)?{...a,attrs:{...a.attrs,width:h.width}}:a}if(a.type===a0&&n.has(String(((l=a.attrs)==null?void 0:l.url)||""))){const h=typeof((u=a.attrs)==null?void 0:u.filename)=="string"?a.attrs.filename:"";return{...a,attrs:{...a.attrs,mimeType:oee(null,h)??"video/mp4"}}}return Array.isArray(a.content)?{...a,content:a.content.map(s)}:a};return t.map(s)},K8=(t,e)=>`${t}="${cee(e)}"`,RLt=t=>{var a,o,l,u;const e=typeof((a=t.attrs)==null?void 0:a.src)=="string"?t.attrs.src.trim():"";if(!SLt(e))return null;const r=typeof((o=t.attrs)==null?void 0:o.alt)=="string"?t.attrs.alt.trim():"",n=typeof((l=t.attrs)==null?void 0:l.title)=="string"?t.attrs.title.trim():"",i=((u=t.attrs)==null?void 0:u.width)==null||t.attrs.width===""?null:tMe(t.attrs.width),s=[K8("src",e)];return r&&s.push(K8("alt",r)),n&&s.push(K8("title",n)),i!=null&&s.push(K8("width",`${i}%`)),``},_Lt=t=>{var e,r;return t.type===a0?t:t.type==="paragraph"&&((e=t.content)==null?void 0:e.length)===1&&((r=t.content[0])==null?void 0:r.type)===a0?t.content[0]:null},LLt=t=>{var s,a,o;const e=_Lt(t);if(!e)return null;const r=typeof((s=e.attrs)==null?void 0:s.url)=="string"?e.attrs.url.trim():"";if(!aMe(r))return null;const n=typeof((a=e.attrs)==null?void 0:a.filename)=="string"?e.attrs.filename:"",i=typeof((o=e.attrs)==null?void 0:o.mimeType)=="string"?e.attrs.mimeType:"";return W5(i,n||r)!=="video"?null:``},ILt=(t,e)=>{const r=[],n=[],i=()=>{if(n.length===0)return;const s=e.renderChildren(n,` +`):""});return{markdown:lfe(n,/]*)\/?>/gi,(a,s)=>{const o=Z9(s||"","src");if(!o)return a;const l=Z9(s||"","alt"),u=Z9(s||"","title");return e.push({src:o,width:rIt(Z9(s||"","width"))}),u?`![${l}](${o} "${u}")`:`![${l}](${o})`}),images:e,videoUrls:r}},iIt=(t,e,r)=>{const n=new Set(r);let i=0;const a=s=>{var o,l,u;if(s.type==="image"){const h=e[i],d=typeof((o=s.attrs)==null?void 0:o.src)=="string"?s.attrs.src:"";return h&&h.src===d&&(i+=1,h.width!=null)?{...s,attrs:{...s.attrs,width:h.width}}:s}if(s.type===o0&&n.has(String(((l=s.attrs)==null?void 0:l.url)||""))){const h=typeof((u=s.attrs)==null?void 0:u.filename)=="string"?s.attrs.filename:"";return{...s,attrs:{...s.attrs,mimeType:pee(null,h)??"video/mp4"}}}return Array.isArray(s.content)?{...s,content:s.content.map(a)}:s};return t.map(a)},QS=(t,e)=>`${t}="${mee(e)}"`,aIt=t=>{var s,o,l,u;const e=typeof((s=t.attrs)==null?void 0:s.src)=="string"?t.attrs.src.trim():"";if(!tIt(e))return null;const r=typeof((o=t.attrs)==null?void 0:o.alt)=="string"?t.attrs.alt.trim():"",n=typeof((l=t.attrs)==null?void 0:l.title)=="string"?t.attrs.title.trim():"",i=((u=t.attrs)==null?void 0:u.width)==null||t.attrs.width===""?null:dEe(t.attrs.width),a=[QS("src",e)];return r&&a.push(QS("alt",r)),n&&a.push(QS("title",n)),i!=null&&a.push(QS("width",`${i}%`)),``},sIt=t=>{var e,r;return t.type===o0?t:t.type==="paragraph"&&((e=t.content)==null?void 0:e.length)===1&&((r=t.content[0])==null?void 0:r.type)===o0?t.content[0]:null},oIt=t=>{var a,s,o;const e=sIt(t);if(!e)return null;const r=typeof((a=e.attrs)==null?void 0:a.url)=="string"?e.attrs.url.trim():"";if(!UEe(r))return null;const n=typeof((s=e.attrs)==null?void 0:s.filename)=="string"?e.attrs.filename:"",i=typeof((o=e.attrs)==null?void 0:o.mimeType)=="string"?e.attrs.mimeType:"";return Yv(i,n||r)!=="video"?null:``},lIt=(t,e)=>{const r=[],n=[],i=()=>{if(n.length===0)return;const a=e.renderChildren(n,` -`).trim();s&&r.push(s),n.length=0};for(const s of t){const a=s.type==="image"?RLt(s):LLt(s);if(!a){n.push(s);continue}i(),r.push(a)}return i(),r.join(` +`).trim();a&&r.push(a),n.length=0};for(const a of t){const s=a.type==="image"?aIt(a):oIt(a);if(!s){n.push(a);continue}i(),r.push(s)}return i(),r.join(` -`)},NLt=(t,e)=>{const r=t.createElement("p"),n=t.createElement("span");return n.setAttribute("data-type","edgeever-file-attachment"),n.setAttribute("data-file-url",e.src),n.setAttribute("data-file-label",e.label),n.setAttribute("data-file-name",e.filename),n.setAttribute("data-file-mime-type",e.mimeType),r.appendChild(n),r},OLt=t=>{if(typeof DOMParser>"u"||!t.includes(" [data-type="detailsContent"]'))continue;const i=e.createElement("div");i.setAttribute("data-type","detailsContent");for(const a of[...n.childNodes])a.nodeName!=="SUMMARY"&&i.appendChild(a);i.hasChildNodes()||i.appendChild(e.createElement("p"));const s=n.querySelector(":scope > summary");s!=null&&s.nextSibling?n.insertBefore(i,s.nextSibling):n.appendChild(i)}return e.body.innerHTML},DLt=` +`)},cIt=(t,e)=>{const r=t.createElement("p"),n=t.createElement("span");return n.setAttribute("data-type","edgeever-file-attachment"),n.setAttribute("data-file-url",e.src),n.setAttribute("data-file-label",e.label),n.setAttribute("data-file-name",e.filename),n.setAttribute("data-file-mime-type",e.mimeType),r.appendChild(n),r},uIt=t=>{if(typeof DOMParser>"u"||!t.includes(" [data-type="detailsContent"]'))continue;const i=e.createElement("div");i.setAttribute("data-type","detailsContent");for(const s of[...n.childNodes])s.nodeName!=="SUMMARY"&&i.appendChild(s);i.hasChildNodes()||i.appendChild(e.createElement("p"));const a=n.querySelector(":scope > summary");a!=null&&a.nextSibling?n.insertBefore(i,a.nextSibling):n.appendChild(i)}return e.body.innerHTML},hIt=` .ProseMirror [data-type="details"], .edgeever-editor-content [data-type="details"] { display: flex; @@ -1446,118 +2116,118 @@ ${r} .edgeever-editor-content [data-type="details"].is-open [data-type="detailsContent"] { margin-top: 0.15em; } -`,PLt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=MLt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),s=i.length>0?i:[{type:"paragraph"}];return e.createNode(Wq,void 0,[e.createNode(rMe,void 0,r?[e.createTextNode(r)]:[]),e.createNode(nMe,void 0,s)])},$Lt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===rMe),i=r.find(o=>o.type===nMe),s=cee(iMe(n).trim()),a=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?ILt(i.content,e):"";return`
    -${s} +`,dIt=(t,e)=>{const r=typeof t.summary=="string"?t.summary:"",n=t,i=iIt(e.parseChildren(t.tokens||[]),n.detailImages||[],n.detailVideoUrls||[]),a=i.length>0?i:[{type:"paragraph"}];return e.createNode(ZW,void 0,[e.createNode(fEe,void 0,r?[e.createTextNode(r)]:[]),e.createNode(pEe,void 0,a)])},fIt=(t,e)=>{const r=Array.isArray(t.content)?t.content:[],n=r.find(o=>o.type===fEe),i=r.find(o=>o.type===pEe),a=mee(gEe(n).trim()),s=Array.isArray(i==null?void 0:i.content)&&i.content.length>0?lIt(i.content,e):"";return`
    +${a} -${a} +${s} -
    `},BLt=j_t.extend({addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{class:"edgeever-details"},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details":"Expand details")}}},parseMarkdown:PLt,renderMarkdown:$Lt,markdownTokenizer:{name:Wq,level:"block",start(t){const e=/[BLt,FLt,zLt],O0="edgeeverImageGallery",lMe=["auto","2","3","1"],HLt="edgeever-image-upload://",GLt=t=>typeof t=="string"&&t.startsWith(HLt),qq=t=>lMe.includes(t)?t:"auto",cMe=ti.create({name:O0,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>qq(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":qq(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",mn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` +
    `},pIt=TLt.extend({addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{class:"edgeever-details"},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details":"Expand details")}}},parseMarkdown:dIt,renderMarkdown:fIt,markdownTokenizer:{name:ZW,level:"block",start(t){const e=/[pIt,gIt,mIt],O0="edgeeverImageGallery",bEe=["auto","2","3","1"],yIt="edgeever-image-upload://",bIt=t=>typeof t=="string"&&t.startsWith(yIt),JW=t=>bEe.includes(t)?t:"auto",vEe=ri.create({name:O0,group:"block",content:"image+",defining:!0,isolating:!0,addAttributes(){return{layout:{default:"auto",parseHTML:t=>JW(t.getAttribute("data-image-gallery-layout")),renderHTML:t=>({"data-image-gallery-layout":JW(t.layout)})}}},parseHTML(){return[{tag:"div[data-edgeever-image-gallery]"}]},renderHTML({node:t,HTMLAttributes:e}){return["div",yn(e,{"data-edgeever-image-gallery":"true","data-image-count":String(t.childCount)}),0]},renderMarkdown(t,e){return e.renderChildren(t.content??[],` -`)}}),Z8="edgeeverMergeDivider",WLt="\x3C!-- edgeever:merge-divider -->",qLt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,ULt=ti.create({name:Z8,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",mn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${WLt} +`)}}),eE="edgeeverMergeDivider",vIt="\x3C!-- edgeever:merge-divider -->",xIt=/^\x3C!--\s*edgeever:merge-divider\s*-->\s*(?:\n+---[ \t]*(?:\n+|$)|(?:\n+|$))/,wIt=ri.create({name:eE,group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML(){return[{tag:"hr[data-edgeever-merge-divider]"}]},renderHTML({HTMLAttributes:t}){return["hr",yn(t,{"data-edgeever-merge-divider":"true",class:"edgeever-merge-divider"})]},renderMarkdown(){return`${vIt} ----`},parseMarkdown(t,e){return e.createNode(Z8)},markdownTokenizer:{name:Z8,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=qLt.exec(t);if(e)return{type:Z8,raw:e[0],text:""}}}}),Lb="edgeeverPdfAttachment",Zde=t=>t==="inline"?"inline":"compact",jLt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,Qde=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,YLt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),XLt=ti.create({name:Lb,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=>Gg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=Gg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>Zde(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":Zde(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",mn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:Lb,attrs:{url:t.url||"",label:t.label||"PDF",filename:lee(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${YLt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:Lb,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=jLt.exec(t);if(!(!e||!Qde(null,e[1])&&!Qde(null,e[2])))return{type:Lb,raw:e[0],label:e[1],url:e[2]}}}}),zk="edgeeverPluginEmbed",uMe="edgeever-plugin-embed",b2=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",Jde=t=>{if(!t||typeof t!="object")return null;const e=t,r=b2(e.id,160),n=b2(e.pluginId,160),i=b2(e.type,120),s=b2(e.resourceId,200);if(!r||!n||!i||!s)return null;const a=typeof e.dataJson=="string"?e.dataJson:"null";try{JSON.parse(a)}catch{return null}return{id:r,pluginId:n,type:i,resourceId:s,previewResourceId:b2(e.previewResourceId,200),title:b2(e.title,500),dataJson:a}},KLt=t=>`\`\`\`${uMe} +---`},parseMarkdown(t,e){return e.createNode(eE)},markdownTokenizer:{name:eE,level:"block",start(t){return t.indexOf("\x3C!-- edgeever:merge-divider -->")},tokenize(t){const e=xIt.exec(t);if(e)return{type:eE,raw:e[0],text:""}}}}),Oy="edgeeverPdfAttachment",cfe=t=>t==="inline"?"inline":"compact",TIt=/^\[([^\]]+)\]\(([^\s)]+)(?:\s+"[^"]*")?\)/,ufe=(t,e)=>(e==null?void 0:e.trim().toLowerCase().endsWith(".pdf"))===!0,CIt=t=>t.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),kIt=ri.create({name:Oy,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=>Wg(t.getAttribute("data-pdf-byte-size")),renderHTML:t=>{const e=Wg(t.byteSize);return e===null?{}:{"data-pdf-byte-size":String(e)}}},displayMode:{default:"compact",parseHTML:t=>cfe(t.getAttribute("data-pdf-display-mode")),renderHTML:t=>({"data-pdf-display-mode":cfe(t.displayMode)})}}},parseHTML(){return[{tag:'span[data-type="edgeever-pdf-attachment"]'}]},renderHTML({HTMLAttributes:t}){return["span",yn(t,{"data-type":"edgeever-pdf-attachment",class:"edgeever-pdf-attachment"})]},parseMarkdown:t=>({type:Oy,attrs:{url:t.url||"",label:t.label||"PDF",filename:gee(t.label||"PDF"),mimeType:"application/pdf",byteSize:null,displayMode:"compact"}}),renderMarkdown:t=>{var e,r;return`[${CIt(String(((e=t.attrs)==null?void 0:e.label)||"PDF"))}](${String(((r=t.attrs)==null?void 0:r.url)||"")})`},markdownTokenizer:{name:Oy,level:"inline",start(t){return t.indexOf("[")},tokenize(t){const e=TIt.exec(t);if(!(!e||!ufe(null,e[1])&&!ufe(null,e[2])))return{type:Oy,raw:e[0],label:e[1],url:e[2]}}}}),H3="edgeeverPluginEmbed",xEe="edgeever-plugin-embed",w2=(t,e=500)=>typeof t=="string"?t.trim().slice(0,e):"",hfe=t=>{if(!t||typeof t!="object")return null;const e=t,r=w2(e.id,160),n=w2(e.pluginId,160),i=w2(e.type,120),a=w2(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:w2(e.previewResourceId,200),title:w2(e.title,500),dataJson:s}},SIt=t=>`\`\`\`${xEe} ${JSON.stringify(t)} -\`\`\``,ZLt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,QLt=ti.create({name:zk,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",mn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:zk,attrs:t.attrs}),renderMarkdown:t=>{const e=Jde(t.attrs);return e?KLt(e):""},markdownTokenizer:{name:zk,level:"block",start(t){return t.indexOf(`\`\`\`${uMe}`)},tokenize(t){const e=ZLt.exec(t);if(e)try{const r=Jde(JSON.parse(e[1]));return r?{type:zk,raw:e[0],attrs:r}:void 0}catch{return}}}}),uee="edgeeverEmptyExternalLink",efe=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},JLt=ti.create({name:uee,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{href:{default:""},title:{default:null}}},parseHTML(){return[{tag:"a[data-edgeever-empty-link]"}]},renderHTML({HTMLAttributes:t}){const e=efe(t.href);return["a",mn(t,{href:e||void 0,target:"_blank",rel:"noopener noreferrer","data-edgeever-empty-link":"true","aria-label":e?`Open link: ${e}`:"Open link",class:"edgeever-empty-external-link"}),"↗"]},renderMarkdown(t){var n,i;const e=efe((n=t.attrs)==null?void 0:n.href);if(!e)return"";const r=typeof((i=t.attrs)==null?void 0:i.title)=="string"&&t.attrs.title?` "${t.attrs.title.replaceAll('"','\\"')}"`:"";return`[](${e}${r})`}}),$D="[\0-   ᠎ -\u2029  ]",eIt=new RegExp($D),tIt=new RegExp(`${$D}$`),rIt=new RegExp(`${$D}+$`),nIt=new RegExp($D,"g");function iIt(t,e,r){var n,i;const s=t.doc.resolve(e.to);if(!(!((n=s.nodeBefore)===null||n===void 0)&&n.isText))return;const a=(i=t.doc.textBetween(e.from,e.to,"","").match(rIt))===null||i===void 0?void 0:i[0];if(!a)return;const o=e.to-a.length,l=H3(o,e.to,t.doc).filter(d=>d.mark.type===r);if(!l.length)return;const{nodeAfter:u}=s;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;const h=t.storedMarks;t.removeMark(o,e.to,r),t.setStoredMarks(h),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(r)}function sIt(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function aIt(t){return new li({key:new Mi("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(l=>l.docChanged)&&!r.doc.eq(n.doc),s=e.some(l=>l.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=n,o=mQ(r.doc,[...e]);if(!e.some(K5e)){const l=[];o.steps.forEach((u,h)=>{if(!(u instanceof ws)||!u.slice.size)return;const d=o.mapping.slice(h+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);fh.to-u.to),l.forEach(u=>iIt(a,u,t.type))}if(UA(o).forEach(({newRange:l})=>{const u=o3e(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(!tIt.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(eIt).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=OD(p).map(y=>y.toObject(t.defaultProtocol));if(!sIt(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=>{H3(y.from,y.to,n.doc).some(v=>v.mark.type===t.type)||a.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function oIt(t){return new li({key:new Mi("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 s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var a,o;const l=bQ(e.state,t.type.name),u=(a=i.href)!==null&&a!==void 0?a:l.href,h=(o=i.target)!==null&&o!==void 0?o:l.target;u&&(window.open(u,h),s=!0)}return s}}})}const lIt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,cIt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function hMe(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function uIt(t,e){let r=0,n=0;for(;n0}function dMe(t,e,r){var n,i;const[,s,a]=e;return(e.index?t[e.index-1]:void 0)==="!"||hMe(t,(n=e.index)!==null&&n!==void 0?n:0)||uIt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!s.trim()&&r(a)}function fMe(t){var e,r;const[n,i,s,,a,o,l]=t,u=(e=a??o)!==null&&e!==void 0?e:l;return{index:(r=t.index)!==null&&r!==void 0?r:0,text:n,replaceWith:i,data:{href:s,title:u||null,markdown:!0}}}function hIt(t,e){return t.index{const n=lIt.exec(r);return!n||!dMe(r,n,t.isAllowedHref)?null:fMe(n)},type:t.type,getAttributes:pMe});return new Kh({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 fIt(t){const e=Ud({find:r=>{var n,i;const s=[];for(const o of r.matchAll(cIt))dMe(r,o,t.isAllowedHref)&&s.push(fMe(o));const a=((n=(i=t.findPlainUrls)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:[]).filter(o=>!s.some(l=>hIt(l,o)));return[...s,...a]},type:t.type,getAttributes:pMe});return new YA({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 pIt(t){return new li({key:new Mi("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:a}=s,{empty:o}=a;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=DD(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 Rf(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(nIt,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const gIt=tp.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"){oI(t);return}oI(t.scheme,t.optionalSlashes)})},onDestroy(){K8e()},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)=>!!Rf(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=>!!Rf(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=>!!Rf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",mn(this.options.HTMLAttributes,t),0]:["a",mn(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,s;const a=(r=(n=t.attrs)===null||n===void 0?void 0:n.href)!==null&&r!==void 0?r:"",o=(i=(s=t.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"",l=e.renderChildren(t);return o?`[${l}](${a} "${o}")`:`[${l}](${a})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Rf(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=>!!Rf(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?[dIt({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Rf(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;DD(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Rf(a,n),protocols:n,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&r.push({text:s.value,data:{href:s.href},index:s.start})})}return r};return this.options.markdownLinks?[fIt({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Rf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Ud({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(aIt({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Rf(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(oIt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(pIt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var mIt=gIt;const yIt=mIt.extend({inclusive:!1,parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:uee,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),vIt=/^\s*\[([ xX])\] $/,bIt=({state:t,range:e,match:r})=>{var k,E;const n=((k=r[1])==null?void 0:k.toLowerCase())==="x",i=t.doc.resolve(e.from);if(i.parent.type.name!=="paragraph"||i.depth<2||i.node(-1).type.name!=="listItem"||i.node(-2).type.name!=="bulletList")return null;const s=t.schema.nodes.taskItem,a=t.schema.nodes.taskList;if(!s||!a)return null;const o=t.tr.delete(e.from,e.to),l=o.doc.resolve(e.from);if(l.parent.type.name!=="paragraph"||l.depth<2)return null;const u=l.node(-1),h=l.node(-2);if(u.type.name!=="listItem"||h.type.name!=="bulletList")return null;const d=l.depth-2,f=l.index(d),p=s.create({checked:n},u.content),g=a.create(null,p),m=[],y=[];h.forEach((A,M,R)=>{Rf&&y.push(A)});const v=[...m.length?[h.type.create(h.attrs,m)]:[],g,...y.length?[h.type.create(h.attrs,y)]:[]],b=l.before(d);o.replaceWith(b,l.after(d),v);let x=b;m.length&&(x+=((E=v[0])==null?void 0:E.nodeSize)??0);const T=x+3,C=o.steps.length,S=A=>{var R,P;if(A<=0||A>=o.doc.content.size)return;const M=o.doc.resolve(A);((R=M.nodeBefore)==null?void 0:R.type)!==a||((P=M.nodeAfter)==null?void 0:P.type)!==a||Rl(o.doc,A)&&o.join(A)};S(x+g.nodeSize),S(x),o.setSelection(yr.create(o.doc,o.mapping.slice(C).map(T)))},xIt=()=>C8e.extend({addInputRules(){var t;return[new Kh({find:vIt,handler:bIt}),...((t=this.parent)==null?void 0:t.call(this))??[]]}}).configure({nested:!0}),k6="blockMath",cI="inlineMath",wIt=Ni.create({name:"mathCodeFence",priority:101,markdownTokenName:"code",parseMarkdown:t=>{var e;return t.lang!=="math"||!((e=t.text)!=null&&e.trim())?[]:{type:k6,attrs:{latex:t.text.trim()}}}}),uI=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},l7=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!uI(t,n))return n;return-1},hee=t=>/^\d+(?:[.,]\d+)?$/u.test(t),TIt=(t,e)=>{if(t[e]!=="$"||uI(t,e)||t.startsWith("$$",e)||e>0&&t[e-1]==="$"&&!uI(t,e-1))return null;const r=l7(t,"$",e+1);if(r<0||t[r+1]==="$")return null;const n=t.slice(e+1,r).trim();return!n||n.includes(` -`)||hee(n)?null:{index:e,raw:t.slice(e,r+1),latex:n}},CIt=(t,e)=>{if(uI(t,e)||t.startsWith("$$",e))return e+1;const r=l7(t,"$",e+1);if(r<0||t[r+1]==="$")return e+1;const n=t.slice(e+1,r).trim();return n&&!n.includes(` -`)&&hee(n)?r+1:e+1},gMe=t=>{const e=[];let r=0;for(;r{const e=gMe(t).at(-1);return!e||e.index+e.raw.length!==t.length?null:e},tfe=t=>{const e=t.trim();if(!e.startsWith("$$")||e.startsWith("$$$"))return null;const r=l7(e,"$$",2);if(r<0||e.slice(r+2).trim()!=="")return null;const n=e.slice(2,r).trim();return n?{latex:n}:null},mMe={name:cI,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=l7(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 hee(n)?{type:"text",raw:r,text:r}:{type:cI,raw:r,latex:n}}},yMe={name:k6,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=l7(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:k6,raw:t.slice(0,e+2),latex:r}}},SIt=ti.create({name:cI,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",mn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:cI,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:mMe}),EIt=ti.create({name:k6,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",mn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:k6,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` -`)},markdownTokenizer:yMe}),AIt=()=>[EIt.configure(),SIt.configure()],XC=(t,e)=>t===!1?[]:[t??e],vMe=t=>[t.markdown?YF.configure({...t.starterKit,link:!1}):t.starterKit===void 0?YF:YF.configure(t.starterKit),...t.markdown?[yIt]:[],JLt,k8e,xIt(),t.table===void 0?Fde:Fde.configure(t.table),...XC(t.image,M3e),...XC(t.gallery,cMe),...XC(t.pdf,XLt),...XC(t.file,uLt),ULt,...VLt(),...XC(t.pluginEmbed,QLt),...t.mathematics,wIt,...t.markdown?[HMt.configure({markedOptions:{gfm:!0}})]:[]],dee="edgeeverUnsupportedBlock",S6="edgeeverUnsupportedInline",c7="edgeeverUnsupportedMark",E6=new Set([dee,S6]),bMe=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","details","detailsSummary","detailsContent","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider","edgeeverVideoNote",uee,"inlineMath","blockMath",...E6]),Uq=new Set(["bold","italic","strike","underline","code","link",c7]),MIt=new Set([...bMe,a0,Lb,zk]),xMe=new Set(["paragraph","heading"]),BD=t=>t.type==="text"&&"text"in t,A6=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",q5=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:e==="pl"?`Nieobsługiwana zawartość: ${t}`:`Unsupported content: ${t}`,RIt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:q5(t.type,e)}),wMe=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}},_It=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[]}},LIt=ti.create({name:dee,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=A6(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:q5(e)]}}),IIt=ti.create({name:S6,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=A6(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:q5(e)]}}),NIt=tp.create({name:c7,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]}}),OIt=()=>[LIt,IIt,NIt],DIt=t=>{const e=t.marks??[],r=e.filter(i=>Uq.has(i.type));return e.filter(i=>!Uq.has(i.type)).length?{...t,marks:[...r,{type:c7,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},PIt=(t,e)=>{const r=(n,i)=>{if(BD(n))return DIt(n);if(!bMe.has(n.type))return{type:xMe.has(i)?S6:dee,attrs:RIt(n,e)};const s=n;return E6.has(s.type)?s:s.content?{...s,content:s.content.map(a=>r(a,s.type))}:s};return{...t,content:t.content.map(n=>r(n,"doc"))}},fee=t=>{const e=r=>{var i;if(E6.has(r.type)){const s=r;return wMe(s.attrs)??{type:r.type===S6?"text":"paragraph",...r.type===S6?{text:q5(A6(s.attrs))}:{content:[{type:"text",text:q5(A6(s.attrs))}]}}}if(BD(r)){const s=r,a=(i=s.marks)==null?void 0:i.find(l=>l.type===c7),o=a?_It(a.attrs):s.marks??[];return o.length?{...s,marks:o}:{type:"text",text:s.text}}const n=r;return n.content?{...n,content:n.content.map(e)}:n};return{...t,content:t.content.map(r=>e(r))}},TMe=t=>{var e;return BD(t)?t.text:((e=t.content)==null?void 0:e.map(TMe).filter(Boolean).join(" "))??""},$It=t=>{const e=(r,n)=>{var s;if(BD(r)){const a=r;return{...a,marks:(s=a.marks)==null?void 0:s.filter(o=>Uq.has(o.type)&&o.type!==c7)}}if(!MIt.has(r.type)||E6.has(r.type)){const a=r,o=E6.has(r.type)?wMe(a.attrs):a,l=(o==null?void 0:o.type)??A6(a.attrs),h=(o?TMe(o):"")||q5(l);return xMe.has(n)?{type:"text",text:h}:{type:"paragraph",content:[{type:"text",text:h}]}}const i=r;return i.content?{...i,content:i.content.map(a=>e(a,i.type))}:i};return{...t,content:t.content.map(r=>e(r,"doc"))}},pee=Symbol.for("yaml.alias"),BIt=Symbol.for("yaml.document"),Ay=Symbol.for("yaml.map"),CMe=Symbol.for("yaml.pair"),gee=Symbol.for("yaml.scalar"),u7=Symbol.for("yaml.seq"),lf=Symbol.for("yaml.node.type"),Mv=t=>!!t&&typeof t=="object"&&t[lf]===pee,FD=t=>!!t&&typeof t=="object"&&t[lf]===BIt,kMe=t=>!!t&&typeof t=="object"&&t[lf]===Ay,Do=t=>!!t&&typeof t=="object"&&t[lf]===CMe,$a=t=>!!t&&typeof t=="object"&&t[lf]===gee,mee=t=>!!t&&typeof t=="object"&&t[lf]===u7;function Wc(t){if(t&&typeof t=="object")switch(t[lf]){case Ay:case u7:return!0}return!1}function Zo(t){if(t&&typeof t=="object")switch(t[lf]){case pee:case Ay:case gee:case u7:return!0}return!1}const SMe=t=>($a(t)||Wc(t))&&!!t.anchor,v1=Symbol("break visit"),FIt=Symbol("skip children"),XS=Symbol("remove node");function zD(t,e){const r=zIt(e);FD(t)?Ib(null,t.contents,r,Object.freeze([t]))===XS&&(t.contents=null):Ib(null,t,r,Object.freeze([]))}zD.BREAK=v1;zD.SKIP=FIt;zD.REMOVE=XS;function Ib(t,e,r,n){const i=VIt(t,e,r,n);if(Zo(i)||Do(i))return HIt(t,n,i),Ib(t,i,r,n);if(typeof i!="symbol"){if(Wc(e)){n=Object.freeze(n.concat(e));for(let s=0;s_h(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!SMe(t))return t.toJSON(e,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};const i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!(r!=null&&r.keep)?Number(t):t}class yee{constructor(e){Object.defineProperty(this,lf,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!FD(e))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=_h(this,"",a);if(typeof i=="function")for(const{count:l,res:u}of a.anchors.values())i(u,l);return typeof s=="function"?Vk(s,{"":o},"",o):o}}class GIt extends yee{constructor(e){super(pee),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r!=null&&r.aliasResolveCache?n=r.aliasResolveCache:(n=[],zD(e,{Node:(s,a)=>{(Mv(a)||SMe(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(const s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(a);if(o||(_h(a,null,r),o=n.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=qR(i,a,n)),o.count*o.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,r,n){const i=`*${this.source}`;if(e){if(EMe(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}}function qR(t,e,r){if(Mv(e)){const n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Wc(e)){let n=0;for(const i of e.items){const s=qR(t,i,r);s>n&&(n=s)}return n}else if(Do(e)){const n=qR(t,e.key,r),i=qR(t,e.value,r);return Math.max(n,i)}return 1}const AMe=t=>!t||typeof t!="function"&&typeof t!="object";class Fs extends yee{constructor(e){super(gee),this.value=e}toJSON(e,r){return r!=null&&r.keep?this.value:_h(this.value,e,r)}toString(){return String(this.value)}}Fs.BLOCK_FOLDED="BLOCK_FOLDED";Fs.BLOCK_LITERAL="BLOCK_LITERAL";Fs.PLAIN="PLAIN";Fs.QUOTE_DOUBLE="QUOTE_DOUBLE";Fs.QUOTE_SINGLE="QUOTE_SINGLE";function WIt(t,e,r){return r.find(n=>{var i;return((i=n.identify)==null?void 0:i.call(n,t))&&!n.format})}function hI(t,e,r){var d,f,p;if(FD(t)&&(t=t.contents),Zo(t))return t;if(Do(t)){const g=(f=(d=r.schema[Ay]).createNode)==null?void 0:f.call(d,r.schema,null,r);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=r;let l;if(n&&t&&typeof t=="object"){if(l=o.get(t),l)return l.anchor??(l.anchor=i(t)),new GIt(l.anchor);l={anchor:null,node:null},o.set(t,l)}let u=WIt(t,e,a.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const g=new Fs(t);return l&&(l.node=g),g}u=t instanceof Map?a[Ay]:Symbol.iterator in Object(t)?a[u7]:a[Ay]}s&&(s(u),delete r.onTagObj);const h=u!=null&&u.createNode?u.createNode(r.schema,t,r):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(r.schema,t,r):new Fs(t);return u.default||(h.tag=u.tag),l&&(l.node=h),h}function rfe(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return hI(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const qIt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let MMe=class extends yee{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Zo(n)||Do(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(qIt(e))this.add(r);else{const[n,...i]=e,s=this.get(n,!0);if(Wc(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,rfe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[r,...n]=e;if(n.length===0)return this.delete(r);const i=this.get(r,!0);if(Wc(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){const[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&$a(s)?s.value:s:Wc(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Do(r))return!1;const n=r.value;return n==null||e&&$a(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[r,...n]=e;if(n.length===0)return this.has(r);const i=this.get(r,!0);return Wc(i)?i.hasIn(n):!1}setIn(e,r){const[n,...i]=e;if(i.length===0)this.set(n,r);else{const s=this.get(n,!0);if(Wc(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,rfe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};const UIt=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function M6(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Nb=(t,e,r)=>t.endsWith(` -`)?M6(r,e):r.includes(` +\`\`\``,EIt=/^```edgeever-plugin-embed[ \t]*\n([^\n]+)\n```(?:\n|$)/,AIt=ri.create({name:H3,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",yn(t,{"data-type":"edgeever-plugin-embed",class:"edgeever-plugin-embed",contenteditable:"false"}),["figcaption",{},e]]},parseMarkdown:t=>({type:H3,attrs:t.attrs}),renderMarkdown:t=>{const e=hfe(t.attrs);return e?SIt(e):""},markdownTokenizer:{name:H3,level:"block",start(t){return t.indexOf(`\`\`\`${xEe}`)},tokenize(t){const e=EIt.exec(t);if(e)try{const r=hfe(JSON.parse(e[1]));return r?{type:H3,raw:e[0],attrs:r}:void 0}catch{return}}}}),Uee="edgeeverEmptyExternalLink",dfe=t=>{if(typeof t!="string")return"";const e=t.trim();return/^(?:https?:\/\/|\/|#)/i.test(e)?e:""},MIt=ri.create({name:Uee,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{href:{default:""},title:{default:null}}},parseHTML(){return[{tag:"a[data-edgeever-empty-link]"}]},renderHTML({HTMLAttributes:t}){const e=dfe(t.href);return["a",yn(t,{href:e||void 0,target:"_blank",rel:"noopener noreferrer","data-edgeever-empty-link":"true","aria-label":e?`Open link: ${e}`:"Open link",class:"edgeever-empty-external-link"}),"↗"]},renderMarkdown(t){var n,i;const e=dfe((n=t.attrs)==null?void 0:n.href);if(!e)return"";const r=typeof((i=t.attrs)==null?void 0:i.title)=="string"&&t.attrs.title?` "${t.attrs.title.replaceAll('"','\\"')}"`:"";return`[](${e}${r})`}}),FO="[\0-   ᠎ -\u2029  ]",RIt=new RegExp(FO),LIt=new RegExp(`${FO}$`),IIt=new RegExp(`${FO}+$`),NIt=new RegExp(FO,"g");function DIt(t,e,r){var n,i;const a=t.doc.resolve(e.to);if(!(!((n=a.nodeBefore)===null||n===void 0)&&n.isText))return;const s=(i=t.doc.textBetween(e.from,e.to,"","").match(IIt))===null||i===void 0?void 0:i[0];if(!s)return;const o=e.to-s.length,l=W4(o,e.to,t.doc).filter(d=>d.mark.type===r);if(!l.length)return;const{nodeAfter:u}=a;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;const h=t.storedMarks;t.removeMark(o,e.to,r),t.setStoredMarks(h),t.selection.empty&&t.selection.from===e.to&&t.removeStoredMark(r)}function OIt(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function _It(t){return new ci({key:new Mi("autolink"),appendTransaction:(e,r,n)=>{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=TJ(r.doc,[...e]);if(!e.some(s4e)){const l=[];o.steps.forEach((u,h)=>{if(!(u instanceof va)||!u.slice.size)return;const d=o.mapping.slice(h+1),f=d.map(u.from,1),p=d.map(u.from+u.slice.size,-1);fh.to-u.to),l.forEach(u=>DIt(s,u,t.type))}if(KC(o).forEach(({newRange:l})=>{const u=U4e(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(!LIt.test(f))return;h=u[0],d=n.doc.textBetween(h.pos,l.to,void 0," ")}if(h&&d){const f=d.split(RIt).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=PO(p).map(U=>U.toObject(t.defaultProtocol));if(!OIt(m))return!1;m.filter(U=>U.isLink).map(U=>({...U,from:g+U.start+1,to:g+U.end+1})).filter(U=>n.schema.marks.code?!n.doc.rangeHasMark(U.from,U.to,n.schema.marks.code):!0).filter(U=>t.validate(U.value)).filter(U=>t.shouldAutoLink(U.value)).forEach(U=>{W4(U.from,U.to,n.doc).some(y=>y.mark.type===t.type)||s.addMark(U.from,U.to,t.type.create({href:U.href}))})}}),!!s.steps.length)return s}})}function PIt(t){return new ci({key:new Mi("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=SJ(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 BIt=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,$It=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function wEe(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function FIt(t,e){let r=0,n=0;for(;n0}function TEe(t,e,r){var n,i;const[,a,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||wEe(t,(n=e.index)!==null&&n!==void 0?n:0)||FIt(t,(i=e.index)!==null&&i!==void 0?i:0)?!1:!!a.trim()&&r(s)}function CEe(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 zIt(t,e){return t.index{const n=BIt.exec(r);return!n||!TEe(r,n,t.isAllowedHref)?null:CEe(n)},type:t.type,getAttributes:kEe});return new Kh({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 HIt(t){const e=jd({find:r=>{var n,i;const a=[];for(const o of r.matchAll($It))TEe(r,o,t.isAllowedHref)&&a.push(CEe(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=>zIt(l,o)));return[...a,...s]},type:t.type,getAttributes:kEe});return new JC({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 GIt(t){return new ci({key:new Mi("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=BO(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 Rf(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(NIt,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const WIt=rp.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"){hI(t);return}hI(t.scheme,t.optionalSlashes)})},onDestroy(){oEe()},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)=>!!Rf(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=>!!Rf(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=>!!Rf(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",yn(this.options.HTMLAttributes,t),0]:["a",yn(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=>!!Rf(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=>!!Rf(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?[VIt({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Rf(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;BO(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:s=>!!Rf(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?[HIt({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Rf(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[jd({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(_It({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Rf(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(PIt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(GIt({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}});var qIt=WIt;function jIt(t){if(/^[a-z][a-z\d+.-]*:/i.test(t)||t.includes("@"))return 0;const r=t.split(".",1)[0].match(/^.*[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}](?=[a-z\d-]+$)/u);return(r==null?void 0:r[0].length)??0}const YIt=qIt.extend({inclusive:!1,addPasteRules(){var e;const t=((e=this.parent)==null?void 0:e.call(this))??[];for(const r of t){const n=r.find;typeof n=="function"&&(r.find=(i,a)=>(n(i,a)??[]).flatMap(s=>{if(s.replaceWith!==void 0)return[s];const o=jIt(s.text);return o?(n(s.text.slice(o),a)??[]).map(l=>({...l,index:s.index+o+l.index})):[s]}))}return t},parseMarkdown(t,e){var r;return!((r=t.tokens)!=null&&r.length)&&t.text===""&&typeof t.href=="string"&&t.href?{type:Uee,attrs:{href:t.href,title:t.title||null}}:e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})}}),XIt=/^\s*\[([ xX])\] $/,KIt=({state:t,range:e,match:r})=>{var C,S;const n=((C=r[1])==null?void 0:C.toLowerCase())==="x",i=t.doc.resolve(e.from);if(i.parent.type.name!=="paragraph"||i.depth<2||i.node(-1).type.name!=="listItem"||i.node(-2).type.name!=="bulletList")return null;const a=t.schema.nodes.taskItem,s=t.schema.nodes.taskList;if(!a||!s)return null;const o=t.tr.delete(e.from,e.to),l=o.doc.resolve(e.from);if(l.parent.type.name!=="paragraph"||l.depth<2)return null;const u=l.node(-1),h=l.node(-2);if(u.type.name!=="listItem"||h.type.name!=="bulletList")return null;const d=l.depth-2,f=l.index(d),p=a.create({checked:n},u.content),g=s.create(null,p),m=[],U=[];h.forEach((E,A,R)=>{Rf&&U.push(E)});const y=[...m.length?[h.type.create(h.attrs,m)]:[],g,...U.length?[h.type.create(h.attrs,U)]:[]],b=l.before(d);o.replaceWith(b,l.after(d),y);let v=b;m.length&&(v+=((S=y[0])==null?void 0:S.nodeSize)??0);const w=v+3,T=o.steps.length,k=E=>{var R,_;if(E<=0||E>=o.doc.content.size)return;const A=o.doc.resolve(E);((R=A.nodeBefore)==null?void 0:R.type)!==s||((_=A.nodeAfter)==null?void 0:_.type)!==s||Ml(o.doc,E)&&o.join(E)};k(v+g.nodeSize),k(v),o.setSelection(yr.create(o.doc,o.mapping.slice(T).map(w)))},ZIt=()=>NSe.extend({addInputRules(){var t;return[new Kh({find:XIt,handler:KIt}),...((t=this.parent)==null?void 0:t.call(this))??[]]}}).configure({nested:!0}),AT="blockMath",fI="inlineMath",JIt=Di.create({name:"mathCodeFence",priority:101,markdownTokenName:"code",parseMarkdown:t=>{var e;return t.lang!=="math"||!((e=t.text)!=null&&e.trim())?[]:{type:AT,attrs:{latex:t.text.trim()}}}}),pI=(t,e)=>{let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1},dk=(t,e,r)=>{for(let n=r;n<=t.length-e.length;n+=1)if(t.startsWith(e,n)&&!pI(t,n))return n;return-1},yee=t=>/^\d+(?:[.,]\d+)?$/u.test(t),QIt=(t,e)=>{if(t[e]!=="$"||pI(t,e)||t.startsWith("$$",e)||e>0&&t[e-1]==="$"&&!pI(t,e-1))return null;const r=dk(t,"$",e+1);if(r<0||t[r+1]==="$")return null;const n=t.slice(e+1,r).trim();return!n||n.includes(` +`)||yee(n)?null:{index:e,raw:t.slice(e,r+1),latex:n}},eNt=(t,e)=>{if(pI(t,e)||t.startsWith("$$",e))return e+1;const r=dk(t,"$",e+1);if(r<0||t[r+1]==="$")return e+1;const n=t.slice(e+1,r).trim();return n&&!n.includes(` +`)&&yee(n)?r+1:e+1},SEe=t=>{const e=[];let r=0;for(;r{const e=SEe(t).at(-1);return!e||e.index+e.raw.length!==t.length?null:e},ffe=t=>{const e=t.trim();if(!e.startsWith("$$")||e.startsWith("$$$"))return null;const r=dk(e,"$$",2);if(r<0||e.slice(r+2).trim()!=="")return null;const n=e.slice(2,r).trim();return n?{latex:n}:null},EEe={name:fI,level:"inline",start:t=>t.indexOf("$"),tokenize:t=>{if(!t.startsWith("$")||t.startsWith("$$"))return;const e=dk(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 yee(n)?{type:"text",raw:r,text:r}:{type:fI,raw:r,latex:n}}},AEe={name:AT,level:"block",start:t=>t.indexOf("$$"),tokenize:t=>{if(!t.startsWith("$$")||t.startsWith("$$$"))return;const e=dk(t,"$$",2);if(e<0)return;const r=t.slice(2,e).trim();if(r)return{type:AT,raw:t.slice(0,e+2),latex:r}}},rNt=ri.create({name:fI,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",yn(t,{"data-type":"inline-math"})]},parseMarkdown:t=>({type:fI,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return`$${((e=t.attrs)==null?void 0:e.latex)||""}$`},markdownTokenizer:EEe}),nNt=ri.create({name:AT,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",yn(t,{"data-type":"block-math"})]},parseMarkdown:t=>({type:AT,attrs:{latex:t.latex}}),renderMarkdown:t=>{var e;return["$$",((e=t.attrs)==null?void 0:e.latex)||"","$$"].join(` +`)},markdownTokenizer:AEe}),iNt=()=>[nNt.configure(),rNt.configure()],J9=(t,e)=>t===!1?[]:[t??e],MEe=t=>[t.markdown?Q$.configure({...t.starterKit,link:!1}):t.starterKit===void 0?Q$:Q$.configure(t.starterKit),...t.markdown?[YIt]:[],MIt,DSe,ZIt(),t.table===void 0?Zde:Zde.configure(t.table),...J9(t.image,B4e),...J9(t.gallery,vEe),...J9(t.pdf,kIt),...J9(t.file,FLt),wIt,...UIt(),...J9(t.pluginEmbed,AIt),...t.mathematics,JIt,...t.markdown?[UAt.configure({markedOptions:{gfm:!0}})]:[]],bee="edgeeverUnsupportedBlock",MT="edgeeverUnsupportedInline",fk="edgeeverUnsupportedMark",RT=new Set([bee,MT]),REe=new Set(["doc","text","paragraph","heading","blockquote","bulletList","orderedList","listItem","taskList","taskItem","codeBlock","hardBreak","horizontalRule","image","details","detailsSummary","detailsContent","edgeeverImageGallery","table","tableRow","tableHeader","tableCell","edgeeverMergeDivider","edgeeverVideoNote",Uee,"inlineMath","blockMath",...RT]),QW=new Set(["bold","italic","strike","underline","code","link",fk]),aNt=new Set([...REe,o0,Oy,H3]),LEe=new Set(["paragraph","heading"]),zO=t=>t.type==="text"&&"text"in t,LT=t=>typeof(t==null?void 0:t.originalType)=="string"?t.originalType:"unknown",Xv=(t,e)=>e==="zh-CN"?`暂不支持的内容:${t}`:e==="ja"?`未対応のコンテンツ: ${t}`:e==="pl"?`Nieobsługiwana zawartość: ${t}`:`Unsupported content: ${t}`,sNt=(t,e)=>({originalType:t.type,originalJson:JSON.stringify(t),displayLabel:Xv(t.type,e)}),IEe=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}},oNt=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[]}},lNt=ri.create({name:bee,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=LT(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:Xv(e)]}}),cNt=ri.create({name:MT,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=LT(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:Xv(e)]}}),uNt=rp.create({name:fk,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]}}),hNt=()=>[lNt,cNt,uNt],dNt=t=>{const e=t.marks??[],r=e.filter(i=>QW.has(i.type));return e.filter(i=>!QW.has(i.type)).length?{...t,marks:[...r,{type:fk,attrs:{originalMarksJson:JSON.stringify(e)}}]}:t},fNt=(t,e)=>{const r=(n,i)=>{if(zO(n))return dNt(n);if(!REe.has(n.type))return{type:LEe.has(i)?MT:bee,attrs:sNt(n,e)};const a=n;return RT.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"))}},vee=t=>{const e=r=>{var i;if(RT.has(r.type)){const a=r;return IEe(a.attrs)??{type:r.type===MT?"text":"paragraph",...r.type===MT?{text:Xv(LT(a.attrs))}:{content:[{type:"text",text:Xv(LT(a.attrs))}]}}}if(zO(r)){const a=r,s=(i=a.marks)==null?void 0:i.find(l=>l.type===fk),o=s?oNt(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))}},NEe=t=>{var e;return zO(t)?t.text:((e=t.content)==null?void 0:e.map(NEe).filter(Boolean).join(" "))??""},pNt=t=>{const e=(r,n)=>{var a;if(zO(r)){const s=r;return{...s,marks:(a=s.marks)==null?void 0:a.filter(o=>QW.has(o.type)&&o.type!==fk)}}if(!aNt.has(r.type)||RT.has(r.type)){const s=r,o=RT.has(r.type)?IEe(s.attrs):s,l=(o==null?void 0:o.type)??LT(s.attrs),h=(o?NEe(o):"")||Xv(l);return LEe.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"))}},xee=Symbol.for("yaml.alias"),gNt=Symbol.for("yaml.document"),RU=Symbol.for("yaml.map"),DEe=Symbol.for("yaml.pair"),wee=Symbol.for("yaml.scalar"),pk=Symbol.for("yaml.seq"),cf=Symbol.for("yaml.node.type"),L5=t=>!!t&&typeof t=="object"&&t[cf]===xee,VO=t=>!!t&&typeof t=="object"&&t[cf]===gNt,OEe=t=>!!t&&typeof t=="object"&&t[cf]===RU,Oo=t=>!!t&&typeof t=="object"&&t[cf]===DEe,Ps=t=>!!t&&typeof t=="object"&&t[cf]===wee,Tee=t=>!!t&&typeof t=="object"&&t[cf]===pk;function Gc(t){if(t&&typeof t=="object")switch(t[cf]){case RU:case pk:return!0}return!1}function Zo(t){if(t&&typeof t=="object")switch(t[cf]){case xee:case RU:case wee:case pk:return!0}return!1}const _Ee=t=>(Ps(t)||Gc(t))&&!!t.anchor,xm=Symbol("break visit"),mNt=Symbol("skip children"),Qx=Symbol("remove node");function HO(t,e){const r=UNt(e);VO(t)?_y(null,t.contents,r,Object.freeze([t]))===Qx&&(t.contents=null):_y(null,t,r,Object.freeze([]))}HO.BREAK=xm;HO.SKIP=mNt;HO.REMOVE=Qx;function _y(t,e,r,n){const i=yNt(t,e,r,n);if(Zo(i)||Oo(i))return bNt(t,n,i),_y(t,i,r,n);if(typeof i!="symbol"){if(Gc(e)){n=Object.freeze(n.concat(e));for(let a=0;aRh(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!_Ee(t))return t.toJSON(e,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=a=>{n.res=a,delete r.onCreate};const i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!(r!=null&&r.keep)?Number(t):t}class Cee{constructor(e){Object.defineProperty(this,cf,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:a}={}){if(!VO(e))throw new TypeError("A document argument is required");const s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=Rh(this,"",s);if(typeof i=="function")for(const{count:l,res:u}of s.anchors.values())i(u,l);return typeof a=="function"?G3(a,{"":o},"",o):o}}class vNt extends Cee{constructor(e){super(xee),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r!=null&&r.aliasResolveCache?n=r.aliasResolveCache:(n=[],HO(e,{Node:(a,s)=>{(L5(s)||_Ee(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(const a of n){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(e,r){if(!r)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:a}=r,s=this.resolve(i,r);if(!s){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(s);if(o||(Rh(s,null,r),o=n.get(s)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=YA(i,s,n)),o.count*o.aliasCount>a)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,r,n){const i=`*${this.source}`;if(e){if(PEe(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${i} `}return i}}function YA(t,e,r){if(L5(e)){const n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Gc(e)){let n=0;for(const i of e.items){const a=YA(t,i,r);a>n&&(n=a)}return n}else if(Oo(e)){const n=YA(t,e.key,r),i=YA(t,e.value,r);return Math.max(n,i)}return 1}const BEe=t=>!t||typeof t!="function"&&typeof t!="object";class Ba extends Cee{constructor(e){super(wee),this.value=e}toJSON(e,r){return r!=null&&r.keep?this.value:Rh(this.value,e,r)}toString(){return String(this.value)}}Ba.BLOCK_FOLDED="BLOCK_FOLDED";Ba.BLOCK_LITERAL="BLOCK_LITERAL";Ba.PLAIN="PLAIN";Ba.QUOTE_DOUBLE="QUOTE_DOUBLE";Ba.QUOTE_SINGLE="QUOTE_SINGLE";function xNt(t,e,r){return r.find(n=>{var i;return((i=n.identify)==null?void 0:i.call(n,t))&&!n.format})}function gI(t,e,r){var d,f,p;if(VO(t)&&(t=t.contents),Zo(t))return t;if(Oo(t)){const g=(f=(d=r.schema[RU]).createNode)==null?void 0:f.call(d,r.schema,null,r);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:a,schema:s,sourceObjects:o}=r;let l;if(n&&t&&typeof t=="object"){if(l=o.get(t),l)return l.anchor??(l.anchor=i(t)),new vNt(l.anchor);l={anchor:null,node:null},o.set(t,l)}let u=xNt(t,e,s.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const g=new Ba(t);return l&&(l.node=g),g}u=t instanceof Map?s[RU]:Symbol.iterator in Object(t)?s[pk]:s[RU]}a&&(a(u),delete r.onTagObj);const h=u!=null&&u.createNode?u.createNode(r.schema,t,r):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(r.schema,t,r):new Ba(t);return u.default||(h.tag=u.tag),l&&(l.node=h),h}function pfe(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){const a=e[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const s=[];s[a]=n,n=s}else n=new Map([[a,n]])}return gI(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const wNt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let $Ee=class extends Cee{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Zo(n)||Oo(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(wNt(e))this.add(r);else{const[n,...i]=e,a=this.get(n,!0);if(Gc(a))a.addIn(i,r);else if(a===void 0&&this.schema)this.set(n,pfe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[r,...n]=e;if(n.length===0)return this.delete(r);const i=this.get(r,!0);if(Gc(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){const[n,...i]=e,a=this.get(n,!0);return i.length===0?!r&&Ps(a)?a.value:a:Gc(a)?a.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Oo(r))return!1;const n=r.value;return n==null||e&&Ps(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[r,...n]=e;if(n.length===0)return this.has(r);const i=this.get(r,!0);return Gc(i)?i.hasIn(n):!1}setIn(e,r){const[n,...i]=e;if(i.length===0)this.set(n,r);else{const a=this.get(n,!0);if(Gc(a))a.setIn(i,r);else if(a===void 0&&this.schema)this.set(n,pfe(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};const TNt=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function IT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Py=(t,e,r)=>t.endsWith(` +`)?IT(r,e):r.includes(` `)?` -`+M6(r,e):(t.endsWith(" ")?"":" ")+r,RMe="flow",jq="block",UR="quoted";function VD(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return t;ii-Math.max(2,s)?u.push(0):d=i-n);let f,p,g=!1,m=-1,y=-1,v=-1;r===jq&&(m=nfe(t,m,e.length),m!==-1&&(d=m+l));for(let x;x=t[m+=1];){if(r===UR&&x==="\\"){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if(x===` -`)r===jq&&(m=nfe(t,m,e.length)),d=m+e.length+l,f=void 0;else{if(x===" "&&p&&p!==" "&&p!==` -`&&p!==" "){const T=t[m+1];T&&T!==" "&&T!==` -`&&T!==" "&&(f=m)}if(m>=d)if(f)u.push(f),d=f+l,f=void 0;else if(r===UR){for(;p===" "||p===" ";)p=x,x=t[m+=1],g=!0;const T=m>v+1?m-2:y-1;if(h[T])return t;u.push(T),h[T]=!0,d=T+l,f=void 0}else g=!0}p=x}if(g&&o&&o(),u.length===0)return t;a&&a();let b=t.slice(0,u[0]);for(let x=0;x({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),GD=t=>/^(%|---|\.\.\.)/m.test(t);function jIt(t,e,r){if(!e||e<0)return!1;const n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;sn)return!0;if(a=s+1,i-a<=n)return!1}return!0}function KS(t,e){const r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(GD(t)?" ":"");let a="",o=0;for(let l=0,u=r[l];u;u=r[++l])if(u===" "&&r[l+1]==="\\"&&r[l+2]==="n"&&(a+=r.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(r[l+1]){case"u":{a+=r.slice(o,l);const h=r.substr(l+2,4);switch(h){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:h.substr(0,2)==="00"?a+="\\x"+h.substr(2):a+=r.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||r[l+2]==='"'||r.lengthi-Math.max(2,a)?u.push(0):d=i-n);let f,p,g=!1,m=-1,U=-1,y=-1;r===eq&&(m=gfe(t,m,e.length),m!==-1&&(d=m+l));for(let v;v=t[m+=1];){if(r===XA&&v==="\\"){switch(U=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(v===` +`)r===eq&&(m=gfe(t,m,e.length)),d=m+e.length+l,f=void 0;else{if(v===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const w=t[m+1];w&&w!==" "&&w!==` +`&&w!==" "&&(f=m)}if(m>=d)if(f)u.push(f),d=f+l,f=void 0;else if(r===XA){for(;p===" "||p===" ";)p=v,v=t[m+=1],g=!0;const w=m>y+1?m-2:U-1;if(h[w])return t;u.push(w),h[w]=!0,d=w+l,f=void 0}else g=!0}p=v}if(g&&o&&o(),u.length===0)return t;s&&s();let b=t.slice(0,u[0]);for(let v=0;v({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),qO=t=>/^(%|---|\.\.\.)/m.test(t);function CNt(t,e,r){if(!e||e<0)return!1;const n=e-r,i=t.length;if(i<=n)return!1;for(let a=0,s=0;an)return!0;if(s=a+1,i-s<=n)return!1}return!0}function ew(t,e){const r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(qO(t)?" ":"");let s="",o=0;for(let l=0,u=r[l];u;u=r[++l])if(u===" "&&r[l+1]==="\\"&&r[l+2]==="n"&&(s+=r.slice(o,l)+"\\ ",l+=1,o=l,u="\\"),u==="\\")switch(r[l+1]){case"u":{s+=r.slice(o,l);const h=r.substr(l+2,4);switch(h){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:h.substr(0,2)==="00"?s+="\\x"+h.substr(2):s+=r.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||r[l+2]==='"'||r.length -`;let d,f;for(f=r.length;f>0;--f){const C=r[f-1];if(C!==` -`&&C!==" "&&C!==" ")break}let p=r.substring(f);const g=p.indexOf(` -`);g===-1?d="-":r===p||g!==p.length-1?(d="+",s&&s()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(Xq,`$&${u}`));let m=!1,y,v=-1;for(y=0;y{S=!0});const E=VD(`${b}${C}${p}`,u,jq,k);if(!S)return`>${T} -${u}${E}`}return r=r.replace(/\n+/g,`$&${u}`),`|${T} -${u}${b}${r}${p}`}function YIt(t,e,r,n){const{type:i,value:s}=t,{actualString:a,implicitKey:o,indent:l,indentStep:u,inFlow:h}=e;if(o&&s.includes(` -`)||h&&/[[\]{},]/.test(s))return Ob(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||h||!s.includes(` -`)?Ob(s,e):jR(t,e,r,n);if(!o&&!h&&i!==Fs.PLAIN&&s.includes(` -`))return jR(t,e,r,n);if(GD(s)){if(l==="")return e.forceBlockIndent=!0,jR(t,e,r,n);if(o&&l===u)return Ob(s,e)}const d=s.replace(/\n+/g,`$& -${l}`);if(a){const f=m=>{var y;return m.default&&m.tag!=="tag:yaml.org,2002:str"&&((y=m.test)==null?void 0:y.test(d))},{compat:p,tags:g}=e.doc.schema;if(g.some(f)||p!=null&&p.some(f))return Ob(s,e)}return o?d:VD(d,l,RMe,HD(e,!1))}function XIt(t,e,r,n){const{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:o}=t;o!==Fs.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Fs.QUOTE_DOUBLE);const l=h=>{switch(h){case Fs.BLOCK_FOLDED:case Fs.BLOCK_LITERAL:return i||s?Ob(a.value,e):jR(a,e,r,n);case Fs.QUOTE_DOUBLE:return KS(a.value,e);case Fs.QUOTE_SINGLE:return Yq(a.value,e);case Fs.PLAIN:return YIt(a,e,r,n);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:h,defaultStringType:d}=e.options,f=i&&h||d;if(u=l(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function KIt(t,e){const r=Object.assign({blockQuote:!0,commentString:UIt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function ZIt(t,e){var i;if(e.tag){const s=t.filter(a=>a.tag===e.tag);if(s.length>0)return s.find(a=>a.format===e.format)??s[0]}let r,n;if($a(e)){n=e.value;let s=t.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,n)});if(s.length>1){const a=s.filter(o=>o.test);a.length>0&&(s=a)}r=s.find(a=>a.format===e.format)??s.find(a=>!a.format)}else n=e,r=t.find(s=>s.nodeClass&&n instanceof s.nodeClass);if(!r){const s=((i=n==null?void 0:n.constructor)==null?void 0:i.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${s} value`)}return r}function QIt(t,e,{anchors:r,doc:n}){if(!n.directives)return"";const i=[],s=($a(t)||Wc(t))&&t.anchor;s&&EMe(s)&&(r.add(s),i.push(`&${s}`));const a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function dI(t,e,r,n){var l;if(Do(t))return t.toString(e,r,n);if(Mv(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const s=Zo(t)?t:e.doc.createNode(t,{onTagObj:u=>i=u});i??(i=ZIt(e.doc.schema.tags,s));const a=QIt(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const o=typeof i.stringify=="function"?i.stringify(s,e,r,n):$a(s)?XIt(s,e,r,n):s.toString(e,r,n);return a?$a(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} -${e.indent}${o}`:o}function JIt({key:t,value:e},r,n,i){const{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:u,indentSeq:h,simpleKeys:d}}=r;let f=Zo(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Wc(t)||!Zo(t)&&typeof t=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Wc(t)||($a(t)?t.type===Fs.BLOCK_FOLDED||t.type===Fs.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!s),indent:o+l});let g=!1,m=!1,y=dI(t,r,()=>g=!0,()=>m=!0);if(!p&&!r.inFlow&&y.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(s||e==null)return g&&n&&n(),y===""?"?":p?`? ${y}`:y}else if(s&&!d||e==null&&p)return y=`? ${y}`,f&&!g?y+=Nb(y,r.indent,u(f)):m&&i&&i(),y;g&&(f=null),p?(f&&(y+=Nb(y,r.indent,u(f))),y=`? ${y} -${o}:`):(y=`${y}:`,f&&(y+=Nb(y,r.indent,u(f))));let v,b,x;Zo(e)?(v=!!e.spaceBefore,b=e.commentBefore,x=e.comment):(v=!1,b=null,x=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!p&&!f&&$a(e)&&(r.indentAtStart=y.length+1),m=!1,!h&&l.length>=2&&!r.inFlow&&!p&&mee(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1;const C=dI(e,r,()=>T=!0,()=>m=!0);let S=" ";if(f||v||b){if(S=v?` -`:"",b){const k=u(b);S+=` -${M6(k,r.indent)}`}C===""&&!r.inFlow?S===` -`&&x&&(S=` +`;let d,f;for(f=r.length;f>0;--f){const T=r[f-1];if(T!==` +`&&T!==" "&&T!==" ")break}let p=r.substring(f);const g=p.indexOf(` +`);g===-1?d="-":r===p||g!==p.length-1?(d="+",a&&a()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` +`&&(p=p.slice(0,-1)),p=p.replace(rq,`$&${u}`));let m=!1,U,y=-1;for(U=0;U{k=!0});const S=GO(`${b}${T}${p}`,u,eq,C);if(!k)return`>${w} +${u}${S}`}return r=r.replace(/\n+/g,`$&${u}`),`|${w} +${u}${b}${r}${p}`}function kNt(t,e,r,n){const{type:i,value:a}=t,{actualString:s,implicitKey:o,indent:l,indentStep:u,inFlow:h}=e;if(o&&a.includes(` +`)||h&&/[[\]{},]/.test(a))return By(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return o||h||!a.includes(` +`)?By(a,e):KA(t,e,r,n);if(!o&&!h&&i!==Ba.PLAIN&&a.includes(` +`))return KA(t,e,r,n);if(qO(a)){if(l==="")return e.forceBlockIndent=!0,KA(t,e,r,n);if(o&&l===u)return By(a,e)}const d=a.replace(/\n+/g,`$& +${l}`);if(s){const f=m=>{var U;return m.default&&m.tag!=="tag:yaml.org,2002:str"&&((U=m.test)==null?void 0:U.test(d))},{compat:p,tags:g}=e.doc.schema;if(g.some(f)||p!=null&&p.some(f))return By(a,e)}return o?d:GO(d,l,FEe,WO(e,!1))}function SNt(t,e,r,n){const{implicitKey:i,inFlow:a}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:o}=t;o!==Ba.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(o=Ba.QUOTE_DOUBLE);const l=h=>{switch(h){case Ba.BLOCK_FOLDED:case Ba.BLOCK_LITERAL:return i||a?By(s.value,e):KA(s,e,r,n);case Ba.QUOTE_DOUBLE:return ew(s.value,e);case Ba.QUOTE_SINGLE:return tq(s.value,e);case Ba.PLAIN:return kNt(s,e,r,n);default:return null}};let u=l(o);if(u===null){const{defaultKeyType:h,defaultStringType:d}=e.options,f=i&&h||d;if(u=l(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function ENt(t,e){const r=Object.assign({blockQuote:!0,commentString:TNt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function ANt(t,e){var i;if(e.tag){const a=t.filter(s=>s.tag===e.tag);if(a.length>0)return a.find(s=>s.format===e.format)??a[0]}let r,n;if(Ps(e)){n=e.value;let a=t.filter(s=>{var o;return(o=s.identify)==null?void 0:o.call(s,n)});if(a.length>1){const s=a.filter(o=>o.test);s.length>0&&(a=s)}r=a.find(s=>s.format===e.format)??a.find(s=>!s.format)}else n=e,r=t.find(a=>a.nodeClass&&n instanceof a.nodeClass);if(!r){const a=((i=n==null?void 0:n.constructor)==null?void 0:i.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${a} value`)}return r}function MNt(t,e,{anchors:r,doc:n}){if(!n.directives)return"";const i=[],a=(Ps(t)||Gc(t))&&t.anchor;a&&PEe(a)&&(r.add(a),i.push(`&${a}`));const s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function mI(t,e,r,n){var l;if(Oo(t))return t.toString(e,r,n);if(L5(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const a=Zo(t)?t:e.doc.createNode(t,{onTagObj:u=>i=u});i??(i=ANt(e.doc.schema.tags,a));const s=MNt(a,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);const o=typeof i.stringify=="function"?i.stringify(a,e,r,n):Ps(a)?SNt(a,e,r,n):a.toString(e,r,n);return s?Ps(a)||o[0]==="{"||o[0]==="["?`${s} ${o}`:`${s} +${e.indent}${o}`:o}function RNt({key:t,value:e},r,n,i){const{allNullValues:a,doc:s,indent:o,indentStep:l,options:{commentString:u,indentSeq:h,simpleKeys:d}}=r;let f=Zo(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Gc(t)||!Zo(t)&&typeof t=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Gc(t)||(Ps(t)?t.type===Ba.BLOCK_FOLDED||t.type===Ba.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:o+l});let g=!1,m=!1,U=mI(t,r,()=>g=!0,()=>m=!0);if(!p&&!r.inFlow&&U.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(a||e==null)return g&&n&&n(),U===""?"?":p?`? ${U}`:U}else if(a&&!d||e==null&&p)return U=`? ${U}`,f&&!g?U+=Py(U,r.indent,u(f)):m&&i&&i(),U;g&&(f=null),p?(f&&(U+=Py(U,r.indent,u(f))),U=`? ${U} +${o}:`):(U=`${U}:`,f&&(U+=Py(U,r.indent,u(f))));let y,b,v;Zo(e)?(y=!!e.spaceBefore,b=e.commentBefore,v=e.comment):(y=!1,b=null,v=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&Ps(e)&&(r.indentAtStart=U.length+1),m=!1,!h&&l.length>=2&&!r.inFlow&&!p&&Tee(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let w=!1;const T=mI(e,r,()=>w=!0,()=>m=!0);let k=" ";if(f||y||b){if(k=y?` +`:"",b){const C=u(b);k+=` +${IT(C,r.indent)}`}T===""&&!r.inFlow?k===` +`&&v&&(k=` -`):S+=` -${r.indent}`}else if(!p&&Wc(e)){const k=C[0],E=C.indexOf(` -`),A=E!==-1,M=r.inFlow??e.flow??e.items.length===0;if(A||!M){let R=!1;if(A&&(k==="&"||k==="!")){let P=C.indexOf(" ");k==="&"&&P!==-1&&Pt===Q8||typeof t=="symbol"&&t.description===Q8,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Fs(Symbol(Q8)),{addToJSMap:_Me}),stringify:()=>Q8},tNt=(t,e)=>(XF.identify(e)||$a(e)&&(!e.type||e.type===Fs.PLAIN)&&XF.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(r=>r.tag===XF.tag&&r.default));function _Me(t,e,r){if(r=t&&Mv(r)?r.resolve(t.doc):r,mee(r))for(const n of r.items)KF(t,e,n);else if(Array.isArray(r))for(const n of r)KF(t,e,n);else KF(t,e,r)}function KF(t,e,r){const n=t&&Mv(r)?r.resolve(t.doc):r;if(!kMe(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,t,Map);for(const[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function LMe(t,e,{key:r,value:n}){if(Zo(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(tNt(t,r))_Me(t,e,n);else{const i=_h(r,"",t);if(e instanceof Map)e.set(i,_h(n,i,t));else if(e instanceof Set)e.add(i);else{const s=rNt(r,i,t),a=_h(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function rNt(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Zo(t)&&(r!=null&&r.doc)){const n=KIt(r.doc,{});n.anchors=new Set;for(const s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),eNt(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}function vee(t,e,r){const n=hI(t,void 0,r),i=hI(e,void 0,r);return new w0(n,i)}class w0{constructor(e,r=null){Object.defineProperty(this,lf,{value:CMe}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Zo(r)&&(r=r.clone(e)),Zo(n)&&(n=n.clone(e)),new w0(r,n)}toJSON(e,r){const n=r!=null&&r.mapAsMap?new Map:{};return LMe(r,n,this)}toString(e,r,n){return e!=null&&e.doc?JIt(this,e,r,n):JSON.stringify(this)}}function IMe(t,e,r){return(e.inFlow??t.flow?iNt:nNt)(t,e,r)}function nNt({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:u}}=r,h=Object.assign({},r,{indent:s,type:null});let d=!1;const f=[];for(let g=0;gy=null,()=>d=!0);y&&(v+=Nb(v,s,u(y))),d&&y&&(d=!1),f.push(n+v)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;gt===tE||typeof t=="symbol"&&t.description===tE,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ba(Symbol(tE)),{addToJSMap:zEe}),stringify:()=>tE},INt=(t,e)=>(eF.identify(e)||Ps(e)&&(!e.type||e.type===Ba.PLAIN)&&eF.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(r=>r.tag===eF.tag&&r.default));function zEe(t,e,r){if(r=t&&L5(r)?r.resolve(t.doc):r,Tee(r))for(const n of r.items)tF(t,e,n);else if(Array.isArray(r))for(const n of r)tF(t,e,n);else tF(t,e,r)}function tF(t,e,r){const n=t&&L5(r)?r.resolve(t.doc):r;if(!OEe(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,t,Map);for(const[a,s]of i)e instanceof Map?e.has(a)||e.set(a,s):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function VEe(t,e,{key:r,value:n}){if(Zo(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(INt(t,r))zEe(t,e,n);else{const i=Rh(r,"",t);if(e instanceof Map)e.set(i,Rh(n,i,t));else if(e instanceof Set)e.add(i);else{const a=NNt(r,i,t),s=Rh(n,a,t);a in e?Object.defineProperty(e,a,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[a]=s}}return e}function NNt(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Zo(t)&&(r!=null&&r.doc)){const n=ENt(r.doc,{});n.anchors=new Set;for(const a of r.anchors.keys())n.anchors.add(a.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=t.toString(n);if(!r.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),LNt(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}function kee(t,e,r){const n=gI(t,void 0,r),i=gI(e,void 0,r);return new w0(n,i)}class w0{constructor(e,r=null){Object.defineProperty(this,cf,{value:DEe}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Zo(r)&&(r=r.clone(e)),Zo(n)&&(n=n.clone(e)),new w0(r,n)}toJSON(e,r){const n=r!=null&&r.mapAsMap?new Map:{};return VEe(r,n,this)}toString(e,r,n){return e!=null&&e.doc?RNt(this,e,r,n):JSON.stringify(this)}}function HEe(t,e,r){return(e.inFlow??t.flow?ONt:DNt)(t,e,r)}function DNt({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:a,onChompKeep:s,onComment:o}){const{indent:l,options:{commentString:u}}=r,h=Object.assign({},r,{indent:a,type:null});let d=!1;const f=[];for(let g=0;gU=null,()=>d=!0);U&&(y+=Py(y,a,u(U))),d&&U&&(d=!1),f.push(n+y)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let g=1;gy=null);u||(u=d.length>h||v.includes(` -`)),g0&&(u||(u=d.reduce((b,x)=>b+x.length+2,2)+(v.length+2)>e.options.lineWidth)),u&&(v+=",")),y&&(v+=Nb(v,n,o(y))),d.push(v),h=d.length}const{start:f,end:p}=r;if(d.length===0)return f+p;if(!u){const g=d.reduce((m,y)=>m+y.length+2,2);u=e.options.lineWidth>0&&g>e.options.lineWidth}if(u){let g=f;for(const m of d)g+=m?` -${s}${i}${m}`:` +`+IT(u(t),l),o&&o()):d&&s&&s(),p}function ONt({items:t},e,{flowChars:r,itemIndent:n}){const{indent:i,indentStep:a,flowCollectionPadding:s,options:{commentString:o}}=e;n+=a;const l=Object.assign({},e,{indent:n,inFlow:!0,type:null});let u=!1,h=0;const d=[];for(let g=0;gU=null);u||(u=d.length>h||y.includes(` +`)),g0&&(u||(u=d.reduce((b,v)=>b+v.length+2,2)+(y.length+2)>e.options.lineWidth)),u&&(y+=",")),U&&(y+=Py(y,n,o(U))),d.push(y),h=d.length}const{start:f,end:p}=r;if(d.length===0)return f+p;if(!u){const g=d.reduce((m,U)=>m+U.length+2,2);u=e.options.lineWidth>0&&g>e.options.lineWidth}if(u){let g=f;for(const m of d)g+=m?` +${a}${i}${m}`:` `;return`${g} -${i}${p}`}else return`${f}${a}${d.join(" ")}${a}${p}`}function fI({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const s=M6(e(n),t);r.push(s.trimStart())}}function hy(t,e){const r=$a(e)?e.value:e;for(const n of t)if(Do(n)&&(n.key===e||n.key===r||$a(n.key)&&n.key.value===r))return n}class rb extends MMe{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ay,e),this.items=[]}static from(e,r,n){const{keepUndefined:i,replacer:s}=n,a=new this(e),o=(l,u)=>{if(typeof s=="function")u=s.call(r,l,u);else if(Array.isArray(s)&&!s.includes(l))return;(u!==void 0||i)&&a.items.push(vee(l,u,n))};if(r instanceof Map)for(const[l,u]of r)o(l,u);else if(r&&typeof r=="object")for(const l of Object.keys(r))o(l,r[l]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){var a;let n;Do(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new w0(e,e==null?void 0:e.value):n=new w0(e.key,e.value);const i=hy(this.items,n.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);$a(i.value)&&AMe(n.value)?i.value.value=n.value:i.value=n.value}else if(s){const o=this.items.findIndex(l=>s(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){const r=hy(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){const n=hy(this.items,e),i=n==null?void 0:n.value;return(!r&&$a(i)?i.value:i)??void 0}has(e){return!!hy(this.items,e)}set(e,r){this.add(new w0(e,r),!0)}toJSON(e,r,n){const i=n?new n:r!=null&&r.mapAsMap?new Map:{};r!=null&&r.onCreate&&r.onCreate(i);for(const s of this.items)LMe(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Do(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),IMe(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}}class NMe extends MMe{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(u7,e),this.items=[]}add(e){this.items.push(e)}delete(e){const r=J8(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){const n=J8(e);if(typeof n!="number")return;const i=this.items[n];return!r&&$a(i)?i.value:i}has(e){const r=J8(e);return typeof r=="number"&&r=0?e:null}function sNt(t,e,r){const{replacer:n}=r,i=new NMe(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)o=u[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=a;i.items.push(vee(o,l,r))}return i}class bee extends NMe{constructor(){super(),this.add=rb.prototype.add.bind(this),this.delete=rb.prototype.delete.bind(this),this.get=rb.prototype.get.bind(this),this.has=rb.prototype.has.bind(this),this.set=rb.prototype.set.bind(this),this.tag=bee.tag}toJSON(e,r){if(!r)return super.toJSON(e);const n=new Map;r!=null&&r.onCreate&&r.onCreate(n);for(const i of this.items){let s,a;if(Do(i)?(s=_h(i.key,"",r),a=_h(i.value,s,r)):s=_h(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){const i=sNt(e,r,n),s=new this;return s.items=i.items,s}}bee.tag="tag:yaml.org,2002:omap";class xee extends rb{constructor(e){super(e),this.tag=xee.tag}add(e){let r;Do(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new w0(e.key,null):r=new w0(e,null),hy(this.items,r.key)||this.items.push(r)}get(e,r){const n=hy(this.items,e);return!r&&Do(n)?$a(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=hy(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new w0(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){const{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(vee(a,null,n));return s}}xee.tag="tag:yaml.org,2002:set";new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{} -\r `);const aNt="edgeever-frontmatter",oNt=t=>{var e;return(t==null?void 0:t.type)==="codeBlock"&&((e=t.attrs)==null?void 0:e.language)===aNt},lNt=t=>{var e;return oNt(t.content[0])?((e=t.content[0].content)==null?void 0:e.map(r=>"text"in r&&typeof r.text=="string"?r.text:"").join(""))??"":null},cNt=t=>new Mq({extensions:vMe({...t,markdown:!0})}),uNt=cNt({mathematics:AIt()}),hNt=t=>{if(!t||typeof t!="object")return"";const e=t;if(!Array.isArray(e.content))return"";const r=lNt(t),n=r===null?t:{...t,content:e.content.slice(1)},i=DMe($It(Kq(n))),s=uNt.serialize(i).replaceAll(OMe,"\\$");return r===null?s:`--- +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function UI({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const a=IT(e(n),t);r.push(a.trimStart())}}function pU(t,e){const r=Ps(e)?e.value:e;for(const n of t)if(Oo(n)&&(n.key===e||n.key===r||Ps(n.key)&&n.key.value===r))return n}class ay extends $Ee{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(RU,e),this.items=[]}static from(e,r,n){const{keepUndefined:i,replacer:a}=n,s=new this(e),o=(l,u)=>{if(typeof a=="function")u=a.call(r,l,u);else if(Array.isArray(a)&&!a.includes(l))return;(u!==void 0||i)&&s.items.push(kee(l,u,n))};if(r instanceof Map)for(const[l,u]of r)o(l,u);else if(r&&typeof r=="object")for(const l of Object.keys(r))o(l,r[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){var s;let n;Oo(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new w0(e,e==null?void 0:e.value):n=new w0(e.key,e.value);const i=pU(this.items,n.key),a=(s=this.schema)==null?void 0:s.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Ps(i.value)&&BEe(n.value)?i.value.value=n.value:i.value=n.value}else if(a){const o=this.items.findIndex(l=>a(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){const r=pU(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){const n=pU(this.items,e),i=n==null?void 0:n.value;return(!r&&Ps(i)?i.value:i)??void 0}has(e){return!!pU(this.items,e)}set(e,r){this.add(new w0(e,r),!0)}toJSON(e,r,n){const i=n?new n:r!=null&&r.mapAsMap?new Map:{};r!=null&&r.onCreate&&r.onCreate(i);for(const a of this.items)VEe(r,i,a);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Oo(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),HEe(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}}class GEe extends $Ee{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(pk,e),this.items=[]}add(e){this.items.push(e)}delete(e){const r=rE(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){const n=rE(e);if(typeof n!="number")return;const i=this.items[n];return!r&&Ps(i)?i.value:i}has(e){const r=rE(e);return typeof r=="number"&&r=0?e:null}function _Nt(t,e,r){const{replacer:n}=r,i=new GEe(t);i.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(a++),s));let o,l;if(Array.isArray(s))if(s.length===2)o=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){const u=Object.keys(s);if(u.length===1)o=u[0],l=s[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=s;i.items.push(kee(o,l,r))}return i}class See extends GEe{constructor(){super(),this.add=ay.prototype.add.bind(this),this.delete=ay.prototype.delete.bind(this),this.get=ay.prototype.get.bind(this),this.has=ay.prototype.has.bind(this),this.set=ay.prototype.set.bind(this),this.tag=See.tag}toJSON(e,r){if(!r)return super.toJSON(e);const n=new Map;r!=null&&r.onCreate&&r.onCreate(n);for(const i of this.items){let a,s;if(Oo(i)?(a=Rh(i.key,"",r),s=Rh(i.value,a,r)):a=Rh(i,"",r),n.has(a))throw new Error("Ordered maps must not include duplicate keys");n.set(a,s)}return n}static from(e,r,n){const i=_Nt(e,r,n),a=new this;return a.items=i.items,a}}See.tag="tag:yaml.org,2002:omap";class Eee extends ay{constructor(e){super(e),this.tag=Eee.tag}add(e){let r;Oo(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new w0(e.key,null):r=new w0(e,null),pU(this.items,r.key)||this.items.push(r)}get(e,r){const n=pU(this.items,e);return!r&&Oo(n)?Ps(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=pU(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new w0(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){const{replacer:i}=n,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),a.items.push(kee(s,null,n));return a}}Eee.tag="tag:yaml.org,2002:set";new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{} +\r `);const PNt="edgeever-frontmatter",BNt=t=>{var e;return(t==null?void 0:t.type)==="codeBlock"&&((e=t.attrs)==null?void 0:e.language)===PNt},$Nt=t=>{var e;return BNt(t.content[0])?((e=t.content[0].content)==null?void 0:e.map(r=>"text"in r&&typeof r.text=="string"?r.text:"").join(""))??"":null},FNt=t=>new OW({extensions:MEe({...t,markdown:!0})}),zNt=FNt({mathematics:iNt()}),VNt=t=>{if(!t||typeof t!="object")return"";const e=t;if(!Array.isArray(e.content))return"";const r=$Nt(t),n=r===null?t:{...t,content:e.content.slice(1)},i=qEe(pNt(nq(n))),a=zNt.serialize(i).replaceAll(WEe,"\\$");return r===null?a:`--- ${r} --- -${s}`},OMe="edgeever-dollar",DMe=t=>{var r;if(!t||typeof t!="object")return t;const e=t;return e.type==="codeBlock"||(r=e.marks)!=null&&r.some(n=>n.type==="code")?t:e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(i=>i==="$").length>=2?{...e,text:e.text.replaceAll("$",OMe)}:t:Array.isArray(e.content)?{...e,content:e.content.map(DMe)}:t},Kq=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=dNt(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},dNt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};function Zq(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 ife(t,e="|"){return t.map(r=>zMe(r)).join(e)}function Qq(t,e){return typeof e=="bigint"?e.toString():e}class fNt{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function WD(t){return new fNt(t)}function pNt(t){return t==null}function wee(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function gNt(t,e){const r=t/e,n=Math.round(r),i=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){const o=e._zod.def.shape[s];return n?n(o,s):o}):$Me(t,s,n?n(a.value,s):a.value))}}function mNt(t,e){for(const r of Reflect.ownKeys(e)){const n=Object.getOwnPropertyDescriptor(e,r);n.enumerable&&(n.get?PMe(t,r,()=>e[r]):$Me(t,r,n.value))}}function qc(...t){const e={};for(const r of t){const n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function yNt(t){return JSON.stringify(t)}function vNt(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const BMe="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function R6(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const bNt=WD(()=>{var t;if(Hh.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 U5(t){if(R6(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(R6(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function FMe(t){return U5(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const xNt=new Set(["string","number","symbol"]);function j5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function km(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 Rr(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 zMe(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function wNt(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const VMe={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]},TNt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function CNt(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 s={};return nv(s,t,qD(t,e)),km(t,qc(r,{shape:s,checks:[]}))}function qD(t,e){var i;const r=D0(t),n=[];for(const s of Reflect.ownKeys(e)){if(!((i=Object.getOwnPropertyDescriptor(r,s))!=null&&i.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);e[s]&&n.push(s)}return n}function kNt(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 s=new Set(qD(t,e)),a={};return nv(a,t,Reflect.ownKeys(D0(t)).filter(o=>!s.has(o))),km(t,qc(r,{shape:a,checks:[]}))}function SNt(t,e){if(!U5(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const i=D0(t);for(const s of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return km(t,qc(t._zod.def,{shape:HMe(t,e)}))}function HMe(t,e){const r={};return nv(r,t,Reflect.ownKeys(D0(t))),mNt(r,e),r}function ENt(t,e){if(!U5(e))throw new Error("Invalid input to safeExtend: expected a plain object");return km(t,qc(t._zod.def,{shape:HMe(t,e)}))}function ANt(t,e){var i,s;if(!((i=e==null?void 0:e._zod)!=null&&i.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=t._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};nv(r,t,Reflect.ownKeys(D0(t))),nv(r,e,Reflect.ownKeys(D0(e)));const n=qc(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return km(t,n)}function sfe(t,e,r,n="partial"){const s=e._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);const o=r?new Set(qD(e,r)):void 0,l={};return nv(l,e,Reflect.ownKeys(D0(e)),t&&((u,h)=>o&&!o.has(h)?u:new t({type:"optional",innerType:u}))),km(e,qc(e._zod.def,{shape:l,checks:[]}))}function MNt(t,e,r){const n=r?new Set(qD(e,r)):void 0,i={};return nv(i,e,Reflect.ownKeys(D0(e)),(s,a)=>n&&!n.has(a)?s:new t({type:"nonoptional",innerType:s})),km(e,qc(e._zod.def,{shape:i}))}function o0(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 KC(t){return typeof t=="string"?t:t==null?void 0:t.message}function afe(t){const e=[];for(const r of t??[]){const n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;const i=n.maximum??n.length??n.size;i>=0&&e.push([i,r])}return e}function Jq(t,e,r){var n;for(let i=e;it;return e[$Nt]=!0,e}var ofe;const QF={value:void 0,enumerable:!1};let lfe="captureStackTrace"in Error?Error:null;function FNt(t){const e=lfe;if(e){const r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return lfe=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function Tt(t,e,r,n){const i={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=i;const a=r,o=a&&new WeakSet;function l(f,p){if(f._zod){if(f._zod.traits.has(t))return}else{QF.value=new s(p);try{Object.defineProperty(f,"_zod",QF)}finally{QF.value=void 0}}if(f._zod.traits.add(t),e(f,p),o){const m=Object.getPrototypeOf(f),y=f._zod.constr.prototype;let v=m;for(;v&&v!==y;)v=Object.getPrototypeOf(v);const b=v??m;o.has(b)||(o.add(b),INt(b,a))}const g=d.prototype;for(const m in g)Object.prototype.hasOwnProperty.call(g,m)&&(m in f||(f[m]=g[m].bind(f)))}const u=(n==null?void 0:n.Parent)??Object;class h extends u{}Object.defineProperty(h,"name",{value:t});function d(f){var y;const p=n!=null&&n.Parent?FNt(h):this;l(p,f);const g=p._zod.deferred;if(g){for(const v of g)v();p._zod.deferred=void 0}const m=(y=globalThis.__zod_globalConfig)==null?void 0:y.postProcessor;return m&&m(p),p}return Object.defineProperty(d,"init",{value:l}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>{var p,g;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(g=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:g.has(t)}}),Object.defineProperty(d,"name",{value:t}),d}class My extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qMe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(ofe=globalThis).__zod_globalConfig??(ofe.__zod_globalConfig={});const Hh=globalThis.__zod_globalConfig;function Yd(t){return t&&Object.assign(Hh,t),Hh}function zNt(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,Qq,2)),t.message}function VNt(t){this._zod.message=t}const HNt={get:zNt,set:VNt,enumerable:!0,configurable:!0},JF={value:void 0,enumerable:!1},cfe=new WeakSet([Object.prototype,Error.prototype]),GNt=(t,e)=>{t.name="$ZodError",JF.value=e,Object.defineProperty(t,"issues",JF),JF.value=void 0,Object.defineProperty(t,"message",HNt);const r=Object.getPrototypeOf(t);cfe.has(r)||(cfe.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},WNt=Tt("$ZodError",GNt);function qNt(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function UNt(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?qNt(r,i.path[0],()=>[]).push(e(i)):n.push(e(i));return{formErrors:n,fieldErrors:r}}function jNt(t,e=r=>r.message){const r={_errors:[]},n=(i,s=[])=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o},[...s,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...s,...a.path]);else{const o=[...s,...a.path];if(o.length===0)r._errors.push(e(a));else{let l=r,u=0;for(;u{const e=(r,n,i,s)=>{const a=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new My;if(o.issues.length){const l=new((s==null?void 0:s.Err)??t)(o.issues.map(u=>Wg(u,a,Yd())));throw BMe(l,(s==null?void 0:s.callee)??e),l}return o.value};return e},Eee=t=>{const e=async(r,n,i,s)=>{const a=i?{...i,async:!0}:{async:!0};let o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((s==null?void 0:s.Err)??t)(o.issues.map(u=>Wg(u,a,Yd())));throw BMe(l,(s==null?void 0:s.callee)??e),l}return o.value};return e},Aee=t=>(e,r,n)=>{const i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new My;return s.issues.length?UMe(t,s.issues,i):{success:!0,data:s.value}};function UMe(t,e,r){let n;return{success:!1,get error(){return n||(n=new t(e.map(i=>Wg(i,r,Yd()))),e=void 0,r=void 0),n},set error(i){n=i,e=void 0,r=void 0}}}const Mee=t=>async(e,r,n)=>{const i=n?{...n,async:!0}:{async:!0};let s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?UMe(t,s.issues,i):{success:!0,data:s.value}},YNt=Symbol.for("zod.compile.invalid"),XNt=Symbol.for("zod.compile.fallback"),KNt=((t,e,r)=>{const n=t._zod.bag.validator;if(n!==void 0){if(n(e)!==YNt)return!0;if(n.definite===!0&&r===void 0)return!1}return ZNt(t,e,r)});function ZNt(t,e,r){const n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=t._zod.bag.fallbackRun;let s;if(i?(n[XNt]=!0,s=i({value:e,issues:[]},n)):s=t._zod.run({value:e,issues:[]},n),s instanceof Promise)throw new My;return s.issues.length===0}const QNt=async(t,e,r)=>{const n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let i=t._zod.run({value:e,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length===0},JNt=t=>{const e=See(t),r=(n,i,s,a)=>{const o=s?{...s,direction:"backward"}:{direction:"backward"};return e(n,i,o,UD(r,a))};return r},eOt=t=>{const e=See(t),r=(n,i,s,a)=>e(n,i,s,UD(r,a));return r},tOt=t=>{const e=Eee(t),r=async(n,i,s,a)=>{const o=s?{...s,direction:"backward"}:{direction:"backward"};return await e(n,i,o,UD(r,a))};return r},rOt=t=>{const e=Eee(t),r=async(n,i,s,a)=>await e(n,i,s,UD(r,a));return r},nOt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Aee(t)(e,r,i)},iOt=t=>(e,r,n)=>Aee(t)(e,r,n),sOt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Mee(t)(e,r,i)},aOt=t=>async(e,r,n)=>Mee(t)(e,r,n),oOt=/^[cC][0-9a-z]{6,}$/,lOt=/^[0-9a-z]+$/,cOt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,uOt=/^[0-9a-vA-V]{20}$/,hOt=/^[A-Za-z0-9]{27}$/,dOt=/^[a-zA-Z0-9_-]{21}$/;function fOt(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const pOt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gOt=/^([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})$/,ufe=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)$/,mOt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yOt="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function vOt(){return new RegExp(yOt,"u")}const bOt=/^(?:(?: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])$/,xOt=/^(([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}|:))$/,wOt=/^((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])$/,TOt=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,COt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kOt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,SOt=/^https?$/,EOt=/^\+[1-9]\d{6,14}$/,jMe="(?:(?:\\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])))";function AOt(t){return new RegExp(`^${t}$`)}const MOt=AOt(jMe);function eU(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}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ROt(t){return new RegExp(`^${eU(t)}$`)}function _Ot(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${eU({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,n=t.local?`${r}|${eU({precision:t.precision})}`:r;return new RegExp(`^${jMe}T(?:${n})$`)}const LOt=/^[\s\S]{0,}$/,IOt=/^-?\d+$/,Ree=/^-?\d+(?:\.\d+)?$/,NOt=/^(?:true|false)$/i,OOt=/^[^A-Z]*$/,DOt=/^[^a-z]*$/,Rc=Tt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),_ee=t=>{const e=t.value;return!pNt(e)&&e.length!==void 0},pI={number:"number",bigint:"bigint",object:"date"},YMe=Tt("$ZodCheckLessThan",(t,e)=>{Rc.init(t,e);const r=pI[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value{Rc.init(t,e);const r=pI[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:pI[typeof n.value]??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})}}),POt=Tt("$ZodCheckMultipleOf",(t,e)=>{Rc.init(t,e),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"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):gNt(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})}}),$Ot=Tt("$ZodCheckNumberFormat",(t,e)=>{var a;Rc.init(t,e),e.format=e.format||"float64";const r=(a=e.format)==null?void 0:a.includes("int"),n=r?"int":"number",[i,s]=VMe[e.format];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}}ls&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}}),BOt=Tt("$ZodCheckMaxLength",(t,e)=>{var r;Rc.init(t,e),(r=t._zod.def).when??(r.when=_ee),t._zod.check=n=>{const i=n.value,s=i.length;if((typeof i=="string"&&s>e.maximum?Cee(i):s)<=e.maximum)return;const o=kee(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),FOt=Tt("$ZodCheckMinLength",(t,e)=>{var r;Rc.init(t,e),(r=t._zod.def).when??(r.when=_ee),t._zod.check=n=>{const i=n.value,s=i.length;if((typeof i=="string"&&s>=e.minimum&&s=e.minimum)return;const o=kee(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),zOt=Tt("$ZodCheckLengthEquals",(t,e)=>{var r;Rc.init(t,e),(r=t._zod.def).when??(r.when=_ee),t._zod.check=n=>{const i=n.value,s=i.length,a=typeof i=="string"&&s>=e.length&&s<=e.length*2?Cee(i):s;if(a===e.length)return;const o=kee(i),l=a>e.length;n.issues.push({origin:o,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),jD=Tt("$ZodCheckStringFormat",(t,e)=>{var r,n;Rc.init(t,e),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=()=>{})}),VOt=Tt("$ZodCheckRegex",(t,e)=>{jD.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})}}),HOt=Tt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=OOt),jD.init(t,e)}),GOt=Tt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=DOt),jD.init(t,e)}),WOt=Tt("$ZodCheckIncludes",(t,e)=>{Rc.init(t,e);const r=j5(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position},}${r}`:r);e.pattern=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})}}),qOt=Tt("$ZodCheckStartsWith",(t,e)=>{Rc.init(t,e);const r=new RegExp(`^${j5(e.prefix)}.*`);e.pattern??(e.pattern=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})}}),UOt=Tt("$ZodCheckEndsWith",(t,e)=>{Rc.init(t,e);const r=new RegExp(`.*${j5(e.suffix)}$`);e.pattern??(e.pattern=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})}}),jOt=Tt("$ZodCheckOverwrite",(t,e)=>{Rc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class YOt{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(` -`).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,r=(this==null?void 0:this.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +${a}`},WEe="edgeever-dollar",qEe=t=>{var r;if(!t||typeof t!="object")return t;const e=t;return e.type==="codeBlock"||(r=e.marks)!=null&&r.some(n=>n.type==="code")?t:e.type==="text"&&typeof e.text=="string"?Array.from(e.text).filter(i=>i==="$").length>=2?{...e,text:e.text.replaceAll("$",WEe)}:t:Array.isArray(e.content)?{...e,content:e.content.map(qEe)}:t},nq=t=>{if(!t||typeof t!="object")return t;const e=t;if(e.type==="edgeeverThemeBlock"){const r=HNt(e.attrs,"kind"),n=Array.isArray(e.content)?e.content:[];return{type:"blockquote",content:[{type:"paragraph",content:[{type:"text",text:r?`[${r}]`:"[主题化组件]"}]},...n.map(nq)]}}return Array.isArray(e.content)?{...e,content:e.content.map(nq)}:t},HNt=(t,e)=>{const r=t==null?void 0:t[e];return typeof r=="string"?r.trim():""};function iq(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 mfe(t,e="|"){return t.map(r=>ZEe(r)).join(e)}function aq(t,e){return typeof e=="bigint"?e.toString():e}class GNt{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function jO(t){return new GNt(t)}function WNt(t){return t==null}function Aee(t){const e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function qNt(t,e){const r=t/e,n=Math.round(r),i=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){const o=e._zod.def.shape[a];return n?n(o,a):o}):YEe(t,a,n?n(s.value,a):s.value))}}function jNt(t,e){for(const r of Reflect.ownKeys(e)){const n=Object.getOwnPropertyDescriptor(e,r);n.enumerable&&(n.get?jEe(t,r,()=>e[r]):YEe(t,r,n.value))}}function Wc(...t){const e={};for(const r of t){const n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function YNt(t){return JSON.stringify(t)}function XNt(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const XEe="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function NT(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const KNt=jO(()=>{var t;if(Vh.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 Kv(t){if(NT(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const r=e.prototype;return!(NT(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function KEe(t){return Kv(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const ZNt=new Set(["string","number","symbol"]);function Zv(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S1(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 Rr(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 ZEe(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function JNt(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const JEe={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]},QNt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eDt(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={};return s5(a,t,YO(t,e)),S1(t,Wc(r,{shape:a,checks:[]}))}function YO(t,e){var i;const r=_0(t),n=[];for(const a of Reflect.ownKeys(e)){if(!((i=Object.getOwnPropertyDescriptor(r,a))!=null&&i.enumerable))throw new Error(`Unrecognized key: "${String(a)}"`);e[a]&&n.push(a)}return n}function tDt(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=new Set(YO(t,e)),s={};return s5(s,t,Reflect.ownKeys(_0(t)).filter(o=>!a.has(o))),S1(t,Wc(r,{shape:s,checks:[]}))}function rDt(t,e){if(!Kv(e))throw new Error("Invalid input to extend: expected a plain object");const r=t._zod.def.checks;if(r&&r.length>0){const i=_0(t);for(const a of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return S1(t,Wc(t._zod.def,{shape:QEe(t,e)}))}function QEe(t,e){const r={};return s5(r,t,Reflect.ownKeys(_0(t))),jNt(r,e),r}function nDt(t,e){if(!Kv(e))throw new Error("Invalid input to safeExtend: expected a plain object");return S1(t,Wc(t._zod.def,{shape:QEe(t,e)}))}function iDt(t,e){var i,a;if(!((i=e==null?void 0:e._zod)!=null&&i.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((a=t._zod.def.checks)!=null&&a.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};s5(r,t,Reflect.ownKeys(_0(t))),s5(r,e,Reflect.ownKeys(_0(e)));const n=Wc(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return S1(t,n)}function Ufe(t,e,r,n="partial"){const a=e._zod.def.checks;if(a&&a.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);const o=r?new Set(YO(e,r)):void 0,l={};return s5(l,e,Reflect.ownKeys(_0(e)),t&&((u,h)=>o&&!o.has(h)?u:new t({type:"optional",innerType:u}))),S1(e,Wc(e._zod.def,{shape:l,checks:[]}))}function aDt(t,e,r){const n=r?new Set(YO(e,r)):void 0,i={};return s5(i,e,Reflect.ownKeys(_0(e)),(a,s)=>n&&!n.has(s)?a:new t({type:"nonoptional",innerType:a})),S1(e,Wc(e._zod.def,{shape:i}))}function l0(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 Q9(t){return typeof t=="string"?t:t==null?void 0:t.message}function yfe(t){const e=[];for(const r of t??[]){const n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;const i=n.maximum??n.length??n.size;i>=0&&e.push([i,r])}return e}function sq(t,e,r){var n;for(let i=e;it;return e[pDt]=!0,e}var bfe;const nF={value:void 0,enumerable:!1};let vfe="captureStackTrace"in Error?Error:null;function mDt(t){const e=vfe;if(e){const r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return vfe=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function wt(t,e,r,n){const i={};function a(f){this.def=f,this.constr=d,this.traits=new Set}a.prototype=i;const s=r,o=s&&new WeakSet;function l(f,p){if(f._zod){if(f._zod.traits.has(t))return}else{nF.value=new a(p);try{Object.defineProperty(f,"_zod",nF)}finally{nF.value=void 0}}if(f._zod.traits.add(t),e(f,p),o){const m=Object.getPrototypeOf(f),U=f._zod.constr.prototype;let y=m;for(;y&&y!==U;)y=Object.getPrototypeOf(y);const b=y??m;o.has(b)||(o.add(b),cDt(b,s))}const g=d.prototype;for(const m in g)Object.prototype.hasOwnProperty.call(g,m)&&(m in f||(f[m]=g[m].bind(f)))}const u=(n==null?void 0:n.Parent)??Object;class h extends u{}Object.defineProperty(h,"name",{value:t});function d(f){var U;const p=n!=null&&n.Parent?mDt(h):this;l(p,f);const g=p._zod.deferred;if(g){for(const y of g)y();p._zod.deferred=void 0}const m=(U=globalThis.__zod_globalConfig)==null?void 0:U.postProcessor;return m&&m(p),p}return Object.defineProperty(d,"init",{value:l}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>{var p,g;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(g=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:g.has(t)}}),Object.defineProperty(d,"name",{value:t}),d}class LU extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rAe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(bfe=globalThis).__zod_globalConfig??(bfe.__zod_globalConfig={});const Vh=globalThis.__zod_globalConfig;function Xd(t){return t&&Object.assign(Vh,t),Vh}function UDt(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,aq,2)),t.message}function yDt(t){this._zod.message=t}const bDt={get:UDt,set:yDt,enumerable:!0,configurable:!0},iF={value:void 0,enumerable:!1},xfe=new WeakSet([Object.prototype,Error.prototype]),vDt=(t,e)=>{t.name="$ZodError",iF.value=e,Object.defineProperty(t,"issues",iF),iF.value=void 0,Object.defineProperty(t,"message",bDt);const r=Object.getPrototypeOf(t);xfe.has(r)||(xfe.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},xDt=wt("$ZodError",vDt);function wDt(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function TDt(t,e=r=>r.message){const r={},n=[];for(const i of t.issues)i.path.length>0?wDt(r,i.path[0],()=>[]).push(e(i)):n.push(e(i));return{formErrors:n,fieldErrors:r}}function CDt(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{const e=(r,n,i,a)=>{const s=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new LU;if(o.issues.length){const l=new((a==null?void 0:a.Err)??t)(o.issues.map(u=>qg(u,s,Xd())));throw XEe(l,(a==null?void 0:a.callee)??e),l}return o.value};return e},Nee=t=>{const e=async(r,n,i,a)=>{const s=i?{...i,async:!0}:{async:!0};let o=r._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((a==null?void 0:a.Err)??t)(o.issues.map(u=>qg(u,s,Xd())));throw XEe(l,(a==null?void 0:a.callee)??e),l}return o.value};return e},Dee=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 LU;return a.issues.length?nAe(t,a.issues,i):{success:!0,data:a.value}};function nAe(t,e,r){let n;return{success:!1,get error(){return n||(n=new t(e.map(i=>qg(i,r,Xd()))),e=void 0,r=void 0),n},set error(i){n=i,e=void 0,r=void 0}}}const Oee=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?nAe(t,a.issues,i):{success:!0,data:a.value}},kDt=Symbol.for("zod.compile.invalid"),SDt=Symbol.for("zod.compile.fallback"),EDt=((t,e,r)=>{const n=t._zod.bag.validator;if(n!==void 0){if(n(e)!==kDt)return!0;if(n.definite===!0&&r===void 0)return!1}return ADt(t,e,r)});function ADt(t,e,r){const n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=t._zod.bag.fallbackRun;let a;if(i?(n[SDt]=!0,a=i({value:e,issues:[]},n)):a=t._zod.run({value:e,issues:[]},n),a instanceof Promise)throw new LU;return a.issues.length===0}const MDt=async(t,e,r)=>{const n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let i=t._zod.run({value:e,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length===0},RDt=t=>{const e=Iee(t),r=(n,i,a,s)=>{const o=a?{...a,direction:"backward"}:{direction:"backward"};return e(n,i,o,XO(r,s))};return r},LDt=t=>{const e=Iee(t),r=(n,i,a,s)=>e(n,i,a,XO(r,s));return r},IDt=t=>{const e=Nee(t),r=async(n,i,a,s)=>{const o=a?{...a,direction:"backward"}:{direction:"backward"};return await e(n,i,o,XO(r,s))};return r},NDt=t=>{const e=Nee(t),r=async(n,i,a,s)=>await e(n,i,a,XO(r,s));return r},DDt=t=>(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Dee(t)(e,r,i)},ODt=t=>(e,r,n)=>Dee(t)(e,r,n),_Dt=t=>async(e,r,n)=>{const i=n?{...n,direction:"backward"}:{direction:"backward"};return Oee(t)(e,r,i)},PDt=t=>async(e,r,n)=>Oee(t)(e,r,n),BDt=/^[cC][0-9a-z]{6,}$/,$Dt=/^[0-9a-z]+$/,FDt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,zDt=/^[0-9a-vA-V]{20}$/,VDt=/^[A-Za-z0-9]{27}$/,HDt=/^[a-zA-Z0-9_-]{21}$/;function GDt(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const WDt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qDt=/^([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})$/,wfe=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)$/,jDt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YDt="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function XDt(){return new RegExp(YDt,"u")}const KDt=/^(?:(?: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])$/,ZDt=/^(([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}|:))$/,JDt=/^((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])$/,QDt=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eOt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tOt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,rOt=/^https?$/,nOt=/^\+[1-9]\d{6,14}$/,iAe="(?:(?:\\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])))";function iOt(t){return new RegExp(`^${t}$`)}const aOt=iOt(iAe);function oq(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}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sOt(t){return new RegExp(`^${oq(t)}$`)}function oOt(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${oq({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,n=t.local?`${r}|${oq({precision:t.precision})}`:r;return new RegExp(`^${iAe}T(?:${n})$`)}const lOt=/^[\s\S]{0,}$/,cOt=/^-?\d+$/,_ee=/^-?\d+(?:\.\d+)?$/,uOt=/^(?:true|false)$/i,hOt=/^[^A-Z]*$/,dOt=/^[^a-z]*$/,Mc=wt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Pee=t=>{const e=t.value;return!WNt(e)&&e.length!==void 0},yI={number:"number",bigint:"bigint",object:"date"},aAe=wt("$ZodCheckLessThan",(t,e)=>{Mc.init(t,e);const r=yI[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value{Mc.init(t,e);const r=yI[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:yI[typeof n.value]??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})}}),fOt=wt("$ZodCheckMultipleOf",(t,e)=>{Mc.init(t,e),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"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):qNt(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})}}),pOt=wt("$ZodCheckNumberFormat",(t,e)=>{var s;Mc.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]=JEe[e.format];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})}}),gOt=wt("$ZodCheckMaxLength",(t,e)=>{var r;Mc.init(t,e),(r=t._zod.def).when??(r.when=Pee),t._zod.check=n=>{const i=n.value,a=i.length;if((typeof i=="string"&&a>e.maximum?Ree(i):a)<=e.maximum)return;const o=Lee(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),mOt=wt("$ZodCheckMinLength",(t,e)=>{var r;Mc.init(t,e),(r=t._zod.def).when??(r.when=Pee),t._zod.check=n=>{const i=n.value,a=i.length;if((typeof i=="string"&&a>=e.minimum&&a=e.minimum)return;const o=Lee(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),UOt=wt("$ZodCheckLengthEquals",(t,e)=>{var r;Mc.init(t,e),(r=t._zod.def).when??(r.when=Pee),t._zod.check=n=>{const i=n.value,a=i.length,s=typeof i=="string"&&a>=e.length&&a<=e.length*2?Ree(i):a;if(s===e.length)return;const o=Lee(i),l=s>e.length;n.issues.push({origin:o,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),KO=wt("$ZodCheckStringFormat",(t,e)=>{var r,n;Mc.init(t,e),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=()=>{})}),yOt=wt("$ZodCheckRegex",(t,e)=>{KO.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})}}),bOt=wt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=hOt),KO.init(t,e)}),vOt=wt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=dOt),KO.init(t,e)}),xOt=wt("$ZodCheckIncludes",(t,e)=>{Mc.init(t,e);const r=Zv(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position},}${r}`:r);e.pattern=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})}}),wOt=wt("$ZodCheckStartsWith",(t,e)=>{Mc.init(t,e);const r=new RegExp(`^${Zv(e.prefix)}.*`);e.pattern??(e.pattern=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})}}),TOt=wt("$ZodCheckEndsWith",(t,e)=>{Mc.init(t,e);const r=new RegExp(`.*${Zv(e.suffix)}$`);e.pattern??(e.pattern=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})}}),COt=wt("$ZodCheckOverwrite",(t,e)=>{Mc.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});class kOt{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}indented(e){this.indent+=1;try{e(this)}finally{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.content)??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${r.join(` `)} -};`)(...Object.values(this.closed))}}const XOt={major:4,minor:6,patch:6},Es=Tt("$ZodType",(t,e)=>{var s;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=XOt;const n=t._zod.def.checks,i=t._zod.traits.has("$ZodCheck")?[t,...n??[]]:n!=null&&n.length?[...n]:[];for(const a of i)for(const o of a._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),(s=t._zod.deferred)==null||s.push(()=>{t._zod.run=t._zod.parse});else{const a=(l,u,h)=>{if(l.memo)return l;let d=o0(l),f;for(const p of u){if(p._zod.def.when){if(RNt(l)||!p._zod.def.when(l))continue}else if(d)continue;const g=l.issues.length,m=p._zod.check(l);if(m instanceof Promise&&(h==null?void 0:h.async)===!1)throw new My;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,l.issues.length!==g&&(Jq(l.issues,g,t),d||(d=o0(l,g)))});else{if(l.issues.length===g)continue;Jq(l.issues,g,t),d||(d=o0(l,g))}}return f?f.then(()=>l):l},o=(l,u,h)=>{if(o0(l))return l.aborted=!0,l;const d=a(u,i,h);if(d instanceof Promise){if(h.async===!1)throw new My;return d.then(f=>t._zod.parse(f,h))}return t._zod.parse(d,h)};t._zod.run=(l,u)=>{if(u.skipChecks)return t._zod.parse(l,u);if(u.direction==="backward"){const d=t._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(f=>o(f,l,u)):o(d,l,u)}const h=t._zod.parse(l,u);if(h instanceof Promise){if(u.async===!1)throw new My;return h.then(d=>a(d,i,u))}return a(h,i,u)}}},{get"~standard"(){return GMe(this,"~standard",ZMe(this))},set"~standard"(t){qg(this,"~standard",t)}}),KMe=(t,e)=>t.issues.length?{issues:t.issues.map(r=>Wg(r,e,Yd()))}:{value:t.value};async function KOt(t,e){const r={async:!0};return KMe(await t._zod.run({value:e,issues:[]},r),r)}function ZMe(t){return{validate:e=>{const r={async:!1};try{const n=t._zod.run({value:e,issues:[]},r);if(!(n instanceof Promise))return KMe(n,r)}catch{}return KOt(t,e)},vendor:"zod",version:1}}const Lee=Tt("$ZodString",(t,e)=>{Es.init(t,e),t._zod.pattern=e.pattern??LOt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ps=Tt("$ZodStringFormat",(t,e)=>{jD.init(t,e),Lee.init(t,e)}),ZOt=Tt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=gOt),ps.init(t,e)}),QOt=Tt("$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=ufe(n))}else e.pattern??(e.pattern=ufe());ps.init(t,e)}),JOt=Tt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=mOt),ps.init(t,e)}),QMe=1,gI=2;function JMe(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function eDt(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?JMe(t)||gI:tDt(t,e)}function tDt(t,e){var r;if(!e.normalize&&((r=e.protocol)==null?void 0:r.source)===SOt.source&&!/^https?:\/\//i.test(t))return QMe;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(t)??gI}return new URL(t)}catch{return gI}}const rDt=/[\t\n\r]/g;function hfe(t){return t.replace(rDt,"")}function nDt(t,e){return e.lastIndex=0,e.test(t.hostname)}function iDt(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const sDt=Tt("$ZodURL",(t,e)=>{ps.init(t,e),t._zod.check=r=>{try{const n=r.value.trim(),i=eDt(n,e);if(i===QMe){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(i===gI){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}if(i===!0){r.value=hfe(n);return}e.hostname&&!nDt(i,e.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&&!iDt(i,e.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}),r.value=e.normalize?i.href:hfe(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),aDt=Tt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=vOt()),ps.init(t,e)}),oDt=Tt("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?dOt:fOt(e.length)),ps.init(t,e)}),lDt=Tt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=oOt),ps.init(t,e)}),cDt=Tt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=lOt),ps.init(t,e)}),uDt=Tt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=cOt),ps.init(t,e)}),hDt=Tt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=uOt),ps.init(t,e)}),dDt=Tt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=hOt),ps.init(t,e)}),fDt=Tt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=_Ot(e)),ps.init(t,e)}),pDt=Tt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=MOt),ps.init(t,e)}),gDt=Tt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ROt(e)),ps.init(t,e)}),mDt=Tt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=pOt),ps.init(t,e)}),yDt=Tt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=bOt),ps.init(t,e)}),vDt=/^[0-9a-fA-F:.]+$/;function eRe(t){return vDt.test(t)?JMe(`http://[${t}]`):!1}const bDt=Tt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=xOt),ps.init(t,e),t._zod.check=r=>{eRe(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}),xDt=Tt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=wOt),ps.init(t,e)});function wDt(t){const e=t.split("/");if(e.length!==2)return!1;const[r,n]=e;if(!n)return!1;const i=Number(n);return`${i}`!==n||i<0||i>128?!1:eRe(r)}const TDt=Tt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=TOt),ps.init(t,e),t._zod.check=r=>{wDt(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});function tRe(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const rRe=/^[0-9a-zA-Z+/]*={0,2}$/,CDt=Tt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=rRe),ps.init(t,e),t._zod.check=r=>{tRe(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),Iee=/^[A-Za-z0-9_-]*$/;function kDt(t){if(!Iee.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return tRe(r)}const SDt=Tt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Iee),ps.init(t,e),t._zod.check=r=>{kDt(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),EDt=Tt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=EOt),ps.init(t,e)});function ADt(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 MDt=Tt("$ZodJWT",(t,e)=>{ps.init(t,e),t._zod.check=r=>{ADt(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),nRe=Tt("$ZodNumber",(t,e)=>{Es.init(t,e),t._zod.pattern=Ree,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 s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),RDt=Tt("$ZodNumberFormat",(t,e)=>{$Ot.init(t,e),nRe.init(t,e)}),_Dt=Tt("$ZodBoolean",(t,e)=>{Es.init(t,e),t._zod.pattern=NOt,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}}),LDt=Tt("$ZodUnknown",(t,e)=>{Es.init(t,e),t._zod.parse=r=>r}),IDt=Tt("$ZodNever",(t,e)=>{Es.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function NDt(t,e){const r=afe(t._zod.def.checks);if(!r.length)return;const n=Math.min(...r.map(s=>s[0])),i=t._zod.parse;t._zod.parse=(s,a)=>{const o=e(s.value);if(o>n&&!(a!=null&&a.skipChecks)&&(a==null?void 0:a.direction)!=="backward"){for(const[l,u]of afe(t._zod.def.checks))if(o>l&&u._zod.def.when(s)){const h=s.issues.length;return u._zod.check(s),s.issues[h].continue=!1,Jq(s.issues,h,t),s}}return i(s,a)}}const ODt=t=>Array.isArray(t)?t.length:-1;function dfe(t,e,r){t.issues.length&&e.issues.push(...Db(r,t.issues)),e.value[r]=t.value}const DDt=Tt("$ZodArray",(t,e)=>{Es.init(t,e);const r=Hh.memoizer;r==null||r.attach(t),t._zod.parse=(n,i)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),n;n.value=r?r.alloc(t,n,Array(s.length),i):Array(s.length);const a=[],o=i==null?void 0:i.abortEarly;for(let l=0;ldfe(d,n,l)));else if(dfe(h,n,l),o&&h.issues.length!==0&&o0(h))break}return a.length?Promise.all(a).then(()=>n):n},NDt(t,ODt)});function mI(t,e,r,n,i,s){const a=r in n,o=s==="optional";if(!(!a&&o&&i==="optional")){if(t.issues.length){if(i!==void 0&&o&&!a)return;e.issues.push(...Db(r,t.issues))}if(!a&&i===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?(a||i==="defaulted"&&!o)&&(e.value[r]=void 0):e.value[r]=t.value}}const PDt=[];function iRe(t){var a,o,l,u;const e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),n=r.length?r:PDt,i=n.length?[...e,...n]:e;for(const h of i)if(!((u=(l=(o=(a=t.shape)==null?void 0:a[h])==null?void 0:o._zod)==null?void 0:l.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${String(h)}": expected a Zod schema`);const s=wNt(t.shape);return{...t,allKeys:i,symbolKeys:n,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(s)}}function sRe(t,e,r,n,i,s,a){const o=[],l=i.keySet,u=i.catchall._zod,h=u.def.type,d=u.optin,f=u.optout;let p=0;for(const g in e){if(a&&r.issues.length!==p){if(o0(r,p))break;p=r.issues.length}if(l.has(g))continue;if(g==="__proto__"){h==="never"&&o.push(g);continue}if(h==="never"){o.push(g);continue}const m=u.run({value:e[g],issues:[]},n);m instanceof Promise?t.push(m.then(y=>mI(y,r,g,e,d,f))):mI(m,r,g,e,d,f)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s,continue:!0}),t.length?Promise.all(t).then(()=>r):r}const $Dt=Tt("$ZodObject",(t,e)=>{Es.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape"),n=r!=null&&r.get?r.get.raw:e.shape??{};if(n){const u=()=>{const h={...n};return Object.defineProperty(e,"shape",{value:h}),u.raw=h,h};u.raw=n,Object.defineProperty(e,"shape",{get:u})}const i=WD(()=>iRe(e));di(t,"propValues",u=>{const h=u.def.shape,d={};for(const f in h){const p=h[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(d,f)||sp(d,f,new Set);for(const g of p.values)d[f].add(g);p.optin!==void 0&&d[f].add(void 0)}}return d});const s=R6,a=e.catchall;let o;const l=Hh.memoizer;l==null||l.attach(t),t._zod.parse=(u,h)=>{o??(o=i.value);const d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),u;u.value=l?l.alloc(t,u,{},h):{};const f=[],p=o.shape,g=h==null?void 0:h.abortEarly;let m=u.issues.length;for(const y of o.allKeys){if(g&&u.issues.length!==m){if(o0(u,m))break;m=u.issues.length}if(y==="__proto__")continue;const v=p[y],b=v._zod.optin,x=v._zod.optout,T=v._zod.run({value:d[y],issues:[]},h);T instanceof Promise?f.push(T.then(C=>mI(C,u,y,d,b,x))):mI(T,u,y,d,b,x)}return a?sRe(f,d,u,h,i.value,t,g===!0):f.length?Promise.all(f).then(()=>u):u}}),BDt=Tt("$ZodObjectJIT",(t,e)=>{$Dt.init(t,e);const r=t._zod.parse,n=WD(()=>iRe(e)),i=Hh.memoizer,s=p=>{var C,S;const g=n.value,m=g.symbolKeys,y=new YOt(["payload","ctx"],{shape:p,inst:t,memo:i,syms:m}),v=k=>`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`,b=(k,E)=>` - let ${k}_ab = false; - for (let i = 0; i < ${k}.issues.length; i++) { - const iss = ${k}.issues[i]; - iss.path = iss.path ? [${E}, ...iss.path] : [${E}]; +};`)(...Object.values(this.closed))}}const SOt={major:4,minor:6,patch:6},ka=wt("$ZodType",(t,e)=>{var a;var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=SOt;const n=t._zod.def.checks,i=t._zod.traits.has("$ZodCheck")?[t,...n??[]]:n!=null&&n.length?[...n]:[];for(const s of i)for(const o of s._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),(a=t._zod.deferred)==null||a.push(()=>{t._zod.run=t._zod.parse});else{const s=(l,u,h)=>{if(l.memo)return l;let d=l0(l),f;for(const p of u){if(p._zod.def.when){if(sDt(l)||!p._zod.def.when(l))continue}else if(d)continue;const g=l.issues.length,m=p._zod.check(l);if(m instanceof Promise&&(h==null?void 0:h.async)===!1)throw new LU;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,l.issues.length!==g&&(sq(l.issues,g,t),d||(d=l0(l,g)))});else{if(l.issues.length===g)continue;sq(l.issues,g,t),d||(d=l0(l,g))}}return f?f.then(()=>l):l},o=(l,u,h)=>{if(l0(l))return l.aborted=!0,l;const d=s(u,i,h);if(d instanceof Promise){if(h.async===!1)throw new LU;return d.then(f=>t._zod.parse(f,h))}return t._zod.parse(d,h)};t._zod.run=(l,u)=>{if(u.skipChecks)return t._zod.parse(l,u);if(u.direction==="backward"){const d=t._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(f=>o(f,l,u)):o(d,l,u)}const h=t._zod.parse(l,u);if(h instanceof Promise){if(u.async===!1)throw new LU;return h.then(d=>s(d,i,u))}return s(h,i,u)}}},{get"~standard"(){return eAe(this,"~standard",lAe(this))},set"~standard"(t){jg(this,"~standard",t)}}),oAe=(t,e)=>t.issues.length?{issues:t.issues.map(r=>qg(r,e,Xd()))}:{value:t.value};async function EOt(t,e){const r={async:!0};return oAe(await t._zod.run({value:e,issues:[]},r),r)}function lAe(t){return{validate:e=>{const r={async:!1};try{const n=t._zod.run({value:e,issues:[]},r);if(!(n instanceof Promise))return oAe(n,r)}catch{}return EOt(t,e)},vendor:"zod",version:1}}const Bee=wt("$ZodString",(t,e)=>{ka.init(t,e),t._zod.pattern=e.pattern??lOt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),fa=wt("$ZodStringFormat",(t,e)=>{KO.init(t,e),Bee.init(t,e)}),AOt=wt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=qDt),fa.init(t,e)}),MOt=wt("$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=wfe(n))}else e.pattern??(e.pattern=wfe());fa.init(t,e)}),ROt=wt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=jDt),fa.init(t,e)}),cAe=1,bI=2;function uAe(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function LOt(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?uAe(t)||bI:IOt(t,e)}function IOt(t,e){var r;if(!e.normalize&&((r=e.protocol)==null?void 0:r.source)===rOt.source&&!/^https?:\/\//i.test(t))return cAe;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(t)??bI}return new URL(t)}catch{return bI}}const NOt=/[\t\n\r]/g;function Tfe(t){return t.replace(NOt,"")}function DOt(t,e){return e.lastIndex=0,e.test(t.hostname)}function OOt(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const _Ot=wt("$ZodURL",(t,e)=>{fa.init(t,e),t._zod.check=r=>{try{const n=r.value.trim(),i=LOt(n,e);if(i===cAe){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(i===bI){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}if(i===!0){r.value=Tfe(n);return}e.hostname&&!DOt(i,e.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&&!OOt(i,e.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}),r.value=e.normalize?i.href:Tfe(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),POt=wt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=XDt()),fa.init(t,e)}),BOt=wt("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?HDt:GDt(e.length)),fa.init(t,e)}),$Ot=wt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=BDt),fa.init(t,e)}),FOt=wt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=$Dt),fa.init(t,e)}),zOt=wt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=FDt),fa.init(t,e)}),VOt=wt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=zDt),fa.init(t,e)}),HOt=wt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=VDt),fa.init(t,e)}),GOt=wt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=oOt(e)),fa.init(t,e)}),WOt=wt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=aOt),fa.init(t,e)}),qOt=wt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=sOt(e)),fa.init(t,e)}),jOt=wt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=WDt),fa.init(t,e)}),YOt=wt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=KDt),fa.init(t,e)}),XOt=/^[0-9a-fA-F:.]+$/;function hAe(t){return XOt.test(t)?uAe(`http://[${t}]`):!1}const KOt=wt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=ZDt),fa.init(t,e),t._zod.check=r=>{hAe(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}),ZOt=wt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=JDt),fa.init(t,e)});function JOt(t){const e=t.split("/");if(e.length!==2)return!1;const[r,n]=e;if(!n)return!1;const i=Number(n);return`${i}`!==n||i<0||i>128?!1:hAe(r)}const QOt=wt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=QDt),fa.init(t,e),t._zod.check=r=>{JOt(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});function dAe(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const fAe=/^[0-9a-zA-Z+/]*={0,2}$/,e_t=wt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=fAe),fa.init(t,e),t._zod.check=r=>{dAe(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),$ee=/^[A-Za-z0-9_-]*$/;function t_t(t){if(!$ee.test(t))return!1;const e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return dAe(r)}const r_t=wt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=$ee),fa.init(t,e),t._zod.check=r=>{t_t(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),n_t=wt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=nOt),fa.init(t,e)});function i_t(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 a_t=wt("$ZodJWT",(t,e)=>{fa.init(t,e),t._zod.check=r=>{i_t(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),pAe=wt("$ZodNumber",(t,e)=>{ka.init(t,e),t._zod.pattern=_ee,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:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),s_t=wt("$ZodNumberFormat",(t,e)=>{pOt.init(t,e),pAe.init(t,e)}),o_t=wt("$ZodBoolean",(t,e)=>{ka.init(t,e),t._zod.pattern=uOt,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}}),l_t=wt("$ZodUnknown",(t,e)=>{ka.init(t,e),t._zod.parse=r=>r}),c_t=wt("$ZodNever",(t,e)=>{ka.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function u_t(t,e){const r=yfe(t._zod.def.checks);if(!r.length)return;const n=Math.min(...r.map(a=>a[0])),i=t._zod.parse;t._zod.parse=(a,s)=>{const o=e(a.value);if(o>n&&!(s!=null&&s.skipChecks)&&(s==null?void 0:s.direction)!=="backward"){for(const[l,u]of yfe(t._zod.def.checks))if(o>l&&u._zod.def.when(a)){const h=a.issues.length;return u._zod.check(a),a.issues[h].continue=!1,sq(a.issues,h,t),a}}return i(a,s)}}const h_t=t=>Array.isArray(t)?t.length:-1;function Cfe(t,e,r){t.issues.length&&e.issues.push(...$y(r,t.issues)),e.value[r]=t.value}const d_t=wt("$ZodArray",(t,e)=>{ka.init(t,e);const r=Vh.memoizer;r==null||r.attach(t),t._zod.parse=(n,i)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:t}),n;n.value=r?r.alloc(t,n,Array(a.length),i):Array(a.length);const s=[],o=i==null?void 0:i.abortEarly;for(let l=0;lCfe(d,n,l)));else if(Cfe(h,n,l),o&&h.issues.length!==0&&l0(h))break}return s.length?Promise.all(s).then(()=>n):n},u_t(t,h_t)});function vI(t,e,r,n,i,a){const s=r in n,o=a==="optional";if(!(!s&&o&&i==="optional")){if(t.issues.length){if(i!==void 0&&o&&!s)return;e.issues.push(...$y(r,t.issues))}if(!s&&i===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?(s||i==="defaulted"&&!o)&&(e.value[r]=void 0):e.value[r]=t.value}}const f_t=[];function gAe(t){var s,o,l,u;const e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),n=r.length?r:f_t,i=n.length?[...e,...n]:e;for(const h of i)if(!((u=(l=(o=(s=t.shape)==null?void 0:s[h])==null?void 0:o._zod)==null?void 0:l.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${String(h)}": expected a Zod schema`);const a=JNt(t.shape);return{...t,allKeys:i,symbolKeys:n,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(a)}}function mAe(t,e,r,n,i,a,s){const o=[],l=i.keySet,u=i.catchall._zod,h=u.def.type,d=u.optin,f=u.optout;let p=0;for(const g in e){if(s&&r.issues.length!==p){if(l0(r,p))break;p=r.issues.length}if(l.has(g))continue;if(g==="__proto__"){h==="never"&&o.push(g);continue}if(h==="never"){o.push(g);continue}const m=u.run({value:e[g],issues:[]},n);m instanceof Promise?t.push(m.then(U=>vI(U,r,g,e,d,f))):vI(m,r,g,e,d,f)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:a,continue:!0}),t.length?Promise.all(t).then(()=>r):r}const p_t=wt("$ZodObject",(t,e)=>{ka.init(t,e);const r=Object.getOwnPropertyDescriptor(e,"shape"),n=r!=null&&r.get?r.get.raw:e.shape??{};if(n){const u=()=>{const h={...n};return Object.defineProperty(e,"shape",{value:h}),u.raw=h,h};u.raw=n,Object.defineProperty(e,"shape",{get:u})}const i=jO(()=>gAe(e));fi(t,"propValues",u=>{const h=u.def.shape,d={};for(const f in h){const p=h[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(d,f)||sp(d,f,new Set);for(const g of p.values)d[f].add(g);p.optin!==void 0&&d[f].add(void 0)}}return d});const a=NT,s=e.catchall;let o;const l=Vh.memoizer;l==null||l.attach(t),t._zod.parse=(u,h)=>{o??(o=i.value);const d=u.value;if(!a(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),u;u.value=l?l.alloc(t,u,{},h):{};const f=[],p=o.shape,g=h==null?void 0:h.abortEarly;let m=u.issues.length;for(const U of o.allKeys){if(g&&u.issues.length!==m){if(l0(u,m))break;m=u.issues.length}if(U==="__proto__")continue;const y=p[U],b=y._zod.optin,v=y._zod.optout,w=y._zod.run({value:d[U],issues:[]},h);w instanceof Promise?f.push(w.then(T=>vI(T,u,U,d,b,v))):vI(w,u,U,d,b,v)}return s?mAe(f,d,u,h,i.value,t,g===!0):f.length?Promise.all(f).then(()=>u):u}}),g_t=wt("$ZodObjectJIT",(t,e)=>{p_t.init(t,e);const r=t._zod.parse,n=jO(()=>gAe(e)),i=Vh.memoizer,a=p=>{var T,k;const g=n.value,m=g.symbolKeys,U=new kOt(["payload","ctx"],{shape:p,inst:t,memo:i,syms:m}),y=C=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,b=(C,S)=>` + let ${C}_ab = false; + for (let i = 0; i < ${C}.issues.length; i++) { + const iss = ${C}.issues[i]; + iss.path = iss.path ? [${S}, ...iss.path] : [${S}]; payload.issues.push(iss); - if (iss.continue !== true) ${k}_ab = true; + if (iss.continue !== true) ${C}_ab = true; } - if (${k}_ab && ctx && ctx.abortEarly) { + if (${C}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;y.write("const input = payload.value;");const x=Object.create(null);let T=0;for(const k of g.allKeys)x[k]=`key_${T++}`;y.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const k of g.allKeys){if(k==="__proto__")continue;const E=x[k],A=typeof k=="symbol"?`syms[${m.indexOf(k)}]`:yNt(k),M=`${A} in input`,R=p[k],P=(C=R==null?void 0:R._zod)==null?void 0:C.optin,N=P!==void 0,L=((S=R==null?void 0:R._zod)==null?void 0:S.optout)==="optional";if(y.write(`const ${E} = ${v(A)};`),N&&L){const I=P==="optional"?`${E}_present`:`${E}.value !== undefined || ${E}_present`;y.write(` - const ${E}_present = ${M}; - if (!${E}.issues.length || ${E}_present) { - if (${E}.issues.length) {${b(E,A)} + }`;U.write("const input = payload.value;");const v=Object.create(null);let w=0;for(const C of g.allKeys)v[C]=`key_${w++}`;U.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const C of g.allKeys){if(C==="__proto__")continue;const S=v[C],E=typeof C=="symbol"?`syms[${m.indexOf(C)}]`:YNt(C),A=`${E} in input`,R=p[C],_=(T=R==null?void 0:R._zod)==null?void 0:T.optin,N=_!==void 0,L=((k=R==null?void 0:R._zod)==null?void 0:k.optout)==="optional";if(U.write(`const ${S} = ${y(E)};`),N&&L){const I=_==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;U.write(` + const ${S}_present = ${A}; + if (!${S}.issues.length || ${S}_present) { + if (${S}.issues.length) {${b(S,E)} } if (${I}) { - newResult[${A}] = ${E}.value; + newResult[${E}] = ${S}.value; } } - `)}else N?(y.write(` - if (${E}.issues.length) {${b(E,A)} + `)}else N?(U.write(` + if (${S}.issues.length) {${b(S,E)} } - `),P==="defaulted"?y.write(`newResult[${A}] = ${E}.value;`):y.write(` - if (${E}.value !== undefined || ${M}) { - newResult[${A}] = ${E}.value; + `),_==="defaulted"?U.write(`newResult[${E}] = ${S}.value;`):U.write(` + if (${S}.value !== undefined || ${A}) { + newResult[${E}] = ${S}.value; } - `)):y.write(` - const ${E}_present = ${M}; - if (${E}.issues.length) {${b(E,A)} + `)):U.write(` + const ${S}_present = ${A}; + if (${S}.issues.length) {${b(S,E)} } - if (!${E}_present && !${E}.issues.length) { + if (!${S}_present && !${S}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${A}] + path: [${E}] }); if (ctx && ctx.abortEarly) { payload.value = newResult; @@ -1565,13 +2235,13 @@ ${r.join(` } } - if (${E}_present) { - newResult[${A}] = ${E}.value; + if (${S}_present) { + newResult[${E}] = ${S}.value; } - `)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()};let a;const o=R6,l=!Hh.jitless,h=l&&bNt.value,d=e.catchall;let f;t._zod.parse=(p,g)=>{f??(f=n.value);const m=p.value;return o(m)?l&&h&&(g==null?void 0:g.async)===!1&&g.jitless!==!0?(a||(a=s(e.shape)),p=a(p,g),d?sRe([],m,p,g,f,t,(g==null?void 0:g.abortEarly)===!0):p):r(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function ffe(t,e,r,n){for(const s of t)if(s.issues.length===0)return e.value=s.value,e;const i=t.filter(s=>!o0(s));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(s=>s.issues.map(a=>Wg(a,n,Yd())))}),e)}const aRe=Tt("$ZodUnion",(t,e)=>{Es.init(t,e),di(t,"optin",n=>n.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":n.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),di(t,"optout",n=>n.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),di(t,"values",n=>{if(n.def.options.every(i=>i._zod.values))return new Set(n.def.options.flatMap(i=>Array.from(i._zod.values)))}),di(t,"pattern",n=>{if(n.def.options.every(i=>i._zod.pattern)){const i=n.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>wee(s.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 s=!1;const a=[];for(const o of e.options){const l=o._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(o=>ffe(o,n,t,i)):ffe(a,n,t,i)}});function FDt(t){var r;const e=new Map;for(const n of t.options){const i=(r=n._zod.propValues)==null?void 0:r[t.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const s of i)if(e.has(s)){if(s!==void 0)throw new Error(`Duplicate discriminator value "${String(s)}"`);e.set(s,null)}else e.set(s,n)}return e}const zDt=Tt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,aRe.init(t,e);const r=t._zod.parse;di(t,"propValues",i=>{var o,l;const s={};let a=0;for(const u of i.def.options){const h=u._zod.propValues;if(!h||Object.keys(h).length===0)throw new Error(`Invalid discriminated union option at index "${i.def.options.indexOf(u)}"`);(o=h[i.def.discriminator])!=null&&o.has(void 0)&&a++;for(const[d,f]of Object.entries(h)){Object.prototype.hasOwnProperty.call(s,d)||sp(s,d,new Set);for(const p of f)s[d].add(p)}}return!i.def.unionFallback&&a>1&&((l=s[i.def.discriminator])==null||l.delete(void 0)),s}),e.options.forEach((i,s)=>{const a=Tee(i._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,e.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});const n=WD(()=>FDt(e));t._zod.parse=(i,s)=>{const a=i.value;if(!R6(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=a==null?void 0:a[e.discriminator],l=n.value.get(o);return l&&(o!==void 0||s.direction!=="backward")?l._zod.run(i,s):e.unionFallback||s.direction==="backward"?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:a,path:[e.discriminator],inst:t}),i)}}),VDt=Tt("$ZodIntersection",(t,e)=>{Es.init(t,e),t._zod.parse=(r,n)=>{const i=r.value,s=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([l,u])=>pfe(r,l,u)):pfe(r,s,a)}});function tU(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(U5(t)&&U5(e)){const r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),i={...t,...e};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(const s of n){if(s==="__proto__")continue;const a=tU(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.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;n{var f,p;let d;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))i??(i=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const g=String(u.path[0]);s.has(g)||s.set(g,u),d=[g]}else return!1;for(const g of d)n.has(g)||n.set(g,{}),n.get(g)[h]=!0;return!0};for(const u of e.issues)a(u,"l")||t.issues.push(u);for(const u of r.issues)a(u,"r")||t.issues.push(u);const o=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(o.length){const u=i?o.filter(h=>i.keys.includes(h)):[];u.length&&t.issues.push({...i,keys:u});for(const h of o)!u.includes(h)&&s.has(h)&&t.issues.push(s.get(h))}const l=tU(e.value,r.value);if(!l.valid){if(o0(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return t.value=l.data,t}const HDt=Tt("$ZodRecord",(t,e)=>{Es.init(t,e);const r=Hh.memoizer;r==null||r.attach(t),t._zod.parse=(n,i)=>{const s=n.value;if(!U5(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),n;const a=[],o=e.keyType._zod.values;if(o&&!e.partial){n.value=r?r.alloc(t,n,{},i):{};const l=new Set;for(const h of o)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){if(l.add(typeof h=="number"?h.toString():h),h==="__proto__")continue;const d=e.keyType._zod.run({value:h,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>Wg(g,i,Yd())),input:h,path:[h],inst:t});continue}const f=d.value;if(f==="__proto__")continue;const p=e.valueType._zod.run({value:s[h],issues:[]},i);p instanceof Promise?a.push(p.then(g=>{g.issues.length&&n.issues.push(...Db(h,g.issues)),n.value[f]=g.value})):(p.issues.length&&n.issues.push(...Db(h,p.issues)),n.value[f]=p.value)}let u;for(const h in s)if(!l.has(h))if(e.mode==="loose"){if(h==="__proto__")continue;n.value[h]=s[h]}else u=u??[],u.push(h);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:u,continue:!0})}else{n.value=r?r.alloc(t,n,{},i):{};let l;for(const u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let h=e.keyType._zod.run({value:u,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ree.test(u)&&h.issues.length){const g=e.keyType._zod.run({value:Number(u),issues:[]},i);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(h=g)}if(h.issues.length){e.mode==="loose"?n.value[u]=s[u]:o?(l=l??[],l.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(g=>Wg(g,i,Yd())),input:u,path:[u],inst:t});continue}const f=h.value;if(f==="__proto__")continue;const p=e.valueType._zod.run({value:s[u],issues:[]},i);p instanceof Promise?a.push(p.then(g=>{g.issues.length&&n.issues.push(...Db(u,g.issues)),n.value[f]=g.value})):(p.issues.length&&n.issues.push(...Db(u,p.issues)),n.value[f]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}}),GDt=Tt("$ZodEnum",(t,e)=>{Es.init(t,e);const r=Zq(e.entries),n=new Set(r);t._zod.values=n,di(t,"pattern",i=>{const s=Zq(i.def.entries).filter(a=>xNt.has(typeof a));return new RegExp(s.length?`^(${s.map(a=>j5(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(i,s)=>{const a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:t}),i}}),WDt=Tt("$ZodLiteral",(t,e)=>{Es.init(t,e);const r=new Set(e.values);t._zod.values=r,di(t,"pattern",n=>{const i=n.def.values;return new RegExp(i.length?`^(${i.map(s=>typeof s=="string"?j5(s):s?j5(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(n,i)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}}),qDt=Tt("$ZodTransform",(t,e)=>{var r;Es.init(t,e),t._zod.optin="optional",(r=Hh.memoizer)==null||r.guard(t),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new qMe(t.constructor.name);const s=e.transform(n.value,n);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new My;return n.value=s,n}});function gfe(t,e){return t.value=e.issues.length?void 0:e.value,t}const oRe=Tt("$ZodOptional",(t,e)=>{Es.init(t,e),di(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",di(t,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),di(t,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${wee(n.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(r.value===void 0){if(e.innerType._zod.optin!=="defaulted")return r;const i=e.innerType._zod.run({value:r.value,issues:[]},n);return i instanceof Promise?i.then(s=>gfe(r,s)):gfe(r,i)}return e.innerType._zod.run(r,n)}}),UDt=Tt("$ZodExactOptional",(t,e)=>{oRe.init(t,e),di(t,"values",r=>r.def.innerType._zod.values),di(t,"pattern",r=>r.def.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),jDt=Tt("$ZodNullable",(t,e)=>{Es.init(t,e),di(t,"optin",r=>r.def.innerType._zod.optin),di(t,"optout",r=>r.def.innerType._zod.optout),di(t,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${wee(n.source)}|null)$`):void 0}),di(t,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),YDt=Tt("$ZodDefault",(t,e)=>{Es.init(t,e),t._zod.optin="defaulted",di(t,"values",r=>r.def.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(s=>mfe(s,e)):mfe(i,e)}});function mfe(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const XDt=Tt("$ZodPrefault",(t,e)=>{Es.init(t,e),t._zod.optin="defaulted",di(t,"values",r=>r.def.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))}),KDt=Tt("$ZodNonOptional",(t,e)=>{Es.init(t,e),di(t,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>yfe(s,t)):yfe(i,t)}});function yfe(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function vfe(t,e,r,n){return e.issues.length?(t.value=r.catchValue({...e,value:t.value,error:{issues:e.issues.map(i=>Wg(i,n,Yd()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const ZDt=Tt("$ZodCatch",(t,e)=>{Es.init(t,e),di(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),di(t,"optout",r=>r.def.innerType._zod.optout),di(t,"values",r=>r.def.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({value:r.value,issues:[]},n);return i instanceof Promise?i.then(s=>vfe(r,s,e,n)):vfe(r,i,e,n)}}),QDt=Tt("$ZodPipe",(t,e)=>{Es.init(t,e),di(t,"values",r=>r.def.in._zod.values),di(t,"optin",r=>r.def.in._zod.optin),di(t,"optout",r=>r.def.out._zod.optout),di(t,"propValues",r=>r.def.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=e.out._zod.run(r,n);return s instanceof Promise?s.then(a=>eM(a,e.in,n)):eM(s,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>eM(s,e.out,n)):eM(i,e.out,n)}});function eM(t,e,r){return t.issues.some(n=>n.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}const JDt=Tt("$ZodReadonly",(t,e)=>{Es.init(t,e),di(t,"propValues",r=>r.def.innerType._zod.propValues),di(t,"values",r=>r.def.innerType._zod.values),di(t,"optin",r=>{var n,i;return(i=(n=r.def.innerType)==null?void 0:n._zod)==null?void 0:i.optin}),di(t,"optout",r=>{var n,i;return(i=(n=r.def.innerType)==null?void 0:n._zod)==null?void 0:i.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(bfe):bfe(i)}});function bfe(t){return t.memo||(t.value=Object.freeze(t.value)),t}const ePt=Tt("$ZodCustom",(t,e)=>{Rc.init(t,e),Es.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(s=>xfe(s,r,n,t));xfe(i,r,n,t)}});function xfe(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(_6(i))}}class tPt extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const rU="~memo",wfe=[];function lRe(t){return t!==null&&typeof t=="object"}function ez(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const cRe=new WeakMap,Hk=0,YR=1,ZS=2;function XR(t,e,r){const n=cRe.get(t);if(n!==void 0)return n?ZS:Hk;if(e.has(t))return ZS;e.add(t);let i=Hk;const s=h=>{if(i!==ZS&&(h!=null&&h._zod)){const d=XR(h,e);d>i&&(i=d)}},a=(h,d)=>{var p;let f=Hk;for(const g of Reflect.ownKeys(h)){const m=Object.getOwnPropertyDescriptor(h,g);if(!m.enumerable)continue;const y=m.get?YR:(p=m.value)!=null&&p._zod?XR(m.value,e):Hk;y>f&&(f=y)}return f},o=h=>{h>i&&(i=h)},l=t._zod.def;switch(l.type){case"object":{const h=Tee(l);o(h?a(h):YR),s(l.catchall);break}case"array":s(l.element);break;case"tuple":for(const h of l.items)s(h);s(l.rest);break;case"record":case"map":s(l.keyType),s(l.valueType);break;case"set":s(l.valueType);break;case"union":for(const h of l.options)s(h);break;case"intersection":s(l.left),s(l.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(l.innerType);break;case"pipe":s(l.in),s(l.out);break;case"function":s(l.input),s(l.output);break;case"lazy":{const h=l._cachedInner??void 0;o(h?XR(h,e):YR);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const h in l){const d=Object.getOwnPropertyDescriptor(l,h);if(!d||d.get)continue;const f=d.value;if(!(!f||typeof f!="object")){if(f._zod)s(f);else if(Array.isArray(f))for(const p of f)s(p)}}}return e.delete(t),rPt(t,i)}function rPt(t,e){return e!==YR&&cRe.set(t,e===ZS),e}function nPt(t,e){let r=t.buckets.get(e);return r||(r=new WeakMap,t.buckets.set(e,r)),r}let tM;const rM=[],iPt={alloc(t,e,r){const n=tM;if(!n)return r;tM=void 0;const i={value:r,issues:null};return n.set(e.value,i),rM.push(i),r},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const r=t._zod.parse,n=(i,s)=>{if(s.direction!=="backward"&&aPt(s,i.value))throw new tPt;return r(i,s)};t._zod.parse=n,t._zod.run===r&&(t._zod.run=n)})},attach(t){var e;let r,n=!1,i,s;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const a=t._zod.parse,o=(l,u)=>{if(r===void 0){const v=XR(t,new Set);if(v===Hk)return t._zod.parse=a,t._zod.run===o&&(t._zod.run=a),a(l,u);v===ZS||n?r=!0:n=!0}const h=l.value;if(!lRe(h))return a(l,u);let d=u[rU];d||(d={buckets:new WeakMap,backEdges:void 0},u[rU]=d);let f;i===u?f=s:(f=nPt(d,t),i=u,s=f);const p=f.get(h);if(p)return l.value=p.value,p.issues?p.issues.length&&l.issues.push(...ez(p.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(p.value)),l;tM=f;const g=rM.length,m=a(l,u);tM=void 0;const y=rM.length>g?rM.pop():void 0;return m instanceof Promise?m.then(v=>(y&&(y.issues=v.issues.length?ez(v.issues):wfe),v)):(y&&(y.issues=m.issues.length?ez(m.issues):wfe),m)};t._zod.parse=o,t._zod.run===a&&(t._zod.run=o)})}};function sPt(){return iPt}function aPt(t,e){var n;const r=(n=t[rU])==null?void 0:n.backEdges;return r!==void 0&&lRe(e)&&r.has(e)}const oPt=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(s){return t[s]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function i(s,a){return s==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):n[s]??s}return s=>{switch(s.code){case"invalid_type":{const a=i(s.expected),o=LNt(s.input),l=i(o,s.input);return`Invalid input: expected ${a}, received ${l}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${zMe(s.values[0])}`:`Invalid option: expected one of ${ife(s.values,"|")}`;case"too_big":{const a=s.exact?"exactly ":s.inclusive?"<=":"<",o=e(s.origin);return o?`Too big: expected ${s.origin??"value"} to have ${a}${s.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${a}${s.maximum.toString()}`}case"too_small":{const a=s.exact?"exactly ":s.inclusive?">=":">",o=e(s.origin);return o?`Too small: expected ${s.origin} to have ${a}${s.minimum.toString()} ${o.unit}`:`Too small: expected ${s.origin} to be ${a}${s.minimum.toString()}`}case"invalid_format":{const a=s;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ife(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(o=>`'${o}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function lPt(){return{localeError:oPt()}}var Tfe;class cPt{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 uPt(){return new cPt}(Tfe=globalThis).__zod_globalRegistry??(Tfe.__zod_globalRegistry=uPt());const Gk=globalThis.__zod_globalRegistry;function uRe(t){return t.checks&&(t.checks=[...t.checks]),t}function hPt(t,e){return new t(uRe({type:"string",...Rr(e)}))}function dPt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Rr(e)})}function fPt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Rr(e)})}function pPt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Rr(e)})}function gPt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Rr(e)})}function mPt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Rr(e)})}function yPt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Rr(e)})}function vPt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Rr(e)})}function bPt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Rr(e)})}function xPt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Rr(e)})}function wPt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Rr(e)})}function TPt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Rr(e)})}function CPt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Rr(e)})}function kPt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Rr(e)})}function SPt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Rr(e)})}function EPt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Rr(e)})}function APt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Rr(e)})}function MPt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Rr(e)})}function RPt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Rr(e)})}function _Pt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Rr(e)})}function LPt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Rr(e)})}function IPt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Rr(e)})}function NPt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Rr(e)})}function OPt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Rr(e)})}function DPt(t,e){return new t({type:"string",format:"date",check:"string_format",...Rr(e)})}function PPt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Rr(e)})}function $Pt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Rr(e)})}function BPt(t,e){return new t(uRe({type:"number",checks:[],...Rr(e)}))}function FPt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Rr(e)})}function zPt(t,e){return new t({type:"boolean",...Rr(e)})}function VPt(t){return new t({type:"unknown"})}function HPt(t,e){return new t({type:"never",...Rr(e)})}function Cfe(t,e){return new YMe({check:"less_than",...Rr(e),value:t,inclusive:!1})}function tz(t,e){return new YMe({check:"less_than",...Rr(e),value:t,inclusive:!0})}function kfe(t,e){return new XMe({check:"greater_than",...Rr(e),value:t,inclusive:!1})}function rz(t,e){return new XMe({check:"greater_than",...Rr(e),value:t,inclusive:!0})}function Sfe(t,e){return new POt({check:"multiple_of",...Rr(e),value:t})}function hRe(t,e){return new BOt({check:"max_length",...Rr(e),maximum:t})}function yI(t,e){return new FOt({check:"min_length",...Rr(e),minimum:t})}function dRe(t,e){return new zOt({check:"length_equals",...Rr(e),length:t})}function GPt(t,e){return new VOt({check:"string_format",format:"regex",...Rr(e),pattern:t})}function WPt(t){return new HOt({check:"string_format",format:"lowercase",...Rr(t)})}function qPt(t){return new GOt({check:"string_format",format:"uppercase",...Rr(t)})}function UPt(t,e){return new WOt({check:"string_format",format:"includes",...Rr(e),includes:t})}function jPt(t,e){return new qOt({check:"string_format",format:"starts_with",...Rr(e),prefix:t})}function YPt(t,e){return new UOt({check:"string_format",format:"ends_with",...Rr(e),suffix:t})}function Z3(t){return new jOt({check:"overwrite",tx:t})}function XPt(t){return Z3(e=>e.normalize(t))}function KPt(){return Z3(t=>t.trim())}function ZPt(){return Z3(t=>t.toLowerCase())}function QPt(){return Z3(t=>t.toUpperCase())}function JPt(){return Z3(t=>vNt(t))}function e$t(t,e,r){return new t({type:"array",element:e,...Rr(r)})}function t$t(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Rr(r)})}function r$t(t,e){const r=n$t(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(_6(i,n.value,r._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(_6(s))}},t(n.value,n)),e);return r}function n$t(t,e){const r=new Rc({check:"custom",...Rr(e)});return r._zod.check=t,r}function QS(t,...e){for(const r of e)for(const n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&sp(t,n,r[n]);return t}function fRe(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)??Gk,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,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function Ug(t,e,r,n,i){const s=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:n.path,message:i}):e.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(i);return Object.assign(r,s),!0}function ma(t,e,r={path:[],schemaPath:[]}){var h,d;var n;const i=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const o=(d=(h=t._zod).toJSONSchema)==null?void 0:d.call(h);if(o)a.schema=o;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,f);else{const g=a.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&&(a.ref||(a.ref=p),ma(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&QS(a.schema,l),e.io==="input"&&ml(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function Efe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function pRe(t,e){var a,o,l,u;const r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const n=new Map;for(const h of t.seen.entries()){const d=(a=t.metadataRegistry.get(h[0]))==null?void 0:a.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??(x=>x);if(y)return{ref:v(y)};const b=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=b,{defId:b,ref:`${v("__shared")}#/${d}/${Efe(b)}`}}const f="#",p=`${f}/${d}/`;if(h[1]===r&&!h[1].schema.id)return{ref:f};const g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+Efe(g)}},s=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("/")}/ + `)}return U.write("payload.value = newResult;"),U.write("return payload;"),U.compile()};let s;const o=NT,l=!Vh.jitless,h=l&&KNt.value,d=e.catchall;let f;t._zod.parse=(p,g)=>{f??(f=n.value);const m=p.value;return o(m)?l&&h&&(g==null?void 0:g.async)===!1&&g.jitless!==!0?(s||(s=a(e.shape)),p=s(p,g),d?mAe([],m,p,g,f,t,(g==null?void 0:g.abortEarly)===!0):p):r(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function kfe(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=>!l0(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=>qg(s,n,Xd())))}),e)}const UAe=wt("$ZodUnion",(t,e)=>{ka.init(t,e),fi(t,"optin",n=>n.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":n.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),fi(t,"optout",n=>n.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),fi(t,"values",n=>{if(n.def.options.every(i=>i._zod.values))return new Set(n.def.options.flatMap(i=>Array.from(i._zod.values)))}),fi(t,"pattern",n=>{if(n.def.options.every(i=>i._zod.pattern)){const i=n.def.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Aee(a.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=>kfe(o,n,t,i)):kfe(s,n,t,i)}});function m_t(t){var r;const e=new Map;for(const n of t.options){const i=(r=n._zod.propValues)==null?void 0:r[t.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const a of i)if(e.has(a)){if(a!==void 0)throw new Error(`Duplicate discriminator value "${String(a)}"`);e.set(a,null)}else e.set(a,n)}return e}const U_t=wt("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,UAe.init(t,e);const r=t._zod.parse;fi(t,"propValues",i=>{var o,l;const a={};let s=0;for(const u of i.def.options){const h=u._zod.propValues;if(!h||Object.keys(h).length===0)throw new Error(`Invalid discriminated union option at index "${i.def.options.indexOf(u)}"`);(o=h[i.def.discriminator])!=null&&o.has(void 0)&&s++;for(const[d,f]of Object.entries(h)){Object.prototype.hasOwnProperty.call(a,d)||sp(a,d,new Set);for(const p of f)a[d].add(p)}}return!i.def.unionFallback&&s>1&&((l=a[i.def.discriminator])==null||l.delete(void 0)),a}),e.options.forEach((i,a)=>{const s=Mee(i._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,e.discriminator))throw new Error(`Invalid discriminated union option at index "${a}"`)});const n=jO(()=>m_t(e));t._zod.parse=(i,a)=>{const s=i.value;if(!NT(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;const o=s==null?void 0:s[e.discriminator],l=n.value.get(o);return l&&(o!==void 0||a.direction!=="backward")?l._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()).filter(u=>n.value.get(u)!==null),input:s,path:[e.discriminator],inst:t}),i)}}),y_t=wt("$ZodIntersection",(t,e)=>{ka.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])=>Sfe(r,l,u)):Sfe(r,a,s)}});function lq(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(Kv(t)&&Kv(e)){const r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(const a of n){if(a==="__proto__")continue;const s=lq(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;n{var f,p;let d;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))i??(i=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const g=String(u.path[0]);a.has(g)||a.set(g,u),d=[g]}else return!1;for(const g of d)n.has(g)||n.set(g,{}),n.get(g)[h]=!0;return!0};for(const u of e.issues)s(u,"l")||t.issues.push(u);for(const u of r.issues)s(u,"r")||t.issues.push(u);const o=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(o.length){const u=i?o.filter(h=>i.keys.includes(h)):[];u.length&&t.issues.push({...i,keys:u});for(const h of o)!u.includes(h)&&a.has(h)&&t.issues.push(a.get(h))}const l=lq(e.value,r.value);if(!l.valid){if(l0(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return t.value=l.data,t}const b_t=wt("$ZodRecord",(t,e)=>{ka.init(t,e);const r=Vh.memoizer;r==null||r.attach(t),t._zod.parse=(n,i)=>{const a=n.value;if(!Kv(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:t}),n;const s=[],o=e.keyType._zod.values;if(o&&!e.partial){n.value=r?r.alloc(t,n,{},i):{};const l=new Set;for(const h of o)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){if(l.add(typeof h=="number"?h.toString():h),h==="__proto__")continue;const d=e.keyType._zod.run({value:h,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>qg(g,i,Xd())),input:h,path:[h],inst:t});continue}const f=d.value;if(f==="__proto__")continue;const p=e.valueType._zod.run({value:a[h],issues:[]},i);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...$y(h,g.issues)),n.value[f]=g.value})):(p.issues.length&&n.issues.push(...$y(h,p.issues)),n.value[f]=p.value)}let u;for(const h in a)if(!l.has(h))if(e.mode==="loose"){if(h==="__proto__")continue;n.value[h]=a[h]}else u=u??[],u.push(h);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:u,continue:!0})}else{n.value=r?r.alloc(t,n,{},i):{};let l;for(const u of Reflect.ownKeys(a)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,u))continue;let h=e.keyType._zod.run({value:u,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&_ee.test(u)&&h.issues.length){const g=e.keyType._zod.run({value:Number(u),issues:[]},i);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(h=g)}if(h.issues.length){e.mode==="loose"?n.value[u]=a[u]:o?(l=l??[],l.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(g=>qg(g,i,Xd())),input:u,path:[u],inst:t});continue}const f=h.value;if(f==="__proto__")continue;const p=e.valueType._zod.run({value:a[u],issues:[]},i);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...$y(u,g.issues)),n.value[f]=g.value})):(p.issues.length&&n.issues.push(...$y(u,p.issues)),n.value[f]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:t,keys:l,continue:!0})}return s.length?Promise.all(s).then(()=>n):n}}),v_t=wt("$ZodEnum",(t,e)=>{ka.init(t,e);const r=iq(e.entries),n=new Set(r);t._zod.values=n,fi(t,"pattern",i=>{const a=iq(i.def.entries).filter(s=>ZNt.has(typeof s));return new RegExp(a.length?`^(${a.map(s=>Zv(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),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}}),x_t=wt("$ZodLiteral",(t,e)=>{ka.init(t,e);const r=new Set(e.values);t._zod.values=r,fi(t,"pattern",n=>{const i=n.def.values;return new RegExp(i.length?`^(${i.map(a=>typeof a=="string"?Zv(a):a?Zv(a.toString()):String(a)).join("|")})$`:"^[^\\s\\S]$")}),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}}),w_t=wt("$ZodTransform",(t,e)=>{var r;ka.init(t,e),t._zod.optin="optional",(r=Vh.memoizer)==null||r.guard(t),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new rAe(t.constructor.name);const a=e.transform(n.value,n);if(i.async)return(a instanceof Promise?a:Promise.resolve(a)).then(o=>(n.value=o,n));if(a instanceof Promise)throw new LU;return n.value=a,n}});function Efe(t,e){return t.value=e.issues.length?void 0:e.value,t}const yAe=wt("$ZodOptional",(t,e)=>{ka.init(t,e),fi(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",fi(t,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),fi(t,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Aee(n.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(r.value===void 0){if(e.innerType._zod.optin!=="defaulted")return r;const i=e.innerType._zod.run({value:r.value,issues:[]},n);return i instanceof Promise?i.then(a=>Efe(r,a)):Efe(r,i)}return e.innerType._zod.run(r,n)}}),T_t=wt("$ZodExactOptional",(t,e)=>{yAe.init(t,e),fi(t,"values",r=>r.def.innerType._zod.values),fi(t,"pattern",r=>r.def.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),C_t=wt("$ZodNullable",(t,e)=>{ka.init(t,e),fi(t,"optin",r=>r.def.innerType._zod.optin),fi(t,"optout",r=>r.def.innerType._zod.optout),fi(t,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Aee(n.source)}|null)$`):void 0}),fi(t,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),k_t=wt("$ZodDefault",(t,e)=>{ka.init(t,e),t._zod.optin="defaulted",fi(t,"values",r=>r.def.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=>Afe(a,e)):Afe(i,e)}});function Afe(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const S_t=wt("$ZodPrefault",(t,e)=>{ka.init(t,e),t._zod.optin="defaulted",fi(t,"values",r=>r.def.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))}),E_t=wt("$ZodNonOptional",(t,e)=>{ka.init(t,e),fi(t,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,n)=>{const i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Mfe(a,t)):Mfe(i,t)}});function Mfe(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Rfe(t,e,r,n){return e.issues.length?(t.value=r.catchValue({...e,value:t.value,error:{issues:e.issues.map(i=>qg(i,n,Xd()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const A_t=wt("$ZodCatch",(t,e)=>{ka.init(t,e),fi(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),fi(t,"optout",r=>r.def.innerType._zod.optout),fi(t,"values",r=>r.def.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({value:r.value,issues:[]},n);return i instanceof Promise?i.then(a=>Rfe(r,a,e,n)):Rfe(r,i,e,n)}}),M_t=wt("$ZodPipe",(t,e)=>{ka.init(t,e),fi(t,"values",r=>r.def.in._zod.values),fi(t,"optin",r=>r.def.in._zod.optin),fi(t,"optout",r=>r.def.out._zod.optout),fi(t,"propValues",r=>r.def.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=>nE(s,e.in,n)):nE(a,e.in,n)}const i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>nE(a,e.out,n)):nE(i,e.out,n)}});function nE(t,e,r){return t.issues.some(n=>n.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}const R_t=wt("$ZodReadonly",(t,e)=>{ka.init(t,e),fi(t,"propValues",r=>r.def.innerType._zod.propValues),fi(t,"values",r=>r.def.innerType._zod.values),fi(t,"optin",r=>{var n,i;return(i=(n=r.def.innerType)==null?void 0:n._zod)==null?void 0:i.optin}),fi(t,"optout",r=>{var n,i;return(i=(n=r.def.innerType)==null?void 0:n._zod)==null?void 0:i.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(Lfe):Lfe(i)}});function Lfe(t){return t.memo||(t.value=Object.freeze(t.value)),t}const L_t=wt("$ZodCustom",(t,e)=>{Mc.init(t,e),ka.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=>Ife(a,r,n,t));Ife(i,r,n,t)}});function Ife(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(DT(i))}}class I_t extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const cq="~memo",Nfe=[];function bAe(t){return t!==null&&typeof t=="object"}function aF(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const vAe=new WeakMap,W3=0,ZA=1,tw=2;function JA(t,e,r){const n=vAe.get(t);if(n!==void 0)return n?tw:W3;if(e.has(t))return tw;e.add(t);let i=W3;const a=h=>{if(i!==tw&&(h!=null&&h._zod)){const d=JA(h,e);d>i&&(i=d)}},s=(h,d)=>{var p;let f=W3;for(const g of Reflect.ownKeys(h)){const m=Object.getOwnPropertyDescriptor(h,g);if(!m.enumerable)continue;const U=m.get?ZA:(p=m.value)!=null&&p._zod?JA(m.value,e):W3;U>f&&(f=U)}return f},o=h=>{h>i&&(i=h)},l=t._zod.def;switch(l.type){case"object":{const h=Mee(l);o(h?s(h):ZA),a(l.catchall);break}case"array":a(l.element);break;case"tuple":for(const h of l.items)a(h);a(l.rest);break;case"record":case"map":a(l.keyType),a(l.valueType);break;case"set":a(l.valueType);break;case"union":for(const h of l.options)a(h);break;case"intersection":a(l.left),a(l.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":a(l.innerType);break;case"pipe":a(l.in),a(l.out);break;case"function":a(l.input),a(l.output);break;case"lazy":{const h=l._cachedInner??void 0;o(h?JA(h,e):ZA);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const h in l){const d=Object.getOwnPropertyDescriptor(l,h);if(!d||d.get)continue;const f=d.value;if(!(!f||typeof f!="object")){if(f._zod)a(f);else if(Array.isArray(f))for(const p of f)a(p)}}}return e.delete(t),N_t(t,i)}function N_t(t,e){return e!==ZA&&vAe.set(t,e===tw),e}function D_t(t,e){let r=t.buckets.get(e);return r||(r=new WeakMap,t.buckets.set(e,r)),r}let iE;const aE=[],O_t={alloc(t,e,r){const n=iE;if(!n)return r;iE=void 0;const i={value:r,issues:null};return n.set(e.value,i),aE.push(i),r},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const r=t._zod.parse,n=(i,a)=>{if(a.direction!=="backward"&&P_t(a,i.value))throw new I_t;return r(i,a)};t._zod.parse=n,t._zod.run===r&&(t._zod.run=n)})},attach(t){var e;let r,n=!1,i,a;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const s=t._zod.parse,o=(l,u)=>{if(r===void 0){const y=JA(t,new Set);if(y===W3)return t._zod.parse=s,t._zod.run===o&&(t._zod.run=s),s(l,u);y===tw||n?r=!0:n=!0}const h=l.value;if(!bAe(h))return s(l,u);let d=u[cq];d||(d={buckets:new WeakMap,backEdges:void 0},u[cq]=d);let f;i===u?f=a:(f=D_t(d,t),i=u,a=f);const p=f.get(h);if(p)return l.value=p.value,p.issues?p.issues.length&&l.issues.push(...aF(p.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(p.value)),l;iE=f;const g=aE.length,m=s(l,u);iE=void 0;const U=aE.length>g?aE.pop():void 0;return m instanceof Promise?m.then(y=>(U&&(U.issues=y.issues.length?aF(y.issues):Nfe),y)):(U&&(U.issues=m.issues.length?aF(m.issues):Nfe),m)};t._zod.parse=o,t._zod.run===s&&(t._zod.run=o)})}};function __t(){return O_t}function P_t(t,e){var n;const r=(n=t[cq])==null?void 0:n.backEdges;return r!==void 0&&bAe(e)&&r.has(e)}const B_t=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(a){return t[a]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function i(a,s){return a==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[a]??a}return a=>{switch(a.code){case"invalid_type":{const s=i(a.expected),o=lDt(a.input),l=i(o,a.input);return`Invalid input: expected ${s}, received ${l}`}case"invalid_value":return a.values.length===1?`Invalid input: expected ${ZEe(a.values[0])}`:`Invalid option: expected one of ${mfe(a.values,"|")}`;case"too_big":{const s=a.exact?"exactly ":a.inclusive?"<=":"<",o=e(a.origin);return o?`Too big: expected ${a.origin??"value"} to have ${s}${a.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${a.origin??"value"} to be ${s}${a.maximum.toString()}`}case"too_small":{const s=a.exact?"exactly ":a.inclusive?">=":">",o=e(a.origin);return o?`Too small: expected ${a.origin} to have ${s}${a.minimum.toString()} ${o.unit}`:`Too small: expected ${a.origin} to be ${s}${a.minimum.toString()}`}case"invalid_format":{const s=a;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??a.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${a.divisor}`;case"unrecognized_keys":return`Unrecognized key${a.keys.length>1?"s":""}: ${mfe(a.keys,", ")}`;case"invalid_key":return`Invalid key in ${a.origin}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Invalid discriminator value. Expected ${a.options.map(o=>`'${o}'`).join(" | ")}`:a.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${a.origin}`;default:return"Invalid input"}}};function $_t(){return{localeError:B_t()}}var Dfe;class F_t{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 z_t(){return new F_t}(Dfe=globalThis).__zod_globalRegistry??(Dfe.__zod_globalRegistry=z_t());const q3=globalThis.__zod_globalRegistry;function xAe(t){return t.checks&&(t.checks=[...t.checks]),t}function V_t(t,e){return new t(xAe({type:"string",...Rr(e)}))}function H_t(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Rr(e)})}function G_t(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Rr(e)})}function W_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Rr(e)})}function q_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Rr(e)})}function j_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Rr(e)})}function Y_t(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Rr(e)})}function X_t(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Rr(e)})}function K_t(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Rr(e)})}function Z_t(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Rr(e)})}function J_t(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Rr(e)})}function Q_t(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Rr(e)})}function ePt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Rr(e)})}function tPt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Rr(e)})}function rPt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Rr(e)})}function nPt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Rr(e)})}function iPt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Rr(e)})}function aPt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Rr(e)})}function sPt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Rr(e)})}function oPt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Rr(e)})}function lPt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Rr(e)})}function cPt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Rr(e)})}function uPt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Rr(e)})}function hPt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Rr(e)})}function dPt(t,e){return new t({type:"string",format:"date",check:"string_format",...Rr(e)})}function fPt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Rr(e)})}function pPt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Rr(e)})}function gPt(t,e){return new t(xAe({type:"number",checks:[],...Rr(e)}))}function mPt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Rr(e)})}function UPt(t,e){return new t({type:"boolean",...Rr(e)})}function yPt(t){return new t({type:"unknown"})}function bPt(t,e){return new t({type:"never",...Rr(e)})}function Ofe(t,e){return new aAe({check:"less_than",...Rr(e),value:t,inclusive:!1})}function sF(t,e){return new aAe({check:"less_than",...Rr(e),value:t,inclusive:!0})}function _fe(t,e){return new sAe({check:"greater_than",...Rr(e),value:t,inclusive:!1})}function oF(t,e){return new sAe({check:"greater_than",...Rr(e),value:t,inclusive:!0})}function Pfe(t,e){return new fOt({check:"multiple_of",...Rr(e),value:t})}function wAe(t,e){return new gOt({check:"max_length",...Rr(e),maximum:t})}function xI(t,e){return new mOt({check:"min_length",...Rr(e),minimum:t})}function TAe(t,e){return new UOt({check:"length_equals",...Rr(e),length:t})}function vPt(t,e){return new yOt({check:"string_format",format:"regex",...Rr(e),pattern:t})}function xPt(t){return new bOt({check:"string_format",format:"lowercase",...Rr(t)})}function wPt(t){return new vOt({check:"string_format",format:"uppercase",...Rr(t)})}function TPt(t,e){return new xOt({check:"string_format",format:"includes",...Rr(e),includes:t})}function CPt(t,e){return new wOt({check:"string_format",format:"starts_with",...Rr(e),prefix:t})}function kPt(t,e){return new TOt({check:"string_format",format:"ends_with",...Rr(e),suffix:t})}function e9(t){return new COt({check:"overwrite",tx:t})}function SPt(t){return e9(e=>e.normalize(t))}function EPt(){return e9(t=>t.trim())}function APt(){return e9(t=>t.toLowerCase())}function MPt(){return e9(t=>t.toUpperCase())}function RPt(){return e9(t=>XNt(t))}function LPt(t,e,r){return new t({type:"array",element:e,...Rr(r)})}function IPt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Rr(r)})}function NPt(t,e){const r=DPt(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(DT(i,n.value,r._zod.def));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(DT(a))}},t(n.value,n)),e);return r}function DPt(t,e){const r=new Mc({check:"custom",...Rr(e)});return r._zod.check=t,r}function rw(t,...e){for(const r of e)for(const n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&sp(t,n,r[n]);return t}function CAe(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)??q3,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,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",intersections:[],deferred:[],external:(t==null?void 0:t.external)??void 0}}function Yg(t,e,r,n,i){const a=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:n.path,message:i}):e.unrepresentable;if(a==="any")return!1;if(a===void 0||a==="throw")throw new Error(i);return Object.assign(r,a),!0}function ms(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),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;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),ms(p,e,f),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(t);return l&&rw(s.schema,l),e.io==="input"&&ml(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 Bfe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function kAe(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.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;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 U=(m=t.external.registry.get(h[0]))==null?void 0:m.id,y=t.external.uri??(v=>v);if(U)return{ref:y(U)};const b=h[1].defId??h[1].schema.id??`schema${t.counter++}`;return h[1].defId=b,{defId:b,ref:`${y("__shared")}#/${d}/${Bfe(b)}`}}const f="#",p=`${f}/${d}/`;if(h[1]===r&&!h[1].schema.id)return{ref:f};const g=h[1].schema.id??`__schema${t.counter++}`;return{defId:g,ref:p+Bfe(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]){s(h);continue}if(t.external){const p=(l=t.external.registry.get(h[0]))==null?void 0:l.id;if(e!==h[0]&&p){s(h);continue}}if((u=t.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(d.cycle){s(h);continue}d.count>1&&t.reused==="ref"&&s(h)}t.external&&(t.sharedDefsExtractedFor=t.external)}function gRe(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const r=[];for(const n of e){if(!n||typeof n!="object")return;gRe(n);const i=Object.keys(n);if(i.length!==1||i[0]!=="type")return;const s=n.type;for(const a of Array.isArray(s)?s:[s]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete t.anyOf,t.type=r.length===1?r[0]:r}const mRe=new Set(["type","properties","required","additionalProperties"]),Afe=["oneOf","anyOf"];function Mfe(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function nU(t){var s;const e=[];for(const a of t){if(typeof a!="object"||a.type!=="object")return null;for(const o in a)if(!mRe.has(o))return null;e.push(a)}const r={},n=new Set;for(const a of e){for(const o in a.properties){if(Object.prototype.hasOwnProperty.call(r,o))continue;const l=[];for(const h of e){const d=((s=h.properties)==null?void 0:s[o])??Mfe(h);d!=null&&(l.some(f=>JSON.stringify(f)===JSON.stringify(d))||l.push(d))}const u=l.length===1?l[0]:nU(l)??{allOf:l};sp(r,o,u)}for(const o of a.required??[])n.add(o)}const i={type:"object",properties:r};if(n.size&&(i.required=[...n]),e.every(a=>a.additionalProperties===!1))i.additionalProperties=!1;else{const a=[];for(const o of e){const l=Mfe(o);l&&!a.some(u=>JSON.stringify(u)===JSON.stringify(l))&&a.push(l)}a.length===1?i.additionalProperties=a[0]:a.length>1&&(i.additionalProperties={allOf:a})}return i}function i$t(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const i of mRe)if(i in t)return;const r=e.filter(i=>Afe.some(s=>Array.isArray(i[s])));let n=null;if(!r.length)n=nU(e);else{const i=r[0],s=Afe.find(l=>Array.isArray(i[l]));if(Object.keys(i).length!==1)return;const a=e.filter(l=>l!==i),o=i[s].map(l=>nU([...a,l]));if(o.some(l=>!l))return;n={[s]:o}}n&&(delete t.allOf,QS(t,n))}function yRe(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),b=v.schema;if(b.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(b)):QS(p,b),QS(p,g),d._zod.parent===m)for(const T in p)T==="$ref"||T==="allOf"||T in g||delete p[T];if(b.$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 b in p)b==="$ref"||b==="allOf"||b in v.def&&JSON.stringify(p[b])===JSON.stringify(v.def[b])&&delete p[b]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const d of[...t.seen.entries()].reverse())n(d[0]);if(t.target!=="openapi-3.0")for(const d of t.seen.entries())gRe(d[1].def??d[1].schema);for(const d of t.deferred)d();if(t.intersections.length){const d=new Map;for(const f of t.seen.values())for(const p of[f.schema,f.def]){const g=p==null?void 0:p.allOf;if(!Array.isArray(g))continue;const m=d.get(g);m?m.push(p):d.set(g,[p])}for(const f of t.intersections)for(const p of d.get(f)??[])i$t(p)}}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)}QS(i,r.defId?r.schema:r.def??r.schema);const s=(u=t.metadataRegistry.get(e))==null?void 0:u.id;s!==void 0&&i.id===s&&delete i.id;const a=((h=t.external)==null?void 0:h.defs)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,sp(a,f.defId,f.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:vI(e,"input",t.processors),output:vI(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function ml(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 ml(n.element,r);if(n.type==="set")return ml(n.valueType,r);if(n.type==="lazy")return ml(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"||n.type==="catch")return ml(n.innerType,r);if(n.type==="intersection")return ml(n.left,r)||ml(n.right,r);if(n.type==="record"||n.type==="map")return ml(n.keyType,r)||ml(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ml(n.in,r)||ml(n.out,r);if(n.type==="object"){for(const i in n.shape)if(ml(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(ml(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(ml(i,r))return!0;return!!(n.rest&&ml(n.rest,r))}return!1}const s$t=(t,e={})=>r=>{const n=fRe({...r,processors:e});return ma(t,n),pRe(n,t),yRe(n,t)},vI=(t,e,r={})=>n=>{const{libraryOptions:i,target:s}=n??{},a=fRe({...i??{},target:s,io:e,processors:r});return ma(t,a),pRe(a,t),yRe(a,t)},Y5=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},X5=(t,e,r)=>{(t[e]===void 0||r{Y5(t,"minimum",e),X5(t,"maximum",e)},vRe=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},bRe=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},xRe=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},wRe=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},_fe=(t,e)=>Y5(t,"minimum",e.minimum),Lfe=(t,e)=>X5(t,"maximum",e.maximum),Ife=t=>(e,r)=>{wRe(e,r.format);const[n,i]=t[r.format];Y5(e,"minimum",n),X5(e,"maximum",i)},nz={greater_than:(t,e)=>Y5(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>X5(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>vRe(t,e.value),number_format:Ife(VMe),bigint_format:Ife(TNt),min_length:_fe,max_length:Lfe,length_equals:(t,e)=>Rfe(t,e.length),min_size:_fe,max_size:Lfe,size_equals:(t,e)=>Rfe(t,e.size),string_format:(t,e)=>{wRe(t,e.format),e.pattern&&bRe(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>xRe(t,e.mime)};function wh(t){var s;const e={},r=t._zod.def,n=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(const a of n)(s=nz[a._zod.def.check])==null||s.call(nz,e,a._zod.def);const i=t._zod.bag;i.minimum!==void 0&&Y5(e,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&Y5(e,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&X5(e,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&X5(e,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&vRe(e,i.multipleOf),i.format!==void 0&&(e.format??(e.format=i.format),i.format.includes("int")&&(e.isInt=!0)),i.mime&&xRe(e,i.mime);for(const a of i.patterns??[])bRe(e,a);return e}const a$t={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o$t=new Map([[rRe,COt],[Iee,kOt]]),TRe=t=>o$t.get(t)??t,l$t=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:s,maximum:a,format:o,patterns:l,contentEncoding:u,laxFormat:h}=wh(t);if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),o&&(i.format=a$t[o]??o,i.format===""&&delete i.format,(o==="time"||h)&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const d=[...l].map(TRe);d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},c$t=(t,e,r,n)=>{const i=r,{minimum:s,maximum:a,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:u,isInt:h}=wh(t);i.type=h?"integer":"number";const d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";if(d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof a=="number"&&(i.maximum=a),o){const g=new Set;for(const v of o)Number.isFinite(v)&&v!==0?g.add(Math.abs(v)):Ug(t,e,i,n,`A multipleOf divisor of ${v} cannot be represented in JSON Schema`);const[m,...y]=g;m!==void 0&&(i.multipleOf=m),y.length&&(i.allOf=[...i.allOf??[],...y.map(v=>({multipleOf:v}))])}},u$t=(t,e,r,n)=>{r.type="boolean"},h$t=(t,e,r,n)=>{r.not={}},d$t=(t,e,r,n)=>{},f$t=(t,e,r,n)=>{const i=t._zod.def,s=Zq(i.entries);if(s.length===0){r.not={};return}s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},p$t=(t,e,r,n)=>{const i=t._zod.def;if(i.values.length===0){r.not={};return}const s=[];for(const a of i.values)if(a===void 0){if(Ug(t,e,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Ug(t,e,r,n,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},g$t=(t,e,r,n)=>{Ug(t,e,r,n,"Custom types cannot be represented in JSON Schema")},m$t=(t,e,r,n)=>{Ug(t,e,r,n,"Transforms cannot be represented in JSON Schema")},y$t=(t,e,r,n)=>{const i=r,s=t._zod.def,{minimum:a,maximum:o}=wh(t);typeof a=="number"&&(i.minItems=a),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=ma(s.element,e,{...n,path:[...n.path,"items"]})};function bI(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?bI(e.out):e.type==="catch"?bI(e.innerType):t._zod.optin}const v$t=(t,e,r,n)=>{var u;const i=r,s=t._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&Ug(t,e,i,n,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(const h in a)sp(i.properties,h,ma(a[h],e,{...n,path:[...n.path,"properties",h]}));const l=[];for(const h of Object.keys(a)){const d=s.shape[h];(e.io==="input"?bI(d)===void 0:d._zod.optout===void 0)&&l.push(h)}l.length>0&&(i.required=l),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=ma(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},b$t=(t,e,r,n)=>{const i=t._zod.def,s=i.inclusive===!1,a=i.options.map((o,l)=>ma(o,e,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},x$t=(t,e,r,n)=>{const i=t._zod.def,s=ma(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=ma(i.right,e,{...n,path:[...n.path,"allOf",1]}),o=u=>"allOf"in u&&Object.keys(u).length===1,l=[...o(s)?s.allOf:[s],...o(a)?a.allOf:[a]];r.allOf=l,e.intersections.push(l)};function iU(t,e,r){var g;if(e.$ref){if(r.has(e))return e;r.add(e);const m=(g=t.get(e))==null?void 0:g.def;if(!m)return e;const y=iU(t,m,r);return y===m?e:y}for(const m of["anyOf","oneOf"]){const y=e[m];if(!Array.isArray(y))continue;const v=y.map(b=>iU(t,b,r));v.some((b,x)=>b!==y[x])&&(e={...e,[m]:v})}const n=Array.isArray(e.type)?e.type:[e.type],i=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),s=e.enum??(e.const!==void 0?[e.const]:void 0);if(!i&&!(s!=null&&s.some(m=>typeof m=="number")))return e;const{minimum:a,maximum:o,exclusiveMinimum:l,exclusiveMaximum:u,multipleOf:h,format:d,id:f,...p}=e;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),i&&(p.type="string",s||(p.pattern=(n.includes("number")?Ree:IOt).source)),p}const sU=new WeakMap;function w$t(t){var n;const e=new Map;for(const i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);const r=new Map;for(const i of sU.get(t)??[]){const s=t.seen.get(i),a=(n=(s==null?void 0:s.def)??(s==null?void 0:s.schema))==null?void 0:n.propertyNames;if(!a||a===!0||r.has(a))continue;const o=iU(e,a,new Set);o!==a&&r.set(a,o)}if(r.size)for(const i of t.seen.values())for(const s of[i.schema,i.def]){const a=s&&r.get(s.propertyNames);a&&(s.propertyNames=a)}}const T$t=(t,e,r,n)=>{const i=r,s=t._zod.def;i.type="object";const a=s.keyType,o=wh(a).patterns;if(s.mode==="loose"&&o&&o.size>0){const h=ma(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of o)sp(i.patternProperties,TRe(d).source,h)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){i.propertyNames=ma(s.keyType,e,{...n,path:[...n.path,"propertyNames"]});let h=sU.get(e);h||(h=[],sU.set(e,h),e.deferred.push(()=>w$t(e))),h.push(t)}i.additionalProperties=ma(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]})}const l=a._zod.values,u=e.io==="input"&&bI(s.valueType)!==void 0;if(l&&!s.partial&&!u){const h=[...l].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h.map(String))}},C$t=(t,e,r,n)=>{const i=t._zod.def,s=ma(i.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},k$t=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},Nee=Symbol();function CRe(t,e,r,n,i){let s=!1;const a=JSON.stringify(t,(o,l)=>typeof l!="bigint"?l:(s=!0,null));return s?(Ug(e,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),Nee):JSON.parse(a)}const S$t=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;const a=CRe(i.defaultValue,t,e,r,n);a!==Nee&&(r.default=a)},E$t=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);if(s.ref=i.innerType,e.io!=="input")return;const a=CRe(i.defaultValue,t,e,r,n);a!==Nee&&(r._prefault=a)},A$t=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{Ug(t,e,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},M$t=(t,e,r,n)=>{const i=t._zod.def,s=i.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?s?i.out:i.in:i.out;ma(a,e,n);const o=e.seen.get(t);o.ref=a},R$t=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType,r.readOnly=!0},kRe=(t,e,r,n)=>{const i=t._zod.def;ma(i.innerType,e,n);const s=e.seen.get(t);s.ref=i.innerType},Nfe=new WeakSet([Object.prototype,Error.prototype]);function nM(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const n=r(this);return Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0})}})}const _$t=(t,e)=>{WNt.init(t,e),t.name="ZodError";const r=Object.getPrototypeOf(t);Nfe.has(r)||(Nfe.add(r),nM(r,"format",n=>i=>jNt(n,i)),nM(r,"flatten",n=>i=>UNt(n,i)),nM(r,"addIssue",n=>i=>{n.issues.push(i),n.message=JSON.stringify(n.issues,Qq,2)}),nM(r,"addIssues",n=>i=>{n.issues.push(...i),n.message=JSON.stringify(n.issues,Qq,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Ku=Tt("ZodError",_$t,void 0,{Parent:Error}),L$t=See(Ku),I$t=Eee(Ku),N$t=Aee(Ku),O$t=Mee(Ku),D$t=JNt(Ku),P$t=eOt(Ku),$$t=tOt(Ku),B$t=rOt(Ku),F$t=nOt(Ku),z$t=iOt(Ku),V$t=sOt(Ku),H$t=aOt(Ku);function G$t(){Hh.localeError||Yd(lPt())}function YD(){Hh.memoizer||Yd({memoizer:sPt()})}const As=Tt("ZodType",(t,e)=>(G$t(),Es.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(qc(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return km(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(FBt(t,e))},superRefine(t,e){return this.check(zBt(t,e))},overwrite(t){return this.check(Z3(t))},optional(){return Pfe(this)},exactOptional(){return EBt(this)},nullable(){return $fe(this)},nullish(){return Pfe($fe(this))},nonoptional(t){return IBt(this,t)},array(){return Gn(this)},or(t){return K5([this,t])},and(t){return TBt(this,t)},transform(t){return Bfe(this,SBt(t))},default(t){return RBt(this,t)},prefault(t){return LBt(this,t)},catch(t){return OBt(this,t)},pipe(t){return Bfe(this,t)},readonly(){return $Bt(this)},describe(t){const e=this.clone();return Gk.add(e,{description:t}),e},meta(...t){if(t.length===0)return Gk.get(this);const e=this.clone();return Gk.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return GMe(this,"~standard",{...ZMe(this),jsonSchema:{input:vI(this,"input"),output:vI(this,"output")}})},set"~standard"(t){qg(this,"~standard",t)},parse:function t(e,r){return L$t(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await I$t(this,e,r,{callee:t})},safeParse(t,e){return N$t(this,t,e)},async safeParseAsync(t,e){return O$t(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){qg(this,"spa",t)},validate(t,e){return KNt(this,t,e)},validateAsync(t,e){return QNt(this,t,e)},encode:function t(e,r){return D$t(this,e,r,{callee:t})},decode:function t(e,r){return P$t(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await $$t(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await B$t(this,e,r,{callee:t})},safeEncode(t,e){return F$t(this,t,e)},safeDecode(t,e){return z$t(this,t,e)},async safeEncodeAsync(t,e){return V$t(this,t,e)},async safeDecodeAsync(t,e){return H$t(this,t,e)},toJSONSchema(t){return s$t(this,{})(t)},get description(){var t;return(t=Gk.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),SRe=Tt("_ZodString",(t,e)=>{Lee.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>l$t(t,r,n)},WMe({format:t=>wh(t).format??null,minLength:t=>wh(t).minimum??null,maxLength:t=>wh(t).maximum??null},{regex(...t){return this.check(GPt(...t))},includes(...t){return this.check(UPt(...t))},startsWith(...t){return this.check(jPt(...t))},endsWith(...t){return this.check(YPt(...t))},min(...t){return this.check(yI(...t))},max(...t){return this.check(hRe(...t))},length(...t){return this.check(dRe(...t))},nonempty(...t){return this.check(yI(1,...t))},lowercase(t){return this.check(WPt(t))},uppercase(t){return this.check(qPt(t))},trim(){return this.check(KPt())},normalize(...t){return this.check(XPt(...t))},toLowerCase(){return this.check(ZPt())},toUpperCase(){return this.check(QPt())},slugify(){return this.check(JPt())}})),W$t=Tt("ZodString",(t,e)=>{Lee.init(t,e),SRe.init(t,e)},{email(t){return this.check(dPt(X$t,t))},url(t){return this.check(vPt(Z$t,t))},jwt(t){return this.check(NPt(dBt,t))},emoji(t){return this.check(bPt(Q$t,t))},guid(t){return this.check(fPt(K$t,t))},uuid(t){return this.check(pPt(iM,t))},uuidv4(t){return this.check(gPt(iM,t))},uuidv6(t){return this.check(mPt(iM,t))},uuidv7(t){return this.check(yPt(iM,t))},nanoid(t){return this.check(xPt(J$t,t))},cuid(t){return this.check(wPt(eBt,t))},cuid2(t){return this.check(TPt(tBt,t))},ulid(t){return this.check(CPt(rBt,t))},base64(t){return this.check(_Pt(cBt,t))},base64url(t){return this.check(LPt(uBt,t))},xid(t){return this.check(kPt(nBt,t))},ksuid(t){return this.check(SPt(iBt,t))},ipv4(t){return this.check(EPt(sBt,t))},ipv6(t){return this.check(APt(aBt,t))},cidrv4(t){return this.check(MPt(oBt,t))},cidrv6(t){return this.check(RPt(lBt,t))},e164(t){return this.check(IPt(hBt,t))},datetime(t){return this.check(OPt(q$t,t))},date(t){return this.check(DPt(U$t,t))},time(t){return this.check(PPt(j$t,t))},duration(t){return this.check($Pt(Y$t,t))}});function Ue(t){return hPt(W$t,t)}const Ms=Tt("ZodStringFormat",(t,e)=>{ps.init(t,e),SRe.init(t,e)}),q$t=Tt("ZodISODateTime",(t,e)=>{fDt.init(t,e),Ms.init(t,e)}),U$t=Tt("ZodISODate",(t,e)=>{pDt.init(t,e),Ms.init(t,e)}),j$t=Tt("ZodISOTime",(t,e)=>{gDt.init(t,e),Ms.init(t,e)}),Y$t=Tt("ZodISODuration",(t,e)=>{mDt.init(t,e),Ms.init(t,e)}),X$t=Tt("ZodEmail",(t,e)=>{JOt.init(t,e),Ms.init(t,e)}),K$t=Tt("ZodGUID",(t,e)=>{ZOt.init(t,e),Ms.init(t,e)}),iM=Tt("ZodUUID",(t,e)=>{QOt.init(t,e),Ms.init(t,e)}),Z$t=Tt("ZodURL",(t,e)=>{sDt.init(t,e),Ms.init(t,e)}),Q$t=Tt("ZodEmoji",(t,e)=>{aDt.init(t,e),Ms.init(t,e)}),J$t=Tt("ZodNanoID",(t,e)=>{oDt.init(t,e),Ms.init(t,e)}),eBt=Tt("ZodCUID",(t,e)=>{lDt.init(t,e),Ms.init(t,e)}),tBt=Tt("ZodCUID2",(t,e)=>{cDt.init(t,e),Ms.init(t,e)}),rBt=Tt("ZodULID",(t,e)=>{uDt.init(t,e),Ms.init(t,e)}),nBt=Tt("ZodXID",(t,e)=>{hDt.init(t,e),Ms.init(t,e)}),iBt=Tt("ZodKSUID",(t,e)=>{dDt.init(t,e),Ms.init(t,e)}),sBt=Tt("ZodIPv4",(t,e)=>{yDt.init(t,e),Ms.init(t,e)}),aBt=Tt("ZodIPv6",(t,e)=>{bDt.init(t,e),Ms.init(t,e)}),oBt=Tt("ZodCIDRv4",(t,e)=>{xDt.init(t,e),Ms.init(t,e)}),lBt=Tt("ZodCIDRv6",(t,e)=>{TDt.init(t,e),Ms.init(t,e)}),cBt=Tt("ZodBase64",(t,e)=>{CDt.init(t,e),Ms.init(t,e)}),uBt=Tt("ZodBase64URL",(t,e)=>{SDt.init(t,e),Ms.init(t,e)}),hBt=Tt("ZodE164",(t,e)=>{EDt.init(t,e),Ms.init(t,e)}),dBt=Tt("ZodJWT",(t,e)=>{MDt.init(t,e),Ms.init(t,e)}),ERe=Tt("ZodNumber",(t,e)=>{nRe.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>c$t(t,r,n,i),t.isFinite=!0},WMe({minValue:t=>{const{minimum:e,exclusiveMinimum:r}=wh(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:r}=wh(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:r}=wh(t);return!!e||!!(r!=null&&r.some(Number.isSafeInteger))},format:t=>wh(t).format??null},{gt(t,e){return this.check(kfe(t,e))},gte(t,e){return this.check(rz(t,e))},min(t,e){return this.check(rz(t,e))},lt(t,e){return this.check(Cfe(t,e))},lte(t,e){return this.check(tz(t,e))},max(t,e){return this.check(tz(t,e))},int(t){return this.check(Ofe(t))},safe(t){return this.check(Ofe(t))},positive(t){return this.check(kfe(0,t))},nonnegative(t){return this.check(rz(0,t))},negative(t){return this.check(Cfe(0,t))},nonpositive(t){return this.check(tz(0,t))},multipleOf(t,e){return this.check(Sfe(t,e))},step(t,e){return this.check(Sfe(t,e))},finite(){return this}}));function Fr(t){return BPt(ERe,t)}const fBt=Tt("ZodNumberFormat",(t,e)=>{RDt.init(t,e),ERe.init(t,e)});function Ofe(t){return FPt(fBt,t)}const pBt=Tt("ZodBoolean",(t,e)=>{_Dt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>u$t(t,r,n)});function wn(t){return zPt(pBt,t)}const gBt=Tt("ZodUnknown",(t,e)=>{LDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>d$t()});function Xd(){return VPt(gBt)}const mBt=Tt("ZodNever",(t,e)=>{IDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>h$t(t,r,n)});function yBt(t){return HPt(mBt,t)}const vBt=Tt("ZodArray",(t,e)=>{YD(),DDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>y$t(t,r,n,i),t.element=e.element},{min(t,e){return this.check(yI(t,e))},nonempty(t){return this.check(yI(1,t))},max(t,e){return this.check(hRe(t,e))},length(t,e){return this.check(dRe(t,e))},unwrap(){return this.element}});function Gn(t,e){return e$t(vBt,t,e)}const bBt=Tt("ZodObject",(t,e)=>{YD(),BDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>v$t(t,r,n,i),PNt(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return An(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(qc(this._zod.def,{catchall:t}))},passthrough(){return this.clone(qc(this._zod.def,{catchall:Xd()}))},loose(){return this.clone(qc(this._zod.def,{catchall:Xd()}))},strict(){return this.clone(qc(this._zod.def,{catchall:yBt()}))},strip(){return this.clone(qc(this._zod.def,{catchall:void 0}))},extend(t){return SNt(this,t)},safeExtend(t){return ENt(this,t)},merge(t){return ANt(this,t)},pick(t){return CNt(this,t)},omit(t){return kNt(this,t)},partial(...t){return sfe(RRe,this,t[0])},exactPartial(...t){return sfe(_Re,this,t[0],"exactPartial")},required(...t){return MNt(LRe,this,t[0])}});function Ft(t,e){const r={type:"object",shape:t??{},...Rr(e)};return new bBt(r)}const ARe=Tt("ZodUnion",(t,e)=>{aRe.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>b$t(t,r,n,i),t.options=e.options});function K5(t,e){return new ARe({type:"union",options:t,...Rr(e)})}const xBt=Tt("ZodDiscriminatedUnion",(t,e)=>{ARe.init(t,e),zDt.init(t,e)});function MRe(t,e,r){return new xBt({type:"union",options:e,discriminator:t,...Rr(r)})}const wBt=Tt("ZodIntersection",(t,e)=>{VDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>x$t(t,r,n,i)});function TBt(t,e){return new wBt({type:"intersection",left:t,right:e})}const Dfe=Tt("ZodRecord",(t,e)=>{YD(),HDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>T$t(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function XD(t,e,r){return!e||!e._zod?new Dfe({type:"record",keyType:Ue(),valueType:t,...Rr(e)}):new Dfe({type:"record",keyType:t,valueType:e,...Rr(r)})}const aU=Tt("ZodEnum",(t,e)=>{GDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(n,i,s)=>f$t(t,n,i),t.enum=e.entries,t.options=[...t._zod.values];const r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{const s={};for(const a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new aU({...e,checks:[],...Rr(i),entries:s})},t.exclude=(n,i)=>{const s={...e.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new aU({...e,checks:[],...Rr(i),entries:s})}});function An(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new aU({type:"enum",entries:r,...Rr(e)})}const CBt=Tt("ZodLiteral",(t,e)=>{WDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>p$t(t,r,n,i),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 cs(t,e){return new CBt({type:"literal",values:Array.isArray(t)?t:[t],...Rr(e)})}const kBt=Tt("ZodTransform",(t,e)=>{YD(),qDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>m$t(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new qMe(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(_6(s,r.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=t),r.issues.push(_6(a))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(s=>(r.value=s,r)):(r.value=i,r)}});function SBt(t){return new kBt({type:"transform",transform:t})}const RRe=Tt("ZodOptional",(t,e)=>{oRe.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kRe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Pfe(t){return new RRe({type:"optional",innerType:t})}const _Re=Tt("ZodExactOptional",(t,e)=>{UDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kRe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function EBt(t){return new _Re({type:"optional",innerType:t})}const ABt=Tt("ZodNullable",(t,e)=>{jDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>C$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function $fe(t){return new ABt({type:"nullable",innerType:t})}const MBt=Tt("ZodDefault",(t,e)=>{YDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>S$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function RBt(t,e){return new MBt({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():FMe(e)}})}const _Bt=Tt("ZodPrefault",(t,e)=>{XDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>E$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function LBt(t,e){return new _Bt({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():FMe(e)}})}const LRe=Tt("ZodNonOptional",(t,e)=>{KDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>k$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function IBt(t,e){return new LRe({type:"nonoptional",innerType:t,...Rr(e)})}const NBt=Tt("ZodCatch",(t,e)=>{ZDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>A$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function OBt(t,e){return new NBt({type:"catch",innerType:t,catchValue:typeof e=="function"?e:BNt(e)})}const DBt=Tt("ZodPipe",(t,e)=>{QDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>M$t(t,r,n,i),t.in=e.in,t.out=e.out});function Bfe(t,e){return new DBt({type:"pipe",in:t,out:e})}const PBt=Tt("ZodReadonly",(t,e)=>{JDt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>R$t(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function $Bt(t){return new PBt({type:"readonly",innerType:t})}const BBt=Tt("ZodCustom",(t,e)=>{ePt.init(t,e),As.init(t,e),t._zod.processJSONSchema=(r,n,i)=>g$t(t,r,n,i)});function FBt(t,e={}){return t$t(BBt,t,e)}function zBt(t,e){return r$t(t,e)}const oU=["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"],VBt=["professional","friendly","casual","direct"],HBt=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt","pl"],GBt=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],WBt=4,Ffe=4*1024*1024,qBt=256*1024,UBt=8*1024*1024,IRe=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},jBt=t=>t.startsWith("text/")||t==="application/json",Oee=["none","target-language","tone"],Dee=["append","replace","both"],xI=Ue().uuid();Ft({content:Ue().trim().min(1).max(500),sourceTurnId:xI.optional()}).strict();Ft({content:Ue().trim().min(1).max(500),version:Fr().int().positive()}).strict();const YBt=Ft({memoId:Ue().trim().min(1).max(100).optional(),notebookId:Ue().trim().min(1).max(100).optional(),notebookTitle:Ue().trim().max(160).optional(),title:Ue().trim().max(160).optional(),selectionMarkdown:Ue().max(2e3).optional(),contentMarkdown:Ue().max(4e3).optional(),contentTruncated:wn().optional(),diagramKind:An(["mind-map","flowchart","architecture"]).optional()}).strict(),XBt=Ft({type:An(["memo","notebook","tag"]),id:Ue().trim().min(1).max(100),title:Ue().trim().max(160).optional()}).strict();Ft({id:xI,threadId:xI,message:Ue().trim().min(1).max(4e3),useMemory:wn().default(!0),allowNotes:wn().default(!1),allowWrites:wn().optional(),locale:An(["zh-CN","en-US","ja","pl"]).default("en-US"),focus:YBt.optional(),mentions:Gn(XBt).max(8).optional(),attachmentIds:Gn(Ue().uuid()).max(4).optional()}).strict();Ft({id:Ue().trim().min(1).max(80),prompt:Ue().trim().min(1).max(200),inputType:An(["free_text","single_select","multi_select"]),options:Gn(Ft({id:Ue().trim().min(1).max(80),label:Ue().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const KBt=Ft({questionId:Ue().trim().min(1).max(80),optionIds:Gn(Ue().trim().min(1).max(80)).max(6).optional(),text:Ue().trim().max(400).optional()}).strict();Ft({answers:Gn(KBt).max(3).optional()}).strict();Ft({name:Ue().trim().min(1).max(80),input:XD(Ue(),Xd()).default({}),callId:Ue().trim().min(1).max(100).optional(),response:Ue().max(16e3).optional(),process:Ue().max(32e3).optional()}).strict();Ft({response:Ue().max(16e3),process:Ue().max(32e3).optional()}).strict();Ft({response:Ue().max(16e3),process:Ue().max(32e3).optional(),status:An(["completed","interrupted","failed"]),inputTokens:Fr().int().nonnegative().optional(),outputTokens:Fr().int().nonnegative().optional()}).strict();Ft({enabled:wn(),learningEnabled:wn().optional(),useMemory:wn().optional(),version:Fr().int().nonnegative()}).strict();const ZBt=Ue().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Ft({suggestion:Ft({kind:An(["insight","merge","append","move","tag"]),title:Ue().trim().min(1).max(60),body:ZBt,sourceIds:Gn(Ue().min(1).max(100)).min(1).max(5),memoryIds:Gn(Ue().max(100)).max(8).optional(),notebookId:Ue().max(100).nullable().optional(),tags:Gn(Ue().min(1).max(40)).max(5).optional(),targetId:Ue().max(100).nullable()}).nullable()});Ft({turnId:xI,output:Xd()}).strict();const Pee=Ue().trim().min(1).max(400),NRe=Ue().trim().min(1).max(100),QBt=Ft({kind:cs("merge"),memoIds:Gn(NRe).min(2).max(5),title:Ue().trim().min(1).max(160),reason:Pee}).strict(),JBt=Ft({kind:cs("tag"),memoId:NRe,tags:Gn(Ue().trim().min(1).max(40)).min(1).max(5),reason:Pee}).strict(),eFt=Ft({kind:cs("tool"),toolName:Ue().min(1).max(80),arguments:XD(Ue(),Xd()),reason:Pee}).strict();MRe("kind",[QBt,JBt,eFt]);Ft({version:K5([cs(1),cs(2)]),memories:Gn(Ft({content:Ue().trim().min(1).max(500),kind:An(["explicit","inferred"]).optional()})).max(50),controls:Ft({useMemory:wn(),learningEnabled:wn()}).optional()}).strict();const x2=(t,e,r,n,i)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});x2({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("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")},{name:"Podsumuj",description:"Streść notatkę do tematu, wniosków i działań do podjęcia",instruction:["Utwórz faktycznie skondensowane podsumowanie notatki, zamiast ją przepisywać, parafrazować zdanie po zdaniu lub powtarzać. ","Wskaż główny temat, najważniejsze tezy, kluczowe wnioski i działania do podjęcia. ","Pomiń powtórzenia, ozdobniki retoryczne, przykłady, cytaty i drobne szczegóły, chyba że są niezbędne do zrozumienia kluczowego wniosku. ","W przypadku obszernej notatki celuj w około 20–30% długości oryginału i użyj 3–7 zwięzłych punktów listy Markdown; w przypadku krótkiej notatki wystarczą 1–3 zwięzłe zdania. ","Nie przytaczaj dosłownie długich fragmentów i nie dodawaj faktów, których nie ma w oryginale. ","Zachowaj język notatki i zwróć wyłącznie podsumowanie w formacie Markdown."].join("")}),x2({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."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"},{name:"Przetłumacz",description:"Przetłumacz na wybrany język, zachowując formatowanie",instruction:"Przetłumacz całą notatkę na język docelowy wskazany przez użytkownika. Zachowaj jej znaczenie, strukturę Markdown, linki i bloki kodu. Zwróć wyłącznie przetłumaczoną notatkę, bez komentarzy."}),x2({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."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"},{name:"Popraw styl",description:"Popraw język oraz zwiększ przejrzystość i płynność tekstu",instruction:"Dopracuj treść: popraw pisownię, gramatykę i interpunkcję oraz ulepsz dobór słów, budowę zdań, przejrzystość i płynność. Nie zmieniaj jej znaczenia ani celowo jej nie skracaj. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),x2({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."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"},{name:"Skróć i uprość",description:"Usuń powtórzenia i napisz tekst zwięźle i konkretnie",instruction:"Dopracuj treść, usuwając powtórzenia, puste frazy i zbędne określenia oraz łącząc zdania tam, gdzie to pomaga. Spraw, by tekst był zwięzły, jasny i konkretny, zachowując każdy kluczowy fakt, tezę i pierwotne znaczenie. Nie dodawaj nowych informacji. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),x2({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"},{name:"Wyodrębnij zadania",description:"Znajdź działania do wykonania i utwórz listę zadań",instruction:"Wyodrębnij z notatki jawne lub domniemane zadania do wykonania jako listę zadań Markdown z użyciem '- [ ]'. Zachowaj jej język i nie wymyślaj zadań. Jeśli nie ma zadań do wykonania, napisz to krótko w języku notatki."}),x2({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"},{name:"Pisz dalej",description:"Kontynuuj naturalnie od końca notatki",instruction:"Kontynuuj pisanie naturalnie od miejsca, w którym kończy się notatka. Zwróć wyłącznie nową kontynuację, bez oryginalnej treści. Zachowaj jej język i styl Markdown."});const tFt=new Set([a0,Lb]),ZC=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},zfe="edgeever-attachment-kind-",$ee=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),ORe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(s=>s&&s!=="edgeever-attachment-link"&&!s.startsWith(zfe)):[],i=W5(e,$ee(t));return[...n,"edgeever-attachment-link",`${zfe}${i}`].join(" ")},rFt=Ni.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=>Gg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Gg(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":iLt(n,r,e)}}}}}]}}),Vfe=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/")},nFt=t=>{var e;return(e=t.marks)!=null&&e.some(Vfe)?{...t,marks:t.marks.map(r=>{var n,i;return Vfe(r)?{...r,attrs:{...r.attrs,class:ORe(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:$ee(t.text)}}:r})}:t},iFt=t=>{var a;const e=ZC(t,"url"),r=ZC(t,"label")||ZC(t,"filename")||"Attachment",n=ZC(t,"mimeType"),i=ZC(t,"filename")||$ee(r),s=Gg((a=t.attrs)==null?void 0:a.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:ORe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:s}}]}:{}}},sFt=t=>{const e=r=>tFt.has(r.type)?iFt(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?nFt(r):r;return{...t,content:t.content.map(r=>e(r))}},aFt="edgeever-zip",oFt=2,Lh=Ue().datetime();Ft({format:cs(aFt),formatVersion:K5([cs(1),cs(oFt)]),schemaVersion:Fr().int().positive(),edgeeverVersion:Ue().trim().min(1),buildId:Ue().trim().min(1),exportedAt:Lh,includesTrash:cs(!1),counts:Ft({notebooks:Fr().int().min(0),memos:Fr().int().min(0),revisions:Fr().int().min(0),resources:Fr().int().min(0),prompts:Fr().int().min(0).optional()})});const lFt=Ft({id:Ue().trim().min(1),parentId:Ue().trim().min(1).nullable(),name:Ue().trim().min(1).max(80),slug:Ue().nullable(),icon:Ue().nullable(),color:Ue().nullable(),sortOrder:Fr().int(),createdAt:Lh,updatedAt:Lh}),cFt=Ft({id:Ue().trim().min(1),memoId:Ue().trim().min(1),revision:Fr().int().min(0),title:Ue().nullable(),tags:Gn(Ue()),contentJson:Xd(),contentMarkdown:Ue(),contentText:Ue(),contentHash:Ue(),createdBy:Ue(),createdAt:Lh}),uFt=Ft({id:Ue().trim().min(1),notebookId:Ue().trim().min(1),title:Ue().nullable(),excerpt:Ue(),tags:Gn(Ue()),isPinned:wn(),isArchived:wn(),isDeleted:wn(),revision:Fr().int().min(0),createdAt:Lh,updatedAt:Lh,deletedAt:Lh.nullable(),contentJson:Xd(),contentMarkdown:Ue(),contentText:Ue(),contentHash:Ue(),sourceMemoIds:Gn(Ue()),mergeSourceCount:Fr().int().min(0),mergedIntoMemoId:Ue().nullable()}),DRe=Ft({memo:uFt,revisions:Gn(cFt),resources:Gn(Ft({id:Ue().trim().min(1),memoId:Ue().trim().min(1),originalMemoId:Ue().nullable(),kind:An(["image","attachment"]),mimeType:Ue().nullable(),filename:Ue().nullable(),byteSize:Fr().int().min(0),sha256:Ue().nullable(),width:Fr().int().positive().nullable(),height:Fr().int().positive().nullable(),createdAt:Lh,updatedAt:Lh,archivePath:Ue().trim().min(1)}))});Ft({notebooks:Gn(lFt).min(1).max(100)});Ft({memos:Gn(DRe).min(1).max(10)});const hFt=Ft({id:Ue().trim().min(1).max(200),origin:An(["default","custom"]),seedKey:An(oU.filter(t=>t!=="custom")).nullable(),action:An(oU),parameterKind:An(Oee),resultMode:An(Dee),nameCustomized:wn(),descriptionCustomized:wn(),instructionCustomized:wn(),name:Ue().trim().min(1).max(80),description:Ue().max(200).nullable(),instruction:Ue().trim().min(1).max(2e3),createdAt:Lh,updatedAt:Lh}).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."})});Ft({prompts:Gn(hFt).max(100)});DRe.shape.resources.element;const QC=(t,e,r,n,i)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});QC({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}d.count>1&&t.reused==="ref"&&a(h)}t.external&&(t.sharedDefsExtractedFor=t.external)}function SAe(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const r=[];for(const n of e){if(!n||typeof n!="object")return;SAe(n);const i=Object.keys(n);if(i.length!==1||i[0]!=="type")return;const a=n.type;for(const s of Array.isArray(a)?a:[a]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete t.anyOf,t.type=r.length===1?r[0]:r}const EAe=new Set(["type","properties","required","additionalProperties"]),$fe=["oneOf","anyOf"];function Ffe(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function uq(t){var a;const e=[];for(const s of t){if(typeof s!="object"||s.type!=="object")return null;for(const o in s)if(!EAe.has(o))return null;e.push(s)}const r={},n=new Set;for(const s of e){for(const o in s.properties){if(Object.prototype.hasOwnProperty.call(r,o))continue;const l=[];for(const h of e){const d=((a=h.properties)==null?void 0:a[o])??Ffe(h);d!=null&&(l.some(f=>JSON.stringify(f)===JSON.stringify(d))||l.push(d))}const u=l.length===1?l[0]:uq(l)??{allOf:l};sp(r,o,u)}for(const o of s.required??[])n.add(o)}const i={type:"object",properties:r};if(n.size&&(i.required=[...n]),e.every(s=>s.additionalProperties===!1))i.additionalProperties=!1;else{const s=[];for(const o of e){const l=Ffe(o);l&&!s.some(u=>JSON.stringify(u)===JSON.stringify(l))&&s.push(l)}s.length===1?i.additionalProperties=s[0]:s.length>1&&(i.additionalProperties={allOf:s})}return i}function OPt(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const i of EAe)if(i in t)return;const r=e.filter(i=>$fe.some(a=>Array.isArray(i[a])));let n=null;if(!r.length)n=uq(e);else{const i=r[0],a=$fe.find(l=>Array.isArray(i[l]));if(Object.keys(i).length!==1)return;const s=e.filter(l=>l!==i),o=i[a].map(l=>uq([...s,l]));if(o.some(l=>!l))return;n={[a]:o}}n&&(delete t.allOf,rw(t,n))}function AAe(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 y=t.seen.get(m),b=y.schema;if(b.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(b)):rw(p,b),rw(p,g),d._zod.parent===m)for(const w in p)w==="$ref"||w==="allOf"||w in g||delete p[w];if(b.$ref&&y.def)for(const w in p)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(p[w])===JSON.stringify(y.def[w])&&delete p[w]}const U=d._zod.parent;if(U&&U!==m){n(U);const y=t.seen.get(U);if(y!=null&&y.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const b in p)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(p[b])===JSON.stringify(y.def[b])&&delete p[b]}t.override({zodSchema:d,jsonSchema:p,path:f.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const d of[...t.seen.entries()].reverse())n(d[0]);if(t.target!=="openapi-3.0")for(const d of t.seen.entries())SAe(d[1].def??d[1].schema);for(const d of t.deferred)d();if(t.intersections.length){const d=new Map;for(const f of t.seen.values())for(const p of[f.schema,f.def]){const g=p==null?void 0:p.allOf;if(!Array.isArray(g))continue;const m=d.get(g);m?m.push(p):d.set(g,[p])}for(const f of t.intersections)for(const p of d.get(f)??[])OPt(p)}}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)}rw(i,r.defId?r.schema: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)??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const d of t.seen.entries()){const f=d[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,sp(s,f.defId,f.def))}t.external&&(t.sharedEmitDoneFor=t.external),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:wI(e,"input",t.processors),output:wI(e,"output",t.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function ml(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 ml(n.element,r);if(n.type==="set")return ml(n.valueType,r);if(n.type==="lazy")return ml(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"||n.type==="catch")return ml(n.innerType,r);if(n.type==="intersection")return ml(n.left,r)||ml(n.right,r);if(n.type==="record"||n.type==="map")return ml(n.keyType,r)||ml(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ml(n.in,r)||ml(n.out,r);if(n.type==="object"){for(const i in n.shape)if(ml(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(const i of n.options)if(ml(i,r))return!0;return!1}if(n.type==="tuple"){for(const i of n.items)if(ml(i,r))return!0;return!!(n.rest&&ml(n.rest,r))}return!1}const _Pt=(t,e={})=>r=>{const n=CAe({...r,processors:e});return ms(t,n),kAe(n,t),AAe(n,t)},wI=(t,e,r={})=>n=>{const{libraryOptions:i,target:a}=n??{},s=CAe({...i??{},target:a,io:e,processors:r});return ms(t,s),kAe(s,t),AAe(s,t)},Jv=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},Qv=(t,e,r)=>{(t[e]===void 0||r{Jv(t,"minimum",e),Qv(t,"maximum",e)},MAe=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},RAe=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},LAe=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},IAe=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},Vfe=(t,e)=>Jv(t,"minimum",e.minimum),Hfe=(t,e)=>Qv(t,"maximum",e.maximum),Gfe=t=>(e,r)=>{IAe(e,r.format);const[n,i]=t[r.format];Jv(e,"minimum",n),Qv(e,"maximum",i)},lF={greater_than:(t,e)=>Jv(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>Qv(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>MAe(t,e.value),number_format:Gfe(JEe),bigint_format:Gfe(QNt),min_length:Vfe,max_length:Hfe,length_equals:(t,e)=>zfe(t,e.length),min_size:Vfe,max_size:Hfe,size_equals:(t,e)=>zfe(t,e.size),string_format:(t,e)=>{IAe(t,e.format),e.pattern&&RAe(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>LAe(t,e.mime)};function xh(t){var a;const e={},r=t._zod.def,n=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(const s of n)(a=lF[s._zod.def.check])==null||a.call(lF,e,s._zod.def);const i=t._zod.bag;i.minimum!==void 0&&Jv(e,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&Jv(e,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&Qv(e,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&Qv(e,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&MAe(e,i.multipleOf),i.format!==void 0&&(e.format??(e.format=i.format),i.format.includes("int")&&(e.isInt=!0)),i.mime&&LAe(e,i.mime);for(const s of i.patterns??[])RAe(e,s);return e}const PPt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},BPt=new Map([[fAe,eOt],[$ee,tOt]]),NAe=t=>BPt.get(t)??t,$Pt=(t,e,r,n)=>{const i=r;i.type="string";const{minimum:a,maximum:s,format:o,patterns:l,contentEncoding:u,laxFormat:h}=xh(t);if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),o&&(i.format=PPt[o]??o,i.format===""&&delete i.format,(o==="time"||h)&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){const d=[...l].map(NAe);d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},FPt=(t,e,r,n)=>{const i=r,{minimum:a,maximum:s,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:u,isInt:h}=xh(t);i.type=h?"integer":"number";const d=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";if(d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a=="number"&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof s=="number"&&(i.maximum=s),o){const g=new Set;for(const y of o)Number.isFinite(y)&&y!==0?g.add(Math.abs(y)):Yg(t,e,i,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);const[m,...U]=g;m!==void 0&&(i.multipleOf=m),U.length&&(i.allOf=[...i.allOf??[],...U.map(y=>({multipleOf:y}))])}},zPt=(t,e,r,n)=>{r.type="boolean"},VPt=(t,e,r,n)=>{r.not={}},HPt=(t,e,r,n)=>{},GPt=(t,e,r,n)=>{const i=t._zod.def,a=iq(i.entries);if(a.length===0){r.not={};return}a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},WPt=(t,e,r,n)=>{const i=t._zod.def;if(i.values.length===0){r.not={};return}const a=[];for(const s of i.values)if(s===void 0){if(Yg(t,e,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Yg(t,e,r,n,"BigInt literals cannot be represented in JSON Schema"))return;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},qPt=(t,e,r,n)=>{Yg(t,e,r,n,"Custom types cannot be represented in JSON Schema")},jPt=(t,e,r,n)=>{Yg(t,e,r,n,"Transforms cannot be represented in JSON Schema")},YPt=(t,e,r,n)=>{const i=r,a=t._zod.def,{minimum:s,maximum:o}=xh(t);typeof s=="number"&&(i.minItems=s),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=ms(a.element,e,{...n,path:[...n.path,"items"]})};function TI(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?TI(e.out):e.type==="catch"?TI(e.innerType):t._zod.optin}const XPt=(t,e,r,n)=>{var u;const i=r,a=t._zod.def,s=a.shape;if(Object.getOwnPropertySymbols(s).length&&Yg(t,e,i,n,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(const h in s)sp(i.properties,h,ms(s[h],e,{...n,path:[...n.path,"properties",h]}));const l=[];for(const h of Object.keys(s)){const d=a.shape[h];(e.io==="input"?TI(d)===void 0:d._zod.optout===void 0)&&l.push(h)}l.length>0&&(i.required=l),((u=a.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ms(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},KPt=(t,e,r,n)=>{const i=t._zod.def,a=i.inclusive===!1,s=i.options.map((o,l)=>ms(o,e,{...n,path:[...n.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=s:r.anyOf=s},ZPt=(t,e,r,n)=>{const i=t._zod.def,a=ms(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=ms(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,e.intersections.push(l)};function hq(t,e,r){var g;if(e.$ref){if(r.has(e))return e;r.add(e);const m=(g=t.get(e))==null?void 0:g.def;if(!m)return e;const U=hq(t,m,r);return U===m?e:U}for(const m of["anyOf","oneOf"]){const U=e[m];if(!Array.isArray(U))continue;const y=U.map(b=>hq(t,b,r));y.some((b,v)=>b!==U[v])&&(e={...e,[m]:y})}const n=Array.isArray(e.type)?e.type:[e.type],i=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),a=e.enum??(e.const!==void 0?[e.const]:void 0);if(!i&&!(a!=null&&a.some(m=>typeof m=="number")))return e;const{minimum:s,maximum:o,exclusiveMinimum:l,exclusiveMaximum:u,multipleOf:h,format:d,id:f,...p}=e;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),i&&(p.type="string",a||(p.pattern=(n.includes("number")?_ee:cOt).source)),p}const dq=new WeakMap;function JPt(t){var n;const e=new Map;for(const i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);const r=new Map;for(const i of dq.get(t)??[]){const a=t.seen.get(i),s=(n=(a==null?void 0:a.def)??(a==null?void 0:a.schema))==null?void 0:n.propertyNames;if(!s||s===!0||r.has(s))continue;const o=hq(e,s,new Set);o!==s&&r.set(s,o)}if(r.size)for(const i of t.seen.values())for(const a of[i.schema,i.def]){const s=a&&r.get(a.propertyNames);s&&(a.propertyNames=s)}}const QPt=(t,e,r,n)=>{const i=r,a=t._zod.def;i.type="object";const s=a.keyType,o=xh(s).patterns;if(a.mode==="loose"&&o&&o.size>0){const h=ms(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(const d of o)sp(i.patternProperties,NAe(d).source,h)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){i.propertyNames=ms(a.keyType,e,{...n,path:[...n.path,"propertyNames"]});let h=dq.get(e);h||(h=[],dq.set(e,h),e.deferred.push(()=>JPt(e))),h.push(t)}i.additionalProperties=ms(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]})}const l=s._zod.values,u=e.io==="input"&&TI(a.valueType)!==void 0;if(l&&!a.partial&&!u){const h=[...l].filter(d=>typeof d=="string"||typeof d=="number");h.length>0&&(i.required=h.map(String))}},eBt=(t,e,r,n)=>{const i=t._zod.def,a=ms(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"}]},tBt=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},Fee=Symbol();function DAe(t,e,r,n,i){let a=!1;const s=JSON.stringify(t,(o,l)=>typeof l!="bigint"?l:(a=!0,null));return a?(Yg(e,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),Fee):JSON.parse(s)}const rBt=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType;const s=DAe(i.defaultValue,t,e,r,n);s!==Fee&&(r.default=s)},nBt=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);if(a.ref=i.innerType,e.io!=="input")return;const s=DAe(i.defaultValue,t,e,r,n);s!==Fee&&(r._prefault=s)},iBt=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{Yg(t,e,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},aBt=(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;ms(s,e,n);const o=e.seen.get(t);o.ref=s},sBt=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},OAe=(t,e,r,n)=>{const i=t._zod.def;ms(i.innerType,e,n);const a=e.seen.get(t);a.ref=i.innerType},Wfe=new WeakSet([Object.prototype,Error.prototype]);function sE(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const n=r(this);return Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0})}})}const oBt=(t,e)=>{xDt.init(t,e),t.name="ZodError";const r=Object.getPrototypeOf(t);Wfe.has(r)||(Wfe.add(r),sE(r,"format",n=>i=>CDt(n,i)),sE(r,"flatten",n=>i=>TDt(n,i)),sE(r,"addIssue",n=>i=>{n.issues.push(i),n.message=JSON.stringify(n.issues,aq,2)}),sE(r,"addIssues",n=>i=>{n.issues.push(...i),n.message=JSON.stringify(n.issues,aq,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Ku=wt("ZodError",oBt,void 0,{Parent:Error}),lBt=Iee(Ku),cBt=Nee(Ku),uBt=Dee(Ku),hBt=Oee(Ku),dBt=RDt(Ku),fBt=LDt(Ku),pBt=IDt(Ku),gBt=NDt(Ku),mBt=DDt(Ku),UBt=ODt(Ku),yBt=_Dt(Ku),bBt=PDt(Ku);function vBt(){Vh.localeError||Xd($_t())}function ZO(){Vh.memoizer||Xd({memoizer:__t()})}const Sa=wt("ZodType",(t,e)=>(vBt(),ka.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(Wc(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return S1(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(m$t(t,e))},superRefine(t,e){return this.check(U$t(t,e))},overwrite(t){return this.check(e9(t))},optional(){return Yfe(this)},exactOptional(){return n$t(this)},nullable(){return Xfe(this)},nullish(){return Yfe(Xfe(this))},nonoptional(t){return c$t(this,t)},array(){return Tn(this)},or(t){return Eg([this,t])},and(t){return QBt(this,t)},transform(t){return Kfe(this,r$t(t))},default(t){return s$t(this,t)},prefault(t){return l$t(this,t)},catch(t){return h$t(this,t)},pipe(t){return Kfe(this,t)},readonly(){return p$t(this)},describe(t){const e=this.clone();return q3.add(e,{description:t}),e},meta(...t){if(t.length===0)return q3.get(this);const e=this.clone();return q3.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return eAe(this,"~standard",{...lAe(this),jsonSchema:{input:wI(this,"input"),output:wI(this,"output")}})},set"~standard"(t){jg(this,"~standard",t)},parse:function t(e,r){return lBt(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await cBt(this,e,r,{callee:t})},safeParse(t,e){return uBt(this,t,e)},async safeParseAsync(t,e){return hBt(this,t,e)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(t){jg(this,"spa",t)},validate(t,e){return EDt(this,t,e)},validateAsync(t,e){return MDt(this,t,e)},encode:function t(e,r){return dBt(this,e,r,{callee:t})},decode:function t(e,r){return fBt(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await pBt(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await gBt(this,e,r,{callee:t})},safeEncode(t,e){return mBt(this,t,e)},safeDecode(t,e){return UBt(this,t,e)},async safeEncodeAsync(t,e){return yBt(this,t,e)},async safeDecodeAsync(t,e){return bBt(this,t,e)},toJSONSchema(t){return _Pt(this,{})(t)},get description(){var t;return(t=q3.get(this))==null?void 0:t.description},get _def(){return this._zod.def}}),_Ae=wt("_ZodString",(t,e)=>{Bee.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$Pt(t,r,n)},tAe({format:t=>xh(t).format??null,minLength:t=>xh(t).minimum??null,maxLength:t=>xh(t).maximum??null},{regex(...t){return this.check(vPt(...t))},includes(...t){return this.check(TPt(...t))},startsWith(...t){return this.check(CPt(...t))},endsWith(...t){return this.check(kPt(...t))},min(...t){return this.check(xI(...t))},max(...t){return this.check(wAe(...t))},length(...t){return this.check(TAe(...t))},nonempty(...t){return this.check(xI(1,...t))},lowercase(t){return this.check(xPt(t))},uppercase(t){return this.check(wPt(t))},trim(){return this.check(EPt())},normalize(...t){return this.check(SPt(...t))},toLowerCase(){return this.check(APt())},toUpperCase(){return this.check(MPt())},slugify(){return this.check(RPt())}})),xBt=wt("ZodString",(t,e)=>{Bee.init(t,e),_Ae.init(t,e)},{email(t){return this.check(H_t(SBt,t))},url(t){return this.check(X_t(ABt,t))},jwt(t){return this.check(uPt(HBt,t))},emoji(t){return this.check(K_t(MBt,t))},guid(t){return this.check(G_t(EBt,t))},uuid(t){return this.check(W_t(oE,t))},uuidv4(t){return this.check(q_t(oE,t))},uuidv6(t){return this.check(j_t(oE,t))},uuidv7(t){return this.check(Y_t(oE,t))},nanoid(t){return this.check(Z_t(RBt,t))},cuid(t){return this.check(J_t(LBt,t))},cuid2(t){return this.check(Q_t(IBt,t))},ulid(t){return this.check(ePt(NBt,t))},base64(t){return this.check(oPt(FBt,t))},base64url(t){return this.check(lPt(zBt,t))},xid(t){return this.check(tPt(DBt,t))},ksuid(t){return this.check(rPt(OBt,t))},ipv4(t){return this.check(nPt(_Bt,t))},ipv6(t){return this.check(iPt(PBt,t))},cidrv4(t){return this.check(aPt(BBt,t))},cidrv6(t){return this.check(sPt($Bt,t))},e164(t){return this.check(cPt(VBt,t))},datetime(t){return this.check(hPt(wBt,t))},date(t){return this.check(dPt(TBt,t))},time(t){return this.check(fPt(CBt,t))},duration(t){return this.check(pPt(kBt,t))}});function $e(t){return V_t(xBt,t)}const Ea=wt("ZodStringFormat",(t,e)=>{fa.init(t,e),_Ae.init(t,e)}),wBt=wt("ZodISODateTime",(t,e)=>{GOt.init(t,e),Ea.init(t,e)}),TBt=wt("ZodISODate",(t,e)=>{WOt.init(t,e),Ea.init(t,e)}),CBt=wt("ZodISOTime",(t,e)=>{qOt.init(t,e),Ea.init(t,e)}),kBt=wt("ZodISODuration",(t,e)=>{jOt.init(t,e),Ea.init(t,e)}),SBt=wt("ZodEmail",(t,e)=>{ROt.init(t,e),Ea.init(t,e)}),EBt=wt("ZodGUID",(t,e)=>{AOt.init(t,e),Ea.init(t,e)}),oE=wt("ZodUUID",(t,e)=>{MOt.init(t,e),Ea.init(t,e)}),ABt=wt("ZodURL",(t,e)=>{_Ot.init(t,e),Ea.init(t,e)}),MBt=wt("ZodEmoji",(t,e)=>{POt.init(t,e),Ea.init(t,e)}),RBt=wt("ZodNanoID",(t,e)=>{BOt.init(t,e),Ea.init(t,e)}),LBt=wt("ZodCUID",(t,e)=>{$Ot.init(t,e),Ea.init(t,e)}),IBt=wt("ZodCUID2",(t,e)=>{FOt.init(t,e),Ea.init(t,e)}),NBt=wt("ZodULID",(t,e)=>{zOt.init(t,e),Ea.init(t,e)}),DBt=wt("ZodXID",(t,e)=>{VOt.init(t,e),Ea.init(t,e)}),OBt=wt("ZodKSUID",(t,e)=>{HOt.init(t,e),Ea.init(t,e)}),_Bt=wt("ZodIPv4",(t,e)=>{YOt.init(t,e),Ea.init(t,e)}),PBt=wt("ZodIPv6",(t,e)=>{KOt.init(t,e),Ea.init(t,e)}),BBt=wt("ZodCIDRv4",(t,e)=>{ZOt.init(t,e),Ea.init(t,e)}),$Bt=wt("ZodCIDRv6",(t,e)=>{QOt.init(t,e),Ea.init(t,e)}),FBt=wt("ZodBase64",(t,e)=>{e_t.init(t,e),Ea.init(t,e)}),zBt=wt("ZodBase64URL",(t,e)=>{r_t.init(t,e),Ea.init(t,e)}),VBt=wt("ZodE164",(t,e)=>{n_t.init(t,e),Ea.init(t,e)}),HBt=wt("ZodJWT",(t,e)=>{a_t.init(t,e),Ea.init(t,e)}),PAe=wt("ZodNumber",(t,e)=>{pAe.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FPt(t,r,n,i),t.isFinite=!0},tAe({minValue:t=>{const{minimum:e,exclusiveMinimum:r}=xh(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{const{maximum:e,exclusiveMaximum:r}=xh(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{const{isInt:e,multipleOf:r}=xh(t);return!!e||!!(r!=null&&r.some(Number.isSafeInteger))},format:t=>xh(t).format??null},{gt(t,e){return this.check(_fe(t,e))},gte(t,e){return this.check(oF(t,e))},min(t,e){return this.check(oF(t,e))},lt(t,e){return this.check(Ofe(t,e))},lte(t,e){return this.check(sF(t,e))},max(t,e){return this.check(sF(t,e))},int(t){return this.check(qfe(t))},safe(t){return this.check(qfe(t))},positive(t){return this.check(_fe(0,t))},nonnegative(t){return this.check(oF(0,t))},negative(t){return this.check(Ofe(0,t))},nonpositive(t){return this.check(sF(0,t))},multipleOf(t,e){return this.check(Pfe(t,e))},step(t,e){return this.check(Pfe(t,e))},finite(){return this}}));function Qt(t){return gPt(PAe,t)}const GBt=wt("ZodNumberFormat",(t,e)=>{s_t.init(t,e),PAe.init(t,e)});function qfe(t){return mPt(GBt,t)}const WBt=wt("ZodBoolean",(t,e)=>{o_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zPt(t,r,n)});function cn(t){return UPt(WBt,t)}const qBt=wt("ZodUnknown",(t,e)=>{l_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HPt()});function Kd(){return yPt(qBt)}const jBt=wt("ZodNever",(t,e)=>{c_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VPt(t,r,n)});function YBt(t){return bPt(jBt,t)}const XBt=wt("ZodArray",(t,e)=>{ZO(),d_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YPt(t,r,n,i),t.element=e.element},{min(t,e){return this.check(xI(t,e))},nonempty(t){return this.check(xI(1,t))},max(t,e){return this.check(wAe(t,e))},length(t,e){return this.check(TAe(t,e))},unwrap(){return this.element}});function Tn(t,e){return LPt(XBt,t,e)}const KBt=wt("ZodObject",(t,e)=>{ZO(),g_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XPt(t,r,n,i),fDt(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return nn(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(Wc(this._zod.def,{catchall:t}))},passthrough(){return this.clone(Wc(this._zod.def,{catchall:Kd()}))},loose(){return this.clone(Wc(this._zod.def,{catchall:Kd()}))},strict(){return this.clone(Wc(this._zod.def,{catchall:YBt()}))},strip(){return this.clone(Wc(this._zod.def,{catchall:void 0}))},extend(t){return rDt(this,t)},safeExtend(t){return nDt(this,t)},merge(t){return iDt(this,t)},pick(t){return eDt(this,t)},omit(t){return tDt(this,t)},partial(...t){return Ufe($Ae,this,t[0])},exactPartial(...t){return Ufe(FAe,this,t[0],"exactPartial")},required(...t){return aDt(zAe,this,t[0])}});function Ct(t,e){const r={type:"object",shape:t??{},...Rr(e)};return new KBt(r)}const BAe=wt("ZodUnion",(t,e)=>{UAe.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KPt(t,r,n,i),t.options=e.options});function Eg(t,e){return new BAe({type:"union",options:t,...Rr(e)})}const ZBt=wt("ZodDiscriminatedUnion",(t,e)=>{BAe.init(t,e),U_t.init(t,e)});function zee(t,e,r){return new ZBt({type:"union",options:e,discriminator:t,...Rr(r)})}const JBt=wt("ZodIntersection",(t,e)=>{y_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZPt(t,r,n,i)});function QBt(t,e){return new JBt({type:"intersection",left:t,right:e})}const jfe=wt("ZodRecord",(t,e)=>{ZO(),b_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QPt(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function JO(t,e,r){return!e||!e._zod?new jfe({type:"record",keyType:$e(),valueType:t,...Rr(e)}):new jfe({type:"record",keyType:t,valueType:e,...Rr(r)})}const fq=wt("ZodEnum",(t,e)=>{v_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(n,i,a)=>GPt(t,n,i),t.enum=e.entries,t.options=[...t._zod.values];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 fq({...e,checks:[],...Rr(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 fq({...e,checks:[],...Rr(i),entries:a})}});function nn(t,e){const r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new fq({type:"enum",entries:r,...Rr(e)})}const e$t=wt("ZodLiteral",(t,e)=>{x_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WPt(t,r,n,i),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 Wn(t,e){return new e$t({type:"literal",values:Array.isArray(t)?t:[t],...Rr(e)})}const t$t=wt("ZodTransform",(t,e)=>{ZO(),w_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jPt(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new rAe(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(DT(a,r.value,e));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=t),r.issues.push(DT(s))}};const i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function r$t(t){return new t$t({type:"transform",transform:t})}const $Ae=wt("ZodOptional",(t,e)=>{yAe.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Yfe(t){return new $Ae({type:"optional",innerType:t})}const FAe=wt("ZodExactOptional",(t,e)=>{T_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OAe(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function n$t(t){return new FAe({type:"optional",innerType:t})}const i$t=wt("ZodNullable",(t,e)=>{C_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Xfe(t){return new i$t({type:"nullable",innerType:t})}const a$t=wt("ZodDefault",(t,e)=>{k_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function s$t(t,e){return new a$t({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():KEe(e)}})}const o$t=wt("ZodPrefault",(t,e)=>{S_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function l$t(t,e){return new o$t({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():KEe(e)}})}const zAe=wt("ZodNonOptional",(t,e)=>{E_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function c$t(t,e){return new zAe({type:"nonoptional",innerType:t,...Rr(e)})}const u$t=wt("ZodCatch",(t,e)=>{A_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function h$t(t,e){return new u$t({type:"catch",innerType:t,catchValue:typeof e=="function"?e:gDt(e)})}const d$t=wt("ZodPipe",(t,e)=>{M_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aBt(t,r,n,i),t.in=e.in,t.out=e.out});function Kfe(t,e){return new d$t({type:"pipe",in:t,out:e})}const f$t=wt("ZodReadonly",(t,e)=>{R_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sBt(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function p$t(t){return new f$t({type:"readonly",innerType:t})}const g$t=wt("ZodCustom",(t,e)=>{L_t.init(t,e),Sa.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qPt(t,r,n,i)});function m$t(t,e={}){return IPt(g$t,t,e)}function U$t(t,e){return NPt(t,e)}const pq=["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"],y$t=["professional","friendly","casual","direct"],b$t=["en","zh-CN","zh-TW","ja","ko","es","fr","de","pt","pl"],v$t=["image/jpeg","image/png","image/webp","image/gif","application/pdf","application/json","text/plain","text/markdown","text/csv"],x$t=4,Zfe=4*1024*1024,w$t=256*1024,T$t=8*1024*1024,VAe=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},C$t=t=>t.startsWith("text/")||t==="application/json",Vee=["none","target-language","tone"],Hee=["append","replace","both"],CI=$e().uuid();Ct({content:$e().trim().min(1).max(500),sourceTurnId:CI.optional()}).strict();Ct({content:$e().trim().min(1).max(500),version:Qt().int().positive()}).strict();const k$t=Ct({memoId:$e().trim().min(1).max(100).optional(),notebookId:$e().trim().min(1).max(100).optional(),notebookTitle:$e().trim().max(160).optional(),title:$e().trim().max(160).optional(),selectionMarkdown:$e().max(2e3).optional(),contentMarkdown:$e().max(4e3).optional(),contentTruncated:cn().optional(),diagramKind:nn(["mind-map","flowchart","architecture"]).optional()}).strict(),S$t=Ct({type:nn(["memo","notebook","tag"]),id:$e().trim().min(1).max(100),title:$e().trim().max(160).optional()}).strict();Ct({id:CI,threadId:CI,message:$e().trim().min(1).max(4e3),useMemory:cn().default(!0),allowNotes:cn().default(!1),allowWrites:cn().optional(),locale:nn(["zh-CN","en-US","ja","pl"]).default("en-US"),focus:k$t.optional(),mentions:Tn(S$t).max(8).optional(),attachmentIds:Tn($e().uuid()).max(4).optional()}).strict();Ct({id:$e().trim().min(1).max(80),prompt:$e().trim().min(1).max(200),inputType:nn(["free_text","single_select","multi_select"]),options:Tn(Ct({id:$e().trim().min(1).max(80),label:$e().trim().min(1).max(80)}).strict()).min(2).max(6).optional()}).strict();const E$t=Ct({questionId:$e().trim().min(1).max(80),optionIds:Tn($e().trim().min(1).max(80)).max(6).optional(),text:$e().trim().max(400).optional()}).strict();Ct({answers:Tn(E$t).max(3).optional()}).strict();Ct({name:$e().trim().min(1).max(80),input:JO($e(),Kd()).default({}),callId:$e().trim().min(1).max(100).optional(),response:$e().max(16e3).optional(),process:$e().max(32e3).optional()}).strict();Ct({response:$e().max(16e3),process:$e().max(32e3).optional()}).strict();Ct({response:$e().max(16e3),process:$e().max(32e3).optional(),status:nn(["completed","interrupted","failed"]),inputTokens:Qt().int().nonnegative().optional(),outputTokens:Qt().int().nonnegative().optional()}).strict();Ct({enabled:cn(),learningEnabled:cn().optional(),useMemory:cn().optional(),version:Qt().int().nonnegative()}).strict();const A$t=$e().trim().min(1).max(180).refine(t=>t.split(/\r?\n/).length<=3,"Discovery body must contain at most 3 lines.");Ct({suggestion:Ct({kind:nn(["insight","merge","append","move","tag"]),title:$e().trim().min(1).max(60),body:A$t,sourceIds:Tn($e().min(1).max(100)).min(1).max(5),memoryIds:Tn($e().max(100)).max(8).optional(),notebookId:$e().max(100).nullable().optional(),tags:Tn($e().min(1).max(40)).max(5).optional(),targetId:$e().max(100).nullable()}).nullable()});Ct({turnId:CI,output:Kd()}).strict();const Gee=$e().trim().min(1).max(400),HAe=$e().trim().min(1).max(100),M$t=Ct({kind:Wn("merge"),memoIds:Tn(HAe).min(2).max(5),title:$e().trim().min(1).max(160),reason:Gee}).strict(),R$t=Ct({kind:Wn("tag"),memoId:HAe,tags:Tn($e().trim().min(1).max(40)).min(1).max(5),reason:Gee}).strict(),L$t=Ct({kind:Wn("tool"),toolName:$e().min(1).max(80),arguments:JO($e(),Kd()),reason:Gee}).strict();zee("kind",[M$t,R$t,L$t]);Ct({version:Eg([Wn(1),Wn(2)]),memories:Tn(Ct({content:$e().trim().min(1).max(500),kind:nn(["explicit","inferred"]).optional()})).max(50),controls:Ct({useMemory:cn(),learningEnabled:cn()}).optional()}).strict();const T2=(t,e,r,n,i)=>({...t,...e,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});T2({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("")},{name:"要約する",description:"テーマ、結論、実行できる結果に圧縮する",instruction:["ノートを本当に要約してください。逐語の言い換え、行ごとの書き換え、エコーのような再述はしないでください。","中心テーマ、主要な主張、重要な結論、実行できる結果を抜き出してください。","繰り返し、修辞、例示、引用、枝葉の詳細は、重要な結論を理解するのに必要でない限り省いてください。","長いノートは原文のおよそ 20–30% を目安に、3–7 個の簡潔な Markdown 箇条書きにしてください。短いノートは 1–3 文で構いません。","長い原文をそのまま写したり、原文にない事実を足したりしないでください。","ノートの言語を保ち、Markdown の要約だけを返してください。"].join("")},{name:"Podsumuj",description:"Streść notatkę do tematu, wniosków i działań do podjęcia",instruction:["Utwórz faktycznie skondensowane podsumowanie notatki, zamiast ją przepisywać, parafrazować zdanie po zdaniu lub powtarzać. ","Wskaż główny temat, najważniejsze tezy, kluczowe wnioski i działania do podjęcia. ","Pomiń powtórzenia, ozdobniki retoryczne, przykłady, cytaty i drobne szczegóły, chyba że są niezbędne do zrozumienia kluczowego wniosku. ","W przypadku obszernej notatki celuj w około 20–30% długości oryginału i użyj 3–7 zwięzłych punktów listy Markdown; w przypadku krótkiej notatki wystarczą 1–3 zwięzłe zdania. ","Nie przytaczaj dosłownie długich fragmentów i nie dodawaj faktów, których nie ma w oryginale. ","Zachowaj język notatki i zwróć wyłącznie podsumowanie w formacie Markdown."].join("")}),T2({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."},{name:"翻訳する",description:"指定した言語へ翻訳し、構造と書式を残す",instruction:"ノート全体を、ユーザーが指定した目標言語へ翻訳してください。意味、Markdown の構造、リンク、コードブロックは残してください。解説は付けず、訳文だけを返してください。"},{name:"Przetłumacz",description:"Przetłumacz na wybrany język, zachowując formatowanie",instruction:"Przetłumacz całą notatkę na język docelowy wskazany przez użytkownika. Zachowaj jej znaczenie, strukturę Markdown, linki i bloki kodu. Zwróć wyłącznie przetłumaczoną notatkę, bez komentarzy."}),T2({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."},{name:"文章を整える",description:"誤字と文法を直し、わかりやすさと流れを上げる",instruction:"内容を整えてください。誤字、文法、句読点を直し、語彙、文の形、明瞭さ、流れを改善します。意味を変えたり、意図的に短くしたりしないでください。元の言語と有用な Markdown 書式は残してください。整えた本文だけを返してください。"},{name:"Popraw styl",description:"Popraw język oraz zwiększ przejrzystość i płynność tekstu",instruction:"Dopracuj treść: popraw pisownię, gramatykę i interpunkcję oraz ulepsz dobór słów, budowę zdań, przejrzystość i płynność. Nie zmieniaj jej znaczenia ani celowo jej nie skracaj. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),T2({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."},{name:"簡潔にする",description:"重複と冗長さを削り、短くはっきり書く",instruction:"内容を簡潔にしてください。繰り返し、空疎な言い回し、不要な修飾を削り、まとめられる文はまとめて、短く、はっきり、力強くしてください。重要な事実、主張、元の意味はすべて残し、新しい情報は足さないでください。元の言語と有用な Markdown 書式は残してください。簡潔にした本文だけを返してください。"},{name:"Skróć i uprość",description:"Usuń powtórzenia i napisz tekst zwięźle i konkretnie",instruction:"Dopracuj treść, usuwając powtórzenia, puste frazy i zbędne określenia oraz łącząc zdania tam, gdzie to pomaga. Spraw, by tekst był zwięzły, jasny i konkretny, zachowując każdy kluczowy fakt, tezę i pierwotne znaczenie. Nie dodawaj nowych informacji. Zachowaj jej język i przydatne formatowanie Markdown. Zwróć wyłącznie dopracowaną treść."}),T2({key:"extract-todos",action:"extract-todos",parameterKind:"none",resultMode:"append"},{name:"提取待办",description:"识别可执行任务,生成任务清单",instruction:"从笔记中提取明确或隐含的可执行任务,用 Markdown 任务列表(- [ ])输出。保持原语言,不要编造任务。若没有可执行事项,用原文语言简短说明。"},{name:"Extract tasks",description:"Identify actionable work and produce a task list",instruction:"Extract explicit or implied actionable tasks from the note as a Markdown task list using '- [ ]'. Preserve its language and do not invent tasks. If there are no actionable tasks, say so briefly in the note's language."},{name:"タスクを抜き出す",description:"実行できる作業を見つけ、チェックリストにする",instruction:"ノートから明示または含意された実行可能なタスクを抜き出し、Markdown のタスクリスト(- [ ])で出力してください。ノートの言語を保ち、タスクを捏造しないでください。実行できることがなければ、ノートの言語で短くそう書いてください。"},{name:"Wyodrębnij zadania",description:"Znajdź działania do wykonania i utwórz listę zadań",instruction:"Wyodrębnij z notatki jawne lub domniemane zadania do wykonania jako listę zadań Markdown z użyciem '- [ ]'. Zachowaj jej język i nie wymyślaj zadań. Jeśli nie ma zadań do wykonania, napisz to krótko w języku notatki."}),T2({key:"continue-writing",action:"continue-writing",parameterKind:"none",resultMode:"append"},{name:"继续写作",description:"从笔记末尾自然续写",instruction:"从笔记结束处自然续写。只返回新增续写内容,不要重复原文。保持原语言与 Markdown 风格。"},{name:"Continue writing",description:"Continue naturally from the end of the note",instruction:"Continue writing naturally from where the note ends. Return only the new continuation, not the original content. Preserve its language and Markdown style."},{name:"続きを書く",description:"ノートの末尾から自然に書き継ぐ",instruction:"ノートの終わりから自然に書き継いでください。原文は繰り返さず、新しい続きだけを返してください。元の言語と Markdown の調子を保ってください。"},{name:"Pisz dalej",description:"Kontynuuj naturalnie od końca notatki",instruction:"Kontynuuj pisanie naturalnie od miejsca, w którym kończy się notatka. Zwróć wyłącznie nową kontynuację, bez oryginalnej treści. Zachowaj jej język i styl Markdown."});const I$t=new Set([o0,Oy]),e3=(t,e)=>{var n;const r=(n=t.attrs)==null?void 0:n[e];return typeof r=="string"?r:""},Jfe="edgeever-attachment-kind-",Wee=t=>t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim(),GAe=(t,e,r)=>{const n=typeof r=="string"?r.split(/\s+/).filter(a=>a&&a!=="edgeever-attachment-link"&&!a.startsWith(Jfe)):[],i=Yv(e,Wee(t));return[...n,"edgeever-attachment-link",`${Jfe}${i}`].join(" ")},N$t=Di.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=>Wg(t.getAttribute("data-attachment-byte-size")),renderHTML:t=>{const e=Wg(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":DLt(n,r,e)}}}}}]}}),Qfe=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/")},D$t=t=>{var e;return(e=t.marks)!=null&&e.some(Qfe)?{...t,marks:t.marks.map(r=>{var n,i;return Qfe(r)?{...r,attrs:{...r.attrs,class:GAe(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:Wee(t.text)}}:r})}:t},O$t=t=>{var s;const e=e3(t,"url"),r=e3(t,"label")||e3(t,"filename")||"Attachment",n=e3(t,"mimeType"),i=e3(t,"filename")||Wee(r),a=Wg((s=t.attrs)==null?void 0:s.byteSize);return{type:"text",text:r,...e?{marks:[{type:"link",attrs:{href:e,target:"_blank",class:GAe(r,n),attachmentFilename:i,attachmentMimeType:n,attachmentByteSize:a}}]}:{}}},_$t=t=>{const e=r=>I$t.has(r.type)?O$t(r):"content"in r&&r.content?{...r,content:r.content.map(e)}:r.type==="text"?D$t(r):r;return{...t,content:t.content.map(r=>e(r))}},P$t="edgeever-zip",B$t=2,Lh=$e().datetime();Ct({format:Wn(P$t),formatVersion:Eg([Wn(1),Wn(B$t)]),schemaVersion:Qt().int().positive(),edgeeverVersion:$e().trim().min(1),buildId:$e().trim().min(1),exportedAt:Lh,includesTrash:Wn(!1),counts:Ct({notebooks:Qt().int().min(0),memos:Qt().int().min(0),revisions:Qt().int().min(0),resources:Qt().int().min(0),prompts:Qt().int().min(0).optional()})});const $$t=Ct({id:$e().trim().min(1),parentId:$e().trim().min(1).nullable(),name:$e().trim().min(1).max(80),slug:$e().nullable(),icon:$e().nullable(),color:$e().nullable(),sortOrder:Qt().int(),createdAt:Lh,updatedAt:Lh}),F$t=Ct({id:$e().trim().min(1),memoId:$e().trim().min(1),revision:Qt().int().min(0),title:$e().nullable(),tags:Tn($e()),contentJson:Kd(),contentMarkdown:$e(),contentText:$e(),contentHash:$e(),createdBy:$e(),createdAt:Lh}),z$t=Ct({id:$e().trim().min(1),notebookId:$e().trim().min(1),title:$e().nullable(),excerpt:$e(),tags:Tn($e()),isPinned:cn(),isArchived:cn(),isDeleted:cn(),revision:Qt().int().min(0),createdAt:Lh,updatedAt:Lh,deletedAt:Lh.nullable(),contentJson:Kd(),contentMarkdown:$e(),contentText:$e(),contentHash:$e(),sourceMemoIds:Tn($e()),mergeSourceCount:Qt().int().min(0),mergedIntoMemoId:$e().nullable()}),WAe=Ct({memo:z$t,revisions:Tn(F$t),resources:Tn(Ct({id:$e().trim().min(1),memoId:$e().trim().min(1),originalMemoId:$e().nullable(),kind:nn(["image","attachment"]),mimeType:$e().nullable(),filename:$e().nullable(),byteSize:Qt().int().min(0),sha256:$e().nullable(),width:Qt().int().positive().nullable(),height:Qt().int().positive().nullable(),createdAt:Lh,updatedAt:Lh,archivePath:$e().trim().min(1)}))});Ct({notebooks:Tn($$t).min(1).max(100)});Ct({memos:Tn(WAe).min(1).max(10)});const V$t=Ct({id:$e().trim().min(1).max(200),origin:nn(["default","custom"]),seedKey:nn(pq.filter(t=>t!=="custom")).nullable(),action:nn(pq),parameterKind:nn(Vee),resultMode:nn(Hee),nameCustomized:cn(),descriptionCustomized:cn(),instructionCustomized:cn(),name:$e().trim().min(1).max(80),description:$e().max(200).nullable(),instruction:$e().trim().min(1).max(2e3),createdAt:Lh,updatedAt:Lh}).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."})});Ct({prompts:Tn(V$t).max(100)});WAe.shape.resources.element;const t3=(t,e,r,n,i)=>({...t,translations:{"zh-CN":e,"en-US":r,ja:n,pl:i}});t3({key:"quick-note",translationKey:"quickNote",tag:"quick-note"},{title:"灵感速记",description:"快速捕捉闪念、临时灵感、资料链接与即刻行动。",contentMarkdown:`## 💡 闪念记录 - @@ -1611,7 +2281,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 🚀 Kolejne kroki -- [ ] `}),QC({key:"meeting",translationKey:"meeting",tag:"meeting"},{title:"会议纪要",description:"结构化记录议题背景、核心结论与带负责人的待办事项。",contentMarkdown:`# 📝 会议纪要 +- [ ] `}),t3({key:"meeting",translationKey:"meeting",tag:"meeting"},{title:"会议纪要",description:"结构化记录议题背景、核心结论与带负责人的待办事项。",contentMarkdown:`# 📝 会议纪要 - **时间**: - **主持人/记录人**: @@ -1715,7 +2385,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] **[Osoba odpowiedzialna]** Opis zadania (termin: MM-DD) - [ ] **[Osoba odpowiedzialna]** Opis zadania (termin: MM-DD) -`}),QC({key:"weekly-review",translationKey:"weeklyReview",tag:"weekly-review"},{title:"周报与进展复盘",description:"梳理本周核心产出、风险卡点与下周关键优先级。",contentMarkdown:`# 🗓️ 工作周报 +`}),t3({key:"weekly-review",translationKey:"weeklyReview",tag:"weekly-review"},{title:"周报与进展复盘",description:"梳理本周核心产出、风险卡点与下周关键优先级。",contentMarkdown:`# 🗓️ 工作周报 ## 🌟 本周核心进展 (Highlights) @@ -1795,7 +2465,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 💡 Refleksje i wnioski - -`}),QC({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片 +`}),t3({key:"reading",translationKey:"reading",tag:"reading"},{title:"深度阅读卡片",description:"提炼核心观点、精妙摘录、个人理解与关联知识卡片。",contentMarkdown:`# 📖 深度阅读卡片 - **书名/文章**: - **作者/来源**: @@ -1891,7 +2561,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. ## 🔗 Działanie i praktyka - [ ] **Plan działania**: -`}),QC({key:"okr",translationKey:"okr",tag:"okr"},{title:"目标与任务拆解",description:"明确 OKR 目标、关键结果、里程碑与具体执行清单。",contentMarkdown:`# 🎯 目标拆解 +`}),t3({key:"okr",translationKey:"okr",tag:"okr"},{title:"目标与任务拆解",description:"明确 OKR 目标、关键结果、里程碑与具体执行清单。",contentMarkdown:`# 🎯 目标拆解 - **周期**: - **负责人**: @@ -1991,548 +2661,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. - [ ] - [ ] -`});const dFt=["clay","orange","dawn","teal","azure","violet","pink","slate"],fFt=["native",...dFt],pFt=8*1024;Ft({name:Ue().trim().min(1).max(80),parentId:Ue().trim().min(1).nullable().optional()});Ft({name:Ue().trim().min(1).max(80).optional(),parentId:Ue().trim().min(1).nullable().optional(),sortOrder:Fr().int().optional()});Ft({notebookId:Ue().trim().min(1),title:Ue().trim().max(160).optional(),contentJson:Xd().optional(),contentMarkdown:Ue().optional(),tags:Gn(Ue()).optional(),createdAt:Ue().datetime().optional(),updatedAt:Ue().datetime().optional()});Ft({expectedRevision:Fr().int().min(0).optional(),expectedContentHash:Ue().length(64).optional(),editSessionId:Ue().trim().min(1).optional(),notebookId:Ue().trim().min(1).optional(),title:Ue().trim().max(160).optional(),isPinned:wn().optional(),contentJson:Xd().optional(),contentMarkdown:Ue().optional(),tags:Gn(Ue()).optional(),createdAt:Ue().datetime().optional(),updatedAt:Ue().datetime().optional(),allowDestructiveOverwrite:wn().optional()});Ft({name:Ue().trim().min(1).max(160),description:Ue().trim().max(500).optional(),memoId:Ue().trim().min(1).optional(),title:Ue().trim().max(160).nullable().optional(),contentMarkdown:Ue().optional(),tags:Gn(Ue()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Ft({name:Ue().trim().min(1).max(160).optional(),description:Ue().trim().max(500).nullable().optional(),title:Ue().trim().max(160).nullable().optional(),contentMarkdown:Ue().optional(),tags:Gn(Ue()).optional()});Ft({notebookId:Ue().trim().min(1)});const PRe=Ft({pluginId:Ue().trim().min(3).max(200),commandId:Ue().trim().min(1).max(200)}),gFt=Ft({name:Ue().trim().min(1).max(120),taskType:cs("plugin-command"),taskPayload:PRe,cronExpression:Ue().trim().min(1).max(160),timezone:Ue().trim().min(1).max(80),executorDeviceId:Ue().trim().min(16).max(160),missedRunPolicy:An(["run-once","skip"]).default("run-once"),isEnabled:wn().default(!0)});gFt.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:PRe.optional(),executorDeviceId:Ue().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ft({pluginId:Ue().trim().min(3).max(200),scheduleKey:Ue().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:Ue().trim().min(1).max(120),commandId:Ue().trim().min(1).max(200),cronExpression:Ue().trim().min(1).max(160),timezone:Ue().trim().min(1).max(80),executorDeviceId:Ue().trim().min(16).max(160),missedRunPolicy:An(["run-once","skip"]).default("run-once"),isEnabled:wn().optional()});Ft({scheduledFor:Ue().datetime(),executorDeviceId:Ue().trim().min(16).max(160)});Ft({executorDeviceId:Ue().trim().min(16).max(160),status:An(["succeeded","failed"]),errorMessage:Ue().trim().max(2e3).nullable().optional()});const Hfe=Ue().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});Ft({type:An(["plugin","theme"]),version:Ue().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:wn(),installedAt:Ue().datetime(),manifestUrl:Hfe,sourceKind:An(["marketplace","github","manifest"]),verified:wn(),repositoryUrl:Hfe.max(500).nullable().optional(),releaseTag:Ue().trim().min(1).max(80).nullable().optional(),publisher:cs("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});Ft({memoIds:Gn(Ue().trim().min(1)).min(1).max(100),notebookId:Ue().trim().min(1)});Ft({memoIds:Gn(Ue().trim().min(1)).min(1).max(100),permanent:wn().optional()});Ft({memoIds:Gn(Ue().trim().min(1)).min(2).max(50),notebookId:Ue().trim().min(1).optional(),title:Ue().trim().max(160).optional()});Ft({username:Ue().trim().min(1).max(80),password:Ue().min(1).max(512),deviceId:Ue().trim().min(16).max(160).optional()});Ft({label:Ue().trim().max(80).nullable()});Ft({currentPassword:Ue().min(1).max(512),newPassword:Ue().min(8).max(512),confirmPassword:Ue().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Ft({username:Ue().trim().min(1).max(80),displayName:Ue().trim().max(80).nullable().optional(),password:Ue().min(8).max(512)});Ft({displayName:Ue().trim().max(80).nullable().optional(),password:Ue().min(8).max(512).optional(),isDisabled:wn().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Ft({name:Ue().trim().min(1).max(80),scopes:Gn(Ue().trim().min(1).max(80)).min(1).max(32),expiresAt:Ue().datetime().nullable().optional()});Ft({name:Ue().trim().min(1).max(80)});Ft({filename:Ue().trim().min(1).max(160)});const $Re=Ue().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");MRe("provider",[Ft({provider:cs("builtin")}),Ft({provider:cs("s3"),displayName:Ue().trim().min(1).max(80),endpoint:$Re,region:Ue().trim().min(1).max(80),bucket:Ue().trim().min(1).max(255),accessKeyId:Ue().trim().min(1).max(256),secretAccessKey:Ue().min(1).max(1024).optional(),forcePathStyle:wn().default(!0),objectPrefix:Ue().trim().max(500).default("")})]);Ft({endpoint:$Re,region:Ue().trim().min(1).max(80),bucket:Ue().trim().min(1).max(255),accessKeyId:Ue().trim().min(1).max(256),secretAccessKey:Ue().min(1).max(1024).optional(),forcePathStyle:wn().default(!0),objectPrefix:Ue().trim().max(500).default("")});const BRe=An(["openai-compatible","anthropic","google"]),FRe=An(["openai-compatible"]),zRe=(t,e)=>{let r;try{r=new URL(t)}catch{e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});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."})},VRe=Ue().trim().url().max(500).superRefine(zRe),HRe=Ue().trim().min(1).max(500).superRefine((t,e)=>{if(!Ue().url().safeParse(t).success){e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}zRe(t,e)});Ft({provider:FRe.default("openai-compatible"),displayName:Ue().trim().min(1).max(80),baseUrl:HRe,apiKey:Ue().trim().min(1).max(4096),isEnabled:wn().default(!0),initialModelId:Ue().trim().min(1).max(200).optional()});Ft({provider:FRe.default("openai-compatible"),displayName:Ue().trim().min(1).max(80),baseUrl:HRe,apiKey:Ue().trim().min(1).max(4096).optional(),isEnabled:wn().default(!0)});Ft({modelId:Ue().trim().min(1).max(200),displayName:Ue().trim().min(1).max(80).optional()});Ft({modelConfigId:Ue().trim().min(1).nullable()});const GRe=Ft({provider:BRe,displayName:Ue().trim().min(1).max(80),baseUrl:VRe,isEnabled:wn().default(!0)});GRe.extend({apiKey:Ue().min(1).max(4096),initialModelId:Ue().trim().min(1).max(200).optional()});GRe.extend({apiKey:Ue().min(1).max(4096).optional()});Ft({modelId:Ue().trim().min(1).max(200),provider:BRe.optional(),baseUrl:VRe.optional(),apiKey:Ue().min(1).max(4096).optional()});Ft({modelId:Ue().trim().min(1).max(200),displayName:Ue().trim().min(1).max(200).optional()});Ft({modelConfigId:Ue().trim().min(1).nullable()});const mFt=Ft({filename:Ue().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:An(GBt),base64Data:Ue().min(1).max(Math.ceil(Ffe/3)*4)}).superRefine((t,e)=>{const r=IRe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=jBt(t.mediaType)?qBt:Ffe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Ft({action:An(oU),promptId:Ue().trim().min(1).max(200).optional(),locale:Ue().trim().min(2).max(35).optional(),title:Ue().trim().max(160).default(""),contentMarkdown:Ue().max(3e5),stream:wn().default(!1),targetLanguage:An(HBt).optional(),tone:An(VBt).optional(),instruction:Ue().trim().min(1).max(2e3).optional(),attachments:Gn(mFt).max(WBt).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,s)=>i+(IRe(s.base64Data)??0),0)>UBt&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Ft({title:Ue().trim().max(160).default(""),contentMarkdown:Ue().max(3e5),currentTags:Gn(Ue().trim().min(1).max(200)).max(24).default([]),locale:Ue().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."})});Ft({name:Ue().trim().min(1).max(80),description:Ue().trim().max(200).optional(),instruction:Ue().trim().min(1).max(2e3),parameterKind:An(Oee).default("none"),resultMode:An(Dee).default("both")});Ft({name:Ue().trim().min(1).max(80).optional(),description:Ue().trim().max(200).nullable().optional(),instruction:Ue().trim().min(1).max(2e3).optional(),parameterKind:An(Oee).optional(),resultMode:An(Dee).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ft({passwordProtected:wn()});Ft({bodyFont:An(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const Rp=Ue().regex(/^#[0-9a-f]{6}$/i),Gfe=Ft({background:Rp,text:Rp,muted:Rp,heading:Rp,accent:Rp,soft:Rp,codeBackground:Rp,border:Rp});Ft({fontSize:K5([cs(14),cs(16),cs(18),cs(20)]).nullable().optional(),lineHeight:K5([cs(1.5),cs(1.65),cs(2)]).nullable().optional(),palette:An(fFt).nullable().optional(),customCss:Ue().refine(t=>new TextEncoder().encode(t).byteLength<=pFt).nullable().optional(),customColors:Ft({light:Gfe,dark:Gfe}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ft({password:Ue().min(1).max(64)});const yFt=Ft({fieldId:Ue().trim().min(1).max(80),required:wn()});Ft({enabled:wn(),passwordProtected:wn(),rotatePassword:wn().optional(),title:Ue().trim().max(120),description:Ue().trim().max(1e3),submitLabel:Ue().trim().max(40),fields:Gn(yFt).max(40)});Ft({cells:XD(Ue().max(80),Xd())});const WRe="3.9.3",vFt=WRe,Wfe=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,qfe=typeof TextEncoder=="function"?new TextEncoder:void 0,bFt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Wk=Array.prototype.slice.call(bFt),sM=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Wk),xFt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,So=String.fromCharCode.bind(String),wFt=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),qRe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),URe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),jRe=t=>{let e,r,n,i,s="";const a=t.length%3;for(let o=0;o255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=Wk[e>>18&63]+Wk[e>>12&63]+Wk[e>>6&63]+Wk[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},Bee=typeof btoa=="function"?t=>btoa(t):jRe,lU=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?qRe(lU(t)):lU(t),TFt=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?So(192|e>>>6)+So(128|e&63):So(224|e>>>12&15)+So(128|e>>>6&63)+So(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return So(240|e>>>18&7)+So(128|e>>>12&63)+So(128|e>>>6&63)+So(128|e&63)}},CFt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,YRe=t=>t.replace(CFt,TFt),Ufe=qfe?t=>lU(qfe.encode(t)):t=>Bee(YRe(t)),ux=(t,e=!1)=>e?qRe(Ufe(t)):Ufe(t),jfe=t=>ux(t,!0),kFt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,SFt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return So((r>>>10)+55296)+So((r&1023)+56320);case 3:return So((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return So((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},XRe=t=>t.replace(kFt,SFt),KRe=t=>{if(t=t.replace(/\s+/g,""),!xFt.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let s=0;s>16&255)):n===64?i.push(So(e>>16&255,e>>8&255)):i.push(So(e>>16&255,e>>8&255,e&255));return i.join("")},Fee=typeof atob=="function"?t=>atob(URe(t)):KRe,ZRe=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>wFt(Fee(t).split("").map(e=>e.charCodeAt(0))),QRe=t=>ZRe(JRe(t)),EFt=Wfe?t=>Wfe.decode(ZRe(t)):t=>XRe(Fee(t)),JRe=t=>URe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),cU=t=>EFt(JRe(t)),AFt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},e9e=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),t9e=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,e9e(r));t("fromBase64",function(){return cU(this)}),t("toBase64",function(e){return ux(this,e)}),t("toBase64URI",function(){return ux(this,!0)}),t("toBase64URL",function(){return ux(this,!0)}),t("toUint8Array",function(){return QRe(this)})},r9e=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,e9e(r));t("toBase64",function(e){return KR(this,e)}),t("toBase64URI",function(){return KR(this,!0)}),t("toBase64URL",function(){return KR(this,!0)})},MFt=()=>{t9e(),r9e()},RFt={version:WRe,VERSION:vFt,atob:Fee,atobPolyfill:KRe,btoa:Bee,btoaPolyfill:jRe,fromBase64:cU,toBase64:ux,encode:ux,encodeURI:jfe,encodeURL:jfe,utob:YRe,btou:XRe,decode:cU,isValid:AFt,fromUint8Array:KR,toUint8Array:QRe,extendString:t9e,extendUint8Array:r9e,extendBuiltins:MFt},vl="#f8fafb",bl="#222325",Yfe={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},n9e='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',_Ft=12,LFt=550,IFt=17,NFt=10,OFt=14,uU=34,DFt=10,aM=32,oM=64,PFt=(t,e,r,n)=>({name:"manhattan",args:{padding:8,step:8,maxLoopCount:5e3,excludeNodes:[...new Set([t,e,...r])],...n?{startDirections:[n.source],endDirections:[n.target]}:{}}}),i9e=(t,e)=>{const r=t.x+t.width,n=e.x+e.width,i=t.y-(e.y+e.height),s=e.y-(t.y+t.height);if(e.x>=r)return e.x-roM?{source:"right",target:"bottom"}:e.x-roM?{source:"right",target:"top"}:{source:"right",target:"left"};if(n<=t.x)return t.x-noM?{source:"left",target:"bottom"}:t.x-noM?{source:"left",target:"top"}:{source:"left",target:"right"};const a=t.y+t.height/2;return e.y+e.height/2>=a?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},Xfe=({side:t,offset:e})=>({name:t,args:t==="left"||t==="right"?{dy:e}:{dx:e}}),$Ft=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=new Map,i=new Map;for(const s of e){const a=r.get(s.source),o=r.get(s.target);if(!a||!o)continue;const l=i9e(a,o);n.set(s.id,{source:{side:l.source,offset:0},target:{side:l.target,offset:0}});for(const[u,h,d,f]of[["source",a,l.source,o],["target",o,l.target,a]]){const p=`${h.id}:${d}`,g=i.get(p)??[];g.push({edgeId:s.id,end:u,opposite:d==="left"||d==="right"?f.y+f.height/2:f.x+f.width/2}),i.set(p,g)}}for(const[s,a]of i){if(a.length<2)continue;const o=s.lastIndexOf(":"),l=r.get(s.slice(0,o)),u=s.slice(o+1);if(!l)continue;const h=u==="left"||u==="right"?l.height:l.width,d=Math.min(Math.max(0,h-28),(a.length-1)*16);a.sort((f,p)=>f.opposite-p.opposite||f.edgeId.localeCompare(p.edgeId)),a.forEach(({edgeId:f,end:p},g)=>{const m=n.get(f);m&&(m[p].offset=Math.round(-d/2+d*g/(a.length-1)))})}return n},s9e=["client","frontend","service","database","storage","queue","security","external"],BFt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},FFt={light:{canvas:vl,boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:bl,boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},KD=(t="light")=>FFt[t],zFt=(t,e)=>{const r=KD(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:s9e.includes(t)?r.nodes[t]:r.nodes.service},VFt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,Kfe=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,HFt=t=>Math.round((t-uU)/2),a9e=(t,e)=>{const r=t??(s9e.includes(e)?BFt[e]:"service");return Yfe[r]??Yfe.service},GFt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=a9e(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},WFt=(t,e,r,n)=>{const i=KD(e),s=zFt(t,e),a=t==="boundary",o=VFt(t,r.height),l=HFt(r.height),u=a?[]:a9e(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:s.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:GFt(n,t),body:{fill:s.fill,stroke:s.stroke,strokeWidth:1.5,strokeDasharray:a||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:s.text,fontSize:a?12:_Ft,fontWeight:a?650:LFt,fontFamily:n9e,lineHeight:a?18:IFt,...a?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:a?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:DFt,y:l,width:uU,height:uU,rx:Kfe(t),ry:Kfe(t),fill:s.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},qFt=(t,e,r=!1)=>{const n=KD(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},hU='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',UFt=10,jFt=14,YFt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},XFt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,s=n.y-r.y;return s<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(s)>=Math.abs(i)?s>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},KFt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},ZFt=.85,QFt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],JFt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},ezt=t=>t&&QFt.includes(t)?t:t?JFt[t]??"brand":"plain",tzt={plain:{light:{canvas:vl,edge:"#737373",process:{fill:"#FFFFFF",stroke:"#D4D4D4",text:"#212121"},decision:{fill:"#F4F4F5",stroke:"#737373",text:"#212121"},terminator:{fill:"#707070",stroke:"#707070",text:"#FFFFFF"}},dark:{canvas:bl,edge:"#A3A3A3",process:{fill:"#1C1C1C",stroke:"#3A3A3A",text:"#F4F4F5"},decision:{fill:"#262626",stroke:"#A3A3A3",text:"#F4F4F5"},terminator:{fill:"#F5F5F5",stroke:"#F5F5F5",text:"#212121"}}},brand:{light:{canvas:vl,edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:bl,edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:vl,edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:bl,edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:vl,edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:bl,edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:vl,edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:bl,edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:vl,edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:bl,edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:vl,edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:bl,edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:vl,edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:bl,edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:vl,edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:bl,edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:vl,edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:bl,edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:vl,edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:bl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},o9e=(t="light",e)=>tzt[ezt(e)][t],rzt=(t,e,r)=>{const n=o9e(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},nzt=(t,e,r,n)=>{const i=rzt(t,e,n),s=t==="terminator",a=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:s?Math.round(r.height/2):10,ry:s?Math.round(r.height/2):10,...a?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:s?650:a?600:500,fontFamily:hU,lineHeight:18}}},izt=1,szt=2,azt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],ozt="plain",lzt=["plain","brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],czt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],uzt=[...czt,"rect","diamond","cloud"],hzt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},zee=t=>t&&azt.includes(t)?t:t?hzt[t]??"brand":ozt,dzt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],fzt="edgeever-diagram-v1",l9e=new RegExp(`\x3C!--\\s*${fzt}:([\\s\\S]*?)\\s*-->`),pzt=t=>RFt.decode(t),lM=t=>typeof t=="number"&&Number.isFinite(t),gzt=["mind-map","flowchart","architecture"],mzt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],Zfe=["dependency","request","async","data"],yzt=t=>typeof t=="string"&&dzt.includes(t),vzt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!lM(e.x)||!lM(e.y)||!lM(e.width)||!lM(e.height)||!mzt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...yzt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},bzt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!Zfe.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...Zfe.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},xzt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(l9e))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(pzt(e));if(!gzt.includes(i.kind))return null;const s=i.kind==="architecture";if((s?i.schemaVersion!==szt:i.schemaVersion!==izt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const a=lzt.includes(i.theme)?i.theme:void 0,o=uzt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(vzt),u=i.edges.map(bzt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(s){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...a?{theme:a}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},wzt=t=>(t??"").replace(l9e,"").trimEnd(),Tzt=1e5;Ft({prompt:Ue().trim().min(1).max(1e3),locale:Ue().trim().min(2).max(35).optional(),currentTemplate:Ue().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:Ue().max(Tzt).default(""),candidates:Gn(Ue().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Gn(Ft({prompt:Ue().max(1e3),response:Ue().max(2e3)})).max(12).default([])});const c9e={plain:{id:"plain",group:"classic",colors:["#707070","#8A8A8A","#A3A3A3","#BDBDBD","#D4D4D4","#FFFFFF"],accent:"#707070"},brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],accent:"#EC4899"}},Czt=Object.fromEntries(Object.entries(c9e).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),dU=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},kzt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,wl=(t,e,r)=>{const n=dU(t),i=dU(e);return kzt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},Szt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},u9e=t=>{const[e,r,n]=dU(t).map(Szt);return e*.2126+r*.7152+n*.0722},fU=t=>u9e(t)>.35?"#1C1917":"#FFFCF8",Ezt=t=>Czt[zee(t)].colors,Azt=t=>{const e=zee(t);return e!=="brand"&&e!=="plain"},pU=(t,e)=>{const r=u9e(t);return e==="dark"?r<.22?wl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?wl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},Mzt=(t,e)=>Ezt(t).map(n=>{const i=pU(n,e),s=e==="dark"?wl(n,"#121518",.72):wl(n,"#FFFFFF",.84);return{fill:s,stroke:e==="dark"?wl(i,"#FFFFFF",.15):wl(i,"#1C1917",.12),text:fU(s),edge:i}}),Rzt=(t,e)=>{const r=zee(t),n=c9e[r],i=n.accent;if(r==="plain")return e==="dark"?{topicFill:"#F5F5F5",topicText:"#212121",nodeFill:"#1C1C1C",nodeText:"#F4F4F5",nodeStroke:"#3A3A3A",topicStroke:"#F5F5F5",mindMapEdge:"#A3A3A3",flowEdge:"#A3A3A3",canvas:bl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:vl};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:bl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:vl};if(e==="dark"){const a=pU(i,"dark");return{topicFill:i,topicText:fU(i),nodeFill:wl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:wl(a,"#FFFFFF",.15),topicStroke:wl(i,"#FFFFFF",.25),mindMapEdge:a,flowEdge:wl(i,"#FFFFFF",.15),canvas:bl}}const s=pU(i,"light");return{topicFill:i,topicText:fU(i),nodeFill:wl(i,"#FFFFFF",.88),nodeText:wl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:wl(s,"#FFFFFF",.5),topicStroke:wl(i,"#1C1917",.15),mindMapEdge:s,flowEdge:wl(i,"#1C1917",.15),canvas:vl}},Vee=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),_zt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},Lzt=13,Izt=18,Qfe=.7,Nzt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&Vee(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),Ozt=(t,e)=>{const r=_zt(t),n=t==="decision",i=t==="terminator",s=i?36:28,a=r.width,o=Math.max(4,(n?a*Qfe:a-s)/Lzt),l=Nzt(e,o),u=Math.max(l.length,1)*Izt,h=Math.max(r.height,n?Math.ceil(u/(1-Qfe)):u+(i?16:18));return{width:a,height:h,text:l.join(` -`)}},h9e="edgeever-mindmap",Jfe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',Dzt=10,Pzt=14,Hee=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",$zt=t=>{const e=Hee(t);return e==="map"||e==="logic"},Q3=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,Gee=(t,e="primary")=>Q3(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",Bzt=(t,e="primary")=>{const r=Gee(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},Fzt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},zzt=(t,e)=>t.split(` -`).flatMap(r=>{const n=[];let i="";for(const s of Array.from(r))i&&Vee(i+s)>e&&(n.push(i),i=""),i+=s;return n.push(i),n}),tr=t=>(Math.round(t*100)/100).toFixed(2),Vzt=t=>Azt(t),ZR=(t,e)=>{const r=new Map(t.map(s=>[s.id,s])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},Hzt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,s=n;const a=new Set;for(;s.parentId&&r.has(s.parentId)&&!a.has(s.id);){a.add(s.id);const u=r.get(s.parentId);if(!u)break;if(!u.parentId){i=s;break}s=u,i=s}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},Gzt=(t,e,r)=>{if(t==null)return;const n=r?Mzt(r,e):Fzt[e];return n[t%n.length]},Wzt=(t,e="primary",r)=>{const n=e==="root",i=Q3(e,r),s=Gee(r,e),a=n?36:i?22:s==="diamond"||s==="hexagon"||s==="circle"?36:28,o=Math.round(Math.min(n?180:s==="circle"?132:168,Math.max(n?124:i?88:s==="circle"?108:96,Vee(t)*13+a))),l=n?46:i?32:s==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},qzt=(t,e,r)=>{const n=Wzt(t,e,r),i=Q3(e,r),s=e==="root"?20:18,a=e==="root"?36:i?22:28,o=zzt(t,Math.max(4,(n.width-a)/13));return{...n,height:Math.max(n.height,o.length*s+(e==="root"?18:i?10:14)),text:o.join(` -`),fontSize:e==="root"?15:e==="primary"?14:13}},Uzt=t=>Math.round(Math.max(1,t/2)),jzt=(t,e)=>`M 1 ${tr(Math.max(2,e-2))} H ${tr(Math.max(2,t-1))}`,Yzt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${tr(r*.18)} ${tr(n*.62)}`,`Q ${tr(r*.06)} ${tr(n*.6)} ${tr(r*.08)} ${tr(n*.44)}`,`Q ${tr(r*.02)} ${tr(n*.26)} ${tr(r*.22)} ${tr(n*.24)}`,`Q ${tr(r*.3)} ${tr(n*.06)} ${tr(r*.48)} ${tr(n*.14)}`,`Q ${tr(r*.6)} ${tr(n*.02)} ${tr(r*.72)} ${tr(n*.16)}`,`Q ${tr(r*.96)} ${tr(n*.14)} ${tr(r*.92)} ${tr(n*.4)}`,`Q ${tr(r*1.02)} ${tr(n*.56)} ${tr(r*.84)} ${tr(n*.64)}`,`Q ${tr(r*.8)} ${tr(n*.84)} ${tr(r*.58)} ${tr(n*.78)}`,`Q ${tr(r*.42)} ${tr(n*.92)} ${tr(r*.3)} ${tr(n*.76)}`,`Q ${tr(r*.12)} ${tr(n*.82)} ${tr(r*.18)} ${tr(n*.62)}`,"Z"].join(" ")},Xzt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:Yzt(e,r)}:{rx:n,ry:n},Kzt=(t,e,r={})=>{const n=r.underline??Q3(t,r.structure),i=r.width??96,s=r.height??(t==="root"?46:n?32:36),a=r.tint,o=Gee(r.structure,t);if(n){const h=(a==null?void 0:a.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(a==null?void 0:a.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:Jfe,lineHeight:18,refX:"50%",refY:s-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:jzt(i,s),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?Uzt(s):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(a==null?void 0:a.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(a==null?void 0:a.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...Xzt(o,i,s,u)},label:{fill:l?e.topicText:(a==null?void 0:a.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:Jfe,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},e0e=(t,e,r,n,i,s,a)=>{const o=ZR(t,e),l=Q3(o,a),u=Vzt(n)?Gzt(Hzt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:Kzt(o,r,{tint:u,underline:l,structure:a,width:s.width,height:s.height})}},Zzt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},Qzt=(t,e,r)=>{const n=Hee(r),i=t.x+t.width/2,s=e.x+e.width/2,a=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?sa+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o=i?"right":"left",target:"bottom"}:o>a+8?{source:s>=i?"right":"left",target:"top"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:s>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},t0e=(t,e,r,n)=>{const i=Q3(e,n),s=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...s?{args:{dy:s}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},Jzt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},r0e=(t,e)=>$zt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},eVt=(t,e,r,n,i)=>{const s=1-i;return{x:s*s*s*t.x+3*s*s*i*e.x+3*s*i*i*r.x+i*i*i*n.x,y:s*s*s*t.y+3*s*s*i*e.y+3*s*i*i*r.y+i*i*i*n.y}},tVt=(t,e,r,n,i)=>{const s=1-i;return{x:3*s*s*(e.x-t.x)+6*s*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*s*s*(e.y-t.y)+6*s*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},rVt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,s=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(s)<.01)return`M ${tr(t.x)} ${tr(t.y)} L ${tr(e.x)} ${tr(e.y)}`;const a=(t.x+e.x)/2,o=t,l={x:a,y:t.y},u={x:a,y:e.y},h=e,d=20,f=[],p=[];for(let y=0;y<=d;y+=1){const v=y/d,b=eVt(o,l,u,h,v),x=tVt(o,l,u,h,v),T=Math.hypot(x.x,x.y)||1,C=((1-v)*r+v*n)/2,S=-x.y/T,k=x.x/T;f.push({x:b.x+S*C,y:b.y+k*C}),p.push({x:b.x-S*C,y:b.y-k*C})}const g=f[0],m=[`M ${tr(g.x)} ${tr(g.y)}`];for(let y=1;y=0;y-=1)m.push(`L ${tr(p[y].x)} ${tr(p[y].y)}`);return m.push("Z"),m.join(" ")},nVt=t=>`${tr(t.x)} ${tr(t.y)}`,Kd=t=>t.map((e,r)=>`${r===0?"M":"L"} ${nVt(e)}`).join(" "),iVt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Kd([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Kd([t,n,i,e])},sVt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Kd([t,e]):Kd([t,{x:r,y:t.y},{x:r,y:e.y},e])},aVt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),s=Math.max(r??t.y,n??t.y,t.y,e.y),a=Math.max(18,s-i),o=(i+s)/2-a/2,l=o+a,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Kd([t,{x:d-h,y:t.y}]),`M ${tr(d-h)} ${tr(o)}`,`C ${tr(d)} ${tr(o)} ${tr(d)} ${tr(o)} ${tr(d)} ${tr((o+u)/2)}`,`C ${tr(d)} ${tr(u)} ${tr(d+h)} ${tr(u)} ${tr(d+h)} ${tr(u)}`,`C ${tr(d)} ${tr(u)} ${tr(d)} ${tr(u)} ${tr(d)} ${tr((u+l)/2)}`,`C ${tr(d)} ${tr(l)} ${tr(d)} ${tr(l)} ${tr(d-h)} ${tr(l)}`,Kd([{x:d,y:e.y},e])].join(" ")},oVt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Kd([t,e]):Kd([t,{x:e.x,y:t.y},e]),lVt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Kd([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),s={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Kd([t,s,e])},cVt=(t,e,r,n={})=>{const i=Hee(n.structure);return i==="org"?iVt(t,e):i==="tree"?sVt(t,e):i==="brace"?aVt(t,e,n.braceTop,n.braceBottom):i==="timeline"?oVt(t,e):i==="fishbone"?lVt(t,e):rVt(t,e,n.sourceWidth,n.targetWidth)},uVt=(t,e="light")=>Rzt(t,e),hVt=(t,e)=>{const r=uVt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?o9e(e,t.theme):null,i=t.kind==="architecture"?KD(e):null,s=t.nodes.map(h=>{const d=t.kind==="mind-map"?ZR(t.nodes,h.id):null,f=t.kind==="flowchart"?Ozt(h.shape,h.label):d?qzt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?e0e(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?nzt(h.shape,e,f,t.theme):null,y=t.kind==="architecture"?WFt(h.shape,e,f,h.resourceIcon):null,v=h.shape==="topic"&&!h.parentId,b=h.shape==="terminator",x=h.shape==="boundary",T=v||b,C=g?g.body.fill:m?m.body.fill:y?y.body.fill:T?r.topicFill:r.nodeFill,S=g?g.body.stroke:m?m.body.stroke:y?y.body.stroke:T?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:x?0:2,...y?{markup:y.markup}:d?{markup:Bzt(t.structure,d)}:{},attrs:{body:{strokeDasharray:(y==null?void 0:y.body.strokeDasharray)??(x?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(y==null?void 0:y.body)??{rx:b?24:11,ry:b?24:11},fill:C,stroke:S,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(y==null?void 0:y.body.strokeWidth)??1,...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(y==null?void 0:y.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(y==null?void 0:y.label.fill)??(T?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(y==null?void 0:y.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(y==null?void 0:y.label.fontWeight)??(T?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(y==null?void 0:y.label.fontFamily)??hU,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...y?{refX:y.label.refX,refY:y.label.refY,textAnchor:y.label.textAnchor,textVerticalAnchor:y.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(y==null?void 0:y.attrs)??{}}}}),a=new Map(s.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?$Ft(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=a.get(h.source),p=a.get(h.target),g=t.kind==="mind-map"?ZR(t.nodes,h.source):null,m=t.kind==="mind-map"?ZR(t.nodes,h.target):null,y=t.kind==="mind-map"?e0e(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,v=g?Zzt(g,r,y):null,b=f&&p?Qzt(f,p,t.structure):{source:"right",target:"left"},x=f&&g?t0e(f,g,b.source,t.structure):null,T=p&&m?t0e(p,m,b.target,t.structure):null,C=t.kind==="mind-map"&&t.structure==="brace"?Jzt(t.nodes,h.source):null,S=t.kind==="architecture"?qFt(d,e,h.bidirectional):null,k=(S==null?void 0:S.stroke)??(v==null?void 0:v.stroke)??(n==null?void 0:n.edge)??r.flowEdge,E=f&&p?t.kind==="architecture"?i9e(f,p):t.kind==="flowchart"?XFt(f,p):null:null,A=t.kind==="flowchart"&&!!(E&&f&&p&&KFt(f,p)),M=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...x??{anchor:{name:b.source}}}:M?{cell:h.source,anchor:Xfe(M.source)}:E?{cell:h.source,port:E.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...T??{anchor:{name:b.target}}}:M?{cell:h.target,anchor:Xfe(M.target)}:E?{cell:h.target,port:E.target}:{cell:h.target},router:t.kind==="architecture"?PFt(h.source,h.target,o,E??void 0):t.kind==="flowchart"?A?{name:"normal"}:YFt:void 0,connector:t.kind==="mind-map"?{name:h9e,args:{sourceWidth:v==null?void 0:v.sourceWidth,targetWidth:v==null?void 0:v.targetWidth,structure:t.structure,...C?{braceTop:C.top,braceBottom:C.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{...v?r0e(t.structure,k):{fill:"none"},stroke:k,strokeWidth:(S==null?void 0:S.strokeWidth)??(v?r0e(t.structure,k).strokeWidth:1.5),strokeDasharray:S==null?void 0:S.strokeDasharray,sourceMarker:S?S.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(S==null?void 0:S.targetMarker)??{name:"block",width:7,height:5}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?NFt:t.kind==="flowchart"?UFt:Dzt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?OFt:t.kind==="flowchart"?jFt:Pzt,fontFamily:t.kind==="architecture"?n9e:hU,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(S==null?void 0:S.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:s}},wI={compact:560,standard:680,wide:800},dVt=(t,e)=>{if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)throw new Error("Invalid note image dimensions");const r=Math.min(1,15e3/e);if(r<.5)throw new Error("NOTE_IMAGE_TOO_LONG");const n=Math.max(1,Math.floor(t*r)),i=Math.max(1,Math.floor(e*r));return{pixelRatio:Math.min(2,15e3/i,Math.sqrt(12e6/(n*i))),sourceHeight:i,sourceScale:r,sourceWidth:n}},fVt=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i,pVt={slate:"#f8fafc",aurora:"#a7f3d0",sunset:"#fde68a",midnight:"#090d16",editorial:"#f1f3f5",terminal:"#0d1117",film:"#f4ede4",mint:"#ecfdf5",notepad:"#fbf7ee",xuan:"#f7f6f2",lavender:"#f5f3ff",polaroid:"#f5f4ef",warm:"#fffbeb"},L6={slate:{canvasBg:"#ffffff",cardBg:"#ffffff",cardBorder:"1px solid #e2e8f0",cardShadow:"none",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"},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"},editorial:{canvasBg:"linear-gradient(145deg, #f1f3f5 0%, #e9ecef 50%, #dee2e6 100%)",cardBg:"#ffffff",cardBorder:"1px solid #111827",cardShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 20px 40px -8px rgba(0, 0, 0, 0.12)",textColor:"#1f2937",headingColor:"#111827",metaColor:"#4b5563",metaBg:"#f3f4f6",metaBorder:"#111827",accentColor:"#111827",accentSubtle:"rgba(17, 24, 39, 0.15)",linkBg:"rgba(17, 24, 39, 0.06)",dividerColor:"#111827",codeBg:"#f9fafb",codeBorder:"#d1d5db",codeColor:"#111827",quoteBg:"#f9fafb",quoteBorder:"#111827",tableThBg:"#f3f4f6",tableBorder:"#d1d5db",brandText:"#111827",brandMark:"#111827"},terminal:{canvasBg:"linear-gradient(145deg, #0d1117 0%, #161b22 60%, #090d13 100%)",cardBg:"#0d1117",cardBorder:"1px solid #30363d",cardShadow:"0 0 0 1px rgba(0, 255, 170, 0.15), 0 24px 60px -12px rgba(0, 0, 0, 0.95)",textColor:"#c9d1d9",headingColor:"#58a6ff",metaColor:"#8b949e",metaBg:"#161b22",metaBorder:"#30363d",accentColor:"#6ee7b7",accentSubtle:"rgba(0, 240, 160, 0.2)",linkBg:"rgba(0, 240, 160, 0.1)",dividerColor:"#21262d",codeBg:"#161b22",codeBorder:"#30363d",codeColor:"#6ee7b7",quoteBg:"rgba(88, 166, 255, 0.08)",quoteBorder:"#58a6ff",tableThBg:"#161b22",tableBorder:"#30363d",brandText:"#f0f6fc",brandMark:"#00f0a0",isDark:!0},film:{canvasBg:"linear-gradient(145deg, #f4ede4 0%, #eaddcf 50%, #dfd0bf 100%)",cardBg:"#fcfbf9",cardBorder:"1px solid rgba(197, 168, 137, 0.8)",cardShadow:"0 2px 4px rgba(60, 45, 30, 0.04), 0 16px 36px -6px rgba(60, 45, 30, 0.11), 0 32px 64px -12px rgba(60, 45, 30, 0.08)",textColor:"#292524",headingColor:"#1c1917",metaColor:"#78716c",metaBg:"#f5eee6",metaBorder:"#e7d9cb",accentColor:"#ea580c",accentSubtle:"rgba(234, 88, 12, 0.15)",linkBg:"rgba(234, 88, 12, 0.08)",dividerColor:"#e7d9cb",codeBg:"#f5eee6",codeBorder:"#e7d9cb",codeColor:"#9a3412",quoteBg:"rgba(254, 243, 199, 0.6)",quoteBorder:"#d97706",tableThBg:"#f5eee6",tableBorder:"#e7d9cb",brandText:"#1c1917",brandMark:"#ea580c"}},n0e={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'},gVt=(t,e="auto")=>{const r=h7(void 0,t),n=e==="auto"?r==="film"||r==="sunset"?"serif":"sans":e,i=e==="auto"?r==="editorial"?"serif":r==="terminal"?"mono":n:n;return{bodyFamily:n0e[n],headingFamily:n0e[i],headingWeight:i==="serif"?700:720,lineHeightAdjustment:n==="serif"?.08:n==="mono"?.02:0}},i0e={sm:{base:"14.5px",lineHeight:"1.72",title:"28px",h1:"21px",h2:"18px",h3:"16px",h4:"15px",h5:"14.5px",h6:"14.5px",meta:"12px",code:"12.5px"},md:{base:"16px",lineHeight:"1.8",title:"32px",h1:"24px",h2:"20px",h3:"17.5px",h4:"16.5px",h5:"16px",h6:"16px",meta:"13px",code:"13.5px"},lg:{base:"18px",lineHeight:"1.86",title:"36px",h1:"27px",h2:"22.5px",h3:"19px",h4:"18px",h5:"18px",h6:"18px",meta:"14px",code:"15px"}},h7=(t,e)=>e==="midnight"?"terminal":e==="lavender"?"mint":e&&L6[e]?e:e==="notepad"||e==="xuan"?"editorial":e==="polaroid"?"film":t==="warm"?"sunset":t==="notepad"||t==="xuan"?"editorial":t==="polaroid"?"film":t&&L6[t]?h7(void 0,t):"mint",mVt=(t,e)=>{const n=t.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"-").replace(/\s+/g," ").replace(/[. ]+$/g,"").trim().slice(0,100)||e;return fVt.test(n)?`_${n}`:n},_p=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),yVt=t=>{const e=t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim(),r=(e.match(/[\u4e00-\u9fa5\u3040-\u30ff\uac00-\ud7af]/g)||[]).length,n=e.replace(/[\u4e00-\u9fa5\u3040-\u30ff\uac00-\ud7af]/g," ").trim(),i=n?n.split(/\s+/).filter(Boolean).length:0,s=r+i;return{minutes:Math.max(1,Math.ceil(s/350)),totalCount:s}},vVt=({title:t,notebook:e="",tags:r=[],updatedAt:n="",bodyHtml:i,theme:s="mint",fontStyle:a="auto",showTitle:o=!0,showNotebook:l=!1,showTags:u=!1,showUpdatedAt:h=!0,showBranding:d=!0,author:f="",showAuthor:p=!1,showReadingTime:g=!1,readingTimeText:m=""})=>{var M;s=h7(void 0,s);const y=s==="terminal"?`
    - - - - ${_p(e||"note.md")} -
    `:"",v="",b=l&&!!e||h&&!!n||u&&r.length>0||g;let x="";if(b){const R=[];if(l&&e&&R.push(`${_p(e)}`),h&&n&&R.push(`${_p(n)}`),g){const P=yVt(i),N=m||`${P.minutes} min · ${P.totalCount} words`;R.push(`${_p(N)}`)}if(u&&r.length>0)for(const P of r)R.push(`#${_p(P)}`);x=`
    ${R.join("")}
    `}const T=o&&t?`

    ${_p(t)}

    `:"",C=T||x?'
    ':"",S=`
    - - EdgeEver -
    `,k=p&&!!f.trim();let E="";if(k){const R=f.trim(),P=((M=Array.from(R)[0])==null?void 0:M.toUpperCase())||"E";E=`${_p(R)}·`}const A=d||k?`
    - - ${d?S:""} -
    `:"";return`
    - -
    - ${v} - ${y} -
    - ${x} - ${T} - ${C} -
    -
    - ${i} -
    - ${A} -
    -
    `},bVt=({theme:t="mint",fontStyle:e="auto",fontSize:r="lg",cardWidth:n="wide"})=>{t=h7(void 0,t);const i=L6[t],s=gVt(t,e),a=i0e[r]||i0e.md,o=wI[n]||wI.wide;return` - :root { - --ee-canvas-bg: ${i.canvasBg}; - --ee-card-bg: ${i.cardBg}; - --ee-card-border: ${i.cardBorder}; - --ee-card-shadow: ${i.cardShadow}; - --ee-text-color: ${i.textColor}; - --ee-heading-color: ${i.headingColor}; - --ee-meta-color: ${i.metaColor}; - --ee-meta-bg: ${i.metaBg}; - --ee-meta-border: ${i.metaBorder}; - --ee-accent: ${i.accentColor}; - --ee-accent-subtle: ${i.accentSubtle}; - --ee-link-bg: ${i.linkBg}; - --ee-divider: ${i.dividerColor}; - --ee-code-bg: ${i.codeBg}; - --ee-code-border: ${i.codeBorder}; - --ee-code-color: ${i.codeColor}; - --ee-quote-bg: ${i.quoteBg}; - --ee-quote-border: ${i.quoteBorder}; - --ee-table-th-bg: ${i.tableThBg}; - --ee-table-border: ${i.tableBorder}; - --ee-brand-text: ${i.brandText}; - --ee-brand-mark: ${i.brandMark}; - - --ee-font-family: ${s.bodyFamily}; - --ee-heading-font-family: ${s.headingFamily}; - --ee-heading-weight: ${s.headingWeight}; - --ee-base-size: ${a.base}; - --ee-line-height: ${(Number(a.lineHeight)+s.lineHeightAdjustment).toFixed(2)}; - --ee-title-size: ${a.title}; - --ee-h1-size: ${a.h1}; - --ee-h2-size: ${a.h2}; - --ee-h3-size: ${a.h3}; - --ee-h4-size: ${a.h4}; - --ee-h5-size: ${a.h5}; - --ee-h6-size: ${a.h6}; - --ee-meta-size: ${a.meta}; - --ee-code-size: ${a.code}; - } - - * { box-sizing: border-box; } - - .edgeever-image-wrapper { - position: relative; - width: ${o}px; - padding: 38px 32px 44px; - background: var(--ee-canvas-bg); - font-family: var(--ee-font-family); - box-sizing: border-box; - margin: 0; - color: var(--ee-text-color); - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-feature-settings: "chws" 1; - overflow: hidden; - } - - .edgeever-grain-overlay { - position: absolute; - inset: 0; - pointer-events: none; - background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.055'/%3E%3C/svg%3E"); - background-repeat: repeat; - z-index: 1; - } - - .edgeever-image-card { - background: var(--ee-card-bg); - border: var(--ee-card-border); - border-radius: ${t==="editorial"||t==="film"||t==="slate"?4:20}px; - box-shadow: var(--ee-card-shadow); - padding: 40px 38px 36px; - position: relative; - z-index: 2; - overflow: hidden; - } - - .edgeever-terminal-header { - display: flex; - align-items: center; - gap: 7px; - padding: 12px 18px; - margin: -40px -38px 26px; - border-bottom: var(--ee-card-border); - background: var(--ee-meta-bg); - } - .edgeever-terminal-dot { - width: 10.5px; - height: 10.5px; - border-radius: 50%; - display: inline-block; - } - .dot-red { background: #ff5f56; } - .dot-yellow { background: #ffbd2e; } - .dot-green { background: #27c93f; } - .edgeever-terminal-name { - margin-left: 6px; - font-size: 12px; - color: var(--ee-meta-color); - font-family: inherit; - opacity: 0.9; - } - - .edgeever-card-meta { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 8px; - margin-bottom: 16px; - } - - .edgeever-meta-pill { - display: inline-flex; - align-items: center; - gap: 5.5px; - padding: 3.5px 10px; - border-radius: 9999px; - background: var(--ee-meta-bg); - border: 1px solid var(--ee-meta-border); - color: var(--ee-meta-color); - font-size: var(--ee-meta-size); - font-weight: 550; - line-height: 1.2; - } - .edgeever-icon { - display: inline-block; - vertical-align: middle; - stroke: currentColor; - } - .edgeever-meta-tag { - background: var(--ee-link-bg); - border-color: var(--ee-accent-subtle); - color: var(--ee-accent); - font-weight: 600; - } - - .edgeever-card-title { - margin: 0 0 16px; - font-size: var(--ee-title-size); - font-family: var(--ee-heading-font-family); - font-weight: var(--ee-heading-weight); - line-height: 1.25; - letter-spacing: -0.026em; - color: var(--ee-heading-color); - word-break: break-word; - } - - .edgeever-card-divider { - height: 1px; - background: linear-gradient(90deg, var(--ee-divider) 0%, transparent 95%); - margin: 0 0 24px; - } - - .edgeever-card-body { - font-size: var(--ee-base-size); - line-height: var(--ee-line-height); - color: var(--ee-text-color); - overflow-wrap: anywhere; - } - - .edgeever-card-body > :first-child { margin-top: 0; } - .edgeever-card-body > :last-child { margin-bottom: 0; } - - .edgeever-card-body h1, - .edgeever-card-body h2, - .edgeever-card-body h3, - .edgeever-card-body h4, - .edgeever-card-body h5, - .edgeever-card-body h6 { - color: var(--ee-heading-color); - line-height: 1.28; - font-family: var(--ee-heading-font-family); - font-weight: var(--ee-heading-weight); - letter-spacing: -0.015em; - } - .edgeever-card-body h1 { - font-size: var(--ee-h1-size); - margin: 1.6em 0 0.7em; - border-left: 3.5px solid var(--ee-accent); - padding-left: 10px; - margin-left: -13.5px; - } - .edgeever-card-body h2 { font-size: var(--ee-h2-size); margin: 1.4em 0 0.6em; } - .edgeever-card-body h3 { font-size: var(--ee-h3-size); margin: 1.2em 0 0.5em; } - .edgeever-card-body h4 { font-size: var(--ee-h4-size); margin: 1.1em 0 0.45em; } - .edgeever-card-body h5 { font-size: var(--ee-h5-size); margin: 1em 0 0.4em; } - .edgeever-card-body h6 { font-size: var(--ee-h6-size); margin: 0.9em 0 0.35em; } - - .edgeever-card-body p { margin: 0 0 1em; } - - .edgeever-card-body ul, - .edgeever-card-body ol { - margin: 0 0 1.1em; - padding-left: 1.5em; - } - .edgeever-card-body li { margin: 0.3em 0; } - - .edgeever-card-body ul[data-type="taskList"] { - padding-left: 0; - list-style: none; - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked] { - display: flex; - align-items: flex-start; - gap: 0.6rem; - margin: 0.4rem 0; - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked="true"] { - opacity: 0.7; - text-decoration: line-through; - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked] > label { - display: inline-flex; - flex: 0 0 auto; - margin-top: 0.2rem; - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked] > label input { - width: 1.1rem; - height: 1.1rem; - margin: 0; - accent-color: var(--ee-accent); - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked] > div { - min-width: 0; - flex: 1 1 auto; - } - .edgeever-card-body ul[data-type="taskList"] li[data-checked] > div > p { - margin-bottom: 0; - } - - .edgeever-card-body blockquote { - position: relative; - margin: 1.3em 0; - border-left: 4px solid var(--ee-quote-border); - background: var(--ee-quote-bg); - padding: 14px 18px 14px 24px; - border-radius: 0 10px 10px 0; - color: var(--ee-text-color); - font-size: 0.98em; - line-height: 1.75; - } - .edgeever-card-body blockquote::before { - content: "“"; - position: absolute; - top: -8px; - left: 6px; - font-size: 38px; - line-height: 1; - font-family: Georgia, "Songti SC", "Times New Roman", serif; - color: var(--ee-quote-border); - opacity: 0.28; - pointer-events: none; - } - .edgeever-card-body blockquote p:last-child { margin-bottom: 0; } - - .edgeever-card-body mark { - background: linear-gradient(104deg, rgba(254, 240, 138, 0) 1%, rgba(254, 240, 138, 0.88) 3%, rgba(254, 240, 138, 0.76) 98%); - padding: 0.1em 0.35em; - border-radius: 4px; - box-decoration-break: clone; - -webkit-box-decoration-break: clone; - color: inherit; - } - - .edgeever-card-body hr { - margin: 1.8em 0; - border: 0; - border-top: 1px solid var(--ee-divider); - } - - .edgeever-card-body a { - display: inline-flex; - align-items: center; - gap: 4px; - color: var(--ee-accent); - text-decoration: none; - font-weight: 600; - background: var(--ee-link-bg); - border: 1px solid var(--ee-accent-subtle); - padding: 1.5px 8px; - border-radius: 6px; - line-height: 1.45; - vertical-align: baseline; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02); - } - - .edgeever-card-body code { - border-radius: 5px; - background: var(--ee-code-bg); - border: 1px solid var(--ee-code-border); - color: var(--ee-code-color); - padding: 2px 6px; - font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace; - font-size: var(--ee-code-size); - } - - .edgeever-card-body pre, - .edgeever-card-body .edgeever-code-source { - max-width: 100%; - margin: 1.3em 0; - border: 1px solid var(--ee-code-border); - border-radius: 10px; - background: var(--ee-code-bg); - padding: 14px 18px; - color: var(--ee-code-color); - font-family: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace; - font-size: var(--ee-code-size); - line-height: 1.6; - overflow-x: auto; - overflow-wrap: anywhere; - white-space: pre-wrap; - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); - } - - .edgeever-card-body pre code { - background: transparent; - border: 0; - padding: 0; - color: inherit; - } - - .edgeever-card-body img, - .edgeever-card-body .edgeever-html-mermaid svg { - display: block; - width: auto; - max-width: 100%; - height: auto; - max-height: 80vh; - border-radius: 10px; - margin: 1.3em auto; - object-fit: contain; - } - - .edgeever-card-body figure, - .edgeever-card-body .edgeever-html-mermaid { - max-width: 100%; - margin: 1.3em auto; - } - - .edgeever-card-body table { - width: 100%; - margin: 1.4em 0; - border-collapse: separate; - border-spacing: 0; - border-radius: 8px; - overflow: hidden; - border: 1px solid var(--ee-table-border); - font-size: calc(var(--ee-base-size) * 0.92); - line-height: 1.5; - } - - .edgeever-card-body th, - .edgeever-card-body td { - padding: 9px 13px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid var(--ee-table-border); - border-right: 1px solid var(--ee-table-border); - } - - .edgeever-card-body th { - background: var(--ee-table-th-bg); - color: var(--ee-heading-color); - font-weight: 650; - } - - .edgeever-card-body tr:last-child td { border-bottom: 0; } - .edgeever-card-body td:last-child, - .edgeever-card-body th:last-child { border-right: 0; } - - .edgeever-card-body [data-edgeever-theme-block] { - margin: 1.3em 0; - border: 1px solid var(--ee-meta-border); - border-left: 4px solid var(--ee-accent); - border-radius: 10px; - background: var(--ee-meta-bg); - padding: 12px 16px; - } - - .edgeever-card-body .edgeever-image-controls, - .edgeever-card-body .edgeever-code-copy-button, - .edgeever-card-body .edgeever-theme-block__toolbar, - .edgeever-card-body .edgeever-mermaid-source { - display: none !important; - } - - .edgeever-card-footer { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; - margin-top: 36px; - border-top: 1px solid var(--ee-divider); - padding-top: 22px; - } - - .edgeever-card-footer-meta { - display: inline-flex; - align-items: center; - gap: 6px; - font-size: 12px; - color: var(--ee-meta-color); - font-weight: 500; - opacity: 0.85; - } - - .edgeever-footer-author { - display: inline-flex; - align-items: center; - gap: 6px; - font-weight: 600; - color: var(--ee-heading-color); - } - - .edgeever-footer-avatar { - display: inline-flex; - align-items: center; - justify-content: center; - width: 18px; - height: 18px; - border-radius: 50%; - background: var(--ee-heading-color); - color: var(--ee-card-bg); - font-size: 10px; - font-weight: 700; - font-family: system-ui, -apple-system, sans-serif; - line-height: 1; - text-transform: uppercase; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); - flex-shrink: 0; - } - - .edgeever-footer-author-name { - letter-spacing: -0.01em; - } - - .edgeever-footer-sep { - opacity: 0.45; - } - - .edgeever-brand-badge { - display: inline-flex; - align-items: center; - gap: 7.5px; - font-size: 13px; - font-weight: 650; - color: var(--ee-brand-text); - opacity: 0.95; - } - - .edgeever-brand-logo { - display: inline-block; - vertical-align: middle; - border-radius: 5px; - } - - .edgeever-brand-name { - font-weight: 760; - letter-spacing: -0.01em; - color: var(--ee-brand-text); - } - - ${t==="editorial"?` - .edgeever-image-card[data-theme="editorial"] { - border: 2px solid #111827; - border-radius: 4px; - box-shadow: 6px 6px 0px #111827; - } - .edgeever-image-card[data-theme="editorial"] .edgeever-card-header { - border-bottom: 2px solid #111827; - padding-bottom: 12px; - margin-bottom: 24px; - } - .edgeever-image-card[data-theme="editorial"] .edgeever-card-title { - font-family: var(--ee-heading-font-family); - letter-spacing: -0.02em; - } - `:""} - - ${t==="terminal"?` - .edgeever-image-card[data-theme="terminal"] { - border: 1px solid rgba(0, 240, 160, 0.35); - border-radius: 12px; - box-shadow: 0 0 30px -5px rgba(0, 240, 160, 0.15), 0 24px 60px -12px rgba(0, 0, 0, 0.95); - - } - .edgeever-image-card[data-theme="terminal"] .edgeever-terminal-header { - border-bottom: 1px solid rgba(0, 240, 160, 0.2); - background: #161b22; - } - `:""} - - ${t==="film"?` - .edgeever-image-card[data-theme="film"] { - border: 1px solid rgba(214, 186, 155, 0.85); - border-radius: 4px; - box-shadow: 0 2px 8px rgba(60, 45, 30, 0.05); - } - .edgeever-image-card[data-theme="film"] .edgeever-card-title { - color: #1c1917; - } - `:""} - `};Ft({system:Ue().max(8e3),prompt:Ue().min(1).max(9e4),maxOutputTokens:Fr().int().min(1).optional()}).strict();Ft({url:Ue().min(1).max(8192),method:An(["GET","HEAD"]).default("GET"),headers:XD(Ue().max(100),Ue().max(2e3)).default({})}).strict();const xVt=(t,e)=>{const r=n=>{if(n.ctrlKey||n.metaKey||n.altKey)return;const i=n.target;if(typeof Element<"u"&&i instanceof Element&&i.closest('input, textarea, select, [contenteditable="true"]'))return;const s=n.deltaMode===1?16:n.deltaMode===2?Math.max(1,t.clientHeight):1,a=(n.shiftKey&&n.deltaX===0?n.deltaY:n.deltaX)*s,o=(n.shiftKey&&n.deltaX===0?0:n.deltaY)*s;if(!a&&!o)return;n.preventDefault(),n.stopPropagation();const l=e.translate();e.translate(l.tx-a,l.ty-o)};return t.addEventListener("wheel",r,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",r,{capture:!0})},wVt=ZFt,TVt=2.5,CVt=28,kVt=(t,e=wVt)=>t+1e-6>=e?"fit":"read",SVt=t=>{if(t.nodes.length){if(t.kind==="flowchart"){const e=new Set(t.edges.map(r=>r.target));return t.nodes.find(r=>!e.has(r.id))??t.nodes[0]}if(t.kind==="architecture"){const e=t.nodes.filter(r=>r.shape!=="boundary");return[...e.length?e:t.nodes].sort((r,n)=>r.x-n.x||r.y-n.y||r.id.localeCompare(n.id))[0]}return t.nodes.find(e=>!e.parentId)??t.nodes[0]}},EVt=(t,e,r,n=1)=>{const i=t.x+t.width/2,s=r==="flowchart"?t.y:t.y+t.height/2;return{tx:e.width/2-i*n,ty:(r==="flowchart"?32:e.height/2)-s*n}},AVt=(t,e,r,n=.1,i=TVt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),s0e=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),MVt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),RVt=(t,e,r,n,i)=>{const s=xVt(e,t),a=e.parentElement;a==null||a.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:CVt}),t.centerContent()},l=(b,x=1)=>{t.zoomTo(x);const T=EVt(b,{width:y,height:v},r.kind,x);t.translate(T.tx,T.ty)},u=()=>{const b=SVt(r);b&&l(b,1)},h=()=>{e.dataset.scale=`${Math.round(t.scale().sx*100)}`};t.on("scale",h);const d=b=>{var T,C;const x=(C=(T=b==null?void 0:b.node)==null?void 0:T.getBBox)==null?void 0:C.call(T);x&&l(x,Math.max(1,t.scale().sx))};t.on("node:click",d);let f=null;const p=b=>{var x;b.touches.length===2&&(f={distance:s0e(b.touches[0],b.touches[1]),scale:t.scale().sx},(x=t.disablePanning)==null||x.call(t))},g=b=>{if(!f||b.touches.length!==2)return;b.preventDefault(),b.stopPropagation();const x=AVt(f.scale,f.distance,s0e(b.touches[0],b.touches[1]));t.zoomTo(x,{center:MVt(b.touches[0],b.touches[1],e.getBoundingClientRect())})},m=b=>{var x;b.touches.length<2&&(f=null,(x=t.enablePanning)==null||x.call(t))};e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",g,{capture:!0,passive:!1}),e.addEventListener("touchend",m),e.addEventListener("touchcancel",m);let y=0,v=0;return{resize(b,x){if(b===y&&x===v)return;const T=y===0,C=t.translate(),S=(b-y)/2,k=(x-v)/2,E=T||v<80&&x>=160;y=b,v=x,t.resize(y,v),E?(o(),kVt(t.scale().sx)==="read"&&u()):t.translate(C.tx+S,C.ty+k),h()},dispose(){var b;s(),t.off("scale",h),t.off("node:click",d),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",g,!0),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m),(b=t.enablePanning)==null||b.call(t),a==null||a.classList.remove("edgeever-diagram-reader-host"),delete e.dataset.scale}}},Z5=Ue().regex(/^#[0-9a-f]{6}$/i),_Vt=Ft({kind:An(["linear","radial"]),from:Z5,to:Z5,angle:Fr().finite().min(-360).max(360).default(90)}),J3=Ue().max(80).regex(/^(?:#[0-9a-f]{3,8}|rgba?\([\d.,\s]+\)|transparent)$/i),LVt=Ft({color:J3,blur:Fr().min(0).max(300),offsetX:Fr().min(-300).max(300),offsetY:Fr().min(-300).max(300)}),I6=Ue().min(1).max(160).regex(/^[\w-]+$/),IVt=Gn(Ft({offset:Fr().min(0).max(1),color:J3,opacity:Fr().min(0).max(1).optional()})).min(2).max(16),NVt=Ft({kind:An(["linear","radial"]),from:Z5,to:Z5,angle:Fr().finite().default(90),stops:IVt.optional(),coords:Ft({x1:Fr().finite(),y1:Fr().finite(),x2:Fr().finite(),y2:Fr().finite(),r1:Fr().finite().optional(),r2:Fr().finite().optional()}).optional()}),ZD={id:I6,name:Ue().max(120),role:An(["title","subtitle","badge","decor"]).optional(),visible:wn().optional(),imagePlaceholder:wn().optional(),flipX:wn().optional(),flipY:wn().optional(),stroke:J3.optional(),strokeWidth:Fr().min(0).max(1024).optional(),shadow:LVt.optional(),gradient:NVt.optional(),groupId:I6.optional(),x:Fr().finite().min(-8192).max(8192),y:Fr().finite().min(-8192).max(8192),width:Fr().finite().min(1).max(8192),height:Fr().finite().min(1).max(8192),rotation:Fr().finite().min(-360).max(360).default(0),opacity:Fr().min(0).max(1).default(1),locked:wn().optional()},OVt=Ft({...ZD,type:cs("text"),text:Ue().max(8e3),fill:J3,fontSize:Fr().min(4).max(8192),fontFamily:Ue().min(1).max(100).regex(/^[\w\s\-\u3400-\u9fff]+$/),fontStyle:An(["normal","italic"]).optional(),underline:wn().optional(),lineHeight:Fr().min(.5).max(3).optional(),charSpacing:Fr().min(-300).max(1e3).optional(),sourceText:Ue().max(8e3).optional(),badge:Ft({background:Z5,padX:Fr().min(0).max(3),padY:Fr().min(0).max(3),radius:Fr().min(0).max(1)}).optional(),fontWeight:An(["normal","bold"]),textAlign:An(["left","center","right"])}),DVt=Ft({...ZD,type:An(["rect","ellipse"]),fill:J3,radius:Fr().min(0).max(4096).optional()}),PVt=Ft({...ZD,type:cs("image"),resourceId:I6,crop:Ft({x:Fr().min(0).max(1),y:Fr().min(0).max(1),width:Fr().min(.01).max(1),height:Fr().min(.01).max(1)}).optional()}),$Vt=Ft({...ZD,type:cs("path"),fill:J3,path:Ue().min(1).max(1e5).regex(/^[MmLlHhVvCcSsQqTtAaZz\d\s,.eE+\-]+$/)}),BVt=K5([OVt,DVt,PVt,$Vt]);Ft({schemaVersion:cs(1),width:Fr().int().min(320).max(4096),height:Fr().int().min(320).max(4096),background:Z5,backgroundGradient:_Vt.optional(),elements:Gn(BVt).max(500),copy:Ft({title:Ue().max(8e3),subtitle:Ue().max(8e3),badge:Ue().max(8e3)}).optional(),templateId:Ue().max(80).optional(),platformId:Ue().max(80).optional(),sourceMemoId:I6.optional(),previewResourceId:I6.optional()}).superRefine((t,e)=>{new Set(t.elements.map(r=>r.id)).size!==t.elements.length&&e.addIssue({code:"custom",message:"Element IDs must be unique"})});const a0e=t=>{try{const e=t.state;t.view.updateState(xh.create({doc:e.doc,plugins:e.plugins,schema:e.schema,selection:e.selection})),t.view.dispatch(t.state.tr.setMeta("addToHistory",!1).setMeta("preventUpdate",!0))}catch{try{const e=t.state;t.view.updateState(xh.create({doc:e.doc,plugins:e.plugins,schema:e.schema}))}catch{}}};let Yt=class d9e extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15t.replace(FVt,"-$1").toLowerCase(),VVt={"&":"&",">":">","<":"<",'"':""","'":"'"},HVt=/[&><"']/g,Qo=t=>String(t).replace(HVt,e=>VVt[e]),QR=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?QR(t.body[0]):t:t.type==="font"?QR(t.body):t,GVt=new Set(["mathord","textord","atom"]),ap=t=>GVt.has(QR(t).type),WVt=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"},gU={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 qVt(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 UVt(t){if(Object.prototype.hasOwnProperty.call(t,"default")&&t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return qVt(e)}function jVt(t,e,r,n){var i=Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0,s=Object.prototype.hasOwnProperty.call(n,"processor")?n.processor:void 0;t[e]=i!==void 0?s?s(i):i:UVt(n)}let Wee=class{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(gU)){var n=gU[r];n&&jVt(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 Yt("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=WVt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},Lp=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 kd[YVt[this.id]]}sub(){return kd[XVt[this.id]]}fracNum(){return kd[KVt[this.id]]}fracDen(){return kd[ZVt[this.id]]}cramp(){return kd[QVt[this.id]]}text(){return kd[JVt[this.id]]}isTight(){return this.size>=2}};var qee=0,TI=1,hx=2,T0=3,N6=4,Ou=5,Q5=6,Ol=7,kd=[new Lp(qee,0,!1),new Lp(TI,0,!0),new Lp(hx,1,!1),new Lp(T0,1,!0),new Lp(N6,2,!1),new Lp(Ou,2,!0),new Lp(Q5,3,!1),new Lp(Ol,3,!0)],YVt=[N6,Ou,N6,Ou,Q5,Ol,Q5,Ol],XVt=[Ou,Ou,Ou,Ou,Ol,Ol,Ol,Ol],KVt=[hx,T0,N6,Ou,Q5,Ol,Q5,Ol],ZVt=[T0,T0,Ou,Ou,Ol,Ol,Ol,Ol],QVt=[TI,TI,T0,T0,Ou,Ou,Ol,Ol],JVt=[qee,TI,hx,T0,hx,T0,hx,T0],hn={DISPLAY:kd[qee],TEXT:kd[hx],SCRIPT:kd[N6],SCRIPTSCRIPT:kd[Q5]},mU=[{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 eHt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var JR=[];mU.forEach(t=>t.blocks.forEach(e=>JR.push(...e)));function f9e(t){for(var e=0;e=JR[e]&&t<=JR[e+1])return!0;return!1}var Ca=t=>t+" "+t,w2=80,tHt=function(e,r){return"M95,"+(622+e+r)+` +`});const H$t=["clay","dawn","teal","azure","violet","pink","slate"],G$t=["native",...H$t],W$t=8*1024;Ct({name:$e().trim().min(1).max(80),parentId:$e().trim().min(1).nullable().optional()});Ct({name:$e().trim().min(1).max(80).optional(),parentId:$e().trim().min(1).nullable().optional(),sortOrder:Qt().int().optional()});Ct({notebookId:$e().trim().min(1),title:$e().trim().max(160).optional(),contentJson:Kd().optional(),contentMarkdown:$e().optional(),tags:Tn($e()).optional(),createdAt:$e().datetime().optional(),updatedAt:$e().datetime().optional()});Ct({expectedRevision:Qt().int().min(0).optional(),expectedContentHash:$e().length(64).optional(),editSessionId:$e().trim().min(1).optional(),notebookId:$e().trim().min(1).optional(),title:$e().trim().max(160).optional(),isPinned:cn().optional(),contentJson:Kd().optional(),contentMarkdown:$e().optional(),tags:Tn($e()).optional(),createdAt:$e().datetime().optional(),updatedAt:$e().datetime().optional(),allowDestructiveOverwrite:cn().optional()});Ct({name:$e().trim().min(1).max(160),description:$e().trim().max(500).optional(),memoId:$e().trim().min(1).optional(),title:$e().trim().max(160).nullable().optional(),contentMarkdown:$e().optional(),tags:Tn($e()).optional()}).refine(t=>t.memoId||t.contentMarkdown!==void 0,{message:"memoId or contentMarkdown is required"});Ct({name:$e().trim().min(1).max(160).optional(),description:$e().trim().max(500).nullable().optional(),title:$e().trim().max(160).nullable().optional(),contentMarkdown:$e().optional(),tags:Tn($e()).optional()});Ct({notebookId:$e().trim().min(1),locale:$e().trim().min(1).max(64).optional()});const qAe=Ct({pluginId:$e().trim().min(3).max(200),commandId:$e().trim().min(1).max(200)}),q$t=Ct({name:$e().trim().min(1).max(120),taskType:Wn("plugin-command"),taskPayload:qAe,cronExpression:$e().trim().min(1).max(160),timezone:$e().trim().min(1).max(80),executorDeviceId:$e().trim().min(16).max(160),missedRunPolicy:nn(["run-once","skip"]).default("run-once"),isEnabled:cn().default(!0)});q$t.omit({taskType:!0,taskPayload:!0,executorDeviceId:!0}).partial().extend({taskPayload:qAe.optional(),executorDeviceId:$e().trim().min(16).max(160).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ct({pluginId:$e().trim().min(3).max(200),scheduleKey:$e().trim().regex(/^[a-z0-9][a-z0-9._-]*$/i).max(120),name:$e().trim().min(1).max(120),commandId:$e().trim().min(1).max(200),cronExpression:$e().trim().min(1).max(160),timezone:$e().trim().min(1).max(80),executorDeviceId:$e().trim().min(16).max(160),missedRunPolicy:nn(["run-once","skip"]).default("run-once"),isEnabled:cn().optional()});Ct({scheduledFor:$e().datetime(),executorDeviceId:$e().trim().min(16).max(160)});Ct({executorDeviceId:$e().trim().min(16).max(160),status:nn(["succeeded","failed"]),errorMessage:$e().trim().max(2e3).nullable().optional()});const e0e=$e().trim().max(2e3).refine(t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},{message:"URL must use http or https."});Ct({type:nn(["plugin","theme"]),version:$e().trim().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/).max(80),enabled:cn(),installedAt:$e().datetime(),manifestUrl:e0e,sourceKind:nn(["marketplace","github","manifest"]),verified:cn(),repositoryUrl:e0e.max(500).nullable().optional(),releaseTag:$e().trim().min(1).max(80).nullable().optional(),publisher:Wn("edgeever").nullable().optional()}).refine(t=>t.sourceKind==="github"?!!t.repositoryUrl:t.sourceKind==="marketplace"?!!(t.repositoryUrl||t.manifestUrl):!0,{message:"GitHub and marketplace extensions require a source URL."});Ct({memoIds:Tn($e().trim().min(1)).min(1).max(100),notebookId:$e().trim().min(1)});Ct({memoIds:Tn($e().trim().min(1)).min(1).max(100),permanent:cn().optional()});Ct({notebookId:$e().trim().min(1).optional(),title:$e().trim().max(160).optional()});Ct({memoIds:Tn($e().trim().min(1)).min(2).max(50),notebookId:$e().trim().min(1).optional(),title:$e().trim().max(160).optional()});Ct({username:$e().trim().min(1).max(80),password:$e().min(1).max(512),deviceId:$e().trim().min(16).max(160).optional(),locale:$e().trim().min(1).max(35).optional()});Ct({label:$e().trim().max(80).nullable()});Ct({currentPassword:$e().min(1).max(512),newPassword:$e().min(8).max(512),confirmPassword:$e().min(8).max(512)}).refine(t=>t.newPassword===t.confirmPassword,{message:"New passwords do not match.",path:["confirmPassword"]});Ct({username:$e().trim().min(1).max(80),displayName:$e().trim().max(80).nullable().optional(),password:$e().min(8).max(512)});Ct({displayName:$e().trim().max(80).nullable().optional(),password:$e().min(8).max(512).optional(),isDisabled:cn().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required.");Ct({name:$e().trim().min(1).max(80),scopes:Tn($e().trim().min(1).max(80)).min(1).max(32),expiresAt:$e().datetime().nullable().optional()});Ct({name:$e().trim().min(1).max(80)});Ct({filename:$e().trim().min(1).max(160)});const jAe=$e().trim().url().max(500).refine(t=>t.startsWith("https://")||t.startsWith("http://"),"Object storage endpoint must use HTTP or HTTPS.");zee("provider",[Ct({provider:Wn("builtin")}),Ct({provider:Wn("s3"),displayName:$e().trim().min(1).max(80),endpoint:jAe,region:$e().trim().min(1).max(80),bucket:$e().trim().min(1).max(255),accessKeyId:$e().trim().min(1).max(256),secretAccessKey:$e().min(1).max(1024).optional(),forcePathStyle:cn().default(!0),objectPrefix:$e().trim().max(500).default("")})]);Ct({endpoint:jAe,region:$e().trim().min(1).max(80),bucket:$e().trim().min(1).max(255),accessKeyId:$e().trim().min(1).max(256),secretAccessKey:$e().min(1).max(1024).optional(),forcePathStyle:cn().default(!0),objectPrefix:$e().trim().max(500).default("")});const YAe=nn(["openai-compatible","anthropic","google"]),XAe=nn(["openai-compatible"]),KAe=(t,e)=>{let r;try{r=new URL(t)}catch{e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});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."})},ZAe=$e().trim().url().max(500).superRefine(KAe),JAe=$e().trim().min(1).max(500).superRefine((t,e)=>{if(!$e().url().safeParse(t).success){e.addIssue({code:"custom",message:"AI Base URL must be a valid URL."});return}KAe(t,e)});Ct({provider:XAe.default("openai-compatible"),displayName:$e().trim().min(1).max(80),baseUrl:JAe,apiKey:$e().trim().min(1).max(4096),isEnabled:cn().default(!0),initialModelId:$e().trim().min(1).max(200).optional()});Ct({provider:XAe.default("openai-compatible"),displayName:$e().trim().min(1).max(80),baseUrl:JAe,apiKey:$e().trim().min(1).max(4096).optional(),isEnabled:cn().default(!0)});Ct({modelId:$e().trim().min(1).max(200),displayName:$e().trim().min(1).max(80).optional()});Ct({modelConfigId:$e().trim().min(1).nullable()});const QAe=Ct({provider:YAe,displayName:$e().trim().min(1).max(80),baseUrl:ZAe,isEnabled:cn().default(!0)});QAe.extend({apiKey:$e().min(1).max(4096),initialModelId:$e().trim().min(1).max(200).optional()});QAe.extend({apiKey:$e().min(1).max(4096).optional()});Ct({modelId:$e().trim().min(1).max(200),provider:YAe.optional(),baseUrl:ZAe.optional(),apiKey:$e().min(1).max(4096).optional()});Ct({modelId:$e().trim().min(1).max(200),displayName:$e().trim().min(1).max(200).optional()});Ct({modelConfigId:$e().trim().min(1).nullable()});const j$t=Ct({filename:$e().trim().min(1).max(255).regex(/^[^\u0000-\u001F\u007F]+$/),mediaType:nn(v$t),base64Data:$e().min(1).max(Math.ceil(Zfe/3)*4)}).superRefine((t,e)=>{const r=VAe(t.base64Data);if(r===null){e.addIssue({code:"custom",path:["base64Data"],message:"Attachment data must be valid base64."});return}const n=C$t(t.mediaType)?w$t:Zfe;r>n&&e.addIssue({code:"custom",path:["base64Data"],message:"The attachment is too large."})});Ct({action:nn(pq),promptId:$e().trim().min(1).max(200).optional(),locale:$e().trim().min(2).max(35).optional(),title:$e().trim().max(160).default(""),contentMarkdown:$e().max(3e5),stream:cn().default(!1),targetLanguage:nn(b$t).optional(),tone:nn(y$t).optional(),instruction:$e().trim().min(1).max(2e3).optional(),attachments:Tn(j$t).max(x$t).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+(VAe(a.base64Data)??0),0)>T$t&&e.addIssue({code:"custom",path:["attachments"],message:"The attachments are too large in total."})});Ct({title:$e().trim().max(160).default(""),contentMarkdown:$e().max(3e5),currentTags:Tn($e().trim().min(1).max(200)).max(24).default([]),locale:$e().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."})});Ct({name:$e().trim().min(1).max(80),description:$e().trim().max(200).optional(),instruction:$e().trim().min(1).max(2e3),parameterKind:nn(Vee).default("none"),resultMode:nn(Hee).default("both")});Ct({name:$e().trim().min(1).max(80).optional(),description:$e().trim().max(200).nullable().optional(),instruction:$e().trim().min(1).max(2e3).optional(),parameterKind:nn(Vee).optional(),resultMode:nn(Hee).optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ct({passwordProtected:cn()});Ct({bodyFont:nn(["wenkai","wenkai-screen","zhuque","source-han-serif","neo-zhi-song","source-han-sans","source-serif"]).nullable()});const Lp=$e().regex(/^#[0-9a-f]{6}$/i),t0e=Ct({background:Lp,text:Lp,muted:Lp,heading:Lp,accent:Lp,soft:Lp,codeBackground:Lp,border:Lp});Ct({fontSize:Eg([Wn(14),Wn(16),Wn(18),Wn(20)]).nullable().optional(),lineHeight:Eg([Wn(1.5),Wn(1.65),Wn(2)]).nullable().optional(),palette:Eg([nn(G$t),Wn("orange")]).transform(t=>t==="orange"?"clay":t).nullable().optional(),customCss:$e().refine(t=>new TextEncoder().encode(t).byteLength<=W$t).nullable().optional(),customColors:Ct({light:t0e,dark:t0e}).nullable().optional()}).refine(t=>Object.values(t).some(e=>e!==void 0),{message:"At least one field is required."});Ct({password:$e().min(1).max(64)});const Y$t=Ct({fieldId:$e().trim().min(1).max(80),required:cn()});Ct({enabled:cn(),passwordProtected:cn(),rotatePassword:cn().optional(),title:$e().trim().max(120),description:$e().trim().max(1e3),submitLabel:$e().trim().max(40),fields:Tn(Y$t).max(40)});Ct({cells:JO($e().max(80),Kd())});const eMe="3.9.3",X$t=eMe,r0e=typeof TextDecoder=="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,n0e=typeof TextEncoder=="function"?new TextEncoder:void 0,K$t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",j3=Array.prototype.slice.call(K$t),lE=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(j3),Z$t=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ko=String.fromCharCode.bind(String),J$t=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),tMe=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),rMe=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),nMe=t=>{let e,r,n,i,a="";const s=t.length%3;for(let o=0;o255||(n=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,a+=j3[e>>18&63]+j3[e>>12&63]+j3[e>>6&63]+j3[e&63]}return s?a.slice(0,s-3)+"===".substring(s):a},qee=typeof btoa=="function"?t=>btoa(t):nMe,gq=typeof Uint8Array.prototype.toBase64=="function"?t=>t.toBase64():t=>{let r=[];for(let n=0,i=t.length;ne?tMe(gq(t)):gq(t),Q$t=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?ko(192|e>>>6)+ko(128|e&63):ko(224|e>>>12&15)+ko(128|e>>>6&63)+ko(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return ko(240|e>>>18&7)+ko(128|e>>>12&63)+ko(128|e>>>6&63)+ko(128|e&63)}},eFt=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,iMe=t=>t.replace(eFt,Q$t),i0e=n0e?t=>gq(n0e.encode(t)):t=>qee(iMe(t)),p6=(t,e=!1)=>e?tMe(i0e(t)):i0e(t),a0e=t=>p6(t,!0),tFt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,rFt=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return ko((r>>>10)+55296)+ko((r&1023)+56320);case 3:return ko((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return ko((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},aMe=t=>t.replace(tFt,rFt),sMe=t=>{if(t=t.replace(/\s+/g,""),!Z$t.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,i=[];for(let a=0;a>16&255)):n===64?i.push(ko(e>>16&255,e>>8&255)):i.push(ko(e>>16&255,e>>8&255,e&255));return i.join("")},jee=typeof atob=="function"?t=>atob(rMe(t)):sMe,oMe=typeof Uint8Array.fromBase64=="function"?t=>Uint8Array.fromBase64(t):t=>J$t(jee(t).split("").map(e=>e.charCodeAt(0))),lMe=t=>oMe(cMe(t)),nFt=r0e?t=>r0e.decode(oMe(t)):t=>aMe(jee(t)),cMe=t=>rMe(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),mq=t=>nFt(cMe(t)),iFt=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},uMe=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),hMe=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,uMe(r));t("fromBase64",function(){return mq(this)}),t("toBase64",function(e){return p6(this,e)}),t("toBase64URI",function(){return p6(this,!0)}),t("toBase64URL",function(){return p6(this,!0)}),t("toUint8Array",function(){return lMe(this)})},dMe=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,uMe(r));t("toBase64",function(e){return QA(this,e)}),t("toBase64URI",function(){return QA(this,!0)}),t("toBase64URL",function(){return QA(this,!0)})},aFt=()=>{hMe(),dMe()},sFt={version:eMe,VERSION:X$t,atob:jee,atobPolyfill:sMe,btoa:qee,btoaPolyfill:nMe,fromBase64:mq,toBase64:p6,encode:p6,encodeURI:a0e,encodeURL:a0e,utob:iMe,btou:aMe,decode:mq,isValid:iFt,fromUint8Array:QA,toUint8Array:lMe,extendString:hMe,extendUint8Array:dMe,extendBuiltins:aFt},yl="#f8fafb",bl="#222325",s0e={client:[{tagName:"path",attrs:{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}},{tagName:"path",attrs:{d:"M10 19v-3.96 3.15"}},{tagName:"path",attrs:{d:"M7 19h5"}},{tagName:"rect",attrs:{width:"6",height:"10",x:"16",y:"12",rx:"2"}}],webApp:[{tagName:"rect",attrs:{x:"2",y:"4",width:"20",height:"16",rx:"2"}},{tagName:"path",attrs:{d:"M10 4v4"}},{tagName:"path",attrs:{d:"M2 8h20"}},{tagName:"path",attrs:{d:"M6 4v4"}}],mobileApp:[{tagName:"rect",attrs:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M12 18h.01"}}],website:[{tagName:"path",attrs:{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54"}},{tagName:"path",attrs:{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17"}},{tagName:"path",attrs:{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}}],apiClient:[{tagName:"path",attrs:{d:"m18 16 4-4-4-4"}},{tagName:"path",attrs:{d:"m6 8-4 4 4 4"}},{tagName:"path",attrs:{d:"m14.5 4-5 16"}}],service:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}},{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"6",y2:"6"}},{tagName:"line",attrs:{x1:"6",x2:"6.01",y1:"18",y2:"18"}}],cpu:[{tagName:"path",attrs:{d:"M12 20v2"}},{tagName:"path",attrs:{d:"M12 2v2"}},{tagName:"path",attrs:{d:"M17 20v2"}},{tagName:"path",attrs:{d:"M17 2v2"}},{tagName:"path",attrs:{d:"M2 12h2"}},{tagName:"path",attrs:{d:"M2 17h2"}},{tagName:"path",attrs:{d:"M2 7h2"}},{tagName:"path",attrs:{d:"M20 12h2"}},{tagName:"path",attrs:{d:"M20 17h2"}},{tagName:"path",attrs:{d:"M20 7h2"}},{tagName:"path",attrs:{d:"M7 20v2"}},{tagName:"path",attrs:{d:"M7 2v2"}},{tagName:"rect",attrs:{x:"4",y:"4",width:"16",height:"16",rx:"2"}},{tagName:"rect",attrs:{x:"8",y:"8",width:"8",height:"8",rx:"1"}}],gpu:[{tagName:"path",attrs:{d:"M2 17h18a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H2"}},{tagName:"path",attrs:{d:"M2 21V3"}},{tagName:"path",attrs:{d:"M7 17v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3"}},{tagName:"circle",attrs:{cx:"16",cy:"11",r:"2"}},{tagName:"circle",attrs:{cx:"8",cy:"11",r:"2"}}],memory:[{tagName:"path",attrs:{d:"M12 12v-2"}},{tagName:"path",attrs:{d:"M12 18v-2"}},{tagName:"path",attrs:{d:"M16 12v-2"}},{tagName:"path",attrs:{d:"M16 18v-2"}},{tagName:"path",attrs:{d:"M2 11h1.5"}},{tagName:"path",attrs:{d:"M20 18v-2"}},{tagName:"path",attrs:{d:"M20.5 11H22"}},{tagName:"path",attrs:{d:"M4 18v-2"}},{tagName:"path",attrs:{d:"M8 12v-2"}},{tagName:"path",attrs:{d:"M8 18v-2"}},{tagName:"rect",attrs:{x:"2",y:"6",width:"20",height:"10",rx:"2"}}],virtualMachine:[{tagName:"path",attrs:{d:"m10.852 14.772-.383.923"}},{tagName:"path",attrs:{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.148 9.228.383-.923"}},{tagName:"path",attrs:{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 10.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 13.148.923.383"}},{tagName:"path",attrs:{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"}},{tagName:"path",attrs:{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"}},{tagName:"path",attrs:{d:"M6 18h.01"}},{tagName:"path",attrs:{d:"M6 6h.01"}},{tagName:"path",attrs:{d:"m9.228 10.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 13.148-.923.383"}}],container:[{tagName:"path",attrs:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"}},{tagName:"path",attrs:{d:"M10 21.9V14L2.1 9.1"}},{tagName:"path",attrs:{d:"m10 14 11.9-6.9"}},{tagName:"path",attrs:{d:"M14 19.8v-8.1"}},{tagName:"path",attrs:{d:"M18 17.5V9.4"}}],kubernetes:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"8"}},{tagName:"path",attrs:{d:"M12 2v7.5"}},{tagName:"path",attrs:{d:"m19 5-5.23 5.23"}},{tagName:"path",attrs:{d:"M22 12h-7.5"}},{tagName:"path",attrs:{d:"m19 19-5.23-5.23"}},{tagName:"path",attrs:{d:"M12 14.5V22"}},{tagName:"path",attrs:{d:"M10.23 13.77 5 19"}},{tagName:"path",attrs:{d:"M9.5 12H2"}},{tagName:"path",attrs:{d:"M10.23 10.23 5 5"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2.5"}}],serverless:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}},{tagName:"path",attrs:{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"}},{tagName:"path",attrs:{d:"M9 11.2h5.7"}}],largeLanguageModel:[{tagName:"path",attrs:{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}},{tagName:"path",attrs:{d:"M9 13a4.5 4.5 0 0 0 3-4"}},{tagName:"path",attrs:{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}},{tagName:"path",attrs:{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}},{tagName:"path",attrs:{d:"M6 18a4 4 0 0 1-1.967-.516"}},{tagName:"path",attrs:{d:"M12 13h4"}},{tagName:"path",attrs:{d:"M12 18h6a2 2 0 0 1 2 2v1"}},{tagName:"path",attrs:{d:"M12 8h8"}},{tagName:"path",attrs:{d:"M16 8V5a2 2 0 0 1 2-2"}},{tagName:"circle",attrs:{cx:"16",cy:"13",r:".5"}},{tagName:"circle",attrs:{cx:"18",cy:"3",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"21",r:".5"}},{tagName:"circle",attrs:{cx:"20",cy:"8",r:".5"}}],multimodalModel:[{tagName:"path",attrs:{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}},{tagName:"path",attrs:{d:"M20 2v4"}},{tagName:"path",attrs:{d:"M22 4h-4"}},{tagName:"circle",attrs:{cx:"4",cy:"20",r:"2"}}],embeddingModel:[{tagName:"rect",attrs:{x:"14",y:"14",width:"4",height:"6",rx:"2"}},{tagName:"rect",attrs:{x:"6",y:"4",width:"4",height:"6",rx:"2"}},{tagName:"path",attrs:{d:"M6 20h4"}},{tagName:"path",attrs:{d:"M14 10h4"}},{tagName:"path",attrs:{d:"M6 14h2v6"}},{tagName:"path",attrs:{d:"M14 4h2v6"}}],reranker:[{tagName:"path",attrs:{d:"m3 16 4 4 4-4"}},{tagName:"path",attrs:{d:"M7 20V4"}},{tagName:"path",attrs:{d:"m21 8-4-4-4 4"}},{tagName:"path",attrs:{d:"M17 4v16"}}],modelInference:[{tagName:"path",attrs:{d:"M10 12h4"}},{tagName:"path",attrs:{d:"M10 17h4"}},{tagName:"path",attrs:{d:"M10 7h4"}},{tagName:"path",attrs:{d:"M18 12h2"}},{tagName:"path",attrs:{d:"M18 18h2"}},{tagName:"path",attrs:{d:"M18 6h2"}},{tagName:"path",attrs:{d:"M4 12h2"}},{tagName:"path",attrs:{d:"M4 18h2"}},{tagName:"path",attrs:{d:"M4 6h2"}},{tagName:"rect",attrs:{x:"6",y:"2",width:"12",height:"20",rx:"2"}}],vectorDatabase:[{tagName:"path",attrs:{d:"m10.586 5.414-5.172 5.172"}},{tagName:"path",attrs:{d:"m18.586 13.414-5.172 5.172"}},{tagName:"path",attrs:{d:"M6 12h12"}},{tagName:"circle",attrs:{cx:"12",cy:"20",r:"2"}},{tagName:"circle",attrs:{cx:"12",cy:"4",r:"2"}},{tagName:"circle",attrs:{cx:"20",cy:"12",r:"2"}},{tagName:"circle",attrs:{cx:"4",cy:"12",r:"2"}}],ragPipeline:[{tagName:"rect",attrs:{width:"8",height:"8",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M7 11v4a2 2 0 0 0 2 2h4"}},{tagName:"rect",attrs:{width:"8",height:"8",x:"13",y:"13",rx:"2"}}],aiAgent:[{tagName:"path",attrs:{d:"M12 8V4H8"}},{tagName:"rect",attrs:{width:"16",height:"12",x:"4",y:"8",rx:"2"}},{tagName:"path",attrs:{d:"M2 14h2"}},{tagName:"path",attrs:{d:"M20 14h2"}},{tagName:"path",attrs:{d:"M15 13v2"}},{tagName:"path",attrs:{d:"M9 13v2"}}],modelGateway:[{tagName:"rect",attrs:{width:"20",height:"8",x:"2",y:"14",rx:"2"}},{tagName:"path",attrs:{d:"M6.01 18H6"}},{tagName:"path",attrs:{d:"M10.01 18H10"}},{tagName:"path",attrs:{d:"M15 10v4"}},{tagName:"path",attrs:{d:"M17.84 7.17a4 4 0 0 0-5.66 0"}},{tagName:"path",attrs:{d:"M20.66 4.34a8 8 0 0 0-11.31 0"}}],mcpServer:[{tagName:"path",attrs:{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}},{tagName:"path",attrs:{d:"m2 22 3-3"}},{tagName:"path",attrs:{d:"M7.5 13.5 10 11"}},{tagName:"path",attrs:{d:"M10.5 16.5 13 14"}},{tagName:"path",attrs:{d:"m18 3-4 4h6l-4 4"}}],relationalDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 21 19V5"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 21 12"}}],noSqlDatabase:[{tagName:"ellipse",attrs:{cx:"12",cy:"5",rx:"9",ry:"3"}},{tagName:"path",attrs:{d:"M3 5V19A9 3 0 0 0 15 21.84"}},{tagName:"path",attrs:{d:"M21 5V8"}},{tagName:"path",attrs:{d:"M21 12L18 17H22L19 22"}},{tagName:"path",attrs:{d:"M3 12A9 3 0 0 0 14.59 14.87"}}],cache:[{tagName:"path",attrs:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}}],dataWarehouse:[{tagName:"path",attrs:{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}},{tagName:"path",attrs:{d:"m7 16.5-4.74-2.85"}},{tagName:"path",attrs:{d:"m7 16.5 5-3"}},{tagName:"path",attrs:{d:"M7 16.5v5.17"}},{tagName:"path",attrs:{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}},{tagName:"path",attrs:{d:"m17 16.5-5-3"}},{tagName:"path",attrs:{d:"m17 16.5 4.74-2.85"}},{tagName:"path",attrs:{d:"M17 16.5v5.17"}},{tagName:"path",attrs:{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}},{tagName:"path",attrs:{d:"M12 8 7.26 5.15"}},{tagName:"path",attrs:{d:"m12 8 4.74-2.85"}},{tagName:"path",attrs:{d:"M12 13.5V8"}}],searchEngine:[{tagName:"path",attrs:{d:"m21 21-4.34-4.34"}},{tagName:"circle",attrs:{cx:"11",cy:"11",r:"8"}}],objectStorage:[{tagName:"path",attrs:{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"}}],fileStorage:[{tagName:"path",attrs:{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"}},{tagName:"path",attrs:{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z"}}],blockStorage:[{tagName:"path",attrs:{d:"M10 16h.01"}},{tagName:"path",attrs:{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}},{tagName:"path",attrs:{d:"M21.946 12.013H2.054"}},{tagName:"path",attrs:{d:"M6 16h.01"}}],backup:[{tagName:"circle",attrs:{cx:"15",cy:"19",r:"2"}},{tagName:"path",attrs:{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1"}},{tagName:"path",attrs:{d:"M15 11v-1"}},{tagName:"path",attrs:{d:"M15 17v-2"}}],cdn:[{tagName:"path",attrs:{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}},{tagName:"path",attrs:{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}},{tagName:"path",attrs:{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}},{tagName:"path",attrs:{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}},{tagName:"circle",attrs:{cx:"12",cy:"12",r:"2"}}],messageQueue:[{tagName:"path",attrs:{d:"M11 5h10"}},{tagName:"path",attrs:{d:"M11 12h10"}},{tagName:"path",attrs:{d:"M11 19h10"}},{tagName:"path",attrs:{d:"M4 4h1v5"}},{tagName:"path",attrs:{d:"M4 9h2"}},{tagName:"path",attrs:{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}}],eventBus:[{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"12",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"19",r:"3"}},{tagName:"line",attrs:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}},{tagName:"line",attrs:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}}],streamProcessing:[{tagName:"path",attrs:{d:"M2 12q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 19q2.5 2 5 0t5 0 5 0 5 0"}},{tagName:"path",attrs:{d:"M2 5q2.5 2 5 0t5 0 5 0 5 0"}}],webhook:[{tagName:"path",attrs:{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}},{tagName:"path",attrs:{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}},{tagName:"path",attrs:{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"}}],serviceMesh:[{tagName:"path",attrs:{d:"M12 3v18"}},{tagName:"path",attrs:{d:"M3 12h18"}},{tagName:"rect",attrs:{x:"3",y:"3",width:"18",height:"18",rx:"2"}}],apiGateway:[{tagName:"circle",attrs:{cx:"6",cy:"19",r:"3"}},{tagName:"path",attrs:{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"}},{tagName:"circle",attrs:{cx:"18",cy:"5",r:"3"}}],loadBalancer:[{tagName:"circle",attrs:{cx:"12",cy:"18",r:"3"}},{tagName:"circle",attrs:{cx:"6",cy:"6",r:"3"}},{tagName:"circle",attrs:{cx:"18",cy:"6",r:"3"}},{tagName:"path",attrs:{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}},{tagName:"path",attrs:{d:"M12 12v3"}}],dns:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"path",attrs:{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"}}],vpc:[{tagName:"rect",attrs:{x:"16",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"2",y:"16",width:"6",height:"6",rx:"1"}},{tagName:"rect",attrs:{x:"9",y:"2",width:"6",height:"6",rx:"1"}},{tagName:"path",attrs:{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}},{tagName:"path",attrs:{d:"M12 12V8"}}],subnet:[{tagName:"path",attrs:{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"}},{tagName:"path",attrs:{d:"M17 21v-2"}},{tagName:"path",attrs:{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10"}},{tagName:"path",attrs:{d:"M21 21v-2"}},{tagName:"path",attrs:{d:"M3 5V3"}},{tagName:"path",attrs:{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"}},{tagName:"path",attrs:{d:"M7 5V3"}}],vpn:[{tagName:"path",attrs:{d:"m15 20 3-3h2a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2l3 3z"}},{tagName:"path",attrs:{d:"M6 8v1"}},{tagName:"path",attrs:{d:"M10 8v1"}},{tagName:"path",attrs:{d:"M14 8v1"}},{tagName:"path",attrs:{d:"M18 8v1"}}],identity:[{tagName:"path",attrs:{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}},{tagName:"circle",attrs:{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}}],firewall:[{tagName:"rect",attrs:{width:"18",height:"18",x:"3",y:"3",rx:"2"}},{tagName:"path",attrs:{d:"M12 9v6"}},{tagName:"path",attrs:{d:"M16 15v6"}},{tagName:"path",attrs:{d:"M16 3v6"}},{tagName:"path",attrs:{d:"M3 15h18"}},{tagName:"path",attrs:{d:"M3 9h18"}},{tagName:"path",attrs:{d:"M8 15v6"}},{tagName:"path",attrs:{d:"M8 3v6"}}],waf:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"m9 12 2 2 4-4"}}],secretManager:[{tagName:"circle",attrs:{cx:"12",cy:"16",r:"1"}},{tagName:"rect",attrs:{x:"3",y:"10",width:"18",height:"12",rx:"2"}},{tagName:"path",attrs:{d:"M7 10V7a5 5 0 0 1 10 0v3"}}],certificate:[{tagName:"path",attrs:{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}},{tagName:"path",attrs:{d:"M8 12h.01"}},{tagName:"path",attrs:{d:"M12 12h.01"}},{tagName:"path",attrs:{d:"M16 12h.01"}}],systemBoundary:[{tagName:"path",attrs:{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}},{tagName:"path",attrs:{d:"m3.3 7 8.7 5 8.7-5"}},{tagName:"path",attrs:{d:"M12 22V12"}}],monitoring:[{tagName:"path",attrs:{d:"m12 14 4-4"}},{tagName:"path",attrs:{d:"M3.34 19a10 10 0 1 1 17.32 0"}}],logging:[{tagName:"path",attrs:{d:"M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85"}},{tagName:"path",attrs:{d:"M14 2v5a1 1 0 0 0 1 1h5"}},{tagName:"path",attrs:{d:"M8 14v2.2l1.6 1"}},{tagName:"circle",attrs:{cx:"8",cy:"16",r:"6"}}],metrics:[{tagName:"path",attrs:{d:"M12 16v5"}},{tagName:"path",attrs:{d:"M16 14.639V21"}},{tagName:"path",attrs:{d:"M20 10.656V21"}},{tagName:"path",attrs:{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15"}},{tagName:"path",attrs:{d:"M4 18.463V21"}},{tagName:"path",attrs:{d:"M8 14.656V21"}}],tracing:[{tagName:"path",attrs:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}}],alerting:[{tagName:"circle",attrs:{cx:"12",cy:"12",r:"10"}},{tagName:"line",attrs:{x1:"12",x2:"12",y1:"8",y2:"12"}},{tagName:"line",attrs:{x1:"12",x2:"12.01",y1:"16",y2:"16"}}],saas:[{tagName:"path",attrs:{d:"m10.852 19.772-.383.924"}},{tagName:"path",attrs:{d:"m13.148 14.228.383-.923"}},{tagName:"path",attrs:{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923"}},{tagName:"path",attrs:{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544"}},{tagName:"path",attrs:{d:"m14.772 15.852.923-.383"}},{tagName:"path",attrs:{d:"m14.772 18.148.923.383"}},{tagName:"path",attrs:{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2"}},{tagName:"path",attrs:{d:"m9.228 15.852-.923-.383"}},{tagName:"path",attrs:{d:"m9.228 18.148-.923.383"}}],externalApi:[{tagName:"path",attrs:{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}},{tagName:"path",attrs:{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}}],thirdPartyService:[{tagName:"path",attrs:{d:"M15 3h6v6"}},{tagName:"path",attrs:{d:"M10 14 21 3"}},{tagName:"path",attrs:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}}]},fMe='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',oFt=12,lFt=550,cFt=17,uFt=10,hFt=14,Uq=34,dFt=10,cE=32,uE=64,fFt=(t,e,r,n)=>({name:"manhattan",args:{padding:8,step:8,maxLoopCount:5e3,excludeNodes:[...new Set([t,e,...r])],...n?{startDirections:[n.source],endDirections:[n.target]}:{}}}),pMe=(t,e)=>{const r=t.x+t.width,n=e.x+e.width,i=t.y-(e.y+e.height),a=e.y-(t.y+t.height);if(e.x>=r)return e.x-ruE?{source:"right",target:"bottom"}:e.x-ruE?{source:"right",target:"top"}:{source:"right",target:"left"};if(n<=t.x)return t.x-nuE?{source:"left",target:"bottom"}:t.x-nuE?{source:"left",target:"top"}:{source:"left",target:"right"};const s=t.y+t.height/2;return e.y+e.height/2>=s?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}},o0e=({side:t,offset:e})=>({name:t,args:t==="left"||t==="right"?{dy:e}:{dx:e}}),pFt=(t,e)=>{const r=new Map(t.map(a=>[a.id,a])),n=new Map,i=new Map;for(const a of e){const s=r.get(a.source),o=r.get(a.target);if(!s||!o)continue;const l=pMe(s,o);n.set(a.id,{source:{side:l.source,offset:0},target:{side:l.target,offset:0}});for(const[u,h,d,f]of[["source",s,l.source,o],["target",o,l.target,s]]){const p=`${h.id}:${d}`,g=i.get(p)??[];g.push({edgeId:a.id,end:u,opposite:d==="left"||d==="right"?f.y+f.height/2:f.x+f.width/2}),i.set(p,g)}}for(const[a,s]of i){if(s.length<2)continue;const o=a.lastIndexOf(":"),l=r.get(a.slice(0,o)),u=a.slice(o+1);if(!l)continue;const h=u==="left"||u==="right"?l.height:l.width,d=Math.min(Math.max(0,h-28),(s.length-1)*16);s.sort((f,p)=>f.opposite-p.opposite||f.edgeId.localeCompare(p.edgeId)),s.forEach(({edgeId:f,end:p},g)=>{const m=n.get(f);m&&(m[p].offset=Math.round(-d/2+d*g/(s.length-1)))})}return n},gMe=["client","frontend","service","database","storage","queue","security","external"],gFt={client:"client",frontend:"webApp",service:"service",database:"relationalDatabase",storage:"objectStorage",queue:"messageQueue",security:"waf",external:"saas"},mFt={light:{canvas:yl,boundaryStroke:"#7B8F86",boundaryText:"#1C3D31",boundaryFill:"rgba(123, 143, 134, 0.05)",boundaryBadgeFill:"rgba(255, 255, 255, 0.95)",boundaryBadgeStroke:"rgba(123, 143, 134, 0.4)",nodes:{client:{fill:"#E9EFF5",stroke:"#3B6285",text:"#1A3B5C",accent:"#2B5A84",iconFrame:"#D4E2EE"},frontend:{fill:"#EEF2FF",stroke:"#4338CA",text:"#312E81",accent:"#4F46E5",iconFrame:"#E0E7FF"},service:{fill:"#E3F4EE",stroke:"#169567",text:"#19563E",accent:"#16A06E",iconFrame:"#D0ECE2"},database:{fill:"#EFE7FD",stroke:"#7437DC",text:"#472877",accent:"#7C3AED",iconFrame:"#E5D8FB"},storage:{fill:"#FAEFE1",stroke:"#CA6F07",text:"#71430F",accent:"#D97706",iconFrame:"#F7E4CD"},queue:{fill:"#FCEBE2",stroke:"#DA530D",text:"#793512",accent:"#EA580C",iconFrame:"#FBDECE"},security:{fill:"#FBE4E9",stroke:"#D11D44",text:"#751B2D",accent:"#E11D48",iconFrame:"#F9D2DA"},external:{fill:"#ECEEF1",stroke:"#5E6D82",text:"#3C424B",accent:"#64748B",iconFrame:"#E0E3E8"}},edges:{dependency:{stroke:"#64748B",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#0F8A5C",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#7C3AED",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#EA580C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}},dark:{canvas:bl,boundaryStroke:"#5B6F66",boundaryText:"#D7F4E8",boundaryFill:"rgba(91, 111, 102, 0.12)",boundaryBadgeFill:"rgba(16, 19, 17, 0.95)",boundaryBadgeStroke:"rgba(91, 111, 102, 0.5)",nodes:{client:{fill:"#132537",stroke:"#5A8EB9",text:"#DCE8F2",accent:"#5A8EB9",iconFrame:"#1C3752"},frontend:{fill:"#18214D",stroke:"#6366F1",text:"#E0E7FF",accent:"#6366F1",iconFrame:"#232F6B"},service:{fill:"#123A2B",stroke:"#49B58E",text:"#D5EEE5",accent:"#49B58E",iconFrame:"#13573E"},database:{fill:"#2E1E4F",stroke:"#9965F1",text:"#E7DCFC",accent:"#9965F1",iconFrame:"#44267B"},storage:{fill:"#482F0E",stroke:"#E1953D",text:"#F8E7D2",accent:"#E1953D",iconFrame:"#70430C"},queue:{fill:"#4D2610",stroke:"#EF7D41",text:"#FBE1D3",accent:"#EF7D41",iconFrame:"#79340F"},security:{fill:"#4B1620",stroke:"#E84F70",text:"#FAD6DE",accent:"#E84F70",iconFrame:"#74182B"},external:{fill:"#282E33",stroke:"#8693A5",text:"#E3E6EA",accent:"#8693A5",iconFrame:"#38424C"}},edges:{dependency:{stroke:"#94A3B8",strokeWidth:1.2,markerWidth:7,markerHeight:5},request:{stroke:"#4DB58B",strokeWidth:1.6,markerWidth:8,markerHeight:6},data:{stroke:"#A78BFA",strokeWidth:1.6,markerWidth:8,markerHeight:6},async:{stroke:"#FB923C",strokeWidth:1.5,strokeDasharray:"7 5",markerWidth:8,markerHeight:6}}}},QO=(t="light")=>mFt[t],UFt=(t,e)=>{const r=QO(e);return t==="boundary"?{fill:r.boundaryFill,stroke:r.boundaryStroke,text:r.boundaryText,accent:r.boundaryStroke,iconFrame:"transparent"}:gMe.includes(t)?r.nodes[t]:r.nodes.service},yFt=(t,e)=>t==="database"||t==="queue"||t==="external"?Math.round(e/2):t==="security"?16:t==="frontend"?10:t==="service"?8:t==="client"||t==="storage"?6:11,l0e=t=>t==="database"||t==="external"?17:t==="security"?12:t==="queue"?10:8,bFt=t=>Math.round((t-Uq)/2),mMe=(t,e)=>{const r=t??(gMe.includes(e)?gFt[e]:"service");return s0e[r]??s0e.service},vFt=(t,e)=>{if(e==="boundary")return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"headerBadge"},{tagName:"text",selector:"label"}];const r=mMe(t,e);return[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"iconFrame"},...r.map((n,i)=>({tagName:n.tagName,selector:`architectureIcon${i}`})),{tagName:"text",selector:"label"}]},xFt=(t,e,r,n)=>{const i=QO(e),a=UFt(t,e),s=t==="boundary",o=yFt(t,r.height),l=bFt(r.height),u=s?[]:mMe(n,t),h=Object.fromEntries(u.map((d,f)=>[`architectureIcon${f}`,{...d.attrs,transform:`translate(15 ${l+5})`,fill:"none",stroke:a.accent,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}]));return{markup:vFt(n,t),body:{fill:a.fill,stroke:a.stroke,strokeWidth:1.5,strokeDasharray:s||t==="external"?"7 5":void 0,rx:o,ry:o},label:{fill:a.text,fontSize:s?12:oFt,fontWeight:s?650:lFt,fontFamily:fMe,lineHeight:s?18:cFt,...s?{refX:20,refY:20,textAnchor:"start",textVerticalAnchor:"middle"}:{refX:54,refY:"50%",textAnchor:"start",textVerticalAnchor:"middle"}},attrs:s?{headerBadge:{ref:"label",refWidth:1,refHeight:1,refWidth2:16,refHeight2:6,refX:-8,refY:-3,fill:i.boundaryBadgeFill,stroke:i.boundaryBadgeStroke,strokeWidth:1,rx:4,ry:4,pointerEvents:"none"}}:{iconFrame:{x:dFt,y:l,width:Uq,height:Uq,rx:l0e(t),ry:l0e(t),fill:a.iconFrame,stroke:"none",pointerEvents:"none"},...h}}},wFt=(t,e,r=!1)=>{const n=QO(e).edges[t??"dependency"],i={name:"block",width:n.markerWidth,height:n.markerHeight};return{stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,sourceMarker:r?i:null,targetMarker:i,fill:"none"}},yq='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',TFt=10,CFt=14,kFt={name:"manhattan",args:{padding:8,step:8,excludeEnds:!0}},SFt=(t,e)=>{const r={x:t.x+t.width/2,y:t.y+t.height/2},n={x:e.x+e.width/2,y:e.y+e.height/2},i=n.x-r.x,a=n.y-r.y;return a<-t.height?{source:"left",target:"left"}:i<-t.width?{source:"top",target:"top"}:Math.abs(a)>=Math.abs(i)?a>=0?{source:"bottom",target:"top"}:{source:"top",target:"bottom"}:i>=0?{source:"right",target:"left"}:{source:"left",target:"right"}},EFt=(t,e)=>{const r=e.x+e.width/2-(t.x+t.width/2),n=e.y+e.height/2-(t.y+t.height/2);return n<-t.height||r<-t.width?!1:Math.abs(r)<=1&&Math.abs(n)>8||Math.abs(n)<=1&&Math.abs(r)>8},AFt=.85,MFt=["plain","brand","ink","paper","island","tea","cosmos","sun","wa","rose","mint"],RFt={ocean:"brand",slate:"ink",mono:"ink",classic:"paper",sand:"island",sky:"cosmos",sunset:"sun",violet:"rose",aurora:"mint"},LFt=t=>t&&MFt.includes(t)?t:t?RFt[t]??"brand":"plain",IFt={plain:{light:{canvas:yl,edge:"#737373",process:{fill:"#FFFFFF",stroke:"#D4D4D4",text:"#212121"},decision:{fill:"#F4F4F5",stroke:"#737373",text:"#212121"},terminator:{fill:"#707070",stroke:"#707070",text:"#FFFFFF"}},dark:{canvas:bl,edge:"#A3A3A3",process:{fill:"#1C1C1C",stroke:"#3A3A3A",text:"#F4F4F5"},decision:{fill:"#262626",stroke:"#A3A3A3",text:"#F4F4F5"},terminator:{fill:"#F5F5F5",stroke:"#F5F5F5",text:"#212121"}}},brand:{light:{canvas:yl,edge:"#5C7166",process:{fill:"#FFFFFF",stroke:"#6F9B88",text:"#1C3D31"},decision:{fill:"#FFF6E5",stroke:"#D4A24A",text:"#7A4A12"},terminator:{fill:"#E7F6EF",stroke:"#16A06E",text:"#145C40"}},dark:{canvas:bl,edge:"#8CA397",process:{fill:"#1B2420",stroke:"#5B7569",text:"#E8F2ED"},decision:{fill:"#2A2316",stroke:"#E0B35C",text:"#F8E4B8"},terminator:{fill:"#1A3329",stroke:"#4DB58B",text:"#D8F3E6"}}},ink:{light:{canvas:yl,edge:"#64748B",process:{fill:"#FFFFFF",stroke:"#7D8794",text:"#1C232C"},decision:{fill:"#E8EDF3",stroke:"#6E7C8F",text:"#243044"},terminator:{fill:"#E6EAEF",stroke:"#3A4656",text:"#1A222C"}},dark:{canvas:bl,edge:"#94A3B8",process:{fill:"#1B1E23",stroke:"#6B7380",text:"#E8ECF1"},decision:{fill:"#222830",stroke:"#8B9BB0",text:"#D5DDE8"},terminator:{fill:"#1A2028",stroke:"#A8B4C4",text:"#E8EEF4"}}},paper:{light:{canvas:yl,edge:"#78716C",process:{fill:"#FFFCF6",stroke:"#C4B396",text:"#3A3126"},decision:{fill:"#F4E4CC",stroke:"#C08A48",text:"#6A3F14"},terminator:{fill:"#F0E4D0",stroke:"#7A5230",text:"#3F2A16"}},dark:{canvas:bl,edge:"#A8A29E",process:{fill:"#221E19",stroke:"#7A6A56",text:"#F3EBE0"},decision:{fill:"#2C2418",stroke:"#D4A06A",text:"#F6E2C4"},terminator:{fill:"#2A2118",stroke:"#C4A07A",text:"#F0E4D4"}}},island:{light:{canvas:yl,edge:"#7C6F68",process:{fill:"#FFF8F3",stroke:"#C4A090",text:"#3A2A22"},decision:{fill:"#F3D8C8",stroke:"#C46A48",text:"#6A3220"},terminator:{fill:"#EBD0C0",stroke:"#8B4A32",text:"#3F2418"}},dark:{canvas:bl,edge:"#ABA09A",process:{fill:"#231C18",stroke:"#8A6A56",text:"#F3E8E0"},decision:{fill:"#2C2018",stroke:"#D49070",text:"#F6D8C4"},terminator:{fill:"#281A16",stroke:"#C48868",text:"#F0D8CC"}}},tea:{light:{canvas:yl,edge:"#657361",process:{fill:"#FFFFFF",stroke:"#8A9A72",text:"#2A3420"},decision:{fill:"#E8EED4",stroke:"#8A9A48",text:"#3F4A18"},terminator:{fill:"#DCE6C8",stroke:"#4F6A32",text:"#243018"}},dark:{canvas:bl,edge:"#97A693",process:{fill:"#1C2018",stroke:"#6A7A56",text:"#E8F0DC"},decision:{fill:"#222618",stroke:"#B8C46A",text:"#E8F0C4"},terminator:{fill:"#1A2418",stroke:"#8AAA5A",text:"#D8E8C4"}}},cosmos:{light:{canvas:yl,edge:"#5C6D7E",process:{fill:"#FFFFFF",stroke:"#7A94A8",text:"#1C2A38"},decision:{fill:"#E4EEF5",stroke:"#5A82A0",text:"#1E3A52"},terminator:{fill:"#D8E6F0",stroke:"#2A5470",text:"#163044"}},dark:{canvas:bl,edge:"#8EA0B2",process:{fill:"#181E26",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#1C2834",stroke:"#7AA0C0",text:"#D0E4F4"},terminator:{fill:"#162028",stroke:"#8AB4D0",text:"#D8E8F4"}}},sun:{light:{canvas:yl,edge:"#736B5E",process:{fill:"#FFFEF6",stroke:"#D4C47A",text:"#3A3418"},decision:{fill:"#FFF0C4",stroke:"#E0B040",text:"#6A4A08"},terminator:{fill:"#F8E8B0",stroke:"#C09020",text:"#4A3808"}},dark:{canvas:bl,edge:"#A8A092",process:{fill:"#242018",stroke:"#8A7A48",text:"#F6F0D8"},decision:{fill:"#2C2410",stroke:"#E0B848",text:"#F8E8B8"},terminator:{fill:"#28240C",stroke:"#D4B040",text:"#F4E8C0"}}},wa:{light:{canvas:yl,edge:"#5B6F7D",process:{fill:"#FFFFFF",stroke:"#8AA8C0",text:"#1C2C3A"},decision:{fill:"#FCE8DC",stroke:"#E09070",text:"#7A3A24"},terminator:{fill:"#DCE8F4",stroke:"#2A5A88",text:"#1A3858"}},dark:{canvas:bl,edge:"#8EA3B3",process:{fill:"#182028",stroke:"#5A7088",text:"#E0E8F0"},decision:{fill:"#2C2018",stroke:"#E0A080",text:"#F8DCC8"},terminator:{fill:"#162030",stroke:"#6A98C0",text:"#D4E4F4"}}},rose:{light:{canvas:yl,edge:"#75646B",process:{fill:"#FFFFFF",stroke:"#C49AAC",text:"#3A2430"},decision:{fill:"#F8E4EC",stroke:"#D0809A",text:"#7A3048"},terminator:{fill:"#F0D8E2",stroke:"#A04060",text:"#4A2030"}},dark:{canvas:bl,edge:"#A8969D",process:{fill:"#24181C",stroke:"#8A5A6A",text:"#F4E4EA"},decision:{fill:"#2C1A22",stroke:"#E090A8",text:"#F8D8E4"},terminator:{fill:"#28141C",stroke:"#E07090",text:"#F4D0DC"}}},mint:{light:{canvas:yl,edge:"#5A736F",process:{fill:"#FFFFFF",stroke:"#7AB0A8",text:"#1C3A38"},decision:{fill:"#E4F4F0",stroke:"#4AA89A",text:"#1A5A52"},terminator:{fill:"#D4EEE8",stroke:"#1A7A70",text:"#145048"}},dark:{canvas:bl,edge:"#8EA8A4",process:{fill:"#182422",stroke:"#4A786E",text:"#DCF0EC"},decision:{fill:"#1A2C28",stroke:"#6AC4B4",text:"#D0F0E8"},terminator:{fill:"#162824",stroke:"#5AB8A8",text:"#D0EEE6"}}}},UMe=(t="light",e)=>IFt[LFt(e)][t],NFt=(t,e,r)=>{const n=UMe(e,r);return t==="decision"?n.decision:t==="terminator"?n.terminator:n.process},DFt=(t,e,r,n)=>{const i=NFt(t,e,n),a=t==="terminator",s=t==="decision";return{body:{fill:i.fill,stroke:i.stroke,strokeWidth:1.5,rx:a?Math.round(r.height/2):10,ry:a?Math.round(r.height/2):10,...s?{refPoints:"0,10 10,0 20,10 10,20"}:{},style:{filter:e==="dark"?"drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3))":"drop-shadow(0 1px 2px rgba(15, 23, 42, 0.06)) drop-shadow(0 2px 5px rgba(15, 23, 42, 0.04))"}},label:{fill:i.text,fontSize:13,fontWeight:a?650:s?600:500,fontFamily:yq,lineHeight:18}}},OFt=1,_Ft=2,PFt=["plain","brand","cosmos","dune","slate","prism","sunrise","marine","blossom","mint","macaron"],BFt="plain",$Ft=["plain","brand","ocean","ink","classic","sky","sunset","violet","rose","sand","slate","aurora","mono","sun","wa","island","mint","cosmos","tea","naive","macaron","paper","dune","prism","sunrise","marine","blossom"],FFt=["map","line","capsule","box","circle","ellipse","hexagon","logic","tree","brace","org","timeline","fishbone"],zFt=[...FFt,"rect","diamond","cloud"],VFt={ocean:"brand",ink:"brand",paper:"brand",classic:"sunrise",sunset:"sunrise",sun:"sunrise",wa:"marine",island:"dune",sand:"dune",tea:"slate",mono:"slate",slate:"slate",sky:"cosmos",cosmos:"cosmos",rose:"blossom",violet:"blossom",aurora:"mint",naive:"prism",mint:"mint",macaron:"macaron"},Yee=t=>t&&PFt.includes(t)?t:t?VFt[t]??"brand":BFt,HFt=["client","webApp","mobileApp","website","apiClient","service","cpu","gpu","memory","virtualMachine","container","kubernetes","serverless","largeLanguageModel","multimodalModel","embeddingModel","reranker","modelInference","vectorDatabase","ragPipeline","aiAgent","modelGateway","mcpServer","relationalDatabase","noSqlDatabase","cache","dataWarehouse","searchEngine","objectStorage","fileStorage","blockStorage","backup","cdn","messageQueue","eventBus","streamProcessing","webhook","serviceMesh","apiGateway","loadBalancer","dns","vpc","subnet","vpn","identity","firewall","waf","secretManager","certificate","systemBoundary","monitoring","logging","metrics","tracing","alerting","saas","externalApi","thirdPartyService"],GFt="edgeever-diagram-v1",yMe=new RegExp(`\x3C!--\\s*${GFt}:([\\s\\S]*?)\\s*-->`),WFt=t=>sFt.decode(t),hE=t=>typeof t=="number"&&Number.isFinite(t),qFt=["mind-map","flowchart","architecture"],jFt=["topic","process","decision","terminator","client","frontend","service","database","storage","queue","security","external","boundary"],c0e=["dependency","request","async","data"],YFt=t=>typeof t=="string"&&HFt.includes(t),XFt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.label!="string"||!hE(e.x)||!hE(e.y)||!hE(e.width)||!hE(e.height)||!jFt.includes(e.shape)?null:{id:e.id,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height,shape:e.shape,...typeof e.parentId=="string"&&e.parentId?{parentId:e.parentId}:{},...YFt(e.resourceIcon)?{resourceIcon:e.resourceIcon}:{}}},KFt=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;const e=t;return typeof e.id!="string"||!e.id||typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!c0e.includes(e.kind)||e.bidirectional!==void 0&&typeof e.bidirectional!="boolean"?null:{id:e.id,source:e.source,target:e.target,...typeof e.label=="string"&&e.label?{label:e.label}:{},...c0e.includes(e.kind)?{kind:e.kind}:{},...typeof e.bidirectional=="boolean"?{bidirectional:e.bidirectional}:{}}},ZFt=t=>{var r,n;const e=(n=(r=t==null?void 0:t.match(yMe))==null?void 0:r[1])==null?void 0:n.replace(/\s+/g,"");if(!e||!/^[A-Za-z0-9_-]+$/.test(e))return null;try{const i=JSON.parse(WFt(e));if(!qFt.includes(i.kind))return null;const a=i.kind==="architecture";if((a?i.schemaVersion!==_Ft:i.schemaVersion!==OFt)||!Array.isArray(i.nodes)||!Array.isArray(i.edges))return null;const s=$Ft.includes(i.theme)?i.theme:void 0,o=zFt.includes(i.structure)?i.structure:void 0,l=i.nodes.map(XFt),u=i.edges.map(KFt);if(l.some(f=>!f)||u.some(f=>!f))return null;const h=new Set(l.map(f=>f.id)),d=new Map(l.map(f=>[f.id,f]));if(h.size!==l.length||l.some(f=>f.parentId&&(f.parentId===f.id||!h.has(f.parentId)))||u.some(f=>!h.has(f.source)||!h.has(f.target)))return null;if(a){if(l.some(f=>f.shape==="topic"||f.shape==="process"||f.shape==="decision"||f.shape==="terminator")||l.some(f=>{var p;return f.parentId&&((p=d.get(f.parentId))==null?void 0:p.shape)!=="boundary"})||u.some(f=>{var p,g;return((p=d.get(f.source))==null?void 0:p.shape)==="boundary"||((g=d.get(f.target))==null?void 0:g.shape)==="boundary"}))return null}else if(l.some(f=>!["topic","process","decision","terminator"].includes(f.shape)))return null;return{schemaVersion:i.schemaVersion,kind:i.kind,...s?{theme:s}:{},...i.kind==="mind-map"&&o?{structure:o}:{},nodes:l,edges:u}}catch{return null}},JFt=t=>(t??"").replace(yMe,"").trimEnd(),QFt=1e5;Ct({prompt:$e().trim().min(1).max(1e3),locale:$e().trim().min(2).max(35).optional(),currentTemplate:$e().regex(/^[a-z0-9-]+$/).max(120).optional(),currentContent:$e().max(QFt).default(""),candidates:Tn($e().regex(/^[a-z0-9-]+$/).max(120)).min(1).max(50),history:Tn(Ct({prompt:$e().max(1e3),response:$e().max(2e3)})).max(12).default([])});const bMe={plain:{id:"plain",group:"classic",colors:["#707070","#8A8A8A","#A3A3A3","#BDBDBD","#D4D4D4","#FFFFFF"],accent:"#707070"},brand:{id:"brand",group:"classic",colors:["#16A06E","#059669","#0D9488","#10B981","#047857","#065F46"],accent:"#16A06E"},cosmos:{id:"cosmos",group:"classic",colors:["#2563EB","#0284C7","#4F46E5","#0D9488","#3B82F6","#1D4ED8"],accent:"#2563EB"},dune:{id:"dune",group:"classic",colors:["#C2410C","#D97706","#B45309","#A16207","#78350F","#9A3412"],accent:"#B45309"},slate:{id:"slate",group:"classic",colors:["#475569","#52525B","#4B5563","#334155","#64748B","#1E293B"],accent:"#475569"},prism:{id:"prism",group:"vivid",colors:["#E11D48","#EA580C","#D97706","#059669","#2563EB","#7C3AED"],accent:"#6366F1"},sunrise:{id:"sunrise",group:"vivid",colors:["#E11D48","#F97316","#F59E0B","#D97706","#DC2626","#EA580C"],accent:"#EA580C"},marine:{id:"marine",group:"vivid",colors:["#0284C7","#06B6D4","#0D9488","#2563EB","#0891B2","#1D4ED8"],accent:"#0284C7"},blossom:{id:"blossom",group:"vivid",colors:["#DB2777","#C026D3","#9333EA","#E11D48","#BE185D","#7C3AED"],accent:"#DB2777"},mint:{id:"mint",group:"vivid",colors:["#0D9488","#059669","#10B981","#0891B2","#16A34A","#047857"],accent:"#0D9488"},macaron:{id:"macaron",group:"vivid",colors:["#EC4899","#FB923C","#EAB308","#10B981","#38BDF8","#8B5CF6"],accent:"#EC4899"}},ezt=Object.fromEntries(Object.entries(bMe).map(([t,e])=>[t,{id:e.id,group:e.group,colors:e.colors}])),bq=t=>{const e=t.replace("#","");return[Number.parseInt(e.slice(0,2),16),Number.parseInt(e.slice(2,4),16),Number.parseInt(e.slice(4,6),16)]},tzt=(t,e,r)=>`#${[t,e,r].map(n=>Math.round(Math.min(255,Math.max(0,n))).toString(16).padStart(2,"0")).join("")}`,xl=(t,e,r)=>{const n=bq(t),i=bq(e);return tzt(n[0]+(i[0]-n[0])*r,n[1]+(i[1]-n[1])*r,n[2]+(i[2]-n[2])*r)},rzt=t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4},vMe=t=>{const[e,r,n]=bq(t).map(rzt);return e*.2126+r*.7152+n*.0722},vq=t=>vMe(t)>.35?"#1C1917":"#FFFCF8",nzt=t=>ezt[Yee(t)].colors,izt=t=>{const e=Yee(t);return e!=="brand"&&e!=="plain"},xq=(t,e)=>{const r=vMe(t);return e==="dark"?r<.22?xl(t,"#FFFFFF",Math.max(.35,(.3-r)*1.6)):t:r>.26?xl(t,"#18181B",Math.max(.24,(r-.2)*.9)):t},azt=(t,e)=>nzt(t).map(n=>{const i=xq(n,e),a=e==="dark"?xl(n,"#121518",.72):xl(n,"#FFFFFF",.84);return{fill:a,stroke:e==="dark"?xl(i,"#FFFFFF",.15):xl(i,"#1C1917",.12),text:vq(a),edge:i}}),szt=(t,e)=>{const r=Yee(t),n=bMe[r],i=n.accent;if(r==="plain")return e==="dark"?{topicFill:"#F5F5F5",topicText:"#212121",nodeFill:"#1C1C1C",nodeText:"#F4F4F5",nodeStroke:"#3A3A3A",topicStroke:"#F5F5F5",mindMapEdge:"#A3A3A3",flowEdge:"#A3A3A3",canvas:bl}:{topicFill:"#707070",topicText:"#FFFFFF",nodeFill:"#FFFFFF",nodeText:"#212121",nodeStroke:"#D4D4D4",topicStroke:"#707070",mindMapEdge:"#737373",flowEdge:"#737373",canvas:yl};if(r==="brand")return e==="dark"?{topicFill:"#16A06E",topicText:"#F4FFF9",nodeFill:"#18211D",nodeText:"#E8F2ED",nodeStroke:"#3B5248",topicStroke:"#58CDA4",mindMapEdge:"#4DB58B",flowEdge:"#72B99B",canvas:bl}:{topicFill:"#16A06E",topicText:"#FFFFFF",nodeFill:"#F0F8F4",nodeText:"#173B2E",nodeStroke:"#B8DFD0",topicStroke:"#12845B",mindMapEdge:"#55B891",flowEdge:"#408A6D",canvas:yl};if(e==="dark"){const s=xq(i,"dark");return{topicFill:i,topicText:vq(i),nodeFill:xl(i,"#101418",.78),nodeText:"#E8EEF2",nodeStroke:xl(s,"#FFFFFF",.15),topicStroke:xl(i,"#FFFFFF",.25),mindMapEdge:s,flowEdge:xl(i,"#FFFFFF",.15),canvas:bl}}const a=xq(i,"light");return{topicFill:i,topicText:vq(i),nodeFill:xl(i,"#FFFFFF",.88),nodeText:xl(n.colors[n.colors.length-1],"#1C1917",.35),nodeStroke:xl(a,"#FFFFFF",.5),topicStroke:xl(i,"#1C1917",.15),mindMapEdge:a,flowEdge:xl(i,"#1C1917",.15),canvas:yl}},Xee=t=>Array.from(t).reduce((e,r)=>e+(/[^\u0000-\u00ff]/.test(r)?1:.55),0),ozt=t=>t==="decision"?{width:176,height:80}:t==="terminator"?{width:140,height:44}:{width:176,height:56},lzt=13,czt=18,u0e=.7,uzt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const a of Array.from(r))i&&Xee(i+a)>e&&(n.push(i),i=""),i+=a;return n.push(i),n}),hzt=(t,e)=>{const r=ozt(t),n=t==="decision",i=t==="terminator",a=i?36:28,s=r.width,o=Math.max(4,(n?s*u0e:s-a)/lzt),l=uzt(e,o),u=Math.max(l.length,1)*czt,h=Math.max(r.height,n?Math.ceil(u/(1-u0e)):u+(i?16:18));return{width:s,height:h,text:l.join(` +`)}},xMe="edgeever-mindmap",h0e='Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',dzt=10,fzt=14,Kee=t=>t==="logic"?"logic":t==="brace"?"brace":t==="org"?"org":t==="tree"?"tree":t==="timeline"?"timeline":t==="fishbone"?"fishbone":"map",pzt=t=>{const e=Kee(t);return e==="map"||e==="logic"},t9=(t,e)=>t==="root"?!1:e==="line"||e==="brace"?!0:e==="map"||e==="tree"||e==="timeline"||e==="fishbone"||!e?t==="nested":!1,Zee=(t,e="primary")=>t9(e,t)?"underline":t==="capsule"?"capsule":t==="ellipse"?"ellipse":t==="circle"?"circle":t==="hexagon"?"hexagon":t==="box"||t==="logic"||t==="org"?"rounded":e==="root"?"capsule":"rounded",gzt=(t,e="primary")=>{const r=Zee(t,e);return[r==="ellipse"||r==="circle"?{tagName:"ellipse",selector:"body"}:r==="diamond"||r==="hexagon"?{tagName:"polygon",selector:"body"}:r==="cloud"?{tagName:"path",selector:"body"}:{tagName:"rect",selector:"body"},{tagName:"path",selector:"underline"},{tagName:"text",selector:"label"}]},mzt={light:[{fill:"#E7F6EF",stroke:"#0F8A5C",text:"#145C40",edge:"#16A06E"},{fill:"#E7F0FE",stroke:"#2563EB",text:"#1E3A8A",edge:"#3B82F6"},{fill:"#F3E8FF",stroke:"#7C3AED",text:"#5B21B6",edge:"#8B5CF6"},{fill:"#FEF3C7",stroke:"#D97706",text:"#92400E",edge:"#F59E0B"},{fill:"#FCE7F3",stroke:"#DB2777",text:"#9D174D",edge:"#EC4899"},{fill:"#CFFAFE",stroke:"#0E7490",text:"#155E75",edge:"#06B6D4"}],dark:[{fill:"#1A2A22",stroke:"#4DB58B",text:"#D7F4E8",edge:"#4DB58B"},{fill:"#1A2438",stroke:"#60A5FA",text:"#DBEAFE",edge:"#60A5FA"},{fill:"#251B38",stroke:"#A78BFA",text:"#EDE9FE",edge:"#A78BFA"},{fill:"#2A2114",stroke:"#FBBF24",text:"#FEF3C7",edge:"#FBBF24"},{fill:"#2A1520",stroke:"#F472B6",text:"#FCE7F3",edge:"#F472B6"},{fill:"#15252B",stroke:"#22D3EE",text:"#CFFAFE",edge:"#22D3EE"}]},Uzt=(t,e)=>t.split(` +`).flatMap(r=>{const n=[];let i="";for(const a of Array.from(r))i&&Xee(i+a)>e&&(n.push(i),i=""),i+=a;return n.push(i),n}),rr=t=>(Math.round(t*100)/100).toFixed(2),yzt=t=>izt(t),eM=(t,e)=>{const r=new Map(t.map(a=>[a.id,a])),n=r.get(e);if(!(n!=null&&n.parentId))return"root";const i=r.get(n.parentId);return i!=null&&i.parentId?"nested":"primary"},bzt=(t,e)=>{const r=new Map(t.map(u=>[u.id,u])),n=r.get(e);if(!(n!=null&&n.parentId))return null;let i=n,a=n;const s=new Set;for(;a.parentId&&r.has(a.parentId)&&!s.has(a.id);){s.add(a.id);const u=r.get(a.parentId);if(!u)break;if(!u.parentId){i=a;break}a=u,i=a}const l=t.filter(u=>u.parentId===i.parentId).sort((u,h)=>(u.y??0)-(h.y??0)||(u.x??0)-(h.x??0)||u.id.localeCompare(h.id)).findIndex(u=>u.id===i.id);return l<0?0:l},vzt=(t,e,r)=>{if(t==null)return;const n=r?azt(r,e):mzt[e];return n[t%n.length]},xzt=(t,e="primary",r)=>{const n=e==="root",i=t9(e,r),a=Zee(r,e),s=n?36:i?22:a==="diamond"||a==="hexagon"||a==="circle"?36:28,o=Math.round(Math.min(n?180:a==="circle"?132:168,Math.max(n?124:i?88:a==="circle"?108:96,Xee(t)*13+s))),l=n?46:i?32:a==="circle"?Math.max(40,o-24):36;return{width:o,height:l}},wzt=(t,e,r)=>{const n=xzt(t,e,r),i=t9(e,r),a=e==="root"?20:18,s=e==="root"?36:i?22:28,o=Uzt(t,Math.max(4,(n.width-s)/13));return{...n,height:Math.max(n.height,o.length*a+(e==="root"?18:i?10:14)),text:o.join(` +`),fontSize:e==="root"?15:e==="primary"?14:13}},Tzt=t=>Math.round(Math.max(1,t/2)),Czt=(t,e)=>`M 1 ${rr(Math.max(2,e-2))} H ${rr(Math.max(2,t-1))}`,kzt=(t,e)=>{const r=Math.max(t,12),n=Math.max(e,12);return[`M ${rr(r*.18)} ${rr(n*.62)}`,`Q ${rr(r*.06)} ${rr(n*.6)} ${rr(r*.08)} ${rr(n*.44)}`,`Q ${rr(r*.02)} ${rr(n*.26)} ${rr(r*.22)} ${rr(n*.24)}`,`Q ${rr(r*.3)} ${rr(n*.06)} ${rr(r*.48)} ${rr(n*.14)}`,`Q ${rr(r*.6)} ${rr(n*.02)} ${rr(r*.72)} ${rr(n*.16)}`,`Q ${rr(r*.96)} ${rr(n*.14)} ${rr(r*.92)} ${rr(n*.4)}`,`Q ${rr(r*1.02)} ${rr(n*.56)} ${rr(r*.84)} ${rr(n*.64)}`,`Q ${rr(r*.8)} ${rr(n*.84)} ${rr(r*.58)} ${rr(n*.78)}`,`Q ${rr(r*.42)} ${rr(n*.92)} ${rr(r*.3)} ${rr(n*.76)}`,`Q ${rr(r*.12)} ${rr(n*.82)} ${rr(r*.18)} ${rr(n*.62)}`,"Z"].join(" ")},Szt=(t,e,r,n)=>t==="ellipse"||t==="circle"?{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}:t==="diamond"?{refPoints:"5,0 10,5 5,10 0,5"}:t==="hexagon"?{refPoints:"2.5,0 7.5,0 10,5 7.5,10 2.5,10 0,5"}:t==="cloud"?{d:kzt(e,r)}:{rx:n,ry:n},Ezt=(t,e,r={})=>{const n=r.underline??t9(t,r.structure),i=r.width??96,a=r.height??(t==="root"?46:n?32:36),s=r.tint,o=Zee(r.structure,t);if(n){const h=(s==null?void 0:s.edge)??e.mindMapEdge;return{body:{fill:"transparent",stroke:"none",strokeWidth:0,rx:0,ry:0},label:{fill:(s==null?void 0:s.text)??e.nodeText,fontSize:t==="primary"?14:13,fontWeight:t==="primary"?650:500,fontFamily:h0e,lineHeight:18,refX:"50%",refY:a-6,textAnchor:"middle",textVerticalAnchor:"bottom"},underline:{d:Czt(i,a),stroke:h,strokeWidth:1.8,fill:"none",strokeLinecap:"round",pointerEvents:"none"}}}const l=t==="root",u=o==="capsule"||l&&o==="rounded"?Tzt(a):o==="rect"?2:l?12:t==="nested"?8:10;return{body:{fill:l?e.topicFill:(s==null?void 0:s.fill)??(t==="nested"?e.canvas:e.nodeFill),stroke:l?e.topicStroke:(s==null?void 0:s.stroke)??(t==="nested"?e.nodeStroke:e.topicStroke),strokeWidth:t==="nested"&&!l?1:1.5,...Szt(o,i,a,u)},label:{fill:l?e.topicText:(s==null?void 0:s.text)??e.nodeText,fontSize:l?15:t==="primary"?14:13,fontWeight:l||t==="primary"?650:500,fontFamily:h0e,lineHeight:l?20:18,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},underline:{d:"",stroke:"none",fill:"none"}}},d0e=(t,e,r,n,i,a,s)=>{const o=eM(t,e),l=t9(o,s),u=yzt(n)?vzt(bzt(t,e),i,n):void 0;return{role:o,underline:l,tint:u,visual:Ezt(o,r,{tint:u,underline:l,structure:s,width:a.width,height:a.height})}},Azt=(t,e,r)=>{const n=(r==null?void 0:r.edge)??e.mindMapEdge;return t==="root"?{stroke:n,sourceWidth:3.1,targetWidth:1.55}:t==="primary"?{stroke:n,sourceWidth:1.85,targetWidth:1.15}:{stroke:n,sourceWidth:1.25,targetWidth:.9}},Mzt=(t,e,r)=>{const n=Kee(r),i=t.x+t.width/2,a=e.x+e.width/2,s=t.y+t.height/2,o=e.y+e.height/2;return n==="org"?{source:"bottom",target:"top"}:n==="fishbone"?as+8?{source:"bottom",target:"top"}:{source:"left",target:"right"}:n==="timeline"?o=i?"right":"left",target:"bottom"}:o>s+8?{source:a>=i?"right":"left",target:"top"}:a>=i?{source:"right",target:"left"}:{source:"left",target:"right"}:a>=i?{source:"right",target:"left"}:{source:"left",target:"right"}},f0e=(t,e,r,n)=>{const i=t9(e,n),a=i&&(r==="left"||r==="right")?t.height/2-2:0;return{anchor:{name:r,...a?{args:{dy:a}}:{}},connectionPoint:{name:i?"anchor":"boundary"}}},Rzt=(t,e)=>{const r=t.filter(i=>i.parentId===e);if(r.length===0)return null;const n=r.map(i=>i.y+i.height/2);return{top:Math.min(...n),bottom:Math.max(...n)}},p0e=(t,e)=>pzt(t)?{fill:e,strokeWidth:.5,strokeLinejoin:"round",strokeLinecap:"round"}:{fill:"none",strokeWidth:1.7,strokeLinejoin:"round",strokeLinecap:"round"},Lzt=(t,e,r,n,i)=>{const a=1-i;return{x:a*a*a*t.x+3*a*a*i*e.x+3*a*i*i*r.x+i*i*i*n.x,y:a*a*a*t.y+3*a*a*i*e.y+3*a*i*i*r.y+i*i*i*n.y}},Izt=(t,e,r,n,i)=>{const a=1-i;return{x:3*a*a*(e.x-t.x)+6*a*i*(r.x-e.x)+3*i*i*(n.x-r.x),y:3*a*a*(e.y-t.y)+6*a*i*(r.y-e.y)+3*i*i*(n.y-r.y)}},Nzt=(t,e,r=2.4,n=1.15)=>{const i=e.x-t.x,a=e.y-t.y;if(Math.abs(i)<.01&&Math.abs(a)<.01)return`M ${rr(t.x)} ${rr(t.y)} L ${rr(e.x)} ${rr(e.y)}`;const s=(t.x+e.x)/2,o=t,l={x:s,y:t.y},u={x:s,y:e.y},h=e,d=20,f=[],p=[];for(let U=0;U<=d;U+=1){const y=U/d,b=Lzt(o,l,u,h,y),v=Izt(o,l,u,h,y),w=Math.hypot(v.x,v.y)||1,T=((1-y)*r+y*n)/2,k=-v.y/w,C=v.x/w;f.push({x:b.x+k*T,y:b.y+C*T}),p.push({x:b.x-k*T,y:b.y-C*T})}const g=f[0],m=[`M ${rr(g.x)} ${rr(g.y)}`];for(let U=1;U=0;U-=1)m.push(`L ${rr(p[U].x)} ${rr(p[U].y)}`);return m.push("Z"),m.join(" ")},Dzt=t=>`${rr(t.x)} ${rr(t.y)}`,Zd=t=>t.map((e,r)=>`${r===0?"M":"L"} ${Dzt(e)}`).join(" "),Ozt=(t,e,r)=>{if(Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8)return Zd([t,e]);const n={x:t.x,y:(t.y+e.y)/2},i={x:e.x,y:n.y};return Zd([t,n,i,e])},_zt=(t,e)=>{const r=t.x+Math.max(10,Math.min(28,Math.abs(e.x-t.x)*.38));return Math.abs(t.y-e.y)<.8?Zd([t,e]):Zd([t,{x:r,y:t.y},{x:r,y:e.y},e])},Pzt=(t,e,r,n)=>{const i=Math.min(r??t.y,n??t.y,t.y,e.y),a=Math.max(r??t.y,n??t.y,t.y,e.y),s=Math.max(18,a-i),o=(i+a)/2-s/2,l=o+s,u=(o+l)/2,h=9,d=t.x+Math.max(18,Math.min(36,Math.abs(e.x-t.x)*.42));return[Zd([t,{x:d-h,y:t.y}]),`M ${rr(d-h)} ${rr(o)}`,`C ${rr(d)} ${rr(o)} ${rr(d)} ${rr(o)} ${rr(d)} ${rr((o+u)/2)}`,`C ${rr(d)} ${rr(u)} ${rr(d+h)} ${rr(u)} ${rr(d+h)} ${rr(u)}`,`C ${rr(d)} ${rr(u)} ${rr(d)} ${rr(u)} ${rr(d)} ${rr((u+l)/2)}`,`C ${rr(d)} ${rr(l)} ${rr(d)} ${rr(l)} ${rr(d-h)} ${rr(l)}`,Zd([{x:d,y:e.y},e])].join(" ")},Bzt=(t,e)=>Math.abs(t.x-e.x)<.8||Math.abs(t.y-e.y)<.8?Zd([t,e]):Zd([t,{x:e.x,y:t.y},e]),$zt=(t,e)=>{if(Math.abs(t.y-e.y)<.8||Math.abs(t.x-e.x)<.8)return Zd([t,e]);const r=Math.abs(e.y-t.y),n=t.x>=e.x?1:-1,i=e.x+n*Math.max(18,r/Math.sqrt(3)),a={x:n>0?Math.min(t.x,i):Math.max(t.x,i),y:t.y};return Zd([t,a,e])},Fzt=(t,e,r,n={})=>{const i=Kee(n.structure);return i==="org"?Ozt(t,e):i==="tree"?_zt(t,e):i==="brace"?Pzt(t,e,n.braceTop,n.braceBottom):i==="timeline"?Bzt(t,e):i==="fishbone"?$zt(t,e):Nzt(t,e,n.sourceWidth,n.targetWidth)},zzt=(t,e="light")=>szt(t,e),Vzt=(t,e)=>{const r=zzt(t.kind==="architecture"?t.theme??"brand":t.theme,e),n=t.kind==="flowchart"?UMe(e,t.theme):null,i=t.kind==="architecture"?QO(e):null,a=t.nodes.map(h=>{const d=t.kind==="mind-map"?eM(t.nodes,h.id):null,f=t.kind==="flowchart"?hzt(h.shape,h.label):d?wzt(h.label,d,t.structure):{width:h.width,height:h.height,text:h.label},p=d?d0e(t.nodes,h.id,r,t.theme,e,f,t.structure):null,g=(p==null?void 0:p.visual)??null,m=t.kind==="flowchart"?DFt(h.shape,e,f,t.theme):null,U=t.kind==="architecture"?xFt(h.shape,e,f,h.resourceIcon):null,y=h.shape==="topic"&&!h.parentId,b=h.shape==="terminator",v=h.shape==="boundary",w=y||b,T=g?g.body.fill:m?m.body.fill:U?U.body.fill:w?r.topicFill:r.nodeFill,k=g?g.body.stroke:m?m.body.stroke:U?U.body.stroke:w?r.topicStroke:r.nodeStroke;return{id:h.id,shape:h.shape==="decision"?"polygon":"rect",x:h.x,y:h.y,width:f.width,height:f.height,zIndex:v?0:2,...U?{markup:U.markup}:d?{markup:gzt(t.structure,d)}:{},attrs:{body:{strokeDasharray:(U==null?void 0:U.body.strokeDasharray)??(v?"7 5":void 0),...(g==null?void 0:g.body)??(m==null?void 0:m.body)??(U==null?void 0:U.body)??{rx:b?24:11,ry:b?24:11},fill:T,stroke:k,strokeWidth:(g==null?void 0:g.body.strokeWidth)??(m==null?void 0:m.body.strokeWidth)??(U==null?void 0:U.body.strokeWidth)??1,...h.shape==="decision"?{refPoints:"0,10 10,0 20,10 10,20"}:{}},label:{text:f.text,lineHeight:(g==null?void 0:g.label.lineHeight)??(m==null?void 0:m.label.lineHeight)??(U==null?void 0:U.label.lineHeight)??(d==="root"?20:18),fill:(g==null?void 0:g.label.fill)??(m==null?void 0:m.label.fill)??(U==null?void 0:U.label.fill)??(w?r.topicText:r.nodeText),fontSize:(g==null?void 0:g.label.fontSize)??(m==null?void 0:m.label.fontSize)??(U==null?void 0:U.label.fontSize)??(h.shape==="topic"?14:13),fontWeight:(g==null?void 0:g.label.fontWeight)??(m==null?void 0:m.label.fontWeight)??(U==null?void 0:U.label.fontWeight)??(w?650:500),fontFamily:(g==null?void 0:g.label.fontFamily)??(m==null?void 0:m.label.fontFamily)??(U==null?void 0:U.label.fontFamily)??yq,...g?{refX:g.label.refX,refY:g.label.refY,textAnchor:g.label.textAnchor,textVerticalAnchor:g.label.textVerticalAnchor}:{},...U?{refX:U.label.refX,refY:U.label.refY,textAnchor:U.label.textAnchor,textVerticalAnchor:U.label.textVerticalAnchor}:{}},...g?{underline:g.underline}:{},...(U==null?void 0:U.attrs)??{}}}}),s=new Map(a.map(h=>[h.id,h])),o=t.nodes.filter(h=>h.shape==="boundary").map(h=>h.id),l=t.kind==="architecture"?pFt(t.nodes.filter(h=>h.shape!=="boundary"),t.edges):null,u=t.edges.map(h=>{const d=h.kind??(t.kind==="architecture"?"dependency":void 0),f=s.get(h.source),p=s.get(h.target),g=t.kind==="mind-map"?eM(t.nodes,h.source):null,m=t.kind==="mind-map"?eM(t.nodes,h.target):null,U=t.kind==="mind-map"?d0e(t.nodes,h.target,r,t.theme,e,{width:96,height:36},t.structure).tint:void 0,y=g?Azt(g,r,U):null,b=f&&p?Mzt(f,p,t.structure):{source:"right",target:"left"},v=f&&g?f0e(f,g,b.source,t.structure):null,w=p&&m?f0e(p,m,b.target,t.structure):null,T=t.kind==="mind-map"&&t.structure==="brace"?Rzt(t.nodes,h.source):null,k=t.kind==="architecture"?wFt(d,e,h.bidirectional):null,C=(k==null?void 0:k.stroke)??(y==null?void 0:y.stroke)??(n==null?void 0:n.edge)??r.flowEdge,S=f&&p?t.kind==="architecture"?pMe(f,p):t.kind==="flowchart"?SFt(f,p):null:null,E=t.kind==="flowchart"&&!!(S&&f&&p&&EFt(f,p)),A=l==null?void 0:l.get(h.id);return{id:h.id,source:t.kind==="mind-map"?{cell:h.source,...v??{anchor:{name:b.source}}}:A?{cell:h.source,anchor:o0e(A.source)}:S?{cell:h.source,port:S.source}:{cell:h.source},target:t.kind==="mind-map"?{cell:h.target,...w??{anchor:{name:b.target}}}:A?{cell:h.target,anchor:o0e(A.target)}:S?{cell:h.target,port:S.target}:{cell:h.target},router:t.kind==="architecture"?fFt(h.source,h.target,o,S??void 0):t.kind==="flowchart"?E?{name:"normal"}:kFt:void 0,connector:t.kind==="mind-map"?{name:xMe,args:{sourceWidth:y==null?void 0:y.sourceWidth,targetWidth:y==null?void 0:y.targetWidth,structure:t.structure,...T?{braceTop:T.top,braceBottom:T.bottom}:{}}}:{name:"rounded",args:{radius:10}},attrs:{line:{...y?p0e(t.structure,C):{fill:"none"},stroke:C,strokeWidth:(k==null?void 0:k.strokeWidth)??(y?p0e(t.structure,C).strokeWidth:1.5),strokeDasharray:k==null?void 0:k.strokeDasharray,sourceMarker:k?k.sourceMarker:h.bidirectional?{name:"block",width:7,height:5}:null,targetMarker:t.kind==="mind-map"?null:(k==null?void 0:k.targetMarker)??{name:"block",width:7,height:5}}},labels:h.label?[{attrs:{label:{text:h.label,fill:t.kind==="architecture"?e==="dark"?"#E2E8F0":"#334155":t.kind==="flowchart"?e==="dark"?"#E2E8F0":"#475569":(n==null?void 0:n.process.text)??(i==null?void 0:i.nodes.service.text)??r.nodeText,fontSize:t.kind==="architecture"?uFt:t.kind==="flowchart"?TFt:dzt,fontWeight:t.kind==="architecture"||t.kind==="flowchart"?500:400,lineHeight:t.kind==="architecture"?hFt:t.kind==="flowchart"?CFt:fzt,fontFamily:t.kind==="architecture"?fMe:yq,textWrap:{width:140,height:512}},body:{ref:"label",refWidth:1,refHeight:1,refWidth2:t.kind==="architecture"||t.kind==="flowchart"?14:12,refHeight2:6,refX:t.kind==="architecture"||t.kind==="flowchart"?-7:-6,refY:-3,fill:t.kind==="architecture"?e==="dark"?"rgba(15, 23, 42, 0.92)":"rgba(255, 255, 255, 0.96)":t.kind==="flowchart"?e==="dark"?"rgba(24, 28, 34, 0.94)":"rgba(255, 255, 255, 0.95)":(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,stroke:t.kind==="architecture"?(k==null?void 0:k.stroke)??(e==="dark"?"rgba(148, 163, 184, 0.3)":"rgba(203, 213, 225, 0.8)"):t.kind==="flowchart"?e==="dark"?"rgba(148, 163, 184, 0.28)":"rgba(100, 116, 139, 0.24)":(n==null?void 0:n.process.stroke)??(i==null?void 0:i.nodes.service.stroke)??r.nodeStroke,strokeWidth:1,rx:6,ry:6,...t.kind==="architecture"||t.kind==="flowchart"?{style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.06))"}}:{}}}}]:void 0}});return{canvas:(n==null?void 0:n.canvas)??(i==null?void 0:i.canvas)??r.canvas,edges:u,nodes:a}};Ct({system:$e().max(8e3),prompt:$e().min(1).max(9e4),maxOutputTokens:Qt().int().min(1).optional()}).strict();Ct({url:$e().min(1).max(8192),method:nn(["GET","HEAD"]).default("GET"),headers:JO($e().max(100),$e().max(2e3)).default({})}).strict();const Hzt=(t,e)=>{const r=n=>{if(n.ctrlKey||n.metaKey||n.altKey)return;const i=n.target;if(typeof Element<"u"&&i instanceof Element&&i.closest('input, textarea, select, [contenteditable="true"]'))return;const a=n.deltaMode===1?16:n.deltaMode===2?Math.max(1,t.clientHeight):1,s=(n.shiftKey&&n.deltaX===0?n.deltaY:n.deltaX)*a,o=(n.shiftKey&&n.deltaX===0?0:n.deltaY)*a;if(!s&&!o)return;n.preventDefault(),n.stopPropagation();const l=e.translate();e.translate(l.tx-s,l.ty-o)};return t.addEventListener("wheel",r,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",r,{capture:!0})},Gzt=AFt,Wzt=2.5,qzt=28,jzt=(t,e=Gzt)=>t+1e-6>=e?"fit":"read",Yzt=t=>{if(t.nodes.length){if(t.kind==="flowchart"){const e=new Set(t.edges.map(r=>r.target));return t.nodes.find(r=>!e.has(r.id))??t.nodes[0]}if(t.kind==="architecture"){const e=t.nodes.filter(r=>r.shape!=="boundary");return[...e.length?e:t.nodes].sort((r,n)=>r.x-n.x||r.y-n.y||r.id.localeCompare(n.id))[0]}return t.nodes.find(e=>!e.parentId)??t.nodes[0]}},Xzt=(t,e,r,n=1)=>{const i=t.x+t.width/2,a=r==="flowchart"?t.y:t.y+t.height/2;return{tx:e.width/2-i*n,ty:(r==="flowchart"?32:e.height/2)-a*n}},Kzt=(t,e,r,n=.1,i=Wzt)=>e<8?t:Math.min(i,Math.max(n,t*(r/e))),g0e=(t,e)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY),Zzt=(t,e,r)=>({x:(t.clientX+e.clientX)/2-r.left,y:(t.clientY+e.clientY)/2-r.top}),Jzt=(t,e,r,n,i)=>{const a=Hzt(e,t),s=e.parentElement;s==null||s.classList.add("edgeever-diagram-reader-host");const o=()=>{t.zoomToFit({maxScale:1,padding:qzt}),t.centerContent()},l=(b,v=1)=>{t.zoomTo(v);const w=Xzt(b,{width:U,height:y},r.kind,v);t.translate(w.tx,w.ty)},u=()=>{const b=Yzt(r);b&&l(b,1)},h=()=>{e.dataset.scale=`${Math.round(t.scale().sx*100)}`};t.on("scale",h);const d=b=>{var w,T;const v=(T=(w=b==null?void 0:b.node)==null?void 0:w.getBBox)==null?void 0:T.call(w);v&&l(v,Math.max(1,t.scale().sx))};t.on("node:click",d);let f=null;const p=b=>{var v;b.touches.length===2&&(f={distance:g0e(b.touches[0],b.touches[1]),scale:t.scale().sx},(v=t.disablePanning)==null||v.call(t))},g=b=>{if(!f||b.touches.length!==2)return;b.preventDefault(),b.stopPropagation();const v=Kzt(f.scale,f.distance,g0e(b.touches[0],b.touches[1]));t.zoomTo(v,{center:Zzt(b.touches[0],b.touches[1],e.getBoundingClientRect())})},m=b=>{var v;b.touches.length<2&&(f=null,(v=t.enablePanning)==null||v.call(t))};e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",g,{capture:!0,passive:!1}),e.addEventListener("touchend",m),e.addEventListener("touchcancel",m);let U=0,y=0;return{resize(b,v){if(b===U&&v===y)return;const w=U===0,T=t.translate(),k=(b-U)/2,C=(v-y)/2,S=w||y<80&&v>=160;U=b,y=v,t.resize(U,y),S?(o(),jzt(t.scale().sx)==="read"&&u()):t.translate(T.tx+k,T.ty+C),h()},dispose(){var b;a(),t.off("scale",h),t.off("node:click",d),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",g,!0),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m),(b=t.enablePanning)==null||b.call(t),s==null||s.classList.remove("edgeever-diagram-reader-host"),delete e.dataset.scale}}},e4=$e().regex(/^#[0-9a-f]{6}$/i),wMe=Ct({kind:nn(["linear","radial"]),from:e4,to:e4,angle:Qt().finite().min(-360).max(360).default(90)}),r9=$e().max(80).regex(/^(?:#[0-9a-f]{3,8}|rgba?\([\d.,\s]+\)|transparent)$/i),Qzt=Ct({color:r9,blur:Qt().min(0).max(300),offsetX:Qt().min(-300).max(300),offsetY:Qt().min(-300).max(300)}),OT=$e().min(1).max(160).regex(/^[\w-]+$/),eVt=Tn(Ct({offset:Qt().min(0).max(1),color:r9,opacity:Qt().min(0).max(1).optional()})).min(2).max(16),TMe=Ct({kind:nn(["linear","radial"]),from:e4,to:e4,angle:Qt().finite().default(90),stops:eVt.optional(),coords:Ct({x1:Qt().finite(),y1:Qt().finite(),x2:Qt().finite(),y2:Qt().finite(),r1:Qt().finite().optional(),r2:Qt().finite().optional()}).optional()}),e_={id:OT,name:$e().max(120),role:nn(["title","subtitle","badge","decor"]).optional(),visible:cn().optional(),imagePlaceholder:cn().optional(),flipX:cn().optional(),flipY:cn().optional(),stroke:r9.optional(),strokeWidth:Qt().min(0).max(1024).optional(),shadow:Qzt.optional(),gradient:TMe.optional(),groupId:OT.optional(),x:Qt().finite().min(-8192).max(8192),y:Qt().finite().min(-8192).max(8192),width:Qt().finite().min(1).max(8192),height:Qt().finite().min(1).max(8192),rotation:Qt().finite().min(-360).max(360).default(0),opacity:Qt().min(0).max(1).default(1),locked:cn().optional()},tVt=Ct({...e_,type:Wn("text"),text:$e().max(8e3),fill:r9,fontSize:Qt().min(4).max(8192),fontFamily:$e().min(1).max(100).regex(/^[\w\s\-\u3400-\u9fff]+$/),fontStyle:nn(["normal","italic"]).optional(),underline:cn().optional(),lineHeight:Qt().min(.5).max(3).optional(),charSpacing:Qt().min(-300).max(1e3).optional(),sourceText:$e().max(8e3).optional(),badge:Ct({background:e4,padX:Qt().min(0).max(3),padY:Qt().min(0).max(3),radius:Qt().min(0).max(1)}).optional(),fontWeight:nn(["normal","bold"]),textAlign:nn(["left","center","right"])}),rVt=Ct({...e_,type:nn(["rect","ellipse"]),fill:r9,radius:Qt().min(0).max(4096).optional()}),nVt=Ct({...e_,type:Wn("image"),resourceId:OT,crop:Ct({x:Qt().min(0).max(1),y:Qt().min(0).max(1),width:Qt().min(.01).max(1),height:Qt().min(.01).max(1)}).optional()}),iVt=Ct({...e_,type:Wn("path"),fill:r9,path:$e().min(1).max(1e5).regex(/^[MmLlHhVvCcSsQqTtAaZz\d\s,.eE+\-]+$/)}),Y3=Eg([tVt,rVt,nVt,iVt]);Ct({schemaVersion:Wn(1),width:Qt().int().min(320).max(4096),height:Qt().int().min(320).max(4096),background:e4,backgroundGradient:wMe.optional(),elements:Tn(Y3).max(500),copy:Ct({title:$e().max(8e3),subtitle:$e().max(8e3),badge:$e().max(8e3)}).optional(),templateId:$e().max(80).optional(),platformId:$e().max(80).optional(),sourceMemoId:OT.optional(),previewResourceId:OT.optional()}).superRefine((t,e)=>{new Set(t.elements.map(r=>r.id)).size!==t.elements.length&&e.addIssue({code:"custom",message:"Element IDs must be unique"})});const CMe=["editorial","bold","quote","minimal"];Ct({notebookId:$e().min(1),title:$e().min(1).max(160),heading:$e().trim().min(1).max(80),subtitle:$e().max(240).default(""),template:nn(CMe).default("editorial"),format:nn(["portrait","square","wechat","video","story"]).default("portrait"),badge:$e().trim().max(24).default(""),footer:$e().trim().max(100).default(""),layout:nn(["auto","grid","list"]).default("auto"),sections:Tn(Ct({heading:$e().trim().min(1).max(32),body:$e().trim().min(1).max(120)}).strict()).min(2).max(6).optional(),tags:Tn($e()).max(100).optional()}).strict();const aVt=Ct({name:$e().max(120).optional(),role:nn(["title","subtitle","badge","decor"]).optional(),visible:cn().optional(),flipX:cn().optional(),flipY:cn().optional(),stroke:$e().max(80).regex(/^(?:#[0-9a-f]{3,8}|rgba?\([\d.,\s]+\)|transparent)$/i).optional(),strokeWidth:Qt().min(0).max(1024).optional(),shadow:Ct({color:$e().max(80).regex(/^(?:#[0-9a-f]{3,8}|rgba?\([\d.,\s]+\)|transparent)$/i),blur:Qt().min(0).max(300),offsetX:Qt().min(-300).max(300),offsetY:Qt().min(-300).max(300)}).strict().nullable().optional(),gradient:TMe.nullable().optional(),fontFamily:$e().min(1).max(100).regex(/^[\w\s\-\u3400-\u9fff]+$/).optional(),fontStyle:nn(["normal","italic"]).optional(),underline:cn().optional(),lineHeight:Qt().min(.5).max(3).optional(),charSpacing:Qt().min(-300).max(1e3).optional(),badge:Ct({background:$e().regex(/^#[0-9a-f]{6}$/i),padX:Qt().min(0).max(3),padY:Qt().min(0).max(3),radius:Qt().min(0).max(1)}).strict().nullable().optional(),radius:Qt().min(0).max(4096).optional(),resourceId:$e().min(1).max(160).regex(/^[\w-]+$/).optional(),crop:Ct({x:Qt().min(0).max(1),y:Qt().min(0).max(1),width:Qt().min(.01).max(1),height:Qt().min(.01).max(1)}).strict().refine(t=>t.x+t.width<=1&&t.y+t.height<=1).nullable().optional(),path:$e().min(1).max(1e5).regex(/^[MmLlHhVvCcSsQqTtAaZz\d\s,.eE+\-]+$/).optional(),text:$e().max(8e3).optional(),fill:$e().regex(/^#[0-9a-f]{6}$/i).optional(),fontSize:Qt().finite().min(4).max(8192).optional(),fontWeight:nn(["normal","bold"]).optional(),textAlign:nn(["left","center","right"]).optional(),x:Qt().finite().min(-8192).max(8192).optional(),y:Qt().finite().min(-8192).max(8192).optional(),width:Qt().finite().min(1).max(8192).optional(),height:Qt().finite().min(1).max(8192).optional(),rotation:Qt().finite().min(-360).max(360).optional(),opacity:Qt().finite().min(0).max(1).optional()}).strict().refine(t=>Object.keys(t).length>0),sVt=aVt,tm=Tn($e().min(1)).min(1).max(100).refine(t=>new Set(t).size===t.length),oVt=zee("op",[Ct({op:Wn("add"),element:Eg([Y3.options[0].strict(),Y3.options[1].strict(),Y3.options[2].strict(),Y3.options[3].strict()])}).strict(),Ct({op:Wn("remove"),ids:tm}).strict(),Ct({op:Wn("duplicate"),ids:tm,dx:Qt().min(-8192).max(8192).default(24),dy:Qt().min(-8192).max(8192).default(24)}).strict(),Ct({op:Wn("reorder"),ids:tm,position:nn(["front","back","forward","backward"])}).strict(),Ct({op:Wn("group"),ids:tm}).strict(),Ct({op:Wn("ungroup"),ids:tm}).strict(),Ct({op:Wn("align"),ids:tm,alignment:nn(["left","center","right","top","middle","bottom"])}).strict(),Ct({op:Wn("lock"),ids:tm,locked:cn()}).strict(),Ct({op:Wn("apply_template"),template:nn(CMe),heading:$e().min(1).max(80).optional(),subtitle:$e().max(240).optional()}).strict()]);Ct({memoId:$e().min(1),expectedRevision:Qt().int().nonnegative(),dryRun:cn().optional(),background:$e().regex(/^#[0-9a-f]{6}$/i).optional(),backgroundGradient:wMe.nullable().optional(),canvas:Ct({width:Qt().int().min(320).max(4096),height:Qt().int().min(320).max(4096),scaleElements:cn().default(!0)}).strict().optional(),platform:$e().min(1).max(80).optional(),operations:Tn(oVt).min(1).max(100).optional(),edits:Tn(Ct({id:$e().min(1),patch:sVt}).strict()).max(100).optional()}).strict().refine(t=>{var e,r;return!!((e=t.edits)!=null&&e.length||t.background||t.backgroundGradient!==void 0||t.canvas||t.platform||(r=t.operations)!=null&&r.length)});const m0e=t=>{try{const e=t.state;t.view.updateState(vh.create({doc:e.doc,plugins:e.plugins,schema:e.schema,selection:e.selection})),t.view.dispatch(t.state.tr.setMeta("addToHistory",!1).setMeta("preventUpdate",!0))}catch{try{const e=t.state;t.view.updateState(vh.create({doc:e.doc,plugins:e.plugins,schema:e.schema}))}catch{}}};let Yt=class kMe 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(lVt,"-$1").toLowerCase(),uVt={"&":"&",">":">","<":"<",'"':""","'":"'"},hVt=/[&><"']/g,Jo=t=>String(t).replace(hVt,e=>uVt[e]),tM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?tM(t.body[0]):t:t.type==="font"?tM(t.body):t,dVt=new Set(["mathord","textord","atom"]),op=t=>dVt.has(tM(t).type),fVt=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"},wq={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 pVt(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 gVt(t){if(Object.prototype.hasOwnProperty.call(t,"default")&&t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return pVt(e)}function mVt(t,e,r,n){var i=Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0,a=Object.prototype.hasOwnProperty.call(n,"processor")?n.processor:void 0;t[e]=i!==void 0?a?a(i):i:gVt(n)}let Jee=class{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(wq)){var n=wq[r];n&&mVt(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 Yt("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=fVt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}},Ip=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 kd[UVt[this.id]]}sub(){return kd[yVt[this.id]]}fracNum(){return kd[bVt[this.id]]}fracDen(){return kd[vVt[this.id]]}cramp(){return kd[xVt[this.id]]}text(){return kd[wVt[this.id]]}isTight(){return this.size>=2}};var Qee=0,kI=1,g6=2,T0=3,_T=4,Du=5,t4=6,Dl=7,kd=[new Ip(Qee,0,!1),new Ip(kI,0,!0),new Ip(g6,1,!1),new Ip(T0,1,!0),new Ip(_T,2,!1),new Ip(Du,2,!0),new Ip(t4,3,!1),new Ip(Dl,3,!0)],UVt=[_T,Du,_T,Du,t4,Dl,t4,Dl],yVt=[Du,Du,Du,Du,Dl,Dl,Dl,Dl],bVt=[g6,T0,_T,Du,t4,Dl,t4,Dl],vVt=[T0,T0,Du,Du,Dl,Dl,Dl,Dl],xVt=[kI,kI,T0,T0,Du,Du,Dl,Dl],wVt=[Qee,kI,g6,T0,g6,T0,g6,T0],fn={DISPLAY:kd[Qee],TEXT:kd[g6],SCRIPT:kd[_T],SCRIPTSCRIPT:kd[t4]},Tq=[{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 TVt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var rM=[];Tq.forEach(t=>t.blocks.forEach(e=>rM.push(...e)));function SMe(t){for(var e=0;e=rM[e]&&t<=rM[e+1])return!0;return!1}var Ts=t=>t+" "+t,C2=80,CVt=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 @@ -2543,7 +2676,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"},rHt=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"},kVt=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+` @@ -2553,7 +2686,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"},nHt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},SVt=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 @@ -2562,7 +2695,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"},iHt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},EVt=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 @@ -2572,18 +2705,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"},sHt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},AVt=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"},aHt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},oHt=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"},MVt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},RVt=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"},lHt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=tHt(r,w2);break;case"sqrtSize1":i=rHt(r,w2);break;case"sqrtSize2":i=nHt(r,w2);break;case"sqrtSize3":i=iHt(r,w2);break;case"sqrtSize4":i=sHt(r,w2);break;case"sqrtTall":i=oHt(r,w2,n)}return i},cHt=function(e,r){switch(e){case"⎜":return Ca("M291 0 H417 V"+r+" H291z");case"∣":return Ca("M145 0 H188 V"+r+" H145z");case"∥":return Ca("M145 0 H188 V"+r+" H145z")+Ca("M367 0 H410 V"+r+" H367z");case"⎟":return Ca("M457 0 H583 V"+r+" H457z");case"⎢":return Ca("M319 0 H403 V"+r+" H319z");case"⎥":return Ca("M263 0 H347 V"+r+" H263z");case"⎪":return Ca("M384 0 H504 V"+r+" H384z");case"⏐":return Ca("M312 0 H355 V"+r+" H312z");case"‖":return Ca("M257 0 H300 V"+r+" H257z")+Ca("M478 0 H521 V"+r+" H478z");default:return""}},o0e={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},LVt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=CVt(r,C2);break;case"sqrtSize1":i=kVt(r,C2);break;case"sqrtSize2":i=SVt(r,C2);break;case"sqrtSize3":i=EVt(r,C2);break;case"sqrtSize4":i=AVt(r,C2);break;case"sqrtTall":i=RVt(r,C2,n)}return i},IVt=function(e,r){switch(e){case"⎜":return Ts("M291 0 H417 V"+r+" H291z");case"∣":return Ts("M145 0 H188 V"+r+" H145z");case"∥":return Ts("M145 0 H188 V"+r+" H145z")+Ts("M367 0 H410 V"+r+" H367z");case"⎟":return Ts("M457 0 H583 V"+r+" H457z");case"⎢":return Ts("M319 0 H403 V"+r+" H319z");case"⎥":return Ts("M263 0 H347 V"+r+" H263z");case"⎪":return Ts("M384 0 H504 V"+r+" H384z");case"⏐":return Ts("M312 0 H355 V"+r+" H312z");case"‖":return Ts("M257 0 H300 V"+r+" H257z")+Ts("M478 0 H521 V"+r+" H478z");default:return""}},U0e={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 @@ -2629,10 +2762,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ca("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ca("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ca("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ca("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Ts("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Ts("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Ts("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Ts("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ca("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Ts("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -2681,7 +2814,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ca("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ca("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ca("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Ts("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Ts("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Ts("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -2754,7 +2887,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`},uHt=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`},NVt=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 @@ -2782,14 +2915,14 @@ 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 hHt(t){return"toText"in t}let eC=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 this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(hHt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var yU={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},dHt={ex:!0,em:!0,mu:!0},p9e=function(e){return typeof e!="string"&&(e=e.unit),e in yU||e in dHt||e==="ex"},Ts=function(e,r){var n;if(e.unit in yU)n=yU[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 Yt("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"},jg=function(e){return e.filter(r=>r).join(" ")},Uee=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=zVt(n)+":"+i+";")}return r},g9e=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)}},m9e=function(e){var r=document.createElement(e);r.className=jg(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]/,y9e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Qo(jg(this.classes))+'"');var n=Uee(this.style);n&&(r+=' style="'+Qo(n)+'"');for(var i of Object.keys(this.attributes)){if(fHt.test(i))throw new Yt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Qo(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};let tC=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,this.italic=void 0,g9e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return m9e.call(this,"span")}toMarkup(){return y9e.call(this,"span")}},QD=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,g9e.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 m9e.call(this,"a")}toMarkup(){return y9e.call(this,"a")}},pHt=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.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=''+Qo(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=jg(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:"+Xt(this.italic)+";"),n+=Uee(this.style),n&&(e=!0,r+=' style="'+Qo(n)+'"');var i=Qo(this.text);return e?(r+=">",r+=i,r+="",r):i}},P0=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 of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},vU=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 of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var vHt=t=>t instanceof tC||t instanceof QD||t instanceof eC,_d={"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]}},iz={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]},l0e={Å:"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 bHt(t,e){_d[t]=e}function jee(t,e,r){if(!_d[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=_d[e][n];if(!i&&t[0]in l0e&&(n=l0e[t[0]].charCodeAt(0),i=_d[e][n]),!i&&r==="text"&&f9e(n)&&(i=_d[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var sz={};function xHt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!sz[e]){var r=sz[e]={cssEmPerMu:iz.quad[e]/18};for(var n of Object.keys(iz))r[n]=iz[n][e]}return sz[e]}var hs={math:{},text:{}};function j(t,e,r,n,i,s){hs[t][i]={font:e,group:r,replace:n},s&&n&&(hs[t][n]=hs[t][i])}var se="math",Nt="text",ve="main",Ge="ams",gs="accent-token",ur="bin",Zl="close",rC="inner",Vr="mathord",va="op-token",au="open",d7="punct",Ye="rel",op="spacing",Je="textord";j(se,ve,Ye,"≡","\\equiv",!0);j(se,ve,Ye,"≺","\\prec",!0);j(se,ve,Ye,"≻","\\succ",!0);j(se,ve,Ye,"∼","\\sim",!0);j(se,ve,Ye,"⊥","\\perp");j(se,ve,Ye,"⪯","\\preceq",!0);j(se,ve,Ye,"⪰","\\succeq",!0);j(se,ve,Ye,"≃","\\simeq",!0);j(se,ve,Ye,"∣","\\mid",!0);j(se,ve,Ye,"≪","\\ll",!0);j(se,ve,Ye,"≫","\\gg",!0);j(se,ve,Ye,"≍","\\asymp",!0);j(se,ve,Ye,"∥","\\parallel");j(se,ve,Ye,"⋈","\\bowtie",!0);j(se,ve,Ye,"⌣","\\smile",!0);j(se,ve,Ye,"⊑","\\sqsubseteq",!0);j(se,ve,Ye,"⊒","\\sqsupseteq",!0);j(se,ve,Ye,"≐","\\doteq",!0);j(se,ve,Ye,"⌢","\\frown",!0);j(se,ve,Ye,"∋","\\ni",!0);j(se,ve,Ye,"∝","\\propto",!0);j(se,ve,Ye,"⊢","\\vdash",!0);j(se,ve,Ye,"⊣","\\dashv",!0);j(se,ve,Ye,"∋","\\owns");j(se,ve,d7,".","\\ldotp");j(se,ve,d7,"⋅","\\cdotp");j(se,ve,d7,"⋅","·");j(Nt,ve,Je,"⋅","·");j(se,ve,Je,"#","\\#");j(Nt,ve,Je,"#","\\#");j(se,ve,Je,"&","\\&");j(Nt,ve,Je,"&","\\&");j(se,ve,Je,"ℵ","\\aleph",!0);j(se,ve,Je,"∀","\\forall",!0);j(se,ve,Je,"ℏ","\\hbar",!0);j(se,ve,Je,"∃","\\exists",!0);j(se,ve,Je,"∇","\\nabla",!0);j(se,ve,Je,"♭","\\flat",!0);j(se,ve,Je,"ℓ","\\ell",!0);j(se,ve,Je,"♮","\\natural",!0);j(se,ve,Je,"♣","\\clubsuit",!0);j(se,ve,Je,"℘","\\wp",!0);j(se,ve,Je,"♯","\\sharp",!0);j(se,ve,Je,"♢","\\diamondsuit",!0);j(se,ve,Je,"ℜ","\\Re",!0);j(se,ve,Je,"♡","\\heartsuit",!0);j(se,ve,Je,"ℑ","\\Im",!0);j(se,ve,Je,"♠","\\spadesuit",!0);j(se,ve,Je,"§","\\S",!0);j(Nt,ve,Je,"§","\\S");j(se,ve,Je,"¶","\\P",!0);j(Nt,ve,Je,"¶","\\P");j(se,ve,Je,"†","\\dag");j(Nt,ve,Je,"†","\\dag");j(Nt,ve,Je,"†","\\textdagger");j(se,ve,Je,"‡","\\ddag");j(Nt,ve,Je,"‡","\\ddag");j(Nt,ve,Je,"‡","\\textdaggerdbl");j(se,ve,Zl,"⎱","\\rmoustache",!0);j(se,ve,au,"⎰","\\lmoustache",!0);j(se,ve,Zl,"⟯","\\rgroup",!0);j(se,ve,au,"⟮","\\lgroup",!0);j(se,ve,ur,"∓","\\mp",!0);j(se,ve,ur,"⊖","\\ominus",!0);j(se,ve,ur,"⊎","\\uplus",!0);j(se,ve,ur,"⊓","\\sqcap",!0);j(se,ve,ur,"∗","\\ast");j(se,ve,ur,"⊔","\\sqcup",!0);j(se,ve,ur,"◯","\\bigcirc",!0);j(se,ve,ur,"∙","\\bullet",!0);j(se,ve,ur,"‡","\\ddagger");j(se,ve,ur,"≀","\\wr",!0);j(se,ve,ur,"⨿","\\amalg");j(se,ve,ur,"&","\\And");j(se,ve,Ye,"⟵","\\longleftarrow",!0);j(se,ve,Ye,"⇐","\\Leftarrow",!0);j(se,ve,Ye,"⟸","\\Longleftarrow",!0);j(se,ve,Ye,"⟶","\\longrightarrow",!0);j(se,ve,Ye,"⇒","\\Rightarrow",!0);j(se,ve,Ye,"⟹","\\Longrightarrow",!0);j(se,ve,Ye,"↔","\\leftrightarrow",!0);j(se,ve,Ye,"⟷","\\longleftrightarrow",!0);j(se,ve,Ye,"⇔","\\Leftrightarrow",!0);j(se,ve,Ye,"⟺","\\Longleftrightarrow",!0);j(se,ve,Ye,"↦","\\mapsto",!0);j(se,ve,Ye,"⟼","\\longmapsto",!0);j(se,ve,Ye,"↗","\\nearrow",!0);j(se,ve,Ye,"↩","\\hookleftarrow",!0);j(se,ve,Ye,"↪","\\hookrightarrow",!0);j(se,ve,Ye,"↘","\\searrow",!0);j(se,ve,Ye,"↼","\\leftharpoonup",!0);j(se,ve,Ye,"⇀","\\rightharpoonup",!0);j(se,ve,Ye,"↙","\\swarrow",!0);j(se,ve,Ye,"↽","\\leftharpoondown",!0);j(se,ve,Ye,"⇁","\\rightharpoondown",!0);j(se,ve,Ye,"↖","\\nwarrow",!0);j(se,ve,Ye,"⇌","\\rightleftharpoons",!0);j(se,Ge,Ye,"≮","\\nless",!0);j(se,Ge,Ye,"","\\@nleqslant");j(se,Ge,Ye,"","\\@nleqq");j(se,Ge,Ye,"⪇","\\lneq",!0);j(se,Ge,Ye,"≨","\\lneqq",!0);j(se,Ge,Ye,"","\\@lvertneqq");j(se,Ge,Ye,"⋦","\\lnsim",!0);j(se,Ge,Ye,"⪉","\\lnapprox",!0);j(se,Ge,Ye,"⊀","\\nprec",!0);j(se,Ge,Ye,"⋠","\\npreceq",!0);j(se,Ge,Ye,"⋨","\\precnsim",!0);j(se,Ge,Ye,"⪹","\\precnapprox",!0);j(se,Ge,Ye,"≁","\\nsim",!0);j(se,Ge,Ye,"","\\@nshortmid");j(se,Ge,Ye,"∤","\\nmid",!0);j(se,Ge,Ye,"⊬","\\nvdash",!0);j(se,Ge,Ye,"⊭","\\nvDash",!0);j(se,Ge,Ye,"⋪","\\ntriangleleft");j(se,Ge,Ye,"⋬","\\ntrianglelefteq",!0);j(se,Ge,Ye,"⊊","\\subsetneq",!0);j(se,Ge,Ye,"","\\@varsubsetneq");j(se,Ge,Ye,"⫋","\\subsetneqq",!0);j(se,Ge,Ye,"","\\@varsubsetneqq");j(se,Ge,Ye,"≯","\\ngtr",!0);j(se,Ge,Ye,"","\\@ngeqslant");j(se,Ge,Ye,"","\\@ngeqq");j(se,Ge,Ye,"⪈","\\gneq",!0);j(se,Ge,Ye,"≩","\\gneqq",!0);j(se,Ge,Ye,"","\\@gvertneqq");j(se,Ge,Ye,"⋧","\\gnsim",!0);j(se,Ge,Ye,"⪊","\\gnapprox",!0);j(se,Ge,Ye,"⊁","\\nsucc",!0);j(se,Ge,Ye,"⋡","\\nsucceq",!0);j(se,Ge,Ye,"⋩","\\succnsim",!0);j(se,Ge,Ye,"⪺","\\succnapprox",!0);j(se,Ge,Ye,"≆","\\ncong",!0);j(se,Ge,Ye,"","\\@nshortparallel");j(se,Ge,Ye,"∦","\\nparallel",!0);j(se,Ge,Ye,"⊯","\\nVDash",!0);j(se,Ge,Ye,"⋫","\\ntriangleright");j(se,Ge,Ye,"⋭","\\ntrianglerighteq",!0);j(se,Ge,Ye,"","\\@nsupseteqq");j(se,Ge,Ye,"⊋","\\supsetneq",!0);j(se,Ge,Ye,"","\\@varsupsetneq");j(se,Ge,Ye,"⫌","\\supsetneqq",!0);j(se,Ge,Ye,"","\\@varsupsetneqq");j(se,Ge,Ye,"⊮","\\nVdash",!0);j(se,Ge,Ye,"⪵","\\precneqq",!0);j(se,Ge,Ye,"⪶","\\succneqq",!0);j(se,Ge,Ye,"","\\@nsubseteqq");j(se,Ge,ur,"⊴","\\unlhd");j(se,Ge,ur,"⊵","\\unrhd");j(se,Ge,Ye,"↚","\\nleftarrow",!0);j(se,Ge,Ye,"↛","\\nrightarrow",!0);j(se,Ge,Ye,"⇍","\\nLeftarrow",!0);j(se,Ge,Ye,"⇏","\\nRightarrow",!0);j(se,Ge,Ye,"↮","\\nleftrightarrow",!0);j(se,Ge,Ye,"⇎","\\nLeftrightarrow",!0);j(se,Ge,Ye,"△","\\vartriangle");j(se,Ge,Je,"ℏ","\\hslash");j(se,Ge,Je,"▽","\\triangledown");j(se,Ge,Je,"◊","\\lozenge");j(se,Ge,Je,"Ⓢ","\\circledS");j(se,Ge,Je,"®","\\circledR");j(Nt,Ge,Je,"®","\\circledR");j(se,Ge,Je,"∡","\\measuredangle",!0);j(se,Ge,Je,"∄","\\nexists");j(se,Ge,Je,"℧","\\mho");j(se,Ge,Je,"Ⅎ","\\Finv",!0);j(se,Ge,Je,"⅁","\\Game",!0);j(se,Ge,Je,"‵","\\backprime");j(se,Ge,Je,"▲","\\blacktriangle");j(se,Ge,Je,"▼","\\blacktriangledown");j(se,Ge,Je,"■","\\blacksquare");j(se,Ge,Je,"⧫","\\blacklozenge");j(se,Ge,Je,"★","\\bigstar");j(se,Ge,Je,"∢","\\sphericalangle",!0);j(se,Ge,Je,"∁","\\complement",!0);j(se,Ge,Je,"ð","\\eth",!0);j(Nt,ve,Je,"ð","ð");j(se,Ge,Je,"╱","\\diagup");j(se,Ge,Je,"╲","\\diagdown");j(se,Ge,Je,"□","\\square");j(se,Ge,Je,"□","\\Box");j(se,Ge,Je,"◊","\\Diamond");j(se,Ge,Je,"¥","\\yen",!0);j(Nt,Ge,Je,"¥","\\yen",!0);j(se,Ge,Je,"✓","\\checkmark",!0);j(Nt,Ge,Je,"✓","\\checkmark");j(se,Ge,Je,"ℶ","\\beth",!0);j(se,Ge,Je,"ℸ","\\daleth",!0);j(se,Ge,Je,"ℷ","\\gimel",!0);j(se,Ge,Je,"ϝ","\\digamma",!0);j(se,Ge,Je,"ϰ","\\varkappa");j(se,Ge,au,"┌","\\@ulcorner",!0);j(se,Ge,Zl,"┐","\\@urcorner",!0);j(se,Ge,au,"└","\\@llcorner",!0);j(se,Ge,Zl,"┘","\\@lrcorner",!0);j(se,Ge,Ye,"≦","\\leqq",!0);j(se,Ge,Ye,"⩽","\\leqslant",!0);j(se,Ge,Ye,"⪕","\\eqslantless",!0);j(se,Ge,Ye,"≲","\\lesssim",!0);j(se,Ge,Ye,"⪅","\\lessapprox",!0);j(se,Ge,Ye,"≊","\\approxeq",!0);j(se,Ge,ur,"⋖","\\lessdot");j(se,Ge,Ye,"⋘","\\lll",!0);j(se,Ge,Ye,"≶","\\lessgtr",!0);j(se,Ge,Ye,"⋚","\\lesseqgtr",!0);j(se,Ge,Ye,"⪋","\\lesseqqgtr",!0);j(se,Ge,Ye,"≑","\\doteqdot");j(se,Ge,Ye,"≓","\\risingdotseq",!0);j(se,Ge,Ye,"≒","\\fallingdotseq",!0);j(se,Ge,Ye,"∽","\\backsim",!0);j(se,Ge,Ye,"⋍","\\backsimeq",!0);j(se,Ge,Ye,"⫅","\\subseteqq",!0);j(se,Ge,Ye,"⋐","\\Subset",!0);j(se,Ge,Ye,"⊏","\\sqsubset",!0);j(se,Ge,Ye,"≼","\\preccurlyeq",!0);j(se,Ge,Ye,"⋞","\\curlyeqprec",!0);j(se,Ge,Ye,"≾","\\precsim",!0);j(se,Ge,Ye,"⪷","\\precapprox",!0);j(se,Ge,Ye,"⊲","\\vartriangleleft");j(se,Ge,Ye,"⊴","\\trianglelefteq");j(se,Ge,Ye,"⊨","\\vDash",!0);j(se,Ge,Ye,"⊪","\\Vvdash",!0);j(se,Ge,Ye,"⌣","\\smallsmile");j(se,Ge,Ye,"⌢","\\smallfrown");j(se,Ge,Ye,"≏","\\bumpeq",!0);j(se,Ge,Ye,"≎","\\Bumpeq",!0);j(se,Ge,Ye,"≧","\\geqq",!0);j(se,Ge,Ye,"⩾","\\geqslant",!0);j(se,Ge,Ye,"⪖","\\eqslantgtr",!0);j(se,Ge,Ye,"≳","\\gtrsim",!0);j(se,Ge,Ye,"⪆","\\gtrapprox",!0);j(se,Ge,ur,"⋗","\\gtrdot");j(se,Ge,Ye,"⋙","\\ggg",!0);j(se,Ge,Ye,"≷","\\gtrless",!0);j(se,Ge,Ye,"⋛","\\gtreqless",!0);j(se,Ge,Ye,"⪌","\\gtreqqless",!0);j(se,Ge,Ye,"≖","\\eqcirc",!0);j(se,Ge,Ye,"≗","\\circeq",!0);j(se,Ge,Ye,"≜","\\triangleq",!0);j(se,Ge,Ye,"∼","\\thicksim");j(se,Ge,Ye,"≈","\\thickapprox");j(se,Ge,Ye,"⫆","\\supseteqq",!0);j(se,Ge,Ye,"⋑","\\Supset",!0);j(se,Ge,Ye,"⊐","\\sqsupset",!0);j(se,Ge,Ye,"≽","\\succcurlyeq",!0);j(se,Ge,Ye,"⋟","\\curlyeqsucc",!0);j(se,Ge,Ye,"≿","\\succsim",!0);j(se,Ge,Ye,"⪸","\\succapprox",!0);j(se,Ge,Ye,"⊳","\\vartriangleright");j(se,Ge,Ye,"⊵","\\trianglerighteq");j(se,Ge,Ye,"⊩","\\Vdash",!0);j(se,Ge,Ye,"∣","\\shortmid");j(se,Ge,Ye,"∥","\\shortparallel");j(se,Ge,Ye,"≬","\\between",!0);j(se,Ge,Ye,"⋔","\\pitchfork",!0);j(se,Ge,Ye,"∝","\\varpropto");j(se,Ge,Ye,"◀","\\blacktriangleleft");j(se,Ge,Ye,"∴","\\therefore",!0);j(se,Ge,Ye,"∍","\\backepsilon");j(se,Ge,Ye,"▶","\\blacktriangleright");j(se,Ge,Ye,"∵","\\because",!0);j(se,Ge,Ye,"⋘","\\llless");j(se,Ge,Ye,"⋙","\\gggtr");j(se,Ge,ur,"⊲","\\lhd");j(se,Ge,ur,"⊳","\\rhd");j(se,Ge,Ye,"≂","\\eqsim",!0);j(se,ve,Ye,"⋈","\\Join");j(se,Ge,Ye,"≑","\\Doteq",!0);j(se,Ge,ur,"∔","\\dotplus",!0);j(se,Ge,ur,"∖","\\smallsetminus");j(se,Ge,ur,"⋒","\\Cap",!0);j(se,Ge,ur,"⋓","\\Cup",!0);j(se,Ge,ur,"⩞","\\doublebarwedge",!0);j(se,Ge,ur,"⊟","\\boxminus",!0);j(se,Ge,ur,"⊞","\\boxplus",!0);j(se,Ge,ur,"⋇","\\divideontimes",!0);j(se,Ge,ur,"⋉","\\ltimes",!0);j(se,Ge,ur,"⋊","\\rtimes",!0);j(se,Ge,ur,"⋋","\\leftthreetimes",!0);j(se,Ge,ur,"⋌","\\rightthreetimes",!0);j(se,Ge,ur,"⋏","\\curlywedge",!0);j(se,Ge,ur,"⋎","\\curlyvee",!0);j(se,Ge,ur,"⊝","\\circleddash",!0);j(se,Ge,ur,"⊛","\\circledast",!0);j(se,Ge,ur,"⋅","\\centerdot");j(se,Ge,ur,"⊺","\\intercal",!0);j(se,Ge,ur,"⋒","\\doublecap");j(se,Ge,ur,"⋓","\\doublecup");j(se,Ge,ur,"⊠","\\boxtimes",!0);j(se,Ge,Ye,"⇢","\\dashrightarrow",!0);j(se,Ge,Ye,"⇠","\\dashleftarrow",!0);j(se,Ge,Ye,"⇇","\\leftleftarrows",!0);j(se,Ge,Ye,"⇆","\\leftrightarrows",!0);j(se,Ge,Ye,"⇚","\\Lleftarrow",!0);j(se,Ge,Ye,"↞","\\twoheadleftarrow",!0);j(se,Ge,Ye,"↢","\\leftarrowtail",!0);j(se,Ge,Ye,"↫","\\looparrowleft",!0);j(se,Ge,Ye,"⇋","\\leftrightharpoons",!0);j(se,Ge,Ye,"↶","\\curvearrowleft",!0);j(se,Ge,Ye,"↺","\\circlearrowleft",!0);j(se,Ge,Ye,"↰","\\Lsh",!0);j(se,Ge,Ye,"⇈","\\upuparrows",!0);j(se,Ge,Ye,"↿","\\upharpoonleft",!0);j(se,Ge,Ye,"⇃","\\downharpoonleft",!0);j(se,ve,Ye,"⊶","\\origof",!0);j(se,ve,Ye,"⊷","\\imageof",!0);j(se,Ge,Ye,"⊸","\\multimap",!0);j(se,Ge,Ye,"↭","\\leftrightsquigarrow",!0);j(se,Ge,Ye,"⇉","\\rightrightarrows",!0);j(se,Ge,Ye,"⇄","\\rightleftarrows",!0);j(se,Ge,Ye,"↠","\\twoheadrightarrow",!0);j(se,Ge,Ye,"↣","\\rightarrowtail",!0);j(se,Ge,Ye,"↬","\\looparrowright",!0);j(se,Ge,Ye,"↷","\\curvearrowright",!0);j(se,Ge,Ye,"↻","\\circlearrowright",!0);j(se,Ge,Ye,"↱","\\Rsh",!0);j(se,Ge,Ye,"⇊","\\downdownarrows",!0);j(se,Ge,Ye,"↾","\\upharpoonright",!0);j(se,Ge,Ye,"⇂","\\downharpoonright",!0);j(se,Ge,Ye,"⇝","\\rightsquigarrow",!0);j(se,Ge,Ye,"⇝","\\leadsto");j(se,Ge,Ye,"⇛","\\Rrightarrow",!0);j(se,Ge,Ye,"↾","\\restriction");j(se,ve,Je,"‘","`");j(se,ve,Je,"$","\\$");j(Nt,ve,Je,"$","\\$");j(Nt,ve,Je,"$","\\textdollar");j(se,ve,Je,"%","\\%");j(Nt,ve,Je,"%","\\%");j(se,ve,Je,"_","\\_");j(Nt,ve,Je,"_","\\_");j(Nt,ve,Je,"_","\\textunderscore");j(se,ve,Je,"∠","\\angle",!0);j(se,ve,Je,"∞","\\infty",!0);j(se,ve,Je,"′","\\prime");j(se,ve,Je,"△","\\triangle");j(se,ve,Je,"Γ","\\Gamma",!0);j(se,ve,Je,"Δ","\\Delta",!0);j(se,ve,Je,"Θ","\\Theta",!0);j(se,ve,Je,"Λ","\\Lambda",!0);j(se,ve,Je,"Ξ","\\Xi",!0);j(se,ve,Je,"Π","\\Pi",!0);j(se,ve,Je,"Σ","\\Sigma",!0);j(se,ve,Je,"Υ","\\Upsilon",!0);j(se,ve,Je,"Φ","\\Phi",!0);j(se,ve,Je,"Ψ","\\Psi",!0);j(se,ve,Je,"Ω","\\Omega",!0);j(se,ve,Je,"A","Α");j(se,ve,Je,"B","Β");j(se,ve,Je,"E","Ε");j(se,ve,Je,"Z","Ζ");j(se,ve,Je,"H","Η");j(se,ve,Je,"I","Ι");j(se,ve,Je,"K","Κ");j(se,ve,Je,"M","Μ");j(se,ve,Je,"N","Ν");j(se,ve,Je,"O","Ο");j(se,ve,Je,"P","Ρ");j(se,ve,Je,"T","Τ");j(se,ve,Je,"X","Χ");j(se,ve,Je,"¬","\\neg",!0);j(se,ve,Je,"¬","\\lnot");j(se,ve,Je,"⊤","\\top");j(se,ve,Je,"⊥","\\bot");j(se,ve,Je,"∅","\\emptyset");j(se,Ge,Je,"∅","\\varnothing");j(se,ve,Vr,"α","\\alpha",!0);j(se,ve,Vr,"β","\\beta",!0);j(se,ve,Vr,"γ","\\gamma",!0);j(se,ve,Vr,"δ","\\delta",!0);j(se,ve,Vr,"ϵ","\\epsilon",!0);j(se,ve,Vr,"ζ","\\zeta",!0);j(se,ve,Vr,"η","\\eta",!0);j(se,ve,Vr,"θ","\\theta",!0);j(se,ve,Vr,"ι","\\iota",!0);j(se,ve,Vr,"κ","\\kappa",!0);j(se,ve,Vr,"λ","\\lambda",!0);j(se,ve,Vr,"μ","\\mu",!0);j(se,ve,Vr,"ν","\\nu",!0);j(se,ve,Vr,"ξ","\\xi",!0);j(se,ve,Vr,"ο","\\omicron",!0);j(se,ve,Vr,"π","\\pi",!0);j(se,ve,Vr,"ρ","\\rho",!0);j(se,ve,Vr,"σ","\\sigma",!0);j(se,ve,Vr,"τ","\\tau",!0);j(se,ve,Vr,"υ","\\upsilon",!0);j(se,ve,Vr,"ϕ","\\phi",!0);j(se,ve,Vr,"χ","\\chi",!0);j(se,ve,Vr,"ψ","\\psi",!0);j(se,ve,Vr,"ω","\\omega",!0);j(se,ve,Vr,"ε","\\varepsilon",!0);j(se,ve,Vr,"ϑ","\\vartheta",!0);j(se,ve,Vr,"ϖ","\\varpi",!0);j(se,ve,Vr,"ϱ","\\varrho",!0);j(se,ve,Vr,"ς","\\varsigma",!0);j(se,ve,Vr,"φ","\\varphi",!0);j(se,ve,ur,"∗","*",!0);j(se,ve,ur,"+","+");j(se,ve,ur,"−","-",!0);j(se,ve,ur,"⋅","\\cdot",!0);j(se,ve,ur,"∘","\\circ",!0);j(se,ve,ur,"÷","\\div",!0);j(se,ve,ur,"±","\\pm",!0);j(se,ve,ur,"×","\\times",!0);j(se,ve,ur,"∩","\\cap",!0);j(se,ve,ur,"∪","\\cup",!0);j(se,ve,ur,"∖","\\setminus",!0);j(se,ve,ur,"∧","\\land");j(se,ve,ur,"∨","\\lor");j(se,ve,ur,"∧","\\wedge",!0);j(se,ve,ur,"∨","\\vee",!0);j(se,ve,Je,"√","\\surd");j(se,ve,au,"⟨","\\langle",!0);j(se,ve,au,"∣","\\lvert");j(se,ve,au,"∥","\\lVert");j(se,ve,Zl,"?","?");j(se,ve,Zl,"!","!");j(se,ve,Zl,"⟩","\\rangle",!0);j(se,ve,Zl,"∣","\\rvert");j(se,ve,Zl,"∥","\\rVert");j(se,ve,Ye,"=","=");j(se,ve,Ye,":",":");j(se,ve,Ye,"≈","\\approx",!0);j(se,ve,Ye,"≅","\\cong",!0);j(se,ve,Ye,"≥","\\ge");j(se,ve,Ye,"≥","\\geq",!0);j(se,ve,Ye,"←","\\gets");j(se,ve,Ye,">","\\gt",!0);j(se,ve,Ye,"∈","\\in",!0);j(se,ve,Ye,"","\\@not");j(se,ve,Ye,"⊂","\\subset",!0);j(se,ve,Ye,"⊃","\\supset",!0);j(se,ve,Ye,"⊆","\\subseteq",!0);j(se,ve,Ye,"⊇","\\supseteq",!0);j(se,Ge,Ye,"⊈","\\nsubseteq",!0);j(se,Ge,Ye,"⊉","\\nsupseteq",!0);j(se,ve,Ye,"⊨","\\models");j(se,ve,Ye,"←","\\leftarrow",!0);j(se,ve,Ye,"≤","\\le");j(se,ve,Ye,"≤","\\leq",!0);j(se,ve,Ye,"<","\\lt",!0);j(se,ve,Ye,"→","\\rightarrow",!0);j(se,ve,Ye,"→","\\to");j(se,Ge,Ye,"≱","\\ngeq",!0);j(se,Ge,Ye,"≰","\\nleq",!0);j(se,ve,op," ","\\ ");j(se,ve,op," ","\\space");j(se,ve,op," ","\\nobreakspace");j(Nt,ve,op," ","\\ ");j(Nt,ve,op," "," ");j(Nt,ve,op," ","\\space");j(Nt,ve,op," ","\\nobreakspace");j(se,ve,op,"","\\nobreak");j(se,ve,op,"","\\allowbreak");j(se,ve,d7,",",",");j(se,ve,d7,";",";");j(se,Ge,ur,"⊼","\\barwedge",!0);j(se,Ge,ur,"⊻","\\veebar",!0);j(se,ve,ur,"⊙","\\odot",!0);j(se,ve,ur,"⊕","\\oplus",!0);j(se,ve,ur,"⊗","\\otimes",!0);j(se,ve,Je,"∂","\\partial",!0);j(se,ve,ur,"⊘","\\oslash",!0);j(se,Ge,ur,"⊚","\\circledcirc",!0);j(se,Ge,ur,"⊡","\\boxdot",!0);j(se,ve,ur,"△","\\bigtriangleup");j(se,ve,ur,"▽","\\bigtriangledown");j(se,ve,ur,"†","\\dagger");j(se,ve,ur,"⋄","\\diamond");j(se,ve,ur,"⋆","\\star");j(se,ve,ur,"◃","\\triangleleft");j(se,ve,ur,"▹","\\triangleright");j(se,ve,au,"{","\\{");j(Nt,ve,Je,"{","\\{");j(Nt,ve,Je,"{","\\textbraceleft");j(se,ve,Zl,"}","\\}");j(Nt,ve,Je,"}","\\}");j(Nt,ve,Je,"}","\\textbraceright");j(se,ve,au,"{","\\lbrace");j(se,ve,Zl,"}","\\rbrace");j(se,ve,au,"[","\\lbrack",!0);j(Nt,ve,Je,"[","\\lbrack",!0);j(se,ve,Zl,"]","\\rbrack",!0);j(Nt,ve,Je,"]","\\rbrack",!0);j(se,ve,au,"(","\\lparen",!0);j(se,ve,Zl,")","\\rparen",!0);j(Nt,ve,Je,"<","\\textless",!0);j(Nt,ve,Je,">","\\textgreater",!0);j(se,ve,au,"⌊","\\lfloor",!0);j(se,ve,Zl,"⌋","\\rfloor",!0);j(se,ve,au,"⌈","\\lceil",!0);j(se,ve,Zl,"⌉","\\rceil",!0);j(se,ve,Je,"\\","\\backslash");j(se,ve,Je,"∣","|");j(se,ve,Je,"∣","\\vert");j(Nt,ve,Je,"|","\\textbar",!0);j(se,ve,Je,"∥","\\|");j(se,ve,Je,"∥","\\Vert");j(Nt,ve,Je,"∥","\\textbardbl");j(Nt,ve,Je,"~","\\textasciitilde");j(Nt,ve,Je,"\\","\\textbackslash");j(Nt,ve,Je,"^","\\textasciicircum");j(se,ve,Ye,"↑","\\uparrow",!0);j(se,ve,Ye,"⇑","\\Uparrow",!0);j(se,ve,Ye,"↓","\\downarrow",!0);j(se,ve,Ye,"⇓","\\Downarrow",!0);j(se,ve,Ye,"↕","\\updownarrow",!0);j(se,ve,Ye,"⇕","\\Updownarrow",!0);j(se,ve,va,"∐","\\coprod");j(se,ve,va,"⋁","\\bigvee");j(se,ve,va,"⋀","\\bigwedge");j(se,ve,va,"⨄","\\biguplus");j(se,ve,va,"⋂","\\bigcap");j(se,ve,va,"⋃","\\bigcup");j(se,ve,va,"∫","\\int");j(se,ve,va,"∫","\\intop");j(se,ve,va,"∬","\\iint");j(se,ve,va,"∭","\\iiint");j(se,ve,va,"∏","\\prod");j(se,ve,va,"∑","\\sum");j(se,ve,va,"⨂","\\bigotimes");j(se,ve,va,"⨁","\\bigoplus");j(se,ve,va,"⨀","\\bigodot");j(se,ve,va,"∮","\\oint");j(se,ve,va,"∯","\\oiint");j(se,ve,va,"∰","\\oiiint");j(se,ve,va,"⨆","\\bigsqcup");j(se,ve,va,"∫","\\smallint");j(Nt,ve,rC,"…","\\textellipsis");j(se,ve,rC,"…","\\mathellipsis");j(Nt,ve,rC,"…","\\ldots",!0);j(se,ve,rC,"…","\\ldots",!0);j(se,ve,rC,"⋯","\\@cdots",!0);j(se,ve,rC,"⋱","\\ddots",!0);j(se,ve,Je,"⋮","\\varvdots");j(Nt,ve,Je,"⋮","\\varvdots");j(se,ve,gs,"ˊ","\\acute");j(se,ve,gs,"ˋ","\\grave");j(se,ve,gs,"¨","\\ddot");j(se,ve,gs,"~","\\tilde");j(se,ve,gs,"ˉ","\\bar");j(se,ve,gs,"˘","\\breve");j(se,ve,gs,"ˇ","\\check");j(se,ve,gs,"^","\\hat");j(se,ve,gs,"⃗","\\vec");j(se,ve,gs,"˙","\\dot");j(se,ve,gs,"˚","\\mathring");j(se,ve,Vr,"","\\@imath");j(se,ve,Vr,"","\\@jmath");j(se,ve,Je,"ı","ı");j(se,ve,Je,"ȷ","ȷ");j(Nt,ve,Je,"ı","\\i",!0);j(Nt,ve,Je,"ȷ","\\j",!0);j(Nt,ve,Je,"ß","\\ss",!0);j(Nt,ve,Je,"æ","\\ae",!0);j(Nt,ve,Je,"œ","\\oe",!0);j(Nt,ve,Je,"ø","\\o",!0);j(Nt,ve,Je,"Æ","\\AE",!0);j(Nt,ve,Je,"Œ","\\OE",!0);j(Nt,ve,Je,"Ø","\\O",!0);j(Nt,ve,gs,"ˊ","\\'");j(Nt,ve,gs,"ˋ","\\`");j(Nt,ve,gs,"ˆ","\\^");j(Nt,ve,gs,"˜","\\~");j(Nt,ve,gs,"ˉ","\\=");j(Nt,ve,gs,"˘","\\u");j(Nt,ve,gs,"˙","\\.");j(Nt,ve,gs,"¸","\\c");j(Nt,ve,gs,"˚","\\r");j(Nt,ve,gs,"ˇ","\\v");j(Nt,ve,gs,"¨",'\\"');j(Nt,ve,gs,"˝","\\H");j(Nt,ve,gs,"◯","\\textcircled");var v9e={"--":!0,"---":!0,"``":!0,"''":!0};j(Nt,ve,Je,"–","--",!0);j(Nt,ve,Je,"–","\\textendash");j(Nt,ve,Je,"—","---",!0);j(Nt,ve,Je,"—","\\textemdash");j(Nt,ve,Je,"‘","`",!0);j(Nt,ve,Je,"‘","\\textquoteleft");j(Nt,ve,Je,"’","'",!0);j(Nt,ve,Je,"’","\\textquoteright");j(Nt,ve,Je,"“","``",!0);j(Nt,ve,Je,"“","\\textquotedblleft");j(Nt,ve,Je,"”","''",!0);j(Nt,ve,Je,"”","\\textquotedblright");j(se,ve,Je,"°","\\degree",!0);j(Nt,ve,Je,"°","\\degree");j(Nt,ve,Je,"°","\\textdegree",!0);j(se,ve,Je,"£","\\pounds");j(se,ve,Je,"£","\\mathsterling",!0);j(Nt,ve,Je,"£","\\pounds");j(Nt,ve,Je,"£","\\textsterling",!0);j(se,Ge,Je,"✠","\\maltese");j(Nt,Ge,Je,"✠","\\maltese");var c0e='0123456789/@."';for(var az=0;az{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 b0e[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return THt[s]}else{if(n===120485||n===120486)return b0e[0];if(120486{if(jg(t.classes)!==jg(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},b9e=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},zt=function(e,r,n,i){var s=new tC(e,r,n,i);return Xee(s),s},Xg=(t,e,r,n)=>new tC(t,e,r,n),J5=function(e,r,n){var i=zt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},EHt=function(e,r,n,i){var s=new QD(e,r,n,i);return Xee(s),s},lp=function(e){var r=new eC(e);return Xee(r),r},e3=function(e,r){return e instanceof eC?zt([],[e],r):e},AHt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=zt(["mspace"],[],e),n=Ts(t,e);return r.style.marginRight=Xt(n),r},hM=(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},kU={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"}},w9e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},T9e=function(e,r){var n=w9e[e],i=n[0],s=n[1],a=n[2],o=new Yg(i),l=new P0([o],{width:Xt(s),height:Xt(a),style:"width:"+Xt(s),viewBox:"0 0 "+1e3*s+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),u=Xg(["katex-overlay"],[l],r);return u.height=a,u.style.height=Xt(a),u.style.width=Xt(s),u},bs={number:3,unit:"mu"},e1={number:4,unit:"mu"},_f={number:5,unit:"mu"},MHt={mord:{mop:bs,mbin:e1,mrel:_f,minner:bs},mop:{mord:bs,mop:bs,mrel:_f,minner:bs},mbin:{mord:e1,mop:e1,mopen:e1,minner:e1},mrel:{mord:_f,mop:_f,mopen:_f,minner:_f},mopen:{},mclose:{mop:bs,mbin:e1,mrel:_f,minner:bs},mpunct:{mord:bs,mop:bs,mrel:_f,mopen:bs,mclose:bs,mpunct:bs,minner:bs},minner:{mord:bs,mop:bs,mbin:e1,mrel:_f,mopen:bs,mpunct:bs,minner:bs}},RHt={mord:{mop:bs},mop:{mord:bs,mop:bs},mbin:{},mrel:{},mopen:{},mclose:{mop:bs},mpunct:{},minner:{mop:bs}},C9e={},O6={},D6={};function sr(t){for(var e=t.type,r=t.names,n=t.htmlBuilder,i=t.mathmlBuilder,s=0;s{var y=m.classes[0],v=g.classes[0];y==="mbin"&&LHt.has(v)?m.classes[0]="mord":v==="mbin"&&_Ht.has(y)&&(g.classes[0]="mord")},{node:d},f,p),SU(s,(g,m)=>{var y,v,b=AU(m),x=AU(g),T=b&&x?g.hasClass("mtight")?(y=RHt[b])==null?void 0:y[x]:(v=MHt[b])==null?void 0:v[x]:null;if(T)return x9e(T,u)},{node:d},f,p),s},SU=function(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},k9e=function(e){return e instanceof eC||e instanceof QD||e instanceof tC&&e.hasClass("enclosing")?e:null},EU=function(e,r){var n=k9e(e);if(n){var i=n.children;if(i.length){if(r==="right")return EU(i[i.length-1],"right");if(r==="left")return EU(i[0],"left")}}return e},AU=function(e,r){if(!e)return null;r&&(e=EU(e,r));var n=e.classes[0];return NHt[n]||null},P6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return zt(r.concat(n))},gi=function(e,r,n){if(!e)return zt();if(O6[e.type]){var i=O6[e.type](e,r);if(n&&r.size!==n.size){i=zt(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Yt("Got group of unknown type: '"+e.type+"'")};function dM(t,e){var r=zt(["katex-base"],t,e),n=zt(["katex-strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function MU(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Ba(t,e,"root"),i;n.length===2&&n[1].hasClass("katex-tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(dM(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(dM(a,e));var u;r?(u=dM(Ba(r,e,!0),e),u.classes=["katex-tag"],s.push(u)):i&&s.push(i);var h=zt(["katex-html"],s);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 S9e(t){return new eC(t)}let Ut=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 of Object.entries(this.attributes)){var n=r[0],i=r[1];e.setAttribute(n,i)}this.classes.length>0&&(e.className=jg(this.classes));for(var s=0;s0&&(e+=' class ="'+Qo(jg(this.classes))+'"'),e+=">";for(var s=0;s",e}toText(){return this.children.map(e=>e.toText()).join("")}},da=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qo(this.toText())}toText(){return this.text}},E9e=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 OHt=new Set(["\\imath","\\jmath"]),DHt=new Set(["mrow","mtable"]),Wu=function(e,r,n){var i,s;return hs[r][e]&&hs[r][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(v9e,e)&&((n==null||(i=n.fontFamily)==null?void 0:i.slice(4,6))==="tt"||(n==null||(s=n.font)==null?void 0:s.slice(4,6))==="tt"))&&(e=hs[r][e].replace),new da(e)},Kee=function(e){return e.length===1?e[0]:new Ut("mrow",e)},PHt={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"},Zee=(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=PHt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(OHt.has(s))return null;if(hs[n][s]){var a=hs[n][s].replace;a&&(s=a)}var o=kU[r].fontName;return jee(s,o,n)?kU[r].variant:null};function uz(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof da&&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 da&&r.text===","}else return!1}var ou=function(e,r,n){if(e.length===1){var i=Li(e[0],r);return n&&i instanceof Ut&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||uz(a))){var u=l.children[0];u instanceof Ut&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof da&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof da&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},Kg=function(e,r,n){return Kee(ou(e,r,n))},Li=function(e,r){if(!e)return new Ut("mrow");if(D6[e.type])return D6[e.type](e,r);throw new Yt("Got group of unknown type: '"+e.type+"'")};function x0e(t,e,r,n,i){var s=ou(t,r),a;s.length===1&&s[0]instanceof Ut&&DHt.has(s[0].type)?a=s[0]:a=new Ut("mrow",s);var o=new Ut("annotation",[new da(e)]);o.setAttribute("encoding","application/x-tex");var l=new Ut("semantics",[a,o]),u=new Ut("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return zt([h],[u])}var $Ht=[[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]],w0e=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],T0e=function(e,r){return r.size<2?e:$Ht[e-1][r.size-1]};let A9e=class b1{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||b1.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=w0e[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 b1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:T0e(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:w0e[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=T0e(b1.BASESIZE,e);return this.size===r&&this.textSize===b1.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?["katex-sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==b1.BASESIZE?["katex-sizing","reset-size"+this.size,"size"+b1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=xHt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};A9e.BASESIZE=6;var M9e=function(e){return new A9e({style:e.displayMode?hn.DISPLAY:hn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},R9e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=zt(n,[e])}return e},BHt=function(e,r,n){var i=M9e(n),s;if(n.output==="mathml")return x0e(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=MU(e,i);s=zt(["katex"],[a])}else{var o=x0e(e,r,i,n.displayMode,!1),l=MU(e,i);s=zt(["katex"],[o,l])}return R9e(s,n)},FHt=function(e,r,n){var i=M9e(n),s=MU(e,i),a=zt(["katex"],[s]);return R9e(a,n)},zHt={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":"="},tP=function(e){var r=new Ut("mo",[new da(zHt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},VHt={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]},HHt=new Set(["widehat","widecheck","widetilde","utilde"]),rP=function(e,r){function n(){var l=4e5,u=e.label.slice(1);if(HHt.has(u)&&"base"in e){var h=e.base.type==="ordgroup"?e.base.body.length:1,d,f,p;if(h>5)u==="widehat"||u==="widecheck"?(d=420,l=2364,p=.42,f=u+"4"):(d=312,l=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=u+g):(l=[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 Yg(f),y=new P0([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+l+" "+d,preserveAspectRatio:"none"});return{span:Xg([],[y],r),minWidth:0,height:p}}else{var v=[],b=VHt[u];if(!b)throw new Error('No SVG data for "'+u+'".');var x=b[0],T=b[1],C=b[2],S=C/1e3,k=x.length,E,A;if(k===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');E=["hide-tail"],A=[b[3]]}else if(k===2)E=["halfarrow-left","halfarrow-right"],A=["xMinYMin","xMaxYMin"];else if(k===3)E=["brace-left","brace-center","brace-right"],A=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+k+" children.");for(var M=0;M0&&(s.style.minWidth=Xt(a)),s},GHt=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=zt(["katex-stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new vU({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new vU({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new P0(u,{width:"100%",height:Xt(o)});a=Xg([],[h],s)}return a.height=o,a.style.height=Xt(o),a},WHt=["bin","close","inner","open","punct","rel"],qHt=["accent-token","mathord","op-token","spacing","textord"],UHt=new Set(WHt),jHt=new Set(qHt);function YHt(t){return UHt.has(t)}function bn(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 nP(t){var e=iP(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 iP(t){return t.type==="atom"||jHt.has(t.type)?t:null}var _9e=t=>{if(t instanceof tu)return t;if(vHt(t)&&t.children.length===1)return _9e(t.children[0])},L9e=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=bn(t.base,"accent"),r=n.base,t.base=r,i=yHt(gi(t,e)),t.base=n):(n=bn(t,"accent"),r=n.base);var s=gi(r,e.havingCrampedStyle()),a=n.isShifty&&ap(r),o=0;if(a){var l,u;o=(l=(u=_9e(s))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=rP(n,e),f=fi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Xt(2*o)+")",marginLeft:Xt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=T9e("vec",e),g=w9e.vec[1]):(p=eP({type:"textord",mode:n.mode,text:n.label},e),p=mHt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=zt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Xt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=fi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=zt(["mord","katex-accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},XHt=(t,e)=>{var r=t.isStretchy?tP(t.label):new Ut("mo",[Wu(t.label,t.mode)]),n=new Ut("mover",[Li(t.base,e),r]);return n.setAttribute("accent","true"),n},KHt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));sr({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"],numArgs:1,handler:(t,e)=>{var r=kI(e[0]),n=!KHt.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:L9e,mathmlBuilder:XHt});sr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],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}}});sr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=gi(t.base,e),n=rP(t,e),i=t.label==="\\utilde"?.12:0,s=fi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return zt(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=tP(t.label),n=new Ut("munder",[Li(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var fM=t=>{var e=new Ut("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};sr({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"],numArgs:1,numOptionalArgs:1,handler(t,e,r){var n=t.parser,i=t.funcName;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=e3(gi(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=e3(gi(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=rP(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(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=fi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else h=fi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return zt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=tP(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=fM(Li(t.body,e));if(t.below){var s=fM(Li(t.below,e));n=new Ut("munderover",[r,s,i])}else n=new Ut("mover",[r,i])}else if(t.below){var a=fM(Li(t.below,e));n=new Ut("munder",[r,a])}else n=fM(),n=new Ut("mover",[r,n]);return n}});function ZHt(t,e){var r=Ba(t.body,e,!0);return zt([t.mclass],r,e)}function QHt(t,e){var r,n=ou(t.body,e);return t.mclass==="minner"?r=new Ut("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Ut("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Ut("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")),r}sr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:ha(i),isCharacterBox:ap(i)}},htmlBuilder:ZHt,mathmlBuilder:QHt});var sP=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"};sr({type:"mclass",names:["\\@binrel"],numArgs:2,handler(t,e){var r=t.parser;return{type:"mclass",mode:r.mode,mclass:sP(e[0]),body:ha(e[1]),isCharacterBox:ap(e[1])}}});sr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(t,e){var r=t.parser,n=t.funcName,i=e[1],s=e[0],a;n!=="\\stackrel"?a=sP(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ha(i)},l=n==="\\underset"?{type:"supsub",mode:s.mode,base:o,sub:s}:{type:"supsub",mode:s.mode,base:o,sup:s};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:ap(l)}}});sr({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser;return{type:"pmb",mode:r.mode,mclass:sP(e[0]),body:ha(e[0])}},htmlBuilder(t,e){var r=Ba(t.body,e,!0),n=zt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=ou(t.body,e),n=new Ut("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var JHt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},C0e=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),k0e=t=>t.type==="textord"&&t.text==="@",eGt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function tGt(t,e,r){var n=JHt[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]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,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 rGt(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 Yt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;sAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=tGt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=C0e()}s%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([])}}sr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=e3(gi(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 Ut("mrow",[Li(t.label,e)]);return r=new Ut("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ut("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});sr({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(t,e){var r=t.parser;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=e3(gi(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Ut("mrow",[Li(t.fragment,e)])}});sr({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(t,e){for(var r=t.parser,n=bn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Yt("\\@char with invalid code point "+s);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 nGt=(t,e)=>{var r=Ba(t.body,e.withColor(t.color),!1);return lp(r)},iGt=(t,e)=>{var r=ou(t.body,e.withColor(t.color)),n=new Ut("mstyle",r);return n.setAttribute("mathcolor",t.color),n};sr({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(t,e){var r=t.parser,n=bn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ha(i)}},htmlBuilder:nGt,mathmlBuilder:iGt});sr({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(t,e){var r=t.parser,n=t.breakOnTokenText,i=bn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}}});sr({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(t,e,r){var n=t.parser,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&bn(i,"size").value}},htmlBuilder(t,e){var r=zt(["mspace"],[],e);return t.newLine&&(r.classes.push("katex-newline"),t.size&&(r.style.marginTop=Xt(Ts(t.size,e)))),r},mathmlBuilder(t,e){var r=new Ut("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(Ts(t.size,e)))),r}});var RU={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},I9e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Yt("Expected a control sequence",t);return e},sGt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},N9e=(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)};sr({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(t){var e=t.parser,r=t.funcName;e.consumeSpaces();var n=e.fetch();if(RU[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=RU[n.text]),bn(e.parseFunction(),"internal");throw new Yt("Invalid token after macro prefix",n)}});sr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Yt("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Yt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Yt('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Yt("Expected a macro definition");o[s].push(n.text)}var l=e.gullet.consumeArg(),u=l.tokens;return a&&u.unshift(a),(r==="\\edef"||r==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:s,delimiters:o},r===RU[r]),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=I9e(e.gullet.popToken());e.gullet.consumeSpaces();var i=sGt(e);return N9e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=I9e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return N9e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var qk=function(e,r,n){var i=hs.math[e]&&hs.math[e].replace,s=jee(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},Qee=function(e,r,n,i){var s=n.havingBaseStyle(r),a=zt(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},O9e=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Xt(s),e.height-=s,e.depth+=s},aGt=function(e,r,n,i,s,a){var o=Tl(e,"Main-Regular",s,i),l=Qee(o,r,i,a);return O9e(l,i,r),l},oGt=function(e,r,n,i){return Tl(e,"Size"+r+"-Regular",n,i)},D9e=function(e,r,n,i,s,a){var o=oGt(e,r,s,i),l=Qee(zt(["delimsizing","size"+r],[o],i),hn.TEXT,i,a);return n&&O9e(l,i,hn.TEXT),l},hz=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=zt(["delimsizinginner",i],[zt([],[Tl(e,r,n)])]);return{type:"elem",elem:s}},dz=function(e,r,n){var i=_d["Size4-Regular"][e.charCodeAt(0)]?_d["Size4-Regular"][e.charCodeAt(0)][4]:_d["Size1-Regular"][e.charCodeAt(0)][4],s=new Yg("inner",cHt(e,Math.round(1e3*r))),a=new P0([s],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Xg([],[a],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},_U=.008,pM={type:"kern",size:-1*_U},lGt=new Set(["|","\\lvert","\\rvert","\\vert"]),cGt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),P9e=function(e,r,n,i,s,a){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"):lGt.has(e)?(u="∣",d="vert",f=333):cGt.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=qk(o,p,s),m=g.height+g.depth,y=qk(u,p,s),v=y.height+y.depth,b=qk(h,p,s),x=b.height+b.depth,T=0,C=1;if(l!==null){var S=qk(l,p,s);T=S.height+S.depth,C=2}var k=m+x+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var R=A/2-M,P=[];if(d.length>0){var N=A-m-x,L=Math.round(A*1e3),I=uHt(d,Math.round(N*1e3)),$=new Yg(d,I),O=Xt(f/1e3),D=Xt(L/1e3),B=new P0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Xg([],[B],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(hz(h,p,s)),P.push(pM),l===null){var V=A-m-x+2*_U;P.push(dz(u,V,i))}else{var F=(A-m-x-T)/2+2*_U;P.push(dz(u,F,i)),P.push(pM),P.push(hz(l,p,s)),P.push(pM),P.push(dz(u,F,i))}P.push(pM),P.push(hz(o,p,s))}var H=i.havingBaseStyle(hn.TEXT),G=fi({positionType:"bottom",positionData:R,children:P});return Qee(zt(["delimsizing","mult"],[G],H),hn.TEXT,i,a)},fz=80,pz=.08,gz=function(e,r,n,i,s){var a=lHt(e,i,n),o=new Yg(e,a),l=new P0([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Xg(["hide-tail"],[l],s)},uGt=function(e,r){var n=r.havingBaseSizing(),i=V9e("\\surd",e*n.sizeMultiplier,z9e,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*a+fz,e<1?s=1:e<1.4&&(s=.7),l=(1+a+pz)/s,u=(1+a)/s,o=gz("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+fz)*JS[i.size],u=(JS[i.size]+a)/s,l=(JS[i.size]+a+pz)/s,o=gz("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+pz,u=e+a,h=Math.floor(1e3*e+a)+fz,o=gz("sqrtTall",l,h,a,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+a)*s}},$9e=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),hGt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),B9e=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),JS=[0,1.2,1.8,2.4,3],F9e=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),$9e.has(e)||B9e.has(e))return D9e(e,r,!1,n,i,s);if(hGt.has(e))return P9e(e,JS[r],!1,n,i,s);throw new Yt("Illegal delimiter: '"+e+"'")},dGt=[{type:"small",style:hn.SCRIPTSCRIPT},{type:"small",style:hn.SCRIPT},{type:"small",style:hn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],fGt=[{type:"small",style:hn.SCRIPTSCRIPT},{type:"small",style:hn.SCRIPT},{type:"small",style:hn.TEXT},{type:"stack"}],z9e=[{type:"small",style:hn.SCRIPTSCRIPT},{type:"small",style:hn.SCRIPT},{type:"small",style:hn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],pGt=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.")},V9e=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return o}return n[n.length-1]},LU=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;B9e.has(e)?o=dGt:$9e.has(e)?o=z9e:o=fGt;var l=V9e(e,r,o,i);return l.type==="small"?aGt(e,l.style,n,i,s,a):l.type==="large"?D9e(e,l.size,n,i,s,a):P9e(e,r,n,i,s,a)},mz=function(e,r,n,i,s,a){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 LU(e,d,!0,i,s,a)},S0e={"\\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}},gGt=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 E0e(t){return"isMiddle"in t}function aP(t,e){var r=iP(t);if(r&&gGt.has(r.text))return r;throw r?new Yt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Yt("Invalid delimiter type '"+t.type+"'",t)}sr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(t,e)=>{var r=aP(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:S0e[t.funcName].size,mclass:S0e[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?zt([t.mclass]):F9e(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Wu(t.delim,t.mode));var r=new Ut("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Xt(JS[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function A0e(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}sr({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Yt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:aP(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=aP(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=bn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{A0e(t);for(var r=Ba(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{A0e(t);var r=ou(t.body,e);if(t.left!=="."){var n=new Ut("mo",[Wu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Ut("mo",[Wu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return Kee(r)}});sr({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=aP(e[0],t);if(!t.parser.leftrightDepth)throw new Yt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=P6(e,[]):(r=F9e(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Wu("|","text"):Wu(t.delim,t.mode),n=new Ut("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var mGt=(t,e)=>{var r=e3(gi(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a,o=ap(t.body);if(n==="sout")s=zt(["katex-stretchy","katex-sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Ts({number:.6,unit:"pt"},e),u=Ts({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=aHt(f),g=new P0([new Yg("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Xg(["hide-tail"],[g],e),s.style.height=Xt(d),a=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),s=GHt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Xt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Xt(v),s.style.borderRightWidth=Xt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=fi({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=fi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?zt(["mord","cancel-lap"],[b],e):zt(["mord"],[b],e)},yGt=(t,e)=>{var r,n=new Ut(t.label.includes("colorbox")?"mpadded":"menclose",[Li(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: "+Xt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};sr({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(t,e,r){var n=t.parser,i=t.funcName,s=bn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:mGt,mathmlBuilder:yGt});sr({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(t,e,r){var n=t.parser,i=t.funcName,s=bn(e[0],"color-token").color,a=bn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}}});sr({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(t,e){var r=t.parser;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});sr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}}});sr({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName;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}}});sr({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(t,e){var r=t.parser;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var H9e={};function cf(t){for(var e=t.type,r=t.names,n=t.props,i=t.handler,s=t.htmlBuilder,a=t.mathmlBuilder,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 Yt("{"+t.envName+"} can be used only in display mode.")},vGt=new Set(["gather","gather*"]);function Jee(t){if(!t.includes("ed"))return!t.includes("*")}function Sm(t,e,r){var n=e.hskipBeforeAndAfter,i=e.addJot,s=e.cols,a=e.arraystretch,o=e.colSeparationType,l=e.autoTag,u=e.singleRow,h=e.emptySingleRow,d=e.maxNumCols,f=e.leqno;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Yt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],b=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Ih("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),v.push(M0e(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new Yt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){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&&(x+=.25),u.push({pos:x,isDashed:Ce[re]})}for(T(a[0]),n=0;n0&&(R+=b,kCe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var Q,ne;Z=(Q=(ne=H)==null?void 0:ne.pregap)!=null?Q:f,Z!==0&&(I=zt(["arraycolsep"],[]),I.style.width=Xt(Z),L.push(I))}var ie=[];for(n=0;n0){for(var ge=J5("katex-hline",r,h),ze=J5("katex-hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Ae=u.pop(),qe=Ae.pos-P;Ae.isDashed?we.push({type:"elem",elem:ze,shift:qe}):we.push({type:"elem",elem:ge,shift:qe})}Te=fi({positionType:"individualShift",children:we})}if(O.length===0)return zt(["mord"],[Te],r);var le=fi({positionType:"individualShift",children:O}),pe=zt(["katex-tag"],[le],r);return lp([Te,pe])},bGt={c:"center ",l:"left ",r:"right "},hf=function(e,r){for(var n=[],i=new Ut("mtd",[],["mtr-glue"]),s=new Ut("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,b=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var x=v;x0?"left ":"",f+=A[A.length-1].length>0?"right ":"";for(var M=1;M0&&f&&(m=1),n[p]={type:"align",align:g,pregap:m,postgap:0}}return s.colSeparationType=f?"align":"alignat",s};cf({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=iP(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(a){var o=nP(a),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 Yt("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Sm(t.parser,s,ete(t.envName))},htmlBuilder:uf,mathmlBuilder:hf});cf({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 Yt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=Sm(t.parser,n,ete(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Sm(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=iP(e[0]),n=r?[e[0]]:bn(e[0],"ordgroup").body,i=n.map(function(o){var l=nP(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Yt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Yt("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},a=Sm(t.parser,s,"script");if(a.body.length>0&&a.body[0].length>1)throw new Yt("{subarray} can contain only one column");return a},htmlBuilder:uf,mathmlBuilder:hf});cf({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=Sm(t.parser,e,ete(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:U9e,htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){vGt.has(t.envName)&&oP(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Jee(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Sm(t.parser,e,"display")},htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:U9e,htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){oP(t);var e={autoTag:Jee(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Sm(t.parser,e,"display")},htmlBuilder:uf,mathmlBuilder:hf});cf({type:"array",names:["CD"],props:{numArgs:0},handler(t){return oP(t),rGt(t.parser)},htmlBuilder:uf,mathmlBuilder:hf});Se("\\nonumber","\\gdef\\@eqnsw{0}");Se("\\notag","\\nonumber");sr({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(t,e){throw new Yt(t.funcName+" valid only within array environment")}});var R0e=H9e;sr({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(t,e){var r=t.parser,n=t.funcName,i=e[0];if(i.type!=="ordgroup")throw new Yt("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return gi(t.body,n)},wGt=(t,e)=>{var r=t.font,n=e.withFont(r);return Li(t.body,n)},_0e={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};sr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=kI(e[0]),s=n in _0e?_0e[n]:n;return{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:xGt,mathmlBuilder:wGt});sr({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"mclass",mode:r.mode,mclass:sP(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:ap(n)}}});sr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=t.breakOnTokenText,s=r.mode,a=r.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:a}}}});var TGt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=gi(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.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 b=e.fontMetrics().axisHeight;p-a.depth-(b+.5*d){var r=new Ut("mfrac",[Li(t.numer,e),Li(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Ts(t.barSize,e);r.setAttribute("linethickness",Xt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var s=new Ut("mo",[new da(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new Ut("mo",[new da(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return Kee(i)}return r},j9e=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};sr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0],s=e[1],a,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!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"),j9e({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:TGt,mathmlBuilder:CGt});sr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(t){var e=t.parser,r=t.funcName,n=t.token,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 L0e=["display","text","script","scriptscript"],I0e=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};sr({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(t,e){var r=t.parser,n=e[4],i=e[5],s=kI(e[0]),a=s.type==="atom"&&s.family==="open"?I0e(s.text):null,o=kI(e[1]),l=o.type==="atom"&&o.family==="close"?I0e(o.text):null,u=bn(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=bn(p.body[0],"textord");f=L0e[Number(g.text)]}}else p=bn(p,"textord"),f=L0e[Number(p.text)];return j9e({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l},f)}});sr({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(t,e){var r=t.parser;t.funcName;var n=t.token;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:bn(e[0],"size").value,token:n}}});sr({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(t,e)=>{var r=t.parser;t.funcName;var n=e[0],i=bn(e[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var s=e[2],a=i.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:s,continued:!1,hasBarLine:a,barSize:i,leftDelim:null,rightDelim:null}}});var Y9e=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?gi(t.sup,e.havingStyle(r.sup()),e):gi(t.sub,e.havingStyle(r.sub()),e),i=bn(t.base,"horizBrace")):i=bn(t,"horizBrace");var s=gi(i.base,e.havingBaseStyle(hn.DISPLAY)),a=rP(i,e),o;if(i.isOver?o=fi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=fi({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){var l=zt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=fi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=fi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return zt(["minner",i.isOver?"mover":"munder"],[o],e)},kGt=(t,e)=>{var r=tP(t.label);return new Ut(t.isOver?"mover":"munder",[Li(t.base,e),r])};sr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:Y9e,mathmlBuilder:kGt});sr({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[1],i=bn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ha(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Ba(t.body,e,!1);return EHt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Kg(t.body,e);return r instanceof Ut||(r=new Ut("mrow",[r])),r.setAttribute("href",t.href),r}});sr({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=bn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var r=t.parser,n=t.funcName;t.token;var i=bn(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,o={};switch(n){case"\\htmlClass":o.class=i,a={command:"\\htmlClass",class:i};break;case"\\htmlId":o.id=i,a={command:"\\htmlId",id:i};break;case"\\htmlStyle":o.style=i,a={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var l="{,}",u=[],h="",d=0;d{var r=Ba(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=zt(n,r,e);for(var s of Object.entries(t.attributes)){var a=s[0],o=s[1];a!=="class"&&i.setAttribute(a,o)}return i},mathmlBuilder:(t,e)=>Kg(t.body,e)});sr({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(t,e)=>{var r=t.parser;return{type:"htmlmathml",mode:r.mode,html:ha(e[0]),mathml:ha(e[1])}},htmlBuilder:(t,e)=>{var r=Ba(t.html,e,!1);return lp(r)},mathmlBuilder:(t,e)=>Kg(t.mathml,e)});var yz=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 Yt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!p9e(n))throw new Yt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};sr({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(t,e,r)=>{var n=t.parser,i={number:0,unit:"em"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=bn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Ts(t.height,e),n=0;t.totalheight.number>0&&(n=Ts(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Ts(t.width,e));var s={height:Xt(r+n)};i>0&&(s.width=Xt(i)),n>0&&(s.verticalAlign=Xt(-n));var a=new pHt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new Ut("mglyph",[]);r.setAttribute("alt",t.alt);var n=Ts(t.height,e),i=0;if(t.totalheight.number>0&&(i=Ts(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var s=Ts(t.width,e);r.setAttribute("width",Xt(s))}return r.setAttribute("src",t.src),r}});sr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName,i=bn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||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")):a&&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 x9e(t.dimension,e)},mathmlBuilder(t,e){var r=Ts(t.dimension,e);return new E9e(r)}});sr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=zt([],[gi(t.body,e)]),r=zt(["katex-inner"],[r],e)):r=zt(["katex-inner"],[gi(t.body,e)]);var n=zt(["katex-fix"],[]),i=zt([t.alignment],[r,n],e),s=zt(["katex-strut"]);return s.style.height=Xt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Xt(-i.depth)),i.children.unshift(s),i=zt(["katex-thinbox"],[i],e),zt(["mord","katex-vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Ut("mpadded",[Li(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}});sr({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){var r=t.funcName,n=t.parser,i=n.mode;n.switchMode("math");var s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:a}}});sr({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){throw new Yt("Mismatched "+t.funcName)}});var N0e=(t,e)=>{switch(e.style.size){case hn.DISPLAY.size:return t.display;case hn.TEXT.size:return t.text;case hn.SCRIPT.size:return t.script;case hn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};sr({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(t,e)=>{var r=t.parser;return{type:"mathchoice",mode:r.mode,display:ha(e[0]),text:ha(e[1]),script:ha(e[2]),scriptscript:ha(e[3])}},htmlBuilder:(t,e)=>{var r=N0e(t,e),n=Ba(r,e,!1);return lp(n)},mathmlBuilder:(t,e)=>{var r=N0e(t,e);return Kg(r,e)}});var X9e=(t,e,r,n,i,s,a)=>{t=zt([],[t]);var o=r&&ap(r),l,u;if(e){var h=gi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=gi(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+a;f=fi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-a;f=fi({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Xt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+a;f=fi({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Xt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&s!==0&&!o){var v=zt(["mspace"],[],n);v.style.marginRight=Xt(s),y.unshift(v)}return zt(["mop","op-limits"],y,n)},K9e=new Set(["\\smallint"]),Z9e=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"op"),i=!0):s=bn(t,"op");var a=e.style,o=!1;a.size===hn.DISPLAY.size&&s.symbol&&!K9e.has(s.name)&&(o=!0);var l,u;if(s.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=Tl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=T9e(d+"Size"+(o?"2":"1"),e);l=fi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var p=Ba(s.body,e,!0);p.length===1&&p[0]instanceof tu?(l=p[0],l.classes[0]="mop"):l=zt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new Ut("mo",[Wu(t.name,t.mode)]),K9e.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Ut("mo",ou(t.body,e));else{r=new Ut("mi",[new da(t.name.slice(1))]);var n=new Ut("mo",[Wu("⁡","text")]);t.parentIsSupSub?r=new Ut("mrow",[r,n]):r=S9e([r,n])}return r},EGt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};sr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=n;return i.length===1&&(i=EGt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Z9e,mathmlBuilder:SGt});sr({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:ha(n)}}});var AGt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};sr({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"],numArgs:0,handler(t){var e=t.parser,r=t.funcName;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}}});sr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(t){var e=t.parser,r=t.funcName;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}}});sr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(t){var e=t.parser,r=t.funcName,n=r;return n.length===1&&(n=AGt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var Q9e=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=bn(t.base,"operatorname"),i=!0):s=bn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.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=Ba(o,e.withFont("mathrm"),!0),u=0;u{for(var r=ou(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new da(o)]}var l=new Ut("mi",r);l.setAttribute("mathvariant","normal");var u=new Ut("mo",[Wu("⁡","text")]);return t.parentIsSupSub?new Ut("mrow",[l,u]):S9e([l,u])};sr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"operatorname",mode:r.mode,body:ha(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Q9e,mathmlBuilder:MGt});Se("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rv({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?lp(Ba(t.body,e,!1)):zt(["mord"],Ba(t.body,e,!0),e)},mathmlBuilder(t,e){return Kg(t.body,e,!0)}});sr({type:"overline",names:["\\overline"],numArgs:1,handler(t,e){var r=t.parser,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=gi(t.body,e.havingCrampedStyle()),n=J5("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=fi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return zt(["mord","katex-overline"],[s],e)},mathmlBuilder(t,e){var r=new Ut("mo",[new da("‾")]);r.setAttribute("stretchy","true");var n=new Ut("mover",[Li(t.body,e),r]);return n.setAttribute("accent","true"),n}});sr({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"phantom",mode:r.mode,body:ha(n)}},htmlBuilder:(t,e)=>{var r=Ba(t.body,e.withPhantom(),!1);return lp(r)},mathmlBuilder:(t,e)=>{var r=ou(t.body,e);return new Ut("mphantom",r)}});Se("\\hphantom","\\smash{\\phantom{#1}}");sr({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=zt(["katex-inner"],[gi(t.body,e.withPhantom())]),n=zt(["katex-fix"],[]);return zt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=ou(ha(t.body),e),n=new Ut("mphantom",r),i=new Ut("mpadded",[n]);return i.setAttribute("width","0px"),i}});sr({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(t,e){var r=t.parser,n=bn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=gi(t.body,e),n=Ts(t.dy,e);return fi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ut("mpadded",[Li(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});sr({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(t){var e=t.parser;return{type:"internal",mode:e.mode}}});sr({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(t,e,r){var n=t.parser,i=r[0],s=bn(e[0],"size"),a=bn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&bn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=zt(["mord","katex-rule"],[],e),n=Ts(t.width,e),i=Ts(t.height,e),s=t.shift?Ts(t.shift,e):0;return r.style.borderRightWidth=Xt(n),r.style.borderTopWidth=Xt(i),r.style.bottom=Xt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Ts(t.width,e),n=Ts(t.height,e),i=t.shift?Ts(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new Ut("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Xt(r)),a.setAttribute("height",Xt(n));var o=new Ut("mpadded",[a]);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 J9e(t,e,r){for(var n=Ba(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return J9e(t.body,r,e)};sr({type:"sizing",names:O0e,numArgs:0,allowedInText:!0,handler:(t,e)=>{var r=t.breakOnTokenText,n=t.funcName,i=t.parser,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:O0e.indexOf(n)+1,body:s}},htmlBuilder:RGt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=ou(t.body,r),i=new Ut("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});sr({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(t,e,r)=>{var n=t.parser,i=!1,s=!1,a=r[0]&&bn(r[0],"ordgroup");if(a)for(var o,l=0;l{var r=zt([],[gi(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 zt(["mord","katex-smash"],[r],e);if(r.children)for(var n=0;n{var r=new Ut("mpadded",[Li(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});sr({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(t,e,r){var n=t.parser,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=gi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=e3(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+f-r.height-r.depth)/2);var p=u.height-r.height-a-h;r.style.paddingLeft=Xt(d);var g=fi({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+p)},{type:"elem",elem:u},{type:"kern",size:h}]});if(t.index){var m=e.havingStyle(hn.SCRIPTSCRIPT),y=gi(t.index,m,e),v=.6*(g.height-g.depth),b=fi({positionType:"shift",positionData:-v,children:[{type:"elem",elem:y}]}),x=zt(["katex-root"],[b]);return zt(["mord","sqrt"],[x,g],e)}else return zt(["mord","sqrt"],[g],e)},mathmlBuilder(t,e){var r=t.body,n=t.index;return n?new Ut("mroot",[Li(r,e),Li(n,e)]):new Ut("msqrt",[Li(r,e)])}});var IU={display:hn.DISPLAY,text:hn.TEXT,script:hn.SCRIPT,scriptscript:hn.SCRIPTSCRIPT};function _Gt(t){return t in IU}sr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(t,e){var r=t.breakOnTokenText,n=t.funcName,i=t.parser,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);if(!_Gt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=IU[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),J9e(t.body,n,e)},mathmlBuilder(t,e){var r=IU[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=ou(t.body,n),s=new Ut("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var LGt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===hn.DISPLAY.size||n.alwaysHandleSupSub);return i?Z9e:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===hn.DISPLAY.size||n.limits);return s?Q9e:null}else{if(n.type==="accent")return ap(n.base)?L9e:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?Y9e:null}else return null}else return null};Rv({type:"supsub",htmlBuilder(t,e){var r=LGt(t,e);if(r)return r(t,e);var n=t.base,i=t.sup,s=t.sub,a=gi(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&ap(n);if(i){var p=e.havingStyle(e.style.sup());o=gi(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=gi(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===hn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Xt(.5/u.ptPerEm/y),b=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof tu||x){var T;b=Xt(-((T=a.italic)!=null?T:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:v}];C=fi({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:b,marginRight:v}];C=fi({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=fi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var R=AU(a,"right")||"mord";return zt([R],[a,zt(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Li(t.base,e)];t.sub&&s.push(Li(t.sub,e)),t.sup&&s.push(Li(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===hn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===hn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===hn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===hn.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===hn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===hn.DISPLAY)?a="mover":a="msup"}return new Ut(a,s)}});Rv({type:"atom",htmlBuilder(t,e){return Yee(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Ut("mo",[Wu(t.text,t.mode)]);if(t.family==="bin"){var n=Zee(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 e_e={mi:"italic",mn:"normal",mtext:"normal"};Rv({type:"mathord",htmlBuilder(t,e){return eP(t,e)},mathmlBuilder(t,e){var r=new Ut("mi",[Wu(t.text,t.mode,e)]),n=Zee(t,e)||"italic";return n!==e_e[r.type]&&r.setAttribute("mathvariant",n),r}});Rv({type:"textord",htmlBuilder(t,e){return eP(t,e)},mathmlBuilder(t,e){var r=Wu(t.text,t.mode,e),n=Zee(t,e)||"normal",i;return t.mode==="text"?i=new Ut("mtext",[r]):/[0-9]/.test(t.text)?i=new Ut("mn",[r]):t.text==="\\prime"?i=new Ut("mo",[r]):i=new Ut("mi",[r]),n!==e_e[i.type]&&i.setAttribute("mathvariant",n),i}});var D0e=new Map([["\\nobreak","nobreak"],["\\allowbreak","allowbreak"]]),P0e=new Map([[" ",{}],["\\ ",{}],["~",{className:"nobreak"}],["\\space",{}],["\\nobreakspace",{className:"nobreak"}]]);Rv({type:"spacing",htmlBuilder(t,e){var r=P0e.get(t.text),n=D0e.get(t.text);if(r){var i=r.className||"";if(t.mode==="text"){var s=eP(t,e);return s.classes.push(i),s}else return zt(["mspace",i],[Yee(t.text,t.mode,e)],e)}else{if(n)return zt(["mspace",n],[],e);throw new Yt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(P0e.has(t.text))r=new Ut("mtext",[new da(" ")]);else{if(D0e.has(t.text))return new Ut("mspace");throw new Yt('Unknown type of space "'+t.text+'"')}return r}});var $0e=()=>{var t=new Ut("mtd",[]);return t.setAttribute("width","50%"),t};Rv({type:"tag",mathmlBuilder(t,e){var r=new Ut("mtable",[new Ut("mtr",[$0e(),new Ut("mtd",[Kg(t.body,e)]),$0e(),new Ut("mtd",[Kg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var B0e={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},F0e={"\\textbf":"textbf","\\textmd":"textmd"},IGt={"\\textit":"textit","\\textup":"textup"},z0e=(t,e)=>{var r=t.font;if(r){if(B0e[r])return e.withTextFontFamily(B0e[r]);if(F0e[r])return e.withTextFontWeight(F0e[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(IGt[r])};sr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"text",mode:r.mode,body:ha(i),font:n}},htmlBuilder(t,e){var r=z0e(t,e),n=Ba(t.body,r,!0);return zt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=z0e(t,e);return Kg(t.body,r)}});sr({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=gi(t.body,e),n=J5("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=fi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return zt(["mord","katex-underline"],[s],e)},mathmlBuilder(t,e){var r=new Ut("mo",[new da("‾")]);r.setAttribute("stretchy","true");var n=new Ut("munder",[Li(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});sr({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(t,e){var r=t.parser;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=gi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return fi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Ut("mpadded",[Li(t.body,e)],["vcenter"]);return new Ut("mrow",[r])}});sr({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(t,e,r){throw new Yt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=V0e(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),hg=C9e,t_e=`[ \r - ]`,NGt="\\\\[a-zA-Z@]+",OGt="\\\\[^\uD800-\uDFFF]",DGt="("+NGt+")"+t_e+"*",PGt=`\\\\( +-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 DVt(t){return"toText"in t}let n9=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 this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(DVt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var Cq={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},OVt={ex:!0,em:!0,mu:!0},EMe=function(e){return typeof e!="string"&&(e=e.unit),e in Cq||e in OVt||e==="ex"},xa=function(e,r){var n;if(e.unit in Cq)n=Cq[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 Yt("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"},Xg=function(e){return e.filter(r=>r).join(" ")},ete=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=cVt(n)+":"+i+";")}return r},AMe=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)}},MMe=function(e){var r=document.createElement(e);r.className=Xg(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]/,RMe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Jo(Xg(this.classes))+'"');var n=ete(this.style);n&&(r+=' style="'+Jo(n)+'"');for(var i of Object.keys(this.attributes)){if(_Vt.test(i))throw new Yt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Jo(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};let i9=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,this.italic=void 0,AMe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return MMe.call(this,"span")}toMarkup(){return RMe.call(this,"span")}},t_=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,AMe.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 MMe.call(this,"a")}toMarkup(){return RMe.call(this,"a")}},PVt=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.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=''+Jo(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Xt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Xg(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:"+Xt(this.italic)+";"),n+=ete(this.style),n&&(e=!0,r+=' style="'+Jo(n)+'"');var i=Jo(this.text);return e?(r+=">",r+=i,r+="",r):i}},P0=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 of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i':''}},kq=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 of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e=" but got "+String(t)+".")}var zVt=t=>t instanceof i9||t instanceof t_||t instanceof n9,Ld={"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]}},cF={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]},y0e={Å:"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 VVt(t,e){Ld[t]=e}function tte(t,e,r){if(!Ld[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Ld[e][n];if(!i&&t[0]in y0e&&(n=y0e[t[0]].charCodeAt(0),i=Ld[e][n]),!i&&r==="text"&&SMe(n)&&(i=Ld[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var uF={};function HVt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!uF[e]){var r=uF[e]={cssEmPerMu:cF.quad[e]/18};for(var n of Object.keys(cF))r[n]=cF[n][e]}return uF[e]}var ua={math:{},text:{}};function j(t,e,r,n,i,a){ua[t][i]={font:e,group:r,replace:n},a&&n&&(ua[t][n]=ua[t][i])}var ae="math",Dt="text",ye="main",Ge="ams",pa="accent-token",hr="bin",Zl="close",a9="inner",zr="mathord",ys="op-token",su="open",gk="punct",Ye="rel",lp="spacing",Qe="textord";j(ae,ye,Ye,"≡","\\equiv",!0);j(ae,ye,Ye,"≺","\\prec",!0);j(ae,ye,Ye,"≻","\\succ",!0);j(ae,ye,Ye,"∼","\\sim",!0);j(ae,ye,Ye,"⊥","\\perp");j(ae,ye,Ye,"⪯","\\preceq",!0);j(ae,ye,Ye,"⪰","\\succeq",!0);j(ae,ye,Ye,"≃","\\simeq",!0);j(ae,ye,Ye,"∣","\\mid",!0);j(ae,ye,Ye,"≪","\\ll",!0);j(ae,ye,Ye,"≫","\\gg",!0);j(ae,ye,Ye,"≍","\\asymp",!0);j(ae,ye,Ye,"∥","\\parallel");j(ae,ye,Ye,"⋈","\\bowtie",!0);j(ae,ye,Ye,"⌣","\\smile",!0);j(ae,ye,Ye,"⊑","\\sqsubseteq",!0);j(ae,ye,Ye,"⊒","\\sqsupseteq",!0);j(ae,ye,Ye,"≐","\\doteq",!0);j(ae,ye,Ye,"⌢","\\frown",!0);j(ae,ye,Ye,"∋","\\ni",!0);j(ae,ye,Ye,"∝","\\propto",!0);j(ae,ye,Ye,"⊢","\\vdash",!0);j(ae,ye,Ye,"⊣","\\dashv",!0);j(ae,ye,Ye,"∋","\\owns");j(ae,ye,gk,".","\\ldotp");j(ae,ye,gk,"⋅","\\cdotp");j(ae,ye,gk,"⋅","·");j(Dt,ye,Qe,"⋅","·");j(ae,ye,Qe,"#","\\#");j(Dt,ye,Qe,"#","\\#");j(ae,ye,Qe,"&","\\&");j(Dt,ye,Qe,"&","\\&");j(ae,ye,Qe,"ℵ","\\aleph",!0);j(ae,ye,Qe,"∀","\\forall",!0);j(ae,ye,Qe,"ℏ","\\hbar",!0);j(ae,ye,Qe,"∃","\\exists",!0);j(ae,ye,Qe,"∇","\\nabla",!0);j(ae,ye,Qe,"♭","\\flat",!0);j(ae,ye,Qe,"ℓ","\\ell",!0);j(ae,ye,Qe,"♮","\\natural",!0);j(ae,ye,Qe,"♣","\\clubsuit",!0);j(ae,ye,Qe,"℘","\\wp",!0);j(ae,ye,Qe,"♯","\\sharp",!0);j(ae,ye,Qe,"♢","\\diamondsuit",!0);j(ae,ye,Qe,"ℜ","\\Re",!0);j(ae,ye,Qe,"♡","\\heartsuit",!0);j(ae,ye,Qe,"ℑ","\\Im",!0);j(ae,ye,Qe,"♠","\\spadesuit",!0);j(ae,ye,Qe,"§","\\S",!0);j(Dt,ye,Qe,"§","\\S");j(ae,ye,Qe,"¶","\\P",!0);j(Dt,ye,Qe,"¶","\\P");j(ae,ye,Qe,"†","\\dag");j(Dt,ye,Qe,"†","\\dag");j(Dt,ye,Qe,"†","\\textdagger");j(ae,ye,Qe,"‡","\\ddag");j(Dt,ye,Qe,"‡","\\ddag");j(Dt,ye,Qe,"‡","\\textdaggerdbl");j(ae,ye,Zl,"⎱","\\rmoustache",!0);j(ae,ye,su,"⎰","\\lmoustache",!0);j(ae,ye,Zl,"⟯","\\rgroup",!0);j(ae,ye,su,"⟮","\\lgroup",!0);j(ae,ye,hr,"∓","\\mp",!0);j(ae,ye,hr,"⊖","\\ominus",!0);j(ae,ye,hr,"⊎","\\uplus",!0);j(ae,ye,hr,"⊓","\\sqcap",!0);j(ae,ye,hr,"∗","\\ast");j(ae,ye,hr,"⊔","\\sqcup",!0);j(ae,ye,hr,"◯","\\bigcirc",!0);j(ae,ye,hr,"∙","\\bullet",!0);j(ae,ye,hr,"‡","\\ddagger");j(ae,ye,hr,"≀","\\wr",!0);j(ae,ye,hr,"⨿","\\amalg");j(ae,ye,hr,"&","\\And");j(ae,ye,Ye,"⟵","\\longleftarrow",!0);j(ae,ye,Ye,"⇐","\\Leftarrow",!0);j(ae,ye,Ye,"⟸","\\Longleftarrow",!0);j(ae,ye,Ye,"⟶","\\longrightarrow",!0);j(ae,ye,Ye,"⇒","\\Rightarrow",!0);j(ae,ye,Ye,"⟹","\\Longrightarrow",!0);j(ae,ye,Ye,"↔","\\leftrightarrow",!0);j(ae,ye,Ye,"⟷","\\longleftrightarrow",!0);j(ae,ye,Ye,"⇔","\\Leftrightarrow",!0);j(ae,ye,Ye,"⟺","\\Longleftrightarrow",!0);j(ae,ye,Ye,"↦","\\mapsto",!0);j(ae,ye,Ye,"⟼","\\longmapsto",!0);j(ae,ye,Ye,"↗","\\nearrow",!0);j(ae,ye,Ye,"↩","\\hookleftarrow",!0);j(ae,ye,Ye,"↪","\\hookrightarrow",!0);j(ae,ye,Ye,"↘","\\searrow",!0);j(ae,ye,Ye,"↼","\\leftharpoonup",!0);j(ae,ye,Ye,"⇀","\\rightharpoonup",!0);j(ae,ye,Ye,"↙","\\swarrow",!0);j(ae,ye,Ye,"↽","\\leftharpoondown",!0);j(ae,ye,Ye,"⇁","\\rightharpoondown",!0);j(ae,ye,Ye,"↖","\\nwarrow",!0);j(ae,ye,Ye,"⇌","\\rightleftharpoons",!0);j(ae,Ge,Ye,"≮","\\nless",!0);j(ae,Ge,Ye,"","\\@nleqslant");j(ae,Ge,Ye,"","\\@nleqq");j(ae,Ge,Ye,"⪇","\\lneq",!0);j(ae,Ge,Ye,"≨","\\lneqq",!0);j(ae,Ge,Ye,"","\\@lvertneqq");j(ae,Ge,Ye,"⋦","\\lnsim",!0);j(ae,Ge,Ye,"⪉","\\lnapprox",!0);j(ae,Ge,Ye,"⊀","\\nprec",!0);j(ae,Ge,Ye,"⋠","\\npreceq",!0);j(ae,Ge,Ye,"⋨","\\precnsim",!0);j(ae,Ge,Ye,"⪹","\\precnapprox",!0);j(ae,Ge,Ye,"≁","\\nsim",!0);j(ae,Ge,Ye,"","\\@nshortmid");j(ae,Ge,Ye,"∤","\\nmid",!0);j(ae,Ge,Ye,"⊬","\\nvdash",!0);j(ae,Ge,Ye,"⊭","\\nvDash",!0);j(ae,Ge,Ye,"⋪","\\ntriangleleft");j(ae,Ge,Ye,"⋬","\\ntrianglelefteq",!0);j(ae,Ge,Ye,"⊊","\\subsetneq",!0);j(ae,Ge,Ye,"","\\@varsubsetneq");j(ae,Ge,Ye,"⫋","\\subsetneqq",!0);j(ae,Ge,Ye,"","\\@varsubsetneqq");j(ae,Ge,Ye,"≯","\\ngtr",!0);j(ae,Ge,Ye,"","\\@ngeqslant");j(ae,Ge,Ye,"","\\@ngeqq");j(ae,Ge,Ye,"⪈","\\gneq",!0);j(ae,Ge,Ye,"≩","\\gneqq",!0);j(ae,Ge,Ye,"","\\@gvertneqq");j(ae,Ge,Ye,"⋧","\\gnsim",!0);j(ae,Ge,Ye,"⪊","\\gnapprox",!0);j(ae,Ge,Ye,"⊁","\\nsucc",!0);j(ae,Ge,Ye,"⋡","\\nsucceq",!0);j(ae,Ge,Ye,"⋩","\\succnsim",!0);j(ae,Ge,Ye,"⪺","\\succnapprox",!0);j(ae,Ge,Ye,"≆","\\ncong",!0);j(ae,Ge,Ye,"","\\@nshortparallel");j(ae,Ge,Ye,"∦","\\nparallel",!0);j(ae,Ge,Ye,"⊯","\\nVDash",!0);j(ae,Ge,Ye,"⋫","\\ntriangleright");j(ae,Ge,Ye,"⋭","\\ntrianglerighteq",!0);j(ae,Ge,Ye,"","\\@nsupseteqq");j(ae,Ge,Ye,"⊋","\\supsetneq",!0);j(ae,Ge,Ye,"","\\@varsupsetneq");j(ae,Ge,Ye,"⫌","\\supsetneqq",!0);j(ae,Ge,Ye,"","\\@varsupsetneqq");j(ae,Ge,Ye,"⊮","\\nVdash",!0);j(ae,Ge,Ye,"⪵","\\precneqq",!0);j(ae,Ge,Ye,"⪶","\\succneqq",!0);j(ae,Ge,Ye,"","\\@nsubseteqq");j(ae,Ge,hr,"⊴","\\unlhd");j(ae,Ge,hr,"⊵","\\unrhd");j(ae,Ge,Ye,"↚","\\nleftarrow",!0);j(ae,Ge,Ye,"↛","\\nrightarrow",!0);j(ae,Ge,Ye,"⇍","\\nLeftarrow",!0);j(ae,Ge,Ye,"⇏","\\nRightarrow",!0);j(ae,Ge,Ye,"↮","\\nleftrightarrow",!0);j(ae,Ge,Ye,"⇎","\\nLeftrightarrow",!0);j(ae,Ge,Ye,"△","\\vartriangle");j(ae,Ge,Qe,"ℏ","\\hslash");j(ae,Ge,Qe,"▽","\\triangledown");j(ae,Ge,Qe,"◊","\\lozenge");j(ae,Ge,Qe,"Ⓢ","\\circledS");j(ae,Ge,Qe,"®","\\circledR");j(Dt,Ge,Qe,"®","\\circledR");j(ae,Ge,Qe,"∡","\\measuredangle",!0);j(ae,Ge,Qe,"∄","\\nexists");j(ae,Ge,Qe,"℧","\\mho");j(ae,Ge,Qe,"Ⅎ","\\Finv",!0);j(ae,Ge,Qe,"⅁","\\Game",!0);j(ae,Ge,Qe,"‵","\\backprime");j(ae,Ge,Qe,"▲","\\blacktriangle");j(ae,Ge,Qe,"▼","\\blacktriangledown");j(ae,Ge,Qe,"■","\\blacksquare");j(ae,Ge,Qe,"⧫","\\blacklozenge");j(ae,Ge,Qe,"★","\\bigstar");j(ae,Ge,Qe,"∢","\\sphericalangle",!0);j(ae,Ge,Qe,"∁","\\complement",!0);j(ae,Ge,Qe,"ð","\\eth",!0);j(Dt,ye,Qe,"ð","ð");j(ae,Ge,Qe,"╱","\\diagup");j(ae,Ge,Qe,"╲","\\diagdown");j(ae,Ge,Qe,"□","\\square");j(ae,Ge,Qe,"□","\\Box");j(ae,Ge,Qe,"◊","\\Diamond");j(ae,Ge,Qe,"¥","\\yen",!0);j(Dt,Ge,Qe,"¥","\\yen",!0);j(ae,Ge,Qe,"✓","\\checkmark",!0);j(Dt,Ge,Qe,"✓","\\checkmark");j(ae,Ge,Qe,"ℶ","\\beth",!0);j(ae,Ge,Qe,"ℸ","\\daleth",!0);j(ae,Ge,Qe,"ℷ","\\gimel",!0);j(ae,Ge,Qe,"ϝ","\\digamma",!0);j(ae,Ge,Qe,"ϰ","\\varkappa");j(ae,Ge,su,"┌","\\@ulcorner",!0);j(ae,Ge,Zl,"┐","\\@urcorner",!0);j(ae,Ge,su,"└","\\@llcorner",!0);j(ae,Ge,Zl,"┘","\\@lrcorner",!0);j(ae,Ge,Ye,"≦","\\leqq",!0);j(ae,Ge,Ye,"⩽","\\leqslant",!0);j(ae,Ge,Ye,"⪕","\\eqslantless",!0);j(ae,Ge,Ye,"≲","\\lesssim",!0);j(ae,Ge,Ye,"⪅","\\lessapprox",!0);j(ae,Ge,Ye,"≊","\\approxeq",!0);j(ae,Ge,hr,"⋖","\\lessdot");j(ae,Ge,Ye,"⋘","\\lll",!0);j(ae,Ge,Ye,"≶","\\lessgtr",!0);j(ae,Ge,Ye,"⋚","\\lesseqgtr",!0);j(ae,Ge,Ye,"⪋","\\lesseqqgtr",!0);j(ae,Ge,Ye,"≑","\\doteqdot");j(ae,Ge,Ye,"≓","\\risingdotseq",!0);j(ae,Ge,Ye,"≒","\\fallingdotseq",!0);j(ae,Ge,Ye,"∽","\\backsim",!0);j(ae,Ge,Ye,"⋍","\\backsimeq",!0);j(ae,Ge,Ye,"⫅","\\subseteqq",!0);j(ae,Ge,Ye,"⋐","\\Subset",!0);j(ae,Ge,Ye,"⊏","\\sqsubset",!0);j(ae,Ge,Ye,"≼","\\preccurlyeq",!0);j(ae,Ge,Ye,"⋞","\\curlyeqprec",!0);j(ae,Ge,Ye,"≾","\\precsim",!0);j(ae,Ge,Ye,"⪷","\\precapprox",!0);j(ae,Ge,Ye,"⊲","\\vartriangleleft");j(ae,Ge,Ye,"⊴","\\trianglelefteq");j(ae,Ge,Ye,"⊨","\\vDash",!0);j(ae,Ge,Ye,"⊪","\\Vvdash",!0);j(ae,Ge,Ye,"⌣","\\smallsmile");j(ae,Ge,Ye,"⌢","\\smallfrown");j(ae,Ge,Ye,"≏","\\bumpeq",!0);j(ae,Ge,Ye,"≎","\\Bumpeq",!0);j(ae,Ge,Ye,"≧","\\geqq",!0);j(ae,Ge,Ye,"⩾","\\geqslant",!0);j(ae,Ge,Ye,"⪖","\\eqslantgtr",!0);j(ae,Ge,Ye,"≳","\\gtrsim",!0);j(ae,Ge,Ye,"⪆","\\gtrapprox",!0);j(ae,Ge,hr,"⋗","\\gtrdot");j(ae,Ge,Ye,"⋙","\\ggg",!0);j(ae,Ge,Ye,"≷","\\gtrless",!0);j(ae,Ge,Ye,"⋛","\\gtreqless",!0);j(ae,Ge,Ye,"⪌","\\gtreqqless",!0);j(ae,Ge,Ye,"≖","\\eqcirc",!0);j(ae,Ge,Ye,"≗","\\circeq",!0);j(ae,Ge,Ye,"≜","\\triangleq",!0);j(ae,Ge,Ye,"∼","\\thicksim");j(ae,Ge,Ye,"≈","\\thickapprox");j(ae,Ge,Ye,"⫆","\\supseteqq",!0);j(ae,Ge,Ye,"⋑","\\Supset",!0);j(ae,Ge,Ye,"⊐","\\sqsupset",!0);j(ae,Ge,Ye,"≽","\\succcurlyeq",!0);j(ae,Ge,Ye,"⋟","\\curlyeqsucc",!0);j(ae,Ge,Ye,"≿","\\succsim",!0);j(ae,Ge,Ye,"⪸","\\succapprox",!0);j(ae,Ge,Ye,"⊳","\\vartriangleright");j(ae,Ge,Ye,"⊵","\\trianglerighteq");j(ae,Ge,Ye,"⊩","\\Vdash",!0);j(ae,Ge,Ye,"∣","\\shortmid");j(ae,Ge,Ye,"∥","\\shortparallel");j(ae,Ge,Ye,"≬","\\between",!0);j(ae,Ge,Ye,"⋔","\\pitchfork",!0);j(ae,Ge,Ye,"∝","\\varpropto");j(ae,Ge,Ye,"◀","\\blacktriangleleft");j(ae,Ge,Ye,"∴","\\therefore",!0);j(ae,Ge,Ye,"∍","\\backepsilon");j(ae,Ge,Ye,"▶","\\blacktriangleright");j(ae,Ge,Ye,"∵","\\because",!0);j(ae,Ge,Ye,"⋘","\\llless");j(ae,Ge,Ye,"⋙","\\gggtr");j(ae,Ge,hr,"⊲","\\lhd");j(ae,Ge,hr,"⊳","\\rhd");j(ae,Ge,Ye,"≂","\\eqsim",!0);j(ae,ye,Ye,"⋈","\\Join");j(ae,Ge,Ye,"≑","\\Doteq",!0);j(ae,Ge,hr,"∔","\\dotplus",!0);j(ae,Ge,hr,"∖","\\smallsetminus");j(ae,Ge,hr,"⋒","\\Cap",!0);j(ae,Ge,hr,"⋓","\\Cup",!0);j(ae,Ge,hr,"⩞","\\doublebarwedge",!0);j(ae,Ge,hr,"⊟","\\boxminus",!0);j(ae,Ge,hr,"⊞","\\boxplus",!0);j(ae,Ge,hr,"⋇","\\divideontimes",!0);j(ae,Ge,hr,"⋉","\\ltimes",!0);j(ae,Ge,hr,"⋊","\\rtimes",!0);j(ae,Ge,hr,"⋋","\\leftthreetimes",!0);j(ae,Ge,hr,"⋌","\\rightthreetimes",!0);j(ae,Ge,hr,"⋏","\\curlywedge",!0);j(ae,Ge,hr,"⋎","\\curlyvee",!0);j(ae,Ge,hr,"⊝","\\circleddash",!0);j(ae,Ge,hr,"⊛","\\circledast",!0);j(ae,Ge,hr,"⋅","\\centerdot");j(ae,Ge,hr,"⊺","\\intercal",!0);j(ae,Ge,hr,"⋒","\\doublecap");j(ae,Ge,hr,"⋓","\\doublecup");j(ae,Ge,hr,"⊠","\\boxtimes",!0);j(ae,Ge,Ye,"⇢","\\dashrightarrow",!0);j(ae,Ge,Ye,"⇠","\\dashleftarrow",!0);j(ae,Ge,Ye,"⇇","\\leftleftarrows",!0);j(ae,Ge,Ye,"⇆","\\leftrightarrows",!0);j(ae,Ge,Ye,"⇚","\\Lleftarrow",!0);j(ae,Ge,Ye,"↞","\\twoheadleftarrow",!0);j(ae,Ge,Ye,"↢","\\leftarrowtail",!0);j(ae,Ge,Ye,"↫","\\looparrowleft",!0);j(ae,Ge,Ye,"⇋","\\leftrightharpoons",!0);j(ae,Ge,Ye,"↶","\\curvearrowleft",!0);j(ae,Ge,Ye,"↺","\\circlearrowleft",!0);j(ae,Ge,Ye,"↰","\\Lsh",!0);j(ae,Ge,Ye,"⇈","\\upuparrows",!0);j(ae,Ge,Ye,"↿","\\upharpoonleft",!0);j(ae,Ge,Ye,"⇃","\\downharpoonleft",!0);j(ae,ye,Ye,"⊶","\\origof",!0);j(ae,ye,Ye,"⊷","\\imageof",!0);j(ae,Ge,Ye,"⊸","\\multimap",!0);j(ae,Ge,Ye,"↭","\\leftrightsquigarrow",!0);j(ae,Ge,Ye,"⇉","\\rightrightarrows",!0);j(ae,Ge,Ye,"⇄","\\rightleftarrows",!0);j(ae,Ge,Ye,"↠","\\twoheadrightarrow",!0);j(ae,Ge,Ye,"↣","\\rightarrowtail",!0);j(ae,Ge,Ye,"↬","\\looparrowright",!0);j(ae,Ge,Ye,"↷","\\curvearrowright",!0);j(ae,Ge,Ye,"↻","\\circlearrowright",!0);j(ae,Ge,Ye,"↱","\\Rsh",!0);j(ae,Ge,Ye,"⇊","\\downdownarrows",!0);j(ae,Ge,Ye,"↾","\\upharpoonright",!0);j(ae,Ge,Ye,"⇂","\\downharpoonright",!0);j(ae,Ge,Ye,"⇝","\\rightsquigarrow",!0);j(ae,Ge,Ye,"⇝","\\leadsto");j(ae,Ge,Ye,"⇛","\\Rrightarrow",!0);j(ae,Ge,Ye,"↾","\\restriction");j(ae,ye,Qe,"‘","`");j(ae,ye,Qe,"$","\\$");j(Dt,ye,Qe,"$","\\$");j(Dt,ye,Qe,"$","\\textdollar");j(ae,ye,Qe,"%","\\%");j(Dt,ye,Qe,"%","\\%");j(ae,ye,Qe,"_","\\_");j(Dt,ye,Qe,"_","\\_");j(Dt,ye,Qe,"_","\\textunderscore");j(ae,ye,Qe,"∠","\\angle",!0);j(ae,ye,Qe,"∞","\\infty",!0);j(ae,ye,Qe,"′","\\prime");j(ae,ye,Qe,"△","\\triangle");j(ae,ye,Qe,"Γ","\\Gamma",!0);j(ae,ye,Qe,"Δ","\\Delta",!0);j(ae,ye,Qe,"Θ","\\Theta",!0);j(ae,ye,Qe,"Λ","\\Lambda",!0);j(ae,ye,Qe,"Ξ","\\Xi",!0);j(ae,ye,Qe,"Π","\\Pi",!0);j(ae,ye,Qe,"Σ","\\Sigma",!0);j(ae,ye,Qe,"Υ","\\Upsilon",!0);j(ae,ye,Qe,"Φ","\\Phi",!0);j(ae,ye,Qe,"Ψ","\\Psi",!0);j(ae,ye,Qe,"Ω","\\Omega",!0);j(ae,ye,Qe,"A","Α");j(ae,ye,Qe,"B","Β");j(ae,ye,Qe,"E","Ε");j(ae,ye,Qe,"Z","Ζ");j(ae,ye,Qe,"H","Η");j(ae,ye,Qe,"I","Ι");j(ae,ye,Qe,"K","Κ");j(ae,ye,Qe,"M","Μ");j(ae,ye,Qe,"N","Ν");j(ae,ye,Qe,"O","Ο");j(ae,ye,Qe,"P","Ρ");j(ae,ye,Qe,"T","Τ");j(ae,ye,Qe,"X","Χ");j(ae,ye,Qe,"¬","\\neg",!0);j(ae,ye,Qe,"¬","\\lnot");j(ae,ye,Qe,"⊤","\\top");j(ae,ye,Qe,"⊥","\\bot");j(ae,ye,Qe,"∅","\\emptyset");j(ae,Ge,Qe,"∅","\\varnothing");j(ae,ye,zr,"α","\\alpha",!0);j(ae,ye,zr,"β","\\beta",!0);j(ae,ye,zr,"γ","\\gamma",!0);j(ae,ye,zr,"δ","\\delta",!0);j(ae,ye,zr,"ϵ","\\epsilon",!0);j(ae,ye,zr,"ζ","\\zeta",!0);j(ae,ye,zr,"η","\\eta",!0);j(ae,ye,zr,"θ","\\theta",!0);j(ae,ye,zr,"ι","\\iota",!0);j(ae,ye,zr,"κ","\\kappa",!0);j(ae,ye,zr,"λ","\\lambda",!0);j(ae,ye,zr,"μ","\\mu",!0);j(ae,ye,zr,"ν","\\nu",!0);j(ae,ye,zr,"ξ","\\xi",!0);j(ae,ye,zr,"ο","\\omicron",!0);j(ae,ye,zr,"π","\\pi",!0);j(ae,ye,zr,"ρ","\\rho",!0);j(ae,ye,zr,"σ","\\sigma",!0);j(ae,ye,zr,"τ","\\tau",!0);j(ae,ye,zr,"υ","\\upsilon",!0);j(ae,ye,zr,"ϕ","\\phi",!0);j(ae,ye,zr,"χ","\\chi",!0);j(ae,ye,zr,"ψ","\\psi",!0);j(ae,ye,zr,"ω","\\omega",!0);j(ae,ye,zr,"ε","\\varepsilon",!0);j(ae,ye,zr,"ϑ","\\vartheta",!0);j(ae,ye,zr,"ϖ","\\varpi",!0);j(ae,ye,zr,"ϱ","\\varrho",!0);j(ae,ye,zr,"ς","\\varsigma",!0);j(ae,ye,zr,"φ","\\varphi",!0);j(ae,ye,hr,"∗","*",!0);j(ae,ye,hr,"+","+");j(ae,ye,hr,"−","-",!0);j(ae,ye,hr,"⋅","\\cdot",!0);j(ae,ye,hr,"∘","\\circ",!0);j(ae,ye,hr,"÷","\\div",!0);j(ae,ye,hr,"±","\\pm",!0);j(ae,ye,hr,"×","\\times",!0);j(ae,ye,hr,"∩","\\cap",!0);j(ae,ye,hr,"∪","\\cup",!0);j(ae,ye,hr,"∖","\\setminus",!0);j(ae,ye,hr,"∧","\\land");j(ae,ye,hr,"∨","\\lor");j(ae,ye,hr,"∧","\\wedge",!0);j(ae,ye,hr,"∨","\\vee",!0);j(ae,ye,Qe,"√","\\surd");j(ae,ye,su,"⟨","\\langle",!0);j(ae,ye,su,"∣","\\lvert");j(ae,ye,su,"∥","\\lVert");j(ae,ye,Zl,"?","?");j(ae,ye,Zl,"!","!");j(ae,ye,Zl,"⟩","\\rangle",!0);j(ae,ye,Zl,"∣","\\rvert");j(ae,ye,Zl,"∥","\\rVert");j(ae,ye,Ye,"=","=");j(ae,ye,Ye,":",":");j(ae,ye,Ye,"≈","\\approx",!0);j(ae,ye,Ye,"≅","\\cong",!0);j(ae,ye,Ye,"≥","\\ge");j(ae,ye,Ye,"≥","\\geq",!0);j(ae,ye,Ye,"←","\\gets");j(ae,ye,Ye,">","\\gt",!0);j(ae,ye,Ye,"∈","\\in",!0);j(ae,ye,Ye,"","\\@not");j(ae,ye,Ye,"⊂","\\subset",!0);j(ae,ye,Ye,"⊃","\\supset",!0);j(ae,ye,Ye,"⊆","\\subseteq",!0);j(ae,ye,Ye,"⊇","\\supseteq",!0);j(ae,Ge,Ye,"⊈","\\nsubseteq",!0);j(ae,Ge,Ye,"⊉","\\nsupseteq",!0);j(ae,ye,Ye,"⊨","\\models");j(ae,ye,Ye,"←","\\leftarrow",!0);j(ae,ye,Ye,"≤","\\le");j(ae,ye,Ye,"≤","\\leq",!0);j(ae,ye,Ye,"<","\\lt",!0);j(ae,ye,Ye,"→","\\rightarrow",!0);j(ae,ye,Ye,"→","\\to");j(ae,Ge,Ye,"≱","\\ngeq",!0);j(ae,Ge,Ye,"≰","\\nleq",!0);j(ae,ye,lp," ","\\ ");j(ae,ye,lp," ","\\space");j(ae,ye,lp," ","\\nobreakspace");j(Dt,ye,lp," ","\\ ");j(Dt,ye,lp," "," ");j(Dt,ye,lp," ","\\space");j(Dt,ye,lp," ","\\nobreakspace");j(ae,ye,lp,"","\\nobreak");j(ae,ye,lp,"","\\allowbreak");j(ae,ye,gk,",",",");j(ae,ye,gk,";",";");j(ae,Ge,hr,"⊼","\\barwedge",!0);j(ae,Ge,hr,"⊻","\\veebar",!0);j(ae,ye,hr,"⊙","\\odot",!0);j(ae,ye,hr,"⊕","\\oplus",!0);j(ae,ye,hr,"⊗","\\otimes",!0);j(ae,ye,Qe,"∂","\\partial",!0);j(ae,ye,hr,"⊘","\\oslash",!0);j(ae,Ge,hr,"⊚","\\circledcirc",!0);j(ae,Ge,hr,"⊡","\\boxdot",!0);j(ae,ye,hr,"△","\\bigtriangleup");j(ae,ye,hr,"▽","\\bigtriangledown");j(ae,ye,hr,"†","\\dagger");j(ae,ye,hr,"⋄","\\diamond");j(ae,ye,hr,"⋆","\\star");j(ae,ye,hr,"◃","\\triangleleft");j(ae,ye,hr,"▹","\\triangleright");j(ae,ye,su,"{","\\{");j(Dt,ye,Qe,"{","\\{");j(Dt,ye,Qe,"{","\\textbraceleft");j(ae,ye,Zl,"}","\\}");j(Dt,ye,Qe,"}","\\}");j(Dt,ye,Qe,"}","\\textbraceright");j(ae,ye,su,"{","\\lbrace");j(ae,ye,Zl,"}","\\rbrace");j(ae,ye,su,"[","\\lbrack",!0);j(Dt,ye,Qe,"[","\\lbrack",!0);j(ae,ye,Zl,"]","\\rbrack",!0);j(Dt,ye,Qe,"]","\\rbrack",!0);j(ae,ye,su,"(","\\lparen",!0);j(ae,ye,Zl,")","\\rparen",!0);j(Dt,ye,Qe,"<","\\textless",!0);j(Dt,ye,Qe,">","\\textgreater",!0);j(ae,ye,su,"⌊","\\lfloor",!0);j(ae,ye,Zl,"⌋","\\rfloor",!0);j(ae,ye,su,"⌈","\\lceil",!0);j(ae,ye,Zl,"⌉","\\rceil",!0);j(ae,ye,Qe,"\\","\\backslash");j(ae,ye,Qe,"∣","|");j(ae,ye,Qe,"∣","\\vert");j(Dt,ye,Qe,"|","\\textbar",!0);j(ae,ye,Qe,"∥","\\|");j(ae,ye,Qe,"∥","\\Vert");j(Dt,ye,Qe,"∥","\\textbardbl");j(Dt,ye,Qe,"~","\\textasciitilde");j(Dt,ye,Qe,"\\","\\textbackslash");j(Dt,ye,Qe,"^","\\textasciicircum");j(ae,ye,Ye,"↑","\\uparrow",!0);j(ae,ye,Ye,"⇑","\\Uparrow",!0);j(ae,ye,Ye,"↓","\\downarrow",!0);j(ae,ye,Ye,"⇓","\\Downarrow",!0);j(ae,ye,Ye,"↕","\\updownarrow",!0);j(ae,ye,Ye,"⇕","\\Updownarrow",!0);j(ae,ye,ys,"∐","\\coprod");j(ae,ye,ys,"⋁","\\bigvee");j(ae,ye,ys,"⋀","\\bigwedge");j(ae,ye,ys,"⨄","\\biguplus");j(ae,ye,ys,"⋂","\\bigcap");j(ae,ye,ys,"⋃","\\bigcup");j(ae,ye,ys,"∫","\\int");j(ae,ye,ys,"∫","\\intop");j(ae,ye,ys,"∬","\\iint");j(ae,ye,ys,"∭","\\iiint");j(ae,ye,ys,"∏","\\prod");j(ae,ye,ys,"∑","\\sum");j(ae,ye,ys,"⨂","\\bigotimes");j(ae,ye,ys,"⨁","\\bigoplus");j(ae,ye,ys,"⨀","\\bigodot");j(ae,ye,ys,"∮","\\oint");j(ae,ye,ys,"∯","\\oiint");j(ae,ye,ys,"∰","\\oiiint");j(ae,ye,ys,"⨆","\\bigsqcup");j(ae,ye,ys,"∫","\\smallint");j(Dt,ye,a9,"…","\\textellipsis");j(ae,ye,a9,"…","\\mathellipsis");j(Dt,ye,a9,"…","\\ldots",!0);j(ae,ye,a9,"…","\\ldots",!0);j(ae,ye,a9,"⋯","\\@cdots",!0);j(ae,ye,a9,"⋱","\\ddots",!0);j(ae,ye,Qe,"⋮","\\varvdots");j(Dt,ye,Qe,"⋮","\\varvdots");j(ae,ye,pa,"ˊ","\\acute");j(ae,ye,pa,"ˋ","\\grave");j(ae,ye,pa,"¨","\\ddot");j(ae,ye,pa,"~","\\tilde");j(ae,ye,pa,"ˉ","\\bar");j(ae,ye,pa,"˘","\\breve");j(ae,ye,pa,"ˇ","\\check");j(ae,ye,pa,"^","\\hat");j(ae,ye,pa,"⃗","\\vec");j(ae,ye,pa,"˙","\\dot");j(ae,ye,pa,"˚","\\mathring");j(ae,ye,zr,"","\\@imath");j(ae,ye,zr,"","\\@jmath");j(ae,ye,Qe,"ı","ı");j(ae,ye,Qe,"ȷ","ȷ");j(Dt,ye,Qe,"ı","\\i",!0);j(Dt,ye,Qe,"ȷ","\\j",!0);j(Dt,ye,Qe,"ß","\\ss",!0);j(Dt,ye,Qe,"æ","\\ae",!0);j(Dt,ye,Qe,"œ","\\oe",!0);j(Dt,ye,Qe,"ø","\\o",!0);j(Dt,ye,Qe,"Æ","\\AE",!0);j(Dt,ye,Qe,"Œ","\\OE",!0);j(Dt,ye,Qe,"Ø","\\O",!0);j(Dt,ye,pa,"ˊ","\\'");j(Dt,ye,pa,"ˋ","\\`");j(Dt,ye,pa,"ˆ","\\^");j(Dt,ye,pa,"˜","\\~");j(Dt,ye,pa,"ˉ","\\=");j(Dt,ye,pa,"˘","\\u");j(Dt,ye,pa,"˙","\\.");j(Dt,ye,pa,"¸","\\c");j(Dt,ye,pa,"˚","\\r");j(Dt,ye,pa,"ˇ","\\v");j(Dt,ye,pa,"¨",'\\"');j(Dt,ye,pa,"˝","\\H");j(Dt,ye,pa,"◯","\\textcircled");var LMe={"--":!0,"---":!0,"``":!0,"''":!0};j(Dt,ye,Qe,"–","--",!0);j(Dt,ye,Qe,"–","\\textendash");j(Dt,ye,Qe,"—","---",!0);j(Dt,ye,Qe,"—","\\textemdash");j(Dt,ye,Qe,"‘","`",!0);j(Dt,ye,Qe,"‘","\\textquoteleft");j(Dt,ye,Qe,"’","'",!0);j(Dt,ye,Qe,"’","\\textquoteright");j(Dt,ye,Qe,"“","``",!0);j(Dt,ye,Qe,"“","\\textquotedblleft");j(Dt,ye,Qe,"”","''",!0);j(Dt,ye,Qe,"”","\\textquotedblright");j(ae,ye,Qe,"°","\\degree",!0);j(Dt,ye,Qe,"°","\\degree");j(Dt,ye,Qe,"°","\\textdegree",!0);j(ae,ye,Qe,"£","\\pounds");j(ae,ye,Qe,"£","\\mathsterling",!0);j(Dt,ye,Qe,"£","\\pounds");j(Dt,ye,Qe,"£","\\textsterling",!0);j(ae,Ge,Qe,"✠","\\maltese");j(Dt,Ge,Qe,"✠","\\maltese");var b0e='0123456789/@."';for(var hF=0;hF{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 M0e[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return WVt[a]}else{if(n===120485||n===120486)return M0e[0];if(120486{if(Xg(t.classes)!==Xg(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},IMe=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},Ft=function(e,r,n,i){var a=new i9(e,r,n,i);return nte(a),a},Zg=(t,e,r,n)=>new i9(t,e,r,n),r4=function(e,r,n){var i=Ft([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Xt(i.height),i.maxFontSize=1,i},XVt=function(e,r,n,i){var a=new t_(e,r,n,i);return nte(a),a},cp=function(e){var r=new n9(e);return nte(r),r},n4=function(e,r){return e instanceof n9?Ft([],[e],r):e},KVt=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=Ft(["mspace"],[],e),n=xa(t,e);return r.style.marginRight=Xt(n),r},pE=(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},Lq={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"}},DMe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},OMe=function(e,r){var n=DMe[e],i=n[0],a=n[1],s=n[2],o=new Kg(i),l=new P0([o],{width:Xt(a),height:Xt(s),style:"width:"+Xt(a),viewBox:"0 0 "+1e3*a+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),u=Zg(["katex-overlay"],[l],r);return u.height=s,u.style.height=Xt(s),u.style.width=Xt(a),u},ya={number:3,unit:"mu"},nm={number:4,unit:"mu"},Lf={number:5,unit:"mu"},ZVt={mord:{mop:ya,mbin:nm,mrel:Lf,minner:ya},mop:{mord:ya,mop:ya,mrel:Lf,minner:ya},mbin:{mord:nm,mop:nm,mopen:nm,minner:nm},mrel:{mord:Lf,mop:Lf,mopen:Lf,minner:Lf},mopen:{},mclose:{mop:ya,mbin:nm,mrel:Lf,minner:ya},mpunct:{mord:ya,mop:ya,mrel:Lf,mopen:ya,mclose:ya,mpunct:ya,minner:ya},minner:{mord:ya,mop:ya,mbin:nm,mrel:Lf,mopen:ya,mpunct:ya,minner:ya}},JVt={mord:{mop:ya},mop:{mord:ya,mop:ya},mbin:{},mrel:{},mopen:{},mclose:{mop:ya},mpunct:{},minner:{mop:ya}},_Me={},PT={},BT={};function sr(t){for(var e=t.type,r=t.names,n=t.htmlBuilder,i=t.mathmlBuilder,a=0;a{var U=m.classes[0],y=g.classes[0];U==="mbin"&&eHt.has(y)?m.classes[0]="mord":y==="mbin"&&QVt.has(U)&&(g.classes[0]="mord")},{node:d},f,p),Iq(a,(g,m)=>{var U,y,b=Dq(m),v=Dq(g),w=b&&v?g.hasClass("mtight")?(U=JVt[b])==null?void 0:U[v]:(y=ZVt[b])==null?void 0:y[v]:null;if(w)return NMe(w,u)},{node:d},f,p),a},Iq=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()},PMe=function(e){return e instanceof n9||e instanceof t_||e instanceof i9&&e.hasClass("enclosing")?e:null},Nq=function(e,r){var n=PMe(e);if(n){var i=n.children;if(i.length){if(r==="right")return Nq(i[i.length-1],"right");if(r==="left")return Nq(i[0],"left")}}return e},Dq=function(e,r){if(!e)return null;r&&(e=Nq(e,r));var n=e.classes[0];return rHt[n]||null},$T=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Ft(r.concat(n))},mi=function(e,r,n){if(!e)return Ft();if(PT[e.type]){var i=PT[e.type](e,r);if(n&&r.size!==n.size){i=Ft(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new Yt("Got group of unknown type: '"+e.type+"'")};function gE(t,e){var r=Ft(["katex-base"],t,e),n=Ft(["katex-strut"]);return n.style.height=Xt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Xt(-r.depth)),r.children.unshift(n),r}function Oq(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Bs(t,e,"root"),i;n.length===2&&n[1].hasClass("katex-tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(gE(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(gE(s,e));var u;r?(u=gE(Bs(r,e,!0),e),u.classes=["katex-tag"],a.push(u)):i&&a.push(i);var h=Ft(["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 BMe(t){return new n9(t)}let qt=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 of Object.entries(this.attributes)){var n=r[0],i=r[1];e.setAttribute(n,i)}this.classes.length>0&&(e.className=Xg(this.classes));for(var a=0;a0&&(e+=' class ="'+Jo(Xg(this.classes))+'"'),e+=">";for(var a=0;a",e}toText(){return this.children.map(e=>e.toText()).join("")}},ds=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Jo(this.toText())}toText(){return this.text}},$Me=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 nHt=new Set(["\\imath","\\jmath"]),iHt=new Set(["mrow","mtable"]),Gu=function(e,r,n){var i,a;return ua[r][e]&&ua[r][e].replace&&e.charCodeAt(0)!==55349&&!(Object.prototype.hasOwnProperty.call(LMe,e)&&((n==null||(i=n.fontFamily)==null?void 0:i.slice(4,6))==="tt"||(n==null||(a=n.font)==null?void 0:a.slice(4,6))==="tt"))&&(e=ua[r][e].replace),new ds(e)},ite=function(e){return e.length===1?e[0]:new qt("mrow",e)},aHt={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"},ate=(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=aHt[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(nHt.has(a))return null;if(ua[n][a]){var s=ua[n][a].replace;s&&(a=s)}var o=Lq[r].fontName;return tte(a,o,n)?Lq[r].variant:null};function gF(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ds&&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 ds&&r.text===","}else return!1}var ou=function(e,r,n){if(e.length===1){var i=Ii(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"||gF(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 ds&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ds&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},Jg=function(e,r,n){return ite(ou(e,r,n))},Ii=function(e,r){if(!e)return new qt("mrow");if(BT[e.type])return BT[e.type](e,r);throw new Yt("Got group of unknown type: '"+e.type+"'")};function R0e(t,e,r,n,i){var a=ou(t,r),s;a.length===1&&a[0]instanceof qt&&iHt.has(a[0].type)?s=a[0]:s=new qt("mrow",a);var o=new qt("annotation",[new ds(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 Ft([h],[u])}var sHt=[[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]],L0e=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],I0e=function(e,r){return r.size<2?e:sHt[e-1][r.size-1]};let FMe=class wm{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||wm.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=L0e[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 wm(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:I0e(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:L0e[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=I0e(wm.BASESIZE,e);return this.size===r&&this.textSize===wm.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?["katex-sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==wm.BASESIZE?["katex-sizing","reset-size"+this.size,"size"+wm.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=HVt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};FMe.BASESIZE=6;var zMe=function(e){return new FMe({style:e.displayMode?fn.DISPLAY:fn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},VMe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Ft(n,[e])}return e},oHt=function(e,r,n){var i=zMe(n),a;if(n.output==="mathml")return R0e(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=Oq(e,i);a=Ft(["katex"],[s])}else{var o=R0e(e,r,i,n.displayMode,!1),l=Oq(e,i);a=Ft(["katex"],[o,l])}return VMe(a,n)},lHt=function(e,r,n){var i=zMe(n),a=Oq(e,i),s=Ft(["katex"],[a]);return VMe(s,n)},cHt={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":"="},i_=function(e){var r=new qt("mo",[new ds(cHt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},uHt={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]},hHt=new Set(["widehat","widecheck","widetilde","utilde"]),a_=function(e,r){function n(){var l=4e5,u=e.label.slice(1);if(hHt.has(u)&&"base"in e){var h=e.base.type==="ordgroup"?e.base.body.length:1,d,f,p;if(h>5)u==="widehat"||u==="widecheck"?(d=420,l=2364,p=.42,f=u+"4"):(d=312,l=2340,p=.34,f="tilde4");else{var g=[1,1,2,2,3,3][h];u==="widehat"||u==="widecheck"?(l=[0,1062,2364,2364,2364][g],d=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],f=u+g):(l=[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 Kg(f),U=new P0([m],{width:"100%",height:Xt(p),viewBox:"0 0 "+l+" "+d,preserveAspectRatio:"none"});return{span:Zg([],[U],r),minWidth:0,height:p}}else{var y=[],b=uHt[u];if(!b)throw new Error('No SVG data for "'+u+'".');var v=b[0],w=b[1],T=b[2],k=T/1e3,C=v.length,S,E;if(C===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+u+'".');S=["hide-tail"],E=[b[3]]}else if(C===2)S=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(C===3)S=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+C+" children.");for(var A=0;A0&&(a.style.minWidth=Xt(s)),a},dHt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=Ft(["katex-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 kq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new kq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new P0(u,{width:"100%",height:Xt(o)});s=Zg([],[h],a)}return s.height=o,s.style.height=Xt(o),s},fHt=["bin","close","inner","open","punct","rel"],pHt=["accent-token","mathord","op-token","spacing","textord"],gHt=new Set(fHt),mHt=new Set(pHt);function UHt(t){return gHt.has(t)}function xn(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 s_(t){var e=o_(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 o_(t){return t.type==="atom"||mHt.has(t.type)?t:null}var HMe=t=>{if(t instanceof tu)return t;if(zVt(t)&&t.children.length===1)return HMe(t.children[0])},GMe=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=xn(t.base,"accent"),r=n.base,t.base=r,i=FVt(mi(t,e)),t.base=n):(n=xn(t,"accent"),r=n.base);var a=mi(r,e.havingCrampedStyle()),s=n.isShifty&&op(r),o=0;if(s){var l,u;o=(l=(u=HMe(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=a_(n,e),f=pi({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}]});else{var p,g;n.label==="\\vec"?(p=OMe("vec",e),g=DMe.vec[1]):(p=n_({type:"textord",mode:n.mode,text:n.label},e),p=$Vt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Ft(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var U=o;m||(U-=g/2),f.style.left=Xt(U),n.label==="\\textcircled"&&(f.style.top=".2em"),f=pi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=Ft(["mord","katex-accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},yHt=(t,e)=>{var r=t.isStretchy?i_(t.label):new qt("mo",[Gu(t.label,t.mode)]),n=new qt("mover",[Ii(t.base,e),r]);return n.setAttribute("accent","true"),n},bHt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));sr({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"],numArgs:1,handler:(t,e)=>{var r=EI(e[0]),n=!bHt.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:GMe,mathmlBuilder:yHt});sr({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],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}}});sr({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=mi(t.base,e),n=a_(t,e),i=t.label==="\\utilde"?.12:0,a=pi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Ft(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=i_(t.label),n=new qt("munder",[Ii(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var mE=t=>{var e=new qt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};sr({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"],numArgs:1,numOptionalArgs:1,handler(t,e,r){var n=t.parser,i=t.funcName;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=n4(mi(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=n4(mi(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=a_(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=pi({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=pi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Ft(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=i_(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=mE(Ii(t.body,e));if(t.below){var a=mE(Ii(t.below,e));n=new qt("munderover",[r,a,i])}else n=new qt("mover",[r,i])}else if(t.below){var s=mE(Ii(t.below,e));n=new qt("munder",[r,s])}else n=mE(),n=new qt("mover",[r,n]);return n}});function vHt(t,e){var r=Bs(t.body,e,!0);return Ft([t.mclass],r,e)}function xHt(t,e){var r,n=ou(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")),r}sr({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:hs(i),isCharacterBox:op(i)}},htmlBuilder:vHt,mathmlBuilder:xHt});var l_=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"};sr({type:"mclass",names:["\\@binrel"],numArgs:2,handler(t,e){var r=t.parser;return{type:"mclass",mode:r.mode,mclass:l_(e[0]),body:hs(e[1]),isCharacterBox:op(e[1])}}});sr({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(t,e){var r=t.parser,n=t.funcName,i=e[1],a=e[0],s;n!=="\\stackrel"?s=l_(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:hs(i)},l=n==="\\underset"?{type:"supsub",mode:a.mode,base:o,sub:a}:{type:"supsub",mode:a.mode,base:o,sup:a};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:op(l)}}});sr({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser;return{type:"pmb",mode:r.mode,mclass:l_(e[0]),body:hs(e[0])}},htmlBuilder(t,e){var r=Bs(t.body,e,!0),n=Ft([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=ou(t.body,e),n=new qt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var wHt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},N0e=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),D0e=t=>t.type==="textord"&&t.text==="@",THt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function CHt(t,e,r){var n=wHt[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 kHt(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 Yt("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=CHt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=N0e()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var U=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:U,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}sr({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=n4(mi(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 qt("mrow",[Ii(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}});sr({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(t,e){var r=t.parser;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=n4(mi(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new qt("mrow",[Ii(t.fragment,e)])}});sr({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(t,e){for(var r=t.parser,n=xn(e[0],"ordgroup"),i=n.body,a="",s=0;s=1114111)throw new Yt("\\@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 SHt=(t,e)=>{var r=Bs(t.body,e.withColor(t.color),!1);return cp(r)},EHt=(t,e)=>{var r=ou(t.body,e.withColor(t.color)),n=new qt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};sr({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(t,e){var r=t.parser,n=xn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:hs(i)}},htmlBuilder:SHt,mathmlBuilder:EHt});sr({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(t,e){var r=t.parser,n=t.breakOnTokenText,i=xn(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}}});sr({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(t,e,r){var n=t.parser,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&&xn(i,"size").value}},htmlBuilder(t,e){var r=Ft(["mspace"],[],e);return t.newLine&&(r.classes.push("katex-newline"),t.size&&(r.style.marginTop=Xt(xa(t.size,e)))),r},mathmlBuilder(t,e){var r=new qt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Xt(xa(t.size,e)))),r}});var _q={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},WMe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Yt("Expected a control sequence",t);return e},AHt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},qMe=(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)};sr({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(t){var e=t.parser,r=t.funcName;e.consumeSpaces();var n=e.fetch();if(_q[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=_q[n.text]),xn(e.parseFunction(),"internal");throw new Yt("Invalid token after macro prefix",n)}});sr({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new Yt("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 Yt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new Yt('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new Yt("Expected a macro definition");o[a].push(n.text)}var l=e.gullet.consumeArg(),u=l.tokens;return s&&u.unshift(s),(r==="\\edef"||r==="\\xdef")&&(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(i,{tokens:u,numArgs:a,delimiters:o},r===_q[r]),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=WMe(e.gullet.popToken());e.gullet.consumeSpaces();var i=AHt(e);return qMe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});sr({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(t){var e=t.parser,r=t.funcName,n=WMe(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return qMe(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var X3=function(e,r,n){var i=ua.math[e]&&ua.math[e].replace,a=tte(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},ste=function(e,r,n,i){var a=n.havingBaseStyle(r),s=Ft(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},jMe=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},MHt=function(e,r,n,i,a,s){var o=wl(e,"Main-Regular",a,i),l=ste(o,r,i,s);return jMe(l,i,r),l},RHt=function(e,r,n,i){return wl(e,"Size"+r+"-Regular",n,i)},YMe=function(e,r,n,i,a,s){var o=RHt(e,r,a,i),l=ste(Ft(["delimsizing","size"+r],[o],i),fn.TEXT,i,s);return n&&jMe(l,i,fn.TEXT),l},mF=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Ft(["delimsizinginner",i],[Ft([],[wl(e,r,n)])]);return{type:"elem",elem:a}},UF=function(e,r,n){var i=Ld["Size4-Regular"][e.charCodeAt(0)]?Ld["Size4-Regular"][e.charCodeAt(0)][4]:Ld["Size1-Regular"][e.charCodeAt(0)][4],a=new Kg("inner",IVt(e,Math.round(1e3*r))),s=new P0([a],{width:Xt(i),height:Xt(r),style:"width:"+Xt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Zg([],[s],n);return o.height=r,o.style.height=Xt(r),o.style.width=Xt(i),{type:"elem",elem:o}},Pq=.008,UE={type:"kern",size:-1*Pq},LHt=new Set(["|","\\lvert","\\rvert","\\vert"]),IHt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),XMe=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"):LHt.has(e)?(u="∣",d="vert",f=333):IHt.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=X3(o,p,a),m=g.height+g.depth,U=X3(u,p,a),y=U.height+U.depth,b=X3(h,p,a),v=b.height+b.depth,w=0,T=1;if(l!==null){var k=X3(l,p,a);w=k.height+k.depth,T=2}var C=m+v+w,S=Math.max(0,Math.ceil((r-C)/(T*y))),E=C+S*T*y,A=i.fontMetrics().axisHeight;n&&(A*=i.sizeMultiplier);var R=E/2-A,_=[];if(d.length>0){var N=E-m-v,L=Math.round(E*1e3),I=NVt(d,Math.round(N*1e3)),P=new Kg(d,I),O=Xt(f/1e3),D=Xt(L/1e3),B=new P0([P],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),F=Zg([],[B],i);F.height=L/1e3,F.style.width=O,F.style.height=D,_.push({type:"elem",elem:F})}else{if(_.push(mF(h,p,a)),_.push(UE),l===null){var z=E-m-v+2*Pq;_.push(UF(u,z,i))}else{var $=(E-m-v-w)/2+2*Pq;_.push(UF(u,$,i)),_.push(UE),_.push(mF(l,p,a)),_.push(UE),_.push(UF(u,$,i))}_.push(UE),_.push(mF(o,p,a))}var V=i.havingBaseStyle(fn.TEXT),H=pi({positionType:"bottom",positionData:R,children:_});return ste(Ft(["delimsizing","mult"],[H],V),fn.TEXT,i,s)},yF=80,bF=.08,vF=function(e,r,n,i,a){var s=LVt(e,i,n),o=new Kg(e,s),l=new P0([o],{width:"400em",height:Xt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Zg(["hide-tail"],[l],a)},NHt=function(e,r){var n=r.havingBaseSizing(),i=eRe("\\surd",e*n.sizeMultiplier,QMe,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+yF,e<1?a=1:e<1.4&&(a=.7),l=(1+s+bF)/a,u=(1+s)/a,o=vF("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+yF)*nw[i.size],u=(nw[i.size]+s)/a,l=(nw[i.size]+s+bF)/a,o=vF("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+bF,u=e+s,h=Math.floor(1e3*e+s)+yF,o=vF("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}},KMe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),DHt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),ZMe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),nw=[0,1.2,1.8,2.4,3],JMe=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),KMe.has(e)||ZMe.has(e))return YMe(e,r,!1,n,i,a);if(DHt.has(e))return XMe(e,nw[r],!1,n,i,a);throw new Yt("Illegal delimiter: '"+e+"'")},OHt=[{type:"small",style:fn.SCRIPTSCRIPT},{type:"small",style:fn.SCRIPT},{type:"small",style:fn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],_Ht=[{type:"small",style:fn.SCRIPTSCRIPT},{type:"small",style:fn.SCRIPT},{type:"small",style:fn.TEXT},{type:"stack"}],QMe=[{type:"small",style:fn.SCRIPTSCRIPT},{type:"small",style:fn.SCRIPT},{type:"small",style:fn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],PHt=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.")},eRe=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]},Bq=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;ZMe.has(e)?o=OHt:KMe.has(e)?o=QMe:o=_Ht;var l=eRe(e,r,o,i);return l.type==="small"?MHt(e,l.style,n,i,a,s):l.type==="large"?YMe(e,l.size,n,i,a,s):XMe(e,r,n,i,a,s)},xF=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 Bq(e,d,!0,i,a,s)},O0e={"\\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}},BHt=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 _0e(t){return"isMiddle"in t}function c_(t,e){var r=o_(t);if(r&&BHt.has(r.text))return r;throw r?new Yt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Yt("Invalid delimiter type '"+t.type+"'",t)}sr({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(t,e)=>{var r=c_(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:O0e[t.funcName].size,mclass:O0e[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Ft([t.mclass]):JMe(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Gu(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=Xt(nw[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function P0e(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}sr({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new Yt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:c_(e[0],t).text,color:r}}});sr({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=c_(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=xn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{P0e(t);for(var r=Bs(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{P0e(t);var r=ou(t.body,e);if(t.left!=="."){var n=new qt("mo",[Gu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new qt("mo",[Gu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return ite(r)}});sr({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=c_(e[0],t);if(!t.parser.leftrightDepth)throw new Yt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=$T(e,[]):(r=JMe(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Gu("|","text"):Gu(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 $Ht=(t,e)=>{var r=n4(mi(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=op(t.body);if(n==="sout")a=Ft(["katex-stretchy","katex-sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=xa({number:.6,unit:"pt"},e),u=xa({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=MVt(f),g=new P0([new Kg("phase",p)],{width:"400em",height:Xt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Zg(["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,U,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),U=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,U=Math.max(0,.25-r.depth)):(m=o?.2:0,U=m),a=dHt(r,n,m,U,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Xt(y)):n==="angl"&&y!==.049&&(a.style.borderTopWidth=Xt(y),a.style.borderRightWidth=Xt(y)),s=r.depth+U,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=pi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var v=/cancel|phase/.test(n)?["svg-align"]:[];b=pi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:v}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?Ft(["mord","cancel-lap"],[b],e):Ft(["mord"],[b],e)},FHt=(t,e)=>{var r,n=new qt(t.label.includes("colorbox")?"mpadded":"menclose",[Ii(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: "+Xt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};sr({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(t,e,r){var n=t.parser,i=t.funcName,a=xn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:$Ht,mathmlBuilder:FHt});sr({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(t,e,r){var n=t.parser,i=t.funcName,a=xn(e[0],"color-token").color,s=xn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}}});sr({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(t,e){var r=t.parser;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});sr({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}}});sr({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName;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}}});sr({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(t,e){var r=t.parser;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var tRe={};function uf(t){for(var e=t.type,r=t.names,n=t.props,i=t.handler,a=t.htmlBuilder,s=t.mathmlBuilder,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 Yt("{"+t.envName+"} can be used only in display mode.")},zHt=new Set(["gather","gather*"]);function ote(t){if(!t.includes("ed"))return!t.includes("*")}function E1(t,e,r){var n=e.hskipBeforeAndAfter,i=e.addJot,a=e.cols,s=e.arraystretch,o=e.colSeparationType,l=e.autoTag,u=e.singleRow,h=e.emptySingleRow,d=e.maxNumCols,f=e.leqno;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 Yt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],U=[],y=[],b=l!=null?[]:void 0;function v(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Ih("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(v(),y.push(B0e(t));;){var T=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var k={type:"ordgroup",mode:t.mode,body:T};r&&(k={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[k]}),g.push(k);var C=t.fetch().text;if(C==="&"){if(d&&g.length===d){if(u||o)throw new Yt("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"){w(),g.length===1&&k.type==="styling"&&k.body.length===1&&k.body[0].type==="ordgroup"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length0&&(v+=.25),u.push({pos:v,isDashed:Te[re]})}for(w(s[0]),n=0;n0&&(R+=b,CTe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var J,ne;Z=(J=(ne=V)==null?void 0:ne.pregap)!=null?J:f,Z!==0&&(I=Ft(["arraycolsep"],[]),I.style.width=Xt(Z),L.push(I))}var ie=[];for(n=0;n0){for(var ge=r4("katex-hline",r,h),ze=r4("katex-hdashline",r,h),xe=[{type:"elem",elem:we,shift:0}];u.length>0;){var Ee=u.pop(),qe=Ee.pos-_;Ee.isDashed?xe.push({type:"elem",elem:ze,shift:qe}):xe.push({type:"elem",elem:ge,shift:qe})}we=pi({positionType:"individualShift",children:xe})}if(O.length===0)return Ft(["mord"],[we],r);var le=pi({positionType:"individualShift",children:O}),pe=Ft(["katex-tag"],[le],r);return cp([we,pe])},VHt={c:"center ",l:"left ",r:"right "},df=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="",U=!1,y=0,b=g.length;g[0].type==="separator"&&(f+="top ",y=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var v=y;v0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A0&&f&&(m=1),n[p]={type:"align",align:g,pregap:m,postgap:0}}return a.colSeparationType=f?"align":"alignat",a};uf({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=o_(e[0]),n=r?[e[0]]:xn(e[0],"ordgroup").body,i=n.map(function(s){var o=s_(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 Yt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return E1(t.parser,a,lte(t.envName))},htmlBuilder:hf,mathmlBuilder:df});uf({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 Yt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=E1(t.parser,n,lte(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:hf,mathmlBuilder:df});uf({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=E1(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=o_(e[0]),n=r?[e[0]]:xn(e[0],"ordgroup").body,i=n.map(function(o){var l=s_(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Yt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Yt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=E1(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Yt("{subarray} can contain only one column");return s},htmlBuilder:hf,mathmlBuilder:df});uf({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=E1(t.parser,e,lte(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:aRe,htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){zHt.has(t.envName)&&u_(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ote(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return E1(t.parser,e,"display")},htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:aRe,htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){u_(t);var e={autoTag:ote(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return E1(t.parser,e,"display")},htmlBuilder:hf,mathmlBuilder:df});uf({type:"array",names:["CD"],props:{numArgs:0},handler(t){return u_(t),kHt(t.parser)},htmlBuilder:hf,mathmlBuilder:df});ke("\\nonumber","\\gdef\\@eqnsw{0}");ke("\\notag","\\nonumber");sr({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(t,e){throw new Yt(t.funcName+" valid only within array environment")}});var $0e=tRe;sr({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(t,e){var r=t.parser,n=t.funcName,i=e[0];if(i.type!=="ordgroup")throw new Yt("Invalid environment name",i);for(var a="",s=0;s{var r=t.font,n=e.withFont(r);return mi(t.body,n)},GHt=(t,e)=>{var r=t.font,n=e.withFont(r);return Ii(t.body,n)},F0e={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};sr({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=EI(e[0]),a=n in F0e?F0e[n]:n;return{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:HHt,mathmlBuilder:GHt});sr({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"mclass",mode:r.mode,mclass:l_(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:op(n)}}});sr({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=t.breakOnTokenText,a=r.mode,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}}});var WHt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=mi(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 U;if(h){var b=e.fontMetrics().axisHeight;p-s.depth-(b+.5*d){var r=new qt("mfrac",[Ii(t.numer,e),Ii(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=xa(t.barSize,e);r.setAttribute("linethickness",Xt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new qt("mo",[new ds(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new qt("mo",[new ds(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return ite(i)}return r},sRe=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};sr({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,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"),sRe({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:WHt,mathmlBuilder:qHt});sr({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(t){var e=t.parser,r=t.funcName,n=t.token,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 z0e=["display","text","script","scriptscript"],V0e=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};sr({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(t,e){var r=t.parser,n=e[4],i=e[5],a=EI(e[0]),s=a.type==="atom"&&a.family==="open"?V0e(a.text):null,o=EI(e[1]),l=o.type==="atom"&&o.family==="close"?V0e(o.text):null,u=xn(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=xn(p.body[0],"textord");f=z0e[Number(g.text)]}}else p=xn(p,"textord"),f=z0e[Number(p.text)];return sRe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});sr({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(t,e){var r=t.parser;t.funcName;var n=t.token;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:xn(e[0],"size").value,token:n}}});sr({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(t,e)=>{var r=t.parser;t.funcName;var n=e[0],i=xn(e[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=e[2],s=i.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null}}});var oRe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?mi(t.sup,e.havingStyle(r.sup()),e):mi(t.sub,e.havingStyle(r.sub()),e),i=xn(t.base,"horizBrace")):i=xn(t,"horizBrace");var a=mi(i.base,e.havingBaseStyle(fn.DISPLAY)),s=a_(i,e),o;if(i.isOver?o=pi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=pi({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=Ft(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=pi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=pi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Ft(["minner",i.isOver?"mover":"munder"],[o],e)},jHt=(t,e)=>{var r=i_(t.label);return new qt(t.isOver?"mover":"munder",[Ii(t.base,e),r])};sr({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(t,e){var r=t.parser,n=t.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:oRe,mathmlBuilder:jHt});sr({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[1],i=xn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:hs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Bs(t.body,e,!1);return XVt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=Jg(t.body,e);return r instanceof qt||(r=new qt("mrow",[r])),r.setAttribute("href",t.href),r}});sr({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=xn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a{var r=t.parser,n=t.funcName;t.token;var i=xn(e[0],"raw").string,a=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,o={};switch(n){case"\\htmlClass":o.class=i,s={command:"\\htmlClass",class:i};break;case"\\htmlId":o.id=i,s={command:"\\htmlId",id:i};break;case"\\htmlStyle":o.style=i,s={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var l="{,}",u=[],h="",d=0;d{var r=Bs(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Ft(n,r,e);for(var a of Object.entries(t.attributes)){var s=a[0],o=a[1];s!=="class"&&i.setAttribute(s,o)}return i},mathmlBuilder:(t,e)=>Jg(t.body,e)});sr({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(t,e)=>{var r=t.parser;return{type:"htmlmathml",mode:r.mode,html:hs(e[0]),mathml:hs(e[1])}},htmlBuilder:(t,e)=>{var r=Bs(t.html,e,!1);return cp(r)},mathmlBuilder:(t,e)=>Jg(t.mathml,e)});var wF=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 Yt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!EMe(n))throw new Yt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};sr({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(t,e,r)=>{var n=t.parser,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=xn(r[0],"raw").string,u=l.split(","),h=0;h{var r=xa(t.height,e),n=0;t.totalheight.number>0&&(n=xa(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=xa(t.width,e));var a={height:Xt(r+n)};i>0&&(a.width=Xt(i)),n>0&&(a.verticalAlign=Xt(-n));var s=new PVt(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=xa(t.height,e),i=0;if(t.totalheight.number>0&&(i=xa(t.totalheight,e)-n,r.setAttribute("valign",Xt(-i))),r.setAttribute("height",Xt(n+i)),t.width.number>0){var a=xa(t.width,e);r.setAttribute("width",Xt(a))}return r.setAttribute("src",t.src),r}});sr({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName,i=xn(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 NMe(t.dimension,e)},mathmlBuilder(t,e){var r=xa(t.dimension,e);return new $Me(r)}});sr({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=Ft([],[mi(t.body,e)]),r=Ft(["katex-inner"],[r],e)):r=Ft(["katex-inner"],[mi(t.body,e)]);var n=Ft(["katex-fix"],[]),i=Ft([t.alignment],[r,n],e),a=Ft(["katex-strut"]);return a.style.height=Xt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Xt(-i.depth)),i.children.unshift(a),i=Ft(["katex-thinbox"],[i],e),Ft(["mord","katex-vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new qt("mpadded",[Ii(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}});sr({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){var r=t.funcName,n=t.parser,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}}});sr({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(t,e){throw new Yt("Mismatched "+t.funcName)}});var H0e=(t,e)=>{switch(e.style.size){case fn.DISPLAY.size:return t.display;case fn.TEXT.size:return t.text;case fn.SCRIPT.size:return t.script;case fn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};sr({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(t,e)=>{var r=t.parser;return{type:"mathchoice",mode:r.mode,display:hs(e[0]),text:hs(e[1]),script:hs(e[2]),scriptscript:hs(e[3])}},htmlBuilder:(t,e)=>{var r=H0e(t,e),n=Bs(r,e,!1);return cp(n)},mathmlBuilder:(t,e)=>{var r=H0e(t,e);return Jg(r,e)}});var lRe=(t,e,r,n,i,a,s)=>{t=Ft([],[t]);var o=r&&op(r),l,u;if(e){var h=mi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=mi(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=pi({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}]})}else if(l){var g=t.height-s;f=pi({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}]})}else if(u){var m=t.depth+s;f=pi({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}]})}else return t;var U=[f];if(l&&a!==0&&!o){var y=Ft(["mspace"],[],n);y.style.marginRight=Xt(a),U.unshift(y)}return Ft(["mop","op-limits"],U,n)},cRe=new Set(["\\smallint"]),uRe=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=xn(t.base,"op"),i=!0):a=xn(t,"op");var s=e.style,o=!1;s.size===fn.DISPLAY.size&&a.symbol&&!cRe.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=wl(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=OMe(d+"Size"+(o?"2":"1"),e);l=pi({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=Bs(a.body,e,!0);p.length===1&&p[0]instanceof tu?(l=p[0],l.classes[0]="mop"):l=Ft(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new qt("mo",[Gu(t.name,t.mode)]),cRe.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new qt("mo",ou(t.body,e));else{r=new qt("mi",[new ds(t.name.slice(1))]);var n=new qt("mo",[Gu("⁡","text")]);t.parentIsSupSub?r=new qt("mrow",[r,n]):r=BMe([r,n])}return r},XHt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};sr({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=n;return i.length===1&&(i=XHt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:uRe,mathmlBuilder:YHt});sr({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:hs(n)}}});var KHt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};sr({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"],numArgs:0,handler(t){var e=t.parser,r=t.funcName;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}}});sr({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(t){var e=t.parser,r=t.funcName;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}}});sr({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(t){var e=t.parser,r=t.funcName,n=r;return n.length===1&&(n=KHt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var hRe=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=xn(t.base,"operatorname"),i=!0):a=xn(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=Bs(o,e.withFont("mathrm"),!0),u=0;u{for(var r=ou(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new ds(o)]}var l=new qt("mi",r);l.setAttribute("mathvariant","normal");var u=new qt("mo",[Gu("⁡","text")]);return t.parentIsSupSub?new qt("mrow",[l,u]):BMe([l,u])};sr({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(t,e)=>{var r=t.parser,n=t.funcName,i=e[0];return{type:"operatorname",mode:r.mode,body:hs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:hRe,mathmlBuilder:ZHt});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");I5({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?cp(Bs(t.body,e,!1)):Ft(["mord"],Bs(t.body,e,!0),e)},mathmlBuilder(t,e){return Jg(t.body,e,!0)}});sr({type:"overline",names:["\\overline"],numArgs:1,handler(t,e){var r=t.parser,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=mi(t.body,e.havingCrampedStyle()),n=r4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=pi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Ft(["mord","katex-overline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ds("‾")]);r.setAttribute("stretchy","true");var n=new qt("mover",[Ii(t.body,e),r]);return n.setAttribute("accent","true"),n}});sr({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"phantom",mode:r.mode,body:hs(n)}},htmlBuilder:(t,e)=>{var r=Bs(t.body,e.withPhantom(),!1);return cp(r)},mathmlBuilder:(t,e)=>{var r=ou(t.body,e);return new qt("mphantom",r)}});ke("\\hphantom","\\smash{\\phantom{#1}}");sr({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(t,e)=>{var r=t.parser,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=Ft(["katex-inner"],[mi(t.body,e.withPhantom())]),n=Ft(["katex-fix"],[]);return Ft(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=ou(hs(t.body),e),n=new qt("mphantom",r),i=new qt("mpadded",[n]);return i.setAttribute("width","0px"),i}});sr({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(t,e){var r=t.parser,n=xn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=mi(t.body,e),n=xa(t.dy,e);return pi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Ii(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});sr({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(t){var e=t.parser;return{type:"internal",mode:e.mode}}});sr({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(t,e,r){var n=t.parser,i=r[0],a=xn(e[0],"size"),s=xn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&xn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=Ft(["mord","katex-rule"],[],e),n=xa(t.width,e),i=xa(t.height,e),a=t.shift?xa(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=xa(t.width,e),n=xa(t.height,e),i=t.shift?xa(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new qt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Xt(r)),s.setAttribute("height",Xt(n));var o=new qt("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 dRe(t,e,r){for(var n=Bs(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return dRe(t.body,r,e)};sr({type:"sizing",names:G0e,numArgs:0,allowedInText:!0,handler:(t,e)=>{var r=t.breakOnTokenText,n=t.funcName,i=t.parser,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:G0e.indexOf(n)+1,body:a}},htmlBuilder:JHt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=ou(t.body,r),i=new qt("mstyle",n);return i.setAttribute("mathsize",Xt(r.sizeMultiplier)),i}});sr({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(t,e,r)=>{var n=t.parser,i=!1,a=!1,s=r[0]&&xn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=Ft([],[mi(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 Ft(["mord","katex-smash"],[r],e);if(r.children)for(var n=0;n{var r=new qt("mpadded",[Ii(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});sr({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(t,e,r){var n=t.parser,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=mi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=n4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+s&&(s=(s+f-r.height-r.depth)/2);var p=u.height-r.height-s-h;r.style.paddingLeft=Xt(d);var g=pi({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+p)},{type:"elem",elem:u},{type:"kern",size:h}]});if(t.index){var m=e.havingStyle(fn.SCRIPTSCRIPT),U=mi(t.index,m,e),y=.6*(g.height-g.depth),b=pi({positionType:"shift",positionData:-y,children:[{type:"elem",elem:U}]}),v=Ft(["katex-root"],[b]);return Ft(["mord","sqrt"],[v,g],e)}else return Ft(["mord","sqrt"],[g],e)},mathmlBuilder(t,e){var r=t.body,n=t.index;return n?new qt("mroot",[Ii(r,e),Ii(n,e)]):new qt("msqrt",[Ii(r,e)])}});var $q={display:fn.DISPLAY,text:fn.TEXT,script:fn.SCRIPT,scriptscript:fn.SCRIPTSCRIPT};function QHt(t){return t in $q}sr({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(t,e){var r=t.breakOnTokenText,n=t.funcName,i=t.parser,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!QHt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=$q[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),dRe(t.body,n,e)},mathmlBuilder(t,e){var r=$q[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=ou(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 eGt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===fn.DISPLAY.size||n.alwaysHandleSupSub);return i?uRe:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===fn.DISPLAY.size||n.limits);return a?hRe:null}else{if(n.type==="accent")return op(n.base)?GMe:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?oRe:null}else return null}else return null};I5({type:"supsub",htmlBuilder(t,e){var r=eGt(t,e);if(r)return r(t,e);var n=t.base,i=t.sup,a=t.sub,s=mi(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&op(n);if(i){var p=e.havingStyle(e.style.sup());o=mi(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=mi(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===fn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var U=e.sizeMultiplier,y=Xt(.5/u.ptPerEm/U),b=null;if(l){var v=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof tu||v){var w;b=Xt(-((w=s.italic)!=null?w:0))}}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,C=4*k;if(h-o.depth-(l.height-d)0&&(h+=S,d-=S)}var E=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:y}];T=pi({positionType:"individualShift",children:E})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];T=pi({positionType:"shift",positionData:d,children:A})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=pi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var R=Dq(s,"right")||"mord";return Ft([R],[s,Ft(["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=[Ii(t.base,e)];t.sub&&a.push(Ii(t.sub,e)),t.sup&&a.push(Ii(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===fn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===fn.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===fn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===fn.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===fn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===fn.DISPLAY)?s="mover":s="msup"}return new qt(s,a)}});I5({type:"atom",htmlBuilder(t,e){return rte(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new qt("mo",[Gu(t.text,t.mode)]);if(t.family==="bin"){var n=ate(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 fRe={mi:"italic",mn:"normal",mtext:"normal"};I5({type:"mathord",htmlBuilder(t,e){return n_(t,e)},mathmlBuilder(t,e){var r=new qt("mi",[Gu(t.text,t.mode,e)]),n=ate(t,e)||"italic";return n!==fRe[r.type]&&r.setAttribute("mathvariant",n),r}});I5({type:"textord",htmlBuilder(t,e){return n_(t,e)},mathmlBuilder(t,e){var r=Gu(t.text,t.mode,e),n=ate(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!==fRe[i.type]&&i.setAttribute("mathvariant",n),i}});var W0e=new Map([["\\nobreak","nobreak"],["\\allowbreak","allowbreak"]]),q0e=new Map([[" ",{}],["\\ ",{}],["~",{className:"nobreak"}],["\\space",{}],["\\nobreakspace",{className:"nobreak"}]]);I5({type:"spacing",htmlBuilder(t,e){var r=q0e.get(t.text),n=W0e.get(t.text);if(r){var i=r.className||"";if(t.mode==="text"){var a=n_(t,e);return a.classes.push(i),a}else return Ft(["mspace",i],[rte(t.text,t.mode,e)],e)}else{if(n)return Ft(["mspace",n],[],e);throw new Yt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(q0e.has(t.text))r=new qt("mtext",[new ds(" ")]);else{if(W0e.has(t.text))return new qt("mspace");throw new Yt('Unknown type of space "'+t.text+'"')}return r}});var j0e=()=>{var t=new qt("mtd",[]);return t.setAttribute("width","50%"),t};I5({type:"tag",mathmlBuilder(t,e){var r=new qt("mtable",[new qt("mtr",[j0e(),new qt("mtd",[Jg(t.body,e)]),j0e(),new qt("mtd",[Jg(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Y0e={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},X0e={"\\textbf":"textbf","\\textmd":"textmd"},tGt={"\\textit":"textit","\\textup":"textup"},K0e=(t,e)=>{var r=t.font;if(r){if(Y0e[r])return e.withTextFontFamily(Y0e[r]);if(X0e[r])return e.withTextFontWeight(X0e[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(tGt[r])};sr({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(t,e){var r=t.parser,n=t.funcName,i=e[0];return{type:"text",mode:r.mode,body:hs(i),font:n}},htmlBuilder(t,e){var r=K0e(t,e),n=Bs(t.body,r,!0);return Ft(["mord","text"],n,r)},mathmlBuilder(t,e){var r=K0e(t,e);return Jg(t.body,r)}});sr({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(t,e){var r=t.parser;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=mi(t.body,e),n=r4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=pi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Ft(["mord","katex-underline"],[a],e)},mathmlBuilder(t,e){var r=new qt("mo",[new ds("‾")]);r.setAttribute("stretchy","true");var n=new qt("munder",[Ii(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});sr({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(t,e){var r=t.parser;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=mi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return pi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new qt("mpadded",[Ii(t.body,e)],["vcenter"]);return new qt("mrow",[r])}});sr({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(t,e,r){throw new Yt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Z0e(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),dg=_Me,pRe=`[ \r + ]`,rGt="\\\\[a-zA-Z@]+",nGt="\\\\[^\uD800-\uDFFF]",iGt="("+rGt+")"+pRe+"*",aGt=`\\\\( |[ \r ]+ -?)[ \r ]*`,NU="[̀-ͯ]",$Gt=new RegExp(NU+"+$"),BGt="("+t_e+"+)|"+(PGt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(NU+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(NU+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+DGt)+("|"+OGt+")");let H0e=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(BGt,"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 Ih("EOF",new Eu(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Yt("Unexpected character: '"+e[r]+"'",new Ih(e[r],new Eu(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(` -`,this.tokenRegex.lastIndex);return s===-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=s+1,this.lex()}return new Ih(i,new Eu(this,r,this.tokenRegex.lastIndex))}},FGt=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 Yt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r of Object.keys(e))e[r]===void 0?delete this.current[r]:this.current[r]=e[r]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){return Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:Object.prototype.hasOwnProperty.call(this.builtins,e)?this.builtins[e]:void 0}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 s=this.undefStack[this.undefStack.length-1];s&&!Object.prototype.hasOwnProperty.call(s,e)&&(s[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}r==null?delete this.current[e]:this.current[e]=r}};var zGt=G9e;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 G0e={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=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 Yt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=G0e[e.text],n==null||n>=r)throw new Yt("Invalid base-"+r+" digit "+e.text);for(var i;(i=G0e[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Yt("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Yt("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Yt("\\renewcommand{"+s+"} when command "+s+" 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 Yt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};Se("\\newcommand",t=>tte(t,!1,!0,!1));Se("\\renewcommand",t=>tte(t,!0,!1,!1));Se("\\providecommand",t=>tte(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),hg[r],hs.math[r],hs.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("\\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}\\nobreak}{\\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("\\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 W0e={",":"\\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"},VGt=new Set(["bin","rel"]);Se("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in W0e?e=W0e[r]:(r.slice(0,4)==="\\not"||r in hs.math&&VGt.has(hs.math[r].group))&&(e="\\dotsb"),e});var rte={")":!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 rte?"\\ldots\\,":"\\ldots"});Se("\\dotsc",function(t){var e=t.future().text;return e in rte&&e!==","?"\\ldots\\,":"\\ldots"});Se("\\cdots",function(t){var e=t.future().text;return e in rte?"\\@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 Yt("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 r_e=Xt(_d["Main-Regular"][84][1]-.7*_d["Main-Regular"][65][1]);Se("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+r_e+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Se("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+r_e+"}{\\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 n_e=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),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([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Se("\\bra@ket",n_e(!1));Se("\\bra@set",n_e(!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 i_e={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let HGt=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 FGt(zGt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new H0e(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();var s=this.consumeArg(["]"]);i=s.tokens,n=s.end}else{var a=this.consumeArg();i=a.tokens,r=a.start,n=a.end}return this.pushToken(new Ih("EOF",n.loc)),this.pushTokens(i),new Ih("",Eu.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(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Yt("Extra }",s)}else if(s.text==="EOF")throw new Yt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Yt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Yt("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 Yt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Yt("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Yt("Not a valid argument number",l)}}}return this.pushTokens(s),s.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 Ih(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 s=0;if(i.includes("#"))for(var a=i.replace(/##/g,"");a.includes("#"+(s+1));)++s;for(var o=new H0e(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(hg,e)||Object.prototype.hasOwnProperty.call(hs.math,e)||Object.prototype.hasOwnProperty.call(hs.text,e)||Object.prototype.hasOwnProperty.call(i_e,e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Object.prototype.hasOwnProperty.call(hg,e)&&!hg[e].primitive}};var q0e=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,gM=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vz={"́":{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"}},U0e={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let s_e=class a_e{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 HGt(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 Yt("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 Ih("}")),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(a_e.endOfExpression.has(i.text)||r&&i.text===r||e&&hg[i.text]&&hg[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(f9e(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)),a={type:"textord",mode:"text",loc:Eu.range(e),text:r};else return null;if(this.consume(),s)for(var h=0;ht.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,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.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 s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n??s.attrs.latex}),!0)}}},parseHTML(){return[{tag:'div[data-type="block-math"]'}]},renderHTML({HTMLAttributes:t}){return["div",mn(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 Kh({find:/^\$\$\$([^$]+)\$\$\$$/,handler:({state:t,range:e,match:r})=>{const[,n]=r,{tr:i}=t,s=t.doc.resolve(e.from),a=this.type.create({latex:n}),o=s.depth>0&&s.parent.isTextblock&&e.from===s.start()&&e.to===s.end()&&s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),this.type)?{from:s.before(),to:s.after()}:e;i.replaceWith(o.from,o.to,a)}})]},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 s(){try{c_e.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 a=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",a),s(),{dom:n,destroy(){n.removeEventListener("click",a)}}}}}),YGt=t=>{const e=/\$\$([^$\n]+?)\$\$(?!\$)/g;let r=e.exec(t);for(;r!==null;){if(r.index===0||t[r.index-1]!=="$")return{index:r.index,text:r[0],data:{latex:r[1]}};e.lastIndex=r.index+1,r=e.exec(t)}return null},h_e=ti.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,s=(n=t==null?void 0:t.pos)!==null&&n!==void 0?n:e.state.selection.from;return i?(r.replaceWith(s,s,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,s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.delete(i,i+s.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 s=e.state.doc.nodeAt(i);return!s||s.type.name!==this.name?!1:(r.setNodeMarkup(i,this.type,{...s.attrs,latex:n}),!0)}}},parseHTML(){return[{tag:'span[data-type="inline-math"]'}]},renderHTML({HTMLAttributes:t}){return["span",mn(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 Kh({find:YGt,handler:({state:t,range:e,match:r})=>{var n;const i=(n=r.data)===null||n===void 0?void 0:n.latex;if(typeof i!="string")return null;const{tr:s}=t,a=e.from,o=e.to;s.replaceWith(a,o,this.type.create({latex:i}))}})]},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{c_e.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 s=a=>{a.preventDefault(),a.stopPropagation();const o=r();o!=null&&this.options.onClick&&this.options.onClick(e,o)};return this.options.onClick&&n.addEventListener("click",s),i(),{dom:n,destroy(){n.removeEventListener("click",s)}}}}});Ni.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[u_e.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),h_e.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const XGt=(t,e,r)=>e<0||r>t.content.size||e>=r?"":t.textBetween(e,r),j0e=(t,e)=>{var i,s;const n=((i=t.doc.resolve(e).nodeAfter)==null?void 0:i.type.name)==="paragraph"?null:(s=t.doc.type.schema.nodes.paragraph)==null?void 0:s.create();n&&t.insert(e,n),t.setSelection(yr.create(t.doc,e+1))},KGt=h_e.extend({markdownTokenizer:mMe,addInputRules(){return[new Kh({find:t=>{const e=kIt(t);return e?{index:e.index,text:e.raw,data:{latex:e.latex}}:null},handler:({state:t,range:e,match:r})=>{var i;const n=(i=r.data)==null?void 0:i.latex;if(typeof n!="string"||!n)return null;t.tr.replaceWith(e.from,e.to,this.type.create({latex:n}))}})]},addPasteRules(){return[new YA({find:t=>gMe(t).map(e=>({index:e.index,text:e.raw,data:{latex:e.latex}})),handler:({state:t,range:e,match:r})=>{var s;const n=(s=r.data)==null?void 0:s.latex;if(typeof n!="string"||!n||e.from>=e.to||XGt(t.doc,e.from,e.to)!==r[0])return;const i=t.doc.resolve(e.from);i.parent.type.spec.code||i.marks().some(a=>a.type.spec.code)||t.tr.replaceWith(e.from,e.to,this.type.create({latex:n}))}})]}}),ZGt=u_e.extend({markdownTokenizer:yMe,addInputRules(){return[new Kh({find:t=>{const e=tfe(t);return e?{index:0,text:t,data:{latex:e.latex}}:null},handler:({state:t,range:e,match:r})=>{var o;const n=(o=r.data)==null?void 0:o.latex;if(typeof n!="string"||!n)return null;const i=t.doc.resolve(e.from);if(!(i.parent.isTextblock&&e.from===i.start()&&e.to===i.end())||i.depth<1||!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),this.type))return null;const{tr:a}=t;a.replaceWith(i.before(),i.after(),this.type.create({latex:n})),j0e(a,a.mapping.map(i.after()))}})]},addPasteRules(){return[new YA({find:t=>{const e=tfe(t);if(!e)return null;const r=t.trim();return[{index:t.indexOf(r),text:r,data:{latex:e.latex}}]},handler:({state:t,range:e,match:r})=>{var d;const n=(d=r.data)==null?void 0:d.latex;if(typeof n!="string"||!n||e.from>=e.to)return;const i=t.doc.resolve(e.from);if(!i.parent.isTextblock||i.parent.type.spec.code||i.parent.textContent.trim()!==r[0]||i.depth<1||!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),this.type))return;const{tr:s}=t,a=i.before(),o=i.after();s.replaceWith(a,o,this.type.create({latex:n}));const l=s.mapping.map(o),{from:u,to:h}=s.selection;u>=s.mapping.map(a)&&h<=l&&j0e(s,l)}})]}}),Y0e={throwOnError:!1,strict:"warn",trust:!1},QGt=(t={})=>[ZGt.configure({katexOptions:Y0e,onClick:t.onBlockClick}),KGt.configure({katexOptions:Y0e,onClick:t.onInlineClick})],X0e=t=>(t==null?void 0:t.type.name)==="image"&&!GLt(t.attrs.src),mM=(t,e)=>!!t&&t.type.name===O0&&!e.has(t),JGt=(t,e)=>{let r=null;return t.doc.forEach((n,i)=>{n===e&&(r={node:n,pos:i})}),r},eWt=(t,e,r)=>{let n=e,i=e+r.nodeSize;for(;X0e(t.doc.resolve(n).nodeBefore);)n-=t.doc.resolve(n).nodeBefore.nodeSize;for(;X0e(t.doc.resolve(i).nodeAfter);)i+=t.doc.resolve(i).nodeAfter.nodeSize;return{start:n,end:i}},bz=(t,e,r,n,i)=>{const s=t.doc.resolve(e).blockRange(t.doc.resolve(r));return s?(t.wrap(s,[{type:n,attrs:i}]),!0):!1},tWt=(t,e)=>{const r=new Set(e),n=[];t.doc.forEach(i=>{r.has(i)&&(i.type.name==="image"||i.type.name===O0)&&n.push(i)});for(const i of n.reverse()){const s=JGt(t,i);s&&rWt(t,s.node,s.pos,r)}return t},rWt=(t,e,r,n)=>{const i=t.doc.type.schema.nodes[O0];if(!i)return;const{start:s,end:a}=eWt(t,r,e),o=mM(t.doc.resolve(s).nodeBefore,n)?t.doc.resolve(s).nodeBefore:null,l=o?null:mM(t.doc.resolve(a).nodeAfter,n)?t.doc.resolve(a).nodeAfter:null,u=o??l;if(!(sr+e.nodeSize)&&!u)return;if(e.type.name==="image"){const y=(u==null?void 0:u.attrs)??{layout:"auto"};if(!bz(t,s,a,(u==null?void 0:u.type)??i,y))return;if(o)Rl(t.doc,s)&&t.join(s);else if(l){const v=t.doc.nodeAt(s),b=v?s+v.nodeSize:null;b!==null&&Rl(t.doc,b)&&t.join(b)}return}const d=(u==null?void 0:u.attrs)??e.attrs;let f=r;if(a>r+e.nodeSize){const y=r+e.nodeSize;bz(t,y,a,i,d)&&Rl(t.doc,y)&&t.join(y)}if(s{const r=Math.min(e.from,t.content.size),n=Math.min(e.to,t.content.size),i=t.resolve(r);for(let a=i.depth;a>0;a-=1)if(i.node(a).type.name===O0){const o=i.after(a);return{from:o,to:o}}const s=t.nodeAt(r);if(n>r&&((s==null?void 0:s.type.name)==="image"||(s==null?void 0:s.type.name)===O0)){const a=r+s.nodeSize;return{from:a,to:a}}return{from:r,to:n}},iWt=(t,e,r=t.selection)=>{const{from:n,to:i}=nWt(t.doc,r),s=t.schema.nodes.image.create(e),a=t.tr.replaceRangeWith(n,i,s);return a.doc.descendants((o,l)=>{o===s&&a.setSelection(Ir.create(a.doc,l))}),a},sWt=(t,e)=>{if(!t.isEditable||t.isDestroyed||e.length===0)return!1;const r=t.schema.nodes[O0];if(!r)return!1;const n=new Set(e),i=[];let s=null;if(t.state.doc.forEach((l,u)=>{l.type.name==="image"&&n.has(l.attrs.src)?(s||(s={from:u,to:u,images:[]}),s.images.push(l),s.to=u+l.nodeSize):(s&&i.push(s),s=null)}),s&&i.push(s),!i.length)return!1;const a=t.state.tr,o=[];for(const l of i.reverse())if(l.images.length===1)o.push(l.images[0]);else{const u=r.create({layout:"auto"},l.images);a.replaceWith(l.from,l.to,u),o.push(u)}return tWt(a,o),a.docChanged?(t.view.dispatch(a),!0):!1},K0e={"zh-CN":{label:"图片画廊布局",auto:"自动",single:"单列",columns:t=>`${t} 栏`},"en-US":{label:"Image gallery layout",auto:"Auto",single:"Single",columns:t=>`${t} columns`},ja:{label:"画像ギャラリーのレイアウト",auto:"自動",single:"1列",columns:t=>`${t}列`},pl:{label:"Układ galerii obrazów",auto:"Auto",single:"1 kolumna",columns:t=>`${t} kolumny`}},aWt=t=>K0e[t]??K0e["zh-CN"],oWt=t=>(({editor:e,node:r,getPos:n})=>{let i=r;const s=document.createElement("div");s.className="edgeever-native-image-gallery",s.dataset.edgeeverImageGallery="true";const a=document.createElement("div");a.className="edgeever-native-gallery-toolbar",a.contentEditable="false",a.setAttribute("role","toolbar");const o=document.createElement("div");o.className="edgeever-native-gallery-content";const l=lMe.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)===O0&&e.view.dispatch(e.state.tr.setNodeMarkup(p,void 0,{...g.attrs,layout:h}))}),a.appendChild(d),{button:d,layout:h}});s.appendChild(a),s.appendChild(o);const u=()=>{const h=aWt(t()),d=qq(i.attrs.layout);s.dataset.imageGalleryLayout=d,s.dataset.imageCount=String(i.childCount),a.hidden=!e.isEditable,a.setAttribute("aria-label",h.label);for(const f of l)f.button.textContent=f.layout==="auto"?h.auto:f.layout==="1"?h.single:h.columns(f.layout),f.button.setAttribute("aria-pressed",String(f.layout===d))};return u(),e.on("transaction",u),e.on("update",u),{dom:s,contentDOM:o,update:h=>h.type!==i.type?!1:(i=h,u(),!0),stopEvent:h=>a.contains(h.target),ignoreMutation:h=>h.type!=="selection"&&!o.contains(h.target),destroy:()=>{e.off("transaction",u),e.off("update",u)}}}),lWt=` +?)[ \r ]*`,Fq="[̀-ͯ]",sGt=new RegExp(Fq+"+$"),oGt="("+pRe+"+)|"+(aGt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Fq+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Fq+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+iGt)+("|"+nGt+")");let J0e=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(oGt,"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 Ih("EOF",new Su(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Yt("Unexpected character: '"+e[r]+"'",new Ih(e[r],new Su(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 Ih(i,new Su(this,r,this.tokenRegex.lastIndex))}},lGt=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 Yt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r of Object.keys(e))e[r]===void 0?delete this.current[r]:this.current[r]=e[r]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){return Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:Object.prototype.hasOwnProperty.call(this.builtins,e)?this.builtins[e]:void 0}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&&!Object.prototype.hasOwnProperty.call(a,e)&&(a[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}r==null?delete this.current[e]:this.current[e]=r}};var cGt=rRe;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ke("\\@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}});ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Q0e={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};ke("\\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 Yt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Q0e[e.text],n==null||n>=r)throw new Yt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Q0e[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Yt("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new Yt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new Yt("\\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 Yt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>cte(t,!1,!0,!1));ke("\\renewcommand",t=>cte(t,!0,!1,!1));ke("\\providecommand",t=>cte(t,!0,!0,!0));ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),dg[r],ua.math[r],ua.text[r]),""});ke("\\bgroup","{");ke("\\egroup","}");ke("~","\\nobreakspace");ke("\\lq","`");ke("\\rq","'");ke("\\aa","\\r a");ke("\\AA","\\r A");ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ke("ℬ","\\mathscr{B}");ke("ℰ","\\mathscr{E}");ke("ℱ","\\mathscr{F}");ke("ℋ","\\mathscr{H}");ke("ℐ","\\mathscr{I}");ke("ℒ","\\mathscr{L}");ke("ℳ","\\mathscr{M}");ke("ℛ","\\mathscr{R}");ke("ℭ","\\mathfrak{C}");ke("ℌ","\\mathfrak{H}");ke("ℨ","\\mathfrak{Z}");ke("\\Bbbk","\\Bbb{k}");ke("\\llap","\\mathllap{\\textrm{#1}}");ke("\\rlap","\\mathrlap{\\textrm{#1}}");ke("\\clap","\\mathclap{\\textrm{#1}}");ke("\\mathstrut","\\vphantom{(}");ke("\\underbar","\\underline{\\text{#1}}");ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ke("\\ne","\\neq");ke("≠","\\neq");ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ke("∉","\\notin");ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ke("⟂","\\perp");ke("‼","\\mathclose{!\\mkern-0.8mu!}");ke("∌","\\notni");ke("⌜","\\ulcorner");ke("⌝","\\urcorner");ke("⌞","\\llcorner");ke("⌟","\\lrcorner");ke("©","\\copyright");ke("®","\\textregistered");ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ke("⋮","\\vdots");ke("\\varGamma","\\mathit{\\Gamma}");ke("\\varDelta","\\mathit{\\Delta}");ke("\\varTheta","\\mathit{\\Theta}");ke("\\varLambda","\\mathit{\\Lambda}");ke("\\varXi","\\mathit{\\Xi}");ke("\\varPi","\\mathit{\\Pi}");ke("\\varSigma","\\mathit{\\Sigma}");ke("\\varUpsilon","\\mathit{\\Upsilon}");ke("\\varPhi","\\mathit{\\Phi}");ke("\\varPsi","\\mathit{\\Psi}");ke("\\varOmega","\\mathit{\\Omega}");ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ke("\\boxed","\\fbox{$\\displaystyle{#1}$}");ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var epe={",":"\\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"},uGt=new Set(["bin","rel"]);ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in epe?e=epe[r]:(r.slice(0,4)==="\\not"||r in ua.math&&uGt.has(ua.math[r].group))&&(e="\\dotsb"),e});var ute={")":!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};ke("\\dotso",function(t){var e=t.future().text;return e in ute?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in ute&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in ute?"\\@cdots\\,":"\\@cdots"});ke("\\dotsb","\\cdots");ke("\\dotsm","\\cdots");ke("\\dotsi","\\!\\cdots");ke("\\dotsx","\\ldots\\,");ke("\\DOTSI","\\relax");ke("\\DOTSB","\\relax");ke("\\DOTSX","\\relax");ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ke("\\,","\\tmspace+{3mu}{.1667em}");ke("\\thinspace","\\,");ke("\\>","\\mskip{4mu}");ke("\\:","\\tmspace+{4mu}{.2222em}");ke("\\medspace","\\:");ke("\\;","\\tmspace+{5mu}{.2777em}");ke("\\thickspace","\\;");ke("\\!","\\tmspace-{3mu}{.1667em}");ke("\\negthinspace","\\!");ke("\\negmedspace","\\tmspace-{4mu}{.2222em}");ke("\\negthickspace","\\tmspace-{5mu}{.277em}");ke("\\enspace","\\kern.5em ");ke("\\enskip","\\hskip.5em\\relax");ke("\\quad","\\hskip1em\\relax");ke("\\qquad","\\hskip2em\\relax");ke("\\tag","\\@ifstar\\tag@literal\\tag@paren");ke("\\tag@paren","\\tag@literal{({#1})}");ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Yt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ke("\\newline","\\\\\\relax");ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var gRe=Xt(Ld["Main-Regular"][84][1]-.7*Ld["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+gRe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+gRe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ke("\\hspace","\\@ifstar\\@hspacer\\@hspace");ke("\\@hspace","\\hskip #1\\relax");ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ke("\\ordinarycolon",":");ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ke("∷","\\dblcolon");ke("∹","\\eqcolon");ke("≔","\\coloneqq");ke("≕","\\eqqcolon");ke("⩴","\\Coloneqq");ke("\\ratio","\\vcentcolon");ke("\\coloncolon","\\dblcolon");ke("\\colonequals","\\coloneqq");ke("\\coloncolonequals","\\Coloneqq");ke("\\equalscolon","\\eqqcolon");ke("\\equalscoloncolon","\\Eqqcolon");ke("\\colonminus","\\coloneq");ke("\\coloncolonminus","\\Coloneq");ke("\\minuscolon","\\eqcolon");ke("\\minuscoloncolon","\\Eqcolon");ke("\\coloncolonapprox","\\Colonapprox");ke("\\coloncolonsim","\\Colonsim");ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ke("\\imath","\\html@mathml{\\@imath}{ı}");ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ke("⟦","\\llbracket");ke("⟧","\\rrbracket");ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ke("⦃","\\lBrace");ke("⦄","\\rBrace");ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ke("⦵","\\minuso");ke("\\darr","\\downarrow");ke("\\dArr","\\Downarrow");ke("\\Darr","\\Downarrow");ke("\\lang","\\langle");ke("\\rang","\\rangle");ke("\\uarr","\\uparrow");ke("\\uArr","\\Uparrow");ke("\\Uarr","\\Uparrow");ke("\\N","\\mathbb{N}");ke("\\R","\\mathbb{R}");ke("\\Z","\\mathbb{Z}");ke("\\alef","\\aleph");ke("\\alefsym","\\aleph");ke("\\Alpha","\\mathrm{A}");ke("\\Beta","\\mathrm{B}");ke("\\bull","\\bullet");ke("\\Chi","\\mathrm{X}");ke("\\clubs","\\clubsuit");ke("\\cnums","\\mathbb{C}");ke("\\Complex","\\mathbb{C}");ke("\\Dagger","\\ddagger");ke("\\diamonds","\\diamondsuit");ke("\\empty","\\emptyset");ke("\\Epsilon","\\mathrm{E}");ke("\\Eta","\\mathrm{H}");ke("\\exist","\\exists");ke("\\harr","\\leftrightarrow");ke("\\hArr","\\Leftrightarrow");ke("\\Harr","\\Leftrightarrow");ke("\\hearts","\\heartsuit");ke("\\image","\\Im");ke("\\infin","\\infty");ke("\\Iota","\\mathrm{I}");ke("\\isin","\\in");ke("\\Kappa","\\mathrm{K}");ke("\\larr","\\leftarrow");ke("\\lArr","\\Leftarrow");ke("\\Larr","\\Leftarrow");ke("\\lrarr","\\leftrightarrow");ke("\\lrArr","\\Leftrightarrow");ke("\\Lrarr","\\Leftrightarrow");ke("\\Mu","\\mathrm{M}");ke("\\natnums","\\mathbb{N}");ke("\\Nu","\\mathrm{N}");ke("\\Omicron","\\mathrm{O}");ke("\\plusmn","\\pm");ke("\\rarr","\\rightarrow");ke("\\rArr","\\Rightarrow");ke("\\Rarr","\\Rightarrow");ke("\\real","\\Re");ke("\\reals","\\mathbb{R}");ke("\\Reals","\\mathbb{R}");ke("\\Rho","\\mathrm{P}");ke("\\sdot","\\cdot");ke("\\sect","\\S");ke("\\spades","\\spadesuit");ke("\\sub","\\subset");ke("\\sube","\\subseteq");ke("\\supe","\\supseteq");ke("\\Tau","\\mathrm{T}");ke("\\thetasym","\\vartheta");ke("\\weierp","\\wp");ke("\\Zeta","\\mathrm{Z}");ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ke("\\bra","\\mathinner{\\langle{#1}|}");ke("\\ket","\\mathinner{|{#1}\\rangle}");ke("\\braket","\\mathinner{\\langle{#1}\\rangle}");ke("\\Bra","\\left\\langle#1\\right|");ke("\\Ket","\\left|#1\\right\\rangle");var mRe=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}};ke("\\bra@ket",mRe(!1));ke("\\bra@set",mRe(!0));ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ke("\\angln","{\\angl n}");ke("\\blue","\\textcolor{##6495ed}{#1}");ke("\\orange","\\textcolor{##ffa500}{#1}");ke("\\pink","\\textcolor{##ff00af}{#1}");ke("\\red","\\textcolor{##df0030}{#1}");ke("\\green","\\textcolor{##28ae7b}{#1}");ke("\\gray","\\textcolor{gray}{#1}");ke("\\purple","\\textcolor{##9d38bd}{#1}");ke("\\blueA","\\textcolor{##ccfaff}{#1}");ke("\\blueB","\\textcolor{##80f6ff}{#1}");ke("\\blueC","\\textcolor{##63d9ea}{#1}");ke("\\blueD","\\textcolor{##11accd}{#1}");ke("\\blueE","\\textcolor{##0c7f99}{#1}");ke("\\tealA","\\textcolor{##94fff5}{#1}");ke("\\tealB","\\textcolor{##26edd5}{#1}");ke("\\tealC","\\textcolor{##01d1c1}{#1}");ke("\\tealD","\\textcolor{##01a995}{#1}");ke("\\tealE","\\textcolor{##208170}{#1}");ke("\\greenA","\\textcolor{##b6ffb0}{#1}");ke("\\greenB","\\textcolor{##8af281}{#1}");ke("\\greenC","\\textcolor{##74cf70}{#1}");ke("\\greenD","\\textcolor{##1fab54}{#1}");ke("\\greenE","\\textcolor{##0d923f}{#1}");ke("\\goldA","\\textcolor{##ffd0a9}{#1}");ke("\\goldB","\\textcolor{##ffbb71}{#1}");ke("\\goldC","\\textcolor{##ff9c39}{#1}");ke("\\goldD","\\textcolor{##e07d10}{#1}");ke("\\goldE","\\textcolor{##a75a05}{#1}");ke("\\redA","\\textcolor{##fca9a9}{#1}");ke("\\redB","\\textcolor{##ff8482}{#1}");ke("\\redC","\\textcolor{##f9685d}{#1}");ke("\\redD","\\textcolor{##e84d39}{#1}");ke("\\redE","\\textcolor{##bc2612}{#1}");ke("\\maroonA","\\textcolor{##ffbde0}{#1}");ke("\\maroonB","\\textcolor{##ff92c6}{#1}");ke("\\maroonC","\\textcolor{##ed5fa6}{#1}");ke("\\maroonD","\\textcolor{##ca337c}{#1}");ke("\\maroonE","\\textcolor{##9e034e}{#1}");ke("\\purpleA","\\textcolor{##ddd7ff}{#1}");ke("\\purpleB","\\textcolor{##c6b9fc}{#1}");ke("\\purpleC","\\textcolor{##aa87ff}{#1}");ke("\\purpleD","\\textcolor{##7854ab}{#1}");ke("\\purpleE","\\textcolor{##543b78}{#1}");ke("\\mintA","\\textcolor{##f5f9e8}{#1}");ke("\\mintB","\\textcolor{##edf2df}{#1}");ke("\\mintC","\\textcolor{##e0e5cc}{#1}");ke("\\grayA","\\textcolor{##f6f7f7}{#1}");ke("\\grayB","\\textcolor{##f0f1f2}{#1}");ke("\\grayC","\\textcolor{##e3e5e6}{#1}");ke("\\grayD","\\textcolor{##d6d8da}{#1}");ke("\\grayE","\\textcolor{##babec2}{#1}");ke("\\grayF","\\textcolor{##888d93}{#1}");ke("\\grayG","\\textcolor{##626569}{#1}");ke("\\grayH","\\textcolor{##3b3e40}{#1}");ke("\\grayI","\\textcolor{##21242c}{#1}");ke("\\kaBlue","\\textcolor{##314453}{#1}");ke("\\kaGreen","\\textcolor{##71B307}{#1}");var URe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};let hGt=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 lGt(cGt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new J0e(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();var a=this.consumeArg(["]"]);i=a.tokens,n=a.end}else{var s=this.consumeArg();i=s.tokens,r=s.start,n=s.end}return this.pushToken(new Ih("EOF",n.loc)),this.pushTokens(i),new Ih("",Su.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 Yt("Extra }",a)}else if(a.text==="EOF")throw new Yt("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 Yt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Yt("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 Yt("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 Yt("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 Yt("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 Ih(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 J0e(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)||Object.prototype.hasOwnProperty.call(dg,e)||Object.prototype.hasOwnProperty.call(ua.math,e)||Object.prototype.hasOwnProperty.call(ua.text,e)||Object.prototype.hasOwnProperty.call(URe,e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Object.prototype.hasOwnProperty.call(dg,e)&&!dg[e].primitive}};var tpe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,yE=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"}},rpe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let yRe=class bRe{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 hGt(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 Yt("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 Ih("}")),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(bRe.endOfExpression.has(i.text)||r&&i.text===r||e&&dg[i.text]&&dg[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&&(SMe(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:Su.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;ht.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",yn(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 Kh({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{wRe.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)}}}}}),UGt=t=>{const e=/\$\$([^$\n]+?)\$\$(?!\$)/g;let r=e.exec(t);for(;r!==null;){if(r.index===0||t[r.index-1]!=="$")return{index:r.index,text:r[0],data:{latex:r[1]}};e.lastIndex=r.index+1,r=e.exec(t)}return null},CRe=ri.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",yn(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 Kh({find:UGt,handler:({state:t,range:e,match:r})=>{var n;const i=(n=r.data)===null||n===void 0?void 0:n.latex;if(typeof i!="string")return null;const{tr:a}=t,s=e.from,o=e.to;a.replaceWith(s,o,this.type.create({latex:i}))}})]},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{wRe.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)}}}}});Di.create({name:"Mathematics",addOptions(){return{inlineOptions:void 0,blockOptions:void 0,katexOptions:void 0}},addExtensions(){return[TRe.configure({...this.options.blockOptions,katexOptions:this.options.katexOptions}),CRe.configure({...this.options.inlineOptions,katexOptions:this.options.katexOptions})]}});const yGt=(t,e,r)=>e<0||r>t.content.size||e>=r?"":t.textBetween(e,r),npe=(t,e)=>{var i,a;const n=((i=t.doc.resolve(e).nodeAfter)==null?void 0:i.type.name)==="paragraph"?null:(a=t.doc.type.schema.nodes.paragraph)==null?void 0:a.create();n&&t.insert(e,n),t.setSelection(yr.create(t.doc,e+1))},bGt=CRe.extend({markdownTokenizer:EEe,addInputRules(){return[new Kh({find:t=>{const e=tNt(t);return e?{index:e.index,text:e.raw,data:{latex:e.latex}}:null},handler:({state:t,range:e,match:r})=>{var i;const n=(i=r.data)==null?void 0:i.latex;if(typeof n!="string"||!n)return null;t.tr.replaceWith(e.from,e.to,this.type.create({latex:n}))}})]},addPasteRules(){return[new JC({find:t=>SEe(t).map(e=>({index:e.index,text:e.raw,data:{latex:e.latex}})),handler:({state:t,range:e,match:r})=>{var a;const n=(a=r.data)==null?void 0:a.latex;if(typeof n!="string"||!n||e.from>=e.to||yGt(t.doc,e.from,e.to)!==r[0])return;const i=t.doc.resolve(e.from);i.parent.type.spec.code||i.marks().some(s=>s.type.spec.code)||t.tr.replaceWith(e.from,e.to,this.type.create({latex:n}))}})]}}),vGt=TRe.extend({markdownTokenizer:AEe,addInputRules(){return[new Kh({find:t=>{const e=ffe(t);return e?{index:0,text:t,data:{latex:e.latex}}:null},handler:({state:t,range:e,match:r})=>{var o;const n=(o=r.data)==null?void 0:o.latex;if(typeof n!="string"||!n)return null;const i=t.doc.resolve(e.from);if(!(i.parent.isTextblock&&e.from===i.start()&&e.to===i.end())||i.depth<1||!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),this.type))return null;const{tr:s}=t;s.replaceWith(i.before(),i.after(),this.type.create({latex:n})),npe(s,s.mapping.map(i.after()))}})]},addPasteRules(){return[new JC({find:t=>{const e=ffe(t);if(!e)return null;const r=t.trim();return[{index:t.indexOf(r),text:r,data:{latex:e.latex}}]},handler:({state:t,range:e,match:r})=>{var d;const n=(d=r.data)==null?void 0:d.latex;if(typeof n!="string"||!n||e.from>=e.to)return;const i=t.doc.resolve(e.from);if(!i.parent.isTextblock||i.parent.type.spec.code||i.parent.textContent.trim()!==r[0]||i.depth<1||!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),this.type))return;const{tr:a}=t,s=i.before(),o=i.after();a.replaceWith(s,o,this.type.create({latex:n}));const l=a.mapping.map(o),{from:u,to:h}=a.selection;u>=a.mapping.map(s)&&h<=l&&npe(a,l)}})]}}),ipe={throwOnError:!1,strict:"warn",trust:!1},xGt=(t={})=>[vGt.configure({katexOptions:ipe,onClick:t.onBlockClick}),bGt.configure({katexOptions:ipe,onClick:t.onInlineClick})],ape=t=>(t==null?void 0:t.type.name)==="image"&&!bIt(t.attrs.src),bE=(t,e)=>!!t&&t.type.name===O0&&!e.has(t),wGt=(t,e)=>{let r=null;return t.doc.forEach((n,i)=>{n===e&&(r={node:n,pos:i})}),r},TGt=(t,e,r)=>{let n=e,i=e+r.nodeSize;for(;ape(t.doc.resolve(n).nodeBefore);)n-=t.doc.resolve(n).nodeBefore.nodeSize;for(;ape(t.doc.resolve(i).nodeAfter);)i+=t.doc.resolve(i).nodeAfter.nodeSize;return{start:n,end:i}},CF=(t,e,r,n,i)=>{const a=t.doc.resolve(e).blockRange(t.doc.resolve(r));return a?(t.wrap(a,[{type:n,attrs:i}]),!0):!1},CGt=(t,e)=>{const r=new Set(e),n=[];t.doc.forEach(i=>{r.has(i)&&(i.type.name==="image"||i.type.name===O0)&&n.push(i)});for(const i of n.reverse()){const a=wGt(t,i);a&&kGt(t,a.node,a.pos,r)}return t},kGt=(t,e,r,n)=>{const i=t.doc.type.schema.nodes[O0];if(!i)return;const{start:a,end:s}=TGt(t,r,e),o=bE(t.doc.resolve(a).nodeBefore,n)?t.doc.resolve(a).nodeBefore:null,l=o?null:bE(t.doc.resolve(s).nodeAfter,n)?t.doc.resolve(s).nodeAfter:null,u=o??l;if(!(ar+e.nodeSize)&&!u)return;if(e.type.name==="image"){const U=(u==null?void 0:u.attrs)??{layout:"auto"};if(!CF(t,a,s,(u==null?void 0:u.type)??i,U))return;if(o)Ml(t.doc,a)&&t.join(a);else if(l){const y=t.doc.nodeAt(a),b=y?a+y.nodeSize:null;b!==null&&Ml(t.doc,b)&&t.join(b)}return}const d=(u==null?void 0:u.attrs)??e.attrs;let f=r;if(s>r+e.nodeSize){const U=r+e.nodeSize;CF(t,U,s,i,d)&&Ml(t.doc,U)&&t.join(U)}if(a{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===O0){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)===O0)){const s=r+a.nodeSize;return{from:s,to:s}}return{from:r,to:n}},EGt=(t,e,r=t.selection)=>{const{from:n,to:i}=SGt(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(Nr.create(s.doc,l))}),s},AGt=(t,e)=>{if(!t.isEditable||t.isDestroyed||e.length===0)return!1;const r=t.schema.nodes[O0];if(!r)return!1;const n=new Set(e),i=[];let a=null;if(t.state.doc.forEach((l,u)=>{l.type.name==="image"&&n.has(l.attrs.src)?(a||(a={from:u,to:u,images:[]}),a.images.push(l),a.to=u+l.nodeSize):(a&&i.push(a),a=null)}),a&&i.push(a),!i.length)return!1;const s=t.state.tr,o=[];for(const l of i.reverse())if(l.images.length===1)o.push(l.images[0]);else{const u=r.create({layout:"auto"},l.images);s.replaceWith(l.from,l.to,u),o.push(u)}return CGt(s,o),s.docChanged?(t.view.dispatch(s),!0):!1},spe={"zh-CN":{label:"图片画廊布局",auto:"自动",single:"单列",columns:t=>`${t} 栏`},"en-US":{label:"Image gallery layout",auto:"Auto",single:"Single",columns:t=>`${t} columns`},ja:{label:"画像ギャラリーのレイアウト",auto:"自動",single:"1列",columns:t=>`${t}列`},pl:{label:"Układ galerii obrazów",auto:"Auto",single:"1 kolumna",columns:t=>`${t} kolumny`}},MGt=t=>spe[t]??spe["zh-CN"],RGt=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=bEe.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)===O0&&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=MGt(t()),d=JW(i.attrs.layout);a.dataset.imageGalleryLayout=d,a.dataset.imageCount=String(i.childCount),s.hidden=!e.isEditable,s.setAttribute("aria-label",h.label);for(const f of l)f.button.textContent=f.layout==="auto"?h.auto:f.layout==="1"?h.single:h.columns(f.layout),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)}}}),LGt=` [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; } @@ -2802,12 +2935,12 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, .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; } -`,cWt=t=>cMe.extend({addNodeView(){return oWt(t)}}),d_e=document.createElement("style");d_e.textContent=lWt;document.head.append(d_e);mLt();const f_e=document.createElement("style");f_e.textContent=DLt;document.head.append(f_e);ht.registerConnector(h9e,cVt,!0);function Ry(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 ste(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 ate(t,e){const r=Ry(t);return r?JSON.stringify({kind:"image",href:ste(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function uWt(t,e){const r=Ry(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:ste(t,r),filename:n,resourceId:r})}const Z0e="edgeever-attachment-kind-";function hWt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function p_e(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(Z0e)&&e.classList.remove(n)});const r=hWt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${Z0e}${W5(null,r)}`)})}const dWt=performance.now(),Q0e=256*1024;let Ps="viewer",SI="zh-CN",OU="开始输入…",Uk=!1;const EI=new Map;let fWt=0;function fa(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 pWt(t){return new Uint8Array(await t.arrayBuffer())}function gWt(t){let e="";for(let r=0;r{const r=`r${++fWt}`;EI.set(r,e),fa({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{EI.delete(r)&&e(null)},3e4)})}async function mWt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(g_e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await m_e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function yWt(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(a=>{const o=a.textContent||"";return a.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(a=>a.parentElement).filter(Boolean),...n]);Jhe.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default",flowchart:{nodeSpacing:25,rankSpacing:30}});let s=0;for(const a of i){const o=(a.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${s++}`,{svg:u}=await Jhe.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u;const d=h.querySelector("svg"),f=d==null?void 0:d.viewBox.baseVal;d&&f&&f.width>0&&f.height>0&&(d.style.width=`${Math.ceil(f.width)}px`,d.style.height=`${Math.ceil(f.height)}px`,d.style.maxWidth="none"),a.replaceWith(h)}catch{}}}let jk=null,e9=null,MI=null,Yk=null,Xk=null,Kk=null;function ote(){var t;e9!==null&&cancelAnimationFrame(e9),e9=null,jk==null||jk.dispose(),jk=null,Xk==null||Xk.disconnect(),Xk=null,Yk==null||Yk.dispose(),Yk=null,Kk==null||Kk.remove(),Kk=null,(t=_a.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function vWt(t,e,r){ote();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=hVt(e,r),s=document.createElement("div");s.className="edgeever-x6-diagram",s.setAttribute("role","img"),s.setAttribute("aria-label",e.kind==="mind-map"?"思维导图":e.kind==="architecture"?"架构图":"流程图"),n.hidden=!0,t.append(s);const a=s.parentElement,o=()=>{if(!a)return Math.max(1,s.clientWidth);const f=getComputedStyle(a),p=getComputedStyle(s),g=Number.parseFloat(f.paddingLeft||"0")+Number.parseFloat(f.paddingRight||"0"),m=Number.parseFloat(p.marginLeft||"0")+Number.parseFloat(p.marginRight||"0");return Math.max(1,a.clientWidth-g-m)},l=new ht({container:s,width:o(),height:Math.max(1,s.clientHeight),background:{color:i.canvas},grid:!1,interacting:!1,panning:{enabled:!0},mousewheel:{enabled:!0,minScale:.1,maxScale:2.5}});l.addNodes(i.nodes),l.addEdges(i.edges);const u=RVt(l,s,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});jk=u;const h=()=>u.resize(o(),Math.max(1,s.clientHeight));e9=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(a??s),Yk=l,Xk=d,Kk=s,!0}const bWt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function Np(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 y_e(t){return Math.min(100,Math.max(10,Math.round(t)))}function yM(t,e){const r=e==null?null:y_e(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 J0e(t,e){let r=0;const n=s=>{s.preventDefault(),s.stopPropagation(),typeof s.stopImmediatePropagation=="function"&&s.stopImmediatePropagation()},i=s=>{n(s);const a=Date.now();a-r<350||(r=a,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function xWt(){return M3e.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>Np(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=Np(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 s=document.createElement("div");s.className="edgeever-image-loading";const a=document.createElement("span");a.className="edgeever-image-upload-spinner",s.append(a);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 R=y_e(E);let P=t.state.tr.setNodeMarkup(A,void 0,{...M.attrs,width:R});try{P=P.setSelection(Ir.create(P.doc,A))}catch{}t.view.dispatch(P),yM(i,R),f(R)},d=[];for(const E of bWt){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"),J0e(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"),s.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){s.replaceChildren();const A=document.createElement("span");A.className="edgeever-image-loading-label",A.textContent="图片加载失败",s.append(A),s.hidden=!1}else E==="loading"&&s.replaceChildren(a)},g=E=>{const A=String(E.src??"");return AI(A)||Ry(A)?A:i.dataset.resourceHref||A},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),A=ate(E,String(n.attrs.alt??"image"));if(A){fa({type:"resourcePress",targetJson:A});return}fa({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&&fa({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};J0e(l,m);let v=0;const b=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(),Ps==="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",b),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&b(E)}),i.append(s,o,l,u);let x=0,T="",C=!1;const S=E=>{const A=String(E.alt??"");o.alt=A;const M=Np(E.width);yM(i,M),f(M);const R=String(E.src??""),P=Ry(R);P&&(i.dataset.resourceHref=ste(R,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{x+=1;const A=x,M=String(E.src??"");T=M,S(E),p("loading"),u.hidden=!0;const R=P=>{A===x&&(o.onload=()=>{A===x&&(p("ready"),o.style.cursor=Ps==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&Ps==="editor"&&(u.hidden=!1))},o.onerror=()=>{A===x&&p("failed")},o.src=P)};if(!M){p("failed");return}if(M.startsWith("data:")||M.startsWith("edgeever-res:")||M.startsWith("blob:")){R(M);return}if(g_e(M)){m_e(M).then(P=>{A===x&&(P?R(P):p("failed"))});return}R(M)};return k(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?k(E.attrs):(f(Np(E.attrs.width)),yM(i,Np(E.attrs.width))),!0},selectNode:()=>{var A,M;C=!0,i.classList.add("is-selected");const E=Np((M=(A=t.state.selection.node)==null?void 0:A.attrs)==null?void 0:M.width)??Np(i.dataset.width)??Np(n.attrs.width);yM(i,E),t.isEditable&&Ps==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{x+=1}}}}}).configure({inline:!1,allowBase64:!0})}function wWt(t){return[...vMe({mathematics:QGt(),starterKit:{codeBlock:!1,link:!1},image:xWt(),gallery:cWt(()=>SI),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),rFt,Lyt.configure({languageClassPrefix:"language-"}),...OIt(),Myt.configure({placeholder:t})]}const _a=document.getElementById("editor"),t9=document.getElementById("toolbar");let r9=!1;_a.addEventListener("scroll",()=>{if(Ps!=="viewer")return;const t=_a.scrollTop>(r9?4:24);t!==r9&&(r9=t,fa({type:"readerScroll",collapsed:t}))},{passive:!0});function TWt(){Ps==="viewer"&&(_a.scrollTop=0,r9=!1,fa({type:"readerScroll",collapsed:!1}))}const mr=new Z1t({element:_a,extensions:wWt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{t3(),requestAnimationFrame(()=>p_e(_a)),!(Uk||Ps!=="editor")&&gd(t)},onSelectionUpdate:()=>t3(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return OLt(t)},handleClick(t,e,r){return epe(r,"click")},handleDOMEvents:{contextmenu(t,e){return epe(e,"contextmenu")}}}});_a.addEventListener("dblclick",t=>{if(Ps!=="viewer")return;const e=t.target;!e||e.closest("a, button, img, input, textarea, select, .edgeever-image-node")||(t.preventDefault(),t.stopPropagation(),fa({type:"doubleTap"}))});function epe(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 s=n.getAttribute("href")||"";if(AI(s)||Ry(s)){const a=uWt(s,n.textContent||"");if(a)return t.preventDefault(),t.stopPropagation(),fa({type:"resourcePress",targetJson:a}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const s=i.dataset.originalSrc||i.getAttribute("src")||"",a=i.dataset.originalSrc||(AI(s)||Ry(s)?s:"");if(!a&&!Ry(s))return Ps==="viewer"&&e==="click"&&s?(t.preventDefault(),fa({type:"imagePreview",source:s,alt:i.getAttribute("alt")||""}),!0):!1;const o=a||s,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=ate(o,l);if(u)return t.preventDefault(),t.stopPropagation(),fa({type:"resourcePress",targetJson:u}),!0}if(Ps==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),fa({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};_a.addEventListener("touchstart",n=>{var s;const i=(s=n.target)==null?void 0:s.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const a=e.dataset.originalSrc||e.getAttribute("src")||"",o=ate(a,e.getAttribute("alt")||"image");o&&fa({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),_a.addEventListener("touchend",r,{passive:!0}),_a.addEventListener("touchmove",r,{passive:!0}),_a.addEventListener("touchcancel",r,{passive:!0})})();const lte="edgeever-dollar",cte=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("$",lte)}:t:Array.isArray(e.content)?{...e,content:e.content.map(cte)}:t},v_e=t=>hNt(fee(t.getJSON()));let JC=null;const CWt=(t,e,r)=>{var s;const n=(s=t.storage.markdown)==null?void 0:s.manager,i=t.state.doc.slice(e,r).content.toJSON();return n!=null&&n.serialize?n.serialize(cte({type:"doc",content:i})).replaceAll(lte,"\\$"):t.state.doc.textBetween(e,r,` +`,IGt=t=>vEe.extend({addNodeView(){return RGt(t)}}),kRe=document.createElement("style");kRe.textContent=LGt;document.head.append(kRe);qLt();const SRe=document.createElement("style");SRe.textContent=hIt;document.head.append(SRe);ht.registerConnector(xMe,Fzt,!0);function IU(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 fte(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 pte(t,e){const r=IU(t);return r?JSON.stringify({kind:"image",href:fte(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function NGt(t,e){const r=IU(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:fte(t,r),filename:n,resourceId:r})}const ope="edgeever-attachment-kind-";function DGt(t){return t.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()}function ERe(t){t.querySelectorAll('a.edgeever-attachment-link, a[href*="/api/v1/resources/"]').forEach(e=>{Array.from(e.classList).forEach(n=>{n.startsWith(ope)&&e.classList.remove(n)});const r=DGt(e.textContent||"");e.classList.add("edgeever-attachment-link",`${ope}${Yv(null,r)}`)})}const OGt=performance.now(),lpe=256*1024;let Oa="viewer",AI="zh-CN",zq="开始输入…",K3=!1;const MI=new Map;let _Gt=0;function fs(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 PGt(t){return new Uint8Array(await t.arrayBuffer())}function BGt(t){let e="";for(let r=0;r{const r=`r${++_Gt}`;MI.set(r,e),fs({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{MI.delete(r)&&e(null)},3e4)})}async function $Gt(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(ARe(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await MRe(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function FGt(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]);hde.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default",flowchart:{nodeSpacing:25,rankSpacing:30}});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 hde.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u;const d=h.querySelector("svg"),f=d==null?void 0:d.viewBox.baseVal;d&&f&&f.width>0&&f.height>0&&(d.style.width=`${Math.ceil(f.width)}px`,d.style.height=`${Math.ceil(f.height)}px`,d.style.maxWidth="none"),s.replaceWith(h)}catch{}}}let Z3=null,nM=null,LI=null,J3=null,Q3=null,ex=null;function gte(){var t;nM!==null&&cancelAnimationFrame(nM),nM=null,Z3==null||Z3.dispose(),Z3=null,Q3==null||Q3.disconnect(),Q3=null,J3==null||J3.dispose(),J3=null,ex==null||ex.remove(),ex=null,(t=Rs.querySelector(".ProseMirror"))==null||t.removeAttribute("hidden")}function zGt(t,e,r){gte();const n=t.querySelector(".ProseMirror");if(!n)return!1;const i=Vzt(e,r),a=document.createElement("div");a.className="edgeever-x6-diagram",a.setAttribute("role","img"),a.setAttribute("aria-label",e.kind==="mind-map"?"思维导图":e.kind==="architecture"?"架构图":"流程图"),n.hidden=!0,t.append(a);const s=a.parentElement,o=()=>{if(!s)return Math.max(1,a.clientWidth);const f=getComputedStyle(s),p=getComputedStyle(a),g=Number.parseFloat(f.paddingLeft||"0")+Number.parseFloat(f.paddingRight||"0"),m=Number.parseFloat(p.marginLeft||"0")+Number.parseFloat(p.marginRight||"0");return Math.max(1,s.clientWidth-g-m)},l=new ht({container:a,width:o(),height:Math.max(1,a.clientHeight),background:{color:i.canvas},grid:!1,interacting:!1,panning:{enabled:!0},mousewheel:{enabled:!0,minScale:.1,maxScale:2.5}});l.addNodes(i.nodes),l.addEdges(i.edges);const u=Jzt(l,a,{...e,nodes:e.nodes.map((f,p)=>({...f,width:i.nodes[p].width,height:i.nodes[p].height}))});Z3=u;const h=()=>u.resize(o(),Math.max(1,a.clientHeight));nM=requestAnimationFrame(h);const d=new ResizeObserver(h);return d.observe(s??a),J3=l,Q3=d,ex=a,!0}const VGt=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function Dp(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 RRe(t){return Math.min(100,Math.max(10,Math.round(t)))}function vE(t,e){const r=e==null?null:RRe(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 cpe(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 HGt(){return B4e.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>Dp(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=Dp(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=S=>{const E=e();if(typeof E!="number")return;const A=t.state.doc.nodeAt(E);if(!A||A.type.name!=="image")return;const R=RRe(S);let _=t.state.tr.setNodeMarkup(E,void 0,{...A.attrs,width:R});try{_=_.setSelection(Nr.create(_.doc,E))}catch{}t.view.dispatch(_),vE(i,R),f(R)},d=[];for(const S of VGt){const E=document.createElement("button");E.type="button",E.className="edgeever-image-size-button",E.textContent=S.label,E.setAttribute("aria-label",S.label),E.setAttribute("aria-pressed","false"),cpe(E,()=>h(S.width)),d.push({button:E,width:S.width}),u.append(E)}const f=S=>{for(const E of d){const A=S!=null&&E.width===S;E.button.classList.toggle("is-active",A),E.button.setAttribute("aria-pressed",String(A))}},p=S=>{if(i.classList.toggle("is-loading",S==="loading"),i.classList.toggle("is-failed",S==="failed"),a.hidden=S==="ready",o.hidden=S!=="ready",l.hidden=S!=="ready",S==="failed"){a.replaceChildren();const E=document.createElement("span");E.className="edgeever-image-loading-label",E.textContent="图片加载失败",a.append(E),a.hidden=!1}else S==="loading"&&a.replaceChildren(s)},g=S=>{const E=String(S.src??"");return RI(E)||IU(E)?E:i.dataset.resourceHref||E},m=()=>{const S=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),E=pte(S,String(n.attrs.alt??"image"));if(E){fs({type:"resourcePress",targetJson:E});return}fs({type:"log",message:`image actions: no resource id for href=${S.slice(0,120)}`})},U=()=>{const S=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";S&&fs({type:"imagePreview",source:S,alt:String(n.attrs.alt??"")})};cpe(l,m);let y=0;const b=S=>{if(S.target instanceof Element&&S.target.closest(".edgeever-image-actions"))return;const E=Date.now();if(E-y<350)return;if(y=E,S.stopPropagation(),Oa==="viewer"||!t.isEditable){S.preventDefault(),U();return}S.preventDefault();const A=e();typeof A=="number"&&t.chain().setNodeSelection(A).run()};o.addEventListener("pointerdown",S=>S.stopPropagation()),o.addEventListener("click",b),o.addEventListener("pointerup",S=>{(S.pointerType==="touch"||S.pointerType==="pen")&&b(S)}),i.append(a,o,l,u);let v=0,w="",T=!1;const k=S=>{const E=String(S.alt??"");o.alt=E;const A=Dp(S.width);vE(i,A),f(A);const R=String(S.src??""),_=IU(R);_&&(i.dataset.resourceHref=fte(R,_),o.dataset.originalSrc=i.dataset.resourceHref)},C=S=>{v+=1;const E=v,A=String(S.src??"");w=A,k(S),p("loading"),u.hidden=!0;const R=_=>{E===v&&(o.onload=()=>{E===v&&(p("ready"),o.style.cursor=Oa==="viewer"||!t.isEditable?"zoom-in":"pointer",T&&t.isEditable&&Oa==="editor"&&(u.hidden=!1))},o.onerror=()=>{E===v&&p("failed")},o.src=_)};if(!A){p("failed");return}if(A.startsWith("data:")||A.startsWith("edgeever-res:")||A.startsWith("blob:")){R(A);return}if(ARe(A)){MRe(A).then(_=>{E===v&&(_?R(_):p("failed"))});return}R(A)};return C(r.attrs),{dom:i,update:S=>{if(S.type.name!=="image")return!1;n=S;const E=String(S.attrs.src??"");return k(S.attrs),E!==w?C(S.attrs):(f(Dp(S.attrs.width)),vE(i,Dp(S.attrs.width))),!0},selectNode:()=>{var E,A;T=!0,i.classList.add("is-selected");const S=Dp((A=(E=t.state.selection.node)==null?void 0:E.attrs)==null?void 0:A.width)??Dp(i.dataset.width)??Dp(n.attrs.width);vE(i,S),t.isEditable&&Oa==="editor"&&!o.hidden&&(u.hidden=!1,f(S))},deselectNode:()=>{T=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{v+=1}}}}}).configure({inline:!1,allowBase64:!0})}function GGt(t){return[...MEe({mathematics:xGt(),starterKit:{codeBlock:!1,link:!1},image:HGt(),gallery:IGt(()=>AI),pdf:!1,file:!1,pluginEmbed:!1,table:{table:{resizable:!1}},markdown:!0}),N$t,s5t.configure({languageClassPrefix:"language-"}),...hNt(),n5t.configure({placeholder:t})]}const Rs=document.getElementById("editor"),iM=document.getElementById("toolbar");let aM=!1;Rs.addEventListener("scroll",()=>{if(Oa!=="viewer")return;const t=Rs.scrollTop>(aM?4:24);t!==aM&&(aM=t,fs({type:"readerScroll",collapsed:t}))},{passive:!0});function WGt(){Oa==="viewer"&&(Rs.scrollTop=0,aM=!1,fs({type:"readerScroll",collapsed:!1}))}const Ur=new SUt({element:Rs,extensions:GGt("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{i4(),requestAnimationFrame(()=>ERe(Rs)),!(K3||Oa!=="editor")&&md(t)},onSelectionUpdate:()=>i4(),editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},transformPastedHTML(t){return uIt(t)},handleClick(t,e,r){return upe(r,"click")},handleDOMEvents:{contextmenu(t,e){return upe(e,"contextmenu")}}}});Rs.addEventListener("dblclick",t=>{if(Oa!=="viewer")return;const e=t.target;!e||e.closest("a, button, img, input, textarea, select, .edgeever-image-node")||(t.preventDefault(),t.stopPropagation(),fs({type:"doubleTap"}))});function upe(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(RI(a)||IU(a)){const s=NGt(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),fs({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||(RI(a)||IU(a)?a:"");if(!s&&!IU(a))return Oa==="viewer"&&e==="click"&&a?(t.preventDefault(),fs({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=pte(o,l);if(u)return t.preventDefault(),t.stopPropagation(),fs({type:"resourcePress",targetJson:u}),!0}if(Oa==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),fs({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Rs.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=pte(s,e.getAttribute("alt")||"image");o&&fs({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Rs.addEventListener("touchend",r,{passive:!0}),Rs.addEventListener("touchmove",r,{passive:!0}),Rs.addEventListener("touchcancel",r,{passive:!0})})();const mte="edgeever-dollar",Ute=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("$",mte)}:t:Array.isArray(e.content)?{...e,content:e.content.map(Ute)}:t},LRe=t=>VNt(vee(t.getJSON()));let r3=null;const qGt=(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(Ute({type:"doc",content:i})).replaceAll(mte,"\\$"):t.state.doc.textBetween(e,r,` -`)},xz="edgeever-inline-sentinel",kWt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(cte({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(lte,"\\$"):r},SWt=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,s)=>{if(!i.isTextblock)return!0;const a=s+1,o=a+i.content.size,l=Math.max(e.from,a),u=Math.min(e.to,o);return u>l&&r.push({node:i,contentFrom:a,contentTo:o,from:l,to:u}),!1}),r.length===1){const i=r[0],s=i.node.cut(i.from-i.contentFrom,i.to-i.contentFrom).toJSON(),a=t.state.doc.textBetween(i.from,i.to,` -`),o=kWt(t,s.content??[],a).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:a}:null}const n=CWt(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,` +`)},kF="edgeever-inline-sentinel",jGt=(t,e,r)=>{var i;const n=(i=t.storage.markdown)==null?void 0:i.manager;return n!=null&&n.serialize?n.serialize(Ute({type:"doc",content:[{type:"paragraph",content:e}]})).replaceAll(mte,"\\$"):r},YGt=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=jGt(t,a.content??[],s).trim();return o?{from:i.from,to:i.to,isInline:!0,markdown:o,text:s}:null}const n=qGt(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},EWt=(t,e,r)=>{var f,p,g;const n=(f=t.storage.markdown)==null?void 0:f.manager,i=e.trim(),s=((p=n==null?void 0:n.parse)==null?void 0:p.call(n,i).content)??[{type:"text",text:i}];if(!r)return s;const a=i.replace(/\s*\n+\s*/g," "),o=(g=n==null?void 0:n.parse)==null?void 0:g.call(n,`${xz}${a}`).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(xz))return[{type:"text",text:a}];const d=h.text.slice(xz.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function gd(t){try{const e=JSON.stringify(fee(t.getJSON())),r=v_e(t);fa({type:"change",contentMarkdown:r,contentJson:e})}catch(e){fa({type:"error",message:e instanceof Error?e.message:String(e)})}}function AWt(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(),a=[];let o=s.indexOf(r);for(;o!==-1;){const l=n[o],u=n[o+r.length-1];l&&u&&l.pos>=0&&u.pos>=0&&a.push({from:l.pos,to:u.pos+1}),o=s.indexOf(r,o+r.length)}return a}const tpe=()=>mr.isActive("taskItem")?"taskItem":"listItem";function b_e(t){var r;if(t9.classList.toggle("editor-mode",t),t9.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>mr.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>mr.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>fa({type:"pickImage"})},{id:"bold",label:"B",run:()=>mr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>mr.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>mr.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>mr.chain().focus().sinkListItem(tpe()).run()},{id:"outdent",label:"⇤",run:()=>mr.chain().focus().liftListItem(tpe()).run()},{id:"quote",label:"❝",run:()=>mr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>mr.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 s={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=s[n.id])==null?void 0:r[SI])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&gd(mr),t3()}),t9.appendChild(i)}t3()}function t3(){const t={bold:mr.isActive("bold"),bullet:mr.isActive("bulletList"),task:mr.isActive("taskList"),quote:mr.isActive("blockquote")},e=n=>{try{return mr.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};t9.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function wz(t="light"){_a.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=OU}),p_e(_a),await mWt(_a),Ps==="viewer"&&(!MI||!vWt(_a,MI,t))&&(ote(),await yWt(_a,t))}async function MWt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=h7(t.background,t.theme),r=t.fontStyle??"auto",n=t.fontSize??"lg",i=t.cardWidth??"wide",s=wI[i]||wI.wide,a=L6[e]||L6.aurora,o=mr.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:${s}px;pointer-events:none;`;const h=document.createElement("style");h.textContent=bVt({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=vVt({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=`${s}px`,f.style.maxWidth="none",f.style.margin="0",document.body.appendChild(u);try{const g=Array.from(f.querySelectorAll("img"));await Promise.race([Promise.all([(p=document.fonts)==null?void 0:p.ready,...g.map(async O=>{if(!O.complete)try{await O.decode()}catch{}})]),new Promise(O=>window.setTimeout(O,8e3))]);const m=Array.from(f.querySelectorAll(".edgeever-card-body img")),y=m.filter(O=>!O.complete||O.naturalWidth===0).length,v=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),b=dVt(s,v);let x=0,T=f,C=null;b.sourceScale<1&&(C=document.createElement("div"),C.style.cssText=`position:relative;width:${b.sourceWidth}px;height:${b.sourceHeight}px;overflow:hidden;`,f.replaceWith(C),C.appendChild(f),f.style.transform=`scale(${b.sourceScale})`,f.style.transformOrigin="top left",T=C);const S=pVt[e]||a.canvasBg,k="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",E=(O,D,B)=>V8t(O,{backgroundColor:S,cacheBust:!1,height:B,imagePlaceholder:k,onImageErrorHandler:z=>{x+=1,z instanceof Event&&z.target instanceof HTMLImageElement&&(z.target.src=k)},pixelRatio:b.pixelRatio,skipFonts:!0,width:D});let A;try{A=await E(T,b.sourceWidth,b.sourceHeight)}catch{const O=b.sourceScale*.75;if(O<.5)throw new Error("NOTE_IMAGE_RENDER_FAILED");const D=Math.max(1,Math.floor(s*O)),B=Math.max(1,Math.floor(v*O));C||(C=document.createElement("div"),f.replaceWith(C),C.appendChild(f)),C.style.cssText=`position:relative;width:${D}px;height:${B}px;overflow:hidden;`,f.style.transform=`scale(${O})`,f.style.transformOrigin="top left";try{A=await E(C,D,B)}catch{throw new Error("NOTE_IMAGE_RENDER_FAILED")}}const M=await new Promise((O,D)=>{A.toBlob(B=>B?O(B):D(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),R=t.format==="jpeg"?"jpg":"png",P=mVt(t.title,t.fallbackTitle),N=await pWt(M),L=`${P}.${R}`,I=t.format==="jpeg"?"image/jpeg":"image/png",$=gWt(N);for(let O=0;O<$.length;O+=Q0e)fa({type:"imageExportChunk",requestId:t.requestId,chunk:$.slice(O,O+Q0e)}),await new Promise(D=>setTimeout(D,0));fa({type:"imageExportComplete",requestId:t.requestId,filename:L,mimeType:I,width:A.width,height:A.height,totalImages:m.length,failedImages:Math.min(m.length,y+x)})}catch(g){fa({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const RWt={resetReaderScroll:TWt,exportImage(t){MWt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==Ps;Ps=e,SI=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",mr.setEditable(Ps==="editor"),b_e(Ps==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",Ps==="viewer"),document.body.classList.toggle("editor-mode",Ps==="editor"),t.placeholder&&(OU=t.placeholder,_a.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=OU})),Ps==="editor"&&r&&requestAnimationFrame(()=>{try{mr.commands.focus("end")}catch{}}),wz(t.theme||"light")},setMarkdown(t){var n;Uk=!0;const e=Ps==="viewer"?xzt(t):null;MI=e;const r=Ps==="viewer"?e?"":wzt(t):t;try{mr.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=mr.storage.markdown)==null?void 0:n.manager;if(i)mr.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}mr.setEditable(Ps==="editor"),a0e(mr),t3(),Uk=!1,wz(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){Uk=!0,MI=null,ote();try{const e=JSON.parse(t);mr.commands.setContent(PIt(sFt(e),SI))}catch{mr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}mr.setEditable(Ps==="editor"),a0e(mr),t3(),Uk=!1,wz(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=EI.get(t);r&&(EI.delete(t),r(e))},getMarkdown(){return v_e(mr)},getDocument(){return JSON.stringify(fee(mr.getJSON()))},captureSelection(){const t=SWt(mr);return t?(JC={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(mr.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(JC=null,null)},applySelectionDraft(t,e){var a,o;const r=JC;if(!r||!t.trim())return!1;if(JSON.stringify(mr.getJSON())!==r.documentFingerprint)return JC=null,!1;const n=mr.state.doc.content.size,i=Math.min(Math.max(r.from,0),n),s=Math.min(Math.max(r.to,i),n);try{const l=(a=mr.storage.markdown)==null?void 0:a.manager,u=(o=l==null?void 0:l.parse)==null?void 0:o.call(l,t),h=e==="replace"?EWt(mr,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:s,to:s}:{from:i,to:s};return mr.chain().focus().insertContentAt(d,h).run(),JC=null,gd(mr),!0}catch{return!1}},undo(){if(!mr.can().undo())return!1;const t=mr.commands.undo();return t&&gd(mr),t},focusEnd(){var t;try{mr.commands.focus("end")}catch{}try{const e=(t=mr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){gd(mr)},exec(t){var r;const e={bold:()=>mr.chain().focus().toggleBold().run(),bulletList:()=>mr.chain().focus().toggleBulletList().run(),taskList:()=>mr.chain().focus().toggleTaskList().run(),blockquote:()=>mr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>mr.chain().focus().setHorizontalRule().run(),heading2:()=>mr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>mr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),gd(mr)},beginImageUpload(t,e){mr.chain().focus().setImage({src:e,alt:t,width:Yde}).run();const r=_a.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),gd(mr)},completeImageUpload(t,e,r){mr.isEditable&&(mr.view.dispatch(iWt(mr.state,{src:e,alt:r||t||"",width:Yde})),gd(mr))},groupImages(t){const e=sWt(mr,t);return e&&gd(mr),e},cancelImageUpload(t){const e=_a.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),gd(mr)},search(t,e){const r=AWt(mr,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){mr.commands.setTextSelection({from:i.from,to:i.to});try{const s=mr.view.domAtPos(i.from).node,a=s instanceof Element?s:s.parentElement;a==null||a.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}fa({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=RWt;b_e(!1);fa({type:"ready",startupMs:Math.round(performance.now()-dWt)});class Wt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,s,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;i=a.start,s=a.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;s+15t.replace(_Wt,"-$1").toLowerCase(),IWt={"&":"&",">":">","<":"<",'"':""","'":"'"},NWt=/[&><"']/g,Jo=t=>String(t).replace(NWt,e=>IWt[e]),n9=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?n9(t.body[0]):t:t.type==="font"?n9(t.body):t,OWt=new Set(["mathord","textord","atom"]),cp=t=>OWt.has(n9(t).type),DWt=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"},RI={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 PWt(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 $Wt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return PWt(e)}function BWt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:$Wt(n)}class ute{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(RI)){var n=RI[r];n&&BWt(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 Wt("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=DWt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Op{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 Sd[FWt[this.id]]}sub(){return Sd[zWt[this.id]]}fracNum(){return Sd[VWt[this.id]]}fracDen(){return Sd[HWt[this.id]]}cramp(){return Sd[GWt[this.id]]}text(){return Sd[WWt[this.id]]}isTight(){return this.size>=2}}var hte=0,_I=1,dx=2,C0=3,$6=4,Du=5,r3=6,Dl=7,Sd=[new Op(hte,0,!1),new Op(_I,0,!0),new Op(dx,1,!1),new Op(C0,1,!0),new Op($6,2,!1),new Op(Du,2,!0),new Op(r3,3,!1),new Op(Dl,3,!0)],FWt=[$6,Du,$6,Du,r3,Dl,r3,Dl],zWt=[Du,Du,Du,Du,Dl,Dl,Dl,Dl],VWt=[dx,C0,$6,Du,r3,Dl,r3,Dl],HWt=[C0,C0,Du,Du,Dl,Dl,Dl,Dl],GWt=[_I,_I,C0,C0,Du,Du,Dl,Dl],WWt=[hte,_I,dx,C0,dx,C0,dx,C0],dn={DISPLAY:Sd[hte],TEXT:Sd[dx],SCRIPT:Sd[$6],SCRIPTSCRIPT:Sd[r3]},DU=[{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 qWt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var i9=[];DU.forEach(t=>t.blocks.forEach(e=>i9.push(...e)));function x_e(t){for(var e=0;e=i9[e]&&t<=i9[e+1])return!0;return!1}var ka=t=>t+" "+t,T2=80,UWt=function(e,r){return"M95,"+(622+e+r)+` +`)}:null},XGt=(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,`${kF}${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(kF))return[{type:"text",text:s}];const d=h.text.slice(kF.length);return[...d?[{...h,text:d}]:[],...u.slice(1)]};function md(t){try{const e=JSON.stringify(vee(t.getJSON())),r=LRe(t);fs({type:"change",contentMarkdown:r,contentJson:e})}catch(e){fs({type:"error",message:e instanceof Error?e.message:String(e)})}}function KGt(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 hpe=()=>Ur.isActive("taskItem")?"taskItem":"listItem";function IRe(t){var r;if(iM.classList.toggle("editor-mode",t),iM.innerHTML="",!t)return;const e=[{id:"undo",label:"↩",run:()=>Ur.chain().focus().undo().run()},{id:"redo",label:"↪",run:()=>Ur.chain().focus().redo().run()},{id:"image",label:"▧+",run:()=>fs({type:"pickImage"})},{id:"bold",label:"B",run:()=>Ur.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>Ur.chain().focus().toggleBulletList().run()},{id:"task",label:"☑",run:()=>Ur.chain().focus().toggleTaskList().run()},{id:"indent",label:"⇥",run:()=>Ur.chain().focus().sinkListItem(hpe()).run()},{id:"outdent",label:"⇤",run:()=>Ur.chain().focus().liftListItem(hpe()).run()},{id:"quote",label:"❝",run:()=>Ur.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>Ur.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={undo:{"zh-CN":"撤销","en-US":"Undo",ja:"元に戻す",pl:"Cofnij"},redo:{"zh-CN":"重做","en-US":"Redo",ja:"やり直す",pl:"Ponów"},image:{"zh-CN":"插入图片","en-US":"Insert image",ja:"画像を挿入",pl:"Wstaw obraz"},bold:{"zh-CN":"粗体","en-US":"Bold",ja:"太字",pl:"Pogrubienie"},bullet:{"zh-CN":"项目符号列表","en-US":"Bullet list",ja:"箇条書き",pl:"Lista punktowana"},task:{"zh-CN":"任务清单","en-US":"Task list",ja:"タスクリスト",pl:"Lista zadań"},indent:{"zh-CN":"增加列表缩进","en-US":"Increase list indent",ja:"リストのインデントを増やす",pl:"Zwiększ wcięcie listy"},outdent:{"zh-CN":"减少列表缩进","en-US":"Decrease list indent",ja:"リストのインデントを減らす",pl:"Zmniejsz wcięcie listy"},quote:{"zh-CN":"引用","en-US":"Block quote",ja:"引用",pl:"Cytat"},hr:{"zh-CN":"分隔线","en-US":"Horizontal rule",ja:"区切り線",pl:"Linia pozioma"}};i.setAttribute("aria-label",((r=a[n.id])==null?void 0:r[AI])??n.id),i.addEventListener("click",()=>{n.run(),n.id!=="image"&&md(Ur),i4()}),iM.appendChild(i)}i4()}function i4(){const t={bold:Ur.isActive("bold"),bullet:Ur.isActive("bulletList"),task:Ur.isActive("taskList"),quote:Ur.isActive("blockquote")},e=n=>{try{return Ur.can().chain().focus()[n]().run()}catch{return!1}},r={undo:e("undo"),redo:e("redo")};iM.querySelectorAll("button[data-action]").forEach(n=>{const i=n.dataset.action??"";n.classList.toggle("is-active",t[i]??!1),i in r&&(n.disabled=!r[i])})}async function SF(t="light"){Rs.querySelectorAll("[data-placeholder]").forEach(e=>{e.dataset.placeholder=zq}),ERe(Rs),await $Gt(Rs),Oa==="viewer"&&(!LI||!zGt(Rs,LI,t))&&(gte(),await FGt(Rs,t))}async function ZGt(t){var p;if(!t.requestId||t.format!=="png"&&t.format!=="jpeg")return;const e=MC(t.background,t.theme),r=t.fontStyle??"auto",n=t.fontSize??"lg",i=t.cardWidth??"wide",a=vH[i]||vH.wide,s=xH[e]||xH.aurora,o=Ur.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=Dse({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const d=dJe({title:t.title||t.fallbackTitle,notebook:t.notebook,tags:t.tags,updatedAt:t.updatedAt,bodyHtml:l,theme:e,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{const g=await mJe({theme:e,fontStyle:r,text:[t.title,t.notebook,...t.tags||[],t.updatedAt,l].join(" "),urls:UJe});h.textContent=g.css+Dse({theme:e,fontStyle:r,fontSize:n,cardWidth:i});const m=Array.from(f.querySelectorAll("img"));await Promise.race([Promise.all([(p=document.fonts)==null?void 0:p.ready,...m.map(async D=>{if(!D.complete)try{await D.decode()}catch{}})]),new Promise(D=>window.setTimeout(D,8e3))]);const U=Array.from(f.querySelectorAll(".edgeever-card-body img")),y=U.filter(D=>!D.complete||D.naturalWidth===0).length,b=Math.max(1,Math.ceil(f.getBoundingClientRect().height)),v=aJe(a,b);let w=0,T=f,k=null;v.sourceScale<1&&(k=document.createElement("div"),k.style.cssText=`position:relative;width:${v.sourceWidth}px;height:${v.sourceHeight}px;overflow:hidden;`,f.replaceWith(k),k.appendChild(f),f.style.transform=`scale(${v.sourceScale})`,f.style.transformOrigin="top left",T=k);const C=sJe[e]||s.canvasBg,S="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",E=(D,B,F)=>mEt(D,{backgroundColor:C,cacheBust:!1,height:F,imagePlaceholder:S,onImageErrorHandler:z=>{w+=1,z instanceof Event&&z.target instanceof HTMLImageElement&&(z.target.src=S)},pixelRatio:v.pixelRatio,fontEmbedCSS:g.fontCss,width:B});let A;try{A=await E(T,v.sourceWidth,v.sourceHeight)}catch{const D=v.sourceScale*.75;if(D<.5)throw new Error("NOTE_IMAGE_RENDER_FAILED");const B=Math.max(1,Math.floor(a*D)),F=Math.max(1,Math.floor(b*D));k||(k=document.createElement("div"),f.replaceWith(k),k.appendChild(f)),k.style.cssText=`position:relative;width:${B}px;height:${F}px;overflow:hidden;`,f.style.transform=`scale(${D})`,f.style.transformOrigin="top left";try{A=await E(k,B,F)}catch{throw new Error("NOTE_IMAGE_RENDER_FAILED")}}const R=await new Promise((D,B)=>{A.toBlob(F=>F?D(F):B(new Error("Image renderer returned an empty file")),t.format==="jpeg"?"image/jpeg":"image/png",t.format==="jpeg"?.92:1)}),_=t.format==="jpeg"?"jpg":"png",N=uJe(t.title,t.fallbackTitle),L=await PGt(R),I=`${N}.${_}`,P=t.format==="jpeg"?"image/jpeg":"image/png",O=BGt(L);for(let D=0;DsetTimeout(B,0));fs({type:"imageExportComplete",requestId:t.requestId,filename:I,mimeType:P,width:A.width,height:A.height,totalImages:U.length,failedImages:Math.min(U.length,y+w)})}catch(g){fs({type:"imageExportError",requestId:t.requestId,message:g instanceof Error?g.message:"Image export failed"})}finally{u.remove()}}const JGt={resetReaderScroll:WGt,exportImage(t){ZGt(t)},configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==Oa;Oa=e,AI=t.locale==="en-US"||t.locale==="ja"||t.locale==="pl"?t.locale:"zh-CN",Ur.setEditable(Oa==="editor"),IRe(Oa==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",Oa==="viewer"),document.body.classList.toggle("editor-mode",Oa==="editor"),t.placeholder&&(zq=t.placeholder,Rs.querySelectorAll("[data-placeholder]").forEach(n=>{n.dataset.placeholder=zq})),Oa==="editor"&&r&&requestAnimationFrame(()=>{try{Ur.commands.focus("end")}catch{}}),SF(t.theme||"light")},setMarkdown(t){var n;K3=!0;const e=Oa==="viewer"?ZFt(t):null;LI=e;const r=Oa==="viewer"?e?"":JFt(t):t;try{Ur.commands.setContent(r||"",{contentType:"markdown"})}catch{try{const i=(n=Ur.storage.markdown)==null?void 0:n.manager;if(i)Ur.commands.setContent(i.parse(r||""));else throw new Error("no markdown manager")}catch{Ur.commands.setContent({type:"doc",content:[{type:"paragraph",content:r?[{type:"text",text:r}]:[]}]})}}Ur.setEditable(Oa==="editor"),m0e(Ur),i4(),K3=!1,SF(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){K3=!0,LI=null,gte();try{const e=JSON.parse(t);Ur.commands.setContent(fNt(_$t(e),AI))}catch{Ur.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}Ur.setEditable(Oa==="editor"),m0e(Ur),i4(),K3=!1,SF(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=MI.get(t);r&&(MI.delete(t),r(e))},getMarkdown(){return LRe(Ur)},getDocument(){return JSON.stringify(vee(Ur.getJSON()))},captureSelection(){const t=YGt(Ur);return t?(r3={from:t.from,to:t.to,isInline:t.isInline,documentFingerprint:JSON.stringify(Ur.getJSON())},JSON.stringify({from:t.from,to:t.to,markdown:t.markdown,text:t.text})):(r3=null,null)},applySelectionDraft(t,e){var s,o;const r=r3;if(!r||!t.trim())return!1;if(JSON.stringify(Ur.getJSON())!==r.documentFingerprint)return r3=null,!1;const n=Ur.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=Ur.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"?XGt(Ur,t,r.isInline):(u==null?void 0:u.content)??t,d=e==="append"?{from:a,to:a}:{from:i,to:a};return Ur.chain().focus().insertContentAt(d,h).run(),r3=null,md(Ur),!0}catch{return!1}},undo(){if(!Ur.can().undo())return!1;const t=Ur.commands.undo();return t&&md(Ur),t},focusEnd(){var t;try{Ur.commands.focus("end")}catch{}try{const e=(t=Ur.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){md(Ur)},exec(t){var r;const e={bold:()=>Ur.chain().focus().toggleBold().run(),bulletList:()=>Ur.chain().focus().toggleBulletList().run(),taskList:()=>Ur.chain().focus().toggleTaskList().run(),blockquote:()=>Ur.chain().focus().toggleBlockquote().run(),horizontalRule:()=>Ur.chain().focus().setHorizontalRule().run(),heading2:()=>Ur.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>Ur.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),md(Ur)},beginImageUpload(t,e){Ur.chain().focus().setImage({src:e,alt:t,width:sfe}).run();const r=Rs.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),md(Ur)},completeImageUpload(t,e,r){Ur.isEditable&&(Ur.view.dispatch(EGt(Ur.state,{src:e,alt:r||t||"",width:sfe})),md(Ur))},groupImages(t){const e=AGt(Ur,t);return e&&md(Ur),e},cancelImageUpload(t){const e=Rs.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),md(Ur)},search(t,e){const r=KGt(Ur,t),n=r.length>0?Math.min(Math.max(Number.isFinite(e)?e:0,0),r.length-1):0,i=r[n];if(i){Ur.commands.setTextSelection({from:i.from,to:i.to});try{const a=Ur.view.domAtPos(i.from).node,s=a instanceof Element?a:a.parentElement;s==null||s.scrollIntoView({block:"center",behavior:"smooth"})}catch{}}fs({type:"searchResult",count:r.length,index:n})}};window.EdgeEverEditor=JGt;IRe(!1);fs({type:"ready",startupMs:Math.round(performance.now()-OGt)});class Gt 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(QGt,"-$1").toLowerCase(),tWt={"&":"&",">":">","<":"<",'"':""","'":"'"},rWt=/[&><"']/g,Qo=t=>String(t).replace(rWt,e=>tWt[e]),sM=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?sM(t.body[0]):t:t.type==="font"?sM(t.body):t,nWt=new Set(["mathord","textord","atom"]),up=t=>nWt.has(sM(t).type),iWt=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"},II={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 aWt(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 sWt(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return aWt(e)}function oWt(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:sWt(n)}class yte{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(II)){var n=II[r];n&&oWt(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 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("url"in e&&e.url&&!e.protocol){var r=iWt(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class Op{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 Sd[lWt[this.id]]}sub(){return Sd[cWt[this.id]]}fracNum(){return Sd[uWt[this.id]]}fracDen(){return Sd[hWt[this.id]]}cramp(){return Sd[dWt[this.id]]}text(){return Sd[fWt[this.id]]}isTight(){return this.size>=2}}var bte=0,NI=1,m6=2,C0=3,FT=4,Ou=5,a4=6,Ol=7,Sd=[new Op(bte,0,!1),new Op(NI,0,!0),new Op(m6,1,!1),new Op(C0,1,!0),new Op(FT,2,!1),new Op(Ou,2,!0),new Op(a4,3,!1),new Op(Ol,3,!0)],lWt=[FT,Ou,FT,Ou,a4,Ol,a4,Ol],cWt=[Ou,Ou,Ou,Ou,Ol,Ol,Ol,Ol],uWt=[m6,C0,FT,Ou,a4,Ol,a4,Ol],hWt=[C0,C0,Ou,Ou,Ol,Ol,Ol,Ol],dWt=[NI,NI,C0,C0,Ou,Ou,Ol,Ol],fWt=[bte,NI,m6,C0,m6,C0,m6,C0],pn={DISPLAY:Sd[bte],TEXT:Sd[m6],SCRIPT:Sd[FT],SCRIPTSCRIPT:Sd[a4]},Vq=[{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 pWt(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var oM=[];Vq.forEach(t=>t.blocks.forEach(e=>oM.push(...e)));function NRe(t){for(var e=0;e=oM[e]&&t<=oM[e+1])return!0;return!1}var Cs=t=>t+" "+t,k2=80,gWt=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 @@ -2818,7 +2951,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"},jWt=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"},mWt=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+` @@ -2828,7 +2961,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"},YWt=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},UWt=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 @@ -2837,7 +2970,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"},XWt=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},yWt=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 @@ -2847,18 +2980,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"},KWt=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},bWt=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"},ZWt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},QWt=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"},vWt=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},xWt=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"},JWt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=UWt(r,T2);break;case"sqrtSize1":i=jWt(r,T2);break;case"sqrtSize2":i=YWt(r,T2);break;case"sqrtSize3":i=XWt(r,T2);break;case"sqrtSize4":i=KWt(r,T2);break;case"sqrtTall":i=QWt(r,T2,n)}return i},eqt=function(e,r){switch(e){case"⎜":return ka("M291 0 H417 V"+r+" H291z");case"∣":return ka("M145 0 H188 V"+r+" H145z");case"∥":return ka("M145 0 H188 V"+r+" H145z")+ka("M367 0 H410 V"+r+" H367z");case"⎟":return ka("M457 0 H583 V"+r+" H457z");case"⎢":return ka("M319 0 H403 V"+r+" H319z");case"⎥":return ka("M263 0 H347 V"+r+" H263z");case"⎪":return ka("M384 0 H504 V"+r+" H384z");case"⏐":return ka("M312 0 H355 V"+r+" H312z");case"‖":return ka("M257 0 H300 V"+r+" H257z")+ka("M478 0 H521 V"+r+" H478z");default:return""}},rpe={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},wWt=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=gWt(r,k2);break;case"sqrtSize1":i=mWt(r,k2);break;case"sqrtSize2":i=UWt(r,k2);break;case"sqrtSize3":i=yWt(r,k2);break;case"sqrtSize4":i=bWt(r,k2);break;case"sqrtTall":i=xWt(r,k2,n)}return i},TWt=function(e,r){switch(e){case"⎜":return Cs("M291 0 H417 V"+r+" H291z");case"∣":return Cs("M145 0 H188 V"+r+" H145z");case"∥":return Cs("M145 0 H188 V"+r+" H145z")+Cs("M367 0 H410 V"+r+" H367z");case"⎟":return Cs("M457 0 H583 V"+r+" H457z");case"⎢":return Cs("M319 0 H403 V"+r+" H319z");case"⎥":return Cs("M263 0 H347 V"+r+" H263z");case"⎪":return Cs("M384 0 H504 V"+r+" H384z");case"⏐":return Cs("M312 0 H355 V"+r+" H312z");case"‖":return Cs("M257 0 H300 V"+r+" H257z")+Cs("M478 0 H521 V"+r+" H478z");default:return""}},dpe={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 @@ -2904,10 +3037,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:ka("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:ka("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:ka("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:ka("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Cs("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Cs("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Cs("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Cs("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:ka("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Cs("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 @@ -2956,7 +3089,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:ka("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:ka("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:ka("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Cs("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Cs("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Cs("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 @@ -3029,7 +3162,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`},tqt=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`},CWt=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 @@ -3057,48 +3190,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 rqt(t){return"toText"in t}let nC=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 this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(rqt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var PU={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},nqt={ex:!0,em:!0,mu:!0},w_e=function(e){return typeof e!="string"&&(e=e.unit),e in PU||e in nqt||e==="ex"},Cs=function(e,r){var n;if(e.unit in PU)n=PU[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 Wt("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Kt=function(e){return+e.toFixed(4)+"em"},Zg=function(e){return e.filter(r=>r).join(" ")},dte=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=LWt(n)+":"+i+";")}return r},T_e=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)}},C_e=function(e){var r=document.createElement(e);r.className=Zg(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]/,k_e=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Jo(Zg(this.classes))+'"');var n=dte(this.style);n&&(r+=' style="'+Jo(n)+'"');for(var i of Object.keys(this.attributes)){if(iqt.test(i))throw new Wt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Jo(this.attributes[i])+'"'}r+=">";for(var s=0;s",r};class iC{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,T_e.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return C_e.call(this,"span")}toMarkup(){return k_e.call(this,"span")}}let lP=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,T_e.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 C_e.call(this,"a")}toMarkup(){return k_e.call(this,"a")}};class sqt{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=''+Jo(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Kt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Zg(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:"+Kt(this.italic)+";"),n+=dte(this.style),n&&(e=!0,r+=' style="'+Jo(n)+'"');var i=Jo(this.text);return e?(r+=">",r+=i,r+="",r):i}}class $0{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 $U{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 cqt=t=>t instanceof iC||t instanceof lP||t instanceof nC,Ld={"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]}},vM={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]},npe={Å:"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 S_e(t,e){Ld[t]=e}function fte(t,e,r){if(!Ld[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Ld[e][n];if(!i&&t[0]in npe&&(n=npe[t[0]].charCodeAt(0),i=Ld[e][n]),!i&&r==="text"&&x_e(n)&&(i=Ld[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Tz={};function uqt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!Tz[e]){var r=Tz[e]={cssEmPerMu:vM.quad[e]/18};for(var n in vM)vM.hasOwnProperty(n)&&(r[n]=vM[n][e])}return Tz[e]}var ds={math:{},text:{}};function U(t,e,r,n,i,s){ds[t][i]={font:e,group:r,replace:n},s&&n&&(ds[t][n]=ds[t][i])}var ae="math",Ot="text",be="main",We="ams",ms="accent-token",hr="bin",Ql="close",sC="inner",Hr="mathord",ba="op-token",lu="open",f7="punct",Xe="rel",up="spacing",et="textord";U(ae,be,Xe,"≡","\\equiv",!0);U(ae,be,Xe,"≺","\\prec",!0);U(ae,be,Xe,"≻","\\succ",!0);U(ae,be,Xe,"∼","\\sim",!0);U(ae,be,Xe,"⊥","\\perp");U(ae,be,Xe,"⪯","\\preceq",!0);U(ae,be,Xe,"⪰","\\succeq",!0);U(ae,be,Xe,"≃","\\simeq",!0);U(ae,be,Xe,"∣","\\mid",!0);U(ae,be,Xe,"≪","\\ll",!0);U(ae,be,Xe,"≫","\\gg",!0);U(ae,be,Xe,"≍","\\asymp",!0);U(ae,be,Xe,"∥","\\parallel");U(ae,be,Xe,"⋈","\\bowtie",!0);U(ae,be,Xe,"⌣","\\smile",!0);U(ae,be,Xe,"⊑","\\sqsubseteq",!0);U(ae,be,Xe,"⊒","\\sqsupseteq",!0);U(ae,be,Xe,"≐","\\doteq",!0);U(ae,be,Xe,"⌢","\\frown",!0);U(ae,be,Xe,"∋","\\ni",!0);U(ae,be,Xe,"∝","\\propto",!0);U(ae,be,Xe,"⊢","\\vdash",!0);U(ae,be,Xe,"⊣","\\dashv",!0);U(ae,be,Xe,"∋","\\owns");U(ae,be,f7,".","\\ldotp");U(ae,be,f7,"⋅","\\cdotp");U(ae,be,f7,"⋅","·");U(Ot,be,et,"⋅","·");U(ae,be,et,"#","\\#");U(Ot,be,et,"#","\\#");U(ae,be,et,"&","\\&");U(Ot,be,et,"&","\\&");U(ae,be,et,"ℵ","\\aleph",!0);U(ae,be,et,"∀","\\forall",!0);U(ae,be,et,"ℏ","\\hbar",!0);U(ae,be,et,"∃","\\exists",!0);U(ae,be,et,"∇","\\nabla",!0);U(ae,be,et,"♭","\\flat",!0);U(ae,be,et,"ℓ","\\ell",!0);U(ae,be,et,"♮","\\natural",!0);U(ae,be,et,"♣","\\clubsuit",!0);U(ae,be,et,"℘","\\wp",!0);U(ae,be,et,"♯","\\sharp",!0);U(ae,be,et,"♢","\\diamondsuit",!0);U(ae,be,et,"ℜ","\\Re",!0);U(ae,be,et,"♡","\\heartsuit",!0);U(ae,be,et,"ℑ","\\Im",!0);U(ae,be,et,"♠","\\spadesuit",!0);U(ae,be,et,"§","\\S",!0);U(Ot,be,et,"§","\\S");U(ae,be,et,"¶","\\P",!0);U(Ot,be,et,"¶","\\P");U(ae,be,et,"†","\\dag");U(Ot,be,et,"†","\\dag");U(Ot,be,et,"†","\\textdagger");U(ae,be,et,"‡","\\ddag");U(Ot,be,et,"‡","\\ddag");U(Ot,be,et,"‡","\\textdaggerdbl");U(ae,be,Ql,"⎱","\\rmoustache",!0);U(ae,be,lu,"⎰","\\lmoustache",!0);U(ae,be,Ql,"⟯","\\rgroup",!0);U(ae,be,lu,"⟮","\\lgroup",!0);U(ae,be,hr,"∓","\\mp",!0);U(ae,be,hr,"⊖","\\ominus",!0);U(ae,be,hr,"⊎","\\uplus",!0);U(ae,be,hr,"⊓","\\sqcap",!0);U(ae,be,hr,"∗","\\ast");U(ae,be,hr,"⊔","\\sqcup",!0);U(ae,be,hr,"◯","\\bigcirc",!0);U(ae,be,hr,"∙","\\bullet",!0);U(ae,be,hr,"‡","\\ddagger");U(ae,be,hr,"≀","\\wr",!0);U(ae,be,hr,"⨿","\\amalg");U(ae,be,hr,"&","\\And");U(ae,be,Xe,"⟵","\\longleftarrow",!0);U(ae,be,Xe,"⇐","\\Leftarrow",!0);U(ae,be,Xe,"⟸","\\Longleftarrow",!0);U(ae,be,Xe,"⟶","\\longrightarrow",!0);U(ae,be,Xe,"⇒","\\Rightarrow",!0);U(ae,be,Xe,"⟹","\\Longrightarrow",!0);U(ae,be,Xe,"↔","\\leftrightarrow",!0);U(ae,be,Xe,"⟷","\\longleftrightarrow",!0);U(ae,be,Xe,"⇔","\\Leftrightarrow",!0);U(ae,be,Xe,"⟺","\\Longleftrightarrow",!0);U(ae,be,Xe,"↦","\\mapsto",!0);U(ae,be,Xe,"⟼","\\longmapsto",!0);U(ae,be,Xe,"↗","\\nearrow",!0);U(ae,be,Xe,"↩","\\hookleftarrow",!0);U(ae,be,Xe,"↪","\\hookrightarrow",!0);U(ae,be,Xe,"↘","\\searrow",!0);U(ae,be,Xe,"↼","\\leftharpoonup",!0);U(ae,be,Xe,"⇀","\\rightharpoonup",!0);U(ae,be,Xe,"↙","\\swarrow",!0);U(ae,be,Xe,"↽","\\leftharpoondown",!0);U(ae,be,Xe,"⇁","\\rightharpoondown",!0);U(ae,be,Xe,"↖","\\nwarrow",!0);U(ae,be,Xe,"⇌","\\rightleftharpoons",!0);U(ae,We,Xe,"≮","\\nless",!0);U(ae,We,Xe,"","\\@nleqslant");U(ae,We,Xe,"","\\@nleqq");U(ae,We,Xe,"⪇","\\lneq",!0);U(ae,We,Xe,"≨","\\lneqq",!0);U(ae,We,Xe,"","\\@lvertneqq");U(ae,We,Xe,"⋦","\\lnsim",!0);U(ae,We,Xe,"⪉","\\lnapprox",!0);U(ae,We,Xe,"⊀","\\nprec",!0);U(ae,We,Xe,"⋠","\\npreceq",!0);U(ae,We,Xe,"⋨","\\precnsim",!0);U(ae,We,Xe,"⪹","\\precnapprox",!0);U(ae,We,Xe,"≁","\\nsim",!0);U(ae,We,Xe,"","\\@nshortmid");U(ae,We,Xe,"∤","\\nmid",!0);U(ae,We,Xe,"⊬","\\nvdash",!0);U(ae,We,Xe,"⊭","\\nvDash",!0);U(ae,We,Xe,"⋪","\\ntriangleleft");U(ae,We,Xe,"⋬","\\ntrianglelefteq",!0);U(ae,We,Xe,"⊊","\\subsetneq",!0);U(ae,We,Xe,"","\\@varsubsetneq");U(ae,We,Xe,"⫋","\\subsetneqq",!0);U(ae,We,Xe,"","\\@varsubsetneqq");U(ae,We,Xe,"≯","\\ngtr",!0);U(ae,We,Xe,"","\\@ngeqslant");U(ae,We,Xe,"","\\@ngeqq");U(ae,We,Xe,"⪈","\\gneq",!0);U(ae,We,Xe,"≩","\\gneqq",!0);U(ae,We,Xe,"","\\@gvertneqq");U(ae,We,Xe,"⋧","\\gnsim",!0);U(ae,We,Xe,"⪊","\\gnapprox",!0);U(ae,We,Xe,"⊁","\\nsucc",!0);U(ae,We,Xe,"⋡","\\nsucceq",!0);U(ae,We,Xe,"⋩","\\succnsim",!0);U(ae,We,Xe,"⪺","\\succnapprox",!0);U(ae,We,Xe,"≆","\\ncong",!0);U(ae,We,Xe,"","\\@nshortparallel");U(ae,We,Xe,"∦","\\nparallel",!0);U(ae,We,Xe,"⊯","\\nVDash",!0);U(ae,We,Xe,"⋫","\\ntriangleright");U(ae,We,Xe,"⋭","\\ntrianglerighteq",!0);U(ae,We,Xe,"","\\@nsupseteqq");U(ae,We,Xe,"⊋","\\supsetneq",!0);U(ae,We,Xe,"","\\@varsupsetneq");U(ae,We,Xe,"⫌","\\supsetneqq",!0);U(ae,We,Xe,"","\\@varsupsetneqq");U(ae,We,Xe,"⊮","\\nVdash",!0);U(ae,We,Xe,"⪵","\\precneqq",!0);U(ae,We,Xe,"⪶","\\succneqq",!0);U(ae,We,Xe,"","\\@nsubseteqq");U(ae,We,hr,"⊴","\\unlhd");U(ae,We,hr,"⊵","\\unrhd");U(ae,We,Xe,"↚","\\nleftarrow",!0);U(ae,We,Xe,"↛","\\nrightarrow",!0);U(ae,We,Xe,"⇍","\\nLeftarrow",!0);U(ae,We,Xe,"⇏","\\nRightarrow",!0);U(ae,We,Xe,"↮","\\nleftrightarrow",!0);U(ae,We,Xe,"⇎","\\nLeftrightarrow",!0);U(ae,We,Xe,"△","\\vartriangle");U(ae,We,et,"ℏ","\\hslash");U(ae,We,et,"▽","\\triangledown");U(ae,We,et,"◊","\\lozenge");U(ae,We,et,"Ⓢ","\\circledS");U(ae,We,et,"®","\\circledR");U(Ot,We,et,"®","\\circledR");U(ae,We,et,"∡","\\measuredangle",!0);U(ae,We,et,"∄","\\nexists");U(ae,We,et,"℧","\\mho");U(ae,We,et,"Ⅎ","\\Finv",!0);U(ae,We,et,"⅁","\\Game",!0);U(ae,We,et,"‵","\\backprime");U(ae,We,et,"▲","\\blacktriangle");U(ae,We,et,"▼","\\blacktriangledown");U(ae,We,et,"■","\\blacksquare");U(ae,We,et,"⧫","\\blacklozenge");U(ae,We,et,"★","\\bigstar");U(ae,We,et,"∢","\\sphericalangle",!0);U(ae,We,et,"∁","\\complement",!0);U(ae,We,et,"ð","\\eth",!0);U(Ot,be,et,"ð","ð");U(ae,We,et,"╱","\\diagup");U(ae,We,et,"╲","\\diagdown");U(ae,We,et,"□","\\square");U(ae,We,et,"□","\\Box");U(ae,We,et,"◊","\\Diamond");U(ae,We,et,"¥","\\yen",!0);U(Ot,We,et,"¥","\\yen",!0);U(ae,We,et,"✓","\\checkmark",!0);U(Ot,We,et,"✓","\\checkmark");U(ae,We,et,"ℶ","\\beth",!0);U(ae,We,et,"ℸ","\\daleth",!0);U(ae,We,et,"ℷ","\\gimel",!0);U(ae,We,et,"ϝ","\\digamma",!0);U(ae,We,et,"ϰ","\\varkappa");U(ae,We,lu,"┌","\\@ulcorner",!0);U(ae,We,Ql,"┐","\\@urcorner",!0);U(ae,We,lu,"└","\\@llcorner",!0);U(ae,We,Ql,"┘","\\@lrcorner",!0);U(ae,We,Xe,"≦","\\leqq",!0);U(ae,We,Xe,"⩽","\\leqslant",!0);U(ae,We,Xe,"⪕","\\eqslantless",!0);U(ae,We,Xe,"≲","\\lesssim",!0);U(ae,We,Xe,"⪅","\\lessapprox",!0);U(ae,We,Xe,"≊","\\approxeq",!0);U(ae,We,hr,"⋖","\\lessdot");U(ae,We,Xe,"⋘","\\lll",!0);U(ae,We,Xe,"≶","\\lessgtr",!0);U(ae,We,Xe,"⋚","\\lesseqgtr",!0);U(ae,We,Xe,"⪋","\\lesseqqgtr",!0);U(ae,We,Xe,"≑","\\doteqdot");U(ae,We,Xe,"≓","\\risingdotseq",!0);U(ae,We,Xe,"≒","\\fallingdotseq",!0);U(ae,We,Xe,"∽","\\backsim",!0);U(ae,We,Xe,"⋍","\\backsimeq",!0);U(ae,We,Xe,"⫅","\\subseteqq",!0);U(ae,We,Xe,"⋐","\\Subset",!0);U(ae,We,Xe,"⊏","\\sqsubset",!0);U(ae,We,Xe,"≼","\\preccurlyeq",!0);U(ae,We,Xe,"⋞","\\curlyeqprec",!0);U(ae,We,Xe,"≾","\\precsim",!0);U(ae,We,Xe,"⪷","\\precapprox",!0);U(ae,We,Xe,"⊲","\\vartriangleleft");U(ae,We,Xe,"⊴","\\trianglelefteq");U(ae,We,Xe,"⊨","\\vDash",!0);U(ae,We,Xe,"⊪","\\Vvdash",!0);U(ae,We,Xe,"⌣","\\smallsmile");U(ae,We,Xe,"⌢","\\smallfrown");U(ae,We,Xe,"≏","\\bumpeq",!0);U(ae,We,Xe,"≎","\\Bumpeq",!0);U(ae,We,Xe,"≧","\\geqq",!0);U(ae,We,Xe,"⩾","\\geqslant",!0);U(ae,We,Xe,"⪖","\\eqslantgtr",!0);U(ae,We,Xe,"≳","\\gtrsim",!0);U(ae,We,Xe,"⪆","\\gtrapprox",!0);U(ae,We,hr,"⋗","\\gtrdot");U(ae,We,Xe,"⋙","\\ggg",!0);U(ae,We,Xe,"≷","\\gtrless",!0);U(ae,We,Xe,"⋛","\\gtreqless",!0);U(ae,We,Xe,"⪌","\\gtreqqless",!0);U(ae,We,Xe,"≖","\\eqcirc",!0);U(ae,We,Xe,"≗","\\circeq",!0);U(ae,We,Xe,"≜","\\triangleq",!0);U(ae,We,Xe,"∼","\\thicksim");U(ae,We,Xe,"≈","\\thickapprox");U(ae,We,Xe,"⫆","\\supseteqq",!0);U(ae,We,Xe,"⋑","\\Supset",!0);U(ae,We,Xe,"⊐","\\sqsupset",!0);U(ae,We,Xe,"≽","\\succcurlyeq",!0);U(ae,We,Xe,"⋟","\\curlyeqsucc",!0);U(ae,We,Xe,"≿","\\succsim",!0);U(ae,We,Xe,"⪸","\\succapprox",!0);U(ae,We,Xe,"⊳","\\vartriangleright");U(ae,We,Xe,"⊵","\\trianglerighteq");U(ae,We,Xe,"⊩","\\Vdash",!0);U(ae,We,Xe,"∣","\\shortmid");U(ae,We,Xe,"∥","\\shortparallel");U(ae,We,Xe,"≬","\\between",!0);U(ae,We,Xe,"⋔","\\pitchfork",!0);U(ae,We,Xe,"∝","\\varpropto");U(ae,We,Xe,"◀","\\blacktriangleleft");U(ae,We,Xe,"∴","\\therefore",!0);U(ae,We,Xe,"∍","\\backepsilon");U(ae,We,Xe,"▶","\\blacktriangleright");U(ae,We,Xe,"∵","\\because",!0);U(ae,We,Xe,"⋘","\\llless");U(ae,We,Xe,"⋙","\\gggtr");U(ae,We,hr,"⊲","\\lhd");U(ae,We,hr,"⊳","\\rhd");U(ae,We,Xe,"≂","\\eqsim",!0);U(ae,be,Xe,"⋈","\\Join");U(ae,We,Xe,"≑","\\Doteq",!0);U(ae,We,hr,"∔","\\dotplus",!0);U(ae,We,hr,"∖","\\smallsetminus");U(ae,We,hr,"⋒","\\Cap",!0);U(ae,We,hr,"⋓","\\Cup",!0);U(ae,We,hr,"⩞","\\doublebarwedge",!0);U(ae,We,hr,"⊟","\\boxminus",!0);U(ae,We,hr,"⊞","\\boxplus",!0);U(ae,We,hr,"⋇","\\divideontimes",!0);U(ae,We,hr,"⋉","\\ltimes",!0);U(ae,We,hr,"⋊","\\rtimes",!0);U(ae,We,hr,"⋋","\\leftthreetimes",!0);U(ae,We,hr,"⋌","\\rightthreetimes",!0);U(ae,We,hr,"⋏","\\curlywedge",!0);U(ae,We,hr,"⋎","\\curlyvee",!0);U(ae,We,hr,"⊝","\\circleddash",!0);U(ae,We,hr,"⊛","\\circledast",!0);U(ae,We,hr,"⋅","\\centerdot");U(ae,We,hr,"⊺","\\intercal",!0);U(ae,We,hr,"⋒","\\doublecap");U(ae,We,hr,"⋓","\\doublecup");U(ae,We,hr,"⊠","\\boxtimes",!0);U(ae,We,Xe,"⇢","\\dashrightarrow",!0);U(ae,We,Xe,"⇠","\\dashleftarrow",!0);U(ae,We,Xe,"⇇","\\leftleftarrows",!0);U(ae,We,Xe,"⇆","\\leftrightarrows",!0);U(ae,We,Xe,"⇚","\\Lleftarrow",!0);U(ae,We,Xe,"↞","\\twoheadleftarrow",!0);U(ae,We,Xe,"↢","\\leftarrowtail",!0);U(ae,We,Xe,"↫","\\looparrowleft",!0);U(ae,We,Xe,"⇋","\\leftrightharpoons",!0);U(ae,We,Xe,"↶","\\curvearrowleft",!0);U(ae,We,Xe,"↺","\\circlearrowleft",!0);U(ae,We,Xe,"↰","\\Lsh",!0);U(ae,We,Xe,"⇈","\\upuparrows",!0);U(ae,We,Xe,"↿","\\upharpoonleft",!0);U(ae,We,Xe,"⇃","\\downharpoonleft",!0);U(ae,be,Xe,"⊶","\\origof",!0);U(ae,be,Xe,"⊷","\\imageof",!0);U(ae,We,Xe,"⊸","\\multimap",!0);U(ae,We,Xe,"↭","\\leftrightsquigarrow",!0);U(ae,We,Xe,"⇉","\\rightrightarrows",!0);U(ae,We,Xe,"⇄","\\rightleftarrows",!0);U(ae,We,Xe,"↠","\\twoheadrightarrow",!0);U(ae,We,Xe,"↣","\\rightarrowtail",!0);U(ae,We,Xe,"↬","\\looparrowright",!0);U(ae,We,Xe,"↷","\\curvearrowright",!0);U(ae,We,Xe,"↻","\\circlearrowright",!0);U(ae,We,Xe,"↱","\\Rsh",!0);U(ae,We,Xe,"⇊","\\downdownarrows",!0);U(ae,We,Xe,"↾","\\upharpoonright",!0);U(ae,We,Xe,"⇂","\\downharpoonright",!0);U(ae,We,Xe,"⇝","\\rightsquigarrow",!0);U(ae,We,Xe,"⇝","\\leadsto");U(ae,We,Xe,"⇛","\\Rrightarrow",!0);U(ae,We,Xe,"↾","\\restriction");U(ae,be,et,"‘","`");U(ae,be,et,"$","\\$");U(Ot,be,et,"$","\\$");U(Ot,be,et,"$","\\textdollar");U(ae,be,et,"%","\\%");U(Ot,be,et,"%","\\%");U(ae,be,et,"_","\\_");U(Ot,be,et,"_","\\_");U(Ot,be,et,"_","\\textunderscore");U(ae,be,et,"∠","\\angle",!0);U(ae,be,et,"∞","\\infty",!0);U(ae,be,et,"′","\\prime");U(ae,be,et,"△","\\triangle");U(ae,be,et,"Γ","\\Gamma",!0);U(ae,be,et,"Δ","\\Delta",!0);U(ae,be,et,"Θ","\\Theta",!0);U(ae,be,et,"Λ","\\Lambda",!0);U(ae,be,et,"Ξ","\\Xi",!0);U(ae,be,et,"Π","\\Pi",!0);U(ae,be,et,"Σ","\\Sigma",!0);U(ae,be,et,"Υ","\\Upsilon",!0);U(ae,be,et,"Φ","\\Phi",!0);U(ae,be,et,"Ψ","\\Psi",!0);U(ae,be,et,"Ω","\\Omega",!0);U(ae,be,et,"A","Α");U(ae,be,et,"B","Β");U(ae,be,et,"E","Ε");U(ae,be,et,"Z","Ζ");U(ae,be,et,"H","Η");U(ae,be,et,"I","Ι");U(ae,be,et,"K","Κ");U(ae,be,et,"M","Μ");U(ae,be,et,"N","Ν");U(ae,be,et,"O","Ο");U(ae,be,et,"P","Ρ");U(ae,be,et,"T","Τ");U(ae,be,et,"X","Χ");U(ae,be,et,"¬","\\neg",!0);U(ae,be,et,"¬","\\lnot");U(ae,be,et,"⊤","\\top");U(ae,be,et,"⊥","\\bot");U(ae,be,et,"∅","\\emptyset");U(ae,We,et,"∅","\\varnothing");U(ae,be,Hr,"α","\\alpha",!0);U(ae,be,Hr,"β","\\beta",!0);U(ae,be,Hr,"γ","\\gamma",!0);U(ae,be,Hr,"δ","\\delta",!0);U(ae,be,Hr,"ϵ","\\epsilon",!0);U(ae,be,Hr,"ζ","\\zeta",!0);U(ae,be,Hr,"η","\\eta",!0);U(ae,be,Hr,"θ","\\theta",!0);U(ae,be,Hr,"ι","\\iota",!0);U(ae,be,Hr,"κ","\\kappa",!0);U(ae,be,Hr,"λ","\\lambda",!0);U(ae,be,Hr,"μ","\\mu",!0);U(ae,be,Hr,"ν","\\nu",!0);U(ae,be,Hr,"ξ","\\xi",!0);U(ae,be,Hr,"ο","\\omicron",!0);U(ae,be,Hr,"π","\\pi",!0);U(ae,be,Hr,"ρ","\\rho",!0);U(ae,be,Hr,"σ","\\sigma",!0);U(ae,be,Hr,"τ","\\tau",!0);U(ae,be,Hr,"υ","\\upsilon",!0);U(ae,be,Hr,"ϕ","\\phi",!0);U(ae,be,Hr,"χ","\\chi",!0);U(ae,be,Hr,"ψ","\\psi",!0);U(ae,be,Hr,"ω","\\omega",!0);U(ae,be,Hr,"ε","\\varepsilon",!0);U(ae,be,Hr,"ϑ","\\vartheta",!0);U(ae,be,Hr,"ϖ","\\varpi",!0);U(ae,be,Hr,"ϱ","\\varrho",!0);U(ae,be,Hr,"ς","\\varsigma",!0);U(ae,be,Hr,"φ","\\varphi",!0);U(ae,be,hr,"∗","*",!0);U(ae,be,hr,"+","+");U(ae,be,hr,"−","-",!0);U(ae,be,hr,"⋅","\\cdot",!0);U(ae,be,hr,"∘","\\circ",!0);U(ae,be,hr,"÷","\\div",!0);U(ae,be,hr,"±","\\pm",!0);U(ae,be,hr,"×","\\times",!0);U(ae,be,hr,"∩","\\cap",!0);U(ae,be,hr,"∪","\\cup",!0);U(ae,be,hr,"∖","\\setminus",!0);U(ae,be,hr,"∧","\\land");U(ae,be,hr,"∨","\\lor");U(ae,be,hr,"∧","\\wedge",!0);U(ae,be,hr,"∨","\\vee",!0);U(ae,be,et,"√","\\surd");U(ae,be,lu,"⟨","\\langle",!0);U(ae,be,lu,"∣","\\lvert");U(ae,be,lu,"∥","\\lVert");U(ae,be,Ql,"?","?");U(ae,be,Ql,"!","!");U(ae,be,Ql,"⟩","\\rangle",!0);U(ae,be,Ql,"∣","\\rvert");U(ae,be,Ql,"∥","\\rVert");U(ae,be,Xe,"=","=");U(ae,be,Xe,":",":");U(ae,be,Xe,"≈","\\approx",!0);U(ae,be,Xe,"≅","\\cong",!0);U(ae,be,Xe,"≥","\\ge");U(ae,be,Xe,"≥","\\geq",!0);U(ae,be,Xe,"←","\\gets");U(ae,be,Xe,">","\\gt",!0);U(ae,be,Xe,"∈","\\in",!0);U(ae,be,Xe,"","\\@not");U(ae,be,Xe,"⊂","\\subset",!0);U(ae,be,Xe,"⊃","\\supset",!0);U(ae,be,Xe,"⊆","\\subseteq",!0);U(ae,be,Xe,"⊇","\\supseteq",!0);U(ae,We,Xe,"⊈","\\nsubseteq",!0);U(ae,We,Xe,"⊉","\\nsupseteq",!0);U(ae,be,Xe,"⊨","\\models");U(ae,be,Xe,"←","\\leftarrow",!0);U(ae,be,Xe,"≤","\\le");U(ae,be,Xe,"≤","\\leq",!0);U(ae,be,Xe,"<","\\lt",!0);U(ae,be,Xe,"→","\\rightarrow",!0);U(ae,be,Xe,"→","\\to");U(ae,We,Xe,"≱","\\ngeq",!0);U(ae,We,Xe,"≰","\\nleq",!0);U(ae,be,up," ","\\ ");U(ae,be,up," ","\\space");U(ae,be,up," ","\\nobreakspace");U(Ot,be,up," ","\\ ");U(Ot,be,up," "," ");U(Ot,be,up," ","\\space");U(Ot,be,up," ","\\nobreakspace");U(ae,be,up,"","\\nobreak");U(ae,be,up,"","\\allowbreak");U(ae,be,f7,",",",");U(ae,be,f7,";",";");U(ae,We,hr,"⊼","\\barwedge",!0);U(ae,We,hr,"⊻","\\veebar",!0);U(ae,be,hr,"⊙","\\odot",!0);U(ae,be,hr,"⊕","\\oplus",!0);U(ae,be,hr,"⊗","\\otimes",!0);U(ae,be,et,"∂","\\partial",!0);U(ae,be,hr,"⊘","\\oslash",!0);U(ae,We,hr,"⊚","\\circledcirc",!0);U(ae,We,hr,"⊡","\\boxdot",!0);U(ae,be,hr,"△","\\bigtriangleup");U(ae,be,hr,"▽","\\bigtriangledown");U(ae,be,hr,"†","\\dagger");U(ae,be,hr,"⋄","\\diamond");U(ae,be,hr,"⋆","\\star");U(ae,be,hr,"◃","\\triangleleft");U(ae,be,hr,"▹","\\triangleright");U(ae,be,lu,"{","\\{");U(Ot,be,et,"{","\\{");U(Ot,be,et,"{","\\textbraceleft");U(ae,be,Ql,"}","\\}");U(Ot,be,et,"}","\\}");U(Ot,be,et,"}","\\textbraceright");U(ae,be,lu,"{","\\lbrace");U(ae,be,Ql,"}","\\rbrace");U(ae,be,lu,"[","\\lbrack",!0);U(Ot,be,et,"[","\\lbrack",!0);U(ae,be,Ql,"]","\\rbrack",!0);U(Ot,be,et,"]","\\rbrack",!0);U(ae,be,lu,"(","\\lparen",!0);U(ae,be,Ql,")","\\rparen",!0);U(Ot,be,et,"<","\\textless",!0);U(Ot,be,et,">","\\textgreater",!0);U(ae,be,lu,"⌊","\\lfloor",!0);U(ae,be,Ql,"⌋","\\rfloor",!0);U(ae,be,lu,"⌈","\\lceil",!0);U(ae,be,Ql,"⌉","\\rceil",!0);U(ae,be,et,"\\","\\backslash");U(ae,be,et,"∣","|");U(ae,be,et,"∣","\\vert");U(Ot,be,et,"|","\\textbar",!0);U(ae,be,et,"∥","\\|");U(ae,be,et,"∥","\\Vert");U(Ot,be,et,"∥","\\textbardbl");U(Ot,be,et,"~","\\textasciitilde");U(Ot,be,et,"\\","\\textbackslash");U(Ot,be,et,"^","\\textasciicircum");U(ae,be,Xe,"↑","\\uparrow",!0);U(ae,be,Xe,"⇑","\\Uparrow",!0);U(ae,be,Xe,"↓","\\downarrow",!0);U(ae,be,Xe,"⇓","\\Downarrow",!0);U(ae,be,Xe,"↕","\\updownarrow",!0);U(ae,be,Xe,"⇕","\\Updownarrow",!0);U(ae,be,ba,"∐","\\coprod");U(ae,be,ba,"⋁","\\bigvee");U(ae,be,ba,"⋀","\\bigwedge");U(ae,be,ba,"⨄","\\biguplus");U(ae,be,ba,"⋂","\\bigcap");U(ae,be,ba,"⋃","\\bigcup");U(ae,be,ba,"∫","\\int");U(ae,be,ba,"∫","\\intop");U(ae,be,ba,"∬","\\iint");U(ae,be,ba,"∭","\\iiint");U(ae,be,ba,"∏","\\prod");U(ae,be,ba,"∑","\\sum");U(ae,be,ba,"⨂","\\bigotimes");U(ae,be,ba,"⨁","\\bigoplus");U(ae,be,ba,"⨀","\\bigodot");U(ae,be,ba,"∮","\\oint");U(ae,be,ba,"∯","\\oiint");U(ae,be,ba,"∰","\\oiiint");U(ae,be,ba,"⨆","\\bigsqcup");U(ae,be,ba,"∫","\\smallint");U(Ot,be,sC,"…","\\textellipsis");U(ae,be,sC,"…","\\mathellipsis");U(Ot,be,sC,"…","\\ldots",!0);U(ae,be,sC,"…","\\ldots",!0);U(ae,be,sC,"⋯","\\@cdots",!0);U(ae,be,sC,"⋱","\\ddots",!0);U(ae,be,et,"⋮","\\varvdots");U(Ot,be,et,"⋮","\\varvdots");U(ae,be,ms,"ˊ","\\acute");U(ae,be,ms,"ˋ","\\grave");U(ae,be,ms,"¨","\\ddot");U(ae,be,ms,"~","\\tilde");U(ae,be,ms,"ˉ","\\bar");U(ae,be,ms,"˘","\\breve");U(ae,be,ms,"ˇ","\\check");U(ae,be,ms,"^","\\hat");U(ae,be,ms,"⃗","\\vec");U(ae,be,ms,"˙","\\dot");U(ae,be,ms,"˚","\\mathring");U(ae,be,Hr,"","\\@imath");U(ae,be,Hr,"","\\@jmath");U(ae,be,et,"ı","ı");U(ae,be,et,"ȷ","ȷ");U(Ot,be,et,"ı","\\i",!0);U(Ot,be,et,"ȷ","\\j",!0);U(Ot,be,et,"ß","\\ss",!0);U(Ot,be,et,"æ","\\ae",!0);U(Ot,be,et,"œ","\\oe",!0);U(Ot,be,et,"ø","\\o",!0);U(Ot,be,et,"Æ","\\AE",!0);U(Ot,be,et,"Œ","\\OE",!0);U(Ot,be,et,"Ø","\\O",!0);U(Ot,be,ms,"ˊ","\\'");U(Ot,be,ms,"ˋ","\\`");U(Ot,be,ms,"ˆ","\\^");U(Ot,be,ms,"˜","\\~");U(Ot,be,ms,"ˉ","\\=");U(Ot,be,ms,"˘","\\u");U(Ot,be,ms,"˙","\\.");U(Ot,be,ms,"¸","\\c");U(Ot,be,ms,"˚","\\r");U(Ot,be,ms,"ˇ","\\v");U(Ot,be,ms,"¨",'\\"');U(Ot,be,ms,"˝","\\H");U(Ot,be,ms,"◯","\\textcircled");var E_e={"--":!0,"---":!0,"``":!0,"''":!0};U(Ot,be,et,"–","--",!0);U(Ot,be,et,"–","\\textendash");U(Ot,be,et,"—","---",!0);U(Ot,be,et,"—","\\textemdash");U(Ot,be,et,"‘","`",!0);U(Ot,be,et,"‘","\\textquoteleft");U(Ot,be,et,"’","'",!0);U(Ot,be,et,"’","\\textquoteright");U(Ot,be,et,"“","``",!0);U(Ot,be,et,"“","\\textquotedblleft");U(Ot,be,et,"”","''",!0);U(Ot,be,et,"”","\\textquotedblright");U(ae,be,et,"°","\\degree",!0);U(Ot,be,et,"°","\\degree");U(Ot,be,et,"°","\\textdegree",!0);U(ae,be,et,"£","\\pounds");U(ae,be,et,"£","\\mathsterling",!0);U(Ot,be,et,"£","\\pounds");U(Ot,be,et,"£","\\textsterling",!0);U(ae,We,et,"✠","\\maltese");U(Ot,We,et,"✠","\\maltese");var ipe='0123456789/@."';for(var Cz=0;Cz{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 ppe[i]}else if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return dqt[s]}else{if(n===120485||n===120486)return ppe[0];if(120486{if(Zg(t.classes)!==Zg(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},A_e=t=>{for(var e=0;er&&(r=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>i&&(i=a.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Vt=function(e,r,n,i){var s=new iC(e,r,n,i);return gte(s),s},Jg=(t,e,r,n)=>new iC(t,e,r,n),n3=function(e,r,n){var i=Vt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Kt(i.height),i.maxFontSize=1,i},mqt=function(e,r,n,i){var s=new lP(e,r,n,i);return gte(s),s},hp=function(e){var r=new nC(e);return gte(r),r},i3=function(e,r){return e instanceof nC?Vt([],[e],r):e},yqt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,s=i,a=1;a{var r=Vt(["mspace"],[],e),n=Cs(t,e);return r.style.marginRight=Kt(n),r},wM=(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},GU={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"}},R_e={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},__e=function(e,r){var[n,i,s]=R_e[e],a=new Qg(n),o=new $0([a],{width:Kt(i),height:Kt(s),style:"width:"+Kt(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Jg(["overlay"],[o],r);return l.height=s,l.style.height=Kt(s),l.style.width=Kt(i),l},xs={number:3,unit:"mu"},r1={number:4,unit:"mu"},Lf={number:5,unit:"mu"},vqt={mord:{mop:xs,mbin:r1,mrel:Lf,minner:xs},mop:{mord:xs,mop:xs,mrel:Lf,minner:xs},mbin:{mord:r1,mop:r1,mopen:r1,minner:r1},mrel:{mord:Lf,mop:Lf,mopen:Lf,minner:Lf},mopen:{},mclose:{mop:xs,mbin:r1,mrel:Lf,minner:xs},mpunct:{mord:xs,mop:xs,mrel:Lf,mopen:xs,mclose:xs,mpunct:xs,minner:xs},minner:{mord:xs,mop:xs,mbin:r1,mrel:Lf,mopen:xs,mpunct:xs,minner:xs}},bqt={mord:{mop:xs},mop:{mord:xs,mop:xs},mbin:{},mrel:{},mopen:{},mclose:{mop:xs},mpunct:{},minner:{mop:xs}},L_e={},II={},NI={};function ir(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=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"&&wqt.has(v)?m.classes[0]="mord":v==="mbin"&&xqt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),WU(s,(g,m)=>{var y,v,b=UU(m),x=UU(g),T=b&&x?g.hasClass("mtight")?(y=bqt[b])==null?void 0:y[x]:(v=vqt[b])==null?void 0:v[x]:null;if(T)return M_e(T,u)},{node:d},f,p),s},WU=function(e,r,n,i,s){i&&e.push(i);for(var a=0;af=>{e.splice(d+1,0,f),a++})(a)}i&&e.pop()},I_e=function(e){return e instanceof nC||e instanceof lP||e instanceof iC&&e.hasClass("enclosing")?e:null},qU=function(e,r){var n=I_e(e);if(n){var i=n.children;if(i.length){if(r==="right")return qU(i[i.length-1],"right");if(r==="left")return qU(i[0],"left")}}return e},UU=function(e,r){if(!e)return null;r&&(e=qU(e,r));var n=e.classes[0];return Cqt[n]||null},B6=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Vt(r.concat(n))},mi=function(e,r,n){if(!e)return Vt();if(II[e.type]){var i=II[e.type](e,r);if(n&&r.size!==n.size){i=Vt(r.sizingClasses(n),[i],r);var s=r.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new Wt("Got group of unknown type: '"+e.type+"'")};function TM(t,e){var r=Vt(["base"],t,e),n=Vt(["strut"]);return n.style.height=Kt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Kt(-r.depth)),r.children.unshift(n),r}function jU(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=Fa(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],a=[],o=0;o0&&(s.push(TM(a,e)),a=[]),s.push(n[o]));a.length>0&&s.push(TM(a,e));var u;r?(u=TM(Fa(r,e,!0),e),u.classes=["tag"],s.push(u)):i&&s.push(i);var h=Vt(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Kt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Kt(-h.depth))}return h}function N_e(t){return new nC(t)}class jt{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=Zg(this.classes));for(var n=0;n0&&(e+=' class ="'+Jo(Zg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ga{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Jo(this.toText())}toText(){return this.text}}class O_e{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",Kt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var kqt=new Set(["\\imath","\\jmath"]),Sqt=new Set(["mrow","mtable"]),qu=function(e,r,n){return ds[r][e]&&ds[r][e].replace&&e.charCodeAt(0)!==55349&&!(E_e.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ds[r][e].replace),new ga(e)},mte=function(e){return e.length===1?e[0]:new jt("mrow",e)},Eqt={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"},yte=(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=Eqt[r];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(kqt.has(s))return null;if(ds[n][s]){var a=ds[n][s].replace;a&&(s=a)}var o=GU[r].fontName;return fte(s,o,n)?GU[r].variant:null};function Az(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof ga&&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 ga&&r.text===","}else return!1}var cu=function(e,r,n){if(e.length===1){var i=Ii(e[0],r);return n&&i instanceof jt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],a,o=0;o=1&&(a.type==="mn"||Az(a))){var u=l.children[0];u instanceof jt&&u.type==="mn"&&(u.children=[...a.children,...u.children],s.pop())}else if(a.type==="mi"&&a.children.length===1){var h=a.children[0];if(h instanceof ga&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof ga&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),a=l}return s},em=function(e,r,n){return mte(cu(e,r,n))},Ii=function(e,r){if(!e)return new jt("mrow");if(NI[e.type])return NI[e.type](e,r);throw new Wt("Got group of unknown type: '"+e.type+"'")};function gpe(t,e,r,n,i){var s=cu(t,r),a;s.length===1&&s[0]instanceof jt&&Sqt.has(s[0].type)?a=s[0]:a=new jt("mrow",s);var o=new jt("annotation",[new ga(e)]);o.setAttribute("encoding","application/x-tex");var l=new jt("semantics",[a,o]),u=new jt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return Vt([h],[u])}var Aqt=[[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]],mpe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],ype=function(e,r){return r.size<2?e:Aqt[e-1][r.size-1]};class jf{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||jf.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=mpe[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 jf(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:ype(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:mpe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=ype(jf.BASESIZE,e);return this.size===r&&this.textSize===jf.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!==jf.BASESIZE?["sizing","reset-size"+this.size,"size"+jf.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=uqt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}jf.BASESIZE=6;var D_e=function(e){return new jf({style:e.displayMode?dn.DISPLAY:dn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},P_e=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Vt(n,[e])}return e},Mqt=function(e,r,n){var i=D_e(n),s;if(n.output==="mathml")return gpe(e,r,i,n.displayMode,!0);if(n.output==="html"){var a=jU(e,i);s=Vt(["katex"],[a])}else{var o=gpe(e,r,i,n.displayMode,!1),l=jU(e,i);s=Vt(["katex"],[o,l])}return P_e(s,n)},Rqt=function(e,r,n){var i=D_e(n),s=jU(e,i),a=Vt(["katex"],[s]);return P_e(a,n)},_qt={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":"="},hP=function(e){var r=new jt("mo",[new ga(_qt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Lqt={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]},Iqt=new Set(["widehat","widecheck","widetilde","utilde"]),dP=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Iqt.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 Qg(d),m=new $0([g],{width:"100%",height:Kt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:Jg([],[m],r),minWidth:0,height:f}}else{var y=[],v=Lqt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[b,x,T]=v,C=T/1e3,S=b.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+S+" children.");for(var A=0;A0&&(i.style.minWidth=Kt(s)),i},Nqt=function(e,r,n,i,s){var a,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(a=Vt(["stretchy",r],[],s),r==="fbox"){var l=s.color&&s.getColor();l&&(a.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new $U({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new $U({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new $0(u,{width:"100%",height:Kt(o)});a=Jg([],[h],s)}return a.height=o,a.style.height=Kt(o),a},Oqt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Dqt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Pqt(t){return t in Oqt}function xn(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 fP(t){var e=pP(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 pP(t){return t&&(t.type==="atom"||Dqt.hasOwnProperty(t.type))?t:null}var $_e=t=>{if(t instanceof ru)return t;if(cqt(t)&&t.children.length===1)return $_e(t.children[0])},vte=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=xn(t.base,"accent"),r=n.base,t.base=r,i=lqt(mi(t,e)),t.base=n):(n=xn(t,"accent"),r=n.base);var s=mi(r,e.havingCrampedStyle()),a=n.isShifty&&cp(r),o=0;if(a){var l,u;o=(l=(u=$_e(s))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=dP(n,e),f=pi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Kt(2*o)+")",marginLeft:Kt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=__e("vec",e),g=R_e.vec[1]):(p=uP({mode:n.mode,text:n.label},e,"textord"),p=oqt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Vt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var y=o;m||(y-=g/2),f.style.left=Kt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=pi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=Vt(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},B_e=(t,e)=>{var r=t.isStretchy?hP(t.label):new jt("mo",[qu(t.label,t.mode)]),n=new jt("mover",[Ii(t.base,e),r]);return n.setAttribute("accent","true"),n},$qt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ir({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=OI(e[0]),n=!$qt.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:vte,mathmlBuilder:B_e});ir({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:vte,mathmlBuilder:B_e});ir({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=mi(t.base,e),n=dP(t,e),i=t.label==="\\utilde"?.12:0,s=pi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Vt(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var r=hP(t.label),n=new jt("munder",[Ii(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var CM=t=>{var e=new jt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ir({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=i3(mi(t.body,n,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var a;t.below&&(n=e.havingStyle(r.sub()),a=i3(mi(t.below,n,e),e),a.classes.push(s+"-arrow-pad"));var o=dP(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(a){var d=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;h=pi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:d}]})}else h=pi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return Vt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=hP(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=CM(Ii(t.body,e));if(t.below){var s=CM(Ii(t.below,e));n=new jt("munderover",[r,s,i])}else n=new jt("mover",[r,i])}else if(t.below){var a=CM(Ii(t.below,e));n=new jt("munder",[r,a])}else n=CM(),n=new jt("mover",[r,n]);return n}});function F_e(t,e){var r=Fa(t.body,e,!0);return Vt([t.mclass],r,e)}function z_e(t,e){var r,n=cu(t.body,e);return t.mclass==="minner"?r=new jt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new jt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new jt("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}ir({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:pa(i),isCharacterBox:cp(i)}},htmlBuilder:F_e,mathmlBuilder:z_e});var gP=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"};ir({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:gP(e[0]),body:pa(e[1]),isCharacterBox:cp(e[1])}}});ir({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],s=e[0],a;n!=="\\stackrel"?a=gP(i):a="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:pa(i)},l={type:"supsub",mode:s.mode,base:o,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:r.mode,mclass:a,body:[l],isCharacterBox:cp(l)}},htmlBuilder:F_e,mathmlBuilder:z_e});ir({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:gP(e[0]),body:pa(e[0])}},htmlBuilder(t,e){var r=Fa(t.body,e,!0),n=Vt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=cu(t.body,e),n=new jt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Bqt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},vpe=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),bpe=t=>t.type==="textord"&&t.text==="@",Fqt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function zqt(t,e,r){var n=Bqt[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]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},a=r.callFunction("\\Big",[s],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,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 Vqt(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 Wt("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],s=0;sAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',a[l]);var g=zqt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=vpe()}s%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([])}}ir({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=i3(mi(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Kt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new jt("mrow",[Ii(t.label,e)]);return r=new jt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new jt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});ir({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=i3(mi(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new jt("mrow",[Ii(t.fragment,e)])}});ir({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=xn(e[0],"ordgroup"),i=n.body,s="",a=0;a=1114111)throw new Wt("\\@char with invalid code point "+s);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 V_e=(t,e)=>{var r=Fa(t.body,e.withColor(t.color),!1);return hp(r)},H_e=(t,e)=>{var r=cu(t.body,e.withColor(t.color)),n=new jt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};ir({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=xn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:pa(i)}},htmlBuilder:V_e,mathmlBuilder:H_e});ir({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=xn(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:s}},htmlBuilder:V_e,mathmlBuilder:H_e});ir({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,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&xn(i,"size").value}},htmlBuilder(t,e){var r=Vt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Kt(Cs(t.size,e)))),r},mathmlBuilder(t,e){var r=new jt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Kt(Cs(t.size,e)))),r}});var YU={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},G_e=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Wt("Expected a control sequence",t);return e},Hqt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},W_e=(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)};ir({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(YU[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=YU[n.text]),xn(e.parseFunction(),"internal");throw new Wt("Invalid token after macro prefix",n)}});ir({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 Wt("Expected a control sequence",n);for(var s=0,a,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new Wt('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new Wt('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if(n.text==="EOF")throw new Wt("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===YU[r]),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=G_e(e.gullet.popToken());e.gullet.consumeSpaces();var i=Hqt(e);return W_e(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});ir({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=G_e(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return W_e(e,n,s,r==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Zk=function(e,r,n){var i=ds.math[e]&&ds.math[e].replace,s=fte(i||e,r,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return s},bte=function(e,r,n,i){var s=n.havingBaseStyle(r),a=Vt(i.concat(s.sizingClasses(n)),[e],n),o=s.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=s.sizeMultiplier,a},q_e=function(e,r,n){var i=r.havingBaseStyle(n),s=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Kt(s),e.height-=s,e.depth+=s},Gqt=function(e,r,n,i,s,a){var o=Cl(e,"Main-Regular",s,i),l=bte(o,r,i,a);return q_e(l,i,r),l},Wqt=function(e,r,n,i){return Cl(e,"Size"+r+"-Regular",n,i)},U_e=function(e,r,n,i,s,a){var o=Wqt(e,r,s,i),l=bte(Vt(["delimsizing","size"+r],[o],i),dn.TEXT,i,a);return n&&q_e(l,i,dn.TEXT),l},Mz=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=Vt(["delimsizinginner",i],[Vt([],[Cl(e,r,n)])]);return{type:"elem",elem:s}},Rz=function(e,r,n){var i=Ld["Size4-Regular"][e.charCodeAt(0)]?Ld["Size4-Regular"][e.charCodeAt(0)][4]:Ld["Size1-Regular"][e.charCodeAt(0)][4],s=new Qg("inner",eqt(e,Math.round(1e3*r))),a=new $0([s],{width:Kt(i),height:Kt(r),style:"width:"+Kt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=Jg([],[a],n);return o.height=r,o.style.height=Kt(r),o.style.width=Kt(i),{type:"elem",elem:o}},XU=.008,kM={type:"kern",size:-1*XU},qqt=new Set(["|","\\lvert","\\rvert","\\vert"]),Uqt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),j_e=function(e,r,n,i,s,a){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"):qqt.has(e)?(u="∣",d="vert",f=333):Uqt.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=Zk(o,p,s),m=g.height+g.depth,y=Zk(u,p,s),v=y.height+y.depth,b=Zk(h,p,s),x=b.height+b.depth,T=0,C=1;if(l!==null){var S=Zk(l,p,s);T=S.height+S.depth,C=2}var k=m+x+T,E=Math.max(0,Math.ceil((r-k)/(C*v))),A=k+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var R=A/2-M,P=[];if(d.length>0){var N=A-m-x,L=Math.round(A*1e3),I=tqt(d,Math.round(N*1e3)),$=new Qg(d,I),O=Kt(f/1e3),D=Kt(L/1e3),B=new $0([$],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),z=Jg([],[B],i);z.height=L/1e3,z.style.width=O,z.style.height=D,P.push({type:"elem",elem:z})}else{if(P.push(Mz(h,p,s)),P.push(kM),l===null){var V=A-m-x+2*XU;P.push(Rz(u,V,i))}else{var F=(A-m-x-T)/2+2*XU;P.push(Rz(u,F,i)),P.push(kM),P.push(Mz(l,p,s)),P.push(kM),P.push(Rz(u,F,i))}P.push(kM),P.push(Mz(o,p,s))}var H=i.havingBaseStyle(dn.TEXT),G=pi({positionType:"bottom",positionData:R,children:P});return bte(Vt(["delimsizing","mult"],[G],H),dn.TEXT,i,a)},_z=80,Lz=.08,Iz=function(e,r,n,i,s){var a=JWt(e,i,n),o=new Qg(e,a),l=new $0([o],{width:"400em",height:Kt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Jg(["hide-tail"],[l],s)},jqt=function(e,r){var n=r.havingBaseSizing(),i=Q_e("\\surd",e*n.sizeMultiplier,Z_e,n),s=n.sizeMultiplier,a=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*a+_z,e<1?s=1:e<1.4&&(s=.7),l=(1+a+Lz)/s,u=(1+a)/s,o=Iz("sqrtMain",l,h,a,r),o.style.minWidth="0.853em",d=.833/s):i.type==="large"?(h=(1e3+_z)*eE[i.size],u=(eE[i.size]+a)/s,l=(eE[i.size]+a+Lz)/s,o=Iz("sqrtSize"+i.size,l,h,a,r),o.style.minWidth="1.02em",d=1/s):(l=e+a+Lz,u=e+a,h=Math.floor(1e3*e+a)+_z,o=Iz("sqrtTall",l,h,a,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Kt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+a)*s}},Y_e=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Yqt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),X_e=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),eE=[0,1.2,1.8,2.4,3],K_e=function(e,r,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Y_e.has(e)||X_e.has(e))return U_e(e,r,!1,n,i,s);if(Yqt.has(e))return j_e(e,eE[r],!1,n,i,s);throw new Wt("Illegal delimiter: '"+e+"'")},Xqt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Kqt=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"stack"}],Z_e=[{type:"small",style:dn.SCRIPTSCRIPT},{type:"small",style:dn.SCRIPT},{type:"small",style:dn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Zqt=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.")},Q_e=function(e,r,n,i){for(var s=Math.min(2,3-i.style.size),a=s;ar)return o}return n[n.length-1]},KU=function(e,r,n,i,s,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;X_e.has(e)?o=Xqt:Y_e.has(e)?o=Z_e:o=Kqt;var l=Q_e(e,r,o,i);return l.type==="small"?Gqt(e,l.style,n,i,s,a):l.type==="large"?U_e(e,l.size,n,i,s,a):j_e(e,r,n,i,s,a)},Nz=function(e,r,n,i,s,a){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 KU(e,d,!0,i,s,a)},xpe={"\\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}},Qqt=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 wpe(t){return"isMiddle"in t}function mP(t,e){var r=pP(t);if(r&&Qqt.has(r.text))return r;throw r?new Wt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Wt("Invalid delimiter type '"+t.type+"'",t)}ir({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=mP(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:xpe[t.funcName].size,mclass:xpe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Vt([t.mclass]):K_e(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(qu(t.delim,t.mode));var r=new jt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Kt(eE[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function Tpe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ir({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 Wt("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:mP(e[0],t).text,color:r}}});ir({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=mP(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=xn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{Tpe(t);for(var r=Fa(t.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,a=0;a{Tpe(t);var r=cu(t.body,e);if(t.left!=="."){var n=new jt("mo",[qu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new jt("mo",[qu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return mte(r)}});ir({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=mP(e[0],t);if(!t.parser.leftrightDepth)throw new Wt("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=B6(e,[]):(r=K_e(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?qu("|","text"):qu(t.delim,t.mode),n=new jt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var yP=(t,e)=>{var r=i3(mi(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,s,a,o=cp(t.body);if(n==="sout")s=Vt(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,a=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Cs({number:.6,unit:"pt"},e),u=Cs({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Kt(d/2+l);var f=Math.floor(1e3*d*i),p=ZWt(f),g=new $0([new Qg("phase",p)],{width:"400em",height:Kt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=Jg(["hide-tail"],[g],e),s.style.height=Kt(d),a=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),s=Nqt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=Kt(v)):n==="angl"&&v!==.049&&(s.style.borderTopWidth=Kt(v),s.style.borderRightWidth=Kt(v)),a=r.depth+y,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=pi({positionType:"individualShift",children:[{type:"elem",elem:s,shift:a},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=pi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:s,shift:a,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?Vt(["mord","cancel-lap"],[b],e):Vt(["mord"],[b],e)},vP=(t,e)=>{var r,n=new jt(t.label.includes("colorbox")?"mpadded":"menclose",[Ii(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: "+Kt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};ir({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=xn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:a}},htmlBuilder:yP,mathmlBuilder:vP});ir({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,s=xn(e[0],"color-token").color,a=xn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,borderColor:s,body:o}},htmlBuilder:yP,mathmlBuilder:vP});ir({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]}}});ir({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:yP,mathmlBuilder:vP});ir({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:yP,mathmlBuilder:vP});ir({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 J_e={};function df(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:s,mathmlBuilder:a}=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 Wt("{"+t.envName+"} can be used only in display mode.")},Jqt=new Set(["gather","gather*"]);function xte(t){if(!t.includes("ed"))return!t.includes("*")}function Em(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:a,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)a=1;else if(a=parseFloat(p),!a||a<0)throw new Wt("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],b=l!=null?[]:void 0;function x(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Zc("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),v.push(Cpe(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new Wt("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){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&&(x+=.25),u.push({pos:x,isDashed:Ce[re]})}for(T(a[0]),n=0;n0&&(R+=b,kCe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var Q,ne;Z=(Q=(ne=H)==null?void 0:ne.pregap)!=null?Q:f,Z!==0&&(I=Vt(["arraycolsep"],[]),I.style.width=Kt(Z),L.push(I))}var ie=[];for(n=0;n0){for(var ge=n3("hline",r,h),ze=n3("hdashline",r,h),we=[{type:"elem",elem:Te,shift:0}];u.length>0;){var Ae=u.pop(),qe=Ae.pos-P;Ae.isDashed?we.push({type:"elem",elem:ze,shift:qe}):we.push({type:"elem",elem:ge,shift:qe})}Te=pi({positionType:"individualShift",children:we})}if(O.length===0)return Vt(["mord"],[Te],r);var le=pi({positionType:"individualShift",children:O}),pe=Vt(["tag"],[le],r);return hp([Te,pe])},eUt={c:"center ",l:"left ",r:"right "},pf=function(e,r){for(var n=[],i=new jt("mtd",[],["mtr-glue"]),s=new jt("mtd",[],["mml-eqn-num"]),a=0;a0){var g=e.cols,m="",y=!1,v=0,b=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var x=v;x0?"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 a.colSeparationType=p?"align":"alignat",a};df({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=pP(e[0]),n=r?[e[0]]:xn(e[0],"ordgroup").body,i=n.map(function(a){var o=fP(a),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 Wt("Unknown column alignment: "+l,a)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Em(t.parser,s,wte(t.envName))},htmlBuilder:ff,mathmlBuilder:pf});df({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 Wt("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var s=Em(t.parser,n,wte(t.envName)),a=Math.max(0,...s.body.map(o=>o.length));return s.cols=new Array(a).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Em(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=pP(e[0]),n=r?[e[0]]:xn(e[0],"ordgroup").body,i=n.map(function(o){var l=fP(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Wt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Wt("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},a=Em(t.parser,s,"script");if(a.body.length>0&&a.body[0].length>1)throw new Wt("{subarray} can contain only one column");return a},htmlBuilder:ff,mathmlBuilder:pf});df({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=Em(t.parser,e,wte(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:tLe,htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Jqt.has(t.envName)&&bP(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:xte(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Em(t.parser,e,"display")},htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:tLe,htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){bP(t);var e={autoTag:xte(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Em(t.parser,e,"display")},htmlBuilder:ff,mathmlBuilder:pf});df({type:"array",names:["CD"],props:{numArgs:0},handler(t){return bP(t),Vqt(t.parser)},htmlBuilder:ff,mathmlBuilder:pf});ke("\\nonumber","\\gdef\\@eqnsw{0}");ke("\\notag","\\nonumber");ir({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new Wt(t.funcName+" valid only within array environment")}});var kpe=J_e;ir({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 Wt("Invalid environment name",i);for(var s="",a=0;a{var r=t.font,n=e.withFont(r);return mi(t.body,n)},nLe=(t,e)=>{var r=t.font,n=e.withFont(r);return Ii(t.body,n)},Spe={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ir({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=OI(e[0]),s=n;return s in Spe&&(s=Spe[s]),{type:"font",mode:r.mode,font:s.slice(1),body:i}},htmlBuilder:rLe,mathmlBuilder:nLe});ir({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:gP(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:cp(n)}}});ir({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:s}=r,a=r.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:a}}},htmlBuilder:rLe,mathmlBuilder:nLe});var tUt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),s;s=e.havingStyle(n);var a=mi(t.numer,s,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.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 b=e.fontMetrics().axisHeight;p-a.depth-(b+.5*d){var r=new jt("mfrac",[Ii(t.numer,e),Ii(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Cs(t.barSize,e);r.setAttribute("linethickness",Kt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var s=new jt("mo",[new ga(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(r),t.rightDelim!=null){var a=new jt("mo",[new ga(t.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}return mte(i)}return r},iLe=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};ir({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],s=e[1],a,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",l=")";break;case"\\\\bracefrac":a=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":a=!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"),iLe({type:"genfrac",mode:r.mode,numer:i,denom:s,continued:u,hasBarLine:a,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:tUt,mathmlBuilder:rUt});ir({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 Epe=["display","text","script","scriptscript"],Ape=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};ir({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],s=OI(e[0]),a=s.type==="atom"&&s.family==="open"?Ape(s.text):null,o=OI(e[1]),l=o.type==="atom"&&o.family==="close"?Ape(o.text):null,u=xn(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=xn(p.body[0],"textord");f=Epe[Number(g.text)]}}else p=xn(p,"textord"),f=Epe[Number(p.text)];return iLe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:a,rightDelim:l},f)}});ir({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:xn(e[0],"size").value,token:i}}});ir({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],s=xn(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var a=e[2],o=s.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:a,continued:!1,hasBarLine:o,barSize:s,leftDelim:null,rightDelim:null}}});var sLe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?mi(t.sup,e.havingStyle(r.sup()),e):mi(t.sub,e.havingStyle(r.sub()),e),i=xn(t.base,"horizBrace")):i=xn(t,"horizBrace");var s=mi(i.base,e.havingBaseStyle(dn.DISPLAY)),a=dP(i,e),o;if(i.isOver?o=pi({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=pi({positionType:"bottom",positionData:s.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){var l=Vt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=pi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=pi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Vt(["minner",i.isOver?"mover":"munder"],[o],e)},nUt=(t,e)=>{var r=hP(t.label);return new jt(t.isOver?"mover":"munder",[Ii(t.base,e),r])};ir({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:sLe,mathmlBuilder:nUt});ir({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=xn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:pa(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=Fa(t.body,e,!1);return mqt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=em(t.body,e);return r instanceof jt||(r=new jt("mrow",[r])),r.setAttribute("href",t.href),r}});ir({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=xn(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:r,funcName:n,token:i}=t,s=xn(e[0],"raw").string,a=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=s,o={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,o={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,o={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),h=0;h{var r=Fa(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Vt(n,r,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>em(t.body,e)});ir({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:pa(e[0]),mathml:pa(e[1])}},htmlBuilder:(t,e)=>{var r=Fa(t.html,e,!1);return hp(r)},mathmlBuilder:(t,e)=>em(t.mathml,e)});var Oz=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 Wt("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!w_e(n))throw new Wt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ir({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"},s={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(r[0])for(var l=xn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Cs(t.height,e),n=0;t.totalheight.number>0&&(n=Cs(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Cs(t.width,e));var s={height:Kt(r+n)};i>0&&(s.width=Kt(i)),n>0&&(s.verticalAlign=Kt(-n));var a=new sqt(t.src,t.alt,s);return a.height=r,a.depth=n,a},mathmlBuilder:(t,e)=>{var r=new jt("mglyph",[]);r.setAttribute("alt",t.alt);var n=Cs(t.height,e),i=0;if(t.totalheight.number>0&&(i=Cs(t.totalheight,e)-n,r.setAttribute("valign",Kt(-i))),r.setAttribute("height",Kt(n+i)),t.width.number>0){var s=Cs(t.width,e);r.setAttribute("width",Kt(s))}return r.setAttribute("src",t.src),r}});ir({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=xn(e[0],"size");if(r.settings.strict){var s=n[1]==="m",a=i.value.unit==="mu";s?(a||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")):a&&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 M_e(t.dimension,e)},mathmlBuilder(t,e){var r=Cs(t.dimension,e);return new O_e(r)}});ir({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=Vt([],[mi(t.body,e)]),r=Vt(["inner"],[r],e)):r=Vt(["inner"],[mi(t.body,e)]);var n=Vt(["fix"],[]),i=Vt([t.alignment],[r,n],e),s=Vt(["strut"]);return s.style.height=Kt(i.height+i.depth),i.depth&&(s.style.verticalAlign=Kt(-i.depth)),i.children.unshift(s),i=Vt(["thinbox"],[i],e),Vt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new jt("mpadded",[Ii(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}});ir({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 s=r==="\\("?"\\)":"$",a=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:a}}});ir({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Wt("Mismatched "+t.funcName)}});var Mpe=(t,e)=>{switch(e.style.size){case dn.DISPLAY.size:return t.display;case dn.TEXT.size:return t.text;case dn.SCRIPT.size:return t.script;case dn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};ir({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:pa(e[0]),text:pa(e[1]),script:pa(e[2]),scriptscript:pa(e[3])}},htmlBuilder:(t,e)=>{var r=Mpe(t,e),n=Fa(r,e,!1);return hp(n)},mathmlBuilder:(t,e)=>{var r=Mpe(t,e);return em(r,e)}});var aLe=(t,e,r,n,i,s,a)=>{t=Vt([],[t]);var o=r&&cp(r),l,u;if(e){var h=mi(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=mi(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+a;f=pi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Kt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Kt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-a;f=pi({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Kt(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+a;f=pi({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Kt(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&s!==0&&!o){var v=Vt(["mspace"],[],n);v.style.marginRight=Kt(s),y.unshift(v)}return Vt(["mop","op-limits"],y,n)},oLe=new Set(["\\smallint"]),aC=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=xn(t.base,"op"),i=!0):s=xn(t,"op");var a=e.style,o=!1;a.size===dn.DISPLAY.size&&s.symbol&&!oLe.has(s.name)&&(o=!0);var l,u;if(s.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=Cl(s.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=__e(d+"Size"+(o?"2":"1"),e);l=pi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var p=Fa(s.body,e,!0);p.length===1&&p[0]instanceof ru?(l=p[0],l.classes[0]="mop"):l=Vt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new jt("mo",[qu(t.name,t.mode)]),oLe.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new jt("mo",cu(t.body,e));else{r=new jt("mi",[new ga(t.name.slice(1))]);var n=new jt("mo",[qu("⁡","text")]);t.parentIsSupSub?r=new jt("mrow",[r,n]):r=N_e([r,n])}return r},iUt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ir({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=iUt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:aC,mathmlBuilder:p7});ir({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:pa(n)}},htmlBuilder:aC,mathmlBuilder:p7});var sUt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ir({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:aC,mathmlBuilder:p7});ir({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:aC,mathmlBuilder:p7});ir({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=sUt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:aC,mathmlBuilder:p7});var lLe=(t,e)=>{var r,n,i=!1,s;t.type==="supsub"?(r=t.sup,n=t.sub,s=xn(t.base,"operatorname"),i=!0):s=xn(t,"operatorname");var a;if(s.body.length>0){for(var o=s.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=Fa(o,e.withFont("mathrm"),!0),u=0;u{for(var r=cu(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new ga(o)]}var l=new jt("mi",r);l.setAttribute("mathvariant","normal");var u=new jt("mo",[qu("⁡","text")]);return t.parentIsSupSub?new jt("mrow",[l,u]):N_e([l,u])};ir({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:pa(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:lLe,mathmlBuilder:aUt});ke("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");_v({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?hp(Fa(t.body,e,!1)):Vt(["mord"],Fa(t.body,e,!0),e)},mathmlBuilder(t,e){return em(t.body,e,!0)}});ir({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=mi(t.body,e.havingCrampedStyle()),n=n3("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=pi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Vt(["mord","overline"],[s],e)},mathmlBuilder(t,e){var r=new jt("mo",[new ga("‾")]);r.setAttribute("stretchy","true");var n=new jt("mover",[Ii(t.body,e),r]);return n.setAttribute("accent","true"),n}});ir({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:pa(n)}},htmlBuilder:(t,e)=>{var r=Fa(t.body,e.withPhantom(),!1);return hp(r)},mathmlBuilder:(t,e)=>{var r=cu(t.body,e);return new jt("mphantom",r)}});ke("\\hphantom","\\smash{\\phantom{#1}}");ir({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=Vt(["inner"],[mi(t.body,e.withPhantom())]),n=Vt(["fix"],[]);return Vt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=cu(pa(t.body),e),n=new jt("mphantom",r),i=new jt("mpadded",[n]);return i.setAttribute("width","0px"),i}});ir({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=xn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=mi(t.body,e),n=Cs(t.dy,e);return pi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new jt("mpadded",[Ii(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});ir({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});ir({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],s=xn(e[0],"size"),a=xn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&xn(i,"size").value,width:s.value,height:a.value}},htmlBuilder(t,e){var r=Vt(["mord","rule"],[],e),n=Cs(t.width,e),i=Cs(t.height,e),s=t.shift?Cs(t.shift,e):0;return r.style.borderRightWidth=Kt(n),r.style.borderTopWidth=Kt(i),r.style.bottom=Kt(s),r.width=n,r.height=i+s,r.depth=-s,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=Cs(t.width,e),n=Cs(t.height,e),i=t.shift?Cs(t.shift,e):0,s=e.color&&e.getColor()||"black",a=new jt("mspace");a.setAttribute("mathbackground",s),a.setAttribute("width",Kt(r)),a.setAttribute("height",Kt(n));var o=new jt("mpadded",[a]);return i>=0?o.setAttribute("height",Kt(i)):(o.setAttribute("height",Kt(i)),o.setAttribute("depth",Kt(-i))),o.setAttribute("voffset",Kt(i)),o}});function cLe(t,e,r){for(var n=Fa(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,s=0;s{var r=e.havingSize(t.size);return cLe(t.body,r,e)};ir({type:"sizing",names:Rpe,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,s=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:Rpe.indexOf(n)+1,body:s}},htmlBuilder:oUt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=cu(t.body,r),i=new jt("mstyle",n);return i.setAttribute("mathsize",Kt(r.sizeMultiplier)),i}});ir({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,s=!1,a=r[0]&&xn(r[0],"ordgroup");if(a)for(var o,l=0;l{var r=Vt([],[mi(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 Vt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new jt("mpadded",[Ii(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});ir({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(t,e){var r=mi(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=i3(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idr.height+r.depth+a&&(a=(a+d-r.height-r.depth)/2);var f=l.height-r.height-a-u;r.style.paddingLeft=Kt(h);var p=pi({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(dn.SCRIPTSCRIPT),m=mi(t.index,g,e),y=.6*(p.height-p.depth),v=pi({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),b=Vt(["root"],[v]);return Vt(["mord","sqrt"],[b,p],e)}else return Vt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new jt("mroot",[Ii(r,e),Ii(n,e)]):new jt("msqrt",[Ii(r,e)])}});var ZU={display:dn.DISPLAY,text:dn.TEXT,script:dn.SCRIPT,scriptscript:dn.SCRIPTSCRIPT};function lUt(t){return t in ZU}ir({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,s=i.parseExpression(!0,r),a=n.slice(1,n.length-5);if(!lUt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:i.mode,style:a,body:s}},htmlBuilder(t,e){var r=ZU[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),cLe(t.body,n,e)},mathmlBuilder(t,e){var r=ZU[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=cu(t.body,n),s=new jt("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}});var cUt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===dn.DISPLAY.size||n.alwaysHandleSupSub);return i?aC:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(r.style.size===dn.DISPLAY.size||n.limits);return s?lLe:null}else{if(n.type==="accent")return cp(n.base)?vte:null;if(n.type==="horizBrace"){var a=!e.sub;return a===n.isOver?sLe:null}else return null}else return null};_v({type:"supsub",htmlBuilder(t,e){var r=cUt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:s}=t,a=mi(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&cp(n);if(i){var p=e.havingStyle(e.style.sup());o=mi(i,p,e),f||(h=a.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());l=mi(s,g,e),f||(d=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===dn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Kt(.5/u.ptPerEm/y),b=null;if(l){var x=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(a instanceof ru||x){var T;b=Kt(-((T=a.italic)!=null?T:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)0&&(h+=E,d-=E)}var A=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:v}];C=pi({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:b,marginRight:v}];C=pi({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=pi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var R=UU(a,"right")||"mord";return Vt([R],[a,Vt(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Ii(t.base,e)];t.sub&&s.push(Ii(t.sub,e)),t.sup&&s.push(Ii(t.sup,e));var a;if(r)a=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===dn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===dn.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===dn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===dn.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===dn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===dn.DISPLAY)?a="mover":a="msup"}return new jt(a,s)}});_v({type:"atom",htmlBuilder(t,e){return pte(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new jt("mo",[qu(t.text,t.mode)]);if(t.family==="bin"){var n=yte(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 uLe={mi:"italic",mn:"normal",mtext:"normal"};_v({type:"mathord",htmlBuilder(t,e){return uP(t,e,"mathord")},mathmlBuilder(t,e){var r=new jt("mi",[qu(t.text,t.mode,e)]),n=yte(t,e)||"italic";return n!==uLe[r.type]&&r.setAttribute("mathvariant",n),r}});_v({type:"textord",htmlBuilder(t,e){return uP(t,e,"textord")},mathmlBuilder(t,e){var r=qu(t.text,t.mode,e),n=yte(t,e)||"normal",i;return t.mode==="text"?i=new jt("mtext",[r]):/[0-9]/.test(t.text)?i=new jt("mn",[r]):t.text==="\\prime"?i=new jt("mo",[r]):i=new jt("mi",[r]),n!==uLe[i.type]&&i.setAttribute("mathvariant",n),i}});var Dz={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Pz={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};_v({type:"spacing",htmlBuilder(t,e){if(Pz.hasOwnProperty(t.text)){var r=Pz[t.text].className||"";if(t.mode==="text"){var n=uP(t,e,"textord");return n.classes.push(r),n}else return Vt(["mspace",r],[pte(t.text,t.mode,e)],e)}else{if(Dz.hasOwnProperty(t.text))return Vt(["mspace",Dz[t.text]],[],e);throw new Wt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(Pz.hasOwnProperty(t.text))r=new jt("mtext",[new ga(" ")]);else{if(Dz.hasOwnProperty(t.text))return new jt("mspace");throw new Wt('Unknown type of space "'+t.text+'"')}return r}});var _pe=()=>{var t=new jt("mtd",[]);return t.setAttribute("width","50%"),t};_v({type:"tag",mathmlBuilder(t,e){var r=new jt("mtable",[new jt("mtr",[_pe(),new jt("mtd",[em(t.body,e)]),_pe(),new jt("mtd",[em(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var Lpe={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Ipe={"\\textbf":"textbf","\\textmd":"textmd"},uUt={"\\textit":"textit","\\textup":"textup"},Npe=(t,e)=>{var r=t.font;if(r){if(Lpe[r])return e.withTextFontFamily(Lpe[r]);if(Ipe[r])return e.withTextFontWeight(Ipe[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(uUt[r])};ir({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:pa(i),font:n}},htmlBuilder(t,e){var r=Npe(t,e),n=Fa(t.body,r,!0);return Vt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Npe(t,e);return em(t.body,r)}});ir({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=mi(t.body,e),n=n3("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=pi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Vt(["mord","underline"],[s],e)},mathmlBuilder(t,e){var r=new jt("mo",[new ga("‾")]);r.setAttribute("stretchy","true");var n=new jt("munder",[Ii(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});ir({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=mi(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return pi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new jt("mpadded",[Ii(t.body,e)],["vcenter"]);return new jt("mrow",[r])}});ir({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new Wt("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=Ope(t),n=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),dg=L_e,hLe=`[ \r - ]`,hUt="\\\\[a-zA-Z@]+",dUt="\\\\[^\uD800-\uDFFF]",fUt="("+hUt+")"+hLe+"*",pUt=`\\\\( +-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 kWt(t){return"toText"in t}let s9=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 this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r{if(kWt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}};var Hq={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},SWt={ex:!0,em:!0,mu:!0},DRe=function(e){return typeof e!="string"&&(e=e.unit),e in Hq||e in SWt||e==="ex"},wa=function(e,r){var n;if(e.unit in Hq)n=Hq[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)},Kt=function(e){return+e.toFixed(4)+"em"},Qg=function(e){return e.filter(r=>r).join(" ")},vte=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=eWt(n)+":"+i+";")}return r},ORe=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)}},_Re=function(e){var r=document.createElement(e);r.className=Qg(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]/,PRe=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+Qo(Qg(this.classes))+'"');var n=vte(this.style);n&&(r+=' style="'+Qo(n)+'"');for(var i of Object.keys(this.attributes)){if(EWt.test(i))throw new Gt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+Qo(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class o9{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,ORe.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return _Re.call(this,"span")}toMarkup(){return PRe.call(this,"span")}}let h_=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,ORe.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 _Re.call(this,"a")}toMarkup(){return PRe.call(this,"a")}};class AWt{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=''+Qo(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=Kt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=Qg(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:"+Kt(this.italic)+";"),n+=vte(this.style),n&&(e=!0,r+=' style="'+Qo(n)+'"');var i=Qo(this.text);return e?(r+=">",r+=i,r+="",r):i}}class B0{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 Gq{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 IWt=t=>t instanceof o9||t instanceof h_||t instanceof s9,Id={"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]}},xE={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]},fpe={Å:"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 BRe(t,e){Id[t]=e}function xte(t,e,r){if(!Id[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Id[e][n];if(!i&&t[0]in fpe&&(n=fpe[t[0]].charCodeAt(0),i=Id[e][n]),!i&&r==="text"&&NRe(n)&&(i=Id[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var EF={};function NWt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!EF[e]){var r=EF[e]={cssEmPerMu:xE.quad[e]/18};for(var n in xE)xE.hasOwnProperty(n)&&(r[n]=xE[n][e])}return EF[e]}var ha={math:{},text:{}};function q(t,e,r,n,i,a){ha[t][i]={font:e,group:r,replace:n},a&&n&&(ha[t][n]=ha[t][i])}var se="math",Ot="text",be="main",We="ams",ga="accent-token",dr="bin",Jl="close",l9="inner",Vr="mathord",bs="op-token",lu="open",mk="punct",Xe="rel",hp="spacing",et="textord";q(se,be,Xe,"≡","\\equiv",!0);q(se,be,Xe,"≺","\\prec",!0);q(se,be,Xe,"≻","\\succ",!0);q(se,be,Xe,"∼","\\sim",!0);q(se,be,Xe,"⊥","\\perp");q(se,be,Xe,"⪯","\\preceq",!0);q(se,be,Xe,"⪰","\\succeq",!0);q(se,be,Xe,"≃","\\simeq",!0);q(se,be,Xe,"∣","\\mid",!0);q(se,be,Xe,"≪","\\ll",!0);q(se,be,Xe,"≫","\\gg",!0);q(se,be,Xe,"≍","\\asymp",!0);q(se,be,Xe,"∥","\\parallel");q(se,be,Xe,"⋈","\\bowtie",!0);q(se,be,Xe,"⌣","\\smile",!0);q(se,be,Xe,"⊑","\\sqsubseteq",!0);q(se,be,Xe,"⊒","\\sqsupseteq",!0);q(se,be,Xe,"≐","\\doteq",!0);q(se,be,Xe,"⌢","\\frown",!0);q(se,be,Xe,"∋","\\ni",!0);q(se,be,Xe,"∝","\\propto",!0);q(se,be,Xe,"⊢","\\vdash",!0);q(se,be,Xe,"⊣","\\dashv",!0);q(se,be,Xe,"∋","\\owns");q(se,be,mk,".","\\ldotp");q(se,be,mk,"⋅","\\cdotp");q(se,be,mk,"⋅","·");q(Ot,be,et,"⋅","·");q(se,be,et,"#","\\#");q(Ot,be,et,"#","\\#");q(se,be,et,"&","\\&");q(Ot,be,et,"&","\\&");q(se,be,et,"ℵ","\\aleph",!0);q(se,be,et,"∀","\\forall",!0);q(se,be,et,"ℏ","\\hbar",!0);q(se,be,et,"∃","\\exists",!0);q(se,be,et,"∇","\\nabla",!0);q(se,be,et,"♭","\\flat",!0);q(se,be,et,"ℓ","\\ell",!0);q(se,be,et,"♮","\\natural",!0);q(se,be,et,"♣","\\clubsuit",!0);q(se,be,et,"℘","\\wp",!0);q(se,be,et,"♯","\\sharp",!0);q(se,be,et,"♢","\\diamondsuit",!0);q(se,be,et,"ℜ","\\Re",!0);q(se,be,et,"♡","\\heartsuit",!0);q(se,be,et,"ℑ","\\Im",!0);q(se,be,et,"♠","\\spadesuit",!0);q(se,be,et,"§","\\S",!0);q(Ot,be,et,"§","\\S");q(se,be,et,"¶","\\P",!0);q(Ot,be,et,"¶","\\P");q(se,be,et,"†","\\dag");q(Ot,be,et,"†","\\dag");q(Ot,be,et,"†","\\textdagger");q(se,be,et,"‡","\\ddag");q(Ot,be,et,"‡","\\ddag");q(Ot,be,et,"‡","\\textdaggerdbl");q(se,be,Jl,"⎱","\\rmoustache",!0);q(se,be,lu,"⎰","\\lmoustache",!0);q(se,be,Jl,"⟯","\\rgroup",!0);q(se,be,lu,"⟮","\\lgroup",!0);q(se,be,dr,"∓","\\mp",!0);q(se,be,dr,"⊖","\\ominus",!0);q(se,be,dr,"⊎","\\uplus",!0);q(se,be,dr,"⊓","\\sqcap",!0);q(se,be,dr,"∗","\\ast");q(se,be,dr,"⊔","\\sqcup",!0);q(se,be,dr,"◯","\\bigcirc",!0);q(se,be,dr,"∙","\\bullet",!0);q(se,be,dr,"‡","\\ddagger");q(se,be,dr,"≀","\\wr",!0);q(se,be,dr,"⨿","\\amalg");q(se,be,dr,"&","\\And");q(se,be,Xe,"⟵","\\longleftarrow",!0);q(se,be,Xe,"⇐","\\Leftarrow",!0);q(se,be,Xe,"⟸","\\Longleftarrow",!0);q(se,be,Xe,"⟶","\\longrightarrow",!0);q(se,be,Xe,"⇒","\\Rightarrow",!0);q(se,be,Xe,"⟹","\\Longrightarrow",!0);q(se,be,Xe,"↔","\\leftrightarrow",!0);q(se,be,Xe,"⟷","\\longleftrightarrow",!0);q(se,be,Xe,"⇔","\\Leftrightarrow",!0);q(se,be,Xe,"⟺","\\Longleftrightarrow",!0);q(se,be,Xe,"↦","\\mapsto",!0);q(se,be,Xe,"⟼","\\longmapsto",!0);q(se,be,Xe,"↗","\\nearrow",!0);q(se,be,Xe,"↩","\\hookleftarrow",!0);q(se,be,Xe,"↪","\\hookrightarrow",!0);q(se,be,Xe,"↘","\\searrow",!0);q(se,be,Xe,"↼","\\leftharpoonup",!0);q(se,be,Xe,"⇀","\\rightharpoonup",!0);q(se,be,Xe,"↙","\\swarrow",!0);q(se,be,Xe,"↽","\\leftharpoondown",!0);q(se,be,Xe,"⇁","\\rightharpoondown",!0);q(se,be,Xe,"↖","\\nwarrow",!0);q(se,be,Xe,"⇌","\\rightleftharpoons",!0);q(se,We,Xe,"≮","\\nless",!0);q(se,We,Xe,"","\\@nleqslant");q(se,We,Xe,"","\\@nleqq");q(se,We,Xe,"⪇","\\lneq",!0);q(se,We,Xe,"≨","\\lneqq",!0);q(se,We,Xe,"","\\@lvertneqq");q(se,We,Xe,"⋦","\\lnsim",!0);q(se,We,Xe,"⪉","\\lnapprox",!0);q(se,We,Xe,"⊀","\\nprec",!0);q(se,We,Xe,"⋠","\\npreceq",!0);q(se,We,Xe,"⋨","\\precnsim",!0);q(se,We,Xe,"⪹","\\precnapprox",!0);q(se,We,Xe,"≁","\\nsim",!0);q(se,We,Xe,"","\\@nshortmid");q(se,We,Xe,"∤","\\nmid",!0);q(se,We,Xe,"⊬","\\nvdash",!0);q(se,We,Xe,"⊭","\\nvDash",!0);q(se,We,Xe,"⋪","\\ntriangleleft");q(se,We,Xe,"⋬","\\ntrianglelefteq",!0);q(se,We,Xe,"⊊","\\subsetneq",!0);q(se,We,Xe,"","\\@varsubsetneq");q(se,We,Xe,"⫋","\\subsetneqq",!0);q(se,We,Xe,"","\\@varsubsetneqq");q(se,We,Xe,"≯","\\ngtr",!0);q(se,We,Xe,"","\\@ngeqslant");q(se,We,Xe,"","\\@ngeqq");q(se,We,Xe,"⪈","\\gneq",!0);q(se,We,Xe,"≩","\\gneqq",!0);q(se,We,Xe,"","\\@gvertneqq");q(se,We,Xe,"⋧","\\gnsim",!0);q(se,We,Xe,"⪊","\\gnapprox",!0);q(se,We,Xe,"⊁","\\nsucc",!0);q(se,We,Xe,"⋡","\\nsucceq",!0);q(se,We,Xe,"⋩","\\succnsim",!0);q(se,We,Xe,"⪺","\\succnapprox",!0);q(se,We,Xe,"≆","\\ncong",!0);q(se,We,Xe,"","\\@nshortparallel");q(se,We,Xe,"∦","\\nparallel",!0);q(se,We,Xe,"⊯","\\nVDash",!0);q(se,We,Xe,"⋫","\\ntriangleright");q(se,We,Xe,"⋭","\\ntrianglerighteq",!0);q(se,We,Xe,"","\\@nsupseteqq");q(se,We,Xe,"⊋","\\supsetneq",!0);q(se,We,Xe,"","\\@varsupsetneq");q(se,We,Xe,"⫌","\\supsetneqq",!0);q(se,We,Xe,"","\\@varsupsetneqq");q(se,We,Xe,"⊮","\\nVdash",!0);q(se,We,Xe,"⪵","\\precneqq",!0);q(se,We,Xe,"⪶","\\succneqq",!0);q(se,We,Xe,"","\\@nsubseteqq");q(se,We,dr,"⊴","\\unlhd");q(se,We,dr,"⊵","\\unrhd");q(se,We,Xe,"↚","\\nleftarrow",!0);q(se,We,Xe,"↛","\\nrightarrow",!0);q(se,We,Xe,"⇍","\\nLeftarrow",!0);q(se,We,Xe,"⇏","\\nRightarrow",!0);q(se,We,Xe,"↮","\\nleftrightarrow",!0);q(se,We,Xe,"⇎","\\nLeftrightarrow",!0);q(se,We,Xe,"△","\\vartriangle");q(se,We,et,"ℏ","\\hslash");q(se,We,et,"▽","\\triangledown");q(se,We,et,"◊","\\lozenge");q(se,We,et,"Ⓢ","\\circledS");q(se,We,et,"®","\\circledR");q(Ot,We,et,"®","\\circledR");q(se,We,et,"∡","\\measuredangle",!0);q(se,We,et,"∄","\\nexists");q(se,We,et,"℧","\\mho");q(se,We,et,"Ⅎ","\\Finv",!0);q(se,We,et,"⅁","\\Game",!0);q(se,We,et,"‵","\\backprime");q(se,We,et,"▲","\\blacktriangle");q(se,We,et,"▼","\\blacktriangledown");q(se,We,et,"■","\\blacksquare");q(se,We,et,"⧫","\\blacklozenge");q(se,We,et,"★","\\bigstar");q(se,We,et,"∢","\\sphericalangle",!0);q(se,We,et,"∁","\\complement",!0);q(se,We,et,"ð","\\eth",!0);q(Ot,be,et,"ð","ð");q(se,We,et,"╱","\\diagup");q(se,We,et,"╲","\\diagdown");q(se,We,et,"□","\\square");q(se,We,et,"□","\\Box");q(se,We,et,"◊","\\Diamond");q(se,We,et,"¥","\\yen",!0);q(Ot,We,et,"¥","\\yen",!0);q(se,We,et,"✓","\\checkmark",!0);q(Ot,We,et,"✓","\\checkmark");q(se,We,et,"ℶ","\\beth",!0);q(se,We,et,"ℸ","\\daleth",!0);q(se,We,et,"ℷ","\\gimel",!0);q(se,We,et,"ϝ","\\digamma",!0);q(se,We,et,"ϰ","\\varkappa");q(se,We,lu,"┌","\\@ulcorner",!0);q(se,We,Jl,"┐","\\@urcorner",!0);q(se,We,lu,"└","\\@llcorner",!0);q(se,We,Jl,"┘","\\@lrcorner",!0);q(se,We,Xe,"≦","\\leqq",!0);q(se,We,Xe,"⩽","\\leqslant",!0);q(se,We,Xe,"⪕","\\eqslantless",!0);q(se,We,Xe,"≲","\\lesssim",!0);q(se,We,Xe,"⪅","\\lessapprox",!0);q(se,We,Xe,"≊","\\approxeq",!0);q(se,We,dr,"⋖","\\lessdot");q(se,We,Xe,"⋘","\\lll",!0);q(se,We,Xe,"≶","\\lessgtr",!0);q(se,We,Xe,"⋚","\\lesseqgtr",!0);q(se,We,Xe,"⪋","\\lesseqqgtr",!0);q(se,We,Xe,"≑","\\doteqdot");q(se,We,Xe,"≓","\\risingdotseq",!0);q(se,We,Xe,"≒","\\fallingdotseq",!0);q(se,We,Xe,"∽","\\backsim",!0);q(se,We,Xe,"⋍","\\backsimeq",!0);q(se,We,Xe,"⫅","\\subseteqq",!0);q(se,We,Xe,"⋐","\\Subset",!0);q(se,We,Xe,"⊏","\\sqsubset",!0);q(se,We,Xe,"≼","\\preccurlyeq",!0);q(se,We,Xe,"⋞","\\curlyeqprec",!0);q(se,We,Xe,"≾","\\precsim",!0);q(se,We,Xe,"⪷","\\precapprox",!0);q(se,We,Xe,"⊲","\\vartriangleleft");q(se,We,Xe,"⊴","\\trianglelefteq");q(se,We,Xe,"⊨","\\vDash",!0);q(se,We,Xe,"⊪","\\Vvdash",!0);q(se,We,Xe,"⌣","\\smallsmile");q(se,We,Xe,"⌢","\\smallfrown");q(se,We,Xe,"≏","\\bumpeq",!0);q(se,We,Xe,"≎","\\Bumpeq",!0);q(se,We,Xe,"≧","\\geqq",!0);q(se,We,Xe,"⩾","\\geqslant",!0);q(se,We,Xe,"⪖","\\eqslantgtr",!0);q(se,We,Xe,"≳","\\gtrsim",!0);q(se,We,Xe,"⪆","\\gtrapprox",!0);q(se,We,dr,"⋗","\\gtrdot");q(se,We,Xe,"⋙","\\ggg",!0);q(se,We,Xe,"≷","\\gtrless",!0);q(se,We,Xe,"⋛","\\gtreqless",!0);q(se,We,Xe,"⪌","\\gtreqqless",!0);q(se,We,Xe,"≖","\\eqcirc",!0);q(se,We,Xe,"≗","\\circeq",!0);q(se,We,Xe,"≜","\\triangleq",!0);q(se,We,Xe,"∼","\\thicksim");q(se,We,Xe,"≈","\\thickapprox");q(se,We,Xe,"⫆","\\supseteqq",!0);q(se,We,Xe,"⋑","\\Supset",!0);q(se,We,Xe,"⊐","\\sqsupset",!0);q(se,We,Xe,"≽","\\succcurlyeq",!0);q(se,We,Xe,"⋟","\\curlyeqsucc",!0);q(se,We,Xe,"≿","\\succsim",!0);q(se,We,Xe,"⪸","\\succapprox",!0);q(se,We,Xe,"⊳","\\vartriangleright");q(se,We,Xe,"⊵","\\trianglerighteq");q(se,We,Xe,"⊩","\\Vdash",!0);q(se,We,Xe,"∣","\\shortmid");q(se,We,Xe,"∥","\\shortparallel");q(se,We,Xe,"≬","\\between",!0);q(se,We,Xe,"⋔","\\pitchfork",!0);q(se,We,Xe,"∝","\\varpropto");q(se,We,Xe,"◀","\\blacktriangleleft");q(se,We,Xe,"∴","\\therefore",!0);q(se,We,Xe,"∍","\\backepsilon");q(se,We,Xe,"▶","\\blacktriangleright");q(se,We,Xe,"∵","\\because",!0);q(se,We,Xe,"⋘","\\llless");q(se,We,Xe,"⋙","\\gggtr");q(se,We,dr,"⊲","\\lhd");q(se,We,dr,"⊳","\\rhd");q(se,We,Xe,"≂","\\eqsim",!0);q(se,be,Xe,"⋈","\\Join");q(se,We,Xe,"≑","\\Doteq",!0);q(se,We,dr,"∔","\\dotplus",!0);q(se,We,dr,"∖","\\smallsetminus");q(se,We,dr,"⋒","\\Cap",!0);q(se,We,dr,"⋓","\\Cup",!0);q(se,We,dr,"⩞","\\doublebarwedge",!0);q(se,We,dr,"⊟","\\boxminus",!0);q(se,We,dr,"⊞","\\boxplus",!0);q(se,We,dr,"⋇","\\divideontimes",!0);q(se,We,dr,"⋉","\\ltimes",!0);q(se,We,dr,"⋊","\\rtimes",!0);q(se,We,dr,"⋋","\\leftthreetimes",!0);q(se,We,dr,"⋌","\\rightthreetimes",!0);q(se,We,dr,"⋏","\\curlywedge",!0);q(se,We,dr,"⋎","\\curlyvee",!0);q(se,We,dr,"⊝","\\circleddash",!0);q(se,We,dr,"⊛","\\circledast",!0);q(se,We,dr,"⋅","\\centerdot");q(se,We,dr,"⊺","\\intercal",!0);q(se,We,dr,"⋒","\\doublecap");q(se,We,dr,"⋓","\\doublecup");q(se,We,dr,"⊠","\\boxtimes",!0);q(se,We,Xe,"⇢","\\dashrightarrow",!0);q(se,We,Xe,"⇠","\\dashleftarrow",!0);q(se,We,Xe,"⇇","\\leftleftarrows",!0);q(se,We,Xe,"⇆","\\leftrightarrows",!0);q(se,We,Xe,"⇚","\\Lleftarrow",!0);q(se,We,Xe,"↞","\\twoheadleftarrow",!0);q(se,We,Xe,"↢","\\leftarrowtail",!0);q(se,We,Xe,"↫","\\looparrowleft",!0);q(se,We,Xe,"⇋","\\leftrightharpoons",!0);q(se,We,Xe,"↶","\\curvearrowleft",!0);q(se,We,Xe,"↺","\\circlearrowleft",!0);q(se,We,Xe,"↰","\\Lsh",!0);q(se,We,Xe,"⇈","\\upuparrows",!0);q(se,We,Xe,"↿","\\upharpoonleft",!0);q(se,We,Xe,"⇃","\\downharpoonleft",!0);q(se,be,Xe,"⊶","\\origof",!0);q(se,be,Xe,"⊷","\\imageof",!0);q(se,We,Xe,"⊸","\\multimap",!0);q(se,We,Xe,"↭","\\leftrightsquigarrow",!0);q(se,We,Xe,"⇉","\\rightrightarrows",!0);q(se,We,Xe,"⇄","\\rightleftarrows",!0);q(se,We,Xe,"↠","\\twoheadrightarrow",!0);q(se,We,Xe,"↣","\\rightarrowtail",!0);q(se,We,Xe,"↬","\\looparrowright",!0);q(se,We,Xe,"↷","\\curvearrowright",!0);q(se,We,Xe,"↻","\\circlearrowright",!0);q(se,We,Xe,"↱","\\Rsh",!0);q(se,We,Xe,"⇊","\\downdownarrows",!0);q(se,We,Xe,"↾","\\upharpoonright",!0);q(se,We,Xe,"⇂","\\downharpoonright",!0);q(se,We,Xe,"⇝","\\rightsquigarrow",!0);q(se,We,Xe,"⇝","\\leadsto");q(se,We,Xe,"⇛","\\Rrightarrow",!0);q(se,We,Xe,"↾","\\restriction");q(se,be,et,"‘","`");q(se,be,et,"$","\\$");q(Ot,be,et,"$","\\$");q(Ot,be,et,"$","\\textdollar");q(se,be,et,"%","\\%");q(Ot,be,et,"%","\\%");q(se,be,et,"_","\\_");q(Ot,be,et,"_","\\_");q(Ot,be,et,"_","\\textunderscore");q(se,be,et,"∠","\\angle",!0);q(se,be,et,"∞","\\infty",!0);q(se,be,et,"′","\\prime");q(se,be,et,"△","\\triangle");q(se,be,et,"Γ","\\Gamma",!0);q(se,be,et,"Δ","\\Delta",!0);q(se,be,et,"Θ","\\Theta",!0);q(se,be,et,"Λ","\\Lambda",!0);q(se,be,et,"Ξ","\\Xi",!0);q(se,be,et,"Π","\\Pi",!0);q(se,be,et,"Σ","\\Sigma",!0);q(se,be,et,"Υ","\\Upsilon",!0);q(se,be,et,"Φ","\\Phi",!0);q(se,be,et,"Ψ","\\Psi",!0);q(se,be,et,"Ω","\\Omega",!0);q(se,be,et,"A","Α");q(se,be,et,"B","Β");q(se,be,et,"E","Ε");q(se,be,et,"Z","Ζ");q(se,be,et,"H","Η");q(se,be,et,"I","Ι");q(se,be,et,"K","Κ");q(se,be,et,"M","Μ");q(se,be,et,"N","Ν");q(se,be,et,"O","Ο");q(se,be,et,"P","Ρ");q(se,be,et,"T","Τ");q(se,be,et,"X","Χ");q(se,be,et,"¬","\\neg",!0);q(se,be,et,"¬","\\lnot");q(se,be,et,"⊤","\\top");q(se,be,et,"⊥","\\bot");q(se,be,et,"∅","\\emptyset");q(se,We,et,"∅","\\varnothing");q(se,be,Vr,"α","\\alpha",!0);q(se,be,Vr,"β","\\beta",!0);q(se,be,Vr,"γ","\\gamma",!0);q(se,be,Vr,"δ","\\delta",!0);q(se,be,Vr,"ϵ","\\epsilon",!0);q(se,be,Vr,"ζ","\\zeta",!0);q(se,be,Vr,"η","\\eta",!0);q(se,be,Vr,"θ","\\theta",!0);q(se,be,Vr,"ι","\\iota",!0);q(se,be,Vr,"κ","\\kappa",!0);q(se,be,Vr,"λ","\\lambda",!0);q(se,be,Vr,"μ","\\mu",!0);q(se,be,Vr,"ν","\\nu",!0);q(se,be,Vr,"ξ","\\xi",!0);q(se,be,Vr,"ο","\\omicron",!0);q(se,be,Vr,"π","\\pi",!0);q(se,be,Vr,"ρ","\\rho",!0);q(se,be,Vr,"σ","\\sigma",!0);q(se,be,Vr,"τ","\\tau",!0);q(se,be,Vr,"υ","\\upsilon",!0);q(se,be,Vr,"ϕ","\\phi",!0);q(se,be,Vr,"χ","\\chi",!0);q(se,be,Vr,"ψ","\\psi",!0);q(se,be,Vr,"ω","\\omega",!0);q(se,be,Vr,"ε","\\varepsilon",!0);q(se,be,Vr,"ϑ","\\vartheta",!0);q(se,be,Vr,"ϖ","\\varpi",!0);q(se,be,Vr,"ϱ","\\varrho",!0);q(se,be,Vr,"ς","\\varsigma",!0);q(se,be,Vr,"φ","\\varphi",!0);q(se,be,dr,"∗","*",!0);q(se,be,dr,"+","+");q(se,be,dr,"−","-",!0);q(se,be,dr,"⋅","\\cdot",!0);q(se,be,dr,"∘","\\circ",!0);q(se,be,dr,"÷","\\div",!0);q(se,be,dr,"±","\\pm",!0);q(se,be,dr,"×","\\times",!0);q(se,be,dr,"∩","\\cap",!0);q(se,be,dr,"∪","\\cup",!0);q(se,be,dr,"∖","\\setminus",!0);q(se,be,dr,"∧","\\land");q(se,be,dr,"∨","\\lor");q(se,be,dr,"∧","\\wedge",!0);q(se,be,dr,"∨","\\vee",!0);q(se,be,et,"√","\\surd");q(se,be,lu,"⟨","\\langle",!0);q(se,be,lu,"∣","\\lvert");q(se,be,lu,"∥","\\lVert");q(se,be,Jl,"?","?");q(se,be,Jl,"!","!");q(se,be,Jl,"⟩","\\rangle",!0);q(se,be,Jl,"∣","\\rvert");q(se,be,Jl,"∥","\\rVert");q(se,be,Xe,"=","=");q(se,be,Xe,":",":");q(se,be,Xe,"≈","\\approx",!0);q(se,be,Xe,"≅","\\cong",!0);q(se,be,Xe,"≥","\\ge");q(se,be,Xe,"≥","\\geq",!0);q(se,be,Xe,"←","\\gets");q(se,be,Xe,">","\\gt",!0);q(se,be,Xe,"∈","\\in",!0);q(se,be,Xe,"","\\@not");q(se,be,Xe,"⊂","\\subset",!0);q(se,be,Xe,"⊃","\\supset",!0);q(se,be,Xe,"⊆","\\subseteq",!0);q(se,be,Xe,"⊇","\\supseteq",!0);q(se,We,Xe,"⊈","\\nsubseteq",!0);q(se,We,Xe,"⊉","\\nsupseteq",!0);q(se,be,Xe,"⊨","\\models");q(se,be,Xe,"←","\\leftarrow",!0);q(se,be,Xe,"≤","\\le");q(se,be,Xe,"≤","\\leq",!0);q(se,be,Xe,"<","\\lt",!0);q(se,be,Xe,"→","\\rightarrow",!0);q(se,be,Xe,"→","\\to");q(se,We,Xe,"≱","\\ngeq",!0);q(se,We,Xe,"≰","\\nleq",!0);q(se,be,hp," ","\\ ");q(se,be,hp," ","\\space");q(se,be,hp," ","\\nobreakspace");q(Ot,be,hp," ","\\ ");q(Ot,be,hp," "," ");q(Ot,be,hp," ","\\space");q(Ot,be,hp," ","\\nobreakspace");q(se,be,hp,"","\\nobreak");q(se,be,hp,"","\\allowbreak");q(se,be,mk,",",",");q(se,be,mk,";",";");q(se,We,dr,"⊼","\\barwedge",!0);q(se,We,dr,"⊻","\\veebar",!0);q(se,be,dr,"⊙","\\odot",!0);q(se,be,dr,"⊕","\\oplus",!0);q(se,be,dr,"⊗","\\otimes",!0);q(se,be,et,"∂","\\partial",!0);q(se,be,dr,"⊘","\\oslash",!0);q(se,We,dr,"⊚","\\circledcirc",!0);q(se,We,dr,"⊡","\\boxdot",!0);q(se,be,dr,"△","\\bigtriangleup");q(se,be,dr,"▽","\\bigtriangledown");q(se,be,dr,"†","\\dagger");q(se,be,dr,"⋄","\\diamond");q(se,be,dr,"⋆","\\star");q(se,be,dr,"◃","\\triangleleft");q(se,be,dr,"▹","\\triangleright");q(se,be,lu,"{","\\{");q(Ot,be,et,"{","\\{");q(Ot,be,et,"{","\\textbraceleft");q(se,be,Jl,"}","\\}");q(Ot,be,et,"}","\\}");q(Ot,be,et,"}","\\textbraceright");q(se,be,lu,"{","\\lbrace");q(se,be,Jl,"}","\\rbrace");q(se,be,lu,"[","\\lbrack",!0);q(Ot,be,et,"[","\\lbrack",!0);q(se,be,Jl,"]","\\rbrack",!0);q(Ot,be,et,"]","\\rbrack",!0);q(se,be,lu,"(","\\lparen",!0);q(se,be,Jl,")","\\rparen",!0);q(Ot,be,et,"<","\\textless",!0);q(Ot,be,et,">","\\textgreater",!0);q(se,be,lu,"⌊","\\lfloor",!0);q(se,be,Jl,"⌋","\\rfloor",!0);q(se,be,lu,"⌈","\\lceil",!0);q(se,be,Jl,"⌉","\\rceil",!0);q(se,be,et,"\\","\\backslash");q(se,be,et,"∣","|");q(se,be,et,"∣","\\vert");q(Ot,be,et,"|","\\textbar",!0);q(se,be,et,"∥","\\|");q(se,be,et,"∥","\\Vert");q(Ot,be,et,"∥","\\textbardbl");q(Ot,be,et,"~","\\textasciitilde");q(Ot,be,et,"\\","\\textbackslash");q(Ot,be,et,"^","\\textasciicircum");q(se,be,Xe,"↑","\\uparrow",!0);q(se,be,Xe,"⇑","\\Uparrow",!0);q(se,be,Xe,"↓","\\downarrow",!0);q(se,be,Xe,"⇓","\\Downarrow",!0);q(se,be,Xe,"↕","\\updownarrow",!0);q(se,be,Xe,"⇕","\\Updownarrow",!0);q(se,be,bs,"∐","\\coprod");q(se,be,bs,"⋁","\\bigvee");q(se,be,bs,"⋀","\\bigwedge");q(se,be,bs,"⨄","\\biguplus");q(se,be,bs,"⋂","\\bigcap");q(se,be,bs,"⋃","\\bigcup");q(se,be,bs,"∫","\\int");q(se,be,bs,"∫","\\intop");q(se,be,bs,"∬","\\iint");q(se,be,bs,"∭","\\iiint");q(se,be,bs,"∏","\\prod");q(se,be,bs,"∑","\\sum");q(se,be,bs,"⨂","\\bigotimes");q(se,be,bs,"⨁","\\bigoplus");q(se,be,bs,"⨀","\\bigodot");q(se,be,bs,"∮","\\oint");q(se,be,bs,"∯","\\oiint");q(se,be,bs,"∰","\\oiiint");q(se,be,bs,"⨆","\\bigsqcup");q(se,be,bs,"∫","\\smallint");q(Ot,be,l9,"…","\\textellipsis");q(se,be,l9,"…","\\mathellipsis");q(Ot,be,l9,"…","\\ldots",!0);q(se,be,l9,"…","\\ldots",!0);q(se,be,l9,"⋯","\\@cdots",!0);q(se,be,l9,"⋱","\\ddots",!0);q(se,be,et,"⋮","\\varvdots");q(Ot,be,et,"⋮","\\varvdots");q(se,be,ga,"ˊ","\\acute");q(se,be,ga,"ˋ","\\grave");q(se,be,ga,"¨","\\ddot");q(se,be,ga,"~","\\tilde");q(se,be,ga,"ˉ","\\bar");q(se,be,ga,"˘","\\breve");q(se,be,ga,"ˇ","\\check");q(se,be,ga,"^","\\hat");q(se,be,ga,"⃗","\\vec");q(se,be,ga,"˙","\\dot");q(se,be,ga,"˚","\\mathring");q(se,be,Vr,"","\\@imath");q(se,be,Vr,"","\\@jmath");q(se,be,et,"ı","ı");q(se,be,et,"ȷ","ȷ");q(Ot,be,et,"ı","\\i",!0);q(Ot,be,et,"ȷ","\\j",!0);q(Ot,be,et,"ß","\\ss",!0);q(Ot,be,et,"æ","\\ae",!0);q(Ot,be,et,"œ","\\oe",!0);q(Ot,be,et,"ø","\\o",!0);q(Ot,be,et,"Æ","\\AE",!0);q(Ot,be,et,"Œ","\\OE",!0);q(Ot,be,et,"Ø","\\O",!0);q(Ot,be,ga,"ˊ","\\'");q(Ot,be,ga,"ˋ","\\`");q(Ot,be,ga,"ˆ","\\^");q(Ot,be,ga,"˜","\\~");q(Ot,be,ga,"ˉ","\\=");q(Ot,be,ga,"˘","\\u");q(Ot,be,ga,"˙","\\.");q(Ot,be,ga,"¸","\\c");q(Ot,be,ga,"˚","\\r");q(Ot,be,ga,"ˇ","\\v");q(Ot,be,ga,"¨",'\\"');q(Ot,be,ga,"˝","\\H");q(Ot,be,ga,"◯","\\textcircled");var $Re={"--":!0,"---":!0,"``":!0,"''":!0};q(Ot,be,et,"–","--",!0);q(Ot,be,et,"–","\\textendash");q(Ot,be,et,"—","---",!0);q(Ot,be,et,"—","\\textemdash");q(Ot,be,et,"‘","`",!0);q(Ot,be,et,"‘","\\textquoteleft");q(Ot,be,et,"’","'",!0);q(Ot,be,et,"’","\\textquoteright");q(Ot,be,et,"“","``",!0);q(Ot,be,et,"“","\\textquotedblleft");q(Ot,be,et,"”","''",!0);q(Ot,be,et,"”","\\textquotedblright");q(se,be,et,"°","\\degree",!0);q(Ot,be,et,"°","\\degree");q(Ot,be,et,"°","\\textdegree",!0);q(se,be,et,"£","\\pounds");q(se,be,et,"£","\\mathsterling",!0);q(Ot,be,et,"£","\\pounds");q(Ot,be,et,"£","\\textsterling",!0);q(se,We,et,"✠","\\maltese");q(Ot,We,et,"✠","\\maltese");var ppe='0123456789/@."';for(var AF=0;AF{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 Cpe[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return OWt[a]}else{if(n===120485||n===120486)return Cpe[0];if(120486{if(Qg(t.classes)!==Qg(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},FRe=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},zt=function(e,r,n,i){var a=new o9(e,r,n,i);return Tte(a),a},t1=(t,e,r,n)=>new o9(t,e,r,n),s4=function(e,r,n){var i=zt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Kt(i.height),i.maxFontSize=1,i},$Wt=function(e,r,n,i){var a=new h_(e,r,n,i);return Tte(a),a},dp=function(e){var r=new s9(e);return Tte(r),r},o4=function(e,r){return e instanceof s9?zt([],[e],r):e},FWt=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=zt(["mspace"],[],e),n=wa(t,e);return r.style.marginRight=Kt(n),r},CE=(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},Kq={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"}},VRe={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},HRe=function(e,r){var[n,i,a]=VRe[e],s=new e1(n),o=new B0([s],{width:Kt(i),height:Kt(a),style:"width:"+Kt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=t1(["overlay"],[o],r);return l.height=a,l.style.height=Kt(a),l.style.width=Kt(i),l},ba={number:3,unit:"mu"},am={number:4,unit:"mu"},If={number:5,unit:"mu"},zWt={mord:{mop:ba,mbin:am,mrel:If,minner:ba},mop:{mord:ba,mop:ba,mrel:If,minner:ba},mbin:{mord:am,mop:am,mopen:am,minner:am},mrel:{mord:If,mop:If,mopen:If,minner:If},mopen:{},mclose:{mop:ba,mbin:am,mrel:If,minner:ba},mpunct:{mord:ba,mop:ba,mrel:If,mopen:ba,mclose:ba,mpunct:ba,minner:ba},minner:{mord:ba,mop:ba,mbin:am,mrel:If,mopen:ba,mpunct:ba,minner:ba}},VWt={mord:{mop:ba},mop:{mord:ba,mop:ba},mbin:{},mrel:{},mopen:{},mclose:{mop:ba},mpunct:{},minner:{mop:ba}},GRe={},OI={},_I={};function ar(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 U=m.classes[0],y=g.classes[0];U==="mbin"&&GWt.has(y)?m.classes[0]="mord":y==="mbin"&&HWt.has(U)&&(g.classes[0]="mord")},{node:d},f,p),Zq(a,(g,m)=>{var U,y,b=Qq(m),v=Qq(g),w=b&&v?g.hasClass("mtight")?(U=VWt[b])==null?void 0:U[v]:(y=zWt[b])==null?void 0:y[v]:null;if(w)return zRe(w,u)},{node:d},f,p),a},Zq=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()},WRe=function(e){return e instanceof s9||e instanceof h_||e instanceof o9&&e.hasClass("enclosing")?e:null},Jq=function(e,r){var n=WRe(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},Qq=function(e,r){if(!e)return null;r&&(e=Jq(e,r));var n=e.classes[0];return qWt[n]||null},zT=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return zt(r.concat(n))},Ui=function(e,r,n){if(!e)return zt();if(OI[e.type]){var i=OI[e.type](e,r);if(n&&r.size!==n.size){i=zt(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 kE(t,e){var r=zt(["base"],t,e),n=zt(["strut"]);return n.style.height=Kt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Kt(-r.depth)),r.children.unshift(n),r}function ej(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=$s(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o0&&(a.push(kE(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push(kE(s,e));var u;r?(u=kE($s(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=zt(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Kt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Kt(-h.depth))}return h}function qRe(t){return new s9(t)}class jt{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=Qg(this.classes));for(var n=0;n0&&(e+=' class ="'+Qo(Qg(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class gs{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qo(this.toText())}toText(){return this.text}}class jRe{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",Kt(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var jWt=new Set(["\\imath","\\jmath"]),YWt=new Set(["mrow","mtable"]),Wu=function(e,r,n){return ha[r][e]&&ha[r][e].replace&&e.charCodeAt(0)!==55349&&!($Re.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ha[r][e].replace),new gs(e)},Cte=function(e){return e.length===1?e[0]:new jt("mrow",e)},XWt={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"},kte=(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=XWt[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(jWt.has(a))return null;if(ha[n][a]){var s=ha[n][a].replace;s&&(a=s)}var o=Kq[r].fontName;return xte(a,o,n)?Kq[r].variant:null};function IF(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof gs&&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 gs&&r.text===","}else return!1}var cu=function(e,r,n){if(e.length===1){var i=Ni(e[0],r);return n&&i instanceof jt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o=1&&(s.type==="mn"||IF(s))){var u=l.children[0];u instanceof jt&&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 gs&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof gs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},r1=function(e,r,n){return Cte(cu(e,r,n))},Ni=function(e,r){if(!e)return new jt("mrow");if(_I[e.type])return _I[e.type](e,r);throw new Gt("Got group of unknown type: '"+e.type+"'")};function kpe(t,e,r,n,i){var a=cu(t,r),s;a.length===1&&a[0]instanceof jt&&YWt.has(a[0].type)?s=a[0]:s=new jt("mrow",a);var o=new jt("annotation",[new gs(e)]);o.setAttribute("encoding","application/x-tex");var l=new jt("semantics",[s,o]),u=new jt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return zt([h],[u])}var KWt=[[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]],Spe=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Epe=function(e,r){return r.size<2?e:KWt[e-1][r.size-1]};class Yf{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||Yf.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=Spe[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 Yf(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Epe(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:Spe[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=Epe(Yf.BASESIZE,e);return this.size===r&&this.textSize===Yf.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!==Yf.BASESIZE?["sizing","reset-size"+this.size,"size"+Yf.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=NWt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Yf.BASESIZE=6;var YRe=function(e){return new Yf({style:e.displayMode?pn.DISPLAY:pn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},XRe=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=zt(n,[e])}return e},ZWt=function(e,r,n){var i=YRe(n),a;if(n.output==="mathml")return kpe(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=ej(e,i);a=zt(["katex"],[s])}else{var o=kpe(e,r,i,n.displayMode,!1),l=ej(e,i);a=zt(["katex"],[o,l])}return XRe(a,n)},JWt=function(e,r,n){var i=YRe(n),a=ej(e,i),s=zt(["katex"],[a]);return XRe(s,n)},QWt={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":"="},p_=function(e){var r=new jt("mo",[new gs(QWt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},eqt={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]},tqt=new Set(["widehat","widecheck","widetilde","utilde"]),g_=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(tqt.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 e1(d),m=new B0([g],{width:"100%",height:Kt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:t1([],[m],r),minWidth:0,height:f}}else{var U=[],y=eqt[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[b,v,w]=y,T=w/1e3,k=b.length,C,S;if(k===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');C=["hide-tail"],S=[y[3]]}else if(k===2)C=["halfarrow-left","halfarrow-right"],S=["xMinYMin","xMaxYMin"];else if(k===3)C=["brace-left","brace-center","brace-right"],S=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+k+" children.");for(var E=0;E0&&(i.style.minWidth=Kt(a)),i},rqt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=zt(["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 Gq({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new Gq({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new B0(u,{width:"100%",height:Kt(o)});s=t1([],[h],a)}return s.height=o,s.style.height=Kt(o),s},nqt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},iqt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function aqt(t){return t in nqt}function wn(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 m_(t){var e=U_(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 U_(t){return t&&(t.type==="atom"||iqt.hasOwnProperty(t.type))?t:null}var KRe=t=>{if(t instanceof ru)return t;if(IWt(t)&&t.children.length===1)return KRe(t.children[0])},Ste=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=wn(t.base,"accent"),r=n.base,t.base=r,i=LWt(Ui(t,e)),t.base=n):(n=wn(t,"accent"),r=n.base);var a=Ui(r,e.havingCrampedStyle()),s=n.isShifty&&up(r),o=0;if(s){var l,u;o=(l=(u=KRe(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=g_(n,e),f=gi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Kt(2*o)+")",marginLeft:Kt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=HRe("vec",e),g=VRe.vec[1]):(p=f_({mode:n.mode,text:n.label},e,"textord"),p=RWt(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=zt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var U=o;m||(U-=g/2),f.style.left=Kt(U),n.label==="\\textcircled"&&(f.style.top=".2em"),f=gi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=zt(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},ZRe=(t,e)=>{var r=t.isStretchy?p_(t.label):new jt("mo",[Wu(t.label,t.mode)]),n=new jt("mover",[Ni(t.base,e),r]);return n.setAttribute("accent","true"),n},sqt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ar({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=PI(e[0]),n=!sqt.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:Ste,mathmlBuilder:ZRe});ar({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:Ste,mathmlBuilder:ZRe});ar({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=Ui(t.base,e),n=g_(t,e),i=t.label==="\\utilde"?.12:0,a=gi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return zt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=p_(t.label),n=new jt("munder",[Ni(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var SE=t=>{var e=new jt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ar({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=o4(Ui(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=o4(Ui(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=g_(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=gi({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=gi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return zt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=p_(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=SE(Ni(t.body,e));if(t.below){var a=SE(Ni(t.below,e));n=new jt("munderover",[r,a,i])}else n=new jt("mover",[r,i])}else if(t.below){var s=SE(Ni(t.below,e));n=new jt("munder",[r,s])}else n=SE(),n=new jt("mover",[r,n]);return n}});function JRe(t,e){var r=$s(t.body,e,!0);return zt([t.mclass],r,e)}function QRe(t,e){var r,n=cu(t.body,e);return t.mclass==="minner"?r=new jt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new jt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new jt("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}ar({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:ps(i),isCharacterBox:up(i)}},htmlBuilder:JRe,mathmlBuilder:QRe});var y_=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"};ar({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:y_(e[0]),body:ps(e[1]),isCharacterBox:up(e[1])}}});ar({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=y_(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:ps(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:up(l)}},htmlBuilder:JRe,mathmlBuilder:QRe});ar({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:y_(e[0]),body:ps(e[0])}},htmlBuilder(t,e){var r=$s(t.body,e,!0),n=zt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=cu(t.body,e),n=new jt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var oqt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Ape=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Mpe=t=>t.type==="textord"&&t.text==="@",lqt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function cqt(t,e,r){var n=oqt[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 uqt(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;aAV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;pAV=|." after @',s[l]);var g=cqt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=Ape()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var U=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:U,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ar({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=o4(Ui(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Kt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new jt("mrow",[Ni(t.label,e)]);return r=new jt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new jt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});ar({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=o4(Ui(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new jt("mrow",[Ni(t.fragment,e)])}});ar({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=wn(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 eLe=(t,e)=>{var r=$s(t.body,e.withColor(t.color),!1);return dp(r)},tLe=(t,e)=>{var r=cu(t.body,e.withColor(t.color)),n=new jt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};ar({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=wn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:ps(i)}},htmlBuilder:eLe,mathmlBuilder:tLe});ar({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=wn(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:eLe,mathmlBuilder:tLe});ar({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&&wn(i,"size").value}},htmlBuilder(t,e){var r=zt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Kt(wa(t.size,e)))),r},mathmlBuilder(t,e){var r=new jt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Kt(wa(t.size,e)))),r}});var tj={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},rLe=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Gt("Expected a control sequence",t);return e},hqt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},nLe=(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)};ar({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(tj[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=tj[n.text]),wn(e.parseFunction(),"internal");throw new Gt("Invalid token after macro prefix",n)}});ar({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===tj[r]),{type:"internal",mode:e.mode}}});ar({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=rLe(e.gullet.popToken());e.gullet.consumeSpaces();var i=hqt(e);return nLe(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});ar({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=rLe(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return nLe(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var tx=function(e,r,n){var i=ha.math[e]&&ha.math[e].replace,a=xte(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},Ete=function(e,r,n,i){var a=n.havingBaseStyle(r),s=zt(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},iLe=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=Kt(a),e.height-=a,e.depth+=a},dqt=function(e,r,n,i,a,s){var o=Tl(e,"Main-Regular",a,i),l=Ete(o,r,i,s);return iLe(l,i,r),l},fqt=function(e,r,n,i){return Tl(e,"Size"+r+"-Regular",n,i)},aLe=function(e,r,n,i,a,s){var o=fqt(e,r,a,i),l=Ete(zt(["delimsizing","size"+r],[o],i),pn.TEXT,i,s);return n&&iLe(l,i,pn.TEXT),l},NF=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=zt(["delimsizinginner",i],[zt([],[Tl(e,r,n)])]);return{type:"elem",elem:a}},DF=function(e,r,n){var i=Id["Size4-Regular"][e.charCodeAt(0)]?Id["Size4-Regular"][e.charCodeAt(0)][4]:Id["Size1-Regular"][e.charCodeAt(0)][4],a=new e1("inner",TWt(e,Math.round(1e3*r))),s=new B0([a],{width:Kt(i),height:Kt(r),style:"width:"+Kt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=t1([],[s],n);return o.height=r,o.style.height=Kt(r),o.style.width=Kt(i),{type:"elem",elem:o}},rj=.008,EE={type:"kern",size:-1*rj},pqt=new Set(["|","\\lvert","\\rvert","\\vert"]),gqt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),sLe=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"):pqt.has(e)?(u="∣",d="vert",f=333):gqt.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=tx(o,p,a),m=g.height+g.depth,U=tx(u,p,a),y=U.height+U.depth,b=tx(h,p,a),v=b.height+b.depth,w=0,T=1;if(l!==null){var k=tx(l,p,a);w=k.height+k.depth,T=2}var C=m+v+w,S=Math.max(0,Math.ceil((r-C)/(T*y))),E=C+S*T*y,A=i.fontMetrics().axisHeight;n&&(A*=i.sizeMultiplier);var R=E/2-A,_=[];if(d.length>0){var N=E-m-v,L=Math.round(E*1e3),I=CWt(d,Math.round(N*1e3)),P=new e1(d,I),O=Kt(f/1e3),D=Kt(L/1e3),B=new B0([P],{width:O,height:D,viewBox:"0 0 "+f+" "+L}),F=t1([],[B],i);F.height=L/1e3,F.style.width=O,F.style.height=D,_.push({type:"elem",elem:F})}else{if(_.push(NF(h,p,a)),_.push(EE),l===null){var z=E-m-v+2*rj;_.push(DF(u,z,i))}else{var $=(E-m-v-w)/2+2*rj;_.push(DF(u,$,i)),_.push(EE),_.push(NF(l,p,a)),_.push(EE),_.push(DF(u,$,i))}_.push(EE),_.push(NF(o,p,a))}var V=i.havingBaseStyle(pn.TEXT),H=gi({positionType:"bottom",positionData:R,children:_});return Ete(zt(["delimsizing","mult"],[H],V),pn.TEXT,i,s)},OF=80,_F=.08,PF=function(e,r,n,i,a){var s=wWt(e,i,n),o=new e1(e,s),l=new B0([o],{width:"400em",height:Kt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return t1(["hide-tail"],[l],a)},mqt=function(e,r){var n=r.havingBaseSizing(),i=hLe("\\surd",e*n.sizeMultiplier,uLe,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+OF,e<1?a=1:e<1.4&&(a=.7),l=(1+s+_F)/a,u=(1+s)/a,o=PF("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+OF)*iw[i.size],u=(iw[i.size]+s)/a,l=(iw[i.size]+s+_F)/a,o=PF("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+_F,u=e+s,h=Math.floor(1e3*e+s)+OF,o=PF("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Kt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},oLe=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Uqt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),lLe=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),iw=[0,1.2,1.8,2.4,3],cLe=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),oLe.has(e)||lLe.has(e))return aLe(e,r,!1,n,i,a);if(Uqt.has(e))return sLe(e,iw[r],!1,n,i,a);throw new Gt("Illegal delimiter: '"+e+"'")},yqt=[{type:"small",style:pn.SCRIPTSCRIPT},{type:"small",style:pn.SCRIPT},{type:"small",style:pn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],bqt=[{type:"small",style:pn.SCRIPTSCRIPT},{type:"small",style:pn.SCRIPT},{type:"small",style:pn.TEXT},{type:"stack"}],uLe=[{type:"small",style:pn.SCRIPTSCRIPT},{type:"small",style:pn.SCRIPT},{type:"small",style:pn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],vqt=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.")},hLe=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]},nj=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;lLe.has(e)?o=yqt:oLe.has(e)?o=uLe:o=bqt;var l=hLe(e,r,o,i);return l.type==="small"?dqt(e,l.style,n,i,a,s):l.type==="large"?aLe(e,l.size,n,i,a,s):sLe(e,r,n,i,a,s)},BF=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 nj(e,d,!0,i,a,s)},Rpe={"\\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}},xqt=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 Lpe(t){return"isMiddle"in t}function b_(t,e){var r=U_(t);if(r&&xqt.has(r.text))return r;throw r?new Gt("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new Gt("Invalid delimiter type '"+t.type+"'",t)}ar({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=b_(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:Rpe[t.funcName].size,mclass:Rpe[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?zt([t.mclass]):cLe(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Wu(t.delim,t.mode));var r=new jt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Kt(iw[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function Ipe(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ar({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:b_(e[0],t).text,color:r}}});ar({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=b_(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=wn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{Ipe(t);for(var r=$s(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s{Ipe(t);var r=cu(t.body,e);if(t.left!=="."){var n=new jt("mo",[Wu(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new jt("mo",[Wu(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return Cte(r)}});ar({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=b_(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;return t.delim==="."?r=zT(e,[]):(r=cLe(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?Wu("|","text"):Wu(t.delim,t.mode),n=new jt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var v_=(t,e)=>{var r=o4(Ui(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=up(t.body);if(n==="sout")a=zt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=wa({number:.6,unit:"pt"},e),u=wa({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Kt(d/2+l);var f=Math.floor(1e3*d*i),p=vWt(f),g=new B0([new e1("phase",p)],{width:"400em",height:Kt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=t1(["hide-tail"],[g],e),a.style.height=Kt(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,U,y=0;/box/.test(n)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:y),U=m):n==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,U=Math.max(0,.25-r.depth)):(m=o?.2:0,U=m),a=rqt(r,n,m,U,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Kt(y)):n==="angl"&&y!==.049&&(a.style.borderTopWidth=Kt(y),a.style.borderRightWidth=Kt(y)),s=r.depth+U,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=gi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var v=/cancel|phase/.test(n)?["svg-align"]:[];b=gi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:v}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!o?zt(["mord","cancel-lap"],[b],e):zt(["mord"],[b],e)},x_=(t,e)=>{var r,n=new jt(t.label.includes("colorbox")?"mpadded":"menclose",[Ni(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: "+Kt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};ar({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=wn(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:v_,mathmlBuilder:x_});ar({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=wn(e[0],"color-token").color,s=wn(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:v_,mathmlBuilder:x_});ar({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]}}});ar({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:v_,mathmlBuilder:x_});ar({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:v_,mathmlBuilder:x_});ar({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 dLe={};function ff(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.")},wqt=new Set(["gather","gather*"]);function Ate(t){if(!t.includes("ed"))return!t.includes("*")}function A1(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],U=[],y=[],b=l!=null?[]:void 0;function v(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){b&&(t.gullet.macros.get("\\df@tag")?(b.push(t.subparse([new Zc("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(v(),y.push(Npe(t));;){var T=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var k={type:"ordgroup",mode:t.mode,body:T};r&&(k={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[k]}),g.push(k);var C=t.fetch().text;if(C==="&"){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(C==="\\end"){w(),g.length===1&&k.type==="styling"&&k.body.length===1&&k.body[0].type==="ordgroup"&&k.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),y.length0&&(v+=.25),u.push({pos:v,isDashed:Te[re]})}for(w(s[0]),n=0;n0&&(R+=b,CTe))for(n=0;n=o)){var Z=void 0;if(i>0||e.hskipBeforeAndAfter){var J,ne;Z=(J=(ne=V)==null?void 0:ne.pregap)!=null?J:f,Z!==0&&(I=zt(["arraycolsep"],[]),I.style.width=Kt(Z),L.push(I))}var ie=[];for(n=0;n0){for(var ge=s4("hline",r,h),ze=s4("hdashline",r,h),xe=[{type:"elem",elem:we,shift:0}];u.length>0;){var Ee=u.pop(),qe=Ee.pos-_;Ee.isDashed?xe.push({type:"elem",elem:ze,shift:qe}):xe.push({type:"elem",elem:ge,shift:qe})}we=gi({positionType:"individualShift",children:xe})}if(O.length===0)return zt(["mord"],[we],r);var le=gi({positionType:"individualShift",children:O}),pe=zt(["tag"],[le],r);return dp([we,pe])},Tqt={c:"center ",l:"left ",r:"right "},gf=function(e,r){for(var n=[],i=new jt("mtd",[],["mtr-glue"]),a=new jt("mtd",[],["mml-eqn-num"]),s=0;s0){var g=e.cols,m="",U=!1,y=0,b=g.length;g[0].type==="separator"&&(f+="top ",y=1),g[g.length-1].type==="separator"&&(f+="bottom ",b-=1);for(var v=y;v0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var A=1;A0&&p&&(U=1),n[g]={type:"align",align:m,pregap:U,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};ff({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=U_(e[0]),n=r?[e[0]]:wn(e[0],"ordgroup").body,i=n.map(function(s){var o=m_(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 Gt("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return A1(t.parser,a,Mte(t.envName))},htmlBuilder:pf,mathmlBuilder:gf});ff({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 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=A1(t.parser,n,Mte(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:pf,mathmlBuilder:gf});ff({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=A1(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=U_(e[0]),n=r?[e[0]]:wn(e[0],"ordgroup").body,i=n.map(function(o){var l=m_(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Gt("Unknown column alignment: "+u,o)});if(i.length>1)throw new Gt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=A1(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new Gt("{subarray} can contain only one column");return s},htmlBuilder:pf,mathmlBuilder:gf});ff({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=A1(t.parser,e,Mte(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:pLe,htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){wqt.has(t.envName)&&w_(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Ate(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return A1(t.parser,e,"display")},htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:pLe,htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){w_(t);var e={autoTag:Ate(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return A1(t.parser,e,"display")},htmlBuilder:pf,mathmlBuilder:gf});ff({type:"array",names:["CD"],props:{numArgs:0},handler(t){return w_(t),uqt(t.parser)},htmlBuilder:pf,mathmlBuilder:gf});Ce("\\nonumber","\\gdef\\@eqnsw{0}");Ce("\\notag","\\nonumber");ar({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 Dpe=dLe;ar({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 Ui(t.body,n)},mLe=(t,e)=>{var r=t.font,n=e.withFont(r);return Ni(t.body,n)},Ope={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ar({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=PI(e[0]),a=n;return a in Ope&&(a=Ope[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:gLe,mathmlBuilder:mLe});ar({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:y_(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:up(n)}}});ar({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:gLe,mathmlBuilder:mLe});var Cqt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=Ui(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 U;if(h){var b=e.fontMetrics().axisHeight;p-s.depth-(b+.5*d){var r=new jt("mfrac",[Ni(t.numer,e),Ni(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=wa(t.barSize,e);r.setAttribute("linethickness",Kt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new jt("mo",[new gs(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new jt("mo",[new gs(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return Cte(i)}return r},ULe=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};ar({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"),ULe({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:Cqt,mathmlBuilder:kqt});ar({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 _pe=["display","text","script","scriptscript"],Ppe=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};ar({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=PI(e[0]),s=a.type==="atom"&&a.family==="open"?Ppe(a.text):null,o=PI(e[1]),l=o.type==="atom"&&o.family==="close"?Ppe(o.text):null,u=wn(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=wn(p.body[0],"textord");f=_pe[Number(g.text)]}}else p=wn(p,"textord"),f=_pe[Number(p.text)];return ULe({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});ar({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:wn(e[0],"size").value,token:i}}});ar({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=wn(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 yLe=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Ui(t.sup,e.havingStyle(r.sup()),e):Ui(t.sub,e.havingStyle(r.sub()),e),i=wn(t.base,"horizBrace")):i=wn(t,"horizBrace");var a=Ui(i.base,e.havingBaseStyle(pn.DISPLAY)),s=g_(i,e),o;if(i.isOver?o=gi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=gi({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=zt(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=gi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=gi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return zt(["minner",i.isOver?"mover":"munder"],[o],e)},Sqt=(t,e)=>{var r=p_(t.label);return new jt(t.isOver?"mover":"munder",[Ni(t.base,e),r])};ar({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:yLe,mathmlBuilder:Sqt});ar({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=wn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:ps(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=$s(t.body,e,!1);return $Wt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=r1(t.body,e);return r instanceof jt||(r=new jt("mrow",[r])),r.setAttribute("href",t.href),r}});ar({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=wn(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=wn(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=$s(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=zt(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)=>r1(t.body,e)});ar({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:ps(e[0]),mathml:ps(e[1])}},htmlBuilder:(t,e)=>{var r=$s(t.html,e,!1);return dp(r)},mathmlBuilder:(t,e)=>r1(t.mathml,e)});var $F=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(!DRe(n))throw new Gt("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};ar({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=wn(r[0],"raw").string,u=l.split(","),h=0;h{var r=wa(t.height,e),n=0;t.totalheight.number>0&&(n=wa(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=wa(t.width,e));var a={height:Kt(r+n)};i>0&&(a.width=Kt(i)),n>0&&(a.verticalAlign=Kt(-n));var s=new AWt(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new jt("mglyph",[]);r.setAttribute("alt",t.alt);var n=wa(t.height,e),i=0;if(t.totalheight.number>0&&(i=wa(t.totalheight,e)-n,r.setAttribute("valign",Kt(-i))),r.setAttribute("height",Kt(n+i)),t.width.number>0){var a=wa(t.width,e);r.setAttribute("width",Kt(a))}return r.setAttribute("src",t.src),r}});ar({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=wn(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 zRe(t.dimension,e)},mathmlBuilder(t,e){var r=wa(t.dimension,e);return new jRe(r)}});ar({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=zt([],[Ui(t.body,e)]),r=zt(["inner"],[r],e)):r=zt(["inner"],[Ui(t.body,e)]);var n=zt(["fix"],[]),i=zt([t.alignment],[r,n],e),a=zt(["strut"]);return a.style.height=Kt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Kt(-i.depth)),i.children.unshift(a),i=zt(["thinbox"],[i],e),zt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new jt("mpadded",[Ni(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}});ar({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}}});ar({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Gt("Mismatched "+t.funcName)}});var Bpe=(t,e)=>{switch(e.style.size){case pn.DISPLAY.size:return t.display;case pn.TEXT.size:return t.text;case pn.SCRIPT.size:return t.script;case pn.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};ar({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:ps(e[0]),text:ps(e[1]),script:ps(e[2]),scriptscript:ps(e[3])}},htmlBuilder:(t,e)=>{var r=Bpe(t,e),n=$s(r,e,!1);return dp(n)},mathmlBuilder:(t,e)=>{var r=Bpe(t,e);return r1(r,e)}});var bLe=(t,e,r,n,i,a,s)=>{t=zt([],[t]);var o=r&&up(r),l,u;if(e){var h=Ui(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Ui(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=gi({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Kt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Kt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=gi({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Kt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=gi({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Kt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var U=[f];if(l&&a!==0&&!o){var y=zt(["mspace"],[],n);y.style.marginRight=Kt(a),U.unshift(y)}return zt(["mop","op-limits"],U,n)},vLe=new Set(["\\smallint"]),c9=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=wn(t.base,"op"),i=!0):a=wn(t,"op");var s=e.style,o=!1;s.size===pn.DISPLAY.size&&a.symbol&&!vLe.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=Tl(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=HRe(d+"Size"+(o?"2":"1"),e);l=gi({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=$s(a.body,e,!0);p.length===1&&p[0]instanceof ru?(l=p[0],l.classes[0]="mop"):l=zt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new jt("mo",[Wu(t.name,t.mode)]),vLe.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new jt("mo",cu(t.body,e));else{r=new jt("mi",[new gs(t.name.slice(1))]);var n=new jt("mo",[Wu("⁡","text")]);t.parentIsSupSub?r=new jt("mrow",[r,n]):r=qRe([r,n])}return r},Eqt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ar({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=Eqt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:c9,mathmlBuilder:Uk});ar({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:ps(n)}},htmlBuilder:c9,mathmlBuilder:Uk});var Aqt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ar({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:c9,mathmlBuilder:Uk});ar({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:c9,mathmlBuilder:Uk});ar({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=Aqt[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:c9,mathmlBuilder:Uk});var xLe=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=wn(t.base,"operatorname"),i=!0):a=wn(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=$s(o,e.withFont("mathrm"),!0),u=0;u{for(var r=cu(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new gs(o)]}var l=new jt("mi",r);l.setAttribute("mathvariant","normal");var u=new jt("mo",[Wu("⁡","text")]);return t.parentIsSupSub?new jt("mrow",[l,u]):qRe([l,u])};ar({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:ps(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:xLe,mathmlBuilder:Mqt});Ce("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");N5({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?dp($s(t.body,e,!1)):zt(["mord"],$s(t.body,e,!0),e)},mathmlBuilder(t,e){return r1(t.body,e,!0)}});ar({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=Ui(t.body,e.havingCrampedStyle()),n=s4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=gi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return zt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new jt("mo",[new gs("‾")]);r.setAttribute("stretchy","true");var n=new jt("mover",[Ni(t.body,e),r]);return n.setAttribute("accent","true"),n}});ar({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:ps(n)}},htmlBuilder:(t,e)=>{var r=$s(t.body,e.withPhantom(),!1);return dp(r)},mathmlBuilder:(t,e)=>{var r=cu(t.body,e);return new jt("mphantom",r)}});Ce("\\hphantom","\\smash{\\phantom{#1}}");ar({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=zt(["inner"],[Ui(t.body,e.withPhantom())]),n=zt(["fix"],[]);return zt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=cu(ps(t.body),e),n=new jt("mphantom",r),i=new jt("mpadded",[n]);return i.setAttribute("width","0px"),i}});ar({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=wn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Ui(t.body,e),n=wa(t.dy,e);return gi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new jt("mpadded",[Ni(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});ar({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});ar({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=wn(e[0],"size"),s=wn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&wn(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=zt(["mord","rule"],[],e),n=wa(t.width,e),i=wa(t.height,e),a=t.shift?wa(t.shift,e):0;return r.style.borderRightWidth=Kt(n),r.style.borderTopWidth=Kt(i),r.style.bottom=Kt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=wa(t.width,e),n=wa(t.height,e),i=t.shift?wa(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new jt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Kt(r)),s.setAttribute("height",Kt(n));var o=new jt("mpadded",[s]);return i>=0?o.setAttribute("height",Kt(i)):(o.setAttribute("height",Kt(i)),o.setAttribute("depth",Kt(-i))),o.setAttribute("voffset",Kt(i)),o}});function wLe(t,e,r){for(var n=$s(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return wLe(t.body,r,e)};ar({type:"sizing",names:$pe,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:$pe.indexOf(n)+1,body:a}},htmlBuilder:Rqt,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=cu(t.body,r),i=new jt("mstyle",n);return i.setAttribute("mathsize",Kt(r.sizeMultiplier)),i}});ar({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]&&wn(r[0],"ordgroup");if(s)for(var o,l=0;l{var r=zt([],[Ui(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 zt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new jt("mpadded",[Ni(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});ar({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=Ui(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=o4(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=Kt(h);var p=gi({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(pn.SCRIPTSCRIPT),m=Ui(t.index,g,e),U=.6*(p.height-p.depth),y=gi({positionType:"shift",positionData:-U,children:[{type:"elem",elem:m}]}),b=zt(["root"],[y]);return zt(["mord","sqrt"],[b,p],e)}else return zt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new jt("mroot",[Ni(r,e),Ni(n,e)]):new jt("msqrt",[Ni(r,e)])}});var ij={display:pn.DISPLAY,text:pn.TEXT,script:pn.SCRIPT,scriptscript:pn.SCRIPTSCRIPT};function Lqt(t){return t in ij}ar({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(!Lqt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=ij[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),wLe(t.body,n,e)},mathmlBuilder(t,e){var r=ij[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=cu(t.body,n),a=new jt("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 Iqt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===pn.DISPLAY.size||n.alwaysHandleSupSub);return i?c9:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===pn.DISPLAY.size||n.limits);return a?xLe:null}else{if(n.type==="accent")return up(n.base)?Ste:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?yLe:null}else return null}else return null};N5({type:"supsub",htmlBuilder(t,e){var r=Iqt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=Ui(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&up(n);if(i){var p=e.havingStyle(e.style.sup());o=Ui(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Ui(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===pn.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var U=e.sizeMultiplier,y=Kt(.5/u.ptPerEm/U),b=null;if(l){var v=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof ru||v){var w;b=Kt(-((w=s.italic)!=null?w:0))}}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,C=4*k;if(h-o.depth-(l.height-d)0&&(h+=S,d-=S)}var E=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:o,shift:-h,marginRight:y}];T=gi({positionType:"individualShift",children:E})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var A=[{type:"elem",elem:l,marginLeft:b,marginRight:y}];T=gi({positionType:"shift",positionData:d,children:A})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),T=gi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var R=Qq(s,"right")||"mord";return zt([R],[s,zt(["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=[Ni(t.base,e)];t.sub&&a.push(Ni(t.sub,e)),t.sup&&a.push(Ni(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===pn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===pn.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===pn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===pn.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===pn.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===pn.DISPLAY)?s="mover":s="msup"}return new jt(s,a)}});N5({type:"atom",htmlBuilder(t,e){return wte(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new jt("mo",[Wu(t.text,t.mode)]);if(t.family==="bin"){var n=kte(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 TLe={mi:"italic",mn:"normal",mtext:"normal"};N5({type:"mathord",htmlBuilder(t,e){return f_(t,e,"mathord")},mathmlBuilder(t,e){var r=new jt("mi",[Wu(t.text,t.mode,e)]),n=kte(t,e)||"italic";return n!==TLe[r.type]&&r.setAttribute("mathvariant",n),r}});N5({type:"textord",htmlBuilder(t,e){return f_(t,e,"textord")},mathmlBuilder(t,e){var r=Wu(t.text,t.mode,e),n=kte(t,e)||"normal",i;return t.mode==="text"?i=new jt("mtext",[r]):/[0-9]/.test(t.text)?i=new jt("mn",[r]):t.text==="\\prime"?i=new jt("mo",[r]):i=new jt("mi",[r]),n!==TLe[i.type]&&i.setAttribute("mathvariant",n),i}});var FF={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},zF={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};N5({type:"spacing",htmlBuilder(t,e){if(zF.hasOwnProperty(t.text)){var r=zF[t.text].className||"";if(t.mode==="text"){var n=f_(t,e,"textord");return n.classes.push(r),n}else return zt(["mspace",r],[wte(t.text,t.mode,e)],e)}else{if(FF.hasOwnProperty(t.text))return zt(["mspace",FF[t.text]],[],e);throw new Gt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(zF.hasOwnProperty(t.text))r=new jt("mtext",[new gs(" ")]);else{if(FF.hasOwnProperty(t.text))return new jt("mspace");throw new Gt('Unknown type of space "'+t.text+'"')}return r}});var Fpe=()=>{var t=new jt("mtd",[]);return t.setAttribute("width","50%"),t};N5({type:"tag",mathmlBuilder(t,e){var r=new jt("mtable",[new jt("mtr",[Fpe(),new jt("mtd",[r1(t.body,e)]),Fpe(),new jt("mtd",[r1(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var zpe={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Vpe={"\\textbf":"textbf","\\textmd":"textmd"},Nqt={"\\textit":"textit","\\textup":"textup"},Hpe=(t,e)=>{var r=t.font;if(r){if(zpe[r])return e.withTextFontFamily(zpe[r]);if(Vpe[r])return e.withTextFontWeight(Vpe[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(Nqt[r])};ar({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:ps(i),font:n}},htmlBuilder(t,e){var r=Hpe(t,e),n=$s(t.body,r,!0);return zt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=Hpe(t,e);return r1(t.body,r)}});ar({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=Ui(t.body,e),n=s4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=gi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return zt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new jt("mo",[new gs("‾")]);r.setAttribute("stretchy","true");var n=new jt("munder",[Ni(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});ar({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=Ui(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return gi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new jt("mpadded",[Ni(t.body,e)],["vcenter"]);return new jt("mrow",[r])}});ar({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=Gpe(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),fg=GRe,CLe=`[ \r + ]`,Dqt="\\\\[a-zA-Z@]+",Oqt="\\\\[^\uD800-\uDFFF]",_qt="("+Dqt+")"+CLe+"*",Pqt=`\\\\( |[ \r ]+ -?)[ \r ]*`,QU="[̀-ͯ]",gUt=new RegExp(QU+"+$"),mUt="("+hLe+"+)|"+(pUt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(QU+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(QU+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+fUt)+("|"+dUt+")");let Dpe=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(mUt,"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 Zc("EOF",new fc(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Wt("Unexpected character: '"+e[r]+"'",new Zc(e[r],new fc(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(` -`,this.tokenRegex.lastIndex);return s===-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=s+1,this.lex()}return new Zc(i,new fc(this,r,this.tokenRegex.lastIndex))}};class yUt{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 Wt("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 s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var vUt=eLe;ke("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});ke("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});ke("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});ke("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});ke("\\@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}});ke("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");ke("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Ppe={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};ke("\\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 Wt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=Ppe[e.text],n==null||n>=r)throw new Wt("Invalid base-"+r+" digit "+e.text);for(var i;(i=Ppe[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new Wt("\\newcommand's first argument must be a macro name");var s=i[0].text,a=t.isDefined(s);if(a&&!e)throw new Wt("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!a&&!r)throw new Wt("\\renewcommand{"+s+"} when command "+s+" 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 Wt("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return a&&n||t.macros.set(s,{tokens:i,numArgs:o}),""};ke("\\newcommand",t=>Tte(t,!1,!0,!1));ke("\\renewcommand",t=>Tte(t,!0,!1,!1));ke("\\providecommand",t=>Tte(t,!0,!0,!0));ke("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});ke("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});ke("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),dg[r],ds.math[r],ds.text[r]),""});ke("\\bgroup","{");ke("\\egroup","}");ke("~","\\nobreakspace");ke("\\lq","`");ke("\\rq","'");ke("\\aa","\\r a");ke("\\AA","\\r A");ke("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");ke("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");ke("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");ke("ℬ","\\mathscr{B}");ke("ℰ","\\mathscr{E}");ke("ℱ","\\mathscr{F}");ke("ℋ","\\mathscr{H}");ke("ℐ","\\mathscr{I}");ke("ℒ","\\mathscr{L}");ke("ℳ","\\mathscr{M}");ke("ℛ","\\mathscr{R}");ke("ℭ","\\mathfrak{C}");ke("ℌ","\\mathfrak{H}");ke("ℨ","\\mathfrak{Z}");ke("\\Bbbk","\\Bbb{k}");ke("\\llap","\\mathllap{\\textrm{#1}}");ke("\\rlap","\\mathrlap{\\textrm{#1}}");ke("\\clap","\\mathclap{\\textrm{#1}}");ke("\\mathstrut","\\vphantom{(}");ke("\\underbar","\\underline{\\text{#1}}");ke("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');ke("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");ke("\\ne","\\neq");ke("≠","\\neq");ke("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");ke("∉","\\notin");ke("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");ke("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");ke("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");ke("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");ke("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");ke("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");ke("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");ke("⟂","\\perp");ke("‼","\\mathclose{!\\mkern-0.8mu!}");ke("∌","\\notni");ke("⌜","\\ulcorner");ke("⌝","\\urcorner");ke("⌞","\\llcorner");ke("⌟","\\lrcorner");ke("©","\\copyright");ke("®","\\textregistered");ke("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');ke("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');ke("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');ke("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');ke("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");ke("⋮","\\vdots");ke("\\varGamma","\\mathit{\\Gamma}");ke("\\varDelta","\\mathit{\\Delta}");ke("\\varTheta","\\mathit{\\Theta}");ke("\\varLambda","\\mathit{\\Lambda}");ke("\\varXi","\\mathit{\\Xi}");ke("\\varPi","\\mathit{\\Pi}");ke("\\varSigma","\\mathit{\\Sigma}");ke("\\varUpsilon","\\mathit{\\Upsilon}");ke("\\varPhi","\\mathit{\\Phi}");ke("\\varPsi","\\mathit{\\Psi}");ke("\\varOmega","\\mathit{\\Omega}");ke("\\substack","\\begin{subarray}{c}#1\\end{subarray}");ke("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");ke("\\boxed","\\fbox{$\\displaystyle{#1}$}");ke("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");ke("\\implies","\\DOTSB\\;\\Longrightarrow\\;");ke("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");ke("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");ke("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var $pe={",":"\\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"},bUt=new Set(["bin","rel"]);ke("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in $pe?e=$pe[r]:(r.slice(0,4)==="\\not"||r in ds.math&&bUt.has(ds.math[r].group))&&(e="\\dotsb"),e});var Cte={")":!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};ke("\\dotso",function(t){var e=t.future().text;return e in Cte?"\\ldots\\,":"\\ldots"});ke("\\dotsc",function(t){var e=t.future().text;return e in Cte&&e!==","?"\\ldots\\,":"\\ldots"});ke("\\cdots",function(t){var e=t.future().text;return e in Cte?"\\@cdots\\,":"\\@cdots"});ke("\\dotsb","\\cdots");ke("\\dotsm","\\cdots");ke("\\dotsi","\\!\\cdots");ke("\\dotsx","\\ldots\\,");ke("\\DOTSI","\\relax");ke("\\DOTSB","\\relax");ke("\\DOTSX","\\relax");ke("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");ke("\\,","\\tmspace+{3mu}{.1667em}");ke("\\thinspace","\\,");ke("\\>","\\mskip{4mu}");ke("\\:","\\tmspace+{4mu}{.2222em}");ke("\\medspace","\\:");ke("\\;","\\tmspace+{5mu}{.2777em}");ke("\\thickspace","\\;");ke("\\!","\\tmspace-{3mu}{.1667em}");ke("\\negthinspace","\\!");ke("\\negmedspace","\\tmspace-{4mu}{.2222em}");ke("\\negthickspace","\\tmspace-{5mu}{.277em}");ke("\\enspace","\\kern.5em ");ke("\\enskip","\\hskip.5em\\relax");ke("\\quad","\\hskip1em\\relax");ke("\\qquad","\\hskip2em\\relax");ke("\\tag","\\@ifstar\\tag@literal\\tag@paren");ke("\\tag@paren","\\tag@literal{({#1})}");ke("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Wt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});ke("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");ke("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");ke("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");ke("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");ke("\\newline","\\\\\\relax");ke("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var dLe=Kt(Ld["Main-Regular"][84][1]-.7*Ld["Main-Regular"][65][1]);ke("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+dLe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");ke("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+dLe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");ke("\\hspace","\\@ifstar\\@hspacer\\@hspace");ke("\\@hspace","\\hskip #1\\relax");ke("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");ke("\\ordinarycolon",":");ke("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");ke("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');ke("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');ke("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');ke("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');ke("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');ke("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');ke("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');ke("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');ke("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');ke("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');ke("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');ke("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');ke("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');ke("∷","\\dblcolon");ke("∹","\\eqcolon");ke("≔","\\coloneqq");ke("≕","\\eqqcolon");ke("⩴","\\Coloneqq");ke("\\ratio","\\vcentcolon");ke("\\coloncolon","\\dblcolon");ke("\\colonequals","\\coloneqq");ke("\\coloncolonequals","\\Coloneqq");ke("\\equalscolon","\\eqqcolon");ke("\\equalscoloncolon","\\Eqqcolon");ke("\\colonminus","\\coloneq");ke("\\coloncolonminus","\\Coloneq");ke("\\minuscolon","\\eqcolon");ke("\\minuscoloncolon","\\Eqcolon");ke("\\coloncolonapprox","\\Colonapprox");ke("\\coloncolonsim","\\Colonsim");ke("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");ke("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");ke("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");ke("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");ke("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");ke("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");ke("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");ke("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");ke("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");ke("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");ke("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");ke("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");ke("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");ke("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");ke("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");ke("\\nleqq","\\html@mathml{\\@nleqq}{≰}");ke("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");ke("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");ke("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");ke("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");ke("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");ke("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");ke("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");ke("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");ke("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");ke("\\imath","\\html@mathml{\\@imath}{ı}");ke("\\jmath","\\html@mathml{\\@jmath}{ȷ}");ke("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");ke("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");ke("⟦","\\llbracket");ke("⟧","\\rrbracket");ke("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");ke("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");ke("⦃","\\lBrace");ke("⦄","\\rBrace");ke("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");ke("⦵","\\minuso");ke("\\darr","\\downarrow");ke("\\dArr","\\Downarrow");ke("\\Darr","\\Downarrow");ke("\\lang","\\langle");ke("\\rang","\\rangle");ke("\\uarr","\\uparrow");ke("\\uArr","\\Uparrow");ke("\\Uarr","\\Uparrow");ke("\\N","\\mathbb{N}");ke("\\R","\\mathbb{R}");ke("\\Z","\\mathbb{Z}");ke("\\alef","\\aleph");ke("\\alefsym","\\aleph");ke("\\Alpha","\\mathrm{A}");ke("\\Beta","\\mathrm{B}");ke("\\bull","\\bullet");ke("\\Chi","\\mathrm{X}");ke("\\clubs","\\clubsuit");ke("\\cnums","\\mathbb{C}");ke("\\Complex","\\mathbb{C}");ke("\\Dagger","\\ddagger");ke("\\diamonds","\\diamondsuit");ke("\\empty","\\emptyset");ke("\\Epsilon","\\mathrm{E}");ke("\\Eta","\\mathrm{H}");ke("\\exist","\\exists");ke("\\harr","\\leftrightarrow");ke("\\hArr","\\Leftrightarrow");ke("\\Harr","\\Leftrightarrow");ke("\\hearts","\\heartsuit");ke("\\image","\\Im");ke("\\infin","\\infty");ke("\\Iota","\\mathrm{I}");ke("\\isin","\\in");ke("\\Kappa","\\mathrm{K}");ke("\\larr","\\leftarrow");ke("\\lArr","\\Leftarrow");ke("\\Larr","\\Leftarrow");ke("\\lrarr","\\leftrightarrow");ke("\\lrArr","\\Leftrightarrow");ke("\\Lrarr","\\Leftrightarrow");ke("\\Mu","\\mathrm{M}");ke("\\natnums","\\mathbb{N}");ke("\\Nu","\\mathrm{N}");ke("\\Omicron","\\mathrm{O}");ke("\\plusmn","\\pm");ke("\\rarr","\\rightarrow");ke("\\rArr","\\Rightarrow");ke("\\Rarr","\\Rightarrow");ke("\\real","\\Re");ke("\\reals","\\mathbb{R}");ke("\\Reals","\\mathbb{R}");ke("\\Rho","\\mathrm{P}");ke("\\sdot","\\cdot");ke("\\sect","\\S");ke("\\spades","\\spadesuit");ke("\\sub","\\subset");ke("\\sube","\\subseteq");ke("\\supe","\\supseteq");ke("\\Tau","\\mathrm{T}");ke("\\thetasym","\\vartheta");ke("\\weierp","\\wp");ke("\\Zeta","\\mathrm{Z}");ke("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");ke("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");ke("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");ke("\\bra","\\mathinner{\\langle{#1}|}");ke("\\ket","\\mathinner{|{#1}\\rangle}");ke("\\braket","\\mathinner{\\langle{#1}\\rangle}");ke("\\Bra","\\left\\langle#1\\right|");ke("\\Ket","\\left|#1\\right\\rangle");var fLe=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",a),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([...s,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};ke("\\bra@ket",fLe(!1));ke("\\bra@set",fLe(!0));ke("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");ke("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");ke("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");ke("\\angln","{\\angl n}");ke("\\blue","\\textcolor{##6495ed}{#1}");ke("\\orange","\\textcolor{##ffa500}{#1}");ke("\\pink","\\textcolor{##ff00af}{#1}");ke("\\red","\\textcolor{##df0030}{#1}");ke("\\green","\\textcolor{##28ae7b}{#1}");ke("\\gray","\\textcolor{gray}{#1}");ke("\\purple","\\textcolor{##9d38bd}{#1}");ke("\\blueA","\\textcolor{##ccfaff}{#1}");ke("\\blueB","\\textcolor{##80f6ff}{#1}");ke("\\blueC","\\textcolor{##63d9ea}{#1}");ke("\\blueD","\\textcolor{##11accd}{#1}");ke("\\blueE","\\textcolor{##0c7f99}{#1}");ke("\\tealA","\\textcolor{##94fff5}{#1}");ke("\\tealB","\\textcolor{##26edd5}{#1}");ke("\\tealC","\\textcolor{##01d1c1}{#1}");ke("\\tealD","\\textcolor{##01a995}{#1}");ke("\\tealE","\\textcolor{##208170}{#1}");ke("\\greenA","\\textcolor{##b6ffb0}{#1}");ke("\\greenB","\\textcolor{##8af281}{#1}");ke("\\greenC","\\textcolor{##74cf70}{#1}");ke("\\greenD","\\textcolor{##1fab54}{#1}");ke("\\greenE","\\textcolor{##0d923f}{#1}");ke("\\goldA","\\textcolor{##ffd0a9}{#1}");ke("\\goldB","\\textcolor{##ffbb71}{#1}");ke("\\goldC","\\textcolor{##ff9c39}{#1}");ke("\\goldD","\\textcolor{##e07d10}{#1}");ke("\\goldE","\\textcolor{##a75a05}{#1}");ke("\\redA","\\textcolor{##fca9a9}{#1}");ke("\\redB","\\textcolor{##ff8482}{#1}");ke("\\redC","\\textcolor{##f9685d}{#1}");ke("\\redD","\\textcolor{##e84d39}{#1}");ke("\\redE","\\textcolor{##bc2612}{#1}");ke("\\maroonA","\\textcolor{##ffbde0}{#1}");ke("\\maroonB","\\textcolor{##ff92c6}{#1}");ke("\\maroonC","\\textcolor{##ed5fa6}{#1}");ke("\\maroonD","\\textcolor{##ca337c}{#1}");ke("\\maroonE","\\textcolor{##9e034e}{#1}");ke("\\purpleA","\\textcolor{##ddd7ff}{#1}");ke("\\purpleB","\\textcolor{##c6b9fc}{#1}");ke("\\purpleC","\\textcolor{##aa87ff}{#1}");ke("\\purpleD","\\textcolor{##7854ab}{#1}");ke("\\purpleE","\\textcolor{##543b78}{#1}");ke("\\mintA","\\textcolor{##f5f9e8}{#1}");ke("\\mintB","\\textcolor{##edf2df}{#1}");ke("\\mintC","\\textcolor{##e0e5cc}{#1}");ke("\\grayA","\\textcolor{##f6f7f7}{#1}");ke("\\grayB","\\textcolor{##f0f1f2}{#1}");ke("\\grayC","\\textcolor{##e3e5e6}{#1}");ke("\\grayD","\\textcolor{##d6d8da}{#1}");ke("\\grayE","\\textcolor{##babec2}{#1}");ke("\\grayF","\\textcolor{##888d93}{#1}");ke("\\grayG","\\textcolor{##626569}{#1}");ke("\\grayH","\\textcolor{##3b3e40}{#1}");ke("\\grayI","\\textcolor{##21242c}{#1}");ke("\\kaBlue","\\textcolor{##314453}{#1}");ke("\\kaGreen","\\textcolor{##71B307}{#1}");var pLe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class xUt{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 yUt(vUt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Dpe(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 Zc("EOF",n.loc)),this.pushTokens(i),new Zc("",fc.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(),s,a=0,o=0;do{if(s=this.popToken(),r.push(s),s.text==="{")++a;else if(s.text==="}"){if(--a,a===-1)throw new Wt("Extra }",s)}else if(s.text==="EOF")throw new Wt("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",s);if(e&&n)if((a===0||a===1&&e[o]==="{")&&s.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(a!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:s}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new Wt("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;ithis.settings.maxExpand)throw new Wt("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 Wt("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var s=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var o=s.length-1;o>=0;--o){var l=s[o];if(l.text==="#"){if(o===0)throw new Wt("Incomplete placeholder at end of macro body",l);if(l=s[--o],l.text==="#")s.splice(o+1,1);else if(/^[1-9]$/.test(l.text))s.splice(o,2,...a[+l.text-1]);else throw new Wt("Not a valid argument number",l)}}}return this.pushTokens(s),s.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 Zc(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 s=0;if(i.includes("#"))for(var a=i.replace(/##/g,"");a.includes("#"+(s+1));)++s;for(var o=new Dpe(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:s};return h}return i}isDefined(e){return this.macros.has(e)||dg.hasOwnProperty(e)||ds.math.hasOwnProperty(e)||ds.text.hasOwnProperty(e)||pLe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:dg.hasOwnProperty(e)&&!dg[e].primitive}}var Bpe=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,SM=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),$z={"́":{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"}},Fpe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let gLe=class mLe{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 xUt(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 Wt("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 Zc("}")),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(mLe.endOfExpression.has(i.text)||r&&i.text===r||e&&dg[i.text]&&dg[i.text].infix)break;var s=this.parseAtom(r);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i=128)this.settings.strict&&(x_e(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)),a={type:"textord",mode:"text",loc:fc.range(e),text:r};else return null;if(this.consume(),s)for(var h=0;h1?i.setNode(s,r):i.setNode(s)}),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]=n1,this._children[e]={},this._children[n1][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],St(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),St(zc(this._in[e]),r),delete this._in[e],delete this._preds[e],St(zc(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(Zs(r))r=n1;else{r+="";for(var n=r;!Zs(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!==n1)return r}}children(e){if(Zs(e)&&(e=n1),this._isCompound){var r=this._children[e];if(r)return zc(r)}else{if(e===n1)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return zc(r)}successors(e){var r=this._sucs[e];if(r)return zc(r)}neighbors(e){var r=this.predecessors(e);if(r)return CG(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;St(this._nodes,function(a,o){e(o)&&r.setNode(o,a)}),St(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&St(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(e){return wE(e)||(e=kb(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return f0(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return LA(e,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var e,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(e=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(e=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),e=""+e,r=""+r,Zs(n)||(n=""+n);var o=Qk(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!Zs(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(e,r,n);var l=kUt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,Vpe(this._preds[r],e),Vpe(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?Bz(this._isDirected,arguments[0]):Qk(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?Bz(this._isDirected,arguments[0]):Qk(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?Bz(this._isDirected,arguments[0]):Qk(this._isDirected,e,r,n),s=this._edgeObjs[i];return s&&(e=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Hpe(this._preds[r],e),Hpe(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=f0(n);return r?Jf(i,function(s){return s.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=f0(n);return r?Jf(i,function(s){return s.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}rl.prototype._nodeCount=0;rl.prototype._edgeCount=0;function Vpe(t,e){t[e]?t[e]++:t[e]=1}function Hpe(t,e){--t[e]||delete t[e]}function Qk(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}return i+zpe+s+zpe+(Zs(n)?CUt:n)}function kUt(t,e,r,n){var i=""+e,s=""+r;if(!t&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function Bz(t,e){return Qk(t,e.v,e.w,e.name)}function k0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:SUt(t),edges:EUt(t)};return Zs(t.graph())||(e.value=d_(t.graph())),e}function SUt(t){return ca(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Zs(r)||(i.value=r),Zs(n)||(i.parent=n),i})}function EUt(t){return ca(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Zs(e.name)||(n.name=e.name),Zs(r)||(n.value=r),n})}var un=new Map,fg=new Map,CLe=new Map,kLe=w(()=>{fg.clear(),CLe.clear(),un.clear()},"clear"),iv=w((t,e)=>{const r=fg.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),AUt=w((t,e)=>{const r=fg.get(e)||[];return de.info("Descendants of ",e," is ",r),de.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||iv(t.v,e)||iv(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),JU=w((t,e,r,n)=>{de.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),de.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(s=>{if(e.children(s).length>0)JU(s,e,r,n);else{const a=e.node(s);de.info("cp ",s," to ",n," with parent ",t),r.setNode(s,a),n!==e.parent(s)&&(de.warn("Setting parent",s,e.parent(s)),r.setParent(s,e.parent(s))),t!==n&&s!==t?(de.debug("Setting parent",s,t),r.setParent(s,t)):(de.info("In copy ",t,"root",n,"data",e.node(t),n),de.debug("Not Setting parent for node=",s,"cluster!==rootId",t!==n,"node!==clusterId",s!==t));const o=e.edges(s);de.debug("Copying Edges",o),o.forEach(l=>{de.info("Edge",l);const u=e.edge(l.v,l.w,l.name);de.info("Edge data",u,n);try{if(AUt(l,n)){const h=fg.get(n)||[],d=h.includes(l.v)||iv(l.v,n)||l.v===n,f=h.includes(l.w)||iv(l.w,n)||l.w===n;if(d&&f)de.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),de.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;de.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else de.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){de.error(h)}})}de.debug("Removing node",s),e.removeNode(s)})},"copy"),SLe=w((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)CLe.set(i,t),n=[...n,...SLe(i,e)];return n},"extractDescendants"),MUt=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),s=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),a=i.map(l=>({v:l.v,w:l.w}));return s.filter(l=>a.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),s3=w((t,e,r)=>{const n=e.children(t);if(de.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const s of n){const a=s3(s,e,r),o=MUt(e,r,a);if(a)if(o.length>0)i=a;else return a}return i},"findNonClusterChild"),Gpe=w(t=>!un.has(t)||!un.get(t).externalConnections?t:un.has(t)?un.get(t).id:t,"getAnchorId"),RUt=w((t,e)=>{var r;if(!t||e>10){de.debug("Opting out, no graph ");return}else de.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(de.warn("Cluster identified",n," Replacement id in edges: ",s3(n,t,n)),fg.set(n,SLe(n,t)),un.set(n,{id:s3(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),s=t.edges();i.length>0?(de.debug("Cluster identified",n,fg),s.forEach(a=>{const o=iv(a.v,n),l=iv(a.w,n);o^l&&(de.warn("Edge: ",a," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",fg.get(n)),un.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,fg)});for(let n of un.keys()){const i=un.get(n).id,s=t.parent(i);s!==n&&un.has(s)&&!un.get(s).externalConnections&&(un.get(n).id=s);const a=t.edges().some(o=>o.v===n);if(i&&((r=un.get(n))!=null&&r.externalConnections)&&a&&MLe(t,i,n)){const o=LUt(t,n,t.parent(i));o&&(un.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let s=n.v,a=n.w;if(de.warn("Fix XXX",un,"ids:",n.v,n.w,"Translating: ",un.get(n.v)," --- ",un.get(n.w)),un.get(n.v)||un.get(n.w)){if(de.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),s=Gpe(n.v),a=Gpe(n.w),t.removeEdge(n.v,n.w,n.name),s!==n.v){const o=t.parent(s);un.get(o).externalConnections=!0,i.fromCluster=n.v}if(a!==n.w){const o=t.parent(a);un.get(o).externalConnections=!0,i.toCluster=n.w}de.warn("Fix Replacing with XXX",s,a,n.name),t.setEdge(s,a,i,n.name)}}),de.warn("Adjusted Graph",k0(t)),ELe(t,0),de.trace(un)},"adjustClustersAndEdges"),ELe=w((t,e)=>{var i,s,a,o;if(de.warn("extractor - ",e,k0(t),t.children("D")),e>10){de.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){de.debug("Done, no node has children",t.nodes());return}de.debug("Nodes = ",r,e);for(const l of r)if(de.debug("Extracting node",l,un,un.has(l)&&!un.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!un.has(l))de.debug("Not a cluster",l,e);else if((s=(i=un.get(l))==null?void 0:i.clusterData)!=null&&s.explicitDir&&t.children(l)&&t.children(l).length>0){de.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=un.get(l).clusterData.dir,h=new rl({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});JU(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:un.get(l).clusterData,label:un.get(l).label,graph:h}),de.warn("Subgraph for cluster with explicit dir created:",l,k0(h))}else if(!un.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){de.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(a=un.get(l))==null?void 0:a.clusterData)!=null&&o.dir&&(h=un.get(l).clusterData.dir,de.warn("Fixing dir",un.get(l).clusterData.dir,h));const d=new rl({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});JU(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:un.get(l).clusterData,label:un.get(l).label,graph:d}),de.debug("Old graph after copy",k0(t))}else de.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!un.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),de.debug(un);r=t.nodes(),de.warn("New list of nodes",r);for(const l of r){const u=t.node(l);de.warn(" Now next level",l,u),u!=null&&u.clusterNode&&ELe(u.graph,e+1)}},"extractor"),ALe=w((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),s=ALe(t,i);r=[...r,...s]}),r},"sorter"),_Ut=w(t=>ALe(t,t.children()),"sortNodesByHierarchy"),MLe=w((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=un.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),LUt=w((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||iv(i,r))continue;const s=s3(i,t,e);if(s&&!MLe(t,s,e))return s}return null},"findSafeAnchorNode");class IUt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Wpe(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Wpe(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,NUt)),n=n._prev;return"["+e.join(", ")+"]"}}function Wpe(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function NUt(t,e){if(t!=="_next"&&t!=="_prev")return e}var OUt=kb(1);function DUt(t,e){if(t.nodeCount()<=1)return[];var r=$Ut(t,e||OUt),n=PUt(r.graph,r.buckets,r.zeroIdx);return D3(ca(n,function(i){return t.outEdges(i.v,i.w)}))}function PUt(t,e,r){for(var n=[],i=e[e.length-1],s=e[0],a;t.nodeCount();){for(;a=s.dequeue();)Fz(t,e,r,a);for(;a=i.dequeue();)Fz(t,e,r,a);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(a=e[o].dequeue(),a){n=n.concat(Fz(t,e,r,a,!0));break}}}return n}function Fz(t,e,r,n,i){var s=i?[]:void 0;return St(t.inEdges(n.v),function(a){var o=t.edge(a),l=t.node(a.v);i&&s.push({v:a.v,w:a.w}),l.out-=o,ej(e,r,l)}),St(t.outEdges(n.v),function(a){var o=t.edge(a),l=a.w,u=t.node(l);u.in-=o,ej(e,r,u)}),t.removeNode(n.v),s}function $Ut(t,e){var r=new rl,n=0,i=0;St(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),St(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 s=g5(i+n+3).map(function(){return new IUt}),a=n+1;return St(r.nodes(),function(o){ej(s,a,r.node(o))}),{graph:r,buckets:s,zeroIdx:a}}function ej(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 BUt(t){var e=t.graph().acyclicer==="greedy"?DUt(t,r(t)):FUt(t);St(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,AO("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function FUt(t){var e=[],r={},n={};function i(s){Object.prototype.hasOwnProperty.call(n,s)||(n[s]=!0,r[s]=!0,St(t.outEdges(s),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?e.push(a):i(a.w)}),delete r[s])}return St(t.nodes(),i),e}function zUt(t){St(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 oC(t,e,r,n){var i;do i=AO(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function VUt(t){var e=new rl().setGraph(t.graph());return St(t.nodes(),function(r){e.setNode(r,t.node(r))}),St(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 RLe(t){var e=new rl({multigraph:t.isMultigraph()}).setGraph(t.graph());return St(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),St(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function qpe(t,e){var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=o*i/s,u=o):(i<0&&(a=-a),l=a,u=a*s/i),{x:r+l,y:n+u}}function wP(t){var e=ca(g5(_Le(t)+1),function(){return[]});return St(t.nodes(),function(r){var n=t.node(r),i=n.rank;Zs(i)||(e[i][n.order]=r)}),e}function HUt(t){var e=EE(ca(t.nodes(),function(r){return t.node(r).rank}));St(t.nodes(),function(r){var n=t.node(r);Sb(n,"rank")&&(n.rank-=e)})}function GUt(t){var e=EE(ca(t.nodes(),function(s){return t.node(s).rank})),r=[];St(t.nodes(),function(s){var a=t.node(s).rank-e;r[a]||(r[a]=[]),r[a].push(s)});var n=0,i=t.graph().nodeRankFactor;St(r,function(s,a){Zs(s)&&a%i!==0?--n:n&&St(s,function(o){t.node(o).rank+=n})})}function Upe(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),oC(t,"border",i,e)}function _Le(t){return Ig(ca(t.nodes(),function(e){var r=t.node(e).rank;if(!Zs(r))return r}))}function WUt(t,e){var r={lhs:[],rhs:[]};return St(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function qUt(t,e){return e()}function UUt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&St(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,a=i.maxRank+1;sa.lim&&(o=a,l=!0);var u=Jf(e.edges(),function(h){return l===Xpe(t,t.node(h.v),o)&&l!==Xpe(t,t.node(h.w),o)});return yZ(u,function(h){return F6(e,h)})}function FLe(t,e,r,n){var i=r.v,s=r.w;t.removeEdge(i,s),t.setEdge(n.v,n.w,{}),Mte(t),Ate(t,e),ojt(t,e)}function ojt(t,e){var r=gZ(t.nodes(),function(i){return!e.node(i).parent}),n=sjt(t,r);n=n.slice(1),St(n,function(i){var s=t.node(i).parent,a=e.edge(i,s),o=!1;a||(a=e.edge(s,i),o=!0),e.node(i).rank=e.node(s).rank+(o?a.minlen:-a.minlen)})}function ljt(t,e,r){return t.hasEdge(e,r)}function Xpe(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function cjt(t){switch(t.graph().ranker){case"network-simplex":Kpe(t);break;case"tight-tree":hjt(t);break;case"longest-path":ujt(t);break;default:Kpe(t)}}var ujt=Ete;function hjt(t){Ete(t),ILe(t)}function Kpe(t){Lv(t)}function djt(t){var e=oC(t,"root",{},"_root"),r=fjt(t),n=Ig(f0(r))-1,i=2*n+1;t.graph().nestingRoot=e,St(t.edges(),function(a){t.edge(a).minlen*=i});var s=pjt(t)+1;St(t.children(),function(a){zLe(t,e,i,s,n,r,a)}),t.graph().nodeRankFactor=i}function zLe(t,e,r,n,i,s,a){var o=t.children(a);if(!o.length){a!==e&&t.setEdge(e,a,{weight:0,minlen:r});return}var l=Upe(t,"_bt"),u=Upe(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(u,a),h.borderBottom=u,St(o,function(d){zLe(t,e,r,n,i,s,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-s[a]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:i+s[a]})}function fjt(t){var e={};function r(n,i){var s=t.children(n);s&&s.length&&St(s,function(a){r(a,i+1)}),e[n]=i}return St(t.children(),function(n){r(n,1)}),e}function pjt(t){return LA(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function gjt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,St(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function mjt(t,e,r){var n={},i;St(r,function(s){for(var a=t.parent(s),o,l;a;){if(o=t.parent(a),o?(l=n[o],n[o]=a):(l=i,i=a),l&&l!==a){e.setEdge(l,a);return}a=o}})}function yjt(t,e,r){var n=vjt(t),i=new rl({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(s){return t.node(s)});return St(t.nodes(),function(s){var a=t.node(s),o=t.parent(s);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(s),i.setParent(s,o||n),St(t[r](s),function(l){var u=l.v===s?l.w:l.v,h=i.edge(u,s),d=Zs(h)?0:h.weight;i.setEdge(u,s,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(s,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i}function vjt(t){for(var e;t.hasNode(e=AO("_root")););return e}function bjt(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 wjt(t){var e={},r=Jf(t.nodes(),function(o){return!t.children(o).length}),n=Ig(ca(r,function(o){return t.node(o).rank})),i=ca(g5(n+1),function(){return[]});function s(o){if(!Sb(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),St(t.successors(o),s)}}var a=mm(r,function(o){return t.node(o).rank});return St(a,s),i}function Tjt(t,e){return ca(e,function(r){var n=t.inEdges(r);if(n.length){var i=LA(n,function(s,a){var o=t.edge(a),l=t.node(a.v);return{sum:s.sum+o.weight*l.order,weight:s.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Cjt(t,e){var r={};St(t,function(i,s){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};Zs(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),St(e.edges(),function(i){var s=r[i.v],a=r[i.w];!Zs(s)&&!Zs(a)&&(a.indegree++,s.out.push(r[i.w]))});var n=Jf(r,function(i){return!i.indegree});return kjt(n)}function kjt(t){var e=[];function r(s){return function(a){a.merged||(Zs(a.barycenter)||Zs(s.barycenter)||a.barycenter>=s.barycenter)&&Sjt(s,a)}}function n(s){return function(a){a.in.push(s),--a.indegree===0&&t.push(a)}}for(;t.length;){var i=t.pop();e.push(i),St(i.in.reverse(),r(i)),St(i.out,n(i))}return ca(Jf(e,function(s){return!s.merged}),function(s){return p5(s,["vs","i","barycenter","weight"])})}function Sjt(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 Ejt(t,e){var r=WUt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=mm(r.rhs,function(h){return-h.i}),s=[],a=0,o=0,l=0;n.sort(Ajt(!!e)),l=Zpe(s,i,l),St(n,function(h){l+=h.vs.length,s.push(h.vs),a+=h.barycenter*h.weight,o+=h.weight,l=Zpe(s,i,l)});var u={vs:D3(s)};return o&&(u.barycenter=a/o,u.weight=o),u}function Zpe(t,e,r){for(var n;e.length&&(n=p_(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function Ajt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function VLe(t,e,r,n){var i=t.children(e),s=t.node(e),a=s?s.borderLeft:void 0,o=s?s.borderRight:void 0,l={};a&&(i=Jf(i,function(g){return g!==a&&g!==o}));var u=Tjt(t,i);St(u,function(g){if(t.children(g.v).length){var m=VLe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&Rjt(g,m)}});var h=Cjt(u,r);Mjt(h,l);var d=Ejt(h,n);if(a&&(d.vs=D3([a,d.vs,o]),t.predecessors(a).length)){var f=t.node(t.predecessors(a)[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 Mjt(t,e){St(t,function(r){r.vs=D3(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function Rjt(t,e){Zs(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 _jt(t){var e=_Le(t),r=Qpe(t,g5(1,e+1),"inEdges"),n=Qpe(t,g5(e-1,-1,-1),"outEdges"),i=wjt(t);Jpe(t,i);for(var s=Number.POSITIVE_INFINITY,a,o=0,l=0;l<4;++o,++l){Ljt(o%2?r:n,o%4>=2),i=wP(t);var u=bjt(t,i);ua||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)s.push(l);return{path:i.concat(s.reverse()),lca:u}}function Ojt(t){var e={},r=0;function n(i){var s=r;St(t.children(i),n),e[i]={low:s,lim:r++}}return St(t.children(),n),e}function Djt(t,e){var r={};function n(i,s){var a=0,o=0,l=i.length,u=p_(s);return St(s,function(h,d){var f=$jt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(St(s.slice(o,d+1),function(g){St(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(vu)&&HLe(r,f,h)})})}function i(s,a){var o=-1,l,u=0;return St(a,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(a,u,d,o,l),u=d,o=l)}n(a,u,a.length,l,s.length)}),a}return LA(e,i),r}function $jt(t,e){if(t.node(e).dummy)return gZ(t.predecessors(e),function(r){return t.node(r).dummy})}function HLe(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 Bjt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function Fjt(t,e,r,n){var i={},s={},a={};return St(e,function(o){St(o,function(l,u){i[l]=l,s[l]=l,a[l]=u})}),St(e,function(o){var l=-1;St(o,function(u){var h=n(u);if(h.length){h=mm(h,function(m){return a[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];s[u]===u&&l{var n=r(" buildLayoutGraph",()=>aYt(t));r(" runLayout",()=>Kjt(n,r)),r(" updateInputGraph",()=>Zjt(t,n))})}function Kjt(t,e){e(" makeSpaceForEdgeLabels",()=>oYt(t)),e(" removeSelfEdges",()=>mYt(t)),e(" acyclic",()=>BUt(t)),e(" nestingGraph.run",()=>djt(t)),e(" rank",()=>cjt(RLe(t))),e(" injectEdgeLabelProxies",()=>lYt(t)),e(" removeEmptyRanks",()=>GUt(t)),e(" nestingGraph.cleanup",()=>gjt(t)),e(" normalizeRanks",()=>HUt(t)),e(" assignRankMinMax",()=>cYt(t)),e(" removeEdgeLabelProxies",()=>uYt(t)),e(" normalize.run",()=>ZUt(t)),e(" parentDummyChains",()=>Ijt(t)),e(" addBorderSegments",()=>UUt(t)),e(" order",()=>_jt(t)),e(" insertSelfEdges",()=>yYt(t)),e(" adjustCoordinateSystem",()=>jUt(t)),e(" position",()=>Yjt(t)),e(" positionSelfEdges",()=>vYt(t)),e(" removeBorderNodes",()=>gYt(t)),e(" normalize.undo",()=>JUt(t)),e(" fixupEdgeLabelCoords",()=>fYt(t)),e(" undoCoordinateSystem",()=>YUt(t)),e(" translateGraph",()=>hYt(t)),e(" assignNodeIntersects",()=>dYt(t)),e(" reversePoints",()=>pYt(t)),e(" acyclic.undo",()=>zUt(t))}function Zjt(t,e){St(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))}),St(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 Qjt=["nodesep","edgesep","ranksep","marginx","marginy"],Jjt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},eYt=["acyclicer","ranker","rankdir","align"],tYt=["width","height"],rYt={width:0,height:0},nYt=["minlen","weight","width","height","labeloffset"],iYt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sYt=["labelpos"];function aYt(t){var e=new rl({multigraph:!0,compound:!0}),r=Gz(t.graph());return e.setGraph(zi({},Jjt,Hz(r,Qjt),p5(r,eYt))),St(t.nodes(),function(n){var i=Gz(t.node(n));e.setNode(n,Fxe(Hz(i,tYt),rYt)),e.setParent(n,t.parent(n))}),St(t.edges(),function(n){var i=Gz(t.edge(n));e.setEdge(n,zi({},iYt,Hz(i,nYt),p5(i,sYt)))}),e}function oYt(t){var e=t.graph();e.ranksep/=2,St(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 lYt(t){St(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),s={rank:(i.rank-n.rank)/2+n.rank,e};oC(t,"edge-proxy",s,"_ep")}})}function cYt(t){var e=0;St(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=Ig(e,n.maxRank))}),t.graph().maxRank=e}function uYt(t){St(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function hYt(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,s=t.graph(),a=s.marginx||0,o=s.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)}St(t.nodes(),function(u){l(t.node(u))}),St(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=a,n-=o,St(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),St(t.edges(),function(u){var h=t.edge(u);St(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)}),s.width=r-e+a,s.height=i-n+o}function dYt(t){St(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),s,a;r.points?(s=r.points[0],a=r.points[r.points.length-1]):(r.points=[],s=i,a=n),r.points.unshift(qpe(n,s)),r.points.push(qpe(i,a))})}function fYt(t){St(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 pYt(t){St(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function gYt(t){St(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),s=t.node(p_(r.borderLeft)),a=t.node(p_(r.borderRight));r.width=Math.abs(a.x-s.x),r.height=Math.abs(i.y-n.y),r.x=s.x+r.width/2,r.y=n.y+r.height/2}}),St(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function mYt(t){St(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 yYt(t){var e=wP(t);St(e,function(r){var n=0;St(r,function(i,s){var a=t.node(i);a.order=s+n,St(a.selfEdges,function(o){oC(t,"selfedge",{width:o.label.width,height:o.label.height,rank:a.rank,order:s+ ++n,e:o.e,label:o.label},"_se")}),delete a.selfEdges})})}function vYt(t){St(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,s=n.y,a=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*a/3,y:s-o},{x:i+5*a/6,y:s-o},{x:i+a,y:s},{x:i+5*a/6,y:s+o},{x:i+2*a/3,y:s+o}],r.label.x=r.x,r.label.y=r.y}})}function Hz(t,e){return EO(p5(t,e),Number)}function Gz(t){var e={};return St(t,function(r,n){e[n.toLowerCase()]=r}),e}var ege=w((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),tge=w((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),bYt=w(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),xYt=w((t,e,r,n,i)=>{const s=[],a=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&a.add(h),d!==n&&a.add(d)}),a.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&s.push(d)}),s.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"&&s.push(d)})}),s.length===0)return tge(i);const o=s.reduce((h,d)=>({x:h.x+d.x/s.length,y:h.y+d.y/s.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":tge(i)},"getSelfLoopSide"),wYt=w((t,e="top",r=0,n=0)=>{const i=t.x,s=t.y-r,a=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=ege(Math.max(n,t.width*.35),36,l),h=ege(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=s+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+a;return[{x:d,y:s-u/2},{x:d+h,y:s-u/2},{x:d+h,y:s+u/2},{x:d,y:s+u/2}]}case"left":{const d=i-a;return[{x:d,y:s-u/2},{x:d-h,y:s-u/2},{x:d-h,y:s+u/2},{x:d,y:s+u/2}]}case"top":default:{const d=s-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"),TYt=w((t,e,r="top",n=0,i={})=>{const a=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:a,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:a,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),WLe=w((t,e=0,{mergeSelfLoops:r=!0}={})=>{var a;const n=new Map,i=[],s=(a=t.graph())==null?void 0:a.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(b=>i.push(b));return}o.sort((b,x)=>b.edge.selfLoop.order-x.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(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=xYt(t,f,o,d.start,s),m=wYt(f,g,e,p.width??0),y=TYt(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"),qLe=w(async(t,e,r,n,i,s)=>{de.warn("Graph in recursive render:XAX",k0(e),i);const a=e.graph().rankdir;de.trace("Dir in recursive render - dir:",a);const o=t.insert("g").attr("class","root");e.nodes()?de.info("Recursive render XXX",e.nodes()):de.info("No nodes found for",e),e.edges().length>0&&de.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=bYt(r);await Promise.all(e.nodes().map(async function(b){const x=e.node(b);if(i!==void 0){const T=JSON.parse(JSON.stringify(i.clusterData));de.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,aj="[̀-ͯ]",Bqt=new RegExp(aj+"+$"),$qt="("+CLe+"+)|"+(Pqt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(aj+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(aj+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+_qt)+("|"+Oqt+")");let Wpe=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($qt,"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 Zc("EOF",new fc(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Gt("Unexpected character: '"+e[r]+"'",new Zc(e[r],new fc(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 Zc(i,new fc(this,r,this.tokenRegex.lastIndex))}};class Fqt{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 zqt=fLe;Ce("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});Ce("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});Ce("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});Ce("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});Ce("\\@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}});Ce("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");Ce("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var qpe={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};Ce("\\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 Gt("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=qpe[e.text],n==null||n>=r)throw new Gt("Invalid base-"+r+" digit "+e.text);for(var i;(i=qpe[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}),""};Ce("\\newcommand",t=>Rte(t,!1,!0,!1));Ce("\\renewcommand",t=>Rte(t,!0,!1,!1));Ce("\\providecommand",t=>Rte(t,!0,!0,!0));Ce("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});Ce("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});Ce("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),fg[r],ha.math[r],ha.text[r]),""});Ce("\\bgroup","{");Ce("\\egroup","}");Ce("~","\\nobreakspace");Ce("\\lq","`");Ce("\\rq","'");Ce("\\aa","\\r a");Ce("\\AA","\\r A");Ce("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");Ce("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");Ce("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");Ce("ℬ","\\mathscr{B}");Ce("ℰ","\\mathscr{E}");Ce("ℱ","\\mathscr{F}");Ce("ℋ","\\mathscr{H}");Ce("ℐ","\\mathscr{I}");Ce("ℒ","\\mathscr{L}");Ce("ℳ","\\mathscr{M}");Ce("ℛ","\\mathscr{R}");Ce("ℭ","\\mathfrak{C}");Ce("ℌ","\\mathfrak{H}");Ce("ℨ","\\mathfrak{Z}");Ce("\\Bbbk","\\Bbb{k}");Ce("\\llap","\\mathllap{\\textrm{#1}}");Ce("\\rlap","\\mathrlap{\\textrm{#1}}");Ce("\\clap","\\mathclap{\\textrm{#1}}");Ce("\\mathstrut","\\vphantom{(}");Ce("\\underbar","\\underline{\\text{#1}}");Ce("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');Ce("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");Ce("\\ne","\\neq");Ce("≠","\\neq");Ce("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");Ce("∉","\\notin");Ce("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");Ce("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");Ce("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");Ce("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");Ce("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");Ce("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");Ce("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");Ce("⟂","\\perp");Ce("‼","\\mathclose{!\\mkern-0.8mu!}");Ce("∌","\\notni");Ce("⌜","\\ulcorner");Ce("⌝","\\urcorner");Ce("⌞","\\llcorner");Ce("⌟","\\lrcorner");Ce("©","\\copyright");Ce("®","\\textregistered");Ce("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');Ce("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');Ce("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');Ce("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');Ce("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");Ce("⋮","\\vdots");Ce("\\varGamma","\\mathit{\\Gamma}");Ce("\\varDelta","\\mathit{\\Delta}");Ce("\\varTheta","\\mathit{\\Theta}");Ce("\\varLambda","\\mathit{\\Lambda}");Ce("\\varXi","\\mathit{\\Xi}");Ce("\\varPi","\\mathit{\\Pi}");Ce("\\varSigma","\\mathit{\\Sigma}");Ce("\\varUpsilon","\\mathit{\\Upsilon}");Ce("\\varPhi","\\mathit{\\Phi}");Ce("\\varPsi","\\mathit{\\Psi}");Ce("\\varOmega","\\mathit{\\Omega}");Ce("\\substack","\\begin{subarray}{c}#1\\end{subarray}");Ce("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");Ce("\\boxed","\\fbox{$\\displaystyle{#1}$}");Ce("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");Ce("\\implies","\\DOTSB\\;\\Longrightarrow\\;");Ce("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");Ce("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");Ce("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var jpe={",":"\\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"},Vqt=new Set(["bin","rel"]);Ce("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in jpe?e=jpe[r]:(r.slice(0,4)==="\\not"||r in ha.math&&Vqt.has(ha.math[r].group))&&(e="\\dotsb"),e});var Lte={")":!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};Ce("\\dotso",function(t){var e=t.future().text;return e in Lte?"\\ldots\\,":"\\ldots"});Ce("\\dotsc",function(t){var e=t.future().text;return e in Lte&&e!==","?"\\ldots\\,":"\\ldots"});Ce("\\cdots",function(t){var e=t.future().text;return e in Lte?"\\@cdots\\,":"\\@cdots"});Ce("\\dotsb","\\cdots");Ce("\\dotsm","\\cdots");Ce("\\dotsi","\\!\\cdots");Ce("\\dotsx","\\ldots\\,");Ce("\\DOTSI","\\relax");Ce("\\DOTSB","\\relax");Ce("\\DOTSX","\\relax");Ce("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");Ce("\\,","\\tmspace+{3mu}{.1667em}");Ce("\\thinspace","\\,");Ce("\\>","\\mskip{4mu}");Ce("\\:","\\tmspace+{4mu}{.2222em}");Ce("\\medspace","\\:");Ce("\\;","\\tmspace+{5mu}{.2777em}");Ce("\\thickspace","\\;");Ce("\\!","\\tmspace-{3mu}{.1667em}");Ce("\\negthinspace","\\!");Ce("\\negmedspace","\\tmspace-{4mu}{.2222em}");Ce("\\negthickspace","\\tmspace-{5mu}{.277em}");Ce("\\enspace","\\kern.5em ");Ce("\\enskip","\\hskip.5em\\relax");Ce("\\quad","\\hskip1em\\relax");Ce("\\qquad","\\hskip2em\\relax");Ce("\\tag","\\@ifstar\\tag@literal\\tag@paren");Ce("\\tag@paren","\\tag@literal{({#1})}");Ce("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Gt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});Ce("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");Ce("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");Ce("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");Ce("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");Ce("\\newline","\\\\\\relax");Ce("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var kLe=Kt(Id["Main-Regular"][84][1]-.7*Id["Main-Regular"][65][1]);Ce("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+kLe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Ce("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+kLe+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");Ce("\\hspace","\\@ifstar\\@hspacer\\@hspace");Ce("\\@hspace","\\hskip #1\\relax");Ce("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");Ce("\\ordinarycolon",":");Ce("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");Ce("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');Ce("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');Ce("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');Ce("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');Ce("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');Ce("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');Ce("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');Ce("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');Ce("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');Ce("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');Ce("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');Ce("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');Ce("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');Ce("∷","\\dblcolon");Ce("∹","\\eqcolon");Ce("≔","\\coloneqq");Ce("≕","\\eqqcolon");Ce("⩴","\\Coloneqq");Ce("\\ratio","\\vcentcolon");Ce("\\coloncolon","\\dblcolon");Ce("\\colonequals","\\coloneqq");Ce("\\coloncolonequals","\\Coloneqq");Ce("\\equalscolon","\\eqqcolon");Ce("\\equalscoloncolon","\\Eqqcolon");Ce("\\colonminus","\\coloneq");Ce("\\coloncolonminus","\\Coloneq");Ce("\\minuscolon","\\eqcolon");Ce("\\minuscoloncolon","\\Eqcolon");Ce("\\coloncolonapprox","\\Colonapprox");Ce("\\coloncolonsim","\\Colonsim");Ce("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ce("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ce("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");Ce("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");Ce("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");Ce("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");Ce("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");Ce("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");Ce("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");Ce("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");Ce("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");Ce("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");Ce("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");Ce("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");Ce("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");Ce("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");Ce("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");Ce("\\nleqq","\\html@mathml{\\@nleqq}{≰}");Ce("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");Ce("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");Ce("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");Ce("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");Ce("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");Ce("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");Ce("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");Ce("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");Ce("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");Ce("\\imath","\\html@mathml{\\@imath}{ı}");Ce("\\jmath","\\html@mathml{\\@jmath}{ȷ}");Ce("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");Ce("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");Ce("⟦","\\llbracket");Ce("⟧","\\rrbracket");Ce("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");Ce("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");Ce("⦃","\\lBrace");Ce("⦄","\\rBrace");Ce("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");Ce("⦵","\\minuso");Ce("\\darr","\\downarrow");Ce("\\dArr","\\Downarrow");Ce("\\Darr","\\Downarrow");Ce("\\lang","\\langle");Ce("\\rang","\\rangle");Ce("\\uarr","\\uparrow");Ce("\\uArr","\\Uparrow");Ce("\\Uarr","\\Uparrow");Ce("\\N","\\mathbb{N}");Ce("\\R","\\mathbb{R}");Ce("\\Z","\\mathbb{Z}");Ce("\\alef","\\aleph");Ce("\\alefsym","\\aleph");Ce("\\Alpha","\\mathrm{A}");Ce("\\Beta","\\mathrm{B}");Ce("\\bull","\\bullet");Ce("\\Chi","\\mathrm{X}");Ce("\\clubs","\\clubsuit");Ce("\\cnums","\\mathbb{C}");Ce("\\Complex","\\mathbb{C}");Ce("\\Dagger","\\ddagger");Ce("\\diamonds","\\diamondsuit");Ce("\\empty","\\emptyset");Ce("\\Epsilon","\\mathrm{E}");Ce("\\Eta","\\mathrm{H}");Ce("\\exist","\\exists");Ce("\\harr","\\leftrightarrow");Ce("\\hArr","\\Leftrightarrow");Ce("\\Harr","\\Leftrightarrow");Ce("\\hearts","\\heartsuit");Ce("\\image","\\Im");Ce("\\infin","\\infty");Ce("\\Iota","\\mathrm{I}");Ce("\\isin","\\in");Ce("\\Kappa","\\mathrm{K}");Ce("\\larr","\\leftarrow");Ce("\\lArr","\\Leftarrow");Ce("\\Larr","\\Leftarrow");Ce("\\lrarr","\\leftrightarrow");Ce("\\lrArr","\\Leftrightarrow");Ce("\\Lrarr","\\Leftrightarrow");Ce("\\Mu","\\mathrm{M}");Ce("\\natnums","\\mathbb{N}");Ce("\\Nu","\\mathrm{N}");Ce("\\Omicron","\\mathrm{O}");Ce("\\plusmn","\\pm");Ce("\\rarr","\\rightarrow");Ce("\\rArr","\\Rightarrow");Ce("\\Rarr","\\Rightarrow");Ce("\\real","\\Re");Ce("\\reals","\\mathbb{R}");Ce("\\Reals","\\mathbb{R}");Ce("\\Rho","\\mathrm{P}");Ce("\\sdot","\\cdot");Ce("\\sect","\\S");Ce("\\spades","\\spadesuit");Ce("\\sub","\\subset");Ce("\\sube","\\subseteq");Ce("\\supe","\\supseteq");Ce("\\Tau","\\mathrm{T}");Ce("\\thetasym","\\vartheta");Ce("\\weierp","\\wp");Ce("\\Zeta","\\mathrm{Z}");Ce("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");Ce("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");Ce("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");Ce("\\bra","\\mathinner{\\langle{#1}|}");Ce("\\ket","\\mathinner{|{#1}\\rangle}");Ce("\\braket","\\mathinner{\\langle{#1}\\rangle}");Ce("\\Bra","\\left\\langle#1\\right|");Ce("\\Ket","\\left|#1\\right\\rangle");var SLe=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}};Ce("\\bra@ket",SLe(!1));Ce("\\bra@set",SLe(!0));Ce("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");Ce("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");Ce("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");Ce("\\angln","{\\angl n}");Ce("\\blue","\\textcolor{##6495ed}{#1}");Ce("\\orange","\\textcolor{##ffa500}{#1}");Ce("\\pink","\\textcolor{##ff00af}{#1}");Ce("\\red","\\textcolor{##df0030}{#1}");Ce("\\green","\\textcolor{##28ae7b}{#1}");Ce("\\gray","\\textcolor{gray}{#1}");Ce("\\purple","\\textcolor{##9d38bd}{#1}");Ce("\\blueA","\\textcolor{##ccfaff}{#1}");Ce("\\blueB","\\textcolor{##80f6ff}{#1}");Ce("\\blueC","\\textcolor{##63d9ea}{#1}");Ce("\\blueD","\\textcolor{##11accd}{#1}");Ce("\\blueE","\\textcolor{##0c7f99}{#1}");Ce("\\tealA","\\textcolor{##94fff5}{#1}");Ce("\\tealB","\\textcolor{##26edd5}{#1}");Ce("\\tealC","\\textcolor{##01d1c1}{#1}");Ce("\\tealD","\\textcolor{##01a995}{#1}");Ce("\\tealE","\\textcolor{##208170}{#1}");Ce("\\greenA","\\textcolor{##b6ffb0}{#1}");Ce("\\greenB","\\textcolor{##8af281}{#1}");Ce("\\greenC","\\textcolor{##74cf70}{#1}");Ce("\\greenD","\\textcolor{##1fab54}{#1}");Ce("\\greenE","\\textcolor{##0d923f}{#1}");Ce("\\goldA","\\textcolor{##ffd0a9}{#1}");Ce("\\goldB","\\textcolor{##ffbb71}{#1}");Ce("\\goldC","\\textcolor{##ff9c39}{#1}");Ce("\\goldD","\\textcolor{##e07d10}{#1}");Ce("\\goldE","\\textcolor{##a75a05}{#1}");Ce("\\redA","\\textcolor{##fca9a9}{#1}");Ce("\\redB","\\textcolor{##ff8482}{#1}");Ce("\\redC","\\textcolor{##f9685d}{#1}");Ce("\\redD","\\textcolor{##e84d39}{#1}");Ce("\\redE","\\textcolor{##bc2612}{#1}");Ce("\\maroonA","\\textcolor{##ffbde0}{#1}");Ce("\\maroonB","\\textcolor{##ff92c6}{#1}");Ce("\\maroonC","\\textcolor{##ed5fa6}{#1}");Ce("\\maroonD","\\textcolor{##ca337c}{#1}");Ce("\\maroonE","\\textcolor{##9e034e}{#1}");Ce("\\purpleA","\\textcolor{##ddd7ff}{#1}");Ce("\\purpleB","\\textcolor{##c6b9fc}{#1}");Ce("\\purpleC","\\textcolor{##aa87ff}{#1}");Ce("\\purpleD","\\textcolor{##7854ab}{#1}");Ce("\\purpleE","\\textcolor{##543b78}{#1}");Ce("\\mintA","\\textcolor{##f5f9e8}{#1}");Ce("\\mintB","\\textcolor{##edf2df}{#1}");Ce("\\mintC","\\textcolor{##e0e5cc}{#1}");Ce("\\grayA","\\textcolor{##f6f7f7}{#1}");Ce("\\grayB","\\textcolor{##f0f1f2}{#1}");Ce("\\grayC","\\textcolor{##e3e5e6}{#1}");Ce("\\grayD","\\textcolor{##d6d8da}{#1}");Ce("\\grayE","\\textcolor{##babec2}{#1}");Ce("\\grayF","\\textcolor{##888d93}{#1}");Ce("\\grayG","\\textcolor{##626569}{#1}");Ce("\\grayH","\\textcolor{##3b3e40}{#1}");Ce("\\grayI","\\textcolor{##21242c}{#1}");Ce("\\kaBlue","\\textcolor{##314453}{#1}");Ce("\\kaGreen","\\textcolor{##71B307}{#1}");var ELe={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Hqt{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 Fqt(zqt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Wpe(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 Zc("EOF",n.loc)),this.pushTokens(i),new Zc("",fc.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 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}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Zc(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 Wpe(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)||fg.hasOwnProperty(e)||ha.math.hasOwnProperty(e)||ha.text.hasOwnProperty(e)||ELe.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:fg.hasOwnProperty(e)&&!fg[e].primitive}}var Ype=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,AE=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),VF={"́":{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"}},Xpe={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let ALe=class MLe{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 Hqt(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 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 Zc("}")),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(MLe.endOfExpression.has(i.text)||r&&i.text===r||e&&fg[i.text]&&fg[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&&(NRe(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:fc.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h1?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]=sm,this._children[e]={},this._children[sm][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],St(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),St(Fc(this._in[e]),r),delete this._in[e],delete this._preds[e],St(Fc(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(Ka(r))r=sm;else{r+="";for(var n=r;!Ka(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!==sm)return r}}children(e){if(Ka(e)&&(e=sm),this._isCompound){var r=this._children[e];if(r)return Fc(r)}else{if(e===sm)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Fc(r)}successors(e){var r=this._sucs[e];if(r)return Fc(r)}neighbors(e){var r=this.predecessors(e);if(r)return RH(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;St(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),St(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&&St(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return kw(e)||(e=Ay(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p0(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return OC(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,Ka(n)||(n=""+n);var o=rx(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Ka(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=jqt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,Zpe(this._preds[r],e),Zpe(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?HF(this._isDirected,arguments[0]):rx(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?HF(this._isDirected,arguments[0]):rx(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?HF(this._isDirected,arguments[0]):rx(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],Jpe(this._preds[r],e),Jpe(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=p0(n);return r?e0(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=p0(n);return r?e0(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))}}rl.prototype._nodeCount=0;rl.prototype._edgeCount=0;function Zpe(t,e){t[e]?t[e]++:t[e]=1}function Jpe(t,e){--t[e]||delete t[e]}function rx(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+Kpe+a+Kpe+(Ka(n)?qqt:n)}function jqt(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 HF(t,e){return rx(t,e.v,e.w,e.name)}function k0(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Yqt(t),edges:Xqt(t)};return Ka(t.graph())||(e.value=mR(t.graph())),e}function Yqt(t){return cs(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ka(r)||(i.value=r),Ka(n)||(i.parent=n),i})}function Xqt(t){return cs(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ka(e.name)||(n.name=e.name),Ka(r)||(n.value=r),n})}var dn=new Map,pg=new Map,_Le=new Map,PLe=x(()=>{pg.clear(),_Le.clear(),dn.clear()},"clear"),o5=x((t,e)=>{const r=pg.get(e)||[];return de.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),Kqt=x((t,e)=>{const r=pg.get(e)||[];return de.info("Descendants of ",e," is ",r),de.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||o5(t.v,e)||o5(t.w,e)||r.includes(t.w):(de.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),sj=x((t,e,r,n)=>{de.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),de.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)sj(a,e,r,n);else{const s=e.node(a);de.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(de.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(de.debug("Setting parent",a,t),r.setParent(a,t)):(de.info("In copy ",t,"root",n,"data",e.node(t),n),de.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);de.debug("Copying Edges",o),o.forEach(l=>{de.info("Edge",l);const u=e.edge(l.v,l.w,l.name);de.info("Edge data",u,n);try{if(Kqt(l,n)){const h=pg.get(n)||[],d=h.includes(l.v)||o5(l.v,n)||l.v===n,f=h.includes(l.w)||o5(l.w,n)||l.w===n;if(d&&f)de.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),de.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;de.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else de.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){de.error(h)}})}de.debug("Removing node",a),e.removeNode(a)})},"copy"),BLe=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)_Le.set(i,t),n=[...n,...BLe(i,e)];return n},"extractDescendants"),Zqt=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),l4=x((t,e,r)=>{const n=e.children(t);if(de.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=l4(a,e,r),o=Zqt(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),Qpe=x(t=>!dn.has(t)||!dn.get(t).externalConnections?t:dn.has(t)?dn.get(t).id:t,"getAnchorId"),Jqt=x((t,e)=>{var r;if(!t||e>10){de.debug("Opting out, no graph ");return}else de.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(de.warn("Cluster identified",n," Replacement id in edges: ",l4(n,t,n)),pg.set(n,BLe(n,t)),dn.set(n,{id:l4(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(de.debug("Cluster identified",n,pg),a.forEach(s=>{const o=o5(s.v,n),l=o5(s.w,n);o^l&&(de.warn("Edge: ",s," leaves cluster ",n),de.warn("Descendants of XXX ",n,": ",pg.get(n)),dn.get(n).externalConnections=!0)})):de.debug("Not a cluster ",n,pg)});for(let n of dn.keys()){const i=dn.get(n).id,a=t.parent(i);a!==n&&dn.has(a)&&!dn.get(a).externalConnections&&(dn.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=dn.get(n))!=null&&r.externalConnections)&&s&&zLe(t,i,n)){const o=ejt(t,n,t.parent(i));o&&(dn.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),de.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(de.warn("Fix XXX",dn,"ids:",n.v,n.w,"Translating: ",dn.get(n.v)," --- ",dn.get(n.w)),dn.get(n.v)||dn.get(n.w)){if(de.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=Qpe(n.v),s=Qpe(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);dn.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);dn.get(o).externalConnections=!0,i.toCluster=n.w}de.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),de.warn("Adjusted Graph",k0(t)),$Le(t,0),de.trace(dn)},"adjustClustersAndEdges"),$Le=x((t,e)=>{var i,a,s,o;if(de.warn("extractor - ",e,k0(t),t.children("D")),e>10){de.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){de.debug("Done, no node has children",t.nodes());return}de.debug("Nodes = ",r,e);for(const l of r)if(de.debug("Extracting node",l,dn,dn.has(l)&&!dn.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!dn.has(l))de.debug("Not a cluster",l,e);else if((a=(i=dn.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){de.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=dn.get(l).clusterData.dir,h=new rl({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});sj(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:dn.get(l).clusterData,label:dn.get(l).label,graph:h}),de.warn("Subgraph for cluster with explicit dir created:",l,k0(h))}else if(!dn.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){de.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=dn.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=dn.get(l).clusterData.dir,de.warn("Fixing dir",dn.get(l).clusterData.dir,h));const d=new rl({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});sj(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:dn.get(l).clusterData,label:dn.get(l).label,graph:d}),de.debug("Old graph after copy",k0(t))}else de.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!dn.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),de.debug(dn);r=t.nodes(),de.warn("New list of nodes",r);for(const l of r){const u=t.node(l);de.warn(" Now next level",l,u),u!=null&&u.clusterNode&&$Le(u.graph,e+1)}},"extractor"),FLe=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=FLe(t,i);r=[...r,...a]}),r},"sorter"),Qqt=x(t=>FLe(t,t.children()),"sortNodesByHierarchy"),zLe=x((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=dn.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),ejt=x((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||o5(i,r))continue;const a=l4(i,t,e);if(a&&!zLe(t,a,e))return a}return null},"findSafeAnchorNode");class tjt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return ege(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&ege(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,rjt)),n=n._prev;return"["+e.join(", ")+"]"}}function ege(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function rjt(t,e){if(t!=="_next"&&t!=="_prev")return e}var njt=Ay(1);function ijt(t,e){if(t.nodeCount()<=1)return[];var r=sjt(t,e||njt),n=ajt(r.graph,r.buckets,r.zeroIdx);return B4(cs(n,function(i){return t.outEdges(i.v,i.w)}))}function ajt(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)GF(t,e,r,s);for(;s=i.dequeue();)GF(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(GF(t,e,r,s,!0));break}}}return n}function GF(t,e,r,n,i){var a=i?[]:void 0;return St(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,oj(e,r,l)}),St(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,oj(e,r,u)}),t.removeNode(n.v),a}function sjt(t,e){var r=new rl,n=0,i=0;St(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),St(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=bv(i+n+3).map(function(){return new tjt}),s=n+1;return St(r.nodes(),function(o){oj(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function oj(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 ojt(t){var e=t.graph().acyclicer==="greedy"?ijt(t,r(t)):ljt(t);St(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,RD("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function ljt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,St(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return St(t.nodes(),i),e}function cjt(t){St(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 u9(t,e,r,n){var i;do i=RD(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function ujt(t){var e=new rl().setGraph(t.graph());return St(t.nodes(),function(r){e.setNode(r,t.node(r))}),St(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 VLe(t){var e=new rl({multigraph:t.isMultigraph()}).setGraph(t.graph());return St(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),St(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function tge(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 C_(t){var e=cs(bv(HLe(t)+1),function(){return[]});return St(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ka(i)||(e[i][n.order]=r)}),e}function hjt(t){var e=Rw(cs(t.nodes(),function(r){return t.node(r).rank}));St(t.nodes(),function(r){var n=t.node(r);My(n,"rank")&&(n.rank-=e)})}function djt(t){var e=Rw(cs(t.nodes(),function(a){return t.node(a).rank})),r=[];St(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;St(r,function(a,s){Ka(a)&&s%i!==0?--n:n&&St(a,function(o){t.node(o).rank+=n})})}function rge(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),u9(t,"border",i,e)}function HLe(t){return Dg(cs(t.nodes(),function(e){var r=t.node(e).rank;if(!Ka(r))return r}))}function fjt(t,e){var r={lhs:[],rhs:[]};return St(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function pjt(t,e){return e()}function gjt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&St(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=e0(e.edges(),function(h){return l===age(t,t.node(h.v),o)&&l!==age(t,t.node(h.w),o)});return CZ(u,function(h){return VT(e,h)})}function JLe(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),_te(t),Ote(t,e),Rjt(t,e)}function Rjt(t,e){var r=wZ(t.nodes(),function(i){return!e.node(i).parent}),n=Ajt(t,r);n=n.slice(1),St(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 Ljt(t,e,r){return t.hasEdge(e,r)}function age(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function Ijt(t){switch(t.graph().ranker){case"network-simplex":sge(t);break;case"tight-tree":Djt(t);break;case"longest-path":Njt(t);break;default:sge(t)}}var Njt=Dte;function Djt(t){Dte(t),WLe(t)}function sge(t){D5(t)}function Ojt(t){var e=u9(t,"root",{},"_root"),r=_jt(t),n=Dg(p0(r))-1,i=2*n+1;t.graph().nestingRoot=e,St(t.edges(),function(s){t.edge(s).minlen*=i});var a=Pjt(t)+1;St(t.children(),function(s){QLe(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function QLe(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=rge(t,"_bt"),u=rge(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,St(o,function(d){QLe(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,U=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:U,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:U,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function _jt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&St(a,function(s){r(s,i+1)}),e[n]=i}return St(t.children(),function(n){r(n,1)}),e}function Pjt(t){return OC(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function Bjt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,St(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function $jt(t,e,r){var n={},i;St(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 Fjt(t,e,r){var n=zjt(t),i=new rl({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return St(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),St(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Ka(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 zjt(t){for(var e;t.hasNode(e=RD("_root")););return e}function Vjt(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 Gjt(t){var e={},r=e0(t.nodes(),function(o){return!t.children(o).length}),n=Dg(cs(r,function(o){return t.node(o).rank})),i=cs(bv(n+1),function(){return[]});function a(o){if(!My(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),St(t.successors(o),a)}}var s=y1(r,function(o){return t.node(o).rank});return St(s,a),i}function Wjt(t,e){return cs(e,function(r){var n=t.inEdges(r);if(n.length){var i=OC(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 qjt(t,e){var r={};St(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ka(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),St(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Ka(a)&&!Ka(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=e0(r,function(i){return!i.indegree});return jjt(n)}function jjt(t){var e=[];function r(a){return function(s){s.merged||(Ka(s.barycenter)||Ka(a.barycenter)||s.barycenter>=a.barycenter)&&Yjt(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),St(i.in.reverse(),r(i)),St(i.out,n(i))}return cs(e0(e,function(a){return!a.merged}),function(a){return yv(a,["vs","i","barycenter","weight"])})}function Yjt(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 Xjt(t,e){var r=fjt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=y1(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(Kjt(!!e)),l=oge(a,i,l),St(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=oge(a,i,l)});var u={vs:B4(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function oge(t,e,r){for(var n;e.length&&(n=yR(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function Kjt(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function eIe(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=e0(i,function(g){return g!==s&&g!==o}));var u=Wjt(t,i);St(u,function(g){if(t.children(g.v).length){var m=eIe(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&Jjt(g,m)}});var h=qjt(u,r);Zjt(h,l);var d=Xjt(h,n);if(s&&(d.vs=B4([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 Zjt(t,e){St(t,function(r){r.vs=B4(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function Jjt(t,e){Ka(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 Qjt(t){var e=HLe(t),r=lge(t,bv(1,e+1),"inEdges"),n=lge(t,bv(e-1,-1,-1),"outEdges"),i=Gjt(t);cge(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){eYt(o%2?r:n,o%4>=2),i=C_(t);var u=Vjt(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 nYt(t){var e={},r=0;function n(i){var a=r;St(t.children(i),n),e[i]={low:a,lim:r++}}return St(t.children(),n),e}function iYt(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=yR(a);return St(a,function(h,d){var f=sYt(t,h),p=f?t.node(f).order:l;(f||h===u)&&(St(a.slice(o,d+1),function(g){St(t.predecessors(g),function(m){var U=t.node(m),y=U.order;(yu)&&tIe(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return St(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 OC(e,i),r}function sYt(t,e){if(t.node(e).dummy)return wZ(t.predecessors(e),function(r){return t.node(r).dummy})}function tIe(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 oYt(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function lYt(t,e,r,n){var i={},a={},s={};return St(e,function(o){St(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),St(e,function(o){var l=-1;St(o,function(u){var h=n(u);if(h.length){h=y1(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",()=>MYt(t));r(" runLayout",()=>bYt(n,r)),r(" updateInputGraph",()=>vYt(t,n))})}function bYt(t,e){e(" makeSpaceForEdgeLabels",()=>RYt(t)),e(" removeSelfEdges",()=>$Yt(t)),e(" acyclic",()=>ojt(t)),e(" nestingGraph.run",()=>Ojt(t)),e(" rank",()=>Ijt(VLe(t))),e(" injectEdgeLabelProxies",()=>LYt(t)),e(" removeEmptyRanks",()=>djt(t)),e(" nestingGraph.cleanup",()=>Bjt(t)),e(" normalizeRanks",()=>hjt(t)),e(" assignRankMinMax",()=>IYt(t)),e(" removeEdgeLabelProxies",()=>NYt(t)),e(" normalize.run",()=>vjt(t)),e(" parentDummyChains",()=>tYt(t)),e(" addBorderSegments",()=>gjt(t)),e(" order",()=>Qjt(t)),e(" insertSelfEdges",()=>FYt(t)),e(" adjustCoordinateSystem",()=>mjt(t)),e(" position",()=>UYt(t)),e(" positionSelfEdges",()=>zYt(t)),e(" removeBorderNodes",()=>BYt(t)),e(" normalize.undo",()=>wjt(t)),e(" fixupEdgeLabelCoords",()=>_Yt(t)),e(" undoCoordinateSystem",()=>Ujt(t)),e(" translateGraph",()=>DYt(t)),e(" assignNodeIntersects",()=>OYt(t)),e(" reversePoints",()=>PYt(t)),e(" acyclic.undo",()=>cjt(t))}function vYt(t,e){St(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))}),St(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 xYt=["nodesep","edgesep","ranksep","marginx","marginy"],wYt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},TYt=["acyclicer","ranker","rankdir","align"],CYt=["width","height"],kYt={width:0,height:0},SYt=["minlen","weight","width","height","labeloffset"],EYt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},AYt=["labelpos"];function MYt(t){var e=new rl({multigraph:!0,compound:!0}),r=YF(t.graph());return e.setGraph(zi({},wYt,jF(r,xYt),yv(r,TYt))),St(t.nodes(),function(n){var i=YF(t.node(n));e.setNode(n,X6e(jF(i,CYt),kYt)),e.setParent(n,t.parent(n))}),St(t.edges(),function(n){var i=YF(t.edge(n));e.setEdge(n,zi({},EYt,jF(i,SYt),yv(i,AYt)))}),e}function RYt(t){var e=t.graph();e.ranksep/=2,St(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 LYt(t){St(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};u9(t,"edge-proxy",a,"_ep")}})}function IYt(t){var e=0;St(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=Dg(e,n.maxRank))}),t.graph().maxRank=e}function NYt(t){St(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function DYt(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)}St(t.nodes(),function(u){l(t.node(u))}),St(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,St(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),St(t.edges(),function(u){var h=t.edge(u);St(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 OYt(t){St(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(tge(n,a)),r.points.push(tge(i,s))})}function _Yt(t){St(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 PYt(t){St(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function BYt(t){St(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(yR(r.borderLeft)),s=t.node(yR(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}}),St(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function $Yt(t){St(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 FYt(t){var e=C_(t);St(e,function(r){var n=0;St(r,function(i,a){var s=t.node(i);s.order=a+n,St(s.selfEdges,function(o){u9(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 zYt(t){St(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 jF(t,e){return MD(yv(t,e),Number)}function YF(t){var e={};return St(t,function(r,n){e[n.toLowerCase()]=r}),e}var uge=x((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),hge=x((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),VYt=x(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),HYt=x((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return hge(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":hge(i)},"getSelfLoopSide"),GYt=x((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=uge(Math.max(n,t.width*.35),36,l),h=uge(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"),WYt=x((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),nIe=x((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(b=>i.push(b));return}o.sort((b,v)=>b.edge.selfLoop.order-v.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(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=HYt(t,f,o,d.start,a),m=GYt(f,g,e,p.width??0),U=WYt(f,m,g,e,p),y={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:U.x,y:U.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 y.selfLoop,delete y.originalEdge,i.push({edge:y,start:y.start,end:y.end})}),i},"getEdgesToRender"),iIe=x(async(t,e,r,n,i,a)=>{de.warn("Graph in recursive render:XAX",k0(e),i);const s=e.graph().rankdir;de.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?de.info("Recursive render XXX",e.nodes()):de.info("No nodes found for",e),e.edges().length>0&&de.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=VYt(r);await Promise.all(e.nodes().map(async function(b){const v=e.node(b);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));de.trace(`Setting data for parent cluster XXX Node.id = `,b,` - data=`,T.height,` -Parent cluster`,i.height),e.setNode(i.id,T),e.parent(b)||(de.trace("Setting parent",b,i.id),e.setParent(b,i.id,T))}if(de.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),x!=null&&x.clusterNode){de.info("Cluster identified XBX",b,x.width,e.node(b));const{ranksep:T,nodesep:C}=e.graph();x.graph.setGraph({...x.graph.graph(),ranksep:T+25,nodesep:C});const S=await qLe(d,x.graph,r,n,e.node(b),s),k=S.elem;Tr(x,k),x.diff=S.diff||0,de.info("New compound node after recursive render XAX",b,"width",x.width,"height",x.height),LSt(k,x)}else e.children(b).length>0?(de.trace("Cluster - the non recursive path XBX",b,x.id,x,x.width,"Graph:",e),de.trace(s3(x.id,e)),un.set(x.id,{id:s3(x.id,e),node:x})):(de.trace("Node - the non recursive path XAX",b,d,e.node(b),a),await s7(d,e.node(b),{config:s,dir:a}))})),await w(async()=>{const b=e.edges().map(async function(x){const T=e.edge(x.v,x.w,x.name);if(de.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),de.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),de.info("Fix",un,"ids:",x.v,x.w,"Translating: ",un.get(x.v),un.get(x.w)),f&&T.selfLoop){if(T.selfLoop.order!==1)return;const C=T.id;T.id=T.selfLoop.id,await CL(h,T),T.id=C;return}await CL(h,T)});await Promise.all(b)},"processEdges")(),de.info("Graph before layout:",JSON.stringify(k0(e))),de.info("############################################# XXX"),de.info("### Layout ### XXX"),de.info("############################################# XXX"),GLe(e),de.info("Graph after layout:",JSON.stringify(k0(e)));let g=0,{subGraphTitleTotalMargin:m}=U3(s);await Promise.all(_Ut(e).map(async function(b){var T;const x=e.node(b);if(de.info("Position XBX => "+b+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,de.info("A tainted cluster node XBX1",b,x.id,x.width,x.height,x.x,x.y,e.parent(b)),un.get(x.id).node=x,TL(x);else if(e.children(b).length>0){de.info("A pure cluster node XBX1",b,x.id,x.x,x.y,x.width,x.height,e.parent(b)),x.height+=m,e.node(x.parentId);const C=(x==null?void 0:x.padding)/2||0,S=((T=x==null?void 0:x.labelBBox)==null?void 0:T.height)||0,k=S-C||0;de.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await TD(l,x),un.get(x.id).node=x}else{const C=e.node(x.parentId);x.y+=m/2,de.info("A regular node XBX1 - using the padding",x.id,"parent",x.parentId,x.width,x.height,x.x,x.y,"offsetY",x.offsetY,"parent",C,C==null?void 0:C.offsetY,x),TL(x)}}));const y=m/2;return WLe(e,y,{mergeSelfLoops:f}).forEach(function({edge:b,start:x,end:T}){de.info("Edge "+x+" -> "+T+": "+JSON.stringify(b),b),b.points.forEach(E=>E.y+=y);const C=e.node(x),S=e.node(T),k=IJ(u,b,un,r,C,S,n);FAe(b,k)}),e.nodes().forEach(function(b){const x=e.node(b);de.info(b,x.type,x.diff),x.isGroup&&(g=x.diff)}),de.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),CYt=w(async(t,e)=>{var s,a,o,l,u,h;const r=new rl({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((s=t.config)==null?void 0:s.nodeSpacing)||((o=(a=t.config)==null?void 0:a.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");NJ(n,t.markers,t.type,t.diagramId),PAe(),BAe(),g6e(),kLe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),de.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),b=structuredClone(d),x=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},b.originalEdge=y,b.selfLoop={id:y.id,order:1},x.originalEdge=y,x.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",b.startLabelRight="",b.startLabelLeft="",b.endLabelLeft="",b.endLabelRight="",b.arrowTypeStart="none",b.arrowTypeEnd="none",b.id=f+"-cyclic-special-mid",x.label="",x.startLabelRight="",x.startLabelLeft="",x.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,x.toCluster=f),x.id=f+"-cyclic-special-2",x.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,b,f+"-cyclic-special-1"),r.setEdge(g,f,x,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),de.warn("Graph at first:",JSON.stringify(k0(r))),RUt(r),de.warn("Graph after XAX:",JSON.stringify(k0(r)));const i=He();await qLe(n,r,t.type,t.diagramId,void 0,i)},"render");const kYt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:WLe,render:CYt},Symbol.toStringTag,{value:"Module"}));async function ULe(t,e){const r=new rl({multigraph:!0,compound:!0}),n=[...e.edges],i=He(),s=t.insert("g").attr("class","root"),a=s.insert("g").attr("class","clusters"),o=s.insert("g").attr("class","edges edgePath"),l=s.insert("g").attr("class","edgeLabels"),u=s.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 s7(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 Mr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>Ekr);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:a,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:s},nodeElements:h}}w(ULe,"createGraphWithElements");var rge=5,EM=1e-5,AM=1e-6;function DI(t){const e=[];for(let r=0;r=1-AM||f<=AM||f>=1-AM?null:{point:{x:t.x+d*i,y:t.y+d*s},tA:d,tB:f}}w(jLe,"segmentIntersection");function tj(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}w(tj,"isHorizontalSeg");function YLe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}w(XLe,"getArcSweepFlag");var SYt=.001;function KLe(t,e){if(t.length<2)return t.map(s=>({...s}));const r=t.map(s=>({...s})),n=e.arrowTypeStart&&Wa[e.arrowTypeStart];if(n){const s=t[0],a=t[1],o=Math.atan2(a.y-s.y,a.x-s.x);r[0].x=s.x+n*Math.cos(o),r[0].y=s.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&Wa[e.arrowTypeEnd];if(i){const s=t.length,a=t[s-2],o=t[s-1],l=Math.atan2(o.y-a.y,o.x-a.x);r[s-1].x=o.x-i*Math.cos(l),r[s-1].y=o.y-i*Math.sin(l)}return r}w(KLe,"applyMarkerOffsets");function ZLe(t,e,r,n,i){const s=t.point.x,a=t.point.y,o={x:s-e*t.r,y:a-r*t.r},l={x:s+e*t.r,y:a+r*t.r},u=[`L${fx(o)}`];return i==="arc"?u.push(`A${gh(t.r)},${gh(t.r)} 0 0 ${n} ${fx(l)}`):u.push(`M${fx(l)}`),u}w(ZLe,"emitJump");function rj(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,s),u=Math.hypot(a,o);if(l0){const x=rj(i[u-1],i[u],i[u+1]??i[u],rge);x&&(m=x.cutLen)}let y=d,v=null;s&&ux.t-T.t);for(const x of b)x.r=Math.min(x.r,x.d-m,y-x.d);for(let x=0;xT){const C=T/2;b[x].r=Math.min(b[x].r,C),b[x+1].r=Math.min(b[x+1].r,C)}}for(const x of b)x.r=2?n:null}catch{return null}}w(tIe,"decodeDataPoints");function rIe(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 s=[],a=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;a.set(u.id,d);const p=tIe(d.getAttribute("data-points"))??u.points;s.push({...u,points:p})}const o=YLe(s);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 s){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&&!eIe(f))continue;const p=a.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!JLe(x))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,b=QLe(u,h,r);if(p.setAttribute("d",b),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const x=p.getTotalLength(),T=Math.max(0,x-y-v),C=`0 ${y} ${T} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}w(rIe,"applyLineJumpsToSvg");async function nIe(t,e){var i,s;for(const a of t.nodes)a.isGroup?await TD(e.clusters,a):TL(a);const r=new Map;for(const a of t.nodes)a!=null&&a.id&&r.set(a.id,a);for(const a of t.edges){const o=a.start?r.get(a.start)??{}:{},l=a.end?r.get(a.end)??{}:{},u=IJ(e.edgePaths,{...a},{},t.type,o,l,t.diagramId);a.label&&await CL(e.rootGroups,a),a.label&&iIe(a,u)}const n=(s=(i=t.config)==null?void 0:i.swimlane)==null?void 0:s.lineHops;if(n!==!1){const a=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}));rIe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:a})}}w(nIe,"adjustLayout");function iIe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=xr(),{subGraphTitleTotalMargin:i}=U3({flowchart:n.flowchart??{}});if(t.label){const s=y6.get(t.id);let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const s=Ys.get(t.id).startLeft;let a=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=Ys.get(t.id).startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=Ys.get(t.id).endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=Ys.get(t.id).endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}}w(iIe,"positionEdgeLabel");var Wz="__swimlane_default__",EYt=21,nge=20;function nj(t){return Math.max(t.padding??nge,nge)}w(nj,"topLaneHorizontalPadding");function sIe(t){const{x:e,y:r,width:n,height:i}=t,s=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof s!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(s)||n<=0||i<=0){delete t.groupTitleRect;return}const a=r-i/2,o=Math.min(s,r+i/2),l=Math.min(EYt,Math.max(0,o-a)),u=a+l;if(u<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:a,bottom:u}}w(sIe,"assignTopLaneTitleRect");function aIe(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const s of t.nodes??[])s.isGroup&&!s.parentId&&(s.shape="swimlane",e&&(s.direction=e));const n=r.filter(s=>!s.isGroup&&!s.parentId);if(n.length===0)return;let i=r.find(s=>s.id===Wz);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:Wz,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const s of n)s.parentId=Wz}w(aIe,"prepareLayoutForSwimlanes");function oIe(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),s=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...s].map(l=>l.id),edges:r,layout:t,nodeById:e}}w(oIe,"toGraphView");function lIe(t,e,r,n){const{layout:i}=t,s=t.nodeById,a=(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=s.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*a;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(b=>b.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const b of p){const x=b.x??r.x[b.id],T=b.y??r.y[b.id],C=b.width??0,S=b.height??0;x!=null&&T!=null&&(g=Math.min(g,x-C/2),m=Math.max(m,x+C/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 b=f.padding??20,x=f.parentId?b:2*nj(f),T=b,C=Math.max(0,m-g)+x,S=Math.max(0,v-y)+T,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),b=m+2*v,x=(f+p)/2;for(const A of d)A.y=x,A.height=b,A.swimlaneContentTop=f;const T=[...d].sort((A,M)=>{const R=A.x??0,P=M.x??0;return R-P}),C=[],S=[],k=[];for(const A of T){const M=h.get(A.id);if(!M)continue;const R=Math.max(0,M.maxX-M.minX)+2*nj(A),P=(M.minX+M.maxX)/2;C.push(A.id),S.push(P),k.push(R)}const E=C.length;if(E>0){const A=new Map;if(E===1)A.set(C[0],k[0]);else{const M=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:px(e,r,n,i)}:void 0}w(Rte,"measuredNodeRect");function _te(t){if(t.isGroup)return;const e=Rte(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}w(_te,"nodeBoundsInfoFor");function Uu(t,e,r=oo){return Math.abs(t.x-e.x)r}w($s,"isHorizontalSegment");function Bs(t,e,r=oo){return Bn(t,e,r)&&Math.abs(t.y-e.y)>r}w(Bs,"isVerticalSegment");function Gl(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(Gl,"overlapLength");function zd(t,e,r=oo){return t.horizontal&&e.horizontal&&Vn(t.a,e.a,r)?Gl(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Bn(t.a,e.a,r)?Gl(t.a.y,t.b.y,e.a.y,e.b.y):0}w(zd,"sameAxisSegmentOverlapLength");function a3(t,e=oo){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Uu(i,n,e))&&r.push({x:n.x,y:n.y})}return r}w(Qn,"dedupeConsecutivePoints");function Lte(t,e=oo){if(!t||t.length!==4)return;const[r,n,i,s]=t;return $s(r,n,e)&&Bs(n,i,e)&&$s(i,s,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:s}:Bs(r,n,e)&&$s(n,i,e)&&Bs(i,s,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:s}:void 0}w(Lte,"classifyThreeSegmentRoute");function TP(t,e,r,n=0){const i=Math.min(t.x,e.x),s=Math.max(t.x,e.x),a=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return s>r.left-n&&ir.top-n&&ae.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}w(uIe,"rectContainsRect");function PI(t,e){return t.lefte.left&&t.tope.top}w(PI,"rectsOverlap");function ij(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}w(ij,"inflateRect");function px(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}w(px,"rectFromCenterSize");function Sc(t){var e;return(e=Rte(t))==null?void 0:e.rect}w(Sc,"rectOfNodeBounds");function dy(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(dy,"portForRectSide");function Nte(t,e,r,n,i,s=oo){const a=e==="left"||e==="right",o=n==="left"||n==="right";if(a&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Vn(t,r,s))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(Vn(t,r,s))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(!a&&!o){if(e===n){if(Bn(t,r,s))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(Bn(t,r,s))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(a&&!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(Nte,"buildOrthogonalPortPath");function Ote(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(Ote,"buildSameSideTrackPath");function CP(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=_te(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}w(CP,"collectRealNodeBounds");function Am(t){const e=[],r=[];for(const n of t){const i=_te(n);if(!i)continue;const s={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(s):e.push(s)}return{realNodeRects:e,labelNodeRects:r}}w(Am,"collectNodeRectEntries");function hIe(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,s=n.y??0,a=n.width??0,o=n.height??0;r.push({nodeId:n.id,...px(i,s,a,o)})}return r}w(hIe,"collectLayoutNodeRects");function Dte(t,e,r=oo){const n=t.start,i=t.end;if(!n||!i)return;const s=e.get(n),a=e.get(i);if(!(!s||!a))return{srcId:n,dstId:i,srcInfo:s,dstInfo:a,collinearX:Math.abs(s.cx-a.cx)g||fv)return!1;const b=Math.abs(m-h.a.x)i:s&&o&&Vn(t,r,i)?Gl(t.x,e.x,r.x,n.x)>i:!1}w(dIe,"sameAxisSegmentsOverlap");function $I(t,e,r,n,{epsilon:i=oo,skipDegenerateOther:s=!1}={}){for(const a of r){if(a===n||a.isLayoutOnly)continue;const o=a.points;if(!(!o||o.length<2))for(let l=0;lf+i&&gm+i&&dn+oo&&t=2?e[e.length-2]:void 0,l=(a?Bn(a,i):!1)?{x:i.x,y:s.y}:{x:s.x,y:i.y};e.push(l)}e.push(s)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!Uu(i,n))&&r.push(n)}return r}w(BI,"orthogonalizePolyline");function Zd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=pIe(e);if(e=n.points,!n.changed)break}return e}w(Zd,"simplifyPolyline");var Zr=.001,MYt=.5,ige=4;function $te(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length=0&&i=t.length)return t;const s=i-n;if(s<0||s>=t.length)return t;const a=gIe(t[i],t[s],e);return r?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}w(aj,"clipEndpoint");function mIe(t,e){for(const r of t){const n=$te(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=aj(i,n.srcRect,!0)),n.dstRect&&(i=aj(i,n.dstRect,!1)),i=Zd(BI(i)),i=Bte(i,n.srcRect,n.dstRect),n.edge.points=Zd(BI(i))}}w(mIe,"clipEdgeEndpointsToNodeBoundaries");function oj(t,e,r,n=!1){if(Vn(t,e,Zr)){if(e.yr.bottom+Zr)return e;if(n){if(t.xr.right+Zr)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(Bn(t,e,Zr)){if(e.xr.right+Zr)return e;if(n){if(t.yr.bottom+Zr)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(oj,"snapEndpointToBoundary");function FI(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(yIe,"intersectRanges");function cj(t,e){return e==="left"||e==="right"?zI(t.top,t.bottom):zI(t.left,t.right)}w(cj,"clearanceRangeForSide");function VI(t,e,r){const n=t.y>=r.top-Zr&&t.y<=r.bottom+Zr,i=t.x>=r.left-Zr&&t.x<=r.right+Zr;if(Vn(t,e,Zr)&&n){if(Math.abs(t.x-r.left)0?yIe(s):void 0}w(vIe,"straightClearanceRange");function uj(t,e,r,n,i){const s=vIe(t,e,r,n,i);if(!s)return;const a=i?t.y:t.x,o=Math.min(s.hi,Math.max(s.lo,a));if(!(Math.abs(o-a)({...o}));for(let o=e;o>=0&&o=r.left-Zr&&Math.max(t.x,e.x)<=r.right+Zr,i=Math.min(t.y,e.y)>=r.top-Zr&&Math.max(t.y,e.y)<=r.bottom+Zr;if(Math.abs(t.y-r.top)n.bottom+Zr;case"left":return Vn(e,r,Zr)&&r.xn.right+Zr}}w(fj,"leavesOutward");function pj(t,e,r){if(t.length<3)return t;if(r){const s=dj(t[0],t[1],e);return s&&fj(s,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=dj(t[n-1],t[n],e);return i&&fj(i,t[n-1],t[n-2],e)?t.slice(0,n):t}w(pj,"collapseOwnBorderStub");function wIe(t,e,r){let n=t;if(e){const s=FI(n,0,1);if(s){const a=oj(s,n[0],e);a!==n[0]&&(n=[a,...n.slice(1)])}n=pj(n,e,!0)}if(r){const s=n.length-1,a=FI(n,s,-1);if(a){const o=oj(a,n[s],r,!0);o!==n[s]&&(n=[...n.slice(0,s),o])}n=pj(n,r,!1)}const i=Bte(n,e,r);return i!==n||n.length===2?i:(e&&(n=hj(n,e,!0)),r&&(n=hj(n,r,!1)),n)}w(wIe,"snapAndCollapseEndpoints");function gj(t,e){for(const r of t){const n=$te(r,e,2);if(!n)continue;const i=Qn(n.points,Zr),s=wIe(i,n.srcRect,n.dstRect);if(s.length<3){n.edge.points=s;continue}const a=[s[0],{...s[0]},...s.slice(1,-1),s[s.length-1],{...s[s.length-1]}];n.edge.points=a}}w(gj,"prepareEdgeEndpointsForRenderer");function Fte(t){return new Map(t.map(e=>[e.id,e]))}w(Fte,"buildNodeMap");function TIe(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(TIe,"resolveTopLevelGroupId");function mj(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(mj,"groupDepth");function zte(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const s of t){const a=s.x,o=s.y;if(typeof a!="number"||typeof o!="number")continue;const l=s.width??0,u=s.height??0;e=Math.min(e,a-l/2),r=Math.max(r,a+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(zte,"boundsForChildren");function CIe(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(CIe,"applyGroupBounds");function kIe(t){const e=Fte(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>mj(i,e)-mj(n,e));for(const n of r){const i=t.filter(a=>a.parentId===n.id),s=zte(i);s&&CIe(n,s)}}w(kIe,"recomputeNestedGroupBounds");function HI(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let s=1/0,a=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(s=Math.min(s,u),a=Math.max(a,u))}if(!Number.isFinite(s)||!Number.isFinite(a))return!1;const o=w(l=>s+a-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(HI,"mirrorAxis");function SIe(t){return(t.nodes??[]).some(r=>!r.isGroup)?HI(t,"y"):!0}w(SIe,"applyBtDirectionTransform");function EIe(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(N=>!N.isGroup);let s=1/0,a=1/0;for(const N of i){const L=N.x??0,I=N.y??0;L0?Math.max(1,h/d):1;for(const N of i){const L=N.x??0,$=((N.y??0)-a)*f+o,O=L-s;N.x=$,N.y=O}for(const N of n)if(N.points)for(const L of N.points){const I=L.x,O=(L.y-a)*f+o,D=I-s;L.x=O,L.y=D}kIe(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&HI(t,"x"),!0;const g=Fte(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=TIe(N,g);if(!L)continue;const I=m.get(L)??[];I.push(N),m.set(L,I)}let y=0;for(const N of p){const L=N.padding??0;L>y&&(y=L)}const v=[];let b=1/0,x=-1/0;for(const N of p){const L=m.get(N.id)??[],I=zte(L);I&&(b=Math.min(b,I.minX),x=Math.max(x,I.maxX),v.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(b===1/0||x===-1/0)return!0;const T=Math.max(0,x-b),C=Math.max(y,10),S=T+2*C,k=o+S,M=(b+x)/2-S/2-o,R=M+k/2,P=Math.max(y,o);v.sort((N,L)=>N.centerY-L.centerY);for(let N=0;Nf.cy?v.bottom:v.top,P=f.cx+b;if(P<=v.left+rh||P>=v.right-rh)continue;x={x:P,y:R},T={x:P,y:o.y},C={x:o.x,y:o.y}}else{const R=p.cx>f.cx?v.right:v.left,P=f.cy+b;if(P<=v.top+rh||P>=v.bottom-rh)continue;x={x:R,y:P},T={x:o.x,y:P},C={x:o.x,y:o.y}}const S=Uu(x,T,rh),k=Uu(T,C,rh);if(S&&k||!S&&Js(x,T,n,[h],1)||!k&&Js(T,C,n,[d],1))continue;const E=!S&&$I(x,T,t,i,{epsilon:rh,skipDegenerateOther:!0}),A=!k&&$I(T,C,t,i,{epsilon:rh,skipDegenerateOther:!0});if(!(E||A)){S?y=[T,C]:k?y=[x,T]:y=[x,T,C];break}}y&&(i.points=y)}}w(AIe,"portSwapToLShape");function MIe(t,e){const{realNodeRects:s,labelNodeRects:a}=Am(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Qn(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,b=f.y-p.y;if(Math.hypot(v,b)<.001)continue;const T=$s(f,d,.001),C=Bs(f,d,.001),S=$s(p,f,.001),k=Bs(p,f,.001);if(!(T&&k||C&&S))continue;const E=o.end,A=o.start,M=E?e.get(E):void 0;if(!M)continue;const R=M.x??0,P=M.y??0,N=Sc(M);if(!N)continue;let L,I;if(k){const F=b<0;L={x:R,y:p.y},I={x:R,y:F?N.bottom:N.top}}else{const F=v>0;L={x:p.x,y:P},I={x:F?N.right:N.left,y:P}}if(Js(L,I,s,E?[E]:[],-2)||Js(L,I,a,[],-2))continue;if(A){const F=e.get(A),H=F?Sc(F):void 0;if(H&&Ite(L,H,2))continue}const $=w((F,H)=>`${F.x.toFixed(3)},${F.y.toFixed(3)}|${H.x.toFixed(3)},${H.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let F=0;F{for(const G of t){if(G===o||G.isLayoutOnly)continue;const W=G.points;if(!(!W||W.length<2))for(let K=0;K=0){const F=u[h-3],H=[A,E].filter(G=>!!G);if(Js(F,L,s,H,-2)||D(F,L))continue}const z=[...u.slice(0,h-2),L,I];o.points=z;const V=o.labelNodeId;if(V){const F=e.get(V);if(F){const H=F.width??0,G=F.height??0;if(H>0&&G>0){let W,K,q=-1;for(let oe=0;oe=H+2||me&&ne>=G+2)&&ne>q&&(q=ne,W=(Z.x+Q.x)/2,K=(Z.y+Q.y)/2)}W!==void 0&&K!==void 0&&(F.x=W,F.y=K)}}}}}w(MIe,"collapseShortTerminalStub");var vr=.001,no=8,vn=a3,qz=w((t,e)=>Bn(t,e,vr)||Vn(t,e,vr),"orthogonallyAligned");function RIe(t,e){const i=w((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,b=g.y-y;let x=(p.width??0)/2,T=(p.height??0)/2;return Math.abs(b)*x>Math.abs(v)*T?(b<0&&(T=-T),{x:m+(b===0?0:T*v/b),y:y+T}):(v<0&&(x=-x),{x:m+x,y:y+(v===0?0:x*b/v)})},"rectIntersect"),s=w((p,g)=>{const m=Qn(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,b=v?Sc(v):void 0;if(!v||!y||!b)return;const x=g?m[0]:m[m.length-1],T=g?m[1]:m[m.length-2],C=i(v,x);let S=x;if(qz(T,C)&&(S=T),Bn(C,S,vr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:b};if(Vn(C,S,vr))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:b}},"terminalLaneFor"),a=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)&&Bn(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Vn(p.boundary,g.boundary,1),"sameTerminalFace"),l=w((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:a(p,g)>=no&&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=a(p,g);if(m2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=w((p,g)=>{const m=Qn(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?Vn(y,p.boundary,vr)&&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?Bn(y,p.boundary,vr)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&Uu(m[1],p.railEnd,vr),k=m.slice(S?2:1),E=k[0];return E&&!qz(E,v)?void 0:[y,v,...k]}const x=m.length>1&&Uu(m[m.length-2],p.railEnd,vr),T=m.slice(0,x?-2:-1),C=T[T.length-1];if(!(C&&!qz(C,v)))return[...T,v,y]},"shiftedCandidate"),d=w(p=>{const g=p.edge,m=Qn(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,b=y?e.get(y):void 0,x=v?e.get(v):void 0;if(!b||!x)return!1;const T=b.x??0,C=b.y??0,S=x.x??0,k=x.y??0,[E,A]=m;return Vn(E,A,vr)&&Math.abs(C-k)<1&&Math.abs(T-S)>1||Bn(E,A,vr)&&Math.abs(T-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[s(y,!0),s(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y{const E=d(S),A=d(k);return E!==A?Number(E)-Number(A):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const A=s({...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(RIe,"separateSharedRenderedTerminalLanes");function _Ie(t,e){const{realNodeRects:n,labelNodeRects:i}=Am(e.values()),s=w((o,l)=>{const u=o.start,h=o.end,d=vn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Js(p.a,p.b,n,f,-2)||Js(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 vn(Qn(g)))if(zd(m,y,.5)>=no||dp(m.a,m.b,y.a,y.b,vr))return!1}}return!0},"candidateIsSafe"),a=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=$s(u,h)&&Bs(h,d)&&$s(d,f)&&Bs(f,p)&&Bn(u,f,vr)&&Bn(u,p,vr)&&Bn(h,d,vr)&&(h.x-u.x)*(f.x-d.x)<0,m=Bs(u,h)&&$s(h,d)&&Bs(d,f)&&$s(f,p)&&Vn(u,f,vr)&&Vn(u,p,vr)&&Vn(h,d,vr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Qn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Bs(u,h)&&$s(h,d)&&Bs(d,f)&&$s(f,p)&&Bs(p,y)&&Bn(u,p,vr)&&Bn(u,y,vr)&&Bn(d,f,vr)&&(d.x-h.x)*(p.x-f.x)<0,b=$s(u,h)&&Bs(h,d)&&$s(d,f)&&Bs(f,p)&&$s(p,y)&&Vn(u,p,vr)&&Vn(u,y,vr)&&Vn(d,f,vr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!b))return Qn([...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=Qn(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=a(h,d);if(!(!f||!s(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}w(_Ie,"collapseRedundantRectangularDoglegs");function yj(t,e){const{realNodeRects:s,labelNodeRects:a}=Am(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=w((g,m,y)=>Qn(g===m?y??[]:g.points??[]),"pointsFor"),u=w((g,m)=>{let y=0;for(let v=0;v{const m=vn(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 s.filter(v=>{if(y.includes(v.id))return!1;const b=v.rect;return m.horizontal?Gl(m.a.x,m.b.x,b.left,b.right)>=no&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Gl(m.a.y,m.b.y,b.top,b.bottom)>=no&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=w((g,m,y)=>{const v=g.map(x=>({...x}));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 b=Zd(Qn(v));return vn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=w((g,m,y)=>{const v=[g.start,g.end].filter(x=>!!x),b=vn(m);if(b.length!==m.length-1)return!1;for(const x of b)if(Js(x.a,x.b,s,v,-2)||Js(x.a,x.b,a,[],-2))return!1;for(const x of o)if(x!==g){for(const T of b)for(const C of vn(l(x)))if(zd(T,C,.5)>=no)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 b=l(v),x=h(b);if(!x)continue;const T=d(v,x.segment);if(T.length===0)continue;const C=x.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 C){const k=f(b,x.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}w(yj,"liftObstacleHuggingSameSideRails");function vj(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+vr||h>=u.bottom-vr?!1:Gl(l.a.x,l.b.x,u.left,u.right)>=no},"horizontalSegmentIntersectsTitle"),a=[...e.values()].map(i).filter(l=>!!l);if(a.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Qn(l.points??[]);for(const h of vn(u))for(const d of a)s(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=vr))for(const l of a){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(vj,"liftTopLaneTitleBandsAboveRails");function bj(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+vr||d>=h.right-vr?!1:Gl(u.a.y,u.b.y,h.top,h.bottom)>=no},"verticalSegmentIntersectsTitle"),a=w((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+vr||d>=h.bottom-vr?!1:Gl(u.a.x,u.b.x,h.left,h.right)>=no},"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=Qn(u.points??[]);for(const d of vn(h))for(const f of o)if(s(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(a(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=vr))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(bj,"shiftLeftLaneTitleBandsLeftOfRails");function LIe(t,e){const{realNodeRects:n}=Am(e.values()),i=t.filter(g=>!g.isLayoutOnly),s=w((g,m=new Map)=>Qn(m.get(g)??g.points??[]),"replacementPointsFor"),a=w((g=new Map)=>{let m=0;for(let y=0;yi.reduce((m,y)=>m+Vc(s(y,g)),0),"totalBends"),l=w(g=>{const m=s(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!$s(y,v,vr)&&!Bs(y,v,vr)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=w((g,m)=>{const y=s(g);if(y.length<3)return;const v=y[0],b=y[1];let x;if($s(v,b,vr))x={x:b.x,y:m.tailStart.y};else if(Bs(v,b,vr))x={x:m.tailStart.x,y:b.y};else return;const T=Zd(Qn([v,b,x,m.tailStart,m.terminal]));return vn(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 vn(m))if(Js(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 b of vn(m))for(const x of vn(s(v,y)))if(zd(b,x,.5)>=no)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)||s(m).length<4)continue;const b=g.get(y)??[];b.push(m),g.set(y,b)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=a();if(m===0)return;const y=o();let v,b=m,x=y;for(const T of p().values())for(let C=0;C=m||L>b||L===b&&I>=x||(v=N,b=L,x=I)}if(!v)return;for(const[T,C]of v)T.points=C}}w(LIe,"swapDestinationTerminalTailsToReduceCrossings");function IIe(t,e){const{realNodeRects:s,labelNodeRects:a}=Am(e.values()),o=t.filter(T=>!T.isLayoutOnly),l=w((T,C=new Map)=>Qn(C.get(T)??T.points??[]),"replacementPointsFor"),u=w((T=new Map)=>{let C=0;for(let S=0;So.reduce((C,S)=>C+Vc(l(S,T)),0),"totalBends"),d=w(T=>{const C=T.start,S=T.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,A=k?Sc(k):void 0,M=E?Sc(E):void 0;return A&&M?{src:A,dst:M}:void 0},"endpointRectsFor"),f=w((T,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(T);if(k){if(S.vertical){const E=S.a.x,A=Math.min(k.src.left,k.dst.left),M=Math.max(k.src.right,k.dst.right),R=EM+vr?"right":void 0;return R?{edge:T,points:C,segmentIndex:S.index,axis:"vertical",side:R,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(k.src.top,k.dst.top),M=Math.max(k.src.bottom,k.dst.bottom),R=EM+vr?"bottom":void 0;return R?{edge:T,points:C,segmentIndex:S.index,axis:"horizontal",side:R,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 C of o){const S=l(C);for(const k of vn(S)){const E=f(C,S,k);E&&T.push(E)}}return T},"collectExternalRails"),g=w((T,C)=>T.edge!==C.edge&&T.axis===C.axis&&T.side===C.side&&Gl(T.min,T.max,C.min,C.max)>=no,"railsInteract"),m=w(T=>{const C=[],S=new Set;for(const k of T){if(S.has(k))continue;const E=[k],A=[];for(S.add(k);E.length>0;){const M=E.pop();A.push(M);for(const R of T)!S.has(R)&&g(M,R)&&(S.add(R),E.push(R))}A.length>1&&C.push(A)}return C},"connectedComponents"),y=w(T=>{const C=[];for(const S of T)C.some(k=>Math.abs(k-S.coord){const C=T.map(E=>E.coord),S=y(T),k=[];if(T.length<=6){const E=new Array(S.length).fill(!1),A=[],M=w(()=>{if(A.length===T.length){A.some((R,P)=>Math.abs(R-C[P])>=vr)&&k.push([...A]);return}for(const[R,P]of S.entries())E[R]||(E[R]=!0,A.push(P),M(),A.pop(),E[R]=!1)},"visit");return M(),k}for(let E=0;E{const S=new Map;for(const[E,A]of T.entries()){const M=C[E],R=S.get(A.edge)??A.points.map(P=>({x:P.x,y:P.y}));A.axis==="vertical"?(R[A.segmentIndex].x=M,R[A.segmentIndex+1].x=M):(R[A.segmentIndex].y=M,R[A.segmentIndex+1].y=M),S.set(A.edge,R)}const k=new Map;for(const[E,A]of S){const M=Zd(Qn(A));if(vn(M).length!==M.length-1)return;k.set(E,M)}return k},"replacementsForAssignment"),x=w(T=>{for(const[C,S]of T){const k=[C.start,C.end].filter(E=>!!E);for(const E of vn(S))if(Js(E.a,E.b,s,k,-2)||Js(E.a,E.b,a,[],-2))return!1}for(let C=0;C=no)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const C=u();if(C===0)return;let S,k=C,E=h(),A=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const R of v(M)){const P=b(M,R);if(!P||!x(P))continue;const N=u(P);if(N>=C)continue;const L=h(P),I=M.reduce(($,O,D)=>$+Math.abs(R[D]-O.coord),0);N>k||N===k&&(L>E||L===E&&I>=A)||(S=P,k=N,E=L,A=I)}if(!S)return;for(const[M,R]of S)M.points=R}}w(IIe,"reassignCrossingExternalRailChannels");function NIe(t,e){const{realNodeRects:n,labelNodeRects:i}=Am(e.values()),s=t.filter(p=>!p.isLayoutOnly),a=w((p,g,m)=>Qn(p===g?m??[]:p.points??[]),"pointsFor"),o=w(p=>vn(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)&&Gl(p.a.x,p.b.x,g.left,g.right)>=no}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Gl(p.a.y,p.b.y,g.top,g.bottom)>=no}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),b=v?Sc(v):void 0;b&&m.push(b)}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],b=p[g+3],x=$s(m,y,vr)&&Bs(y,v,vr)&&$s(v,b,vr),T=Bs(m,y,vr)&&$s(y,v,vr)&&Bs(v,b,vr);if(!x&&!T)return[];if(!(x?Math.sign(y.x-m.x)!==Math.sign(b.x-v.x):Math.sign(y.y-m.y)!==Math.sign(b.y-v.y)))return[];const S=Bn(m,b,vr)||Vn(m,b,vr)?[]:[{x:m.x,y:b.y},{x:b.x,y:m.y}],k=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 k.map(A=>Zd(Qn(A))).filter(A=>{if(vn(A).length!==A.length-1||!A.some(R=>Uu(R,b,vr)))return!1;const M=A.map(R=>`${R.x.toFixed(3)},${R.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(b=>!!b),v=h(p);for(const b of vn(g))if(Js(b.a,b.b,n,y,-2)||Js(b.a,b.b,i,[],-2)||v.some(x=>u(b,x)))return!1;for(const b of s)if(b!==p){for(const x of vn(g))for(const T of vn(a(b)))if(zd(x,T,.5)>=no)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,b=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY;for(const T of s){const C=a(T),S=Vc(C,vr),k=o(C);for(let E=0;E<=C.length-4;E++)for(const A of d(C,E)){const M=Vc(A,vr),R=o(A);if(!(Mv||N===v&&(M>b||M===b&&R>=x)||(m=T,y=A,v=N,b=M,x=R)}}if(!m||!y)return;m.points=y}}w(NIe,"shortcutRedundantOrthogonalJogs");function OIe(t,e){const a=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const he=ce.x??0,Te=ce.y??0,ge=Sc(ce);ge&&a.push({id:String(ce.id??""),cx:he,cy:Te,rect:ge})}if(a.length===0)return;const o=new Map(a.map(ce=>[ce.id,ce])),l=a.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...a.map(ce=>ce.rect.top))-20,bottom:Math.max(...a.map(ce=>ce.rect.bottom))+20,left:Math.min(...a.map(ce=>ce.rect.left))-20,right:Math.max(...a.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,he)=>[ce,he])),p=w(ce=>{const he=ce==="left"||ce==="top"?-1:1,Te=[];for(let ge=0;ge<=2;ge++)Te.push(h[ce]+he*20*ge);return Te},"outwardTracksForSide"),g=w((ce,he=new Map)=>Qn(he.get(ce)??ce.points??[]),"replacementPointsFor"),m=w((ce,he)=>{let Te=0;for(const ge of ce)for(const ze of he)dp(ge.a,ge.b,ze.a,ze.b,vr)&&Te++;return Te},"crossingCountBetweenSegments"),y=w((ce,he)=>m(vn(ce),vn(he)),"crossingCountBetweenPaths"),v=w((ce=new Map)=>{let he=0;const Te=[],ge=new Set,ze=[],we=w(Ae=>{ge.has(Ae)||(ge.add(Ae),ze.push(Ae))},"addEdge");for(let Ae=0;Ae0&&(he+=re,Te.push({first:qe,second:Ce,count:re}),we(qe),we(Ce))}}return ze.sort((Ae,qe)=>(f.get(Ae)??0)-(f.get(qe)??0)),{count:he,pairs:Te,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=w((ce,he)=>{const Te=new Set(he.keys());if(Te.size===0)return ce.count;let ge=0;for(const we of ce.pairs)(Te.has(we.first)||Te.has(we.second))&&(ge+=we.count);let ze=0;for(let we=0;we{const he=new Map;for(const ze of ce.pairs){const we=he.get(ze.first)??new Set;we.add(ze.second),he.set(ze.first,we);const Ae=he.get(ze.second)??new Set;Ae.add(ze.first),he.set(ze.second,Ae)}const Te=[],ge=new Set;for(const ze of ce.edges){if(ge.has(ze))continue;const we=[ze],Ae=[];for(ge.add(ze);we.length>0;){const qe=we.pop();Ae.push(qe);for(const le of he.get(qe)??[])ge.has(le)||(ge.add(le),we.push(le))}Ae.sort((qe,le)=>(f.get(qe)??0)-(f.get(le)??0)),Ae.length>1&&Te.push(Ae)}return Te},"crossingComponents"),T=w(ce=>[ce.start,ce.end].filter(he=>!!he),"endpointIdsFor"),C=w(ce=>{const he=[];for(const Te of x(ce)){const ge=new Set(Te),ze=new Set(Te.flatMap(Ae=>T(Ae))),we=[...Te];for(const Ae of d)ge.has(Ae)||T(Ae).some(qe=>ze.has(qe))&&we.push(Ae);we.sort((Ae,qe)=>(f.get(Ae)??0)-(f.get(qe)??0)),he.push(we)}return he},"pairSearchGroups"),S=w((ce,he,Te)=>b(ce,new Map([[he,Te]])),"crossingCountWithSingleReplacement"),k=w(ce=>{const he=new Map;for(const Te of ce.pairs)he.set(Te.first,(he.get(Te.first)??0)+Te.count),he.set(Te.second,(he.get(Te.second)??0)+Te.count);return he},"currentCrossingsByEdge"),E=w(ce=>ce.slice(1).reduce((he,Te,ge)=>{const ze=ce[ge];return he+Math.abs(Te.x-ze.x)+Math.abs(Te.y-ze.y)},0),"pathLength"),A=w((ce=new Map)=>d.reduce((he,Te)=>he+Vc(g(Te,ce)),0),"totalBends"),M=w((ce=new Map)=>d.reduce((he,Te)=>he+E(g(Te,ce)),0),"totalLength"),R=w((ce,he,Te=new Map)=>{const ge=vn(he);for(const ze of d)if(ze!==ce){for(const we of ge)for(const Ae of vn(g(ze,Te)))if(zd(we,Ae,.5)>=no)return!0}return!1},"pathHasSegmentConflict"),P=w((ce,he)=>{const Te=[ce.start,ce.end].filter(ge=>!!ge);for(const ge of vn(he))if(Js(ge.a,ge.b,l,Te,-2))return!0;return!1},"pathHitsNode"),N=w((ce,he)=>{const Te=Zd(Qn(he));vn(Te).length===Te.length-1&&ce.push(Te)},"pushOrthogonalCandidate"),L=w(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=w((ce,he,Te)=>{switch(he){case"left":return Math.min(ce.x,Te.x)-20;case"right":return Math.max(ce.x,Te.x)+20;case"top":return Math.min(ce.y,Te.y)-20;case"bottom":return Math.max(ce.y,Te.y)+20}},"localTrackForSameSide"),$=w((ce,he,Te,ge)=>{const ze=Te==="left"||Te==="top"?-1:1,we=[I(he,Te,ge),h[Te]];for(const Ae of we)for(let qe=0;qe<=2;qe++)N(ce,Ote(he,Te,ge,Ae+ze*20*qe))},"addSameSideCandidates"),O=w((ce,he,Te,ge,ze)=>{for(const we of p(Te))for(const Ae of p(ze))N(ce,[he,{x:we,y:he.y},{x:we,y:Ae},{x:ge.x,y:Ae},ge])},"addHorizontalToVerticalCandidates"),D=w((ce,he,Te,ge,ze)=>{for(const we of p(Te))for(const Ae of p(ze))N(ce,[he,{x:he.x,y:we},{x:Ae,y:we},{x:Ae,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),B=w((ce,he,Te,ge,ze)=>{const we=[...p("top"),...p("bottom")];for(const Ae of p(Te))for(const qe of p(ze))for(const le of we)N(ce,[he,{x:Ae,y:he.y},{x:Ae,y:le},{x:qe,y:le},{x:qe,y:ge.y},ge])},"addHorizontalPairCandidates"),z=w((ce,he,Te,ge,ze)=>{const we=[...p("left"),...p("right")];for(const Ae of p(Te))for(const qe of p(ze))for(const le of we)N(ce,[he,{x:he.x,y:Ae},{x:le,y:Ae},{x:le,y:qe},{x:ge.x,y:qe},ge])},"addVerticalPairCandidates"),V=w(ce=>{const he=new Set;return ce.map(Te=>Qn(Te)).filter(Te=>{const ge=Te.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return he.has(ge)||Te.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),F=w((ce,he,Te,ge)=>{const ze=[],we=Nte(ce,he,Te,ge,20,vr);we&&N(ze,we),he===ge&&$(ze,ce,he,Te);const Ae=L(he),qe=L(ge);return Ae&&!qe?O(ze,ce,he,Te,ge):!Ae&&qe?D(ze,ce,he,Te,ge):Ae?B(ze,ce,he,Te,ge):z(ze,ce,he,Te,ge),V(ze)},"buildCandidatesForSides"),H=w((ce,he,Te,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const qe=dy(ge,Ae),le=Ae==="top"||Ae==="bottom"?p(Ae):we;for(const pe of ze){N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:qe.y},qe]);for(const Ce of le)N(ce,[he,Te,{x:pe,y:Te.y},{x:pe,y:Ce},{x:qe.x,y:Ce},qe])}}},"addVerticalDepartureOuterTrackCandidates"),G=w((ce,he,Te,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Ae of u){const qe=dy(ge,Ae),le=Ae==="left"||Ae==="right"?p(Ae):ze;for(const pe of we){N(ce,[he,Te,{x:Te.x,y:pe},{x:qe.x,y:pe},qe]);for(const Ce of le)N(ce,[he,Te,{x:Te.x,y:pe},{x:Ce,y:pe},{x:Ce,y:qe.y},qe])}}},"addHorizontalDepartureOuterTrackCandidates"),W=w(ce=>{const he=ce.start,Te=ce.end,ge=Te?o.get(Te):void 0;if(!he||!ge)return[];const ze=Qn(ce.points??[]);if(ze.length<4)return[];const we=ze[0],Ae=ze[1],qe=[];return Bs(we,Ae,vr)?H(qe,we,Ae,ge):$s(we,Ae,vr)&&G(qe,we,Ae,ge),qe},"terminalPreservingOuterTrackCandidates"),K=w(ce=>{const he=ce.start,Te=ce.end,ge=he?o.get(he):void 0,ze=Te?o.get(Te):void 0;if(!ge||!ze)return[];const we=[];for(const Ae of u){const qe=dy(ge,Ae);for(const le of u)we.push(...F(qe,Ae,dy(ze,le),le))}return we.push(...W(ce)),we},"candidatePathsFor"),q=w(()=>new Map(d.map(ce=>[ce,vn(g(ce))])),"currentSegmentsByEdge"),oe=w((ce,he,Te)=>{const ge=new Set;for(const ze of d){if(ze===ce)continue;const we=Te.get(ze)??vn(g(ze));he.some(Ae=>we.some(qe=>zd(Ae,qe,.5)>=no))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),Z=w((ce,he,Te,ge)=>{const ze=new Set;return K(ce).map(Ae=>Zd(Qn(Ae))).filter(Ae=>{if(P(ce,Ae))return!1;const qe=Ae.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return ze.has(qe)||Ae.length<2?!1:(ze.add(qe),!0)}).map(Ae=>{const qe=vn(Ae);let le=0;for(const pe of d)pe!==ce&&(le+=m(qe,Te.get(pe)??vn(g(pe))));return{candidate:Ae,candidateSegments:qe,crossings:he.count-(ge.get(ce)??0)+le,bends:Vc(Ae,vr),totalBends:Vc(Ae),length:E(Ae)}}).filter(({crossings:Ae})=>Ae<=he.count).sort((Ae,qe)=>Ae.crossings-qe.crossings||Ae.bends-qe.bends||Ae.length-qe.length).slice(0,48).map(Ae=>({path:Ae.candidate,segments:Ae.candidateSegments,sharedTrackConflicts:oe(ce,Ae.candidateSegments,Te),totalBends:Ae.totalBends,length:Ae.length}))},"pairCandidatesFor"),Q=w((ce,he,Te,ge,ze,we)=>{let Ae=0;for(const le of ce.pairs)(le.first===he||le.second===he||le.first===ge||le.second===ge)&&(Ae+=le.count);let qe=m(Te.segments,ze.segments);for(const le of d){if(le===he||le===ge)continue;const pe=we.get(le)??vn(g(le));qe+=m(Te.segments,pe)+m(ze.segments,pe)}return ce.count-Ae+qe},"pairCrossingCount"),ne=w((ce,he)=>{for(const Te of ce.sharedTrackConflicts)if(Te!==he)return!1;return!0},"conflictsOnlyWith"),ie=w((ce,he)=>ce.segments.some(Te=>he.segments.some(ge=>zd(Te,ge,.5)>=no)),"candidatesShareTrack"),me=w((ce,he,Te,ge)=>ne(he,Te.edge)&&ne(ge,ce.edge)&&!ie(he,ge),"pairCandidatesAreCompatible"),te=w((ce,he,Te,ge,ze)=>{const we=Q(ce.current,he.edge,Te,ge.edge,ze,ce.baseSegments);if(!(we>=ce.current.count))return{replacements:new Map([[he.edge,Te.path],[ge.edge,ze.path]]),crossings:we,bends:ce.currentBends-(ce.baseBendsByEdge.get(he.edge)??0)-(ce.baseBendsByEdge.get(ge.edge)??0)+Te.totalBends+ze.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(he.edge)??0)-(ce.baseLengthByEdge.get(ge.edge)??0)+Te.length+ze.length}},"scorePairReplacement"),_e=w((ce,he)=>ce.crossings{let ze=ge;for(const we of he.candidates)for(const Ae of Te.candidates){if(!me(he,we,Te,Ae))continue;const qe=te(ce,he,we,Te,Ae);qe&&_e(qe,ze)&&(ze=qe)}return ze},"bestScoreForOptionPair"),Ve=w(ce=>{const he=A(),Te=M(),ge=q(),ze=k(ce),we=new Map(d.map(re=>[re,Vc(g(re))])),Ae=new Map(d.map(re=>[re,E(g(re))])),qe=new Map,le=C(ce);for(const re of le)for(const Y of re){if(qe.has(Y))continue;const J=Z(Y,ce,ge,ze);J.length>0&&qe.set(Y,{edge:Y,candidates:J})}let pe={replacements:new Map,crossings:ce.count,bends:he,length:Te};const Ce={current:ce,currentBends:he,currentLength:Te,baseBendsByEdge:we,baseLengthByEdge:Ae,baseSegments:ge};for(const re of le){const Y=new Set(re.filter(ue=>ce.edgeSet.has(ue))),J=re.map(ue=>qe.get(ue)).filter(ue=>!!ue);for(let ue=0;ue0?pe.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const he=v(),Te=he.count;if(Te===0)return;let ge,ze,we=Te,Ae=Number.POSITIVE_INFINITY;for(const le of he.edges){const pe=Vc(g(le),vr);for(const Ce of K(le)){const re=P(le,Ce),Y=!re&&R(le,Ce),J=S(he,le,Ce),ue=Vc(Ce,vr);re||Y||!(Jwe||J===we&&ue>=Ae||(ge=le,ze=Ce,we=J,Ae=ue)}}if(ge&&ze){ge.points=ze;continue}const qe=Ve(he);if(!qe)return;for(const[le,pe]of qe)le.points=pe}}w(OIe,"resolveRenderedOrthogonalCrossings");var Pp=.001,LYt=8;function DIe(t,e){const{nodeInfoById:r,realNodeRects:n}=CP(e),i=["top","bottom","left","right"],s=20,a={top:Math.min(...n.map(m=>m.rect.top))-s,bottom:Math.max(...n.map(m=>m.rect.bottom))+s,left:Math.min(...n.map(m=>m.rect.left))-s,right:Math.max(...n.map(m=>m.rect.right))+s},o=w((m,y,v,b)=>{const x=[],T=Nte(m,y,v,b,s,Pp);return T&&x.push(T),y===b&&x.push(Ote(m,y,v,a[y])),x},"buildOrthogonalPathCandidates"),l=w((m,y)=>{for(let v=0;v{let b=0;const x=a3(m,Pp),T=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&T&&C&&(k===T||k===C||E===T||E===C))continue;const A=S.points;if(!(!A||A.length<2))for(const M of x)for(const R of a3(A,Pp)){if(Pte(M.a,M.b,R.a,R.b,Pp,Pp)){b++;continue}zd(M,R,Pp)>=LYt&&b++}}return b},"pathConflictCount"),h=4,d=w((m,y)=>{const v=Math.abs(m.y-y.rect.top),b=Math.abs(m.y-y.rect.bottom),x=Math.abs(m.x-y.rect.left),T=Math.abs(m.x-y.rect.right);let C="top",S=v;return b{const b=f.get(m)??[];b.push({side:y,edgeId:v}),f.set(m,b)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",b=m.start,x=m.end;if(b){const T=r.get(b);T&&p(b,d(y[0],T),v)}if(x){const T=r.get(x);T&&p(x,d(y[y.length-1],T),v)}}const g=w((m,y,v)=>{var b;return((b=f.get(m))==null?void 0:b.some(x=>x.edgeId!==v&&x.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=Vc(y,Pp);if(v0){const D=u($,m,!0);if(D>M||D===M&&O>=R)continue;M=D,R=O,A=$;continue}u($,m)>E||OL.edgeId!==S));const N=f.get(x);N&&f.set(x,N.filter(L=>L.edgeId!==S)),p(b,d(A[0],T),S),p(x,d(A[A.length-1],C),S)}}}w(DIe,"simplifyDetouredEdges");var cc=.001,sge=10,RM=7;function xj(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],s=t[r+n];if(!i||!s)return;const a=s.x-i.x,o=s.y-i.y;if(!(Math.abs(a)+Math.abs(o)s&&PI(t,PIe(s)))}w(wj,"labelOverlapsOwnMarker");function s9(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=ij(m,s);for(const{nodeId:v,rect:b}of n)if(v!==g&&PI(y,b))return!0;return!1},"labelOverlapsForeignNode"),u=w((g,m)=>{const y=ij(m,s);for(const v of r)if(v.edgeId!==g&&TP(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(uIe(y,g))return m},"findContainingLane"),p=w((g,m)=>d.some(y=>y.labelId!==g&&PI(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 b=y.width??0,x=y.height??0;if(b<=0||x<=0)continue;const T=[];for(let V=0;V=cc&&W>=cc||T.push({idx:V,length:G+W,orientation:G>=cc?"horizontal":"vertical",midX:(F.x+H.x)/2,midY:(F.y+H.y)/2})}if(T.length===0)continue;const C=T.length>=3?T.filter(V=>V.idx>0&&V.idx0?C:T,k=b>=x?"horizontal":"vertical",E=w(V=>[...V].sort((F,H)=>{const G=F.orientation===k,W=H.orientation===k;if(G!==W)return G?-1:1;const K=F.length>=(F.orientation==="horizontal"?b:x)+2,q=H.length>=(H.orientation==="horizontal"?b:x)+2;return K!==q?K?-1:1:H.length-F.length}),"rankSegments"),A=T[0],M=T[T.length-1],R=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=w((V,F)=>{const H=v[V.idx],G=v[V.idx+1];return{midX:H.x+(G.x-H.x)*F,midY:H.y+(G.y-H.y)*F}},"anchorAtT"),N=w((V,F,H)=>Math.min(H,Math.max(F,V)),"clamp"),L=w((V,F)=>V.midX>=F.left-cc&&V.midX<=F.right+cc&&V.midY>=F.top-cc&&V.midY<=F.bottom+cc,"pointInsideRectInclusive"),I=w(V=>{const F=px(V.midX,V.midY,b,x),H=f(F);if(H)return{laneId:H,anchor:V,rect:F};const G=i.find(({rect:ne})=>L(V,ne));if(!G)return;const W=G.rect.left+b/2+a,K=G.rect.right-b/2-a,q=G.rect.top+x/2+a,oe=G.rect.bottom-x/2-a;if(W>K||q>oe)return;const Z={midX:N(V.midX,W,K),midY:N(V.midY,q,oe)},Q=px(Z.midX,Z.midY,b,x);return L(V,Q)?{laneId:G.id,anchor:Z,rect:Q}:void 0},"placementForAnchor"),$=w((V,F,H)=>V.orientation==="horizontal"?Math.abs(F.midX-H.x):Math.abs(F.midY-H.y),"distanceAlongSegment"),O=w((V,F)=>{const G=(V.orientation==="horizontal"?b/2:x/2)+o;if(V===A){const W=v[V.idx];if($(V,F,W)+cc{const F=E(V);for(const H of F)for(const G of R){const W=P(H,G);if(!O(H,W))continue;const K=I(W);if(K&&!wj(K.rect,v)&&!p(m,K.rect)&&!h(m,g.id,K.rect))return{laneId:K.laneId,anchor:K.anchor}}},"tryPool"),B=w((V,F,H=!1)=>{const G=E(V);for(const W of G){const K={midX:W.midX,midY:W.midY};if(F&&!O(W,K))continue;const q=I(K);if(q&&!wj(q.rect,v)&&!p(m,q.rect)&&!l(m,q.rect)&&(H||!u(g.id,q.rect)))return{laneId:q.laneId,anchor:q.anchor}}},"findLaneContainingFallback"),z=D(S)??(S.lengthH.labelId===m);F>=0?d[F]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}w(s9,"anchorLabelsToPolyline");var Uz=1e-6,IYt=8,age=IYt/2,NYt=3;function Tj(t,e){return t{const h=Tj(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(a.labelNodeId);for(const p of t){if(p===a||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||Tj(g,m)===h&&f(p.labelNodeId)}return d>0?d+NYt:0},"labelClearanceFor");for(const a of t){if(a.isLayoutOnly)continue;const o=a.points;if(!Lte(o,Uz))continue;const l=Dte(a,r,Uz);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Js(m,y,n,[u,h],1))continue;const b=s(a,u,h,p?"x":"y"),x=b>age?b:age,T=[0,x,-x];for(const C of T){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Js(S,k,n,[u,h],1)&&!$I(S,k,t,a,{epsilon:Uz})){a.points=[S,k];break}}}}w($Ie,"straightenCollinearSiblingDetours");function Cj(t,e){const{realNodeRects:l,labelNodeRects:u}=Am(e.values()),h=w((C,S)=>a3(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=w(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,Qn(k)))}return C},"allSegments"),f=w((C,S)=>C.horizontal&&S.horizontal?Gl(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?Gl(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=w((C,S)=>{const k=C.start,E=C.end,A=h(C,S);if(A.length!==S.length-1)return!1;const M=[k,E].filter(P=>!!P),R=C.labelNodeId?[C.labelNodeId]:[];for(const P of A)if(Js(P.a,P.b,l,M,-2)||Js(P.a,P.b,u,R,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const N=P.points;if(!(!N||N.length<2)){for(const L of A)for(const I of h(P,Qn(N)))if(f(L,I)||dp(L.a,L.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=w((C,S)=>{const k=Qn(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(A=>({...A}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=w((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=w(C=>{const S=C.edge,k=Qn(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,A=S.end?e.get(S.end):void 0,M=E?Sc(E):void 0,R=A?Sc(A):void 0,P=k.slice(C.index+2);if(!(!E||!A||!M||!R||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(A,R),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=w((C,S,k,E,A,M)=>{const R=E.y>=k.y,P=R?A.bottom:A.top,N=P+(R?20:-20);if(R&&C.b.y<=N+.001||!R&&C.b.y>=N-.001)return;const L=C.a.x+S;return Qn([{x:k.x,y:P},{x:k.x,y:N},{x:L,y:N},{x:L,y:C.b.y},...M],.001)},"verticalSourceDetour"),b=w((C,S,k,E,A,M)=>{const R=E.x>=k.x,P=R?A.right:A.left,N=P+(R?20:-20);if(R&&C.b.x<=N+.001||!R&&C.b.x>=N-.001)return;const L=C.a.y+S;return Qn([{x:P,y:k.y},{x:N,y:k.y},{x:N,y:L},{x:C.b.x,y:L},...M],.001)},"horizontalSourceDetour"),x=w((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return b(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;EN.interior);for(const N of P){for(const L of T){const I=g(N,L);if(I&&p(N.edge,I)){N.edge.points=I,k=!0;break}const $=x(N,L);if($&&p(N.edge,$)){N.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}w(Cj,"nudgeSharedInteriorSubpaths");function BIe(t,e,r,n){const i=e.x-t.x,s=e.y-t.y,a=n.x-r.x,o=n.y-r.y,l=i*o-s*a;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*a)/l,f=(u*s-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}w(BIe,"segmentsIntersect");function FIe(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=hIe(e),s=[];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;de.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)de.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}w(FIe,"validateSwimlanesLayout");function zIe(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!EIe(t,e)||e==="BT"&&i.length>0&&!SIe(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Zd(BI(l)))}DIe(n,r),$Ie(n,r),AIe(n,r);const s=new Map;for(const o of r)s.set(String(o.id),o);s9(n,s),mIe(n,s),MIe(n,s),Cj(n,s),RIe(n,s),_Ie(n,s),yj(n,s),LIe(n,s);const a=w(()=>{OIe(n,s),IIe(n,s),NIe(n,s),s9(n,s),gj(n,s),yj(n,s),s9(n,s),gj(n,s)},"finalizeRenderedEdges");a(),Cj(n,s),a(),vj(n,s),bj(n,s),vj(n,s),bj(n,s)}w(zIe,"postProcessSwimlaneLayout");function Mm(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const s of t.edges){if(!e.has(s.src)||!e.has(s.dst))continue;const a=`${s.id}:${s.src}->${s.dst}`;r.has(a)||(r.add(a),n.push(s))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}w(Mm,"normalizeGraph");function Vte(t,e){return t.edges.filter(r=>r.dst===e)}w(Vte,"incoming");function VIe(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(VIe,"buildSuccessorMap");function Hte(t){const e=VIe(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}w(Hte,"buildSortedSuccessorMap");function Gte(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(Gte,"buildInDegreeMap");function Wte(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}w(Wte,"sortedZeroInDegreeNodes");function kP(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(kP,"buildPredecessorSuccessorMaps");function qte(t,e,r,n){var a,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((a=t.nodeById.get(l))!=null&&a.isGroup)||(i=Math.max(i,r[l]??0));const s=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||s[Math.max(0,r[l]??0)].push(l);return s}w(qte,"buildLayersFromRanks");function g7(t){const e=Gte(t),r=Wte(e),n=[],i=Hte(t);for(;r.length;){const s=r.shift();n.push(s);for(const a of i.get(s)??[])if(e.set(a,(e.get(a)??0)-1),(e.get(a)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const s=n+i>>1;let a=r(n,s)+r(s,i),o=n,l=s,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=[],s=w(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?s(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),a=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of a)n[h]===0&&s(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(HIe,"removeCycles_DFS");function GIe(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 s=i.parentId;if(!s)return e.set(n,null),null;const o=r(s)??s;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}w(GIe,"buildTopLaneMap");function fp(t){const e=GIe(t);return r=>e.get(r)??null}w(fp,"createTopLaneResolver");function SP(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}w(SP,"buildTopLaneOrder");function jte(t,e){const r=SP(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,s=[];for(const a of e)!n.has(a)||i.has(a)||(i.add(a),s.push(a));for(const a of r)i.has(a)||s.push(a);return s}w(jte,"resolveTopLaneOrder");var OYt={EPSILON:1e-6},GI={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},oge={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function WIe(t,e){const r=Mm(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:s}=kP(r);for(const C of s.values())C.sort((S,k)=>S.localeCompare(k));const a=g7(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of a.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of a){const S=(s.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=qIe(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=UIe(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=jIe(p),m=YIe(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],b=[],x=new Set,T=w(C=>{if(!x.has(C)){x.add(C),v.push(C);for(const S of u.get(C)??[])T(S);b.push(C)}},"walk");for(const C of d)T(C);for(const C of a)T(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:b,topologicalOrder:a}}w(WIe,"buildDrivingTree");function qIe(t,e,r){const n=r.laneOf(t);return[...e].sort((s,a)=>{var m,y;const o=r.laneOf(s),l=r.laneOf(a),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[s],f=(y=r.rankHint)==null?void 0:y[a];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(s)??0,g=r.topoIndex.get(a)??0;return p!==g?p-g:s.localeCompare(a)})[0]}w(qIe,"chooseParent");function UIe(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(UIe,"buildAdjacency");function jIe(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 s=i.pop();if(!e.has(s)){e.set(s,r);for(const a of t.get(s)??[])e.has(a)||i.push(a)}}r++}return e}w(jIe,"assignComponents");function YIe(t){const e=new Map,r=new Map,n=[],i=[];let s=0;const a=w((o,l)=>{e.set(o,++s),r.set(o,s);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)??s,e.get(u)??s))):(n.push([o,u]),a(u,o),r.set(o,Math.min(r.get(o)??s,r.get(u)??s)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(XIe(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||a(o,null);return i}w(YIe,"computeBlocks");function XIe(t,e,r,n){const i=[],s=new Set;for(;r.length>0;){const a=r.pop();if(i.push(a),s.add(a[0]),s.add(a[1]),a[0]===t&&a[1]===e||a[0]===e&&a[1]===t)break}return{id:n,edges:i,nodes:[...s]}}w(XIe,"popBlock");function KIe(t,e,r){const n=[...t.nodes],i=new Map;for(const[b,x]of n.entries())i.set(x,b);const s=n.length,a=new Array(s).fill(-1),o=new Array(s).fill(0),l=[],u=new Set;for(const b of n){const x=r.parent.get(b)??null,T=i.get(b);T!=null&&x==null&&(a[T]=-1,o[T]=0,u.has(b)||(u.add(b),l.push(b)))}for(;l.length>0;){const b=l.shift(),x=i.get(b);if(x==null)continue;const T=r.children.get(b)??[];for(const C of T){if(u.has(C))continue;const S=i.get(C);S!=null&&(a[S]=x,o[S]=o[x]+1,u.add(C),l.push(C))}}for(const b of n){if(u.has(b))continue;const x=i.get(b);x!=null&&(a[x]=-1,o[x]=0,u.add(b))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,s)))+1),d=Array.from({length:h},()=>new Array(s).fill(-1));for(let b=0;b{if(b===-1||x===-1)return-1;o[b]>C&1&&(b=d[C][b],b===-1))return-1;if(b===x)return b;for(let C=h-1;C>=0;C--){const S=d[C][b],k=d[C][x];S===-1||k===-1||S!==k&&(b=S,x=k)}return d[0][b]},"lcaIndex"),p=Array.from({length:s},()=>new Map);for(const b of t.edges){let x=b.src,T=b.dst,C=e[x],S=e[T];if(C==null||S==null||(C>S&&([x,T]=[T,x],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(x),E=i.get(T);if(k==null||E==null)continue;const A=f(k,E);if(A===-1)continue;const M=p[A];for(let R=C;R{if(x.size!==0)for(const[T,C]of x)b.set(T,(b.get(T)??0)+C)},"mergeInto"),y=new Set,v=w(b=>{const x=i.get(b);y.add(b);const T=x==null?void 0:p[x],C=T?new Map(T):new Map,S=r.children.get(b)??[];for(const k of S){const E=v(k),A=e[b];if(A!=null){let M=g.get(b);M||(M=new Map,g.set(b,M));let R=E.get(A)??0;const P=e[k];P!=null&&P>A&&(R+=1),M.set(k,R)}m(C,E)}return C},"dfs");for(const b of r.roots)y.has(b)||v(b);for(const b of n)y.has(b)||v(b);return g}w(KIe,"computeSubtreeCrossCounts");function ZIe(t,e,r){const n=new Map,i=w(s=>{let a=r[s]??0;const o=[...e.get(s)??[]];o.sort(Yte(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(a=Math.min(a,u))}n.set(s,a)},"annotate");for(const s of t)i(s);return n}w(ZIe,"annotateMinimumLayers");function Yte(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}w(Yte,"compareByRankThenId");function QIe(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const s=Array.from({length:i+1},()=>[]),a=new Set,o=w(l=>{if(a.has(l))return;a.add(l);const u=r[l]??0;s[u]||(s[u]=[]),s[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(!a.has(l)){const u=r[l]??0;s[u]||(s[u]=[]),s[u].push(l),a.add(l)}return s}w(QIe,"emitNodesInTreeOrder");function JIe(t){const e=[];for(const r of t){const n=new Set,i=[];for(const s of r)n.has(s)||(n.add(s),i.push(s));e.push(i)}return e}w(JIe,"deduplicateLayers");function eNe(t,e,r,n){return i=>{const s=t.get(i)??[];if(s.length===0)return[];const a=e[i]??0,o=[],l=[],u=r.get(i);for(const h of s){const d=n.get(h)??a;d>a?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)??a,m=n.get(d)??a;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}w(eNe,"createChildOrderer");function WI(t,e,r){const n=WIe(t,{rankHint:e,laneOf:r}),{children:i,roots:s}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const a=KIe(t,e,n),o=[...s].sort(Yte(e)),l=ZIe(o,i,e),u=eNe(i,e,a,l);let h=QIe(o,t.nodes,e,u);return h=JIe(h),h}w(WI,"buildMultitreeLayerOrder");function tNe(t,e,r){const n=new Set(t),i=new Set(e),s=o3(e),a=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&a.push(s.get(o.dst));return Ute(a)}w(tNe,"countCrossingsBetweenAdjacent");function kj(t,e,r){const n=[];for(const s of e){const a=r[s.src],o=r[s.dst];if(a==null||o==null||a===o)continue;let l=s.src,u=s.dst,h=a,d=o;a>o&&(l=s.dst,u=s.src,h=o,d=a);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=WI(t,r,i),y=kj(m,t.edges,r);y(e[i]??0)-(e[s]??0)||i.localeCompare(s));for(const i of n){const s=r(i);if(!s)continue;const a=t.edges.filter(m=>m.src===i);if(a.length===0)continue;let o=!1,l=0;for(const m of a){const y=r(m.dst);y==null||y===s?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===s?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(nNe,"adjustCrossLaneSources");function iNe(t,e){const r=Mm(t),n=g7(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,s=fp(r);let a=Object.create(null);for(const l of n){const u=Vte(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=s(d.src),p=s(l);return!f||!p?!0:f===p}):u;if(h.length===0)a[l]=0;else if(i&&h.length===1){const d=h[0].src,f=s(d),p=s(l);f!==p?a[l]=a[d]??0:a[l]=(a[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(a[f.src]??0)+1);a[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(a=rNe(r,a)),e!=null&&e.ignoreCrossLaneEdges&&nNe(r,a),{layers:WI(r,a,s),rankOf:a,dummy:new Set}}w(iNe,"assignLayers_LongestPath");function sNe(t,e){const r=Mm(t),i={...iNe(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},s=fp(r),{preds:a,succs:o}=kP(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=s(g.src),y=s(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=g7(r)??[...r.nodes],u=[...l].reverse(),h=w((g,m)=>{let y=0;for(const x of a.get(g)??[])y=Math.max(y,(i[x]??0)+1);let v=Number.POSITIVE_INFINITY;const b=o.get(g)??[];return b.length>0&&(v=Math.min(...b.map(x=>(i[x]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=GI.GRAVITY_ITERATIONS,f=w(g=>{let m=!1;for(const y of g){const v=a.get(y)??[],b=o.get(y)??[];if(v.length===0&&b.length===0)continue;const x=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,T=b.length>0?b.reduce((k,E)=>k+(i[E]??0)-1,0)/b.length:i[y]??0,C=Math.round((x+T)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:qte(r,l,i),rankOf:i,dummy:new Set}}w(sNe,"assignLayers_Gravity");function aNe(t){const e=Gte(t),r=Hte(t);let n=Wte(e);const i=[];for(;n.length>0;){const s=[];for(const a of n){i.push(a);for(const o of r.get(a)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&s.push(o)}n=s.sort((a,o)=>a.localeCompare(o))}return i.length===t.nodes.length?i:null}w(aNe,"topoSortByGenerationIfAcyclic");function oNe(t,e){const r=Mm(t),n=(e==null?void 0:e.direction)==="LR"?aNe(r)??[...r.nodes].sort():g7(r)??[...r.nodes].sort(),i=fp(r),s=w(h=>i(h)??h,"laneOf"),a=Object.create(null),o=new Map,l=w((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?s(h)===s(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=Vte(r,h);let p=0;if(f.length>0)for(const v of f){const b=v.src,x=a[b]??0;p=Math.max(p,x+l(b,h))}const g=s(h),m=o.get(g)??0,y=Math.max(p,m);a[h]=y,o.set(g,y+1)}return{layers:qte(r,n,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}w(oNe,"assignLayers_LaneAwareCompact");function lNe(t,e){const r=Mm(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),s=new Set(t.dummy?[...t.dummy]:[]);let a=0;const o=new Map(r.nodeById),l=w(p=>{const g=`placeholder-${a++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),s.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 b=g+1,x=0;b!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:s},graphWithDummies:f}}w(lNe,"makeProperLayering");function Sj(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(Sj,"median");function Ej(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}w(Ej,"barycenter");function cNe(t,e,r,n){const i=new Map;for(const s of t)i.set(s,[]);for(const s of r)n==="down"?e.has(s.src)&&i.has(s.dst)&&i.get(s.dst).push(e.get(s.src)):e.has(s.dst)&&i.has(s.src)&&i.get(s.src).push(e.get(s.dst));return i}w(cNe,"neighborPositionsFor");function uNe(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}w(uNe,"currentOrderTieBreak");function Aj(t,e,r){const n=new Set(t),i=new Set(e),s=o3(t),a=o3(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:s.get(u.src),v:a.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 Ute(l)}w(Aj,"countCrossingsBetweenAdjacent");function a9(t,e,r){return[...t].sort((n,i)=>{const s=Sj(e.get(n)??[]),a=Sj(e.get(i)??[]);return s===a?uNe(n,i,r):isFinite(s)?isFinite(a)?s-a:-1:1})}w(a9,"sortByHeuristic");function Mj(t,e,r,n,i,s){const a=o3(t),o=o3(e),l=cNe(e,a,r,n);if(!i||!s||s.length===0)return a9(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 s){const p=u.get(f);if(!p||p.length===0)continue;const g=a9(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=a9(d,l,o);for(const p of f){const g=Ej(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const b=Ej(l.get(v)??[]);if(ga.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=Aj(t,m,u);return h&&n&&(y+=Aj(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(s);for(;p;){p=!1;for(let m=0;m+1[...o]),i=e.edges,s=fp(e),a=jte(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=Mj(n[l+1],n[l],i,"up",s,a),n[l]=Rj(n[l+1],n[l],i,n[l-1],s)}return{layers:n}}w(hNe,"orderLayers");function dNe(t,e,r){const n=(r==null?void 0:r.layerGap)??oge.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??oge.DEFAULT_NODE_GAP,s=(r==null?void 0:r.laneGap)??i*2,a=(r==null?void 0:r.direction)??"TB",o=a==="LR"||a==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=w(M=>e.nodeById.get(M),"getNode"),f=w(M=>{var R;return((R=d(M))==null?void 0:R.width)??0},"getWidth"),p=w(M=>{var R;return((R=d(M))==null?void 0:R.height)??0},"getHeight"),g=fp(e),m=jte(e,r==null?void 0:r.laneOrder),y=l.map(M=>M.reduce((R,P)=>Math.max(R,p(P)),0)),v=[];if(o)for(let M=0;M+1Math.max(D,f(B)),0),P=l[M+1].reduce((D,B)=>Math.max(D,f(B)),0),N=y[M],L=y[M+1],I=N/2+L/2,$=(R+P)/2,O=Math.max(0,$-I-n);v.push(O)}const b=new Set;for(const M of l)for(const R of M)b.add(g(R));const x=b.has(null),T=m.filter(M=>b.has(M)),C=[...x?[null]:[],...T],S=Object.create(null);for(const M of T)S[M]=0;x&&(S.null=0);for(const M of l){const R=Object.create(null),P=[];for(const N of M){const L=g(N);L===null?P.push(N):(R[L]||(R[L]=[])).push(N)}for(const[N,L]of Object.entries(R)){const I=L.reduce(($,O)=>$+f(O),0)+i*Math.max(0,L.length-1);S[N]=Math.max(S[N]??0,I)}if(x&&P.length){const N=P.reduce((L,I)=>L+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,N)}}const k=new Map;{const M=C.map(N=>(N===null?S.null:S[N])??0);let P=-(M.reduce((N,L)=>N+L,0)+s*Math.max(0,C.length-1))/2;for(let N=0;Nf(V)),B=D.reduce((V,F)=>V+F,0)+i*($.length-1);let z=O-B/2;for(const[V,F]of $.entries()){const H=D[V];u[F]=z+H/2,h[F]=E+P/2,z+=H+i}}}const L=v[M]??0;E+=P+n+L}const A=new Map;for(const M of e.edges){const R=M.ref.id;A.has(R)||A.set(R,[]),A.get(R).push(M)}for(const[,M]of A){if(M.length===0)continue;const R=M[0].ref,P=R.start,N=R.end;if(P==null||N==null)continue;const L=Math.round(((u[P]??0)+(u[N]??0))/2),I=new Set;for(const $ of M)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===N)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=L)}}return{x:u,y:h}}w(dNe,"assignCoordinates");var fNe=8;function pNe(t){let e=2166136261;for(let r=0;r>>0}w(pNe,"hashString");function gNe(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(gNe,"mulberry32");function mNe(t,e){const r=[...t],n=gNe(e);for(let i=r.length-1;i>0;i--){const s=Math.floor(n()*(i+1));[r[i],r[s]]=[r[s],r[i]]}return r}w(mNe,"deterministicShuffle");function yNe(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}w(yNe,"sourceDistance");function _j(t,e){const r=new Map;for(const[i,s]of t.entries())r.set(s,i);let n=0;for(const{a:i,b:s,weight:a}of e){const o=r.get(i),l=r.get(s);o==null||l==null||(n+=a*Math.abs(o-l))}return n}w(_j,"laneArrangementCost");function vNe(t){const e=SP(t);if(e.length<2)return[];const r=new Map(e.map((s,a)=>[s,a])),n=fp(t),i=new Map;for(const s of t.layout.edges??[]){if(s.isLayoutOnly)continue;const a=typeof s.start=="string"?s.start:void 0,o=typeof s.end=="string"?s.end:void 0;if(!a||!o||!t.nodeById.has(a)||!t.nodeById.has(o))continue;const l=n(a),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(vNe,"buildWeightedLaneEdges");function Lj(t,e,r){const n=[...t];let i=_j(n,e),s=!0,a=0;const o=Math.max(1,n.length);for(;s&&ai.a===s.a?i.b.localeCompare(s.b):i.a.localeCompare(s.a)).map(({a:i,b:s,weight:a})=>`${i}:${s}:${a}`).join("|");return pNe(`${t.join("|")}#${n}#${r}`)}w(xNe,"seedForRestart");function wNe(t,e={}){const r=SP(t);if(r.length<2)return r;const n=vNe(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let s=Lj(r,n,i);const a=Math.max(0,e.restarts??fNe);for(let o=0;okn&&l*3>=o?a>0?"bottom":"top":o>kn?s>0?"right":"left":r}w(Ij,"chooseOrthogonalSide");function Nj(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(re=>{a.set(re.id,pe),r.filter(Y=>Y.parentId===re.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,re=le.x??0,Y=le.y??0,J=DYt;return{nodeId:le.id,minX:re-pe/2-J,maxX:re+pe/2+J,minY:Y-Ce/2-J,maxY:Y+Ce/2+J,visualXHalfExtent:l?Ce/2+J:pe/2+J}}),d=w((le,pe,Ce,re)=>{let Y=o.find(J=>J.orientation===le&&Math.abs(J.coord-pe)<1);return Y||(Y={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Ce,spanMax:re,tracks:[]},o.push(Y)),Y.spanMin=Math.min(Y.spanMin,Ce),Y.spanMax=Math.max(Y.spanMax,re),Y},"getOrAddPipe"),f=w((le,pe)=>{const Ce=le.width??10,re=le.height??10,Y=le.x??0,J=le.y??0;switch(pe){case"top":return{x:Y,y:J-re/2};case"bottom":return{x:Y,y:J+re/2};case"left":return{x:Y-Ce/2,y:J};case"right":return{x:Y+Ce/2,y:J}}},"portForSide"),p=w((le,pe,Ce)=>f(le,Ij(le,pe,Ce?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,b=w((le,pe,Ce)=>{if(g.length===0)return 0;const re=Math.abs(pe.y-Ce.y)fe||ee.from-kn<=ue&&ee.to+kn>=ue&&(J+=v)}else if(Y){const ue=pe.x,X=Math.min(pe.y,Ce.y)-kn,fe=Math.max(pe.y,Ce.y)+kn;if(fe<=X)return 0;for(const ee of g)ee.edgeIndex===le||ee.orientation!=="horizontal"||ee.pipe.coordfe||ee.from-kn<=ue&&ee.to+kn>=ue&&(J+=v)}return J},"crossingPenalty"),x=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Ce=s.get(le.start),re=s.get(le.end),Y=a.get(le.start),J=a.get(le.end),ue=Y&&J&&Y.id!==J.id?1:0,X=Ce&&re?Math.abs((re.x??0)-(Ce.x??0)):0,fe=Ce&&re?Math.abs((re.y??0)-(Ce.y??0)):0;return{idx:pe,crossLane:ue,dx:X,dy:fe}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Ce=le.dx+le.dy,re=pe.dx+pe.dy;return Math.abs(Ce-re)>1?Ce-re:le.idx-pe.idx}).map(le=>le.idx),T=w((le,pe,Ce,re)=>{const Y=Math.min(le.x,pe.x),J=Math.max(le.x,pe.x),ue=Math.min(le.y,pe.y),X=Math.max(le.y,pe.y);return!!h.find(ee=>Ce&&ee.nodeId===Ce||re&&ee.nodeId===re?!1:Math.abs(le.x-pe.x)>kn?ee.minYle.y&&ee.maxX>Y&&ee.minXle.x&&ee.maxY>ue&&ee.minYIj(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=s.get(pe.start),re=s.get(pe.end);if(!Ce||!re)continue;const Y=(re.x??0)-(Ce.x??0),J=(re.y??0)-(Ce.y??0);E.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:k(Ce,{x:re.x??0,y:re.y??0}),dstSide:k(re,{x:Ce.x??0,y:Ce.y??0}),absDx:Math.abs(Y),absDy:Math.abs(J),dxSign:Math.sign(Y),dySign:Math.sign(J)})}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"),R=new Map;for(const le of E.values()){const pe=`${le.srcId}:${le.srcSide}`;R.has(pe)||R.set(pe,[]),R.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 R.values())if(!(le.length<2)){le.sort((pe,Ce)=>{const re=A(pe),Y=A(Ce);return Math.abs(re-Y)>1e-9?Y-re:pe.edgeIdx-Ce.edgeIdx});for(let pe=1;pe=Y||(P.set(N(Ce.srcId,Ce.srcSide),Y-1),P.set(N(Ce.srcId,re),J+1),Ce.srcSide=re)}}const L=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(!L(s.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 re=P.get(N(le.srcId,le.srcSide))??0;P.set(N(le.srcId,le.srcSide),Math.max(0,re-1)),P.set(N(le.srcId,Ce),1),le.srcSide=Ce}for(const le of E.values()){const{edgeIdx:pe,srcId:Ce,dstId:re,srcSide:Y,dstSide:J}=le,ue=s.get(Ce),X=s.get(re),fe=`${Ce}:${Y}:src`,ee=Y==="top"||Y==="bottom"?X.x??0:X.y??0;C.has(fe)||C.set(fe,[]),C.get(fe).push({edgeIdx:pe,oppositeCoord:ee});const Me=`${re}:${J}:dst`,Re=J==="top"||J==="bottom"?ue.x??0:ue.y??0;C.has(Me)||C.set(Me,[]),C.get(Me).push({edgeIdx:pe,oppositeCoord:Re})}const $=new Map,O=8;for(const[le,pe]of C){if(pe.length<2)continue;pe.sort((Ze,Fe)=>Ze.oppositeCoord-Fe.oppositeCoord);const Ce=le.split(":"),re=Ce.slice(0,-2).join(":"),Y=Ce[Ce.length-2],J=Ce[Ce.length-1],ue=s.get(re);if(!ue)continue;const fe=Y==="left"||Y==="right"?ue.height??10:ue.width??10,ee=ue.shape,Re=ee==="question"||ee==="diamond"?fe*.3:fe,Ne=Math.min(20,Math.max(O,Re/(pe.length+1))),Oe=-(Ne*(pe.length-1))/2;for(const[Ze,Fe]of pe.entries()){const st=Oe+Ze*Ne,Pe=`${Fe.edgeIdx}:${J}`;$.set(Pe,st)}}const D=w(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),B=w((le,pe)=>le?(C.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Ce})=>D(Ce))||(C.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Ce})=>D(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"),V=w((le,pe,Ce)=>{const re=E.get(le),Y={x:Ce.x??0,y:Ce.y??0},J={x:pe.x??0,y:pe.y??0},ue=(re==null?void 0:re.srcSide)??k(pe,Y),X=(re==null?void 0:re.dstSide)??k(Ce,J);let fe=re?f(pe,re.srcSide):p(pe,Y,!0),ee=re?f(Ce,re.dstSide):p(Ce,J,!1);const Me=$.get(`${le}:src`),Re=$.get(`${le}:dst`);return Me!==void 0&&(fe=z(fe,ue,Me)),Re!==void 0&&(ee=z(ee,X,Re)),{pSrcPort:fe,pDstPort:ee,srcSide:ue,dstSide:X}},"portsForEdge");for(const le of x){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Ce=s.get(pe.start),re=s.get(pe.end);if(!Ce||!re)continue;const{pSrcPort:Y,pDstPort:J,srcSide:ue,dstSide:X}=V(le,Ce,re),fe={...Y},ee={...J},Me=ue==="top"||ue==="bottom",Re=X==="top"||X==="bottom";if(Me){const ut=Y.y>(Ce.y??0);fe.y=ut?Y.y+vu:Y.y-vu}else{const ut=Y.x>(Ce.x??0);fe.x=ut?Y.x+vu:Y.x-vu}if(Re){const ut=J.y>(re.y??0);ee.y=ut?J.y+vu:J.y-vu}else{const ut=J.x>(re.x??0);ee.x=ut?J.x+vu:J.x-vu}const Ke=w((ut,yt)=>{for(const Zt of h)if(!yt.includes(Zt.nodeId)&&ut.x>Zt.minX&&ut.xZt.minY&&ut.y{if(ln){const Dt=ut.y>(yt.y??0);return{x:(Zt.x??0)>=ut.x?Br.maxX+i1:Br.minX-i1,y:Dt?Br.maxY+C2:Br.minY-C2,leavesPositiveSide:Dt}}const Ct=ut.x>(yt.x??0),vt=(Zt.y??0)>=ut.y;return{x:Ct?Br.maxX+i1:Br.minX-i1,y:vt?Br.maxY+C2:Br.minY-C2,leavesPositiveSide:Ct}},"obstacleDetour");let je=[];const Oe=[pe.start,pe.end],Ze=Ke(fe,Oe);if(Ze.inside&&Ze.obstacle){const ut=Ze.obstacle;if(Me){const yt=Ne(Y,Ce,re,ut,!0);fe.x=yt.x,fe.y=yt.y;const Zt=yt.leavesPositiveSide?Math.min(ut.minY-2,Y.y+vu):Math.max(ut.maxY+2,Y.y-vu);je=[{x:Y.x,y:Zt},{x:yt.x,y:Zt},{x:yt.x,y:yt.y}]}else{const yt=Ne(Y,Ce,re,ut,!1),Zt=yt.leavesPositiveSide?Math.min(ut.minX-2,Y.x+vu):Math.max(ut.maxX+2,Y.x-vu);fe.x=yt.x,fe.y=yt.y,je=[{x:Zt,y:Y.y},{x:Zt,y:yt.y},{x:yt.x,y:yt.y}]}}let Fe=[];const st=Ke(ee,Oe);if(st.inside&&st.obstacle){const ut=st.obstacle;if(Re){const yt=Ne(J,re,Ce,ut,!0);ee.x=yt.x,ee.y=yt.y,Fe=[{x:yt.x,y:yt.y},{x:J.x,y:yt.y}]}else{const yt=Ne(J,re,Ce,ut,!1);ee.x=yt.x,ee.y=yt.y,Fe=[{x:yt.x,y:yt.y},{x:yt.x,y:J.y}]}}if(je.length===0&&Fe.length===0){const ut=i1,yt=Math.abs(fe.x-ee.x)1||Ct>1,Dt=S.get(pe.start??"")??0,ft=S.get(pe.end??"")??0,ar=ln>1&&B(pe.start,ue)||Ct>1&&B(pe.end,X),Ie=ln<=1||Dt<=2,ci=Ct<=1||ft<=2;if((yt||Zt)&&!Br&&(!vt||vt&&!ar&&Ie&&ci)&&!T(Y,J,pe.start,pe.end)){pe.points=[{...Y},{...fe},{...ee},{...J}],y.add(le);const Mn=Zt?"horizontal":"vertical",vs=Zt?Y.y:Y.x,yn=Zt?Math.min(Y.x,J.x):Math.min(Y.y,J.y),wi=Zt?Math.max(Y.x,J.x):Math.max(Y.y,J.y),Rn={id:`fast-path-${Mn}-${vs.toFixed(0)}-${le}`,orientation:Mn,coord:vs,spanMin:yn,spanMax:wi,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:Mn,pipe:Rn,trackIndex:0,from:yn,to:wi});continue}}const Pe=d("vertical",fe.x,fe.y,fe.y);fe.x=Pe.coord;const gt=d("vertical",ee.x,ee.y,ee.y);ee.x=gt.coord;let Le=Math.min(fe.x,ee.x)-50,kt=Math.max(fe.x,ee.x)+50,Et=Math.min(fe.y,ee.y)-50,ot=Math.max(fe.y,ee.y)+50;for(const ut of h){const yt=Math.min(fe.x,ee.x),Zt=Math.max(fe.x,ee.x),Br=Math.min(fe.y,ee.y),ln=Math.max(fe.y,ee.y);ut.minXyt&&ut.minYBr&&(Le=Math.min(Le,ut.minX-_M),kt=Math.max(kt,ut.maxX+_M),Et=Math.min(Et,ut.minY-_M),ot=Math.max(ot,ut.maxY+_M))}for(const ut of h){if(ut.maxXkt||ut.maxYot)continue;const yt=i1;d("horizontal",ut.minY-yt,Le,kt),d("horizontal",ut.maxY+yt,Le,kt);const Zt=C2;d("vertical",ut.minX-Zt,Et,ot),d("vertical",ut.maxX+Zt,Et,ot)}d("horizontal",fe.y,Le,kt),d("horizontal",ee.y,Le,kt);const Ht=o.filter(ut=>ut.orientation==="horizontal"&&ut.coord>=Et&&ut.coord<=ot),_t=o.filter(ut=>ut.orientation==="vertical"&&ut.coord>=Le&&ut.coord<=kt),dt=w((ut,yt)=>`${ut.toFixed(1)},${yt.toFixed(1)}`,"getKey"),xe=dt(fe.x,fe.y),Lt=dt(ee.x,ee.y),wt=new Map,mt=new Map,Mt=new Map,Or=new Set,Ee=[];wt.set(xe,0),Mt.set(xe,"n"),Ee.push({key:xe,f:Math.hypot(ee.x-fe.x,ee.y-fe.y),pt:fe}),Or.add(xe);let it=[];const pt=w((ut,yt)=>T(ut,yt,pe.start,pe.end),"checkSegmentBlocked"),bt={x:ee.x,y:fe.y},nr=pt(fe,bt),$r=pt(bt,ee),kr=nr||$r,jr={x:fe.x,y:ee.y},Er=pt(fe,jr),nn=pt(jr,ee);if(kr?Er||nn||(Math.abs(fe.x-ee.x)0;){Ee.sort((ft,ar)=>ft.f-ar.f);const ut=Ee.shift();if(Or.delete(ut.key),ut.key===Lt){let ft=Lt,ar=ee;for(it=[ar];mt.has(ft);){const Ie=mt.get(ft);it.unshift(Ie),ar=Ie,ft=dt(Ie.x,Ie.y)}break}const yt=ut.pt.x,Zt=ut.pt.y,Br=_t.sort((ft,ar)=>ft.coord-ar.coord),ln=Br.findIndex(ft=>Math.abs(ft.coord-yt)<1),Ct=Ht.sort((ft,ar)=>ft.coord-ar.coord),vt=Ct.findIndex(ft=>Math.abs(ft.coord-Zt)<1),Dt=[];ln>0&&Dt.push({x:Br[ln-1].coord,y:Zt}),ln>=0&&ln0&&Dt.push({x:yt,y:Ct[vt-1].coord}),vt>=0&&vtna.nodeId===pe.start||na.nodeId===pe.end?!1:ar!==Ie?na.minYZt&&na.maxX>ar&&na.minXyt&&na.maxY>ci&&na.minY10&&ic<-5||zo<-10&&ic>5)&&(wi=Math.abs(ic)*100),(Rn>10&&eh<-5||Rn<-10&&eh>5)&&(wi+=Math.abs(eh)*50);let Hm=0;const Gm=Mt.get(ut.key)??"n",Wm=Math.abs(eh)>kn?"h":"v";Gm!=="n"&&Gm!==Wm&&(Hm=50);const xa=vs+yn+wi+Hm,sc=(wt.get(ut.key)??1/0)+xa,go=Math.abs(ee.x-ft.x)+Math.abs(ee.y-ft.y);if(sc<(wt.get(Mn)??1/0))if(mt.set(Mn,ut.pt),wt.set(Mn,sc),Mt.set(Mn,Wm),!Or.has(Mn))Ee.push({key:Mn,f:sc+go,pt:ft}),Or.add(Mn);else{const na=Ee.findIndex(Ic=>Ic.key===Mn);na!==-1&&(Ee[na].f=sc+go)}}}if(it.length===0&&(it=[fe,{x:fe.x,y:ee.y},ee]),it.length>4){const ut=it[0],yt=it[it.length-1];let Zt=Math.min(ut.x,yt.x),Br=Math.max(ut.x,yt.x),ln=Math.min(ut.y,yt.y),Ct=Math.max(ut.y,yt.y);for(const ci of it)Zt=Math.min(Zt,ci.x),Br=Math.max(Br,ci.x),ln=Math.min(ln,ci.y),Ct=Math.max(Ct,ci.y);const vt=Br>Math.max(ut.x,yt.x),Dt=Ztyn.minXBe&&yn.minYcn);if(vs.length>0){let yn=Math.max(ut.x,yt.x);for(const wi of vs){const Rn=(wi.minX+wi.maxX)/2;if(wi.visualXHalfExtent===void 0||isNaN(wi.visualXHalfExtent))continue;const zo=Rn+wi.visualXHalfExtent+ci;yn=Math.max(yn,zo)}isNaN(yn)||(Br=yn)}}if(Dt){const Be=h.filter(cn=>cn.minXMath.min(ut.y,yt.y));if(Be.length>0){let cn=Math.min(ut.x,yt.x);for(const Mn of Be){const yn=(Mn.minX+Mn.maxX)/2-Mn.visualXHalfExtent-ci;cn=Math.min(cn,yn)}Zt=cn}}}const ft=w(ci=>{const Be=yt.y>ut.y,cn=h.filter(yn=>{const wi=Math.min(ut.x,yt.x)yn.minX,Rn=Math.min(ut.y,yt.y)yn.minY;return wi&&Rn});let Mn=cn;if(l&&cn.length>0){const yn=cn.filter(wi=>wi.minXci);yn.length>0&&(Mn=yn)}if(Mn.length===0)return yt.y;const vs=i1;if(Be){const wi=Math.max(...Mn.map(Rn=>Rn.maxY))+vs;if(wiRn.minY))-vs;if(wi>yt.y+kn)return wi}return yt.y},"findBestReturnY"),ar=w(ci=>{const Be=ft(ci),cn={x:ci,y:ut.y},Mn={x:ci,y:Be},vs={x:yt.x,y:Be},yn=pt(ut,cn),wi=pt(cn,Mn),Rn=pt(Mn,vs),zo=Be!==yt.y?pt(vs,yt):!1;return!yn&&!wi&&!Rn&&!zo?Math.abs(Be-yt.y)=3){const ut=Yr[Yr.length-1],yt=Yr[Yr.length-2],Zt=Yr[Yr.length-3],Br=Math.abs(Zt.y-yt.y)Math.abs(ut.x-Zt.x)&&Yr.splice(-2,1)}else if(ln){const Ct=Math.sign(yt.y-Zt.y),vt=Math.sign(ut.y-Zt.y);Ct!==0&&Ct===vt&&Math.abs(yt.y-Zt.y)>Math.abs(ut.y-Zt.y)&&Yr.splice(-2,1)}}const Tn=[Yr[0]];for(let ut=1;utyt.x,Ct=Br.x>Zt.x;if(ln!==Ct){Tn.push(Zt);continue}continue}if(Math.abs(yt.x-Zt.x)yt.y,Ct=Br.y>Zt.y;if(ln!==Ct){Tn.push(Zt);continue}continue}Tn.push(Zt)}Tn.push(Yr[Yr.length-1]);for(let ut=0;utle.from{const Y=!re.segments.some(ue=>(ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex)&&F(ue,le)),J=!Ce.segments.some(ue=>(ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex)&&F(ue,pe));return Y&&J?(le.trackIndex=re.index,pe.trackIndex=Ce.index,Ce.segments=[...Ce.segments.filter(ue=>ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],re.segments=[...re.segments.filter(ue=>ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),G=w(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),W=w((le,pe)=>{const Ce=le.pipe.tracks[le.trackIndex];Ce.segments=Ce.segments.filter(Y=>Y.edgeIndex!==le.edgeIndex||Y.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"),K=w((le,pe)=>{const Ce=m[le.edgeIndex];for(const re of Ce){const Y=g[re];Y.pipe===le.pipe&&W(Y,pe)}},"moveSegmentChainToTrack"),q=w(le=>{const pe=m[le.edgeIndex],Ce=pe.indexOf(g.indexOf(le)),re=[];return Ce>0&&re.push(g[pe[Ce-1]]),Ce{if(le.orientation===pe.orientation)return!1;const Ce=le.orientation==="horizontal"?le:pe,re=le.orientation==="horizontal"?pe:le;return re.pipe.coord>Ce.from&&re.pipe.coordre.from&&Ce.pipe.coord{for(const Ce of le.tracks)if(!Ce.segments.some(Y=>(Y.edgeIndex!==pe.edgeIndex||Y.segmentIndex!==pe.segmentIndex)&&F(Y,pe)))return Ce.index;return-1},"findAvailableTrack"),Q=w((le,pe)=>{if(le.trackIndex===pe.trackIndex)return F(le,pe);const Ce=q(le),re=q(pe);return Ce.some(Y=>re.some(J=>oe(Y,J)))},"segmentsConflict"),ne=w((le,pe,Ce)=>{if(H(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const re=Z(le.pipe,pe);Ce(pe,re!==-1?re:G(le.pipe))},"resolveTrackConflict"),ie=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 X={dest:0,deviation:0,base:0,delta:0};return me.set(le,X),X}const re=g[pe[0]].pipe.coord;let Y=re;for(let X=1;XMath.abs(Me-re)?ee:Me;break}}const J=Math.abs(Y-re),ue={dest:Y,deviation:J,base:re,delta:Y-re};return me.set(le,ue),ue},"getDestInfo"),_e=w(()=>{let le=0;const pe=new Map;for(const[re,Y]of i.entries())m[re].length!==0&&Y.start&&(pe.has(Y.start)||pe.set(Y.start,[]),pe.get(Y.start).push(re));const Ce=w(re=>{const Y=i[re];if(!Y.start||!Y.end)return 0;const J=s.get(Y.start),ue=s.get(Y.end);if(!J||!ue)return 0;const X=(ue.x??0)-(J.x??0),fe=(ue.y??0)-(J.y??0);return Math.abs(X)+Math.abs(fe)},"getEdgeDistance");for(const re of pe.values()){re.sort((J,ue)=>{const X=te(J),fe=te(ue);if(Math.abs(X.deviation-fe.deviation)>1)return X.deviation-fe.deviation;if(Math.abs(X.dest-fe.dest)>1)return X.dest-fe.dest;const ee=Ce(J),Me=Ce(ue);if(Math.abs(ee-Me)>1)return Me-ee;const Re=m[J].length,Ke=m[ue].length;if(Re!==Ke)return Re-Ke;if(Re===1){const Ne=m[J][0],je=m[ue][0];if(g[Ne]&&g[je]){const Oe=g[Ne],Ze=g[je],Fe=Math.abs(Oe.to-Oe.from),st=Math.abs(Ze.to-Ze.from);if(Math.abs(Fe-st)>1)return Fe-st}}return 0});const Y=re.map(J=>g[m[J][0]]);le+=ie(Y)}return le},"fixSourceHandleCrossings"),$e=w(()=>{let le=0;const pe=new Map;for(const[Ce,re]of i.entries())m[Ce].length!==0&&re.end&&(pe.has(re.end)||pe.set(re.end,[]),pe.get(re.end).push(Ce));for(const Ce of pe.values()){Ce.sort((Y,J)=>{const ue=w(ee=>{const Me=m[ee];if(Me.length<2)return 0;const Re=g[Me[Me.length-2]];return Math.abs(Re.to-Re.from)},"getDist"),X=ue(Y),fe=ue(J);return Math.abs(X-fe)>.1?X-fe:Y-J});const re=Ce.map(Y=>g[m[Y][m[Y].length-1]]);le+=ie(re)}return le},"fixTargetHandleCrossings"),Ve=w(()=>{let le=0;for(const pe of o){const Ce=[];for(const re of pe.tracks)for(const Y of re.segments){const J=m[Y.edgeIndex].find(ue=>g[ue].segmentIndex===Y.segmentIndex);J!==void 0&&Ce.push(g[J])}Ce.sort((re,Y)=>re.edgeIndex-Y.edgeIndex||re.segmentIndex-Y.segmentIndex);for(let re=0;re{re.segments.forEach(Y=>{pe.push({edgeIndex:Y.edgeIndex,segmentIndex:Y.segmentIndex,trackIndex:re.index,from:Y.from,to:Y.to})})}),pe.sort((re,Y)=>re.from-Y.from);const Ce=[];if(pe.length>0){let re=[pe[0]],Y=pe[0].to;for(let J=1;JY.add(Ne.trackIndex));const J=new Map;re.forEach(Ne=>{const je=te(Ne.edgeIndex);J.set(Ne.trackIndex,(J.get(Ne.trackIndex)??0)+je.delta)});const ue=[...Y].filter(Ne=>(J.get(Ne)??0)<-1),X=[...Y].filter(Ne=>(J.get(Ne)??0)>1),fe=[...Y].filter(Ne=>Math.abs(J.get(Ne)??0)<=1);ue.sort((Ne,je)=>(J.get(je)??0)-(J.get(Ne)??0)),X.sort((Ne,je)=>(J.get(Ne)??0)-(J.get(je)??0));const ee=w((Ne,je)=>{re.filter(Oe=>Oe.trackIndex===Ne).forEach(Oe=>{const Ze=y.has(Oe.edgeIndex)?le.coord:je;Te.set(`${Oe.edgeIndex}-${Oe.segmentIndex}`,Ze)})},"assignCoord");let Me=0;for(const Ne of ue)Me++,ee(Ne,le.coord-Me*jz);if(fe.length===0&&Y.size>0){const Ne=[...Y].sort((Ze,Fe)=>Math.abs(J.get(Ze)??0)-Math.abs(J.get(Fe)??0))[0],je=ue.indexOf(Ne);je!==-1&&ue.splice(je,1);const Oe=X.indexOf(Ne);Oe!==-1&&X.splice(Oe,1),fe.push(Ne)}let Re=0;for(const Ne of fe){if(Re===0)ee(Ne,le.coord);else{const je=Re%2===1?1:-1,Oe=Math.ceil(Re/2);ee(Ne,le.coord+je*Oe*jz*.5)}Re++}let Ke=0;for(const Ne of X)Ke++,ee(Ne,le.coord+Ke*jz)}}for(const[le,pe]of i.entries()){const Ce=m[le]??[];if(Ce.length===0)continue;const re=[],Y=s.get(pe.start),J=s.get(pe.end),{pSrcPort:ue,pDstPort:X}=V(le,Y,J),fe=Ce.map(Re=>{const Ke=g[Re],Ne=Te.get(`${Ke.edgeIndex}-${Ke.segmentIndex}`)??Ke.pipe.coord;return{orient:Ke.orientation,coord:Ne,from:Ke.from,to:Ke.to}});re.push(ue);for(let Re=0;Rekn&&re.push(x1(Ke,je)),Fe&&Ze.orient===Ke.orient)if(Math.abs(Ke.coord-Ze.coord)>kn){const st=Ke.orient==="vertical"?(je+Ze.from)/2:Nj(Ke,Ze);re.push(x1(Ke,st),x1(Ze,st))}else(Re===0||Re===fe.length-2)&&re.push(x1(Ke,Nj(Ke,Ze)));else if(Fe)re.push(x1(Ke,Ze.coord));else{const st=Math.abs(Ke.from-je)kn||Math.abs(ee.y-X.y)>kn)&&re.push(X);const Me=[];re.length>0&&Me.push(re[0]);for(let Re=1;Rekn||Math.abs(Ke.y-Ne.y)>kn)&&Me.push(Ke)}pe.points=Me}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,re=pe.y??0,Y=pe.width??0,J=pe.height??0;if(Y<=0||J<=0)return le;const ue=Ce-Y/2,X=Ce+Y/2,fe=re-J/2,ee=re+J/2;if(le.xX||le.yee)return le;const Me=le.x-ue,Re=X-le.x,Ke=le.y-fe,Ne=ee-le.y,je=Math.min(Me,Re,Ke,Ne);return je===Me?{x:ue,y:le.y}:je===Re?{x:X,y:le.y}:je===Ke?{x:le.x,y:fe}:{x:le.x,y:ee}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Ce=le.start,re=le.end,Y=Ce?s.get(Ce):void 0,J=re?s.get(re):void 0;Y&&(pe[0]=ge(pe[0],Y)),J&&(pe[pe.length-1]=ge(pe[pe.length-1],J))}return t}w(CNe,"routeEdgesOrthogonal");function kNe(t){return t.direction??"TB"}w(kNe,"getSwimlaneDirection");function SNe(t){var h,d,f,p,g;const e=oIe(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,s=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,a=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=kNe(t),{ordered:l,coordinates:u}=TNe(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:s,automaticLaneOrdering:a,direction:o});lIe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;CNe(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return zIe(t,o),FIe(t),o}w(SNe,"runSwimlaneLayoutCore");async function ENe(t,e){const r=e.select("g");NJ(r,t.markers,t.type,t.diagramId),PAe(),BAe(),g6e(),kLe(),aIe(t);const n=cIe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await ULe(r,t);SNe(t),await nIe(t,i)}w(ENe,"render");const PYt=Object.freeze(Object.defineProperty({__proto__:null,render:ENe},Symbol.toStringTag,{value:"Module"}));function Oj(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 s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}function ANe(t,e,r){return(e=MNe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zYt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function VYt(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],l=!0,u=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.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&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function HYt(){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 GYt(){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 sa(t,e){return $Yt(t)||VYt(t,e)||Xte(t,e)||HYt()}function qI(t){return BYt(t)||zYt(t)||Xte(t)||GYt()}function WYt(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 MNe(t){var e=WYt(t,"string");return typeof e=="symbol"?e:e+""}function za(t){"@babel/helpers - typeof";return za=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},za(t)}function Xte(t,e){if(t){if(typeof t=="string")return Oj(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)?Oj(t,e):void 0}}var Ea=typeof window>"u"?null:window,lge=Ea?Ea.navigator:null;Ea&&Ea.document;var qYt=za(""),RNe=za({}),UYt=za(function(){}),jYt=typeof HTMLElement>"u"?"undefined":za(HTMLElement),m7=function(e){return e&&e.instanceString&&Ss(e.instanceString)?e.instanceString():null},Nr=function(e){return e!=null&&za(e)==qYt},Ss=function(e){return e!=null&&za(e)===UYt},_i=function(e){return!Qc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Jn=function(e){return e!=null&&za(e)===RNe&&!_i(e)&&e.constructor===Object},YYt=function(e){return e!=null&&za(e)===RNe},Qt=function(e){return e!=null&&za(e)===za(1)&&!isNaN(e)},_Ne=function(e){return Qt(e)&&Math.floor(e)===e},UI=function(e){if(jYt!=="undefined")return e!=null&&e instanceof HTMLElement},Qc=function(e){return y7(e)||LNe(e)},y7=function(e){return m7(e)==="collection"&&e._private.single},LNe=function(e){return m7(e)==="collection"&&!e._private.single},Kte=function(e){return m7(e)==="core"},INe=function(e){return m7(e)==="stylesheet"},XYt=function(e){return m7(e)==="event"},tm=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},KYt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},ZYt=function(e){return Jn(e)&&Qt(e.x1)&&Qt(e.x2)&&Qt(e.y1)&&Qt(e.y2)},QYt=function(e){return YYt(e)&&Ss(e.then)},JYt=function(){return lge&&lge.userAgent.match(/msie|trident|edge/i)},l3=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var s=[],a=0;ar?1:0},aXt=function(e,r){return-1*ONe(e,r)},Wr=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("^"+rXt+"$").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,s=parseFloat(d[3]),s<0||s>100)||(s=s/100,a=d[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(i===0)o=l=u=Math.round(s*255);else{var f=s<.5?s*(1+i):s+i-s*i,p=2*s-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,a]}return r},cXt=function(e){var r,n=new RegExp("^"+eXt+"$").exec(e);if(n){r=[];for(var i=[],s=1;s<=3;s++){var a=n[s];if(a[a.length-1]==="%"&&(i[s]=!0),a=parseFloat(a),i[s]&&(a=a/100*255),a<0||a>255)return;r.push(Math.floor(a))}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},uXt=function(e){return hXt[e.toLowerCase()]},DNe=function(e){return(_i(e)?e:null)||uXt(e)||oXt(e)||cXt(e)||lXt(e)},hXt={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]},PNe=function(e){for(var r=e.map,n=e.keys,i=n.length,s=0;s=l||L<0||b&&I>=f}function E(){var N=e();if(k(N))return A(N);g=setTimeout(E,S(N))}function A(N){return g=void 0,x&&h?T(N):(h=d=void 0,p)}function M(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function R(){return g===void 0?p:A(e())}function P(){var N=e(),L=k(N);if(h=arguments,d=this,m=N,L){if(g===void 0)return C(m);if(b)return clearTimeout(g),g=setTimeout(E,l),T(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=R,P}return oV=a,oV}var wXt=xXt(),w7=v7(wXt),lV=Ea?Ea.performance:null,FNe=lV&&lV.now?function(){return lV.now()}:function(){return Date.now()},TXt=(function(){if(Ea){if(Ea.requestAnimationFrame)return function(t){Ea.requestAnimationFrame(t)};if(Ea.mozRequestAnimationFrame)return function(t){Ea.mozRequestAnimationFrame(t)};if(Ea.webkitRequestAnimationFrame)return function(t){Ea.webkitRequestAnimationFrame(t)};if(Ea.msRequestAnimationFrame)return function(t){Ea.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(FNe())},1e3/60)}})(),jI=function(e){return TXt(e)},B0=FNe,B1=9261,zNe=65599,nb=5381,VNe=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B1,n=r,i;i=e.next(),!i.done;)n=n*zNe+i.value|0;return n},V6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B1;return r*zNe+e|0},H6=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nb;return(r<<5)+r+e|0},CXt=function(e,r){return e*2097152+r},$p=function(e){return e[0]*2097152+e[1]},IM=function(e,r){return[V6(e[0],r[0]),H6(e[1],r[1])]},kge=function(e,r){var n={value:0,done:!1},i=0,s=e.length,a={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},tre=function(e){e.splice(0,e.length)},NXt=function(e,r){for(var n=0;n"u"?"undefined":za(Set))!==DXt?Set:PXt,MP=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Kte(e)){us("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"){us("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var s=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 lC,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(s.position.x==null&&(s.position.x=0),s.position.y==null&&(s.position.y=0),r.renderedPosition){var a=r.renderedPosition,o=e.pan(),l=e.zoom();s.position={x:(a.x-o.x)/l,y:(a.y-o.y)/l}}var u=[];_i(r.classes)?u=r.classes:Nr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hb?1:0},h=function(v,b,x,T,C){var S;if(x==null&&(x=0),C==null&&(C=n),x<0)throw new Error("lo must be non-negative");for(T==null&&(T=v.length);xM;0<=M?A++:A--)E.push(A);return E}).apply(this).reverse(),k=[],T=0,C=S.length;TR;0<=R?++E:--E)P.push(a(v,x));return P},m=function(v,b,x,T){var C,S,k;for(T==null&&(T=n),C=v[x];x>b;){if(k=x-1>>1,S=v[k],T(C,S)<0){v[x]=S,x=k;continue}break}return v[x]=C},y=function(v,b,x){var T,C,S,k,E;for(x==null&&(x=n),C=v.length,E=b,S=v[b],T=2*b+1;T0;){var S=b.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var A=S.neighborhood().intersect(g),M=0;M0)for(D.unshift(O);d[z];){var V=d[z];D.unshift(V.edge),D.unshift(V.node),B=V.node,z=B.id()}return o.spawn(D)}}}},GXt={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,s=n.length,a=new Array(s),o=n,l=function(T){for(var C=0;C0;){if(C(),k++,T===h){for(var E=[],A=s,M=h,R=v[M];E.unshift(A),R!=null&&E.unshift(R),A=y[M],A!=null;)M=A.id(),R=v[M];return{found:!0,distance:d[T],path:this.spawn(E),steps:k}}p[T]=!0;for(var P=x._private.edges,N=0;NR&&(g[M]=R,b[M]=A,x[M]=C),!s){var P=A*h+E;!s&&g[P]>R&&(g[P]=R,b[P]=E,x[P]=C)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:a,Te=x(ce),ge=[],ze=Te;;){if(ze==null)return r.spawn();var we=b(ze),Ae=we.edge,qe=we.pred;if(ge.unshift(ze[0]),ze.same(he)&&ge.length>0)break;Ae!=null&&ge.unshift(Ae),ze=qe}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 s=Math.floor(Math.random()*r.length);r=ZXt(s,e,r),n--}return r},QXt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var s=n.length,a=i.length,o=Math.ceil(Math.pow(Math.log(s)/Math.LN2,2)),l=Math.floor(s/KXt);if(s<2){us("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,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,s=0,a=r;a1&&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,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=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];a?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}s&&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},YNe=function(e,r){return r===0?e:YNe(r,e%r)},iKt=function(e){for(var r=e[0],n=0;n0&&(r=YNe(r,e[n]));else return 0;return r},sKt=function(e){return Math.PI*e/180},NM=function(e,r){return Math.atan2(r,e)-Math.PI/2},rre=Math.log2||function(t){return Math.log(t)/Math.log(2)},nre=function(e){return e>0?1:e<0?-1:0},av=function(e,r){return Math.sqrt(w1(e,r))},w1=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},aKt=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}}},lKt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},cKt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},uKt=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},XNe=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},l9=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},c9=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,s,a;if(r.length===1)n=i=s=a=r[0];else if(r.length===2)n=s=r[0],a=i=r[1];else if(r.length===4){var o=sa(r,4);n=o[0],i=o[1],s=o[2],a=o[3]}return e.x1-=a,e.x2+=i,e.y1-=n,e.y2+=s,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},_ge=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},ire=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},gg=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},Lge=function(e,r){return gg(e,r.x,r.y)},KNe=function(e,r){return gg(e,r.x1,r.y1)&&gg(e,r.x2,r.y2)},hKt=(hV=Math.hypot)!==null&&hV!==void 0?hV:function(t,e){return Math.sqrt(t*t+e*e)};function dKt(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}},s=function(E,A){return E.x*A.y-E.y*A.x},a=function(E){var A=hKt(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"?nm(s,a):l,h=s/2,d=a/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,b=y;if(g=mg(e,r,n,i,m,y,v,b,!1),g.length>0)return g}if(p){var x=n+h+o,T=i-d+u-o,C=x,S=i+d-u+o;if(g=mg(e,r,n,i,x,T,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,A=n+h-u+o,M=E;if(g=mg(e,r,n,i,k,E,A,M,!1),g.length>0)return g}if(p){var R=n-h-o,P=i-d+u-o,N=R,L=i+d-u+o;if(g=mg(e,r,n,i,R,P,N,L,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=Jk(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var D=n+h-u,B=i-d+u;if(I=Jk(e,r,n,i,D,B,u+o),I.length>0&&I[0]>=D&&I[1]<=B)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=Jk(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var F=n-h+u,H=i+d-u;if(I=Jk(e,r,n,i,F,H,u+o),I.length>0&&I[0]<=F&&I[1]>=H)return[I[0],I[1]]}return[]},pKt=function(e,r,n,i,s,a,o){var l=o,u=Math.min(n,s),h=Math.max(n,s),d=Math.min(i,a),f=Math.max(i,a);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},gKt=function(e,r,n,i,s,a,o,l,u){var h={x1:Math.min(n,o,s)-u,x2:Math.max(n,o,s)+u,y1:Math.min(i,l,a)-u,y2:Math.max(i,l,a)+u};return!(eh.x2||rh.y2)},mKt=function(e,r,n,i){n-=i;var s=r*r-4*e*n;if(s<0)return[];var a=Math.sqrt(s),o=2*e,l=(-r+a)/o,u=(-r-a)/o;return[l,u]},yKt=function(e,r,n,i,s){var a=1e-5;e===0&&(e=a),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,s[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),s[0]=-p+d+f,p+=(d+f)/2,s[4]=s[2]=-p,p=Math.sqrt(3)*(-f+d)/2,s[3]=p,s[5]=-p;return}if(s[5]=s[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),s[0]=-p+2*g,s[4]=s[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),s[0]=-p+g*Math.cos(h/3),s[2]=-p+g*Math.cos((h+2*Math.PI)/3),s[4]=-p+g*Math.cos((h+4*Math.PI)/3)},vKt=function(e,r,n,i,s,a,o,l){var u=1*n*n-4*n*s+2*n*o+4*s*s-4*s*o+o*o+i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l,h=9*n*s-3*n*n-3*n*o-6*s*s+3*s*o+9*i*a-3*i*i-3*i*l-6*a*a+3*a*l,d=3*n*n-6*n*s+n*o-n*e+2*s*s+2*s*e-o*e+3*i*i-6*i*a+i*l-i*r+2*a*a+2*a*r-l*r,f=1*n*s-n*n+n*e-s*e+i*a-i*i+i*r-a*r,p=[];yKt(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,b,x,T,C=0;C=0?Tu?(e-s)*(e-s)+(r-a)*(r-a):h-f},mc=function(e,r,n){for(var i,s,a,o,l,u=0,h=0;h=e&&e>=a||i<=e&&e<=a)l=(e-i)/(a-i)*(o-s)+s,l>r&&u++;else continue;return u%2!==0},F0=function(e,r,n,i,s,a,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=KI(h,-u);m=XI(y)}else m=h;return mc(e,r,m)},xKt=function(e,r,n,i,s,a,o,l){for(var u=new Array(n.length*2),h=0;h=0&&y<=1&&b.push(y),v>=0&&v<=1&&b.push(v),b.length===0)return[];var x=b[0]*l[0]+e,T=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[x,T];var C=b[1]*l[0]+e,S=b[1]*l[1]+r;return[x,T,C,S]}else return[x,T]},dV=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},mg=function(e,r,n,i,s,a,o,l,u){var h=e-s,d=n-e,f=o-s,p=r-a,g=i-r,m=l-a,y=f*p-m*h,v=d*p-g*h,b=m*d-f*g;if(b!==0){var x=y/b,T=v/b,C=.001,S=0-C,k=1+C;return S<=x&&x<=k&&S<=T&&T<=k?[e+x*d,r+x*g]:u?[e+x*d,r+x*g]:[]}else return y===0||v===0?dV(e,n,o)===o?[o,l]:dV(e,n,s)===s?[s,a]:dV(s,o,n)===n?[n,i]:[]:[]},TKt=function(e,r,n,i,s){var a=[],o=i/2,l=s/2,u=r,h=n;a.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d0){var m=KI(d,-l);p=XI(m)}else p=d}else p=n;for(var y,v,b,x,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(x){return u[x]}},f=0;f0?I=L.edgesTo(N)[0]:I=N.edgesTo(L)[0];var $=i(I);N=N.id(),k[N]>k[R]+$&&(k[N]=k[R]+$,E.nodes.indexOf(N)<0?E.push(N):E.updateItem(N),S[N]=0,C[N]=[]),k[N]==k[R]+$&&(S[N]=S[N]+S[R],C[N].push(R))}else for(var O=0;O0;){for(var V=T.pop(),F=0;F0&&o.push(n[l]);o.length!==0&&s.push(i.collection(o))}return s},$Kt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:zKt,o=i,l,u,h=0;h=2?ek(e,r,n,0,Pge,VKt):ek(e,r,n,0,Dge)},squaredEuclidean:function(e,r,n){return ek(e,r,n,0,Pge)},manhattan:function(e,r,n){return ek(e,r,n,0,Dge)},max:function(e,r,n){return ek(e,r,n,-1/0,HKt)}};c3["squared-euclidean"]=c3.squaredEuclidean;c3.squaredeuclidean=c3.squaredEuclidean;function _P(t,e,r,n,i,s){var a;return Ss(t)?a=t:a=c3[t]||c3.euclidean,e===0&&Ss(t)?a(i,s):a(e,r,n,i,s)}var GKt=$o({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),are=function(e){return GKt(e)},ZI=function(e,r,n,i,s){var a=s!=="kMedoids",o=a?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return _P(e,i.length,o,l,u,h)},pV=function(e,r,n){for(var i=n.length,s=new Array(i),a=new Array(i),o=new Array(r),l=null,u=0;un)return!1}return!0},UKt=function(e,r,n){for(var i=0;io&&(o=r[u][h],l=h);s[l].push(e[u])}for(var d=0;d=s.threshold||s.mode==="dendrogram"&&e.length===1)return!1;var g=r[a],m=r[i[a]],y;s.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][b.key]&&(l=n[m.key][b.key])):s.linkage==="max"?(l=n[g.key][b.key],n[g.key][b.key]0&&i.push(s);return i},Hge=function(e,r,n){for(var i=[],s=0;so&&(a=u,o=r[s*e+u])}a>0&&i.push(a)}for(var h=0;hu&&(l=h,u=d)}n[s]=a[l]}return i=Hge(e,r,n),i},Gge=function(e){for(var r=this.cy(),n=this.nodes(),i=iZt(e),s={},a=0;a=R?(P=R,R=L,N=I):L>P&&(P=L);for(var $=0;$0?1:0;k[A%i.minIterations*o+F]=H,V+=H}if(V>0&&(A>=i.minIterations-1||A==i.maxIterations-1)){for(var G=0,W=0;W1||S>1)&&(o=!0),d[x]=[],b.outgoers().forEach(function(E){E.isEdge()&&d[x].push(E.id())})}else f[x]=[void 0,b.target().id()]}):a.forEach(function(b){var x=b.id();if(b.isNode()){var T=b.degree(!0);T%2&&(l?u?o=!0:u=x:l=x),d[x]=[],b.connectedEdges().forEach(function(C){return d[x].push(C.id())})}else f[x]=[b.source().id(),b.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(s){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=a[0].id());var g=function(x){for(var T=x,C=[x],S,k,E;d[T].length;)S=d[T].shift(),k=f[S][0],E=f[S][1],T!=E?(d[E]=d[E].filter(function(A){return A!=S}),T=E):!s&&T!=k&&(d[k]=d[k].filter(function(A){return A!=S}),T=k),C.unshift(S),C.unshift(T);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(a.getElementById(y.shift())),m.unshift(a.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(a.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}},DM=function(){var e=this,r={},n=0,i=0,s=[],a=[],o={},l=function(f,p){for(var g=a.length-1,m=[],y=e.spawn();a[g].x!=f||a[g].y!=p;)m.push(a.pop().edge),g--;m.push(a.pop().edge),m.forEach(function(v){var b=v.connectedNodes().intersection(e);y.merge(v),b.forEach(function(x){var T=x.id(),C=x.connectedEdges().intersection(e);y.merge(x),r[T].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),s.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)s.push(e.spawn(e.getElementById(p)));else{var y,v,b,x;m.forEach(function(T){y=T.source().id(),v=T.target().id(),b=y===p?v:y,b!==g&&(x=T.id(),o[x]||(o[x]=!0,a.push({x:p,y:b,edge:T})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};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:s}},dZt={hopcroftTarjanBiconnected:DM,htbc:DM,htb:DM,hopcroftTarjanBiconnectedComponents:DM},PM=function(){var e=this,r={},n=0,i=[],s=[],a=e.spawn(e),o=function(u){s.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=s.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),a=a.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:a,components:i}},fZt={tarjanStronglyConnected:PM,tsc:PM,tscc:PM,tarjanStronglyConnectedComponents:PM},iOe={};[G6,HXt,GXt,qXt,jXt,XXt,QXt,EKt,mx,yx,$j,FKt,QKt,rZt,cZt,hZt,dZt,fZt].forEach(function(t){Wr(iOe,t)});/*! + data=`,w.height,` +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(b)||(de.trace("Setting parent",b,i.id),e.setParent(b,i.id,w))}if(de.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),v!=null&&v.clusterNode){de.info("Cluster identified XBX",b,v.width,e.node(b));const{ranksep:w,nodesep:T}=e.graph();v.graph.setGraph({...v.graph.graph(),ranksep:w+25,nodesep:T});const k=await iIe(d,v.graph,r,n,e.node(b),a),C=k.elem;Tr(v,C),v.diff=k.diff||0,de.info("New compound node after recursive render XAX",b,"width",v.width,"height",v.height),swt(C,v)}else e.children(b).length>0?(de.trace("Cluster - the non recursive path XBX",b,v.id,v,v.width,"Graph:",e),de.trace(l4(v.id,e)),dn.set(v.id,{id:l4(v.id,e),node:v})):(de.trace("Node - the non recursive path XAX",b,d,e.node(b),s),await ck(d,e.node(b),{config:a,dir:s}))})),await x(async()=>{const b=e.edges().map(async function(v){const w=e.edge(v.v,v.w,v.name);if(de.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),de.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(e.edge(v))),de.info("Fix",dn,"ids:",v.v,v.w,"Translating: ",dn.get(v.v),dn.get(v.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const T=w.id;w.id=w.selfLoop.id,await EL(h,w),w.id=T;return}await EL(h,w)});await Promise.all(b)},"processEdges")(),de.info("Graph before layout:",JSON.stringify(k0(e))),de.info("############################################# XXX"),de.info("### Layout ### XXX"),de.info("############################################# XXX"),rIe(e),de.info("Graph after layout:",JSON.stringify(k0(e)));let g=0,{subGraphTitleTotalMargin:m}=X4(a);await Promise.all(Qqt(e).map(async function(b){var w;const v=e.node(b);if(de.info("Position XBX => "+b+": ("+v.x,","+v.y,") width: ",v.width," height: ",v.height),v!=null&&v.clusterNode)v.y+=m,de.info("A tainted cluster node XBX1",b,v.id,v.width,v.height,v.x,v.y,e.parent(b)),dn.get(v.id).node=v,SL(v);else if(e.children(b).length>0){de.info("A pure cluster node XBX1",b,v.id,v.x,v.y,v.width,v.height,e.parent(b)),v.height+=m,e.node(v.parentId);const T=(v==null?void 0:v.padding)/2||0,k=((w=v==null?void 0:v.labelBBox)==null?void 0:w.height)||0,C=k-T||0;de.debug("OffsetY",C,"labelHeight",k,"halfPadding",T),await kO(l,v),dn.get(v.id).node=v}else{const T=e.node(v.parentId);v.y+=m/2,de.info("A regular node XBX1 - using the padding",v.id,"parent",v.parentId,v.width,v.height,v.x,v.y,"offsetY",v.offsetY,"parent",T,T==null?void 0:T.offsetY,v),SL(v)}}));const U=m/2;return nIe(e,U,{mergeSelfLoops:f}).forEach(function({edge:b,start:v,end:w}){de.info("Edge "+v+" -> "+w+": "+JSON.stringify(b),b),b.points.forEach(S=>S.y+=U);const T=e.node(v),k=e.node(w),C=$Q(u,b,dn,r,T,k,n);XCe(b,C)}),e.nodes().forEach(function(b){const v=e.node(b);de.info(b,v.type,v.diff),v.isGroup&&(g=v.diff)}),de.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),qYt=x(async(t,e)=>{var a,s,o,l,u,h;const r=new rl({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");FQ(n,t.markers,t.type,t.diagramId),qCe(),YCe(),kTe(),PLe(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),de.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 U=structuredClone(d),y=structuredClone(d),b=structuredClone(d),v=structuredClone(d);y.originalEdge=U,y.selfLoop={id:U.id,order:0},b.originalEdge=U,b.selfLoop={id:U.id,order:1},v.originalEdge=U,v.selfLoop={id:U.id,order:2},y.label="",y.arrowTypeEnd="none",y.endLabelLeft="",y.endLabelRight="",y.startLabelLeft="",y.id=f+"-cyclic-special-1",b.startLabelRight="",b.startLabelLeft="",b.endLabelLeft="",b.endLabelRight="",b.arrowTypeStart="none",b.arrowTypeEnd="none",b.id=f+"-cyclic-special-mid",v.label="",v.startLabelRight="",v.startLabelLeft="",v.arrowTypeStart="none",m.isGroup&&(y.fromCluster=f,v.toCluster=f),v.id=f+"-cyclic-special-2",v.arrowTypeStart="none",r.setEdge(f,p,y,f+"-cyclic-special-0"),r.setEdge(p,g,b,f+"-cyclic-special-1"),r.setEdge(g,f,v,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),de.warn("Graph at first:",JSON.stringify(k0(r))),Jqt(r),de.warn("Graph after XAX:",JSON.stringify(k0(r)));const i=He();await iIe(n,r,t.type,t.diagramId,void 0,i)},"render");const jYt=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:nIe,render:qYt},Symbol.toStringTag,{value:"Module"}));async function aIe(t,e){const r=new rl({multigraph:!0,compound:!0}),n=[...e.edges],i=He(),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 ck(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 Mr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>X3r);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}x(aIe,"createGraphWithElements");var dge=5,ME=1e-5,RE=1e-6;function BI(t){const e=[];for(let r=0;r=1-RE||f<=RE||f>=1-RE?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}x(sIe,"segmentIntersection");function lj(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}x(lj,"isHorizontalSeg");function oIe(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}x(lIe,"getArcSweepFlag");var YYt=.001;function cIe(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&Gs[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&&Gs[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}x(cIe,"applyMarkerOffsets");function uIe(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${U6(o)}`];return i==="arc"?u.push(`A${gh(t.r)},${gh(t.r)} 0 0 ${n} ${U6(l)}`):u.push(`M${U6(l)}`),u}x(uIe,"emitJump");function cj(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 v=cj(i[u-1],i[u],i[u+1]??i[u],dge);v&&(m=v.cutLen)}let U=d,y=null;a&&uv.t-w.t);for(const v of b)v.r=Math.min(v.r,v.d-m,U-v.d);for(let v=0;vw){const T=w/2;b[v].r=Math.min(b[v].r,T),b[v+1].r=Math.min(b[v+1].r,T)}}for(const v of b)v.r=2?n:null}catch{return null}}x(pIe,"decodeDataPoints");function gIe(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=pIe(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=oIe(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&&!fIe(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const v=p.getAttribute("d")??"";if(!dIe(v))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),U=m?Number.parseFloat(m[1]):null,y=m?Number.parseFloat(m[2]):null,b=hIe(u,h,r);if(p.setAttribute("d",b),U!==null&&y!==null&&typeof p.getTotalLength=="function"){const v=p.getTotalLength(),w=Math.max(0,v-U-y),T=`0 ${U} ${w} ${y}`,k=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${T};`).replace(/;\s*;+/g,";");p.setAttribute("style",k)}}}x(gIe,"applyLineJumpsToSvg");async function mIe(t,e){var i,a;for(const s of t.nodes)s.isGroup?await kO(e.clusters,s):SL(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=$Q(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await EL(e.rootGroups,s),s.label&&UIe(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}));gIe(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}x(mIe,"adjustLayout");function UIe(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=xr(),{subGraphTitleTotalMargin:i}=X4({flowchart:n.flowchart??{}});if(t.label){const a=xT.get(t.id);let s=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.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=ja.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=Kr.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=ja.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=Kr.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=ja.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=Kr.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=ja.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}x(UIe,"positionEdgeLabel");var XF="__swimlane_default__",XYt=21,fge=20;function uj(t){return Math.max(t.padding??fge,fge)}x(uj,"topLaneHorizontalPadding");function yIe(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(XYt,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}x(yIe,"assignTopLaneTitleRect");function bIe(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===XF);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:XF,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=XF}x(bIe,"prepareLayoutForSwimlanes");function vIe(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}x(vIe,"toGraphView");function xIe(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 U=r.x[g]??p*o,y=r.y[g]??l*s;m.x=U,m.y=y,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(b=>b.parentId===f.id);let g=1/0,m=-1/0,U=1/0,y=-1/0;for(const b of p){const v=b.x??r.x[b.id],w=b.y??r.y[b.id],T=b.width??0,k=b.height??0;v!=null&&w!=null&&(g=Math.min(g,v-T/2),m=Math.max(m,v+T/2),U=Math.min(U,w-k/2),y=Math.max(y,w+k/2))}if(g===1/0||U===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const b=f.padding??20,v=f.parentId?b:2*uj(f),w=b,T=Math.max(0,m-g)+v,k=Math.max(0,y-U)+w,C=(g+m)/2,S=(U+y)/2;f.x=C,f.y=S,f.width=T,f.height=k,h.set(f.id,{minX:g,maxX:m,minY:U,maxY:y})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const U=m.padding??20;U>g&&(g=U);const y=h.get(m.id);y&&(f=Math.min(f,y.minY),p=Math.max(p,y.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),y=Math.max(g,36),b=m+2*y,v=(f+p)/2;for(const E of d)E.y=v,E.height=b,E.swimlaneContentTop=f;const w=[...d].sort((E,A)=>{const R=E.x??0,_=A.x??0;return R-_}),T=[],k=[],C=[];for(const E of w){const A=h.get(E.id);if(!A)continue;const R=Math.max(0,A.maxX-A.minX)+2*uj(E),_=(A.minX+A.maxX)/2;T.push(E.id),k.push(_),C.push(R)}const S=T.length;if(S>0){const E=new Map;if(S===1)E.set(T[0],C[0]);else{const A=[];for(let I=0;I0&&i>0?{cx:e,cy:r,rect:y6(e,r,n,i)}:void 0}x(Pte,"measuredNodeRect");function Bte(t){if(t.isGroup)return;const e=Pte(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}x(Bte,"nodeBoundsInfoFor");function qu(t,e,r=oo){return Math.abs(t.x-e.x)r}x(_a,"isHorizontalSegment");function Pa(t,e,r=oo){return $n(t,e,r)&&Math.abs(t.y-e.y)>r}x(Pa,"isVerticalSegment");function Hl(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}x(Hl,"overlapLength");function zd(t,e,r=oo){return t.horizontal&&e.horizontal&&Vn(t.a,e.a,r)?Hl(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&$n(t.a,e.a,r)?Hl(t.a.y,t.b.y,e.a.y,e.b.y):0}x(zd,"sameAxisSegmentOverlapLength");function c4(t,e=oo){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!qu(i,n,e))&&r.push({x:n.x,y:n.y})}return r}x(Qn,"dedupeConsecutivePoints");function $te(t,e=oo){if(!t||t.length!==4)return;const[r,n,i,a]=t;return _a(r,n,e)&&Pa(n,i,e)&&_a(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Pa(r,n,e)&&_a(n,i,e)&&Pa(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}x($te,"classifyThreeSegmentRoute");function k_(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&se.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}x(TIe,"rectContainsRect");function $I(t,e){return t.lefte.left&&t.tope.top}x($I,"rectsOverlap");function hj(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}x(hj,"inflateRect");function y6(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}x(y6,"rectFromCenterSize");function kc(t){var e;return(e=Pte(t))==null?void 0:e.rect}x(kc,"rectOfNodeBounds");function gU(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}x(gU,"portForRectSide");function zte(t,e,r,n,i,a=oo){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.xr.x){if(Vn(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(Vn(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($n(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($n(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.xr.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.yr.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}x(zte,"buildOrthogonalPortPath");function Vte(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}x(Vte,"buildSameSideTrackPath");function S_(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=Bte(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}x(S_,"collectRealNodeBounds");function M1(t){const e=[],r=[];for(const n of t){const i=Bte(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}x(M1,"collectNodeRectEntries");function CIe(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,...y6(i,a,s,o)})}return r}x(CIe,"collectLayoutNodeRects");function Hte(t,e,r=oo){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||fy)return!1;const b=Math.abs(m-h.a.x)i:a&&o&&Vn(t,r,i)?Hl(t.x,e.x,r.x,n.x)>i:!1}x(kIe,"sameAxisSegmentsOverlap");function FI(t,e,r,n,{epsilon:i=oo,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+oo&&t=2?e[e.length-2]:void 0,l=(s?$n(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||!qu(i,n))&&r.push(n)}return r}x(zI,"orthogonalizePolyline");function Jd(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=EIe(e);if(e=n.points,!n.changed)break}return e}x(Jd,"simplifyPolyline");var Zr=.001,ZYt=.5,pge=4;function Wte(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=AIe(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}x(fj,"clipEndpoint");function MIe(t,e){for(const r of t){const n=Wte(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=fj(i,n.srcRect,!0)),n.dstRect&&(i=fj(i,n.dstRect,!1)),i=Jd(zI(i)),i=qte(i,n.srcRect,n.dstRect),n.edge.points=Jd(zI(i))}}x(MIe,"clipEdgeEndpointsToNodeBoundaries");function pj(t,e,r,n=!1){if(Vn(t,e,Zr)){if(e.yr.bottom+Zr)return e;if(n){if(t.xr.right+Zr)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($n(t,e,Zr)){if(e.xr.right+Zr)return e;if(n){if(t.yr.bottom+Zr)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}x(pj,"snapEndpointToBoundary");function VI(t,e,r){const n=t[e];for(let i=e+r;i>=0&&in.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}x(RIe,"intersectRanges");function mj(t,e){return e==="left"||e==="right"?HI(t.top,t.bottom):HI(t.left,t.right)}x(mj,"clearanceRangeForSide");function GI(t,e,r){const n=t.y>=r.top-Zr&&t.y<=r.bottom+Zr,i=t.x>=r.left-Zr&&t.x<=r.right+Zr;if(Vn(t,e,Zr)&&n){if(Math.abs(t.x-r.left)0?RIe(a):void 0}x(LIe,"straightClearanceRange");function Uj(t,e,r,n,i){const a=LIe(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-Zr&&Math.max(t.x,e.x)<=r.right+Zr,i=Math.min(t.y,e.y)>=r.top-Zr&&Math.max(t.y,e.y)<=r.bottom+Zr;if(Math.abs(t.y-r.top)n.bottom+Zr;case"left":return Vn(e,r,Zr)&&r.xn.right+Zr}}x(vj,"leavesOutward");function xj(t,e,r){if(t.length<3)return t;if(r){const a=bj(t[0],t[1],e);return a&&vj(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=bj(t[n-1],t[n],e);return i&&vj(i,t[n-1],t[n-2],e)?t.slice(0,n):t}x(xj,"collapseOwnBorderStub");function DIe(t,e,r){let n=t;if(e){const a=VI(n,0,1);if(a){const s=pj(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=xj(n,e,!0)}if(r){const a=n.length-1,s=VI(n,a,-1);if(s){const o=pj(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=xj(n,r,!1)}const i=qte(n,e,r);return i!==n||n.length===2?i:(e&&(n=yj(n,e,!0)),r&&(n=yj(n,r,!1)),n)}x(DIe,"snapAndCollapseEndpoints");function wj(t,e){for(const r of t){const n=Wte(r,e,2);if(!n)continue;const i=Qn(n.points,Zr),a=DIe(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}x(wj,"prepareEdgeEndpointsForRenderer");function jte(t){return new Map(t.map(e=>[e.id,e]))}x(jte,"buildNodeMap");function OIe(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}x(OIe,"resolveTopLevelGroupId");function Tj(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}x(Tj,"groupDepth");function Yte(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}x(Yte,"boundsForChildren");function _Ie(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}x(_Ie,"applyGroupBounds");function PIe(t){const e=jte(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>Tj(i,e)-Tj(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=Yte(i);a&&_Ie(n,a)}}x(PIe,"recomputeNestedGroupBounds");function WI(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=x(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}x(WI,"mirrorAxis");function BIe(t){return(t.nodes??[]).some(r=>!r.isGroup)?WI(t,"y"):!0}x(BIe,"applyBtDirectionTransform");function $Ie(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 L=N.x??0,I=N.y??0;L0?Math.max(1,h/d):1;for(const N of i){const L=N.x??0,P=((N.y??0)-s)*f+o,O=L-a;N.x=P,N.y=O}for(const N of n)if(N.points)for(const L of N.points){const I=L.x,O=(L.y-s)*f+o,D=I-a;L.x=O,L.y=D}PIe(r);const p=r.filter(N=>N.isGroup&&!N.parentId);if(p.length===0)return e==="RL"&&WI(t,"x"),!0;const g=jte(r),m=new Map;for(const N of r){if(N.isGroup)continue;const L=OIe(N,g);if(!L)continue;const I=m.get(L)??[];I.push(N),m.set(L,I)}let U=0;for(const N of p){const L=N.padding??0;L>U&&(U=L)}const y=[];let b=1/0,v=-1/0;for(const N of p){const L=m.get(N.id)??[],I=Yte(L);I&&(b=Math.min(b,I.minX),v=Math.max(v,I.maxX),y.push({lane:N,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(b===1/0||v===-1/0)return!0;const w=Math.max(0,v-b),T=Math.max(U,10),k=w+2*T,C=o+k,A=(b+v)/2-k/2-o,R=A+C/2,_=Math.max(U,o);y.sort((N,L)=>N.centerY-L.centerY);for(let N=0;Nf.cy?y.bottom:y.top,_=f.cx+b;if(_<=y.left+rh||_>=y.right-rh)continue;v={x:_,y:R},w={x:_,y:o.y},T={x:o.x,y:o.y}}else{const R=p.cx>f.cx?y.right:y.left,_=f.cy+b;if(_<=y.top+rh||_>=y.bottom-rh)continue;v={x:R,y:_},w={x:o.x,y:_},T={x:o.x,y:o.y}}const k=qu(v,w,rh),C=qu(w,T,rh);if(k&&C||!k&&Ja(v,w,n,[h],1)||!C&&Ja(w,T,n,[d],1))continue;const S=!k&&FI(v,w,t,i,{epsilon:rh,skipDegenerateOther:!0}),E=!C&&FI(w,T,t,i,{epsilon:rh,skipDegenerateOther:!0});if(!(S||E)){k?U=[w,T]:C?U=[v,w]:U=[v,w,T];break}}U&&(i.points=U)}}x(FIe,"portSwapToLShape");function zIe(t,e){const{realNodeRects:a,labelNodeRects:s}=M1(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=Qn(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,U=Math.hypot(g,m);if(U>=10||U<.001)continue;const y=f.x-p.x,b=f.y-p.y;if(Math.hypot(y,b)<.001)continue;const w=_a(f,d,.001),T=Pa(f,d,.001),k=_a(p,f,.001),C=Pa(p,f,.001);if(!(w&&C||T&&k))continue;const S=o.end,E=o.start,A=S?e.get(S):void 0;if(!A)continue;const R=A.x??0,_=A.y??0,N=kc(A);if(!N)continue;let L,I;if(C){const $=b<0;L={x:R,y:p.y},I={x:R,y:$?N.bottom:N.top}}else{const $=y>0;L={x:p.x,y:_},I={x:$?N.right:N.left,y:_}}if(Ja(L,I,a,S?[S]:[],-2)||Ja(L,I,s,[],-2))continue;if(E){const $=e.get(E),V=$?kc($):void 0;if(V&&Fte(L,V,2))continue}const P=x(($,V)=>`${$.x.toFixed(3)},${$.y.toFixed(3)}|${V.x.toFixed(3)},${V.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let $=0;${for(const H of t){if(H===o||H.isLayoutOnly)continue;const G=H.points;if(!(!G||G.length<2))for(let K=0;K=0){const $=u[h-3],V=[E,S].filter(H=>!!H);if(Ja($,L,a,V,-2)||D($,L))continue}const F=[...u.slice(0,h-2),L,I];o.points=F;const z=o.labelNodeId;if(z){const $=e.get(z);if($){const V=$.width??0,H=$.height??0;if(V>0&&H>0){let G,K,W=-1;for(let oe=0;oe=V+2||me&&ne>=H+2)&&ne>W&&(W=ne,G=(Z.x+J.x)/2,K=(Z.y+J.y)/2)}G!==void 0&&K!==void 0&&($.x=G,$.y=K)}}}}}x(zIe,"collapseShortTerminalStub");var br=.001,no=8,vn=c4,KF=x((t,e)=>$n(t,e,br)||Vn(t,e,br),"orthogonallyAligned");function VIe(t,e){const i=x((p,g)=>{const m=p.x??0,U=p.y??0,y=g.x-m,b=g.y-U;let v=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(b)*v>Math.abs(y)*w?(b<0&&(w=-w),{x:m+(b===0?0:w*y/b),y:U+w}):(y<0&&(v=-v),{x:m+v,y:U+(y===0?0:v*b/y)})},"rectIntersect"),a=x((p,g)=>{const m=Qn(p.points??[]);if(m.length<2)return;const U=g?p.start:p.end,y=U?e.get(U):void 0,b=y?kc(y):void 0;if(!y||!U||!b)return;const v=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],T=i(y,v);let k=v;if(KF(w,T)&&(k=w),$n(T,k,br))return{edge:p,edgeId:String(p.id??""),nodeId:U,atStart:g,orientation:"V",coord:T.x,min:Math.min(T.y,k.y),max:Math.max(T.y,k.y),boundary:T,railEnd:k,rect:b};if(Vn(T,k,br))return{edge:p,edgeId:String(p.id??""),nodeId:U,atStart:g,orientation:"H",coord:T.y,min:Math.min(T.x,k.x),max:Math.max(T.x,k.x),boundary:T,railEnd:k,rect:b}},"terminalLaneFor"),s=x((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&$n(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Vn(p.boundary,g.boundary,1),"sameTerminalFace"),l=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=no&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=x((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m2*U?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=x((p,g)=>{const m=Qn(p.edge.points??[]);if(m.length<2)return;const U=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},y=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!x(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Vn(U,p.boundary,br)&&U.x>=p.rect.left+1&&U.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?$n(U,p.boundary,br)&&U.y>=p.rect.top+1&&U.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const k=m.length>1&&qu(m[1],p.railEnd,br),C=m.slice(k?2:1),S=C[0];return S&&!KF(S,y)?void 0:[U,y,...C]}const v=m.length>1&&qu(m[m.length-2],p.railEnd,br),w=m.slice(0,v?-2:-1),T=w[w.length-1];if(!(T&&!KF(T,y)))return[...w,y,U]},"shiftedCandidate"),d=x(p=>{const g=p.edge,m=Qn(g.points??[]);if(m.length!==2)return!1;const U=g.start,y=g.end,b=U?e.get(U):void 0,v=y?e.get(y):void 0;if(!b||!v)return!1;const w=b.x??0,T=b.y??0,k=v.x??0,C=v.y??0,[S,E]=m;return Vn(S,E,br)&&Math.abs(T-C)<1&&Math.abs(w-k)>1||$n(S,E,br)&&Math.abs(w-k)<1&&Math.abs(T-C)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(U=>!U.isLayoutOnly).flatMap(U=>[a(U,!0),a(U,!1)]).filter(U=>!!U);let m=!1;for(let U=0;U{const S=d(k),E=d(C);return S!==E?Number(S)-Number(E):+!C.atStart-+!k.atStart});for(const k of T){for(const C of f){const S=h(k,C);if(!S)continue;const E=a({...k.edge,points:S},k.atStart);if(!(!E||g.some(A=>A.edge!==k.edge&&(l(E,A)||w&&u(E,A))))){k.edge.points=S,m=!0;break}}if(m)break}}if(!m)return}}x(VIe,"separateSharedRenderedTerminalLanes");function HIe(t,e){const{realNodeRects:n,labelNodeRects:i}=M1(e.values()),a=x((o,l)=>{const u=o.start,h=o.end,d=vn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Ja(p.a,p.b,n,f,-2)||Ja(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 U of vn(Qn(g)))if(zd(m,U,.5)>=no||fp(m.a,m.b,U.a,U.b,br))return!1}}return!0},"candidateIsSafe"),s=x((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=_a(u,h)&&Pa(h,d)&&_a(d,f)&&Pa(f,p)&&$n(u,f,br)&&$n(u,p,br)&&$n(h,d,br)&&(h.x-u.x)*(f.x-d.x)<0,m=Pa(u,h)&&_a(h,d)&&Pa(d,f)&&_a(f,p)&&Vn(u,f,br)&&Vn(u,p,br)&&Vn(h,d,br)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Qn([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const U=o[l+5],y=Pa(u,h)&&_a(h,d)&&Pa(d,f)&&_a(f,p)&&Pa(p,U)&&$n(u,p,br)&&$n(u,U,br)&&$n(d,f,br)&&(d.x-h.x)*(p.x-f.x)<0,b=_a(u,h)&&Pa(h,d)&&_a(d,f)&&Pa(f,p)&&_a(p,U)&&Vn(u,p,br)&&Vn(u,U,br)&&Vn(d,f,br)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!y&&!b))return Qn([...o.slice(0,l+1),U,...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=Qn(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}x(HIe,"collapseRedundantRectangularDoglegs");function Cj(t,e){const{realNodeRects:a,labelNodeRects:s}=M1(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=x((g,m,U)=>Qn(g===m?U??[]:g.points??[]),"pointsFor"),u=x((g,m)=>{let U=0;for(let y=0;y{const m=vn(g);if(m.length!==3)return;const U=m[1];if(!(m[0].horizontal===U.horizontal||m[2].horizontal===U.horizontal))return{index:U.index,horizontal:U.horizontal,vertical:U.vertical,segment:U}},"middleRail"),d=x((g,m)=>{const U=[g.start,g.end].filter(y=>!!y);return a.filter(y=>{if(U.includes(y.id))return!1;const b=y.rect;return m.horizontal?Hl(m.a.x,m.b.x,b.left,b.right)>=no&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Hl(m.a.y,m.b.y,b.top,b.bottom)>=no&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=x((g,m,U)=>{const y=g.map(v=>({...v}));if(m.horizontal)y[m.index].y=U,y[m.index+1].y=U;else if(m.vertical)y[m.index].x=U,y[m.index+1].x=U;else return;const b=Jd(Qn(y));return vn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=x((g,m,U)=>{const y=[g.start,g.end].filter(v=>!!v),b=vn(m);if(b.length!==m.length-1)return!1;for(const v of b)if(Ja(v.a,v.b,a,y,-2)||Ja(v.a,v.b,s,[],-2))return!1;for(const v of o)if(v!==g){for(const w of b)for(const T of vn(l(v)))if(zd(w,T,.5)>=no)return!1}return u(g,m)<=U},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let U=!1;for(const y of o){const b=l(y),v=h(b);if(!v)continue;const w=d(y,v.segment);if(w.length===0)continue;const T=v.horizontal?[Math.min(...w.map(k=>k.rect.top))-20,Math.max(...w.map(k=>k.rect.bottom))+20]:[Math.min(...w.map(k=>k.rect.left))-20,Math.max(...w.map(k=>k.rect.right))+20];for(const k of T){const C=f(b,v.segment,k);if(!(!C||!p(y,C,m))){y.points=C,U=!0;break}}if(U)break}if(!U)return}}x(Cj,"liftObstacleHuggingSameSideRails");function kj(t,e){const n=x(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=x(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+br||h>=u.bottom-br?!1:Hl(l.a.x,l.b.x,u.left,u.right)>=no},"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=Qn(l.points??[]);for(const h of vn(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=br))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}x(kj,"liftTopLaneTitleBandsAboveRails");function Sj(t,e){const n=x(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=x(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+br||d>=h.right-br?!1:Hl(u.a.y,u.b.y,h.top,h.bottom)>=no},"verticalSegmentIntersectsTitle"),s=x((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+br||d>=h.bottom-br?!1:Hl(u.a.x,u.b.x,h.left,h.right)>=no},"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=Qn(u.points??[]);for(const d of vn(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<=br))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}x(Sj,"shiftLeftLaneTitleBandsLeftOfRails");function GIe(t,e){const{realNodeRects:n}=M1(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=x((g,m=new Map)=>Qn(m.get(g)??g.points??[]),"replacementPointsFor"),s=x((g=new Map)=>{let m=0;for(let U=0;Ui.reduce((m,U)=>m+zc(a(U,g)),0),"totalBends"),l=x(g=>{const m=a(g);if(m.length<4)return;const U=m[m.length-2],y=m[m.length-1];if(!(!_a(U,y,br)&&!Pa(U,y,br)))return{tailStart:U,terminal:y}},"terminalTailFor"),u=x((g,m)=>{const U=a(g);if(U.length<3)return;const y=U[0],b=U[1];let v;if(_a(y,b,br))v={x:b.x,y:m.tailStart.y};else if(Pa(y,b,br))v={x:m.tailStart.x,y:b.y};else return;const w=Jd(Qn([y,b,v,m.tailStart,m.terminal]));return vn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=x((g,m)=>{const U=[g.start,g.end].filter(y=>!!y);for(const y of vn(m))if(Ja(y.a,y.b,n,U,-2))return!0;return!1},"pathHasNodeHit"),d=x((g,m,U)=>{for(const y of i)if(y!==g){for(const b of vn(m))for(const v of vn(a(y,U)))if(zd(b,v,.5)>=no)return!0}return!1},"pathHasSharedTrack"),f=x((g,m,U)=>!h(g,m)&&!d(g,m,U),"candidateIsSafe"),p=x(()=>{const g=new Map;for(const m of i){const U=m.end;if(!U||!e.has(U)||a(m).length<4)continue;const b=g.get(U)??[];b.push(m),g.set(U,b)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const U=o();let y,b=m,v=U;for(const w of p().values())for(let T=0;T=m||L>b||L===b&&I>=v||(y=N,b=L,v=I)}if(!y)return;for(const[w,T]of y)w.points=T}}x(GIe,"swapDestinationTerminalTailsToReduceCrossings");function WIe(t,e){const{realNodeRects:a,labelNodeRects:s}=M1(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=x((w,T=new Map)=>Qn(T.get(w)??w.points??[]),"replacementPointsFor"),u=x((w=new Map)=>{let T=0;for(let k=0;ko.reduce((T,k)=>T+zc(l(k,w)),0),"totalBends"),d=x(w=>{const T=w.start,k=w.end,C=T?e.get(T):void 0,S=k?e.get(k):void 0,E=C?kc(C):void 0,A=S?kc(S):void 0;return E&&A?{src:E,dst:A}:void 0},"endpointRectsFor"),f=x((w,T,k)=>{if(k.index<=0||k.index+1>=T.length-1)return;const C=d(w);if(C){if(k.vertical){const S=k.a.x,E=Math.min(C.src.left,C.dst.left),A=Math.max(C.src.right,C.dst.right),R=SA+br?"right":void 0;return R?{edge:w,points:T,segmentIndex:k.index,axis:"vertical",side:R,coord:S,min:Math.min(k.a.y,k.b.y),max:Math.max(k.a.y,k.b.y)}:void 0}if(k.horizontal){const S=k.a.y,E=Math.min(C.src.top,C.dst.top),A=Math.max(C.src.bottom,C.dst.bottom),R=SA+br?"bottom":void 0;return R?{edge:w,points:T,segmentIndex:k.index,axis:"horizontal",side:R,coord:S,min:Math.min(k.a.x,k.b.x),max:Math.max(k.a.x,k.b.x)}:void 0}}},"externalRailForSegment"),p=x(()=>{const w=[];for(const T of o){const k=l(T);for(const C of vn(k)){const S=f(T,k,C);S&&w.push(S)}}return w},"collectExternalRails"),g=x((w,T)=>w.edge!==T.edge&&w.axis===T.axis&&w.side===T.side&&Hl(w.min,w.max,T.min,T.max)>=no,"railsInteract"),m=x(w=>{const T=[],k=new Set;for(const C of w){if(k.has(C))continue;const S=[C],E=[];for(k.add(C);S.length>0;){const A=S.pop();E.push(A);for(const R of w)!k.has(R)&&g(A,R)&&(k.add(R),S.push(R))}E.length>1&&T.push(E)}return T},"connectedComponents"),U=x(w=>{const T=[];for(const k of w)T.some(C=>Math.abs(C-k.coord){const T=w.map(S=>S.coord),k=U(w),C=[];if(w.length<=6){const S=new Array(k.length).fill(!1),E=[],A=x(()=>{if(E.length===w.length){E.some((R,_)=>Math.abs(R-T[_])>=br)&&C.push([...E]);return}for(const[R,_]of k.entries())S[R]||(S[R]=!0,E.push(_),A(),E.pop(),S[R]=!1)},"visit");return A(),C}for(let S=0;S{const k=new Map;for(const[S,E]of w.entries()){const A=T[S],R=k.get(E.edge)??E.points.map(_=>({x:_.x,y:_.y}));E.axis==="vertical"?(R[E.segmentIndex].x=A,R[E.segmentIndex+1].x=A):(R[E.segmentIndex].y=A,R[E.segmentIndex+1].y=A),k.set(E.edge,R)}const C=new Map;for(const[S,E]of k){const A=Jd(Qn(E));if(vn(A).length!==A.length-1)return;C.set(S,A)}return C},"replacementsForAssignment"),v=x(w=>{for(const[T,k]of w){const C=[T.start,T.end].filter(S=>!!S);for(const S of vn(k))if(Ja(S.a,S.b,a,C,-2)||Ja(S.a,S.b,s,[],-2))return!1}for(let T=0;T=no)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const T=u();if(T===0)return;let k,C=T,S=h(),E=Number.POSITIVE_INFINITY;for(const A of m(p()))for(const R of y(A)){const _=b(A,R);if(!_||!v(_))continue;const N=u(_);if(N>=T)continue;const L=h(_),I=A.reduce((P,O,D)=>P+Math.abs(R[D]-O.coord),0);N>C||N===C&&(L>S||L===S&&I>=E)||(k=_,C=N,S=L,E=I)}if(!k)return;for(const[A,R]of k)A.points=R}}x(WIe,"reassignCrossingExternalRailChannels");function qIe(t,e){const{realNodeRects:n,labelNodeRects:i}=M1(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=x((p,g,m)=>Qn(p===g?m??[]:p.points??[]),"pointsFor"),o=x(p=>vn(p).reduce((g,m)=>{const U=m.a.x-m.b.x,y=m.a.y-m.b.y;return g+Math.hypot(U,y)},0),"pathLength"),l=x((p,g)=>{let m=0;for(let U=0;U{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&Hl(p.a.x,p.b.x,g.left,g.right)>=no}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Hl(p.a.y,p.b.y,g.top,g.bottom)>=no}return!1},"segmentRunsAlongRectBorder"),h=x(p=>{const g=[p.start,p.end].filter(U=>!!U),m=[];for(const U of g){const y=e.get(U),b=y?kc(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),d=x((p,g)=>{if(g+3>=p.length)return[];const m=p[g],U=p[g+1],y=p[g+2],b=p[g+3],v=_a(m,U,br)&&Pa(U,y,br)&&_a(y,b,br),w=Pa(m,U,br)&&_a(U,y,br)&&Pa(y,b,br);if(!v&&!w)return[];if(!(v?Math.sign(U.x-m.x)!==Math.sign(b.x-y.x):Math.sign(U.y-m.y)!==Math.sign(b.y-y.y)))return[];const k=$n(m,b,br)||Vn(m,b,br)?[]:[{x:m.x,y:b.y},{x:b.x,y:m.y}],C=k.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:k.map(E=>[...p.slice(0,g+1),E,...p.slice(g+3)]),S=new Set;return C.map(E=>Jd(Qn(E))).filter(E=>{if(vn(E).length!==E.length-1||!E.some(R=>qu(R,b,br)))return!1;const A=E.map(R=>`${R.x.toFixed(3)},${R.y.toFixed(3)}`).join("|");return S.has(A)?!1:(S.add(A),!0)})},"shortcutCandidatesAt"),f=x((p,g,m)=>{const U=[p.start,p.end].filter(b=>!!b),y=h(p);for(const b of vn(g))if(Ja(b.a,b.b,n,U,-2)||Ja(b.a,b.b,i,[],-2)||y.some(v=>u(b,v)))return!1;for(const b of a)if(b!==p){for(const v of vn(g))for(const w of vn(s(b)))if(zd(v,w,.5)>=no)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,U,y=g,b=Number.POSITIVE_INFINITY,v=Number.POSITIVE_INFINITY;for(const w of a){const T=s(w),k=zc(T,br),C=o(T);for(let S=0;S<=T.length-4;S++)for(const E of d(T,S)){const A=zc(E,br),R=o(E);if(!(Ay||N===y&&(A>b||A===b&&R>=v)||(m=w,U=E,y=N,b=A,v=R)}}if(!m||!U)return;m.points=U}}x(qIe,"shortcutRedundantOrthogonalJogs");function jIe(t,e){const s=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const he=ce.x??0,we=ce.y??0,ge=kc(ce);ge&&s.push({id:String(ce.id??""),cx:he,cy:we,rect:ge})}if(s.length===0)return;const o=new Map(s.map(ce=>[ce.id,ce])),l=s.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ce=>ce.rect.top))-20,bottom:Math.max(...s.map(ce=>ce.rect.bottom))+20,left:Math.min(...s.map(ce=>ce.rect.left))-20,right:Math.max(...s.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,he)=>[ce,he])),p=x(ce=>{const he=ce==="left"||ce==="top"?-1:1,we=[];for(let ge=0;ge<=2;ge++)we.push(h[ce]+he*20*ge);return we},"outwardTracksForSide"),g=x((ce,he=new Map)=>Qn(he.get(ce)??ce.points??[]),"replacementPointsFor"),m=x((ce,he)=>{let we=0;for(const ge of ce)for(const ze of he)fp(ge.a,ge.b,ze.a,ze.b,br)&&we++;return we},"crossingCountBetweenSegments"),U=x((ce,he)=>m(vn(ce),vn(he)),"crossingCountBetweenPaths"),y=x((ce=new Map)=>{let he=0;const we=[],ge=new Set,ze=[],xe=x(Ee=>{ge.has(Ee)||(ge.add(Ee),ze.push(Ee))},"addEdge");for(let Ee=0;Ee0&&(he+=re,we.push({first:qe,second:Te,count:re}),xe(qe),xe(Te))}}return ze.sort((Ee,qe)=>(f.get(Ee)??0)-(f.get(qe)??0)),{count:he,pairs:we,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=x((ce,he)=>{const we=new Set(he.keys());if(we.size===0)return ce.count;let ge=0;for(const xe of ce.pairs)(we.has(xe.first)||we.has(xe.second))&&(ge+=xe.count);let ze=0;for(let xe=0;xe{const he=new Map;for(const ze of ce.pairs){const xe=he.get(ze.first)??new Set;xe.add(ze.second),he.set(ze.first,xe);const Ee=he.get(ze.second)??new Set;Ee.add(ze.first),he.set(ze.second,Ee)}const we=[],ge=new Set;for(const ze of ce.edges){if(ge.has(ze))continue;const xe=[ze],Ee=[];for(ge.add(ze);xe.length>0;){const qe=xe.pop();Ee.push(qe);for(const le of he.get(qe)??[])ge.has(le)||(ge.add(le),xe.push(le))}Ee.sort((qe,le)=>(f.get(qe)??0)-(f.get(le)??0)),Ee.length>1&&we.push(Ee)}return we},"crossingComponents"),w=x(ce=>[ce.start,ce.end].filter(he=>!!he),"endpointIdsFor"),T=x(ce=>{const he=[];for(const we of v(ce)){const ge=new Set(we),ze=new Set(we.flatMap(Ee=>w(Ee))),xe=[...we];for(const Ee of d)ge.has(Ee)||w(Ee).some(qe=>ze.has(qe))&&xe.push(Ee);xe.sort((Ee,qe)=>(f.get(Ee)??0)-(f.get(qe)??0)),he.push(xe)}return he},"pairSearchGroups"),k=x((ce,he,we)=>b(ce,new Map([[he,we]])),"crossingCountWithSingleReplacement"),C=x(ce=>{const he=new Map;for(const we of ce.pairs)he.set(we.first,(he.get(we.first)??0)+we.count),he.set(we.second,(he.get(we.second)??0)+we.count);return he},"currentCrossingsByEdge"),S=x(ce=>ce.slice(1).reduce((he,we,ge)=>{const ze=ce[ge];return he+Math.abs(we.x-ze.x)+Math.abs(we.y-ze.y)},0),"pathLength"),E=x((ce=new Map)=>d.reduce((he,we)=>he+zc(g(we,ce)),0),"totalBends"),A=x((ce=new Map)=>d.reduce((he,we)=>he+S(g(we,ce)),0),"totalLength"),R=x((ce,he,we=new Map)=>{const ge=vn(he);for(const ze of d)if(ze!==ce){for(const xe of ge)for(const Ee of vn(g(ze,we)))if(zd(xe,Ee,.5)>=no)return!0}return!1},"pathHasSegmentConflict"),_=x((ce,he)=>{const we=[ce.start,ce.end].filter(ge=>!!ge);for(const ge of vn(he))if(Ja(ge.a,ge.b,l,we,-2))return!0;return!1},"pathHitsNode"),N=x((ce,he)=>{const we=Jd(Qn(he));vn(we).length===we.length-1&&ce.push(we)},"pushOrthogonalCandidate"),L=x(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=x((ce,he,we)=>{switch(he){case"left":return Math.min(ce.x,we.x)-20;case"right":return Math.max(ce.x,we.x)+20;case"top":return Math.min(ce.y,we.y)-20;case"bottom":return Math.max(ce.y,we.y)+20}},"localTrackForSameSide"),P=x((ce,he,we,ge)=>{const ze=we==="left"||we==="top"?-1:1,xe=[I(he,we,ge),h[we]];for(const Ee of xe)for(let qe=0;qe<=2;qe++)N(ce,Vte(he,we,ge,Ee+ze*20*qe))},"addSameSideCandidates"),O=x((ce,he,we,ge,ze)=>{for(const xe of p(we))for(const Ee of p(ze))N(ce,[he,{x:xe,y:he.y},{x:xe,y:Ee},{x:ge.x,y:Ee},ge])},"addHorizontalToVerticalCandidates"),D=x((ce,he,we,ge,ze)=>{for(const xe of p(we))for(const Ee of p(ze))N(ce,[he,{x:he.x,y:xe},{x:Ee,y:xe},{x:Ee,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),B=x((ce,he,we,ge,ze)=>{const xe=[...p("top"),...p("bottom")];for(const Ee of p(we))for(const qe of p(ze))for(const le of xe)N(ce,[he,{x:Ee,y:he.y},{x:Ee,y:le},{x:qe,y:le},{x:qe,y:ge.y},ge])},"addHorizontalPairCandidates"),F=x((ce,he,we,ge,ze)=>{const xe=[...p("left"),...p("right")];for(const Ee of p(we))for(const qe of p(ze))for(const le of xe)N(ce,[he,{x:he.x,y:Ee},{x:le,y:Ee},{x:le,y:qe},{x:ge.x,y:qe},ge])},"addVerticalPairCandidates"),z=x(ce=>{const he=new Set;return ce.map(we=>Qn(we)).filter(we=>{const ge=we.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return he.has(ge)||we.length<2?!1:(he.add(ge),!0)})},"dedupeCandidatePaths"),$=x((ce,he,we,ge)=>{const ze=[],xe=zte(ce,he,we,ge,20,br);xe&&N(ze,xe),he===ge&&P(ze,ce,he,we);const Ee=L(he),qe=L(ge);return Ee&&!qe?O(ze,ce,he,we,ge):!Ee&&qe?D(ze,ce,he,we,ge):Ee?B(ze,ce,he,we,ge):F(ze,ce,he,we,ge),z(ze)},"buildCandidatesForSides"),V=x((ce,he,we,ge)=>{const ze=[...p("left"),...p("right")],xe=[...p("top"),...p("bottom")];for(const Ee of u){const qe=gU(ge,Ee),le=Ee==="top"||Ee==="bottom"?p(Ee):xe;for(const pe of ze){N(ce,[he,we,{x:pe,y:we.y},{x:pe,y:qe.y},qe]);for(const Te of le)N(ce,[he,we,{x:pe,y:we.y},{x:pe,y:Te},{x:qe.x,y:Te},qe])}}},"addVerticalDepartureOuterTrackCandidates"),H=x((ce,he,we,ge)=>{const ze=[...p("left"),...p("right")],xe=[...p("top"),...p("bottom")];for(const Ee of u){const qe=gU(ge,Ee),le=Ee==="left"||Ee==="right"?p(Ee):ze;for(const pe of xe){N(ce,[he,we,{x:we.x,y:pe},{x:qe.x,y:pe},qe]);for(const Te of le)N(ce,[he,we,{x:we.x,y:pe},{x:Te,y:pe},{x:Te,y:qe.y},qe])}}},"addHorizontalDepartureOuterTrackCandidates"),G=x(ce=>{const he=ce.start,we=ce.end,ge=we?o.get(we):void 0;if(!he||!ge)return[];const ze=Qn(ce.points??[]);if(ze.length<4)return[];const xe=ze[0],Ee=ze[1],qe=[];return Pa(xe,Ee,br)?V(qe,xe,Ee,ge):_a(xe,Ee,br)&&H(qe,xe,Ee,ge),qe},"terminalPreservingOuterTrackCandidates"),K=x(ce=>{const he=ce.start,we=ce.end,ge=he?o.get(he):void 0,ze=we?o.get(we):void 0;if(!ge||!ze)return[];const xe=[];for(const Ee of u){const qe=gU(ge,Ee);for(const le of u)xe.push(...$(qe,Ee,gU(ze,le),le))}return xe.push(...G(ce)),xe},"candidatePathsFor"),W=x(()=>new Map(d.map(ce=>[ce,vn(g(ce))])),"currentSegmentsByEdge"),oe=x((ce,he,we)=>{const ge=new Set;for(const ze of d){if(ze===ce)continue;const xe=we.get(ze)??vn(g(ze));he.some(Ee=>xe.some(qe=>zd(Ee,qe,.5)>=no))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),Z=x((ce,he,we,ge)=>{const ze=new Set;return K(ce).map(Ee=>Jd(Qn(Ee))).filter(Ee=>{if(_(ce,Ee))return!1;const qe=Ee.map(le=>`${le.x.toFixed(3)},${le.y.toFixed(3)}`).join("|");return ze.has(qe)||Ee.length<2?!1:(ze.add(qe),!0)}).map(Ee=>{const qe=vn(Ee);let le=0;for(const pe of d)pe!==ce&&(le+=m(qe,we.get(pe)??vn(g(pe))));return{candidate:Ee,candidateSegments:qe,crossings:he.count-(ge.get(ce)??0)+le,bends:zc(Ee,br),totalBends:zc(Ee),length:S(Ee)}}).filter(({crossings:Ee})=>Ee<=he.count).sort((Ee,qe)=>Ee.crossings-qe.crossings||Ee.bends-qe.bends||Ee.length-qe.length).slice(0,48).map(Ee=>({path:Ee.candidate,segments:Ee.candidateSegments,sharedTrackConflicts:oe(ce,Ee.candidateSegments,we),totalBends:Ee.totalBends,length:Ee.length}))},"pairCandidatesFor"),J=x((ce,he,we,ge,ze,xe)=>{let Ee=0;for(const le of ce.pairs)(le.first===he||le.second===he||le.first===ge||le.second===ge)&&(Ee+=le.count);let qe=m(we.segments,ze.segments);for(const le of d){if(le===he||le===ge)continue;const pe=xe.get(le)??vn(g(le));qe+=m(we.segments,pe)+m(ze.segments,pe)}return ce.count-Ee+qe},"pairCrossingCount"),ne=x((ce,he)=>{for(const we of ce.sharedTrackConflicts)if(we!==he)return!1;return!0},"conflictsOnlyWith"),ie=x((ce,he)=>ce.segments.some(we=>he.segments.some(ge=>zd(we,ge,.5)>=no)),"candidatesShareTrack"),me=x((ce,he,we,ge)=>ne(he,we.edge)&&ne(ge,ce.edge)&&!ie(he,ge),"pairCandidatesAreCompatible"),te=x((ce,he,we,ge,ze)=>{const xe=J(ce.current,he.edge,we,ge.edge,ze,ce.baseSegments);if(!(xe>=ce.current.count))return{replacements:new Map([[he.edge,we.path],[ge.edge,ze.path]]),crossings:xe,bends:ce.currentBends-(ce.baseBendsByEdge.get(he.edge)??0)-(ce.baseBendsByEdge.get(ge.edge)??0)+we.totalBends+ze.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(he.edge)??0)-(ce.baseLengthByEdge.get(ge.edge)??0)+we.length+ze.length}},"scorePairReplacement"),Re=x((ce,he)=>ce.crossings{let ze=ge;for(const xe of he.candidates)for(const Ee of we.candidates){if(!me(he,xe,we,Ee))continue;const qe=te(ce,he,xe,we,Ee);qe&&Re(qe,ze)&&(ze=qe)}return ze},"bestScoreForOptionPair"),Ve=x(ce=>{const he=E(),we=A(),ge=W(),ze=C(ce),xe=new Map(d.map(re=>[re,zc(g(re))])),Ee=new Map(d.map(re=>[re,S(g(re))])),qe=new Map,le=T(ce);for(const re of le)for(const Y of re){if(qe.has(Y))continue;const Q=Z(Y,ce,ge,ze);Q.length>0&&qe.set(Y,{edge:Y,candidates:Q})}let pe={replacements:new Map,crossings:ce.count,bends:he,length:we};const Te={current:ce,currentBends:he,currentLength:we,baseBendsByEdge:xe,baseLengthByEdge:Ee,baseSegments:ge};for(const re of le){const Y=new Set(re.filter(ue=>ce.edgeSet.has(ue))),Q=re.map(ue=>qe.get(ue)).filter(ue=>!!ue);for(let ue=0;ue0?pe.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const he=y(),we=he.count;if(we===0)return;let ge,ze,xe=we,Ee=Number.POSITIVE_INFINITY;for(const le of he.edges){const pe=zc(g(le),br);for(const Te of K(le)){const re=_(le,Te),Y=!re&&R(le,Te),Q=k(he,le,Te),ue=zc(Te,br);re||Y||!(Qxe||Q===xe&&ue>=Ee||(ge=le,ze=Te,xe=Q,Ee=ue)}}if(ge&&ze){ge.points=ze;continue}const qe=Ve(he);if(!qe)return;for(const[le,pe]of qe)le.points=pe}}x(jIe,"resolveRenderedOrthogonalCrossings");var Pp=.001,eXt=8;function YIe(t,e){const{nodeInfoById:r,realNodeRects:n}=S_(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=x((m,U,y,b)=>{const v=[],w=zte(m,U,y,b,a,Pp);return w&&v.push(w),U===b&&v.push(Vte(m,U,y,s[U])),v},"buildOrthogonalPathCandidates"),l=x((m,U)=>{for(let y=0;y{let b=0;const v=c4(m,Pp),w=U.start,T=U.end;for(const k of t){if(k===U||k.isLayoutOnly)continue;const C=k.start,S=k.end;if(!y&&w&&T&&(C===w||C===T||S===w||S===T))continue;const E=k.points;if(!(!E||E.length<2))for(const A of v)for(const R of c4(E,Pp)){if(Gte(A.a,A.b,R.a,R.b,Pp,Pp)){b++;continue}zd(A,R,Pp)>=eXt&&b++}}return b},"pathConflictCount"),h=4,d=x((m,U)=>{const y=Math.abs(m.y-U.rect.top),b=Math.abs(m.y-U.rect.bottom),v=Math.abs(m.x-U.rect.left),w=Math.abs(m.x-U.rect.right);let T="top",k=y;return b{const b=f.get(m)??[];b.push({side:U,edgeId:y}),f.set(m,b)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const U=m.points??[];if(U.length<1)continue;const y=m.id??"",b=m.start,v=m.end;if(b){const w=r.get(b);w&&p(b,d(U[0],w),y)}if(v){const w=r.get(v);w&&p(v,d(U[U.length-1],w),y)}}const g=x((m,U,y)=>{var b;return((b=f.get(m))==null?void 0:b.some(v=>v.edgeId!==y&&v.side===U))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const U=m.points;if(!U||U.length<2)continue;const y=zc(U,Pp);if(y0){const D=u(P,m,!0);if(D>A||D===A&&O>=R)continue;A=D,R=O,E=P;continue}u(P,m)>S||OL.edgeId!==k));const N=f.get(v);N&&f.set(v,N.filter(L=>L.edgeId!==k)),p(b,d(E[0],w),k),p(v,d(E[E.length-1],T),k)}}}x(YIe,"simplifyDetouredEdges");var cc=.001,gge=10,IE=7;function Ej(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&&$I(t,XIe(a)))}x(Aj,"labelOverlapsOwnMarker");function lM(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let U=0;U{const U=hj(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&$I(U,b))return!0;return!1},"labelOverlapsForeignNode"),u=x((g,m)=>{const U=hj(m,a);for(const y of r)if(y.edgeId!==g&&k_(y.p1,y.p2,U))return!0;return!1},"labelOverlapsForeignEdge"),h=x((g,m,U)=>l(g,U)||u(m,U),"labelOverlapsAnything"),d=[],f=x(g=>{for(const{id:m,rect:U}of i)if(TIe(U,g))return m},"findContainingLane"),p=x((g,m)=>d.some(U=>U.labelId!==g&&$I(m,U.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const U=e.get(m);if(!U)continue;const y=g.points;if(!y||y.length<2)continue;const b=U.width??0,v=U.height??0;if(b<=0||v<=0)continue;const w=[];for(let z=0;z=cc&&G>=cc||w.push({idx:z,length:H+G,orientation:H>=cc?"horizontal":"vertical",midX:($.x+V.x)/2,midY:($.y+V.y)/2})}if(w.length===0)continue;const T=w.length>=3?w.filter(z=>z.idx>0&&z.idx0?T:w,C=b>=v?"horizontal":"vertical",S=x(z=>[...z].sort(($,V)=>{const H=$.orientation===C,G=V.orientation===C;if(H!==G)return H?-1:1;const K=$.length>=($.orientation==="horizontal"?b:v)+2,W=V.length>=(V.orientation==="horizontal"?b:v)+2;return K!==W?K?-1:1:V.length-$.length}),"rankSegments"),E=w[0],A=w[w.length-1],R=[.5,.25,.75,.05,.95,.15,.85,.1,.9],_=x((z,$)=>{const V=y[z.idx],H=y[z.idx+1];return{midX:V.x+(H.x-V.x)*$,midY:V.y+(H.y-V.y)*$}},"anchorAtT"),N=x((z,$,V)=>Math.min(V,Math.max($,z)),"clamp"),L=x((z,$)=>z.midX>=$.left-cc&&z.midX<=$.right+cc&&z.midY>=$.top-cc&&z.midY<=$.bottom+cc,"pointInsideRectInclusive"),I=x(z=>{const $=y6(z.midX,z.midY,b,v),V=f($);if(V)return{laneId:V,anchor:z,rect:$};const H=i.find(({rect:ne})=>L(z,ne));if(!H)return;const G=H.rect.left+b/2+s,K=H.rect.right-b/2-s,W=H.rect.top+v/2+s,oe=H.rect.bottom-v/2-s;if(G>K||W>oe)return;const Z={midX:N(z.midX,G,K),midY:N(z.midY,W,oe)},J=y6(Z.midX,Z.midY,b,v);return L(z,J)?{laneId:H.id,anchor:Z,rect:J}:void 0},"placementForAnchor"),P=x((z,$,V)=>z.orientation==="horizontal"?Math.abs($.midX-V.x):Math.abs($.midY-V.y),"distanceAlongSegment"),O=x((z,$)=>{const H=(z.orientation==="horizontal"?b/2:v/2)+o;if(z===E){const G=y[z.idx];if(P(z,$,G)+cc{const $=S(z);for(const V of $)for(const H of R){const G=_(V,H);if(!O(V,G))continue;const K=I(G);if(K&&!Aj(K.rect,y)&&!p(m,K.rect)&&!h(m,g.id,K.rect))return{laneId:K.laneId,anchor:K.anchor}}},"tryPool"),B=x((z,$,V=!1)=>{const H=S(z);for(const G of H){const K={midX:G.midX,midY:G.midY};if($&&!O(G,K))continue;const W=I(K);if(W&&!Aj(W.rect,y)&&!p(m,W.rect)&&!l(m,W.rect)&&(V||!u(g.id,W.rect)))return{laneId:W.laneId,anchor:W.anchor}}},"findLaneContainingFallback"),F=D(k)??(k.lengthV.labelId===m);$>=0?d[$]={labelId:m,rect:z}:d.push({labelId:m,rect:z})}}}x(lM,"anchorLabelsToPolyline");var ZF=1e-6,tXt=8,mge=tXt/2,rXt=3;function Mj(t,e){return t{const h=Mj(o,l);let d=0;const f=x(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||Mj(g,m)===h&&f(p.labelNodeId)}return d>0?d+rXt:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!$te(o,ZF))continue;const l=Hte(s,r,ZF);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,U;if(p){const T=f.cy>d.cy;m={x:d.cx,y:T?d.rect.bottom:d.rect.top},U={x:f.cx,y:T?f.rect.top:f.rect.bottom}}else{const T=f.cx>d.cx;m={x:T?d.rect.right:d.rect.left,y:d.cy},U={x:T?f.rect.left:f.rect.right,y:f.cy}}if(Ja(m,U,n,[u,h],1))continue;const b=a(s,u,h,p?"x":"y"),v=b>mge?b:mge,w=[0,v,-v];for(const T of w){const k={...m},C={...U};if(p){if(k.x+=T,C.x+=T,k.x<=d.rect.left||k.x>=d.rect.right||C.x<=f.rect.left||C.x>=f.rect.right)continue}else if(k.y+=T,C.y+=T,k.y<=d.rect.top||k.y>=d.rect.bottom||C.y<=f.rect.top||C.y>=f.rect.bottom)continue;if(!Ja(k,C,n,[u,h],1)&&!FI(k,C,t,s,{epsilon:ZF})){s.points=[k,C];break}}}}x(KIe,"straightenCollinearSiblingDetours");function Rj(t,e){const{realNodeRects:l,labelNodeRects:u}=M1(e.values()),h=x((T,k)=>c4(k,.001).map(C=>({...C,edge:T,interior:C.index>=1&&C.index<=k.length-3})),"segmentsFor"),d=x(()=>{const T=[];for(const k of t){if(k.isLayoutOnly)continue;const C=k.points;!C||C.length<2||T.push(...h(k,Qn(C)))}return T},"allSegments"),f=x((T,k)=>T.horizontal&&k.horizontal?Hl(T.a.x,T.b.x,k.a.x,k.b.x)>=8&&Math.abs(T.a.y-k.a.y)<7:T.vertical&&k.vertical?Hl(T.a.y,T.b.y,k.a.y,k.b.y)>=8&&Math.abs(T.a.x-k.a.x)<7:!1,"hasCrowdedParallelTrack"),p=x((T,k)=>{const C=T.start,S=T.end,E=h(T,k);if(E.length!==k.length-1)return!1;const A=[C,S].filter(_=>!!_),R=T.labelNodeId?[T.labelNodeId]:[];for(const _ of E)if(Ja(_.a,_.b,l,A,-2)||Ja(_.a,_.b,u,R,-2))return!1;for(const _ of t){if(_===T||_.isLayoutOnly)continue;const N=_.points;if(!(!N||N.length<2)){for(const L of E)for(const I of h(_,Qn(N)))if(f(L,I)||fp(L.a,L.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=x((T,k)=>{const C=Qn(T.edge.points??[]);if(C.length<4||T.index>=C.length-1)return;const S=C.map(E=>({...E}));if(T.horizontal)S[T.index].y+=k,S[T.index+1].y+=k;else if(T.vertical)S[T.index].x+=k,S[T.index+1].x+=k;else return;return h(T.edge,S).length===S.length-1?S:void 0},"shiftedCandidate"),m=x((T,k)=>({x:T.x??(k.left+k.right)/2,y:T.y??(k.top+k.bottom)/2}),"nodeCenter"),U=x(T=>{const k=T.edge,C=Qn(k.points??[]);if(C.length!==4||T.index!==1)return;const S=k.start?e.get(k.start):void 0,E=k.end?e.get(k.end):void 0,A=S?kc(S):void 0,R=E?kc(E):void 0,_=C.slice(T.index+2);if(!(!S||!E||!A||!R||_.length===0))return{sourceCenter:m(S,A),targetCenter:m(E,R),sourceRect:A,tail:_}},"sourceDetourContextFor"),y=x((T,k,C,S,E,A)=>{const R=S.y>=C.y,_=R?E.bottom:E.top,N=_+(R?20:-20);if(R&&T.b.y<=N+.001||!R&&T.b.y>=N-.001)return;const L=T.a.x+k;return Qn([{x:C.x,y:_},{x:C.x,y:N},{x:L,y:N},{x:L,y:T.b.y},...A],.001)},"verticalSourceDetour"),b=x((T,k,C,S,E,A)=>{const R=S.x>=C.x,_=R?E.right:E.left,N=_+(R?20:-20);if(R&&T.b.x<=N+.001||!R&&T.b.x>=N-.001)return;const L=T.a.y+k;return Qn([{x:_,y:C.y},{x:N,y:C.y},{x:N,y:L},{x:T.b.x,y:L},...A],.001)},"horizontalSourceDetour"),v=x((T,k)=>{const C=U(T);if(C){if(T.vertical)return y(T,k,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail);if(T.horizontal)return b(T,k,C.sourceCenter,C.targetCenter,C.sourceRect,C.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let T=0;T<12;T++){const k=d();let C=!1;for(let S=0;SN.interior);for(const N of _){for(const L of w){const I=g(N,L);if(I&&p(N.edge,I)){N.edge.points=I,C=!0;break}const P=v(N,L);if(P&&p(N.edge,P)){N.edge.points=P,C=!0;break}}if(C)break}}if(!C)return}}x(Rj,"nudgeSharedInteriorSubpaths");function ZIe(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}x(ZIe,"segmentsIntersect");function JIe(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=CIe(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;de.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)de.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}x(JIe,"validateSwimlanesLayout");function QIe(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!$Ie(t,e)||e==="BT"&&i.length>0&&!BIe(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Jd(zI(l)))}YIe(n,r),KIe(n,r),FIe(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);lM(n,a),MIe(n,a),zIe(n,a),Rj(n,a),VIe(n,a),HIe(n,a),Cj(n,a),GIe(n,a);const s=x(()=>{jIe(n,a),WIe(n,a),qIe(n,a),lM(n,a),wj(n,a),Cj(n,a),lM(n,a),wj(n,a)},"finalizeRenderedEdges");s(),Rj(n,a),s(),kj(n,a),Sj(n,a),kj(n,a),Sj(n,a)}x(QIe,"postProcessSwimlaneLayout");function R1(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}x(R1,"normalizeGraph");function Xte(t,e){return t.edges.filter(r=>r.dst===e)}x(Xte,"incoming");function eNe(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}x(eNe,"buildSuccessorMap");function Kte(t){const e=eNe(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}x(Kte,"buildSortedSuccessorMap");function Zte(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}x(Zte,"buildInDegreeMap");function Jte(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}x(Jte,"sortedZeroInDegreeNodes");function E_(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}x(E_,"buildPredecessorSuccessorMaps");function Qte(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}x(Qte,"buildLayersFromRanks");function yk(t){const e=Zte(t),r=Jte(e),n=[],i=Kte(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o=i||od.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=x(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}x(tNe,"removeCycles_DFS");function rNe(t){const e=new Map,r=x(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}x(rNe,"buildTopLaneMap");function pp(t){const e=rNe(t);return r=>e.get(r)??null}x(pp,"createTopLaneResolver");function A_(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}x(A_,"buildTopLaneOrder");function tre(t,e){const r=A_(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}x(tre,"resolveTopLaneOrder");var nXt={EPSILON:1e-6},qI={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Uge={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function nNe(t,e){const r=R1(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=E_(r);for(const T of a.values())T.sort((k,C)=>k.localeCompare(C));const s=yk(r)??[...r.nodes].sort((T,k)=>T.localeCompare(k)),o=new Map;for(const[T,k]of s.entries())o.set(k,T);const l=new Map,u=new Map;for(const T of r.nodes)u.set(T,[]);for(const T of s){const k=(a.get(T)??[]).filter(C=>l.has(C));if(k.length>0){const C=iNe(T,k,{laneOf:n,rankHint:i,topoIndex:o});l.set(T,C),u.get(C).push(T)}else l.has(T)||l.set(T,null)}for(const T of r.nodes)l.has(T)||l.set(T,null);const h=new Set;for(const T of r.nodes)(l.get(T)??null)===null&&h.add(T);const d=[...h].sort((T,k)=>{const C=o.get(T)??0,S=o.get(k)??0;return C===S?T.localeCompare(k):C-S}),f=aNe(r),p=new Map;for(const[T,k]of f.entries())p.set(T,[...k].sort((C,S)=>C.localeCompare(S)));const g=sNe(p),m=oNe(p),U=new Map;for(const T of r.nodes)U.set(T,[]);for(const T of m)for(const k of T.nodes){const C=U.get(k);C?C.push(T.id):U.set(k,[T.id])}const y=[],b=[],v=new Set,w=x(T=>{if(!v.has(T)){v.add(T),y.push(T);for(const k of u.get(T)??[])w(k);b.push(T)}},"walk");for(const T of d)w(T);for(const T of s)w(T);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:U,adjacency:p,preorder:y,postorder:b,topologicalOrder:s}}x(nNe,"buildDrivingTree");function iNe(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,U;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=(U=r.rankHint)==null?void 0:U[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}x(iNe,"chooseParent");function aNe(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}x(aNe,"buildAdjacency");function sNe(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}x(sNe,"assignComponents");function oNe(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=x((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(lNe(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}x(oNe,"computeBlocks");function lNe(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}x(lNe,"popBlock");function cNe(t,e,r){const n=[...t.nodes],i=new Map;for(const[b,v]of n.entries())i.set(v,b);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const b of n){const v=r.parent.get(b)??null,w=i.get(b);w!=null&&v==null&&(s[w]=-1,o[w]=0,u.has(b)||(u.add(b),l.push(b)))}for(;l.length>0;){const b=l.shift(),v=i.get(b);if(v==null)continue;const w=r.children.get(b)??[];for(const T of w){if(u.has(T))continue;const k=i.get(T);k!=null&&(s[k]=v,o[k]=o[v]+1,u.add(T),l.push(T))}}for(const b of n){if(u.has(b))continue;const v=i.get(b);v!=null&&(s[v]=-1,o[v]=0,u.add(b))}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 b=0;b{if(b===-1||v===-1)return-1;o[b]>T&1&&(b=d[T][b],b===-1))return-1;if(b===v)return b;for(let T=h-1;T>=0;T--){const k=d[T][b],C=d[T][v];k===-1||C===-1||k!==C&&(b=k,v=C)}return d[0][b]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const b of t.edges){let v=b.src,w=b.dst,T=e[v],k=e[w];if(T==null||k==null||(T>k&&([v,w]=[w,v],[T,k]=[k,T]),T==null||k==null||T===k))continue;const C=i.get(v),S=i.get(w);if(C==null||S==null)continue;const E=f(C,S);if(E===-1)continue;const A=p[E];for(let R=T;R{if(v.size!==0)for(const[w,T]of v)b.set(w,(b.get(w)??0)+T)},"mergeInto"),U=new Set,y=x(b=>{const v=i.get(b);U.add(b);const w=v==null?void 0:p[v],T=w?new Map(w):new Map,k=r.children.get(b)??[];for(const C of k){const S=y(C),E=e[b];if(E!=null){let A=g.get(b);A||(A=new Map,g.set(b,A));let R=S.get(E)??0;const _=e[C];_!=null&&_>E&&(R+=1),A.set(C,R)}m(T,S)}return T},"dfs");for(const b of r.roots)U.has(b)||y(b);for(const b of n)U.has(b)||y(b);return g}x(cNe,"computeSubtreeCrossCounts");function uNe(t,e,r){const n=new Map,i=x(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(rre(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}x(uNe,"annotateMinimumLayers");function rre(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}x(rre,"compareByRankThenId");function hNe(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=x(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}x(hNe,"emitNodesInTreeOrder");function dNe(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}x(dNe,"deduplicateLayers");function fNe(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}x(fNe,"createChildOrderer");function jI(t,e,r){const n=nNe(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=cNe(t,e,n),o=[...a].sort(rre(e)),l=uNe(o,i,e),u=fNe(i,e,s,l);let h=hNe(o,t.nodes,e,u);return h=dNe(h),h}x(jI,"buildMultitreeLayerOrder");function pNe(t,e,r){const n=new Set(t),i=new Set(e),a=u4(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return ere(s)}x(pNe,"countCrossingsBetweenAdjacent");function Lj(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 y of n.get(d)??[])p=Math.max(p,(r[y]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=jI(t,r,i),U=Lj(m,t.edges,r);U(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 U=r(m.dst);U==null||U===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 U=r(m.src);U&&(U===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}x(mNe,"adjustCrossLaneSources");function UNe(t,e){const r=R1(t),n=yk(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=pp(r);let s=Object.create(null);for(const l of n){const u=Xte(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=gNe(r,s)),e!=null&&e.ignoreCrossLaneEdges&&mNe(r,s),{layers:jI(r,s,a),rankOf:s,dummy:new Set}}x(UNe,"assignLayers_LongestPath");function yNe(t,e){const r=R1(t),i={...UNe(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=pp(r),{preds:s,succs:o}=E_(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),U=a(g.dst);if(m&&U&&m!==U)return!1}return!0}),l=yk(r)??[...r.nodes],u=[...l].reverse(),h=x((g,m)=>{let U=0;for(const v of s.get(g)??[])U=Math.max(U,(i[v]??0)+1);let y=Number.POSITIVE_INFINITY;const b=o.get(g)??[];return b.length>0&&(y=Math.min(...b.map(v=>(i[v]??0)-1))),Number.isFinite(y)||(y=Math.max(U,m)),Math.min(Math.max(m,U),y)},"clampFeasible"),d=qI.GRAVITY_ITERATIONS,f=x(g=>{let m=!1;for(const U of g){const y=s.get(U)??[],b=o.get(U)??[];if(y.length===0&&b.length===0)continue;const v=y.length>0?y.reduce((C,S)=>C+(i[S]??0)+1,0)/y.length:i[U]??0,w=b.length>0?b.reduce((C,S)=>C+(i[S]??0)-1,0)/b.length:i[U]??0,T=Math.round((v+w)/2),k=h(U,T);k!==i[U]&&(i[U]=k,m=!0)}return m},"relaxOrder");for(let g=0;g0){const U=Math.min(...m.map(y=>(i[y]??0)-1));(i[g]??0)>U&&(i[g]=U)}}return{layers:Qte(r,l,i),rankOf:i,dummy:new Set}}x(yNe,"assignLayers_Gravity");function bNe(t){const e=Zte(t),r=Kte(t);let n=Jte(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}x(bNe,"topoSortByGenerationIfAcyclic");function vNe(t,e){const r=R1(t),n=(e==null?void 0:e.direction)==="LR"?bNe(r)??[...r.nodes].sort():yk(r)??[...r.nodes].sort(),i=pp(r),a=x(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=x((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=Xte(r,h);let p=0;if(f.length>0)for(const y of f){const b=y.src,v=s[b]??0;p=Math.max(p,v+l(b,h))}const g=a(h),m=o.get(g)??0,U=Math.max(p,m);s[h]=U,o.set(g,U+1)}return{layers:Qte(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}x(vNe,"assignLayers_LaneAwareCompact");function xNe(t,e){const r=R1(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=x(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let U=p.src;for(let b=g+1,v=0;b!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}x(xNe,"makeProperLayering");function Ij(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}x(Ij,"median");function Nj(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}x(Nj,"barycenter");function wNe(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}x(wNe,"neighborPositionsFor");function TNe(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}x(TNe,"currentOrderTieBreak");function Dj(t,e,r){const n=new Set(t),i=new Set(e),a=u4(t),s=u4(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 ere(l)}x(Dj,"countCrossingsBetweenAdjacent");function cM(t,e,r){return[...t].sort((n,i)=>{const a=Ij(e.get(n)??[]),s=Ij(e.get(i)??[]);return a===s?TNe(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}x(cM,"sortByHeuristic");function Oj(t,e,r,n,i,a){const s=u4(t),o=u4(e),l=wNe(e,s,r,n);if(!i||!a||a.length===0)return cM(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=cM(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=cM(d,l,o);for(const p of f){const g=Nj(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[U,y]of h.entries()){const b=Nj(l.get(y)??[]);if(gs.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=x(m=>{let U=Dj(t,m,u);return h&&n&&(U+=Dj(m,n,h)),U},"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=pp(e),s=tre(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l=0;l--)n[l]=Oj(n[l+1],n[l],i,"up",a,s),n[l]=_j(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}x(CNe,"orderLayers");function kNe(t,e,r){const n=(r==null?void 0:r.layerGap)??Uge.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??Uge.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=x(A=>e.nodeById.get(A),"getNode"),f=x(A=>{var R;return((R=d(A))==null?void 0:R.width)??0},"getWidth"),p=x(A=>{var R;return((R=d(A))==null?void 0:R.height)??0},"getHeight"),g=pp(e),m=tre(e,r==null?void 0:r.laneOrder),U=l.map(A=>A.reduce((R,_)=>Math.max(R,p(_)),0)),y=[];if(o)for(let A=0;A+1Math.max(D,f(B)),0),_=l[A+1].reduce((D,B)=>Math.max(D,f(B)),0),N=U[A],L=U[A+1],I=N/2+L/2,P=(R+_)/2,O=Math.max(0,P-I-n);y.push(O)}const b=new Set;for(const A of l)for(const R of A)b.add(g(R));const v=b.has(null),w=m.filter(A=>b.has(A)),T=[...v?[null]:[],...w],k=Object.create(null);for(const A of w)k[A]=0;v&&(k.null=0);for(const A of l){const R=Object.create(null),_=[];for(const N of A){const L=g(N);L===null?_.push(N):(R[L]||(R[L]=[])).push(N)}for(const[N,L]of Object.entries(R)){const I=L.reduce((P,O)=>P+f(O),0)+i*Math.max(0,L.length-1);k[N]=Math.max(k[N]??0,I)}if(v&&_.length){const N=_.reduce((L,I)=>L+f(I),0)+i*Math.max(0,_.length-1);k.null=Math.max(k.null??0,N)}}const C=new Map;{const A=T.map(N=>(N===null?k.null:k[N])??0);let _=-(A.reduce((N,L)=>N+L,0)+a*Math.max(0,T.length-1))/2;for(let N=0;Nf(z)),B=D.reduce((z,$)=>z+$,0)+i*(P.length-1);let F=O-B/2;for(const[z,$]of P.entries()){const V=D[z];u[$]=F+V/2,h[$]=S+_/2,F+=V+i}}}const L=y[A]??0;S+=_+n+L}const E=new Map;for(const A of e.edges){const R=A.ref.id;E.has(R)||E.set(R,[]),E.get(R).push(A)}for(const[,A]of E){if(A.length===0)continue;const R=A[0].ref,_=R.start,N=R.end;if(_==null||N==null)continue;const L=Math.round(((u[_]??0)+(u[N]??0))/2),I=new Set;for(const P of A)I.add(P.src),I.add(P.dst);for(const P of I){if(P===_||P===N)continue;const O=e.nodeById.get(P);O!=null&&O.isDummy&&(u[P]=L)}}return{x:u,y:h}}x(kNe,"assignCoordinates");var SNe=8;function ENe(t){let e=2166136261;for(let r=0;r>>0}x(ENe,"hashString");function ANe(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}x(ANe,"mulberry32");function MNe(t,e){const r=[...t],n=ANe(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}x(MNe,"deterministicShuffle");function RNe(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}x(RNe,"sourceDistance");function Pj(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}x(Pj,"laneArrangementCost");function LNe(t){const e=A_(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=pp(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}x(LNe,"buildWeightedLaneEdges");function Bj(t,e,r){const n=[...t];let i=Pj(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 ENe(`${t.join("|")}#${n}#${r}`)}x(NNe,"seedForRestart");function DNe(t,e={}){const r=A_(t);if(r.length<2)return r;const n=LNe(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=Bj(r,n,i);const s=Math.max(0,e.restarts??SNe);for(let o=0;oSn&&l*3>=o?s>0?"bottom":"top":o>Sn?a>0?"right":"left":r}x($j,"chooseOrthogonalSide");function Fj(t,e){return Math.abs(t.to-e.from)le.isGroup&&!le.parentId);for(const le of u){const pe={id:le.id},Te=x(re=>{s.set(re.id,pe),r.filter(Y=>Y.parentId===re.id).forEach(Te)},"assignLane");Te(le)}const h=r.filter(le=>!le.isGroup&&!le.isEdgeLabel).map(le=>{const pe=le.width??10,Te=le.height??10,re=le.x??0,Y=le.y??0,Q=iXt;return{nodeId:le.id,minX:re-pe/2-Q,maxX:re+pe/2+Q,minY:Y-Te/2-Q,maxY:Y+Te/2+Q,visualXHalfExtent:l?Te/2+Q:pe/2+Q}}),d=x((le,pe,Te,re)=>{let Y=o.find(Q=>Q.orientation===le&&Math.abs(Q.coord-pe)<1);return Y||(Y={id:`pipe-${le}-${pe.toFixed(0)}`,orientation:le,coord:pe,spanMin:Te,spanMax:re,tracks:[]},o.push(Y)),Y.spanMin=Math.min(Y.spanMin,Te),Y.spanMax=Math.max(Y.spanMax,re),Y},"getOrAddPipe"),f=x((le,pe)=>{const Te=le.width??10,re=le.height??10,Y=le.x??0,Q=le.y??0;switch(pe){case"top":return{x:Y,y:Q-re/2};case"bottom":return{x:Y,y:Q+re/2};case"left":return{x:Y-Te/2,y:Q};case"right":return{x:Y+Te/2,y:Q}}},"portForSide"),p=x((le,pe,Te)=>f(le,$j(le,pe,Te?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],U=new Set,y=1e3,b=x((le,pe,Te)=>{if(g.length===0)return 0;const re=Math.abs(pe.y-Te.y)fe||ee.from-Sn<=ue&&ee.to+Sn>=ue&&(Q+=y)}else if(Y){const ue=pe.x,X=Math.min(pe.y,Te.y)-Sn,fe=Math.max(pe.y,Te.y)+Sn;if(fe<=X)return 0;for(const ee of g)ee.edgeIndex===le||ee.orientation!=="horizontal"||ee.pipe.coordfe||ee.from-Sn<=ue&&ee.to+Sn>=ue&&(Q+=y)}return Q},"crossingPenalty"),v=i.map((le,pe)=>{if(!le.start||!le.end)return{idx:pe,crossLane:0,dx:0,dy:0};const Te=a.get(le.start),re=a.get(le.end),Y=s.get(le.start),Q=s.get(le.end),ue=Y&&Q&&Y.id!==Q.id?1:0,X=Te&&re?Math.abs((re.x??0)-(Te.x??0)):0,fe=Te&&re?Math.abs((re.y??0)-(Te.y??0)):0;return{idx:pe,crossLane:ue,dx:X,dy:fe}}).sort((le,pe)=>{if(le.crossLane!==pe.crossLane)return pe.crossLane-le.crossLane;const Te=le.dx+le.dy,re=pe.dx+pe.dy;return Math.abs(Te-re)>1?Te-re:le.idx-pe.idx}).map(le=>le.idx),w=x((le,pe,Te,re)=>{const Y=Math.min(le.x,pe.x),Q=Math.max(le.x,pe.x),ue=Math.min(le.y,pe.y),X=Math.max(le.y,pe.y);return!!h.find(ee=>Te&&ee.nodeId===Te||re&&ee.nodeId===re?!1:Math.abs(le.x-pe.x)>Sn?ee.minYle.y&&ee.maxX>Y&&ee.minXle.x&&ee.maxY>ue&&ee.minY$j(le,pe,"bottom"),"determineSide"),S=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 Te=a.get(pe.start),re=a.get(pe.end);if(!Te||!re)continue;const Y=(re.x??0)-(Te.x??0),Q=(re.y??0)-(Te.y??0);S.set(le,{edgeIdx:le,srcId:pe.start,dstId:pe.end,srcSide:C(Te,{x:re.x??0,y:re.y??0}),dstSide:C(re,{x:Te.x??0,y:Te.y??0}),absDx:Math.abs(Y),absDy:Math.abs(Q),dxSign:Math.sign(Y),dySign:Math.sign(Q)})}const E=x(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"),A=x(le=>le.srcSide==="top"||le.srcSide==="bottom"?le.dxSign>=0?"right":"left":le.dySign>=0?"bottom":"top","secondarySide"),R=new Map;for(const le of S.values()){const pe=`${le.srcId}:${le.srcSide}`;R.has(pe)||R.set(pe,[]),R.get(pe).push(le)}const _=new Map,N=x((le,pe)=>`${le}:${pe}`,"loadKey");for(const le of S.values())_.set(N(le.srcId,le.srcSide),(_.get(N(le.srcId,le.srcSide))??0)+1),_.set(N(le.dstId,le.dstSide),(_.get(N(le.dstId,le.dstSide))??0)+1);for(const le of R.values())if(!(le.length<2)){le.sort((pe,Te)=>{const re=E(pe),Y=E(Te);return Math.abs(re-Y)>1e-9?Y-re:pe.edgeIdx-Te.edgeIdx});for(let pe=1;pe=Y||(_.set(N(Te.srcId,Te.srcSide),Y-1),_.set(N(Te.srcId,re),Q+1),Te.srcSide=re)}}const L=x(le=>{const pe=le==null?void 0:le.shape;return pe==="question"||pe==="diamond"},"isDiamondNode"),I=new Map;for(const le of S.values())I.has(le.dstId)||I.set(le.dstId,new Set),I.get(le.dstId).add(le.dstSide);for(const le of S.values()){if(!L(a.get(le.srcId)))continue;const pe=I.get(le.srcId);if(!(pe!=null&&pe.has(le.srcSide)))continue;const Te=A(le);if(pe.has(Te)||(_.get(N(le.srcId,Te))??0)>0)continue;const re=_.get(N(le.srcId,le.srcSide))??0;_.set(N(le.srcId,le.srcSide),Math.max(0,re-1)),_.set(N(le.srcId,Te),1),le.srcSide=Te}for(const le of S.values()){const{edgeIdx:pe,srcId:Te,dstId:re,srcSide:Y,dstSide:Q}=le,ue=a.get(Te),X=a.get(re),fe=`${Te}:${Y}:src`,ee=Y==="top"||Y==="bottom"?X.x??0:X.y??0;T.has(fe)||T.set(fe,[]),T.get(fe).push({edgeIdx:pe,oppositeCoord:ee});const Ae=`${re}:${Q}:dst`,Me=Q==="top"||Q==="bottom"?ue.x??0:ue.y??0;T.has(Ae)||T.set(Ae,[]),T.get(Ae).push({edgeIdx:pe,oppositeCoord:Me})}const P=new Map,O=8;for(const[le,pe]of T){if(pe.length<2)continue;pe.sort((Ze,Fe)=>Ze.oppositeCoord-Fe.oppositeCoord);const Te=le.split(":"),re=Te.slice(0,-2).join(":"),Y=Te[Te.length-2],Q=Te[Te.length-1],ue=a.get(re);if(!ue)continue;const fe=Y==="left"||Y==="right"?ue.height??10:ue.width??10,ee=ue.shape,Me=ee==="question"||ee==="diamond"?fe*.3:fe,Ne=Math.min(20,Math.max(O,Me/(pe.length+1))),De=-(Ne*(pe.length-1))/2;for(const[Ze,Fe]of pe.entries()){const at=De+Ze*Ne,_e=`${Fe.edgeIdx}:${Q}`;P.set(_e,at)}}const D=x(le=>{var pe;return!!((pe=i[le])!=null&&pe.labelNodeId)},"edgeHasLabelNode"),B=x((le,pe)=>le?(T.get(`${le}:${pe}:src`)??[]).some(({edgeIdx:Te})=>D(Te))||(T.get(`${le}:${pe}:dst`)??[]).some(({edgeIdx:Te})=>D(Te)):!1,"faceHasLabelNode"),F=x((le,pe,Te)=>pe==="top"||pe==="bottom"?{x:le.x+Te,y:le.y}:{x:le.x,y:le.y+Te},"applyPortOffset"),z=x((le,pe,Te)=>{const re=S.get(le),Y={x:Te.x??0,y:Te.y??0},Q={x:pe.x??0,y:pe.y??0},ue=(re==null?void 0:re.srcSide)??C(pe,Y),X=(re==null?void 0:re.dstSide)??C(Te,Q);let fe=re?f(pe,re.srcSide):p(pe,Y,!0),ee=re?f(Te,re.dstSide):p(Te,Q,!1);const Ae=P.get(`${le}:src`),Me=P.get(`${le}:dst`);return Ae!==void 0&&(fe=F(fe,ue,Ae)),Me!==void 0&&(ee=F(ee,X,Me)),{pSrcPort:fe,pDstPort:ee,srcSide:ue,dstSide:X}},"portsForEdge");for(const le of v){const pe=i[le];if(m[le]=[],!pe.start||!pe.end||pe.points&&pe.points.length>0||pe.start===pe.end)continue;const Te=a.get(pe.start),re=a.get(pe.end);if(!Te||!re)continue;const{pSrcPort:Y,pDstPort:Q,srcSide:ue,dstSide:X}=z(le,Te,re),fe={...Y},ee={...Q},Ae=ue==="top"||ue==="bottom",Me=X==="top"||X==="bottom";if(Ae){const ut=Y.y>(Te.y??0);fe.y=ut?Y.y+yu:Y.y-yu}else{const ut=Y.x>(Te.x??0);fe.x=ut?Y.x+yu:Y.x-yu}if(Me){const ut=Q.y>(re.y??0);ee.y=ut?Q.y+yu:Q.y-yu}else{const ut=Q.x>(re.x??0);ee.x=ut?Q.x+yu:Q.x-yu}const Ke=x((ut,Ut)=>{for(const Zt of h)if(!Ut.includes(Zt.nodeId)&&ut.x>Zt.minX&&ut.xZt.minY&&ut.y{if(un){const _t=ut.y>(Ut.y??0);return{x:(Zt.x??0)>=ut.x?$r.maxX+om:$r.minX-om,y:_t?$r.maxY+S2:$r.minY-S2,leavesPositiveSide:_t}}const Tt=ut.x>(Ut.x??0),yt=(Zt.y??0)>=ut.y;return{x:Tt?$r.maxX+om:$r.minX-om,y:yt?$r.maxY+S2:$r.minY-S2,leavesPositiveSide:Tt}},"obstacleDetour");let je=[];const De=[pe.start,pe.end],Ze=Ke(fe,De);if(Ze.inside&&Ze.obstacle){const ut=Ze.obstacle;if(Ae){const Ut=Ne(Y,Te,re,ut,!0);fe.x=Ut.x,fe.y=Ut.y;const Zt=Ut.leavesPositiveSide?Math.min(ut.minY-2,Y.y+yu):Math.max(ut.maxY+2,Y.y-yu);je=[{x:Y.x,y:Zt},{x:Ut.x,y:Zt},{x:Ut.x,y:Ut.y}]}else{const Ut=Ne(Y,Te,re,ut,!1),Zt=Ut.leavesPositiveSide?Math.min(ut.minX-2,Y.x+yu):Math.max(ut.maxX+2,Y.x-yu);fe.x=Ut.x,fe.y=Ut.y,je=[{x:Zt,y:Y.y},{x:Zt,y:Ut.y},{x:Ut.x,y:Ut.y}]}}let Fe=[];const at=Ke(ee,De);if(at.inside&&at.obstacle){const ut=at.obstacle;if(Me){const Ut=Ne(Q,re,Te,ut,!0);ee.x=Ut.x,ee.y=Ut.y,Fe=[{x:Ut.x,y:Ut.y},{x:Q.x,y:Ut.y}]}else{const Ut=Ne(Q,re,Te,ut,!1);ee.x=Ut.x,ee.y=Ut.y,Fe=[{x:Ut.x,y:Ut.y},{x:Ut.x,y:Q.y}]}}if(je.length===0&&Fe.length===0){const ut=om,Ut=Math.abs(fe.x-ee.x)1||Tt>1,_t=k.get(pe.start??"")??0,ft=k.get(pe.end??"")??0,or=un>1&&B(pe.start,ue)||Tt>1&&B(pe.end,X),Ie=un<=1||_t<=2,ui=Tt<=1||ft<=2;if((Ut||Zt)&&!$r&&(!yt||yt&&!or&&Ie&&ui)&&!w(Y,Q,pe.start,pe.end)){pe.points=[{...Y},{...fe},{...ee},{...Q}],U.add(le);const Mn=Zt?"horizontal":"vertical",Ua=Zt?Y.y:Y.x,bn=Zt?Math.min(Y.x,Q.x):Math.min(Y.y,Q.y),wi=Zt?Math.max(Y.x,Q.x):Math.max(Y.y,Q.y),Rn={id:`fast-path-${Mn}-${Ua.toFixed(0)}-${le}`,orientation:Mn,coord:Ua,spanMin:bn,spanMax:wi,tracks:[]};g.push({edgeIndex:le,segmentIndex:0,orientation:Mn,pipe:Rn,trackIndex:0,from:bn,to:wi});continue}}const _e=d("vertical",fe.x,fe.y,fe.y);fe.x=_e.coord;const gt=d("vertical",ee.x,ee.y,ee.y);ee.x=gt.coord;let Le=Math.min(fe.x,ee.x)-50,kt=Math.max(fe.x,ee.x)+50,Et=Math.min(fe.y,ee.y)-50,ot=Math.max(fe.y,ee.y)+50;for(const ut of h){const Ut=Math.min(fe.x,ee.x),Zt=Math.max(fe.x,ee.x),$r=Math.min(fe.y,ee.y),un=Math.max(fe.y,ee.y);ut.minXUt&&ut.minY$r&&(Le=Math.min(Le,ut.minX-NE),kt=Math.max(kt,ut.maxX+NE),Et=Math.min(Et,ut.minY-NE),ot=Math.max(ot,ut.maxY+NE))}for(const ut of h){if(ut.maxXkt||ut.maxYot)continue;const Ut=om;d("horizontal",ut.minY-Ut,Le,kt),d("horizontal",ut.maxY+Ut,Le,kt);const Zt=S2;d("vertical",ut.minX-Zt,Et,ot),d("vertical",ut.maxX+Zt,Et,ot)}d("horizontal",fe.y,Le,kt),d("horizontal",ee.y,Le,kt);const Vt=o.filter(ut=>ut.orientation==="horizontal"&&ut.coord>=Et&&ut.coord<=ot),Lt=o.filter(ut=>ut.orientation==="vertical"&&ut.coord>=Le&&ut.coord<=kt),dt=x((ut,Ut)=>`${ut.toFixed(1)},${Ut.toFixed(1)}`,"getKey"),ve=dt(fe.x,fe.y),It=dt(ee.x,ee.y),xt=new Map,mt=new Map,Mt=new Map,Or=new Set,Se=[];xt.set(ve,0),Mt.set(ve,"n"),Se.push({key:ve,f:Math.hypot(ee.x-fe.x,ee.y-fe.y),pt:fe}),Or.add(ve);let it=[];const pt=x((ut,Ut)=>w(ut,Ut,pe.start,pe.end),"checkSegmentBlocked"),bt={x:ee.x,y:fe.y},ir=pt(fe,bt),Br=pt(bt,ee),kr=ir||Br,jr={x:fe.x,y:ee.y},Er=pt(fe,jr),an=pt(jr,ee);if(kr?Er||an||(Math.abs(fe.x-ee.x)0;){Se.sort((ft,or)=>ft.f-or.f);const ut=Se.shift();if(Or.delete(ut.key),ut.key===It){let ft=It,or=ee;for(it=[or];mt.has(ft);){const Ie=mt.get(ft);it.unshift(Ie),or=Ie,ft=dt(Ie.x,Ie.y)}break}const Ut=ut.pt.x,Zt=ut.pt.y,$r=Lt.sort((ft,or)=>ft.coord-or.coord),un=$r.findIndex(ft=>Math.abs(ft.coord-Ut)<1),Tt=Vt.sort((ft,or)=>ft.coord-or.coord),yt=Tt.findIndex(ft=>Math.abs(ft.coord-Zt)<1),_t=[];un>0&&_t.push({x:$r[un-1].coord,y:Zt}),un>=0&&un<$r.length-1&&_t.push({x:$r[un+1].coord,y:Zt}),yt>0&&_t.push({x:Ut,y:Tt[yt-1].coord}),yt>=0&&ytrs.nodeId===pe.start||rs.nodeId===pe.end?!1:or!==Ie?rs.minYZt&&rs.maxX>or&&rs.minXUt&&rs.maxY>ui&&rs.minY10&&ic<-5||Fo<-10&&ic>5)&&(wi=Math.abs(ic)*100),(Rn>10&&eh<-5||Rn<-10&&eh>5)&&(wi+=Math.abs(eh)*50);let G1=0;const W1=Mt.get(ut.key)??"n",q1=Math.abs(eh)>Sn?"h":"v";W1!=="n"&&W1!==q1&&(G1=50);const vs=Ua+bn+wi+G1,ac=(xt.get(ut.key)??1/0)+vs,go=Math.abs(ee.x-ft.x)+Math.abs(ee.y-ft.y);if(ac<(xt.get(Mn)??1/0))if(mt.set(Mn,ut.pt),xt.set(Mn,ac),Mt.set(Mn,q1),!Or.has(Mn))Se.push({key:Mn,f:ac+go,pt:ft}),Or.add(Mn);else{const rs=Se.findIndex(Ic=>Ic.key===Mn);rs!==-1&&(Se[rs].f=ac+go)}}}if(it.length===0&&(it=[fe,{x:fe.x,y:ee.y},ee]),it.length>4){const ut=it[0],Ut=it[it.length-1];let Zt=Math.min(ut.x,Ut.x),$r=Math.max(ut.x,Ut.x),un=Math.min(ut.y,Ut.y),Tt=Math.max(ut.y,Ut.y);for(const ui of it)Zt=Math.min(Zt,ui.x),$r=Math.max($r,ui.x),un=Math.min(un,ui.y),Tt=Math.max(Tt,ui.y);const yt=$r>Math.max(ut.x,Ut.x),_t=Ztbn.minXBe&&bn.minYhn);if(Ua.length>0){let bn=Math.max(ut.x,Ut.x);for(const wi of Ua){const Rn=(wi.minX+wi.maxX)/2;if(wi.visualXHalfExtent===void 0||isNaN(wi.visualXHalfExtent))continue;const Fo=Rn+wi.visualXHalfExtent+ui;bn=Math.max(bn,Fo)}isNaN(bn)||($r=bn)}}if(_t){const Be=h.filter(hn=>hn.minXMath.min(ut.y,Ut.y));if(Be.length>0){let hn=Math.min(ut.x,Ut.x);for(const Mn of Be){const bn=(Mn.minX+Mn.maxX)/2-Mn.visualXHalfExtent-ui;hn=Math.min(hn,bn)}Zt=hn}}}const ft=x(ui=>{const Be=Ut.y>ut.y,hn=h.filter(bn=>{const wi=Math.min(ut.x,Ut.x)bn.minX,Rn=Math.min(ut.y,Ut.y)bn.minY;return wi&&Rn});let Mn=hn;if(l&&hn.length>0){const bn=hn.filter(wi=>wi.minXui);bn.length>0&&(Mn=bn)}if(Mn.length===0)return Ut.y;const Ua=om;if(Be){const wi=Math.max(...Mn.map(Rn=>Rn.maxY))+Ua;if(wiRn.minY))-Ua;if(wi>Ut.y+Sn)return wi}return Ut.y},"findBestReturnY"),or=x(ui=>{const Be=ft(ui),hn={x:ui,y:ut.y},Mn={x:ui,y:Be},Ua={x:Ut.x,y:Be},bn=pt(ut,hn),wi=pt(hn,Mn),Rn=pt(Mn,Ua),Fo=Be!==Ut.y?pt(Ua,Ut):!1;return!bn&&!wi&&!Rn&&!Fo?Math.abs(Be-Ut.y)=3){const ut=Yr[Yr.length-1],Ut=Yr[Yr.length-2],Zt=Yr[Yr.length-3],$r=Math.abs(Zt.y-Ut.y)Math.abs(ut.x-Zt.x)&&Yr.splice(-2,1)}else if(un){const Tt=Math.sign(Ut.y-Zt.y),yt=Math.sign(ut.y-Zt.y);Tt!==0&&Tt===yt&&Math.abs(Ut.y-Zt.y)>Math.abs(ut.y-Zt.y)&&Yr.splice(-2,1)}}const Cn=[Yr[0]];for(let ut=1;utUt.x,Tt=$r.x>Zt.x;if(un!==Tt){Cn.push(Zt);continue}continue}if(Math.abs(Ut.x-Zt.x)Ut.y,Tt=$r.y>Zt.y;if(un!==Tt){Cn.push(Zt);continue}continue}Cn.push(Zt)}Cn.push(Yr[Yr.length-1]);for(let ut=0;utle.from{const Y=!re.segments.some(ue=>(ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex)&&$(ue,le)),Q=!Te.segments.some(ue=>(ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex)&&$(ue,pe));return Y&&Q?(le.trackIndex=re.index,pe.trackIndex=Te.index,Te.segments=[...Te.segments.filter(ue=>ue.edgeIndex!==le.edgeIndex||ue.segmentIndex!==le.segmentIndex),{edgeIndex:pe.edgeIndex,segmentIndex:pe.segmentIndex,from:pe.from,to:pe.to}],re.segments=[...re.segments.filter(ue=>ue.edgeIndex!==pe.edgeIndex||ue.segmentIndex!==pe.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],!0):!1},"trySwapSegmentsAcrossTracks"),H=x(le=>{const pe=le.tracks.length;return le.tracks[pe]={index:pe,coord:le.coord,segments:[]},pe},"createNewTrack"),G=x((le,pe)=>{const Te=le.pipe.tracks[le.trackIndex];Te.segments=Te.segments.filter(Y=>Y.edgeIndex!==le.edgeIndex||Y.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"),K=x((le,pe)=>{const Te=m[le.edgeIndex];for(const re of Te){const Y=g[re];Y.pipe===le.pipe&&G(Y,pe)}},"moveSegmentChainToTrack"),W=x(le=>{const pe=m[le.edgeIndex],Te=pe.indexOf(g.indexOf(le)),re=[];return Te>0&&re.push(g[pe[Te-1]]),Te{if(le.orientation===pe.orientation)return!1;const Te=le.orientation==="horizontal"?le:pe,re=le.orientation==="horizontal"?pe:le;return re.pipe.coord>Te.from&&re.pipe.coordre.from&&Te.pipe.coord{for(const Te of le.tracks)if(!Te.segments.some(Y=>(Y.edgeIndex!==pe.edgeIndex||Y.segmentIndex!==pe.segmentIndex)&&$(Y,pe)))return Te.index;return-1},"findAvailableTrack"),J=x((le,pe)=>{if(le.trackIndex===pe.trackIndex)return $(le,pe);const Te=W(le),re=W(pe);return Te.some(Y=>re.some(Q=>oe(Y,Q)))},"segmentsConflict"),ne=x((le,pe,Te)=>{if(V(le,pe,le.pipe.tracks[le.trackIndex],pe.pipe.tracks[pe.trackIndex]))return;const re=Z(le.pipe,pe);Te(pe,re!==-1?re:H(le.pipe))},"resolveTrackConflict"),ie=x(le=>{let pe=0;for(let Te=0;Te{if(me.has(le))return me.get(le);const pe=m[le];if(pe.length===0){const X={dest:0,deviation:0,base:0,delta:0};return me.set(le,X),X}const re=g[pe[0]].pipe.coord;let Y=re;for(let X=1;XMath.abs(Ae-re)?ee:Ae;break}}const Q=Math.abs(Y-re),ue={dest:Y,deviation:Q,base:re,delta:Y-re};return me.set(le,ue),ue},"getDestInfo"),Re=x(()=>{let le=0;const pe=new Map;for(const[re,Y]of i.entries())m[re].length!==0&&Y.start&&(pe.has(Y.start)||pe.set(Y.start,[]),pe.get(Y.start).push(re));const Te=x(re=>{const Y=i[re];if(!Y.start||!Y.end)return 0;const Q=a.get(Y.start),ue=a.get(Y.end);if(!Q||!ue)return 0;const X=(ue.x??0)-(Q.x??0),fe=(ue.y??0)-(Q.y??0);return Math.abs(X)+Math.abs(fe)},"getEdgeDistance");for(const re of pe.values()){re.sort((Q,ue)=>{const X=te(Q),fe=te(ue);if(Math.abs(X.deviation-fe.deviation)>1)return X.deviation-fe.deviation;if(Math.abs(X.dest-fe.dest)>1)return X.dest-fe.dest;const ee=Te(Q),Ae=Te(ue);if(Math.abs(ee-Ae)>1)return Ae-ee;const Me=m[Q].length,Ke=m[ue].length;if(Me!==Ke)return Me-Ke;if(Me===1){const Ne=m[Q][0],je=m[ue][0];if(g[Ne]&&g[je]){const De=g[Ne],Ze=g[je],Fe=Math.abs(De.to-De.from),at=Math.abs(Ze.to-Ze.from);if(Math.abs(Fe-at)>1)return Fe-at}}return 0});const Y=re.map(Q=>g[m[Q][0]]);le+=ie(Y)}return le},"fixSourceHandleCrossings"),Pe=x(()=>{let le=0;const pe=new Map;for(const[Te,re]of i.entries())m[Te].length!==0&&re.end&&(pe.has(re.end)||pe.set(re.end,[]),pe.get(re.end).push(Te));for(const Te of pe.values()){Te.sort((Y,Q)=>{const ue=x(ee=>{const Ae=m[ee];if(Ae.length<2)return 0;const Me=g[Ae[Ae.length-2]];return Math.abs(Me.to-Me.from)},"getDist"),X=ue(Y),fe=ue(Q);return Math.abs(X-fe)>.1?X-fe:Y-Q});const re=Te.map(Y=>g[m[Y][m[Y].length-1]]);le+=ie(re)}return le},"fixTargetHandleCrossings"),Ve=x(()=>{let le=0;for(const pe of o){const Te=[];for(const re of pe.tracks)for(const Y of re.segments){const Q=m[Y.edgeIndex].find(ue=>g[ue].segmentIndex===Y.segmentIndex);Q!==void 0&&Te.push(g[Q])}Te.sort((re,Y)=>re.edgeIndex-Y.edgeIndex||re.segmentIndex-Y.segmentIndex);for(let re=0;re{re.segments.forEach(Y=>{pe.push({edgeIndex:Y.edgeIndex,segmentIndex:Y.segmentIndex,trackIndex:re.index,from:Y.from,to:Y.to})})}),pe.sort((re,Y)=>re.from-Y.from);const Te=[];if(pe.length>0){let re=[pe[0]],Y=pe[0].to;for(let Q=1;QY.add(Ne.trackIndex));const Q=new Map;re.forEach(Ne=>{const je=te(Ne.edgeIndex);Q.set(Ne.trackIndex,(Q.get(Ne.trackIndex)??0)+je.delta)});const ue=[...Y].filter(Ne=>(Q.get(Ne)??0)<-1),X=[...Y].filter(Ne=>(Q.get(Ne)??0)>1),fe=[...Y].filter(Ne=>Math.abs(Q.get(Ne)??0)<=1);ue.sort((Ne,je)=>(Q.get(je)??0)-(Q.get(Ne)??0)),X.sort((Ne,je)=>(Q.get(Ne)??0)-(Q.get(je)??0));const ee=x((Ne,je)=>{re.filter(De=>De.trackIndex===Ne).forEach(De=>{const Ze=U.has(De.edgeIndex)?le.coord:je;we.set(`${De.edgeIndex}-${De.segmentIndex}`,Ze)})},"assignCoord");let Ae=0;for(const Ne of ue)Ae++,ee(Ne,le.coord-Ae*JF);if(fe.length===0&&Y.size>0){const Ne=[...Y].sort((Ze,Fe)=>Math.abs(Q.get(Ze)??0)-Math.abs(Q.get(Fe)??0))[0],je=ue.indexOf(Ne);je!==-1&&ue.splice(je,1);const De=X.indexOf(Ne);De!==-1&&X.splice(De,1),fe.push(Ne)}let Me=0;for(const Ne of fe){if(Me===0)ee(Ne,le.coord);else{const je=Me%2===1?1:-1,De=Math.ceil(Me/2);ee(Ne,le.coord+je*De*JF*.5)}Me++}let Ke=0;for(const Ne of X)Ke++,ee(Ne,le.coord+Ke*JF)}}for(const[le,pe]of i.entries()){const Te=m[le]??[];if(Te.length===0)continue;const re=[],Y=a.get(pe.start),Q=a.get(pe.end),{pSrcPort:ue,pDstPort:X}=z(le,Y,Q),fe=Te.map(Me=>{const Ke=g[Me],Ne=we.get(`${Ke.edgeIndex}-${Ke.segmentIndex}`)??Ke.pipe.coord;return{orient:Ke.orientation,coord:Ne,from:Ke.from,to:Ke.to}});re.push(ue);for(let Me=0;MeSn&&re.push(Tm(Ke,je)),Fe&&Ze.orient===Ke.orient)if(Math.abs(Ke.coord-Ze.coord)>Sn){const at=Ke.orient==="vertical"?(je+Ze.from)/2:Fj(Ke,Ze);re.push(Tm(Ke,at),Tm(Ze,at))}else(Me===0||Me===fe.length-2)&&re.push(Tm(Ke,Fj(Ke,Ze)));else if(Fe)re.push(Tm(Ke,Ze.coord));else{const at=Math.abs(Ke.from-je)Sn||Math.abs(ee.y-X.y)>Sn)&&re.push(X);const Ae=[];re.length>0&&Ae.push(re[0]);for(let Me=1;MeSn||Math.abs(Ke.y-Ne.y)>Sn)&&Ae.push(Ke)}pe.points=Ae}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=x((le,pe)=>{const Te=pe.x??0,re=pe.y??0,Y=pe.width??0,Q=pe.height??0;if(Y<=0||Q<=0)return le;const ue=Te-Y/2,X=Te+Y/2,fe=re-Q/2,ee=re+Q/2;if(le.xX||le.yee)return le;const Ae=le.x-ue,Me=X-le.x,Ke=le.y-fe,Ne=ee-le.y,je=Math.min(Ae,Me,Ke,Ne);return je===Ae?{x:ue,y:le.y}:je===Me?{x:X,y:le.y}:je===Ke?{x:le.x,y:fe}:{x:le.x,y:ee}},"nodeBoundaryClamp");for(const le of t.edges){const pe=le.points;if(!pe||pe.length<2)continue;const Te=le.start,re=le.end,Y=Te?a.get(Te):void 0,Q=re?a.get(re):void 0;Y&&(pe[0]=ge(pe[0],Y)),Q&&(pe[pe.length-1]=ge(pe[pe.length-1],Q))}return t}x(_Ne,"routeEdgesOrthogonal");function PNe(t){return t.direction??"TB"}x(PNe,"getSwimlaneDirection");function BNe(t){var h,d,f,p,g;const e=vIe(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=PNe(t),{ordered:l,coordinates:u}=ONe(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});xIe(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;_Ne(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return QIe(t,o),JIe(t),o}x(BNe,"runSwimlaneLayoutCore");async function $Ne(t,e){const r=e.select("g");FQ(r,t.markers,t.type,t.diagramId),qCe(),YCe(),kTe(),PLe(),bIe(t);const n=wIe(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await aIe(r,t);BNe(t),await mIe(t,i)}x($Ne,"render");const aXt=Object.freeze(Object.defineProperty({__proto__:null,render:$Ne},Symbol.toStringTag,{value:"Module"}));function zj(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 FNe(t,e,r){return(e=zNe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cXt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function uXt(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 hXt(){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 dXt(){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 is(t,e){return sXt(t)||uXt(t,e)||nre(t,e)||hXt()}function YI(t){return oXt(t)||cXt(t)||nre(t)||dXt()}function fXt(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 zNe(t){var e=fXt(t,"string");return typeof e=="symbol"?e:e+""}function Fs(t){"@babel/helpers - typeof";return Fs=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},Fs(t)}function nre(t,e){if(t){if(typeof t=="string")return zj(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)?zj(t,e):void 0}}var Ss=typeof window>"u"?null:window,yge=Ss?Ss.navigator:null;Ss&&Ss.document;var pXt=Fs(""),VNe=Fs({}),gXt=Fs(function(){}),mXt=typeof HTMLElement>"u"?"undefined":Fs(HTMLElement),bk=function(e){return e&&e.instanceString&&Ca(e.instanceString)?e.instanceString():null},Dr=function(e){return e!=null&&Fs(e)==pXt},Ca=function(e){return e!=null&&Fs(e)===gXt},Li=function(e){return!Jc(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},ei=function(e){return e!=null&&Fs(e)===VNe&&!Li(e)&&e.constructor===Object},UXt=function(e){return e!=null&&Fs(e)===VNe},Jt=function(e){return e!=null&&Fs(e)===Fs(1)&&!isNaN(e)},HNe=function(e){return Jt(e)&&Math.floor(e)===e},XI=function(e){if(mXt!=="undefined")return e!=null&&e instanceof HTMLElement},Jc=function(e){return vk(e)||GNe(e)},vk=function(e){return bk(e)==="collection"&&e._private.single},GNe=function(e){return bk(e)==="collection"&&!e._private.single},ire=function(e){return bk(e)==="core"},WNe=function(e){return bk(e)==="stylesheet"},yXt=function(e){return bk(e)==="event"},n1=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},bXt=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},vXt=function(e){return ei(e)&&Jt(e.x1)&&Jt(e.x2)&&Jt(e.y1)&&Jt(e.y2)},xXt=function(e){return UXt(e)&&Ca(e.then)},wXt=function(){return yge&&yge.userAgent.match(/msie|trident|edge/i)},h4=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},MXt=function(e,r){return-1*jNe(e,r)},Gr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(U-=1),U<1/6?g+(m-g)*6*U:U<1/2?m:U<2/3?g+(m-g)*(2/3-U)*6:g}var d=new RegExp("^"+kXt+"$").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},IXt=function(e){var r,n=new RegExp("^"+TXt+"$").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},NXt=function(e){return DXt[e.toLowerCase()]},YNe=function(e){return(Li(e)?e:null)||NXt(e)||RXt(e)||IXt(e)||LXt(e)},DXt={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]},XNe=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||L<0||b&&I>=f}function S(){var N=e();if(C(N))return E(N);g=setTimeout(S,k(N))}function E(N){return g=void 0,v&&h?w(N):(h=d=void 0,p)}function A(){g!==void 0&&clearTimeout(g),U=0,h=m=d=g=void 0}function R(){return g===void 0?p:E(e())}function _(){var N=e(),L=C(N);if(h=arguments,d=this,m=N,L){if(g===void 0)return T(m);if(b)return clearTimeout(g),g=setTimeout(S,l),w(m)}return g===void 0&&(g=setTimeout(S,l)),p}return _.cancel=A,_.flush=R,_}return dz=s,dz}var GXt=HXt(),Ck=xk(GXt),fz=Ss?Ss.performance:null,JNe=fz&&fz.now?function(){return fz.now()}:function(){return Date.now()},WXt=(function(){if(Ss){if(Ss.requestAnimationFrame)return function(t){Ss.requestAnimationFrame(t)};if(Ss.mozRequestAnimationFrame)return function(t){Ss.mozRequestAnimationFrame(t)};if(Ss.webkitRequestAnimationFrame)return function(t){Ss.webkitRequestAnimationFrame(t)};if(Ss.msRequestAnimationFrame)return function(t){Ss.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(JNe())},1e3/60)}})(),KI=function(e){return WXt(e)},$0=JNe,zm=9261,QNe=65599,sy=5381,eDe=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zm,n=r,i;i=e.next(),!i.done;)n=n*QNe+i.value|0;return n},GT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zm;return r*QNe+e|0},WT=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sy;return(r<<5)+r+e|0},qXt=function(e,r){return e*2097152+r},Bp=function(e){return e[0]*2097152+e[1]},OE=function(e,r){return[GT(e[0],r[0]),WT(e[1],r[1])]},Dge=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)},cre=function(e){e.splice(0,e.length)},rKt=function(e,r){for(var n=0;n"u"?"undefined":Fs(Set))!==iKt?Set:aKt,L_=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!ire(e)){ca("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"){ca("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 h9,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=[];Li(r.classes)?u=r.classes:Dr(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;hb?1:0},h=function(y,b,v,w,T){var k;if(v==null&&(v=0),T==null&&(T=n),v<0)throw new Error("lo must be non-negative");for(w==null&&(w=y.length);vA;0<=A?E++:E--)S.push(E);return S}).apply(this).reverse(),C=[],w=0,T=k.length;wR;0<=R?++S:--S)_.push(s(y,v));return _},m=function(y,b,v,w){var T,k,C;for(w==null&&(w=n),T=y[v];v>b;){if(C=v-1>>1,k=y[C],w(T,k)<0){y[v]=k,v=C;continue}break}return y[v]=T},U=function(y,b,v){var w,T,k,C,S;for(v==null&&(v=n),T=y.length,S=b,k=y[b],w=2*b+1;w0;){var k=b.pop(),C=U(k),S=k.id();if(f[S]=C,C!==1/0)for(var E=k.neighborhood().intersect(g),A=0;A0)for(D.unshift(O);d[F];){var z=d[F];D.unshift(z.edge),D.unshift(z.node),B=z.node,F=B.id()}return o.spawn(D)}}}},dKt={kruskal:function(e){e=e||function(v){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var T=0;T0;){if(T(),C++,w===h){for(var S=[],E=a,A=h,R=y[A];S.unshift(E),R!=null&&S.unshift(R),E=U[A],E!=null;)A=E.id(),R=y[A];return{found:!0,distance:d[w],path:this.spawn(S),steps:C}}p[w]=!0;for(var _=v._private.edges,N=0;N<_.length;N++){var L=_[N];if(this.hasElementWithId(L.id())&&!(o&&L.data("source")!==w)){var I=L.source(),P=L.target(),O=I.id()!==w?I:P,D=O.id();if(this.hasElementWithId(D)&&!p[D]){var B=d[w]+l(L);if(!k(D)){d[D]=B,f[D]=B+s(O),b(O,D),U[D]=v,y[D]=L;continue}BR&&(g[A]=R,b[A]=E,v[A]=T),!a){var _=E*h+S;!a&&g[_]>R&&(g[_]=R,b[_]=S,v[_]=T)}}}for(var N=0;N1&&arguments[1]!==void 0?arguments[1]:s,we=v(ce),ge=[],ze=we;;){if(ze==null)return r.spawn();var xe=b(ze),Ee=xe.edge,qe=xe.pred;if(ge.unshift(ze[0]),ze.same(he)&&ge.length>0)break;Ee!=null&&ge.unshift(Ee),ze=qe}return l.spawn(ge)},k=0;k=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=vKt(a,e,r),n--}return r},xKt={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(D){return D.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/bKt);if(a<2){ca("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},oDe=function(e,r){return r===0?e:oDe(r,e%r)},EKt=function(e){for(var r=e[0],n=0;n0&&(r=oDe(r,e[n]));else return 0;return r},AKt=function(e){return Math.PI*e/180},_E=function(e,r){return Math.atan2(r,e)-Math.PI/2},ure=Math.log2||function(t){return Math.log(t)/Math.log(2)},hre=function(e){return e>0?1:e<0?-1:0},c5=function(e,r){return Math.sqrt(Cm(e,r))},Cm=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},MKt=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}}},LKt=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},IKt=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},NKt=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},lDe=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},hM=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},dM=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=is(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},Fge=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},dre=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},mg=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},zge=function(e,r){return mg(e,r.x,r.y)},cDe=function(e,r){return mg(e,r.x1,r.y1)&&mg(e,r.x2,r.y2)},DKt=(mz=Math.hypot)!==null&&mz!==void 0?mz:function(t,e){return Math.sqrt(t*t+e*e)};function OKt(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(S,E){return{x:S.x+E.x,y:S.y+E.y}},n=function(S,E){return{x:S.x-E.x,y:S.y-E.y}},i=function(S,E){return{x:S.x*E,y:S.y*E}},a=function(S,E){return S.x*E.y-S.y*E.x},s=function(S){var E=DKt(S.x,S.y);return E===0?{x:0,y:0}:{x:S.x/E,y:S.y/E}},o=function(S){for(var E=0,A=0;A7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?a1(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,U=i-d-o,y=n+h-u+o,b=U;if(g=Ug(e,r,n,i,m,U,y,b,!1),g.length>0)return g}if(p){var v=n+h+o,w=i-d+u-o,T=v,k=i+d-u+o;if(g=Ug(e,r,n,i,v,w,T,k,!1),g.length>0)return g}if(f){var C=n-h+u-o,S=i+d+o,E=n+h-u+o,A=S;if(g=Ug(e,r,n,i,C,S,E,A,!1),g.length>0)return g}if(p){var R=n-h-o,_=i-d+u-o,N=R,L=i+d-u+o;if(g=Ug(e,r,n,i,R,_,N,L,!1),g.length>0)return g}var I;{var P=n-h+u,O=i-d+u;if(I=nx(e,r,n,i,P,O,u+o),I.length>0&&I[0]<=P&&I[1]<=O)return[I[0],I[1]]}{var D=n+h-u,B=i-d+u;if(I=nx(e,r,n,i,D,B,u+o),I.length>0&&I[0]>=D&&I[1]<=B)return[I[0],I[1]]}{var F=n+h-u,z=i+d-u;if(I=nx(e,r,n,i,F,z,u+o),I.length>0&&I[0]>=F&&I[1]>=z)return[I[0],I[1]]}{var $=n-h+u,V=i+d-u;if(I=nx(e,r,n,i,$,V,u+o),I.length>0&&I[0]<=$&&I[1]>=V)return[I[0],I[1]]}return[]},PKt=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},BKt=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)},$Kt=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]},FKt=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)},zKt=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=[];FKt(u,h,d,f,p);for(var g=1e-7,m=[],U=0;U<6;U+=2)Math.abs(p[U+1])=0&&p[U]<=1&&m.push(p[U]);m.push(1),m.push(0);for(var y=-1,b,v,w,T=0;T=0?wu?(e-a)*(e-a)+(r-s)*(r-s):h-f},mc=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},F0=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 U=QI(h,-u);m=JI(U)}else m=h;return mc(e,r,m)},HKt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h=0&&U<=1&&b.push(U),y>=0&&y<=1&&b.push(y),b.length===0)return[];var v=b[0]*l[0]+e,w=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[v,w];var T=b[1]*l[0]+e,k=b[1]*l[1]+r;return[v,w,T,k]}else return[v,w]},Uz=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Ug=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,U=f*p-m*h,y=d*p-g*h,b=m*d-f*g;if(b!==0){var v=U/b,w=y/b,T=.001,k=0-T,C=1+T;return k<=v&&v<=C&&k<=w&&w<=C?[e+v*d,r+v*g]:u?[e+v*d,r+v*g]:[]}else return U===0||y===0?Uz(e,n,o)===o?[o,l]:Uz(e,n,a)===a?[a,s]:Uz(a,o,n)===n?[n,i]:[]:[]},WKt=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=QI(d,-l);p=JI(m)}else p=d}else p=n;for(var U,y,b,v,w=0;w2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),U=1;Uh&&(h=w)},get:function(v){return u[v]}},f=0;f0?I=L.edgesTo(N)[0]:I=N.edgesTo(L)[0];var P=i(I);N=N.id(),C[N]>C[R]+P&&(C[N]=C[R]+P,S.nodes.indexOf(N)<0?S.push(N):S.updateItem(N),k[N]=0,T[N]=[]),C[N]==C[R]+P&&(k[N]=k[N]+k[R],T[N].push(R))}else for(var O=0;O0;){for(var z=w.pop(),$=0;$0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},sZt=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:cZt,o=i,l,u,h=0;h=2?n3(e,r,n,0,qge,uZt):n3(e,r,n,0,Wge)},squaredEuclidean:function(e,r,n){return n3(e,r,n,0,qge)},manhattan:function(e,r,n){return n3(e,r,n,0,Wge)},max:function(e,r,n){return n3(e,r,n,-1/0,hZt)}};d4["squared-euclidean"]=d4.squaredEuclidean;d4.squaredeuclidean=d4.squaredEuclidean;function N_(t,e,r,n,i,a){var s;return Ca(t)?s=t:s=d4[t]||d4.euclidean,e===0&&Ca(t)?s(i,a):s(e,r,n,i,a)}var dZt=Po({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),pre=function(e){return dZt(e)},eN=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 N_(e,i.length,o,l,u,h)},bz=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},gZt=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]],U;a.mode==="dendrogram"?U={left:g,right:m,key:g.key}:U={value:g.value.concat(m.value),key:g.key},e[g.index]=U,e.splice(m.index,1),r[g.key]=U;for(var y=0;yn[m.key][b.key]&&(l=n[m.key][b.key])):a.linkage==="max"?(l=n[g.key][b.key],n[g.key][b.key]0&&i.push(a);return i},Jge=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=Jge(e,r,n),i},Qge=function(e){for(var r=this.cy(),n=this.nodes(),i=EZt(e),a={},s=0;s=R?(_=R,R=L,N=I):L>_&&(_=L);for(var P=0;P0?1:0;C[E%i.minIterations*o+$]=V,z+=V}if(z>0&&(E>=i.minIterations-1||E==i.maxIterations-1)){for(var H=0,G=0;G1||k>1)&&(o=!0),d[v]=[],b.outgoers().forEach(function(S){S.isEdge()&&d[v].push(S.id())})}else f[v]=[void 0,b.target().id()]}):s.forEach(function(b){var v=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(l?u?o=!0:u=v:l=v),d[v]=[],b.connectedEdges().forEach(function(T){return d[v].push(T.id())})}else f[v]=[b.source().id(),b.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(v){for(var w=v,T=[v],k,C,S;d[w].length;)k=d[w].shift(),C=f[k][0],S=f[k][1],w!=S?(d[S]=d[S].filter(function(E){return E!=k}),w=S):!a&&w!=C&&(d[C]=d[C].filter(function(E){return E!=k}),w=C),T.unshift(k),T.unshift(w);return T},m=[],U=[];for(U=g(h);U.length!=1;)d[U[0]].length==0?(m.unshift(s.getElementById(U.shift())),m.unshift(s.getElementById(U.shift()))):U=g(U.shift()).concat(U);m.unshift(s.getElementById(U.shift()));for(var y in d)if(d[y].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},BE=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],U=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(y){var b=y.connectedNodes().intersection(e);U.merge(y),b.forEach(function(v){var w=v.id(),T=v.connectedEdges().intersection(e);U.merge(v),r[w].cutVertex?U.merge(T.filter(function(k){return k.isLoop()})):U.merge(T)})}),a.push(U)},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 U,y,b,v;m.forEach(function(w){U=w.source().id(),y=w.target().id(),b=U===p?y:U,b!==g&&(v=w.id(),o[v]||(o[v]=!0,s.push({x:p,y:b,edge:w})),b in r?r[p].low=Math.min(r[p].low,r[b].id):(u(f,b,p),r[p].low=Math.min(r[p].low,r[b].low),r[p].id<=r[b].low&&(r[p].cutVertex=!0,l(p,b))))})}};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}},OZt={hopcroftTarjanBiconnected:BE,htbc:BE,htb:BE,hopcroftTarjanBiconnectedComponents:BE},$E=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 U=m.target().id();U!==u&&(U in r||o(U),r[U].explored||(r[u].low=Math.min(r[u].low,r[U].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}},_Zt={tarjanStronglyConnected:$E,tsc:$E,tscc:$E,tarjanStronglyConnectedComponents:$E},UDe={};[qT,hKt,dKt,pKt,mKt,yKt,xKt,XKt,v6,x6,Gj,lZt,xZt,kZt,IZt,DZt,OZt,_Zt].forEach(function(t){Gr(UDe,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 sOe=0,aOe=1,oOe=2,Gh=function(e){if(!(this instanceof Gh))return new Gh(e);this.id="Thenable/1.0.7",this.state=sOe,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))};Gh.prototype={fulfill:function(e){return Wge(this,aOe,"fulfillValue",e)},reject:function(e){return Wge(this,oOe,"rejectReason",e)},then:function(e,r){var n=this,i=new Gh;return n.onFulfilled.push(Uge(e,i,"fulfill")),n.onRejected.push(Uge(r,i,"reject")),lOe(n),i.proxy}};var Wge=function(e,r,n,i){return e.state===sOe&&(e.state=r,e[n]=i,lOe(e)),e},lOe=function(e){e.state===aOe?qge(e,"onFulfilled",e.fulfillValue):e.state===oOe&&qge(e,"onRejected",e.rejectReason)},qge=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var s=function(){for(var o=0;o0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var a=0;a-1}return PV=e,PV}var $V,gme;function IZt(){if(gme)return $V;gme=1;var t=NP();function e(r,n){var i=this.__data__,s=t(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return $V=e,$V}var BV,mme;function NZt(){if(mme)return BV;mme=1;var t=MZt(),e=RZt(),r=_Zt(),n=LZt(),i=IZt();function s(a){var o=-1,l=a==null?0:a.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){_i(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,s=[],a=0,o=n.length;a0&&this.spawn(s).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}};u9.className=u9.classNames=u9.classes;var Kn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Oa,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Kn.variable="(?:[\\w-.]|(?:\\\\"+Kn.metaChar+"))+";Kn.className="(?:[\\w-]|(?:\\\\"+Kn.metaChar+"))+";Kn.value=Kn.string+"|"+Kn.number;Kn.id=Kn.variable;(function(){var t,e,r;for(t=Kn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Kn.comparatorOp+="|\\!"+e)})();var ki=function(){return{checks:[]}},pr={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},Vj=[{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 aXt(t.selector,e.selector)}),uQt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return xi("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return xi("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&xi("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},mQt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Nr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case pr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case pr.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case pr.DATA_BOOL:{var v=h.operator,b=h.field;return"["+e(v)+b+"]"}case pr.DATA_EXIST:{var x=h.field;return"["+x+"]"}case pr.META_COMPARE:{var T=h.operator,C=h.field;return"[["+C+n(e(T))+r(p)+"]]"}case pr.STATE:return p;case pr.ID:return"#"+p;case pr.CLASS:return"."+p;case pr.PARENT:case pr.CHILD:return s(h.parent,d)+n(">")+s(h.child,d);case pr.ANCESTOR:case pr.DESCENDANT:return s(h.ancestor,d)+" "+s(h.descendant,d);case pr.COMPOUND_SPLIT:{var S=s(h.left,d),k=s(h.subject,d),E=s(h.right,d);return S+(S.length>0?" ":"")+k+E}case pr.TRUE:return""}},s=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},a="",o=0;o1&&o=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(s||o||h)&&(l=!s&&!a?"":""+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),s.add(h.id()),o&&n(i,s,h)}return t}function mOe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return ure(this,t,e,mOe)};function yOe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}u3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ure(this,t,e,yOe)};function kQt(t,e,r){yOe(t,e,r),mOe(t,e,r)}u3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ure(this,t,e,kQt)};u3.ancestors=u3.parents;var U6,vOe;U6=vOe={data:vi.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:vi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:vi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:vi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:vi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:vi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};U6.attr=U6.data;U6.removeAttr=U6.removeData;var SQt=vOe,DP={};function dH(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],s=i._private.edges,a=0;ae}),minIndegree:S2("indegree",function(t,e){return te}),minOutdegree:S2("outdegree",function(t,e){return te})});Wr(DP,{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]):s!==void 0&&u.position({x:s.x+p.x,y:s.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 b=v?m.position():{x:0,y:0};return s={x:g.x-b.x,y:g.y-b.y},e===void 0?s:s[e]}else if(!a)return;return this}};Nh.modelPosition=Nh.point=Nh.position;Nh.modelPositions=Nh.points=Nh.positions;Nh.renderedPoint=Nh.renderedPosition;Nh.relativePoint=Nh.relativePosition;var EQt=bOe,h3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},d3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},AQt=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"}},vx,Lm;vx=Lm={};Lm.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),s=e.x1*n+i.x,a=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:s,x2:a,y1:o,y2:l,w:a-s,h:l-o}};Lm.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)};Lm.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(a){if(!a.isParent())return;var o=a._private,l=a.children(),u=a.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:a.pstyle("min-width").pfValue,left:a.pstyle("min-width-bias-left"),right:a.pstyle("min-width-bias-right")},height:{val:a.pstyle("min-height").pfValue,top:a.pstyle("min-height-bias-top"),bottom:a.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:a.pstyle("width").pfValue,h:a.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,R){var P=0,N=0,L=M+R;return A>0&&L>0&&(P=M/L*A,N=R/L*A),{biasDiff:P,biasComplementDiff:N}}function g(A,M,R,P){if(R.units==="%")switch(P){case"width":return A>0?R.pfValue*A:0;case"height":return M>0?R.pfValue*M:0;case"average":return A>0&&M>0?R.pfValue*(A+M)/2:0;case"min":return A>0&&M>0?A>M?R.pfValue*M:R.pfValue*A:0;case"max":return A>0&&M>0?A>M?R.pfValue*A:R.pfValue*M:0;default:return 0}else return R.units==="px"?R.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 b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var x=p(h.width.val-d.w,m,y),T=x.biasDiff,C=x.biasComplementDiff,S=p(h.height.val-d.h,v,b),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,a.pstyle("padding"),a.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-T+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;ne.x2?i:e.x2,e.y1=ne.y2?s:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Yp=function(e,r){return r==null?e:lh(e,r.x1,r.y1,r.x2,r.y2)},tk=function(e,r,n){return kl(e,r,n)},$M=function(e,r,n){if(!r.cy().headless()){var i=r._private,s=i.rstyle,a=s.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=s.srcX,u=s.srcY):n==="target"?(l=s.tgtX,u=s.tgtY):(l=s.midX,u=s.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-a,d.y1=u-a,d.x2=l+a,d.y2=u+a,d.w=d.x2-d.x1,d.h=d.y2-d.y1,l9(d,1),lh(e,d.x1,d.y1,d.x2,d.y2)}}},fH=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var s=r._private,a=s.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=tk(a,"labelWidth",n),d=tk(a,"labelHeight",n),f=tk(a,"labelX",n),p=tk(a,"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"),b=r.pstyle("text-outline-width").pfValue,x=r.pstyle("text-border-width").pfValue,T=x/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,A=E/2,M=k/2,R,P,N,L;if(y)R=f-A,P=f+A,N=p-M,L=p+M;else{switch(h3(l.value)){case"left":R=f-E,P=f;break;case"center":R=f-A,P=f+A;break;case"right":R=f,P=f+E;break}switch(d3(u.value)){case"top":N=p-k,L=p;break;case"center":N=p-M,L=p+M;break;case"bottom":N=p,L=p+k;break}}var I=g-Math.max(b,T)-C-S,$=g+Math.max(b,T)+C+S,O=m-Math.max(b,T)-C-S,D=m+Math.max(b,T)+C+S;R+=I,P+=$,N+=O,L+=D;var B=n||"main",z=s.labelBounds,V=z[B]=z[B]||{};V.x1=R,V.y1=N,V.x2=P,V.y2=L,V.w=P-R,V.h=L-N,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=D;var F=y&&v.strValue==="autorotate",H=v.pfValue!=null&&v.pfValue!==0;if(F||H){var G=F?tk(s.rstyle,"labelAngle",n):v.pfValue,W=Math.cos(G),K=Math.sin(G),q=(R+P)/2,oe=(N+L)/2;if(!y){switch(h3(l.value)){case"left":q=P;break;case"right":q=R;break}switch(d3(u.value)){case"top":oe=L;break;case"bottom":oe=N;break}}var Z=function(Ve,ce){return Ve=Ve-q,ce=ce-oe,{x:Ve*W-ce*K+q,y:Ve*K+ce*W+oe}},Q=Z(R,N),ne=Z(R,L),ie=Z(P,N),me=Z(P,L);R=Math.min(Q.x,ne.x,ie.x,me.x),P=Math.max(Q.x,ne.x,ie.x,me.x),N=Math.min(Q.y,ne.y,ie.y,me.y),L=Math.max(Q.y,ne.y,ie.y,me.y)}var te=B+"Rot",_e=z[te]=z[te]||{};_e.x1=R,_e.y1=N,_e.x2=P,_e.y2=L,_e.w=P-R,_e.h=L-N,lh(e,R,N,P,L),lh(s.labelBounds.all,R,N,P,L)}return e}},qme=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,s=r.pstyle("outline-offset").value,a=i+s;wOe(e,r,n,a,"outside",a/2)}},wOe=function(e,r,n,i,s,a){if(!(n===0||i<=0||s==="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){s==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);Yp(e,m)}else a!=null&&a>0&&c9(e,[a,a,a,a])}}},MQt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,s=r.pstyle("border-position").value;wOe(e,r,n,i,s)}},RQt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),s=n.headless(),a=Wl(),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],b=function($e){return $e.pstyle("display").value!=="none"},x=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(x){var T=0,C=0;i&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),A=0,M=0;if(i&&(A=e.pstyle("width").pfValue,M=A/2),l&&r.includeNodes){var R=e.position();g=R.x,m=R.y;var P=e.outerWidth(),N=P/2,L=e.outerHeight(),I=L/2;h=g-N,d=g+N,f=m-I,p=m+I,lh(a,h,f,d,p),i&&qme(a,e),i&&r.includeOutlines&&!s&&qme(a,e),i&&MQt(a,e)}else if(u&&r.includeEdges)if(i&&!s){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=M,d+=M,f-=M,p+=M,lh(a,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var D=h;h=d,d=D}if(f>p){var B=f;f=p,p=B}lh(a,h-M,f-M,d+M,p+M)}}else if($==="bezier"||$==="unbundled-bezier"||pg($,"segments")||pg($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;Vd){var q=h;h=d,d=q}if(f>p){var oe=f;f=p,p=oe}h-=M,d+=M,f-=M,p+=M,lh(a,h,f,d,p)}if(i&&r.includeEdges&&u&&($M(a,e,"mid-source"),$M(a,e,"mid-target"),$M(a,e,"source"),$M(a,e,"target")),i){var Z=e.pstyle("ghost").value==="yes";if(Z){var Q=e.pstyle("ghost-offset-x").pfValue,ne=e.pstyle("ghost-offset-y").pfValue;lh(a,a.x1+Q,a.y1+ne,a.x2+Q,a.y2+ne)}}var ie=o.bodyBounds=o.bodyBounds||{};_ge(ie,a),c9(ie,v),l9(ie,1),i&&(h=a.x1,d=a.x2,f=a.y1,p=a.y2,lh(a,h-E,f-E,d+E,p+E));var me=o.overlayBounds=o.overlayBounds||{};_ge(me,a),c9(me,v),l9(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?cKt(te.all):te.all=Wl(),i&&r.includeLabels&&(r.includeMainLabels&&fH(a,e,null),u&&(r.includeSourceLabels&&fH(a,e,"source"),r.includeTargetLabels&&fH(a,e,"target")))}return a.x1=_u(a.x1),a.y1=_u(a.y1),a.x2=_u(a.x2),a.y2=_u(a.y2),a.w=_u(a.x2-a.x1),a.h=_u(a.y2-a.y1),a.w>0&&a.h>0&&x&&(c9(a,v),l9(a,1)),a},TOe=function(e){var r=0,n=function(a){return(a?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 zz=e,zz}var Vz,k1e;function tJt(){if(k1e)return Vz;k1e=1;var t=__();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 Vz=e,Vz}var Hz,S1e;function rJt(){if(S1e)return Hz;S1e=1;var t=ZZt(),e=JZt(),r=QZt(),n=eJt(),i=tJt();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){Li(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}};fM.className=fM.classNames=fM.classes;var Zn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Ds,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Zn.variable="(?:[\\w-.]|(?:\\\\"+Zn.metaChar+"))+";Zn.className="(?:[\\w-]|(?:\\\\"+Zn.metaChar+"))+";Zn.value=Zn.string+"|"+Zn.number;Zn.id=Zn.variable;(function(){var t,e,r;for(t=Zn.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Zn.comparatorOp+="|\\!"+e)})();var ki=function(){return{checks:[]}},gr={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},Yj=[{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 MXt(t.selector,e.selector)}),NJt=(function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return xi("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return xi("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&xi("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},$Jt=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Dr(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case gr.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case gr.DATA_COMPARE:{var m=h.field,U=h.operator;return"["+m+n(e(U))+r(p)+"]"}case gr.DATA_BOOL:{var y=h.operator,b=h.field;return"["+e(y)+b+"]"}case gr.DATA_EXIST:{var v=h.field;return"["+v+"]"}case gr.META_COMPARE:{var w=h.operator,T=h.field;return"[["+T+n(e(w))+r(p)+"]]"}case gr.STATE:return p;case gr.ID:return"#"+p;case gr.CLASS:return"."+p;case gr.PARENT:case gr.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case gr.ANCESTOR:case gr.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case gr.COMPOUND_SPLIT:{var k=a(h.left,d),C=a(h.subject,d),S=a(h.right,d);return k+(k.length>0?" ":"")+C+S}case gr.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 MDe(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return yre(this,t,e,MDe)};function RDe(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}f4.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return yre(this,t,e,RDe)};function jJt(t,e,r){RDe(t,e,r),MDe(t,e,r)}f4.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return yre(this,t,e,jJt)};f4.ancestors=f4.parents;var XT,LDe;XT=LDe={data:bi.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:bi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:bi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:bi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:bi.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:bi.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};XT.attr=XT.data;XT.removeAttr=XT.removeData;var YJt=LDe,B_={};function UV(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:A2("indegree",function(t,e){return te}),minOutdegree:A2("outdegree",function(t,e){return te})});Gr(B_,{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,U=m&&m.length>0,y=U;U&&(m=m[0]);var b=y?m.position():{x:0,y:0};return a={x:g.x-b.x,y:g.y-b.y},e===void 0?a:a[e]}else if(!s)return;return this}};Nh.modelPosition=Nh.point=Nh.position;Nh.modelPositions=Nh.points=Nh.positions;Nh.renderedPoint=Nh.renderedPosition;Nh.relativePoint=Nh.relativePosition;var XJt=IDe,p4=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},g4=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},KJt=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"}},w6,N1;w6=N1={};N1.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}};N1.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)};N1.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(E,A,R){var _=0,N=0,L=A+R;return E>0&&L>0&&(_=A/L*E,N=R/L*E),{biasDiff:_,biasComplementDiff:N}}function g(E,A,R,_){if(R.units==="%")switch(_){case"width":return E>0?R.pfValue*E:0;case"height":return A>0?R.pfValue*A:0;case"average":return E>0&&A>0?R.pfValue*(E+A)/2:0;case"min":return E>0&&A>0?E>A?R.pfValue*A:R.pfValue*E:0;case"max":return E>0&&A>0?E>A?R.pfValue*E:R.pfValue*A:0;default:return 0}else return R.units==="px"?R.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var U=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(U=U*100/h.width.val);var y=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(y=y*100/h.height.val);var b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var v=p(h.width.val-d.w,m,U),w=v.biasDiff,T=v.biasComplementDiff,k=p(h.height.val-d.h,y,b),C=k.biasDiff,S=k.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+T)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-C+d.y1+d.y2+S)/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)},Xp=function(e,r){return r==null?e:lh(e,r.x1,r.y1,r.x2,r.y2)},i3=function(e,r,n){return Cl(e,r,n)},FE=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,hM(d,1),lh(e,d.x1,d.y1,d.x2,d.y2)}}},yV=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=i3(s,"labelWidth",n),d=i3(s,"labelHeight",n),f=i3(s,"labelX",n),p=i3(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,U=r.isEdge(),y=r.pstyle(i+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,v=r.pstyle("text-border-width").pfValue,w=v/2,T=r.pstyle("text-background-padding").pfValue,k=2,C=d,S=h,E=S/2,A=C/2,R,_,N,L;if(U)R=f-E,_=f+E,N=p-A,L=p+A;else{switch(p4(l.value)){case"left":R=f-S,_=f;break;case"center":R=f-E,_=f+E;break;case"right":R=f,_=f+S;break}switch(g4(u.value)){case"top":N=p-C,L=p;break;case"center":N=p-A,L=p+A;break;case"bottom":N=p,L=p+C;break}}var I=g-Math.max(b,w)-T-k,P=g+Math.max(b,w)+T+k,O=m-Math.max(b,w)-T-k,D=m+Math.max(b,w)+T+k;R+=I,_+=P,N+=O,L+=D;var B=n||"main",F=a.labelBounds,z=F[B]=F[B]||{};z.x1=R,z.y1=N,z.x2=_,z.y2=L,z.w=_-R,z.h=L-N,z.leftPad=I,z.rightPad=P,z.topPad=O,z.botPad=D;var $=U&&y.strValue==="autorotate",V=y.pfValue!=null&&y.pfValue!==0;if($||V){var H=$?i3(a.rstyle,"labelAngle",n):y.pfValue,G=Math.cos(H),K=Math.sin(H),W=(R+_)/2,oe=(N+L)/2;if(!U){switch(p4(l.value)){case"left":W=_;break;case"right":W=R;break}switch(g4(u.value)){case"top":oe=L;break;case"bottom":oe=N;break}}var Z=function(Ve,ce){return Ve=Ve-W,ce=ce-oe,{x:Ve*G-ce*K+W,y:Ve*K+ce*G+oe}},J=Z(R,N),ne=Z(R,L),ie=Z(_,N),me=Z(_,L);R=Math.min(J.x,ne.x,ie.x,me.x),_=Math.max(J.x,ne.x,ie.x,me.x),N=Math.min(J.y,ne.y,ie.y,me.y),L=Math.max(J.y,ne.y,ie.y,me.y)}var te=B+"Rot",Re=F[te]=F[te]||{};Re.x1=R,Re.y1=N,Re.x2=_,Re.y2=L,Re.w=_-R,Re.h=L-N,lh(e,R,N,_,L),lh(a.labelBounds.all,R,N,_,L)}return e}},tme=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;DDe(e,r,n,s,"outside",s/2)}},DDe=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);Xp(e,m)}else s!=null&&s>0&&dM(e,[s,s,s,s])}}},ZJt=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;DDe(e,r,n,i,a)}},JJt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Gl(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,U=o.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(Pe){return Pe.pstyle("display").value!=="none"},v=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(v){var w=0,T=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(T=e.pstyle("overlay-padding").value));var k=0,C=0;i&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(C=e.pstyle("underlay-padding").value));var S=Math.max(T,C),E=0,A=0;if(i&&(E=e.pstyle("width").pfValue,A=E/2),l&&r.includeNodes){var R=e.position();g=R.x,m=R.y;var _=e.outerWidth(),N=_/2,L=e.outerHeight(),I=L/2;h=g-N,d=g+N,f=m-I,p=m+I,lh(s,h,f,d,p),i&&tme(s,e),i&&r.includeOutlines&&!a&&tme(s,e),i&&ZJt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var P=e.pstyle("curve-style").strValue;if(h=Math.min(U.srcX,U.midX,U.tgtX),d=Math.max(U.srcX,U.midX,U.tgtX),f=Math.min(U.srcY,U.midY,U.tgtY),p=Math.max(U.srcY,U.midY,U.tgtY),h-=A,d+=A,f-=A,p+=A,lh(s,h,f,d,p),P==="haystack"){var O=U.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var D=h;h=d,d=D}if(f>p){var B=f;f=p,p=B}lh(s,h-A,f-A,d+A,p+A)}}else if(P==="bezier"||P==="unbundled-bezier"||gg(P,"segments")||gg(P,"taxi")){var F;switch(P){case"bezier":case"unbundled-bezier":F=U.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":F=U.linePts;break}if(F!=null)for(var z=0;zd){var W=h;h=d,d=W}if(f>p){var oe=f;f=p,p=oe}h-=A,d+=A,f-=A,p+=A,lh(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(FE(s,e,"mid-source"),FE(s,e,"mid-target"),FE(s,e,"source"),FE(s,e,"target")),i){var Z=e.pstyle("ghost").value==="yes";if(Z){var J=e.pstyle("ghost-offset-x").pfValue,ne=e.pstyle("ghost-offset-y").pfValue;lh(s,s.x1+J,s.y1+ne,s.x2+J,s.y2+ne)}}var ie=o.bodyBounds=o.bodyBounds||{};Fge(ie,s),dM(ie,y),hM(ie,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,lh(s,h-S,f-S,d+S,p+S));var me=o.overlayBounds=o.overlayBounds||{};Fge(me,s),dM(me,y),hM(me,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?IKt(te.all):te.all=Gl(),i&&r.includeLabels&&(r.includeMainLabels&&yV(s,e,null),u&&(r.includeSourceLabels&&yV(s,e,"source"),r.includeTargetLabels&&yV(s,e,"target")))}return s.x1=Ru(s.x1),s.y1=Ru(s.y1),s.x2=Ru(s.x2),s.y2=Ru(s.y2),s.w=Ru(s.x2-s.x1),s.h=Ru(s.y2-s.y1),s.w>0&&s.h>0&&v&&(dM(s,y),hM(s,1)),s},ODe=function(e){var r=0,n=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:WQt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)a(o);return this};am.removeAllListeners=function(){return this.removeListener("*")};am.emit=am.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,_i(e)||(e=[e]),qQt(this,function(s,a){r!=null&&(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===a.type&&(!h.namespace||h.namespace===a.namespace||h.namespace===GQt)&&s.eventMatches(s.context,h,a)){var d=[a];e!=null&&NXt(d,e),s.beforeEmit(s.context,h,a),h.conf&&h.conf.one&&(s.listeners=s.listeners.filter(function(g){return g!==h}));var f=s.callbackContext(s.context,h,a),p=h.callback.apply(f,d);s.afterEmit(s.context,h,a),p===!1&&(a.stopPropagation(),a.preventDefault())}},l=0;l1&&!a){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,s.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,s=i.get(n);if(!s)return this;var a=s.index;return this.unmergeAt(a),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Nr(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,s=0;sn&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,s=this,a=0;a=0&&s"u"?"undefined":za(Symbol))!=e&&za(Symbol.iterator)!=e;r&&(QI[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},s=0,a=this.length;return ANe({next:function(){return s1&&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 s=n._private.style[e];return s??(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,s=n.style();if(Jn(e)){var a=e;s.applyBypass(this,a,i),this.emitAndNotify("style")}else if(Nr(e))if(r===void 0){var o=this[0];return o?s.getStylePropertyValue(o,e):void 0}else s.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?s.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),s=this;if(e===void 0)for(var a=0;a0&&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)}});nl.neighbourhood=nl.neighborhood;nl.closedNeighbourhood=nl.closedNeighborhood;nl.openNeighbourhood=nl.openNeighborhood;Wr(nl,{source:Pu(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Pu(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r1e({attr:"source"}),targets:r1e({attr:"target"})});function r1e(t){return function(r){for(var n=[],i=0;i0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});nl.componentsOf=nl.components;var No=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){us("A collection must have a reference to the core");return}var s=new l0,a=!1;if(!r)r=[];else if(r.length>0&&Jn(r[0])&&!y7(r[0])){a=!0;for(var o=[],l=new lC,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,s=[],a=[],o,l=0,u=r.length;l0){for(var B=o.length===r.length?r:new No(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={},s=r._private.cy;function a(L){for(var I=L._private.edges,$=0;$0&&(t?R.emitAndNotify("remove"):e&&R.emit("remove"));for(var P=0;P0?P=L:R=L;while(Math.abs(N)>a&&++I=s?b(M,I):$===0?I:T(M,R,R+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&x()}var E=function(R){return S||k(),t===e&&r===n?R:R===0?0:R===1?1:y(C(R),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 rJt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,s){var a={x:n.x+s.dx*i,v:n.v+s.dv*i,tension:n.tension,friction:n.friction};return{dx:a.v,dv:t(a)}}function r(n,i){var s={dx:n.v,dv:t(n)},a=e(n,i*.5,s),o=e(n,i*.5,a),l=e(n,i,o),u=1/6*(s.dx+2*(a.dx+o.dx)+l.dx),h=1/6*(s.dv+2*(a.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,s,a){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,s=parseFloat(s)||20,a=a||null,o.tension=i,o.friction=s,f=a!==null,f?(u=n(i,s),p=u/a*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}})(),Di=function(e,r,n,i){var s=tJt(e,r,n,i);return function(a,o,l){return a+(o-a)*s(l)}},d9={linear:function(e,r,n){return e+(r-e)*n},ease:Di(.25,.1,.25,1),"ease-in":Di(.42,0,1,1),"ease-out":Di(0,0,.58,1),"ease-in-out":Di(.42,0,.58,1),"ease-in-sine":Di(.47,0,.745,.715),"ease-out-sine":Di(.39,.575,.565,1),"ease-in-out-sine":Di(.445,.05,.55,.95),"ease-in-quad":Di(.55,.085,.68,.53),"ease-out-quad":Di(.25,.46,.45,.94),"ease-in-out-quad":Di(.455,.03,.515,.955),"ease-in-cubic":Di(.55,.055,.675,.19),"ease-out-cubic":Di(.215,.61,.355,1),"ease-in-out-cubic":Di(.645,.045,.355,1),"ease-in-quart":Di(.895,.03,.685,.22),"ease-out-quart":Di(.165,.84,.44,1),"ease-in-out-quart":Di(.77,0,.175,1),"ease-in-quint":Di(.755,.05,.855,.06),"ease-out-quint":Di(.23,1,.32,1),"ease-in-out-quint":Di(.86,0,.07,1),"ease-in-expo":Di(.95,.05,.795,.035),"ease-out-expo":Di(.19,1,.22,1),"ease-in-out-expo":Di(1,0,0,1),"ease-in-circ":Di(.6,.04,.98,.335),"ease-out-circ":Di(.075,.82,.165,1),"ease-in-out-circ":Di(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return d9.linear;var i=rJt(e,r,n);return function(s,a,o){return s+(a-s)*i(o)}},"cubic-bezier":Di};function s1e(t,e,r,n,i){if(n===1||e===r)return r;var s=i(e,r,n);return t==null||((t.roundValue||t.color)&&(s=Math.round(s)),t.min!==void 0&&(s=Math.max(s,t.min)),t.max!==void 0&&(s=Math.min(s,t.max))),s}function a1e(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function E2(t,e,r,n,i){var s=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var a=a1e(t,i),o=a1e(e,i);if(Qt(a)&&Qt(o))return s1e(s,a,o,r,n);if(_i(a)&&_i(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(a.duration),a.easingImpl=d9[p].apply(null,g)):a.easingImpl=d9[p]}var m=a.easingImpl,y;if(a.duration===0?y=1:y=(r-l)/a.duration,a.applying&&(y=a.progress),y<0?y=0:y>1&&(y=1),a.delay==null){var v=a.startPosition,b=a.position;if(b&&i&&!t.locked()){var x={};nk(v.x,b.x)&&(x.x=E2(v.x,b.x,y,m)),nk(v.y,b.y)&&(x.y=E2(v.y,b.y,y,m)),t.position(x)}var T=a.startPan,C=a.pan,S=s.pan,k=C!=null&&n;k&&(nk(T.x,C.x)&&(S.x=E2(T.x,C.x,y,m)),nk(T.y,C.y)&&(S.y=E2(T.y,C.y,y,m)),t.emit("pan"));var E=a.startZoom,A=a.zoom,M=A!=null&&n;M&&(nk(E,A)&&(s.zoom=W6(s.minZoom,E2(E,A,y,m),s.maxZoom)),t.emit("zoom")),(k||M)&&t.emit("viewport");var R=a.style;if(R&&R.length>0&&i){for(var P=0;P=0;k--){var E=S[k];E()}S.splice(0,S.length)},b=p.length-1;b>=0;b--){var x=p[b],T=x._private;if(T.stopped){p.splice(b,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||iJt(h,x,t),nJt(h,x,t,d),T.applying&&(T.applying=!1),v(T.frames),T.step!=null&&T.step(t),x.completed()&&(p.splice(b,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 s=!1,a=0;a0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var sJt={animate:vi.animate(),animation:vi.animation(),animated:vi.animated(),clearQueue:vi.clearQueue(),delay:vi.delay(),delayAnimation:vi.delayAnimation(),stop:vi.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&&jI(function(s){o1e(s,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(s,a){o1e(a,e)},n.beforeRenderPriorities.animations):r()}},aJt={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&&y7(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}},zM=function(e){return Nr(e)?new im(e):e},NOe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new PP(aJt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,zM(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,zM(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,zM(r),n),this},once:function(e,r,n){return this.emitter().one(e,zM(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}};vi.eventAliasesOn(NOe);var Gj={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)}};Gj.jpeg=Gj.jpg;var f9={layout:function(e){var r=this;if(e==null){us("Layout options must be specified to make a layout");return}if(e.name==null){us("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){us("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var s;Nr(e.eles)?s=r.$(e.eles):s=e.eles!=null?e.eles:r.$();var a=new i(Wr({},e,{cy:r,eles:s}));return a}};f9.createLayout=f9.makeLayout=f9.layout;var oJt={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 s=this.renderer();this.destroyed()||!s||s.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)}};Wj.invalidateDimensions=Wj.resize;var p9={collection:function(e,r){return Nr(e)?this.$(e):Qc(e)?e.collection():_i(e)?(r||(r={}),new No(this,e,r.unique,r.removed)):new No(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}};p9.elements=p9.filter=p9.$;var co={},tE="t",cJt="f";co.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),s=0;s0;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],k=n.valueMax[0],E=n.valueMin[1],A=n.valueMax[1],M=n.valueMin[2],R=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],L=[Math.round(S+(k-S)*T),Math.round(E+(A-E)*T),Math.round(M+(R-M)*T),Math.round(P+(N-P)*T)];s={bypass:n.bypass,name:n.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*T;s=this.parse(n.name,I,n.bypass,f)}else return!1;if(!s)return m(),!1;s.mapping=n,n=s;break}case a.data:{for(var $=n.field.split("."),O=d.data,D=0;D<$.length&&O;D++){var B=$[D];O=O[B]}if(O!=null&&(s=this.parse(n.name,O,n.bypass,f)),!s)return m(),!1;s.mapping=n,n=s;break}case a.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return xi("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(s=this.parse(n.name,V,n.bypass,f),!s)return xi("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;s.mapping=Id(n),n=s;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};co.cleanElements=function(t,e){for(var r=0;r0&&s>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(a).play().promise().then(x):x()}).then(function(){return t.animation({style:o,duration:s,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)};co.checkTrigger=function(t,e,r,n,i,s){var a=this.properties[e],o=i(a);t.removed()||o!=null&&o(r,n,t)&&s(a)};co.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(s){return s.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};co.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};co.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};co.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};co.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 k7={};k7.applyBypass=function(t,e,r,n){var i=this,s=[],a=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;oi.length?n=n.substr(i.length):n=""}function l(){s.length>a.length?s=s.substr(a.length):s=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){xi("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 im(d);if(f.invalid){xi("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;s=p;for(var m=[];;){var y=s.match(/^\s*$/);if(y)break;var v=s.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){xi("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}a=v[0];var b=v[1],x=v[2],T=e.properties[b];if(!T){xi("Skipping property: Invalid property name in: "+a),l();continue}var C=r.parse(b,x);if(!C){xi("Skipping property: Invalid property definition in: "+a),l();continue}m.push({name:b,val:x}),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 xi("`"+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,b=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(b)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 x;if(l?x=e.split(/\s+/):_i(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var T=[],C=[],S=[],k="",E=!1,A=0;A0?" ":"")+M.strValue}return u.validate&&!u.validate(T,C)?null:u.singleEnum&&E?T.length===1&&Nr(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:k,bypass:r,units:C}}var R=function(){for(var Z=0;Zu.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:sKt(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],D=""+e;if(D!=="none"){for(var B=D.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((a-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,s,a,o=!1;if(r.zoomingEnabled||(o=!0),Qt(e)?a=e:Jn(e)&&(a=e.level,e.position!=null?s=RP(e.position,i,n):e.renderedPosition!=null&&(s=e.renderedPosition),s!=null&&!r.panningEnabled&&(o=!0)),a=a>r.maxZoom?r.maxZoom:a,a=ar.maxZoom||!r.zoomingEnabled?a=!0:(r.zoom=l,s.push("zoom"))}if(i&&(!a||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Qt(u.x)&&(r.pan.x=u.x,o=!1),Qt(u.y)&&(r.pan.y=u.y,o=!1),o||s.push("pan")}return s.length>0&&(s.push("viewport"),this.emit(s.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(Nr(e)){var n=e;e=this.mutableElements().filter(n)}else Qc(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),s=this.width(),a=this.height();r=r===void 0?this._private.zoom:r;var o={x:(s-r*(i.x1+i.x2))/2,y:(a-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),s=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-s("padding-left")-s("padding-right"),height:r.clientHeight-s("padding-top")-s("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}};lv.centre=lv.center;lv.autolockNodes=lv.autolock;lv.autoungrabifyNodes=lv.autoungrabify;var Y6={data:vi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:vi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:vi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:vi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Y6.attr=Y6.data;Y6.removeAttr=Y6.removeData;var X6=function(e){var r=this;e=Wr({},e);var n=e.container;n&&!UI(n)&&UI(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var s=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var a=Ea!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Wr({name:a?"grid":"null"},o.layout),o.renderer=Wr({name:a?"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 No(this),listeners:[],aniEles:new No(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?a:o.styleEnabled,zoom:Qt(o.zoom)?o.zoom:1,pan:{x:Jn(o.pan)&&Qt(o.pan.x)?o.pan.x:0,y:Jn(o.pan)&&Qt(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(QYt);if(y)return cC.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Wr({},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&&(Jn(g)||_i(g))&&r.add(g),r.one("layoutready",function(x){r.notifications(!0),r.emit(x),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Wr({},r._private.options.layout);b.eles=r.elements(),r.layout(b).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,Ss(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,o=!!t.boundingBox,l=Wl(o?t.boundingBox:structuredClone(e.extent())),u;if(Qc(t.roots))u=t.roots;else if(_i(t.roots)){for(var h=[],d=0;d0;){var L=N(),I=A(L,R);if(I)L.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(P);else if(I===null){xi("Detected double maximal shift for node `"+L.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O0&&v[0].length<=3?Ae/2:0),le=2*Math.PI/v[ze].length*we;return ze===0&&v[0].length===1&&(qe=1),{x:ie.x+qe*Math.cos(le),y:ie.y+qe*Math.sin(le)}}else{var pe=v[ze].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),$),re={x:ie.x+(we+1-(pe+1)/2)*Ce,y:ie.y+(ze+1-(W+1)/2)*te};return re}},Ve={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ve).indexOf(t.direction)===-1&&us("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ve).join(", ")));var ce=function(Te){return AXt($e(Te),l,Ve[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var pJt={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 DOe(t){this.options=Wr({},pJt,t)}DOe.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,s=n.nodes().not(":parent");e.sort&&(s=s.sort(e.sort));for(var a=Wl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/s.length:e.sweep,u=l/Math.max(1,s.length-1),h,d=0,f=0;f1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(v*v+b*b));h=Math.max(x,h)}var T=function(S,k){var E=e.startAngle+k*u*(i?1:-1),A=h*Math.cos(E),M=h*Math.sin(E),R={x:o.x+A,y:o.y+M};return R};return n.nodes().layoutPositions(this,e,T),this};var gJt={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 POe(t){this.options=Wr({},gJt,t)}POe.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,s=i.nodes().not(":parent"),a=Wl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},l=[],u=0,h=0;h0){var C=Math.abs(b[0].value-T.value);C>=y&&(b=[],v.push(b))}b.push(T)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(a.w,a.h)/2-S,A=E/(v.length+k?1:0);S=Math.min(S,A)}for(var M=0,R=0;R1&&e.avoidOverlap){var I=Math.cos(L)-Math.cos(0),$=Math.sin(L)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));M=Math.max(O,M)}P.r=M,M+=S}if(e.equidistant){for(var D=0,B=0,z=0;z=t.numIter||(TJt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&s(),jI(h)}};h()}else{for(;u;)u=a(l),l++;u1e(n,t),o()}return this};VP.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};VP.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var yJt=function(e,r,n){for(var i=n.eles.edges(),s=n.eles.nodes(),a=Wl(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:s.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},l=n.eles.components(),u={},h=0;h0){o.graphSet.push(E);for(var h=0;hi.count?0:i.graph},$Oe=function(e,r,n,i){var s=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=eN(e,o,l),y=eN(r,-1*o,-1*l),v=y.x-m.x,b=y.y-m.y,x=v*v+b*b,f=Math.sqrt(x),d=(e.nodeRepulsion+r.nodeRepulsion)/x,p=d*v/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},SJt=function(e,r,n,i){if(n>0)var s=e.maxX-r.minX;else var s=r.maxX-e.minX;if(i>0)var a=e.maxY-r.minY;else var a=r.maxY-e.minY;return s>=0&&a>=0?Math.sqrt(s*s+a*a):0},eN=function(e,r,n){var i=e.positionX,s=e.positionY,a=e.height||1,o=e.width||1,l=n/r,u=a/o,h={};return r===0&&0n?(h.x=i,h.y=s+a/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=s-o*n/2/r,h):0=u)?(h.x=i+a*r/2/n,h.y=s+a/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-a*r/2/n,h.y=s-a/2),h)},EJt=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}}}}},MJt=function(e,r){var n=[],i=0,s=-1;for(n.push.apply(n,e.graphSet[0]),s+=e.graphSet[0].length;i<=s;){var a=n[i++],o=e.idToIndex[a],l=e.layoutNodes[o],u=l.children;if(0n)var s={x:n*e/i,y:n*r/i};else var s={x:e,y:r};return s},FOe=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],s=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,s=!0),(i.minX==null||e.minX-i.padLefti.maxY)&&(i.maxY=e.maxY+i.padBottom,s=!0),(i.minY==null||e.minY-i.padTopv&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},LJt={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 zOe(t){this.options=Wr({},LJt,t)}zOe.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 s=Wl(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(s.h===0||s.w===0)n.nodes().layoutPositions(this,e,function(H){return{x:s.x1,y:s.y1}});else{var a=i.size(),o=Math.sqrt(a*s.h/s.w),l=Math.round(o),u=Math.round(s.w/s.h*o),h=function(G){if(G==null)return Math.min(l,u);var W=Math.min(l,u);W==l?l=G:u=G},d=function(G){if(G==null)return Math.max(l,u);var W=Math.max(l,u);W==l?l=G:u=G},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(a/l);else if(f==null&&p!=null)u=p,l=Math.ceil(a/u);else if(u*l>a){var g=h(),m=d();(g-1)*m>=a?h(g-1):(m-1)*g>=a&&d(m-1)}else for(;u*l=a?d(v+1):h(y+1)}var b=s.w/u,x=s.h/l;if(e.condense&&(b=0,x=0),e.avoidOverlap)for(var T=0;T=u&&(I=0,L++)},O={},D=0;D(I=bKt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var $=A.allpts,O=0;O+5(I=vKt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var D=D||E.source,B=B||E.target,z=i.getArrowWidth(M,R),V=[{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}],O=0;O0&&(v(D),v(B))}function x(k,E,A){return kl(k,E,A)}function T(k,E){var A=k._private,M=f,R;E?R=E+"-":R="",k.boundingBox();var P=A.labelBounds[E||"main"],N=k.pstyle(R+"label").value,L=k.pstyle("text-events").strValue==="yes";if(!(!L||!N)){var I=x(A.rscratch,"labelX",E),$=x(A.rscratch,"labelY",E),O=x(A.rscratch,"labelAngle",E),D=k.pstyle(R+"text-margin-x").pfValue,B=k.pstyle(R+"text-margin-y").pfValue,z=P.x1-M-D,V=P.x2+M-D,F=P.y1-M-B,H=P.y2+M-B;if(O){var G=Math.cos(O),W=Math.sin(O),K=function(me,te){return me=me-I,te=te-$,{x:me*G-te*W+I,y:me*W+te*G+$}},q=K(z,F),oe=K(z,H),Z=K(V,F),Q=K(V,H),ne=[q.x+D,q.y+B,Z.x+D,Z.y+B,Q.x+D,Q.y+B,oe.x+D,oe.y+B];if(mc(t,e,ne))return y(k),!0}else if(gg(P,t,e))return y(k),!0}}for(var C=a.length-1;C>=0;C--){var S=a[C];S.isNode()?v(S)||T(S):b(S)||T(S)||T(S,"source")||T(S,"target")}return o};Iv.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,s=this.cy.zoom(),a=2/s,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=Wl({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 kl(me,te,_e)}function y(me,te){var _e=me._private,$e=a,Ve="";me.boundingBox();var ce=_e.labelBounds.main;if(!ce)return null;var he=m(_e.rscratch,"labelX",te),Te=m(_e.rscratch,"labelY",te),ge=m(_e.rscratch,"labelAngle",te),ze=me.pstyle(Ve+"text-margin-x").pfValue,we=me.pstyle(Ve+"text-margin-y").pfValue,Ae=ce.x1-$e-ze,qe=ce.x2+$e-ze,le=ce.y1-$e-we,pe=ce.y2+$e-we;if(ge){var Ce=Math.cos(ge),re=Math.sin(ge),Y=function(ue,X){return ue=ue-he,X=X-Te,{x:ue*Ce-X*re+he,y:ue*re+X*Ce+Te}};return[Y(Ae,le),Y(qe,le),Y(qe,pe),Y(Ae,pe)]}else return[{x:Ae,y:le},{x:qe,y:le},{x:qe,y:pe},{x:Ae,y:pe}]}function v(me,te,_e,$e){function Ve(ce,he,Te){return(Te.y-ce.y)*(he.x-ce.x)>(he.y-ce.y)*(Te.x-ce.x)}return Ve(me,_e,$e)!==Ve(te,_e,$e)&&Ve(me,te,_e)!==Ve(me,te,$e)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},$Jt=function(e,r,n,i,s){if(e!==g1e?m1e(r,e,cd):PJt(Tu,cd),m1e(r,n,Tu),f1e=cd.nx*Tu.ny-cd.ny*Tu.nx,p1e=cd.nx*Tu.nx-cd.ny*-Tu.ny,If=Math.asin(Math.max(-1,Math.min(1,f1e))),Math.abs(If)<1e-6){qj=r.x,Uj=r.y,T1=M2=0;return}F1=1,g9=!1,p1e<0?If<0?If=Math.PI+If:(If=Math.PI-If,F1=-1,g9=!0):If>0&&(F1=-1,g9=!0),r.radius!==void 0?M2=r.radius:M2=i,s1=If/2,VM=Math.min(cd.len/2,Tu.len/2),s?(rd=Math.abs(Math.cos(s1)*M2/Math.sin(s1)),rd>VM?(rd=VM,T1=Math.abs(rd*Math.sin(s1)/Math.cos(s1))):T1=M2):(rd=Math.min(VM,M2),T1=Math.abs(rd*Math.sin(s1)/Math.cos(s1))),jj=r.x+Tu.nx*rd,Yj=r.y+Tu.ny*rd,qj=jj-Tu.ny*T1*F1,Uj=Yj+Tu.nx*T1*F1,WOe=r.x+cd.nx*rd,qOe=r.y+cd.ny*rd,g1e=r};function UOe(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 mre(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}:($Jt(t,e,r,n,i),{cx:qj,cy:Uj,radius:T1,startX:WOe,startY:qOe,stopX:jj,stopY:Yj,startAngle:cd.ang+Math.PI/2*F1,endAngle:Tu.ang-Math.PI/2*F1,counterClockwise:g9})}var K6=.01,BJt=Math.sqrt(2*K6),cl={};cl.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,s,a=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=a.units!=null&&o.units!=null,u=function(C,S,k,E){var A=E-S,M=k-C,R=Math.sqrt(M*M+A*A);return{x:-A/R,y:M/R}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":s=r;break;case"intersection":s=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],a),f=sa(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=sa(m,2),v=y[0],b=y[1],x={x1:p,y1:g,x2:v,y2:b};i=u(p,g,v,b),s=x}else xi("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).")),s=n;break}}return{midptPts:s,vectorNormInverse:i}};cl.findHaystackPoints=function(t){for(var e=0;e0?Math.max(X-fe,0):Math.min(X+fe,0)},N=P(M,E),L=P(R,A),I=!1;b===u?v=Math.abs(N)>Math.abs(L)?i:n:b===l||b===o?(v=n,I=!0):(b===s||b===a)&&(v=i,I=!0);var $=v===n,O=$?L:N,D=$?R:M,B=nre(D),z=!1;!(I&&(T||S))&&(b===o&&D<0||b===l&&D>0||b===s&&D>0||b===a&&D<0)&&(B*=-1,O=B*Math.abs(O),z=!0);var V;if(T){var F=C<0?1+C:C;V=F*O}else{var H=C<0?O:0;V=H+C*B}var G=function(X){return Math.abs(X)=Math.abs(O)},W=G(V),K=G(Math.abs(O)-Math.abs(V)),q=W||K;if(q&&!z)if($){var oe=Math.abs(D)<=f/2,Z=Math.abs(M)<=p/2;if(oe){var Q=(h.x1+h.x2)/2,ne=h.y1,ie=h.y2;r.segpts=[Q,ne,Q,ie]}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 $e=Math.abs(D)<=d/2,Ve=Math.abs(R)<=g/2;if($e){var ce=(h.y1+h.y2)/2,he=h.x1,Te=h.x2;r.segpts=[he,ce,Te,ce]}else if(Ve){var ge=(h.x1+h.x2)/2,ze=h.y1,we=h.y2;r.segpts=[ge,ze,ge,we]}else r.segpts=[h.x2,h.y1]}else if($){var Ae=h.y1+V+(y?f/2*B:0),qe=h.x1,le=h.x2;r.segpts=[qe,Ae,le,Ae]}else{var pe=h.x1+V+(y?d/2*B:0),Ce=h.y1,re=h.y2;r.segpts=[pe,Ce,pe,re]}if(r.isRound){var Y=t.pstyle("taxi-radius").value,J=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Y),r.isArcRadius=new Array(r.segpts.length/2).fill(J)}};cl.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,s=e.srcW,a=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=!Qt(r.startX)||!Qt(r.startY),y=!Qt(r.arrowStartX)||!Qt(r.arrowStartY),v=!Qt(r.endX)||!Qt(r.endY),b=!Qt(r.arrowEndX)||!Qt(r.arrowEndY),x=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=x*T,S=av({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=SD.poolIndex()){var B=O;O=D,D=B}var z=N.srcPos=O.position(),V=N.tgtPos=D.position(),F=N.srcW=O.outerWidth(),H=N.srcH=O.outerHeight(),G=N.tgtW=D.outerWidth(),W=N.tgtH=D.outerHeight(),K=N.srcShape=r.nodeShapes[e.getNodeShape(O)],q=N.tgtShape=r.nodeShapes[e.getNodeShape(D)],oe=N.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Z=N.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,Q=N.tgtRs=D._private.rscratch,ne=N.srcRs=O._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ie=0;ie=BJt||(le=Math.sqrt(Math.max(qe*qe,K6)+Math.max(Ae*Ae,K6)));var pe=N.vector={x:qe,y:Ae},Ce=N.vectorNorm={x:pe.x/le,y:pe.y/le},re={x:-Ce.y,y:Ce.x};N.nodesOverlap=!Qt(le)||q.checkPoint(ce[0],ce[1],0,G,W,V.x,V.y,Z,Q)||K.checkPoint(Te[0],Te[1],0,F,H,z.x,z.y,oe,ne),N.vectorNormInverse=re,L={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:V,srcRs:Q,tgtPos:z,tgtRs:ne,srcW:G,srcH:W,tgtW:F,tgtH:H,srcIntn:ge,tgtIntn:he,srcShape:q,tgtShape:K,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:ze.x2,y1:ze.y2,x2:ze.x1,y2:ze.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Ce.x,y:-Ce.y},vectorNormInverse:{x:-re.x,y:-re.y}}}var Y=Ve?L:N;te.nodesOverlap=Y.nodesOverlap,te.srcIntn=Y.srcIntn,te.tgtIntn=Y.tgtIntn,te.isRound=_e.startsWith("round"),i&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(me,Y,ie,$e):O===D?e.findLoopPoints(me,Y,ie,$e):_e.endsWith("segments")?e.findSegmentsPoints(me,Y):_e.endsWith("taxi")?e.findTaxiPoints(me,Y):_e==="straight"||!$e&&N.eles.length%2===1&&ie===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,Y,ie,$e,Ve),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,Y),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},k=0;k0){var ce=u,he=w1(ce,Pb(a)),Te=w1(ce,Pb(Ve)),ge=he;if(Te2){var ze=w1(ce,{x:Ve[2],y:Ve[3]});ze0){var ee=h,Me=w1(ee,Pb(a)),Re=w1(ee,Pb(fe)),Ke=Me;if(Re2){var Ne=w1(ee,{x:fe[2],y:fe[3]});Ne=g||k){y={cp:T,segment:S};break}}if(y)break}var E=y.cp,A=y.segment,M=(g-v)/A.length,R=A.t1-A.t0,P=p?A.t0+R*M:A.t1-R*M;P=W6(0,P,1),e=gx(E.p0,E.p1,E.p2,P),f=zJt(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var N=0,L,I,$,O,D=n.allpts.length,B=0;B+3=g));B+=2);var z=g-I,V=z/L;V=W6(0,V,1),e=oKt($,O,V),f=XOe($,O);break}}a("labelX",d,e.x),a("labelY",d,e.y),a("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};gf.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};gf.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=sv(n,t._private.labelDimsKey);if(kl(r.rscratch,"prefixedLabelDimsKey",e)!==i){xd(r.rscratch,"prefixedLabelDimsKey",e,i);var s=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=kl(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*a,f=s.width,p=s.height+(h-1)*(a-1)*o;xd(r.rstyle,"labelWidth",e,f),xd(r.rscratch,"labelWidth",e,f),xd(r.rstyle,"labelHeight",e,p),xd(r.rscratch,"labelHeight",e,p),xd(r.rscratch,"labelLineHeight",e,d),xd(r.rscratch,"labelActualDescent",e,s.labelActualDescent)}};gf.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,s=t.pstyle("text-transform").value,a=function(H,G){return G?(xd(r.rscratch,H,e,G),G):kl(r.rscratch,H,e)};if(!i)return"";s=="none"||(s=="uppercase"?i=i.toUpperCase():s=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=a("labelKey");if(l!=null&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u="​",h=i.split(` -`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yd){var C=v.matchAll(m),S="",k=0,E=xc(C),A;try{for(E.s();!(A=E.n()).done;){var M=A.value,R=M[0],P=v.substring(k,M.index);k=M.index+R.length;var N=S.length===0?P:S+P+R,L=this.calculateLabelDimensions(t,N),I=L.width;I<=d?S+=P+R:(S&&g.push(S),S=P+R)}}catch(F){E.e(F)}finally{E.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}a("labelWrapCachedLines",g),i=a("labelWrapCachedText",g.join(` -`)),a("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",D="…",B=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z$)break;O+=i[z],z===i.length-1&&(B=!0)}return B||(O+=D),O}return i};gf.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?AQt(r):"center":e};gf.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,s=0,a=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(a," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(` -`),v=y.length,b=0,x=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(a),o)for(var l=0;l=t.desktopTapThreshold2}var Ht=s(Y);Pe&&(t.hoverData.tapholdCancelled=!0);var _t=function(){var bt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];bt.length===0?(bt.push(Fe[0]),bt.push(Fe[1])):(bt[0]+=Fe[0],bt[1]+=Fe[1])};ue=!0,i(je,["mousemove","vmousemove","tapdrag"],Y,{x:Me[0],y:Me[1]});var dt=function(bt){return{originalEvent:Y,type:bt,position:{x:Me[0],y:Me[1]}}},xe=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(dt("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Pe){var Lt=dt("cxtdrag");Ze?Ze.emit(Lt):X.emit(Lt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||je!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(dt("cxtdragout")),t.hoverData.cxtOver=je,je&&je.emit(dt("cxtdragover")))}}else if(t.hoverData.dragging){if(ue=!0,X.panningEnabled()&&X.userPanningEnabled()){var wt;if(t.hoverData.justStartedPan){var mt=t.hoverData.mdownPos;wt={x:(Me[0]-mt[0])*fe,y:(Me[1]-mt[1])*fe},t.hoverData.justStartedPan=!1}else wt={x:Fe[0]*fe,y:Fe[1]*fe};X.panBy(wt),X.emit(dt("dragpan")),t.hoverData.dragged=!0}Me=t.projectIntoViewport(Y.clientX,Y.clientY)}else if(Ne[4]==1&&(Ze==null||Ze.pannable())){if(Pe){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(Ht||!X.panningEnabled()||!X.userPanningEnabled()))xe();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Mt=a(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=Pb(Re),t.redrawHint("select",!0),t.redraw())}Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate()}}else{if(Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate(),(!Ze||!Ze.grabbed())&&je!=Oe&&(Oe&&i(Oe,["mouseout","tapdragout"],Y,{x:Me[0],y:Me[1]}),je&&i(je,["mouseover","tapdragover"],Y,{x:Me[0],y:Me[1]}),t.hoverData.last=je),Ze)if(Pe){if(X.boxSelectionEnabled()&&Ht)Ze&&Ze.grabbed()&&(m(st),Ze.emit(dt("freeon")),st.emit(dt("free")),t.dragData.didDrag&&(Ze.emit(dt("dragfreeon")),st.emit(dt("dragfree")))),xe();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var Or=!t.dragData.didDrag;Or&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(st,{inDragLayer:!0});var Ee={x:0,y:0};if(Qt(Fe[0])&&Qt(Fe[1])&&(Ee.x+=Fe[0],Ee.y+=Fe[1],Or)){var it=t.hoverData.dragDelta;it&&Qt(it[0])&&Qt(it[1])&&(Ee.x+=it[0],Ee.y+=it[1])}t.hoverData.draggingEles=!0,st.silentShift(Ee).emit(dt("position")).emit(dt("drag")),t.redrawHint("drag",!0),t.redraw()}}else _t();ue=!0}if(Ne[2]=Me[0],Ne[3]=Me[1],ue)return Y.stopPropagation&&Y.stopPropagation(),Y.preventDefault&&Y.preventDefault(),!1}},!1);var M,R,P;t.registerBinding(e,"mouseup",function(Y){if(!(t.hoverData.which===1&&Y.which!==1&&t.hoverData.capture)){var J=t.hoverData.capture;if(J){t.hoverData.capture=!1;var ue=t.cy,X=t.projectIntoViewport(Y.clientX,Y.clientY),fe=t.selection,ee=t.findNearestElement(X[0],X[1],!0,!1),Me=t.dragData.possibleDragElements,Re=t.hoverData.down,Ke=s(Y);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Re&&Re.unactivate();var Ne=function(gt){return{originalEvent:Y,type:gt,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var je=Ne("cxttapend");if(Re?Re.emit(je):ue.emit(je),!t.hoverData.cxtDragged){var Oe=Ne("cxttap");Re?Re.emit(Oe):ue.emit(Oe)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ee,["mouseup","tapend","vmouseup"],Y,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Re,["click","tap","vclick"],Y,{x:X[0],y:X[1]}),R=!1,Y.timeStamp-P<=ue.multiClickDebounceTime()?(M&&clearTimeout(M),R=!0,P=null,i(Re,["dblclick","dbltap","vdblclick"],Y,{x:X[0],y:X[1]})):(M=setTimeout(function(){R||i(Re,["oneclick","onetap","voneclick"],Y,{x:X[0],y:X[1]})},ue.multiClickDebounceTime()),P=Y.timeStamp)),Re==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!s(Y)&&(ue.$(r).unselect(["tapunselect"]),Me.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Me=ue.collection()),ee==Re&&!t.dragData.didDrag&&!t.hoverData.selecting&&ee!=null&&ee._private.selectable&&(t.hoverData.dragging||(ue.selectionType()==="additive"||Ke?ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]):Ke||(ue.$(r).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=ue.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),ue.emit(Ne("boxend"));var Fe=function(gt){return gt.selectable()&&!gt.selected()};ue.selectionType()==="additive"||Ke||ue.$(r).unmerge(Ze).unselect(),Ze.emit(Ne("box")).stdFilter(Fe).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!fe[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var st=Re&&Re.grabbed();m(Me),st&&(Re.emit(Ne("freeon")),Me.emit(Ne("free")),t.dragData.didDrag&&(Re.emit(Ne("dragfreeon")),Me.emit(Ne("dragfree"))))}}fe[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=[],L=4,I,$=1e5,O=function(Y){for(var J=Math.abs(Y[0]),ue=1;ue=L){I=!1;var X=N;if(X[0]>=5){var fe;O(X)?fe=X[0]:fe=iKt(X),fe>1&&(I=!0,$=fe)}}else N.push(Math.abs(ue)),J=!0;else I&&($=Math.min(Math.abs(ue),$));if(!t.scrollingPage){var ee=t.cy,Me=ee.zoom(),Re=ee.pan(),Ke=t.projectIntoViewport(Y.clientX,Y.clientY),Ne=[Ke[0]*Me+Re.x,Ke[1]*Me+Re.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||k()){Y.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){Y.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var je;J&&Math.abs(ue)>5&&(ue=nre(ue)*5),je=ue/-250,I&&(je/=$,je*=3),je=je*t.wheelSensitivity;var Oe=Y.deltaMode===1;Oe&&(je*=33);var Ze=ee.zoom()*Math.pow(10,je);Y.type==="gesturechange"&&(Ze=t.gestureStartZoom*Y.scale),ee.zoom({level:Ze,renderedPosition:{x:Ne[0],y:Ne[1]}}),ee.emit({type:Y.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Y,position:{x:Ke[0],y:Ke[1]}})}}}};t.registerBinding(t.container,"wheel",D,!0),t.registerBinding(e,"scroll",function(Y){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(Y){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||Y.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||D(re)},!0),t.registerBinding(t.container,"mouseout",function(Y){var J=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseout",position:{x:J[0],y:J[1]}})},!1),t.registerBinding(t.container,"mouseover",function(Y){var J=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseover",position:{x:J[0],y:J[1]}})},!1);var B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie=function(Y,J,ue,X){return Math.sqrt((ue-Y)*(ue-Y)+(X-J)*(X-J))},me=function(Y,J,ue,X){return(ue-Y)*(ue-Y)+(X-J)*(X-J)},te;t.registerBinding(t.container,"touchstart",te=function(Y){if(t.hasTouchStarted=!0,!!E(Y)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var J=t.cy,ue=t.touchData.now,X=t.touchData.earlier;if(Y.touches[0]){var fe=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);ue[0]=fe[0],ue[1]=fe[1]}if(Y.touches[1]){var fe=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);ue[2]=fe[0],ue[3]=fe[1]}if(Y.touches[2]){var fe=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);ue[4]=fe[0],ue[5]=fe[1]}var ee=function(Ht){return{originalEvent:Y,type:Ht,position:{x:ue[0],y:ue[1]}}};if(Y.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Me=t.findContainerClientCoords();q=Me[0],oe=Me[1],Z=Me[2],Q=Me[3],B=Y.touches[0].clientX-q,z=Y.touches[0].clientY-oe,V=Y.touches[1].clientX-q,F=Y.touches[1].clientY-oe,ne=0<=B&&B<=Z&&0<=V&&V<=Z&&0<=z&&z<=Q&&0<=F&&F<=Q;var Re=J.pan(),Ke=J.zoom();H=ie(B,z,V,F),G=me(B,z,V,F),W=[(B+V)/2,(z+F)/2],K=[(W[0]-Re.x)/Ke,(W[1]-Re.y)/Ke];var Ne=200,je=Ne*Ne;if(G=1){for(var Le=t.touchData.startPosition=[null,null,null,null,null,null],kt=0;kt=t.touchTapThreshold2}if(J&&t.touchData.cxt){Y.preventDefault();var kt=Y.touches[0].clientX-q,Et=Y.touches[0].clientY-oe,ot=Y.touches[1].clientX-q,Ht=Y.touches[1].clientY-oe,_t=me(kt,Et,ot,Ht),dt=_t/G,xe=150,Lt=xe*xe,wt=1.5,mt=wt*wt;if(dt>=mt||_t>=Lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=Ke("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):X.emit(Mt)}}if(J&&t.touchData.cxt){var Mt=Ke("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):X.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Or=t.findNearestElement(fe[0],fe[1],!0,!0);(!t.touchData.cxtOver||Or!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ke("cxtdragout")),t.touchData.cxtOver=Or,Or&&Or.emit(Ke("cxtdragover")))}else if(J&&Y.touches[2]&&X.boxSelectionEnabled())Y.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(Ke("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ue[4]=1,!ue||ue.length===0||ue[0]===void 0?(ue[0]=(fe[0]+fe[2]+fe[4])/3,ue[1]=(fe[1]+fe[3]+fe[5])/3,ue[2]=(fe[0]+fe[2]+fe[4])/3+1,ue[3]=(fe[1]+fe[3]+fe[5])/3+1):(ue[2]=(fe[0]+fe[2]+fe[4])/3,ue[3]=(fe[1]+fe[3]+fe[5])/3),t.redrawHint("select",!0),t.redraw();else if(J&&Y.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){Y.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ee=t.dragData.touchDragEles;if(Ee){t.redrawHint("drag",!0);for(var it=0;it0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var $e;t.registerBinding(e,"touchcancel",$e=function(Y){var J=t.touchData.start;t.touchData.capture=!1,J&&J.unactivate()});var Ve,ce,he,Te;if(t.registerBinding(e,"touchend",Ve=function(Y){var J=t.touchData.start,ue=t.touchData.capture;if(ue)Y.touches.length===0&&(t.touchData.capture=!1),Y.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var fe=t.cy,ee=fe.zoom(),Me=t.touchData.now,Re=t.touchData.earlier;if(Y.touches[0]){var Ke=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);Me[0]=Ke[0],Me[1]=Ke[1]}if(Y.touches[1]){var Ke=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);Me[2]=Ke[0],Me[3]=Ke[1]}if(Y.touches[2]){var Ke=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);Me[4]=Ke[0],Me[5]=Ke[1]}var Ne=function(Lt){return{originalEvent:Y,type:Lt,position:{x:Me[0],y:Me[1]}}};J&&J.unactivate();var je;if(t.touchData.cxt){if(je=Ne("cxttapend"),J?J.emit(je):fe.emit(je),!t.touchData.cxtDragged){var Oe=Ne("cxttap");J?J.emit(Oe):fe.emit(Oe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!Y.touches[2]&&fe.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=fe.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),fe.emit(Ne("boxend"));var Fe=function(Lt){return Lt.selectable()&&!Lt.selected()};Ze.emit(Ne("box")).stdFilter(Fe).select().emit(Ne("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(J!=null&&J.unactivate(),Y.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!Y.touches[1]){if(!Y.touches[0]){if(!Y.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var st=t.dragData.touchDragEles;if(J!=null){var Pe=J._private.grabbed;m(st),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Pe&&(J.emit(Ne("freeon")),st.emit(Ne("free")),t.dragData.didDrag&&(J.emit(Ne("dragfreeon")),st.emit(Ne("dragfree")))),i(J,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Me[0],y:Me[1]}),J.unactivate(),t.touchData.start=null}else{var gt=t.findNearestElement(Me[0],Me[1],!0,!0);i(gt,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Me[0],y:Me[1]})}var Le=t.touchData.startPosition[0]-Me[0],kt=Le*Le,Et=t.touchData.startPosition[1]-Me[1],ot=Et*Et,Ht=kt+ot,_t=Ht*ee*ee;t.touchData.singleTouchMoved||(J||fe.$(":selected").unselect(["tapunselect"]),i(J,["tap","vclick"],Y,{x:Me[0],y:Me[1]}),ce=!1,Y.timeStamp-Te<=fe.multiClickDebounceTime()?(he&&clearTimeout(he),ce=!0,Te=null,i(J,["dbltap","vdblclick"],Y,{x:Me[0],y:Me[1]})):(he=setTimeout(function(){ce||i(J,["onetap","voneclick"],Y,{x:Me[0],y:Me[1]})},fe.multiClickDebounceTime()),Te=Y.timeStamp)),J!=null&&!t.dragData.didDrag&&J._private.selectable&&_t"u"){var ge=[],ze=function(Y){return{clientX:Y.clientX,clientY:Y.clientY,force:1,identifier:Y.pointerId,pageX:Y.pageX,pageY:Y.pageY,radiusX:Y.width/2,radiusY:Y.height/2,screenX:Y.screenX,screenY:Y.screenY,target:Y.target}},we=function(Y){return{event:Y,touch:ze(Y)}},Ae=function(Y){ge.push(we(Y))},qe=function(Y){for(var J=0;J0)return F[0]}return null},g=Object.keys(f),m=0;m0?p:ZNe(s,a,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,s,a,o,l){l=l==="auto"?nm(i,s):l;var u=2*l;if(F0(e,r,this.points,a,o,i,s-u,[0,-1],n)||F0(e,r,this.points,a,o,i-u,s,[0,-1],n))return!0;var h=i/2+2*n,d=s/2+2*n,f=[a-h,o-d,a-h,o,a+h,o,a+h,o-d];return!!(mc(e,r,f)||fy(e,r,u,u,a+i/2-l,o+s/2-l,n)||fy(e,r,u,u,a-i/2+l,o+s/2-l,n))}}};pp.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",xl(3,0)),this.generateRoundPolygon("round-triangle",xl(3,0)),this.generatePolygon("rectangle",xl(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",xl(5,0)),this.generateRoundPolygon("round-pentagon",xl(5,0)),this.generatePolygon("hexagon",xl(6,0)),this.generateRoundPolygon("round-hexagon",xl(6,0)),this.generatePolygon("heptagon",xl(7,0)),this.generateRoundPolygon("round-heptagon",xl(7,0)),this.generatePolygon("octagon",xl(8,0)),this.generateRoundPolygon("round-octagon",xl(8,0));var n=new Array(20);{var i=Dj(5,0),s=Dj(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var o=0;o=e.deqFastCost*T)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*mH)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&s())},o=e.priority||ere;i.beforeRender(a,o(n))}}}},WJt=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YI;Rm(this,t),this.idsByKey=new l0,this.keyForId=new l0,this.cachesByLvl=new l0,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return _m(t,[{key:"getIdsFor",value:function(r){r==null&&us("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new lC,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),s=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(s,n),this.keyForId.set(n,s)}},{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),s=this.getKey(r);return i!==s}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,s=n.get(r);return s||(s=new l0,n.set(r,s),i.push(r)),s}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),s=this.getCache(i,n);return s!=null&&this.updateKeyMappingFor(r),s}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),s=this.getCache(i,n);return s}},{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 s=this.getKey(r);this.setCache(s,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 s=this.doesEleInvalidateKey(r);return s&&this.invalidateKey(i),s||this.getNumberOfIdsForKey(i)===0}}])})(),x1e=25,HM=50,m9=-4,Xj=3,rDe=7.99,qJt=8,UJt=1024,jJt=1024,YJt=1024,XJt=.2,KJt=.8,ZJt=10,QJt=.15,JJt=.1,eer=.9,ter=.9,rer=100,ner=1,Bb={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ier=$o({getKey:null,doesEleInvalidateKey:YI,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:GNe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),tS=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=ier(r);Wr(n,i),n.lookup=new WJt(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Ha=tS.prototype;Ha.reasons=Bb;Ha.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Ha.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Ha.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new T7(function(r,n){return n.reqs-r.reqs});return e};Ha.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Ha.getElement=function(t,e,r,n,i){var s=this,a=this.renderer,o=a.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!s.allowEdgeTxrCaching&&t.isEdge()||!s.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(rre(o*r))),n=rDe||n>Xj)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=a.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<=x1e?g=x1e:h<=HM?g=HM:g=Math.ceil(h/HM)*HM,h>YJt||d>jJt)return null;var m=s.getTextureQueue(g),y=m[m.length-2],v=function(){return s.recycleTexture(g,d)||s.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidthn;R--)A=s.getElement(t,e,r,R,Bb.downscale);M()}else return s.queueElement(t,S.level-1),S;else{var P;if(!x&&!T&&!C)for(var N=n-1;N>=m9;N--){var L=l.get(t,N);if(L){P=L;break}}if(b(P))return s.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+qJt),y.eleCaches.push(p),l.set(t,n,p),s.checkTextureFullness(y),p};Ha.invalidateElements=function(t){for(var e=0;e=XJt*t.width&&this.retireTexture(t)};Ha.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>KJt&&t.fullnessChecks>=ZJt?rm(r,t):t.fullnessChecks++};Ha.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;rm(n,t),t.retired=!0;for(var s=t.eleCaches,a=0;a=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,tre(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),rm(i,a),n.push(a),a}};Ha.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),s=this.getKey(t),a=i[s];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,n.updateItem(a);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:s};n.push(o),i[s]=o}};Ha.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],s=e.lookup,a=0;a0;a++){var o=r.pop(),l=o.key,u=o.eles[0],h=s.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,Bb.dequeue)}return i};Ha.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),s=n[i];s!=null&&(s.eles.length===1?(s.reqs=Jte,r.updateItem(s),r.pop(),n[i]=null):s.eles.unmerge(t))};Ha.onDequeue=function(t){this.onDequeues.push(t)};Ha.offDequeue=function(t){rm(this.onDequeues,t)};Ha.setupDequeueing=tDe.setupDequeueing({deqRedrawThreshold:rer,deqCost:QJt,deqAvgCost:JJt,deqNoDrawCost:eer,deqFastCost:ter,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=aer||r>rN)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},R=function(I){if(!p)for(var $=r+I;rE<=$&&$<=rN&&!M($);$+=I);};R(1),R(-1);for(var P=h.length-1;P>=0;P--){var N=h[P];N.invalid&&rm(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Wl();for(var M=0;MT1e||N>T1e)return null;var L=P*N;if(L>per)return null;var I=n.makeLayer(d,r);if(R!=null){var $=h.indexOf(R)+1;h.splice($,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,b=t.length/ser,x=!o,T=0;T=b||!KNe(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||x?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(x?null:h)};Bo.getEleLevelForLayerLevel=function(t,e){return t};Bo.drawEleInLayer=function(t,e,r,n){var i=this,s=this.renderer,a=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),s.setImgSmoothing(a,!1),s.drawCachedElement(a,e,null,null,r,ger),s.setImgSmoothing(a,!0))};Bo.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,s=0;s0||a.invalid)return!1;i+=a.eles.length}return i===e.length};Bo.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Bo.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=B0(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,s){e.invalidateLayer(n)}))};Bo.invalidateLayer=function(t){if(this.lastInvalidationTime=B0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];rm(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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o=e._private.rscratch;if(!(s&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=s?e.pstyle("opacity").value:1,h=s?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,b=u*h,x=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(a.eleStrokeStyle(t,e,I),a.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,a.eleStrokeStyle(t,e,I),a.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)a.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?a.drawEdgeTrianglePath(e,t,o.allpts):(a.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&a.drawEdgeOverlay(t,e)},S=function(){i&&a.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;a.drawArrowheads(t,e,I)},E=function(){a.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,R=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,N=v*P;t.translate(M,R),x(N),k(N),t.translate(-M,-R)}else T();S(),x(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var sDe=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 s=this,a=s.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"&&!a?r.lineCap="butt":r.lineCap="round",s.colorStrokeStyle(r,h[0],h[1],h[2],i),s.drawEdgePath(n,r,o.allpts,"solid")}}}};gp.drawEdgeOverlay=sDe("overlay");gp.drawEdgeUnderlay=sDe("underlay");gp.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,s=e,a,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?(a=e=i.pathCache,o=!0):(a=e=new Path2D,i.pathCacheKey=d,i.pathCache=a)}if(s.setLineDash)switch(n){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(u),s.lineDashOffset=h;break;case"solid":s.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,a=this;if(n==null){if(s&&!a.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=a.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?(a.drawText(t,e,null,g,s),e.isEdge()&&(a.drawText(t,e,"source",g,s),a.drawText(t,e,"target",g,s))):a.drawText(t,e,i,g,s),r&&t.translate(m.x1,m.y1)};Nv.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",s=e.pstyle("font-family").strValue,a=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+" "+a+" "+i+" "+s,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function Eer(t,e,r,n,i){var s=Math.min(n,i),a=s/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,a,0,Math.PI*2),t.closePath()}function E1e(t,e,r,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,a=Math.min(s,n/2,i/2);t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath()}Nv.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,s=e?e+"-":"",a=t.pstyle(s+"text-rotation");if(a.strValue==="autorotate"){var o=kl(i,"labelAngle",e);r=t.isEdge()?o:0}else a.strValue==="none"?r=0:r=a.pfValue;return r};Nv.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,s=e._private,a=s.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=kl(a,"labelX",r),u=kl(a,"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=kl(a,"labelWidth",r),m=kl(a,"labelHeight",r),y=kl(a,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,b=e.pstyle(p+"text-margin-y").pfValue,x=e.isEdge(),T=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;x&&(T="center",C="center"),l+=v,u+=b;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=h3(T),E=d3(C);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,R=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,L=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",$=2;if(A>0||R>0&&M>0){var O=t.fillStyle,D=t.strokeStyle,B=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,F=e.pstyle("text-border-style").value,H=A>0,G=R>0&&M>0,W=l-P;switch(k){case"left":W-=g;break;case"center":W-=g/2;break}var K=u-m-P,q=g+2*P,oe=m+2*P;if(H&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")")),G&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(M*o,")"),t.lineWidth=R,t.setLineDash))switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=R/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(L?(t.beginPath(),E1e(t,W,K,q,oe,$)):I?(t.beginPath(),Eer(t,W,K,q,oe)):(t.beginPath(),t.rect(W,K,q,oe)),H&&t.fill(),G&&t.stroke(),G&&F==="double"){var Z=R/2;t.beginPath(),L?E1e(t,W+Z,K+Z,q-2*Z,oe-2*Z,$):t.rect(W+Z,K+Z,q-2*Z,oe-2*Z),t.stroke()}t.fillStyle=O,t.strokeStyle=D,t.lineWidth=B,t.setLineDash&&t.setLineDash([])}var Q=2*e.pstyle("text-outline-width").pfValue;if(Q>0&&(t.lineWidth=Q),u-=y,e.pstyle("text-wrap").value==="wrap"){var ne=kl(a,"labelWrapCachedLines",r),ie=kl(a,"labelLineHeight",r),me=g/2,te=this.getLabelJustification(e);switch(te==="auto"||(k==="left"?te==="left"?l+=-g:te==="center"&&(l+=-me):k==="center"?te==="left"?l+=-me:te==="right"&&(l+=me):k==="right"&&(te==="center"?l+=me:te==="right"&&(l+=g))),E){case"top":u-=(ne.length-1)*ie;break;case"center":case"bottom":u-=(ne.length-1)*ie;break}for(var _e=0;_e0&&t.strokeText(ne[_e],l,u),t.fillText(ne[_e],l,u),u+=ie}else Q>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var Im={};Im.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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Qt(d.x)||!Qt(d.y))&&!(s&&!e.visible())){var f=s?e.effectiveOpacity():1,p=a.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 b=e.pstyle("background-image"),x=b.value,T=new Array(x.length),C=new Array(x.length),S=0,k=0;k0&&arguments[0]!==void 0?arguments[0]:N;a.eleFillStyle(t,e,J)},Z=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;a.colorStrokeStyle(t,L[0],L[1],L[2],J)},Q=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W;a.colorStrokeStyle(t,H[0],H[1],H[2],J)},ne=function(J,ue,X,fe){var ee=a.nodePathCache=a.nodePathCache||[],Me=HNe(X==="polygon"?X+","+fe.join(","):X,""+ue,""+J,""+q),Re=ee[Me],Ke,Ne=!1;return Re!=null?(Ke=Re,Ne=!0,h.pathCache=Ke):(Ke=new Path2D,ee[Me]=h.pathCache=Ke),{path:Ke,cacheHit:Ne}},ie=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=ne(o,l,ie,me);g=te.path,m=te.cacheHit}var _e=function(){if(!m){var J=d;p&&(J={x:0,y:0}),a.nodeShapes[a.getNodeShape(e)].draw(g||t,J.x,J.y,o,l,q,h)}p?t.fill(g):t.fill()},$e=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,X=u.backgrounding,fe=0,ee=0;ee0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasPie(e)&&(a.drawPie(t,e,ue),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},ce=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;a.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h),t.clip()),a.drawStripe(t,e,ue),t.restore(),J&&(p||a.nodeShapes[a.getNodeShape(e)].draw(t,d.x,d.y,o,l,q,h)))},he=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(R>0?R:-R)*J,X=R>0?0:255;R!==0&&(a.colorFillStyle(t,X,X,X,ue),p?t.fill(g):t.fill())},Te=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var J=new Path2D;J.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),J.addPath(g),t.clip(J,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},ge=function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;p&&(J={x:0,y:0});var ue=a.getNodeShape(e),X=P;D==="inside"&&(X=0),D==="outside"&&(X*=2);var fe=(o+X+(F+K))/o,ee=(l+X+(F+K))/l,Me=o*fe,Re=l*ee,Ke=a.nodeShapes[ue].points,Ne;if(p){var je=ne(Me,Re,ue,Ke);Ne=je.path}if(ue==="ellipse")a.drawEllipsePath(Ne||t,J.x,J.y,Me,Re);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var Oe=0,Ze=0,Fe=0;ue==="round-diamond"?Oe=(X+K+F)*1.4:ue==="round-heptagon"?(Oe=(X+K+F)*1.075,Fe=-(X/2+K+F)/35):ue==="round-hexagon"?Oe=(X+K+F)*1.12:ue==="round-pentagon"?(Oe=(X+K+F)*1.13,Fe=-(X/2+K+F)/15):ue==="round-tag"?(Oe=(X+K+F)*1.12,Ze=(X/2+F+K)*.07):ue==="round-triangle"&&(Oe=(X+K+F)*(Math.PI/2),Fe=-(X+K/2+F)/Math.PI),Oe!==0&&(fe=(o+Oe)/o,Me=o*fe,["round-hexagon","round-tag"].includes(ue)||(ee=(l+Oe)/l,Re=l*ee)),q=q==="auto"?JNe(Me,Re):q;for(var st=Me/2,Pe=Re/2,gt=q+(X+F+K)/2,Le=new Array(Ke.length/2),kt=new Array(Ke.length/2),Et=0;Et0){if(i=i||n.position(),s==null||a==null){var p=n.padding();s=n.width()+2*p,a=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,s+l*2,a+l*2,f),r.fill()}}}};Im.drawNodeOverlay=aDe("overlay");Im.drawNodeUnderlay=aDe("underlay");Im.hasPie=function(t){return t=t[0],t._private.hasPie};Im.hasStripe=function(t){return t=t[0],t._private.hasStripe};Im.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=e.pstyle("pie-size"),a=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),s.units==="%"?f=f*s.pfValue:s.pfValue!==void 0&&(f=s.pfValue/2),a.units==="%"?p=f*a.pfValue:a.pfValue!==void 0&&(p=a.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,b=e.pstyle("pie-"+y+"-background-color").value,x=e.pstyle("pie-"+y+"-background-opacity").value*r,T=v/100;T+g>1&&(T=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*T,k=C+S;v===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],x),t.fill(),g+=T)}};Im.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),s=n.x,a=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&&(s=0,a=0),a-=p/2,s-=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,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,x=y/100;x+u>1&&(x=1-u),!(y===0||u>=1||u+x>1)&&(t.beginPath(),t.rect(s,a+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],b),t.fill(),u+=x)}t.restore()};var Jl={},Aer=100;Jl.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};Jl.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 b=r.style(),x=r.zoom(),T=a!==void 0?a:x,C=r.pan(),S={x:C.x,y:C.y},k={zoom:x,pan:{x:C.x,y:C.y}},E=e.prevViewport,A=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.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 R(Z,Q,ne,ie,me){var te=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(Q,ne,ie,me),Z.globalCompositeOperation=te}function P(Z,Q){var ne,ie,me,te;!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ne={x:C.x*p,y:C.y*p},ie=x*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(ne=S,ie=T,me=e.canvasWidth,te=e.canvasHeight),Z.setTransform(1,0,0,1,0,0),Q==="motionBlur"?R(Z,0,0,me,te):!n&&(Q===void 0||Q)&&Z.clearRect(0,0,me,te),i||(Z.translate(ne.x,ne.y),Z.scale(ie,ie)),o&&Z.translate(o.x,o.y),a&&Z.scale(a,a)}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 k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var L=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;L.setTransform(1,0,0,1,0,0),f?R(L,0,0,k.width,k.height):L.clearRect(0,0,k.width,k.height);var $=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(L,$[0],$[1],$[2],O),L.fillRect(0,0,k.width,k.height);var x=r.zoom();P(L,!1),L.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),L.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&B,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||s||V[e.NODE]){var F=f&&!V[e.NODE]&&p!==1,L=n||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),H=f&&!F?"motionBlur":void 0;P(L,H),z?e.drawCachedNodes(L,M.nondrag,l,D):e.drawLayeredElements(L,M.nondrag,l,D),e.debug&&e.drawDebugPoints(L,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!s&&(h[e.DRAG]||i||V[e.DRAG])){var F=f&&!V[e.DRAG]&&p!==1,L=n||(F?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(L,f&&!F?"motionBlur":void 0),z?e.drawCachedNodes(L,M.drag,l,D):e.drawCachedElements(L,M.drag,l,D),e.debug&&e.drawDebugPoints(L,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var G=u.contexts[e.NODE],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=u.contexts[e.DRAG],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],oe=function(Q,ne,ie){Q.setTransform(1,0,0,1,0,0),ie||!v?Q.clearRect(0,0,e.canvasWidth,e.canvasHeight):R(Q,0,0,e.canvasWidth,e.canvasHeight);var me=p;Q.drawImage(ne,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(oe(G,W,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(oe(K,q,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},Aer)),n||r.emit("render")};var ik;Jl.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,s=n.style(),a=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!a&&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=s.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+s.core("selection-box-color").value[0]+","+s.core("selection-box-color").value[1]+","+s.core("selection-box-color").value[2]+","+s.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("+s.core("selection-box-border-color").value[0]+","+s.core("selection-box-border-color").value[1]+","+s.core("selection-box-border-color").value[2]+","+s.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("+s.core("active-bg-color").value[0]+","+s.core("active-bg-color").value[1]+","+s.core("active-bg-color").value[2]+","+s.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,s.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",!ik){var v=h.measureText(y);ik=v.actualBoundingBoxAscent}h.fillText(y,0,ik);var b=60;h.strokeRect(0,ik+10,250,20),h.fillRect(0,ik+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function A1e(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 Mer(t,e,r){var n=A1e(t,t.VERTEX_SHADER,e),i=A1e(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,i),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error("Could not initialize shaders");return s}function Rer(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 bre(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 _er(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function Ler(t,e,r,n,i){var s=n*r+e.x,a=i*r+e.y;return a=Math.round(t.canvasHeight-a),[s,a]}function Ier(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 Ner(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 Oer(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Der(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 oDe(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 lDe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Per(t,e,r,n,i,s){switch(e){case t.FLOAT:return new Float32Array(r.buffer,s*n,i);case t.INT:return new Int32Array(r.buffer,s*n,i)}}function $er(t,e,r,n){var i=oDe(t,e),s=sa(i,2),a=s[0],o=s[1],l=lDe(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,a,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,a,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function nd(t,e,r,n){var i=oDe(t,r),s=sa(i,3),a=s[0],o=s[1],l=s[2],u=lDe(t,o,e*a),h=a*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,a,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,a,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;pa&&(o=a/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var s=this;if(this.locked)throw new Error("can't draw, atlas is locked");var a=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(x,T){if(i&&T){var C=T.context,S=x.x,k=x.row,E=S,A=l*k;C.save(),C.translate(E,A),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(s.freePointer,s.canvas),g[0]={x:s.freePointer.x,y:s.freePointer.row*l,w:d,h:f},g[1]={x:s.freePointer.x+d,y:s.freePointer.row*l,w:0,h:f},s.freePointer.x+=d,s.freePointer.x==a&&(s.freePointer.x=0,s.freePointer.row++)},y=function(){var x=s.scratch,T=s.canvas;x.clear(),p({x:0,row:0},x);var C=a-s.freePointer.x,S=d-C,k=l;{var E=s.freePointer.x,A=s.freePointer.row*l,M=C;T.context.drawImage(x,0,0,M,k,E,A,M,k),g[0]={x:E,y:A,w:M,h:f}}{var R=C,P=(s.freePointer.row+1)*l,N=S;T&&T.context.drawImage(x,R,0,N,k,0,P,N,k),g[1]={x:0,y:P,w:N,h:f}}s.freePointer.x=S,s.freePointer.row++},v=function(){s.freePointer.x=0,s.freePointer.row++};if(this.freePointer.x+d<=a)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===a?(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,s=this.getScale(r),a=s.texW;return this.freePointer.x+a>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},s=i.forceRedraw,a=s===void 0?!1:s,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=xc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=xc(this.renderTypes.values()),v;try{var b=function(){var T=v.value,C=T.type;if(h(C)){var S=n.collections.get(T.collection),k=T.getKey(m),E=Array.isArray(k)?k:[k];if(a)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),M=n._key(C,A),R=n.typeAndIdToKey.get(M);R!==void 0&&!Ner(E,R)&&(d=!0,n.typeAndIdToKey.delete(M),R.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)b()}catch(x){y.e(x)}finally{y.f()}}}}catch(x){p.e(x)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=xc(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(s){r.e(s)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,s){var a=this.renderTypes.get(n),o=this.collections.get(a.collection),l=!1,u=o.draw(s,i,function(f){a.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),a.drawElement(f,r,i,!0,!0),f.restore()):a.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=a.getID?a.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(s):this.typeAndIdToKey.set(d,[s])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,s=this.renderTypes.get(n),a=s.getKey(r),o=Array.isArray(a)?a:[a];return o.map(function(l){var u=s.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=sa(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=xc(this.collections),i;try{for(n.s();!(i=n.n()).done;){var s=sa(i.value,2),a=s[0],o=s[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:a,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),Uer=(function(){function t(e){Rm(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return _m(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}}])})(),jer=` +*/var BDe=function(e,r){this.recycle(e,r)};function a3(){return!1}function zE(){return!0}BDe.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=a3,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?zE:a3):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=zE;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=zE;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=zE,this.stopPropagation()},isDefaultPrevented:a3,isPropagationStopped:a3,isImmediatePropagationStopped:a3};var $De=/^([^.]+)(\.(?:[^.]+))?$/,dQt=".*",FDe={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},sme=Object.keys(FDe),fQt={};function $_(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fQt,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};l1.removeAllListeners=function(){return this.removeListener("*")};l1.emit=l1.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Li(e)||(e=[e]),pQt(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===dQt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&rKt(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&&Dr(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":Fs(Symbol))!=e&&Fs(Symbol.iterator)!=e;r&&(tN[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return FNe({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(ei(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Dr(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)}});nl.neighbourhood=nl.neighborhood;nl.closedNeighbourhood=nl.closedNeighborhood;nl.openNeighbourhood=nl.openNeighborhood;Gr(nl,{source:_u(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:_u(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:dme({attr:"source"}),targets:dme({attr:"target"})});function dme(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]}});nl.componentsOf=nl.components;var No=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){ca("A collection must have a reference to the core");return}var a=new c0,s=!1;if(!r)r=[];else if(r.length>0&&ei(r[0])&&!vk(r[0])){s=!0;for(var o=[],l=new h9,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 B=o.length===r.length?r:new No(n,o),F=0;F0&&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(L){for(var I=L._private.edges,P=0;P0&&(t?R.emitAndNotify("remove"):e&&R.emit("remove"));for(var _=0;_0?_=L:R=L;while(Math.abs(N)>s&&++I=a?b(A,I):P===0?I:w(A,R,R+u)}var k=!1;function C(){k=!0,(t!==e||r!==n)&&v()}var S=function(R){return k||C(),t===e&&r===n?R:R===0?0:R===1?1:U(T(R),e,n)};S.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var E="generateBezier("+[t,e,r,n]+")";return S.toString=function(){return E},S}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var kQt=(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}})(),_i=function(e,r,n,i){var a=CQt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},gM={linear:function(e,r,n){return e+(r-e)*n},ease:_i(.25,.1,.25,1),"ease-in":_i(.42,0,1,1),"ease-out":_i(0,0,.58,1),"ease-in-out":_i(.42,0,.58,1),"ease-in-sine":_i(.47,0,.745,.715),"ease-out-sine":_i(.39,.575,.565,1),"ease-in-out-sine":_i(.445,.05,.55,.95),"ease-in-quad":_i(.55,.085,.68,.53),"ease-out-quad":_i(.25,.46,.45,.94),"ease-in-out-quad":_i(.455,.03,.515,.955),"ease-in-cubic":_i(.55,.055,.675,.19),"ease-out-cubic":_i(.215,.61,.355,1),"ease-in-out-cubic":_i(.645,.045,.355,1),"ease-in-quart":_i(.895,.03,.685,.22),"ease-out-quart":_i(.165,.84,.44,1),"ease-in-out-quart":_i(.77,0,.175,1),"ease-in-quint":_i(.755,.05,.855,.06),"ease-out-quint":_i(.23,1,.32,1),"ease-in-out-quint":_i(.86,0,.07,1),"ease-in-expo":_i(.95,.05,.795,.035),"ease-out-expo":_i(.19,1,.22,1),"ease-in-out-expo":_i(1,0,0,1),"ease-in-circ":_i(.6,.04,.98,.335),"ease-out-circ":_i(.075,.82,.165,1),"ease-in-out-circ":_i(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return gM.linear;var i=kQt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":_i};function gme(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 mme(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function M2(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=mme(t,i),o=mme(e,i);if(Jt(s)&&Jt(o))return gme(a,s,o,r,n);if(Li(s)&&Li(o)){for(var l=[],u=0;u0?(p==="spring"&&g.push(s.duration),s.easingImpl=gM[p].apply(null,g)):s.easingImpl=gM[p]}var m=s.easingImpl,U;if(s.duration===0?U=1:U=(r-l)/s.duration,s.applying&&(U=s.progress),U<0?U=0:U>1&&(U=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var v={};s3(y.x,b.x)&&(v.x=M2(y.x,b.x,U,m)),s3(y.y,b.y)&&(v.y=M2(y.y,b.y,U,m)),t.position(v)}var w=s.startPan,T=s.pan,k=a.pan,C=T!=null&&n;C&&(s3(w.x,T.x)&&(k.x=M2(w.x,T.x,U,m)),s3(w.y,T.y)&&(k.y=M2(w.y,T.y,U,m)),t.emit("pan"));var S=s.startZoom,E=s.zoom,A=E!=null&&n;A&&(s3(S,E)&&(a.zoom=jT(a.minZoom,M2(S,E,U,m),a.maxZoom)),t.emit("zoom")),(C||A)&&t.emit("viewport");var R=s.style;if(R&&R.length>0&&i){for(var _=0;_=0;C--){var S=k[C];S()}k.splice(0,k.length)},b=p.length-1;b>=0;b--){var v=p[b],w=v._private;if(w.stopped){p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||EQt(h,v,t),SQt(h,v,t,d),w.applying&&(w.applying=!1),y(w.frames),w.step!=null&&w.step(t),v.completed()&&(p.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var AQt={animate:bi.animate(),animation:bi.animation(),animated:bi.animated(),clearQueue:bi.clearQueue(),delay:bi.delay(),delayAnimation:bi.delayAnimation(),stop:bi.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&&KI(function(a){Ume(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){Ume(s,e)},n.beforeRenderPriorities.animations):r()}},MQt={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&&vk(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}},HE=function(e){return Dr(e)?new s1(e):e},qDe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new $_(MQt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,HE(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,HE(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,HE(r),n),this},once:function(e,r,n){return this.emitter().one(e,HE(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}};bi.eventAliasesOn(qDe);var Kj={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)}};Kj.jpeg=Kj.jpg;var mM={layout:function(e){var r=this;if(e==null){ca("Layout options must be specified to make a layout");return}if(e.name==null){ca("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){ca("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Dr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Gr({},e,{cy:r,eles:a}));return s}};mM.createLayout=mM.makeLayout=mM.layout;var RQt={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)}};Zj.invalidateDimensions=Zj.resize;var UM={collection:function(e,r){return Dr(e)?this.$(e):Jc(e)?e.collection():Li(e)?(r||(r={}),new No(this,e,r.unique,r.removed)):new No(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}};UM.elements=UM.filter=UM.$;var co={},aw="t",IQt="f";co.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m1&&(w=1),o.color){var k=n.valueMin[0],C=n.valueMax[0],S=n.valueMin[1],E=n.valueMax[1],A=n.valueMin[2],R=n.valueMax[2],_=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],L=[Math.round(k+(C-k)*w),Math.round(S+(E-S)*w),Math.round(A+(R-A)*w),Math.round(_+(N-_)*w)];a={bypass:n.bypass,name:n.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,I,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var P=n.field.split("."),O=d.data,D=0;D0&&a>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(v):v()}).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)};co.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)};co.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)})};co.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};co.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()})})};co.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()})})};co.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 Ek={};Ek.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){xi("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 s1(d);if(f.invalid){xi("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 U=a.match(/^\s*$/);if(U)break;var y=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){xi("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=y[0];var b=y[1],v=y[2],w=e.properties[b];if(!w){xi("Skipping property: Invalid property name in: "+s),l();continue}var T=r.parse(b,v);if(!T){xi("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:v}),l()}if(g){o();break}r.selector(d);for(var k=0;k=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 xi("`"+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 U=g.value,y=m.value,b=U[0]===y[0]&&U[1]===y[1]&&U[2]===y[2]&&(U[3]===y[3]||(U[3]==null||U[3]===1)&&(y[3]==null||y[3]===1));if(b)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 v;if(l?v=e.split(/\s+/):Li(e)?v=e:v=[e],u.evenMultiple&&v.length%2!==0)return null;for(var w=[],T=[],k=[],C="",S=!1,E=0;E0?" ":"")+A.strValue}return u.validate&&!u.validate(w,T)?null:u.singleEnum&&S?w.length===1&&Dr(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:k,strValue:C,bypass:r,units:T}}var R=function(){for(var Z=0;Zu.max||u.strictMax&&e===u.max))return null;var P={name:t,value:e,strValue:""+e+(_||""),units:_,bypass:r};return u.unitless||_!=="px"&&_!=="em"?P.pfValue=e:P.pfValue=_==="px"||!_?e:this.getEmSizeInPixels()*e,(_==="ms"||_==="s")&&(P.pfValue=_==="ms"?e:1e3*e),(_==="deg"||_==="rad")&&(P.pfValue=_==="rad"?e:AKt(e)),_==="%"&&(P.pfValue=e/100),P}else if(u.propList){var O=[],D=""+e;if(D!=="none"){for(var B=D.split(/\s*,\s*|\s+/),F=0;F0&&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),Jt(e)?s=e:ei(e)&&(s=e.level,e.position!=null?a=I_(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;Jt(u.x)&&(r.pan.x=u.x,o=!1),Jt(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(Dr(e)){var n=e;e=this.mutableElements().filter(n)}else Jc(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}};h5.centre=h5.center;h5.autolockNodes=h5.autolock;h5.autoungrabifyNodes=h5.autoungrabify;var ZT={data:bi.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:bi.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:bi.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:bi.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ZT.attr=ZT.data;ZT.removeAttr=ZT.removeData;var JT=function(e){var r=this;e=Gr({},e);var n=e.container;n&&!XI(n)&&XI(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=Ss!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Gr({name:s?"grid":"null"},o.layout),o.renderer=Gr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,U){return m!==void 0?m:U!==void 0?U:g},u=this._private={container:n,ready:!1,options:o,elements:new No(this),listeners:[],aniEles:new No(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:Jt(o.zoom)?o.zoom:1,pan:{x:ei(o.pan)&&Jt(o.pan.x)?o.pan.x:0,y:ei(o.pan)&&Jt(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 U=g.some(xXt);if(U)return d9.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Gr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,U){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(ei(g)||Li(g))&&r.add(g),r.one("layoutready",function(v){r.notifications(!0),r.emit(v),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",U),r.emit("done")});var b=Gr({},r._private.options.layout);b.eles=r.elements(),r.layout(b).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,Ca(o.ready)&&r.on("ready",o.ready);for(var U=0;U0,o=!!t.boundingBox,l=Gl(o?t.boundingBox:structuredClone(e.extent())),u;if(Jc(t.roots))u=t.roots;else if(Li(t.roots)){for(var h=[],d=0;d0;){var L=N(),I=E(L,R);if(I)L.outgoers().filter(function(he){return he.isNode()&&r.has(he)}).forEach(_);else if(I===null){xi("Detected double maximal shift for node `"+L.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var P=0;if(t.avoidOverlap)for(var O=0;O0&&y[0].length<=3?Ee/2:0),le=2*Math.PI/y[ze].length*xe;return ze===0&&y[0].length===1&&(qe=1),{x:ie.x+qe*Math.cos(le),y:ie.y+qe*Math.sin(le)}}else{var pe=y[ze].length,Te=Math.max(pe===1?0:o?(l.w-t.padding*2-me.w)/((t.grid?Re:pe)-1):(l.w-t.padding*2-me.w)/((t.grid?Re:pe)+1),P),re={x:ie.x+(xe+1-(pe+1)/2)*Te,y:ie.y+(ze+1-(G+1)/2)*te};return re}},Ve={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ve).indexOf(t.direction)===-1&&ca("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ve).join(", ")));var ce=function(we){return KXt(Pe(we),l,Ve[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var PQt={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 YDe(t){this.options=Gr({},PQt,t)}YDe.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=Gl(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 y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),v=Math.sqrt(d*d/(y*y+b*b));h=Math.max(v,h)}var w=function(k,C){var S=e.startAngle+C*u*(i?1:-1),E=h*Math.cos(S),A=h*Math.sin(S),R={x:o.x+E,y:o.y+A};return R};return n.nodes().layoutPositions(this,e,w),this};var BQt={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 XDe(t){this.options=Gr({},BQt,t)}XDe.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=Gl(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 T=Math.abs(b[0].value-w.value);T>=U&&(b=[],y.push(b))}b.push(w)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var C=y.length>0&&y[0].length>1,S=Math.min(s.w,s.h)/2-k,E=S/(y.length+C?1:0);k=Math.min(k,E)}for(var A=0,R=0;R1&&e.avoidOverlap){var I=Math.cos(L)-Math.cos(0),P=Math.sin(L)-Math.sin(0),O=Math.sqrt(k*k/(I*I+P*P));A=Math.max(O,A)}_.r=A,A+=k}if(e.equidistant){for(var D=0,B=0,F=0;F=t.numIter||(WQt(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),KI(h)}};h()}else{for(;u;)u=s(l),l++;vme(n,t),o()}return this};G_.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};G_.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var FQt=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Gl(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(S);for(var h=0;hi.count?0:i.graph},KDe=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=nN(e,o,l),U=nN(r,-1*o,-1*l),y=U.x-m.x,b=U.y-m.y,v=y*y+b*b,f=Math.sqrt(v),d=(e.nodeRepulsion+r.nodeRepulsion)/v,p=d*y/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},YQt=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},nN=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)},XQt=function(e,r){for(var n=0;nn){var U=r.gravity*p/m,y=r.gravity*g/m;f.offsetX+=U,f.offsetY+=y}}}}},ZQt=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},JDe=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.padTopy&&(g+=U+r.componentSpacing,p=0,m=0,U=0)}}},eer={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 QDe(t){this.options=Gr({},eer,t)}QDe.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=Gl(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(H){if(H==null)return Math.min(l,u);var G=Math.min(l,u);G==l?l=H:u=H},d=function(H){if(H==null)return Math.max(l,u);var G=Math.max(l,u);G==l?l=H:u=H},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l=s?d(y+1):h(U+1)}var b=a.w/u,v=a.h/l;if(e.condense&&(b=0,v=0),e.avoidOverlap)for(var w=0;w=u&&(I=0,L++)},O={},D=0;D(I=VKt(t,e,P[O],P[O+1],P[O+2],P[O+3])))return U(C,I),!0}else if(E.edgeType==="bezier"||E.edgeType==="multibezier"||E.edgeType==="self"||E.edgeType==="compound"){for(var P=E.allpts,O=0;O+5(I=zKt(t,e,P[O],P[O+1],P[O+2],P[O+3],P[O+4],P[O+5])))return U(C,I),!0}for(var D=D||S.source,B=B||S.target,F=i.getArrowWidth(A,R),z=[{name:"source",x:E.arrowStartX,y:E.arrowStartY,angle:E.srcArrowAngle},{name:"target",x:E.arrowEndX,y:E.arrowEndY,angle:E.tgtArrowAngle},{name:"mid-source",x:E.midX,y:E.midY,angle:E.midsrcArrowAngle},{name:"mid-target",x:E.midX,y:E.midY,angle:E.midtgtArrowAngle}],O=0;O0&&(y(D),y(B))}function v(C,S,E){return Cl(C,S,E)}function w(C,S){var E=C._private,A=f,R;S?R=S+"-":R="",C.boundingBox();var _=E.labelBounds[S||"main"],N=C.pstyle(R+"label").value,L=C.pstyle("text-events").strValue==="yes";if(!(!L||!N)){var I=v(E.rscratch,"labelX",S),P=v(E.rscratch,"labelY",S),O=v(E.rscratch,"labelAngle",S),D=C.pstyle(R+"text-margin-x").pfValue,B=C.pstyle(R+"text-margin-y").pfValue,F=_.x1-A-D,z=_.x2+A-D,$=_.y1-A-B,V=_.y2+A-B;if(O){var H=Math.cos(O),G=Math.sin(O),K=function(me,te){return me=me-I,te=te-P,{x:me*H-te*G+I,y:me*G+te*H+P}},W=K(F,$),oe=K(F,V),Z=K(z,$),J=K(z,V),ne=[W.x+D,W.y+B,Z.x+D,Z.y+B,J.x+D,J.y+B,oe.x+D,oe.y+B];if(mc(t,e,ne))return U(C),!0}else if(mg(_,t,e))return U(C),!0}}for(var T=s.length-1;T>=0;T--){var k=s[T];k.isNode()?y(k)||w(k):b(k)||w(k)||w(k,"source")||w(k,"target")}return o};O5.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=Gl({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,Re){return Cl(me,te,Re)}function U(me,te){var Re=me._private,Pe=s,Ve="";me.boundingBox();var ce=Re.labelBounds.main;if(!ce)return null;var he=m(Re.rscratch,"labelX",te),we=m(Re.rscratch,"labelY",te),ge=m(Re.rscratch,"labelAngle",te),ze=me.pstyle(Ve+"text-margin-x").pfValue,xe=me.pstyle(Ve+"text-margin-y").pfValue,Ee=ce.x1-Pe-ze,qe=ce.x2+Pe-ze,le=ce.y1-Pe-xe,pe=ce.y2+Pe-xe;if(ge){var Te=Math.cos(ge),re=Math.sin(ge),Y=function(ue,X){return ue=ue-he,X=X-we,{x:ue*Te-X*re+he,y:ue*re+X*Te+we}};return[Y(Ee,le),Y(qe,le),Y(qe,pe),Y(Ee,pe)]}else return[{x:Ee,y:le},{x:qe,y:le},{x:qe,y:pe},{x:Ee,y:pe}]}function y(me,te,Re,Pe){function Ve(ce,he,we){return(we.y-ce.y)*(he.x-ce.x)>(he.y-ce.y)*(we.x-ce.x)}return Ve(me,Re,Pe)!==Ve(te,Re,Pe)&&Ve(me,te,Re)!==Ve(me,te,Pe)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},ser=function(e,r,n,i,a){if(e!==kme?Sme(r,e,ud):aer(wu,ud),Sme(r,n,wu),Tme=ud.nx*wu.ny-ud.ny*wu.nx,Cme=ud.nx*wu.nx-ud.ny*-wu.ny,Nf=Math.asin(Math.max(-1,Math.min(1,Tme))),Math.abs(Nf)<1e-6){Jj=r.x,Qj=r.y,km=L2=0;return}Vm=1,yM=!1,Cme<0?Nf<0?Nf=Math.PI+Nf:(Nf=Math.PI-Nf,Vm=-1,yM=!0):Nf>0&&(Vm=-1,yM=!0),r.radius!==void 0?L2=r.radius:L2=i,lm=Nf/2,GE=Math.min(ud.len/2,wu.len/2),a?(nd=Math.abs(Math.cos(lm)*L2/Math.sin(lm)),nd>GE?(nd=GE,km=Math.abs(nd*Math.sin(lm)/Math.cos(lm))):km=L2):(nd=Math.min(GE,L2),km=Math.abs(nd*Math.sin(lm)/Math.cos(lm))),eY=r.x+wu.nx*nd,tY=r.y+wu.ny*nd,Jj=eY-wu.ny*km*Vm,Qj=tY+wu.nx*km*Vm,nOe=r.x+ud.nx*nd,iOe=r.y+ud.ny*nd,kme=r};function aOe(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 Cre(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}:(ser(t,e,r,n,i),{cx:Jj,cy:Qj,radius:km,startX:nOe,startY:iOe,stopX:eY,stopY:tY,startAngle:ud.ang+Math.PI/2*Vm,endAngle:wu.ang-Math.PI/2*Vm,counterClockwise:yM})}var QT=.01,oer=Math.sqrt(2*QT),cl={};cl.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(T,k,C,S){var E=S-k,A=C-T,R=Math.sqrt(A*A+E*E);return{x:-E/R,y:A/R}},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=is(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),U=is(m,2),y=U[0],b=U[1],v={x1:p,y1:g,x2:y,y2:b};i=u(p,g,y,b),a=v}else xi("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}};cl.findHaystackPoints=function(t){for(var e=0;e0?Math.max(X-fe,0):Math.min(X+fe,0)},N=_(A,S),L=_(R,E),I=!1;b===u?y=Math.abs(N)>Math.abs(L)?i:n:b===l||b===o?(y=n,I=!0):(b===a||b===s)&&(y=i,I=!0);var P=y===n,O=P?L:N,D=P?R:A,B=hre(D),F=!1;!(I&&(w||k))&&(b===o&&D<0||b===l&&D>0||b===a&&D>0||b===s&&D<0)&&(B*=-1,O=B*Math.abs(O),F=!0);var z;if(w){var $=T<0?1+T:T;z=$*O}else{var V=T<0?O:0;z=V+T*B}var H=function(X){return Math.abs(X)=Math.abs(O)},G=H(z),K=H(Math.abs(O)-Math.abs(z)),W=G||K;if(W&&!F)if(P){var oe=Math.abs(D)<=f/2,Z=Math.abs(A)<=p/2;if(oe){var J=(h.x1+h.x2)/2,ne=h.y1,ie=h.y2;r.segpts=[J,ne,J,ie]}else if(Z){var me=(h.y1+h.y2)/2,te=h.x1,Re=h.x2;r.segpts=[te,me,Re,me]}else r.segpts=[h.x1,h.y2]}else{var Pe=Math.abs(D)<=d/2,Ve=Math.abs(R)<=g/2;if(Pe){var ce=(h.y1+h.y2)/2,he=h.x1,we=h.x2;r.segpts=[he,ce,we,ce]}else if(Ve){var ge=(h.x1+h.x2)/2,ze=h.y1,xe=h.y2;r.segpts=[ge,ze,ge,xe]}else r.segpts=[h.x2,h.y1]}else if(P){var Ee=h.y1+z+(U?f/2*B:0),qe=h.x1,le=h.x2;r.segpts=[qe,Ee,le,Ee]}else{var pe=h.x1+z+(U?d/2*B:0),Te=h.y1,re=h.y2;r.segpts=[pe,Te,pe,re]}if(r.isRound){var Y=t.pstyle("taxi-radius").value,Q=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Y),r.isArcRadius=new Array(r.segpts.length/2).fill(Q)}};cl.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=!Jt(r.startX)||!Jt(r.startY),U=!Jt(r.arrowStartX)||!Jt(r.arrowStartY),y=!Jt(r.endX)||!Jt(r.endY),b=!Jt(r.arrowEndX)||!Jt(r.arrowEndY),v=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=v*w,k=c5({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),C=kD.poolIndex()){var B=O;O=D,D=B}var F=N.srcPos=O.position(),z=N.tgtPos=D.position(),$=N.srcW=O.outerWidth(),V=N.srcH=O.outerHeight(),H=N.tgtW=D.outerWidth(),G=N.tgtH=D.outerHeight(),K=N.srcShape=r.nodeShapes[e.getNodeShape(O)],W=N.tgtShape=r.nodeShapes[e.getNodeShape(D)],oe=N.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Z=N.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,J=N.tgtRs=D._private.rscratch,ne=N.srcRs=O._private.rscratch;N.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ie=0;ie=oer||(le=Math.sqrt(Math.max(qe*qe,QT)+Math.max(Ee*Ee,QT)));var pe=N.vector={x:qe,y:Ee},Te=N.vectorNorm={x:pe.x/le,y:pe.y/le},re={x:-Te.y,y:Te.x};N.nodesOverlap=!Jt(le)||W.checkPoint(ce[0],ce[1],0,H,G,z.x,z.y,Z,J)||K.checkPoint(we[0],we[1],0,$,V,F.x,F.y,oe,ne),N.vectorNormInverse=re,L={nodesOverlap:N.nodesOverlap,dirCounts:N.dirCounts,calculatedIntersection:!0,hasBezier:N.hasBezier,hasUnbundled:N.hasUnbundled,eles:N.eles,srcPos:z,srcRs:J,tgtPos:F,tgtRs:ne,srcW:H,srcH:G,tgtW:$,tgtH:V,srcIntn:ge,tgtIntn:he,srcShape:W,tgtShape:K,posPts:{x1:xe.x2,y1:xe.y2,x2:xe.x1,y2:xe.y1},intersectionPts:{x1:ze.x2,y1:ze.y2,x2:ze.x1,y2:ze.y1},vector:{x:-pe.x,y:-pe.y},vectorNorm:{x:-Te.x,y:-Te.y},vectorNormInverse:{x:-re.x,y:-re.y}}}var Y=Ve?L:N;te.nodesOverlap=Y.nodesOverlap,te.srcIntn=Y.srcIntn,te.tgtIntn=Y.tgtIntn,te.isRound=Re.startsWith("round"),i&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(me,Y,ie,Pe):O===D?e.findLoopPoints(me,Y,ie,Pe):Re.endsWith("segments")?e.findSegmentsPoints(me,Y):Re.endsWith("taxi")?e.findTaxiPoints(me,Y):Re==="straight"||!Pe&&N.eles.length%2===1&&ie===Math.floor(N.eles.length/2)?e.findStraightEdgePoints(me):e.findBezierPoints(me,Y,ie,Pe,Ve),e.findEndpoints(me),e.tryToCorrectInvalidPoints(me,Y),e.checkForInvalidEdgeWarning(me),e.storeAllpts(me),e.storeEdgeProjections(me),e.calculateArrowAngles(me),e.recalculateEdgeLabelProjections(me),e.calculateLabelAngles(me)}},C=0;C0){var ce=u,he=Cm(ce,Fy(s)),we=Cm(ce,Fy(Ve)),ge=he;if(we2){var ze=Cm(ce,{x:Ve[2],y:Ve[3]});ze0){var ee=h,Ae=Cm(ee,Fy(s)),Me=Cm(ee,Fy(fe)),Ke=Ae;if(Me2){var Ne=Cm(ee,{x:fe[2],y:fe[3]});Ne=g||C){U={cp:w,segment:k};break}}if(U)break}var S=U.cp,E=U.segment,A=(g-y)/E.length,R=E.t1-E.t0,_=p?E.t0+R*A:E.t1-R*A;_=jT(0,_,1),e=b6(S.p0,S.p1,S.p2,_),f=cer(S.p0,S.p1,S.p2,_);break}case"straight":case"segments":case"haystack":{for(var N=0,L,I,P,O,D=n.allpts.length,B=0;B+3=g));B+=2);var F=g-I,z=F/L;z=jT(0,z,1),e=RKt(P,O,z),f=lOe(P,O);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};mf.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};mf.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=l5(n,t._private.labelDimsKey);if(Cl(r.rscratch,"prefixedLabelDimsKey",e)!==i){xd(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=Cl(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;xd(r.rstyle,"labelWidth",e,f),xd(r.rscratch,"labelWidth",e,f),xd(r.rstyle,"labelHeight",e,p),xd(r.rscratch,"labelHeight",e,p),xd(r.rscratch,"labelLineHeight",e,d),xd(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};mf.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,H){return H?(xd(r.rscratch,V,e,H),H):Cl(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,U=0;Ud){var T=y.matchAll(m),k="",C=0,S=vc(T),E;try{for(S.s();!(E=S.n()).done;){var A=E.value,R=A[0],_=y.substring(C,A.index);C=A.index+R.length;var N=k.length===0?_:k+_+R,L=this.calculateLabelDimensions(t,N),I=L.width;I<=d?k+=_+R:(k&&g.push(k),k=_+R)}}catch($){S.e($)}finally{S.f()}k.match(/^[\s\u200b]+$/)||g.push(k)}else g.push(y)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(` +`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var P=t.pstyle("text-max-width").pfValue,O="",D="…",B=!1;if(this.calculateLabelDimensions(t,i).widthP)break;O+=i[F],F===i.length-1&&(B=!0)}return B||(O+=D),O}return i};mf.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?KJt(r):"center":e};mf.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,U=e.split(` +`),y=U.length,b=0,v=0,w=0;w1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Vt=a(Y);_e&&(t.hoverData.tapholdCancelled=!0);var Lt=function(){var bt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];bt.length===0?(bt.push(Fe[0]),bt.push(Fe[1])):(bt[0]+=Fe[0],bt[1]+=Fe[1])};ue=!0,i(je,["mousemove","vmousemove","tapdrag"],Y,{x:Ae[0],y:Ae[1]});var dt=function(bt){return{originalEvent:Y,type:bt,position:{x:Ae[0],y:Ae[1]}}},ve=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit(dt("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(_e){var It=dt("cxtdrag");Ze?Ze.emit(It):X.emit(It),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||je!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(dt("cxtdragout")),t.hoverData.cxtOver=je,je&&je.emit(dt("cxtdragover")))}}else if(t.hoverData.dragging){if(ue=!0,X.panningEnabled()&&X.userPanningEnabled()){var xt;if(t.hoverData.justStartedPan){var mt=t.hoverData.mdownPos;xt={x:(Ae[0]-mt[0])*fe,y:(Ae[1]-mt[1])*fe},t.hoverData.justStartedPan=!1}else xt={x:Fe[0]*fe,y:Fe[1]*fe};X.panBy(xt),X.emit(dt("dragpan")),t.hoverData.dragged=!0}Ae=t.projectIntoViewport(Y.clientX,Y.clientY)}else if(Ne[4]==1&&(Ze==null||Ze.pannable())){if(_e){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(Vt||!X.panningEnabled()||!X.userPanningEnabled()))ve();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Mt=s(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=Fy(Me),t.redrawHint("select",!0),t.redraw())}Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate()}}else{if(Ze&&Ze.pannable()&&Ze.active()&&Ze.unactivate(),(!Ze||!Ze.grabbed())&&je!=De&&(De&&i(De,["mouseout","tapdragout"],Y,{x:Ae[0],y:Ae[1]}),je&&i(je,["mouseover","tapdragover"],Y,{x:Ae[0],y:Ae[1]}),t.hoverData.last=je),Ze)if(_e){if(X.boxSelectionEnabled()&&Vt)Ze&&Ze.grabbed()&&(m(at),Ze.emit(dt("freeon")),at.emit(dt("free")),t.dragData.didDrag&&(Ze.emit(dt("dragfreeon")),at.emit(dt("dragfree")))),ve();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var Or=!t.dragData.didDrag;Or&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(at,{inDragLayer:!0});var Se={x:0,y:0};if(Jt(Fe[0])&&Jt(Fe[1])&&(Se.x+=Fe[0],Se.y+=Fe[1],Or)){var it=t.hoverData.dragDelta;it&&Jt(it[0])&&Jt(it[1])&&(Se.x+=it[0],Se.y+=it[1])}t.hoverData.draggingEles=!0,at.silentShift(Se).emit(dt("position")).emit(dt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Lt();ue=!0}if(Ne[2]=Ae[0],Ne[3]=Ae[1],ue)return Y.stopPropagation&&Y.stopPropagation(),Y.preventDefault&&Y.preventDefault(),!1}},!1);var A,R,_;t.registerBinding(e,"mouseup",function(Y){if(!(t.hoverData.which===1&&Y.which!==1&&t.hoverData.capture)){var Q=t.hoverData.capture;if(Q){t.hoverData.capture=!1;var ue=t.cy,X=t.projectIntoViewport(Y.clientX,Y.clientY),fe=t.selection,ee=t.findNearestElement(X[0],X[1],!0,!1),Ae=t.dragData.possibleDragElements,Me=t.hoverData.down,Ke=a(Y);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Me&&Me.unactivate();var Ne=function(gt){return{originalEvent:Y,type:gt,position:{x:X[0],y:X[1]}}};if(t.hoverData.which===3){var je=Ne("cxttapend");if(Me?Me.emit(je):ue.emit(je),!t.hoverData.cxtDragged){var De=Ne("cxttap");Me?Me.emit(De):ue.emit(De)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ee,["mouseup","tapend","vmouseup"],Y,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Me,["click","tap","vclick"],Y,{x:X[0],y:X[1]}),R=!1,Y.timeStamp-_<=ue.multiClickDebounceTime()?(A&&clearTimeout(A),R=!0,_=null,i(Me,["dblclick","dbltap","vdblclick"],Y,{x:X[0],y:X[1]})):(A=setTimeout(function(){R||i(Me,["oneclick","onetap","voneclick"],Y,{x:X[0],y:X[1]})},ue.multiClickDebounceTime()),_=Y.timeStamp)),Me==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(Y)&&(ue.$(r).unselect(["tapunselect"]),Ae.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Ae=ue.collection()),ee==Me&&!t.dragData.didDrag&&!t.hoverData.selecting&&ee!=null&&ee._private.selectable&&(t.hoverData.dragging||(ue.selectionType()==="additive"||Ke?ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]):Ke||(ue.$(r).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=ue.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),ue.emit(Ne("boxend"));var Fe=function(gt){return gt.selectable()&&!gt.selected()};ue.selectionType()==="additive"||Ke||ue.$(r).unmerge(Ze).unselect(),Ze.emit(Ne("box")).stdFilter(Fe).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!fe[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var at=Me&&Me.grabbed();m(Ae),at&&(Me.emit(Ne("freeon")),Ae.emit(Ne("free")),t.dragData.didDrag&&(Me.emit(Ne("dragfreeon")),Ae.emit(Ne("dragfree"))))}}fe[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=[],L=4,I,P=1e5,O=function(Y){for(var Q=Math.abs(Y[0]),ue=1;ue=L){I=!1;var X=N;if(X[0]>=5){var fe;O(X)?fe=X[0]:fe=EKt(X),fe>1&&(I=!0,P=fe)}}else N.push(Math.abs(ue)),Q=!0;else I&&(P=Math.min(Math.abs(ue),P));if(!t.scrollingPage){var ee=t.cy,Ae=ee.zoom(),Me=ee.pan(),Ke=t.projectIntoViewport(Y.clientX,Y.clientY),Ne=[Ke[0]*Ae+Me.x,Ke[1]*Ae+Me.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C()){Y.preventDefault();return}if(ee.panningEnabled()&&ee.userPanningEnabled()&&ee.zoomingEnabled()&&ee.userZoomingEnabled()){Y.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var je;Q&&Math.abs(ue)>5&&(ue=hre(ue)*5),je=ue/-250,I&&(je/=P,je*=3),je=je*t.wheelSensitivity;var De=Y.deltaMode===1;De&&(je*=33);var Ze=ee.zoom()*Math.pow(10,je);Y.type==="gesturechange"&&(Ze=t.gestureStartZoom*Y.scale),ee.zoom({level:Ze,renderedPosition:{x:Ne[0],y:Ne[1]}}),ee.emit({type:Y.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:Y,position:{x:Ke[0],y:Ke[1]}})}}}};t.registerBinding(t.container,"wheel",D,!0),t.registerBinding(e,"scroll",function(Y){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(Y){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||Y.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||D(re)},!0),t.registerBinding(t.container,"mouseout",function(Y){var Q=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseout",position:{x:Q[0],y:Q[1]}})},!1),t.registerBinding(t.container,"mouseover",function(Y){var Q=t.projectIntoViewport(Y.clientX,Y.clientY);t.cy.emit({originalEvent:Y,type:"mouseover",position:{x:Q[0],y:Q[1]}})},!1);var B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie=function(Y,Q,ue,X){return Math.sqrt((ue-Y)*(ue-Y)+(X-Q)*(X-Q))},me=function(Y,Q,ue,X){return(ue-Y)*(ue-Y)+(X-Q)*(X-Q)},te;t.registerBinding(t.container,"touchstart",te=function(Y){if(t.hasTouchStarted=!0,!!S(Y)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var Q=t.cy,ue=t.touchData.now,X=t.touchData.earlier;if(Y.touches[0]){var fe=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);ue[0]=fe[0],ue[1]=fe[1]}if(Y.touches[1]){var fe=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);ue[2]=fe[0],ue[3]=fe[1]}if(Y.touches[2]){var fe=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);ue[4]=fe[0],ue[5]=fe[1]}var ee=function(Vt){return{originalEvent:Y,type:Vt,position:{x:ue[0],y:ue[1]}}};if(Y.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var Ae=t.findContainerClientCoords();W=Ae[0],oe=Ae[1],Z=Ae[2],J=Ae[3],B=Y.touches[0].clientX-W,F=Y.touches[0].clientY-oe,z=Y.touches[1].clientX-W,$=Y.touches[1].clientY-oe,ne=0<=B&&B<=Z&&0<=z&&z<=Z&&0<=F&&F<=J&&0<=$&&$<=J;var Me=Q.pan(),Ke=Q.zoom();V=ie(B,F,z,$),H=me(B,F,z,$),G=[(B+z)/2,(F+$)/2],K=[(G[0]-Me.x)/Ke,(G[1]-Me.y)/Ke];var Ne=200,je=Ne*Ne;if(H=1){for(var Le=t.touchData.startPosition=[null,null,null,null,null,null],kt=0;kt=t.touchTapThreshold2}if(Q&&t.touchData.cxt){Y.preventDefault();var kt=Y.touches[0].clientX-W,Et=Y.touches[0].clientY-oe,ot=Y.touches[1].clientX-W,Vt=Y.touches[1].clientY-oe,Lt=me(kt,Et,ot,Vt),dt=Lt/H,ve=150,It=ve*ve,xt=1.5,mt=xt*xt;if(dt>=mt||Lt>=It){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=Ke("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):X.emit(Mt)}}if(Q&&t.touchData.cxt){var Mt=Ke("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):X.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Or=t.findNearestElement(fe[0],fe[1],!0,!0);(!t.touchData.cxtOver||Or!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ke("cxtdragout")),t.touchData.cxtOver=Or,Or&&Or.emit(Ke("cxtdragover")))}else if(Q&&Y.touches[2]&&X.boxSelectionEnabled())Y.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit(Ke("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ue[4]=1,!ue||ue.length===0||ue[0]===void 0?(ue[0]=(fe[0]+fe[2]+fe[4])/3,ue[1]=(fe[1]+fe[3]+fe[5])/3,ue[2]=(fe[0]+fe[2]+fe[4])/3+1,ue[3]=(fe[1]+fe[3]+fe[5])/3+1):(ue[2]=(fe[0]+fe[2]+fe[4])/3,ue[3]=(fe[1]+fe[3]+fe[5])/3),t.redrawHint("select",!0),t.redraw();else if(Q&&Y.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){Y.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Se=t.dragData.touchDragEles;if(Se){t.redrawHint("drag",!0);for(var it=0;it0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Pe;t.registerBinding(e,"touchcancel",Pe=function(Y){var Q=t.touchData.start;t.touchData.capture=!1,Q&&Q.unactivate()});var Ve,ce,he,we;if(t.registerBinding(e,"touchend",Ve=function(Y){var Q=t.touchData.start,ue=t.touchData.capture;if(ue)Y.touches.length===0&&(t.touchData.capture=!1),Y.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var fe=t.cy,ee=fe.zoom(),Ae=t.touchData.now,Me=t.touchData.earlier;if(Y.touches[0]){var Ke=t.projectIntoViewport(Y.touches[0].clientX,Y.touches[0].clientY);Ae[0]=Ke[0],Ae[1]=Ke[1]}if(Y.touches[1]){var Ke=t.projectIntoViewport(Y.touches[1].clientX,Y.touches[1].clientY);Ae[2]=Ke[0],Ae[3]=Ke[1]}if(Y.touches[2]){var Ke=t.projectIntoViewport(Y.touches[2].clientX,Y.touches[2].clientY);Ae[4]=Ke[0],Ae[5]=Ke[1]}var Ne=function(It){return{originalEvent:Y,type:It,position:{x:Ae[0],y:Ae[1]}}};Q&&Q.unactivate();var je;if(t.touchData.cxt){if(je=Ne("cxttapend"),Q?Q.emit(je):fe.emit(je),!t.touchData.cxtDragged){var De=Ne("cxttap");Q?Q.emit(De):fe.emit(De)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!Y.touches[2]&&fe.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=fe.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),fe.emit(Ne("boxend"));var Fe=function(It){return It.selectable()&&!It.selected()};Ze.emit(Ne("box")).stdFilter(Fe).select().emit(Ne("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(Q!=null&&Q.unactivate(),Y.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!Y.touches[1]){if(!Y.touches[0]){if(!Y.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(Q!=null){var _e=Q._private.grabbed;m(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),_e&&(Q.emit(Ne("freeon")),at.emit(Ne("free")),t.dragData.didDrag&&(Q.emit(Ne("dragfreeon")),at.emit(Ne("dragfree")))),i(Q,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Ae[0],y:Ae[1]}),Q.unactivate(),t.touchData.start=null}else{var gt=t.findNearestElement(Ae[0],Ae[1],!0,!0);i(gt,["touchend","tapend","vmouseup","tapdragout"],Y,{x:Ae[0],y:Ae[1]})}var Le=t.touchData.startPosition[0]-Ae[0],kt=Le*Le,Et=t.touchData.startPosition[1]-Ae[1],ot=Et*Et,Vt=kt+ot,Lt=Vt*ee*ee;t.touchData.singleTouchMoved||(Q||fe.$(":selected").unselect(["tapunselect"]),i(Q,["tap","vclick"],Y,{x:Ae[0],y:Ae[1]}),ce=!1,Y.timeStamp-we<=fe.multiClickDebounceTime()?(he&&clearTimeout(he),ce=!0,we=null,i(Q,["dbltap","vdblclick"],Y,{x:Ae[0],y:Ae[1]})):(he=setTimeout(function(){ce||i(Q,["onetap","voneclick"],Y,{x:Ae[0],y:Ae[1]})},fe.multiClickDebounceTime()),we=Y.timeStamp)),Q!=null&&!t.dragData.didDrag&&Q._private.selectable&&Lt"u"){var ge=[],ze=function(Y){return{clientX:Y.clientX,clientY:Y.clientY,force:1,identifier:Y.pointerId,pageX:Y.pageX,pageY:Y.pageY,radiusX:Y.width/2,radiusY:Y.height/2,screenX:Y.screenX,screenY:Y.screenY,target:Y.target}},xe=function(Y){return{event:Y,touch:ze(Y)}},Ee=function(Y){ge.push(xe(Y))},qe=function(Y){for(var Q=0;Q0)return $[0]}return null},g=Object.keys(f),m=0;m0?p:uDe(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?a1(i,a):l;var u=2*l;if(F0(e,r,this.points,s,o,i,a-u,[0,-1],n)||F0(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!!(mc(e,r,f)||mU(e,r,u,u,s+i/2-l,o+a/2-l,n)||mU(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};gp.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",vl(3,0)),this.generateRoundPolygon("round-triangle",vl(3,0)),this.generatePolygon("rectangle",vl(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",vl(5,0)),this.generateRoundPolygon("round-pentagon",vl(5,0)),this.generatePolygon("hexagon",vl(6,0)),this.generateRoundPolygon("round-hexagon",vl(6,0)),this.generatePolygon("heptagon",vl(7,0)),this.generateRoundPolygon("round-heptagon",vl(7,0)),this.generatePolygon("octagon",vl(8,0)),this.generateRoundPolygon("round-octagon",vl(8,0));var n=new Array(20);{var i=Vj(5,0),a=Vj(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*w)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(v>=e.deqNoDrawCost*xV)break;var T=e.deq(n,U,m);if(T.length>0)for(var k=0;k0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,U,m)&&a())},o=e.priority||lre;i.beforeRender(s,o(n))}}}},fer=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ZI;L1(this,t),this.idsByKey=new c0,this.keyForId=new c0,this.cachesByLvl=new c0,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return I1(t,[{key:"getIdsFor",value:function(r){r==null&&ca("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new h9,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 c0,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}}])})(),Rme=25,WE=50,bM=-4,rY=3,gOe=7.99,per=8,ger=1024,mer=1024,Uer=1024,yer=.2,ber=.8,ver=10,xer=.15,wer=.1,Ter=.9,Cer=.9,ker=100,Ser=1,Vy={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Eer=Po({getKey:null,doesEleInvalidateKey:ZI,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:rDe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ax=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=Eer(r);Gr(n,i),n.lookup=new fer(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},Vs=ax.prototype;Vs.reasons=Vy;Vs.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Vs.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};Vs.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new kk(function(r,n){return n.reqs-r.reqs});return e};Vs.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Vs.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(ure(o*r))),n=gOe||n>rY)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<=Rme?g=Rme:h<=WE?g=WE:g=Math.ceil(h/WE)*WE,h>Uer||d>mer)return null;var m=a.getTextureQueue(g),U=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};U||(U=m[m.length-1]),U||(U=y()),U.width-U.usedWidthn;R--)E=a.getElement(t,e,r,R,Vy.downscale);A()}else return a.queueElement(t,k.level-1),k;else{var _;if(!v&&!w&&!T)for(var N=n-1;N>=bM;N--){var L=l.get(t,N);if(L){_=L;break}}if(b(_))return a.queueElement(t,n),_;U.context.translate(U.usedWidth,0),U.context.scale(u,u),this.drawElement(U.context,t,e,f,!1),U.context.scale(1/u,1/u),U.context.translate(-U.usedWidth,0)}return p={x:U.usedWidth,texture:U,level:n,scale:u,width:d,height:h,scaledLabelShown:f},U.usedWidth+=Math.ceil(d+per),U.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(U),p};Vs.invalidateElements=function(t){for(var e=0;e=yer*t.width&&this.retireTexture(t)};Vs.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>ber&&t.fullnessChecks>=ver?i1(r,t):t.fullnessChecks++};Vs.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;i1(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,cre(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),i1(i,s),n.push(s),s}};Vs.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}};Vs.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,Vy.dequeue)}return i};Vs.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=ore,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};Vs.onDequeue=function(t){this.onDequeues.push(t)};Vs.offDequeue=function(t){i1(this.onDequeues,t)};Vs.setupDequeueing=pOe.setupDequeueing({deqRedrawThreshold:ker,deqCost:xer,deqAvgCost:wer,deqNoDrawCost:Ter,deqFastCost:Cer,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=Mer||r>aN)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 A=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},R=function(I){if(!p)for(var P=r+I;sw<=P&&P<=aN&&!A(P);P+=I);};R(1),R(-1);for(var _=h.length-1;_>=0;_--){var N=h[_];N.invalid&&i1(h,N)}};if(!f)g();else return h;var m=function(){if(!d){d=Gl();for(var A=0;AIme||N>Ime)return null;var L=_*N;if(L>Per)return null;var I=n.makeLayer(d,r);if(R!=null){var P=h.indexOf(R)+1;h.splice(P,0,I)}else(A.insert===void 0||A.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var y=null,b=t.length/Aer,v=!o,w=0;w=b||!cDe(y.bb,T.boundingBox()))&&(y=U({insert:!0,after:y}),!y))return null;p||v?n.queueLayer(y,T):n.drawEleInLayer(y,T,r,e),y.eles.push(T),C[r]=y}return p||(v?null:h)};Bo.getEleLevelForLayerLevel=function(t,e){return t};Bo.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,Ber),a.setImgSmoothing(s,!0))};Bo.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};Bo.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};Bo.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=$0(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};Bo.invalidateLayer=function(t){if(this.lastInvalidationTime=$0(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];i1(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,U=e.pstyle("line-outline-color").value,y=u*h,b=u*h,v=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,I),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,I),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,U[0],U[1],U[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")},T=function(){i&&s.drawEdgeOverlay(t,e)},k=function(){i&&s.drawEdgeUnderlay(t,e)},C=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,I)},S=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var E=e.pstyle("ghost").value==="yes";if(E){var A=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,N=y*_;t.translate(A,R),v(N),C(N),t.translate(-A,-R)}else w();k(),v(),C(),T(),S(),r&&t.translate(l.x1,l.y1)}};var yOe=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")}}}};mp.drawEdgeOverlay=yOe("overlay");mp.drawEdgeUnderlay=yOe("underlay");mp.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)};_5.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 Xer(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 _me(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()}_5.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=Cl(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};_5.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=Cl(s,"labelX",r),u=Cl(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=Cl(s,"labelWidth",r),m=Cl(s,"labelHeight",r),U=Cl(s,"labelActualDescent",r),y=e.pstyle(p+"text-margin-x").pfValue,b=e.pstyle(p+"text-margin-y").pfValue,v=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;v&&(w="center",T="center"),l+=y,u+=b;var k;n?k=this.getTextAngle(e,r):k=0,k!==0&&(h=l,d=u,t.translate(h,d),t.rotate(k),l=0,u=0);var C=p4(w),S=g4(T);switch(S){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var E=e.pstyle("text-background-opacity").value,A=e.pstyle("text-border-opacity").value,R=e.pstyle("text-border-width").pfValue,_=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,L=N==="round-rectangle"||N==="roundrectangle",I=N==="circle",P=2;if(E>0||R>0&&A>0){var O=t.fillStyle,D=t.strokeStyle,B=t.lineWidth,F=e.pstyle("text-background-color").value,z=e.pstyle("text-border-color").value,$=e.pstyle("text-border-style").value,V=E>0,H=R>0&&A>0,G=l-_;switch(C){case"left":G-=g;break;case"center":G-=g/2;break}var K=u-m-_,W=g+2*_,oe=m+2*_;if(V&&(t.fillStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(E*o,")")),H&&(t.strokeStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(A*o,")"),t.lineWidth=R,t.setLineDash))switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=R/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(L?(t.beginPath(),_me(t,G,K,W,oe,P)):I?(t.beginPath(),Xer(t,G,K,W,oe)):(t.beginPath(),t.rect(G,K,W,oe)),V&&t.fill(),H&&t.stroke(),H&&$==="double"){var Z=R/2;t.beginPath(),L?_me(t,G+Z,K+Z,W-2*Z,oe-2*Z,P):t.rect(G+Z,K+Z,W-2*Z,oe-2*Z),t.stroke()}t.fillStyle=O,t.strokeStyle=D,t.lineWidth=B,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),u-=U,e.pstyle("text-wrap").value==="wrap"){var ne=Cl(s,"labelWrapCachedLines",r),ie=Cl(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))),S){case"top":u-=(ne.length-1)*ie;break;case"center":case"bottom":u-=(ne.length-1)*ie;break}for(var Re=0;Re0&&t.strokeText(ne[Re],l,u),t.fillText(ne[Re],l,u),u+=ie}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);k!==0&&(t.rotate(-k),t.translate(-h,-d))}}};var D1={};D1.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(!(!Jt(d.x)||!Jt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,U=e.padding();o=e.width()+2*U,l=e.height()+2*U;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),v=b.value,w=new Array(v.length),T=new Array(v.length),k=0,C=0;C0&&arguments[0]!==void 0?arguments[0]:N;s.eleFillStyle(t,e,Q)},Z=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;s.colorStrokeStyle(t,L[0],L[1],L[2],Q)},J=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;s.colorStrokeStyle(t,V[0],V[1],V[2],Q)},ne=function(Q,ue,X,fe){var ee=s.nodePathCache=s.nodePathCache||[],Ae=tDe(X==="polygon"?X+","+fe.join(","):X,""+ue,""+Q,""+W),Me=ee[Ae],Ke,Ne=!1;return Me!=null?(Ke=Me,Ne=!0,h.pathCache=Ke):(Ke=new Path2D,ee[Ae]=h.pathCache=Ke),{path:Ke,cacheHit:Ne}},ie=e.pstyle("shape").strValue,me=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var te=ne(o,l,ie,me);g=te.path,m=te.cacheHit}var Re=function(){if(!m){var Q=d;p&&(Q={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,Q.x,Q.y,o,l,W,h)}p?t.fill(g):t.fill()},Pe=function(){for(var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,X=u.backgrounding,fe=0,ee=0;ee0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ue),Q&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,W,h)))},ce=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=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,W,h),t.clip()),s.drawStripe(t,e,ue),t.restore(),Q&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,W,h)))},he=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(R>0?R:-R)*Q,X=R>0?0:255;R!==0&&(s.colorFillStyle(t,X,X,X,ue),p?t.fill(g):t.fill())},we=function(){if(_>0){if(t.lineWidth=_,t.lineCap=O,t.lineJoin=P,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=F;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var Q=new Path2D;Q.rect(-o/2-_,-l/2-_,o+2*_,l+2*_),Q.addPath(g),t.clip(Q,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=_/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},ge=function(){if($>0){if(t.lineWidth=$,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Q=d;p&&(Q={x:0,y:0});var ue=s.getNodeShape(e),X=_;D==="inside"&&(X=0),D==="outside"&&(X*=2);var fe=(o+X+($+K))/o,ee=(l+X+($+K))/l,Ae=o*fe,Me=l*ee,Ke=s.nodeShapes[ue].points,Ne;if(p){var je=ne(Ae,Me,ue,Ke);Ne=je.path}if(ue==="ellipse")s.drawEllipsePath(Ne||t,Q.x,Q.y,Ae,Me);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var De=0,Ze=0,Fe=0;ue==="round-diamond"?De=(X+K+$)*1.4:ue==="round-heptagon"?(De=(X+K+$)*1.075,Fe=-(X/2+K+$)/35):ue==="round-hexagon"?De=(X+K+$)*1.12:ue==="round-pentagon"?(De=(X+K+$)*1.13,Fe=-(X/2+K+$)/15):ue==="round-tag"?(De=(X+K+$)*1.12,Ze=(X/2+$+K)*.07):ue==="round-triangle"&&(De=(X+K+$)*(Math.PI/2),Fe=-(X+K/2+$)/Math.PI),De!==0&&(fe=(o+De)/o,Ae=o*fe,["round-hexagon","round-tag"].includes(ue)||(ee=(l+De)/l,Me=l*ee)),W=W==="auto"?dDe(Ae,Me):W;for(var at=Ae/2,_e=Me/2,gt=W+(X+$+K)/2,Le=new Array(Ke.length/2),kt=new Array(Ke.length/2),Et=0;Et0){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()}}}};D1.drawNodeOverlay=bOe("overlay");D1.drawNodeUnderlay=bOe("underlay");D1.hasPie=function(t){return t=t[0],t._private.hasPie};D1.hasStripe=function(t){return t=t[0],t._private.hasStripe};D1.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 U=1;U<=i.pieBackgroundN;U++){var y=e.pstyle("pie-"+U+"-background-size").value,b=e.pstyle("pie-"+U+"-background-color").value,v=e.pstyle("pie-"+U+"-background-opacity").value*r,w=y/100;w+g>1&&(w=1-g);var T=1.5*Math.PI+2*Math.PI*g;T+=o;var k=2*Math.PI*w,C=T+k;y===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,T,C),t.closePath()):(t.beginPath(),t.arc(l,u,f,T,C),t.arc(l,u,p,C,T,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],v),t.fill(),g+=w)}};D1.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 U=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,v=U/100;v+u>1&&(v=1-u),!(U===0||u>=1||u+v>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*v),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=v)}t.restore()};var Ql={},Ker=100;Ql.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};Ql.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 b=r.style(),v=r.zoom(),w=s!==void 0?s:v,T=r.pan(),k={x:T.x,y:T.y},C={zoom:v,pan:{x:T.x,y:T.y}},S=e.prevViewport,E=S===void 0||C.zoom!==S.zoom||C.pan.x!==S.pan.x||C.pan.y!==S.pan.y;!E&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(k=o),w*=l,k.x*=l,k.y*=l;var A=e.getCachedZSortedEles();function R(Z,J,ne,ie,me){var te=Z.globalCompositeOperation;Z.globalCompositeOperation="destination-out",e.colorFillStyle(Z,255,255,255,e.motionBlurTransparency),Z.fillRect(J,ne,ie,me),Z.globalCompositeOperation=te}function _(Z,J){var ne,ie,me,te;!e.clearingMotionBlur&&(Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||Z===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ne={x:T.x*p,y:T.y*p},ie=v*p,me=e.canvasWidth*p,te=e.canvasHeight*p):(ne=k,ie=w,me=e.canvasWidth,te=e.canvasHeight),Z.setTransform(1,0,0,1,0,0),J==="motionBlur"?R(Z,0,0,me,te):!n&&(J===void 0||J)&&Z.clearRect(0,0,me,te),i||(Z.translate(ne.x,ne.y),Z.scale(ie,ie)),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 L=u.contexts[e.NODE],I=e.textureCache.texture,C=e.textureCache.viewport;L.setTransform(1,0,0,1,0,0),f?R(L,0,0,C.width,C.height):L.clearRect(0,0,C.width,C.height);var P=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(L,P[0],P[1],P[2],O),L.fillRect(0,0,C.width,C.height);var v=r.zoom();_(L,!1),L.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),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 D=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),F=e.hideEdgesOnViewport&&B,z=[];if(z[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,z[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),z[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,z[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||z[e.NODE]){var $=f&&!z[e.NODE]&&p!==1,L=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),V=f&&!$?"motionBlur":void 0;_(L,V),F?e.drawCachedNodes(L,A.nondrag,l,D):e.drawLayeredElements(L,A.nondrag,l,D),e.debug&&e.drawDebugPoints(L,A.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||z[e.DRAG])){var $=f&&!z[e.DRAG]&&p!==1,L=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);_(L,f&&!$?"motionBlur":void 0),F?e.drawCachedNodes(L,A.drag,l,D):e.drawCachedElements(L,A.drag,l,D),e.debug&&e.drawDebugPoints(L,A.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,_),f&&p!==1){var H=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],K=u.contexts[e.DRAG],W=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],oe=function(J,ne,ie){J.setTransform(1,0,0,1,0,0),ie||!y?J.clearRect(0,0,e.canvasWidth,e.canvasHeight):R(J,0,0,e.canvasWidth,e.canvasHeight);var me=p;J.drawImage(ne,0,0,e.canvasWidth*me,e.canvasHeight*me,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||z[e.NODE])&&(oe(H,G,z[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||z[e.DRAG])&&(oe(K,W,z[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()},Ker)),n||r.emit("render")};var o3;Ql.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),U="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",!o3){var y=h.measureText(U);o3=y.actualBoundingBoxAscent}h.fillText(U,0,o3);var b=60;h.strokeRect(0,o3+10,250,20),h.fillRect(0,o3+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function Pme(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 Zer(t,e,r){var n=Pme(t,t.VERTEX_SHADER,e),i=Pme(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 Jer(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 Ere(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 Qer(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function etr(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 ttr(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 rtr(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 ntr(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function itr(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 vOe(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 xOe(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function atr(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 str(t,e,r,n){var i=vOe(t,e),a=is(i,2),s=a[0],o=a[1],l=xOe(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 id(t,e,r,n){var i=vOe(t,r),a=is(i,3),s=a[0],o=a[1],l=a[2],u=xOe(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(v,w){if(i&&w){var T=w.context,k=v.x,C=v.row,S=k,E=l*C;T.save(),T.translate(S,E),T.scale(h,h),i(T,n),T.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++)},U=function(){var v=a.scratch,w=a.canvas;v.clear(),p({x:0,row:0},v);var T=s-a.freePointer.x,k=d-T,C=l;{var S=a.freePointer.x,E=a.freePointer.row*l,A=T;w.context.drawImage(v,0,0,A,C,S,E,A,C),g[0]={x:S,y:E,w:A,h:f}}{var R=T,_=(a.freePointer.row+1)*l,N=k;w&&w.context.drawImage(v,R,0,N,C,0,_,N,C),g[1]={x:0,y:_,w:N,h:f}}a.freePointer.x=k,a.freePointer.row++},y=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?(y(),m()):this.enableWrapping?U():(y(),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=vc(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var U=vc(this.renderTypes.values()),y;try{var b=function(){var w=y.value,T=w.type;if(h(T)){var k=n.collections.get(w.collection),C=w.getKey(m),S=Array.isArray(C)?C:[C];if(s)S.forEach(function(_){return k.markKeyForGC(_)}),f=!0;else{var E=w.getID?w.getID(m):m.id(),A=n._key(T,E),R=n.typeAndIdToKey.get(A);R!==void 0&&!rtr(S,R)&&(d=!0,n.typeAndIdToKey.delete(A),R.forEach(function(_){return k.markKeyForGC(_)}))}}};for(U.s();!(y=U.n()).done;)b()}catch(v){U.e(v)}finally{U.f()}}}}catch(v){p.e(v)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=vc(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=is(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=vc(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=is(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}}])})(),gtr=(function(){function t(e){L1(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return I1(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}}])})(),mtr=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,Yer=` +`,Utr=` 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); } -`,Xer=` +`,ytr=` 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; } -`,Ker=` +`,btr=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -3118,7 +3251,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,nE={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},nN={IGNORE:1,USE_BB:2},bH=0,L1e=1,I1e=2,xH=3,_2=4,GM=5,sk=6,ak=7,Zer=(function(){function t(e,r,n){Rm(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=Rer,this.atlasManager=new qer(e,n),this.batchManager=new Uer(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(nE.SCREEN),this.pickingProgram=this._createShaderProgram(nE.PICKING),this.vao=this._createVAO()}return _m(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,s=this.atlasManager;return i?s.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):s.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,ow={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},sN={IGNORE:1,USE_BB:2},CV=0,zme=1,Vme=2,kV=3,N2=4,qE=5,l3=6,c3=7,vtr=(function(){function t(e,r,n){L1(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=Jer,this.atlasManager=new ptr(e,n),this.batchManager=new gtr(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(ow.SCREEN),this.pickingProgram=this._createShaderProgram(ow.PICKING),this.vao=this._createVAO()}return I1(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; @@ -3165,7 +3298,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(bH,`) { + if(aVertType == `.concat(CV,`) { float texX = aTex.x; // texture coordinates float texY = aTex.y; float texW = aTex.z; @@ -3183,8 +3316,8 @@ 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(_2," || aVertType == ").concat(ak,` - || aVertType == `).concat(GM," || aVertType == ").concat(sk,`) { // simple shapes + else if(aVertType == `).concat(N2," || aVertType == ").concat(c3,` + || aVertType == `).concat(qE," || aVertType == ").concat(l3,`) { // simple shapes // the bounding box is needed by the fragment shader vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat @@ -3199,7 +3332,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(L1e,`) { + else if(aVertType == `).concat(zme,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -3214,7 +3347,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(I1e,`) { + else if(aVertType == `).concat(Vme,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -3263,7 +3396,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js vColor = aColor; } - else if(aVertType == `).concat(xH,` && vid < 3) { + else if(aVertType == `).concat(kV,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); @@ -3283,11 +3416,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js vVertType = aVertType; vIndex = aIndex; } - `),s=this.batchManager.getIndexArray(),a=`#version 300 es + `),a=this.batchManager.getIndexArray(),s=`#version 300 es precision highp float; // declare texture unit for each texture atlas in the batch - `.concat(s.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(` + `.concat(a.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(` `),` uniform vec4 uBGColor; @@ -3308,10 +3441,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js out vec4 outColor; - `).concat(jer,` - `).concat(Yer,` - `).concat(Xer,` - `).concat(Ker,` + `).concat(mtr,` + `).concat(Utr,` + `).concat(ytr,` + `).concat(btr,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -3327,21 +3460,21 @@ https://github.com/jquery/jquery/blob/master/src/event.js } void main(void) { - if(vVertType == `).concat(bH,`) { + if(vVertType == `).concat(CV,`) { // look up the texel from the texture unit - `).concat(s.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` + `).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` } - else if(vVertType == `).concat(xH,`) { + else if(vVertType == `).concat(kV,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); outColor.a = 1.0; // make opaque, masks out line under arrow } - else if(vVertType == `).concat(_2,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border + else if(vVertType == `).concat(N2,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat(_2," || vVertType == ").concat(ak,` - || vVertType == `).concat(GM," || vVertType == ").concat(sk,`) { // use SDF + else if(vVertType == `).concat(N2," || vVertType == ").concat(c3,` + || vVertType == `).concat(qE," || vVertType == ").concat(l3,`) { // use SDF float outerBorder = vBorderWidth[0]; float innerBorder = vBorderWidth[1]; @@ -3352,11 +3485,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center float d; // signed distance - if(vVertType == `).concat(_2,`) { + if(vVertType == `).concat(N2,`) { d = rectangleSD(p, b); - } else if(vVertType == `).concat(ak,` && w == h) { + } else if(vVertType == `).concat(c3,` && w == h) { d = circleSD(p, b.x); // faster than ellipse - } else if(vVertType == `).concat(ak,`) { + } else if(vVertType == `).concat(c3,`) { d = ellipseSD(p, b); } else { d = roundRectangleSD(p, b, vCornerRadius.wzyx); @@ -3396,16 +3529,16 @@ https://github.com/jquery/jquery/blob/master/src/event.js `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),o=Mer(n,i,a);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]:nE.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 s=this.atlasManager,a=this.batchManager,o=s.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===nN.IGNORE)return;if(l==nN.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=s.getAtlasInfo(r,i),h=xc(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;a.canAddToCurrentBatch(p)||this.endBatch();for(var y=a.getAtlasIndexForBatch(p),v=0,b=[[g,!0],[m,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(R){h.e(R)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,s){var a=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),s){var l=s.bb,u=s.tex1,h=s.tex2,d=u.w/(u.w+h.w);a||(d=1-d);var f=this._getAdjustedBB(l,o,a,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,s){var a,o;R1e(r);var l=i.getRotation?i.getRotation(s):0;if(l!==0){var u=i.getRotationPoint(s),h=u.x,d=u.y;y9(r,r,[h,d]),_1e(r,r,l);var f=i.getRotationOffset(s);a=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else a=n.x1,o=n.y1;y9(r,r,[a,o]),Kj(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,s){var a=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(a-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*s;return i&&s<1?l=f:!i&&s<1&&(d=l-f,a+=d,l=f),{x1:a,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var s=this.atlasManager.getRenderTypeOpts(i),a=this.instanceCount;this.vertTypeBuffer.getView(a)[0]=_2;var o=this.indexBuffer.getView(a);R2(n,o);var l=this.colorBuffer.getView(a);a1([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(a);this.setTransformMatrix(r,u,s),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var s=this.simpleShapeOptions.get(i);if(this._isVisible(r,s)){var a=s.shapeProps,o=this._getVertTypeForShape(r,a.shape);if(o===void 0||s.isSimple&&!s.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===GM||o===sk){var u=s.getBoundingBox(r),h=this._getCornerRadius(r,a.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===sk&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);R2(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(a.opacity).value*p,m=r.pstyle(a.color).value,y=this.colorBuffer.getView(l);a1(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,a.border){var b=r.pstyle("border-width").value;if(b>0){var x=r.pstyle("border-color").value,T=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);a1(x,T,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-b;else if(S==="outside")v[0]=b,v[1]=0;else{var k=b/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,s),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 _2;case"ellipse":return ak;case"roundrectangle":case"round-rectangle":return GM;case"bottom-round-rectangle":return sk;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var s=i.w,a=i.h;if(r.pstyle(n).value==="auto")return nm(s,a);var o=r.pstyle(n).pfValue,l=s/2,u=a/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var s=r._private.rscratch,a,o,l;if(i==="source"?(a=s.arrowStartX,o=s.arrowStartY,l=s.srcArrowAngle):(a=s.arrowEndX,o=s.arrowEndY,l=s.tgtArrowAngle),!(isNaN(a)||a==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,b=this.transformBuffer.getMatrixView(v);R1e(b),y9(b,b,[a,o]),Kj(b,b,[y,y]),_1e(b,b,l),this.vertTypeBuffer.getView(v)[0]=xH;var x=this.indexBuffer.getView(v);R2(n,x);var T=this.colorBuffer.getView(v);a1(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 s=r.pstyle("opacity").value,a=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=s*a;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=L1e;var d=this.indexBuffer.getView(h);R2(n,d);var f=this.colorBuffer.getView(h);a1(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 s=this._getNumSegments(r);return this._getCurveSegmentPoints(i,s)}}},{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),s=0;s<=n;s++)if(s==0)i[0]=r[0],i[1]=r[1];else if(s==n)i[s*2]=r[r.length-2],i[s*2+1]=r[r.length-1];else{var a=s/n;this._setCurvePoint(r,a,i,s*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,s){if(r.length<=2)i[s]=r[0],i[s+1]=r[1];else{for(var a=Array(r.length-2),o=0;o0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?nN.USE_BB:nN.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:Ier,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:a("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:a("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:wH(e.getLabelKey,null),getBoundingBox:TH(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:wH(e.getSourceLabelKey,"source"),getBoundingBox:TH(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:s("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:wH(e.getTargetLabelKey,"target"),getBoundingBox:TH(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:s("target-label")});var u=w7(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()}),Jer(r)};function Qer(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return DNe(r)}function uDe(t,e){var r=t._private.rscratch;return kl(r,"labelWrapCachedLines",e)||[]}var wH=function(e,r){return function(n){var i=e(n),s=uDe(n,r);return s.length>1?s.map(function(a,o){return"".concat(i,"_").concat(o)}):i}},TH=function(e,r){return function(n,i){var s=e(n);if(typeof i=="string"){var a=i.indexOf("_");if(a>0){var o=Number(i.substring(a+1)),l=uDe(n,r),u=s.h/l.length,h=u*o,d=s.y1+h;return{x1:s.x1,w:s.w,y1:d,h:u,yOffset:h}}}return s}};function Jer(t){{var e=t.render;t.render=function(s){s=s||{};var a=t.cy;t.webgl&&(a.zoom()>rDe?(etr(t),e.call(t,s)):(ttr(t),dDe(t,s,nE.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(s){r.call(t,s),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(s,a,o,l){return otr(t,s,a)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(s,a){i.call(t,s,a),s==="viewport"||s==="bounds"?t.pickingFrameBuffer.needsDraw=!0:s==="background"&&t.drawing.invalidate(a,{type:"node-body"})}}}function etr(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function ttr(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 rtr(t){var e=t.canvasWidth,r=t.canvasHeight,n=bre(t),i=n.pan,s=n.zoom,a=vH();y9(a,a,[i.x,i.y]),Kj(a,a,[s,s]);var o=vH();Ver(o,e,r);var l=vH();return zer(l,o,a),l}function hDe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=bre(t),s=i.pan,a=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(s.x,s.y),e.scale(a,a)}function ntr(t,e){t.drawSelectionRectangle(e,function(r){return hDe(t,r)})}function itr(t){var e=t.data.contexts[t.NODE];e.save(),hDe(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 str(t){var e=function(i,s,a){for(var o=i.atlasManager.getAtlasCollection(s),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&T.add(k)}return T}function otr(t,e,r){var n=atr(t,e,r),i=t.getCachedZSortedEles(),s,a,o=xc(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!s&&h.isNode()&&(s=h),!a&&h.isEdge()&&(a=h),s&&a)break}}catch(d){o.e(d)}finally{o.f()}return[s,a].filter(Boolean)}function CH(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 dDe(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&ntr(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var a=t.data.contexts[t.WEBGL];r.screen?(a.clearColor(0,0,0,0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)):a.disable(a.BLEND),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.viewport(0,0,a.canvas.width,a.canvas.height);var o=rtr(t),l=t.getCachedZSortedEles();if(s=l.length,i.startFrame(o,r),r.screen){for(var u=0;u0&&a>0){p.clearRect(0,0,s,a),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,s,a),p.fill())}return f};function ltr(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),s=0;s"u"?"undefined":za(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};[iDe,mf,gp,vre,Nv,Im,Jl,cDe,Nm,A7,gDe].forEach(function(t){Wr(Sn,t)});var htr=[{name:"null",impl:GOe},{name:"base",impl:eDe},{name:"canvas",impl:ctr}],dtr=[{type:"layout",extensions:DJt},{type:"renderer",extensions:htr}],yDe={},vDe={};function bDe(t,e,r){var n=r,i=function(E){xi("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(X6.prototype[e])return i(e);X6.prototype[e]=r}else if(t==="collection"){if(No.prototype[e])return i(e);No.prototype[e]=r}else if(t==="layout"){for(var s=function(E){this.options=E,r.call(this,E),Jn(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},a=s.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==a.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 s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=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,b){s.call(this,b),this.estimatedSize=a.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(s.prototype);for(var m in s)g[m]=s[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,b){if(v==null&&b==null){var x=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(v.owner==b.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=b.owner?null:(T.source=v,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),b!=v&&b.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 b=v.edges.slice(),x,T=b.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(k,1),x.target!=x.source&&x.target.edges.splice(E,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,b,x,T,C=this.getNodes(),S=C.length,k=0;kb&&(y=b),v>x&&(v=x)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[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=a.MAX_VALUE,b=-a.MAX_VALUE,x=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,M=this.nodes,R=M.length,P=0;PC&&(v=C),bk&&(x=k),TC&&(v=C),bk&&(x=k),T=this.nodes.length){var R=0;b.forEach(function(P){P.owner==y&&R++}),R==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=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 s){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]=b,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=x,u[1]=b,L=!0)),-O===D?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=R,u[3]=M,I=!0)),L&&I)return!1;if(h>f?d>p?(B=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(B){case 1:F=m,V=h+-C/D,u[0]=V,u[1]=F;break;case 2:V=x,F=d+T*D,u[0]=V,u[1]=F;break;case 3:F=b,V=h+C/D,u[0]=V,u[1]=F;break;case 4:V=v,F=d+-T*D,u[0]=V,u[1]=F;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=R,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=M,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.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,b=h.y,x=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,M=void 0,R=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=b-y,E=m-v,M=v*y-m*b,R=C*E-S*k,R===0?null:(x=(k*M-E*A)/R,T=(S*A-C*M)/R,new s(x,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),x=0;x-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(v),x=0;x=0&&y.splice(M,1);var R=S.getNeighborsList();R.forEach(function(L){if(v.indexOf(L)<0){var I=b.get(L),$=I-1;$==1&&E.push(L),b.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(x=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(4);function a(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}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(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,b,x=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*b)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*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=x.length||C>=x[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){var s=(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;a(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)}},a.emit=function(o,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(A),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(R){return k.has(R)});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},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},A=0;A1){var L;for(L=0;LM&&(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))},C.radialLayout=function(k,E,A){var M=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,M);var R=x.calculateBounds(k),P=new T;P.setDeviceOrgX(R.getMinX()),P.setDeviceOrgY(R.getMinY()),P.setWorldOrgX(A.x),P.setWorldOrgY(A.y);for(var N=0;N1;){var G=H[0];H.splice(0,1);var W=D.indexOf(G);W>=0&&D.splice(W,1),V--,B--}E!=null?F=(D.indexOf(H[0])+1)%V:F=0;for(var K=Math.abs(M-A)/B,q=F;z!=B;q=++q%V){var oe=D[q].getOtherEnd(k);if(oe!=E){var Z=(A+z*K)%360,Q=(Z+K)%360;C.branchRadialLayout(oe,k,Z,Q,R+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,A=0;AE&&(E=R)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var A=[],M=this.graphManager.getAllNodes(),R=0;R"u"&&(E[L]=[]),E[L]=E[L].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),D=new u(k.graphManager);D.id=$,D.paddingLeft=O.paddingLeft||0,D.paddingRight=O.paddingRight||0,D.paddingBottom=O.paddingBottom||0,D.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=D;var B=k.getGraphManager().add(k.newGraph(),D),z=O.getChild();z.add(D);for(var V=0;V=0;k--){var E=this.compoundOrder[k],A=E.id,M=E.paddingLeft,R=E.paddingTop;this.adjustLocations(this.tiledMemberPack[A],E.rect.x,E.rect.y,M,R)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(A){var M=k.idToDummyNode[A],R=M.paddingLeft,P=M.paddingTop;k.adjustLocations(E[A],M.rect.x,M.rect.y,R,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var A=k.getChild();if(A==null)return this.toBeTiled[E]=!1,!1;for(var M=A.getNodes(),R=0;R0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),A=0,M=0;MI&&(I=O.rect.height)}A+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var A=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(M){var R=E[M];A.tiledMemberPack[M]=A.tileNodes(k[M],R.paddingLeft+R.paddingRight),R.rect.width=A.tiledMemberPack[M].width,R.rect.height=A.tiledMemberPack[M].height})},C.prototype.tileNodes=function(k,E){var A=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,R={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:A,horizontalPadding:M};k.sort(function(L,I){return L.rect.width*L.rect.height>I.rect.width*I.rect.height?-1:L.rect.width*L.rect.height0&&(N+=k.horizontalPadding),k.rowWidth[A]=N,k.width0&&(L+=k.verticalPadding);var I=0;L>k.rowHeight[A]&&(I=k.rowHeight[A],k.rowHeight[A]=L,I=k.rowHeight[A]-I),k.height+=I,k.rows[A].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,A=Number.MAX_VALUE,M=0;MA&&(E=M,A=k.rowWidth[M]);return E},C.prototype.canAddHorizontal=function(k,E,A){var M=this.getShortestRowIndex(k);if(M<0)return!0;var R=k.rowWidth[M];if(R+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[M]0&&(P=A+k.verticalPadding-k.rowHeight[M]);var N;k.width-R>=E+k.horizontalPadding?N=(k.height+P)/(R+E+k.horizontalPadding):N=(k.height+P)/k.width,P=A+k.verticalPadding;var L;return k.widthP&&E!=A){M.splice(-1,1),k.rows[A].push(R),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[A]=k.rowWidth[A]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var N=Number.MIN_VALUE,L=0;LN&&(N=M[L].height);E>0&&(N+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[A];k.rowHeight[E]=N,k.rowHeight[A]0)for(var z=R;z<=P;z++)B[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(P0)for(var z=N;z<=L;z++)B[3]+=this.grid[R-1][z].length+this.grid[R][z].length-1;for(var V=v.MAX_VALUE,F,H,G=0;G0){var L;L=T.getGraphManager().add(T.newGraph(),A),this.processChildrenList(L,E,T)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(x){x("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(v9)),v9.exports}var Ttr=wtr();const Ctr=wm(Ttr);Jd.use(Ctr);function wDe(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(wDe,"addNodes");function TDe(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(TDe,"addEdges");function CDe(t){return new Promise(e=>{const r=xt("body").append("div").attr("id","cy").attr("style","display:none"),n=Jd({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),wDe(t.nodes,n),TDe(t.edges,n),n.nodes().forEach(function(s){s.layoutDimensions=()=>{const a=s.data();return{w:a.width,h:a.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(s=>{de.info("Cytoscape ready",s),e(n)})})}w(CDe,"createCytoscapeInstance");function kDe(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(s=>{s!=="id"&&(i[s]=r[s])}),i})}w(kDe,"extractPositionedNodes");function SDe(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(s=>{["id","source","target"].includes(s)||(i[s]=r[s])}),i})}w(SDe,"extractPositionedEdges");async function EDe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{ADe(t);const r=await CDe(t),n=kDe(r),i=SDe(r);return de.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw de.error("Error in cose-bilkent layout algorithm:",r),r}}w(EDe,"executeCoseBilkentLayout");function ADe(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(ADe,"validateLayoutData");var ktr=w(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:s,insertNode:a,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");s(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 x=>{if(x.isGroup){const T={...x};d[x.id]=T,h[x.id]=T,await r(p,x)}else{const T={...x};h[x.id]=T;const C=await a(y,x,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();T.width=S.width,T.height=S.height,T.domId=C,o.debug(`Node ${x.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(x=>{const T=h[x.id];return{...x,width:T.width,height:T.height}})},b=await EDe(v,t.config);o.debug("Positioning nodes based on layout results"),b.nodes.forEach(x=>{const T=h[x.id];T!=null&&T.domId&&(T.domId.attr("transform",`translate(${x.x}, ${x.y})`),T.x=x.x,T.y=x.y,o.debug(`Positioned node ${T.id} at center (${x.x}, ${x.y})`))}),b.edges.forEach(x=>{const T=t.edges.find(C=>C.id===x.id);T&&(T.points=[{x:x.startX,y:x.startY},{x:x.midX,y:x.midY},{x:x.endX,y:x.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async x=>{await i(m,x);const T=h[x.start??""],C=h[x.end??""];if(T&&C){const S=b.edges.find(k=>k.id===x.id);if(S){o.debug("APA01 positionedEdge",S);const k={...x},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}else{const k={...x,points:[{x:T.x||0,y:T.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,T,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),Str=ktr;const Etr=Object.freeze(Object.defineProperty({__proto__:null,render:Str},Symbol.toStringTag,{value:"Module"}));var WP=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"),MDe=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"};WP(t,r).lower()},"drawBackgroundRect"),Atr=w((t,e)=>{const r=e.text.replace(G3," "),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"),xre=w((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const s=kv.sanitizeUrl(n);i.attr("xlink:href",s)},"drawImage"),wre=w((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const s=kv.sanitizeUrl(n);i.attr("xlink:href",`#${s}`)},"drawEmbeddedImage"),uu=w(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Tre=w(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Cre=w(()=>{let t=xt(".mermaidTooltip");return t.empty()&&(t=xt("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"),sN=(function(){var t=w(function(we,Ae,qe,le){for(qe=qe||{},le=we.length;le--;qe[we[le]]=Ae);return qe},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],s=[1,28],a=[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],b=[1,34],x=[1,35],T=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],A=[1,41],M=[1,42],R=[1,43],P=[1,44],N=[1,45],L=[1,46],I=[1,47],$=[1,48],O=[1,50],D=[1,51],B=[1,52],z=[1,53],V=[1,54],F=[1,55],H=[1,56],G=[1,57],W=[1,58],K=[1,59],q=[1,60],oe=[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],Q=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[1,82],ie=[1,83],me=[1,84],te=[1,85],_e=[12,14,42],$e=[12,14,33,42],Ve=[12,14,33,42,76,77,79,80],ce=[12,33],he=[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,qe,le,pe,Ce,re,Y){var J=re.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(re[J-3]);break;case 19:pe.setTitle(re[J].substring(6)),this.$=re[J].substring(6);break;case 20:pe.setAccDescription(re[J].substring(15)),this.$=re[J].substring(15);break;case 21:this.$=re[J].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=re[J].trim(),pe.setAccDescription(this.$);break;case 28:re[J].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...re[J]),this.$=re[J];break;case 29:re[J].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...re[J]),this.$=re[J];break;case 30:pe.addPersonOrSystemBoundary(...re[J]),this.$=re[J];break;case 31:re[J].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...re[J]),this.$=re[J];break;case 32:pe.addDeploymentNode("node",...re[J]),this.$=re[J];break;case 33:pe.addDeploymentNode("nodeL",...re[J]),this.$=re[J];break;case 34:pe.addDeploymentNode("nodeR",...re[J]),this.$=re[J];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...re[J]),this.$=re[J];break;case 40:pe.addPersonOrSystem("external_person",...re[J]),this.$=re[J];break;case 41:pe.addPersonOrSystem("system",...re[J]),this.$=re[J];break;case 42:pe.addPersonOrSystem("system_db",...re[J]),this.$=re[J];break;case 43:pe.addPersonOrSystem("system_queue",...re[J]),this.$=re[J];break;case 44:pe.addPersonOrSystem("external_system",...re[J]),this.$=re[J];break;case 45:pe.addPersonOrSystem("external_system_db",...re[J]),this.$=re[J];break;case 46:pe.addPersonOrSystem("external_system_queue",...re[J]),this.$=re[J];break;case 47:pe.addContainer("container",...re[J]),this.$=re[J];break;case 48:pe.addContainer("container_db",...re[J]),this.$=re[J];break;case 49:pe.addContainer("container_queue",...re[J]),this.$=re[J];break;case 50:pe.addContainer("external_container",...re[J]),this.$=re[J];break;case 51:pe.addContainer("external_container_db",...re[J]),this.$=re[J];break;case 52:pe.addContainer("external_container_queue",...re[J]),this.$=re[J];break;case 53:pe.addComponent("component",...re[J]),this.$=re[J];break;case 54:pe.addComponent("component_db",...re[J]),this.$=re[J];break;case 55:pe.addComponent("component_queue",...re[J]),this.$=re[J];break;case 56:pe.addComponent("external_component",...re[J]),this.$=re[J];break;case 57:pe.addComponent("external_component_db",...re[J]),this.$=re[J];break;case 58:pe.addComponent("external_component_queue",...re[J]),this.$=re[J];break;case 60:pe.addRel("rel",...re[J]),this.$=re[J];break;case 61:pe.addRel("birel",...re[J]),this.$=re[J];break;case 62:pe.addRel("rel_u",...re[J]),this.$=re[J];break;case 63:pe.addRel("rel_d",...re[J]),this.$=re[J];break;case 64:pe.addRel("rel_l",...re[J]),this.$=re[J];break;case 65:pe.addRel("rel_r",...re[J]),this.$=re[J];break;case 66:pe.addRel("rel_b",...re[J]),this.$=re[J];break;case 67:re[J].splice(0,1),pe.addRel("rel",...re[J]),this.$=re[J];break;case 68:pe.updateElStyle("update_el_style",...re[J]),this.$=re[J];break;case 69:pe.updateRelStyle("update_rel_style",...re[J]),this.$=re[J];break;case 70:pe.updateLayoutConfig("update_layout_config",...re[J]),this.$=re[J];break;case 71:this.$=[re[J]];break;case 72:re[J].unshift(re[J-1]),this.$=re[J];break;case 73:case 75:this.$=re[J].trim();break;case 74:let ue={};ue[re[J-1].trim()]=re[J].trim(),this.$=ue;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:s,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:s,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{14:[1,74]},t(oe,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q}),t(oe,[2,14]),t(Z,[2,16],{12:[1,76]}),t(oe,[2,36],{12:[1,77]}),t(Q,[2,19]),t(Q,[2,20]),{25:[1,78]},{27:[1,79]},t(Q,[2,23]),{35:80,75:81,76:ne,77:ie,79:me,80:te},{35:86,75:81,76:ne,77:ie,79:me,80:te},{35:87,75:81,76:ne,77:ie,79:me,80:te},{35:88,75:81,76:ne,77:ie,79:me,80:te},{35:89,75:81,76:ne,77:ie,79:me,80:te},{35:90,75:81,76:ne,77:ie,79:me,80:te},{35:91,75:81,76:ne,77:ie,79:me,80:te},{35:92,75:81,76:ne,77:ie,79:me,80:te},{35:93,75:81,76:ne,77:ie,79:me,80:te},{35:94,75:81,76:ne,77:ie,79:me,80:te},{35:95,75:81,76:ne,77:ie,79:me,80:te},{35:96,75:81,76:ne,77:ie,79:me,80:te},{35:97,75:81,76:ne,77:ie,79:me,80:te},{35:98,75:81,76:ne,77:ie,79:me,80:te},{35:99,75:81,76:ne,77:ie,79:me,80:te},{35:100,75:81,76:ne,77:ie,79:me,80:te},{35:101,75:81,76:ne,77:ie,79:me,80:te},{35:102,75:81,76:ne,77:ie,79:me,80:te},{35:103,75:81,76:ne,77:ie,79:me,80:te},{35:104,75:81,76:ne,77:ie,79:me,80:te},t(_e,[2,59]),{35:105,75:81,76:ne,77:ie,79:me,80:te},{35:106,75:81,76:ne,77:ie,79:me,80:te},{35:107,75:81,76:ne,77:ie,79:me,80:te},{35:108,75:81,76:ne,77:ie,79:me,80:te},{35:109,75:81,76:ne,77:ie,79:me,80:te},{35:110,75:81,76:ne,77:ie,79:me,80:te},{35:111,75:81,76:ne,77:ie,79:me,80:te},{35:112,75:81,76:ne,77:ie,79:me,80:te},{35:113,75:81,76:ne,77:ie,79:me,80:te},{35:114,75:81,76:ne,77:ie,79:me,80:te},{35:115,75:81,76:ne,77:ie,79:me,80:te},{20:116,29:49,30:61,32:62,34:a,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:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q},{12:[1,118],33:[1,117]},{35:119,75:81,76:ne,77:ie,79:me,80:te},{35:120,75:81,76:ne,77:ie,79:me,80:te},{35:121,75:81,76:ne,77:ie,79:me,80:te},{35:122,75:81,76:ne,77:ie,79:me,80:te},{35:123,75:81,76:ne,77:ie,79:me,80:te},{35:124,75:81,76:ne,77:ie,79:me,80:te},{35:125,75:81,76:ne,77:ie,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(oe,[2,15]),t(Z,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:s}),t(oe,[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:s,34:a,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:b,50:x,51:T,52:C,53:S,54:k,55:E,56:A,57:M,58:R,59:P,60:N,61:L,62:I,63:$,64:O,65:D,66:B,67:z,68:V,69:F,70:H,71:G,72:W,73:K,74:q}),t(Q,[2,21]),t(Q,[2,22]),t(_e,[2,39]),t($e,[2,71],{75:81,35:132,76:ne,77:ie,79:me,80:te}),t(Ve,[2,73]),{78:[1,133]},t(Ve,[2,75]),t(Ve,[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(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Z,[2,18]),t(oe,[2,38]),t($e,[2,72]),t(Ve,[2,74]),t(_e,[2,24]),t(_e,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[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,qe){if(qe.recoverable)this.trace(Ae);else{var le=new Error(Ae);throw le.hash=qe,le}},"parseError"),parse:w(function(Ae){var qe=this,le=[0],pe=[],Ce=[null],re=[],Y=this.table,J="",ue=0,X=0,fe=2,ee=1,Me=re.slice.call(arguments,1),Re=Object.create(this.lexer),Ke={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(Ke.yy[Ne]=this.yy[Ne]);Re.setInput(Ae,Ke.yy),Ke.yy.lexer=Re,Ke.yy.parser=this,typeof Re.yylloc>"u"&&(Re.yylloc={});var je=Re.yylloc;re.push(je);var Oe=Re.options&&Re.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(xe){le.length=le.length-2*xe,Ce.length=Ce.length-xe,re.length=re.length-xe}w(Ze,"popStack");function Fe(){var xe;return xe=pe.pop()||Re.lex()||ee,typeof xe!="number"&&(xe instanceof Array&&(pe=xe,xe=pe.pop()),xe=qe.symbols_[xe]||xe),xe}w(Fe,"lex");for(var st,Pe,gt,Le,kt={},Et,ot,Ht,_t;;){if(Pe=le[le.length-1],this.defaultActions[Pe]?gt=this.defaultActions[Pe]:((st===null||typeof st>"u")&&(st=Fe()),gt=Y[Pe]&&Y[Pe][st]),typeof gt>"u"||!gt.length||!gt[0]){var dt="";_t=[];for(Et in Y[Pe])this.terminals_[Et]&&Et>fe&&_t.push("'"+this.terminals_[Et]+"'");Re.showPosition?dt="Parse error on line "+(ue+1)+`: -`+Re.showPosition()+` -Expecting `+_t.join(", ")+", got '"+(this.terminals_[st]||st)+"'":dt="Parse error on line "+(ue+1)+": Unexpected "+(st==ee?"end of input":"'"+(this.terminals_[st]||st)+"'"),this.parseError(dt,{text:Re.match,token:this.terminals_[st]||st,line:Re.yylineno,loc:je,expected:_t})}if(gt[0]instanceof Array&>.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Pe+", token: "+st);switch(gt[0]){case 1:le.push(st),Ce.push(Re.yytext),re.push(Re.yylloc),le.push(gt[1]),st=null,X=Re.yyleng,J=Re.yytext,ue=Re.yylineno,je=Re.yylloc;break;case 2:if(ot=this.productions_[gt[1]][1],kt.$=Ce[Ce.length-ot],kt._$={first_line:re[re.length-(ot||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(ot||1)].first_column,last_column:re[re.length-1].last_column},Oe&&(kt._$.range=[re[re.length-(ot||1)].range[0],re[re.length-1].range[1]]),Le=this.performAction.apply(kt,[J,X,ue,Ke.yy,gt[1],Ce,re].concat(Me)),typeof Le<"u")return Le;ot&&(le=le.slice(0,-1*ot*2),Ce=Ce.slice(0,-1*ot),re=re.slice(0,-1*ot)),le.push(this.productions_[gt[1]][0]),Ce.push(kt.$),re.push(kt._$),Ht=Y[le[le.length-2]][le[le.length-1]],le.push(Ht);break;case 3:return!0}}return!0},"parse")},ge=(function(){var we={EOF:1,parseError:w(function(qe,le){if(this.yy.parser)this.yy.parser.parseError(qe,le);else throw new Error(qe)},"parseError"),setInput:w(function(Ae,qe){return this.yy=qe||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 qe=Ae.match(/(?:\r\n?|\n).*/g);return qe?(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 qe=Ae.length,le=Ae.split(/(?:\r\n?|\n)/g);this._input=Ae+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-qe),this.offset-=qe;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-qe},this.options.ranges&&(this.yylloc.range=[Ce[0],Ce[0]+this.yyleng-qe]),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(),qe=new Array(Ae.length+1).join("-");return Ae+this.upcomingInput()+` -`+qe+"^"},"showPosition"),test_match:w(function(Ae,qe){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,qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),le)return le;if(this._backtrack){for(var re in Ce)this[re]=Ce[re];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ae,qe,le,pe;this._more||(this.yytext="",this.match="");for(var Ce=this._currentRules(),re=0;reqe[0].length)){if(qe=le,pe=re,this.options.backtrack_lexer){if(Ae=this.test_match(le,Ce[re]),Ae!==!1)return Ae;if(this._backtrack){qe=!1;continue}else return!1}else if(!this.options.flex)break}return qe?(Ae=this.test_match(qe,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 qe=this.next();return qe||this.lex()},"lex"),begin:w(function(qe){this.conditionStack.push(qe)},"begin"),popState:w(function(){var qe=this.conditionStack.length-1;return qe>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(qe){return qe=this.conditionStack.length-1-Math.abs(qe||0),qe>=0?this.conditionStack[qe]:"INITIAL"},"topState"),pushState:w(function(qe){this.begin(qe)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(qe,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 ze(){this.yy={}}return w(ze,"Parser"),ze.prototype=Te,Te.Parser=ze,new ze})();sN.parser=sN;var Mtr=sN,Wh=[],Mg=[""],Fl="global",Oh="",ef=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Z6=[],kre="",Sre=!1,aN=4,oN=2,RDe,Rtr=w(function(){return RDe},"getC4Type"),_tr=w(function(t){RDe=Nn(t,He())},"setC4Type"),Ltr=w(function(t,e,r,n,i,s,a,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=Z6.find(d=>d.from===e&&d.to===r);if(h?u=h:Z6.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(s==null)u.descr={text:""};else if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]={text:f}}else u.descr={text:s};if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]=f}else u.sprite=a;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=Om()},"addRel"),Itr=w(function(t,e,r,n,i,s,a){if(e===null||r===null)return;let o={};const l=Wh.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Wh.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 s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.tags=s;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=Fl,o.wrap=Om()},"addPersonOrSystem"),Ntr=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Wh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Wh.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 s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Om(),l.typeC4Shape={text:t},l.parentBoundary=Fl},"addContainer"),Otr=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=Wh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Wh.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 s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.sprite=s;if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Om(),l.typeC4Shape={text:t},l.parentBoundary=Fl},"addComponent"),Dtr=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=ef.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,ef.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=Fl,s.wrap=Om(),Oh=Fl,Fl=t,Mg.push(Oh)},"addPersonOrSystemBoundary"),Ptr=w(function(t,e,r,n,i){if(t===null||e===null)return;let s={};const a=ef.find(o=>o.alias===t);if(a&&t===a.alias?s=a:(s.alias=t,ef.push(s)),e==null?s.label={text:""}:s.label={text:e},r==null)s.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];s[o]={text:l}}else s.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];s[o]=l}else s.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];s[o]=l}else s.link=i;s.parentBoundary=Fl,s.wrap=Om(),Oh=Fl,Fl=t,Mg.push(Oh)},"addContainerBoundary"),$tr=w(function(t,e,r,n,i,s,a,o){if(e===null||r===null)return;let l={};const u=ef.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ef.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 a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.tags=a;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=Om(),Oh=Fl,Fl=e,Mg.push(Oh)},"addDeploymentNode"),Btr=w(function(){Fl=Oh,Mg.pop(),Oh=Mg.pop(),Mg.push(Oh)},"popBoundaryParseStack"),Ftr=w(function(t,e,r,n,i,s,a,o,l,u,h){let d=Wh.find(f=>f.alias===e);if(!(d===void 0&&(d=ef.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(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shadowing=s;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shape=a;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"),ztr=w(function(t,e,r,n,i,s,a){const o=Z6.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(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(s);if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(a)}},"updateRelStyle"),Vtr=w(function(t,e,r){let n=aN,i=oN;if(typeof e=="object"){const s=Object.values(e)[0];n=parseInt(s)}else n=parseInt(e);if(typeof r=="object"){const s=Object.values(r)[0];i=parseInt(s)}else i=parseInt(r);n>=1&&(aN=n),i>=1&&(oN=i)},"updateLayoutConfig"),Htr=w(function(){return aN},"getC4ShapeInRow"),Gtr=w(function(){return oN},"getC4BoundaryInRow"),Wtr=w(function(){return Fl},"getCurrentBoundaryParse"),qtr=w(function(){return Oh},"getParentBoundaryParse"),_De=w(function(t){return t==null?Wh:Wh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),Utr=w(function(t){return Wh.find(e=>e.alias===t)},"getC4Shape"),jtr=w(function(t){return Object.keys(_De(t))},"getC4ShapeKeys"),LDe=w(function(t){return t==null?ef:ef.filter(e=>e.parentBoundary===t)},"getBoundaries"),Ytr=LDe,Xtr=w(function(){return Z6},"getRels"),Ktr=w(function(){return kre},"getTitle"),Ztr=w(function(t){Sre=t},"setWrap"),Om=w(function(){return Sre},"autoWrap"),Qtr=w(function(){Wh=[],ef=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Oh="",Fl="global",Mg=[""],Z6=[],Mg=[""],kre="",Sre=!1,aN=4,oN=2},"clear"),Jtr={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},err={FILLED:0,OPEN:1},trr={LEFTOF:0,RIGHTOF:1,OVER:2},rrr=w(function(t){kre=Nn(t,He())},"setTitle"),eY={addPersonOrSystem:Itr,addPersonOrSystemBoundary:Dtr,addContainer:Ntr,addContainerBoundary:Ptr,addComponent:Otr,addDeploymentNode:$tr,popBoundaryParseStack:Btr,addRel:Ltr,updateElStyle:Ftr,updateRelStyle:ztr,updateLayoutConfig:Vtr,autoWrap:Om,setWrap:Ztr,getC4ShapeArray:_De,getC4Shape:Utr,getC4ShapeKeys:jtr,getBoundaries:LDe,getBoundarys:Ytr,getCurrentBoundaryParse:Wtr,getParentBoundaryParse:qtr,getRels:Xtr,getTitle:Ktr,getC4Type:Rtr,getC4ShapeInRow:Htr,getC4BoundaryInRow:Gtr,setAccTitle:qi,getAccTitle:ns,getAccDescription:ss,setAccDescription:is,getConfig:w(()=>He().c4,"getConfig"),clear:Qtr,LINETYPE:Jtr,ARROWTYPE:err,PLACEMENT:trr,setTitle:rrr,setC4Type:_tr},Ere=w(function(t,e){return WP(t,e)},"drawRect"),IDe=w(function(t,e,r,n,i,s){const a=t.append("image");a.attr("width",e),a.attr("height",r),a.attr("x",n),a.attr("y",i);let o=s.startsWith("data:image/png;base64")?s:kv.sanitizeUrl(s);a.attr("xlink:href",o)},"drawImage"),nrr=w((t,e,r,n)=>{const i=t.append("g");let s=0;for(let a of e){let o=a.textColor?a.textColor:"#444444",l=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,h=a.offsetY?parseInt(a.offsetY):0,d="";if(s===0){let p=i.append("line");p.attr("x1",a.startPoint.x),p.attr("y1",a.startPoint.y),p.attr("x2",a.endPoint.x),p.attr("y2",a.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),s=-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",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();c0(r)(a.label.text,i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+h,a.label.width,a.label.height,{fill:o},f),a.techn&&a.techn.text!==""&&(f=r.messageFont(),c0(r)("["+a.techn.text+"]",i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+r.messageFontSize+5+h,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),irr=w(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",s=e.borderColor?e.borderColor:"#444444",a=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:s,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Ere(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,c0(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=a,c0(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=a,c0(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),srr=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"],s=e.fontColor?e.fontColor:"#FFFFFF",a="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":a="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":a="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=uu();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},Ere(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=frr(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",s).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":IDe(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,a);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,c0(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:s},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=s,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?c0(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:s,"font-style":"italic"},h):e.type&&e.type.text!==""&&c0(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:s,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=s,c0(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:s},h)),e.height},"drawC4Shape"),arr=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"),orr=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"),lrr=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"),crr=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"),urr=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"),hrr=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"),drr=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"),frr=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),c0=(function(){function t(i,s,a,o,l,u,h){const d=s.append("text").attr("x",a+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}w(t,"byText");function e(i,s,a,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Gt.lineBreakRegex);for(let y=0;y=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>NDe)&&(r=this.nextData.startx+e.margin+Sr.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=s=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",s,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",s,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},rY(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},w(Vx,"Bounds"),Vx),rY=w(function(t){oa(Sr,t),t.fontFamily&&(Sr.personFontFamily=Sr.systemFontFamily=Sr.messageFontFamily=t.fontFamily),t.fontSize&&(Sr.personFontSize=Sr.systemFontSize=Sr.messageFontSize=t.fontSize),t.fontWeight&&(Sr.personFontWeight=Sr.systemFontWeight=Sr.messageFontWeight=t.fontWeight)},"setConf"),ok=w((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),w9=w(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),prr=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function $u(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=zS(e[t].text,i,n),e[t].textLines=e[t].text.split(Gt.lineBreakRegex).length,e[t].width=i,e[t].height=dL(e[t].text,n);else{let s=e[t].text.split(Gt.lineBreakRegex);e[t].textLines=s.length;let a=0;e[t].height=0,e[t].width=0;for(const o of s)e[t].width=Math.max(Bl(o,n),e[t].width),a=dL(o,n),e[t].height=e[t].height+a}}w($u,"calcC4ShapeTextWH");var DDe=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=Sr.c4ShapeMargin-35;let n=e.wrap&&Sr.wrap,i=w9(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let s=Bl(e.label.text,i);$u("label",e,n,i,s),wd.drawBoundary(t,e,Sr)},"drawBoundary"),PDe=w(function(t,e,r,n){let i=0;for(const s of n){i=0;const a=r[s];let o=ok(Sr,a.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,a.typeC4Shape.width=Bl("«"+a.typeC4Shape.text+"»",o),a.typeC4Shape.height=o.fontSize+2,a.typeC4Shape.Y=Sr.c4ShapePadding,i=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=i,i=a.image.Y+a.image.height);let l=a.wrap&&Sr.wrap,u=Sr.width-Sr.c4ShapePadding*2,h=ok(Sr,a.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",$u("label",a,l,h,u),a.label.Y=i+8,i=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let p=ok(Sr,a.typeC4Shape.text);$u("type",a,l,p,u),a.type.Y=i+5,i=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let p=ok(Sr,a.techn.text);$u("techn",a,l,p,u),a.techn.Y=i+5,i=a.techn.Y+a.techn.height}let d=i,f=a.label.width;if(a.descr&&a.descr.text!==""){let p=ok(Sr,a.typeC4Shape.text);$u("descr",a,l,p,u),a.descr.Y=i+20,i=a.descr.Y+a.descr.height,f=Math.max(a.label.width,a.descr.width),d=i-a.descr.textLines*5}f=f+Sr.c4ShapePadding,a.width=Math.max(a.width||Sr.width,f,Sr.width),a.height=Math.max(a.height||Sr.height,d,Sr.height),a.margin=a.margin||Sr.c4ShapeMargin,t.insert(a),wd.drawC4Shape(e,a,Sr)}t.bumpLastMargin(Sr.c4ShapeMargin)},"drawC4ShapeArray"),Hx,bu=(Hx=class{constructor(e,r){this.x=e,this.y=r}},w(Hx,"Point"),Hx),F1e=w(function(t,e){let r=t.x,n=t.y,i=e.x,s=e.y,a=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-s),h=u/l,d=t.height/t.width,f=null;return n==s&&ri?f=new bu(r,o):r==i&&ns&&(f=new bu(a,n)),r>i&&n=h?f=new bu(r,o+h*t.width/2):f=new bu(a-l/u*t.height/2,n+t.height):r=h?f=new bu(r+t.width,o+h*t.width/2):f=new bu(a+l/u*t.height/2,n+t.height):rs?d>=h?f=new bu(r+t.width,o-h*t.width/2):f=new bu(a+t.height/2*l/u,n):r>i&&n>s&&(d>=h?f=new bu(r,o-t.width/2*h):f=new bu(a-t.height/2*l/u,n)),f},"getIntersectPoint"),grr=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=F1e(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=F1e(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),mrr=w(function(t,e,r,n,i){let s=0;for(let a of e){s=s+1;let o=a.wrap&&Sr.wrap,l=prr(Sr);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=s+": "+a.label.text);let h=Bl(a.label.text,l);$u("label",a,o,l,h),a.techn&&a.techn.text!==""&&(h=Bl(a.techn.text,l),$u("techn",a,o,l,h)),a.descr&&a.descr.text!==""&&(h=Bl(a.descr.text,l),$u("descr",a,o,l,h));let d=r(a.from),f=r(a.to),p=grr(d,f);a.startPoint=p.startPoint,a.endPoint=p.endPoint}wd.drawRels(t,e,Sr,i)},"drawRels");function Are(t,e,r,n,i){let s=new ODe(i);s.data.widthLimit=r.data.widthLimit/Math.min(tY,n.length);for(let[a,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&&Sr.wrap,h=w9(Sr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",$u("label",o,u,h,s.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=w9(Sr);$u("type",o,u,g,s.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=w9(Sr);g.fontSize=g.fontSize-2,$u("descr",o,u,g,s.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(a==0||a%tY===0){let g=r.data.startx+Sr.diagramMarginX,m=r.data.stopy+Sr.diagramMarginY+l;s.setData(g,g,m,m)}else{let g=s.data.stopx!==s.data.startx?s.data.stopx+Sr.diagramMarginX:s.data.startx,m=s.data.starty;s.setData(g,g,m,m)}s.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&PDe(s,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&Are(t,e,s,p,i),o.alias!=="global"&&DDe(t,o,s),r.data.stopy=Math.max(s.data.stopy+Sr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(s.data.stopx+Sr.c4ShapeMargin,r.data.stopx),lN=Math.max(lN,r.data.stopx),cN=Math.max(cN,r.data.stopy)}}w(Are,"drawInsideBoundary");var yrr=w(function(t,e,r,n){Sr=He().c4;const i=He().securityLevel;let s;i==="sandbox"&&(s=xt("#i"+e));const a=xt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Sr.wrap),NDe=o.getC4ShapeInRow(),tY=o.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(Sr,null,2)}`);const l=i==="sandbox"?a.select(`[id="${e}"]`):xt(`[id="${e}"]`);wd.insertComputerIcon(l,e),wd.insertDatabaseIcon(l,e),wd.insertClockIcon(l,e);let u=new ODe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,lN=Sr.diagramMarginX,cN=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");Are(l,"",u,d,n),wd.insertArrowHead(l,e),wd.insertArrowEnd(l,e),wd.insertArrowCrossHead(l,e),wd.insertArrowFilledHead(l,e),mrr(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=lN,u.data.stopy=cN;const f=u.data;let g=f.stopy-f.starty+2*Sr.diagramMarginY;const y=f.stopx-f.startx+2*Sr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Sr.diagramMarginX).attr("y",f.starty+Sr.diagramMarginY),qs(l,g,y,Sr.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Sr.diagramMarginX+" -"+(Sr.diagramMarginY+v)+" "+y+" "+(g+v)),de.debug("models:",f)},"draw"),z1e={drawPersonOrSystemArray:PDe,drawBoundary:DDe,setConf:rY,draw:yrr},vrr=w(t=>`.person { + `),o=Zer(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]:ow.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===sN.IGNORE)return;if(l==sN.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=vc(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 U=s.getAtlasIndexForBatch(p),y=0,b=[[g,!0],[m,!1]];y=this.maxInstances&&this.endBatch()}}}}catch(R){h.e(R)}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;$me(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;vM(r,r,[h,d]),Fme(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;vM(r,r,[s,o]),nY(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]=N2;var o=this.indexBuffer.getView(s);I2(n,o);var l=this.colorBuffer.getView(s);cm([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===qE||o===l3){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===l3&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);I2(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,U=this.colorBuffer.getView(l);cm(m,g,U);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,s.border){var b=r.pstyle("border-width").value;if(b>0){var v=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,T=this.borderColorBuffer.getView(l);cm(v,w,T);var k=r.pstyle("border-position").value;if(k==="inside")y[0]=0,y[1]=-b;else if(k==="outside")y[0]=b,y[1]=0;else{var C=b/2;y[0]=C,y[1]=-C}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,S,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 N2;case"ellipse":return c3;case"roundrectangle":case"round-rectangle":return qE;case"bottom-round-rectangle":return l3;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return a1(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,U=this.r.getArrowWidth(g,m),y=this.instanceCount,b=this.transformBuffer.getMatrixView(y);$me(b),vM(b,b,[s,o]),nY(b,b,[U,U]),Fme(b,b,l),this.vertTypeBuffer.getView(y)[0]=kV;var v=this.indexBuffer.getView(y);I2(n,v);var w=this.colorBuffer.getView(y);cm(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=zme;var d=this.indexBuffer.getView(h);I2(n,d);var f=this.colorBuffer.getView(h);cm(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?sN.USE_BB:sN.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),U=d.outerHeight();return{w:m,h:U,x1:p-m/2,y1:g-U/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:ttr,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:SV(e.getLabelKey,null),getBoundingBox:EV(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:SV(e.getSourceLabelKey,"source"),getBoundingBox:EV(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:SV(e.getTargetLabelKey,"target"),getBoundingBox:EV(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=Ck(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()}),wtr(r)};function xtr(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return YNe(r)}function TOe(t,e){var r=t._private.rscratch;return Cl(r,"labelWrapCachedLines",e)||[]}var SV=function(e,r){return function(n){var i=e(n),a=TOe(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},EV=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=TOe(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 wtr(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>gOe?(Ttr(t),e.call(t,a)):(Ctr(t),kOe(t,a,ow.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 Rtr(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 Ttr(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Ctr(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 ktr(t){var e=t.canvasWidth,r=t.canvasHeight,n=Ere(t),i=n.pan,a=n.zoom,s=TV();vM(s,s,[i.x,i.y]),nY(s,s,[a,a]);var o=TV();utr(o,e,r);var l=TV();return ctr(l,o,s),l}function COe(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=Ere(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 Str(t,e){t.drawSelectionRectangle(e,function(r){return COe(t,r)})}function Etr(t){var e=t.data.contexts[t.NODE];e.save(),COe(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 Atr(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h=0&&w.add(C)}return w}function Rtr(t,e,r){var n=Mtr(t,e,r),i=t.getCachedZSortedEles(),a,s,o=vc(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 AV(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 kOe(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]&&Str(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=ktr(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(),U={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(U.x,U.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-U.x,-U.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function Ltr(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":Fs(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};[UOe,Uf,mp,Sre,_5,D1,Ql,wOe,O1,Rk,AOe].forEach(function(t){Gr(En,t)});var Dtr=[{name:"null",impl:rOe},{name:"base",impl:fOe},{name:"canvas",impl:Itr}],Otr=[{type:"layout",extensions:ier},{type:"renderer",extensions:Dtr}],ROe={},LOe={};function IOe(t,e,r){var n=r,i=function(S){xi("Can not register `"+e+"` for `"+t+"` since `"+S+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(JT.prototype[e])return i(e);JT.prototype[e]=r}else if(t==="collection"){if(No.prototype[e])return i(e);No.prototype[e]=r}else if(t==="layout"){for(var a=function(S){this.options=S,r.call(this,S),ei(this._private)||(this._private={}),this._private.cy=S.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 U=new h(g,m),y=p.inverseTransformPoint(U);this.setLocation(y.x,y.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(U,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=U,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.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(U,y,b){if(y==null&&b==null){var v=U;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var w=U;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(U){var y=U;if(U instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),v,w=b.length,T=0;T-1&&S>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(C,1),v.target!=v.source&&v.target.edges.splice(S,1);var k=v.source.owner.getEdges().indexOf(v);if(k==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var U=s.MAX_VALUE,y=s.MAX_VALUE,b,v,w,T=this.getNodes(),k=T.length,C=0;Cb&&(U=b),y>v&&(y=v)}return U==s.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?w=T[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=U-w,new f(this.left,this.top))},g.prototype.updateBounds=function(U){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,v=s.MAX_VALUE,w=-s.MAX_VALUE,T,k,C,S,E,A=this.nodes,R=A.length,_=0;_T&&(y=T),bC&&(v=C),wT&&(y=T),bC&&(v=C),w=this.nodes.length){var R=0;b.forEach(function(_){_.owner==U&&R++}),R==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]=A,!1;if(df)return u[0]=g,u[1]=d,u[2]=S,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,L=!0):(u[0]=U,u[1]=m,L=!0):P===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=v,u[1]=b,L=!0)),-O===D?f>h?(u[2]=E,u[3]=A,I=!0):(u[2]=S,u[3]=C,I=!0):O===D&&(f>h?(u[2]=k,u[3]=C,I=!0):(u[2]=R,u[3]=A,I=!0)),L&&I)return!1;if(h>f?d>p?(B=this.getCardinalDirection(P,D,4),F=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-P,D,3),F=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-P,D,1),F=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection(P,D,2),F=this.getCardinalDirection(O,D,4)),!L)switch(B){case 1:$=m,z=h+-T/D,u[0]=z,u[1]=$;break;case 2:z=v,$=d+w*D,u[0]=z,u[1]=$;break;case 3:$=b,z=h+T/D,u[0]=z,u[1]=$;break;case 4:z=y,$=d+-w*D,u[0]=z,u[1]=$;break}if(!I)switch(F){case 1:H=C,V=f+-N/D,u[2]=V,u[3]=H;break;case 2:V=R,H=p+_*D,u[2]=V,u[3]=H;break;case 3:H=A,V=f+N/D,u[2]=V,u[3]=H;break;case 4:V=E,H=p+-_*D,u[2]=V,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,U=u.y,y=h.x,b=h.y,v=void 0,w=void 0,T=void 0,k=void 0,C=void 0,S=void 0,E=void 0,A=void 0,R=void 0;return T=g-f,C=d-p,E=p*f-d*g,k=b-U,S=m-y,A=y*U-m*b,R=T*S-k*C,R===0?null:(v=(C*A-S*E)/R,w=(k*E-T*A)/R,new a(v,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var U=0,y=Array(m.length);U0&&U;){for(T.push(C[0]);T.length>0&&U;){var S=T[0];T.splice(0,1),w.add(S);for(var E=S.getEdges(),v=0;v-1&&C.splice(N,1)}w=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var U=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),v=0;v0){for(var b=this.edgeToDummyNodes.get(y),v=0;v=0&&U.splice(A,1);var R=k.getNeighborsList();R.forEach(function(L){if(y.indexOf(L)<0){var I=b.get(L),P=I-1;P==1&&S.push(L),b.set(L,P)}})}y=y.concat(S),(U.length==1||U.length==2)&&(v=!0,w=U[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,U,y,b,v=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mT||w>T)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(T=g.getEstimatedSize()*this.compoundGravityRangeFactor,(v>T||w>T)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*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=v.length||T>=v[0].length)){for(var k=0;kd}}]),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 S=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(A){return S.has(A)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},T.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()),S=this.nodesWithGravity.filter(function(R){return C.has(R)});this.graphManager.setAllNodesToApplyGravitation(S),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 E=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var C=this.graphManager.getAllNodes(),S={},E=0;E1){var L;for(L=0;LA&&(A=Math.floor(N.y)),_=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))},T.radialLayout=function(C,S,E){var A=Math.max(this.maxDiagonalInTree(C),d.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(S,null,0,359,0,A);var R=v.calculateBounds(C),_=new w;_.setDeviceOrgX(R.getMinX()),_.setDeviceOrgY(R.getMinY()),_.setWorldOrgX(E.x),_.setWorldOrgY(E.y);for(var N=0;N1;){var H=V[0];V.splice(0,1);var G=D.indexOf(H);G>=0&&D.splice(G,1),z--,B--}S!=null?$=(D.indexOf(V[0])+1)%z:$=0;for(var K=Math.abs(A-E)/B,W=$;F!=B;W=++W%z){var oe=D[W].getOtherEnd(C);if(oe!=S){var Z=(E+F*K)%360,J=(Z+K)%360;T.branchRadialLayout(oe,C,Z,J,R+_,_),F++}}},T.maxDiagonalInTree=function(C){for(var S=y.MIN_VALUE,E=0;ES&&(S=R)}return S},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var C=this,S={};this.memberGroups={},this.idToDummyNode={};for(var E=[],A=this.graphManager.getAllNodes(),R=0;R"u"&&(S[L]=[]),S[L]=S[L].concat(_)}Object.keys(S).forEach(function(I){if(S[I].length>1){var P="DummyCompound_"+I;C.memberGroups[P]=S[I];var O=S[I][0].getParent(),D=new u(C.graphManager);D.id=P,D.paddingLeft=O.paddingLeft||0,D.paddingRight=O.paddingRight||0,D.paddingBottom=O.paddingBottom||0,D.paddingTop=O.paddingTop||0,C.idToDummyNode[P]=D;var B=C.getGraphManager().add(C.newGraph(),D),F=O.getChild();F.add(D);for(var z=0;z=0;C--){var S=this.compoundOrder[C],E=S.id,A=S.paddingLeft,R=S.paddingTop;this.adjustLocations(this.tiledMemberPack[E],S.rect.x,S.rect.y,A,R)}},T.prototype.repopulateZeroDegreeMembers=function(){var C=this,S=this.tiledZeroDegreePack;Object.keys(S).forEach(function(E){var A=C.idToDummyNode[E],R=A.paddingLeft,_=A.paddingTop;C.adjustLocations(S[E],A.rect.x,A.rect.y,R,_)})},T.prototype.getToBeTiled=function(C){var S=C.id;if(this.toBeTiled[S]!=null)return this.toBeTiled[S];var E=C.getChild();if(E==null)return this.toBeTiled[S]=!1,!1;for(var A=E.getNodes(),R=0;R0)return this.toBeTiled[S]=!1,!1;if(_.getChild()==null){this.toBeTiled[_.id]=!1;continue}if(!this.getToBeTiled(_))return this.toBeTiled[S]=!1,!1}return this.toBeTiled[S]=!0,!0},T.prototype.getNodeDegree=function(C){C.id;for(var S=C.getEdges(),E=0,A=0;AI&&(I=O.rect.height)}E+=I+C.verticalPadding}},T.prototype.tileCompoundMembers=function(C,S){var E=this;this.tiledMemberPack=[],Object.keys(C).forEach(function(A){var R=S[A];E.tiledMemberPack[A]=E.tileNodes(C[A],R.paddingLeft+R.paddingRight),R.rect.width=E.tiledMemberPack[A].width,R.rect.height=E.tiledMemberPack[A].height})},T.prototype.tileNodes=function(C,S){var E=d.TILING_PADDING_VERTICAL,A=d.TILING_PADDING_HORIZONTAL,R={rows:[],rowWidth:[],rowHeight:[],width:0,height:S,verticalPadding:E,horizontalPadding:A};C.sort(function(L,I){return L.rect.width*L.rect.height>I.rect.width*I.rect.height?-1:L.rect.width*L.rect.height0&&(N+=C.horizontalPadding),C.rowWidth[E]=N,C.width0&&(L+=C.verticalPadding);var I=0;L>C.rowHeight[E]&&(I=C.rowHeight[E],C.rowHeight[E]=L,I=C.rowHeight[E]-I),C.height+=I,C.rows[E].push(S)},T.prototype.getShortestRowIndex=function(C){for(var S=-1,E=Number.MAX_VALUE,A=0;AE&&(S=A,E=C.rowWidth[A]);return S},T.prototype.canAddHorizontal=function(C,S,E){var A=this.getShortestRowIndex(C);if(A<0)return!0;var R=C.rowWidth[A];if(R+C.horizontalPadding+S<=C.width)return!0;var _=0;C.rowHeight[A]0&&(_=E+C.verticalPadding-C.rowHeight[A]);var N;C.width-R>=S+C.horizontalPadding?N=(C.height+_)/(R+S+C.horizontalPadding):N=(C.height+_)/C.width,_=E+C.verticalPadding;var L;return C.width_&&S!=E){A.splice(-1,1),C.rows[E].push(R),C.rowWidth[S]=C.rowWidth[S]-_,C.rowWidth[E]=C.rowWidth[E]+_,C.width=C.rowWidth[instance.getLongestRowIndex(C)];for(var N=Number.MIN_VALUE,L=0;LN&&(N=A[L].height);S>0&&(N+=C.verticalPadding);var I=C.rowHeight[S]+C.rowHeight[E];C.rowHeight[S]=N,C.rowHeight[E]0)for(var F=R;F<=_;F++)B[0]+=this.grid[F][N-1].length+this.grid[F][N].length-1;if(_0)for(var F=N;F<=L;F++)B[3]+=this.grid[R-1][F].length+this.grid[R][F].length-1;for(var z=y.MAX_VALUE,$,V,H=0;H0){var L;L=w.getGraphManager().add(w.newGraph(),E),this.processChildrenList(L,S,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var y=function(v){v("layout","cose-bilkent",m)};typeof cytoscape<"u"&&y(cytoscape),n.exports=y})])})})(xM)),xM.exports}var Wtr=Gtr();const qtr=T1(Wtr);ef.use(qtr);function DOe(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(DOe,"addNodes");function OOe(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(OOe,"addEdges");function _Oe(t){return new Promise(e=>{const r=vt("body").append("div").attr("id","cy").attr("style","display:none"),n=ef({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),DOe(t.nodes,n),OOe(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=>{de.info("Cytoscape ready",a),e(n)})})}x(_Oe,"createCytoscapeInstance");function POe(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(POe,"extractPositionedNodes");function BOe(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(BOe,"extractPositionedEdges");async function $Oe(t,e){de.debug("Starting cose-bilkent layout algorithm");try{FOe(t);const r=await _Oe(t),n=POe(r),i=BOe(r);return de.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw de.error("Error in cose-bilkent layout algorithm:",r),r}}x($Oe,"executeCoseBilkentLayout");function FOe(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(FOe,"validateLayoutData");var jtr=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),U=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async v=>{if(v.isGroup){const w={...v};d[v.id]=w,h[v.id]=w,await r(p,v)}else{const w={...v};h[v.id]=w;const T=await s(U,v,{config:t.config,dir:t.direction||"TB"}),k=T.node().getBBox();w.width=k.width,w.height=k.height,w.domId=T,o.debug(`Node ${v.id} dimensions: ${k.width}x${k.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const y={...t,nodes:t.nodes.map(v=>{const w=h[v.id];return{...v,width:w.width,height:w.height}})},b=await $Oe(y,t.config);o.debug("Positioning nodes based on layout results"),b.nodes.forEach(v=>{const w=h[v.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${v.x}, ${v.y})`),w.x=v.x,w.y=v.y,o.debug(`Positioned node ${w.id} at center (${v.x}, ${v.y})`))}),b.edges.forEach(v=>{const w=t.edges.find(T=>T.id===v.id);w&&(w.points=[{x:v.startX,y:v.startY},{x:v.midX,y:v.midY},{x:v.endX,y:v.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async v=>{await i(m,v);const w=h[v.start??""],T=h[v.end??""];if(w&&T){const k=b.edges.find(C=>C.id===v.id);if(k){o.debug("APA01 positionedEdge",k);const C={...v},S=n(g,C,d,t.type,w,T,t.diagramId);l(C,S)}else{const C={...v,points:[{x:w.x||0,y:w.y||0},{x:T.x||0,y:T.y||0}]},S=n(g,C,d,t.type,w,T,t.diagramId);l(C,S)}}})),o.debug("Cose-bilkent rendering completed")},"render"),Ytr=jtr;const Xtr=Object.freeze(Object.defineProperty({__proto__:null,render:Ytr},Symbol.toStringTag,{value:"Module"}));var j_=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),zOe=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};j_(t,r).lower()},"drawBackgroundRect"),Ktr=x((t,e)=>{const r=e.text.replace(q4," "),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"),Are=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=E5.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),Mre=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=E5.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),uu=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Rre=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Lre=x(()=>{let t=vt(".mermaidTooltip");return t.empty()&&(t=vt("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"),lN=(function(){var t=x(function(xe,Ee,qe,le){for(qe=qe||{},le=xe.length;le--;qe[xe[le]]=Ee);return qe},"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],U=[1,32],y=[1,33],b=[1,34],v=[1,35],w=[1,36],T=[1,37],k=[1,38],C=[1,39],S=[1,40],E=[1,41],A=[1,42],R=[1,43],_=[1,44],N=[1,45],L=[1,46],I=[1,47],P=[1,48],O=[1,50],D=[1,51],B=[1,52],F=[1,53],z=[1,54],$=[1,55],V=[1,56],H=[1,57],G=[1,58],K=[1,59],W=[1,60],oe=[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],ne=[1,82],ie=[1,83],me=[1,84],te=[1,85],Re=[12,14,42],Pe=[12,14,33,42],Ve=[12,14,33,42,76,77,79,80],ce=[12,33],he=[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],we={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ee,qe,le,pe,Te,re,Y){var Q=re.length-1;switch(Te){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(re[Q-3]);break;case 19:pe.setTitle(re[Q].substring(6)),this.$=re[Q].substring(6);break;case 20:pe.setAccDescription(re[Q].substring(15)),this.$=re[Q].substring(15);break;case 21:this.$=re[Q].trim(),pe.setTitle(this.$);break;case 22:case 23:this.$=re[Q].trim(),pe.setAccDescription(this.$);break;case 28:re[Q].splice(2,0,"ENTERPRISE"),pe.addPersonOrSystemBoundary(...re[Q]),this.$=re[Q];break;case 29:re[Q].splice(2,0,"SYSTEM"),pe.addPersonOrSystemBoundary(...re[Q]),this.$=re[Q];break;case 30:pe.addPersonOrSystemBoundary(...re[Q]),this.$=re[Q];break;case 31:re[Q].splice(2,0,"CONTAINER"),pe.addContainerBoundary(...re[Q]),this.$=re[Q];break;case 32:pe.addDeploymentNode("node",...re[Q]),this.$=re[Q];break;case 33:pe.addDeploymentNode("nodeL",...re[Q]),this.$=re[Q];break;case 34:pe.addDeploymentNode("nodeR",...re[Q]),this.$=re[Q];break;case 35:pe.popBoundaryParseStack();break;case 39:pe.addPersonOrSystem("person",...re[Q]),this.$=re[Q];break;case 40:pe.addPersonOrSystem("external_person",...re[Q]),this.$=re[Q];break;case 41:pe.addPersonOrSystem("system",...re[Q]),this.$=re[Q];break;case 42:pe.addPersonOrSystem("system_db",...re[Q]),this.$=re[Q];break;case 43:pe.addPersonOrSystem("system_queue",...re[Q]),this.$=re[Q];break;case 44:pe.addPersonOrSystem("external_system",...re[Q]),this.$=re[Q];break;case 45:pe.addPersonOrSystem("external_system_db",...re[Q]),this.$=re[Q];break;case 46:pe.addPersonOrSystem("external_system_queue",...re[Q]),this.$=re[Q];break;case 47:pe.addContainer("container",...re[Q]),this.$=re[Q];break;case 48:pe.addContainer("container_db",...re[Q]),this.$=re[Q];break;case 49:pe.addContainer("container_queue",...re[Q]),this.$=re[Q];break;case 50:pe.addContainer("external_container",...re[Q]),this.$=re[Q];break;case 51:pe.addContainer("external_container_db",...re[Q]),this.$=re[Q];break;case 52:pe.addContainer("external_container_queue",...re[Q]),this.$=re[Q];break;case 53:pe.addComponent("component",...re[Q]),this.$=re[Q];break;case 54:pe.addComponent("component_db",...re[Q]),this.$=re[Q];break;case 55:pe.addComponent("component_queue",...re[Q]),this.$=re[Q];break;case 56:pe.addComponent("external_component",...re[Q]),this.$=re[Q];break;case 57:pe.addComponent("external_component_db",...re[Q]),this.$=re[Q];break;case 58:pe.addComponent("external_component_queue",...re[Q]),this.$=re[Q];break;case 60:pe.addRel("rel",...re[Q]),this.$=re[Q];break;case 61:pe.addRel("birel",...re[Q]),this.$=re[Q];break;case 62:pe.addRel("rel_u",...re[Q]),this.$=re[Q];break;case 63:pe.addRel("rel_d",...re[Q]),this.$=re[Q];break;case 64:pe.addRel("rel_l",...re[Q]),this.$=re[Q];break;case 65:pe.addRel("rel_r",...re[Q]),this.$=re[Q];break;case 66:pe.addRel("rel_b",...re[Q]),this.$=re[Q];break;case 67:re[Q].splice(0,1),pe.addRel("rel",...re[Q]),this.$=re[Q];break;case 68:pe.updateElStyle("update_el_style",...re[Q]),this.$=re[Q];break;case 69:pe.updateRelStyle("update_rel_style",...re[Q]),this.$=re[Q];break;case 70:pe.updateLayoutConfig("update_layout_config",...re[Q]),this.$=re[Q];break;case 71:this.$=[re[Q]];break;case 72:re[Q].unshift(re[Q-1]),this.$=re[Q];break;case 73:case 75:this.$=re[Q].trim();break;case 74:let ue={};ue[re[Q-1].trim()]=re[Q].trim(),this.$=ue;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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{14:[1,74]},t(oe,[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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W}),t(oe,[2,14]),t(Z,[2,16],{12:[1,76]}),t(oe,[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:ne,77:ie,79:me,80:te},{35:86,75:81,76:ne,77:ie,79:me,80:te},{35:87,75:81,76:ne,77:ie,79:me,80:te},{35:88,75:81,76:ne,77:ie,79:me,80:te},{35:89,75:81,76:ne,77:ie,79:me,80:te},{35:90,75:81,76:ne,77:ie,79:me,80:te},{35:91,75:81,76:ne,77:ie,79:me,80:te},{35:92,75:81,76:ne,77:ie,79:me,80:te},{35:93,75:81,76:ne,77:ie,79:me,80:te},{35:94,75:81,76:ne,77:ie,79:me,80:te},{35:95,75:81,76:ne,77:ie,79:me,80:te},{35:96,75:81,76:ne,77:ie,79:me,80:te},{35:97,75:81,76:ne,77:ie,79:me,80:te},{35:98,75:81,76:ne,77:ie,79:me,80:te},{35:99,75:81,76:ne,77:ie,79:me,80:te},{35:100,75:81,76:ne,77:ie,79:me,80:te},{35:101,75:81,76:ne,77:ie,79:me,80:te},{35:102,75:81,76:ne,77:ie,79:me,80:te},{35:103,75:81,76:ne,77:ie,79:me,80:te},{35:104,75:81,76:ne,77:ie,79:me,80:te},t(Re,[2,59]),{35:105,75:81,76:ne,77:ie,79:me,80:te},{35:106,75:81,76:ne,77:ie,79:me,80:te},{35:107,75:81,76:ne,77:ie,79:me,80:te},{35:108,75:81,76:ne,77:ie,79:me,80:te},{35:109,75:81,76:ne,77:ie,79:me,80:te},{35:110,75:81,76:ne,77:ie,79:me,80:te},{35:111,75:81,76:ne,77:ie,79:me,80:te},{35:112,75:81,76:ne,77:ie,79:me,80:te},{35:113,75:81,76:ne,77:ie,79:me,80:te},{35:114,75:81,76:ne,77:ie,79:me,80:te},{35:115,75:81,76:ne,77:ie,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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W},{12:[1,118],33:[1,117]},{35:119,75:81,76:ne,77:ie,79:me,80:te},{35:120,75:81,76:ne,77:ie,79:me,80:te},{35:121,75:81,76:ne,77:ie,79:me,80:te},{35:122,75:81,76:ne,77:ie,79:me,80:te},{35:123,75:81,76:ne,77:ie,79:me,80:te},{35:124,75:81,76:ne,77:ie,79:me,80:te},{35:125,75:81,76:ne,77:ie,79:me,80:te},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(oe,[2,15]),t(Z,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(oe,[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:U,48:y,49:b,50:v,51:w,52:T,53:k,54:C,55:S,56:E,57:A,58:R,59:_,60:N,61:L,62:I,63:P,64:O,65:D,66:B,67:F,68:z,69:$,70:V,71:H,72:G,73:K,74:W}),t(J,[2,21]),t(J,[2,22]),t(Re,[2,39]),t(Pe,[2,71],{75:81,35:132,76:ne,77:ie,79:me,80:te}),t(Ve,[2,73]),{78:[1,133]},t(Ve,[2,75]),t(Ve,[2,76]),t(Re,[2,40]),t(Re,[2,41]),t(Re,[2,42]),t(Re,[2,43]),t(Re,[2,44]),t(Re,[2,45]),t(Re,[2,46]),t(Re,[2,47]),t(Re,[2,48]),t(Re,[2,49]),t(Re,[2,50]),t(Re,[2,51]),t(Re,[2,52]),t(Re,[2,53]),t(Re,[2,54]),t(Re,[2,55]),t(Re,[2,56]),t(Re,[2,57]),t(Re,[2,58]),t(Re,[2,60]),t(Re,[2,61]),t(Re,[2,62]),t(Re,[2,63]),t(Re,[2,64]),t(Re,[2,65]),t(Re,[2,66]),t(Re,[2,67]),t(Re,[2,68]),t(Re,[2,69]),t(Re,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Z,[2,18]),t(oe,[2,38]),t(Pe,[2,72]),t(Ve,[2,74]),t(Re,[2,24]),t(Re,[2,35]),t(he,[2,25]),t(he,[2,26],{12:[1,138]}),t(he,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ee,qe){if(qe.recoverable)this.trace(Ee);else{var le=new Error(Ee);throw le.hash=qe,le}},"parseError"),parse:x(function(Ee){var qe=this,le=[0],pe=[],Te=[null],re=[],Y=this.table,Q="",ue=0,X=0,fe=2,ee=1,Ae=re.slice.call(arguments,1),Me=Object.create(this.lexer),Ke={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(Ke.yy[Ne]=this.yy[Ne]);Me.setInput(Ee,Ke.yy),Ke.yy.lexer=Me,Ke.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var je=Me.yylloc;re.push(je);var De=Me.options&&Me.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(ve){le.length=le.length-2*ve,Te.length=Te.length-ve,re.length=re.length-ve}x(Ze,"popStack");function Fe(){var ve;return ve=pe.pop()||Me.lex()||ee,typeof ve!="number"&&(ve instanceof Array&&(pe=ve,ve=pe.pop()),ve=qe.symbols_[ve]||ve),ve}x(Fe,"lex");for(var at,_e,gt,Le,kt={},Et,ot,Vt,Lt;;){if(_e=le[le.length-1],this.defaultActions[_e]?gt=this.defaultActions[_e]:((at===null||typeof at>"u")&&(at=Fe()),gt=Y[_e]&&Y[_e][at]),typeof gt>"u"||!gt.length||!gt[0]){var dt="";Lt=[];for(Et in Y[_e])this.terminals_[Et]&&Et>fe&&Lt.push("'"+this.terminals_[Et]+"'");Me.showPosition?dt="Parse error on line "+(ue+1)+`: +`+Me.showPosition()+` +Expecting `+Lt.join(", ")+", got '"+(this.terminals_[at]||at)+"'":dt="Parse error on line "+(ue+1)+": Unexpected "+(at==ee?"end of input":"'"+(this.terminals_[at]||at)+"'"),this.parseError(dt,{text:Me.match,token:this.terminals_[at]||at,line:Me.yylineno,loc:je,expected:Lt})}if(gt[0]instanceof Array&>.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+at);switch(gt[0]){case 1:le.push(at),Te.push(Me.yytext),re.push(Me.yylloc),le.push(gt[1]),at=null,X=Me.yyleng,Q=Me.yytext,ue=Me.yylineno,je=Me.yylloc;break;case 2:if(ot=this.productions_[gt[1]][1],kt.$=Te[Te.length-ot],kt._$={first_line:re[re.length-(ot||1)].first_line,last_line:re[re.length-1].last_line,first_column:re[re.length-(ot||1)].first_column,last_column:re[re.length-1].last_column},De&&(kt._$.range=[re[re.length-(ot||1)].range[0],re[re.length-1].range[1]]),Le=this.performAction.apply(kt,[Q,X,ue,Ke.yy,gt[1],Te,re].concat(Ae)),typeof Le<"u")return Le;ot&&(le=le.slice(0,-1*ot*2),Te=Te.slice(0,-1*ot),re=re.slice(0,-1*ot)),le.push(this.productions_[gt[1]][0]),Te.push(kt.$),re.push(kt._$),Vt=Y[le[le.length-2]][le[le.length-1]],le.push(Vt);break;case 3:return!0}}return!0},"parse")},ge=(function(){var xe={EOF:1,parseError:x(function(qe,le){if(this.yy.parser)this.yy.parser.parseError(qe,le);else throw new Error(qe)},"parseError"),setInput:x(function(Ee,qe){return this.yy=qe||this.yy||{},this._input=Ee,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ee=this._input[0];this.yytext+=Ee,this.yyleng++,this.offset++,this.match+=Ee,this.matched+=Ee;var qe=Ee.match(/(?:\r\n?|\n).*/g);return qe?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ee},"input"),unput:x(function(Ee){var qe=Ee.length,le=Ee.split(/(?:\r\n?|\n)/g);this._input=Ee+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-qe),this.offset-=qe;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 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:le?(le.length===pe.length?this.yylloc.first_column:0)+pe[pe.length-le.length].length-le[0].length:this.yylloc.first_column-qe},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-qe]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ee){this.unput(this.match.slice(Ee))},"less"),pastInput:x(function(){var Ee=this.matched.substr(0,this.matched.length-this.match.length);return(Ee.length>20?"...":"")+Ee.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ee=this.match;return Ee.length<20&&(Ee+=this._input.substr(0,20-Ee.length)),(Ee.substr(0,20)+(Ee.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ee=this.pastInput(),qe=new Array(Ee.length+1).join("-");return Ee+this.upcomingInput()+` +`+qe+"^"},"showPosition"),test_match:x(function(Ee,qe){var le,pe,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))),pe=Ee[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+Ee[0].length},this.yytext+=Ee[0],this.match+=Ee[0],this.matches=Ee,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(Ee[0].length),this.matched+=Ee[0],le=this.performAction.call(this,this.yy,this,qe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),le)return le;if(this._backtrack){for(var re in Te)this[re]=Te[re];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ee,qe,le,pe;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),re=0;reqe[0].length)){if(qe=le,pe=re,this.options.backtrack_lexer){if(Ee=this.test_match(le,Te[re]),Ee!==!1)return Ee;if(this._backtrack){qe=!1;continue}else return!1}else if(!this.options.flex)break}return qe?(Ee=this.test_match(qe,Te[pe]),Ee!==!1?Ee:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var qe=this.next();return qe||this.lex()},"lex"),begin:x(function(qe){this.conditionStack.push(qe)},"begin"),popState:x(function(){var qe=this.conditionStack.length-1;return qe>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(qe){return qe=this.conditionStack.length-1-Math.abs(qe||0),qe>=0?this.conditionStack[qe]:"INITIAL"},"topState"),pushState:x(function(qe){this.begin(qe)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(qe,le,pe,Te){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 xe})();we.lexer=ge;function ze(){this.yy={}}return x(ze,"Parser"),ze.prototype=we,we.Parser=ze,new ze})();lN.parser=lN;var Ztr=lN,Gh=[],Rg=[""],$l="global",Dh="",tf=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],eC=[],Ire="",Nre=!1,cN=4,uN=2,VOe,Jtr=x(function(){return VOe},"getC4Type"),Qtr=x(function(t){VOe=Dn(t,He())},"setC4Type"),err=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=eC.find(d=>d.from===e&&d.to===r);if(h?u=h:eC.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=_1()},"addRel"),trr=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=Gh.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,Gh.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=$l,o.wrap=_1()},"addPersonOrSystem"),rrr=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Gh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gh.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=_1(),l.typeC4Shape={text:t},l.parentBoundary=$l},"addContainer"),nrr=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=Gh.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gh.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=_1(),l.typeC4Shape={text:t},l.parentBoundary=$l},"addComponent"),irr=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tf.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tf.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=$l,a.wrap=_1(),Dh=$l,$l=t,Rg.push(Dh)},"addPersonOrSystemBoundary"),arr=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tf.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tf.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=$l,a.wrap=_1(),Dh=$l,$l=t,Rg.push(Dh)},"addContainerBoundary"),srr=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=tf.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,tf.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=$l,l.wrap=_1(),Dh=$l,$l=e,Rg.push(Dh)},"addDeploymentNode"),orr=x(function(){$l=Dh,Rg.pop(),Dh=Rg.pop(),Rg.push(Dh)},"popBoundaryParseStack"),lrr=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=Gh.find(f=>f.alias===e);if(!(d===void 0&&(d=tf.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"),crr=x(function(t,e,r,n,i,a,s){const o=eC.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"),urr=x(function(t,e,r){let n=cN,i=uN;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&&(cN=n),i>=1&&(uN=i)},"updateLayoutConfig"),hrr=x(function(){return cN},"getC4ShapeInRow"),drr=x(function(){return uN},"getC4BoundaryInRow"),frr=x(function(){return $l},"getCurrentBoundaryParse"),prr=x(function(){return Dh},"getParentBoundaryParse"),HOe=x(function(t){return t==null?Gh:Gh.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),grr=x(function(t){return Gh.find(e=>e.alias===t)},"getC4Shape"),mrr=x(function(t){return Object.keys(HOe(t))},"getC4ShapeKeys"),GOe=x(function(t){return t==null?tf:tf.filter(e=>e.parentBoundary===t)},"getBoundaries"),Urr=GOe,yrr=x(function(){return eC},"getRels"),brr=x(function(){return Ire},"getTitle"),vrr=x(function(t){Nre=t},"setWrap"),_1=x(function(){return Nre},"autoWrap"),xrr=x(function(){Gh=[],tf=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Dh="",$l="global",Rg=[""],eC=[],Rg=[""],Ire="",Nre=!1,cN=4,uN=2},"clear"),wrr={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},Trr={FILLED:0,OPEN:1},Crr={LEFTOF:0,RIGHTOF:1,OVER:2},krr=x(function(t){Ire=Dn(t,He())},"setTitle"),oY={addPersonOrSystem:trr,addPersonOrSystemBoundary:irr,addContainer:rrr,addContainerBoundary:arr,addComponent:nrr,addDeploymentNode:srr,popBoundaryParseStack:orr,addRel:err,updateElStyle:lrr,updateRelStyle:crr,updateLayoutConfig:urr,autoWrap:_1,setWrap:vrr,getC4ShapeArray:HOe,getC4Shape:grr,getC4ShapeKeys:mrr,getBoundaries:GOe,getBoundarys:Urr,getCurrentBoundaryParse:frr,getParentBoundaryParse:prr,getRels:yrr,getTitle:brr,getC4Type:Jtr,getC4ShapeInRow:hrr,getC4BoundaryInRow:drr,setAccTitle:qi,getAccTitle:ia,getAccDescription:sa,setAccDescription:aa,getConfig:x(()=>He().c4,"getConfig"),clear:xrr,LINETYPE:wrr,ARROWTYPE:Trr,PLACEMENT:Crr,setTitle:krr,setC4Type:Qtr},Dre=x(function(t,e){return j_(t,e)},"drawRect"),WOe=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:E5.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),Srr=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();u0(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(),u0(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"),Err=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Dre(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,u0(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,u0(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,u0(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),Arr=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=uu();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},Dre(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=_rr(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":WOe(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,u0(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)!==""?u0(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!==""&&u0(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,u0(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),Mrr=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Rrr=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Lrr=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Irr=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),Nrr=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Drr=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Orr=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),_rr=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),u0=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Ht.lineBreakRegex);for(let U=0;U=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>qOe)&&(r=this.nextData.startx+e.margin+Sr.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},cY(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(W6,"Bounds"),W6),cY=x(function(t){ss(Sr,t),t.fontFamily&&(Sr.personFontFamily=Sr.systemFontFamily=Sr.messageFontFamily=t.fontFamily),t.fontSize&&(Sr.personFontSize=Sr.systemFontSize=Sr.messageFontSize=t.fontSize),t.fontWeight&&(Sr.personFontWeight=Sr.systemFontWeight=Sr.messageFontWeight=t.fontWeight)},"setConf"),u3=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),CM=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Prr=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Pu(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Gx(e[t].text,i,n),e[t].textLines=e[t].text.split(Ht.lineBreakRegex).length,e[t].width=i,e[t].height=mL(e[t].text,n);else{let a=e[t].text.split(Ht.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(Bl(o,n),e[t].width),s=mL(o,n),e[t].height=e[t].height+s}}x(Pu,"calcC4ShapeTextWH");var YOe=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Sr.c4ShapeMargin-35;let n=e.wrap&&Sr.wrap,i=CM(Sr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Bl(e.label.text,i);Pu("label",e,n,i,a),wd.drawBoundary(t,e,Sr)},"drawBoundary"),XOe=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=u3(Sr,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=Bl("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Sr.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&&Sr.wrap,u=Sr.width-Sr.c4ShapePadding*2,h=u3(Sr,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pu("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=u3(Sr,s.typeC4Shape.text);Pu("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=u3(Sr,s.techn.text);Pu("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=u3(Sr,s.typeC4Shape.text);Pu("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+Sr.c4ShapePadding,s.width=Math.max(s.width||Sr.width,f,Sr.width),s.height=Math.max(s.height||Sr.height,d,Sr.height),s.margin=s.margin||Sr.c4ShapeMargin,t.insert(s),wd.drawC4Shape(e,s,Sr)}t.bumpLastMargin(Sr.c4ShapeMargin)},"drawC4ShapeArray"),q6,bu=(q6=class{constructor(e,r){this.x=e,this.y=r}},x(q6,"Point"),q6),Xme=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&ri?f=new bu(r,o):r==i&&na&&(f=new bu(s,n)),r>i&&n=h?f=new bu(r,o+h*t.width/2):f=new bu(s-l/u*t.height/2,n+t.height):r=h?f=new bu(r+t.width,o+h*t.width/2):f=new bu(s+l/u*t.height/2,n+t.height):ra?d>=h?f=new bu(r+t.width,o-h*t.width/2):f=new bu(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new bu(r,o-t.width/2*h):f=new bu(s-t.height/2*l/u,n)),f},"getIntersectPoint"),Brr=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Xme(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Xme(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),$rr=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Sr.wrap,l=Prr(Sr);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=Bl(s.label.text,l);Pu("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=Bl(s.techn.text,l),Pu("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=Bl(s.descr.text,l),Pu("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=Brr(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}wd.drawRels(t,e,Sr,i)},"drawRels");function Ore(t,e,r,n,i){let a=new jOe(i);a.data.widthLimit=r.data.widthLimit/Math.min(lY,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&&Sr.wrap,h=CM(Sr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pu("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=CM(Sr);Pu("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=CM(Sr);g.fontSize=g.fontSize-2,Pu("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%lY===0){let g=r.data.startx+Sr.diagramMarginX,m=r.data.stopy+Sr.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Sr.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&&XOe(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&Ore(t,e,a,p,i),o.alias!=="global"&&YOe(t,o,a),r.data.stopy=Math.max(a.data.stopy+Sr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Sr.c4ShapeMargin,r.data.stopx),hN=Math.max(hN,r.data.stopx),dN=Math.max(dN,r.data.stopy)}}x(Ore,"drawInsideBoundary");var Frr=x(function(t,e,r,n){Sr=He().c4;const i=He().securityLevel;let a;i==="sandbox"&&(a=vt("#i"+e));const s=vt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Sr.wrap),qOe=o.getC4ShapeInRow(),lY=o.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(Sr,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):vt(`[id="${e}"]`);wd.insertComputerIcon(l,e),wd.insertDatabaseIcon(l,e),wd.insertClockIcon(l,e);let u=new jOe(n);u.setData(Sr.diagramMarginX,Sr.diagramMarginX,Sr.diagramMarginY,Sr.diagramMarginY),u.data.widthLimit=screen.availWidth,hN=Sr.diagramMarginX,dN=Sr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");Ore(l,"",u,d,n),wd.insertArrowHead(l,e),wd.insertArrowEnd(l,e),wd.insertArrowCrossHead(l,e),wd.insertArrowFilledHead(l,e),$rr(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=hN,u.data.stopy=dN;const f=u.data;let g=f.stopy-f.starty+2*Sr.diagramMarginY;const U=f.stopx-f.startx+2*Sr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Sr.diagramMarginX).attr("y",f.starty+Sr.diagramMarginY),Ga(l,g,U,Sr.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Sr.diagramMarginX+" -"+(Sr.diagramMarginY+y)+" "+U+" "+(g+y)),de.debug("models:",f)},"draw"),Kme={drawPersonOrSystemArray:XOe,drawBoundary:YOe,setConf:cY,draw:Frr},zrr=x(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),brr=vrr,xrr={parser:Mtr,db:eY,renderer:z1e,styles:brr,init:w(({c4:t,wrap:e})=>{z1e.setConf(t),eY.setWrap(e)},"init")};const wrr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xrr},Symbol.toStringTag,{value:"Module"}));var M7=w(()=>` +`,"getStyles"),Vrr=zrr,Hrr={parser:Ztr,db:oY,renderer:Kme,styles:Vrr,init:x(({c4:t,wrap:e})=>{Kme.setConf(t),oY.setWrap(e)},"init")};const Grr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hrr},Symbol.toStringTag,{value:"Module"}));var Lk=x(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -3419,21 +3552,21 @@ Expecting `+_t.join(", ")+", got '"+(this.terminals_[st]||st)+"'":dt="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),pC=w((t,e)=>{let r;return e==="sandbox"&&(r=xt("#i"+t)),xt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),Ov=w((t,e,r,n)=>{t.attr("class",r);const{width:i,height:s,x:a,y:o}=Trr(t,e);qs(t,s,i,n);const l=Crr(a,o,i,s,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),Trr=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"),Crr=w((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),krr="flowchart-",Gx,Srr=(Gx=class{constructor(){this.vertexCounter=0,this.config=He(),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=qi,this.setAccDescription=is,this.setDiagramTitle=ts,this.getAccTitle=ns,this.getAccDescription=ss,this.getDiagramTitle=ji,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 Gt.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,s,a,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),U9=x((t,e)=>{let r;return e==="sandbox"&&(r=vt("#i"+t)),vt(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),P5=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=Wrr(t,e);Ga(t,a,i,n);const l=qrr(s,o,i,a,e);t.attr("viewBox",l),de.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),Wrr=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),qrr=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),jrr="flowchart-",j6,Yrr=(j6=class{constructor(){this.vertexCounter=0,this.config=He(),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=qi,this.setAccDescription=aa,this.setDiagramTitle=ra,this.getAccTitle=ia,this.getAccDescription=sa,this.getDiagramTitle=Yi,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 Ht.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=pD(m,{schema:fD})}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&&de.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:krr+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=He(),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)}),s!=null&&s.forEach(m=>{f.classes.push(m)}),a!==void 0&&(f.dir=a),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(!DAe(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};de.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=lx(o.start,o.end,{counter:0,prefix:"L"}):o.id=lx(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))de.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=UO(m,{schema:mO})}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&&de.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:jrr+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=He(),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(!WCe(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};de.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=d6(o.start,o.end,{counter:0,prefix:"L"}):o.id=d6(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))de.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;de.info("addLink",e,r,i);for(const s of e)for(const a of r){const o=s===e[e.length-1],l=a===r[0];o&&l?this.addSingleLink(s,a,n,i):this.addSingleLink(s,a,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,s,a,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,(((s=(i=this.edges[n])==null?void 0:i.style)==null?void 0:s.length)??0)>0&&!((o=(a=this.edges[n])==null?void 0:a.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 s=this.classes.get(i);s===void 0&&(s={id:i,styles:[],textStyles:[]},this.classes.set(i,s)),n!=null&&n.forEach(a=>{if(/color/.exec(a)){const o=a.replace("fill","bgFill");s.textStyles.push(o)}s.styles.push(a)})})}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 s=this.edges.find(o=>o.id===n);s&&s.classes.push(r);const a=this.subGraphLookup.get(n);a&&a.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(He().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{const a=this.lookUpDomId(e),o=document.querySelector(`[id="${a}"]`);o!==null&&o.addEventListener("click",()=>{Kr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const s=this.vertices.get(i);s!==void 0&&(s.link=Kr.formatUrl(r,this.config),s.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=Cre();xt(e).select("svg").selectAll("g.node").on("mouseover",s=>{var u;const a=xt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(a.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(M0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),xt(s.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=He(),Oi()}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(),s=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(x){const T=typeof x;return x.stmt&&x.stmt==="dir"?(v=x.value,!1):x.trim()===""?!1:T in m?m[T].hasOwnProperty(x)?!1:m[T][x]=!0:y.includes(x)?!1:y.push(x)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=He().flowchart??{},f=u??(d.inheritDir?this.getDirection()??He().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,s=1;for(;i=0){const o=this.indexNodes2(e,a);if(o.result)return{result:!0,count:s+o.count};s=s+o.count}i=i+1}return{result:!1,count:s}}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 s=0;s":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 s="normal",a=n.length-1;n.startsWith("=")&&(s="thick"),n.startsWith("~")&&(s="invisible");const o=this.countChar(".",n);return o&&(s="dotted",a=o),{type:i,stroke:s,length:a}}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,s)=>{this.exists(r,i)||n.push(e.nodes[s])}),{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,s,a){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=s.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:a,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(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}getData(){const e=He(),r=[],n=[],i=this.getSubGraphs(),s=new Map,a=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&a.set(h.id,!0);for(const d of h.nodes)s.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:s.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,s,a,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:lx(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 rCe.flowchart}},w(Gx,"FlowDB"),Gx),Err=w(function(t,e){return e.db.getClasses()},"getClasses"),Arr=w(async function(t,e,r,n,i){var f;de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:s,flowchart:a,layout:o}=He();n.db.setDiagramId(e),de.debug("Before getData: ");const l=n.db.getData();de.debug("Data: ",l);const u=pC(e,s),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=a7(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&de.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,l.rankSpacing=(a==null?void 0:a.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,de.debug("REF1:",l),await Y3(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Kr.insertTitle(u,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Ov(u,d,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),Mrr={getClasses:Err,draw:Arr},nY=(function(){var t=w(function(ln,Ct,vt,Dt){for(vt=vt||{},Dt=ln.length;Dt--;vt[ln[Dt]]=Ct);return vt},"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],s=[2,2],a=[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],b=[1,31],x=[1,32],T=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],A=[1,44],M=[1,51],R=[1,46],P=[1,52],N=[1,53],L=[1,34],I=[1,35],$=[1,36],O=[1,37],D=[1,38],B=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],F=[1,61],H=[1,63],G=[8,9,11,75,77,78],W=[1,79],K=[1,92],q=[1,97],oe=[1,96],Z=[1,93],Q=[1,89],ne=[1,95],ie=[1,91],me=[1,98],te=[1,94],_e=[1,99],$e=[1,90],Ve=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],he=[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],ze=[1,122],we=[1,123],Ae=[1,125],qe=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Ce=[1,148],re=[1,149],Y=[1,150],J=[1,151],ue=[1,136],X=[1,138],fe=[1,142],ee=[1,143],Me=[1,144],Re=[1,145],Ke=[1,146],Ne=[1,147],je=[1,152],Oe=[1,153],Ze=[1,132],Fe=[1,133],st=[1,140],Pe=[1,135],gt=[1,139],Le=[1,137],kt=[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],Et=[1,155],ot=[1,157],Ht=[8,9,11],_t=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],dt=[1,177],xe=[1,173],Lt=[1,174],wt=[1,178],mt=[1,175],Mt=[1,176],Or=[77,116,119],Ee=[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],it=[10,106],pt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],bt=[1,248],nr=[1,246],$r=[1,250],kr=[1,244],jr=[1,245],Er=[1,247],nn=[1,249],Cr=[1,251],Yr=[1,269],Tn=[8,9,11,106],ut=[8,9,10,11,60,84,105,106,109,110,111,112],yt={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(Ct,vt,Dt,ft,ar,Ie,ci){var Be=Ie.length-1;switch(ar){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Be])||Ie[Be].length>0)&&Ie[Be-1].push(Ie[Be]),this.$=Ie[Be-1];break;case 4:case 183:this.$=Ie[Be];break;case 11:ft.setDirection("TB"),this.$="TB";break;case 12:ft.setDirection(Ie[Be-1]),this.$=Ie[Be-1];break;case 27:this.$=Ie[Be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=ft.addSubGraph(Ie[Be-6],Ie[Be-1],Ie[Be-4]);break;case 34:this.$=ft.addSubGraph(Ie[Be-3],Ie[Be-1],Ie[Be-3]);break;case 35:this.$=ft.addSubGraph(void 0,Ie[Be-1],void 0);break;case 37:this.$=Ie[Be].trim(),ft.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Be].trim(),ft.setAccDescription(this.$);break;case 43:this.$=Ie[Be-1]+Ie[Be];break;case 44:this.$=Ie[Be];break;case 45:ft.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),ft.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 46:ft.addLink(Ie[Be-2].stmt,Ie[Be],Ie[Be-1]),this.$={stmt:Ie[Be],nodes:Ie[Be].concat(Ie[Be-2].nodes)};break;case 47:ft.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 48:this.$={stmt:Ie[Be-1],nodes:Ie[Be-1]};break;case 49:ft.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1],shapeData:Ie[Be]};break;case 50:this.$={stmt:Ie[Be],nodes:Ie[Be]};break;case 51:this.$=[Ie[Be]];break;case 52:ft.addVertex(Ie[Be-5][Ie[Be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be-4]),this.$=Ie[Be-5].concat(Ie[Be]);break;case 53:this.$=Ie[Be-4].concat(Ie[Be]);break;case 54:this.$=Ie[Be];break;case 55:this.$=Ie[Be-2],ft.setClass(Ie[Be-2],Ie[Be]);break;case 56:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"square");break;case 57:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"doublecircle");break;case 58:this.$=Ie[Be-5],ft.addVertex(Ie[Be-5],Ie[Be-2],"circle");break;case 59:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"ellipse");break;case 60:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"stadium");break;case 61:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"subroutine");break;case 62:this.$=Ie[Be-7],ft.addVertex(Ie[Be-7],Ie[Be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Be-5],Ie[Be-3]]]));break;case 63:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"cylinder");break;case 64:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"round");break;case 65:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"diamond");break;case 66:this.$=Ie[Be-5],ft.addVertex(Ie[Be-5],Ie[Be-2],"hexagon");break;case 67:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"odd");break;case 68:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"trapezoid");break;case 69:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"inv_trapezoid");break;case 70:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"lean_right");break;case 71:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"lean_left");break;case 72:this.$=Ie[Be],ft.addVertex(Ie[Be]);break;case 73:Ie[Be-1].text=Ie[Be],this.$=Ie[Be-1];break;case 74:case 75:Ie[Be-2].text=Ie[Be-1],this.$=Ie[Be-2];break;case 76:this.$=Ie[Be];break;case 77:var cn=ft.destructLink(Ie[Be],Ie[Be-2]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,text:Ie[Be-1]};break;case 78:var cn=ft.destructLink(Ie[Be],Ie[Be-2]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,text:Ie[Be-1],id:Ie[Be-3]};break;case 79:this.$={text:Ie[Be],type:"text"};break;case 80:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 81:this.$={text:Ie[Be],type:"string"};break;case 82:this.$={text:Ie[Be],type:"markdown"};break;case 83:var cn=ft.destructLink(Ie[Be]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length};break;case 84:var cn=ft.destructLink(Ie[Be]);this.$={type:cn.type,stroke:cn.stroke,length:cn.length,id:Ie[Be-1]};break;case 85:this.$=Ie[Be-1];break;case 86:this.$={text:Ie[Be],type:"text"};break;case 87:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 88:this.$={text:Ie[Be],type:"string"};break;case 89:case 104:this.$={text:Ie[Be],type:"markdown"};break;case 101:this.$={text:Ie[Be],type:"text"};break;case 102:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 103:this.$={text:Ie[Be],type:"text"};break;case 105:this.$=Ie[Be-4],ft.addClass(Ie[Be-2],Ie[Be]);break;case 106:this.$=Ie[Be-4],ft.setClass(Ie[Be-2],Ie[Be]);break;case 107:case 115:this.$=Ie[Be-1],ft.setClickEvent(Ie[Be-1],Ie[Be]);break;case 108:case 116:this.$=Ie[Be-3],ft.setClickEvent(Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-3],Ie[Be]);break;case 109:this.$=Ie[Be-2],ft.setClickEvent(Ie[Be-2],Ie[Be-1],Ie[Be]);break;case 110:this.$=Ie[Be-4],ft.setClickEvent(Ie[Be-4],Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-4],Ie[Be]);break;case 111:this.$=Ie[Be-2],ft.setLink(Ie[Be-2],Ie[Be]);break;case 112:this.$=Ie[Be-4],ft.setLink(Ie[Be-4],Ie[Be-2]),ft.setTooltip(Ie[Be-4],Ie[Be]);break;case 113:this.$=Ie[Be-4],ft.setLink(Ie[Be-4],Ie[Be-2],Ie[Be]);break;case 114:this.$=Ie[Be-6],ft.setLink(Ie[Be-6],Ie[Be-4],Ie[Be]),ft.setTooltip(Ie[Be-6],Ie[Be-2]);break;case 117:this.$=Ie[Be-1],ft.setLink(Ie[Be-1],Ie[Be]);break;case 118:this.$=Ie[Be-3],ft.setLink(Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-3],Ie[Be]);break;case 119:this.$=Ie[Be-3],ft.setLink(Ie[Be-3],Ie[Be-2],Ie[Be]);break;case 120:this.$=Ie[Be-5],ft.setLink(Ie[Be-5],Ie[Be-4],Ie[Be]),ft.setTooltip(Ie[Be-5],Ie[Be-2]);break;case 121:this.$=Ie[Be-4],ft.addVertex(Ie[Be-2],void 0,void 0,Ie[Be]);break;case 122:this.$=Ie[Be-4],ft.updateLink([Ie[Be-2]],Ie[Be]);break;case 123:this.$=Ie[Be-4],ft.updateLink(Ie[Be-2],Ie[Be]);break;case 124:this.$=Ie[Be-8],ft.updateLinkInterpolate([Ie[Be-6]],Ie[Be-2]),ft.updateLink([Ie[Be-6]],Ie[Be]);break;case 125:this.$=Ie[Be-8],ft.updateLinkInterpolate(Ie[Be-6],Ie[Be-2]),ft.updateLink(Ie[Be-6],Ie[Be]);break;case 126:this.$=Ie[Be-6],ft.updateLinkInterpolate([Ie[Be-4]],Ie[Be]);break;case 127:this.$=Ie[Be-6],ft.updateLinkInterpolate(Ie[Be-4],Ie[Be]);break;case 128:case 130:this.$=[Ie[Be]];break;case 129:case 131:Ie[Be-2].push(Ie[Be]),this.$=Ie[Be-2];break;case 133:this.$=Ie[Be-1]+Ie[Be];break;case 181:this.$=Ie[Be];break;case 182:this.$=Ie[Be-1]+""+Ie[Be];break;case 184:this.$=Ie[Be-1]+""+Ie[Be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,s,{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:a,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:b,87:x,88:T,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:B,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:F,11:H,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:F,11:H,21:68},{8:V,9:F,11:H,21:69},{8:V,9:F,11:H,21:70},{8:V,9:F,11:H,21:71},{8:V,9:F,11:H,21:72},{8:V,9:F,10:[1,73],11:H,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(G,[2,50],{18:77,39:78,10:B,40:W}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:K,44:q,60:oe,80:[1,87],89:Z,95:[1,84],97:[1,85],101:86,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Ve,[2,51]),t(Ve,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:A,111:M,114:R,115:P,116:N}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(Te,[2,26],{18:115,10:B}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,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:ze,81:we,116:Ae,119:qe},{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:re,27:Y,28:128,32:J,44:ue,60:X,75:fe,80:[1,130],81:[1,131],83:141,84:ee,85:Me,86:Re,87:Ke,88:Ne,89:je,90:Oe,91:129,105:Ze,109:Fe,111:st,114:Pe,115:gt,116:Le},t(kt,s,{5:154}),t(z,[2,37]),t(z,[2,38]),t(G,[2,48],{44:Et}),t(G,[2,49],{18:156,10:B,40:ot}),t(Ve,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},t(Ht,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Ht,[2,115],{120:168,10:[1,167],14:K,44:q,60:oe,89:Z,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e}),t(Ht,[2,117],{10:[1,169]}),t(_t,[2,183]),t(_t,[2,170]),t(_t,[2,171]),t(_t,[2,172]),t(_t,[2,173]),t(_t,[2,174]),t(_t,[2,175]),t(_t,[2,176]),t(_t,[2,177]),t(_t,[2,178]),t(_t,[2,179]),t(_t,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},{30:171,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:179,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:181,50:[1,180],67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:182,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:183,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:184,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{109:[1,185]},{30:186,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:187,65:[1,188],67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:189,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:190,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{30:191,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},t(he,[2,182]),t(i,[2,20]),t(Te,[2,25]),t(G,[2,46],{39:192,18:193,10:B,40:W}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{77:[1,197],79:198,116:Ae,119:qe},t(Or,[2,79]),t(Or,[2,81]),t(Or,[2,82]),t(Or,[2,168]),t(Or,[2,169]),{76:199,79:121,80:ze,81:we,116:Ae,119:qe},t(le,[2,84]),{8:V,9:F,10:pe,11:H,12:Ce,14:re,21:201,27:Y,29:[1,200],32:J,44:ue,60:X,75:fe,83:141,84:ee,85:Me,86:Re,87:Ke,88:Ne,89:je,90:Oe,91:202,105:Ze,109:Fe,111:st,114:Pe,115:gt,116:Le},t(Ee,[2,101]),t(Ee,[2,103]),t(Ee,[2,104]),t(Ee,[2,157]),t(Ee,[2,158]),t(Ee,[2,159]),t(Ee,[2,160]),t(Ee,[2,161]),t(Ee,[2,162]),t(Ee,[2,163]),t(Ee,[2,164]),t(Ee,[2,165]),t(Ee,[2,166]),t(Ee,[2,167]),t(Ee,[2,90]),t(Ee,[2,91]),t(Ee,[2,92]),t(Ee,[2,93]),t(Ee,[2,94]),t(Ee,[2,95]),t(Ee,[2,96]),t(Ee,[2,97]),t(Ee,[2,98]),t(Ee,[2,99]),t(Ee,[2,100]),{6:11,7:12,8:a,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:b,87:x,88:T,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:B,18:204},{44:[1,205]},t(Ve,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:113,114:R,115:P,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(it,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:113,114:R,115:P,116:N},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:113,114:R,115:P,116:N},{80:[1,212]},t(Ht,[2,109],{10:[1,213]}),t(Ht,[2,111],{10:[1,214]}),{80:[1,215]},t(_t,[2,184]),{80:[1,216],98:[1,217]},t(Ve,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:M,114:R,115:P,116:N}),{31:[1,218],67:dt,82:219,116:wt,117:mt,118:Mt},t(pt,[2,86]),t(pt,[2,88]),t(pt,[2,89]),t(pt,[2,153]),t(pt,[2,154]),t(pt,[2,155]),t(pt,[2,156]),{49:[1,220],67:dt,82:219,116:wt,117:mt,118:Mt},{30:221,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{51:[1,222],67:dt,82:219,116:wt,117:mt,118:Mt},{53:[1,223],67:dt,82:219,116:wt,117:mt,118:Mt},{55:[1,224],67:dt,82:219,116:wt,117:mt,118:Mt},{57:[1,225],67:dt,82:219,116:wt,117:mt,118:Mt},{60:[1,226]},{64:[1,227],67:dt,82:219,116:wt,117:mt,118:Mt},{66:[1,228],67:dt,82:219,116:wt,117:mt,118:Mt},{30:229,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},{31:[1,230],67:dt,82:219,116:wt,117:mt,118:Mt},{67:dt,69:[1,231],71:[1,232],82:219,116:wt,117:mt,118:Mt},{67:dt,69:[1,234],71:[1,233],82:219,116:wt,117:mt,118:Mt},t(G,[2,45],{18:156,10:B,40:ot}),t(G,[2,47],{44:Et}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:dt,82:219,116:wt,117:mt,118:Mt},t(ge,[2,77]),t(Or,[2,80]),{77:[1,236],79:198,116:Ae,119:qe},{30:237,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},t(kt,s,{5:238}),t(Ee,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},{10:B,18:240},{10:bt,60:nr,84:$r,92:241,105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},{10:bt,60:nr,84:$r,92:252,104:[1,253],105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},{10:bt,60:nr,84:$r,92:254,104:[1,255],105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},{105:[1,256]},{10:bt,60:nr,84:$r,92:257,105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},t(Ht,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Ht,[2,116]),t(Ht,[2,118],{10:[1,262]}),t(Ht,[2,119]),t(ce,[2,56]),t(pt,[2,87]),t(ce,[2,57]),{51:[1,263],67:dt,82:219,116:wt,117:mt,118:Mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:dt,82:219,116:wt,117:mt,118:Mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:dt,82:219,116:wt,117:mt,118:Mt},{6:11,7:12,8:a,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:b,87:x,88:T,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N,121:L,122:I,123:$,124:O,125:D},t(Ve,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N},t(Ht,[2,121],{106:Yr}),t(Tn,[2,130],{108:270,10:bt,60:nr,84:$r,105:kr,109:jr,110:Er,111:nn,112:Cr}),t(ut,[2,132]),t(ut,[2,134]),t(ut,[2,135]),t(ut,[2,136]),t(ut,[2,137]),t(ut,[2,138]),t(ut,[2,139]),t(ut,[2,140]),t(ut,[2,141]),t(Ht,[2,122],{106:Yr}),{10:[1,271]},t(Ht,[2,123],{106:Yr}),{10:[1,272]},t(it,[2,129]),t(Ht,[2,105],{106:Yr}),t(Ht,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:A,111:M,114:R,115:P,116:N}),t(Ht,[2,110]),t(Ht,[2,112],{10:[1,273]}),t(Ht,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:F,11:H,21:278},t(z,[2,34]),t(Ve,[2,52]),{10:bt,60:nr,84:$r,105:kr,107:279,108:243,109:jr,110:Er,111:nn,112:Cr},t(ut,[2,133]),{14:K,44:q,60:oe,89:Z,101:280,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e,120:88},{14:K,44:q,60:oe,89:Z,101:281,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e,120:88},{98:[1,282]},t(Ht,[2,120]),t(ce,[2,58]),{30:283,67:dt,80:xe,81:Lt,82:172,116:wt,117:mt,118:Mt},t(ce,[2,66]),t(kt,s,{5:284}),t(Tn,[2,131],{108:270,10:bt,60:nr,84:$r,105:kr,109:jr,110:Er,111:nn,112:Cr}),t(Ht,[2,126],{120:168,10:[1,285],14:K,44:q,60:oe,89:Z,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e}),t(Ht,[2,127],{120:168,10:[1,286],14:K,44:q,60:oe,89:Z,105:Q,106:ne,109:ie,111:me,114:te,115:_e,116:$e}),t(Ht,[2,114]),{31:[1,287],67:dt,82:219,116:wt,117:mt,118:Mt},{6:11,7:12,8:a,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:b,87:x,88:T,89:C,102:S,105:k,106:E,109:A,111:M,113:42,114:R,115:P,116:N,121:L,122:I,123:$,124:O,125:D},{10:bt,60:nr,84:$r,92:289,105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},{10:bt,60:nr,84:$r,92:290,105:kr,107:242,108:243,109:jr,110:Er,111:nn,112:Cr},t(ce,[2,62]),t(z,[2,33]),t(Ht,[2,124],{106:Yr}),t(Ht,[2,125],{106:Yr})],defaultActions:{},parseError:w(function(Ct,vt){if(vt.recoverable)this.trace(Ct);else{var Dt=new Error(Ct);throw Dt.hash=vt,Dt}},"parseError"),parse:w(function(Ct){var vt=this,Dt=[0],ft=[],ar=[null],Ie=[],ci=this.table,Be="",cn=0,Mn=0,vs=2,yn=1,wi=Ie.slice.call(arguments,1),Rn=Object.create(this.lexer),zo={yy:{}};for(var eh in this.yy)Object.prototype.hasOwnProperty.call(this.yy,eh)&&(zo.yy[eh]=this.yy[eh]);Rn.setInput(Ct,zo.yy),zo.yy.lexer=Rn,zo.yy.parser=this,typeof Rn.yylloc>"u"&&(Rn.yylloc={});var ic=Rn.yylloc;Ie.push(ic);var Hm=Rn.options&&Rn.options.ranges;typeof zo.yy.parseError=="function"?this.parseError=zo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Gm(Bt){Dt.length=Dt.length-2*Bt,ar.length=ar.length-Bt,Ie.length=Ie.length-Bt}w(Gm,"popStack");function Wm(){var Bt;return Bt=ft.pop()||Rn.lex()||yn,typeof Bt!="number"&&(Bt instanceof Array&&(ft=Bt,Bt=ft.pop()),Bt=vt.symbols_[Bt]||Bt),Bt}w(Wm,"lex");for(var xa,sc,go,na,Ic={},Tp,Pt,De,nt;;){if(sc=Dt[Dt.length-1],this.defaultActions[sc]?go=this.defaultActions[sc]:((xa===null||typeof xa>"u")&&(xa=Wm()),go=ci[sc]&&ci[sc][xa]),typeof go>"u"||!go.length||!go[0]){var It="";nt=[];for(Tp in ci[sc])this.terminals_[Tp]&&Tp>vs&&nt.push("'"+this.terminals_[Tp]+"'");Rn.showPosition?It="Parse error on line "+(cn+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;de.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(He().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",()=>{Kr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Kr.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=Lre();vt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=vt(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(M0.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),vt(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=He(),Oi()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(g=>{const m={boolean:{},number:{},string:{}},U=[];let y;return{nodeList:g.filter(function(v){const w=typeof v;return v.stmt&&v.stmt==="dir"?(y=v.value,!1):v.trim()===""?!1:w in m?m[w].hasOwnProperty(v)?!1:m[w][v]=!0:U.includes(v)?!1:U.push(v)}),dir:y}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=He().flowchart??{},f=u??(d.inheritDir?this.getDirection()??He().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=He(),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:d6(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 d9e.flowchart}},x(j6,"FlowDB"),j6),Xrr=x(function(t,e){return e.db.getClasses()},"getClasses"),Krr=x(async function(t,e,r,n,i){var f;de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=He();n.db.setDiagramId(e),de.debug("Before getData: ");const l=n.db.getData();de.debug("Data: ",l);const u=U9(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=uk(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&de.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,de.debug("REF1:",l),await Z4(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;Kr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),P5(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),Zrr={getClasses:Xrr,draw:Krr},uY=(function(){var t=x(function(un,Tt,yt,_t){for(yt=yt||{},_t=un.length;_t--;yt[un[_t]]=Tt);return yt},"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],U=[1,29],y=[1,30],b=[1,31],v=[1,32],w=[1,33],T=[1,45],k=[1,47],C=[1,43],S=[1,48],E=[1,44],A=[1,51],R=[1,46],_=[1,52],N=[1,53],L=[1,34],I=[1,35],P=[1,36],O=[1,37],D=[1,38],B=[1,58],F=[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],z=[1,62],$=[1,61],V=[1,63],H=[8,9,11,75,77,78],G=[1,79],K=[1,92],W=[1,97],oe=[1,96],Z=[1,93],J=[1,89],ne=[1,95],ie=[1,91],me=[1,98],te=[1,94],Re=[1,99],Pe=[1,90],Ve=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],he=[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],we=[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],ze=[1,122],xe=[1,123],Ee=[1,125],qe=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],pe=[1,134],Te=[1,148],re=[1,149],Y=[1,150],Q=[1,151],ue=[1,136],X=[1,138],fe=[1,142],ee=[1,143],Ae=[1,144],Me=[1,145],Ke=[1,146],Ne=[1,147],je=[1,152],De=[1,153],Ze=[1,132],Fe=[1,133],at=[1,140],_e=[1,135],gt=[1,139],Le=[1,137],kt=[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],Et=[1,155],ot=[1,157],Vt=[8,9,11],Lt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],dt=[1,177],ve=[1,173],It=[1,174],xt=[1,178],mt=[1,175],Mt=[1,176],Or=[77,116,119],Se=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],it=[10,106],pt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],bt=[1,248],ir=[1,246],Br=[1,250],kr=[1,244],jr=[1,245],Er=[1,247],an=[1,249],Cr=[1,251],Yr=[1,269],Cn=[8,9,11,106],ut=[8,9,10,11,60,84,105,106,109,110,111,112],Ut={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(Tt,yt,_t,ft,or,Ie,ui){var Be=Ie.length-1;switch(or){case 2:this.$=[];break;case 3:(!Array.isArray(Ie[Be])||Ie[Be].length>0)&&Ie[Be-1].push(Ie[Be]),this.$=Ie[Be-1];break;case 4:case 183:this.$=Ie[Be];break;case 11:ft.setDirection("TB"),this.$="TB";break;case 12:ft.setDirection(Ie[Be-1]),this.$=Ie[Be-1];break;case 27:this.$=Ie[Be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=ft.addSubGraph(Ie[Be-6],Ie[Be-1],Ie[Be-4]);break;case 34:this.$=ft.addSubGraph(Ie[Be-3],Ie[Be-1],Ie[Be-3]);break;case 35:this.$=ft.addSubGraph(void 0,Ie[Be-1],void 0);break;case 37:this.$=Ie[Be].trim(),ft.setAccTitle(this.$);break;case 38:case 39:this.$=Ie[Be].trim(),ft.setAccDescription(this.$);break;case 43:this.$=Ie[Be-1]+Ie[Be];break;case 44:this.$=Ie[Be];break;case 45:ft.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),ft.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 46:ft.addLink(Ie[Be-2].stmt,Ie[Be],Ie[Be-1]),this.$={stmt:Ie[Be],nodes:Ie[Be].concat(Ie[Be-2].nodes)};break;case 47:ft.addLink(Ie[Be-3].stmt,Ie[Be-1],Ie[Be-2]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1].concat(Ie[Be-3].nodes)};break;case 48:this.$={stmt:Ie[Be-1],nodes:Ie[Be-1]};break;case 49:ft.addVertex(Ie[Be-1][Ie[Be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be]),this.$={stmt:Ie[Be-1],nodes:Ie[Be-1],shapeData:Ie[Be]};break;case 50:this.$={stmt:Ie[Be],nodes:Ie[Be]};break;case 51:this.$=[Ie[Be]];break;case 52:ft.addVertex(Ie[Be-5][Ie[Be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Ie[Be-4]),this.$=Ie[Be-5].concat(Ie[Be]);break;case 53:this.$=Ie[Be-4].concat(Ie[Be]);break;case 54:this.$=Ie[Be];break;case 55:this.$=Ie[Be-2],ft.setClass(Ie[Be-2],Ie[Be]);break;case 56:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"square");break;case 57:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"doublecircle");break;case 58:this.$=Ie[Be-5],ft.addVertex(Ie[Be-5],Ie[Be-2],"circle");break;case 59:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"ellipse");break;case 60:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"stadium");break;case 61:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"subroutine");break;case 62:this.$=Ie[Be-7],ft.addVertex(Ie[Be-7],Ie[Be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Ie[Be-5],Ie[Be-3]]]));break;case 63:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"cylinder");break;case 64:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"round");break;case 65:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"diamond");break;case 66:this.$=Ie[Be-5],ft.addVertex(Ie[Be-5],Ie[Be-2],"hexagon");break;case 67:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"odd");break;case 68:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"trapezoid");break;case 69:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"inv_trapezoid");break;case 70:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"lean_right");break;case 71:this.$=Ie[Be-3],ft.addVertex(Ie[Be-3],Ie[Be-1],"lean_left");break;case 72:this.$=Ie[Be],ft.addVertex(Ie[Be]);break;case 73:Ie[Be-1].text=Ie[Be],this.$=Ie[Be-1];break;case 74:case 75:Ie[Be-2].text=Ie[Be-1],this.$=Ie[Be-2];break;case 76:this.$=Ie[Be];break;case 77:var hn=ft.destructLink(Ie[Be],Ie[Be-2]);this.$={type:hn.type,stroke:hn.stroke,length:hn.length,text:Ie[Be-1]};break;case 78:var hn=ft.destructLink(Ie[Be],Ie[Be-2]);this.$={type:hn.type,stroke:hn.stroke,length:hn.length,text:Ie[Be-1],id:Ie[Be-3]};break;case 79:this.$={text:Ie[Be],type:"text"};break;case 80:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 81:this.$={text:Ie[Be],type:"string"};break;case 82:this.$={text:Ie[Be],type:"markdown"};break;case 83:var hn=ft.destructLink(Ie[Be]);this.$={type:hn.type,stroke:hn.stroke,length:hn.length};break;case 84:var hn=ft.destructLink(Ie[Be]);this.$={type:hn.type,stroke:hn.stroke,length:hn.length,id:Ie[Be-1]};break;case 85:this.$=Ie[Be-1];break;case 86:this.$={text:Ie[Be],type:"text"};break;case 87:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 88:this.$={text:Ie[Be],type:"string"};break;case 89:case 104:this.$={text:Ie[Be],type:"markdown"};break;case 101:this.$={text:Ie[Be],type:"text"};break;case 102:this.$={text:Ie[Be-1].text+""+Ie[Be],type:Ie[Be-1].type};break;case 103:this.$={text:Ie[Be],type:"text"};break;case 105:this.$=Ie[Be-4],ft.addClass(Ie[Be-2],Ie[Be]);break;case 106:this.$=Ie[Be-4],ft.setClass(Ie[Be-2],Ie[Be]);break;case 107:case 115:this.$=Ie[Be-1],ft.setClickEvent(Ie[Be-1],Ie[Be]);break;case 108:case 116:this.$=Ie[Be-3],ft.setClickEvent(Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-3],Ie[Be]);break;case 109:this.$=Ie[Be-2],ft.setClickEvent(Ie[Be-2],Ie[Be-1],Ie[Be]);break;case 110:this.$=Ie[Be-4],ft.setClickEvent(Ie[Be-4],Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-4],Ie[Be]);break;case 111:this.$=Ie[Be-2],ft.setLink(Ie[Be-2],Ie[Be]);break;case 112:this.$=Ie[Be-4],ft.setLink(Ie[Be-4],Ie[Be-2]),ft.setTooltip(Ie[Be-4],Ie[Be]);break;case 113:this.$=Ie[Be-4],ft.setLink(Ie[Be-4],Ie[Be-2],Ie[Be]);break;case 114:this.$=Ie[Be-6],ft.setLink(Ie[Be-6],Ie[Be-4],Ie[Be]),ft.setTooltip(Ie[Be-6],Ie[Be-2]);break;case 117:this.$=Ie[Be-1],ft.setLink(Ie[Be-1],Ie[Be]);break;case 118:this.$=Ie[Be-3],ft.setLink(Ie[Be-3],Ie[Be-2]),ft.setTooltip(Ie[Be-3],Ie[Be]);break;case 119:this.$=Ie[Be-3],ft.setLink(Ie[Be-3],Ie[Be-2],Ie[Be]);break;case 120:this.$=Ie[Be-5],ft.setLink(Ie[Be-5],Ie[Be-4],Ie[Be]),ft.setTooltip(Ie[Be-5],Ie[Be-2]);break;case 121:this.$=Ie[Be-4],ft.addVertex(Ie[Be-2],void 0,void 0,Ie[Be]);break;case 122:this.$=Ie[Be-4],ft.updateLink([Ie[Be-2]],Ie[Be]);break;case 123:this.$=Ie[Be-4],ft.updateLink(Ie[Be-2],Ie[Be]);break;case 124:this.$=Ie[Be-8],ft.updateLinkInterpolate([Ie[Be-6]],Ie[Be-2]),ft.updateLink([Ie[Be-6]],Ie[Be]);break;case 125:this.$=Ie[Be-8],ft.updateLinkInterpolate(Ie[Be-6],Ie[Be-2]),ft.updateLink(Ie[Be-6],Ie[Be]);break;case 126:this.$=Ie[Be-6],ft.updateLinkInterpolate([Ie[Be-4]],Ie[Be]);break;case 127:this.$=Ie[Be-6],ft.updateLinkInterpolate(Ie[Be-4],Ie[Be]);break;case 128:case 130:this.$=[Ie[Be]];break;case 129:case 131:Ie[Be-2].push(Ie[Be]),this.$=Ie[Be-2];break;case 133:this.$=Ie[Be-1]+Ie[Be];break;case 181:this.$=Ie[Be];break;case 182:this.$=Ie[Be-1]+""+Ie[Be];break;case 184:this.$=Ie[Be-1]+""+Ie[Be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9: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:U,85:y,86:b,87:v,88:w,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N,121:L,122:I,123:P,124:O,125:D},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:B,15:54,18:57},t(F,[2,3]),t(F,[2,4]),t(F,[2,5]),t(F,[2,6]),t(F,[2,7]),t(F,[2,8]),{8:z,9:$,11:V,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:z,9:$,11:V,21:68},{8:z,9:$,11:V,21:69},{8:z,9:$,11:V,21:70},{8:z,9:$,11:V,21:71},{8:z,9:$,11:V,21:72},{8:z,9:$,10:[1,73],11:V,21:74},t(F,[2,36]),{35:[1,75]},{37:[1,76]},t(F,[2,39]),t(H,[2,50],{18:77,39:78,10:B,40:G}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:K,44:W,60:oe,80:[1,87],89:Z,95:[1,84],97:[1,85],101:86,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe,120:88},t(F,[2,185]),t(F,[2,186]),t(F,[2,187]),t(F,[2,188]),t(F,[2,189]),t(Ve,[2,51]),t(Ve,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:T,102:k,105:C,106:S,109:E,111:A,114:R,115:_,116:N}),t(he,[2,181]),t(he,[2,142]),t(he,[2,143]),t(he,[2,144]),t(he,[2,145]),t(he,[2,146]),t(he,[2,147]),t(he,[2,148]),t(he,[2,149]),t(he,[2,150]),t(he,[2,151]),t(he,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(we,[2,26],{18:115,10:B}),t(F,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},t(F,[2,40]),t(F,[2,41]),t(F,[2,42]),t(ge,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ze,81:xe,116:Ee,119:qe},{75:[1,126],77:[1,127]},t(le,[2,83]),t(F,[2,28]),t(F,[2,29]),t(F,[2,30]),t(F,[2,31]),t(F,[2,32]),{10:pe,12:Te,14:re,27:Y,28:128,32:Q,44:ue,60:X,75:fe,80:[1,130],81:[1,131],83:141,84:ee,85:Ae,86:Me,87:Ke,88:Ne,89:je,90:De,91:129,105:Ze,109:Fe,111:at,114:_e,115:gt,116:Le},t(kt,a,{5:154}),t(F,[2,37]),t(F,[2,38]),t(H,[2,48],{44:Et}),t(H,[2,49],{18:156,10:B,40:ot}),t(Ve,[2,44]),{44:g,47:158,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},{44:g,47:163,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},t(Vt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Vt,[2,115],{120:168,10:[1,167],14:K,44:W,60:oe,89:Z,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe}),t(Vt,[2,117],{10:[1,169]}),t(Lt,[2,183]),t(Lt,[2,170]),t(Lt,[2,171]),t(Lt,[2,172]),t(Lt,[2,173]),t(Lt,[2,174]),t(Lt,[2,175]),t(Lt,[2,176]),t(Lt,[2,177]),t(Lt,[2,178]),t(Lt,[2,179]),t(Lt,[2,180]),{44:g,47:170,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},{30:171,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:179,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:181,50:[1,180],67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:182,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:183,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:184,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{109:[1,185]},{30:186,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:187,65:[1,188],67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:189,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:190,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{30:191,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},t(he,[2,182]),t(i,[2,20]),t(we,[2,25]),t(H,[2,46],{39:192,18:193,10:B,40:G}),t(ge,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{77:[1,197],79:198,116:Ee,119:qe},t(Or,[2,79]),t(Or,[2,81]),t(Or,[2,82]),t(Or,[2,168]),t(Or,[2,169]),{76:199,79:121,80:ze,81:xe,116:Ee,119:qe},t(le,[2,84]),{8:z,9:$,10:pe,11:V,12:Te,14:re,21:201,27:Y,29:[1,200],32:Q,44:ue,60:X,75:fe,83:141,84:ee,85:Ae,86:Me,87:Ke,88:Ne,89:je,90:De,91:202,105:Ze,109:Fe,111:at,114:_e,115:gt,116:Le},t(Se,[2,101]),t(Se,[2,103]),t(Se,[2,104]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(Se,[2,90]),t(Se,[2,91]),t(Se,[2,92]),t(Se,[2,93]),t(Se,[2,94]),t(Se,[2,95]),t(Se,[2,96]),t(Se,[2,97]),t(Se,[2,98]),t(Se,[2,99]),t(Se,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:U,85:y,86:b,87:v,88:w,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N,121:L,122:I,123:P,124:O,125:D},{10:B,18:204},{44:[1,205]},t(Ve,[2,43]),{10:[1,206],44:g,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:113,114:R,115:_,116:N},{10:[1,207]},{10:[1,208],106:[1,209]},t(it,[2,128]),{10:[1,210],44:g,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:113,114:R,115:_,116:N},{10:[1,211],44:g,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:113,114:R,115:_,116:N},{80:[1,212]},t(Vt,[2,109],{10:[1,213]}),t(Vt,[2,111],{10:[1,214]}),{80:[1,215]},t(Lt,[2,184]),{80:[1,216],98:[1,217]},t(Ve,[2,55],{113:113,44:g,60:m,89:T,102:k,105:C,106:S,109:E,111:A,114:R,115:_,116:N}),{31:[1,218],67:dt,82:219,116:xt,117:mt,118:Mt},t(pt,[2,86]),t(pt,[2,88]),t(pt,[2,89]),t(pt,[2,153]),t(pt,[2,154]),t(pt,[2,155]),t(pt,[2,156]),{49:[1,220],67:dt,82:219,116:xt,117:mt,118:Mt},{30:221,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{51:[1,222],67:dt,82:219,116:xt,117:mt,118:Mt},{53:[1,223],67:dt,82:219,116:xt,117:mt,118:Mt},{55:[1,224],67:dt,82:219,116:xt,117:mt,118:Mt},{57:[1,225],67:dt,82:219,116:xt,117:mt,118:Mt},{60:[1,226]},{64:[1,227],67:dt,82:219,116:xt,117:mt,118:Mt},{66:[1,228],67:dt,82:219,116:xt,117:mt,118:Mt},{30:229,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},{31:[1,230],67:dt,82:219,116:xt,117:mt,118:Mt},{67:dt,69:[1,231],71:[1,232],82:219,116:xt,117:mt,118:Mt},{67:dt,69:[1,234],71:[1,233],82:219,116:xt,117:mt,118:Mt},t(H,[2,45],{18:156,10:B,40:ot}),t(H,[2,47],{44:Et}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:dt,82:219,116:xt,117:mt,118:Mt},t(ge,[2,77]),t(Or,[2,80]),{77:[1,236],79:198,116:Ee,119:qe},{30:237,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},t(kt,a,{5:238}),t(Se,[2,102]),t(F,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},{10:B,18:240},{10:bt,60:ir,84:Br,92:241,105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},{10:bt,60:ir,84:Br,92:252,104:[1,253],105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},{10:bt,60:ir,84:Br,92:254,104:[1,255],105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},{105:[1,256]},{10:bt,60:ir,84:Br,92:257,105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},{44:g,47:258,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},t(Vt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Vt,[2,116]),t(Vt,[2,118],{10:[1,262]}),t(Vt,[2,119]),t(ce,[2,56]),t(pt,[2,87]),t(ce,[2,57]),{51:[1,263],67:dt,82:219,116:xt,117:mt,118:Mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:dt,82:219,116:xt,117:mt,118:Mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(ge,[2,78]),{31:[1,266],67:dt,82:219,116:xt,117:mt,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:U,85:y,86:b,87:v,88:w,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N,121:L,122:I,123:P,124:O,125:D},t(Ve,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N},t(Vt,[2,121],{106:Yr}),t(Cn,[2,130],{108:270,10:bt,60:ir,84:Br,105:kr,109:jr,110:Er,111:an,112:Cr}),t(ut,[2,132]),t(ut,[2,134]),t(ut,[2,135]),t(ut,[2,136]),t(ut,[2,137]),t(ut,[2,138]),t(ut,[2,139]),t(ut,[2,140]),t(ut,[2,141]),t(Vt,[2,122],{106:Yr}),{10:[1,271]},t(Vt,[2,123],{106:Yr}),{10:[1,272]},t(it,[2,129]),t(Vt,[2,105],{106:Yr}),t(Vt,[2,106],{113:113,44:g,60:m,89:T,102:k,105:C,106:S,109:E,111:A,114:R,115:_,116:N}),t(Vt,[2,110]),t(Vt,[2,112],{10:[1,273]}),t(Vt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:z,9:$,11:V,21:278},t(F,[2,34]),t(Ve,[2,52]),{10:bt,60:ir,84:Br,105:kr,107:279,108:243,109:jr,110:Er,111:an,112:Cr},t(ut,[2,133]),{14:K,44:W,60:oe,89:Z,101:280,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe,120:88},{14:K,44:W,60:oe,89:Z,101:281,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe,120:88},{98:[1,282]},t(Vt,[2,120]),t(ce,[2,58]),{30:283,67:dt,80:ve,81:It,82:172,116:xt,117:mt,118:Mt},t(ce,[2,66]),t(kt,a,{5:284}),t(Cn,[2,131],{108:270,10:bt,60:ir,84:Br,105:kr,109:jr,110:Er,111:an,112:Cr}),t(Vt,[2,126],{120:168,10:[1,285],14:K,44:W,60:oe,89:Z,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe}),t(Vt,[2,127],{120:168,10:[1,286],14:K,44:W,60:oe,89:Z,105:J,106:ne,109:ie,111:me,114:te,115:Re,116:Pe}),t(Vt,[2,114]),{31:[1,287],67:dt,82:219,116:xt,117:mt,118:Mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:U,85:y,86:b,87:v,88:w,89:T,102:k,105:C,106:S,109:E,111:A,113:42,114:R,115:_,116:N,121:L,122:I,123:P,124:O,125:D},{10:bt,60:ir,84:Br,92:289,105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},{10:bt,60:ir,84:Br,92:290,105:kr,107:242,108:243,109:jr,110:Er,111:an,112:Cr},t(ce,[2,62]),t(F,[2,33]),t(Vt,[2,124],{106:Yr}),t(Vt,[2,125],{106:Yr})],defaultActions:{},parseError:x(function(Tt,yt){if(yt.recoverable)this.trace(Tt);else{var _t=new Error(Tt);throw _t.hash=yt,_t}},"parseError"),parse:x(function(Tt){var yt=this,_t=[0],ft=[],or=[null],Ie=[],ui=this.table,Be="",hn=0,Mn=0,Ua=2,bn=1,wi=Ie.slice.call(arguments,1),Rn=Object.create(this.lexer),Fo={yy:{}};for(var eh in this.yy)Object.prototype.hasOwnProperty.call(this.yy,eh)&&(Fo.yy[eh]=this.yy[eh]);Rn.setInput(Tt,Fo.yy),Fo.yy.lexer=Rn,Fo.yy.parser=this,typeof Rn.yylloc>"u"&&(Rn.yylloc={});var ic=Rn.yylloc;Ie.push(ic);var G1=Rn.options&&Rn.options.ranges;typeof Fo.yy.parseError=="function"?this.parseError=Fo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function W1($t){_t.length=_t.length-2*$t,or.length=or.length-$t,Ie.length=Ie.length-$t}x(W1,"popStack");function q1(){var $t;return $t=ft.pop()||Rn.lex()||bn,typeof $t!="number"&&($t instanceof Array&&(ft=$t,$t=ft.pop()),$t=yt.symbols_[$t]||$t),$t}x(q1,"lex");for(var vs,ac,go,rs,Ic={},Tp,Pt,Oe,nt;;){if(ac=_t[_t.length-1],this.defaultActions[ac]?go=this.defaultActions[ac]:((vs===null||typeof vs>"u")&&(vs=q1()),go=ui[ac]&&ui[ac][vs]),typeof go>"u"||!go.length||!go[0]){var Nt="";nt=[];for(Tp in ui[ac])this.terminals_[Tp]&&Tp>Ua&&nt.push("'"+this.terminals_[Tp]+"'");Rn.showPosition?Nt="Parse error on line "+(hn+1)+`: `+Rn.showPosition()+` -Expecting `+nt.join(", ")+", got '"+(this.terminals_[xa]||xa)+"'":It="Parse error on line "+(cn+1)+": Unexpected "+(xa==yn?"end of input":"'"+(this.terminals_[xa]||xa)+"'"),this.parseError(It,{text:Rn.match,token:this.terminals_[xa]||xa,line:Rn.yylineno,loc:ic,expected:nt})}if(go[0]instanceof Array&&go.length>1)throw new Error("Parse Error: multiple actions possible at state: "+sc+", token: "+xa);switch(go[0]){case 1:Dt.push(xa),ar.push(Rn.yytext),Ie.push(Rn.yylloc),Dt.push(go[1]),xa=null,Mn=Rn.yyleng,Be=Rn.yytext,cn=Rn.yylineno,ic=Rn.yylloc;break;case 2:if(Pt=this.productions_[go[1]][1],Ic.$=ar[ar.length-Pt],Ic._$={first_line:Ie[Ie.length-(Pt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(Pt||1)].first_column,last_column:Ie[Ie.length-1].last_column},Hm&&(Ic._$.range=[Ie[Ie.length-(Pt||1)].range[0],Ie[Ie.length-1].range[1]]),na=this.performAction.apply(Ic,[Be,Mn,cn,zo.yy,go[1],ar,Ie].concat(wi)),typeof na<"u")return na;Pt&&(Dt=Dt.slice(0,-1*Pt*2),ar=ar.slice(0,-1*Pt),Ie=Ie.slice(0,-1*Pt)),Dt.push(this.productions_[go[1]][0]),ar.push(Ic.$),Ie.push(Ic._$),De=ci[Dt[Dt.length-2]][Dt[Dt.length-1]],Dt.push(De);break;case 3:return!0}}return!0},"parse")},Zt=(function(){var ln={EOF:1,parseError:w(function(vt,Dt){if(this.yy.parser)this.yy.parser.parseError(vt,Dt);else throw new Error(vt)},"parseError"),setInput:w(function(Ct,vt){return this.yy=vt||this.yy||{},this._input=Ct,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 Ct=this._input[0];this.yytext+=Ct,this.yyleng++,this.offset++,this.match+=Ct,this.matched+=Ct;var vt=Ct.match(/(?:\r\n?|\n).*/g);return vt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ct},"input"),unput:w(function(Ct){var vt=Ct.length,Dt=Ct.split(/(?:\r\n?|\n)/g);this._input=Ct+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-vt),this.offset-=vt;var ft=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),Dt.length-1&&(this.yylineno-=Dt.length-1);var ar=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:Dt?(Dt.length===ft.length?this.yylloc.first_column:0)+ft[ft.length-Dt.length].length-Dt[0].length:this.yylloc.first_column-vt},this.options.ranges&&(this.yylloc.range=[ar[0],ar[0]+this.yyleng-vt]),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(Ct){this.unput(this.match.slice(Ct))},"less"),pastInput:w(function(){var Ct=this.matched.substr(0,this.matched.length-this.match.length);return(Ct.length>20?"...":"")+Ct.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Ct=this.match;return Ct.length<20&&(Ct+=this._input.substr(0,20-Ct.length)),(Ct.substr(0,20)+(Ct.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Ct=this.pastInput(),vt=new Array(Ct.length+1).join("-");return Ct+this.upcomingInput()+` -`+vt+"^"},"showPosition"),test_match:w(function(Ct,vt){var Dt,ft,ar;if(this.options.backtrack_lexer&&(ar={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&&(ar.yylloc.range=this.yylloc.range.slice(0))),ft=Ct[0].match(/(?:\r\n?|\n).*/g),ft&&(this.yylineno+=ft.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ft?ft[ft.length-1].length-ft[ft.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ct[0].length},this.yytext+=Ct[0],this.match+=Ct[0],this.matches=Ct,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(Ct[0].length),this.matched+=Ct[0],Dt=this.performAction.call(this,this.yy,this,vt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Dt)return Dt;if(this._backtrack){for(var Ie in ar)this[Ie]=ar[Ie];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ct,vt,Dt,ft;this._more||(this.yytext="",this.match="");for(var ar=this._currentRules(),Ie=0;Ievt[0].length)){if(vt=Dt,ft=Ie,this.options.backtrack_lexer){if(Ct=this.test_match(Dt,ar[Ie]),Ct!==!1)return Ct;if(this._backtrack){vt=!1;continue}else return!1}else if(!this.options.flex)break}return vt?(Ct=this.test_match(vt,ar[ft]),Ct!==!1?Ct:!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 vt=this.next();return vt||this.lex()},"lex"),begin:w(function(vt){this.conditionStack.push(vt)},"begin"),popState:w(function(){var vt=this.conditionStack.length-1;return vt>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(vt){return vt=this.conditionStack.length-1-Math.abs(vt||0),vt>=0?this.conditionStack[vt]:"INITIAL"},"topState"),pushState:w(function(vt){this.begin(vt)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(vt,Dt,ft,ar){switch(ft){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"),Dt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return Dt.yytext=Dt.yytext.replace(Ie,"
    "),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 vt.lex.firstGraph()&&this.begin("dir"),12;case 36:return vt.lex.firstGraph()&&this.begin("dir"),12;case 37:return vt.lex.firstGraph()&&this.begin("dir"),12;case 38:return vt.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 ln})();yt.lexer=Zt;function Br(){this.yy={}}return w(Br,"Parser"),Br.prototype=yt,yt.Parser=Br,new Br})();nY.parser=nY;var $De=nY,BDe=Object.assign({},$De);BDe.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return $De.parse(e)};var Rrr=BDe,_rr=w((t,e)=>{const r=SQ,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return Ah(n,i,s,e)},"fade"),Lrr=w(t=>`.label { +Expecting `+nt.join(", ")+", got '"+(this.terminals_[vs]||vs)+"'":Nt="Parse error on line "+(hn+1)+": Unexpected "+(vs==bn?"end of input":"'"+(this.terminals_[vs]||vs)+"'"),this.parseError(Nt,{text:Rn.match,token:this.terminals_[vs]||vs,line:Rn.yylineno,loc:ic,expected:nt})}if(go[0]instanceof Array&&go.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ac+", token: "+vs);switch(go[0]){case 1:_t.push(vs),or.push(Rn.yytext),Ie.push(Rn.yylloc),_t.push(go[1]),vs=null,Mn=Rn.yyleng,Be=Rn.yytext,hn=Rn.yylineno,ic=Rn.yylloc;break;case 2:if(Pt=this.productions_[go[1]][1],Ic.$=or[or.length-Pt],Ic._$={first_line:Ie[Ie.length-(Pt||1)].first_line,last_line:Ie[Ie.length-1].last_line,first_column:Ie[Ie.length-(Pt||1)].first_column,last_column:Ie[Ie.length-1].last_column},G1&&(Ic._$.range=[Ie[Ie.length-(Pt||1)].range[0],Ie[Ie.length-1].range[1]]),rs=this.performAction.apply(Ic,[Be,Mn,hn,Fo.yy,go[1],or,Ie].concat(wi)),typeof rs<"u")return rs;Pt&&(_t=_t.slice(0,-1*Pt*2),or=or.slice(0,-1*Pt),Ie=Ie.slice(0,-1*Pt)),_t.push(this.productions_[go[1]][0]),or.push(Ic.$),Ie.push(Ic._$),Oe=ui[_t[_t.length-2]][_t[_t.length-1]],_t.push(Oe);break;case 3:return!0}}return!0},"parse")},Zt=(function(){var un={EOF:1,parseError:x(function(yt,_t){if(this.yy.parser)this.yy.parser.parseError(yt,_t);else throw new Error(yt)},"parseError"),setInput:x(function(Tt,yt){return this.yy=yt||this.yy||{},this._input=Tt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Tt=this._input[0];this.yytext+=Tt,this.yyleng++,this.offset++,this.match+=Tt,this.matched+=Tt;var yt=Tt.match(/(?:\r\n?|\n).*/g);return yt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Tt},"input"),unput:x(function(Tt){var yt=Tt.length,_t=Tt.split(/(?:\r\n?|\n)/g);this._input=Tt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-yt),this.offset-=yt;var ft=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 or=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===ft.length?this.yylloc.first_column:0)+ft[ft.length-_t.length].length-_t[0].length:this.yylloc.first_column-yt},this.options.ranges&&(this.yylloc.range=[or[0],or[0]+this.yyleng-yt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Tt){this.unput(this.match.slice(Tt))},"less"),pastInput:x(function(){var Tt=this.matched.substr(0,this.matched.length-this.match.length);return(Tt.length>20?"...":"")+Tt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Tt=this.match;return Tt.length<20&&(Tt+=this._input.substr(0,20-Tt.length)),(Tt.substr(0,20)+(Tt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Tt=this.pastInput(),yt=new Array(Tt.length+1).join("-");return Tt+this.upcomingInput()+` +`+yt+"^"},"showPosition"),test_match:x(function(Tt,yt){var _t,ft,or;if(this.options.backtrack_lexer&&(or={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&&(or.yylloc.range=this.yylloc.range.slice(0))),ft=Tt[0].match(/(?:\r\n?|\n).*/g),ft&&(this.yylineno+=ft.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ft?ft[ft.length-1].length-ft[ft.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Tt[0].length},this.yytext+=Tt[0],this.match+=Tt[0],this.matches=Tt,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(Tt[0].length),this.matched+=Tt[0],_t=this.performAction.call(this,this.yy,this,yt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_t)return _t;if(this._backtrack){for(var Ie in or)this[Ie]=or[Ie];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Tt,yt,_t,ft;this._more||(this.yytext="",this.match="");for(var or=this._currentRules(),Ie=0;Ieyt[0].length)){if(yt=_t,ft=Ie,this.options.backtrack_lexer){if(Tt=this.test_match(_t,or[Ie]),Tt!==!1)return Tt;if(this._backtrack){yt=!1;continue}else return!1}else if(!this.options.flex)break}return yt?(Tt=this.test_match(yt,or[ft]),Tt!==!1?Tt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var yt=this.next();return yt||this.lex()},"lex"),begin:x(function(yt){this.conditionStack.push(yt)},"begin"),popState:x(function(){var yt=this.conditionStack.length-1;return yt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(yt){return yt=this.conditionStack.length-1-Math.abs(yt||0),yt>=0?this.conditionStack[yt]:"INITIAL"},"topState"),pushState:x(function(yt){this.begin(yt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(yt,_t,ft,or){switch(ft){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"),_t.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const Ie=/\n\s*/g;return _t.yytext=_t.yytext.replace(Ie,"
    "),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 yt.lex.firstGraph()&&this.begin("dir"),12;case 36:return yt.lex.firstGraph()&&this.begin("dir"),12;case 37:return yt.lex.firstGraph()&&this.begin("dir"),12;case 38:return yt.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 un})();Ut.lexer=Zt;function $r(){this.yy={}}return x($r,"Parser"),$r.prototype=Ut,Ut.Parser=$r,new $r})();uY.parser=uY;var KOe=uY,ZOe=Object.assign({},KOe);ZOe.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return KOe.parse(e)};var Jrr=ZOe,Qrr=x((t,e)=>{const r=IJ,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Eh(n,i,a,e)},"fade"),enr=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3514,7 +3647,7 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[xa]||xa)+"'":It="Parse erro /* For html labels only */ .labelBkg { - background-color: ${_rr(t.edgeLabelBackground,.5)}; + background-color: ${Qrr(t.edgeLabelBackground,.5)}; // background-color: } @@ -3573,32 +3706,32 @@ Expecting `+nt.join(", ")+", got '"+(this.terminals_[xa]||xa)+"'":It="Parse erro } text-align: center; } - ${M7()} -`,"getStyles"),FDe=Lrr,Mre=w(({defaultLayout:t,styles:e=FDe}={})=>({parser:Rrr,get db(){return new Srr},renderer:Mrr,styles:e,init:w(r=>{r.flowchart||(r.flowchart={});const n=X3e().layout??t??r.layout;n&&SW({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,SW({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),Irr=Mre();const Rre=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:Mre,diagram:Irr},Symbol.toStringTag,{value:"Module"}));var Nrr=w(t=>`${FDe(t)} + ${Lk()} +`,"getStyles"),JOe=enr,_re=x(({defaultLayout:t,styles:e=JOe}={})=>({parser:Jrr,get db(){return new Yrr},renderer:Zrr,styles:e,init:x(r=>{r.flowchart||(r.flowchart={});const n=a9e().layout??t??r.layout;n&&IG({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,IG({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),tnr=_re();const Pre=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:_re,diagram:tnr},Symbol.toStringTag,{value:"Module"}));var rnr=x(t=>`${JOe(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),Orr=Nrr,Drr=Mre({defaultLayout:"swimlane",styles:Orr});const Prr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Drr},Symbol.toStringTag,{value:"Module"}));var iY=(function(){var t=w(function(_e,$e,Ve,ce){for(Ve=Ve||{},ce=_e.length;ce--;Ve[_e[ce]]=$e);return Ve},"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],s=[1,13],a=[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],b=[1,36],x=[1,37],T=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],A=[1,46],M=[1,55],R=[40,48,50,51,52,71,72],P=[1,66],N=[1,64],L=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],D=[66,67,68,69,70],B=[1,85],z=[1,84],V=[1,82],F=[1,83],H=[6,10,42,47],G=[6,10,13,41,42,47,48,49],W=[1,93],K=[1,92],q=[1,91],oe=[19,58],Z=[1,102],Q=[1,101],ne=[19,58,61,63],ie={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($e,Ve,ce,he,Te,ge,ze){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:he.addEntity(ge[we-4]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:he.addEntity(ge[we-8]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-8]],ge[we-6]),he.setClass([ge[we-4]],ge[we-2]);break;case 10:he.addEntity(ge[we-6]),he.addEntity(ge[we-2]),he.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),he.setClass([ge[we-6]],ge[we-4]);break;case 11:he.addEntity(ge[we-6]),he.addEntity(ge[we-4]),he.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),he.setClass([ge[we-4]],ge[we-2]);break;case 12:he.addEntity(ge[we-3]),he.addAttributes(ge[we-3],ge[we-1]);break;case 13:he.addEntity(ge[we-5]),he.addAttributes(ge[we-5],ge[we-1]),he.setClass([ge[we-5]],ge[we-3]);break;case 14:he.addEntity(ge[we-2]);break;case 15:he.addEntity(ge[we-4]),he.setClass([ge[we-4]],ge[we-2]);break;case 16:he.addEntity(ge[we]);break;case 17:he.addEntity(ge[we-2]),he.setClass([ge[we-2]],ge[we]);break;case 18:he.addEntity(ge[we-6],ge[we-4]),he.addAttributes(ge[we-6],ge[we-1]);break;case 19:he.addEntity(ge[we-8],ge[we-6]),he.addAttributes(ge[we-8],ge[we-1]),he.setClass([ge[we-8]],ge[we-3]);break;case 20:he.addEntity(ge[we-5],ge[we-3]);break;case 21:he.addEntity(ge[we-7],ge[we-5]),he.setClass([ge[we-7]],ge[we-2]);break;case 22:he.addEntity(ge[we-3],ge[we-1]);break;case 23:he.addEntity(ge[we-5],ge[we-3]),he.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),he.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),he.setAccDescription(this.$);break;case 32:he.setDirection("TB");break;case 33:he.setDirection("BT");break;case 34:he.setDirection("RL");break;case 35:he.setDirection("LR");break;case 36:this.$=ge[we-3],he.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],he.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],he.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.$=he.Cardinality.ZERO_OR_ONE;break;case 74:this.$=he.Cardinality.ZERO_OR_MORE;break;case 75:this.$=he.Cardinality.ONE_OR_MORE;break;case 76:this.$=he.Cardinality.ONLY_ONE;break;case 77:this.$=he.Cardinality.MD_PARENT;break;case 78:this.$=he.Identification.NON_IDENTIFYING;break;case 79:this.$=he.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:s,29:14,30:15,31:16,32:17,33:a,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:s,29:14,30:15,31:16,32:17,33:a,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:b,67:x,68:T,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41: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(R,[2,73]),t(R,[2,74]),t(R,[2,75]),t(R,[2,76]),t(R,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:N,42:L,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:A,42:L},{13:P,38:69,41:N,42:L,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:L,66:b,67:x,68:T,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:M},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:b,67:x,68:T,69:C,70:S},t(D,[2,78]),t(D,[2,79]),{6:B,10:z,39:81,42:V,47:F},{40:[1,86],41:[1,87]},t(H,[2,43],{46:88,13:P,41:N,48:I,49:$}),t(G,[2,45]),t(G,[2,50]),t(G,[2,51]),t(G,[2,52]),t(G,[2,53]),t(e,[2,41],{42:L}),{6:B,10:z,39:89,42:V,47:F},{14:90,40:W,50:K,73:q},{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(oe,[2,61],{56:98,57:99,60:100,62:Z,63:Q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:N,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(G,[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:L},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(oe,[2,62],{57:110,61:[1,111],63:Q}),t(oe,[2,63]),t(ne,[2,68]),t(oe,[2,71]),t(ne,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:A},t(H,[2,44],{46:88,13:P,41:N,48:I,49:$}),{14:115,40:W,50:K,73:q},{16:116,40:E,41:A},{14:117,40:W,50:K,73:q},t(e,[2,13]),t(oe,[2,64]),{60:118,62:Z},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:L}),t(e,[2,11]),{13:[1,121],42:L},t(e,[2,10]),t(ne,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:W,50:K,73:q},{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($e,Ve){if(Ve.recoverable)this.trace($e);else{var ce=new Error($e);throw ce.hash=Ve,ce}},"parseError"),parse:w(function($e){var Ve=this,ce=[0],he=[],Te=[null],ge=[],ze=this.table,we="",Ae=0,qe=0,le=2,pe=1,Ce=ge.slice.call(arguments,1),re=Object.create(this.lexer),Y={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(Y.yy[J]=this.yy[J]);re.setInput($e,Y.yy),Y.yy.lexer=re,Y.yy.parser=this,typeof re.yylloc>"u"&&(re.yylloc={});var ue=re.yylloc;ge.push(ue);var X=re.options&&re.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(gt){ce.length=ce.length-2*gt,Te.length=Te.length-gt,ge.length=ge.length-gt}w(fe,"popStack");function ee(){var gt;return gt=he.pop()||re.lex()||pe,typeof gt!="number"&&(gt instanceof Array&&(he=gt,gt=he.pop()),gt=Ve.symbols_[gt]||gt),gt}w(ee,"lex");for(var Me,Re,Ke,Ne,je={},Oe,Ze,Fe,st;;){if(Re=ce[ce.length-1],this.defaultActions[Re]?Ke=this.defaultActions[Re]:((Me===null||typeof Me>"u")&&(Me=ee()),Ke=ze[Re]&&ze[Re][Me]),typeof Ke>"u"||!Ke.length||!Ke[0]){var Pe="";st=[];for(Oe in ze[Re])this.terminals_[Oe]&&Oe>le&&st.push("'"+this.terminals_[Oe]+"'");re.showPosition?Pe="Parse error on line "+(Ae+1)+`: +`,"getStyles"),nnr=rnr,inr=_re({defaultLayout:"swimlane",styles:nnr});const anr=Object.freeze(Object.defineProperty({__proto__:null,diagram:inr},Symbol.toStringTag,{value:"Module"}));var hY=(function(){var t=x(function(Re,Pe,Ve,ce){for(Ve=Ve||{},ce=Re.length;ce--;Ve[Re[ce]]=Pe);return Ve},"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],U=[1,21],y=[1,22],b=[1,36],v=[1,37],w=[1,38],T=[1,39],k=[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],S=[1,45],E=[1,46],A=[1,55],R=[40,48,50,51,52,71,72],_=[1,66],N=[1,64],L=[1,61],I=[1,65],P=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],D=[66,67,68,69,70],B=[1,85],F=[1,84],z=[1,82],$=[1,83],V=[6,10,42,47],H=[6,10,13,41,42,47,48,49],G=[1,93],K=[1,92],W=[1,91],oe=[19,58],Z=[1,102],J=[1,101],ne=[19,58,61,63],ie={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:x(function(Pe,Ve,ce,he,we,ge,ze){var xe=ge.length-1;switch(we){case 1:break;case 2:this.$=[];break;case 3:ge[xe-1].push(ge[xe]),this.$=ge[xe-1];break;case 4:case 5:this.$=ge[xe];break;case 6:case 7:this.$=[];break;case 8:he.addEntity(ge[xe-4]),he.addEntity(ge[xe-2]),he.addRelationship(ge[xe-4],ge[xe],ge[xe-2],ge[xe-3]);break;case 9:he.addEntity(ge[xe-8]),he.addEntity(ge[xe-4]),he.addRelationship(ge[xe-8],ge[xe],ge[xe-4],ge[xe-5]),he.setClass([ge[xe-8]],ge[xe-6]),he.setClass([ge[xe-4]],ge[xe-2]);break;case 10:he.addEntity(ge[xe-6]),he.addEntity(ge[xe-2]),he.addRelationship(ge[xe-6],ge[xe],ge[xe-2],ge[xe-3]),he.setClass([ge[xe-6]],ge[xe-4]);break;case 11:he.addEntity(ge[xe-6]),he.addEntity(ge[xe-4]),he.addRelationship(ge[xe-6],ge[xe],ge[xe-4],ge[xe-5]),he.setClass([ge[xe-4]],ge[xe-2]);break;case 12:he.addEntity(ge[xe-3]),he.addAttributes(ge[xe-3],ge[xe-1]);break;case 13:he.addEntity(ge[xe-5]),he.addAttributes(ge[xe-5],ge[xe-1]),he.setClass([ge[xe-5]],ge[xe-3]);break;case 14:he.addEntity(ge[xe-2]);break;case 15:he.addEntity(ge[xe-4]),he.setClass([ge[xe-4]],ge[xe-2]);break;case 16:he.addEntity(ge[xe]);break;case 17:he.addEntity(ge[xe-2]),he.setClass([ge[xe-2]],ge[xe]);break;case 18:he.addEntity(ge[xe-6],ge[xe-4]),he.addAttributes(ge[xe-6],ge[xe-1]);break;case 19:he.addEntity(ge[xe-8],ge[xe-6]),he.addAttributes(ge[xe-8],ge[xe-1]),he.setClass([ge[xe-8]],ge[xe-3]);break;case 20:he.addEntity(ge[xe-5],ge[xe-3]);break;case 21:he.addEntity(ge[xe-7],ge[xe-5]),he.setClass([ge[xe-7]],ge[xe-2]);break;case 22:he.addEntity(ge[xe-3],ge[xe-1]);break;case 23:he.addEntity(ge[xe-5],ge[xe-3]),he.setClass([ge[xe-5]],ge[xe]);break;case 24:case 25:this.$=ge[xe].trim(),he.setAccTitle(this.$);break;case 26:case 27:this.$=ge[xe].trim(),he.setAccDescription(this.$);break;case 32:he.setDirection("TB");break;case 33:he.setDirection("BT");break;case 34:he.setDirection("RL");break;case 35:he.setDirection("LR");break;case 36:this.$=ge[xe-3],he.addClass(ge[xe-2],ge[xe-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[xe]];break;case 39:case 40:this.$=ge[xe-2].concat([ge[xe]]);break;case 41:this.$=ge[xe-2],he.setClass(ge[xe-1],ge[xe]);break;case 42:this.$=ge[xe-3],he.addCssStyles(ge[xe-2],ge[xe-1]);break;case 43:this.$=[ge[xe]];break;case 44:ge[xe-2].push(ge[xe]),this.$=ge[xe-2];break;case 46:this.$=ge[xe-1]+ge[xe];break;case 54:case 80:case 81:this.$=ge[xe].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[xe];break;case 60:ge[xe].push(ge[xe-1]),this.$=ge[xe];break;case 61:this.$={type:ge[xe-1],name:ge[xe]};break;case 62:this.$={type:ge[xe-2],name:ge[xe-1],keys:ge[xe]};break;case 63:this.$={type:ge[xe-2],name:ge[xe-1],comment:ge[xe]};break;case 64:this.$={type:ge[xe-3],name:ge[xe-2],keys:ge[xe-1],comment:ge[xe]};break;case 65:case 67:case 70:this.$=ge[xe];break;case 66:this.$=ge[xe-1]+ge[xe];break;case 69:ge[xe-2].push(ge[xe]),this.$=ge[xe-2];break;case 71:this.$=ge[xe].replace(/"/g,"");break;case 72:this.$={cardA:ge[xe],relType:ge[xe-1],cardB:ge[xe-2]};break;case 73:this.$=he.Cardinality.ZERO_OR_ONE;break;case 74:this.$=he.Cardinality.ZERO_OR_MORE;break;case 75:this.$=he.Cardinality.ONE_OR_MORE;break;case 76:this.$=he.Cardinality.ONLY_ONE;break;case 77:this.$=he.Cardinality.MD_PARENT;break;case 78:this.$=he.Identification.NON_IDENTIFYING;break;case 79:this.$=he.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:U,52:y},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:U,52:y},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:b,67:v,68:w,69:T,70:k}),{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:S,41:E},{16:47,40:S,41:E},{16:48,40:S,41:E},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:U,52:y},{16:50,40:S,41:E},{18:51,19:[1,52],53:53,54:54,58:A},{11:56,40:d,48:g,50:m,51:U,52:y},{65:57,71:[1,58],72:[1,59]},t(R,[2,73]),t(R,[2,74]),t(R,[2,75]),t(R,[2,76]),t(R,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:_,38:60,41:N,42:L,45:62,46:63,48:I,49:P},t(O,[2,37]),t(O,[2,38]),{16:68,40:S,41:E,42:L},{13:_,38:69,41:N,42:L,45:62,46:63,48:I,49:P},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:L,66:b,67:v,68:w,69:T,70:k}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:A},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:b,67:v,68:w,69:T,70:k},t(D,[2,78]),t(D,[2,79]),{6:B,10:F,39:81,42:z,47:$},{40:[1,86],41:[1,87]},t(V,[2,43],{46:88,13:_,41:N,48:I,49:P}),t(H,[2,45]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(e,[2,41],{42:L}),{6:B,10:F,39:89,42:z,47:$},{14:90,40:G,50:K,73:W},{16:94,40:S,41:E},{11:95,40:d,48:g,50:m,51:U,52:y},{18:96,19:[1,97],53:53,54:54,58:A},t(e,[2,12]),{19:[2,60]},t(oe,[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:_,41:N,45:105,46:63,48:I,49:P},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(H,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:L},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(oe,[2,62],{57:110,61:[1,111],63:J}),t(oe,[2,63]),t(ne,[2,68]),t(oe,[2,71]),t(ne,[2,70]),{18:112,19:[1,113],53:53,54:54,58:A},{16:114,40:S,41:E},t(V,[2,44],{46:88,13:_,41:N,48:I,49:P}),{14:115,40:G,50:K,73:W},{16:116,40:S,41:E},{14:117,40:G,50:K,73:W},t(e,[2,13]),t(oe,[2,64]),{60:118,62:Z},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:L}),t(e,[2,11]),{13:[1,121],42:L},t(e,[2,10]),t(ne,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:A},{14:124,40:G,50:K,73:W},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:x(function(Pe,Ve){if(Ve.recoverable)this.trace(Pe);else{var ce=new Error(Pe);throw ce.hash=Ve,ce}},"parseError"),parse:x(function(Pe){var Ve=this,ce=[0],he=[],we=[null],ge=[],ze=this.table,xe="",Ee=0,qe=0,le=2,pe=1,Te=ge.slice.call(arguments,1),re=Object.create(this.lexer),Y={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(Y.yy[Q]=this.yy[Q]);re.setInput(Pe,Y.yy),Y.yy.lexer=re,Y.yy.parser=this,typeof re.yylloc>"u"&&(re.yylloc={});var ue=re.yylloc;ge.push(ue);var X=re.options&&re.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(gt){ce.length=ce.length-2*gt,we.length=we.length-gt,ge.length=ge.length-gt}x(fe,"popStack");function ee(){var gt;return gt=he.pop()||re.lex()||pe,typeof gt!="number"&&(gt instanceof Array&&(he=gt,gt=he.pop()),gt=Ve.symbols_[gt]||gt),gt}x(ee,"lex");for(var Ae,Me,Ke,Ne,je={},De,Ze,Fe,at;;){if(Me=ce[ce.length-1],this.defaultActions[Me]?Ke=this.defaultActions[Me]:((Ae===null||typeof Ae>"u")&&(Ae=ee()),Ke=ze[Me]&&ze[Me][Ae]),typeof Ke>"u"||!Ke.length||!Ke[0]){var _e="";at=[];for(De in ze[Me])this.terminals_[De]&&De>le&&at.push("'"+this.terminals_[De]+"'");re.showPosition?_e="Parse error on line "+(Ee+1)+`: `+re.showPosition()+` -Expecting `+st.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":Pe="Parse error on line "+(Ae+1)+": Unexpected "+(Me==pe?"end of input":"'"+(this.terminals_[Me]||Me)+"'"),this.parseError(Pe,{text:re.match,token:this.terminals_[Me]||Me,line:re.yylineno,loc:ue,expected:st})}if(Ke[0]instanceof Array&&Ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Re+", token: "+Me);switch(Ke[0]){case 1:ce.push(Me),Te.push(re.yytext),ge.push(re.yylloc),ce.push(Ke[1]),Me=null,qe=re.yyleng,we=re.yytext,Ae=re.yylineno,ue=re.yylloc;break;case 2:if(Ze=this.productions_[Ke[1]][1],je.$=Te[Te.length-Ze],je._$={first_line:ge[ge.length-(Ze||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ze||1)].first_column,last_column:ge[ge.length-1].last_column},X&&(je._$.range=[ge[ge.length-(Ze||1)].range[0],ge[ge.length-1].range[1]]),Ne=this.performAction.apply(je,[we,qe,Ae,Y.yy,Ke[1],Te,ge].concat(Ce)),typeof Ne<"u")return Ne;Ze&&(ce=ce.slice(0,-1*Ze*2),Te=Te.slice(0,-1*Ze),ge=ge.slice(0,-1*Ze)),ce.push(this.productions_[Ke[1]][0]),Te.push(je.$),ge.push(je._$),Fe=ze[ce[ce.length-2]][ce[ce.length-1]],ce.push(Fe);break;case 3:return!0}}return!0},"parse")},me=(function(){var _e={EOF:1,parseError:w(function(Ve,ce){if(this.yy.parser)this.yy.parser.parseError(Ve,ce);else throw new Error(Ve)},"parseError"),setInput:w(function($e,Ve){return this.yy=Ve||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 Ve=$e.match(/(?:\r\n?|\n).*/g);return Ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$e},"input"),unput:w(function($e){var Ve=$e.length,ce=$e.split(/(?:\r\n?|\n)/g);this._input=$e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ve),this.offset-=Ve;var he=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var 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:ce?(ce.length===he.length?this.yylloc.first_column:0)+he[he.length-ce.length].length-ce[0].length:this.yylloc.first_column-Ve},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-Ve]),this.yyleng=this.yytext.length,this},"unput"),more: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(),Ve=new Array($e.length+1).join("-");return $e+this.upcomingInput()+` -`+Ve+"^"},"showPosition"),test_match:w(function($e,Ve){var ce,he,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))),he=$e[0].match(/(?:\r\n?|\n).*/g),he&&(this.yylineno+=he.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:he?he[he.length-1].length-he[he.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],ce=this.performAction.call(this,this.yy,this,Ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;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 $e,Ve,ce,he;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ge=0;geVe[0].length)){if(Ve=ce,he=ge,this.options.backtrack_lexer){if($e=this.test_match(ce,Te[ge]),$e!==!1)return $e;if(this._backtrack){Ve=!1;continue}else return!1}else if(!this.options.flex)break}return Ve?($e=this.test_match(Ve,Te[he]),$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 Ve=this.next();return Ve||this.lex()},"lex"),begin:w(function(Ve){this.conditionStack.push(Ve)},"begin"),popState:w(function(){var Ve=this.conditionStack.length-1;return Ve>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(Ve){return Ve=this.conditionStack.length-1-Math.abs(Ve||0),Ve>=0?this.conditionStack[Ve]:"INITIAL"},"topState"),pushState:w(function(Ve){this.begin(Ve)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(Ve,ce,he,Te){switch(he){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return _e})();ie.lexer=me;function te(){this.yy={}}return w(te,"Parser"),te.prototype=ie,ie.Parser=te,new te})();iY.parser=iY;var $rr=iY,Wx,Brr=(Wx=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=qi,this.getAccTitle=ns,this.setAccDescription=is,this.getAccDescription=ss,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getConfig=w(()=>He().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,de.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:He().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),de.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]),de.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const s=this.entities.get(e),a=this.entities.get(n);if(!s||!a)return;const o={entityA:s.id,roleA:r,entityB:a.id,relSpec:i};this.relationships.push(o),de.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(s=>s.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(s=>s.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const s of r)i.cssStyles.push(s)}}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(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const s of r)i.cssClasses+=" "+s}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Oi()}getData(){const e=[],r=[],n=He();let i=0;for(const a of this.entities.keys()){const o=this.entities.get(a);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let s=0;for(const a of this.relationships){const o={id:lx(a.entityA,a.entityB,{prefix:"id",counter:s++}),type:"normal",curve:"basis",start:a.entityA,end:a.entityB,label:a.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:a.relSpec.cardB.toLowerCase(),arrowTypeEnd:a.relSpec.cardA.toLowerCase(),pattern:a.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},w(Wx,"ErDB"),Wx),zDe={};JO(zDe,{draw:()=>Frr});var Frr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:s,layout:a}=He(),o=n.db.getData(),l=pC(e,i);o.type=n.type,o.layoutAlgorithm=a7(a),o.config.flowchart.nodeSpacing=(s==null?void 0:s.nodeSpacing)||140,o.config.flowchart.rankSpacing=(s==null?void 0:s.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 Y3(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=xt(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;Kr.insertTitle(l,"erDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),Ov(l,f,"erDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),V1e=w((t,e)=>{const r=SQ,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return Ah(n,i,s,e)},"fade"),T9=new Set(["redux-color","redux-dark-color"]),zrr=w(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!T9.has(e))return"";const s=(n==null?void 0:n.length)>0;let a="";for(let o=0;o1)throw new Error("Parse Error: multiple actions possible at state: "+Me+", token: "+Ae);switch(Ke[0]){case 1:ce.push(Ae),we.push(re.yytext),ge.push(re.yylloc),ce.push(Ke[1]),Ae=null,qe=re.yyleng,xe=re.yytext,Ee=re.yylineno,ue=re.yylloc;break;case 2:if(Ze=this.productions_[Ke[1]][1],je.$=we[we.length-Ze],je._$={first_line:ge[ge.length-(Ze||1)].first_line,last_line:ge[ge.length-1].last_line,first_column:ge[ge.length-(Ze||1)].first_column,last_column:ge[ge.length-1].last_column},X&&(je._$.range=[ge[ge.length-(Ze||1)].range[0],ge[ge.length-1].range[1]]),Ne=this.performAction.apply(je,[xe,qe,Ee,Y.yy,Ke[1],we,ge].concat(Te)),typeof Ne<"u")return Ne;Ze&&(ce=ce.slice(0,-1*Ze*2),we=we.slice(0,-1*Ze),ge=ge.slice(0,-1*Ze)),ce.push(this.productions_[Ke[1]][0]),we.push(je.$),ge.push(je._$),Fe=ze[ce[ce.length-2]][ce[ce.length-1]],ce.push(Fe);break;case 3:return!0}}return!0},"parse")},me=(function(){var Re={EOF:1,parseError:x(function(Ve,ce){if(this.yy.parser)this.yy.parser.parseError(Ve,ce);else throw new Error(Ve)},"parseError"),setInput:x(function(Pe,Ve){return this.yy=Ve||this.yy||{},this._input=Pe,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Pe=this._input[0];this.yytext+=Pe,this.yyleng++,this.offset++,this.match+=Pe,this.matched+=Pe;var Ve=Pe.match(/(?:\r\n?|\n).*/g);return Ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Pe},"input"),unput:x(function(Pe){var Ve=Pe.length,ce=Pe.split(/(?:\r\n?|\n)/g);this._input=Pe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ve),this.offset-=Ve;var he=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var we=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===he.length?this.yylloc.first_column:0)+he[he.length-ce.length].length-ce[0].length:this.yylloc.first_column-Ve},this.options.ranges&&(this.yylloc.range=[we[0],we[0]+this.yyleng-Ve]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Pe){this.unput(this.match.slice(Pe))},"less"),pastInput:x(function(){var Pe=this.matched.substr(0,this.matched.length-this.match.length);return(Pe.length>20?"...":"")+Pe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Pe=this.match;return Pe.length<20&&(Pe+=this._input.substr(0,20-Pe.length)),(Pe.substr(0,20)+(Pe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Pe=this.pastInput(),Ve=new Array(Pe.length+1).join("-");return Pe+this.upcomingInput()+` +`+Ve+"^"},"showPosition"),test_match:x(function(Pe,Ve){var ce,he,we;if(this.options.backtrack_lexer&&(we={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&&(we.yylloc.range=this.yylloc.range.slice(0))),he=Pe[0].match(/(?:\r\n?|\n).*/g),he&&(this.yylineno+=he.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:he?he[he.length-1].length-he[he.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Pe[0].length},this.yytext+=Pe[0],this.match+=Pe[0],this.matches=Pe,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(Pe[0].length),this.matched+=Pe[0],ce=this.performAction.call(this,this.yy,this,Ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var ge in we)this[ge]=we[ge];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Pe,Ve,ce,he;this._more||(this.yytext="",this.match="");for(var we=this._currentRules(),ge=0;geVe[0].length)){if(Ve=ce,he=ge,this.options.backtrack_lexer){if(Pe=this.test_match(ce,we[ge]),Pe!==!1)return Pe;if(this._backtrack){Ve=!1;continue}else return!1}else if(!this.options.flex)break}return Ve?(Pe=this.test_match(Ve,we[he]),Pe!==!1?Pe:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ve=this.next();return Ve||this.lex()},"lex"),begin:x(function(Ve){this.conditionStack.push(Ve)},"begin"),popState:x(function(){var Ve=this.conditionStack.length-1;return Ve>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ve){return Ve=this.conditionStack.length-1-Math.abs(Ve||0),Ve>=0?this.conditionStack[Ve]:"INITIAL"},"topState"),pushState:x(function(Ve){this.begin(Ve)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Ve,ce,he,we){switch(he){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Re})();ie.lexer=me;function te(){this.yy={}}return x(te,"Parser"),te.prototype=ie,ie.Parser=te,new te})();hY.parser=hY;var snr=hY,Y6,onr=(Y6=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=qi,this.getAccTitle=ia,this.setAccDescription=aa,this.getAccDescription=sa,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getConfig=x(()=>He().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,de.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:He().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),de.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]),de.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),de.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=[],Oi()}getData(){const e=[],r=[],n=He();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:d6(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Y6,"ErDB"),Y6),QOe={};rO(QOe,{draw:()=>lnr});var lnr=x(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=He(),o=n.db.getData(),l=U9(e,i);o.type=n.type,o.layoutAlgorithm=uk(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 Z4(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=vt(this),m=p.attr("id").replace("-background",""),U=l.select(`#${CSS.escape(m)}`);if(!U.empty()){const y=U.attr("transform");p.attr("transform",y)}});const f=8;Kr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),P5(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Zme=x((t,e)=>{const r=IJ,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Eh(n,i,a,e)},"fade"),kM=new Set(["redux-color","redux-dark-color"]),cnr=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!kM.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` - ${zrr(t)} + `;return s},"genColor"),unr=x(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${cnr(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -3614,14 +3747,14 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":Pe="Parse erro } .labelBkg { - background-color: ${T9.has(r)&&n?n:V1e(t.tertiaryColor,.5)}; + background-color: ${kM.has(r)&&n?n:Zme(t.tertiaryColor,.5)}; } .edgeLabel { - background-color: ${T9.has(r)&&n?n:t.edgeLabelBackground}; + background-color: ${kM.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label rect { - fill: ${T9.has(r)&&n?n:t.edgeLabelBackground}; + fill: ${kM.has(r)&&n?n:t.edgeLabelBackground}; } .edgeLabel .label text { fill: ${t.textColor}; @@ -3663,105 +3796,105 @@ Expecting `+st.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":Pe="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${V1e(t.tertiaryColor,.5)}; + background-color: ${Zme(t.tertiaryColor,.5)}; } -`},"getStyles"),Hrr=Vrr,Grr={parser:$rr,get db(){return new Brr},renderer:zDe,styles:Hrr};const Wrr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Grr},Symbol.toStringTag,{value:"Module"}));var qx,_re=(qx=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},w(qx,"ImperativeState"),qx);function ec(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(ec,"populateCommonDb");var qrr=Object.create,R7=Object.defineProperty,Urr=Object.getOwnPropertyDescriptor,Lre=Object.getOwnPropertyNames,jrr=Object.getPrototypeOf,Yrr=Object.prototype.hasOwnProperty,_=(t,e)=>R7(t,"name",{value:e,configurable:!0}),Xrr=(t,e)=>function(){return t&&(e=(0,t[Lre(t)[0]])(t=0)),e},pn=(t,e)=>function(){return e||(0,t[Lre(t)[0]])((e={exports:{}}).exports,e),e.exports},Dm=(t,e)=>{for(var r in e)R7(t,r,{get:e[r],enumerable:!0})},Ire=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lre(e))!Yrr.call(t,i)&&i!==r&&R7(t,i,{get:()=>e[i],enumerable:!(n=Urr(e,i))||n.enumerable});return t},qP=(t,e,r)=>(Ire(t,e,"default"),r),Nre=(t,e,r)=>(r=t!=null?qrr(jrr(t)):{},Ire(R7(r,"default",{value:t,enumerable:!0}),t)),Ore=t=>Ire(R7({},"__esModule",{value:!0}),t),UP={};Dm(UP,{AnnotatedTextEdit:()=>Vf,ChangeAnnotation:()=>k1,ChangeAnnotationIdentifier:()=>bo,CodeAction:()=>BY,CodeActionContext:()=>$Y,CodeActionKind:()=>PY,CodeActionTriggerKind:()=>lS,CodeDescription:()=>pY,CodeLens:()=>FY,Color:()=>k9,ColorInformation:()=>lY,ColorPresentation:()=>cY,Command:()=>C1,CompletionItem:()=>kY,CompletionItemKind:()=>vY,CompletionItemLabelDetails:()=>CY,CompletionItemTag:()=>xY,CompletionList:()=>SY,CreateFile:()=>ib,DeleteFile:()=>ab,Diagnostic:()=>iS,DiagnosticRelatedInformation:()=>S9,DiagnosticSeverity:()=>dY,DiagnosticTag:()=>fY,DocumentHighlight:()=>_Y,DocumentHighlightKind:()=>RY,DocumentLink:()=>VY,DocumentSymbol:()=>DY,DocumentUri:()=>sY,EOL:()=>HDe,FoldingRange:()=>hY,FoldingRangeKind:()=>uY,FormattingOptions:()=>zY,Hover:()=>EY,InlayHint:()=>KY,InlayHintKind:()=>M9,InlayHintLabelPart:()=>R9,InlineCompletionContext:()=>rX,InlineCompletionItem:()=>QY,InlineCompletionList:()=>JY,InlineCompletionTriggerKind:()=>eX,InlineValueContext:()=>XY,InlineValueEvaluatableExpression:()=>YY,InlineValueText:()=>UY,InlineValueVariableLookup:()=>jY,InsertReplaceEdit:()=>wY,InsertTextFormat:()=>bY,InsertTextMode:()=>TY,Location:()=>nS,LocationLink:()=>oY,MarkedString:()=>oS,MarkupContent:()=>ob,MarkupKind:()=>A9,OptionalVersionedTextDocumentIdentifier:()=>aS,ParameterInformation:()=>AY,Position:()=>ui,Range:()=>zn,RenameFile:()=>sb,SelectedCompletionInfo:()=>tX,SelectionRange:()=>HY,SemanticTokenModifiers:()=>WY,SemanticTokenTypes:()=>GY,SemanticTokens:()=>qY,SignatureInformation:()=>MY,StringValue:()=>ZY,SymbolInformation:()=>NY,SymbolKind:()=>LY,SymbolTag:()=>IY,TextDocument:()=>iX,TextDocumentEdit:()=>sS,TextDocumentIdentifier:()=>gY,TextDocumentItem:()=>yY,TextEdit:()=>ud,URI:()=>C9,VersionedTextDocumentIdentifier:()=>mY,WorkspaceChange:()=>VDe,WorkspaceEdit:()=>E9,WorkspaceFolder:()=>nX,WorkspaceSymbol:()=>OY,integer:()=>aY,uinteger:()=>rS});var sY,C9,aY,rS,ui,zn,nS,oY,k9,lY,cY,uY,hY,S9,dY,fY,pY,iS,C1,ud,k1,bo,Vf,sS,ib,sb,ab,E9,lk,kH,VDe,gY,mY,aS,yY,A9,ob,vY,bY,xY,wY,TY,CY,kY,SY,oS,EY,AY,MY,RY,_Y,LY,IY,NY,OY,DY,PY,lS,$Y,BY,FY,zY,VY,HY,GY,WY,qY,UY,jY,YY,XY,M9,R9,KY,ZY,QY,JY,eX,tX,rX,nX,HDe,iX,H1e,at,_7=Xrr({"../../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 s(a){return typeof a=="string"}_(s,"is"),i.is=s})(sY||(sY={})),(function(i){function s(a){return typeof a=="string"}_(s,"is"),i.is=s})(C9||(C9={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}_(s,"is"),i.is=s})(aY||(aY={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function s(a){return typeof a=="number"&&i.MIN_VALUE<=a&&a<=i.MAX_VALUE}_(s,"is"),i.is=s})(rS||(rS={})),(function(i){function s(o,l){return o===Number.MAX_VALUE&&(o=rS.MAX_VALUE),l===Number.MAX_VALUE&&(l=rS.MAX_VALUE),{line:o,character:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.objectLiteral(l)&&at.uinteger(l.line)&&at.uinteger(l.character)}_(a,"is"),i.is=a})(ui||(ui={})),(function(i){function s(o,l,u,h){if(at.uinteger(o)&&at.uinteger(l)&&at.uinteger(u)&&at.uinteger(h))return{start:ui.create(o,l),end:ui.create(u,h)};if(ui.is(o)&&ui.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}_(s,"create"),i.create=s;function a(o){let l=o;return at.objectLiteral(l)&&ui.is(l.start)&&ui.is(l.end)}_(a,"is"),i.is=a})(zn||(zn={})),(function(i){function s(o,l){return{uri:o,range:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.objectLiteral(l)&&zn.is(l.range)&&(at.string(l.uri)||at.undefined(l.uri))}_(a,"is"),i.is=a})(nS||(nS={})),(function(i){function s(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}_(s,"create"),i.create=s;function a(o){let l=o;return at.objectLiteral(l)&&zn.is(l.targetRange)&&at.string(l.targetUri)&&zn.is(l.targetSelectionRange)&&(zn.is(l.originSelectionRange)||at.undefined(l.originSelectionRange))}_(a,"is"),i.is=a})(oY||(oY={})),(function(i){function s(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}_(s,"create"),i.create=s;function a(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)}_(a,"is"),i.is=a})(k9||(k9={})),(function(i){function s(o,l){return{range:o,color:l}}_(s,"create"),i.create=s;function a(o){const l=o;return at.objectLiteral(l)&&zn.is(l.range)&&k9.is(l.color)}_(a,"is"),i.is=a})(lY||(lY={})),(function(i){function s(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}_(s,"create"),i.create=s;function a(o){const l=o;return at.objectLiteral(l)&&at.string(l.label)&&(at.undefined(l.textEdit)||ud.is(l))&&(at.undefined(l.additionalTextEdits)||at.typedArray(l.additionalTextEdits,ud.is))}_(a,"is"),i.is=a})(cY||(cY={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(uY||(uY={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(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))}_(a,"is"),i.is=a})(hY||(hY={})),(function(i){function s(o,l){return{location:o,message:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&nS.is(l.location)&&at.string(l.message)}_(a,"is"),i.is=a})(S9||(S9={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(dY||(dY={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(fY||(fY={})),(function(i){function s(a){const o=a;return at.objectLiteral(o)&&at.string(o.href)}_(s,"is"),i.is=s})(pY||(pY={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(o){var l;let u=o;return at.defined(u)&&zn.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,S9.is))}_(a,"is"),i.is=a})(iS||(iS={})),(function(i){function s(o,l,...u){let h={title:o,command:l};return at.defined(u)&&u.length>0&&(h.arguments=u),h}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.string(l.title)&&at.string(l.command)}_(a,"is"),i.is=a})(C1||(C1={})),(function(i){function s(u,h){return{range:u,newText:h}}_(s,"replace"),i.replace=s;function a(u,h){return{range:{start:u,end:u},newText:h}}_(a,"insert"),i.insert=a;function o(u){return{range:u,newText:""}}_(o,"del"),i.del=o;function l(u){const h=u;return at.objectLiteral(h)&&at.string(h.newText)&&zn.is(h.range)}_(l,"is"),i.is=l})(ud||(ud={})),(function(i){function s(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}_(s,"create"),i.create=s;function a(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)}_(a,"is"),i.is=a})(k1||(k1={})),(function(i){function s(a){const o=a;return at.string(o)}_(s,"is"),i.is=s})(bo||(bo={})),(function(i){function s(u,h,d){return{range:u,newText:h,annotationId:d}}_(s,"replace"),i.replace=s;function a(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}_(a,"insert"),i.insert=a;function o(u,h){return{range:u,newText:"",annotationId:h}}_(o,"del"),i.del=o;function l(u){const h=u;return ud.is(h)&&(k1.is(h.annotationId)||bo.is(h.annotationId))}_(l,"is"),i.is=l})(Vf||(Vf={})),(function(i){function s(o,l){return{textDocument:o,edits:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&aS.is(l.textDocument)&&Array.isArray(l.edits)}_(a,"is"),i.is=a})(sS||(sS={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(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||bo.is(l.annotationId))}_(a,"is"),i.is=a})(ib||(ib={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(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||bo.is(l.annotationId))}_(a,"is"),i.is=a})(sb||(sb={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(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||bo.is(l.annotationId))}_(a,"is"),i.is=a})(ab||(ab={})),(function(i){function s(a){let o=a;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>at.string(l.kind)?ib.is(l)||sb.is(l)||ab.is(l):sS.is(l)))}_(s,"is"),i.is=s})(E9||(E9={})),lk=(t=class{constructor(s,a){this.edits=s,this.changeAnnotations=a}insert(s,a,o){let l,u;if(o===void 0?l=ud.insert(s,a):bo.is(o)?(u=o,l=Vf.insert(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vf.insert(s,a,u)),this.edits.push(l),u!==void 0)return u}replace(s,a,o){let l,u;if(o===void 0?l=ud.replace(s,a):bo.is(o)?(u=o,l=Vf.replace(s,a,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vf.replace(s,a,u)),this.edits.push(l),u!==void 0)return u}delete(s,a){let o,l;if(a===void 0?o=ud.del(s):bo.is(a)?(l=a,o=Vf.del(s,a)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(a),o=Vf.del(s,l)),this.edits.push(o),l!==void 0)return l}add(s){this.edits.push(s)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(s){if(s===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},_(t,"TextEditChangeImpl"),t),kH=(e=class{constructor(s){this._annotations=s===void 0?Object.create(null):s,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(s,a){let o;if(bo.is(s)?o=s:(o=this.nextId(),a=s),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(a===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=a,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},_(e,"ChangeAnnotations"),e),VDe=(r=class{constructor(s){this._textEditChanges=Object.create(null),s!==void 0?(this._workspaceEdit=s,s.documentChanges?(this._changeAnnotations=new kH(s.changeAnnotations),s.changeAnnotations=this._changeAnnotations.all(),s.documentChanges.forEach(a=>{if(sS.is(a)){const o=new lk(a.edits,this._changeAnnotations);this._textEditChanges[a.textDocument.uri]=o}})):s.changes&&Object.keys(s.changes).forEach(a=>{const o=new lk(s.changes[a]);this._textEditChanges[a]=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(s){if(aS.is(s)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const a={uri:s.uri,version:s.version};let o=this._textEditChanges[a.uri];if(!o){const l=[],u={textDocument:a,edits:l};this._workspaceEdit.documentChanges.push(u),o=new lk(l,this._changeAnnotations),this._textEditChanges[a.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 a=this._textEditChanges[s];if(!a){let o=[];this._workspaceEdit.changes[s]=o,a=new lk(o),this._textEditChanges[s]=a}return a}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new kH,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(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;k1.is(a)||bo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=ib.create(s,o):(h=bo.is(l)?l:this._changeAnnotations.manage(l),u=ib.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(s,a,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;k1.is(o)||bo.is(o)?u=o:l=o;let h,d;if(u===void 0?h=sb.create(s,a,l):(d=bo.is(u)?u:this._changeAnnotations.manage(u),h=sb.create(s,a,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(s,a,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;k1.is(a)||bo.is(a)?l=a:o=a;let u,h;if(l===void 0?u=ab.create(s,o):(h=bo.is(l)?l:this._changeAnnotations.manage(l),u=ab.create(s,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},_(r,"WorkspaceChange"),r),(function(i){function s(o){return{uri:o}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.string(l.uri)}_(a,"is"),i.is=a})(gY||(gY={})),(function(i){function s(o,l){return{uri:o,version:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.integer(l.version)}_(a,"is"),i.is=a})(mY||(mY={})),(function(i){function s(o,l){return{uri:o,version:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.string(l.uri)&&(l.version===null||at.integer(l.version))}_(a,"is"),i.is=a})(aS||(aS={})),(function(i){function s(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.string(l.uri)&&at.string(l.languageId)&&at.integer(l.version)&&at.string(l.text)}_(a,"is"),i.is=a})(yY||(yY={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function s(a){const o=a;return o===i.PlainText||o===i.Markdown}_(s,"is"),i.is=s})(A9||(A9={})),(function(i){function s(a){const o=a;return at.objectLiteral(a)&&A9.is(o.kind)&&at.string(o.value)}_(s,"is"),i.is=s})(ob||(ob={})),(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})(vY||(vY={})),(function(i){i.PlainText=1,i.Snippet=2})(bY||(bY={})),(function(i){i.Deprecated=1})(xY||(xY={})),(function(i){function s(o,l,u){return{newText:o,insert:l,replace:u}}_(s,"create"),i.create=s;function a(o){const l=o;return l&&at.string(l.newText)&&zn.is(l.insert)&&zn.is(l.replace)}_(a,"is"),i.is=a})(wY||(wY={})),(function(i){i.asIs=1,i.adjustIndentation=2})(TY||(TY={})),(function(i){function s(a){const o=a;return o&&(at.string(o.detail)||o.detail===void 0)&&(at.string(o.description)||o.description===void 0)}_(s,"is"),i.is=s})(CY||(CY={})),(function(i){function s(a){return{label:a}}_(s,"create"),i.create=s})(kY||(kY={})),(function(i){function s(a,o){return{items:a||[],isIncomplete:!!o}}_(s,"create"),i.create=s})(SY||(SY={})),(function(i){function s(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}_(s,"fromPlainText"),i.fromPlainText=s;function a(o){const l=o;return at.string(l)||at.objectLiteral(l)&&at.string(l.language)&&at.string(l.value)}_(a,"is"),i.is=a})(oS||(oS={})),(function(i){function s(a){let o=a;return!!o&&at.objectLiteral(o)&&(ob.is(o.contents)||oS.is(o.contents)||at.typedArray(o.contents,oS.is))&&(a.range===void 0||zn.is(a.range))}_(s,"is"),i.is=s})(EY||(EY={})),(function(i){function s(a,o){return o?{label:a,documentation:o}:{label:a}}_(s,"create"),i.create=s})(AY||(AY={})),(function(i){function s(a,o,...l){let u={label:a};return at.defined(o)&&(u.documentation=o),at.defined(l)?u.parameters=l:u.parameters=[],u}_(s,"create"),i.create=s})(MY||(MY={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(RY||(RY={})),(function(i){function s(a,o){let l={range:a};return at.number(o)&&(l.kind=o),l}_(s,"create"),i.create=s})(_Y||(_Y={})),(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})(LY||(LY={})),(function(i){i.Deprecated=1})(IY||(IY={})),(function(i){function s(a,o,l,u,h){let d={name:a,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}_(s,"create"),i.create=s})(NY||(NY={})),(function(i){function s(a,o,l,u){return u!==void 0?{name:a,kind:o,location:{uri:l,range:u}}:{name:a,kind:o,location:{uri:l}}}_(s,"create"),i.create=s})(OY||(OY={})),(function(i){function s(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}_(s,"create"),i.create=s;function a(o){let l=o;return l&&at.string(l.name)&&at.number(l.kind)&&zn.is(l.range)&&zn.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))}_(a,"is"),i.is=a})(DY||(DY={})),(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"})(PY||(PY={})),(function(i){i.Invoked=1,i.Automatic=2})(lS||(lS={})),(function(i){function s(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.typedArray(l.diagnostics,iS.is)&&(l.only===void 0||at.typedArray(l.only,at.string))&&(l.triggerKind===void 0||l.triggerKind===lS.Invoked||l.triggerKind===lS.Automatic)}_(a,"is"),i.is=a})($Y||($Y={})),(function(i){function s(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):C1.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}_(s,"create"),i.create=s;function a(o){let l=o;return l&&at.string(l.title)&&(l.diagnostics===void 0||at.typedArray(l.diagnostics,iS.is))&&(l.kind===void 0||at.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||C1.is(l.command))&&(l.isPreferred===void 0||at.boolean(l.isPreferred))&&(l.edit===void 0||E9.is(l.edit))}_(a,"is"),i.is=a})(BY||(BY={})),(function(i){function s(o,l){let u={range:o};return at.defined(l)&&(u.data=l),u}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&zn.is(l.range)&&(at.undefined(l.command)||C1.is(l.command))}_(a,"is"),i.is=a})(FY||(FY={})),(function(i){function s(o,l){return{tabSize:o,insertSpaces:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&at.uinteger(l.tabSize)&&at.boolean(l.insertSpaces)}_(a,"is"),i.is=a})(zY||(zY={})),(function(i){function s(o,l,u){return{range:o,target:l,data:u}}_(s,"create"),i.create=s;function a(o){let l=o;return at.defined(l)&&zn.is(l.range)&&(at.undefined(l.target)||at.string(l.target))}_(a,"is"),i.is=a})(VY||(VY={})),(function(i){function s(o,l){return{range:o,parent:l}}_(s,"create"),i.create=s;function a(o){let l=o;return at.objectLiteral(l)&&zn.is(l.range)&&(l.parent===void 0||i.is(l.parent))}_(a,"is"),i.is=a})(HY||(HY={})),(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"})(GY||(GY={})),(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"})(WY||(WY={})),(function(i){function s(a){const o=a;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")}_(s,"is"),i.is=s})(qY||(qY={})),(function(i){function s(o,l){return{range:o,text:l}}_(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&zn.is(l.range)&&at.string(l.text)}_(a,"is"),i.is=a})(UY||(UY={})),(function(i){function s(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}_(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&zn.is(l.range)&&at.boolean(l.caseSensitiveLookup)&&(at.string(l.variableName)||l.variableName===void 0)}_(a,"is"),i.is=a})(jY||(jY={})),(function(i){function s(o,l){return{range:o,expression:l}}_(s,"create"),i.create=s;function a(o){const l=o;return l!=null&&zn.is(l.range)&&(at.string(l.expression)||l.expression===void 0)}_(a,"is"),i.is=a})(YY||(YY={})),(function(i){function s(o,l){return{frameId:o,stoppedLocation:l}}_(s,"create"),i.create=s;function a(o){const l=o;return at.defined(l)&&zn.is(o.stoppedLocation)}_(a,"is"),i.is=a})(XY||(XY={})),(function(i){i.Type=1,i.Parameter=2;function s(a){return a===1||a===2}_(s,"is"),i.is=s})(M9||(M9={})),(function(i){function s(o){return{value:o}}_(s,"create"),i.create=s;function a(o){const l=o;return at.objectLiteral(l)&&(l.tooltip===void 0||at.string(l.tooltip)||ob.is(l.tooltip))&&(l.location===void 0||nS.is(l.location))&&(l.command===void 0||C1.is(l.command))}_(a,"is"),i.is=a})(R9||(R9={})),(function(i){function s(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}_(s,"create"),i.create=s;function a(o){const l=o;return at.objectLiteral(l)&&ui.is(l.position)&&(at.string(l.label)||at.typedArray(l.label,R9.is))&&(l.kind===void 0||M9.is(l.kind))&&l.textEdits===void 0||at.typedArray(l.textEdits,ud.is)&&(l.tooltip===void 0||at.string(l.tooltip)||ob.is(l.tooltip))&&(l.paddingLeft===void 0||at.boolean(l.paddingLeft))&&(l.paddingRight===void 0||at.boolean(l.paddingRight))}_(a,"is"),i.is=a})(KY||(KY={})),(function(i){function s(a){return{kind:"snippet",value:a}}_(s,"createSnippet"),i.createSnippet=s})(ZY||(ZY={})),(function(i){function s(a,o,l,u){return{insertText:a,filterText:o,range:l,command:u}}_(s,"create"),i.create=s})(QY||(QY={})),(function(i){function s(a){return{items:a}}_(s,"create"),i.create=s})(JY||(JY={})),(function(i){i.Invoked=0,i.Automatic=1})(eX||(eX={})),(function(i){function s(a,o){return{range:a,text:o}}_(s,"create"),i.create=s})(tX||(tX={})),(function(i){function s(a,o){return{triggerKind:a,selectedCompletionInfo:o}}_(s,"create"),i.create=s})(rX||(rX={})),(function(i){function s(a){const o=a;return at.objectLiteral(o)&&C9.is(o.uri)&&at.string(o.name)}_(s,"is"),i.is=s})(nX||(nX={})),HDe=[` +`},"getStyles"),hnr=unr,dnr={parser:snr,get db(){return new onr},renderer:QOe,styles:hnr};const fnr=Object.freeze(Object.defineProperty({__proto__:null,diagram:dnr},Symbol.toStringTag,{value:"Module"}));var X6,Bre=(X6=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(X6,"ImperativeState"),X6);function ec(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(ec,"populateCommonDb");var pnr=Object.create,Ik=Object.defineProperty,gnr=Object.getOwnPropertyDescriptor,$re=Object.getOwnPropertyNames,mnr=Object.getPrototypeOf,Unr=Object.prototype.hasOwnProperty,M=(t,e)=>Ik(t,"name",{value:e,configurable:!0}),ynr=(t,e)=>function(){return t&&(e=(0,t[$re(t)[0]])(t=0)),e},mn=(t,e)=>function(){return e||(0,t[$re(t)[0]])((e={exports:{}}).exports,e),e.exports},P1=(t,e)=>{for(var r in e)Ik(t,r,{get:e[r],enumerable:!0})},Fre=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $re(e))!Unr.call(t,i)&&i!==r&&Ik(t,i,{get:()=>e[i],enumerable:!(n=gnr(e,i))||n.enumerable});return t},Y_=(t,e,r)=>(Fre(t,e,"default"),r),zre=(t,e,r)=>(r=t!=null?pnr(mnr(t)):{},Fre(Ik(r,"default",{value:t,enumerable:!0}),t)),Vre=t=>Fre(Ik({},"__esModule",{value:!0}),t),X_={};P1(X_,{AnnotatedTextEdit:()=>Vf,ChangeAnnotation:()=>Em,ChangeAnnotationIdentifier:()=>bo,CodeAction:()=>WY,CodeActionContext:()=>GY,CodeActionKind:()=>HY,CodeActionTriggerKind:()=>dx,CodeDescription:()=>xY,CodeLens:()=>qY,Color:()=>EM,ColorInformation:()=>gY,ColorPresentation:()=>mY,Command:()=>Sm,CompletionItem:()=>LY,CompletionItemKind:()=>kY,CompletionItemLabelDetails:()=>RY,CompletionItemTag:()=>EY,CompletionList:()=>IY,CreateFile:()=>oy,DeleteFile:()=>cy,Diagnostic:()=>lx,DiagnosticRelatedInformation:()=>AM,DiagnosticSeverity:()=>bY,DiagnosticTag:()=>vY,DocumentHighlight:()=>PY,DocumentHighlightKind:()=>_Y,DocumentLink:()=>YY,DocumentSymbol:()=>VY,DocumentUri:()=>dY,EOL:()=>t_e,FoldingRange:()=>yY,FoldingRangeKind:()=>UY,FormattingOptions:()=>jY,Hover:()=>NY,InlayHint:()=>nX,InlayHintKind:()=>LM,InlayHintLabelPart:()=>IM,InlineCompletionContext:()=>cX,InlineCompletionItem:()=>aX,InlineCompletionList:()=>sX,InlineCompletionTriggerKind:()=>oX,InlineValueContext:()=>rX,InlineValueEvaluatableExpression:()=>tX,InlineValueText:()=>QY,InlineValueVariableLookup:()=>eX,InsertReplaceEdit:()=>AY,InsertTextFormat:()=>SY,InsertTextMode:()=>MY,Location:()=>ox,LocationLink:()=>pY,MarkedString:()=>hx,MarkupContent:()=>uy,MarkupKind:()=>RM,OptionalVersionedTextDocumentIdentifier:()=>ux,ParameterInformation:()=>DY,Position:()=>hi,Range:()=>zn,RenameFile:()=>ly,SelectedCompletionInfo:()=>lX,SelectionRange:()=>XY,SemanticTokenModifiers:()=>ZY,SemanticTokenTypes:()=>KY,SemanticTokens:()=>JY,SignatureInformation:()=>OY,StringValue:()=>iX,SymbolInformation:()=>FY,SymbolKind:()=>BY,SymbolTag:()=>$Y,TextDocument:()=>hX,TextDocumentEdit:()=>cx,TextDocumentIdentifier:()=>wY,TextDocumentItem:()=>CY,TextEdit:()=>hd,URI:()=>SM,VersionedTextDocumentIdentifier:()=>TY,WorkspaceChange:()=>e_e,WorkspaceEdit:()=>MM,WorkspaceFolder:()=>uX,WorkspaceSymbol:()=>zY,integer:()=>fY,uinteger:()=>sx});var dY,SM,fY,sx,hi,zn,ox,pY,EM,gY,mY,UY,yY,AM,bY,vY,xY,lx,Sm,hd,Em,bo,Vf,cx,oy,ly,cy,MM,h3,MV,e_e,wY,TY,ux,CY,RM,uy,kY,SY,EY,AY,MY,RY,LY,IY,hx,NY,DY,OY,_Y,PY,BY,$Y,FY,zY,VY,HY,dx,GY,WY,qY,jY,YY,XY,KY,ZY,JY,QY,eX,tX,rX,LM,IM,nX,iX,aX,sX,oX,lX,cX,uX,t_e,hX,Jme,st,Nk=ynr({"../../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"}M(a,"is"),i.is=a})(dY||(dY={})),(function(i){function a(s){return typeof s=="string"}M(a,"is"),i.is=a})(SM||(SM={})),(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}M(a,"is"),i.is=a})(fY||(fY={})),(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}M(a,"is"),i.is=a})(sx||(sx={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=sx.MAX_VALUE),l===Number.MAX_VALUE&&(l=sx.MAX_VALUE),{line:o,character:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.objectLiteral(l)&&st.uinteger(l.line)&&st.uinteger(l.character)}M(s,"is"),i.is=s})(hi||(hi={})),(function(i){function a(o,l,u,h){if(st.uinteger(o)&&st.uinteger(l)&&st.uinteger(u)&&st.uinteger(h))return{start:hi.create(o,l),end:hi.create(u,h)};if(hi.is(o)&&hi.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}M(a,"create"),i.create=a;function s(o){let l=o;return st.objectLiteral(l)&&hi.is(l.start)&&hi.is(l.end)}M(s,"is"),i.is=s})(zn||(zn={})),(function(i){function a(o,l){return{uri:o,range:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.objectLiteral(l)&&zn.is(l.range)&&(st.string(l.uri)||st.undefined(l.uri))}M(s,"is"),i.is=s})(ox||(ox={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}M(a,"create"),i.create=a;function s(o){let l=o;return st.objectLiteral(l)&&zn.is(l.targetRange)&&st.string(l.targetUri)&&zn.is(l.targetSelectionRange)&&(zn.is(l.originSelectionRange)||st.undefined(l.originSelectionRange))}M(s,"is"),i.is=s})(pY||(pY={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&st.numberRange(l.red,0,1)&&st.numberRange(l.green,0,1)&&st.numberRange(l.blue,0,1)&&st.numberRange(l.alpha,0,1)}M(s,"is"),i.is=s})(EM||(EM={})),(function(i){function a(o,l){return{range:o,color:l}}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&zn.is(l.range)&&EM.is(l.color)}M(s,"is"),i.is=s})(gY||(gY={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&st.string(l.label)&&(st.undefined(l.textEdit)||hd.is(l))&&(st.undefined(l.additionalTextEdits)||st.typedArray(l.additionalTextEdits,hd.is))}M(s,"is"),i.is=s})(mY||(mY={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(UY||(UY={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return st.defined(u)&&(p.startCharacter=u),st.defined(h)&&(p.endCharacter=h),st.defined(d)&&(p.kind=d),st.defined(f)&&(p.collapsedText=f),p}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&st.uinteger(l.startLine)&&st.uinteger(l.startLine)&&(st.undefined(l.startCharacter)||st.uinteger(l.startCharacter))&&(st.undefined(l.endCharacter)||st.uinteger(l.endCharacter))&&(st.undefined(l.kind)||st.string(l.kind))}M(s,"is"),i.is=s})(yY||(yY={})),(function(i){function a(o,l){return{location:o,message:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&ox.is(l.location)&&st.string(l.message)}M(s,"is"),i.is=s})(AM||(AM={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(bY||(bY={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(vY||(vY={})),(function(i){function a(s){const o=s;return st.objectLiteral(o)&&st.string(o.href)}M(a,"is"),i.is=a})(xY||(xY={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return st.defined(u)&&(p.severity=u),st.defined(h)&&(p.code=h),st.defined(d)&&(p.source=d),st.defined(f)&&(p.relatedInformation=f),p}M(a,"create"),i.create=a;function s(o){var l;let u=o;return st.defined(u)&&zn.is(u.range)&&st.string(u.message)&&(st.number(u.severity)||st.undefined(u.severity))&&(st.integer(u.code)||st.string(u.code)||st.undefined(u.code))&&(st.undefined(u.codeDescription)||st.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(st.string(u.source)||st.undefined(u.source))&&(st.undefined(u.relatedInformation)||st.typedArray(u.relatedInformation,AM.is))}M(s,"is"),i.is=s})(lx||(lx={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return st.defined(u)&&u.length>0&&(h.arguments=u),h}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.string(l.title)&&st.string(l.command)}M(s,"is"),i.is=s})(Sm||(Sm={})),(function(i){function a(u,h){return{range:u,newText:h}}M(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}M(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}M(o,"del"),i.del=o;function l(u){const h=u;return st.objectLiteral(h)&&st.string(h.newText)&&zn.is(h.range)}M(l,"is"),i.is=l})(hd||(hd={})),(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}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&st.string(l.label)&&(st.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(st.string(l.description)||l.description===void 0)}M(s,"is"),i.is=s})(Em||(Em={})),(function(i){function a(s){const o=s;return st.string(o)}M(a,"is"),i.is=a})(bo||(bo={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}M(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}M(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}M(o,"del"),i.del=o;function l(u){const h=u;return hd.is(h)&&(Em.is(h.annotationId)||bo.is(h.annotationId))}M(l,"is"),i.is=l})(Vf||(Vf={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&ux.is(l.textDocument)&&Array.isArray(l.edits)}M(s,"is"),i.is=s})(cx||(cx={})),(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}M(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&st.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||st.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||st.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||bo.is(l.annotationId))}M(s,"is"),i.is=s})(oy||(oy={})),(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}M(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&st.string(l.oldUri)&&st.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||st.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||st.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||bo.is(l.annotationId))}M(s,"is"),i.is=s})(ly||(ly={})),(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}M(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&st.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||st.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||st.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||bo.is(l.annotationId))}M(s,"is"),i.is=s})(cy||(cy={})),(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=>st.string(l.kind)?oy.is(l)||ly.is(l)||cy.is(l):cx.is(l)))}M(a,"is"),i.is=a})(MM||(MM={})),h3=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=hd.insert(a,s):bo.is(o)?(u=o,l=Vf.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vf.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=hd.replace(a,s):bo.is(o)?(u=o,l=Vf.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Vf.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=hd.del(a):bo.is(s)?(l=s,o=Vf.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Vf.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.")}},M(t,"TextEditChangeImpl"),t),MV=(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(bo.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()}},M(e,"ChangeAnnotations"),e),e_e=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new MV(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(cx.is(s)){const o=new h3(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new h3(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(ux.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 h3(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 h3(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new MV,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;Em.is(s)||bo.is(s)?l=s:o=s;let u,h;if(l===void 0?u=oy.create(a,o):(h=bo.is(l)?l:this._changeAnnotations.manage(l),u=oy.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;Em.is(o)||bo.is(o)?u=o:l=o;let h,d;if(u===void 0?h=ly.create(a,s,l):(d=bo.is(u)?u:this._changeAnnotations.manage(u),h=ly.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;Em.is(s)||bo.is(s)?l=s:o=s;let u,h;if(l===void 0?u=cy.create(a,o):(h=bo.is(l)?l:this._changeAnnotations.manage(l),u=cy.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},M(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.string(l.uri)}M(s,"is"),i.is=s})(wY||(wY={})),(function(i){function a(o,l){return{uri:o,version:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.string(l.uri)&&st.integer(l.version)}M(s,"is"),i.is=s})(TY||(TY={})),(function(i){function a(o,l){return{uri:o,version:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.string(l.uri)&&(l.version===null||st.integer(l.version))}M(s,"is"),i.is=s})(ux||(ux={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.string(l.uri)&&st.string(l.languageId)&&st.integer(l.version)&&st.string(l.text)}M(s,"is"),i.is=s})(CY||(CY={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}M(a,"is"),i.is=a})(RM||(RM={})),(function(i){function a(s){const o=s;return st.objectLiteral(s)&&RM.is(o.kind)&&st.string(o.value)}M(a,"is"),i.is=a})(uy||(uy={})),(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})(kY||(kY={})),(function(i){i.PlainText=1,i.Snippet=2})(SY||(SY={})),(function(i){i.Deprecated=1})(EY||(EY={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}M(a,"create"),i.create=a;function s(o){const l=o;return l&&st.string(l.newText)&&zn.is(l.insert)&&zn.is(l.replace)}M(s,"is"),i.is=s})(AY||(AY={})),(function(i){i.asIs=1,i.adjustIndentation=2})(MY||(MY={})),(function(i){function a(s){const o=s;return o&&(st.string(o.detail)||o.detail===void 0)&&(st.string(o.description)||o.description===void 0)}M(a,"is"),i.is=a})(RY||(RY={})),(function(i){function a(s){return{label:s}}M(a,"create"),i.create=a})(LY||(LY={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}M(a,"create"),i.create=a})(IY||(IY={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}M(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return st.string(l)||st.objectLiteral(l)&&st.string(l.language)&&st.string(l.value)}M(s,"is"),i.is=s})(hx||(hx={})),(function(i){function a(s){let o=s;return!!o&&st.objectLiteral(o)&&(uy.is(o.contents)||hx.is(o.contents)||st.typedArray(o.contents,hx.is))&&(s.range===void 0||zn.is(s.range))}M(a,"is"),i.is=a})(NY||(NY={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}M(a,"create"),i.create=a})(DY||(DY={})),(function(i){function a(s,o,...l){let u={label:s};return st.defined(o)&&(u.documentation=o),st.defined(l)?u.parameters=l:u.parameters=[],u}M(a,"create"),i.create=a})(OY||(OY={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(_Y||(_Y={})),(function(i){function a(s,o){let l={range:s};return st.number(o)&&(l.kind=o),l}M(a,"create"),i.create=a})(PY||(PY={})),(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})(BY||(BY={})),(function(i){i.Deprecated=1})($Y||($Y={})),(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}M(a,"create"),i.create=a})(FY||(FY={})),(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}}}M(a,"create"),i.create=a})(zY||(zY={})),(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}M(a,"create"),i.create=a;function s(o){let l=o;return l&&st.string(l.name)&&st.number(l.kind)&&zn.is(l.range)&&zn.is(l.selectionRange)&&(l.detail===void 0||st.string(l.detail))&&(l.deprecated===void 0||st.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}M(s,"is"),i.is=s})(VY||(VY={})),(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"})(HY||(HY={})),(function(i){i.Invoked=1,i.Automatic=2})(dx||(dx={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.typedArray(l.diagnostics,lx.is)&&(l.only===void 0||st.typedArray(l.only,st.string))&&(l.triggerKind===void 0||l.triggerKind===dx.Invoked||l.triggerKind===dx.Automatic)}M(s,"is"),i.is=s})(GY||(GY={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):Sm.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}M(a,"create"),i.create=a;function s(o){let l=o;return l&&st.string(l.title)&&(l.diagnostics===void 0||st.typedArray(l.diagnostics,lx.is))&&(l.kind===void 0||st.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||Sm.is(l.command))&&(l.isPreferred===void 0||st.boolean(l.isPreferred))&&(l.edit===void 0||MM.is(l.edit))}M(s,"is"),i.is=s})(WY||(WY={})),(function(i){function a(o,l){let u={range:o};return st.defined(l)&&(u.data=l),u}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&zn.is(l.range)&&(st.undefined(l.command)||Sm.is(l.command))}M(s,"is"),i.is=s})(qY||(qY={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&st.uinteger(l.tabSize)&&st.boolean(l.insertSpaces)}M(s,"is"),i.is=s})(jY||(jY={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}M(a,"create"),i.create=a;function s(o){let l=o;return st.defined(l)&&zn.is(l.range)&&(st.undefined(l.target)||st.string(l.target))}M(s,"is"),i.is=s})(YY||(YY={})),(function(i){function a(o,l){return{range:o,parent:l}}M(a,"create"),i.create=a;function s(o){let l=o;return st.objectLiteral(l)&&zn.is(l.range)&&(l.parent===void 0||i.is(l.parent))}M(s,"is"),i.is=s})(XY||(XY={})),(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"})(KY||(KY={})),(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"})(ZY||(ZY={})),(function(i){function a(s){const o=s;return st.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}M(a,"is"),i.is=a})(JY||(JY={})),(function(i){function a(o,l){return{range:o,text:l}}M(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&zn.is(l.range)&&st.string(l.text)}M(s,"is"),i.is=s})(QY||(QY={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}M(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&zn.is(l.range)&&st.boolean(l.caseSensitiveLookup)&&(st.string(l.variableName)||l.variableName===void 0)}M(s,"is"),i.is=s})(eX||(eX={})),(function(i){function a(o,l){return{range:o,expression:l}}M(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&zn.is(l.range)&&(st.string(l.expression)||l.expression===void 0)}M(s,"is"),i.is=s})(tX||(tX={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}M(a,"create"),i.create=a;function s(o){const l=o;return st.defined(l)&&zn.is(o.stoppedLocation)}M(s,"is"),i.is=s})(rX||(rX={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}M(a,"is"),i.is=a})(LM||(LM={})),(function(i){function a(o){return{value:o}}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&(l.tooltip===void 0||st.string(l.tooltip)||uy.is(l.tooltip))&&(l.location===void 0||ox.is(l.location))&&(l.command===void 0||Sm.is(l.command))}M(s,"is"),i.is=s})(IM||(IM={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}M(a,"create"),i.create=a;function s(o){const l=o;return st.objectLiteral(l)&&hi.is(l.position)&&(st.string(l.label)||st.typedArray(l.label,IM.is))&&(l.kind===void 0||LM.is(l.kind))&&l.textEdits===void 0||st.typedArray(l.textEdits,hd.is)&&(l.tooltip===void 0||st.string(l.tooltip)||uy.is(l.tooltip))&&(l.paddingLeft===void 0||st.boolean(l.paddingLeft))&&(l.paddingRight===void 0||st.boolean(l.paddingRight))}M(s,"is"),i.is=s})(nX||(nX={})),(function(i){function a(s){return{kind:"snippet",value:s}}M(a,"createSnippet"),i.createSnippet=a})(iX||(iX={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}M(a,"create"),i.create=a})(aX||(aX={})),(function(i){function a(s){return{items:s}}M(a,"create"),i.create=a})(sX||(sX={})),(function(i){i.Invoked=0,i.Automatic=1})(oX||(oX={})),(function(i){function a(s,o){return{range:s,text:o}}M(a,"create"),i.create=a})(lX||(lX={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}M(a,"create"),i.create=a})(cX||(cX={})),(function(i){function a(s){const o=s;return st.objectLiteral(o)&&SM.is(o.uri)&&st.string(o.name)}M(a,"is"),i.is=a})(uX||(uX={})),t_e=[` `,`\r -`,"\r"],(function(i){function s(u,h,d,f){return new H1e(u,h,d,f)}_(s,"create"),i.create=s;function a(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))}_(a,"is"),i.is=a;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}_(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&&s.push(a.length),this._lineOffsets=s}return this._lineOffsets}positionAt(s){s=Math.max(Math.min(s,this._content.length),0);let a=this.getLineOffsets(),o=0,l=a.length;if(l===0)return ui.create(0,s);for(;os?l=h:o=h+1}let u=o-1;return ui.create(u,s-a[u])}offsetAt(s){let a=this.getLineOffsets();if(s.line>=a.length)return this._content.length;if(s.line<0)return 0;let o=a[s.line],l=s.line+1"u"}_(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}_(l,"boolean"),i.boolean=l;function u(v){return s.call(v)==="[object String]"}_(u,"string"),i.string=u;function h(v){return s.call(v)==="[object Number]"}_(h,"number"),i.number=h;function d(v,b,x){return s.call(v)==="[object Number]"&&b<=v&&v<=x}_(d,"numberRange"),i.numberRange=d;function f(v){return s.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}_(f,"integer"),i.integer=f;function p(v){return s.call(v)==="[object Number]"&&0<=v&&v<=2147483647}_(p,"uinteger"),i.uinteger=p;function g(v){return s.call(v)==="[object Function]"}_(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}_(m,"objectLiteral"),i.objectLiteral=m;function y(v,b){return Array.isArray(v)&&v.every(b)}_(y,"typedArray"),i.typedArray=y})(at||(at={}))}}),Dv=pn({"../../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,"RAL"),(function(n){function i(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");e=s}_(i,"install"),n.install=i})(r||(r={})),t.default=r}}),L7=pn({"../../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}_(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}_(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}_(n,"number"),t.number=n;function i(l){return l instanceof Error}_(i,"error"),t.error=i;function s(l){return typeof l=="function"}_(s,"func"),t.func=s;function a(l){return Array.isArray(l)}_(a,"array"),t.array=a;function o(l){return a(l)&&l.every(u=>r(u))}_(o,"stringArray"),t.stringArray=o}}),gC=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Dv(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(s=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:_(()=>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:_(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=a._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},_(a,"Emitter"),a);t.Emitter=i,i._noop=function(){}}}),jP=pn({"../../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=Dv(),r=L7(),n=gC(),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)}_(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var s=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),a=(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?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},_(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=i.None}},_(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),GDe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,L,I,$,O,D,B,z,V,F,H,G,W,K,q,oe,Z,Q,ne,ie,me,te,_e,$e,Ve;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=L7(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(he,Te,ge){super(Te),this.code=e.number(he)?he:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const he={code:this.code,message:this.message};return this.data!==void 0&&(he.data=this.data),he}},_(N,"ResponseError"),N);t.ResponseError=n;var i=(L=class{constructor(he){this.kind=he}static is(he){return he===L.auto||he===L.byName||he===L.byPosition}toString(){return this.kind}},_(L,"ParameterStructures"),L);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var s=(I=class{constructor(he,Te){this.method=he,this.numberOfParams=Te}get parameterStructures(){return i.auto}},_(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=s;var a=($=class extends s{constructor(he){super(he,0)}},_($,"RequestType0"),$);t.RequestType0=a;var o=(O=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},_(O,"RequestType"),O);t.RequestType=o;var l=(D=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},_(D,"RequestType1"),D);t.RequestType1=l;var u=(B=class extends s{constructor(he){super(he,2)}},_(B,"RequestType2"),B);t.RequestType2=u;var h=(z=class extends s{constructor(he){super(he,3)}},_(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends s{constructor(he){super(he,4)}},_(V,"RequestType4"),V);t.RequestType4=d;var f=(F=class extends s{constructor(he){super(he,5)}},_(F,"RequestType5"),F);t.RequestType5=f;var p=(H=class extends s{constructor(he){super(he,6)}},_(H,"RequestType6"),H);t.RequestType6=p;var g=(G=class extends s{constructor(he){super(he,7)}},_(G,"RequestType7"),G);t.RequestType7=g;var m=(W=class extends s{constructor(he){super(he,8)}},_(W,"RequestType8"),W);t.RequestType8=m;var y=(K=class extends s{constructor(he){super(he,9)}},_(K,"RequestType9"),K);t.RequestType9=y;var v=(q=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},_(q,"NotificationType"),q);t.NotificationType=v;var b=(oe=class extends s{constructor(he){super(he,0)}},_(oe,"NotificationType0"),oe);t.NotificationType0=b;var x=(Z=class extends s{constructor(he,Te=i.auto){super(he,1),this._parameterStructures=Te}get parameterStructures(){return this._parameterStructures}},_(Z,"NotificationType1"),Z);t.NotificationType1=x;var T=(Q=class extends s{constructor(he){super(he,2)}},_(Q,"NotificationType2"),Q);t.NotificationType2=T;var C=(ne=class extends s{constructor(he){super(he,3)}},_(ne,"NotificationType3"),ne);t.NotificationType3=C;var S=(ie=class extends s{constructor(he){super(he,4)}},_(ie,"NotificationType4"),ie);t.NotificationType4=S;var k=(me=class extends s{constructor(he){super(he,5)}},_(me,"NotificationType5"),me);t.NotificationType5=k;var E=(te=class extends s{constructor(he){super(he,6)}},_(te,"NotificationType6"),te);t.NotificationType6=E;var A=(_e=class extends s{constructor(he){super(he,7)}},_(_e,"NotificationType7"),_e);t.NotificationType7=A;var M=($e=class extends s{constructor(he){super(he,8)}},_($e,"NotificationType8"),$e);t.NotificationType8=M;var R=(Ve=class extends s{constructor(he){super(he,9)}},_(Ve,"NotificationType9"),Ve);t.NotificationType9=R;var P;(function(ce){function he(ze){const we=ze;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}_(he,"isRequest"),ce.isRequest=he;function Te(ze){const we=ze;return we&&e.string(we.method)&&ze.id===void 0}_(Te,"isNotification"),ce.isNotification=Te;function ge(ze){const we=ze;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}_(ge,"isResponse"),ce.isResponse=ge})(P||(t.Message=P={}))}}),WDe=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var s,a;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=(s=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:_(()=>{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:_(()=>{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:_(()=>{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)}},_(s,"LinkedMap"),s);t.LinkedMap=n;var i=(a=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},_(a,"LRUCache"),a);t.LRUCache=i}}),Krr=pn({"../../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}}_(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),Zrr=pn({"../../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=jP(),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()}},_(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")}},_(l,"SharedArrayBufferCancellationToken"),l),s=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},_(u,"SharedArrayBufferCancellationTokenSource"),u),a=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new s(p)}},_(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=a}}),qDe=pn({"../../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=Dv(),r=(n=class{constructor(s=1){if(s<=0)throw new Error("Capacity must be greater than 0");this._capacity=s,this._active=0,this._waiting=[]}lock(s){return new Promise((a,o)=>{this._waiting.push({thunk:s,resolve:a,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 s=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=s.thunk();a instanceof Promise?a.then(o=>{this._active--,s.resolve(o),this.runNext()},o=>{this._active--,s.reject(o),this.runNext()}):(this._active--,s.resolve(a),this.runNext())}catch(a){this._active--,s.reject(a),this.runNext()}}},_(n,"Semaphore"),n);t.Semaphore=r}}),Qrr=pn({"../../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=Dv(),r=L7(),n=gC(),i=qDe(),s;(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)}_(f,"is"),d.is=f})(s||(t.MessageReader=s={}));var a=(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"}`)}},_(u,"AbstractMessageReader"),u);t.AbstractMessageReader=a;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const b=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 x of p.contentDecoders)y.set(x.name,x);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,b.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const x of p.contentTypeDecoders)b.set(x.name,x)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,b.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:b}}_(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends a{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))}},_(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),Jrr=pn({"../../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=Dv(),r=L7(),n=qDe(),i=gC(),s="Content-Length: ",a=`\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)}_(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"}`)}},_(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}}_(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(s,y.byteLength.toString(),a),v.push(a),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()}},_(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),enr=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r -`,i=(s=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}},_(s,"AbstractMessageBuffer"),s);t.AbstractMessageBuffer=i}}),tnr=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;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=Dv(),r=L7(),n=GDe(),i=WDe(),s=gC(),a=jP(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}_($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},_(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}_($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:_(()=>{},"error"),warn:_(()=>{},"warn"),info:_(()=>{},"info"),log:_(()=>{},"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 $(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}_($,"fromString"),I.fromString=$;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}_(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}_($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var b=(L=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,L.prototype)}},_(L,"ConnectionError"),L);t.ConnectionError=b;var x;(function(I){function $(O){const D=O;return D&&r.func(D.cancelUndispatched)}_($,"is"),I.is=$})(x||(t.ConnectionStrategy=x={}));var T;(function(I){function $(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}_($,"is"),I.is=$})(T||(t.IdCancellationReceiverStrategy=T={}));var C;(function(I){function $(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}_($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new a.CancellationTokenSource}});function $(O){return T.is(O)||C.is(O)}_($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function $(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}_($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const D=O;return D&&S.is(D.receiver)&&k.is(D.sender)}_($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var A;(function(I){function $(O){const D=O;return D&&r.func(D.handleMessage)}_($,"is"),I.is=$})(A||(t.MessageStrategy=A={}));var M;(function(I){function $(O){const D=O;return D&&(E.is(D.cancellationStrategy)||x.is(D.connectionStrategy)||A.is(D.messageStrategy))}_($,"is"),I.is=$})(M||(t.ConnectionOptions=M={}));var R;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(R||(R={}));function P(I,$,O,D){const B=O!==void 0?O:t.NullLogger;let z=0,V=0,F=0;const H="2.0";let G;const W=new Map;let K;const q=new Map,oe=new Map;let Z,Q=new i.LinkedMap,ne=new Map,ie=new Set,me=new Map,te=f.Off,_e=g.Text,$e,Ve=R.New;const ce=new s.Emitter,he=new s.Emitter,Te=new s.Emitter,ge=new s.Emitter,ze=new s.Emitter,we=D&&D.cancellationStrategy?D.cancellationStrategy:E.Message;function Ae(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}_(Ae,"createRequestQueueKey");function qe(Ee){return Ee===null?"res-unknown-"+(++F).toString():"res-"+Ee.toString()}_(qe,"createResponseQueueKey");function le(){return"not-"+(++V).toString()}_(le,"createNotificationQueueKey");function pe(Ee,it){n.Message.isRequest(it)?Ee.set(Ae(it.id),it):n.Message.isResponse(it)?Ee.set(qe(it.id),it):Ee.set(le(),it)}_(pe,"addMessageToQueue");function Ce(Ee){}_(Ce,"cancelUndispatched");function re(){return Ve===R.Listening}_(re,"isListening");function Y(){return Ve===R.Closed}_(Y,"isClosed");function J(){return Ve===R.Disposed}_(J,"isDisposed");function ue(){(Ve===R.New||Ve===R.Listening)&&(Ve=R.Closed,he.fire(void 0))}_(ue,"closeHandler");function X(Ee){ce.fire([Ee,void 0,void 0])}_(X,"readErrorHandler");function fe(Ee){ce.fire(Ee)}_(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),$.onClose(ue),$.onError(fe);function ee(){Z||Q.size===0||(Z=(0,e.default)().timer.setImmediate(()=>{Z=void 0,Re()}))}_(ee,"triggerMessageQueue");function Me(Ee){n.Message.isRequest(Ee)?Ne(Ee):n.Message.isNotification(Ee)?Oe(Ee):n.Message.isResponse(Ee)?je(Ee):Ze(Ee)}_(Me,"handleMessage");function Re(){if(Q.size===0)return;const Ee=Q.shift();try{const it=D==null?void 0:D.messageStrategy;A.is(it)?it.handleMessage(Ee,Me):Me(Ee)}finally{ee()}}_(Re,"processMessageQueue");const Ke=_(Ee=>{try{if(n.Message.isNotification(Ee)&&Ee.method===o.type.method){const it=Ee.params.id,pt=Ae(it),bt=Q.get(pt);if(n.Message.isRequest(bt)){const $r=D==null?void 0:D.connectionStrategy,kr=$r&&$r.cancelUndispatched?$r.cancelUndispatched(bt,Ce):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){Q.delete(pt),me.delete(it),kr.id=bt.id,gt(kr,Ee.method,Date.now()),$.write(kr).catch(()=>B.error("Sending response for canceled message failed."));return}}const nr=me.get(it);if(nr!==void 0){nr.cancel(),kt(Ee);return}else ie.add(it)}pe(Q,Ee)}finally{ee()}},"callback");function Ne(Ee){if(J())return;function it(Er,nn,Cr){const Yr={jsonrpc:H,id:Ee.id};Er instanceof n.ResponseError?Yr.error=Er.toJson():Yr.result=Er===void 0?null:Er,gt(Yr,nn,Cr),$.write(Yr).catch(()=>B.error("Sending response failed."))}_(it,"reply");function pt(Er,nn,Cr){const Yr={jsonrpc:H,id:Ee.id,error:Er.toJson()};gt(Yr,nn,Cr),$.write(Yr).catch(()=>B.error("Sending response failed."))}_(pt,"replyError");function bt(Er,nn,Cr){Er===void 0&&(Er=null);const Yr={jsonrpc:H,id:Ee.id,result:Er};gt(Yr,nn,Cr),$.write(Yr).catch(()=>B.error("Sending response failed."))}_(bt,"replySuccess"),Le(Ee);const nr=W.get(Ee.method);let $r,kr;nr&&($r=nr.type,kr=nr.handler);const jr=Date.now();if(kr||G){const Er=Ee.id??String(Date.now()),nn=T.is(we.receiver)?we.receiver.createCancellationTokenSource(Er):we.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&ie.has(Ee.id)&&nn.cancel(),Ee.id!==null&&me.set(Er,nn);try{let Cr;if(kr)if(Ee.params===void 0){if($r!==void 0&&$r.numberOfParams!==0){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${$r.numberOfParams} params but received none.`),Ee.method,jr);return}Cr=kr(nn.token)}else if(Array.isArray(Ee.params)){if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byName){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,jr);return}Cr=kr(...Ee.params,nn.token)}else{if($r!==void 0&&$r.parameterStructures===n.ParameterStructures.byPosition){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,jr);return}Cr=kr(Ee.params,nn.token)}else G&&(Cr=G(Ee.method,Ee.params,nn.token));const Yr=Cr;Cr?Yr.then?Yr.then(Tn=>{me.delete(Er),it(Tn,Ee.method,jr)},Tn=>{me.delete(Er),Tn instanceof n.ResponseError?pt(Tn,Ee.method,jr):Tn&&r.string(Tn.message)?pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Tn.message}`),Ee.method,jr):pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,jr)}):(me.delete(Er),it(Cr,Ee.method,jr)):(me.delete(Er),bt(Cr,Ee.method,jr))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Ee.method,jr):Cr&&r.string(Cr.message)?pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${Cr.message}`),Ee.method,jr):pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,jr)}}else pt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,jr)}_(Ne,"handleRequest");function je(Ee){if(!J())if(Ee.id===null)Ee.error?B.error(`Received response message without id: Error is: -${JSON.stringify(Ee.error,void 0,4)}`):B.error("Received response message without id. No further error information provided.");else{const it=Ee.id,pt=ne.get(it);if(Et(Ee,pt),pt!==void 0){ne.delete(it);try{if(Ee.error){const bt=Ee.error;pt.reject(new n.ResponseError(bt.code,bt.message,bt.data))}else if(Ee.result!==void 0)pt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(bt){bt.message?B.error(`Response handler '${pt.method}' failed with message: ${bt.message}`):B.error(`Response handler '${pt.method}' failed unexpectedly.`)}}}}_(je,"handleResponse");function Oe(Ee){if(J())return;let it,pt;if(Ee.method===o.type.method){const bt=Ee.params.id;ie.delete(bt),kt(Ee);return}else{const bt=q.get(Ee.method);bt&&(pt=bt.handler,it=bt.type)}if(pt||K)try{if(kt(Ee),pt)if(Ee.params===void 0)it!==void 0&&it.numberOfParams!==0&&it.parameterStructures!==n.ParameterStructures.byName&&B.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received none.`),pt();else if(Array.isArray(Ee.params)){const bt=Ee.params;Ee.method===u.type.method&&bt.length===2&&l.is(bt[0])?pt({token:bt[0],value:bt[1]}):(it!==void 0&&(it.parameterStructures===n.ParameterStructures.byName&&B.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),it.numberOfParams!==Ee.params.length&&B.error(`Notification ${Ee.method} defines ${it.numberOfParams} params but received ${bt.length} arguments`)),pt(...bt))}else it!==void 0&&it.parameterStructures===n.ParameterStructures.byPosition&&B.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),pt(Ee.params);else K&&K(Ee.method,Ee.params)}catch(bt){bt.message?B.error(`Notification handler '${Ee.method}' failed with message: ${bt.message}`):B.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else Te.fire(Ee)}_(Oe,"handleNotification");function Ze(Ee){if(!Ee){B.error("Received empty message.");return}B.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ee,null,4)}`);const it=Ee;if(r.string(it.id)||r.number(it.id)){const pt=it.id,bt=ne.get(pt);bt&&bt.reject(new Error("The received response has neither a result nor an error property."))}}_(Ze,"handleInvalidMessage");function Fe(Ee){if(Ee!=null)switch(te){case f.Verbose:return JSON.stringify(Ee,null,4);case f.Compact:return JSON.stringify(Ee);default:return}}_(Fe,"stringifyTrace");function st(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Ee.params&&(it=`Params: ${Fe(Ee.params)} +`,"\r"],(function(i){function a(u,h,d,f){return new Jme(u,h,d,f)}M(a,"create"),i.create=a;function s(u){let h=u;return!!(st.defined(h)&&st.string(h.uri)&&(st.undefined(h.languageId)||st.string(h.languageId))&&st.uinteger(h.lineCount)&&st.func(h.getText)&&st.func(h.positionAt)&&st.func(h.offsetAt))}M(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let U=g.range.start.line-m.range.start.line;return U===0?g.range.start.character-m.range.start.character:U}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],U=u.offsetAt(m.range.start),y=u.offsetAt(m.range.end);if(y<=p)d=d.substring(0,U)+m.newText+d.substring(y,d.length);else throw new Error("Overlapping edit");p=U}return d}M(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,U=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 hi.create(0,a);for(;oa?l=h:o=h+1}let u=o-1;return hi.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"}M(o,"undefined"),i.undefined=o;function l(y){return y===!0||y===!1}M(l,"boolean"),i.boolean=l;function u(y){return a.call(y)==="[object String]"}M(u,"string"),i.string=u;function h(y){return a.call(y)==="[object Number]"}M(h,"number"),i.number=h;function d(y,b,v){return a.call(y)==="[object Number]"&&b<=y&&y<=v}M(d,"numberRange"),i.numberRange=d;function f(y){return a.call(y)==="[object Number]"&&-2147483648<=y&&y<=2147483647}M(f,"integer"),i.integer=f;function p(y){return a.call(y)==="[object Number]"&&0<=y&&y<=2147483647}M(p,"uinteger"),i.uinteger=p;function g(y){return a.call(y)==="[object Function]"}M(g,"func"),i.func=g;function m(y){return y!==null&&typeof y=="object"}M(m,"objectLiteral"),i.objectLiteral=m;function U(y,b){return Array.isArray(y)&&y.every(b)}M(U,"typedArray"),i.typedArray=U})(st||(st={}))}}),B5=mn({"../../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}M(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}M(i,"install"),n.install=i})(r||(r={})),t.default=r}}),Dk=mn({"../../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}M(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}M(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}M(n,"number"),t.number=n;function i(l){return l instanceof Error}M(i,"error"),t.error=i;function a(l){return typeof l=="function"}M(a,"func"),t.func=a;function s(l){return Array.isArray(l)}M(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}M(o,"stringArray"),t.stringArray=o}}),y9=mn({"../../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=B5(),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:M(()=>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:M(()=>{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)}},M(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),K_=mn({"../../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=B5(),r=Dk(),n=y9(),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)}M(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)}},M(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}},M(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),r_e=mn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var N,L,I,P,O,D,B,F,z,$,V,H,G,K,W,oe,Z,J,ne,ie,me,te,Re,Pe,Ve;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=Dk(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(N=class extends Error{constructor(he,we,ge){super(we),this.code=e.number(he)?he:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,N.prototype)}toJson(){const he={code:this.code,message:this.message};return this.data!==void 0&&(he.data=this.data),he}},M(N,"ResponseError"),N);t.ResponseError=n;var i=(L=class{constructor(he){this.kind=he}static is(he){return he===L.auto||he===L.byName||he===L.byPosition}toString(){return this.kind}},M(L,"ParameterStructures"),L);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(he,we){this.method=he,this.numberOfParams=we}get parameterStructures(){return i.auto}},M(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=(P=class extends a{constructor(he){super(he,0)}},M(P,"RequestType0"),P);t.RequestType0=s;var o=(O=class extends a{constructor(he,we=i.auto){super(he,1),this._parameterStructures=we}get parameterStructures(){return this._parameterStructures}},M(O,"RequestType"),O);t.RequestType=o;var l=(D=class extends a{constructor(he,we=i.auto){super(he,1),this._parameterStructures=we}get parameterStructures(){return this._parameterStructures}},M(D,"RequestType1"),D);t.RequestType1=l;var u=(B=class extends a{constructor(he){super(he,2)}},M(B,"RequestType2"),B);t.RequestType2=u;var h=(F=class extends a{constructor(he){super(he,3)}},M(F,"RequestType3"),F);t.RequestType3=h;var d=(z=class extends a{constructor(he){super(he,4)}},M(z,"RequestType4"),z);t.RequestType4=d;var f=($=class extends a{constructor(he){super(he,5)}},M($,"RequestType5"),$);t.RequestType5=f;var p=(V=class extends a{constructor(he){super(he,6)}},M(V,"RequestType6"),V);t.RequestType6=p;var g=(H=class extends a{constructor(he){super(he,7)}},M(H,"RequestType7"),H);t.RequestType7=g;var m=(G=class extends a{constructor(he){super(he,8)}},M(G,"RequestType8"),G);t.RequestType8=m;var U=(K=class extends a{constructor(he){super(he,9)}},M(K,"RequestType9"),K);t.RequestType9=U;var y=(W=class extends a{constructor(he,we=i.auto){super(he,1),this._parameterStructures=we}get parameterStructures(){return this._parameterStructures}},M(W,"NotificationType"),W);t.NotificationType=y;var b=(oe=class extends a{constructor(he){super(he,0)}},M(oe,"NotificationType0"),oe);t.NotificationType0=b;var v=(Z=class extends a{constructor(he,we=i.auto){super(he,1),this._parameterStructures=we}get parameterStructures(){return this._parameterStructures}},M(Z,"NotificationType1"),Z);t.NotificationType1=v;var w=(J=class extends a{constructor(he){super(he,2)}},M(J,"NotificationType2"),J);t.NotificationType2=w;var T=(ne=class extends a{constructor(he){super(he,3)}},M(ne,"NotificationType3"),ne);t.NotificationType3=T;var k=(ie=class extends a{constructor(he){super(he,4)}},M(ie,"NotificationType4"),ie);t.NotificationType4=k;var C=(me=class extends a{constructor(he){super(he,5)}},M(me,"NotificationType5"),me);t.NotificationType5=C;var S=(te=class extends a{constructor(he){super(he,6)}},M(te,"NotificationType6"),te);t.NotificationType6=S;var E=(Re=class extends a{constructor(he){super(he,7)}},M(Re,"NotificationType7"),Re);t.NotificationType7=E;var A=(Pe=class extends a{constructor(he){super(he,8)}},M(Pe,"NotificationType8"),Pe);t.NotificationType8=A;var R=(Ve=class extends a{constructor(he){super(he,9)}},M(Ve,"NotificationType9"),Ve);t.NotificationType9=R;var _;(function(ce){function he(ze){const xe=ze;return xe&&e.string(xe.method)&&(e.string(xe.id)||e.number(xe.id))}M(he,"isRequest"),ce.isRequest=he;function we(ze){const xe=ze;return xe&&e.string(xe.method)&&ze.id===void 0}M(we,"isNotification"),ce.isNotification=we;function ge(ze){const xe=ze;return xe&&(xe.result!==void 0||!!xe.error)&&(e.string(xe.id)||e.number(xe.id)||xe.id===null)}M(ge,"isResponse"),ce.isResponse=ge})(_||(t.Message=_={}))}}),n_e=mn({"../../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:M(()=>{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:M(()=>{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:M(()=>{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)}},M(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))}},M(s,"LRUCache"),s);t.LRUCache=i}}),bnr=mn({"../../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}}M(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),vnr=mn({"../../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=K_(),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()}},M(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")}},M(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},M(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)}},M(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),i_e=mn({"../../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=B5(),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()}}},M(n,"Semaphore"),n);t.Semaphore=r}}),xnr=mn({"../../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=B5(),r=Dk(),n=y9(),i=i_e(),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)}M(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"}`)}},M(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const U=new Map;let y;const b=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,U.set(m.name,m)),p.contentDecoders!==void 0)for(const v of p.contentDecoders)U.set(v.name,v);if(p.contentTypeDecoder!==void 0&&(y=p.contentTypeDecoder,b.set(y.name,y)),p.contentTypeDecoders!==void 0)for(const v of p.contentTypeDecoders)b.set(v.name,v)}return y===void 0&&(y=(0,e.default)().applicationJson.decoder,b.set(y.name,y)),{charset:g,contentDecoder:m,contentDecoders:U,contentTypeDecoder:y,contentTypeDecoders:b}}M(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 U=parseInt(m);if(isNaN(U)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=U}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))}},M(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),wnr=mn({"../../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=B5(),r=Dk(),n=i_e(),i=y9(),a="Content-Length: ",s=`\r +`,o;(function(p){function g(m){let U=m;return U&&r.func(U.dispose)&&r.func(U.onClose)&&r.func(U.onError)&&r.func(U.write)}M(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,U){this.errorEmitter.fire([this.asError(g),m,U])}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"}`)}},M(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}}M(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(U=>this.fireError(U)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(U=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(U):U).then(U=>{const y=[];return y.push(a,U.byteLength.toString(),s),y.push(s),this.doWrite(g,y,U)},U=>{throw this.fireError(U),U}))}async doWrite(g,m,U){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(U)}catch(y){return this.handleError(y,g),Promise.reject(y)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},M(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),Tnr=mn({"../../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}},M(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),Cnr=mn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var N,L;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=B5(),r=Dk(),n=r_e(),i=n_e(),a=y9(),s=K_(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function P(O){return typeof O=="string"||typeof O=="number"}M(P,"is"),I.is=P})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(N=class{constructor(){}},M(N,"ProgressType"),N);t.ProgressType=h;var d;(function(I){function P(O){return r.func(O)}M(P,"is"),I.is=P})(d||(d={})),t.NullLogger=Object.freeze({error:M(()=>{},"error"),warn:M(()=>{},"warn"),info:M(()=>{},"info"),log:M(()=>{},"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 P(D){if(!r.string(D))return I.Off;switch(D=D.toLowerCase(),D){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}M(P,"fromString"),I.fromString=P;function O(D){switch(D){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}M(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function P(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}M(P,"fromString"),I.fromString=P})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var U;(function(I){I.type=new n.NotificationType("$/logTrace")})(U||(t.LogTraceNotification=U={}));var y;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));var b=(L=class extends Error{constructor(P,O){super(O),this.code=P,Object.setPrototypeOf(this,L.prototype)}},M(L,"ConnectionError"),L);t.ConnectionError=b;var v;(function(I){function P(O){const D=O;return D&&r.func(D.cancelUndispatched)}M(P,"is"),I.is=P})(v||(t.ConnectionStrategy=v={}));var w;(function(I){function P(O){const D=O;return D&&(D.kind===void 0||D.kind==="id")&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M(P,"is"),I.is=P})(w||(t.IdCancellationReceiverStrategy=w={}));var T;(function(I){function P(O){const D=O;return D&&D.kind==="request"&&r.func(D.createCancellationTokenSource)&&(D.dispose===void 0||r.func(D.dispose))}M(P,"is"),I.is=P})(T||(t.RequestCancellationReceiverStrategy=T={}));var k;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new s.CancellationTokenSource}});function P(O){return w.is(O)||T.is(O)}M(P,"is"),I.is=P})(k||(t.CancellationReceiverStrategy=k={}));var C;(function(I){I.Message=Object.freeze({sendCancellation(O,D){return O.sendNotification(o.type,{id:D})},cleanup(O){}});function P(O){const D=O;return D&&r.func(D.sendCancellation)&&r.func(D.cleanup)}M(P,"is"),I.is=P})(C||(t.CancellationSenderStrategy=C={}));var S;(function(I){I.Message=Object.freeze({receiver:k.Message,sender:C.Message});function P(O){const D=O;return D&&k.is(D.receiver)&&C.is(D.sender)}M(P,"is"),I.is=P})(S||(t.CancellationStrategy=S={}));var E;(function(I){function P(O){const D=O;return D&&r.func(D.handleMessage)}M(P,"is"),I.is=P})(E||(t.MessageStrategy=E={}));var A;(function(I){function P(O){const D=O;return D&&(S.is(D.cancellationStrategy)||v.is(D.connectionStrategy)||E.is(D.messageStrategy))}M(P,"is"),I.is=P})(A||(t.ConnectionOptions=A={}));var R;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(R||(R={}));function _(I,P,O,D){const B=O!==void 0?O:t.NullLogger;let F=0,z=0,$=0;const V="2.0";let H;const G=new Map;let K;const W=new Map,oe=new Map;let Z,J=new i.LinkedMap,ne=new Map,ie=new Set,me=new Map,te=f.Off,Re=g.Text,Pe,Ve=R.New;const ce=new a.Emitter,he=new a.Emitter,we=new a.Emitter,ge=new a.Emitter,ze=new a.Emitter,xe=D&&D.cancellationStrategy?D.cancellationStrategy:S.Message;function Ee(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}M(Ee,"createRequestQueueKey");function qe(Se){return Se===null?"res-unknown-"+(++$).toString():"res-"+Se.toString()}M(qe,"createResponseQueueKey");function le(){return"not-"+(++z).toString()}M(le,"createNotificationQueueKey");function pe(Se,it){n.Message.isRequest(it)?Se.set(Ee(it.id),it):n.Message.isResponse(it)?Se.set(qe(it.id),it):Se.set(le(),it)}M(pe,"addMessageToQueue");function Te(Se){}M(Te,"cancelUndispatched");function re(){return Ve===R.Listening}M(re,"isListening");function Y(){return Ve===R.Closed}M(Y,"isClosed");function Q(){return Ve===R.Disposed}M(Q,"isDisposed");function ue(){(Ve===R.New||Ve===R.Listening)&&(Ve=R.Closed,he.fire(void 0))}M(ue,"closeHandler");function X(Se){ce.fire([Se,void 0,void 0])}M(X,"readErrorHandler");function fe(Se){ce.fire(Se)}M(fe,"writeErrorHandler"),I.onClose(ue),I.onError(X),P.onClose(ue),P.onError(fe);function ee(){Z||J.size===0||(Z=(0,e.default)().timer.setImmediate(()=>{Z=void 0,Me()}))}M(ee,"triggerMessageQueue");function Ae(Se){n.Message.isRequest(Se)?Ne(Se):n.Message.isNotification(Se)?De(Se):n.Message.isResponse(Se)?je(Se):Ze(Se)}M(Ae,"handleMessage");function Me(){if(J.size===0)return;const Se=J.shift();try{const it=D==null?void 0:D.messageStrategy;E.is(it)?it.handleMessage(Se,Ae):Ae(Se)}finally{ee()}}M(Me,"processMessageQueue");const Ke=M(Se=>{try{if(n.Message.isNotification(Se)&&Se.method===o.type.method){const it=Se.params.id,pt=Ee(it),bt=J.get(pt);if(n.Message.isRequest(bt)){const Br=D==null?void 0:D.connectionStrategy,kr=Br&&Br.cancelUndispatched?Br.cancelUndispatched(bt,Te):void 0;if(kr&&(kr.error!==void 0||kr.result!==void 0)){J.delete(pt),me.delete(it),kr.id=bt.id,gt(kr,Se.method,Date.now()),P.write(kr).catch(()=>B.error("Sending response for canceled message failed."));return}}const ir=me.get(it);if(ir!==void 0){ir.cancel(),kt(Se);return}else ie.add(it)}pe(J,Se)}finally{ee()}},"callback");function Ne(Se){if(Q())return;function it(Er,an,Cr){const Yr={jsonrpc:V,id:Se.id};Er instanceof n.ResponseError?Yr.error=Er.toJson():Yr.result=Er===void 0?null:Er,gt(Yr,an,Cr),P.write(Yr).catch(()=>B.error("Sending response failed."))}M(it,"reply");function pt(Er,an,Cr){const Yr={jsonrpc:V,id:Se.id,error:Er.toJson()};gt(Yr,an,Cr),P.write(Yr).catch(()=>B.error("Sending response failed."))}M(pt,"replyError");function bt(Er,an,Cr){Er===void 0&&(Er=null);const Yr={jsonrpc:V,id:Se.id,result:Er};gt(Yr,an,Cr),P.write(Yr).catch(()=>B.error("Sending response failed."))}M(bt,"replySuccess"),Le(Se);const ir=G.get(Se.method);let Br,kr;ir&&(Br=ir.type,kr=ir.handler);const jr=Date.now();if(kr||H){const Er=Se.id??String(Date.now()),an=w.is(xe.receiver)?xe.receiver.createCancellationTokenSource(Er):xe.receiver.createCancellationTokenSource(Se);Se.id!==null&&ie.has(Se.id)&&an.cancel(),Se.id!==null&&me.set(Er,an);try{let Cr;if(kr)if(Se.params===void 0){if(Br!==void 0&&Br.numberOfParams!==0){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${Br.numberOfParams} params but received none.`),Se.method,jr);return}Cr=kr(an.token)}else if(Array.isArray(Se.params)){if(Br!==void 0&&Br.parameterStructures===n.ParameterStructures.byName){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,jr);return}Cr=kr(...Se.params,an.token)}else{if(Br!==void 0&&Br.parameterStructures===n.ParameterStructures.byPosition){pt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,jr);return}Cr=kr(Se.params,an.token)}else H&&(Cr=H(Se.method,Se.params,an.token));const Yr=Cr;Cr?Yr.then?Yr.then(Cn=>{me.delete(Er),it(Cn,Se.method,jr)},Cn=>{me.delete(Er),Cn instanceof n.ResponseError?pt(Cn,Se.method,jr):Cn&&r.string(Cn.message)?pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Cn.message}`),Se.method,jr):pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,jr)}):(me.delete(Er),it(Cr,Se.method,jr)):(me.delete(Er),bt(Cr,Se.method,jr))}catch(Cr){me.delete(Er),Cr instanceof n.ResponseError?it(Cr,Se.method,jr):Cr&&r.string(Cr.message)?pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Cr.message}`),Se.method,jr):pt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,jr)}}else pt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,jr)}M(Ne,"handleRequest");function je(Se){if(!Q())if(Se.id===null)Se.error?B.error(`Received response message without id: Error is: +${JSON.stringify(Se.error,void 0,4)}`):B.error("Received response message without id. No further error information provided.");else{const it=Se.id,pt=ne.get(it);if(Et(Se,pt),pt!==void 0){ne.delete(it);try{if(Se.error){const bt=Se.error;pt.reject(new n.ResponseError(bt.code,bt.message,bt.data))}else if(Se.result!==void 0)pt.resolve(Se.result);else throw new Error("Should never happen.")}catch(bt){bt.message?B.error(`Response handler '${pt.method}' failed with message: ${bt.message}`):B.error(`Response handler '${pt.method}' failed unexpectedly.`)}}}}M(je,"handleResponse");function De(Se){if(Q())return;let it,pt;if(Se.method===o.type.method){const bt=Se.params.id;ie.delete(bt),kt(Se);return}else{const bt=W.get(Se.method);bt&&(pt=bt.handler,it=bt.type)}if(pt||K)try{if(kt(Se),pt)if(Se.params===void 0)it!==void 0&&it.numberOfParams!==0&&it.parameterStructures!==n.ParameterStructures.byName&&B.error(`Notification ${Se.method} defines ${it.numberOfParams} params but received none.`),pt();else if(Array.isArray(Se.params)){const bt=Se.params;Se.method===u.type.method&&bt.length===2&&l.is(bt[0])?pt({token:bt[0],value:bt[1]}):(it!==void 0&&(it.parameterStructures===n.ParameterStructures.byName&&B.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),it.numberOfParams!==Se.params.length&&B.error(`Notification ${Se.method} defines ${it.numberOfParams} params but received ${bt.length} arguments`)),pt(...bt))}else it!==void 0&&it.parameterStructures===n.ParameterStructures.byPosition&&B.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),pt(Se.params);else K&&K(Se.method,Se.params)}catch(bt){bt.message?B.error(`Notification handler '${Se.method}' failed with message: ${bt.message}`):B.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else we.fire(Se)}M(De,"handleNotification");function Ze(Se){if(!Se){B.error("Received empty message.");return}B.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(Se,null,4)}`);const it=Se;if(r.string(it.id)||r.number(it.id)){const pt=it.id,bt=ne.get(pt);bt&&bt.reject(new Error("The received response has neither a result nor an error property."))}}M(Ze,"handleInvalidMessage");function Fe(Se){if(Se!=null)switch(te){case f.Verbose:return JSON.stringify(Se,null,4);case f.Compact:return JSON.stringify(Se);default:return}}M(Fe,"stringifyTrace");function at(Se){if(!(te===f.Off||!Pe))if(Re===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Se.params&&(it=`Params: ${Fe(Se.params)} -`),$e.log(`Sending request '${Ee.method} - (${Ee.id})'.`,it)}else ot("send-request",Ee)}_(st,"traceSendingRequest");function Pe(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&(Ee.params?it=`Params: ${Fe(Ee.params)} +`),Pe.log(`Sending request '${Se.method} - (${Se.id})'.`,it)}else ot("send-request",Se)}M(at,"traceSendingRequest");function _e(Se){if(!(te===f.Off||!Pe))if(Re===g.Text){let it;(te===f.Verbose||te===f.Compact)&&(Se.params?it=`Params: ${Fe(Se.params)} `:it=`No parameters provided. -`),$e.log(`Sending notification '${Ee.method}'.`,it)}else ot("send-notification",Ee)}_(Pe,"traceSendingNotification");function gt(Ee,it,pt){if(!(te===f.Off||!$e))if(_e===g.Text){let bt;(te===f.Verbose||te===f.Compact)&&(Ee.error&&Ee.error.data?bt=`Error data: ${Fe(Ee.error.data)} +`),Pe.log(`Sending notification '${Se.method}'.`,it)}else ot("send-notification",Se)}M(_e,"traceSendingNotification");function gt(Se,it,pt){if(!(te===f.Off||!Pe))if(Re===g.Text){let bt;(te===f.Verbose||te===f.Compact)&&(Se.error&&Se.error.data?bt=`Error data: ${Fe(Se.error.data)} -`:Ee.result?bt=`Result: ${Fe(Ee.result)} +`:Se.result?bt=`Result: ${Fe(Se.result)} -`:Ee.error===void 0&&(bt=`No result returned. +`:Se.error===void 0&&(bt=`No result returned. -`)),$e.log(`Sending response '${it} - (${Ee.id})'. Processing request took ${Date.now()-pt}ms`,bt)}else ot("send-response",Ee)}_(gt,"traceSendingResponse");function Le(Ee){if(!(te===f.Off||!$e))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Ee.params&&(it=`Params: ${Fe(Ee.params)} +`)),Pe.log(`Sending response '${it} - (${Se.id})'. Processing request took ${Date.now()-pt}ms`,bt)}else ot("send-response",Se)}M(gt,"traceSendingResponse");function Le(Se){if(!(te===f.Off||!Pe))if(Re===g.Text){let it;(te===f.Verbose||te===f.Compact)&&Se.params&&(it=`Params: ${Fe(Se.params)} -`),$e.log(`Received request '${Ee.method} - (${Ee.id})'.`,it)}else ot("receive-request",Ee)}_(Le,"traceReceivedRequest");function kt(Ee){if(!(te===f.Off||!$e||Ee.method===y.type.method))if(_e===g.Text){let it;(te===f.Verbose||te===f.Compact)&&(Ee.params?it=`Params: ${Fe(Ee.params)} +`),Pe.log(`Received request '${Se.method} - (${Se.id})'.`,it)}else ot("receive-request",Se)}M(Le,"traceReceivedRequest");function kt(Se){if(!(te===f.Off||!Pe||Se.method===U.type.method))if(Re===g.Text){let it;(te===f.Verbose||te===f.Compact)&&(Se.params?it=`Params: ${Fe(Se.params)} `:it=`No parameters provided. -`),$e.log(`Received notification '${Ee.method}'.`,it)}else ot("receive-notification",Ee)}_(kt,"traceReceivedNotification");function Et(Ee,it){if(!(te===f.Off||!$e))if(_e===g.Text){let pt;if((te===f.Verbose||te===f.Compact)&&(Ee.error&&Ee.error.data?pt=`Error data: ${Fe(Ee.error.data)} +`),Pe.log(`Received notification '${Se.method}'.`,it)}else ot("receive-notification",Se)}M(kt,"traceReceivedNotification");function Et(Se,it){if(!(te===f.Off||!Pe))if(Re===g.Text){let pt;if((te===f.Verbose||te===f.Compact)&&(Se.error&&Se.error.data?pt=`Error data: ${Fe(Se.error.data)} -`:Ee.result?pt=`Result: ${Fe(Ee.result)} +`:Se.result?pt=`Result: ${Fe(Se.result)} -`:Ee.error===void 0&&(pt=`No result returned. +`:Se.error===void 0&&(pt=`No result returned. -`)),it){const bt=Ee.error?` Request failed: ${Ee.error.message} (${Ee.error.code}).`:"";$e.log(`Received response '${it.method} - (${Ee.id})' in ${Date.now()-it.timerStart}ms.${bt}`,pt)}else $e.log(`Received response ${Ee.id} without active response promise.`,pt)}else ot("receive-response",Ee)}_(Et,"traceReceivedResponse");function ot(Ee,it){if(!$e||te===f.Off)return;const pt={isLSPMessage:!0,type:Ee,message:it,timestamp:Date.now()};$e.log(pt)}_(ot,"logLSPMessage");function Ht(){if(Y())throw new b(v.Closed,"Connection is closed.");if(J())throw new b(v.Disposed,"Connection is disposed.")}_(Ht,"throwIfClosedOrDisposed");function _t(){if(re())throw new b(v.AlreadyListening,"Connection is already listening")}_(_t,"throwIfListening");function dt(){if(!re())throw new Error("Call listen() first.")}_(dt,"throwIfNotListening");function xe(Ee){return Ee===void 0?null:Ee}_(xe,"undefinedToNull");function Lt(Ee){if(Ee!==null)return Ee}_(Lt,"nullToUndefined");function wt(Ee){return Ee!=null&&!Array.isArray(Ee)&&typeof Ee=="object"}_(wt,"isNamedParam");function mt(Ee,it){switch(Ee){case n.ParameterStructures.auto:return wt(it)?Lt(it):[xe(it)];case n.ParameterStructures.byName:if(!wt(it))throw new Error("Received parameters by name but param is not an object literal.");return Lt(it);case n.ParameterStructures.byPosition:return[xe(it)];default:throw new Error(`Unknown parameter structure ${Ee.toString()}`)}}_(mt,"computeSingleParam");function Mt(Ee,it){let pt;const bt=Ee.numberOfParams;switch(bt){case 0:pt=void 0;break;case 1:pt=mt(Ee.parameterStructures,it[0]);break;default:pt=[];for(let nr=0;nr{Ht();let pt,bt;if(r.string(Ee)){pt=Ee;const $r=it[0];let kr=0,jr=n.ParameterStructures.auto;n.ParameterStructures.is($r)&&(kr=1,jr=$r);let Er=it.length;const nn=Er-kr;switch(nn){case 0:bt=void 0;break;case 1:bt=mt(jr,it[kr]);break;default:if(jr===n.ParameterStructures.byName)throw new Error(`Received ${nn} parameters for 'by Name' notification parameter structure.`);bt=it.slice(kr,Er).map(Cr=>xe(Cr));break}}else{const $r=it;pt=Ee.method,bt=Mt(Ee,$r)}const nr={jsonrpc:H,method:pt,params:bt};return Pe(nr),$.write(nr).catch($r=>{throw B.error("Sending notification failed."),$r})},"sendNotification"),onNotification:_((Ee,it)=>{Ht();let pt;return r.func(Ee)?K=Ee:it&&(r.string(Ee)?(pt=Ee,q.set(Ee,{type:void 0,handler:it})):(pt=Ee.method,q.set(Ee.method,{type:Ee,handler:it}))),{dispose:_(()=>{pt!==void 0?q.delete(pt):K=void 0},"dispose")}},"onNotification"),onProgress:_((Ee,it,pt)=>{if(oe.has(it))throw new Error(`Progress handler for token ${it} already registered`);return oe.set(it,pt),{dispose:_(()=>{oe.delete(it)},"dispose")}},"onProgress"),sendProgress:_((Ee,it,pt)=>Or.sendNotification(u.type,{token:it,value:pt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:_((Ee,...it)=>{Ht(),dt();let pt,bt,nr;if(r.string(Ee)){pt=Ee;const Er=it[0],nn=it[it.length-1];let Cr=0,Yr=n.ParameterStructures.auto;n.ParameterStructures.is(Er)&&(Cr=1,Yr=Er);let Tn=it.length;a.CancellationToken.is(nn)&&(Tn=Tn-1,nr=nn);const ut=Tn-Cr;switch(ut){case 0:bt=void 0;break;case 1:bt=mt(Yr,it[Cr]);break;default:if(Yr===n.ParameterStructures.byName)throw new Error(`Received ${ut} parameters for 'by Name' request parameter structure.`);bt=it.slice(Cr,Tn).map(yt=>xe(yt));break}}else{const Er=it;pt=Ee.method,bt=Mt(Ee,Er);const nn=Ee.numberOfParams;nr=a.CancellationToken.is(Er[nn])?Er[nn]:void 0}const $r=z++;let kr;nr&&(kr=nr.onCancellationRequested(()=>{const Er=we.sender.sendCancellation(Or,$r);return Er===void 0?(B.log(`Received no promise from cancellation strategy when cancelling id ${$r}`),Promise.resolve()):Er.catch(()=>{B.log(`Sending cancellation messages for id ${$r} failed`)})}));const jr={jsonrpc:H,id:$r,method:pt,params:bt};return st(jr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(jr),new Promise(async(Er,nn)=>{const Cr=_(ut=>{Er(ut),we.sender.cleanup($r),kr==null||kr.dispose()},"resolveWithCleanup"),Yr=_(ut=>{nn(ut),we.sender.cleanup($r),kr==null||kr.dispose()},"rejectWithCleanup"),Tn={method:pt,timerStart:Date.now(),resolve:Cr,reject:Yr};try{await $.write(jr),ne.set($r,Tn)}catch(ut){throw B.error("Sending request failed."),Tn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},"sendRequest"),onRequest:_((Ee,it)=>{Ht();let pt=null;return d.is(Ee)?(pt=void 0,G=Ee):r.string(Ee)?(pt=null,it!==void 0&&(pt=Ee,W.set(Ee,{handler:it,type:void 0}))):it!==void 0&&(pt=Ee.method,W.set(Ee.method,{type:Ee,handler:it})),{dispose:_(()=>{pt!==null&&(pt!==void 0?W.delete(pt):G=void 0)},"dispose")}},"onRequest"),hasPendingResponse:_(()=>ne.size>0,"hasPendingResponse"),trace:_(async(Ee,it,pt)=>{let bt=!1,nr=g.Text;pt!==void 0&&(r.boolean(pt)?bt=pt:(bt=pt.sendNotification||!1,nr=pt.traceFormat||g.Text)),te=Ee,_e=nr,te===f.Off?$e=void 0:$e=it,bt&&!Y()&&!J()&&await Or.sendNotification(m.type,{value:f.toString(Ee)})},"trace"),onError:ce.event,onClose:he.event,onUnhandledNotification:Te.event,onDispose:ze.event,end:_(()=>{$.end()},"end"),dispose:_(()=>{if(J())return;Ve=R.Disposed,ze.fire(void 0);const Ee=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const it of ne.values())it.reject(Ee);ne=new Map,me=new Map,ie=new Set,Q=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:_(()=>{Ht(),_t(),Ve=R.Listening,I.listen(Ke)},"listen"),inspect:_(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Or.onNotification(y.type,Ee=>{if(te===f.Off||!$e)return;const it=te===f.Verbose||te===f.Compact;$e.log(Ee.message,it?Ee.verbose:void 0)}),Or.onNotification(u.type,Ee=>{const it=oe.get(Ee.token);it?it(Ee.value):ge.fire(Ee)}),Or}_(P,"createMessageConnection"),t.createMessageConnection=P}}),sX=pn({"../../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=GDe();Object.defineProperty(t,"Message",{enumerable:!0,get:_(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:_(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:_(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:_(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:_(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:_(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:_(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:_(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:_(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:_(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:_(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:_(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:_(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:_(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:_(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:_(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:_(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:_(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:_(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:_(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:_(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:_(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:_(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:_(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:_(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:_(function(){return e.ParameterStructures},"get")});var r=WDe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:_(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:_(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:_(function(){return r.Touch},"get")});var n=Krr();Object.defineProperty(t,"Disposable",{enumerable:!0,get:_(function(){return n.Disposable},"get")});var i=gC();Object.defineProperty(t,"Event",{enumerable:!0,get:_(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:_(function(){return i.Emitter},"get")});var s=jP();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:_(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:_(function(){return s.CancellationToken},"get")});var a=Zrr();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:_(function(){return a.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:_(function(){return a.SharedArrayReceiverStrategy},"get")});var o=Qrr();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:_(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:_(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:_(function(){return o.ReadableStreamMessageReader},"get")});var l=Jrr();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:_(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:_(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:_(function(){return l.WriteableStreamMessageWriter},"get")});var u=enr();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:_(function(){return u.AbstractMessageBuffer},"get")});var h=tnr();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:_(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:_(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:_(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:_(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:_(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:_(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:_(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:_(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:_(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:_(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:_(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:_(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:_(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:_(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:_(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:_(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:_(function(){return h.MessageStrategy},"get")});var d=Dv();t.RAL=d.default}}),rnr=pn({"../../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=sX(),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)}},_(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)}},_(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()}},_(h,"WritableStreamWrapper"),h),s=new TextEncoder,a=Object.freeze({messageBuffer:Object.freeze({create:_(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:_((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(s.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:_((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:_(d=>new n(d),"asReadableStream"),asWritableStream:_(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:_(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:_(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:_(()=>clearInterval(g),"dispose")}}})});function o(){return a}_(o,"RIL"),(function(d){function f(){e.RAL.install(a)}_(f,"install"),d.install=f})(o||(o={})),t.default=o}}),mC=pn({"../../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:_(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=rnr();n.default.install();var i=sX();r(sX(),t);var s=(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)}},_(l,"BrowserMessageReader"),l);t.BrowserMessageReader=s;var a=(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(){}},_(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=a;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)}_(o,"createMessageConnection"),t.createMessageConnection=o}}),G1e=pn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=mC()}}),Rs=pn({"../../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=mC(),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}},_(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},_(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var s=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},_(h,"ProtocolRequestType"),h);t.ProtocolRequestType=s;var a=(d=class extends e.NotificationType0{constructor(g){super(g)}},_(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=a;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},_(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),Dre=pn({"../../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}_(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}_(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}_(n,"number"),t.number=n;function i(h){return h instanceof Error}_(i,"error"),t.error=i;function s(h){return typeof h=="function"}_(s,"func"),t.func=s;function a(h){return Array.isArray(h)}_(a,"array"),t.array=a;function o(h){return a(h)&&h.every(d=>r(d))}_(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}_(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}_(u,"objectLiteral"),t.objectLiteral=u}}),nnr=pn({"../../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=Rs(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),inr=pn({"../../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=Rs(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),snr=pn({"../../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=Rs(),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={}))}}),anr=pn({"../../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=Rs(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),onr=pn({"../../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=Rs(),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={}))}}),lnr=pn({"../../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=Rs(),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={}))}}),cnr=pn({"../../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=Rs(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),unr=pn({"../../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=Rs(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),hnr=pn({"../../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=mC(),r=Rs(),n;(function(a){a.type=new e.ProgressType;function o(l){return l===a.type}_(o,"is"),a.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(a){a.method="window/workDoneProgress/create",a.messageDirection=r.MessageDirection.serverToClient,a.type=new r.ProtocolRequestType(a.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var s;(function(a){a.method="window/workDoneProgress/cancel",a.messageDirection=r.MessageDirection.clientToServer,a.type=new r.ProtocolNotificationType(a.method)})(s||(t.WorkDoneProgressCancelNotification=s={}))}}),dnr=pn({"../../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=Rs(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),fnr=pn({"../../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=Rs(),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 s;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensDeltaRequest=s={}));var a;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensRangeRequest=a={}));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={}))}}),pnr=pn({"../../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=Rs(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),gnr=pn({"../../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=Rs(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),mnr=pn({"../../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=Rs(),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 s;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(s||(t.WillRenameFilesRequest=s={}));var a;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(a||(t.DidRenameFilesNotification=a={}));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={}))}}),ynr=pn({"../../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=Rs(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(t.MonikerKind=n={}));var i;(function(s){s.method="textDocument/moniker",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.MonikerRequest=i={}))}}),vnr=pn({"../../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=Rs(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),bnr=pn({"../../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=Rs(),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={}))}}),xnr=pn({"../../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=Rs(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(r||(t.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolRequestType(s.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType0(s.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),wnr=pn({"../../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=mC(),r=Dre(),n=Rs(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}_(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var s;(function(u){u.Full="full",u.Unchanged="unchanged"})(s||(t.DocumentDiagnosticReportKind=s={}));var a;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(a||(t.DocumentDiagnosticRequest=a={}));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={}))}}),Tnr=pn({"../../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=(_7(),Ore(UP)),r=Dre(),n=Rs(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}_(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var s;(function(g){function m(b,x){const T={executionOrder:b};return(x===!0||x===!1)&&(T.success=x),T}_(m,"create"),g.create=m;function y(b){const x=b;return r.objectLiteral(x)&&e.uinteger.is(x.executionOrder)&&(x.success===void 0||r.boolean(x.success))}_(y,"is"),g.is=y;function v(b,x){return b===x?!0:b==null||x===null||x===void 0?!1:b.executionOrder===x.executionOrder&&b.success===x.success}_(v,"equals"),g.equals=v})(s||(t.ExecutionSummary=s={}));var a;(function(g){function m(x,T){return{kind:x,document:T}}_(m,"create"),g.create=m;function y(x){const T=x;return r.objectLiteral(T)&&i.is(T.kind)&&e.DocumentUri.is(T.document)&&(T.metadata===void 0||r.objectLiteral(T.metadata))}_(y,"is"),g.is=y;function v(x,T){const C=new Set;return x.document!==T.document&&C.add("document"),x.kind!==T.kind&&C.add("kind"),x.executionSummary!==T.executionSummary&&C.add("executionSummary"),(x.metadata!==void 0||T.metadata!==void 0)&&!b(x.metadata,T.metadata)&&C.add("metadata"),(x.executionSummary!==void 0||T.executionSummary!==void 0)&&!s.equals(x.executionSummary,T.executionSummary)&&C.add("executionSummary"),C}_(v,"diff"),g.diff=v;function b(x,T){if(x===T)return!0;if(x==null||T===null||T===void 0||typeof x!=typeof T||typeof x!="object")return!1;const C=Array.isArray(x),S=Array.isArray(T);if(C!==S)return!1;if(C&&S){if(x.length!==T.length)return!1;for(let k=0;k0}_(Lt,"hasId"),xe.hasId=Lt})(D||(t.StaticRegistrationOptions=D={}));var B;(function(xe){function Lt(wt){const mt=wt;return mt&&(mt.documentSelector===null||P.is(mt.documentSelector))}_(Lt,"is"),xe.is=Lt})(B||(t.TextDocumentRegistrationOptions=B={}));var z;(function(xe){function Lt(mt){const Mt=mt;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}_(Lt,"is"),xe.is=Lt;function wt(mt){const Mt=mt;return Mt&&n.boolean(Mt.workDoneProgress)}_(wt,"hasWorkDoneProgress"),xe.hasWorkDoneProgress=wt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(xe){xe.method="initialize",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(V||(t.InitializeRequest=V={}));var F;(function(xe){xe.unknownProtocolVersion=1})(F||(t.InitializeErrorCodes=F={}));var H;(function(xe){xe.method="initialized",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(H||(t.InitializedNotification=H={}));var G;(function(xe){xe.method="shutdown",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType0(xe.method)})(G||(t.ShutdownRequest=G={}));var W;(function(xe){xe.method="exit",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType0(xe.method)})(W||(t.ExitNotification=W={}));var K;(function(xe){xe.method="workspace/didChangeConfiguration",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(K||(t.DidChangeConfigurationNotification=K={}));var q;(function(xe){xe.Error=1,xe.Warning=2,xe.Info=3,xe.Log=4,xe.Debug=5})(q||(t.MessageType=q={}));var oe;(function(xe){xe.method="window/showMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(oe||(t.ShowMessageNotification=oe={}));var Z;(function(xe){xe.method="window/showMessageRequest",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType(xe.method)})(Z||(t.ShowMessageRequest=Z={}));var Q;(function(xe){xe.method="window/logMessage",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(Q||(t.LogMessageNotification=Q={}));var ne;(function(xe){xe.method="telemetry/event",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(ne||(t.TelemetryEventNotification=ne={}));var ie;(function(xe){xe.None=0,xe.Full=1,xe.Incremental=2})(ie||(t.TextDocumentSyncKind=ie={}));var me;(function(xe){xe.method="textDocument/didOpen",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(xe){function Lt(mt){let Mt=mt;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}_(Lt,"isIncremental"),xe.isIncremental=Lt;function wt(mt){let Mt=mt;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}_(wt,"isFull"),xe.isFull=wt})(te||(t.TextDocumentContentChangeEvent=te={}));var _e;(function(xe){xe.method="textDocument/didChange",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(_e||(t.DidChangeTextDocumentNotification=_e={}));var $e;(function(xe){xe.method="textDocument/didClose",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})($e||(t.DidCloseTextDocumentNotification=$e={}));var Ve;(function(xe){xe.method="textDocument/didSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(Ve||(t.DidSaveTextDocumentNotification=Ve={}));var ce;(function(xe){xe.Manual=1,xe.AfterDelay=2,xe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var he;(function(xe){xe.method="textDocument/willSave",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(he||(t.WillSaveTextDocumentNotification=he={}));var Te;(function(xe){xe.method="textDocument/willSaveWaitUntil",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Te||(t.WillSaveTextDocumentWaitUntilRequest=Te={}));var ge;(function(xe){xe.method="workspace/didChangeWatchedFiles",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolNotificationType(xe.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var ze;(function(xe){xe.Created=1,xe.Changed=2,xe.Deleted=3})(ze||(t.FileChangeType=ze={}));var we;(function(xe){function Lt(wt){const mt=wt;return n.objectLiteral(mt)&&(r.URI.is(mt.baseUri)||r.WorkspaceFolder.is(mt.baseUri))&&n.string(mt.pattern)}_(Lt,"is"),xe.is=Lt})(we||(t.RelativePattern=we={}));var Ae;(function(xe){xe.Create=1,xe.Change=2,xe.Delete=4})(Ae||(t.WatchKind=Ae={}));var qe;(function(xe){xe.method="textDocument/publishDiagnostics",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolNotificationType(xe.method)})(qe||(t.PublishDiagnosticsNotification=qe={}));var le;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(xe){xe.method="textDocument/completion",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(pe||(t.CompletionRequest=pe={}));var Ce;(function(xe){xe.method="completionItem/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ce||(t.CompletionResolveRequest=Ce={}));var re;(function(xe){xe.method="textDocument/hover",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(re||(t.HoverRequest=re={}));var Y;(function(xe){xe.Invoked=1,xe.TriggerCharacter=2,xe.ContentChange=3})(Y||(t.SignatureHelpTriggerKind=Y={}));var J;(function(xe){xe.method="textDocument/signatureHelp",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(J||(t.SignatureHelpRequest=J={}));var ue;(function(xe){xe.method="textDocument/definition",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ue||(t.DefinitionRequest=ue={}));var X;(function(xe){xe.method="textDocument/references",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(X||(t.ReferencesRequest=X={}));var fe;(function(xe){xe.method="textDocument/documentHighlight",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(fe||(t.DocumentHighlightRequest=fe={}));var ee;(function(xe){xe.method="textDocument/documentSymbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ee||(t.DocumentSymbolRequest=ee={}));var Me;(function(xe){xe.method="textDocument/codeAction",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Me||(t.CodeActionRequest=Me={}));var Re;(function(xe){xe.method="codeAction/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Re||(t.CodeActionResolveRequest=Re={}));var Ke;(function(xe){xe.method="workspace/symbol",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ke||(t.WorkspaceSymbolRequest=Ke={}));var Ne;(function(xe){xe.method="workspaceSymbol/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var je;(function(xe){xe.method="textDocument/codeLens",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(je||(t.CodeLensRequest=je={}));var Oe;(function(xe){xe.method="codeLens/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Oe||(t.CodeLensResolveRequest=Oe={}));var Ze;(function(xe){xe.method="workspace/codeLens/refresh",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType0(xe.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var Fe;(function(xe){xe.method="textDocument/documentLink",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Fe||(t.DocumentLinkRequest=Fe={}));var st;(function(xe){xe.method="documentLink/resolve",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(st||(t.DocumentLinkResolveRequest=st={}));var Pe;(function(xe){xe.method="textDocument/formatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Pe||(t.DocumentFormattingRequest=Pe={}));var gt;(function(xe){xe.method="textDocument/rangeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(gt||(t.DocumentRangeFormattingRequest=gt={}));var Le;(function(xe){xe.method="textDocument/rangesFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Le||(t.DocumentRangesFormattingRequest=Le={}));var kt;(function(xe){xe.method="textDocument/onTypeFormatting",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(kt||(t.DocumentOnTypeFormattingRequest=kt={}));var Et;(function(xe){xe.Identifier=1})(Et||(t.PrepareSupportDefaultBehavior=Et={}));var ot;(function(xe){xe.method="textDocument/rename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(ot||(t.RenameRequest=ot={}));var Ht;(function(xe){xe.method="textDocument/prepareRename",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(Ht||(t.PrepareRenameRequest=Ht={}));var _t;(function(xe){xe.method="workspace/executeCommand",xe.messageDirection=e.MessageDirection.clientToServer,xe.type=new e.ProtocolRequestType(xe.method)})(_t||(t.ExecuteCommandRequest=_t={}));var dt;(function(xe){xe.method="workspace/applyEdit",xe.messageDirection=e.MessageDirection.serverToClient,xe.type=new e.ProtocolRequestType("workspace/applyEdit")})(dt||(t.ApplyWorkspaceEditRequest=dt={}))}}),Snr=pn({"../../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=mC();function r(n,i,s,a){return e.ConnectionStrategy.is(a)&&(a={connectionStrategy:a}),(0,e.createMessageConnection)(n,i,s,a)}_(r,"createProtocolConnection"),t.createProtocolConnection=r}}),Enr=pn({"../../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(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:_(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(mC(),t),r((_7(),Ore(UP)),t),r(Rs(),t),r(knr(),t);var n=Snr();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:_(function(){return n.createProtocolConnection},"get")});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),Anr=pn({"../../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(s,a,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(a,o);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:_(function(){return a[o]},"get")}),Object.defineProperty(s,l,u)}):(function(s,a,o,l){l===void 0&&(l=o),s[l]=a[o]})),r=t&&t.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=G1e();r(G1e(),t),r(Enr(),t);function i(s,a,o,l){return(0,n.createMessageConnection)(s,a,o,l)}_(i,"createProtocolConnection"),t.createProtocolConnection=i}}),UDe={};Dm(UDe,{AbstractAstReflection:()=>Bre,AbstractCstNode:()=>zie,AbstractLangiumParser:()=>Hie,AbstractParserErrorMessageProvider:()=>Nqe,AbstractThreadedAsyncParser:()=>J0r,AstUtils:()=>Fre,BiMap:()=>jN,Cancellation:()=>Vi,CompositeCstNodeImpl:()=>G$,ContextCache:()=>K$,CstNodeBuilder:()=>_qe,CstUtils:()=>Pre,DEFAULT_TOKENIZE_OPTIONS:()=>ase,DONE_RESULT:()=>Sl,DatatypeSymbol:()=>GN,DefaultAstNodeDescriptionProvider:()=>cUe,DefaultAstNodeLocator:()=>hUe,DefaultAsyncParser:()=>RUe,DefaultCommentProvider:()=>MUe,DefaultConfigurationProvider:()=>dUe,DefaultDocumentBuilder:()=>fUe,DefaultDocumentValidator:()=>lUe,DefaultHydrator:()=>LUe,DefaultIndexManager:()=>pUe,DefaultJsonSerializer:()=>iUe,DefaultLangiumDocumentFactory:()=>Xqe,DefaultLangiumDocuments:()=>Kqe,DefaultLangiumProfiler:()=>ipr,DefaultLexer:()=>ose,DefaultLexerErrorMessageProvider:()=>mUe,DefaultLinker:()=>Zqe,DefaultNameProvider:()=>Qqe,DefaultReferenceDescriptionProvider:()=>uUe,DefaultReferences:()=>Jqe,DefaultScopeComputation:()=>eUe,DefaultScopeProvider:()=>nUe,DefaultServiceRegistry:()=>sUe,DefaultTokenBuilder:()=>U$,DefaultValueConverter:()=>Xie,DefaultWorkspaceLock:()=>_Ue,DefaultWorkspaceManager:()=>gUe,Deferred:()=>Y0,Disposable:()=>Ly,DisposableCache:()=>X$,DocumentCache:()=>rUe,DocumentState:()=>_n,DocumentValidator:()=>Iu,EMPTY_SCOPE:()=>X0r,EMPTY_STREAM:()=>f3,EmptyFileSystem:()=>Fo,EmptyFileSystemProvider:()=>OUe,ErrorWithLocation:()=>r$,GrammarAST:()=>XDe,GrammarUtils:()=>gne,IndentationAwareLexer:()=>tpr,IndentationAwareTokenBuilder:()=>NUe,JSDocDocumentationProvider:()=>AUe,LangiumCompletionParser:()=>Oqe,LangiumParser:()=>Iqe,LangiumParserErrorMessageProvider:()=>Gie,LeafCstNodeImpl:()=>HN,LexingMode:()=>yy,MapScope:()=>Y0r,Module:()=>FX,MultiMap:()=>X0,MultiMapScope:()=>tUe,OperationCancelled:()=>Od,ParserWorker:()=>epr,ProfilingTask:()=>PUe,Reduction:()=>J6,RefResolving:()=>M1,RegExpUtils:()=>yne,RootCstNodeImpl:()=>Vie,SimpleCache:()=>tse,StreamImpl:()=>Nd,StreamScope:()=>DX,TextDocument:()=>qN,TreeStreamImpl:()=>p3,URI:()=>Jc,UriTrie:()=>Jie,UriUtils:()=>$l,VALIDATE_EACH_NODE:()=>oUe,ValidationCategory:()=>YN,ValidationRegistry:()=>aUe,ValueConverter:()=>Td,WorkspaceCache:()=>rse,assertCondition:()=>mne,assertUnreachable:()=>Pm,createCompletionParser:()=>Uie,createDefaultCoreModule:()=>uo,createDefaultSharedCoreModule:()=>ho,createGrammarConfig:()=>Dne,createLangiumParser:()=>jie,createParser:()=>W$,delayNextTick:()=>j$,diagnosticData:()=>my,eagerLoad:()=>pse,getDiagnosticRange:()=>ise,indentationBuilderDefaultOptions:()=>VX,inject:()=>jn,interruptAndCheck:()=>Xa,isAstNode:()=>la,isAstNodeDescription:()=>$re,isAstNodeWithComment:()=>nse,isCompositeCstNode:()=>z0,isIMultiModeLexerDefinition:()=>J$,isJSDoc:()=>cse,isLeafCstNode:()=>Pv,isLinkingError:()=>z1,isMultiReference:()=>Vd,isNamed:()=>ese,isOperationCancelled:()=>t2,isReference:()=>Pl,isRootCstNode:()=>YP,isTokenTypeArray:()=>Q$,isTokenTypeDictionary:()=>XN,loadGrammarFromJson:()=>fo,parseJSDoc:()=>lse,prepareLangiumParser:()=>Yie,setInterruptionPeriod:()=>Kie,startCancelableOperation:()=>Y$,stream:()=>Ti,toDiagnosticData:()=>sse,toDiagnosticSeverity:()=>vE});var Pre={};Dm(Pre,{DefaultNameRegexp:()=>une,RangeComparison:()=>Ed,compareRange:()=>lne,findCommentNode:()=>hne,findDeclarationNodeAtOffset:()=>pPe,findLeafNodeAtOffset:()=>t$,findLeafNodeBeforeOffset:()=>dne,flattenCst:()=>fPe,getDatatypeNode:()=>dPe,getInteriorNodes:()=>yPe,getNextNode:()=>gPe,getPreviousNode:()=>pne,getStartlineNode:()=>mPe,inRange:()=>cne,isChildNode:()=>one,isCommentNode:()=>EN,streamCst:()=>v3,toDocumentSegment:()=>b3,tokenToRange:()=>eA});function la(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}_(la,"isAstNode");function Pl(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}_(Pl,"isReference");function Vd(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}_(Vd,"isMultiReference");function $re(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}_($re,"isAstNodeDescription");function z1(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}_(z1,"isLinkingError");var Ux,Bre=(Ux=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 la(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 s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const s of n)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}},_(Ux,"AbstractAstReflection"),Ux);function z0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}_(z0,"isCompositeCstNode");function Pv(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}_(Pv,"isLeafCstNode");function YP(t){return z0(t)&&typeof t.fullText=="string"}_(YP,"isRootCstNode");var dc,Nd=(dc=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:_(()=>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 dc(()=>({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 Sl})}join(e=","){const r=this.iterator();let n="",i,s=!1;do i=r.next(),i.done||(s&&(n+=e),n+=jDe(i.value)),s=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,s=n.next();for(;!s.done;){if(i>=r&&s.value===e)return i;s=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 dc(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Sl:{done:!1,value:e(i)}})}filter(e){return new dc(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Sl})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,s=n.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=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 s=this.recursiveReduce(e,r,n);return s===void 0?i.value:r(s,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 dc(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:i}=this.nextFn(r.this);if(!n){const s=e(i);if(Q6(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return Sl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new dc(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const a=n.iterator.next();if(a.done)n.iterator=void 0;else return a}const{done:i,value:s}=r.nextFn(n.this);if(!i)if(Q6(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return Sl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new dc(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Sl:this.nextFn(r.state)))}distinct(e){return new dc(()=>({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 Sl})}exclude(e,r){const n=new Set;for(const i of e){const s=r?r(i):i;n.add(s)}return this.filter(i=>{const s=r?r(i):i;return!n.has(s)})}},_(dc,"StreamImpl"),dc);function jDe(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}_(jDe,"toString");function Q6(t){return!!t&&typeof t[Symbol.iterator]=="function"}_(Q6,"isIterable");var f3=new Nd(()=>{},()=>Sl),Sl=Object.freeze({done:!0,value:void 0});function Ti(...t){if(t.length===1){const e=t[0];if(e instanceof Nd)return e;if(Q6(e))return new Nd(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Nd(()=>({index:0}),r=>r.index1?new Nd(()=>({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 a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return Sl})}iterator(){const e={state:this.startFn(),next:_(()=>this.nextFn(e.state),"next"),prune:_(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},_(jx,"TreeStreamImpl"),jx),J6;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}_(e,"sum"),t.sum=e;function r(s){return s.reduce((a,o)=>a*o,0)}_(r,"product"),t.product=r;function n(s){return s.reduce((a,o)=>Math.min(a,o))}_(n,"min"),t.min=n;function i(s){return s.reduce((a,o)=>Math.max(a,o))}_(i,"max"),t.max=i})(J6||(J6={}));var Fre={};Dm(Fre,{assignMandatoryProperties:()=>zre,copyAstNode:()=>dN,findRootNode:()=>bx,getContainerOfType:()=>$v,getDocument:()=>Dh,getReferenceNodes:()=>uN,hasContainerOfType:()=>YDe,linkContentToContainer:()=>g3,streamAllContents:()=>mp,streamAst:()=>Ph,streamContents:()=>I7,streamReferences:()=>m3});function g3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,s)=>{la(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=s,e.deep&&g3(i,e))}):la(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&g3(n,e)))}_(g3,"linkContentToContainer");function $v(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}_($v,"getContainerOfType");function YDe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}_(YDe,"hasContainerOfType");function Dh(t){const r=bx(t).$document;if(!r)throw new Error("AST node has no document.");return r}_(Dh,"getDocument");function bx(t){for(;t.$container;)t=t.$container;return t}_(bx,"findRootNode");function uN(t){return Pl(t)?t.ref?[t.ref]:[]:Vd(t)?t.items.map(e=>e.ref):[]}_(uN,"getReferenceNodes");function I7(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Nd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexI7(r,e))}_(mp,"streamAllContents");function Ph(t,e){if(t){if(e!=null&&e.range&&!hN(t,e.range))return new p3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new p3(t,r=>I7(r,e),{includeRoot:!0})}_(Ph,"streamAst");function hN(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?cne(r,e):!1}_(hN,"isAstNodeInRange");function m3(t){return new Nd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexoc,AbstractParserRule:()=>iE,AbstractRule:()=>Fb,AbstractType:()=>$c,Action:()=>Xp,Alternatives:()=>sE,ArrayLiteral:()=>fN,ArrayType:()=>pN,Assignment:()=>Kp,BooleanLiteral:()=>gN,CharacterRange:()=>Zp,Condition:()=>Qp,Conjunction:()=>aE,CrossReference:()=>Jp,Disjunction:()=>oE,EndOfFile:()=>mN,Grammar:()=>Wf,GrammarImport:()=>yN,Group:()=>V1,InferredType:()=>vN,InfixRule:()=>md,InfixRuleOperatorList:()=>lE,InfixRuleOperators:()=>bN,Interface:()=>zb,Keyword:()=>Vb,LangiumGrammarAstReflection:()=>ane,LangiumGrammarTerminals:()=>Mnr,NamedArgument:()=>Hb,NegatedToken:()=>H1,Negation:()=>xN,NumberLiteral:()=>wN,Parameter:()=>Gb,ParameterReference:()=>TN,ParserRule:()=>sh,ReferenceType:()=>cE,RegexToken:()=>G1,ReturnType:()=>CN,RuleCall:()=>W1,SimpleType:()=>Wb,StringLiteral:()=>kN,TerminalAlternatives:()=>q1,TerminalElement:()=>lc,TerminalGroup:()=>U1,TerminalRule:()=>qf,TerminalRuleCall:()=>j1,Type:()=>uE,TypeAttribute:()=>Y1,TypeDefinition:()=>X1,UnionType:()=>SN,UnorderedGroup:()=>hE,UntilToken:()=>K1,ValueLiteral:()=>Z1,Wildcard:()=>qb,isAbstractElement:()=>XP,isAbstractParserRule:()=>Bv,isAbstractRule:()=>KDe,isAbstractType:()=>ZDe,isAction:()=>om,isAlternatives:()=>KP,isArrayLiteral:()=>QDe,isArrayType:()=>Hre,isAssignment:()=>V0,isBooleanLiteral:()=>Gre,isCharacterRange:()=>Wre,isCondition:()=>JDe,isConjunction:()=>qre,isCrossReference:()=>Fv,isDisjunction:()=>Ure,isEndOfFile:()=>jre,isGrammar:()=>ePe,isGrammarImport:()=>tPe,isGroup:()=>zv,isInferredType:()=>N7,isInfixRule:()=>y3,isInfixRuleOperatorList:()=>rPe,isInfixRuleOperators:()=>nPe,isInterface:()=>Yre,isKeyword:()=>H0,isNamedArgument:()=>iPe,isNegatedToken:()=>Xre,isNegation:()=>Kre,isNumberLiteral:()=>sPe,isParameter:()=>aPe,isParameterReference:()=>Zre,isParserRule:()=>ql,isReferenceType:()=>Qre,isRegexToken:()=>Jre,isReturnType:()=>ene,isRuleCall:()=>G0,isSimpleType:()=>ZP,isStringLiteral:()=>oPe,isTerminalAlternatives:()=>tne,isTerminalElement:()=>lPe,isTerminalGroup:()=>rne,isTerminalRule:()=>Zu,isTerminalRuleCall:()=>QP,isType:()=>JP,isTypeAttribute:()=>cPe,isTypeDefinition:()=>uPe,isUnionType:()=>nne,isUnorderedGroup:()=>e$,isUntilToken:()=>ine,isValueLiteral:()=>hPe,isWildcard:()=>sne,reflection:()=>Ur});var Mnr={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]*/},oc={$type:"AbstractElement",cardinality:"cardinality"};function XP(t){return Ur.isInstance(t,oc.$type)}_(XP,"isAbstractElement");var iE={$type:"AbstractParserRule"};function Bv(t){return Ur.isInstance(t,iE.$type)}_(Bv,"isAbstractParserRule");var Fb={$type:"AbstractRule"};function KDe(t){return Ur.isInstance(t,Fb.$type)}_(KDe,"isAbstractRule");var $c={$type:"AbstractType"};function ZDe(t){return Ur.isInstance(t,$c.$type)}_(ZDe,"isAbstractType");var Xp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function om(t){return Ur.isInstance(t,Xp.$type)}_(om,"isAction");var sE={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function KP(t){return Ur.isInstance(t,sE.$type)}_(KP,"isAlternatives");var fN={$type:"ArrayLiteral",elements:"elements"};function QDe(t){return Ur.isInstance(t,fN.$type)}_(QDe,"isArrayLiteral");var pN={$type:"ArrayType",elementType:"elementType"};function Hre(t){return Ur.isInstance(t,pN.$type)}_(Hre,"isArrayType");var Kp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function V0(t){return Ur.isInstance(t,Kp.$type)}_(V0,"isAssignment");var gN={$type:"BooleanLiteral",true:"true"};function Gre(t){return Ur.isInstance(t,gN.$type)}_(Gre,"isBooleanLiteral");var Zp={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Wre(t){return Ur.isInstance(t,Zp.$type)}_(Wre,"isCharacterRange");var Qp={$type:"Condition"};function JDe(t){return Ur.isInstance(t,Qp.$type)}_(JDe,"isCondition");var aE={$type:"Conjunction",left:"left",right:"right"};function qre(t){return Ur.isInstance(t,aE.$type)}_(qre,"isConjunction");var Jp={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Fv(t){return Ur.isInstance(t,Jp.$type)}_(Fv,"isCrossReference");var oE={$type:"Disjunction",left:"left",right:"right"};function Ure(t){return Ur.isInstance(t,oE.$type)}_(Ure,"isDisjunction");var mN={$type:"EndOfFile",cardinality:"cardinality"};function jre(t){return Ur.isInstance(t,mN.$type)}_(jre,"isEndOfFile");var Wf={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function ePe(t){return Ur.isInstance(t,Wf.$type)}_(ePe,"isGrammar");var yN={$type:"GrammarImport",path:"path"};function tPe(t){return Ur.isInstance(t,yN.$type)}_(tPe,"isGrammarImport");var V1={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function zv(t){return Ur.isInstance(t,V1.$type)}_(zv,"isGroup");var vN={$type:"InferredType",name:"name"};function N7(t){return Ur.isInstance(t,vN.$type)}_(N7,"isInferredType");var md={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function y3(t){return Ur.isInstance(t,md.$type)}_(y3,"isInfixRule");var lE={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function rPe(t){return Ur.isInstance(t,lE.$type)}_(rPe,"isInfixRuleOperatorList");var bN={$type:"InfixRuleOperators",precedences:"precedences"};function nPe(t){return Ur.isInstance(t,bN.$type)}_(nPe,"isInfixRuleOperators");var zb={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Yre(t){return Ur.isInstance(t,zb.$type)}_(Yre,"isInterface");var Vb={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function H0(t){return Ur.isInstance(t,Vb.$type)}_(H0,"isKeyword");var Hb={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function iPe(t){return Ur.isInstance(t,Hb.$type)}_(iPe,"isNamedArgument");var H1={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Xre(t){return Ur.isInstance(t,H1.$type)}_(Xre,"isNegatedToken");var xN={$type:"Negation",value:"value"};function Kre(t){return Ur.isInstance(t,xN.$type)}_(Kre,"isNegation");var wN={$type:"NumberLiteral",value:"value"};function sPe(t){return Ur.isInstance(t,wN.$type)}_(sPe,"isNumberLiteral");var Gb={$type:"Parameter",name:"name"};function aPe(t){return Ur.isInstance(t,Gb.$type)}_(aPe,"isParameter");var TN={$type:"ParameterReference",parameter:"parameter"};function Zre(t){return Ur.isInstance(t,TN.$type)}_(Zre,"isParameterReference");var sh={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function ql(t){return Ur.isInstance(t,sh.$type)}_(ql,"isParserRule");var cE={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Qre(t){return Ur.isInstance(t,cE.$type)}_(Qre,"isReferenceType");var G1={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Jre(t){return Ur.isInstance(t,G1.$type)}_(Jre,"isRegexToken");var CN={$type:"ReturnType",name:"name"};function ene(t){return Ur.isInstance(t,CN.$type)}_(ene,"isReturnType");var W1={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function G0(t){return Ur.isInstance(t,W1.$type)}_(G0,"isRuleCall");var Wb={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function ZP(t){return Ur.isInstance(t,Wb.$type)}_(ZP,"isSimpleType");var kN={$type:"StringLiteral",value:"value"};function oPe(t){return Ur.isInstance(t,kN.$type)}_(oPe,"isStringLiteral");var q1={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function tne(t){return Ur.isInstance(t,q1.$type)}_(tne,"isTerminalAlternatives");var lc={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function lPe(t){return Ur.isInstance(t,lc.$type)}_(lPe,"isTerminalElement");var U1={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function rne(t){return Ur.isInstance(t,U1.$type)}_(rne,"isTerminalGroup");var qf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Zu(t){return Ur.isInstance(t,qf.$type)}_(Zu,"isTerminalRule");var j1={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function QP(t){return Ur.isInstance(t,j1.$type)}_(QP,"isTerminalRuleCall");var uE={$type:"Type",name:"name",type:"type"};function JP(t){return Ur.isInstance(t,uE.$type)}_(JP,"isType");var Y1={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function cPe(t){return Ur.isInstance(t,Y1.$type)}_(cPe,"isTypeAttribute");var X1={$type:"TypeDefinition"};function uPe(t){return Ur.isInstance(t,X1.$type)}_(uPe,"isTypeDefinition");var SN={$type:"UnionType",types:"types"};function nne(t){return Ur.isInstance(t,SN.$type)}_(nne,"isUnionType");var hE={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function e$(t){return Ur.isInstance(t,hE.$type)}_(e$,"isUnorderedGroup");var K1={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function ine(t){return Ur.isInstance(t,K1.$type)}_(ine,"isUntilToken");var Z1={$type:"ValueLiteral"};function hPe(t){return Ur.isInstance(t,Z1.$type)}_(hPe,"isValueLiteral");var qb={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function sne(t){return Ur.isInstance(t,qb.$type)}_(sne,"isWildcard");var Yx,ane=(Yx=class extends Bre{constructor(){super(...arguments),this.types={AbstractElement:{name:oc.$type,properties:{cardinality:{name:oc.cardinality}},superTypes:[]},AbstractParserRule:{name:iE.$type,properties:{},superTypes:[Fb.$type,$c.$type]},AbstractRule:{name:Fb.$type,properties:{},superTypes:[]},AbstractType:{name:$c.$type,properties:{},superTypes:[]},Action:{name:Xp.$type,properties:{cardinality:{name:Xp.cardinality},feature:{name:Xp.feature},inferredType:{name:Xp.inferredType},operator:{name:Xp.operator},type:{name:Xp.type,referenceType:$c.$type}},superTypes:[oc.$type]},Alternatives:{name:sE.$type,properties:{cardinality:{name:sE.cardinality},elements:{name:sE.elements,defaultValue:[]}},superTypes:[oc.$type]},ArrayLiteral:{name:fN.$type,properties:{elements:{name:fN.elements,defaultValue:[]}},superTypes:[Z1.$type]},ArrayType:{name:pN.$type,properties:{elementType:{name:pN.elementType}},superTypes:[X1.$type]},Assignment:{name:Kp.$type,properties:{cardinality:{name:Kp.cardinality},feature:{name:Kp.feature},operator:{name:Kp.operator},predicate:{name:Kp.predicate},terminal:{name:Kp.terminal}},superTypes:[oc.$type]},BooleanLiteral:{name:gN.$type,properties:{true:{name:gN.true,defaultValue:!1}},superTypes:[Qp.$type,Z1.$type]},CharacterRange:{name:Zp.$type,properties:{cardinality:{name:Zp.cardinality},left:{name:Zp.left},lookahead:{name:Zp.lookahead},parenthesized:{name:Zp.parenthesized,defaultValue:!1},right:{name:Zp.right}},superTypes:[lc.$type]},Condition:{name:Qp.$type,properties:{},superTypes:[]},Conjunction:{name:aE.$type,properties:{left:{name:aE.left},right:{name:aE.right}},superTypes:[Qp.$type]},CrossReference:{name:Jp.$type,properties:{cardinality:{name:Jp.cardinality},deprecatedSyntax:{name:Jp.deprecatedSyntax,defaultValue:!1},isMulti:{name:Jp.isMulti,defaultValue:!1},terminal:{name:Jp.terminal},type:{name:Jp.type,referenceType:$c.$type}},superTypes:[oc.$type]},Disjunction:{name:oE.$type,properties:{left:{name:oE.left},right:{name:oE.right}},superTypes:[Qp.$type]},EndOfFile:{name:mN.$type,properties:{cardinality:{name:mN.cardinality}},superTypes:[oc.$type]},Grammar:{name:Wf.$type,properties:{imports:{name:Wf.imports,defaultValue:[]},interfaces:{name:Wf.interfaces,defaultValue:[]},isDeclared:{name:Wf.isDeclared,defaultValue:!1},name:{name:Wf.name},rules:{name:Wf.rules,defaultValue:[]},types:{name:Wf.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:yN.$type,properties:{path:{name:yN.path}},superTypes:[]},Group:{name:V1.$type,properties:{cardinality:{name:V1.cardinality},elements:{name:V1.elements,defaultValue:[]},guardCondition:{name:V1.guardCondition},predicate:{name:V1.predicate}},superTypes:[oc.$type]},InferredType:{name:vN.$type,properties:{name:{name:vN.name}},superTypes:[$c.$type]},InfixRule:{name:md.$type,properties:{call:{name:md.call},dataType:{name:md.dataType},inferredType:{name:md.inferredType},name:{name:md.name},operators:{name:md.operators},parameters:{name:md.parameters,defaultValue:[]},returnType:{name:md.returnType,referenceType:$c.$type}},superTypes:[iE.$type]},InfixRuleOperatorList:{name:lE.$type,properties:{associativity:{name:lE.associativity},operators:{name:lE.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:bN.$type,properties:{precedences:{name:bN.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:zb.$type,properties:{attributes:{name:zb.attributes,defaultValue:[]},name:{name:zb.name},superTypes:{name:zb.superTypes,defaultValue:[],referenceType:$c.$type}},superTypes:[$c.$type]},Keyword:{name:Vb.$type,properties:{cardinality:{name:Vb.cardinality},predicate:{name:Vb.predicate},value:{name:Vb.value}},superTypes:[oc.$type]},NamedArgument:{name:Hb.$type,properties:{calledByName:{name:Hb.calledByName,defaultValue:!1},parameter:{name:Hb.parameter,referenceType:Gb.$type},value:{name:Hb.value}},superTypes:[]},NegatedToken:{name:H1.$type,properties:{cardinality:{name:H1.cardinality},lookahead:{name:H1.lookahead},parenthesized:{name:H1.parenthesized,defaultValue:!1},terminal:{name:H1.terminal}},superTypes:[lc.$type]},Negation:{name:xN.$type,properties:{value:{name:xN.value}},superTypes:[Qp.$type]},NumberLiteral:{name:wN.$type,properties:{value:{name:wN.value}},superTypes:[Z1.$type]},Parameter:{name:Gb.$type,properties:{name:{name:Gb.name}},superTypes:[]},ParameterReference:{name:TN.$type,properties:{parameter:{name:TN.parameter,referenceType:Gb.$type}},superTypes:[Qp.$type]},ParserRule:{name:sh.$type,properties:{dataType:{name:sh.dataType},definition:{name:sh.definition},entry:{name:sh.entry,defaultValue:!1},fragment:{name:sh.fragment,defaultValue:!1},inferredType:{name:sh.inferredType},name:{name:sh.name},parameters:{name:sh.parameters,defaultValue:[]},returnType:{name:sh.returnType,referenceType:$c.$type}},superTypes:[iE.$type]},ReferenceType:{name:cE.$type,properties:{isMulti:{name:cE.isMulti,defaultValue:!1},referenceType:{name:cE.referenceType}},superTypes:[X1.$type]},RegexToken:{name:G1.$type,properties:{cardinality:{name:G1.cardinality},lookahead:{name:G1.lookahead},parenthesized:{name:G1.parenthesized,defaultValue:!1},regex:{name:G1.regex}},superTypes:[lc.$type]},ReturnType:{name:CN.$type,properties:{name:{name:CN.name}},superTypes:[]},RuleCall:{name:W1.$type,properties:{arguments:{name:W1.arguments,defaultValue:[]},cardinality:{name:W1.cardinality},predicate:{name:W1.predicate},rule:{name:W1.rule,referenceType:Fb.$type}},superTypes:[oc.$type]},SimpleType:{name:Wb.$type,properties:{primitiveType:{name:Wb.primitiveType},stringType:{name:Wb.stringType},typeRef:{name:Wb.typeRef,referenceType:$c.$type}},superTypes:[X1.$type]},StringLiteral:{name:kN.$type,properties:{value:{name:kN.value}},superTypes:[Z1.$type]},TerminalAlternatives:{name:q1.$type,properties:{cardinality:{name:q1.cardinality},elements:{name:q1.elements,defaultValue:[]},lookahead:{name:q1.lookahead},parenthesized:{name:q1.parenthesized,defaultValue:!1}},superTypes:[lc.$type]},TerminalElement:{name:lc.$type,properties:{cardinality:{name:lc.cardinality},lookahead:{name:lc.lookahead},parenthesized:{name:lc.parenthesized,defaultValue:!1}},superTypes:[oc.$type]},TerminalGroup:{name:U1.$type,properties:{cardinality:{name:U1.cardinality},elements:{name:U1.elements,defaultValue:[]},lookahead:{name:U1.lookahead},parenthesized:{name:U1.parenthesized,defaultValue:!1}},superTypes:[lc.$type]},TerminalRule:{name:qf.$type,properties:{definition:{name:qf.definition},fragment:{name:qf.fragment,defaultValue:!1},hidden:{name:qf.hidden,defaultValue:!1},name:{name:qf.name},type:{name:qf.type}},superTypes:[Fb.$type]},TerminalRuleCall:{name:j1.$type,properties:{cardinality:{name:j1.cardinality},lookahead:{name:j1.lookahead},parenthesized:{name:j1.parenthesized,defaultValue:!1},rule:{name:j1.rule,referenceType:qf.$type}},superTypes:[lc.$type]},Type:{name:uE.$type,properties:{name:{name:uE.name},type:{name:uE.type}},superTypes:[$c.$type]},TypeAttribute:{name:Y1.$type,properties:{defaultValue:{name:Y1.defaultValue},isOptional:{name:Y1.isOptional,defaultValue:!1},name:{name:Y1.name},type:{name:Y1.type}},superTypes:[]},TypeDefinition:{name:X1.$type,properties:{},superTypes:[]},UnionType:{name:SN.$type,properties:{types:{name:SN.types,defaultValue:[]}},superTypes:[X1.$type]},UnorderedGroup:{name:hE.$type,properties:{cardinality:{name:hE.cardinality},elements:{name:hE.elements,defaultValue:[]}},superTypes:[oc.$type]},UntilToken:{name:K1.$type,properties:{cardinality:{name:K1.cardinality},lookahead:{name:K1.lookahead},parenthesized:{name:K1.parenthesized,defaultValue:!1},terminal:{name:K1.terminal}},superTypes:[lc.$type]},ValueLiteral:{name:Z1.$type,properties:{},superTypes:[]},Wildcard:{name:qb.$type,properties:{cardinality:{name:qb.cardinality},lookahead:{name:qb.lookahead},parenthesized:{name:qb.parenthesized,defaultValue:!1}},superTypes:[lc.$type]}}}},_(Yx,"LangiumGrammarAstReflection"),Yx),Ur=new ane;function dPe(t){let e=t,r=!1;for(;e;){const n=$v(e.grammarSource,ql);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}_(dPe,"getDatatypeNode");function v3(t){return new p3(t,e=>z0(e)?e.content:[],{includeRoot:!0})}_(v3,"streamCst");function fPe(t){return v3(t).filter(Pv)}_(fPe,"flattenCst");function one(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}_(one,"isChildNode");function eA(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}_(eA,"tokenToRange");function b3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}_(b3,"toDocumentSegment");var Ed;(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"})(Ed||(Ed={}));function lne(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ed.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineEd.After}_(cne,"inRange");var une=/^[\w\p{L}]$/u;function pPe(t,e,r=une){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return t$(t,e)}}_(pPe,"findDeclarationNodeAtOffset");function hne(t,e){if(t){const r=pne(t,!0);if(r&&EN(r,e))return r;if(YP(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const s=t.content[i];if(EN(s,e))return s}}}}_(hne,"findCommentNode");function EN(t,e){return Pv(t)&&e.includes(t.tokenType.name)}_(EN,"isCommentNode");function t$(t,e){if(Pv(t))return t;if(z0(t)){const r=fne(t,e,!1);if(r)return t$(r,e)}}_(t$,"findLeafNodeAtOffset");function dne(t,e){if(Pv(t))return t;if(z0(t)){const r=fne(t,e,!0);if(r)return dne(r,e)}}_(dne,"findLeafNodeBeforeOffset");function fne(t,e,r){let n=0,i=t.content.length-1,s;for(;n<=i;){const a=Math.floor((n+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=r?o:void 0,n=a+1):i=a-1}return s}_(fne,"binarySearch");function pne(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}}_(pne,"getPreviousNode");function gPe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nMne,findNameAssignment:()=>c$,findNodeForKeyword:()=>Ane,findNodeForProperty:()=>a$,findNodesForKeyword:()=>EPe,findNodesForKeywordInternal:()=>l$,findNodesForProperty:()=>Ene,getActionAtElement:()=>_ne,getActionType:()=>Ine,getAllReachableRules:()=>s$,getAllRulesUsedForCrossReferences:()=>SPe,getCrossReferenceTerminal:()=>kne,getEntryRule:()=>wne,getExplicitRuleType:()=>D7,getHiddenRules:()=>Tne,getRuleType:()=>Nne,getRuleTypeName:()=>LPe,getTypeName:()=>uv,isArrayCardinality:()=>MPe,isArrayOperator:()=>RPe,isCommentTerminal:()=>Sne,isDataType:()=>_Pe,isDataTypeRule:()=>O7,isOptionalCardinality:()=>APe,terminalRegex:()=>P7});var Xx,r$=(Xx=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},_(Xx,"ErrorWithLocation"),Xx);function Pm(t,e="Error: Got unexpected value."){throw new Error(e)}_(Pm,"assertUnreachable");function mne(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}_(mne,"assertCondition");var yne={};Dm(yne,{NEWLINE_REGEXP:()=>wPe,escapeRegExp:()=>yC,getTerminalParts:()=>CPe,isMultilineComment:()=>vne,isWhitespace:()=>i$,partialMatches:()=>bne,partialRegExp:()=>xne,whitespaceCharacters:()=>kPe});function Jr(t){return t.charCodeAt(0)}_(Jr,"cc");function _9(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}_(_9,"insertToSet");function lb(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}_(lb,"addFlag");function S1(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}_(S1,"ASSERT_EXISTS");function bPe(){throw Error("Internal Error - Should never get here!")}_(bPe,"ASSERT_NEVER_REACH_HERE");function oX(t){return t.type==="Character"}_(oX,"isCharacter");var AN=[];for(let t=Jr("0");t<=Jr("9");t++)AN.push(t);var MN=[Jr("_")].concat(AN);for(let t=Jr("a");t<=Jr("z");t++)MN.push(t);for(let t=Jr("A");t<=Jr("Z");t++)MN.push(t);var W1e=[Jr(" "),Jr("\f"),Jr(` -`),Jr("\r"),Jr(" "),Jr("\v"),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr(" "),Jr("\u2028"),Jr("\u2029"),Jr(" "),Jr(" "),Jr(" "),Jr("\uFEFF")],Rnr=/[0-9a-fA-F]/,WM=/[0-9]/,_nr=/[1-9]/,Kx,xPe=(Kx=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":lb(n,"global");break;case"i":lb(n,"ignoreCase");break;case"m":lb(n,"multiLine");break;case"u":lb(n,"unicode");break;case"y":lb(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}}S1(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return bPe()}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 s;this.isDigit()?(s=this.integerIncludingZero(),r={atLeast:i,atMost:s}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;S1(r);break}if(!(e===!0&&r===void 0)&&S1(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()),S1(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Jr(` -`),Jr("\r"),Jr("\u2028"),Jr("\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=AN;break;case"D":e=AN,r=!0;break;case"s":e=W1e;break;case"S":e=W1e,r=!0;break;case"w":e=MN;break;case"W":e=MN,r=!0;break}if(S1(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Jr("\f");break;case"n":e=Jr(` -`);break;case"r":e=Jr("\r");break;case"t":e=Jr(" ");break;case"v":e=Jr("\v");break}if(S1(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:Jr("\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:Jr(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:Jr(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,oX(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,oX(i)){if(i.value{Vt();let pt,bt;if(r.string(Se)){pt=Se;const Br=it[0];let kr=0,jr=n.ParameterStructures.auto;n.ParameterStructures.is(Br)&&(kr=1,jr=Br);let Er=it.length;const an=Er-kr;switch(an){case 0:bt=void 0;break;case 1:bt=mt(jr,it[kr]);break;default:if(jr===n.ParameterStructures.byName)throw new Error(`Received ${an} parameters for 'by Name' notification parameter structure.`);bt=it.slice(kr,Er).map(Cr=>ve(Cr));break}}else{const Br=it;pt=Se.method,bt=Mt(Se,Br)}const ir={jsonrpc:V,method:pt,params:bt};return _e(ir),P.write(ir).catch(Br=>{throw B.error("Sending notification failed."),Br})},"sendNotification"),onNotification:M((Se,it)=>{Vt();let pt;return r.func(Se)?K=Se:it&&(r.string(Se)?(pt=Se,W.set(Se,{type:void 0,handler:it})):(pt=Se.method,W.set(Se.method,{type:Se,handler:it}))),{dispose:M(()=>{pt!==void 0?W.delete(pt):K=void 0},"dispose")}},"onNotification"),onProgress:M((Se,it,pt)=>{if(oe.has(it))throw new Error(`Progress handler for token ${it} already registered`);return oe.set(it,pt),{dispose:M(()=>{oe.delete(it)},"dispose")}},"onProgress"),sendProgress:M((Se,it,pt)=>Or.sendNotification(u.type,{token:it,value:pt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:M((Se,...it)=>{Vt(),dt();let pt,bt,ir;if(r.string(Se)){pt=Se;const Er=it[0],an=it[it.length-1];let Cr=0,Yr=n.ParameterStructures.auto;n.ParameterStructures.is(Er)&&(Cr=1,Yr=Er);let Cn=it.length;s.CancellationToken.is(an)&&(Cn=Cn-1,ir=an);const ut=Cn-Cr;switch(ut){case 0:bt=void 0;break;case 1:bt=mt(Yr,it[Cr]);break;default:if(Yr===n.ParameterStructures.byName)throw new Error(`Received ${ut} parameters for 'by Name' request parameter structure.`);bt=it.slice(Cr,Cn).map(Ut=>ve(Ut));break}}else{const Er=it;pt=Se.method,bt=Mt(Se,Er);const an=Se.numberOfParams;ir=s.CancellationToken.is(Er[an])?Er[an]:void 0}const Br=F++;let kr;ir&&(kr=ir.onCancellationRequested(()=>{const Er=xe.sender.sendCancellation(Or,Br);return Er===void 0?(B.log(`Received no promise from cancellation strategy when cancelling id ${Br}`),Promise.resolve()):Er.catch(()=>{B.log(`Sending cancellation messages for id ${Br} failed`)})}));const jr={jsonrpc:V,id:Br,method:pt,params:bt};return at(jr),typeof xe.sender.enableCancellation=="function"&&xe.sender.enableCancellation(jr),new Promise(async(Er,an)=>{const Cr=M(ut=>{Er(ut),xe.sender.cleanup(Br),kr==null||kr.dispose()},"resolveWithCleanup"),Yr=M(ut=>{an(ut),xe.sender.cleanup(Br),kr==null||kr.dispose()},"rejectWithCleanup"),Cn={method:pt,timerStart:Date.now(),resolve:Cr,reject:Yr};try{await P.write(jr),ne.set(Br,Cn)}catch(ut){throw B.error("Sending request failed."),Cn.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},"sendRequest"),onRequest:M((Se,it)=>{Vt();let pt=null;return d.is(Se)?(pt=void 0,H=Se):r.string(Se)?(pt=null,it!==void 0&&(pt=Se,G.set(Se,{handler:it,type:void 0}))):it!==void 0&&(pt=Se.method,G.set(Se.method,{type:Se,handler:it})),{dispose:M(()=>{pt!==null&&(pt!==void 0?G.delete(pt):H=void 0)},"dispose")}},"onRequest"),hasPendingResponse:M(()=>ne.size>0,"hasPendingResponse"),trace:M(async(Se,it,pt)=>{let bt=!1,ir=g.Text;pt!==void 0&&(r.boolean(pt)?bt=pt:(bt=pt.sendNotification||!1,ir=pt.traceFormat||g.Text)),te=Se,Re=ir,te===f.Off?Pe=void 0:Pe=it,bt&&!Y()&&!Q()&&await Or.sendNotification(m.type,{value:f.toString(Se)})},"trace"),onError:ce.event,onClose:he.event,onUnhandledNotification:we.event,onDispose:ze.event,end:M(()=>{P.end()},"end"),dispose:M(()=>{if(Q())return;Ve=R.Disposed,ze.fire(void 0);const Se=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const it of ne.values())it.reject(Se);ne=new Map,me=new Map,ie=new Set,J=new i.LinkedMap,r.func(P.dispose)&&P.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:M(()=>{Vt(),Lt(),Ve=R.Listening,I.listen(Ke)},"listen"),inspect:M(()=>{(0,e.default)().console.log("inspect")},"inspect")};return Or.onNotification(U.type,Se=>{if(te===f.Off||!Pe)return;const it=te===f.Verbose||te===f.Compact;Pe.log(Se.message,it?Se.verbose:void 0)}),Or.onNotification(u.type,Se=>{const it=oe.get(Se.token);it?it(Se.value):ge.fire(Se)}),Or}M(_,"createMessageConnection"),t.createMessageConnection=_}}),dX=mn({"../../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=r_e();Object.defineProperty(t,"Message",{enumerable:!0,get:M(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:M(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:M(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:M(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:M(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:M(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:M(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:M(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:M(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:M(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:M(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:M(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:M(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:M(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:M(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:M(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:M(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:M(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:M(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:M(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:M(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:M(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:M(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:M(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:M(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:M(function(){return e.ParameterStructures},"get")});var r=n_e();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:M(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:M(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:M(function(){return r.Touch},"get")});var n=bnr();Object.defineProperty(t,"Disposable",{enumerable:!0,get:M(function(){return n.Disposable},"get")});var i=y9();Object.defineProperty(t,"Event",{enumerable:!0,get:M(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:M(function(){return i.Emitter},"get")});var a=K_();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:M(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:M(function(){return a.CancellationToken},"get")});var s=vnr();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:M(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:M(function(){return s.SharedArrayReceiverStrategy},"get")});var o=xnr();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:M(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:M(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:M(function(){return o.ReadableStreamMessageReader},"get")});var l=wnr();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:M(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:M(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:M(function(){return l.WriteableStreamMessageWriter},"get")});var u=Tnr();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:M(function(){return u.AbstractMessageBuffer},"get")});var h=Cnr();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:M(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:M(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:M(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:M(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:M(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:M(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:M(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:M(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:M(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:M(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:M(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:M(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:M(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:M(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:M(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:M(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:M(function(){return h.MessageStrategy},"get")});var d=B5();t.RAL=d.default}}),knr=mn({"../../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=dX(),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)}},M(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)}},M(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()}},M(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:M(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:M((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:M((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:M(d=>new n(d),"asReadableStream"),asWritableStream:M(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:M(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:M(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:M(()=>clearInterval(g),"dispose")}}})});function o(){return s}M(o,"RIL"),(function(d){function f(){e.RAL.install(s)}M(f,"install"),d.install=f})(o||(o={})),t.default=o}}),b9=mn({"../../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:M(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=knr();n.default.install();var i=dX();r(dX(),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)}},M(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(){}},M(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)}M(o,"createMessageConnection"),t.createMessageConnection=o}}),Qme=mn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=b9()}}),Aa=mn({"../../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=b9(),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}},M(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},M(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},M(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},M(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},M(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),Hre=mn({"../../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}M(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}M(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}M(n,"number"),t.number=n;function i(h){return h instanceof Error}M(i,"error"),t.error=i;function a(h){return typeof h=="function"}M(a,"func"),t.func=a;function s(h){return Array.isArray(h)}M(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}M(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}M(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}M(u,"objectLiteral"),t.objectLiteral=u}}),Snr=mn({"../../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=Aa(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),Enr=mn({"../../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=Aa(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),Anr=mn({"../../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=Aa(),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={}))}}),Mnr=mn({"../../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=Aa(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),Rnr=mn({"../../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=Aa(),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={}))}}),Lnr=mn({"../../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=Aa(),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={}))}}),Inr=mn({"../../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=Aa(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),Nnr=mn({"../../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=Aa(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Dnr=mn({"../../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=b9(),r=Aa(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}M(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={}))}}),Onr=mn({"../../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=Aa(),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={}))}}),_nr=mn({"../../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=Aa(),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={}))}}),Pnr=mn({"../../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=Aa(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),Bnr=mn({"../../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=Aa(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),$nr=mn({"../../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=Aa(),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={}))}}),Fnr=mn({"../../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=Aa(),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={}))}}),znr=mn({"../../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=Aa(),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={}))}}),Vnr=mn({"../../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=Aa(),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={}))}}),Hnr=mn({"../../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=Aa(),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={}))}}),Gnr=mn({"../../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=b9(),r=Hre(),n=Aa(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}M(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={}))}}),Wnr=mn({"../../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=(Nk(),Vre(X_)),r=Hre(),n=Aa(),i;(function(g){g.Markup=1,g.Code=2;function m(U){return U===1||U===2}M(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(b,v){const w={executionOrder:b};return(v===!0||v===!1)&&(w.success=v),w}M(m,"create"),g.create=m;function U(b){const v=b;return r.objectLiteral(v)&&e.uinteger.is(v.executionOrder)&&(v.success===void 0||r.boolean(v.success))}M(U,"is"),g.is=U;function y(b,v){return b===v?!0:b==null||v===null||v===void 0?!1:b.executionOrder===v.executionOrder&&b.success===v.success}M(y,"equals"),g.equals=y})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(v,w){return{kind:v,document:w}}M(m,"create"),g.create=m;function U(v){const w=v;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}M(U,"is"),g.is=U;function y(v,w){const T=new Set;return v.document!==w.document&&T.add("document"),v.kind!==w.kind&&T.add("kind"),v.executionSummary!==w.executionSummary&&T.add("executionSummary"),(v.metadata!==void 0||w.metadata!==void 0)&&!b(v.metadata,w.metadata)&&T.add("metadata"),(v.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(v.executionSummary,w.executionSummary)&&T.add("executionSummary"),T}M(y,"diff"),g.diff=y;function b(v,w){if(v===w)return!0;if(v==null||w===null||w===void 0||typeof v!=typeof w||typeof v!="object")return!1;const T=Array.isArray(v),k=Array.isArray(w);if(T!==k)return!1;if(T&&k){if(v.length!==w.length)return!1;for(let C=0;C0}M(It,"hasId"),ve.hasId=It})(D||(t.StaticRegistrationOptions=D={}));var B;(function(ve){function It(xt){const mt=xt;return mt&&(mt.documentSelector===null||_.is(mt.documentSelector))}M(It,"is"),ve.is=It})(B||(t.TextDocumentRegistrationOptions=B={}));var F;(function(ve){function It(mt){const Mt=mt;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}M(It,"is"),ve.is=It;function xt(mt){const Mt=mt;return Mt&&n.boolean(Mt.workDoneProgress)}M(xt,"hasWorkDoneProgress"),ve.hasWorkDoneProgress=xt})(F||(t.WorkDoneProgressOptions=F={}));var z;(function(ve){ve.method="initialize",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(z||(t.InitializeRequest=z={}));var $;(function(ve){ve.unknownProtocolVersion=1})($||(t.InitializeErrorCodes=$={}));var V;(function(ve){ve.method="initialized",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(V||(t.InitializedNotification=V={}));var H;(function(ve){ve.method="shutdown",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType0(ve.method)})(H||(t.ShutdownRequest=H={}));var G;(function(ve){ve.method="exit",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType0(ve.method)})(G||(t.ExitNotification=G={}));var K;(function(ve){ve.method="workspace/didChangeConfiguration",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(K||(t.DidChangeConfigurationNotification=K={}));var W;(function(ve){ve.Error=1,ve.Warning=2,ve.Info=3,ve.Log=4,ve.Debug=5})(W||(t.MessageType=W={}));var oe;(function(ve){ve.method="window/showMessage",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(oe||(t.ShowMessageNotification=oe={}));var Z;(function(ve){ve.method="window/showMessageRequest",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType(ve.method)})(Z||(t.ShowMessageRequest=Z={}));var J;(function(ve){ve.method="window/logMessage",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(J||(t.LogMessageNotification=J={}));var ne;(function(ve){ve.method="telemetry/event",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(ne||(t.TelemetryEventNotification=ne={}));var ie;(function(ve){ve.None=0,ve.Full=1,ve.Incremental=2})(ie||(t.TextDocumentSyncKind=ie={}));var me;(function(ve){ve.method="textDocument/didOpen",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(me||(t.DidOpenTextDocumentNotification=me={}));var te;(function(ve){function It(mt){let Mt=mt;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}M(It,"isIncremental"),ve.isIncremental=It;function xt(mt){let Mt=mt;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}M(xt,"isFull"),ve.isFull=xt})(te||(t.TextDocumentContentChangeEvent=te={}));var Re;(function(ve){ve.method="textDocument/didChange",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(Re||(t.DidChangeTextDocumentNotification=Re={}));var Pe;(function(ve){ve.method="textDocument/didClose",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(Pe||(t.DidCloseTextDocumentNotification=Pe={}));var Ve;(function(ve){ve.method="textDocument/didSave",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(Ve||(t.DidSaveTextDocumentNotification=Ve={}));var ce;(function(ve){ve.Manual=1,ve.AfterDelay=2,ve.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var he;(function(ve){ve.method="textDocument/willSave",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(he||(t.WillSaveTextDocumentNotification=he={}));var we;(function(ve){ve.method="textDocument/willSaveWaitUntil",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(we||(t.WillSaveTextDocumentWaitUntilRequest=we={}));var ge;(function(ve){ve.method="workspace/didChangeWatchedFiles",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolNotificationType(ve.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var ze;(function(ve){ve.Created=1,ve.Changed=2,ve.Deleted=3})(ze||(t.FileChangeType=ze={}));var xe;(function(ve){function It(xt){const mt=xt;return n.objectLiteral(mt)&&(r.URI.is(mt.baseUri)||r.WorkspaceFolder.is(mt.baseUri))&&n.string(mt.pattern)}M(It,"is"),ve.is=It})(xe||(t.RelativePattern=xe={}));var Ee;(function(ve){ve.Create=1,ve.Change=2,ve.Delete=4})(Ee||(t.WatchKind=Ee={}));var qe;(function(ve){ve.method="textDocument/publishDiagnostics",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolNotificationType(ve.method)})(qe||(t.PublishDiagnosticsNotification=qe={}));var le;(function(ve){ve.Invoked=1,ve.TriggerCharacter=2,ve.TriggerForIncompleteCompletions=3})(le||(t.CompletionTriggerKind=le={}));var pe;(function(ve){ve.method="textDocument/completion",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(pe||(t.CompletionRequest=pe={}));var Te;(function(ve){ve.method="completionItem/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Te||(t.CompletionResolveRequest=Te={}));var re;(function(ve){ve.method="textDocument/hover",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(re||(t.HoverRequest=re={}));var Y;(function(ve){ve.Invoked=1,ve.TriggerCharacter=2,ve.ContentChange=3})(Y||(t.SignatureHelpTriggerKind=Y={}));var Q;(function(ve){ve.method="textDocument/signatureHelp",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Q||(t.SignatureHelpRequest=Q={}));var ue;(function(ve){ve.method="textDocument/definition",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(ue||(t.DefinitionRequest=ue={}));var X;(function(ve){ve.method="textDocument/references",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(X||(t.ReferencesRequest=X={}));var fe;(function(ve){ve.method="textDocument/documentHighlight",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(fe||(t.DocumentHighlightRequest=fe={}));var ee;(function(ve){ve.method="textDocument/documentSymbol",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(ee||(t.DocumentSymbolRequest=ee={}));var Ae;(function(ve){ve.method="textDocument/codeAction",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ae||(t.CodeActionRequest=Ae={}));var Me;(function(ve){ve.method="codeAction/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Me||(t.CodeActionResolveRequest=Me={}));var Ke;(function(ve){ve.method="workspace/symbol",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ke||(t.WorkspaceSymbolRequest=Ke={}));var Ne;(function(ve){ve.method="workspaceSymbol/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var je;(function(ve){ve.method="textDocument/codeLens",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(je||(t.CodeLensRequest=je={}));var De;(function(ve){ve.method="codeLens/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(De||(t.CodeLensResolveRequest=De={}));var Ze;(function(ve){ve.method="workspace/codeLens/refresh",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType0(ve.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var Fe;(function(ve){ve.method="textDocument/documentLink",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Fe||(t.DocumentLinkRequest=Fe={}));var at;(function(ve){ve.method="documentLink/resolve",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(at||(t.DocumentLinkResolveRequest=at={}));var _e;(function(ve){ve.method="textDocument/formatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(_e||(t.DocumentFormattingRequest=_e={}));var gt;(function(ve){ve.method="textDocument/rangeFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(gt||(t.DocumentRangeFormattingRequest=gt={}));var Le;(function(ve){ve.method="textDocument/rangesFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Le||(t.DocumentRangesFormattingRequest=Le={}));var kt;(function(ve){ve.method="textDocument/onTypeFormatting",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(kt||(t.DocumentOnTypeFormattingRequest=kt={}));var Et;(function(ve){ve.Identifier=1})(Et||(t.PrepareSupportDefaultBehavior=Et={}));var ot;(function(ve){ve.method="textDocument/rename",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(ot||(t.RenameRequest=ot={}));var Vt;(function(ve){ve.method="textDocument/prepareRename",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Vt||(t.PrepareRenameRequest=Vt={}));var Lt;(function(ve){ve.method="workspace/executeCommand",ve.messageDirection=e.MessageDirection.clientToServer,ve.type=new e.ProtocolRequestType(ve.method)})(Lt||(t.ExecuteCommandRequest=Lt={}));var dt;(function(ve){ve.method="workspace/applyEdit",ve.messageDirection=e.MessageDirection.serverToClient,ve.type=new e.ProtocolRequestType("workspace/applyEdit")})(dt||(t.ApplyWorkspaceEditRequest=dt={}))}}),Ynr=mn({"../../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=b9();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}M(r,"createProtocolConnection"),t.createProtocolConnection=r}}),Xnr=mn({"../../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:M(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(b9(),t),r((Nk(),Vre(X_)),t),r(Aa(),t),r(jnr(),t);var n=Ynr();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:M(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={}))}}),Knr=mn({"../../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:M(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=Qme();r(Qme(),t),r(Xnr(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}M(i,"createProtocolConnection"),t.createProtocolConnection=i}}),a_e={};P1(a_e,{AbstractAstReflection:()=>qre,AbstractCstNode:()=>Yie,AbstractLangiumParser:()=>Kie,AbstractParserErrorMessageProvider:()=>qWe,AbstractThreadedAsyncParser:()=>wpr,AstUtils:()=>jre,BiMap:()=>KN,Cancellation:()=>Vi,CompositeCstNodeImpl:()=>qP,ContextCache:()=>QP,CstNodeBuilder:()=>HWe,CstUtils:()=>Gre,DEFAULT_TOKENIZE_OPTIONS:()=>pae,DONE_RESULT:()=>kl,DatatypeSymbol:()=>qN,DefaultAstNodeDescriptionProvider:()=>wqe,DefaultAstNodeLocator:()=>Cqe,DefaultAsyncParser:()=>Vqe,DefaultCommentProvider:()=>zqe,DefaultConfigurationProvider:()=>kqe,DefaultDocumentBuilder:()=>Sqe,DefaultDocumentValidator:()=>xqe,DefaultHydrator:()=>Gqe,DefaultIndexManager:()=>Eqe,DefaultJsonSerializer:()=>Uqe,DefaultLangiumDocumentFactory:()=>lqe,DefaultLangiumDocuments:()=>cqe,DefaultLangiumProfiler:()=>Epr,DefaultLexer:()=>gae,DefaultLexerErrorMessageProvider:()=>Mqe,DefaultLinker:()=>uqe,DefaultNameProvider:()=>hqe,DefaultReferenceDescriptionProvider:()=>Tqe,DefaultReferences:()=>dqe,DefaultScopeComputation:()=>fqe,DefaultScopeProvider:()=>mqe,DefaultServiceRegistry:()=>yqe,DefaultTokenBuilder:()=>XP,DefaultValueConverter:()=>nae,DefaultWorkspaceLock:()=>Hqe,DefaultWorkspaceManager:()=>Aqe,Deferred:()=>X0,Disposable:()=>DU,DisposableCache:()=>JP,DocumentCache:()=>gqe,DocumentState:()=>Ln,DocumentValidator:()=>Iu,EMPTY_SCOPE:()=>ypr,EMPTY_STREAM:()=>m4,EmptyFileSystem:()=>$o,EmptyFileSystemProvider:()=>jqe,ErrorWithLocation:()=>aP,GrammarAST:()=>l_e,GrammarUtils:()=>Tne,IndentationAwareLexer:()=>Cpr,IndentationAwareTokenBuilder:()=>qqe,JSDocDocumentationProvider:()=>Fqe,LangiumCompletionParser:()=>jWe,LangiumParser:()=>WWe,LangiumParserErrorMessageProvider:()=>Zie,LeafCstNodeImpl:()=>WN,LexingMode:()=>vU,MapScope:()=>Upr,Module:()=>qX,MultiMap:()=>K0,MultiMapScope:()=>pqe,OperationCancelled:()=>Od,ParserWorker:()=>Tpr,ProfilingTask:()=>Xqe,Reduction:()=>rC,RefResolving:()=>Lm,RegExpUtils:()=>kne,RootCstNodeImpl:()=>Xie,SimpleCache:()=>cae,StreamImpl:()=>Dd,StreamScope:()=>VX,TextDocument:()=>YN,TreeStreamImpl:()=>U4,URI:()=>Qc,UriTrie:()=>oae,UriUtils:()=>Pl,VALIDATE_EACH_NODE:()=>vqe,ValidationCategory:()=>ZN,ValidationRegistry:()=>bqe,ValueConverter:()=>Td,WorkspaceCache:()=>uae,assertCondition:()=>Cne,assertUnreachable:()=>B1,createCompletionParser:()=>eae,createDefaultCoreModule:()=>uo,createDefaultSharedCoreModule:()=>ho,createGrammarConfig:()=>Hne,createLangiumParser:()=>tae,createParser:()=>jP,delayNextTick:()=>KP,diagnosticData:()=>bU,eagerLoad:()=>wae,getDiagnosticRange:()=>dae,indentationBuilderDefaultOptions:()=>YX,inject:()=>Yn,interruptAndCheck:()=>Xs,isAstNode:()=>ls,isAstNodeDescription:()=>Wre,isAstNodeWithComment:()=>hae,isCompositeCstNode:()=>z0,isIMultiModeLexerDefinition:()=>rB,isJSDoc:()=>Uae,isLeafCstNode:()=>$5,isLinkingError:()=>Hm,isMultiReference:()=>Vd,isNamed:()=>lae,isOperationCancelled:()=>i2,isReference:()=>_l,isRootCstNode:()=>Z_,isTokenTypeArray:()=>tB,isTokenTypeDictionary:()=>JN,loadGrammarFromJson:()=>fo,parseJSDoc:()=>mae,prepareLangiumParser:()=>rae,setInterruptionPeriod:()=>iae,startCancelableOperation:()=>ZP,stream:()=>Ti,toDiagnosticData:()=>fae,toDiagnosticSeverity:()=>ww});var Gre={};P1(Gre,{DefaultNameRegexp:()=>yne,RangeComparison:()=>Ed,compareRange:()=>mne,findCommentNode:()=>bne,findDeclarationNodeAtOffset:()=>E_e,findLeafNodeAtOffset:()=>iP,findLeafNodeBeforeOffset:()=>vne,flattenCst:()=>S_e,getDatatypeNode:()=>k_e,getInteriorNodes:()=>R_e,getNextNode:()=>A_e,getPreviousNode:()=>wne,getStartlineNode:()=>M_e,inRange:()=>Une,isChildNode:()=>gne,isCommentNode:()=>MN,streamCst:()=>x4,toDocumentSegment:()=>w4,tokenToRange:()=>nC});function ls(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}M(ls,"isAstNode");function _l(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}M(_l,"isReference");function Vd(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}M(Vd,"isMultiReference");function Wre(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}M(Wre,"isAstNodeDescription");function Hm(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}M(Hm,"isLinkingError");var K6,qre=(K6=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 ls(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}}},M(K6,"AbstractAstReflection"),K6);function z0(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}M(z0,"isCompositeCstNode");function $5(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}M($5,"isLeafCstNode");function Z_(t){return z0(t)&&typeof t.fullText=="string"}M(Z_,"isRootCstNode");var dc,Dd=(dc=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:M(()=>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 dc(()=>({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 kl})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=s_e(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 dc(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?kl:{done:!1,value:e(i)}})}filter(e){return new dc(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return kl})}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 dc(()=>({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(tC(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return kl})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new dc(()=>({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(tC(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return kl})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new dc(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?kl:this.nextFn(r.state)))}distinct(e){return new dc(()=>({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 kl})}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)})}},M(dc,"StreamImpl"),dc);function s_e(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}M(s_e,"toString");function tC(t){return!!t&&typeof t[Symbol.iterator]=="function"}M(tC,"isIterable");var m4=new Dd(()=>{},()=>kl),kl=Object.freeze({done:!0,value:void 0});function Ti(...t){if(t.length===1){const e=t[0];if(e instanceof Dd)return e;if(tC(e))return new Dd(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new Dd(()=>({index:0}),r=>r.index1?new Dd(()=>({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 kl})}iterator(){const e={state:this.startFn(),next:M(()=>this.nextFn(e.state),"next"),prune:M(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},M(Z6,"TreeStreamImpl"),Z6),rC;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}M(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}M(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}M(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}M(i,"max"),t.max=i})(rC||(rC={}));var jre={};P1(jre,{assignMandatoryProperties:()=>Yre,copyAstNode:()=>gN,findRootNode:()=>T6,getContainerOfType:()=>F5,getDocument:()=>Oh,getReferenceNodes:()=>fN,hasContainerOfType:()=>o_e,linkContentToContainer:()=>y4,streamAllContents:()=>Up,streamAst:()=>_h,streamContents:()=>Ok,streamReferences:()=>b4});function y4(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{ls(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&y4(i,e))}):ls(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&y4(n,e)))}M(y4,"linkContentToContainer");function F5(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}M(F5,"getContainerOfType");function o_e(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}M(o_e,"hasContainerOfType");function Oh(t){const r=T6(t).$document;if(!r)throw new Error("AST node has no document.");return r}M(Oh,"getDocument");function T6(t){for(;t.$container;)t=t.$container;return t}M(T6,"findRootNode");function fN(t){return _l(t)?t.ref?[t.ref]:[]:Vd(t)?t.items.map(e=>e.ref):[]}M(fN,"getReferenceNodes");function Ok(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new Dd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexOk(r,e))}M(Up,"streamAllContents");function _h(t,e){if(t){if(e!=null&&e.range&&!pN(t,e.range))return new U4(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new U4(t,r=>Ok(r,e),{includeRoot:!0})}M(_h,"streamAst");function pN(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?Une(r,e):!1}M(pN,"isAstNodeInRange");function b4(t){return new Dd(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexoc,AbstractParserRule:()=>lw,AbstractRule:()=>Hy,AbstractType:()=>Pc,Action:()=>Kp,Alternatives:()=>cw,ArrayLiteral:()=>mN,ArrayType:()=>UN,Assignment:()=>Zp,BooleanLiteral:()=>yN,CharacterRange:()=>Jp,Condition:()=>Qp,Conjunction:()=>uw,CrossReference:()=>eg,Disjunction:()=>hw,EndOfFile:()=>bN,Grammar:()=>Wf,GrammarImport:()=>vN,Group:()=>Gm,InferredType:()=>xN,InfixRule:()=>Ud,InfixRuleOperatorList:()=>dw,InfixRuleOperators:()=>wN,Interface:()=>Gy,Keyword:()=>Wy,LangiumGrammarAstReflection:()=>pne,LangiumGrammarTerminals:()=>Znr,NamedArgument:()=>qy,NegatedToken:()=>Wm,Negation:()=>TN,NumberLiteral:()=>CN,Parameter:()=>jy,ParameterReference:()=>kN,ParserRule:()=>ah,ReferenceType:()=>fw,RegexToken:()=>qm,ReturnType:()=>SN,RuleCall:()=>jm,SimpleType:()=>Yy,StringLiteral:()=>EN,TerminalAlternatives:()=>Ym,TerminalElement:()=>lc,TerminalGroup:()=>Xm,TerminalRule:()=>qf,TerminalRuleCall:()=>Km,Type:()=>pw,TypeAttribute:()=>Zm,TypeDefinition:()=>Jm,UnionType:()=>AN,UnorderedGroup:()=>gw,UntilToken:()=>Qm,ValueLiteral:()=>eU,Wildcard:()=>Xy,isAbstractElement:()=>J_,isAbstractParserRule:()=>z5,isAbstractRule:()=>c_e,isAbstractType:()=>u_e,isAction:()=>c1,isAlternatives:()=>Q_,isArrayLiteral:()=>h_e,isArrayType:()=>Kre,isAssignment:()=>V0,isBooleanLiteral:()=>Zre,isCharacterRange:()=>Jre,isCondition:()=>d_e,isConjunction:()=>Qre,isCrossReference:()=>V5,isDisjunction:()=>ene,isEndOfFile:()=>tne,isGrammar:()=>f_e,isGrammarImport:()=>p_e,isGroup:()=>H5,isInferredType:()=>_k,isInfixRule:()=>v4,isInfixRuleOperatorList:()=>g_e,isInfixRuleOperators:()=>m_e,isInterface:()=>rne,isKeyword:()=>H0,isNamedArgument:()=>U_e,isNegatedToken:()=>nne,isNegation:()=>ine,isNumberLiteral:()=>y_e,isParameter:()=>b_e,isParameterReference:()=>ane,isParserRule:()=>Wl,isReferenceType:()=>sne,isRegexToken:()=>one,isReturnType:()=>lne,isRuleCall:()=>G0,isSimpleType:()=>eP,isStringLiteral:()=>v_e,isTerminalAlternatives:()=>cne,isTerminalElement:()=>x_e,isTerminalGroup:()=>une,isTerminalRule:()=>Zu,isTerminalRuleCall:()=>tP,isType:()=>rP,isTypeAttribute:()=>w_e,isTypeDefinition:()=>T_e,isUnionType:()=>hne,isUnorderedGroup:()=>nP,isUntilToken:()=>dne,isValueLiteral:()=>C_e,isWildcard:()=>fne,reflection:()=>qr});var Znr={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]*/},oc={$type:"AbstractElement",cardinality:"cardinality"};function J_(t){return qr.isInstance(t,oc.$type)}M(J_,"isAbstractElement");var lw={$type:"AbstractParserRule"};function z5(t){return qr.isInstance(t,lw.$type)}M(z5,"isAbstractParserRule");var Hy={$type:"AbstractRule"};function c_e(t){return qr.isInstance(t,Hy.$type)}M(c_e,"isAbstractRule");var Pc={$type:"AbstractType"};function u_e(t){return qr.isInstance(t,Pc.$type)}M(u_e,"isAbstractType");var Kp={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function c1(t){return qr.isInstance(t,Kp.$type)}M(c1,"isAction");var cw={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Q_(t){return qr.isInstance(t,cw.$type)}M(Q_,"isAlternatives");var mN={$type:"ArrayLiteral",elements:"elements"};function h_e(t){return qr.isInstance(t,mN.$type)}M(h_e,"isArrayLiteral");var UN={$type:"ArrayType",elementType:"elementType"};function Kre(t){return qr.isInstance(t,UN.$type)}M(Kre,"isArrayType");var Zp={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function V0(t){return qr.isInstance(t,Zp.$type)}M(V0,"isAssignment");var yN={$type:"BooleanLiteral",true:"true"};function Zre(t){return qr.isInstance(t,yN.$type)}M(Zre,"isBooleanLiteral");var Jp={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Jre(t){return qr.isInstance(t,Jp.$type)}M(Jre,"isCharacterRange");var Qp={$type:"Condition"};function d_e(t){return qr.isInstance(t,Qp.$type)}M(d_e,"isCondition");var uw={$type:"Conjunction",left:"left",right:"right"};function Qre(t){return qr.isInstance(t,uw.$type)}M(Qre,"isConjunction");var eg={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function V5(t){return qr.isInstance(t,eg.$type)}M(V5,"isCrossReference");var hw={$type:"Disjunction",left:"left",right:"right"};function ene(t){return qr.isInstance(t,hw.$type)}M(ene,"isDisjunction");var bN={$type:"EndOfFile",cardinality:"cardinality"};function tne(t){return qr.isInstance(t,bN.$type)}M(tne,"isEndOfFile");var Wf={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function f_e(t){return qr.isInstance(t,Wf.$type)}M(f_e,"isGrammar");var vN={$type:"GrammarImport",path:"path"};function p_e(t){return qr.isInstance(t,vN.$type)}M(p_e,"isGrammarImport");var Gm={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function H5(t){return qr.isInstance(t,Gm.$type)}M(H5,"isGroup");var xN={$type:"InferredType",name:"name"};function _k(t){return qr.isInstance(t,xN.$type)}M(_k,"isInferredType");var Ud={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function v4(t){return qr.isInstance(t,Ud.$type)}M(v4,"isInfixRule");var dw={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function g_e(t){return qr.isInstance(t,dw.$type)}M(g_e,"isInfixRuleOperatorList");var wN={$type:"InfixRuleOperators",precedences:"precedences"};function m_e(t){return qr.isInstance(t,wN.$type)}M(m_e,"isInfixRuleOperators");var Gy={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function rne(t){return qr.isInstance(t,Gy.$type)}M(rne,"isInterface");var Wy={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function H0(t){return qr.isInstance(t,Wy.$type)}M(H0,"isKeyword");var qy={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function U_e(t){return qr.isInstance(t,qy.$type)}M(U_e,"isNamedArgument");var Wm={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function nne(t){return qr.isInstance(t,Wm.$type)}M(nne,"isNegatedToken");var TN={$type:"Negation",value:"value"};function ine(t){return qr.isInstance(t,TN.$type)}M(ine,"isNegation");var CN={$type:"NumberLiteral",value:"value"};function y_e(t){return qr.isInstance(t,CN.$type)}M(y_e,"isNumberLiteral");var jy={$type:"Parameter",name:"name"};function b_e(t){return qr.isInstance(t,jy.$type)}M(b_e,"isParameter");var kN={$type:"ParameterReference",parameter:"parameter"};function ane(t){return qr.isInstance(t,kN.$type)}M(ane,"isParameterReference");var ah={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Wl(t){return qr.isInstance(t,ah.$type)}M(Wl,"isParserRule");var fw={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function sne(t){return qr.isInstance(t,fw.$type)}M(sne,"isReferenceType");var qm={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function one(t){return qr.isInstance(t,qm.$type)}M(one,"isRegexToken");var SN={$type:"ReturnType",name:"name"};function lne(t){return qr.isInstance(t,SN.$type)}M(lne,"isReturnType");var jm={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function G0(t){return qr.isInstance(t,jm.$type)}M(G0,"isRuleCall");var Yy={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function eP(t){return qr.isInstance(t,Yy.$type)}M(eP,"isSimpleType");var EN={$type:"StringLiteral",value:"value"};function v_e(t){return qr.isInstance(t,EN.$type)}M(v_e,"isStringLiteral");var Ym={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function cne(t){return qr.isInstance(t,Ym.$type)}M(cne,"isTerminalAlternatives");var lc={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function x_e(t){return qr.isInstance(t,lc.$type)}M(x_e,"isTerminalElement");var Xm={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function une(t){return qr.isInstance(t,Xm.$type)}M(une,"isTerminalGroup");var qf={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Zu(t){return qr.isInstance(t,qf.$type)}M(Zu,"isTerminalRule");var Km={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function tP(t){return qr.isInstance(t,Km.$type)}M(tP,"isTerminalRuleCall");var pw={$type:"Type",name:"name",type:"type"};function rP(t){return qr.isInstance(t,pw.$type)}M(rP,"isType");var Zm={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function w_e(t){return qr.isInstance(t,Zm.$type)}M(w_e,"isTypeAttribute");var Jm={$type:"TypeDefinition"};function T_e(t){return qr.isInstance(t,Jm.$type)}M(T_e,"isTypeDefinition");var AN={$type:"UnionType",types:"types"};function hne(t){return qr.isInstance(t,AN.$type)}M(hne,"isUnionType");var gw={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function nP(t){return qr.isInstance(t,gw.$type)}M(nP,"isUnorderedGroup");var Qm={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function dne(t){return qr.isInstance(t,Qm.$type)}M(dne,"isUntilToken");var eU={$type:"ValueLiteral"};function C_e(t){return qr.isInstance(t,eU.$type)}M(C_e,"isValueLiteral");var Xy={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function fne(t){return qr.isInstance(t,Xy.$type)}M(fne,"isWildcard");var J6,pne=(J6=class extends qre{constructor(){super(...arguments),this.types={AbstractElement:{name:oc.$type,properties:{cardinality:{name:oc.cardinality}},superTypes:[]},AbstractParserRule:{name:lw.$type,properties:{},superTypes:[Hy.$type,Pc.$type]},AbstractRule:{name:Hy.$type,properties:{},superTypes:[]},AbstractType:{name:Pc.$type,properties:{},superTypes:[]},Action:{name:Kp.$type,properties:{cardinality:{name:Kp.cardinality},feature:{name:Kp.feature},inferredType:{name:Kp.inferredType},operator:{name:Kp.operator},type:{name:Kp.type,referenceType:Pc.$type}},superTypes:[oc.$type]},Alternatives:{name:cw.$type,properties:{cardinality:{name:cw.cardinality},elements:{name:cw.elements,defaultValue:[]}},superTypes:[oc.$type]},ArrayLiteral:{name:mN.$type,properties:{elements:{name:mN.elements,defaultValue:[]}},superTypes:[eU.$type]},ArrayType:{name:UN.$type,properties:{elementType:{name:UN.elementType}},superTypes:[Jm.$type]},Assignment:{name:Zp.$type,properties:{cardinality:{name:Zp.cardinality},feature:{name:Zp.feature},operator:{name:Zp.operator},predicate:{name:Zp.predicate},terminal:{name:Zp.terminal}},superTypes:[oc.$type]},BooleanLiteral:{name:yN.$type,properties:{true:{name:yN.true,defaultValue:!1}},superTypes:[Qp.$type,eU.$type]},CharacterRange:{name:Jp.$type,properties:{cardinality:{name:Jp.cardinality},left:{name:Jp.left},lookahead:{name:Jp.lookahead},parenthesized:{name:Jp.parenthesized,defaultValue:!1},right:{name:Jp.right}},superTypes:[lc.$type]},Condition:{name:Qp.$type,properties:{},superTypes:[]},Conjunction:{name:uw.$type,properties:{left:{name:uw.left},right:{name:uw.right}},superTypes:[Qp.$type]},CrossReference:{name:eg.$type,properties:{cardinality:{name:eg.cardinality},deprecatedSyntax:{name:eg.deprecatedSyntax,defaultValue:!1},isMulti:{name:eg.isMulti,defaultValue:!1},terminal:{name:eg.terminal},type:{name:eg.type,referenceType:Pc.$type}},superTypes:[oc.$type]},Disjunction:{name:hw.$type,properties:{left:{name:hw.left},right:{name:hw.right}},superTypes:[Qp.$type]},EndOfFile:{name:bN.$type,properties:{cardinality:{name:bN.cardinality}},superTypes:[oc.$type]},Grammar:{name:Wf.$type,properties:{imports:{name:Wf.imports,defaultValue:[]},interfaces:{name:Wf.interfaces,defaultValue:[]},isDeclared:{name:Wf.isDeclared,defaultValue:!1},name:{name:Wf.name},rules:{name:Wf.rules,defaultValue:[]},types:{name:Wf.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:vN.$type,properties:{path:{name:vN.path}},superTypes:[]},Group:{name:Gm.$type,properties:{cardinality:{name:Gm.cardinality},elements:{name:Gm.elements,defaultValue:[]},guardCondition:{name:Gm.guardCondition},predicate:{name:Gm.predicate}},superTypes:[oc.$type]},InferredType:{name:xN.$type,properties:{name:{name:xN.name}},superTypes:[Pc.$type]},InfixRule:{name:Ud.$type,properties:{call:{name:Ud.call},dataType:{name:Ud.dataType},inferredType:{name:Ud.inferredType},name:{name:Ud.name},operators:{name:Ud.operators},parameters:{name:Ud.parameters,defaultValue:[]},returnType:{name:Ud.returnType,referenceType:Pc.$type}},superTypes:[lw.$type]},InfixRuleOperatorList:{name:dw.$type,properties:{associativity:{name:dw.associativity},operators:{name:dw.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:wN.$type,properties:{precedences:{name:wN.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Gy.$type,properties:{attributes:{name:Gy.attributes,defaultValue:[]},name:{name:Gy.name},superTypes:{name:Gy.superTypes,defaultValue:[],referenceType:Pc.$type}},superTypes:[Pc.$type]},Keyword:{name:Wy.$type,properties:{cardinality:{name:Wy.cardinality},predicate:{name:Wy.predicate},value:{name:Wy.value}},superTypes:[oc.$type]},NamedArgument:{name:qy.$type,properties:{calledByName:{name:qy.calledByName,defaultValue:!1},parameter:{name:qy.parameter,referenceType:jy.$type},value:{name:qy.value}},superTypes:[]},NegatedToken:{name:Wm.$type,properties:{cardinality:{name:Wm.cardinality},lookahead:{name:Wm.lookahead},parenthesized:{name:Wm.parenthesized,defaultValue:!1},terminal:{name:Wm.terminal}},superTypes:[lc.$type]},Negation:{name:TN.$type,properties:{value:{name:TN.value}},superTypes:[Qp.$type]},NumberLiteral:{name:CN.$type,properties:{value:{name:CN.value}},superTypes:[eU.$type]},Parameter:{name:jy.$type,properties:{name:{name:jy.name}},superTypes:[]},ParameterReference:{name:kN.$type,properties:{parameter:{name:kN.parameter,referenceType:jy.$type}},superTypes:[Qp.$type]},ParserRule:{name:ah.$type,properties:{dataType:{name:ah.dataType},definition:{name:ah.definition},entry:{name:ah.entry,defaultValue:!1},fragment:{name:ah.fragment,defaultValue:!1},inferredType:{name:ah.inferredType},name:{name:ah.name},parameters:{name:ah.parameters,defaultValue:[]},returnType:{name:ah.returnType,referenceType:Pc.$type}},superTypes:[lw.$type]},ReferenceType:{name:fw.$type,properties:{isMulti:{name:fw.isMulti,defaultValue:!1},referenceType:{name:fw.referenceType}},superTypes:[Jm.$type]},RegexToken:{name:qm.$type,properties:{cardinality:{name:qm.cardinality},lookahead:{name:qm.lookahead},parenthesized:{name:qm.parenthesized,defaultValue:!1},regex:{name:qm.regex}},superTypes:[lc.$type]},ReturnType:{name:SN.$type,properties:{name:{name:SN.name}},superTypes:[]},RuleCall:{name:jm.$type,properties:{arguments:{name:jm.arguments,defaultValue:[]},cardinality:{name:jm.cardinality},predicate:{name:jm.predicate},rule:{name:jm.rule,referenceType:Hy.$type}},superTypes:[oc.$type]},SimpleType:{name:Yy.$type,properties:{primitiveType:{name:Yy.primitiveType},stringType:{name:Yy.stringType},typeRef:{name:Yy.typeRef,referenceType:Pc.$type}},superTypes:[Jm.$type]},StringLiteral:{name:EN.$type,properties:{value:{name:EN.value}},superTypes:[eU.$type]},TerminalAlternatives:{name:Ym.$type,properties:{cardinality:{name:Ym.cardinality},elements:{name:Ym.elements,defaultValue:[]},lookahead:{name:Ym.lookahead},parenthesized:{name:Ym.parenthesized,defaultValue:!1}},superTypes:[lc.$type]},TerminalElement:{name:lc.$type,properties:{cardinality:{name:lc.cardinality},lookahead:{name:lc.lookahead},parenthesized:{name:lc.parenthesized,defaultValue:!1}},superTypes:[oc.$type]},TerminalGroup:{name:Xm.$type,properties:{cardinality:{name:Xm.cardinality},elements:{name:Xm.elements,defaultValue:[]},lookahead:{name:Xm.lookahead},parenthesized:{name:Xm.parenthesized,defaultValue:!1}},superTypes:[lc.$type]},TerminalRule:{name:qf.$type,properties:{definition:{name:qf.definition},fragment:{name:qf.fragment,defaultValue:!1},hidden:{name:qf.hidden,defaultValue:!1},name:{name:qf.name},type:{name:qf.type}},superTypes:[Hy.$type]},TerminalRuleCall:{name:Km.$type,properties:{cardinality:{name:Km.cardinality},lookahead:{name:Km.lookahead},parenthesized:{name:Km.parenthesized,defaultValue:!1},rule:{name:Km.rule,referenceType:qf.$type}},superTypes:[lc.$type]},Type:{name:pw.$type,properties:{name:{name:pw.name},type:{name:pw.type}},superTypes:[Pc.$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:Jm.$type,properties:{},superTypes:[]},UnionType:{name:AN.$type,properties:{types:{name:AN.types,defaultValue:[]}},superTypes:[Jm.$type]},UnorderedGroup:{name:gw.$type,properties:{cardinality:{name:gw.cardinality},elements:{name:gw.elements,defaultValue:[]}},superTypes:[oc.$type]},UntilToken:{name:Qm.$type,properties:{cardinality:{name:Qm.cardinality},lookahead:{name:Qm.lookahead},parenthesized:{name:Qm.parenthesized,defaultValue:!1},terminal:{name:Qm.terminal}},superTypes:[lc.$type]},ValueLiteral:{name:eU.$type,properties:{},superTypes:[]},Wildcard:{name:Xy.$type,properties:{cardinality:{name:Xy.cardinality},lookahead:{name:Xy.lookahead},parenthesized:{name:Xy.parenthesized,defaultValue:!1}},superTypes:[lc.$type]}}}},M(J6,"LangiumGrammarAstReflection"),J6),qr=new pne;function k_e(t){let e=t,r=!1;for(;e;){const n=F5(e.grammarSource,Wl);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}M(k_e,"getDatatypeNode");function x4(t){return new U4(t,e=>z0(e)?e.content:[],{includeRoot:!0})}M(x4,"streamCst");function S_e(t){return x4(t).filter($5)}M(S_e,"flattenCst");function gne(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}M(gne,"isChildNode");function nC(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}M(nC,"tokenToRange");function w4(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}M(w4,"toDocumentSegment");var Ed;(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"})(Ed||(Ed={}));function mne(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ed.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.lineEd.After}M(Une,"inRange");var yne=/^[\w\p{L}]$/u;function E_e(t,e,r=yne){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return iP(t,e)}}M(E_e,"findDeclarationNodeAtOffset");function bne(t,e){if(t){const r=wne(t,!0);if(r&&MN(r,e))return r;if(Z_(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(MN(a,e))return a}}}}M(bne,"findCommentNode");function MN(t,e){return $5(t)&&e.includes(t.tokenType.name)}M(MN,"isCommentNode");function iP(t,e){if($5(t))return t;if(z0(t)){const r=xne(t,e,!1);if(r)return iP(r,e)}}M(iP,"findLeafNodeAtOffset");function vne(t,e){if($5(t))return t;if(z0(t)){const r=xne(t,e,!0);if(r)return vne(r,e)}}M(vne,"findLeafNodeBeforeOffset");function xne(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}M(xne,"binarySearch");function wne(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}}M(wne,"getPreviousNode");function A_e(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;n_ne,findNameAssignment:()=>dP,findNodeForKeyword:()=>One,findNodeForProperty:()=>cP,findNodesForKeyword:()=>$_e,findNodesForKeywordInternal:()=>hP,findNodesForProperty:()=>Dne,getActionAtElement:()=>Bne,getActionType:()=>Fne,getAllReachableRules:()=>lP,getAllRulesUsedForCrossReferences:()=>B_e,getCrossReferenceTerminal:()=>Ine,getEntryRule:()=>Mne,getExplicitRuleType:()=>Bk,getHiddenRules:()=>Rne,getRuleType:()=>zne,getRuleTypeName:()=>G_e,getTypeName:()=>f5,isArrayCardinality:()=>z_e,isArrayOperator:()=>V_e,isCommentTerminal:()=>Nne,isDataType:()=>H_e,isDataTypeRule:()=>Pk,isOptionalCardinality:()=>F_e,terminalRegex:()=>$k});var Q6,aP=(Q6=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},M(Q6,"ErrorWithLocation"),Q6);function B1(t,e="Error: Got unexpected value."){throw new Error(e)}M(B1,"assertUnreachable");function Cne(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}M(Cne,"assertCondition");var kne={};P1(kne,{NEWLINE_REGEXP:()=>D_e,escapeRegExp:()=>v9,getTerminalParts:()=>__e,isMultilineComment:()=>Sne,isWhitespace:()=>oP,partialMatches:()=>Ene,partialRegExp:()=>Ane,whitespaceCharacters:()=>P_e});function Qr(t){return t.charCodeAt(0)}M(Qr,"cc");function NM(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}M(NM,"insertToSet");function hy(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}M(hy,"addFlag");function Am(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}M(Am,"ASSERT_EXISTS");function I_e(){throw Error("Internal Error - Should never get here!")}M(I_e,"ASSERT_NEVER_REACH_HERE");function pX(t){return t.type==="Character"}M(pX,"isCharacter");var RN=[];for(let t=Qr("0");t<=Qr("9");t++)RN.push(t);var LN=[Qr("_")].concat(RN);for(let t=Qr("a");t<=Qr("z");t++)LN.push(t);for(let t=Qr("A");t<=Qr("Z");t++)LN.push(t);var eUe=[Qr(" "),Qr("\f"),Qr(` +`),Qr("\r"),Qr(" "),Qr("\v"),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr(" "),Qr("\u2028"),Qr("\u2029"),Qr(" "),Qr(" "),Qr(" "),Qr("\uFEFF")],Jnr=/[0-9a-fA-F]/,jE=/[0-9]/,Qnr=/[1-9]/,eb,N_e=(eb=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":hy(n,"global");break;case"i":hy(n,"ignoreCase");break;case"m":hy(n,"multiLine");break;case"u":hy(n,"unicode");break;case"y":hy(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}}Am(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return I_e()}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;Am(r);break}if(!(e===!0&&r===void 0)&&Am(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()),Am(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Qr(` +`),Qr("\r"),Qr("\u2028"),Qr("\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=RN;break;case"D":e=RN,r=!0;break;case"s":e=eUe;break;case"S":e=eUe,r=!0;break;case"w":e=LN;break;case"W":e=LN,r=!0;break}if(Am(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Qr("\f");break;case"n":e=Qr(` +`);break;case"r":e=Qr("\r");break;case"t":e=Qr(" ");break;case"v":e=Qr("\v");break}if(Am(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:Qr("\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:Qr(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:Qr(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,pX(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,pX(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},_(Kx,"RegExpParser"),Kx),Zx,n$=(Zx=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){}},_(Zx,"BaseRegExpVisitor"),Zx),wPe=/\r?\n/gm,TPe=new xPe,Qx,Lnr=(Qx=class extends n${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=yC(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)}},_(Qx,"TerminalRegExpVisitor"),Qx),py=new Lnr;function CPe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=TPe.pattern(t),r=[];for(const n of e.value.value)py.reset(t),py.visit(n),r.push({start:py.startRegexp,end:py.endRegex});return r}catch{return[]}}_(CPe,"getTerminalParts");function vne(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),py.reset(t),py.visit(TPe.pattern(t)),py.multiline}catch{return!1}}_(vne,"isMultilineComment");var kPe=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function i$(t){const e=typeof t=="string"?new RegExp(t):t;return kPe.some(r=>e.test(r))}_(i$,"isWhitespace");function yC(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_(yC,"escapeRegExp");function bne(t,e){const r=xne(t),n=e.match(r);return!!n&&n[0].length>0}_(bne,"partialMatches");function xne(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let s="",a;function o(u){s+=r.substr(n,u),n+=u}_(o,"appendRaw");function l(u){s+="(?:"+r.substr(n,u)+"|$)",n+=u}for(_(l,"appendOptional");n",n)-n+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=n,a=a.exec(r)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=n,a=a.exec(r),a?o(a[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=i()+"|$)";break;case"=":s+="(?=",n+=3,s+=i()+")";break;case"!":a=n,n+=3,i(),s+=r.substr(a,n-a);break;case"<":switch(r[n+3]){case"=":case"!":a=n,n+=4,i(),s+=r.substr(a,n-a);break;default:o(r.indexOf(">",n)-n+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++n,s;default:l(1);break}return s}return _(i,"process"),new RegExp(i(),t.flags)}_(xne,"partialRegExp");function wne(t){return t.rules.find(e=>ql(e)&&e.entry)}_(wne,"getEntryRule");function Tne(t){return t.rules.filter(e=>Zu(e)&&e.hidden)}_(Tne,"getHiddenRules");function s$(t,e){const r=new Set,n=wne(t);if(!n)return new Set(t.rules);const i=[n].concat(Tne(t));for(const a of i)Cne(a,r,e);const s=new Set;for(const a of t.rules)(r.has(a.name)||Zu(a)&&a.hidden)&&s.add(a);return s}_(s$,"getAllReachableRules");function Cne(t,e,r){e.add(t.name),mp(t).forEach(n=>{if(G0(n)||r&&QP(n)){const i=n.rule.ref;i&&!e.has(i.name)&&Cne(i,e,r)}})}_(Cne,"ruleDfs");function SPe(t){const e=new Set;return mp(t).forEach(r=>{Fv(r)&&(ql(r.type.ref)&&e.add(r.type.ref),N7(r.type.ref)&&ql(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}_(SPe,"getAllRulesUsedForCrossReferences");function kne(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=c$(t.type.ref);return e==null?void 0:e.terminal}}_(kne,"getCrossReferenceTerminal");function Sne(t){return t.hidden&&!i$(P7(t))}_(Sne,"isCommentTerminal");function Ene(t,e){return!t||!e?[]:o$(t,e,t.astNode,!0)}_(Ene,"findNodesForProperty");function a$(t,e,r){if(!t||!e)return;const n=o$(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}_(a$,"findNodeForProperty");function o$(t,e,r,n){if(!n){const i=$v(t.grammarSource,V0);if(i&&i.feature===e)return[t]}return z0(t)&&t.astNode===r?t.content.flatMap(i=>o$(i,e,r,!1)):[]}_(o$,"findNodesForPropertyInternal");function EPe(t,e){return t?l$(t,e,t==null?void 0:t.astNode):[]}_(EPe,"findNodesForKeyword");function Ane(t,e,r){if(!t)return;const n=l$(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]}_(Ane,"findNodeForKeyword");function l$(t,e,r){if(t.astNode!==r)return[];if(H0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=v3(t).iterator();let i;const s=[];do if(i=n.next(),!i.done){const a=i.value;a.astNode===r?H0(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):n.prune()}while(!i.done);return s}_(l$,"findNodesForKeywordInternal");function Mne(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=$v(t.grammarSource,V0);if(n)return n;t=t.container}}_(Mne,"findAssignment");function c$(t){let e=t;return N7(e)&&(om(e.$container)?e=e.$container.$container:Bv(e.$container)?e=e.$container:Pm(e.$container)),Rne(t,e,new Map)}_(c$,"findNameAssignment");function Rne(t,e,r){var i;function n(s,a){let o;return $v(s,V0)||(o=Rne(a,a,r)),r.set(t,o),o}if(_(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const s of mp(e)){if(V0(s)&&s.feature.toLowerCase()==="name")return r.set(t,s),s;if(G0(s)&&ql(s.rule.ref))return n(s,s.rule.ref);if(ZP(s)&&((i=s.typeRef)!=null&&i.ref))return n(s,s.typeRef.ref)}}_(Rne,"findNameAssignmentInternal");function _ne(t){const e=t.$container;if(zv(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const s=r[i];if(om(s))return s;{const a=mp(r[i]).find(om);if(a)return a}}}if(XP(e))return _ne(e)}_(_ne,"getActionAtElement");function APe(t,e){return t==="?"||t==="*"||zv(e)&&!!e.guardCondition}_(APe,"isOptionalCardinality");function MPe(t){return t==="*"||t==="+"}_(MPe,"isArrayCardinality");function RPe(t){return t==="+="}_(RPe,"isArrayOperator");function O7(t){return Lne(t,new Set)}_(O7,"isDataTypeRule");function Lne(t,e){if(e.has(t))return!0;e.add(t);for(const r of mp(t))if(G0(r)){if(!r.rule.ref||ql(r.rule.ref)&&!Lne(r.rule.ref,e)||y3(r.rule.ref))return!1}else{if(V0(r))return!1;if(om(r))return!1}return!!t.definition}_(Lne,"isDataTypeRuleInternal");function _Pe(t){return RN(t.type,new Set)}_(_Pe,"isDataType");function RN(t,e){if(e.has(t))return!0;if(e.add(t),Hre(t))return!1;if(Qre(t))return!1;if(nne(t))return t.types.every(r=>RN(r,e));if(ZP(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 JP(r)?RN(r.type,e):!1}else return!1}else return!1}_(RN,"isDataTypeInternal");function D7(t){if(!Zu(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}}}_(D7,"getExplicitRuleType");function uv(t){if(Bv(t))return ql(t)&&O7(t)?t.name:D7(t)??t.name;if(Yre(t)||JP(t)||ene(t))return t.name;if(om(t)){const e=Ine(t);if(e)return e}else if(N7(t))return t.name;throw new Error("Cannot get name of Unknown Type")}_(uv,"getTypeName");function Ine(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return uv(t.type.ref)}_(Ine,"getActionType");function LPe(t){var e;return Zu(t)?((e=t.type)==null?void 0:e.name)??"string":ql(t)&&O7(t)?t.name:D7(t)??t.name}_(LPe,"getRuleTypeName");function Nne(t){var e;return Zu(t)?((e=t.type)==null?void 0:e.name)??"string":D7(t)??t.name}_(Nne,"getRuleType");function P7(t){const e={s:!1,i:!1,u:!1},r=Vv(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}_(P7,"terminalRegex");var One=/[\s\S]/.source;function Vv(t,e){var r;if(tne(t))return IPe(t);if(rne(t))return NPe(t);if(Wre(t))return PPe(t);if(QP(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Hd(Vv(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Xre(t))return DPe(t);if(ine(t))return OPe(t);if(Jre(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),s=t.regex.substring(n+1);return e&&(e.i=s.includes("i"),e.s=s.includes("s"),e.u=s.includes("u")),Hd(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(sne(t))return Hd(One,{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}`)}}}_(Vv,"abstractElementToRegex");function IPe(t){return Hd(t.elements.map(e=>Vv(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}_(IPe,"terminalAlternativesToRegex");function NPe(t){return Hd(t.elements.map(e=>Vv(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}_(NPe,"terminalGroupToRegex");function OPe(t){return Hd(`${One}*?${Vv(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}_(OPe,"untilTokenToRegex");function DPe(t){return Hd(`(?!${Vv(t.terminal)})${One}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}_(DPe,"negateTokenToRegex");function PPe(t){return t.right?Hd(`[${L9(t.left)}-${L9(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Hd(L9(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}_(PPe,"characterRangeToRegex");function L9(t){return yC(t.value)}_(L9,"keywordToRegex");function Hd(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}_(Hd,"withCardinality");function Dne(t){const e=[],r=t.Grammar;for(const n of r.rules)Zu(n)&&Sne(n)&&vne(P7(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:une}}_(Dne,"createGrammarConfig");var Inr=typeof global=="object"&&global&&global.Object===Object&&global,$Pe=Inr,Nnr=typeof self=="object"&&self&&self.Object===Object&&self,Onr=$Pe||Nnr||Function("return this")(),yf=Onr,Dnr=yf.Symbol,ju=Dnr,BPe=Object.prototype,Pnr=BPe.hasOwnProperty,$nr=BPe.toString,ck=ju?ju.toStringTag:void 0;function FPe(t){var e=Pnr.call(t,ck),r=t[ck];try{t[ck]=void 0;var n=!0}catch{}var i=$nr.call(t);return n&&(e?t[ck]=r:delete t[ck]),i}_(FPe,"getRawTag");var Bnr=FPe,Fnr=Object.prototype,znr=Fnr.toString;function zPe(t){return znr.call(t)}_(zPe,"objectToString");var Vnr=zPe,Hnr="[object Null]",Gnr="[object Undefined]",q1e=ju?ju.toStringTag:void 0;function VPe(t){return t==null?t===void 0?Gnr:Hnr:q1e&&q1e in Object(t)?Bnr(t):Vnr(t)}_(VPe,"baseGetTag");var $m=VPe;function HPe(t){return t!=null&&typeof t=="object"}_(HPe,"isObjectLike");var qh=HPe,Wnr="[object Symbol]";function GPe(t){return typeof t=="symbol"||qh(t)&&$m(t)==Wnr}_(GPe,"isSymbol");var u$=GPe;function WPe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=Eir)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}_(o$e,"shortOut");var Rir=o$e;function l$e(t){return function(){return t}}_(l$e,"constant");var _ir=l$e,Lir=(function(){try{var t=Gv(Object,"defineProperty");return t({},"",{}),t}catch{}})(),_N=Lir,Iir=_N?function(t,e){return _N(t,"toString",{configurable:!0,enumerable:!1,value:_ir(e),writable:!0})}:F7,Nir=Iir,Oir=Rir(Nir),Dir=Oir;function c$e(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}_(m$e,"arrayIncludes");var y$e=m$e,Bir=9007199254740991,Fir=/^(?:0|[1-9]\d*)$/;function v$e(t,e){var r=typeof t;return e=e??Bir,!!e&&(r=="number"||r!="symbol"&&Fir.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Gir}_(S$e,"isLength");var zne=S$e;function E$e(t){return t!=null&&zne(t.length)&&!yp(t)}_(E$e,"isArrayLike");var vf=E$e;function A$e(t,e,r){if(!Yu(r))return!1;var n=typeof e;return(n=="number"?vf(r)&&h$(e,r.length):n=="string"&&e in r)?z7(r[e],t):!1}_(A$e,"isIterateeCall");var f$=A$e;function M$e(t){return Fne(function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&f$(r[0],r[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++n-1}_(iBe,"listCacheHas");var oar=iBe;function sBe(t,e){var r=this.__data__,n=m$(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}_(sBe,"listCacheSet");var lar=sBe;function qv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?qne(o,e-1,r,n,i):Wne(i,o):n||(i[i.length]=o)}return i}_(qne,"baseFlatten");var Une=qne;function wBe(t){var e=t==null?0:t.length;return e?Une(t,1):[]}_(wBe,"flatten");var $h=wBe,Mar=V$e(Object.getPrototypeOf,Object),TBe=Mar;function CBe(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 s=Array(i);++no))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&blr?new Kne:void 0;for(s.set(t,e),s.set(e,t);++d2?e[2]:void 0;for(i&&f$(e[0],e[1],i)&&(n=1);++r=dcr&&(s=Zne,a=!1,e=new Kne(e));e:for(;++i-1?i[s?e[a]:a]:void 0}}_(ize,"createFind");var vcr=ize,bcr=Math.max;function sze(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:B7(r);return i<0&&(i=bcr(n+i,0)),d$e(t,bf(e),i)}_(sze,"findIndex");var xcr=sze,wcr=vcr(xcr),w3=wcr;function aze(t){return t&&t.length?t[0]:void 0}_(aze,"head");var Uh=aze;function oze(t,e){var r=-1,n=vf(t)?Array(t.length):[];return Yv(t,function(i,s,a){n[++r]=e(i,s,a)}),n}_(oze,"baseMap");var Tcr=oze;function lze(t,e){var r=ei(t)?$7:Tcr;return r(t,bf(e))}_(lze,"map");var _r=lze;function cze(t,e){return Une(_r(t,e),1)}_(cze,"flatMap");var Vu=cze,Ccr=Object.prototype,kcr=Ccr.hasOwnProperty,Scr=ccr(function(t,e,r){kcr.call(t,r)?t[r].push(e):Bne(t,r,[e])}),Ecr=Scr,Acr=Object.prototype,Mcr=Acr.hasOwnProperty;function uze(t,e){return t!=null&&Mcr.call(t,e)}_(uze,"baseHas");var Rcr=uze;function hze(t,e){return t!=null&&RFe(t,e,Rcr)}_(hze,"has");var Xr=hze,_cr="[object String]";function dze(t){return typeof t=="string"||!ei(t)&&qh(t)&&$m(t)==_cr}_(dze,"isString");var Ec=dze;function fze(t,e){return $7(e,function(r){return t[r]})}_(fze,"baseValues");var Lcr=fze;function pze(t){return t==null?[]:Lcr(t,nu(t))}_(pze,"values");var Aa=pze,Icr=Math.max;function gze(t,e,r,n){t=vf(t)?t:Aa(t),r=r&&!n?B7(r):0;var i=t.length;return r<0&&(r=Icr(i+r,0)),Ec(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&$ne(t,e,r)>-1}_(gze,"includes");var tc=gze,Ncr=Math.max;function mze(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:B7(r);return i<0&&(i=Ncr(n+i,0)),$ne(t,e,i)}_(mze,"indexOf");var Cye=mze,Ocr="[object Map]",Dcr="[object Set]",Pcr=Object.prototype,$cr=Pcr.hasOwnProperty;function yze(t){if(t==null)return!0;if(vf(t)&&(ei(t)||typeof t=="string"||typeof t.splice=="function"||tA(t)||Vne(t)||p$(t)))return!t.length;var e=x3(t);if(e==Ocr||e==Dcr)return!t.size;if(H7(t))return!G$e(t).length;for(var r in t)if($cr.call(t,r))return!1;return!0}_(yze,"isEmpty");var Gi=yze,Bcr="[object RegExp]";function vze(t){return qh(t)&&$m(t)==Bcr}_(vze,"baseIsRegExp");var Fcr=vze,kye=lm&&lm.isRegExp,zcr=kye?G7(kye):Fcr,W0=zcr;function bze(t){return t===void 0}_(bze,"isUndefined");var q0=bze,Vcr="Expected a function";function xze(t){if(typeof t!="function")throw new TypeError(Vcr);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)}}_(xze,"negate");var Hcr=xze;function wze(t,e,r,n){if(!Yu(t))return t;e=w$(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i=Kcr){var u=e?null:Xcr(t);if(u)return Qne(u);a=!1,i=Zne,l=new Kne}else l=e?[]:o;e:for(;++n{r.accept(e)})}},_(Jx,"AbstractProduction"),Jx),ew,Ul=(ew=class extends xf{constructor(e){super([]),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},_(ew,"NonTerminal"),ew),tw,vC=(tw=class extends xf{constructor(e){super(e.definition),this.orgText="",iu(this,Jh(e,r=>r!==void 0))}},_(tw,"Rule"),tw),rw,Ac=(rw=class extends xf{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,iu(this,Jh(e,r=>r!==void 0))}},_(rw,"Alternative"),rw),nw,Oo=(nw=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}},_(nw,"Option"),nw),iw,hu=(iw=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}},_(iw,"RepetitionMandatory"),iw),sw,du=(sw=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}},_(sw,"RepetitionMandatoryWithSeparator"),sw),aw,Vs=(aw=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}},_(aw,"Repetition"),aw),ow,_c=(ow=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Jh(e,r=>r!==void 0))}},_(ow,"RepetitionWithSeparator"),ow),lw,Lc=(lw=class extends xf{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,iu(this,Jh(e,r=>r!==void 0))}},_(lw,"Alternation"),lw),cw,Ji=(cw=class{constructor(e){this.idx=1,iu(this,Jh(e,r=>r!==void 0))}accept(e){e.visit(this)}},_(cw,"Terminal"),cw);function Oze(t){return _r(t,gE)}_(Oze,"serializeGrammar");function gE(t){function e(r){return _r(r,gE)}if(_(e,"convertDefinition"),t instanceof Ul){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Ec(t.label)&&(r.label=t.label),r}else{if(t instanceof Ac)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Oo)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof hu)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof du)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:gE(new Ji({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _c)return{type:"RepetitionWithSeparator",idx:t.idx,separator:gE(new Ji({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Vs)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Lc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ji){const r={type:"Terminal",name:t.terminalType.name,label:Ize(t.terminalType),idx:t.idx};Ec(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=W0(n)?n.source:n),r}else{if(t instanceof vC)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}_(gE,"serializeProduction");var uw,bC=(uw=class{visit(e){const r=e;switch(r.constructor){case Ul:return this.visitNonTerminal(r);case Ac:return this.visitAlternative(r);case Oo:return this.visitOption(r);case hu:return this.visitRepetitionMandatory(r);case du:return this.visitRepetitionMandatoryWithSeparator(r);case _c:return this.visitRepetitionWithSeparator(r);case Vs:return this.visitRepetition(r);case Lc:return this.visitAlternation(r);case Ji:return this.visitTerminal(r);case vC: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){}},_(uw,"GAstVisitor"),uw);function Dze(t){return t instanceof Ac||t instanceof Oo||t instanceof Vs||t instanceof hu||t instanceof du||t instanceof _c||t instanceof Ji||t instanceof vC}_(Dze,"isSequenceProd");function aA(t,e=[]){return t instanceof Oo||t instanceof Vs||t instanceof _c?!0:t instanceof Lc?Rze(t.definition,n=>aA(n,e)):t instanceof Ul&&tc(e,t)?!1:t instanceof xf?(t instanceof Ul&&e.push(t),Bh(t.definition,n=>aA(n,e))):!1}_(aA,"isOptionalProd");function Pze(t){return t instanceof Lc}_(Pze,"isBranchingProd");function mh(t){if(t instanceof Ul)return"SUBRULE";if(t instanceof Oo)return"OPTION";if(t instanceof Lc)return"OR";if(t instanceof hu)return"AT_LEAST_ONE";if(t instanceof du)return"AT_LEAST_ONE_SEP";if(t instanceof _c)return"MANY_SEP";if(t instanceof Vs)return"MANY";if(t instanceof Ji)return"CONSUME";throw Error("non exhaustive match")}_(mh,"getProductionDslName");var hw,k$=(hw=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const s=Co(e.definition,i+1);if(n instanceof Ul)this.walkProdRef(n,s,r);else if(n instanceof Ji)this.walkTerminal(n,s,r);else if(n instanceof Ac)this.walkFlat(n,s,r);else if(n instanceof Oo)this.walkOption(n,s,r);else if(n instanceof hu)this.walkAtLeastOne(n,s,r);else if(n instanceof du)this.walkAtLeastOneSep(n,s,r);else if(n instanceof _c)this.walkManySep(n,s,r);else if(n instanceof Vs)this.walkMany(n,s,r);else if(n instanceof Lc)this.walkOr(n,s,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 Oo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=dX(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Oo({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=dX(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,s=>{const a=new Ac({definition:[s]});this.walk(a,i)})}},_(hw,"RestWalker"),hw);function dX(t,e,r){return[new Oo({definition:[new Ji({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}_(dX,"restForRepetitionWithSeparator");function xC(t){if(t instanceof Ul)return xC(t.referencedRule);if(t instanceof Ji)return Fze(t);if(Dze(t))return $ze(t);if(Pze(t))return Bze(t);throw Error("non exhaustive match")}_(xC,"first");function $ze(t){let e=[];const r=t.definition;let n=0,i=r.length>n,s,a=!0;for(;i&&a;)s=r[n],a=aA(s),e=e.concat(xC(s)),n=n+1,i=r.length>n;return tie(e)}_($ze,"firstForSequence");function Bze(t){const e=_r(t.definition,r=>xC(r));return tie($h(e))}_(Bze,"firstForBranching");function Fze(t){return[t.terminalType]}_(Fze,"firstForTerminal");var zze="_~IN~_",dw,Qcr=(dw=class extends k${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=Hze(e.referencedRule,e.idx)+this.topProd.name,s=r.concat(n),a=new Ac({definition:s}),o=xC(a);this.follows[i]=o}},_(dw,"ResyncFollowsWalker"),dw);function Vze(t){const e={};return tn(t,r=>{const n=new Qcr(r).startWalking();iu(e,n)}),e}_(Vze,"computeAllProdsFollows");function Hze(t,e){return t.name+e+zze}_(Hze,"buildBetweenProdsFollowPrefix");var I9={},Jcr=new xPe;function U7(t){const e=t.toString();if(I9.hasOwnProperty(e))return I9[e];{const r=Jcr.pattern(e);return I9[e]=r,r}}_(U7,"getRegExpAst");function Gze(){I9={}}_(Gze,"clearRegExpParserCache");var Wze="Complement Sets are not supported for first char optimization",NN=`Unable to use "first char" lexer optimizations: -`;function qze(t,e=!1){try{const r=U7(t);return ON(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Wze)e&&rie(`${NN} Unable to optimize: < ${t.toString()} > +`: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}}},M(eb,"RegExpParser"),eb),tb,sP=(tb=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){}},M(tb,"BaseRegExpVisitor"),tb),D_e=/\r?\n/gm,O_e=new N_e,rb,eir=(rb=class extends sP{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=v9(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)}},M(rb,"TerminalRegExpVisitor"),rb),UU=new eir;function __e(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=O_e.pattern(t),r=[];for(const n of e.value.value)UU.reset(t),UU.visit(n),r.push({start:UU.startRegexp,end:UU.endRegex});return r}catch{return[]}}M(__e,"getTerminalParts");function Sne(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),UU.reset(t),UU.visit(O_e.pattern(t)),UU.multiline}catch{return!1}}M(Sne,"isMultilineComment");var P_e=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function oP(t){const e=typeof t=="string"?new RegExp(t):t;return P_e.some(r=>e.test(r))}M(oP,"isWhitespace");function v9(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}M(v9,"escapeRegExp");function Ene(t,e){const r=Ane(t),n=e.match(r);return!!n&&n[0].length>0}M(Ene,"partialMatches");function Ane(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}M(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(M(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 M(i,"process"),new RegExp(i(),t.flags)}M(Ane,"partialRegExp");function Mne(t){return t.rules.find(e=>Wl(e)&&e.entry)}M(Mne,"getEntryRule");function Rne(t){return t.rules.filter(e=>Zu(e)&&e.hidden)}M(Rne,"getHiddenRules");function lP(t,e){const r=new Set,n=Mne(t);if(!n)return new Set(t.rules);const i=[n].concat(Rne(t));for(const s of i)Lne(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Zu(s)&&s.hidden)&&a.add(s);return a}M(lP,"getAllReachableRules");function Lne(t,e,r){e.add(t.name),Up(t).forEach(n=>{if(G0(n)||r&&tP(n)){const i=n.rule.ref;i&&!e.has(i.name)&&Lne(i,e,r)}})}M(Lne,"ruleDfs");function B_e(t){const e=new Set;return Up(t).forEach(r=>{V5(r)&&(Wl(r.type.ref)&&e.add(r.type.ref),_k(r.type.ref)&&Wl(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}M(B_e,"getAllRulesUsedForCrossReferences");function Ine(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=dP(t.type.ref);return e==null?void 0:e.terminal}}M(Ine,"getCrossReferenceTerminal");function Nne(t){return t.hidden&&!oP($k(t))}M(Nne,"isCommentTerminal");function Dne(t,e){return!t||!e?[]:uP(t,e,t.astNode,!0)}M(Dne,"findNodesForProperty");function cP(t,e,r){if(!t||!e)return;const n=uP(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]}M(cP,"findNodeForProperty");function uP(t,e,r,n){if(!n){const i=F5(t.grammarSource,V0);if(i&&i.feature===e)return[t]}return z0(t)&&t.astNode===r?t.content.flatMap(i=>uP(i,e,r,!1)):[]}M(uP,"findNodesForPropertyInternal");function $_e(t,e){return t?hP(t,e,t==null?void 0:t.astNode):[]}M($_e,"findNodesForKeyword");function One(t,e,r){if(!t)return;const n=hP(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]}M(One,"findNodeForKeyword");function hP(t,e,r){if(t.astNode!==r)return[];if(H0(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=x4(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?H0(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}M(hP,"findNodesForKeywordInternal");function _ne(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=F5(t.grammarSource,V0);if(n)return n;t=t.container}}M(_ne,"findAssignment");function dP(t){let e=t;return _k(e)&&(c1(e.$container)?e=e.$container.$container:z5(e.$container)?e=e.$container:B1(e.$container)),Pne(t,e,new Map)}M(dP,"findNameAssignment");function Pne(t,e,r){var i;function n(a,s){let o;return F5(a,V0)||(o=Pne(s,s,r)),r.set(t,o),o}if(M(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Up(e)){if(V0(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(G0(a)&&Wl(a.rule.ref))return n(a,a.rule.ref);if(eP(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}M(Pne,"findNameAssignmentInternal");function Bne(t){const e=t.$container;if(H5(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(c1(a))return a;{const s=Up(r[i]).find(c1);if(s)return s}}}if(J_(e))return Bne(e)}M(Bne,"getActionAtElement");function F_e(t,e){return t==="?"||t==="*"||H5(e)&&!!e.guardCondition}M(F_e,"isOptionalCardinality");function z_e(t){return t==="*"||t==="+"}M(z_e,"isArrayCardinality");function V_e(t){return t==="+="}M(V_e,"isArrayOperator");function Pk(t){return $ne(t,new Set)}M(Pk,"isDataTypeRule");function $ne(t,e){if(e.has(t))return!0;e.add(t);for(const r of Up(t))if(G0(r)){if(!r.rule.ref||Wl(r.rule.ref)&&!$ne(r.rule.ref,e)||v4(r.rule.ref))return!1}else{if(V0(r))return!1;if(c1(r))return!1}return!!t.definition}M($ne,"isDataTypeRuleInternal");function H_e(t){return IN(t.type,new Set)}M(H_e,"isDataType");function IN(t,e){if(e.has(t))return!0;if(e.add(t),Kre(t))return!1;if(sne(t))return!1;if(hne(t))return t.types.every(r=>IN(r,e));if(eP(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 rP(r)?IN(r.type,e):!1}else return!1}else return!1}M(IN,"isDataTypeInternal");function Bk(t){if(!Zu(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}}}M(Bk,"getExplicitRuleType");function f5(t){if(z5(t))return Wl(t)&&Pk(t)?t.name:Bk(t)??t.name;if(rne(t)||rP(t)||lne(t))return t.name;if(c1(t)){const e=Fne(t);if(e)return e}else if(_k(t))return t.name;throw new Error("Cannot get name of Unknown Type")}M(f5,"getTypeName");function Fne(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return f5(t.type.ref)}M(Fne,"getActionType");function G_e(t){var e;return Zu(t)?((e=t.type)==null?void 0:e.name)??"string":Wl(t)&&Pk(t)?t.name:Bk(t)??t.name}M(G_e,"getRuleTypeName");function zne(t){var e;return Zu(t)?((e=t.type)==null?void 0:e.name)??"string":Bk(t)??t.name}M(zne,"getRuleType");function $k(t){const e={s:!1,i:!1,u:!1},r=G5(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}M($k,"terminalRegex");var Vne=/[\s\S]/.source;function G5(t,e){var r;if(cne(t))return W_e(t);if(une(t))return q_e(t);if(Jre(t))return X_e(t);if(tP(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Hd(G5(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(nne(t))return Y_e(t);if(dne(t))return j_e(t);if(one(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")),Hd(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(fne(t))return Hd(Vne,{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}`)}}}M(G5,"abstractElementToRegex");function W_e(t){return Hd(t.elements.map(e=>G5(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(W_e,"terminalAlternativesToRegex");function q_e(t){return Hd(t.elements.map(e=>G5(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(q_e,"terminalGroupToRegex");function j_e(t){return Hd(`${Vne}*?${G5(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(j_e,"untilTokenToRegex");function Y_e(t){return Hd(`(?!${G5(t.terminal)})${Vne}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}M(Y_e,"negateTokenToRegex");function X_e(t){return t.right?Hd(`[${DM(t.left)}-${DM(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Hd(DM(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}M(X_e,"characterRangeToRegex");function DM(t){return v9(t.value)}M(DM,"keywordToRegex");function Hd(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}M(Hd,"withCardinality");function Hne(t){const e=[],r=t.Grammar;for(const n of r.rules)Zu(n)&&Nne(n)&&Sne($k(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:yne}}M(Hne,"createGrammarConfig");var tir=typeof global=="object"&&global&&global.Object===Object&&global,K_e=tir,rir=typeof self=="object"&&self&&self.Object===Object&&self,nir=K_e||rir||Function("return this")(),yf=nir,iir=yf.Symbol,ju=iir,Z_e=Object.prototype,air=Z_e.hasOwnProperty,sir=Z_e.toString,d3=ju?ju.toStringTag:void 0;function J_e(t){var e=air.call(t,d3),r=t[d3];try{t[d3]=void 0;var n=!0}catch{}var i=sir.call(t);return n&&(e?t[d3]=r:delete t[d3]),i}M(J_e,"getRawTag");var oir=J_e,lir=Object.prototype,cir=lir.toString;function Q_e(t){return cir.call(t)}M(Q_e,"objectToString");var uir=Q_e,hir="[object Null]",dir="[object Undefined]",tUe=ju?ju.toStringTag:void 0;function ePe(t){return t==null?t===void 0?dir:hir:tUe&&tUe in Object(t)?oir(t):uir(t)}M(ePe,"baseGetTag");var $1=ePe;function tPe(t){return t!=null&&typeof t=="object"}M(tPe,"isObjectLike");var Wh=tPe,fir="[object Symbol]";function rPe(t){return typeof t=="symbol"||Wh(t)&&$1(t)==fir}M(rPe,"isSymbol");var fP=rPe;function nPe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=Xir)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}M(vPe,"shortOut");var Jir=vPe;function xPe(t){return function(){return t}}M(xPe,"constant");var Qir=xPe,ear=(function(){try{var t=q5(Object,"defineProperty");return t({},"",{}),t}catch{}})(),NN=ear,tar=NN?function(t,e){return NN(t,"toString",{configurable:!0,enumerable:!1,value:Qir(e),writable:!0})}:Vk,rar=tar,nar=Jir(rar),iar=nar;function wPe(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}M(MPe,"arrayIncludes");var RPe=MPe,oar=9007199254740991,lar=/^(?:0|[1-9]\d*)$/;function LPe(t,e){var r=typeof t;return e=e??oar,!!e&&(r=="number"||r!="symbol"&&lar.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=dar}M(BPe,"isLength");var Yne=BPe;function $Pe(t){return t!=null&&Yne(t.length)&&!yp(t)}M($Pe,"isArrayLike");var bf=$Pe;function FPe(t,e,r){if(!Yu(r))return!1;var n=typeof e;return(n=="number"?bf(r)&&pP(e,r.length):n=="string"&&e in r)?Hk(r[e],t):!1}M(FPe,"isIterateeCall");var mP=FPe;function zPe(t){return jne(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&&mP(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}M(UBe,"listCacheHas");var Lsr=UBe;function yBe(t,e){var r=this.__data__,n=bP(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(yBe,"listCacheSet");var Isr=yBe;function Y5(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(o)?e>1?Qne(o,e-1,r,n,i):Jne(i,o):n||(i[i.length]=o)}return i}M(Qne,"baseFlatten");var eie=Qne;function DBe(t){var e=t==null?0:t.length;return e?eie(t,1):[]}M(DBe,"flatten");var Ph=DBe,Zsr=eBe(Object.getPrototypeOf,Object),OBe=Zsr;function _Be(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&Vlr?new iie:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&mP(e[0],e[1],i)&&(n=1);++r=Ocr&&(a=aie,s=!1,e=new iie(e));e:for(;++i-1?i[a?e[s]:s]:void 0}}M(UFe,"createFind");var zcr=UFe,Vcr=Math.max;function yFe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:zk(r);return i<0&&(i=Vcr(n+i,0)),kPe(t,vf(e),i)}M(yFe,"findIndex");var Hcr=yFe,Gcr=zcr(Hcr),C4=Gcr;function bFe(t){return t&&t.length?t[0]:void 0}M(bFe,"head");var qh=bFe;function vFe(t,e){var r=-1,n=bf(t)?Array(t.length):[];return Z5(t,function(i,a,s){n[++r]=e(i,a,s)}),n}M(vFe,"baseMap");var Wcr=vFe;function xFe(t,e){var r=ti(t)?Fk:Wcr;return r(t,vf(e))}M(xFe,"map");var Lr=xFe;function wFe(t,e){return eie(Lr(t,e),1)}M(wFe,"flatMap");var zu=wFe,qcr=Object.prototype,jcr=qcr.hasOwnProperty,Ycr=Icr(function(t,e,r){jcr.call(t,r)?t[r].push(e):qne(t,r,[e])}),Xcr=Ycr,Kcr=Object.prototype,Zcr=Kcr.hasOwnProperty;function TFe(t,e){return t!=null&&Zcr.call(t,e)}M(TFe,"baseHas");var Jcr=TFe;function CFe(t,e){return t!=null&&V$e(t,e,Jcr)}M(CFe,"has");var Xr=CFe,Qcr="[object String]";function kFe(t){return typeof t=="string"||!ti(t)&&Wh(t)&&$1(t)==Qcr}M(kFe,"isString");var Sc=kFe;function SFe(t,e){return Fk(e,function(r){return t[r]})}M(SFe,"baseValues");var eur=SFe;function EFe(t){return t==null?[]:eur(t,nu(t))}M(EFe,"values");var Es=EFe,tur=Math.max;function AFe(t,e,r,n){t=bf(t)?t:Es(t),r=r&&!n?zk(r):0;var i=t.length;return r<0&&(r=tur(i+r,0)),Sc(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Wne(t,e,r)>-1}M(AFe,"includes");var tc=AFe,rur=Math.max;function MFe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:zk(r);return i<0&&(i=rur(n+i,0)),Wne(t,e,i)}M(MFe,"indexOf");var NUe=MFe,nur="[object Map]",iur="[object Set]",aur=Object.prototype,sur=aur.hasOwnProperty;function RFe(t){if(t==null)return!0;if(bf(t)&&(ti(t)||typeof t=="string"||typeof t.splice=="function"||iC(t)||Xne(t)||UP(t)))return!t.length;var e=T4(t);if(e==nur||e==iur)return!t.size;if(Wk(t))return!rBe(t).length;for(var r in t)if(sur.call(t,r))return!1;return!0}M(RFe,"isEmpty");var Gi=RFe,our="[object RegExp]";function LFe(t){return Wh(t)&&$1(t)==our}M(LFe,"baseIsRegExp");var lur=LFe,DUe=u1&&u1.isRegExp,cur=DUe?qk(DUe):lur,W0=cur;function IFe(t){return t===void 0}M(IFe,"isUndefined");var q0=IFe,uur="Expected a function";function NFe(t){if(typeof t!="function")throw new TypeError(uur);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)}}M(NFe,"negate");var hur=NFe;function DFe(t,e,r,n){if(!Yu(t))return t;e=CP(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i=bur){var u=e?null:yur(t);if(u)return sie(u);s=!1,i=aie,l=new iie}else l=e?[]:o;e:for(;++n{r.accept(e)})}},M(nb,"AbstractProduction"),nb),ib,ql=(ib=class extends xf{constructor(e){super([]),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},M(ib,"NonTerminal"),ib),ab,x9=(ab=class extends xf{constructor(e){super(e.definition),this.orgText="",iu(this,Qh(e,r=>r!==void 0))}},M(ab,"Rule"),ab),sb,Ec=(sb=class extends xf{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,iu(this,Qh(e,r=>r!==void 0))}},M(sb,"Alternative"),sb),ob,Do=(ob=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}},M(ob,"Option"),ob),lb,hu=(lb=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}},M(lb,"RepetitionMandatory"),lb),cb,du=(cb=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}},M(cb,"RepetitionMandatoryWithSeparator"),cb),ub,Fa=(ub=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}},M(ub,"Repetition"),ub),hb,Rc=(hb=class extends xf{constructor(e){super(e.definition),this.idx=1,iu(this,Qh(e,r=>r!==void 0))}},M(hb,"RepetitionWithSeparator"),hb),db,Lc=(db=class extends xf{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,iu(this,Qh(e,r=>r!==void 0))}},M(db,"Alternation"),db),fb,ea=(fb=class{constructor(e){this.idx=1,iu(this,Qh(e,r=>r!==void 0))}accept(e){e.visit(this)}},M(fb,"Terminal"),fb);function jFe(t){return Lr(t,bw)}M(jFe,"serializeGrammar");function bw(t){function e(r){return Lr(r,bw)}if(M(e,"convertDefinition"),t instanceof ql){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Sc(t.label)&&(r.label=t.label),r}else{if(t instanceof Ec)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Do)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof hu)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof du)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:bw(new ea({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Rc)return{type:"RepetitionWithSeparator",idx:t.idx,separator:bw(new ea({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Fa)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Lc)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ea){const r={type:"Terminal",name:t.terminalType.name,label:WFe(t.terminalType),idx:t.idx};Sc(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=W0(n)?n.source:n),r}else{if(t instanceof x9)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}M(bw,"serializeProduction");var pb,w9=(pb=class{visit(e){const r=e;switch(r.constructor){case ql:return this.visitNonTerminal(r);case Ec:return this.visitAlternative(r);case Do:return this.visitOption(r);case hu:return this.visitRepetitionMandatory(r);case du:return this.visitRepetitionMandatoryWithSeparator(r);case Rc:return this.visitRepetitionWithSeparator(r);case Fa:return this.visitRepetition(r);case Lc:return this.visitAlternation(r);case ea:return this.visitTerminal(r);case x9: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){}},M(pb,"GAstVisitor"),pb);function YFe(t){return t instanceof Ec||t instanceof Do||t instanceof Fa||t instanceof hu||t instanceof du||t instanceof Rc||t instanceof ea||t instanceof x9}M(YFe,"isSequenceProd");function cC(t,e=[]){return t instanceof Do||t instanceof Fa||t instanceof Rc?!0:t instanceof Lc?VFe(t.definition,n=>cC(n,e)):t instanceof ql&&tc(e,t)?!1:t instanceof xf?(t instanceof ql&&e.push(t),Bh(t.definition,n=>cC(n,e))):!1}M(cC,"isOptionalProd");function XFe(t){return t instanceof Lc}M(XFe,"isBranchingProd");function mh(t){if(t instanceof ql)return"SUBRULE";if(t instanceof Do)return"OPTION";if(t instanceof Lc)return"OR";if(t instanceof hu)return"AT_LEAST_ONE";if(t instanceof du)return"AT_LEAST_ONE_SEP";if(t instanceof Rc)return"MANY_SEP";if(t instanceof Fa)return"MANY";if(t instanceof ea)return"CONSUME";throw Error("non exhaustive match")}M(mh,"getProductionDslName");var gb,EP=(gb=class{walk(e,r=[]){tn(e.definition,(n,i)=>{const a=To(e.definition,i+1);if(n instanceof ql)this.walkProdRef(n,a,r);else if(n instanceof ea)this.walkTerminal(n,a,r);else if(n instanceof Ec)this.walkFlat(n,a,r);else if(n instanceof Do)this.walkOption(n,a,r);else if(n instanceof hu)this.walkAtLeastOne(n,a,r);else if(n instanceof du)this.walkAtLeastOneSep(n,a,r);else if(n instanceof Rc)this.walkManySep(n,a,r);else if(n instanceof Fa)this.walkMany(n,a,r);else if(n instanceof Lc)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 Do({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=bX(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Do({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=bX(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);tn(e.definition,a=>{const s=new Ec({definition:[a]});this.walk(s,i)})}},M(gb,"RestWalker"),gb);function bX(t,e,r){return[new Do({definition:[new ea({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}M(bX,"restForRepetitionWithSeparator");function T9(t){if(t instanceof ql)return T9(t.referencedRule);if(t instanceof ea)return JFe(t);if(YFe(t))return KFe(t);if(XFe(t))return ZFe(t);throw Error("non exhaustive match")}M(T9,"first");function KFe(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=cC(a),e=e.concat(T9(a)),n=n+1,i=r.length>n;return cie(e)}M(KFe,"firstForSequence");function ZFe(t){const e=Lr(t.definition,r=>T9(r));return cie(Ph(e))}M(ZFe,"firstForBranching");function JFe(t){return[t.terminalType]}M(JFe,"firstForTerminal");var QFe="_~IN~_",mb,xur=(mb=class extends EP{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=tze(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Ec({definition:a}),o=T9(s);this.follows[i]=o}},M(mb,"ResyncFollowsWalker"),mb);function eze(t){const e={};return tn(t,r=>{const n=new xur(r).startWalking();iu(e,n)}),e}M(eze,"computeAllProdsFollows");function tze(t,e){return t.name+e+QFe}M(tze,"buildBetweenProdsFollowPrefix");var OM={},wur=new N_e;function Xk(t){const e=t.toString();if(OM.hasOwnProperty(e))return OM[e];{const r=wur.pattern(e);return OM[e]=r,r}}M(Xk,"getRegExpAst");function rze(){OM={}}M(rze,"clearRegExpParserCache");var nze="Complement Sets are not supported for first char optimization",_N=`Unable to use "first char" lexer optimizations: +`;function ize(t,e=!1){try{const r=Xk(t);return PN(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===nze)e&&uie(`${_N} 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.`),IN(`${NN} + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),ON(`${_N} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}_(qze,"getOptimizedStartCodesIndices");function ON(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")cS(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cS(h,e,r);else{for(let h=u.from;h<=u.to&&h=hS){const h=u.from>=hS?u.from:hS,d=u.to,f=U0(h),p=U0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":ON(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&DN(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Aa(e)}_(ON,"firstCharOptimizedIndices");function cS(t,e,r){const n=U0(t);e[n]=n,r===!0&&Uze(t,e)}_(cS,"addOptimizedIdxToResult");function Uze(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=U0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const s=U0(i.charCodeAt(0));e[s]=s}}}_(Uze,"handleIgnoreCase");function fX(t,e){return w3(t.value,r=>{if(typeof r=="number")return tc(e,r);{const n=r;return w3(e,i=>n.from<=i&&i<=n.to)!==void 0}})}_(fX,"findCode");function DN(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ei(t.value)?Bh(t.value,DN):DN(t.value):!1}_(DN,"isWholeOptional");var fw,eur=(fw=class extends n${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){tc(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?fX(e,this.targetCharCodes)===void 0&&(this.found=!0):fX(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},_(fw,"CharCodeFinder"),fw);function S$(t,e){if(e instanceof RegExp){const r=U7(e),n=new eur(t);return n.visit(r),n.found}else return w3(e,r=>tc(t,r.charCodeAt(0)))!==void 0}_(S$,"canMatchCharCode");var dv="PATTERN",uS="defaultMode",UM="modes";function jze(t,e){e=eie(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:_((b,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{pVe()});let n;r("Reject Lexer.NA",()=>{n=C$(t,b=>b[dv]===zl.NA)});let i=!1,s;r("Transform Patterns",()=>{i=!1,s=_r(n,b=>{const x=b[dv];if(W0(x)){const T=x.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!x.ignoreCase?T:T.length===2&&T[0]==="\\"&&!tc(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:pX(x)}else{if(yp(x))return i=!0,{exec:x};if(typeof x=="object")return i=!0,x;if(typeof x=="string"){if(x.length===1)return x;{const T=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(T);return pX(C)}}else throw Error("non exhaustive match")}})});let a,o,l,u,h;r("misc mapping",()=>{a=_r(n,b=>b.tokenTypeIdx),o=_r(n,b=>{const x=b.GROUP;if(x!==zl.SKIPPED){if(Ec(x))return x;if(q0(x))return!1;throw Error("non exhaustive match")}}),l=_r(n,b=>{const x=b.LONGER_ALT;if(x)return ei(x)?_r(x,C=>Cye(n,C)):[Cye(n,x)]}),u=_r(n,b=>b.PUSH_MODE),h=_r(n,b=>Xr(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=oie(e.lineTerminatorCharacters);d=_r(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=_r(n,x=>Xr(x,"LINE_BREAKS")?!!x.LINE_BREAKS:aie(x,b)===!1&&S$(b,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=_r(n,sie),p=_r(s,dVe),g=su(n,(b,x)=>{const T=x.GROUP;return Ec(T)&&T!==zl.SKIPPED&&(b[T]=[]),b},{}),m=_r(s,(b,x)=>({pattern:s[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:o[x],push:u[x],pop:h[x],tokenTypeIdx:a[x],tokenType:n[x]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=su(n,(b,x,T)=>{if(typeof x.PATTERN=="string"){const C=x.PATTERN.charCodeAt(0),S=U0(C);N9(b,S,m[T])}else if(ei(x.START_CHARS_HINT)){let C;tn(x.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=U0(k);C!==E&&(C=E,N9(b,E,m[T]))})}else if(W0(x.PATTERN))if(x.PATTERN.unicode)y=!1,e.ensureOptimizations&&IN(`${NN} Unable to analyze < ${x.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}M(ize,"getOptimizedStartCodesIndices");function PN(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")fx(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)fx(h,e,r);else{for(let h=u.from;h<=u.to&&h=gx){const h=u.from>=gx?u.from:gx,d=u.to,f=j0(h),p=j0(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":PN(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"&&BN(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Es(e)}M(PN,"firstCharOptimizedIndices");function fx(t,e,r){const n=j0(t);e[n]=n,r===!0&&aze(t,e)}M(fx,"addOptimizedIdxToResult");function aze(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=j0(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=j0(i.charCodeAt(0));e[a]=a}}}M(aze,"handleIgnoreCase");function vX(t,e){return C4(t.value,r=>{if(typeof r=="number")return tc(e,r);{const n=r;return C4(e,i=>n.from<=i&&i<=n.to)!==void 0}})}M(vX,"findCode");function BN(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ti(t.value)?Bh(t.value,BN):BN(t.value):!1}M(BN,"isWholeOptional");var Ub,Tur=(Ub=class extends sP{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){tc(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?vX(e,this.targetCharCodes)===void 0&&(this.found=!0):vX(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},M(Ub,"CharCodeFinder"),Ub);function AP(t,e){if(e instanceof RegExp){const r=Xk(e),n=new Tur(t);return n.visit(r),n.found}else return C4(e,r=>tc(t,r.charCodeAt(0)))!==void 0}M(AP,"canMatchCharCode");var g5="PATTERN",px="defaultMode",XE="modes";function sze(t,e){e=lie(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:M((b,v)=>v(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Eze()});let n;r("Reject Lexer.NA",()=>{n=SP(t,b=>b[g5]===Fl.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Lr(n,b=>{const v=b[g5];if(W0(v)){const w=v.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!v.ignoreCase?w:w.length===2&&w[0]==="\\"&&!tc(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:xX(v)}else{if(yp(v))return i=!0,{exec:v};if(typeof v=="object")return i=!0,v;if(typeof v=="string"){if(v.length===1)return v;{const w=v.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),T=new RegExp(w);return xX(T)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=Lr(n,b=>b.tokenTypeIdx),o=Lr(n,b=>{const v=b.GROUP;if(v!==Fl.SKIPPED){if(Sc(v))return v;if(q0(v))return!1;throw Error("non exhaustive match")}}),l=Lr(n,b=>{const v=b.LONGER_ALT;if(v)return ti(v)?Lr(v,T=>NUe(n,T)):[NUe(n,v)]}),u=Lr(n,b=>b.PUSH_MODE),h=Lr(n,b=>Xr(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=gie(e.lineTerminatorCharacters);d=Lr(n,v=>!1),e.positionTracking!=="onlyOffset"&&(d=Lr(n,v=>Xr(v,"LINE_BREAKS")?!!v.LINE_BREAKS:pie(v,b)===!1&&AP(b,v.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Lr(n,fie),p=Lr(a,kze),g=au(n,(b,v)=>{const w=v.GROUP;return Sc(w)&&w!==Fl.SKIPPED&&(b[w]=[]),b},{}),m=Lr(a,(b,v)=>({pattern:a[v],longerAlt:l[v],canLineTerminator:d[v],isCustom:f[v],short:p[v],group:o[v],push:u[v],pop:h[v],tokenTypeIdx:s[v],tokenType:n[v]}))});let U=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=au(n,(b,v,w)=>{if(typeof v.PATTERN=="string"){const T=v.PATTERN.charCodeAt(0),k=j0(T);_M(b,k,m[w])}else if(ti(v.START_CHARS_HINT)){let T;tn(v.START_CHARS_HINT,k=>{const C=typeof k=="string"?k.charCodeAt(0):k,S=j0(C);T!==S&&(T=S,_M(b,S,m[w]))})}else if(W0(v.PATTERN))if(v.PATTERN.unicode)U=!1,e.ensureOptimizations&&ON(`${_N} Unable to analyze < ${v.PATTERN.toString()} > pattern. The regexp unicode flag is not currently supported by the regexp-to-ast library. This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=qze(x.PATTERN,e.ensureOptimizations);Gi(C)&&(y=!1),tn(C,S=>{N9(b,S,m[T])})}else e.ensureOptimizations&&IN(`${NN} TokenType: <${x.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 T=ize(v.PATTERN,e.ensureOptimizations);Gi(T)&&(U=!1),tn(T,k=>{_M(b,k,m[w])})}else e.ensureOptimizations&&ON(`${_N} TokenType: <${v.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 b},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}_(jze,"analyzeTokenTypes");function Yze(t,e){let r=[];const n=Kze(t);r=r.concat(n.errors);const i=Zze(n.valid),s=i.valid;return r=r.concat(i.errors),r=r.concat(Xze(s)),r=r.concat(nVe(s)),r=r.concat(iVe(s,e)),r=r.concat(sVe(s)),r}_(Yze,"validatePatterns");function Xze(t){let e=[];const r=Qu(t,n=>W0(n[dv]));return e=e.concat(Qze(r)),e=e.concat(eVe(r)),e=e.concat(tVe(r)),e=e.concat(rVe(r)),e=e.concat(Jze(r)),e}_(Xze,"validateRegExpPattern");function Kze(t){const e=Qu(t,i=>!Xr(i,dv)),r=_r(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Hs.MISSING_PATTERN,tokenTypes:[i]})),n=T$(t,e);return{errors:r,valid:n}}_(Kze,"findMissingPatterns");function Zze(t){const e=Qu(t,i=>{const s=i[dv];return!W0(s)&&!yp(s)&&!Xr(s,"exec")&&!Ec(s)}),r=_r(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:Hs.INVALID_PATTERN,tokenTypes:[i]})),n=T$(t,e);return{errors:r,valid:n}}_(Zze,"findInvalidPatterns");var tur=/[^\\][$]/;function Qze(t){const i=class i extends n${constructor(){super(...arguments),this.found=!1}visitEndAnchor(a){this.found=!0}};_(i,"EndAnchorFinder");let e=i;const r=Qu(t,s=>{const a=s.PATTERN;try{const o=U7(a),l=new e;return l.visit(o),l.found}catch{return tur.test(a.source)}});return _r(r,s=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Hs.EOI_ANCHOR_FOUND,tokenTypes:[s]}))}_(Qze,"findEndOfInputAnchor");function Jze(t){const e=Qu(t,n=>n.PATTERN.test(""));return _r(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Hs.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}_(Jze,"findEmptyMatchRegExps");var rur=/[^\\[][\^]|^\^/;function eVe(t){const i=class i extends n${constructor(){super(...arguments),this.found=!1}visitStartAnchor(a){this.found=!0}};_(i,"StartAnchorFinder");let e=i;const r=Qu(t,s=>{const a=s.PATTERN;try{const o=U7(a),l=new e;return l.visit(o),l.found}catch{return rur.test(a.source)}});return _r(r,s=>({message:`Unexpected RegExp Anchor Error: - Token Type: ->`+s.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Hs.SOI_ANCHOR_FOUND,tokenTypes:[s]}))}_(eVe,"findStartOfInputAnchor");function tVe(t){const e=Qu(t,n=>{const i=n[dv];return i instanceof RegExp&&(i.multiline||i.global)});return _r(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Hs.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}_(tVe,"findUnsupportedFlags");function rVe(t){const e=[];let r=_r(t,s=>su(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!tc(e,o)&&o.PATTERN!==zl.NA&&(e.push(o),a.push(o)),a),[]));r=q7(r);const n=Qu(r,s=>s.length>1);return _r(n,s=>{const a=_r(s,l=>l.name);return{message:`The same RegExp pattern ->${Uh(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Hs.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}_(rVe,"findDuplicatePatterns");function nVe(t){const e=Qu(t,n=>{if(!Xr(n,"GROUP"))return!1;const i=n.GROUP;return i!==zl.SKIPPED&&i!==zl.NA&&!Ec(i)});return _r(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Hs.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}_(nVe,"findInvalidGroupType");function iVe(t,e){const r=Qu(t,i=>i.PUSH_MODE!==void 0&&!tc(e,i.PUSH_MODE));return _r(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:Hs.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}_(iVe,"findModesThatDoNotExist");function sVe(t){const e=[],r=su(t,(n,i,s)=>{const a=i.PATTERN;return a===zl.NA||(Ec(a)?n.push({str:a,idx:s,tokenType:i}):W0(a)&&oVe(a)&&n.push({str:a.source,idx:s,tokenType:i})),n},[]);return tn(t,(n,i)=>{tn(r,({str:s,idx:a,tokenType:o})=>{if(i${o.name}<- can never be matched. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),U=!1;return b},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:U}}M(sze,"analyzeTokenTypes");function oze(t,e){let r=[];const n=cze(t);r=r.concat(n.errors);const i=uze(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(lze(a)),r=r.concat(mze(a)),r=r.concat(Uze(a,e)),r=r.concat(yze(a)),r}M(oze,"validatePatterns");function lze(t){let e=[];const r=Ju(t,n=>W0(n[g5]));return e=e.concat(hze(r)),e=e.concat(fze(r)),e=e.concat(pze(r)),e=e.concat(gze(r)),e=e.concat(dze(r)),e}M(lze,"validateRegExpPattern");function cze(t){const e=Ju(t,i=>!Xr(i,g5)),r=Lr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:za.MISSING_PATTERN,tokenTypes:[i]})),n=kP(t,e);return{errors:r,valid:n}}M(cze,"findMissingPatterns");function uze(t){const e=Ju(t,i=>{const a=i[g5];return!W0(a)&&!yp(a)&&!Xr(a,"exec")&&!Sc(a)}),r=Lr(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:za.INVALID_PATTERN,tokenTypes:[i]})),n=kP(t,e);return{errors:r,valid:n}}M(uze,"findInvalidPatterns");var Cur=/[^\\][$]/;function hze(t){const i=class i extends sP{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};M(i,"EndAnchorFinder");let e=i;const r=Ju(t,a=>{const s=a.PATTERN;try{const o=Xk(s),l=new e;return l.visit(o),l.found}catch{return Cur.test(s.source)}});return Lr(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:za.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}M(hze,"findEndOfInputAnchor");function dze(t){const e=Ju(t,n=>n.PATTERN.test(""));return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:za.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}M(dze,"findEmptyMatchRegExps");var kur=/[^\\[][\^]|^\^/;function fze(t){const i=class i extends sP{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};M(i,"StartAnchorFinder");let e=i;const r=Ju(t,a=>{const s=a.PATTERN;try{const o=Xk(s),l=new e;return l.visit(o),l.found}catch{return kur.test(s.source)}});return Lr(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:za.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}M(fze,"findStartOfInputAnchor");function pze(t){const e=Ju(t,n=>{const i=n[g5];return i instanceof RegExp&&(i.multiline||i.global)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:za.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}M(pze,"findUnsupportedFlags");function gze(t){const e=[];let r=Lr(t,a=>au(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!tc(e,o)&&o.PATTERN!==Fl.NA&&(e.push(o),s.push(o)),s),[]));r=Yk(r);const n=Ju(r,a=>a.length>1);return Lr(n,a=>{const s=Lr(a,l=>l.name);return{message:`The same RegExp pattern ->${qh(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:za.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}M(gze,"findDuplicatePatterns");function mze(t){const e=Ju(t,n=>{if(!Xr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Fl.SKIPPED&&i!==Fl.NA&&!Sc(i)});return Lr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:za.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}M(mze,"findInvalidGroupType");function Uze(t,e){const r=Ju(t,i=>i.PUSH_MODE!==void 0&&!tc(e,i.PUSH_MODE));return Lr(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:za.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}M(Uze,"findModesThatDoNotExist");function yze(t){const e=[],r=au(t,(n,i,a)=>{const s=i.PATTERN;return s===Fl.NA||(Sc(s)?n.push({str:s,idx:a,tokenType:i}):W0(s)&&vze(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return tn(t,(n,i)=>{tn(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:Hs.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}_(sVe,"findUnreachablePatterns");function aVe(t,e){if(W0(e)){if(lVe(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(yp(e))return e(t,0,[],{});if(Xr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}_(aVe,"tryToMatchStrToPattern");function oVe(t){return w3([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}_(oVe,"noMetaChar");function lVe(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition -`,type:Hs.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Xr(t,UM)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+UM+`> property in its definition -`,type:Hs.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Xr(t,UM)&&Xr(t,uS)&&!Xr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${uS}: <${t.defaultMode}>which does not exist -`,type:Hs.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Xr(t,UM)&&tn(t.modes,(i,s)=>{tn(i,(a,o)=>{if(q0(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}> -`,type:Hs.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Xr(a,"LONGER_ALT")){const l=ei(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];tn(l,u=>{!q0(u)&&!tc(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${s}> -`,type:Hs.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}_(cVe,"performRuntimeChecks");function uVe(t,e,r){const n=[];let i=!1;const s=q7($h(Aa(t.modes))),a=C$(s,l=>l[dv]===zl.NA),o=oie(r);return e&&tn(a,l=>{const u=aie(l,o);if(u!==!1){const d={message:fVe(l,u),type:u.issue,tokenType:l};n.push(d)}else Xr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):S$(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:za.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}M(yze,"findUnreachablePatterns");function bze(t,e){if(W0(e)){if(xze(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(yp(e))return e(t,0,[],{});if(Xr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}M(bze,"tryToMatchStrToPattern");function vze(t){return C4([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}M(vze,"noMetaChar");function xze(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:za.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Xr(t,XE)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+XE+`> property in its definition +`,type:za.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Xr(t,XE)&&Xr(t,px)&&!Xr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${px}: <${t.defaultMode}>which does not exist +`,type:za.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Xr(t,XE)&&tn(t.modes,(i,a)=>{tn(i,(s,o)=>{if(q0(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}> +`,type:za.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Xr(s,"LONGER_ALT")){const l=ti(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];tn(l,u=>{!q0(u)&&!tc(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:za.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}M(wze,"performRuntimeChecks");function Tze(t,e,r){const n=[];let i=!1;const a=Yk(Ph(Es(t.modes))),s=SP(a,l=>l[g5]===Fl.NA),o=gie(r);return e&&tn(s,l=>{const u=pie(l,o);if(u!==!1){const d={message:Sze(l,u),type:u.issue,tokenType:l};n.push(d)}else Xr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):AP(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:Hs.NO_LINE_BREAKS_FLAGS}),n}_(uVe,"performWarningRuntimeChecks");function hVe(t){const e={},r=nu(t);return tn(r,n=>{const i=t[n];if(ei(i))e[n]=[];else throw Error("non exhaustive match")}),e}_(hVe,"cloneEmptyGroups");function sie(t){const e=t.PATTERN;if(W0(e))return!1;if(yp(e))return!0;if(Xr(e,"exec"))return!0;if(Ec(e))return!1;throw Error("non exhaustive match")}_(sie,"isCustomPattern");function dVe(t){return Ec(t)&&t.length===1?t.charCodeAt(0):!1}_(dVe,"isShortPattern");var nur={test:_(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(ti(i))e[n]=[];else throw Error("non exhaustive match")}),e}M(Cze,"cloneEmptyGroups");function fie(t){const e=t.PATTERN;if(W0(e))return!1;if(yp(e))return!0;if(Xr(e,"exec"))return!0;if(Sc(e))return!1;throw Error("non exhaustive match")}M(fie,"isCustomPattern");function kze(t){return Sc(t)&&t.length===1?t.charCodeAt(0):!1}M(kze,"isShortPattern");var Sur={test:M(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===Hs.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===za.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")}_(fVe,"buildLineBreakIssueMessage");function oie(t){return _r(t,r=>Ec(r)?r.charCodeAt(0):r)}_(oie,"getCharCodes");function N9(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}_(N9,"addToMapOfArrays");var hS=256,O9=[];function U0(t){return t255?255+~~(t/255):t}}_(pVe,"initCharCodeToOptimizedIndexMap");function wC(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}_(wC,"tokenStructuredMatcher");function oA(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}_(oA,"tokenStructuredMatcherNoCategories");var Sye=1,gVe={};function TC(t){const e=mVe(t);yVe(e),bVe(e),vVe(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}_(TC,"augmentTokenTypes");function mVe(t){let e=Po(t),r=t,n=!0;for(;n;){r=q7($h(_r(r,s=>s.CATEGORIES)));const i=T$(r,e);e=e.concat(i),Gi(i)?n=!1:r=i}return e}_(mVe,"expandCategories");function yVe(t){tn(t,e=>{cie(e)||(gVe[Sye]=e,e.tokenTypeIdx=Sye++),gX(e)&&!ei(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),gX(e)||(e.CATEGORIES=[]),xVe(e)||(e.categoryMatches=[]),wVe(e)||(e.categoryMatchesMap={})})}_(yVe,"assignTokenDefaultProps");function vVe(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(gVe[n].tokenTypeIdx)})})}_(vVe,"assignCategoriesTokensProp");function bVe(t){tn(t,e=>{lie([],e)})}_(bVe,"assignCategoriesMapProp");function lie(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);tc(n,r)||lie(n,r)})}_(lie,"singleAssignCategoriesToksMap");function cie(t){return Xr(t,"tokenTypeIdx")}_(cie,"hasShortKeyProperty");function gX(t){return Xr(t,"CATEGORIES")}_(gX,"hasCategoriesProperty");function xVe(t){return Xr(t,"categoryMatches")}_(xVe,"hasExtendingTokensTypesProperty");function wVe(t){return Xr(t,"categoryMatchesMap")}_(wVe,"hasExtendingTokensTypesMapProperty");function TVe(t){return Xr(t,"tokenTypeIdx")}_(TVe,"isTokenType");var mX={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Hs;(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"})(Hs||(Hs={}));var dS={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:mX,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(dS);var pw,zl=(pw=class{constructor(e,r=dS){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,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:o,value:l}=nie(s),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return s()},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=iu({},dS,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,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===dS.lineTerminatorsPattern)this.config.lineTerminatorsPattern=nur;else if(this.config.lineTerminatorCharacters===dS.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),ei(e)?i={modes:{defaultMode:Po(e)},defaultMode:uS}:(s=!1,i=Po(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(cVe(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(uVe(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=C$(o,u=>q0(u))});const a=nu(i.modes);if(tn(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(Yze(o,a))}),Gi(this.lexerDefinitionErrors)){TC(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=jze(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=iu({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Gi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=_r(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")}M(Sze,"buildLineBreakIssueMessage");function gie(t){return Lr(t,r=>Sc(r)?r.charCodeAt(0):r)}M(gie,"getCharCodes");function _M(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}M(_M,"addToMapOfArrays");var gx=256,PM=[];function j0(t){return t255?255+~~(t/255):t}}M(Eze,"initCharCodeToOptimizedIndexMap");function C9(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}M(C9,"tokenStructuredMatcher");function uC(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}M(uC,"tokenStructuredMatcherNoCategories");var OUe=1,Aze={};function k9(t){const e=Mze(t);Rze(e),Ize(e),Lze(e),tn(e,r=>{r.isParent=r.categoryMatches.length>0})}M(k9,"augmentTokenTypes");function Mze(t){let e=_o(t),r=t,n=!0;for(;n;){r=Yk(Ph(Lr(r,a=>a.CATEGORIES)));const i=kP(r,e);e=e.concat(i),Gi(i)?n=!1:r=i}return e}M(Mze,"expandCategories");function Rze(t){tn(t,e=>{Uie(e)||(Aze[OUe]=e,e.tokenTypeIdx=OUe++),wX(e)&&!ti(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),wX(e)||(e.CATEGORIES=[]),Nze(e)||(e.categoryMatches=[]),Dze(e)||(e.categoryMatchesMap={})})}M(Rze,"assignTokenDefaultProps");function Lze(t){tn(t,e=>{e.categoryMatches=[],tn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Aze[n].tokenTypeIdx)})})}M(Lze,"assignCategoriesTokensProp");function Ize(t){tn(t,e=>{mie([],e)})}M(Ize,"assignCategoriesMapProp");function mie(t,e){tn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),tn(e.CATEGORIES,r=>{const n=t.concat(e);tc(n,r)||mie(n,r)})}M(mie,"singleAssignCategoriesToksMap");function Uie(t){return Xr(t,"tokenTypeIdx")}M(Uie,"hasShortKeyProperty");function wX(t){return Xr(t,"CATEGORIES")}M(wX,"hasCategoriesProperty");function Nze(t){return Xr(t,"categoryMatches")}M(Nze,"hasExtendingTokensTypesProperty");function Dze(t){return Xr(t,"categoryMatchesMap")}M(Dze,"hasExtendingTokensTypesMapProperty");function Oze(t){return Xr(t,"tokenTypeIdx")}M(Oze,"isTokenType");var TX={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.`}},za;(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"})(za||(za={}));var mx={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:TX,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(mx);var yb,Fl=(yb=class{constructor(e,r=mx){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}=hie(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=iu({},mx,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===mx.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Sur;else if(this.config.lineTerminatorCharacters===mx.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),ti(e)?i={modes:{defaultMode:_o(e)},defaultMode:px}:(a=!1,i=_o(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(wze(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Tze(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},tn(i.modes,(o,l)=>{i.modes[l]=SP(o,u=>q0(u))});const s=nu(i.modes);if(tn(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(oze(o,s))}),Gi(this.lexerDefinitionErrors)){k9(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=sze(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=iu({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Gi(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Lr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: -`+l)}tn(this.lexerDefinitionWarning,o=>{rie(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(s&&(this.handleModes=Ga),this.trackStartLines===!1&&(this.computeNewColumn=F7),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ga),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=su(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Gi(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. +`+l)}tn(this.lexerDefinitionWarning,o=>{uie(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Hs),this.trackStartLines===!1&&(this.computeNewColumn=Vk),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Hs),/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=au(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Gi(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",()=>{Gze()}),this.TRACE_INIT("toFastProperties",()=>{iie(this)})})}tokenize(e,r=this.defaultMode){if(!Gi(this.lexerDefinitionErrors)){const i=_r(this.lexerDefinitionErrors,s=>s.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{rze()}),this.TRACE_INIT("toFastProperties",()=>{die(this)})})}tokenize(e,r=this.defaultMode){if(!Gi(this.lexerDefinitionErrors)){const i=Lr(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,s,a,o,l,u,h,d,f,p,g,m,y,v;const b=e,x=b.length;let T=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let A=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const R=hVe(this.emptyGroups),P=this.trackStartLines,N=this.config.lineTerminatorsPattern;let L=0,I=[],$=[];const O=[],D=[];Object.freeze(D);let B=!1;const z=_(G=>{if(O.length===1&&G.tokenType.PUSH_MODE===void 0){const W=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(G);E.push({offset:G.startOffset,line:G.startLine,column:G.startColumn,length:G.image.length,message:W})}else{O.pop();const W=hv(O);I=this.patternIdxToConfig[W],$=this.charCodeToPatternIdxToConfig[W],L=I.length;const K=this.canModeBeOptimized[W]&&this.config.safeMode===!1;$&&K?B=!0:B=!1}},"pop_mode");function V(G){O.push(G),$=this.charCodeToPatternIdxToConfig[G],I=this.patternIdxToConfig[G],L=I.length,L=I.length;const W=this.canModeBeOptimized[G]&&this.config.safeMode===!1;$&&W?B=!0:B=!1}_(V,"push_mode"),V.call(this,r);let F;const H=this.config.recoveryEnabled;for(;Tl.length){l=a,d=a.length,u=h,F=Q;break}}}break}}if(d!==-1){if(f=F.group,f!==void 0&&(l=l!==null?l:e.substring(T,T+d),p=F.tokenTypeIdx,g=this.createTokenInstance(l,T,p,F.tokenType,A,M,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):R[f].push(g)),P===!0&&F.canLineTerminator===!0){let q=0,oe,Z;N.lastIndex=0;do l=l!==null?l:e.substring(T,T+d),oe=N.test(l),oe===!0&&(Z=N.lastIndex-1,q++);while(oe===!0);q!==0?(A=A+q,M=d-Z,this.updateTokenEndLineColumnLocation(g,f,Z,q,A,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);T=T+d,this.handleModes(F,z,V,g)}else{const q=T,oe=A,Z=M;let Q=H===!1;for(;Q===!1&&T ${_y(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 s="Expecting: ",o=` -but found: '`+Uh(e).image+"'";if(n)return s+n+o;{const l=su(t,(f,p)=>f.concat(p),[]),u=_r(l,f=>`[${_r(f,p=>_y(p)).join(", ")}]`),d=`one of these possible Token sequences: -${_r(u,(f,p)=>` ${p+1}. ${f}`).join(` -`)}`;return s+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",a=` -but found: '`+Uh(e).image+"'";if(r)return i+r+a;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${_r(t,u=>`[${_r(u,h=>_y(h)).join(",")}]`).join(" ,")}>`;return i+l+a}}};Object.freeze(Ub);var sur={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+t.name+"<-"}},gy={buildDuplicateFoundError(t,e){function r(h){return h instanceof Ji?h.terminalType.name:h instanceof Ul?h.nonTerminalName:""}_(r,"getExtraProductionArgument");const n=t.name,i=Uh(e),s=i.idx,a=mh(i),o=r(i),l=s>0;let u=`->${a}${l?s:""}<- ${o?`with argument: ->${o}<-`:""} +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,U,y;const b=e,v=b.length;let w=0,T=0;const k=this.hasCustom?0:Math.floor(e.length/10),C=new Array(k),S=[];let E=this.trackStartLines?1:void 0,A=this.trackStartLines?1:void 0;const R=Cze(this.emptyGroups),_=this.trackStartLines,N=this.config.lineTerminatorsPattern;let L=0,I=[],P=[];const O=[],D=[];Object.freeze(D);let B=!1;const F=M(H=>{if(O.length===1&&H.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(H);S.push({offset:H.startOffset,line:H.startLine,column:H.startColumn,length:H.image.length,message:G})}else{O.pop();const G=p5(O);I=this.patternIdxToConfig[G],P=this.charCodeToPatternIdxToConfig[G],L=I.length;const K=this.canModeBeOptimized[G]&&this.config.safeMode===!1;P&&K?B=!0:B=!1}},"pop_mode");function z(H){O.push(H),P=this.charCodeToPatternIdxToConfig[H],I=this.patternIdxToConfig[H],L=I.length,L=I.length;const G=this.canModeBeOptimized[H]&&this.config.safeMode===!1;P&&G?B=!0:B=!1}M(z,"push_mode"),z.call(this,r);let $;const V=this.config.recoveryEnabled;for(;wl.length){l=s,d=s.length,u=h,$=J;break}}}break}}if(d!==-1){if(f=$.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=$.tokenTypeIdx,g=this.createTokenInstance(l,w,p,$.tokenType,E,A,d),this.handlePayload(g,u),f===!1?T=this.addToken(C,T,g):R[f].push(g)),_===!0&&$.canLineTerminator===!0){let W=0,oe,Z;N.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),oe=N.test(l),oe===!0&&(Z=N.lastIndex-1,W++);while(oe===!0);W!==0?(E=E+W,A=d-Z,this.updateTokenEndLineColumnLocation(g,f,Z,W,E,A,d)):A=this.computeNewColumn(A,d)}else A=this.computeNewColumn(A,d);w=w+d,this.handleModes($,F,z,g)}else{const W=w,oe=E,Z=A;let J=V===!1;for(;J===!1&&w ${NU(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: '`+qh(e).image+"'";if(n)return a+n+o;{const l=au(t,(f,p)=>f.concat(p),[]),u=Lr(l,f=>`[${Lr(f,p=>NU(p)).join(", ")}]`),d=`one of these possible Token sequences: +${Lr(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: '`+qh(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${Lr(t,u=>`[${Lr(u,h=>NU(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Ky);var Aur={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+t.name+"<-"}},yU={buildDuplicateFoundError(t,e){function r(h){return h instanceof ea?h.terminalType.name:h instanceof ql?h.nonTerminalName:""}M(r,"getExtraProductionArgument");const n=t.name,i=qh(e),a=i.idx,s=mh(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 `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,` @@ -3769,63 +3902,63 @@ inside top level rule: ->`+t.name+"<-"}},gy={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=_r(t.prefixPath,i=>_y(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=Lr(t.prefixPath,i=>NU(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=_r(t.prefixPath,s=>_y(s)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives. +`;else{const i=Lr(t.prefixPath,a=>NU(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=mh(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=_r(t.leftRecursionPath,s=>s.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=Lr(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 vC?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function kVe(t,e){const r=new aur(t,e);return r.resolveRefs(),r.errors}_(kVe,"resolveGrammar");var gw,aur=(gw=class extends bC{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Aa(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:jl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},_(gw,"GastRefResolverVisitor"),gw),mw,our=(mw=class extends k${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=Po(this.path.ruleStack).reverse(),this.occurrenceStack=Po(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(){Gi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},_(mw,"AbstractNextPossibleTokensWalker"),mw),yw,lur=(yw=class extends our{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),s=new Ac({definition:i});this.possibleTokTypes=xC(s),this.found=!0}}},_(yw,"NextAfterTokenWalker"),yw),vw,E$=(vw=class extends k${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}},_(vw,"AbstractNextTerminalAfterProductionWalker"),vw),bw,cur=(bw=class extends E${walkMany(e,r,n){if(e.idx===this.occurrence){const i=Uh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ji&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},_(bw,"NextTerminalAfterManyWalker"),bw),xw,Oye=(xw=class extends E${walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Uh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ji&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},_(xw,"NextTerminalAfterManySepWalker"),xw),ww,uur=(ww=class extends E${walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Uh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ji&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},_(ww,"NextTerminalAfterAtLeastOneWalker"),ww),Tw,Dye=(Tw=class extends E${walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Uh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ji&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},_(Tw,"NextTerminalAfterAtLeastOneSepWalker"),Tw);function PN(t,e,r=[]){r=Po(r);let n=[],i=0;function s(o){return o.concat(Co(t,i+1))}_(s,"remainingPathWith");function a(o){const l=PN(s(o),e,r);return n.concat(l)}for(_(a,"getAlternativesForProd");r.length{Gi(l.definition)===!1&&(n=a(l.definition))}),n;if(o instanceof Ji)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Co(t,i)}),n}_(PN,"possiblePathsFrom");function die(t,e,r,n){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Gi(d);){const f=d.pop();if(f===a){o&&hv(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Gi(p))continue;const v=p[0];if(v===i){const b={idx:g,def:Co(p),ruleStack:sA(m),occurrenceStack:sA(y)};d.push(b)}else if(v instanceof Ji)if(g=0;b--){const x=v.definition[b],T={idx:g,def:x.definition.concat(Co(p)),ruleStack:m,occurrenceStack:y};d.push(T),d.push(a)}else if(v instanceof Ac)d.push({idx:g,def:v.definition.concat(Co(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof vC)d.push(SVe(v,g,m,y));else throw Error("non exhaustive match")}return h}_(die,"nextPossibleTokensAfter");function SVe(t,e,r,n){const i=Po(r);i.push(t.name);const s=Po(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}_(SVe,"expandTopLevelRule");var ks;(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"})(ks||(ks={}));function A$(t){if(t instanceof Oo||t==="Option")return ks.OPTION;if(t instanceof Vs||t==="Repetition")return ks.REPETITION;if(t instanceof hu||t==="RepetitionMandatory")return ks.REPETITION_MANDATORY;if(t instanceof du||t==="RepetitionMandatoryWithSeparator")return ks.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof _c||t==="RepetitionWithSeparator")return ks.REPETITION_WITH_SEPARATOR;if(t instanceof Lc||t==="Alternation")return ks.ALTERNATION;throw Error("non exhaustive match")}_(A$,"getProdType");function yX(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=A$(n);return s===ks.ALTERNATION?Y7(e,r,i):X7(e,r,s,i)}_(yX,"getLookaheadPaths");function EVe(t,e,r,n,i,s){const a=Y7(t,e,r),o=pie(a)?oA:wC;return s(a,n,o,i)}_(EVe,"buildLookaheadFuncForOr");function AVe(t,e,r,n,i,s){const a=X7(t,e,i,r),o=pie(a)?oA:wC;return s(a[0],o,n)}_(AVe,"buildLookaheadFuncForOptionalProd");function MVe(t,e,r,n){const i=t.length,s=Bh(t,a=>Bh(a,o=>o.length===1));if(e)return function(a){const o=_r(a,l=>l.GATE);for(let l=0;l$h(l)),o=su(a,(l,u,h)=>(tn(u,d=>{Xr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{Xr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;as.length===1),i=t.length;if(n&&!r){const s=$h(t);if(s.length===1&&Gi(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=su(s,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sPN([a],1)),n=vX(r.length),i=_r(r,a=>{const o={};return tn(a,l=>{const u=D9(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let s=r;for(let a=1;a<=e;a++){const o=s;s=vX(o.length);for(let l=0;l{const v=D9(y.partialPath);tn(v,b=>{i[l][b]=!0})})}}}}return n}_(fie,"lookAheadSequenceFromAlternatives");function Y7(t,e,r,n){const i=new _Ve(t,ks.ALTERNATION,n);return e.accept(i),fie(i.result,r)}_(Y7,"getLookaheadPathsForOr");function X7(t,e,r,n){const i=new _Ve(t,r);e.accept(i);const s=i.result,o=new hur(e,t,r).startWalking(),l=new Ac({definition:s}),u=new Ac({definition:o});return fie([l,u],n)}_(X7,"getLookaheadPathsForOptionalProd");function $N(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}_(IVe,"isStrictPrefixOfPath");function pie(t){return Bh(t,e=>Bh(e,r=>Bh(r,n=>Gi(n.categoryMatches))))}_(pie,"areTokenCategoriesNotUsed");function NVe(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return _r(e,r=>Object.assign({type:jl.CUSTOM_LOOKAHEAD_VALIDATION},r))}_(NVe,"validateLookahead");function OVe(t,e,r,n){const i=Vu(t,l=>DVe(l,r)),s=qVe(t,e,r),a=Vu(t,l=>VVe(l,r)),o=Vu(t,l=>$Ve(l,t,n,r));return i.concat(s,a,o)}_(OVe,"validateGrammar");function DVe(t,e){const r=new dur;t.accept(r);const n=r.allProductions,i=Ecr(n,PVe),s=Jh(i,o=>o.length>1);return _r(Aa(s),o=>{const l=Uh(o),u=e.buildDuplicateFoundError(t,o),h=mh(l),d={message:u,type:jl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=gie(l);return f&&(d.parameter=f),d})}_(DVe,"validateDuplicateProductions");function PVe(t){return`${mh(t)}_#_${t.idx}_#_${gie(t)}`}_(PVe,"identifyProductionForDuplicates");function gie(t){return t instanceof Ji?t.terminalType.name:t instanceof Ul?t.nonTerminalName:""}_(gie,"getExtraProductionArgument");var Sw,dur=(Sw=class extends bC{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)}},_(Sw,"OccurrenceValidationCollector"),Sw);function $Ve(t,e,r,n){const i=[];if(su(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:jl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}_($Ve,"validateRuleDoesNotAlreadyExist");function BVe(t,e,r){const n=[];let i;return tc(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:jl.INVALID_RULE_OVERRIDE,ruleName:t})),n}_(BVe,"validateRuleIsOverridden");function mie(t,e,r,n=[]){const i=[],s=mE(e.definition);if(Gi(s))return[];{const a=t.name;tc(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:jl.LEFT_RECURSION,ruleName:a});const l=T$(s,n.concat([t])),u=Vu(l,h=>{const d=Po(n);return d.push(h),mie(t,h,r,d)});return i.concat(u)}}_(mie,"validateNoLeftRecursion");function mE(t){let e=[];if(Gi(t))return e;const r=Uh(t);if(r instanceof Ul)e.push(r.referencedRule);else if(r instanceof Ac||r instanceof Oo||r instanceof hu||r instanceof du||r instanceof _c||r instanceof Vs)e=e.concat(mE(r.definition));else if(r instanceof Lc)e=$h(_r(r.definition,s=>mE(s.definition)));else if(!(r instanceof Ji))throw Error("non exhaustive match");const n=aA(r),i=t.length>1;if(n&&i){const s=Co(t);return e.concat(mE(s))}else return e}_(mE,"getFirstNoneTerminal");var Ew,yie=(Ew=class extends bC{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},_(Ew,"OrCollector"),Ew);function FVe(t,e){const r=new yie;t.accept(r);const n=r.alternations;return Vu(n,s=>{const a=sA(s.definition);return Vu(a,(o,l)=>{const u=die([o],[],wC,1);return Gi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:l}),type:jl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:l+1}]:[]})})}_(FVe,"validateEmptyOrAlternative");function zVe(t,e,r){const n=new yie;t.accept(n);let i=n.alternations;return i=C$(i,a=>a.ignoreAmbiguities===!0),Vu(i,a=>{const o=a.idx,l=a.maxLookahead||e,u=Y7(o,t,l,a),h=GVe(u,a,t,r),d=WVe(u,a,t,r);return h.concat(d)})}_(zVe,"validateAmbiguousAlternationAlternatives");var Aw,fur=(Aw=class extends bC{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)}},_(Aw,"RepetitionCollector"),Aw);function VVe(t,e){const r=new yie;t.accept(r);const n=r.alternations;return Vu(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:jl.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}_(VVe,"validateTooManyAlts");function HVe(t,e,r){const n=[];return tn(t,i=>{const s=new fur;i.accept(s);const a=s.allProductions;tn(a,o=>{const l=A$(o),u=o.maxLookahead||e,h=o.idx,f=X7(h,i,l,u)[0];if(Gi($h(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:jl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}_(HVe,"validateSomeNonEmptyLookaheadPath");function GVe(t,e,r,n){const i=[],s=su(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&$N(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!$N(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return _r(s,o=>{const l=_r(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:jl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}_(GVe,"checkAlternativesAmbiguities");function WVe(t,e,r,n){const i=su(t,(a,o,l)=>{const u=_r(o,h=>({idx:l,path:h}));return a.concat(u)},[]);return q7(Vu(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,u=a.path,h=Qu(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:jl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}_(WVe,"checkPrefixAlternativesAmbiguities");function qVe(t,e,r){const n=[],i=_r(e,s=>s.name);return tn(t,s=>{const a=s.name;if(tc(i,a)){const o=r.buildNamespaceConflictError(s);n.push({message:o,type:jl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}_(qVe,"checkTerminalAndNoneTerminalsNameSpace");function UVe(t){const e=eie(t,{errMsgProvider:sur}),r={};return tn(t.rules,n=>{r[n.name]=n}),kVe(r,e.errMsgProvider)}_(UVe,"resolveGrammar");function jVe(t){return t=eie(t,{errMsgProvider:gy}),OVe(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}_(jVe,"validateGrammar");var YVe="MismatchedTokenException",XVe="NoViableAltException",KVe="EarlyExitException",ZVe="NotAllInputParsedException",QVe=[YVe,XVe,KVe,ZVe];Object.freeze(QVe);function lA(t){return tc(QVe,t.name)}_(lA,"isRecognitionException");var Mw,M$=(Mw=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)}},_(Mw,"RecognitionException"),Mw),Rw,JVe=(Rw=class extends M${constructor(e,r,n){super(e,r),this.previousToken=n,this.name=YVe}},_(Rw,"MismatchedTokenException"),Rw),_w,pur=(_w=class extends M${constructor(e,r,n){super(e,r),this.previousToken=n,this.name=XVe}},_(_w,"NoViableAltException"),_w),Lw,gur=(Lw=class extends M${constructor(e,r){super(e,r),this.name=ZVe}},_(Lw,"NotAllInputParsedException"),Lw),Iw,mur=(Iw=class extends M${constructor(e,r,n){super(e,r),this.previousToken=n,this.name=KVe}},_(Iw,"EarlyExitException"),Iw),MH={},eHe="InRuleRecoveryException",Nw,yur=(Nw=class extends Error{constructor(e){super(e),this.name=eHe}},_(Nw,"InRuleRecoveryException"),Nw),Ow,vur=(Ow=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Xr(e,"recoveryEnabled")?e.recoveryEnabled:j0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=tHe)}getTokenToInsert(e){const r=j7(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 s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=_(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new JVe(p,u,this.LA(0));g.resyncedTokens=sA(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,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(a)}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 yur("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Gi(r))return!1;const n=this.LA(1);return w3(r,s=>this.tokenMatcher(n,s))!==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 tc(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=w3(e,s=>hie(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return MH;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 _r(e,(n,i)=>i===0?MH:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=_r(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return $h(e)}getFollowSetFromFollowKey(e){if(e===MH)return[cm];const r=e.ruleName+e.idxInCallingRule+zze+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,cm)||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 sA(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=Po(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return _r(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},_(Ow,"Recoverable"),Ow);function tHe(t,e,r,n,i,s,a){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 s(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=cm,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,a)&&this.tryInRepetitionRecovery(t,e,r,u)}_(tHe,"attemptInRepetitionRecovery");var bur=4,Bm=8,rHe=1<mie(r,r,gy))}validateEmptyOrAlternatives(e){return Vu(e,r=>FVe(r,gy))}validateAmbiguousAlternationAlternatives(e,r){return Vu(e,n=>zVe(n,r,gy))}validateSomeNonEmptyLookaheadPath(e,r){return HVe(e,r,gy)}buildLookaheadForAlternation(e){return EVe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,MVe)}buildLookaheadForOptional(e){return AVe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,A$(e.prodType),RVe)}},_(Dw,"LLkLookaheadStrategy"),Dw),Pw,xur=(Pw=class{initLooksAhead(e){this.dynamicTokensEnabled=Xr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:j0.dynamicTokensEnabled,this.maxLookahead=Xr(e,"maxLookahead")?e.maxLookahead:j0.maxLookahead,this.lookaheadStrategy=Xr(e,"lookaheadStrategy")?e.lookaheadStrategy:new vie({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=iHe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${mh(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=$9(this.fullRuleNameToShort[r.name],rHe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,bX,"Repetition",u.maxLookahead,mh(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,nHe,"Option",u.maxLookahead,mh(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,xX,"RepetitionMandatory",u.maxLookahead,mh(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,P9,"RepetitionMandatoryWithSeparator",u.maxLookahead,mh(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,wX,"RepetitionWithSeparator",u.maxLookahead,mh(u))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=$9(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return $9(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},_(Pw,"LooksAhead"),Pw),$w,wur=($w=class extends bC{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)}},_($w,"DslMethodsCollectorVisitor"),$w),jM=new wur;function iHe(t){jM.reset(),t.accept(jM);const e=jM.dslMethods;return jM.reset(),e}_(iHe,"collectMethods");function TX(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: - ${s.join(` +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof x9?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Pze(t,e){const r=new Mur(t,e);return r.resolveRefs(),r.errors}M(Pze,"resolveGrammar");var bb,Mur=(bb=class extends w9{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){tn(Es(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:jl.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},M(bb,"GastRefResolverVisitor"),bb),vb,Rur=(vb=class extends EP{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=_o(this.path.ruleStack).reverse(),this.occurrenceStack=_o(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(){Gi(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},M(vb,"AbstractNextPossibleTokensWalker"),vb),xb,Lur=(xb=class extends Rur{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=T9(a),this.found=!0}}},M(xb,"NextAfterTokenWalker"),xb),wb,MP=(wb=class extends EP{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}},M(wb,"AbstractNextTerminalAfterProductionWalker"),wb),Tb,Iur=(Tb=class extends MP{walkMany(e,r,n){if(e.idx===this.occurrence){const i=qh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ea&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},M(Tb,"NextTerminalAfterManyWalker"),Tb),Cb,GUe=(Cb=class extends MP{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=qh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ea&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},M(Cb,"NextTerminalAfterManySepWalker"),Cb),kb,Nur=(kb=class extends MP{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=qh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ea&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},M(kb,"NextTerminalAfterAtLeastOneWalker"),kb),Sb,WUe=(Sb=class extends MP{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=qh(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ea&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},M(Sb,"NextTerminalAfterAtLeastOneSepWalker"),Sb);function $N(t,e,r=[]){r=_o(r);let n=[],i=0;function a(o){return o.concat(To(t,i+1))}M(a,"remainingPathWith");function s(o){const l=$N(a(o),e,r);return n.concat(l)}for(M(s,"getAlternativesForProd");r.length{Gi(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof ea)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:To(t,i)}),n}M($N,"possiblePathsFrom");function vie(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:[]});!Gi(d);){const f=d.pop();if(f===s){o&&p5(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,U=f.occurrenceStack;if(Gi(p))continue;const y=p[0];if(y===i){const b={idx:g,def:To(p),ruleStack:lC(m),occurrenceStack:lC(U)};d.push(b)}else if(y instanceof ea)if(g=0;b--){const v=y.definition[b],w={idx:g,def:v.definition.concat(To(p)),ruleStack:m,occurrenceStack:U};d.push(w),d.push(s)}else if(y instanceof Ec)d.push({idx:g,def:y.definition.concat(To(p)),ruleStack:m,occurrenceStack:U});else if(y instanceof x9)d.push(Bze(y,g,m,U));else throw Error("non exhaustive match")}return h}M(vie,"nextPossibleTokensAfter");function Bze(t,e,r,n){const i=_o(r);i.push(t.name);const a=_o(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}M(Bze,"expandTopLevelRule");var Ta;(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"})(Ta||(Ta={}));function RP(t){if(t instanceof Do||t==="Option")return Ta.OPTION;if(t instanceof Fa||t==="Repetition")return Ta.REPETITION;if(t instanceof hu||t==="RepetitionMandatory")return Ta.REPETITION_MANDATORY;if(t instanceof du||t==="RepetitionMandatoryWithSeparator")return Ta.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Rc||t==="RepetitionWithSeparator")return Ta.REPETITION_WITH_SEPARATOR;if(t instanceof Lc||t==="Alternation")return Ta.ALTERNATION;throw Error("non exhaustive match")}M(RP,"getProdType");function CX(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=RP(n);return a===Ta.ALTERNATION?Zk(e,r,i):Jk(e,r,a,i)}M(CX,"getLookaheadPaths");function $ze(t,e,r,n,i,a){const s=Zk(t,e,r),o=wie(s)?uC:C9;return a(s,n,o,i)}M($ze,"buildLookaheadFuncForOr");function Fze(t,e,r,n,i,a){const s=Jk(t,e,i,r),o=wie(s)?uC:C9;return a(s[0],o,n)}M(Fze,"buildLookaheadFuncForOptionalProd");function zze(t,e,r,n){const i=t.length,a=Bh(t,s=>Bh(s,o=>o.length===1));if(e)return function(s){const o=Lr(s,l=>l.GATE);for(let l=0;lPh(l)),o=au(s,(l,u,h)=>(tn(u,d=>{Xr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),tn(d.categoryMatches,f=>{Xr(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=Ph(t);if(a.length===1&&Gi(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=au(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,tn(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;a$N([s],1)),n=kX(r.length),i=Lr(r,s=>{const o={};return tn(s,l=>{const u=BM(l.partialPath);tn(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=kX(o.length);for(let l=0;l{const y=BM(U.partialPath);tn(y,b=>{i[l][b]=!0})})}}}}return n}M(xie,"lookAheadSequenceFromAlternatives");function Zk(t,e,r,n){const i=new Hze(t,Ta.ALTERNATION,n);return e.accept(i),xie(i.result,r)}M(Zk,"getLookaheadPathsForOr");function Jk(t,e,r,n){const i=new Hze(t,r);e.accept(i);const a=i.result,o=new Dur(e,t,r).startWalking(),l=new Ec({definition:a}),u=new Ec({definition:o});return xie([l,u],n)}M(Jk,"getLookaheadPathsForOptionalProd");function FN(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}M(Wze,"isStrictPrefixOfPath");function wie(t){return Bh(t,e=>Bh(e,r=>Bh(r,n=>Gi(n.categoryMatches))))}M(wie,"areTokenCategoriesNotUsed");function qze(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Lr(e,r=>Object.assign({type:jl.CUSTOM_LOOKAHEAD_VALIDATION},r))}M(qze,"validateLookahead");function jze(t,e,r,n){const i=zu(t,l=>Yze(l,r)),a=iVe(t,e,r),s=zu(t,l=>eVe(l,r)),o=zu(t,l=>Kze(l,t,n,r));return i.concat(a,s,o)}M(jze,"validateGrammar");function Yze(t,e){const r=new Our;t.accept(r);const n=r.allProductions,i=Xcr(n,Xze),a=Qh(i,o=>o.length>1);return Lr(Es(a),o=>{const l=qh(o),u=e.buildDuplicateFoundError(t,o),h=mh(l),d={message:u,type:jl.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=Tie(l);return f&&(d.parameter=f),d})}M(Yze,"validateDuplicateProductions");function Xze(t){return`${mh(t)}_#_${t.idx}_#_${Tie(t)}`}M(Xze,"identifyProductionForDuplicates");function Tie(t){return t instanceof ea?t.terminalType.name:t instanceof ql?t.nonTerminalName:""}M(Tie,"getExtraProductionArgument");var Mb,Our=(Mb=class extends w9{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)}},M(Mb,"OccurrenceValidationCollector"),Mb);function Kze(t,e,r,n){const i=[];if(au(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:jl.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}M(Kze,"validateRuleDoesNotAlreadyExist");function Zze(t,e,r){const n=[];let i;return tc(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:jl.INVALID_RULE_OVERRIDE,ruleName:t})),n}M(Zze,"validateRuleIsOverridden");function Cie(t,e,r,n=[]){const i=[],a=vw(e.definition);if(Gi(a))return[];{const s=t.name;tc(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:jl.LEFT_RECURSION,ruleName:s});const l=kP(a,n.concat([t])),u=zu(l,h=>{const d=_o(n);return d.push(h),Cie(t,h,r,d)});return i.concat(u)}}M(Cie,"validateNoLeftRecursion");function vw(t){let e=[];if(Gi(t))return e;const r=qh(t);if(r instanceof ql)e.push(r.referencedRule);else if(r instanceof Ec||r instanceof Do||r instanceof hu||r instanceof du||r instanceof Rc||r instanceof Fa)e=e.concat(vw(r.definition));else if(r instanceof Lc)e=Ph(Lr(r.definition,a=>vw(a.definition)));else if(!(r instanceof ea))throw Error("non exhaustive match");const n=cC(r),i=t.length>1;if(n&&i){const a=To(t);return e.concat(vw(a))}else return e}M(vw,"getFirstNoneTerminal");var Rb,kie=(Rb=class extends w9{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},M(Rb,"OrCollector"),Rb);function Jze(t,e){const r=new kie;t.accept(r);const n=r.alternations;return zu(n,a=>{const s=lC(a.definition);return zu(s,(o,l)=>{const u=vie([o],[],C9,1);return Gi(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:jl.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}M(Jze,"validateEmptyOrAlternative");function Qze(t,e,r){const n=new kie;t.accept(n);let i=n.alternations;return i=SP(i,s=>s.ignoreAmbiguities===!0),zu(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=Zk(o,t,l,s),h=rVe(u,s,t,r),d=nVe(u,s,t,r);return h.concat(d)})}M(Qze,"validateAmbiguousAlternationAlternatives");var Lb,_ur=(Lb=class extends w9{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)}},M(Lb,"RepetitionCollector"),Lb);function eVe(t,e){const r=new kie;t.accept(r);const n=r.alternations;return zu(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:jl.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}M(eVe,"validateTooManyAlts");function tVe(t,e,r){const n=[];return tn(t,i=>{const a=new _ur;i.accept(a);const s=a.allProductions;tn(s,o=>{const l=RP(o),u=o.maxLookahead||e,h=o.idx,f=Jk(h,i,l,u)[0];if(Gi(Ph(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:jl.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}M(tVe,"validateSomeNonEmptyLookaheadPath");function rVe(t,e,r,n){const i=[],a=au(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||tn(l,h=>{const d=[u];tn(t,(f,p)=>{u!==p&&FN(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!FN(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return Lr(a,o=>{const l=Lr(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:jl.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}M(rVe,"checkAlternativesAmbiguities");function nVe(t,e,r,n){const i=au(t,(s,o,l)=>{const u=Lr(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return Yk(zu(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=Ju(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:jl.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}M(nVe,"checkPrefixAlternativesAmbiguities");function iVe(t,e,r){const n=[],i=Lr(e,a=>a.name);return tn(t,a=>{const s=a.name;if(tc(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:jl.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}M(iVe,"checkTerminalAndNoneTerminalsNameSpace");function aVe(t){const e=lie(t,{errMsgProvider:Aur}),r={};return tn(t.rules,n=>{r[n.name]=n}),Pze(r,e.errMsgProvider)}M(aVe,"resolveGrammar");function sVe(t){return t=lie(t,{errMsgProvider:yU}),jze(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}M(sVe,"validateGrammar");var oVe="MismatchedTokenException",lVe="NoViableAltException",cVe="EarlyExitException",uVe="NotAllInputParsedException",hVe=[oVe,lVe,cVe,uVe];Object.freeze(hVe);function hC(t){return tc(hVe,t.name)}M(hC,"isRecognitionException");var Ib,LP=(Ib=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)}},M(Ib,"RecognitionException"),Ib),Nb,dVe=(Nb=class extends LP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=oVe}},M(Nb,"MismatchedTokenException"),Nb),Db,Pur=(Db=class extends LP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=lVe}},M(Db,"NoViableAltException"),Db),Ob,Bur=(Ob=class extends LP{constructor(e,r){super(e,r),this.name=uVe}},M(Ob,"NotAllInputParsedException"),Ob),_b,$ur=(_b=class extends LP{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=cVe}},M(_b,"EarlyExitException"),_b),NV={},fVe="InRuleRecoveryException",Pb,Fur=(Pb=class extends Error{constructor(e){super(e),this.name=fVe}},M(Pb,"InRuleRecoveryException"),Pb),Bb,zur=(Bb=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Xr(e,"recoveryEnabled")?e.recoveryEnabled:Y0.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=pVe)}getTokenToInsert(e){const r=Kk(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=M(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new dVe(p,u,this.LA(0));g.resyncedTokens=lC(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 Fur("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Gi(r))return!1;const n=this.LA(1);return C4(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 tc(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=C4(e,a=>bie(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return NV;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 Lr(e,(n,i)=>i===0?NV:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Lr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ph(e)}getFollowSetFromFollowKey(e){if(e===NV)return[h1];const r=e.ruleName+e.idxInCallingRule+QFe+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,h1)||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 lC(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=_o(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Lr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},M(Bb,"Recoverable"),Bb);function pVe(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=h1,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}M(pVe,"attemptInRepetitionRecovery");var Vur=4,F1=8,gVe=1<Cie(r,r,yU))}validateEmptyOrAlternatives(e){return zu(e,r=>Jze(r,yU))}validateAmbiguousAlternationAlternatives(e,r){return zu(e,n=>Qze(n,r,yU))}validateSomeNonEmptyLookaheadPath(e,r){return tVe(e,r,yU)}buildLookaheadForAlternation(e){return $ze(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,zze)}buildLookaheadForOptional(e){return Fze(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,RP(e.prodType),Vze)}},M($b,"LLkLookaheadStrategy"),$b),Fb,Hur=(Fb=class{initLooksAhead(e){this.dynamicTokensEnabled=Xr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Y0.dynamicTokensEnabled,this.maxLookahead=Xr(e,"maxLookahead")?e.maxLookahead:Y0.maxLookahead,this.lookaheadStrategy=Xr(e,"lookaheadStrategy")?e.lookaheadStrategy:new Sie({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){tn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=UVe(r);tn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${mh(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=FM(this.fullRuleNameToShort[r.name],gVe,u.idx);this.setLaFuncCache(f,d)})}),tn(i,u=>{this.computeLookaheadFunc(r,u.idx,SX,"Repetition",u.maxLookahead,mh(u))}),tn(a,u=>{this.computeLookaheadFunc(r,u.idx,mVe,"Option",u.maxLookahead,mh(u))}),tn(s,u=>{this.computeLookaheadFunc(r,u.idx,EX,"RepetitionMandatory",u.maxLookahead,mh(u))}),tn(o,u=>{this.computeLookaheadFunc(r,u.idx,$M,"RepetitionMandatoryWithSeparator",u.maxLookahead,mh(u))}),tn(l,u=>{this.computeLookaheadFunc(r,u.idx,AX,"RepetitionWithSeparator",u.maxLookahead,mh(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=FM(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return FM(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},M(Fb,"LooksAhead"),Fb),zb,Gur=(zb=class extends w9{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)}},M(zb,"DslMethodsCollectorVisitor"),zb),KE=new Gur;function UVe(t){KE.reset(),t.accept(KE);const e=KE.dslMethods;return KE.reset(),e}M(UVe,"collectMethods");function MX(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}_(lHe,"createBaseSemanticVisitorConstructor");function cHe(t,e,r){const n=_(function(){},"derivedConstructor");bie(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,s=>{i[s]=oHe}),n.prototype=i,n.prototype.constructor=n,n}_(cHe,"createBaseVisitorConstructorWithDefaults");var kX;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(kX||(kX={}));function uHe(t,e){return hHe(t,e)}_(uHe,"validateVisitor");function hHe(t,e){const r=Qu(e,i=>yp(t[i])===!1),n=_r(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:kX.MISSING_METHOD,methodName:i}));return q7(n)}_(hHe,"validateMissingCstMethods");var Bw,Cur=(Bw=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Xr(e,"nodeLocationTracking")?e.nodeLocationTracking:j0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ga,this.cstFinallyStateUpdate=Ga,this.cstPostTerminal=Ga,this.cstPostNonTerminal=Ga,this.cstPostRule=Ga;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=CX,this.setNodeLocationFromNode=CX,this.cstPostRule=Ga,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ga,this.setNodeLocationFromNode=Ga,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=TX,this.setNodeLocationFromNode=TX,this.cstPostRule=Ga,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ga,this.setNodeLocationFromNode=Ga,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ga,this.setNodeLocationFromNode=Ga,this.cstPostRule=Ga,this.setInitialNodeLocation=Ga;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];sHe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];aHe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(q0(this.baseCstVisitorConstructor)){const e=lHe(this.className,nu(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(q0(this.baseCstVisitorWithDefaultsConstructor)){const e=cHe(this.className,nu(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]}},_(Bw,"TreeBuilder"),Bw),Fw,kur=(Fw=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)):BN}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?BN: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()}},_(Fw,"LexerAdapter"),Fw),zw,Sur=(zw=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=FN){if(tc(this.definedRulesNames,e)){const a={message:gy.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:jl.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=FN){const i=BVe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,r,n);return this[e]=s,s}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(lA(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Oze(Aa(this.gastProductionsCache))}},_(zw,"RecognizerApi"),zw),Vw,Eur=(Vw=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=oA,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Xr(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}M(xVe,"createBaseSemanticVisitorConstructor");function wVe(t,e,r){const n=M(function(){},"derivedConstructor");Eie(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return tn(e,a=>{i[a]=vVe}),n.prototype=i,n.prototype.constructor=n,n}M(wVe,"createBaseVisitorConstructorWithDefaults");var LX;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(LX||(LX={}));function TVe(t,e){return CVe(t,e)}M(TVe,"validateVisitor");function CVe(t,e){const r=Ju(e,i=>yp(t[i])===!1),n=Lr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:LX.MISSING_METHOD,methodName:i}));return Yk(n)}M(CVe,"validateMissingCstMethods");var Vb,qur=(Vb=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Xr(e,"nodeLocationTracking")?e.nodeLocationTracking:Y0.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Hs,this.cstFinallyStateUpdate=Hs,this.cstPostTerminal=Hs,this.cstPostNonTerminal=Hs,this.cstPostRule=Hs;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=RX,this.setNodeLocationFromNode=RX,this.cstPostRule=Hs,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Hs,this.setNodeLocationFromNode=Hs,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=MX,this.setNodeLocationFromNode=MX,this.cstPostRule=Hs,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Hs,this.setNodeLocationFromNode=Hs,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Hs,this.setNodeLocationFromNode=Hs,this.cstPostRule=Hs,this.setInitialNodeLocation=Hs;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];yVe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];bVe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(q0(this.baseCstVisitorConstructor)){const e=xVe(this.className,nu(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(q0(this.baseCstVisitorWithDefaultsConstructor)){const e=wVe(this.className,nu(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]}},M(Vb,"TreeBuilder"),Vb),Hb,jur=(Hb=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)):zN}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?zN: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()}},M(Hb,"LexerAdapter"),Hb),Gb,Yur=(Gb=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=VN){if(tc(this.definedRulesNames,e)){const s={message:yU.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:jl.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=VN){const i=Zze(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(hC(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return jFe(Es(this.gastProductionsCache))}},M(Gb,"RecognizerApi"),Gb),Wb,Xur=(Wb=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=uC,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Xr(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(ei(e)){if(Gi(e))throw Error(`A Token Vocabulary cannot be empty. + For Further details.`);if(ti(e)){if(Gi(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(ei(e))this.tokensMap=su(e,(s,a)=>(s[a.name]=a,s),{});else if(Xr(e,"modes")&&Bh($h(Aa(e.modes)),TVe)){const s=$h(Aa(e.modes)),a=tie(s);this.tokensMap=su(a,(o,l)=>(o[l.name]=l,o),{})}else if(Yu(e))this.tokensMap=Po(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=cm;const n=Xr(e,"modes")?$h(Aa(e.modes)):Aa(e),i=Bh(n,s=>Gi(s.categoryMatches));this.tokenMatcher=i?oA:wC,TC(Aa(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=Xr(n,"resyncEnabled")?n.resyncEnabled:FN.resyncEnabled,s=Xr(n,"recoveryValueFunc")?n.recoveryValueFunc:FN.recoveryValueFunc,a=this.ruleShortNameIdx<a.call(this)&&o.call(this),"lookAheadFunc")}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(xX,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const a=r.GATE;if(a!==void 0){const o=i;i=_(()=>a.call(this)&&o.call(this),"lookAheadFunc")}}else s=r;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ks.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,xX,e,uur)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(P9,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=_(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Dye],o,P9,e,Dye)}else throw this.raiseEarlyExitException(e,ks.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(bX,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),s;if(typeof r!="function"){s=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=_(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else s=r;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,bX,e,cur,a)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(wX,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,s=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=_(()=>this.tokenMatcher(this.LA(1),s),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Oye],o,wX,e,Oye)}}repetitionSepSecondInternal(e,r,n,i,s){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,s],n,P9,e,s)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(rHe,r),i=ei(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].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 gur(r,e))}}subruleInternal(e,r,n){let i;try{const s=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,s),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,n,e.ruleName)}}subruleInternalError(e,r,n){throw lA(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 s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,n)}catch(s){i=this.consumeInternalRecovery(e,r,s)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const s=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new JVe(i,r,s))}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(s){throw s.name===eHe?n:s}}else throw n}saveRecogState(){const e=this.errors,r=Po(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),cm)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},_(Vw,"RecognizerEngine"),Vw),Hw,Aur=(Hw=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Xr(e,"errorMessageProvider")?e.errorMessageProvider:j0.errorMessageProvider}SAVE_ERROR(e){if(lA(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Po(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Po(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=X7(e,s,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 mur(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],s=Y7(e,i,this.maxLookahead),a=[];for(let u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new pur(l,this.LA(1),o))}},_(Hw,"ErrorHandler"),Hw),Gw,Mur=(Gw=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(q0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return die([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Uh(e.ruleStack),i=this.getGAstProductions()[r];return new lur(i,e).startWalking()}},_(Gw,"ContentAssist"),Gw),R$={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(R$);var Pye=!0,$ye=Math.pow(2,Bm)-1,dHe=wx({name:"RECORDING_PHASE_TOKEN",pattern:zl.NA});TC([dHe]);var fHe=j7(dHe,`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(fHe);var Rur={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Ww,_ur=(Ww=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 BN}topLevelRuleRecord(e,r){try{const n=new vC({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(ti(e))this.tokensMap=au(e,(a,s)=>(a[s.name]=s,a),{});else if(Xr(e,"modes")&&Bh(Ph(Es(e.modes)),Oze)){const a=Ph(Es(e.modes)),s=cie(a);this.tokensMap=au(s,(o,l)=>(o[l.name]=l,o),{})}else if(Yu(e))this.tokensMap=_o(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=h1;const n=Xr(e,"modes")?Ph(Es(e.modes)):Es(e),i=Bh(n,a=>Gi(a.categoryMatches));this.tokenMatcher=i?uC:C9,k9(Es(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=Xr(n,"resyncEnabled")?n.resyncEnabled:VN.resyncEnabled,a=Xr(n,"recoveryValueFunc")?n.recoveryValueFunc:VN.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(EX,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=M(()=>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,Ta.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,EX,e,Nur)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead($M,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=M(()=>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,WUe],o,$M,e,WUe)}else throw this.raiseEarlyExitException(e,Ta.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(SX,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=M(()=>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,SX,e,Iur,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(AX,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=M(()=>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,GUe],o,AX,e,GUe)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,$M,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(gVe,r),i=ti(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 Bur(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 hC(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 dVe(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===fVe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=_o(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),h1)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},M(Wb,"RecognizerEngine"),Wb),qb,Kur=(qb=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Xr(e,"errorMessageProvider")?e.errorMessageProvider:Y0.errorMessageProvider}SAVE_ERROR(e){if(hC(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:_o(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return _o(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=Jk(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 $ur(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Zk(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 Pur(l,this.LA(1),o))}},M(qb,"ErrorHandler"),qb),jb,Zur=(jb=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(q0(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return vie([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=qh(e.ruleStack),i=this.getGAstProductions()[r];return new Lur(i,e).startWalking()}},M(jb,"ContentAssist"),jb),IP={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(IP);var qUe=!0,jUe=Math.pow(2,F1)-1,kVe=k6({name:"RECORDING_PHASE_TOKEN",pattern:Fl.NA});k9([kVe]);var SVe=Kk(kVe,`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(SVe);var Jur={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Yb,Qur=(Yb=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 zN}topLevelRuleRecord(e,r){try{const n=new x9({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 cb.call(this,Oo,e,r)}atLeastOneInternalRecord(e,r){cb.call(this,hu,r,e)}atLeastOneSepFirstInternalRecord(e,r){cb.call(this,du,r,e,Pye)}manyInternalRecord(e,r){cb.call(this,Vs,r,e)}manySepFirstInternalRecord(e,r){cb.call(this,_c,r,e,Pye)}orInternalRecord(e,r){return pHe.call(this,e,r)}subruleInternalRecord(e,r,n){if(cA(r),!e||Xr(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=hv(this.recordingProdStack),s=e.ruleName,a=new Ul({idx:r,nonTerminalName:s,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Rur:R$}consumeInternalRecord(e,r,n){if(cA(r),!cie(e)){const a=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=hv(this.recordingProdStack),s=new Ji({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(s),fHe}},_(Ww,"GastRecorder"),Ww);function cb(t,e,r,n=!1){cA(r);const i=hv(this.recordingProdStack),s=yp(e)?e:e.DEF,a=new t({definition:[],idx:r});return n&&(a.separator=e.SEP),Xr(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),R$}_(cb,"recordProd");function pHe(t,e){cA(e);const r=hv(this.recordingProdStack),n=ei(t)===!1,i=n===!1?t:t.DEF,s=new Lc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Xr(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=Rze(i,o=>yp(o.GATE));return s.hasPredicates=a,r.definition.push(s),tn(i,o=>{const l=new Ac({definition:[]});s.definition.push(l),Xr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Xr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),R$}_(pHe,"recordOrProd");function SX(t){return t===0?"":`${t}`}_(SX,"getIdxSuffix");function cA(t){if(t<0||t>$ye){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${$ye+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}_(cA,"assertMethodIdxIsValid");var qw,Lur=(qw=class{initPerformanceTracer(e){if(Xr(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=j0.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:s}=nie(r),a=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,s}else return r()}},_(qw,"PerformanceTracer"),qw);function gHe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=r.prototype[i]})})}_(gHe,"applyMixins");var BN=j7(cm,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(BN);var j0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ub,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),FN=Object.freeze({recoveryValueFunc:_(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),jl;(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"})(jl||(jl={}));function EX(t=void 0){return function(){return t}}_(EX,"EMPTY_ALT");var Ny,xie=(Ny=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",()=>{iie(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),tn(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=UVe({rules:Aa(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Gi(n)&&this.skipValidations===!1){const i=jVe({rules:Aa(this.gastProductionsCache),tokenTypes:Aa(this.tokensMap),errMsgProvider:gy,grammarName:r}),s=NVe({lookaheadStrategy:this.lookaheadStrategy,rules:Aa(this.gastProductionsCache),tokenTypes:Aa(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,s)}}),Gi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Vze(Aa(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Aa(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Aa(this.gastProductionsCache))})),!Ny.DEFER_DEFINITION_ERRORS_HANDLING&&!Gi(this.definitionErrors))throw e=_r(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 dy.call(this,Do,e,r)}atLeastOneInternalRecord(e,r){dy.call(this,hu,r,e)}atLeastOneSepFirstInternalRecord(e,r){dy.call(this,du,r,e,qUe)}manyInternalRecord(e,r){dy.call(this,Fa,r,e)}manySepFirstInternalRecord(e,r){dy.call(this,Rc,r,e,qUe)}orInternalRecord(e,r){return EVe.call(this,e,r)}subruleInternalRecord(e,r,n){if(dC(r),!e||Xr(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=p5(this.recordingProdStack),a=e.ruleName,s=new ql({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?Jur:IP}consumeInternalRecord(e,r,n){if(dC(r),!Uie(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=p5(this.recordingProdStack),a=new ea({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),SVe}},M(Yb,"GastRecorder"),Yb);function dy(t,e,r,n=!1){dC(r);const i=p5(this.recordingProdStack),a=yp(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Xr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),IP}M(dy,"recordProd");function EVe(t,e){dC(e);const r=p5(this.recordingProdStack),n=ti(t)===!1,i=n===!1?t:t.DEF,a=new Lc({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Xr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=VFe(i,o=>yp(o.GATE));return a.hasPredicates=s,r.definition.push(a),tn(i,o=>{const l=new Ec({definition:[]});a.definition.push(l),Xr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:Xr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),IP}M(EVe,"recordOrProd");function IX(t){return t===0?"":`${t}`}M(IX,"getIdxSuffix");function dC(t){if(t<0||t>jUe){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${jUe+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}M(dC,"assertMethodIdxIsValid");var Xb,ehr=(Xb=class{initPerformanceTracer(e){if(Xr(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=Y0.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}=hie(r),s=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},M(Xb,"PerformanceTracer"),Xb);function AVe(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]})})}M(AVe,"applyMixins");var zN=Kk(h1,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(zN);var Y0=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ky,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),VN=Object.freeze({recoveryValueFunc:M(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),jl;(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"})(jl||(jl={}));function NX(t=void 0){return function(){return t}}M(NX,"EMPTY_ALT");var _U,Aie=(_U=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",()=>{die(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),tn(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=aVe({rules:Es(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Gi(n)&&this.skipValidations===!1){const i=sVe({rules:Es(this.gastProductionsCache),tokenTypes:Es(this.tokensMap),errMsgProvider:yU,grammarName:r}),a=qze({lookaheadStrategy:this.lookaheadStrategy,rules:Es(this.gastProductionsCache),tokenTypes:Es(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Gi(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=eze(Es(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:Es(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Es(this.gastProductionsCache))})),!_U.DEFER_DEFINITION_ERRORS_HANDLING&&!Gi(this.definitionErrors))throw e=Lr(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),Xr(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=Xr(r,"skipValidations")?r.skipValidations:j0.skipValidations}},_(Ny,"Parser"),Ny);xie.DEFER_DEFINITION_ERRORS_HANDLING=!1;gHe(xie,[vur,xur,Cur,kur,Eur,Sur,Aur,Mur,_ur,Lur]);var Uw,Iur=(Uw=class extends xie{constructor(e,r=j0){const n=Po(r);n.outputCst=!1,super(e,n)}},_(Uw,"EmbeddedActionsParser"),Uw);function mHe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}_(kHe,"listCacheHas");var Bur=kHe;function SHe(t,e){var r=this.__data__,n=_$(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}_(SHe,"listCacheSet");var Fur=SHe;function Xv(t){var e=-1,r=t==null?0:t.length;for(this.clear();++eo))return!1;var u=s.get(t),h=s.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&qhr?new iGe:void 0;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Edr}_(AGe,"isLength");var Cie=AGe,Adr="[object Arguments]",Mdr="[object Array]",Rdr="[object Boolean]",_dr="[object Date]",Ldr="[object Error]",Idr="[object Function]",Ndr="[object Map]",Odr="[object Number]",Ddr="[object Object]",Pdr="[object RegExp]",$dr="[object Set]",Bdr="[object String]",Fdr="[object WeakMap]",zdr="[object ArrayBuffer]",Vdr="[object DataView]",Hdr="[object Float32Array]",Gdr="[object Float64Array]",Wdr="[object Int8Array]",qdr="[object Int16Array]",Udr="[object Int32Array]",jdr="[object Uint8Array]",Ydr="[object Uint8ClampedArray]",Xdr="[object Uint16Array]",Kdr="[object Uint32Array]",Ki={};Ki[Hdr]=Ki[Gdr]=Ki[Wdr]=Ki[qdr]=Ki[Udr]=Ki[jdr]=Ki[Ydr]=Ki[Xdr]=Ki[Kdr]=!0;Ki[Adr]=Ki[Mdr]=Ki[zdr]=Ki[Rdr]=Ki[Vdr]=Ki[_dr]=Ki[Ldr]=Ki[Idr]=Ki[Ndr]=Ki[Odr]=Ki[Ddr]=Ki[Pdr]=Ki[$dr]=Ki[Bdr]=Ki[Fdr]=!1;function MGe(t){return T3(t)&&Cie(t.length)&&!!Ki[CC(t)]}_(MGe,"baseIsTypedArray");var Zdr=MGe;function RGe(t){return function(e){return t(e)}}_(RGe,"baseUnary");var Qdr=RGe,_Ge=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yE=_Ge&&typeof module=="object"&&module&&!module.nodeType&&module,Jdr=yE&&yE.exports===_Ge,LH=Jdr&&_He.process,efr=(function(){try{var t=yE&&yE.require&&yE.require("util").types;return t||LH&&LH.binding&&LH.binding("util")}catch{}})(),jye=efr,Yye=jye&&jye.isTypedArray,tfr=Yye?Qdr(Yye):Zdr,kie=tfr,rfr=Object.prototype,nfr=rfr.hasOwnProperty;function LGe(t,e){var r=Yl(t),n=!r&&O$(t),i=!r&&!n&&zN(t),s=!r&&!n&&!i&&kie(t),a=r||n||i||s,o=a?gdr(t.length,String):[],l=o.length;for(var u in t)(e||nfr.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||EGe(u,l)))&&o.push(u);return o}_(LGe,"arrayLikeKeys");var ifr=LGe,sfr=Object.prototype;function IGe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||sfr;return t===r}_(IGe,"isPrototype");var NGe=IGe;function OGe(t,e){return function(r){return t(e(r))}}_(OGe,"overArg");var afr=OGe,ofr=afr(Object.keys,Object),lfr=ofr,cfr=Object.prototype,ufr=cfr.hasOwnProperty;function DGe(t){if(!NGe(t))return lfr(t);var e=[];for(var r in Object(t))ufr.call(t,r)&&r!="constructor"&&e.push(r);return e}_(DGe,"baseKeys");var PGe=DGe;function $Ge(t){return t!=null&&Cie(t.length)&&!$He(t)}_($Ge,"isArrayLike");var D$=$Ge;function BGe(t){return D$(t)?ifr(t):PGe(t)}_(BGe,"keys");var Sie=BGe;function FGe(t){return cdr(t,Sie,pdr)}_(FGe,"getAllKeys");var Xye=FGe,hfr=1,dfr=Object.prototype,ffr=dfr.hasOwnProperty;function zGe(t,e,r,n,i,s){var a=r&hfr,o=Xye(t),l=o.length,u=Xye(e),h=u.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in e:ffr.call(e,f)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var m=!0;s.set(t,e),s.set(e,t);for(var y=a;++dNie(t,e,a));return e2(t,e,n,r,...i)}_(IWe,"alternation");function NWe(t,e,r){const n=Da(t,e,r,{type:um});bp(t,n);const i=e2(t,e,n,r,Fm(t,e,r));return OWe(t,e,r,i)}_(NWe,"option");function Fm(t,e,r){const n=u0r(u0(r.definition,i=>Nie(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:PWe(t,n)}_(Fm,"block");function Oie(t,e,r,n,i){const s=n.left,a=n.right,o=Da(t,e,r,{type:g0r});bp(t,o);const l=Da(t,e,r,{type:kWe});return s.loopback=o,l.loopback=o,t.decisionMap[fv(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Ks(a,o),i===void 0?(Ks(o,s),Ks(o,l)):(Ks(o,l),Ks(o,i.left),Ks(i.right,s)),{left:s,right:l}}_(Oie,"plus");function Die(t,e,r,n,i){const s=n.left,a=n.right,o=Da(t,e,r,{type:p0r});bp(t,o);const l=Da(t,e,r,{type:kWe}),u=Da(t,e,r,{type:f0r});return o.loopback=u,l.loopback=u,Ks(o,s),Ks(o,l),Ks(a,u),i!==void 0?(Ks(u,l),Ks(u,i.left),Ks(i.right,s)):Ks(u,o),t.decisionMap[fv(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}_(Die,"star");function OWe(t,e,r,n){const i=n.left,s=n.right;return Ks(i,s),t.decisionMap[fv(e,"Option",r.idx)]=i,n}_(OWe,"optional");function bp(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}_(bp,"defineDecisionState");function e2(t,e,r,n,...i){const s=Da(t,e,n,{type:d0r,start:r});r.end=s;for(const o of i)o!==void 0?(Ks(r,o.left),Ks(o.right,s)):Ks(r,s);const a={left:r,right:s};return t.decisionMap[fv(e,DWe(n),n.idx)]=r,a}_(e2,"makeAlts");function DWe(t){if(t instanceof Lc)return"Alternation";if(t instanceof Oo)return"Option";if(t instanceof Vs)return"Repetition";if(t instanceof _c)return"RepetitionWithSeparator";if(t instanceof hu)return"RepetitionMandatory";if(t instanceof du)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}_(DWe,"getProdType");function PWe(t,e){const r=e.length;for(let s=0;se.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},_(Zw,"ATNConfigSet"),Zw);function Pie(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}_(Pie,"getATNConfigKey");function zWe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?$ie(o,e-1,r,n,i):pGe(i,o):n||(i[i.length]=o)}return i}_($ie,"baseFlatten");var WWe=$ie;function qWe(t,e){return WWe(u0(t,e),1)}_(qWe,"flatMap");var x0r=qWe;function UWe(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s-1}_(KWe,"arrayIncludes");var S0r=KWe;function ZWe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=L0r){var u=e?null:_0r(t);if(u)return Tie(u);a=!1,i=oGe,l=new iGe}else l=e?[]:o;e:for(;++n{const i=n.toString();let s=r[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},r[i]=s),s}}_(cqe,"createDFACache");var Qw,uqe=(Qw=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=EWe(e.rules),this.dfas=hqe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=fv(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=u0(yX({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>u0(f,p=>p[0]));if(IX(d,!1)&&!s){const f=ove(d,(p,g,m)=>(IH(g,y=>{y&&(p[y.tokenTypeIdx]=m,IH(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 uqe,g=f===void 0?0:f.length;for(let y=0;yu0(f,p=>p[0]));if(IX(d)&&d[0][0]&&!s){const f=d[0],p=O0r(f);if(p.length===1&&V0r(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=ove(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,IH(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=F9.call(this,a,h,lve,o);return typeof f=="object"?!1:f===0}}},_(Jw,"LLStarLookaheadStrategy"),Jw);function IX(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const s of n){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}_(IX,"isLL1Sequence");function hqe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n_y(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${mqe(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=Xr(r,"skipValidations")?r.skipValidations:Y0.skipValidations}},M(_U,"Parser"),_U);Aie.DEFER_DEFINITION_ERRORS_HANDLING=!1;AVe(Aie,[zur,Hur,qur,jur,Xur,Yur,Kur,Zur,Qur,ehr]);var Kb,thr=(Kb=class extends Aie{constructor(e,r=Y0){const n=_o(r);n.outputCst=!1,super(e,n)}},M(Kb,"EmbeddedActionsParser"),Kb);function MVe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}M(PVe,"listCacheHas");var ohr=PVe;function BVe(t,e){var r=this.__data__,n=NP(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}M(BVe,"listCacheSet");var lhr=BVe;function J5(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&pdr?new UHe:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Xdr}M(FHe,"isLength");var Lie=FHe,Kdr="[object Arguments]",Zdr="[object Array]",Jdr="[object Boolean]",Qdr="[object Date]",efr="[object Error]",tfr="[object Function]",rfr="[object Map]",nfr="[object Number]",ifr="[object Object]",afr="[object RegExp]",sfr="[object Set]",ofr="[object String]",lfr="[object WeakMap]",cfr="[object ArrayBuffer]",ufr="[object DataView]",hfr="[object Float32Array]",dfr="[object Float64Array]",ffr="[object Int8Array]",pfr="[object Int16Array]",gfr="[object Int32Array]",mfr="[object Uint8Array]",Ufr="[object Uint8ClampedArray]",yfr="[object Uint16Array]",bfr="[object Uint32Array]",Zi={};Zi[hfr]=Zi[dfr]=Zi[ffr]=Zi[pfr]=Zi[gfr]=Zi[mfr]=Zi[Ufr]=Zi[yfr]=Zi[bfr]=!0;Zi[Kdr]=Zi[Zdr]=Zi[cfr]=Zi[Jdr]=Zi[ufr]=Zi[Qdr]=Zi[efr]=Zi[tfr]=Zi[rfr]=Zi[nfr]=Zi[ifr]=Zi[afr]=Zi[sfr]=Zi[ofr]=Zi[lfr]=!1;function zHe(t){return k4(t)&&Lie(t.length)&&!!Zi[S9(t)]}M(zHe,"baseIsTypedArray");var vfr=zHe;function VHe(t){return function(e){return t(e)}}M(VHe,"baseUnary");var xfr=VHe,HHe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xw=HHe&&typeof module=="object"&&module&&!module.nodeType&&module,wfr=xw&&xw.exports===HHe,_V=wfr&&HVe.process,Tfr=(function(){try{var t=xw&&xw.require&&xw.require("util").types;return t||_V&&_V.binding&&_V.binding("util")}catch{}})(),n5e=Tfr,i5e=n5e&&n5e.isTypedArray,Cfr=i5e?xfr(i5e):vfr,Iie=Cfr,kfr=Object.prototype,Sfr=kfr.hasOwnProperty;function GHe(t,e){var r=Yl(t),n=!r&&PP(t),i=!r&&!n&&HN(t),a=!r&&!n&&!i&&Iie(t),s=r||n||i||a,o=s?Bdr(t.length,String):[],l=o.length;for(var u in t)(e||Sfr.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$He(u,l)))&&o.push(u);return o}M(GHe,"arrayLikeKeys");var Efr=GHe,Afr=Object.prototype;function WHe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Afr;return t===r}M(WHe,"isPrototype");var qHe=WHe;function jHe(t,e){return function(r){return t(e(r))}}M(jHe,"overArg");var Mfr=jHe,Rfr=Mfr(Object.keys,Object),Lfr=Rfr,Ifr=Object.prototype,Nfr=Ifr.hasOwnProperty;function YHe(t){if(!qHe(t))return Lfr(t);var e=[];for(var r in Object(t))Nfr.call(t,r)&&r!="constructor"&&e.push(r);return e}M(YHe,"baseKeys");var XHe=YHe;function KHe(t){return t!=null&&Lie(t.length)&&!KVe(t)}M(KHe,"isArrayLike");var BP=KHe;function ZHe(t){return BP(t)?Efr(t):XHe(t)}M(ZHe,"keys");var Nie=ZHe;function JHe(t){return Idr(t,Nie,Pdr)}M(JHe,"getAllKeys");var a5e=JHe,Dfr=1,Ofr=Object.prototype,_fr=Ofr.hasOwnProperty;function QHe(t,e,r,n,i,a){var s=r&Dfr,o=a5e(t),l=o.length,u=a5e(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:_fr.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 U=s;++dzie(t,e,s));return n2(t,e,n,r,...i)}M(WGe,"alternation");function qGe(t,e,r){const n=Os(t,e,r,{type:d1});vp(t,n);const i=n2(t,e,n,r,z1(t,e,r));return jGe(t,e,r,i)}M(qGe,"option");function z1(t,e,r){const n=N0r(h0(r.definition,i=>zie(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:XGe(t,n)}M(z1,"block");function Vie(t,e,r,n,i){const a=n.left,s=n.right,o=Os(t,e,r,{type:B0r});vp(t,o);const l=Os(t,e,r,{type:PGe});return a.loopback=o,l.loopback=o,t.decisionMap[m5(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Xa(s,o),i===void 0?(Xa(o,a),Xa(o,l)):(Xa(o,l),Xa(o,i.left),Xa(i.right,a)),{left:a,right:l}}M(Vie,"plus");function Hie(t,e,r,n,i){const a=n.left,s=n.right,o=Os(t,e,r,{type:P0r});vp(t,o);const l=Os(t,e,r,{type:PGe}),u=Os(t,e,r,{type:_0r});return o.loopback=u,l.loopback=u,Xa(o,a),Xa(o,l),Xa(s,u),i!==void 0?(Xa(u,l),Xa(u,i.left),Xa(i.right,a)):Xa(u,o),t.decisionMap[m5(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}M(Hie,"star");function jGe(t,e,r,n){const i=n.left,a=n.right;return Xa(i,a),t.decisionMap[m5(e,"Option",r.idx)]=i,n}M(jGe,"optional");function vp(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}M(vp,"defineDecisionState");function n2(t,e,r,n,...i){const a=Os(t,e,n,{type:O0r,start:r});r.end=a;for(const o of i)o!==void 0?(Xa(r,o.left),Xa(o.right,a)):Xa(r,a);const s={left:r,right:a};return t.decisionMap[m5(e,YGe(n),n.idx)]=r,s}M(n2,"makeAlts");function YGe(t){if(t instanceof Lc)return"Alternation";if(t instanceof Do)return"Option";if(t instanceof Fa)return"Repetition";if(t instanceof Rc)return"RepetitionWithSeparator";if(t instanceof hu)return"RepetitionMandatory";if(t instanceof du)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}M(YGe,"getProdType");function XGe(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}},M(t7,"ATNConfigSet"),t7);function Gie(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}M(Gie,"getATNConfigKey");function QGe(t,e,r){for(var n=-1,i=t.length;++n0&&r(o)?e>1?Wie(o,e-1,r,n,i):EHe(i,o):n||(i[i.length]=o)}return i}M(Wie,"baseFlatten");var nWe=Wie;function iWe(t,e){return nWe(h0(t,e),1)}M(iWe,"flatMap");var H0r=iWe;function aWe(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}M(cWe,"arrayIncludes");var Y0r=cWe;function uWe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=epr){var u=e?null:Q0r(t);if(u)return Rie(u);s=!1,i=vHe,l=new UHe}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}}M(wWe,"createDFACache");var r7,TWe=(r7=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=$Ge(e.rules),this.dfas=CWe(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=m5(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=h0(CX({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>h0(f,p=>p[0]));if($X(d,!1)&&!a){const f=U5e(d,(p,g,m)=>(PV(g,U=>{U&&(p[U.tokenTypeIdx]=m,PV(U.categoryMatches,y=>{p[y]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),U=f[m.tokenTypeIdx];if(p!==void 0&&U!==void 0){const y=(g=p[U])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return U}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new TWe,g=f===void 0?0:f.length;for(let U=0;Uh0(f,p=>p[0]));if($X(d)&&d[0][0]&&!a){const f=d[0],p=npr(f);if(p.length===1&&upr(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=U5e(p,(m,U)=>(U!==void 0&&(m[U.tokenTypeIdx]=!0,PV(U.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=VM.call(this,s,h,y5e,o);return typeof f=="object"?!1:f===0}}},M(n7,"LLStarLookaheadStrategy"),n7);function $X(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}M($X,"isLL1Sequence");function CWe(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;nNU(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${MWe(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}_(gqe,"buildAmbiguityError");function mqe(t){if(t instanceof Ul)return"SUBRULE";if(t instanceof Oo)return"OPTION";if(t instanceof Lc)return"OR";if(t instanceof hu)return"AT_LEAST_ONE";if(t instanceof du)return"AT_LEAST_ONE_SEP";if(t instanceof _c)return"MANY_SEP";if(t instanceof Vs)return"MANY";if(t instanceof Ji)return"CONSUME";throw Error("non exhaustive match")}_(mqe,"getProductionDslName");function yqe(t,e,r){const n=x0r(e.configs.elements,s=>s.state.transitions),i=N0r(n.filter(s=>s instanceof Lie).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}_(yqe,"buildAdaptivePredictError");function vqe(t,e){return t.edges[e.tokenTypeIdx]}_(vqe,"getExistingTargetState");function bqe(t,e,r){const n=new LX,i=[];for(const a of t.elements){if(r.is(a.alt)===!1)continue;if(a.state.type===K7){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l0&&!kqe(s))for(const a of i)s.add(a);return s}_(bqe,"computeReachSet");function xqe(t,e){if(t instanceof Lie&&hie(e,t.tokenType))return t.target}_(xqe,"getReachableTarget");function wqe(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}_(wqe,"getUniqueAlt");function Bie(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}_(Bie,"newDFAState");function NX(t,e,r,n){return n=Fie(t,n),e.edges[r.tokenTypeIdx]=n,n}_(NX,"addDFAEdge");function Fie(t,e){if(e===VN)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}_(Fie,"addDFAState");function Tqe(t){const e=new LX,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};fA(a,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}_(Mqe,"hasConflictingAltSet");function Rqe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}_(Rqe,"hasStateAssociatedWithOneAlt");_7();var e4,_qe=(e4=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Vie(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new G$;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new HN(e.startOffset,e.image.length,eA(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 s of e){const a=new HN(s.startOffset,s.image.length,eA(s),s.tokenType,!0);a.root=this.rootNode,r.push(a)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const s=n.container.content.indexOf(n);if(s>0){n.container.content.splice(s,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.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},_(e4,"CstNodeBuilder"),e4),t4,zie=(t4=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)}},_(t4,"AbstractCstNode"),t4),r4,HN=(r4=class extends zie{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,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},_(r4,"LeafCstNodeImpl"),r4),n4,G$=(n4=class extends zie{constructor(){super(...arguments),this.content=new q0r(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]}},_(n4,"CompositeCstNodeImpl"),n4),Oy,q0r=(Oy=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Oy.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}},_(Oy,"CstNodeContainer"),Oy),i4,Vie=(i4=class extends G${get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},_(i4,"RootCstNodeImpl"),i4),GN=Symbol("Datatype");function z9(t){return t.$type===GN}_(z9,"isDataTypeNode");var cve="​",Lqe=_(t=>t.endsWith(cve)?t:t+cve,"withRuleSuffix"),s4,Hie=(s4=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 j0r(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Dqe(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()}},_(s4,"AbstractLangiumParser"),s4),a4,Iqe=(a4=class extends Hie{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new _qe,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;y3(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(Lqe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,s),ql(e)&&e.entry&&(this.mainRule=s),s}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 s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===GN?a.value="":r!==void 0&&(a.$infixName=r)}return n(i),s?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 s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=H0(n)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,h,a,l)}else if(z9(u)){let h=i.image;H0(n)||(h=this.converter.convert(h,a).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,s){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,s)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:s}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,s);else if(!i){const a=this.current;if(z9(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);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 s={$type:e};this.stack.push(s),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)):z9(e)?this.converter.convert(e.value,e.$cstNode):(zre(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 s=0,a=-1;for(let m=0;ma?(a=v.precedence,s=m):v.precedence===a&&(v.rightAssoc||(s=m))}const o=i.slice(0,s),l=i.slice(s+1),u=n.slice(0,s+1),h=n.slice(s+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[s],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=$v(e,V0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Fv(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,s){const a=this.current;let o;switch(s==="single"&&typeof n=="string"?o=this.linker.buildReference(a,r,i,n):s==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(a,r,i,n):o=n,e){case"=":{a[r]=o;break}case"?=":{a[r]=!0;break}case"+=":Array.isArray(a[r])||(a[r]=[]),a[r].push(o)}}assignWithoutOverride(e,r){for(const[i,s]of Object.entries(r)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},_(a4,"LangiumParser"),a4),o4,Nqe=(o4=class{buildMismatchTokenMessage(e){return Ub.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ub.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ub.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ub.buildEarlyExitMessage(e)}},_(o4,"AbstractParserErrorMessageProvider"),o4),l4,Gie=(l4=class extends Nqe{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}\`.`}},_(l4,"LangiumParserErrorMessageProvider"),l4),c4,Oqe=(c4=class extends Hie{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(Lqe(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,s){this.before(i),this.wrapper.wrapSubrule(e,r,s),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}},_(c4,"LangiumCompletionParser"),c4),U0r={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Gie},u4,Dqe=(u4=class extends Iur{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...U0r,lookaheadStrategy:n?new vie({maxLookahead:r.maxLookahead}):new W0r({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,{})}},_(u4,"ChevrotainWrapper"),u4),h4,j0r=(h4=class extends Dqe{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))}}},_(h4,"ProfilerWrapper"),h4);function W$(t,e,r){return Pqe({parser:e,tokens:r,ruleNames:new Map},t),e}_(W$,"createParser");function Pqe(t,e){const r=s$(e,!1),n=Ti(e.rules).filter(ql).filter(s=>r.has(s));for(const s of n){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,hm(a,s.definition))}const i=Ti(e.rules).filter(y3).filter(s=>r.has(s));for(const s of i)t.parser.rule(s,$qe(t,s))}_(Pqe,"buildRules");function $qe(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(Zu(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const l={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...s,$container:a};a.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:_(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=q$(t,r)),t.parser.subrule(0,f,!1,s,p),t.parser.many(0,{DEF:_(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}_($qe,"buildInfixRule");function hm(t,e,r=!1){let n;if(H0(e))n=Wqe(t,e);else if(om(e))n=Bqe(t,e);else if(V0(e))n=hm(t,e.terminal);else if(Fv(e))n=Wie(t,e);else if(G0(e))n=Fqe(t,e);else if(KP(e))n=Vqe(t,e);else if(e$(e))n=Hqe(t,e);else if(zv(e))n=Gqe(t,e);else if(jre(e)){const i=t.consume++;n=_(()=>t.parser.consume(i,cm,e),"method")}else throw new r$(e.$cstNode,`Unexpected element type: ${e.$type}`);return qie(t,r?void 0:pA(e),n,e.cardinality)}_(hm,"buildElement");function Bqe(t,e){const r=uv(e);return()=>t.parser.action(r,e)}_(Bqe,"buildAction");function Fqe(t,e){const r=e.rule.ref;if(Bv(r)){const n=t.subrule++,i=ql(r)&&r.fragment,s=e.arguments.length>0?zqe(r,e.arguments):()=>({});let a;return o=>{a??(a=q$(t,r)),t.parser.subrule(n,a,i,e,s(o))}}else if(Zu(r)){const n=t.consume++,i=WN(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Pm();else throw new r$(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}_(Fqe,"buildRuleCall");function zqe(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var s,a;return{parameterName:(a=(s=i.parameter)==null?void 0:s.ref)==null?void 0:a.name,predicate:vh(i.value)}});return i=>{const s={};for(const{parameterName:a,predicate:o}of n)a&&(s[a]=o(i));return s}}else{const n=e.map(i=>vh(i.value));return i=>{const s={};for(let a=0;ae(n)||r(n)}else if(qre(t)){const e=vh(t.left),r=vh(t.right);return n=>e(n)&&r(n)}else if(Kre(t)){const e=vh(t.value);return r=>!e(r)}else if(Zre(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Gre(t)){const e=!!t.true;return()=>e}Pm()}_(vh,"buildPredicate");function Vqe(t,e){if(e.elements.length===1)return hm(t,e.elements[0]);{const r=[];for(const i of e.elements){const s={ALT:hm(t,i,!0)},a=pA(i);a&&(s.GATE=vh(a)),r.push(s)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(s=>{const a={ALT:_(()=>s.ALT(i),"ALT")},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}_(Vqe,"buildAlternatives");function Hqe(t,e){if(e.elements.length===1)return hm(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:hm(t,o,!0)},u=pA(o);u&&(l.GATE=vh(u)),r.push(l)}const n=t.or++,i=_((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),s=_(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:_(()=>!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"),a=qie(t,pA(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}_(Hqe,"buildUnorderedGroup");function Gqe(t,e){const r=e.elements.map(n=>hm(t,n));return n=>r.forEach(i=>i(n))}_(Gqe,"buildGroup");function pA(t){if(zv(t))return t.guardCondition}_(pA,"getGuardCondition");function Wie(t,e,r=e.terminal){if(r)if(G0(r)&&ql(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let s;return a=>{s??(s=q$(t,n)),t.parser.subrule(i,s,!1,e,a)}}else if(G0(r)&&Zu(r.rule.ref)){const n=t.consume++,i=WN(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(H0(r)){const n=t.consume++,i=WN(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=c$(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+uv(e.type.ref));return Wie(t,e,i)}}_(Wie,"buildCrossReference");function Wqe(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)}_(Wqe,"buildKeyword");function qie(t,e,r,n){const i=e&&vh(e);if(!n)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:_(()=>r(a),"ALT"),GATE:_(()=>i(a),"GATE")},{ALT:EX(),GATE:_(()=>!i(a),"GATE")}])}else return r;if(n==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:_(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(n==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:_(()=>t.parser.atLeastOne(s,{DEF:_(()=>r(o),"DEF")}),"ALT"),GATE:_(()=>i(o),"GATE")},{ALT:EX(),GATE:_(()=>!i(o),"GATE")}])}else return a=>t.parser.atLeastOne(s,{DEF:_(()=>r(a),"DEF")})}else if(n==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:_(()=>r(a),"DEF"),GATE:i?()=>i(a):void 0})}else Pm()}_(qie,"wrap");function q$(t,e){const r=qqe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}_(q$,"getRule");function qqe(t,e){if(Bv(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!ql(n);)(zv(n)||KP(n)||e$(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}_(qqe,"getRuleName");function WN(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}_(WN,"getToken");function Uie(t){const e=t.Grammar,r=t.parser.Lexer,n=new Oqe(t);return W$(e,n,r.definition),n.finalize(),n}_(Uie,"createCompletionParser");function jie(t){const e=Yie(t);return e.finalize(),e}_(jie,"createLangiumParser");function Yie(t){const e=t.Grammar,r=t.parser.Lexer,n=new Iqe(t);return W$(e,n,r.definition)}_(Yie,"prepareLangiumParser");var d4,U$=(d4=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Ti(s$(e,!1)),i=this.buildTerminalTokens(n),s=this.buildKeywordTokens(n,i,r);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Zu).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=P7(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=i$(r)?zl.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(Bv).flatMap(i=>mp(i).filter(H0)).distinct(i=>i.value).toArray().sort((i,s)=>s.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),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,r){return r?new RegExp(yC(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&bne("^"+s.source+"$",e.value)&&n.push(i),n},[])}},_(d4,"DefaultTokenBuilder"),d4),f4,Xie=(f4=class{convert(e,r){let n=r.grammarSource;if(Fv(n)&&(n=kne(n)),G0(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 Td.convertInt(r);case"STRING":return Td.convertString(r);case"ID":return Td.convertID(r)}switch((i=Nne(e))==null?void 0:i.toLowerCase()){case"number":return Td.convertNumber(r);case"boolean":return Td.convertBoolean(r);case"bigint":return Td.convertBigint(r);case"date":return Td.convertDate(r);default:return r}}},_(f4,"DefaultValueConverter"),f4),Td;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}_(j$,"delayNextTick");var V9=0,Uqe=10;function Y$(){return V9=performance.now(),new Vi.CancellationTokenSource}_(Y$,"startCancelableOperation");function Kie(t){Uqe=t}_(Kie,"setInterruptionPeriod");var Od=Symbol("OperationCancelled");function t2(t){return t===Od}_(t2,"isOperationCancelled");async function Xa(t){if(t===Vi.CancellationToken.None)return;const e=performance.now();if(e-V9>=Uqe&&(V9=e,await j$(),V9=performance.now()),t.isCancellationRequested)throw Od}_(Xa,"interruptAndCheck");var p4,Y0=(p4=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},_(p4,"Deferred"),p4),_g,uve=(_g=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(_g.isIncremental(n)){const i=Qie(n.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=OX(n.text,!1,s);if(l-o===h.length)for(let f=0,p=h.length;fe?i=a:n=a+1}const s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}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&&Zie(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}},_(_g,"FullTextDocument"),_g),qN;(function(t){function e(i,s,a,o){return new uve(i,s,a,o)}_(e,"create"),t.create=e;function r(i,s,a){if(i instanceof uve)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}_(r,"update"),t.update=r;function n(i,s){const a=i.getText(),o=UN(s.map(jqe),(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(a.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(a.substr(l)),u.join("")}_(n,"applyEdits"),t.applyEdits=n})(qN||(qN={}));function UN(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);UN(n,e),UN(i,e);let s=0,a=0,o=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}_(Qie,"getWellformedRange");function jqe(t){const e=Qie(t.range);return e!==t.range?{newText:t.newText,range:e}:t}_(jqe,"getWellformedEdit");var Yqe;(()=>{var t={975:N=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}_(L,"e");function I(O,D){for(var B,z="",V=0,F=-1,H=0,G=0;G<=O.length;++G){if(G2){var W=z.lastIndexOf("/");if(W!==z.length-1){W===-1?(z="",V=0):V=(z=z.slice(0,W)).length-1-z.lastIndexOf("/"),F=G,H=0;continue}}else if(z.length===2||z.length===1){z="",V=0,F=G,H=0;continue}}D&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(F+1,G):z=O.slice(F+1,G),V=G-F-1;F=G,H=0}else B===46&&H!==-1?++H:H=-1}return z}_(I,"r");var $={resolve:_(function(){for(var O,D="",B=!1,z=arguments.length-1;z>=-1&&!B;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),L(V),V.length!==0&&(D=V+"/"+D,B=V.charCodeAt(0)===47)}return D=I(D,!B),B?D.length>0?"/"+D:"/":D.length>0?D:"."},"resolve"),normalize:_(function(O){if(L(O),O.length===0)return".";var D=O.charCodeAt(0)===47,B=O.charCodeAt(O.length-1)===47;return(O=I(O,!D)).length!==0||D||(O="."),O.length>0&&B&&(O+="/"),D?"/"+O:O},"normalize"),isAbsolute:_(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:_(function(){if(arguments.length===0)return".";for(var O,D=0;D0&&(O===void 0?O=B:O+="/"+B)}return O===void 0?".":$.normalize(O)},"join"),relative:_(function(O,D){if(L(O),L(D),O===D||(O=$.resolve(O))===(D=$.resolve(D)))return"";for(var B=1;BG){if(D.charCodeAt(F+K)===47)return D.slice(F+K+1);if(K===0)return D.slice(F+K)}else V>G&&(O.charCodeAt(B+K)===47?W=K:K===0&&(W=0));break}var q=O.charCodeAt(B+K);if(q!==D.charCodeAt(F+K))break;q===47&&(W=K)}var oe="";for(K=B+W+1;K<=z;++K)K!==z&&O.charCodeAt(K)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+D.slice(F+W):(F+=W,D.charCodeAt(F)===47&&++F,D.slice(F))},"relative"),_makeLong:_(function(O){return O},"_makeLong"),dirname:_(function(O){if(L(O),O.length===0)return".";for(var D=O.charCodeAt(0),B=D===47,z=-1,V=!0,F=O.length-1;F>=1;--F)if((D=O.charCodeAt(F))===47){if(!V){z=F;break}}else V=!1;return z===-1?B?"/":".":B&&z===1?"//":O.slice(0,z)},"dirname"),basename:_(function(O,D){if(D!==void 0&&typeof D!="string")throw new TypeError('"ext" argument must be a string');L(O);var B,z=0,V=-1,F=!0;if(D!==void 0&&D.length>0&&D.length<=O.length){if(D.length===O.length&&D===O)return"";var H=D.length-1,G=-1;for(B=O.length-1;B>=0;--B){var W=O.charCodeAt(B);if(W===47){if(!F){z=B+1;break}}else G===-1&&(F=!1,G=B+1),H>=0&&(W===D.charCodeAt(H)?--H==-1&&(V=B):(H=-1,V=G))}return z===V?V=G:V===-1&&(V=O.length),O.slice(z,V)}for(B=O.length-1;B>=0;--B)if(O.charCodeAt(B)===47){if(!F){z=B+1;break}}else V===-1&&(F=!1,V=B+1);return V===-1?"":O.slice(z,V)},"basename"),extname:_(function(O){L(O);for(var D=-1,B=0,z=-1,V=!0,F=0,H=O.length-1;H>=0;--H){var G=O.charCodeAt(H);if(G!==47)z===-1&&(V=!1,z=H+1),G===46?D===-1?D=H:F!==1&&(F=1):D!==-1&&(F=-1);else if(!V){B=H+1;break}}return D===-1||z===-1||F===0||F===1&&D===z-1&&D===B+1?"":O.slice(D,z)},"extname"),format:_(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(D,B){var z=B.dir||B.root,V=B.base||(B.name||"")+(B.ext||"");return z?z===B.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:_(function(O){L(O);var D={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return D;var B,z=O.charCodeAt(0),V=z===47;V?(D.root="/",B=1):B=0;for(var F=-1,H=0,G=-1,W=!0,K=O.length-1,q=0;K>=B;--K)if((z=O.charCodeAt(K))!==47)G===-1&&(W=!1,G=K+1),z===46?F===-1?F=K:q!==1&&(q=1):F!==-1&&(q=-1);else if(!W){H=K+1;break}return F===-1||G===-1||q===0||q===1&&F===G-1&&F===H+1?G!==-1&&(D.base=D.name=H===0&&V?O.slice(1,G):O.slice(H,G)):(H===0&&V?(D.name=O.slice(1,F),D.base=O.slice(1,G)):(D.name=O.slice(H,F),D.base=O.slice(H,G)),D.ext=O.slice(F,G)),H>0?D.dir=O.slice(0,H-1):V&&(D.dir="/"),D},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,N.exports=$}},e={};function r(N){var L=e[N];if(L!==void 0)return L.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}_(r,"r"),r.d=(N,L)=>{for(var I in L)r.o(L,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:L[I]})},r.o=(N,L)=>Object.prototype.hasOwnProperty.call(N,L),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:_(()=>f,"URI"),Utils:_(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(N,L){if(!N.scheme&&L)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!s.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!a.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 ("//")')}}_(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,R=class R{constructor(L,I,$,O,D,B=!1){wr(this,"scheme");wr(this,"authority");wr(this,"path");wr(this,"query");wr(this,"fragment");typeof L=="object"?(this.scheme=L.scheme||u,this.authority=L.authority||u,this.path=L.path||u,this.query=L.query||u,this.fragment=L.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(L,B),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=D||u,l(this,B))}static isUri(L){return L instanceof R||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}get fsPath(){return b(this,!1)}with(L){if(!L)return this;let{scheme:I,authority:$,path:O,query:D,fragment:B}=L;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),D===void 0?D=this.query:D===null&&(D=u),B===void 0?B=this.fragment:B===null&&(B=u),I===this.scheme&&$===this.authority&&O===this.path&&D===this.query&&B===this.fragment?this:new g(I,$,O,D,B)}static parse(L,I=!1){const $=d.exec(L);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(L){let I=u;if(i&&(L=L.replace(/\\/g,h)),L[0]===h&&L[1]===h){const $=L.indexOf(h,2);$===-1?(I=L.substring(2),L=h):(I=L.substring(2,$),L=L.substring($)||h)}return new g("file",I,L,u,u)}static from(L){const I=new g(L.scheme,L.authority,L.path,L.query,L.fragment);return l(I,!0),I}toString(L=!1){return x(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof R)return L;{const I=new g(L);return I._formatted=L.external,I._fsPath=L._sep===p?L.fsPath:null,I}}return L}};_(R,"l");let f=R;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);wr(this,"_formatted",null);wr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(I=!1){return I?x(this,!0):(this._formatted||(this._formatted=x(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}};_(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,L,I){let $,O=-1;for(let D=0;D=97&&B<=122||B>=65&&B<=90||B>=48&&B<=57||B===45||B===46||B===95||B===126||L&&B===47||I&&B===91||I&&B===93||I&&B===58)O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$!==void 0&&($+=N.charAt(D));else{$===void 0&&($=N.substr(0,D));const z=m[B];z!==void 0?(O!==-1&&($+=encodeURIComponent(N.substring(O,D)),O=-1),$+=z):O===-1&&(O=D)}}return O!==-1&&($+=encodeURIComponent(N.substring(O))),$!==void 0?$:N}_(y,"m");function v(N){let L;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?L?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}_(b,"v");function x(N,L){const I=L?v:y;let $="",{scheme:O,authority:D,path:B,query:z,fragment:V}=N;if(O&&($+=O,$+=":"),(D||O==="file")&&($+=h,$+=h),D){let F=D.indexOf("@");if(F!==-1){const H=D.substr(0,F);D=D.substr(F+1),F=H.lastIndexOf(":"),F===-1?$+=I(H,!1,!1):($+=I(H.substr(0,F),!1,!1),$+=":",$+=I(H.substr(F+1),!1,!0)),$+="@"}D=D.toLowerCase(),F=D.lastIndexOf(":"),F===-1?$+=I(D,!1,!0):($+=I(D.substr(0,F),!1,!0),$+=D.substr(F))}if(B){if(B.length>=3&&B.charCodeAt(0)===47&&B.charCodeAt(2)===58){const F=B.charCodeAt(1);F>=65&&F<=90&&(B=`/${String.fromCharCode(F+32)}:${B.substr(3)}`)}else if(B.length>=2&&B.charCodeAt(1)===58){const F=B.charCodeAt(0);F>=65&&F<=90&&(B=`${String.fromCharCode(F+32)}:${B.substr(2)}`)}$+=I(B,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=L?V:y(V,!1,!1)),$}_(x,"b");function T(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+T(N.substr(3)):N}}_(T,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(N){return N.match(C)?N.replace(C,(L=>T(L))):N}_(S,"w");var k=r(975);const E=k.posix||k,A="/";var M;(function(N){N.joinPath=function(L,...I){return L.with({path:E.join(L.path,...I)})},N.resolvePath=function(L,...I){let $=L.path,O=!1;$[0]!==A&&($=A+$,O=!0);let D=E.resolve($,...I);return O&&D[0]===A&&!L.authority&&(D=D.substring(1)),L.with({path:D})},N.dirname=function(L){if(L.path.length===0||L.path===A)return L;let I=E.dirname(L.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),L.with({path:I})},N.basename=function(L){return E.basename(L.path)},N.extname=function(L){return E.extname(L.path)}})(M||(M={})),Yqe=n})();var{URI:Jc,Utils:hk}=Yqe,$l;(function(t){t.basename=hk.basename,t.dirname=hk.dirname,t.extname=hk.extname,t.joinPath=hk.joinPath,t.resolvePath=hk.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(a,o){return(a==null?void 0:a.toString())===(o==null?void 0:o.toString())}_(r,"equals"),t.equals=r;function n(a,o){const l=typeof a=="string"?Jc.parse(a).path:a.path,u=typeof o=="string"?Jc.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:$l.joinPath(Jc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode($l.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 s of n){let a=i.children.get(s);if(!a)if(r)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}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}},_(g4,"UriTrie"),g4),_n;(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"})(_n||(_n={}));var m4,Xqe=(m4=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Vi.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Jc.parse(e.uri),Vi.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Vi.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 s;if(n)s={parseResult:e,uri:r,state:_n.Parsed,references:[],textDocument:n};else{const a=this.createTextDocumentGetter(r,i);s={parseResult:e,uri:r,state:_n.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,r){var a,o;const n=(a=e.parseResult.value.$cstNode)==null?void 0:a.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:l})}return n!==s&&(e.parseResult=await this.parseAsync(e.uri,s,r),e.parseResult.value.$document=e),e.state=_n.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=qN.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},_(m4,"DefaultLangiumDocumentFactory"),m4),y4,Kqe=(y4=class{constructor(e){this.documentTrie=new Jie,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Ti(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,_n.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=_n.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=_n.Changed;return this.documentTrie.delete(r),n}},_(y4,"DefaultLangiumDocuments"),y4),M1=Symbol("RefResolving"),v4,Zqe=(v4=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=Vi.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 s of Ph(e.parseResult.value))await Xa(r),m3(s).forEach(a=>{const o=`${s.$type}:${a.property}`;i.startSubTask(o);try{this.doLink(a,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Ph(e.parseResult.value))await Xa(r),m3(i).forEach(s=>this.doLink(s,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=M1;try{const i=this.getCandidate(e);if(z1(i))n._ref=i;else{n._nodeDescription=i;const s=this.loadAstNode(i);n._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const s=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${s}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=M1;try{const i=this.getCandidates(e),s=[];if(z1(i))n._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}n._items=s}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 s=this,a={$refNode:n,$refText:i,_ref:void 0,get ref(){if(la(this._ref))return this._ref;if($re(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=M1;const o=bx(e).$document,l=s.getLinkedNode({reference:a,container:e,property:r});if(l.error&&o&&o.state<_n.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o==null||o.references.push(this)}else this._ref===M1&&s.throwCyclicReferenceError(e,r,i);return la(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return z1(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,r,n,i){const s=this,a={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=M1;const o=bx(e).$document,l=s.getCandidates({reference:a,container:e,property:r}),u=[];if(z1(l))this._linkingError=l;else for(const h of l){const d=s.loadAstNode(h);d&&u.push({ref:d,$nodeDescription:h})}this._items=u,o==null||o.references.push(this)}else this._items===M1&&s.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:r})}};return a}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(z1(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=bx(e.container).$document;n&&n.state<_n.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}},_(v4,"DefaultLinker"),v4);function ese(t){return typeof t.name=="string"}_(ese,"isNamed");var b4,Qqe=(b4=class{getName(e){if(ese(e))return e.name}getNameNode(e){return a$(e.$cstNode,"name")}},_(b4,"DefaultNameProvider"),b4),x4,Jqe=(x4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=Ph(e.Grammar).some(r=>Fv(r)&&r.isMulti)}findDeclarations(e){if(e){const r=Mne(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Pl(i)||Vd(i))return uN(i);if(Array.isArray(i)){for(const s of i)if((Pl(s)||Vd(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return uN(s)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||one(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 m3(n))if(Vd(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.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 s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&n.push(s)}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(s=>$l.equals(s.sourceUri,r.documentUri))),n.push(...i),Ti(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const s=this.nameProvider.getNameNode(i);if(s){const a=Dh(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:b3(s),local:!0})}}return n}},_(x4,"DefaultReferences"),x4),w4,X0=(w4=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return J6.sum(Ti(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?Ti(r):f3}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 Ti(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Ti(this.map.keys())}values(){return Ti(this.map.values()).flat()}entriesGroupedByKey(){return Ti(this.map.entries())}},_(w4,"MultiMap"),w4),T4,jN=(T4=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}},_(T4,"BiMap"),T4),C4,eUe=(C4=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Vi.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=I7,i=Vi.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,r);for(const a of n(e))await Xa(i),this.addExportedSymbol(a,s,r);return s}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=Vi.CancellationToken.None){const n=e.parseResult.value,i=new X0;for(const s of mp(n))await Xa(r),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&n.add(i,this.descriptions.createDescription(e,s,r))}}},_(C4,"DefaultScopeComputation"),C4),k4,DX=(k4=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}},_(k4,"StreamScope"),k4),S4,Y0r=(S4=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 s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(s,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?Ti(i).concat(this.outerScope.getElements(e)):Ti(i)}getAllElements(){let e=Ti(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},_(S4,"MapScope"),S4),E4,tUe=(E4=class{constructor(e,r,n){this.elements=new X0,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,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?Ti(n).concat(this.outerScope.getElements(e)):Ti(n)}getAllElements(){let e=Ti(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},_(E4,"MultiMapScope"),E4),X0r={getElement(){},getElements(){return f3},getAllElements(){return f3}},A4,X$=(A4=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")}},_(A4,"DisposableCache"),A4),M4,tse=(M4=class extends X${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()}},_(M4,"SimpleCache"),M4),R4,K$=(R4=class extends X${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 s=n();return i.set(r,s),s}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}},_(R4,"ContextCache"),R4),_4,rUe=(_4=class extends K${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 s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const s=n.concat(i);for(const a of s)this.clear(a)}))}},_(_4,"DocumentCache"),_4),L4,rse=(L4=class extends tse{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()}))}},_(L4,"WorkspaceCache"),L4),I4,nUe=(I4=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 rse(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Dh(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&r.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,n))),a=a.$container;while(a)}let s=this.getGlobalScope(n,e);for(let a=r.length-1;a>=0;a--)s=this.createScope(r[a],s);return s}createScope(e,r,n){return new DX(Ti(e),r,n)}createScopeForNodes(e,r,n){const i=Ti(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new DX(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new tUe(this.indexManager.allElements(e)))}},_(I4,"DefaultScopeProvider"),I4);function nse(t){return typeof t.$comment=="string"}_(nse,"isAstNodeWithComment");function PX(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}_(PX,"isIntermediateReference");var N4,iUe=(N4=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,s=_((o,l)=>this.replacer(o,l,n),"defaultReplacer"),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=Dh(e),JSON.stringify(e,a,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:s,comments:a,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Pl(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Dh(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(Vd(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Dh(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(la(r)){let d;if(s&&(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),a){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=_(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(s=>!s.startsWith("$")).forEach(s=>{const a=Ene(e.$cstNode,s).map(r);a.length!==0&&(i[s]=a)}),e}}linkNode(e,r,n,i,s,a){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,s),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(s){if(t2(s))throw s;console.error(`${r}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);n("error",`${r}: ${a}`,{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=Ti(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,s,a,o)=>{await this.handleException(()=>e.call(n,i,s,a,o),r,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},_(D4,"ValidationRegistry"),D4),oUe=Object.freeze({validateNode:!0,validateChildren:!0}),P4,lUe=(P4=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=Vi.CancellationToken.None){const i=e.parseResult,s=[];if(await Xa(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,s,r),r.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===Iu.LexingError})||(this.processParsingErrors(i,s,r),r.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===Iu.ParsingError}))||(this.processLinkingErrors(e,s,r),r.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===Iu.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,r,n))}catch(a){if(t2(a))throw a;console.error("An error occurred during validation:",a)}return await Xa(n),s}processLexingErrors(e,r,n){var s;const i=[...e.lexerErrors,...((s=e.lexerReport)==null?void 0:s.diagnostics)??[]];for(const a of i){const o=a.severity??"error",l={severity:vE(o),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:sse(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=eA(i.token);if(s){const a={severity:vE("error"),range:s,message:i.message,data:my(Iu.ParsingError),source:this.getSource()};r.push(a)}}}processLinkingErrors(e,r,n){var i;for(const s of e.references){const a=s.error;if(a){const o={node:a.info.container,range:(i=s.$refNode)==null?void 0:i.range,property:a.info.property,index:a.info.index,data:{code:Iu.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};r.push(this.toDiagnostic("error",a.message,o))}}}async validateAst(e,r,n=Vi.CancellationToken.None){const i=[],s=_((a,o,l)=>{i.push(this.toDiagnostic(a,o,l))},"acceptor");return await this.validateAstBefore(e,r,s,n),await this.validateAstNodes(e,r,s,n),await this.validateAstAfter(e,r,s,n),i}async validateAstBefore(e,r,n,i=Vi.CancellationToken.None){const s=this.validationRegistry.checksBefore;for(const a of s)await Xa(i),await a(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Vi.CancellationToken.None){var s;if((s=this.profiler)!=null&&s.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const o=Ph(e).iterator();for(const l of o){a.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{a.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{a.stop()}}else{const a=Ph(e).iterator();for(const o of a){await Xa(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||a.prune()}}}validateSingleNodeOptions(e,r){return oUe}async validateAstAfter(e,r,n,i=Vi.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Xa(i),await a(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:ise(n),severity:vE(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},_(P4,"DefaultDocumentValidator"),P4);function ise(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=a$(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Ane(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}}}_(ise,"getDiagnosticRange");function vE(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)}}_(vE,"toDiagnosticSeverity");function sse(t){switch(t){case"error":return my(Iu.LexingError);case"warning":return my(Iu.LexingWarning);case"info":return my(Iu.LexingInfo);case"hint":return my(Iu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}_(sse,"toDiagnosticData");var Iu;(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"})(Iu||(Iu={}));var $4,cUe=($4=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Dh(e);r??(r=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${s} has no name.`);let a;const o=_(()=>a??(a=b3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:b3(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}},_($4,"DefaultAstNodeDescriptionProvider"),$4),B4,uUe=(B4=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Vi.CancellationToken.None){const n=[],i=e.parseResult.value;for(const s of Ph(i))await Xa(r),m3(s).forEach(a=>{a.reference.error||n.push(...this.createInfoDescriptions(a))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Pl(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Vd(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Dh(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=b3(r.$refNode);for(const l of n)a.push({sourceUri:i,sourcePath:s,targetUri:l.documentUri,targetPath:l.path,segment:o,local:$l.equals(l.documentUri,i)});return a}},_(B4,"DefaultReferenceDescriptionProvider"),B4),F4,hUe=(F4=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,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),l=parseInt(s.substring(a+1)),u=i[o];return u==null?void 0:u[l]}return i[s]},e)}},_(F4,"DefaultAstNodeLocator"),F4),Z$={};qP(Z$,Nre(gC()));var z4,dUe=(z4=class{constructor(e){this._ready=new Y0,this.onConfigurationSectionUpdateEmitter=new Z$.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,s)=>{this.updateSectionConfiguration(i.section,n[s])})}}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}},_(z4,"DefaultConfigurationProvider"),z4),XM=Nre(Anr()),Ly;(function(t){function e(r){return{dispose:_(async()=>await r(),"dispose")}}_(e,"create"),t.create=e})(Ly||(Ly={}));var V4,fUe=(V4=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new X0,this.documentPhaseListeners=new X0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=_n.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=Vi.CancellationToken.None){var i;for(const s of e){const a=s.uri.toString();if(s.state===_n.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(s,_n.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(s,r);o.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(a))==null?void 0:i.result}),s.state=_n.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=_n.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Vi.CancellationToken.None){this.currentState=_n.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 s=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of s){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=_n.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,_n.Changed)}const a=Ti(s).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!a.has(l.uri.toString())&&this.shouldRelink(l,a)).forEach(l=>this.resetToState(l,_n.ComputedScopes)),await this.emitUpdate(s,i),await Xa(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state<_n.Validated||!((u=this.buildState.get(l.uri.toString()))!=null&&u.completed)||this.resultsAreIncomplete(l,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=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),s=(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,a=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Ti(a).filter(u=>!s.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),Ly.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case _n.Changed:case _n.Parsed:this.indexManager.removeContent(e.uri);case _n.IndexedContent:e.localSymbols=void 0;case _n.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case _n.Linked:this.indexManager.removeReferences(e.uri);case _n.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case _n.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=_n.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,_n.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,_n.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,_n.ComputedScopes,n,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,n)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,_n.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(i,_n.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,_n.Validated,n,async a=>{await this.validate(a,n),this.markAsCompleted(a)})}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(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:r,result:s==null?void 0:s.result})}}async runCancelable(e,r,n,i){for(const a of e)a.statea.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),Ly.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),Ly.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Vi.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(Od);if(this.currentState>=e&&e>i.state)return Promise.reject(new XM.ResponseError(XM.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${_n[i.state]}, requiring ${_n[e]}, but workspace state is already ${_n[this.currentState]}. Returning undefined.`))}else return Promise.reject(new XM.ResponseError(XM.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,u=>{$l.equals(u.uri,r)&&(o.dispose(),l.dispose(),s(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(Od)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Od):new Promise((n,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),n()}),a=r.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(Od)})})}async notifyDocumentPhase(e,r,n){const s=this.documentPhaseListeners.get(r).slice();for(const a of s)try{await Xa(n),await a(e,n)}catch(o){if(!t2(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const s=this.buildPhaseListeners.get(r).slice();for(const a of s)await Xa(n),await a(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),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await n.validateDocument(e,s,r);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Ti(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},_(V4,"DefaultDocumentBuilder"),V4),H4,pUe=(H4=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new K$,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Dh(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{$l.equals(a.targetUri,n)&&a.targetPath===r&&i.push(a)})}),Ti(i)}allElements(e,r){let n=Ti(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(s=>this.astReflection.isSubtype(s.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=Vi.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,r=Vi.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}},_(H4,"DefaultIndexManager"),H4),G4,gUe=(G4=class{constructor(e){this.initialBuildOptions={},this._ready=new Y0,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=Vi.CancellationToken.None){const n=await this.performStartup(e);await Xa(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=_(a=>{r.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=Ti(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,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 Jc.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=$l.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},_(G4,"DefaultWorkspaceManager"),G4),W4,mUe=(W4=class{buildUnexpectedCharactersMessage(e,r,n,i,s){return mX.buildUnexpectedCharactersMessage(e,r,n,i,s)}buildUnableToPopLexerModeMessage(e){return mX.buildUnableToPopLexerModeMessage(e)}},_(W4,"DefaultLexerErrorMessageProvider"),W4),ase={mode:"full"},q4,ose=(q4=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=XN(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new zl(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=ase){var i,s;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(s=(i=this.tokenBuilder).flushLexingReport)==null?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(XN(e))return e;const r=J$(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},_(q4,"DefaultLexer"),q4);function Q$(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}_(Q$,"isTokenTypeArray");function J$(t){return t&&"modes"in t&&"defaultMode"in t}_(J$,"isIMultiModeLexerDefinition");function XN(t){return!Q$(t)&&!J$(t)}_(XN,"isTokenTypeDictionary");_7();function lse(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ui.create(0,0));const s=use(t),a=eB(n),o=yUe({lines:s,position:i,options:a});return xUe({index:0,tokens:o,position:i})}_(lse,"parseJSDoc");function cse(t,e){const r=eB(e),n=use(t);if(n.length===0)return!1;const i=n[0],s=n[n.length-1],a=r.start,o=r.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}_(cse,"isJSDoc");function use(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(wPe)}_(use,"getLines");var hve=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,K0r=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function yUe(t){var i,s,a;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o=h.length){if(e.length>0){const p=ui.create(r,n);e.push({type:"break",content:"",range:zn.create(p,p)})}}else{hve.lastIndex=d;const p=hve.exec(h);if(p){const g=p[0],m=p[1],y=ui.create(r,n+d),v=ui.create(r,n+d+g.length);e.push({type:"tag",content:m,range:zn.create(y,v)}),d+=g.length,d=KN(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}_(yUe,"tokenize");function vUe(t,e,r,n){const i=[];if(t.length===0){const s=ui.create(r,n),a=ui.create(r,n+e.length);i.push({type:"text",content:e,range:zn.create(s,a)})}else{let s=0;for(const o of t){const l=o.index,u=e.substring(s,l);u.length>0&&i.push({type:"text",content:e.substring(s,l),range:zn.create(ui.create(r,s+n),ui.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:zn.create(ui.create(r,s+h+n),ui.create(r,s+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:zn.create(ui.create(r,s+h+n),ui.create(r,s+h+f.length+n))})}else i.push({type:"text",content:"",range:zn.create(ui.create(r,s+h+n),ui.create(r,s+h+n))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:zn.create(ui.create(r,s+n),ui.create(r,s+n+a.length))})}return i}_(vUe,"buildInlineTokens");var Z0r=/\S/,Q0r=/\s*$/;function KN(t,e){const r=t.substring(e).match(Z0r);return r?e+r.index:t.length}_(KN,"skipWhitespace");function bUe(t){const e=t.match(Q0r);if(e&&typeof e.index=="number")return e.index}_(bUe,"lastCharacter");function xUe(t){var s,a;const e=ui.create(t.position.line,t.position.character);if(t.tokens.length===0)return new dve([],zn.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+=BX(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+=BX(r)+i}return r.trim()}},_(U4,"JSDocCommentImpl"),U4),j4,NH=(j4=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 s=kUe(this.name,r,e??{});if(typeof s=="string")return s}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}},_(j4,"JSDocTagImpl"),j4);function kUe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=KN(e,i);s=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),((n=r.renderLink)==null?void 0:n.call(r,e,s))??SUe(e,s)}}_(kUe,"renderInlineTag");function SUe(t,e){try{return Jc.parse(t,!0),`[${e}](${t})`}catch{return t}}_(SUe,"renderLinkDefault");var Y4,$X=(Y4=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}},_(Y4,"JSDocTextImpl"),Y4),X4,EUe=(X4=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},_(X4,"JSDocLineImpl"),X4);function BX(t){return t.endsWith(` +For Further details.`,n}M(AWe,"buildAmbiguityError");function MWe(t){if(t instanceof ql)return"SUBRULE";if(t instanceof Do)return"OPTION";if(t instanceof Lc)return"OR";if(t instanceof hu)return"AT_LEAST_ONE";if(t instanceof du)return"AT_LEAST_ONE_SEP";if(t instanceof Rc)return"MANY_SEP";if(t instanceof Fa)return"MANY";if(t instanceof ea)return"CONSUME";throw Error("non exhaustive match")}M(MWe,"getProductionDslName");function RWe(t,e,r){const n=H0r(e.configs.elements,a=>a.state.transitions),i=rpr(n.filter(a=>a instanceof $ie).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}M(RWe,"buildAdaptivePredictError");function LWe(t,e){return t.edges[e.tokenTypeIdx]}M(LWe,"getExistingTargetState");function IWe(t,e,r){const n=new BX,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Qk){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l0&&!PWe(a))for(const s of i)a.add(s);return a}M(IWe,"computeReachSet");function NWe(t,e){if(t instanceof $ie&&bie(e,t.tokenType))return t.target}M(NWe,"getReachableTarget");function DWe(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}M(DWe,"getUniqueAlt");function qie(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}M(qie,"newDFAState");function FX(t,e,r,n){return n=jie(t,n),e.edges[r.tokenTypeIdx]=n,n}M(FX,"addDFAEdge");function jie(t,e){if(e===GN)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}M(jie,"addDFAState");function OWe(t){const e=new BX,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};mC(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}M(zWe,"hasConflictingAltSet");function VWe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}M(VWe,"hasStateAssociatedWithOneAlt");Nk();var i7,HWe=(i7=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Xie(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new qP;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new WN(e.startOffset,e.image.length,nC(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 WN(a.startOffset,a.image.length,nC(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.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},M(i7,"CstNodeBuilder"),i7),a7,Yie=(a7=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)}},M(a7,"AbstractCstNode"),a7),s7,WN=(s7=class extends Yie{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}},M(s7,"LeafCstNodeImpl"),s7),o7,qP=(o7=class extends Yie{constructor(){super(...arguments),this.content=new ppr(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]}},M(o7,"CompositeCstNodeImpl"),o7),PU,ppr=(PU=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,PU.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}},M(PU,"CstNodeContainer"),PU),l7,Xie=(l7=class extends qP{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},M(l7,"RootCstNodeImpl"),l7),qN=Symbol("Datatype");function HM(t){return t.$type===qN}M(HM,"isDataTypeNode");var b5e="​",GWe=M(t=>t.endsWith(b5e)?t:t+b5e,"withRuleSuffix"),c7,Kie=(c7=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 mpr(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new YWe(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()}},M(c7,"AbstractLangiumParser"),c7),u7,WWe=(u7=class extends Kie{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new HWe,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;v4(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(GWe(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Wl(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===qN?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=H0(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(HM(u)){let h=i.image;H0(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(HM(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)):HM(e)?this.converter.convert(e.value,e.$cstNode):(Yre(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=y.precedence,a=m):y.precedence===s&&(y.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=F5(e,V0);this.assignmentMap.set(e,{assignment:r,crossRef:r&&V5(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}},M(u7,"LangiumParser"),u7),h7,qWe=(h7=class{buildMismatchTokenMessage(e){return Ky.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ky.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ky.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ky.buildEarlyExitMessage(e)}},M(h7,"AbstractParserErrorMessageProvider"),h7),d7,Zie=(d7=class extends qWe{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}\`.`}},M(d7,"LangiumParserErrorMessageProvider"),d7),f7,jWe=(f7=class extends Kie{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(GWe(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}},M(f7,"LangiumCompletionParser"),f7),gpr={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Zie},p7,YWe=(p7=class extends thr{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...gpr,lookaheadStrategy:n?new Sie({maxLookahead:r.maxLookahead}):new fpr({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,{})}},M(p7,"ChevrotainWrapper"),p7),g7,mpr=(g7=class extends YWe{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))}}},M(g7,"ProfilerWrapper"),g7);function jP(t,e,r){return XWe({parser:e,tokens:r,ruleNames:new Map},t),e}M(jP,"createParser");function XWe(t,e){const r=lP(e,!1),n=Ti(e.rules).filter(Wl).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,f1(s,a.definition))}const i=Ti(e.rules).filter(v4).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,KWe(t,a))}M(XWe,"buildRules");function KWe(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(Zu(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:M(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=YP(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:M(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}M(KWe,"buildInfixRule");function f1(t,e,r=!1){let n;if(H0(e))n=nqe(t,e);else if(c1(e))n=ZWe(t,e);else if(V0(e))n=f1(t,e.terminal);else if(V5(e))n=Jie(t,e);else if(G0(e))n=JWe(t,e);else if(Q_(e))n=eqe(t,e);else if(nP(e))n=tqe(t,e);else if(H5(e))n=rqe(t,e);else if(tne(e)){const i=t.consume++;n=M(()=>t.parser.consume(i,h1,e),"method")}else throw new aP(e.$cstNode,`Unexpected element type: ${e.$type}`);return Qie(t,r?void 0:UC(e),n,e.cardinality)}M(f1,"buildElement");function ZWe(t,e){const r=f5(e);return()=>t.parser.action(r,e)}M(ZWe,"buildAction");function JWe(t,e){const r=e.rule.ref;if(z5(r)){const n=t.subrule++,i=Wl(r)&&r.fragment,a=e.arguments.length>0?QWe(r,e.arguments):()=>({});let s;return o=>{s??(s=YP(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Zu(r)){const n=t.consume++,i=jN(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)B1();else throw new aP(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}M(JWe,"buildRuleCall");function QWe(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:yh(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=>yh(i.value));return i=>{const a={};for(let s=0;se(n)||r(n)}else if(Qre(t)){const e=yh(t.left),r=yh(t.right);return n=>e(n)&&r(n)}else if(ine(t)){const e=yh(t.value);return r=>!e(r)}else if(ane(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Zre(t)){const e=!!t.true;return()=>e}B1()}M(yh,"buildPredicate");function eqe(t,e){if(e.elements.length===1)return f1(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:f1(t,i,!0)},s=UC(i);s&&(a.GATE=yh(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:M(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}M(eqe,"buildAlternatives");function tqe(t,e){if(e.elements.length===1)return f1(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:f1(t,o,!0)},u=UC(o);u&&(l.GATE=yh(u)),r.push(l)}const n=t.or++,i=M((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=M(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:M(()=>!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=Qie(t,UC(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}M(tqe,"buildUnorderedGroup");function rqe(t,e){const r=e.elements.map(n=>f1(t,n));return n=>r.forEach(i=>i(n))}M(rqe,"buildGroup");function UC(t){if(H5(t))return t.guardCondition}M(UC,"getGuardCondition");function Jie(t,e,r=e.terminal){if(r)if(G0(r)&&Wl(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=YP(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(G0(r)&&Zu(r.rule.ref)){const n=t.consume++,i=jN(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(H0(r)){const n=t.consume++,i=jN(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=dP(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+f5(e.type.ref));return Jie(t,e,i)}}M(Jie,"buildCrossReference");function nqe(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)}M(nqe,"buildKeyword");function Qie(t,e,r,n){const i=e&&yh(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:M(()=>r(s),"ALT"),GATE:M(()=>i(s),"GATE")},{ALT:NX(),GATE:M(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:M(()=>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:M(()=>t.parser.atLeastOne(a,{DEF:M(()=>r(o),"DEF")}),"ALT"),GATE:M(()=>i(o),"GATE")},{ALT:NX(),GATE:M(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:M(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:M(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else B1()}M(Qie,"wrap");function YP(t,e){const r=iqe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}M(YP,"getRule");function iqe(t,e){if(z5(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Wl(n);)(H5(n)||Q_(n)||nP(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}M(iqe,"getRuleName");function jN(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}M(jN,"getToken");function eae(t){const e=t.Grammar,r=t.parser.Lexer,n=new jWe(t);return jP(e,n,r.definition),n.finalize(),n}M(eae,"createCompletionParser");function tae(t){const e=rae(t);return e.finalize(),e}M(tae,"createLangiumParser");function rae(t){const e=t.Grammar,r=t.parser.Lexer,n=new WWe(t);return jP(e,n,r.definition)}M(rae,"prepareLangiumParser");var m7,XP=(m7=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Ti(lP(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(Zu).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=$k(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=oP(r)?Fl.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(z5).flatMap(i=>Up(i).filter(H0)).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(v9(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&&Ene("^"+a.source+"$",e.value)&&n.push(i),n},[])}},M(m7,"DefaultTokenBuilder"),m7),U7,nae=(U7=class{convert(e,r){let n=r.grammarSource;if(V5(n)&&(n=Ine(n)),G0(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 Td.convertInt(r);case"STRING":return Td.convertString(r);case"ID":return Td.convertID(r)}switch((i=zne(e))==null?void 0:i.toLowerCase()){case"number":return Td.convertNumber(r);case"boolean":return Td.convertBoolean(r);case"bigint":return Td.convertBigint(r);case"date":return Td.convertDate(r);default:return r}}},M(U7,"DefaultValueConverter"),U7),Td;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}M(KP,"delayNextTick");var GM=0,aqe=10;function ZP(){return GM=performance.now(),new Vi.CancellationTokenSource}M(ZP,"startCancelableOperation");function iae(t){aqe=t}M(iae,"setInterruptionPeriod");var Od=Symbol("OperationCancelled");function i2(t){return t===Od}M(i2,"isOperationCancelled");async function Xs(t){if(t===Vi.CancellationToken.None)return;const e=performance.now();if(e-GM>=aqe&&(GM=e,await KP(),GM=performance.now()),t.isCancellationRequested)throw Od}M(Xs,"interruptAndCheck");var y7,X0=(y7=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},M(y7,"Deferred"),y7),Ig,v5e=(Ig=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(Ig.isIncremental(n)){const i=sae(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=zX(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&&aae(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}},M(Ig,"FullTextDocument"),Ig),YN;(function(t){function e(i,a,s,o){return new v5e(i,a,s,o)}M(e,"create"),t.create=e;function r(i,a,s){if(i instanceof v5e)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}M(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=XN(a.map(sqe),(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("")}M(n,"applyEdits"),t.applyEdits=n})(YN||(YN={}));function XN(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);XN(n,e),XN(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}M(sae,"getWellformedRange");function sqe(t){const e=sae(t.range);return e!==t.range?{newText:t.newText,range:e}:t}M(sqe,"getWellformedEdit");var oqe;(()=>{var t={975:N=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}M(L,"e");function I(O,D){for(var B,F="",z=0,$=-1,V=0,H=0;H<=O.length;++H){if(H2){var G=F.lastIndexOf("/");if(G!==F.length-1){G===-1?(F="",z=0):z=(F=F.slice(0,G)).length-1-F.lastIndexOf("/"),$=H,V=0;continue}}else if(F.length===2||F.length===1){F="",z=0,$=H,V=0;continue}}D&&(F.length>0?F+="/..":F="..",z=2)}else F.length>0?F+="/"+O.slice($+1,H):F=O.slice($+1,H),z=H-$-1;$=H,V=0}else B===46&&V!==-1?++V:V=-1}return F}M(I,"r");var P={resolve:M(function(){for(var O,D="",B=!1,F=arguments.length-1;F>=-1&&!B;F--){var z;F>=0?z=arguments[F]:(O===void 0&&(O=process.cwd()),z=O),L(z),z.length!==0&&(D=z+"/"+D,B=z.charCodeAt(0)===47)}return D=I(D,!B),B?D.length>0?"/"+D:"/":D.length>0?D:"."},"resolve"),normalize:M(function(O){if(L(O),O.length===0)return".";var D=O.charCodeAt(0)===47,B=O.charCodeAt(O.length-1)===47;return(O=I(O,!D)).length!==0||D||(O="."),O.length>0&&B&&(O+="/"),D?"/"+O:O},"normalize"),isAbsolute:M(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:M(function(){if(arguments.length===0)return".";for(var O,D=0;D0&&(O===void 0?O=B:O+="/"+B)}return O===void 0?".":P.normalize(O)},"join"),relative:M(function(O,D){if(L(O),L(D),O===D||(O=P.resolve(O))===(D=P.resolve(D)))return"";for(var B=1;BH){if(D.charCodeAt($+K)===47)return D.slice($+K+1);if(K===0)return D.slice($+K)}else z>H&&(O.charCodeAt(B+K)===47?G=K:K===0&&(G=0));break}var W=O.charCodeAt(B+K);if(W!==D.charCodeAt($+K))break;W===47&&(G=K)}var oe="";for(K=B+G+1;K<=F;++K)K!==F&&O.charCodeAt(K)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+D.slice($+G):($+=G,D.charCodeAt($)===47&&++$,D.slice($))},"relative"),_makeLong:M(function(O){return O},"_makeLong"),dirname:M(function(O){if(L(O),O.length===0)return".";for(var D=O.charCodeAt(0),B=D===47,F=-1,z=!0,$=O.length-1;$>=1;--$)if((D=O.charCodeAt($))===47){if(!z){F=$;break}}else z=!1;return F===-1?B?"/":".":B&&F===1?"//":O.slice(0,F)},"dirname"),basename:M(function(O,D){if(D!==void 0&&typeof D!="string")throw new TypeError('"ext" argument must be a string');L(O);var B,F=0,z=-1,$=!0;if(D!==void 0&&D.length>0&&D.length<=O.length){if(D.length===O.length&&D===O)return"";var V=D.length-1,H=-1;for(B=O.length-1;B>=0;--B){var G=O.charCodeAt(B);if(G===47){if(!$){F=B+1;break}}else H===-1&&($=!1,H=B+1),V>=0&&(G===D.charCodeAt(V)?--V==-1&&(z=B):(V=-1,z=H))}return F===z?z=H:z===-1&&(z=O.length),O.slice(F,z)}for(B=O.length-1;B>=0;--B)if(O.charCodeAt(B)===47){if(!$){F=B+1;break}}else z===-1&&($=!1,z=B+1);return z===-1?"":O.slice(F,z)},"basename"),extname:M(function(O){L(O);for(var D=-1,B=0,F=-1,z=!0,$=0,V=O.length-1;V>=0;--V){var H=O.charCodeAt(V);if(H!==47)F===-1&&(z=!1,F=V+1),H===46?D===-1?D=V:$!==1&&($=1):D!==-1&&($=-1);else if(!z){B=V+1;break}}return D===-1||F===-1||$===0||$===1&&D===F-1&&D===B+1?"":O.slice(D,F)},"extname"),format:M(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(D,B){var F=B.dir||B.root,z=B.base||(B.name||"")+(B.ext||"");return F?F===B.root?F+z:F+"/"+z:z})(0,O)},"format"),parse:M(function(O){L(O);var D={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return D;var B,F=O.charCodeAt(0),z=F===47;z?(D.root="/",B=1):B=0;for(var $=-1,V=0,H=-1,G=!0,K=O.length-1,W=0;K>=B;--K)if((F=O.charCodeAt(K))!==47)H===-1&&(G=!1,H=K+1),F===46?$===-1?$=K:W!==1&&(W=1):$!==-1&&(W=-1);else if(!G){V=K+1;break}return $===-1||H===-1||W===0||W===1&&$===H-1&&$===V+1?H!==-1&&(D.base=D.name=V===0&&z?O.slice(1,H):O.slice(V,H)):(V===0&&z?(D.name=O.slice(1,$),D.base=O.slice(1,H)):(D.name=O.slice(V,$),D.base=O.slice(V,H)),D.ext=O.slice($,H)),V>0?D.dir=O.slice(0,V-1):z&&(D.dir="/"),D},"parse"),sep:"/",delimiter:":",win32:null,posix:null};P.posix=P,N.exports=P}},e={};function r(N){var L=e[N];if(L!==void 0)return L.exports;var I=e[N]={exports:{}};return t[N](I,I.exports,r),I.exports}M(r,"r"),r.d=(N,L)=>{for(var I in L)r.o(L,I)&&!r.o(N,I)&&Object.defineProperty(N,I,{enumerable:!0,get:L[I]})},r.o=(N,L)=>Object.prototype.hasOwnProperty.call(N,L),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:M(()=>f,"URI"),Utils:M(()=>A,"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,L){if(!N.scheme&&L)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 ("//")')}}M(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,R=class R{constructor(L,I,P,O,D,B=!1){wr(this,"scheme");wr(this,"authority");wr(this,"path");wr(this,"query");wr(this,"fragment");typeof L=="object"?(this.scheme=L.scheme||u,this.authority=L.authority||u,this.path=L.path||u,this.query=L.query||u,this.fragment=L.fragment||u):(this.scheme=(function(F,z){return F||z?F:"file"})(L,B),this.authority=I||u,this.path=(function(F,z){switch(F){case"https":case"http":case"file":z?z[0]!==h&&(z=h+z):z=h}return z})(this.scheme,P||u),this.query=O||u,this.fragment=D||u,l(this,B))}static isUri(L){return L instanceof R||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}get fsPath(){return b(this,!1)}with(L){if(!L)return this;let{scheme:I,authority:P,path:O,query:D,fragment:B}=L;return I===void 0?I=this.scheme:I===null&&(I=u),P===void 0?P=this.authority:P===null&&(P=u),O===void 0?O=this.path:O===null&&(O=u),D===void 0?D=this.query:D===null&&(D=u),B===void 0?B=this.fragment:B===null&&(B=u),I===this.scheme&&P===this.authority&&O===this.path&&D===this.query&&B===this.fragment?this:new g(I,P,O,D,B)}static parse(L,I=!1){const P=d.exec(L);return P?new g(P[2]||u,k(P[4]||u),k(P[5]||u),k(P[7]||u),k(P[9]||u),I):new g(u,u,u,u,u)}static file(L){let I=u;if(i&&(L=L.replace(/\\/g,h)),L[0]===h&&L[1]===h){const P=L.indexOf(h,2);P===-1?(I=L.substring(2),L=h):(I=L.substring(2,P),L=L.substring(P)||h)}return new g("file",I,L,u,u)}static from(L){const I=new g(L.scheme,L.authority,L.path,L.query,L.fragment);return l(I,!0),I}toString(L=!1){return v(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof R)return L;{const I=new g(L);return I._formatted=L.external,I._fsPath=L._sep===p?L.fsPath:null,I}}return L}};M(R,"l");let f=R;const p=i?1:void 0,_=class _ extends f{constructor(){super(...arguments);wr(this,"_formatted",null);wr(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this,!1)),this._fsPath}toString(I=!1){return I?v(this,!0):(this._formatted||(this._formatted=v(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}};M(_,"d");let g=_;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 U(N,L,I){let P,O=-1;for(let D=0;D=97&&B<=122||B>=65&&B<=90||B>=48&&B<=57||B===45||B===46||B===95||B===126||L&&B===47||I&&B===91||I&&B===93||I&&B===58)O!==-1&&(P+=encodeURIComponent(N.substring(O,D)),O=-1),P!==void 0&&(P+=N.charAt(D));else{P===void 0&&(P=N.substr(0,D));const F=m[B];F!==void 0?(O!==-1&&(P+=encodeURIComponent(N.substring(O,D)),O=-1),P+=F):O===-1&&(O=D)}}return O!==-1&&(P+=encodeURIComponent(N.substring(O))),P!==void 0?P:N}M(U,"m");function y(N){let L;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?L?N.path.substr(1):N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(I=I.replace(/\//g,"\\")),I}M(b,"v");function v(N,L){const I=L?y:U;let P="",{scheme:O,authority:D,path:B,query:F,fragment:z}=N;if(O&&(P+=O,P+=":"),(D||O==="file")&&(P+=h,P+=h),D){let $=D.indexOf("@");if($!==-1){const V=D.substr(0,$);D=D.substr($+1),$=V.lastIndexOf(":"),$===-1?P+=I(V,!1,!1):(P+=I(V.substr(0,$),!1,!1),P+=":",P+=I(V.substr($+1),!1,!0)),P+="@"}D=D.toLowerCase(),$=D.lastIndexOf(":"),$===-1?P+=I(D,!1,!0):(P+=I(D.substr(0,$),!1,!0),P+=D.substr($))}if(B){if(B.length>=3&&B.charCodeAt(0)===47&&B.charCodeAt(2)===58){const $=B.charCodeAt(1);$>=65&&$<=90&&(B=`/${String.fromCharCode($+32)}:${B.substr(3)}`)}else if(B.length>=2&&B.charCodeAt(1)===58){const $=B.charCodeAt(0);$>=65&&$<=90&&(B=`${String.fromCharCode($+32)}:${B.substr(2)}`)}P+=I(B,!0,!1)}return F&&(P+="?",P+=I(F,!1,!1)),z&&(P+="#",P+=L?z:U(z,!1,!1)),P}M(v,"b");function w(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+w(N.substr(3)):N}}M(w,"C");const T=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function k(N){return N.match(T)?N.replace(T,(L=>w(L))):N}M(k,"w");var C=r(975);const S=C.posix||C,E="/";var A;(function(N){N.joinPath=function(L,...I){return L.with({path:S.join(L.path,...I)})},N.resolvePath=function(L,...I){let P=L.path,O=!1;P[0]!==E&&(P=E+P,O=!0);let D=S.resolve(P,...I);return O&&D[0]===E&&!L.authority&&(D=D.substring(1)),L.with({path:D})},N.dirname=function(L){if(L.path.length===0||L.path===E)return L;let I=S.dirname(L.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),L.with({path:I})},N.basename=function(L){return S.basename(L.path)},N.extname=function(L){return S.extname(L.path)}})(A||(A={})),oqe=n})();var{URI:Qc,Utils:p3}=oqe,Pl;(function(t){t.basename=p3.basename,t.dirname=p3.dirname,t.extname=p3.extname,t.joinPath=p3.joinPath,t.resolvePath=p3.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())}M(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Qc.parse(s).path:s.path,u=typeof o=="string"?Qc.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:Pl.joinPath(Qc.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Pl.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}},M(b7,"UriTrie"),b7),Ln;(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"})(Ln||(Ln={}));var v7,lqe=(v7=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Vi.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Qc.parse(e.uri),Vi.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Vi.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:Ln.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Ln.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=Ln.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=YN.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},M(v7,"DefaultLangiumDocumentFactory"),v7),x7,cqe=(x7=class{constructor(e){this.documentTrie=new oae,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Ti(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,Ln.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Ln.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Ln.Changed;return this.documentTrie.delete(r),n}},M(x7,"DefaultLangiumDocuments"),x7),Lm=Symbol("RefResolving"),w7,uqe=(w7=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=Vi.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 _h(e.parseResult.value))await Xs(r),b4(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 _h(e.parseResult.value))await Xs(r),b4(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=Lm;try{const i=this.getCandidate(e);if(Hm(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=Lm;try{const i=this.getCandidates(e),a=[];if(Hm(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(ls(this._ref))return this._ref;if(Wre(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=Lm;const o=T6(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(Hm(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=T6(e.container).$document;n&&n.stateV5(r)&&r.isMulti)}findDeclarations(e){if(e){const r=_ne(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(_l(i)||Vd(i))return fN(i);if(Array.isArray(i)){for(const a of i)if((_l(a)||Vd(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return fN(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||gne(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 b4(n))if(Vd(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=>Pl.equals(a.sourceUri,r.documentUri))),n.push(...i),Ti(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=Oh(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:w4(a),local:!0})}}return n}},M(C7,"DefaultReferences"),C7),k7,K0=(k7=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return rC.sum(Ti(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?Ti(r):m4}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 Ti(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Ti(this.map.keys())}values(){return Ti(this.map.values()).flat()}entriesGroupedByKey(){return Ti(this.map.entries())}},M(k7,"MultiMap"),k7),S7,KN=(S7=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}},M(S7,"BiMap"),S7),E7,fqe=(E7=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Vi.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=Ok,i=Vi.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await Xs(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=Vi.CancellationToken.None){const n=e.parseResult.value,i=new K0;for(const a of Up(n))await Xs(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))}}},M(E7,"DefaultScopeComputation"),E7),A7,VX=(A7=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}},M(A7,"StreamScope"),A7),M7,Upr=(M7=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?Ti(i).concat(this.outerScope.getElements(e)):Ti(i)}getAllElements(){let e=Ti(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(M7,"MapScope"),M7),R7,pqe=(R7=class{constructor(e,r,n){this.elements=new K0,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?Ti(n).concat(this.outerScope.getElements(e)):Ti(n)}getAllElements(){let e=Ti(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},M(R7,"MultiMapScope"),R7),ypr={getElement(){},getElements(){return m4},getAllElements(){return m4}},L7,JP=(L7=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")}},M(L7,"DisposableCache"),L7),I7,cae=(I7=class extends JP{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()}},M(I7,"SimpleCache"),I7),N7,QP=(N7=class extends JP{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}},M(N7,"ContextCache"),N7),D7,gqe=(D7=class extends QP{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)}))}},M(D7,"DocumentCache"),D7),O7,uae=(O7=class extends cae{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()}))}},M(O7,"WorkspaceCache"),O7),_7,mqe=(_7=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 uae(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Oh(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 VX(Ti(e),r,n)}createScopeForNodes(e,r,n){const i=Ti(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new VX(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new pqe(this.indexManager.allElements(e)))}},M(_7,"DefaultScopeProvider"),_7);function hae(t){return typeof t.$comment=="string"}M(hae,"isAstNodeWithComment");function HX(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}M(HX,"isIntermediateReference");var P7,Uqe=(P7=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=M((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Oh(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(_l(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Oh(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(Vd(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Oh(p.ref);let U="";this.currentDocument&&this.currentDocument!==m&&(o?U=o(m.uri,g):U=m.uri.toString());const y=this.astNodeLocator.getAstNodePath(g);f.push(`${U}#${y}`)}return{$refs:f,$refText:d}}else if(ls(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=M(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=Dne(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(i2(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=Ti(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}},M($7,"ValidationRegistry"),$7),vqe=Object.freeze({validateNode:!0,validateChildren:!0}),F7,xqe=(F7=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=Vi.CancellationToken.None){const i=e.parseResult,a=[];if(await Xs(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)===Iu.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Iu.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===Iu.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(i2(s))throw s;console.error("An error occurred during validation:",s)}return await Xs(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:ww(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:fae(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=nC(i.token);if(a){const s={severity:ww("error"),range:a,message:i.message,data:bU(Iu.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:Iu.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=Vi.CancellationToken.None){const i=[],a=M((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=Vi.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await Xs(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Vi.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=_h(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=_h(e).iterator();for(const o of s){await Xs(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 vqe}async validateAstAfter(e,r,n,i=Vi.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await Xs(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:dae(n),severity:ww(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},M(F7,"DefaultDocumentValidator"),F7);function dae(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=cP(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=One(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}}}M(dae,"getDiagnosticRange");function ww(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)}}M(ww,"toDiagnosticSeverity");function fae(t){switch(t){case"error":return bU(Iu.LexingError);case"warning":return bU(Iu.LexingWarning);case"info":return bU(Iu.LexingInfo);case"hint":return bU(Iu.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}M(fae,"toDiagnosticData");var Iu;(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"})(Iu||(Iu={}));var z7,wqe=(z7=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Oh(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=M(()=>s??(s=w4(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:w4(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},M(z7,"DefaultAstNodeDescriptionProvider"),z7),V7,Tqe=(V7=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Vi.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of _h(i))await Xs(r),b4(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=[];_l(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Vd(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Oh(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=w4(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Pl.equals(l.documentUri,i)});return s}},M(V7,"DefaultReferenceDescriptionProvider"),V7),H7,Cqe=(H7=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)}},M(H7,"DefaultAstNodeLocator"),H7),eB={};Y_(eB,zre(y9()));var G7,kqe=(G7=class{constructor(e){this._ready=new X0,this.onConfigurationSectionUpdateEmitter=new eB.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}},M(G7,"DefaultConfigurationProvider"),G7),JE=zre(Knr()),DU;(function(t){function e(r){return{dispose:M(async()=>await r(),"dispose")}}M(e,"create"),t.create=e})(DU||(DU={}));var W7,Sqe=(W7=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new K0,this.documentPhaseListeners=new K0,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Ln.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=Vi.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Ln.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Ln.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=Ln.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Ln.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Vi.CancellationToken.None){this.currentState=Ln.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=Ln.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Ln.Changed)}const s=Ti(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,Ln.ComputedScopes)),await this.emitUpdate(a,i),await Xs(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 Ti(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),DU.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Ln.Changed:case Ln.Parsed:this.indexManager.removeContent(e.uri);case Ln.IndexedContent:e.localSymbols=void 0;case Ln.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Ln.Linked:this.indexManager.removeReferences(e.uri);case Ln.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Ln.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Ln.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Ln.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Ln.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Ln.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,Ln.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Ln.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,Ln.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),DU.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),DU.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Vi.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(Od);if(this.currentState>=e&&e>i.state)return Promise.reject(new JE.ResponseError(JE.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Ln[i.state]}, requiring ${Ln[e]}, but workspace state is already ${Ln[this.currentState]}. Returning undefined.`))}else return Promise.reject(new JE.ResponseError(JE.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Pl.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Od)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Od):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Od)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await Xs(n),await s(e,n)}catch(o){if(!i2(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 Xs(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=Ti(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)??{}}},M(W7,"DefaultDocumentBuilder"),W7),q7,Eqe=(q7=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new QP,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Oh(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Pl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Ti(i)}allElements(e,r){let n=Ti(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=Vi.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=Vi.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}},M(q7,"DefaultIndexManager"),q7),j7,Aqe=(j7=class{constructor(e){this.initialBuildOptions={},this._ready=new X0,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=Vi.CancellationToken.None){const n=await this.performStartup(e);await Xs(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=M(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=Ti(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 Qc.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=Pl.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},M(j7,"DefaultWorkspaceManager"),j7),Y7,Mqe=(Y7=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return TX.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return TX.buildUnableToPopLexerModeMessage(e)}},M(Y7,"DefaultLexerErrorMessageProvider"),Y7),pae={mode:"full"},X7,gae=(X7=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=JN(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Fl(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=pae){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(JN(e))return e;const r=rB(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},M(X7,"DefaultLexer"),X7);function tB(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}M(tB,"isTokenTypeArray");function rB(t){return t&&"modes"in t&&"defaultMode"in t}M(rB,"isIMultiModeLexerDefinition");function JN(t){return!tB(t)&&!rB(t)}M(JN,"isTokenTypeDictionary");Nk();function mae(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=hi.create(0,0));const a=yae(t),s=nB(n),o=Rqe({lines:a,position:i,options:s});return Nqe({index:0,tokens:o,position:i})}M(mae,"parseJSDoc");function Uae(t,e){const r=nB(e),n=yae(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))}M(Uae,"isJSDoc");function yae(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(D_e)}M(yae,"getLines");var x5e=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,bpr=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Rqe(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=hi.create(r,n);e.push({type:"break",content:"",range:zn.create(p,p)})}}else{x5e.lastIndex=d;const p=x5e.exec(h);if(p){const g=p[0],m=p[1],U=hi.create(r,n+d),y=hi.create(r,n+d+g.length);e.push({type:"tag",content:m,range:zn.create(U,y)}),d+=g.length,d=QN(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}M(Rqe,"tokenize");function Lqe(t,e,r,n){const i=[];if(t.length===0){const a=hi.create(r,n),s=hi.create(r,n+e.length);i.push({type:"text",content:e,range:zn.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:zn.create(hi.create(r,a+n),hi.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:zn.create(hi.create(r,a+h+n),hi.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:zn.create(hi.create(r,a+h+n),hi.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:zn.create(hi.create(r,a+h+n),hi.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:zn.create(hi.create(r,a+n),hi.create(r,a+n+s.length))})}return i}M(Lqe,"buildInlineTokens");var vpr=/\S/,xpr=/\s*$/;function QN(t,e){const r=t.substring(e).match(vpr);return r?e+r.index:t.length}M(QN,"skipWhitespace");function Iqe(t){const e=t.match(xpr);if(e&&typeof e.index=="number")return e.index}M(Iqe,"lastCharacter");function Nqe(t){var a,s;const e=hi.create(t.position.line,t.position.character);if(t.tokens.length===0)return new w5e([],zn.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+=WX(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+=WX(r)+i}return r.trim()}},M(K7,"JSDocCommentImpl"),K7),Z7,BV=(Z7=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=Pqe(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}},M(Z7,"JSDocTagImpl"),Z7);function Pqe(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=QN(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))??Bqe(e,a)}}M(Pqe,"renderInlineTag");function Bqe(t,e){try{return Qc.parse(t,!0),`[${e}](${t})`}catch{return t}}M(Bqe,"renderLinkDefault");var J7,GX=(J7=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}},M(J7,"JSDocTextImpl"),J7),Q7,$qe=(Q7=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},M(Q7,"JSDocLineImpl"),Q7);function WX(t){return t.endsWith(` `)?` `:` -`}_(BX,"fillNewlines");var K4,AUe=(K4=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&cse(r))return lse(r).toMarkdown({renderLink:_((i,s)=>this.documentationLinkRenderer(e,i,s),"renderLink"),renderTag:_(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 s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Dh(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(l=>l.name===r);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},_(K4,"JSDocDocumentationProvider"),K4),Z4,MUe=(Z4=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return nse(e)?e.$comment:(r=hne(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},_(Z4,"DefaultCommentProvider"),Z4),Q4,RUe=(Q4=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},_(Q4,"DefaultAsyncParser"),Q4),J4,J0r=(J4=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 Y0;let s;const a=r.onCancellationRequested(()=>{s=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(()=>{a.dispose(),clearTimeout(s)}),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 Y0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Od)}),this.queue.push(r),r.promise}},_(J4,"AbstractThreadedAsyncParser"),J4),eT,epr=(eT=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Z$.Emitter,this.deferred=new Y0,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(s=>{const a=s;this.deferred.resolve(a),this.unlock()}),n(s=>{this.deferred.reject(s),this.unlock()})}terminate(){this.deferred.reject(Od),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 Y0,this.sendMessage(e),this.deferred.promise}},_(eT,"ParserWorker"),eT),tT,_Ue=(tT=class{constructor(){this.previousTokenSource=new Vi.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Y$();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Vi.CancellationToken.None){const i=new Y0,s={action:r,deferred:i,cancellationToken:n};return e.push(s),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 s=await Promise.resolve().then(()=>r(i));n.resolve(s)}catch(s){t2(s)?n.resolve(void 0):n.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},_(tT,"DefaultWorkspaceLock"),tT),rT,LUe=(rT=class{constructor(e){this.grammarElementIdMap=new jN,this.tokenTypeIdMap=new jN,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 Ph(e))r.set(i,{});if(e.$cstNode)for(const i of v3(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,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)la(o)?a.push(this.dehydrateAstNode(o,r)):Pl(o)?a.push(this.dehydrateReference(o,r)):a.push(o)}else la(s)?n[i]=this.dehydrateAstNode(s,r):Pl(s)?n[i]=this.dehydrateReference(s,r):s!==void 0&&(n[i]=s);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 YP(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),z0(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Pv(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 s of Ph(e))r.set(s,{});let i;if(e.$cstNode)for(const s of v3(e.$cstNode)){let a;"fullText"in s?(a=new Vie(s.fullText),i=a):"content"in s?a=new G$:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(n.set(s,a),a.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,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];n[i]=a;for(const o of s)la(o)?a.push(this.setParent(this.hydrateAstNode(o,r),n)):Pl(o)?a.push(this.hydrateReference(o,n,i,r)):a.push(o)}else la(s)?n[i]=this.setParent(this.hydrateAstNode(s,r),n):Pl(s)?n[i]=this.hydrateReference(s,n,i,r):s!==void 0&&(n[i]=s);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),z0(i))for(const s of e.content){const a=this.hydrateCstNode(s,r,n++);i.content.push(a)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new HN(n,i,{start:{line:s,character:a},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 Ph(this.grammar))XP(r)&&this.grammarElementIdMap.set(r,e++)}},_(rT,"DefaultHydrator"),rT);function uo(t){return{documentation:{CommentProvider:_(e=>new MUe(e),"CommentProvider"),DocumentationProvider:_(e=>new AUe(e),"DocumentationProvider")},parser:{AsyncParser:_(e=>new RUe(e),"AsyncParser"),GrammarConfig:_(e=>Dne(e),"GrammarConfig"),LangiumParser:_(e=>jie(e),"LangiumParser"),CompletionParser:_(e=>Uie(e),"CompletionParser"),ValueConverter:_(()=>new Xie,"ValueConverter"),TokenBuilder:_(()=>new U$,"TokenBuilder"),Lexer:_(e=>new ose(e),"Lexer"),ParserErrorMessageProvider:_(()=>new Gie,"ParserErrorMessageProvider"),LexerErrorMessageProvider:_(()=>new mUe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:_(()=>new hUe,"AstNodeLocator"),AstNodeDescriptionProvider:_(e=>new cUe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:_(e=>new uUe(e),"ReferenceDescriptionProvider")},references:{Linker:_(e=>new Zqe(e),"Linker"),NameProvider:_(()=>new Qqe,"NameProvider"),ScopeProvider:_(e=>new nUe(e),"ScopeProvider"),ScopeComputation:_(e=>new eUe(e),"ScopeComputation"),References:_(e=>new Jqe(e),"References")},serializer:{Hydrator:_(e=>new LUe(e),"Hydrator"),JsonSerializer:_(e=>new iUe(e),"JsonSerializer")},validation:{DocumentValidator:_(e=>new lUe(e),"DocumentValidator"),ValidationRegistry:_(e=>new aUe(e),"ValidationRegistry")},shared:_(()=>t.shared,"shared")}}_(uo,"createDefaultCoreModule");function ho(t){return{ServiceRegistry:_(e=>new sUe(e),"ServiceRegistry"),workspace:{LangiumDocuments:_(e=>new Kqe(e),"LangiumDocuments"),LangiumDocumentFactory:_(e=>new Xqe(e),"LangiumDocumentFactory"),DocumentBuilder:_(e=>new fUe(e),"DocumentBuilder"),IndexManager:_(e=>new pUe(e),"IndexManager"),WorkspaceManager:_(e=>new gUe(e),"WorkspaceManager"),FileSystemProvider:_(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:_(()=>new _Ue,"WorkspaceLock"),ConfigurationProvider:_(e=>new dUe(e),"ConfigurationProvider")},profilers:{}}}_(ho,"createDefaultSharedCoreModule");var FX;(function(t){t.merge=(e,r)=>C3(C3({},e),r)})(FX||(FX={}));function jn(t,e,r,n,i,s,a,o,l){const u=[t,e,r,n,i,s,a,o,l].reduce(C3,{});return gse(u)}_(jn,"inject");var IUe=Symbol("isProxy");function pse(t){if(t&&t[IUe])for(const e of Object.values(t))pse(e);return t}_(pse,"eagerLoad");function gse(t,e){const r=new Proxy({},{deleteProperty:_(()=>!1,"deleteProperty"),set:_(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:_((n,i)=>i===IUe?!0:zX(n,i,t,e||r),"get"),getOwnPropertyDescriptor:_((n,i)=>(zX(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:_((n,i)=>i in t,"has"),ownKeys:_(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}_(gse,"_inject");var fve=Symbol();function zX(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]===fve)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]=fve;try{t[e]=typeof i=="function"?i(n):gse(i,n)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}_(zX,"_resolve");function C3(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]=C3(i,n):t[r]=C3({},n)}else t[r]=n}return t}_(C3,"_merge");var VX={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},yy;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(yy||(yy={}));var nT,NUe=(nT=class extends U${constructor(e=VX){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...VX,...e},this.indentTokenType=wx({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=wx({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Q$(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:s,whitespaceTokenName:a,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=yy.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===s?l=f:f.name===i?u=f:f.name===a?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[yy.REGULAR]:[l,u,...d,h],[yy.IGNORE_INDENTATION]:[...d,h]},defaultMode:yy.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 s=this.whitespaceRegExp.exec(e);return{currIndentLevel:(s==null?void 0:s[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:s}}createIndentationTokenInstance(e,r,n,i){const s=this.getLineNumber(r,i);return j7(e,n,i,i+n.length,s,s,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:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);return s<=a?null:(this.indentationStack.push(s),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:s,prevIndentLevel:a,match:o}=this.matchWhitespace(e,r,n,i);if(s>=a)return null;const l=this.indentationStack.lastIndexOf(s);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${s} 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}},_(nT,"IndentationAwareTokenBuilder"),nT),iT,tpr=(iT=class extends ose{constructor(e){if(super(e),e.parser.TokenBuilder instanceof NUe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=ase){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:s,dedentTokenType:a}=this.indentationTokenBuilder,o=s.tokenTypeIdx,l=a.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},_(iT,"IndentationAwareLexer"),iT),mse={};Dm(mse,{AstUtils:()=>Fre,BiMap:()=>jN,Cancellation:()=>Vi,ContextCache:()=>K$,CstUtils:()=>Pre,DONE_RESULT:()=>Sl,Deferred:()=>Y0,Disposable:()=>Ly,DisposableCache:()=>X$,DocumentCache:()=>rUe,EMPTY_STREAM:()=>f3,ErrorWithLocation:()=>r$,GrammarUtils:()=>gne,MultiMap:()=>X0,OperationCancelled:()=>Od,Reduction:()=>J6,RegExpUtils:()=>yne,SimpleCache:()=>tse,StreamImpl:()=>Nd,TreeStreamImpl:()=>p3,URI:()=>Jc,UriTrie:()=>Jie,UriUtils:()=>$l,WorkspaceCache:()=>rse,assertCondition:()=>mne,assertUnreachable:()=>Pm,delayNextTick:()=>j$,interruptAndCheck:()=>Xa,isOperationCancelled:()=>t2,loadGrammarFromJson:()=>fo,setInterruptionPeriod:()=>Kie,startCancelableOperation:()=>Y$,stream:()=>Ti});qP(mse,Z$);var sT,OUe=(sT=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[]}},_(sT,"EmptyFileSystemProvider"),sT),Fo={fileSystemProvider:_(()=>new OUe,"fileSystemProvider")},rpr={Grammar:_(()=>{},"Grammar"),LanguageMetaData:_(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},npr={AstReflection:_(()=>new ane,"AstReflection")};function DUe(){const t=jn(ho(Fo),npr),e=jn(uo({shared:t}),rpr);return t.ServiceRegistry.register(e),e}_(DUe,"createMinimalGrammarServices");function fo(t){const e=DUe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Jc.parse(`memory:/${r.name??"grammar"}.langium`)),r}_(fo,"loadGrammarFromJson");qP(UDe,mse);var aT,ipr=(aT=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new X0}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 PUe(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 a of r.entries.keys()){const o=r.entries.get(a),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${a}`,count:o.length,duration:l})}const i=r.duration-n.map(a=>a.duration).reduce((a,o)=>a+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((a,o)=>o.duration-a.duration);function s(a){return Math.round(100*a)/100}return _(s,"Round"),console.table(n.map(a=>({Element:a.name,Count:a.count,"Self %":s(100*a.duration/r.duration),"Time (ms)":s(a.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])}},_(aT,"DefaultLangiumProfiler"),aT),oT,PUe=(oT=class{constructor(e,r){this.stack=[],this.entries=new X0,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)}},_(oT,"ProfilingTask"),oT),HX;(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:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(HX||(HX={}));var GX;(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]*/}})(GX||(GX={}));var WX;(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]*/}})(WX||(WX={}));var qX;(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])?/}})(qX||(qX={}));var UX;(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]*/}})(UX||(UX={}));var jX;(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]*/}})(jX||(jX={}));var YX;(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]*/}})(YX||(YX={}));var XX;(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]*/}})(XX||(XX={}));var KX;(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]*/}})(KX||(KX={}));var ZX;(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]*?\*\)/}})(ZX||(ZX={}));var QX;(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]*?\*\//}})(QX||(QX={}));var JX;(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]*/}})(JX||(JX={}));var eK;(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:/"[^"]*"|'[^']*'/}})(eK||(eK={}));var tK;(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])*/}})(tK||(tK={}));var rK;(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]*/}})(rK||(rK={}));({...HX.Terminals,...GX.Terminals,...WX.Terminals,...qX.Terminals,...UX.Terminals,...jX.Terminals,...YX.Terminals,...XX.Terminals,...KX.Terminals,...ZX.Terminals,...QX.Terminals,...JX.Terminals,...tK.Terminals,...eK.Terminals,...rK.Terminals});var pve={$type:"AbnfAlternation",alternatives:"alternatives"},gve={$type:"AbnfConcatenation",elements:"elements"},OH={$type:"AbnfElement",primary:"primary",repeat:"repeat"},mve={$type:"AbnfGroup",element:"element"},yve={$type:"AbnfNumVal",value:"value"},vve={$type:"AbnfOptionalGroup",element:"element"},I2={$type:"AbnfPrimary"},DH={$type:"AbnfRule",definition:"definition",name:"name"},bve={$type:"AbnfRuleName",name:"name"},xve={$type:"AbnfStringLiteral",value:"value"},KM={$type:"Accelerator",name:"name",x:"x",y:"y"},PH={$type:"Alignment",direction:"direction",members:"members"},ZM={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},dk={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},$H={$type:"Annotations",x:"x",y:"y"},hd={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function spr(t){return ra.isInstance(t,hd.$type)}_(spr,"isArchitecture");var QM={$type:"Axis",label:"label",name:"name"},G9={$type:"Branch",name:"name",order:"order"};function apr(t){return ra.isInstance(t,G9.$type)}_(apr,"isBranch");var wve={$type:"Checkout",branch:"branch"},JM={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},BH={$type:"ClassDefStatement",className:"className",styleText:"styleText"},ub={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function opr(t){return ra.isInstance(t,ub.$type)}_(opr,"isCommit");var eR={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},o1={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},tR={$type:"Curve",entries:"entries",label:"label",name:"name"},R1={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function lpr(t){return ra.isInstance(t,R1.$type)}_(lpr,"isCynefin");var rR={$type:"Deaccelerator",name:"name",x:"x",y:"y"},Tve={$type:"Decorator",strategy:"strategy"},N2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},W9={$type:"DomainBlock",domain:"domain",items:"items"};function cpr(t){return ra.isInstance(t,W9.$type)}_(cpr,"isDomainBlock");var nK={$type:"DomainItem",label:"label"};function upr(t){return ra.isInstance(t,nK.$type)}_(upr,"isDomainItem");var Cve={$type:"EbnfChoice",alternatives:"alternatives"},kve={$type:"EbnfExceptionPostfix",except:"except"},Sve={$type:"EbnfGroup",element:"element"},Eve={$type:"EbnfNonTerminal",name:"name"},Ave={$type:"EbnfOneOrMorePostfix",operator:"operator"},Mve={$type:"EbnfOptional",element:"element"},Rve={$type:"EbnfOptionalPostfix",operator:"operator"},fk={$type:"EbnfPostfix"},l1={$type:"EbnfPrimary"},_ve={$type:"EbnfRepetition",element:"element"},FH={$type:"EbnfRule",definition:"definition",name:"name"},Lve={$type:"EbnfSequence",elements:"elements"},Ive={$type:"EbnfSpecial",text:"text"},zH={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Nve={$type:"EbnfTerminal",value:"value"},Ove={$type:"EbnfZeroOrMorePostfix",operator:"operator"},id={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},O2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},c1={$type:"EmFrame"},pk={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},Dve={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},VH={$type:"EmModelEntity",name:"name"};function hpr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}_(hpr,"isEmModelEntityType");var nR={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Hf={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function $Ue(t){return ra.isInstance(t,Hf.$type)}_($Ue,"isEmResetFrame");var Fp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},HH={$type:"Entry",axis:"axis",value:"value"},Nf={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Pve={$type:"Evolution",stages:"stages"},iR={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},GH={$type:"Evolve",component:"component",target:"target"},_1={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function dpr(t){return ra.isInstance(t,_1.$type)}_(dpr,"isGitGraph");var gk={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},fS={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function fpr(t){return ra.isInstance(t,fS.$type)}_(fpr,"isInfo");var mk={$type:"Item",classSelector:"classSelector",name:"name"},WH={$type:"Junction",id:"id",in:"in"},yk={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},sR={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},u1={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},hb={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function ppr(t){return ra.isInstance(t,hb.$type)}_(ppr,"isMerge");var aR={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},qH={$type:"Option",name:"name",value:"value"},db={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function gpr(t){return ra.isInstance(t,db.$type)}_(gpr,"isPacket");var fb={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function mpr(t){return ra.isInstance(t,fb.$type)}_(mpr,"isPacketBlock");var $ve={$type:"PegAny",dot:"dot"},Bve={$type:"PegGroup",element:"element"},Fve={$type:"PegIdentifier",name:"name"},zve={$type:"PegLiteral",value:"value"},Vve={$type:"PegOrderedChoice",alternatives:"alternatives"},UH={$type:"PegPrefix",operator:"operator",suffix:"suffix"},vk={$type:"PegPrimary"},jH={$type:"PegRule",definition:"definition",name:"name"},Hve={$type:"PegSequence",elements:"elements"},YH={$type:"PegSuffix",operator:"operator",primary:"primary"},L1={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function ypr(t){return ra.isInstance(t,L1.$type)}_(ypr,"isPie");var q9={$type:"PieSection",label:"label",value:"value"};function vpr(t){return ra.isInstance(t,q9.$type)}_(vpr,"isPieSection");var XH={$type:"Pipeline",components:"components",parent:"parent"},oR={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},h1={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},pb={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function bpr(t){return ra.isInstance(t,pb.$type)}_(bpr,"isRailroad");var gb={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function xpr(t){return ra.isInstance(t,gb.$type)}_(xpr,"isRailroadAbnf");var Gve={$type:"RailroadChoiceExpr",alternatives:"alternatives"},mb={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function wpr(t){return ra.isInstance(t,mb.$type)}_(wpr,"isRailroadEbnf");var Of={$type:"RailroadExpression"},Wve={$type:"RailroadNonTerminalExpr",name:"name"},qve={$type:"RailroadOneOrMoreExpr",element:"element"},Uve={$type:"RailroadOptionalExpr",element:"element"},yb={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Tpr(t){return ra.isInstance(t,yb.$type)}_(Tpr,"isRailroadPeg");var KH={$type:"RailroadRule",definition:"definition",name:"name"},jve={$type:"RailroadSequenceExpr",elements:"elements"},Yve={$type:"RailroadSpecialExpr",text:"text"},Xve={$type:"RailroadTerminalExpr",value:"value"},Kve={$type:"RailroadZeroOrMoreExpr",element:"element"},ZH={$type:"Section",classSelector:"classSelector",name:"name"},D2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},QH={$type:"Size",height:"height",width:"width"},P2={$type:"Statement"},pS={$type:"Transition",from:"from",label:"label",to:"to"};function Cpr(t){return ra.isInstance(t,pS.$type)}_(Cpr,"isTransition");var vb={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function kpr(t){return ra.isInstance(t,vb.$type)}_(kpr,"isTreemap");var JH={$type:"TreemapRow",indent:"indent",item:"item"},$2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},bk={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},xo={$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 Spr(t){return ra.isInstance(t,xo.$type)}_(Spr,"isWardley");var lT,BUe=(lT=class extends Bre{constructor(){super(...arguments),this.types={AbnfAlternation:{name:pve.$type,properties:{alternatives:{name:pve.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:gve.$type,properties:{elements:{name:gve.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:OH.$type,properties:{primary:{name:OH.primary},repeat:{name:OH.repeat}},superTypes:[]},AbnfGroup:{name:mve.$type,properties:{element:{name:mve.element}},superTypes:[I2.$type]},AbnfNumVal:{name:yve.$type,properties:{value:{name:yve.value}},superTypes:[I2.$type]},AbnfOptionalGroup:{name:vve.$type,properties:{element:{name:vve.element}},superTypes:[I2.$type]},AbnfPrimary:{name:I2.$type,properties:{},superTypes:[]},AbnfRule:{name:DH.$type,properties:{definition:{name:DH.definition},name:{name:DH.name}},superTypes:[]},AbnfRuleName:{name:bve.$type,properties:{name:{name:bve.name}},superTypes:[I2.$type]},AbnfStringLiteral:{name:xve.$type,properties:{value:{name:xve.value}},superTypes:[I2.$type]},Accelerator:{name:KM.$type,properties:{name:{name:KM.name},x:{name:KM.x},y:{name:KM.y}},superTypes:[]},Alignment:{name:PH.$type,properties:{direction:{name:PH.direction},members:{name:PH.members,defaultValue:[]}},superTypes:[]},Anchor:{name:ZM.$type,properties:{evolution:{name:ZM.evolution},name:{name:ZM.name},visibility:{name:ZM.visibility}},superTypes:[]},Annotation:{name:dk.$type,properties:{number:{name:dk.number},text:{name:dk.text},x:{name:dk.x},y:{name:dk.y}},superTypes:[]},Annotations:{name:$H.$type,properties:{x:{name:$H.x},y:{name:$H.y}},superTypes:[]},Architecture:{name:hd.$type,properties:{accDescr:{name:hd.accDescr},accTitle:{name:hd.accTitle},alignments:{name:hd.alignments,defaultValue:[]},edges:{name:hd.edges,defaultValue:[]},groups:{name:hd.groups,defaultValue:[]},junctions:{name:hd.junctions,defaultValue:[]},services:{name:hd.services,defaultValue:[]},title:{name:hd.title}},superTypes:[]},Axis:{name:QM.$type,properties:{label:{name:QM.label},name:{name:QM.name}},superTypes:[]},Branch:{name:G9.$type,properties:{name:{name:G9.name},order:{name:G9.order}},superTypes:[P2.$type]},Checkout:{name:wve.$type,properties:{branch:{name:wve.branch}},superTypes:[P2.$type]},CherryPicking:{name:JM.$type,properties:{id:{name:JM.id},parent:{name:JM.parent},tags:{name:JM.tags,defaultValue:[]}},superTypes:[P2.$type]},ClassDefStatement:{name:BH.$type,properties:{className:{name:BH.className},styleText:{name:BH.styleText}},superTypes:[]},Commit:{name:ub.$type,properties:{id:{name:ub.id},message:{name:ub.message},tags:{name:ub.tags,defaultValue:[]},type:{name:ub.type}},superTypes:[P2.$type]},Common:{name:eR.$type,properties:{accDescr:{name:eR.accDescr},accTitle:{name:eR.accTitle},title:{name:eR.title}},superTypes:[]},Component:{name:o1.$type,properties:{decorator:{name:o1.decorator},evolution:{name:o1.evolution},inertia:{name:o1.inertia,defaultValue:!1},label:{name:o1.label},name:{name:o1.name},visibility:{name:o1.visibility}},superTypes:[]},Curve:{name:tR.$type,properties:{entries:{name:tR.entries,defaultValue:[]},label:{name:tR.label},name:{name:tR.name}},superTypes:[]},Cynefin:{name:R1.$type,properties:{accDescr:{name:R1.accDescr},accTitle:{name:R1.accTitle},domains:{name:R1.domains,defaultValue:[]},title:{name:R1.title},transitions:{name:R1.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:rR.$type,properties:{name:{name:rR.name},x:{name:rR.x},y:{name:rR.y}},superTypes:[]},Decorator:{name:Tve.$type,properties:{strategy:{name:Tve.strategy}},superTypes:[]},Direction:{name:N2.$type,properties:{accDescr:{name:N2.accDescr},accTitle:{name:N2.accTitle},dir:{name:N2.dir},statements:{name:N2.statements,defaultValue:[]},title:{name:N2.title}},superTypes:[_1.$type]},DomainBlock:{name:W9.$type,properties:{domain:{name:W9.domain},items:{name:W9.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:nK.$type,properties:{label:{name:nK.label}},superTypes:[]},EbnfChoice:{name:Cve.$type,properties:{alternatives:{name:Cve.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:kve.$type,properties:{except:{name:kve.except}},superTypes:[fk.$type]},EbnfGroup:{name:Sve.$type,properties:{element:{name:Sve.element}},superTypes:[l1.$type]},EbnfNonTerminal:{name:Eve.$type,properties:{name:{name:Eve.name}},superTypes:[l1.$type]},EbnfOneOrMorePostfix:{name:Ave.$type,properties:{operator:{name:Ave.operator}},superTypes:[fk.$type]},EbnfOptional:{name:Mve.$type,properties:{element:{name:Mve.element}},superTypes:[l1.$type]},EbnfOptionalPostfix:{name:Rve.$type,properties:{operator:{name:Rve.operator}},superTypes:[fk.$type]},EbnfPostfix:{name:fk.$type,properties:{},superTypes:[]},EbnfPrimary:{name:l1.$type,properties:{},superTypes:[]},EbnfRepetition:{name:_ve.$type,properties:{element:{name:_ve.element}},superTypes:[l1.$type]},EbnfRule:{name:FH.$type,properties:{definition:{name:FH.definition},name:{name:FH.name}},superTypes:[]},EbnfSequence:{name:Lve.$type,properties:{elements:{name:Lve.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Ive.$type,properties:{text:{name:Ive.text}},superTypes:[l1.$type]},EbnfTerm:{name:zH.$type,properties:{base:{name:zH.base},postfixes:{name:zH.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Nve.$type,properties:{value:{name:Nve.value}},superTypes:[l1.$type]},EbnfZeroOrMorePostfix:{name:Ove.$type,properties:{operator:{name:Ove.operator}},superTypes:[fk.$type]},Edge:{name:id.$type,properties:{lhsDir:{name:id.lhsDir},lhsGroup:{name:id.lhsGroup,defaultValue:!1},lhsId:{name:id.lhsId},lhsInto:{name:id.lhsInto,defaultValue:!1},rhsDir:{name:id.rhsDir},rhsGroup:{name:id.rhsGroup,defaultValue:!1},rhsId:{name:id.rhsId},rhsInto:{name:id.rhsInto,defaultValue:!1},title:{name:id.title}},superTypes:[]},EmDataEntity:{name:O2.$type,properties:{dataBlockValue:{name:O2.dataBlockValue},dataType:{name:O2.dataType},name:{name:O2.name}},superTypes:[]},EmFrame:{name:c1.$type,properties:{},superTypes:[]},EmGwt:{name:pk.$type,properties:{givenStatements:{name:pk.givenStatements,defaultValue:[]},sourceFrame:{name:pk.sourceFrame,referenceType:c1.$type},thenStatements:{name:pk.thenStatements,defaultValue:[]},whenStatements:{name:pk.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:Dve.$type,properties:{entityIdentifier:{name:Dve.entityIdentifier,referenceType:VH.$type}},superTypes:[]},EmModelEntity:{name:VH.$type,properties:{name:{name:VH.name}},superTypes:[]},EmNoteEntity:{name:nR.$type,properties:{dataBlockValue:{name:nR.dataBlockValue},dataType:{name:nR.dataType},sourceFrame:{name:nR.sourceFrame,referenceType:c1.$type}},superTypes:[]},EmResetFrame:{name:Hf.$type,properties:{dataInlineValue:{name:Hf.dataInlineValue},dataReference:{name:Hf.dataReference,referenceType:O2.$type},dataType:{name:Hf.dataType},entityIdentifier:{name:Hf.entityIdentifier},modelEntityType:{name:Hf.modelEntityType},name:{name:Hf.name},sourceFrames:{name:Hf.sourceFrames,defaultValue:[],referenceType:c1.$type}},superTypes:[c1.$type]},EmTimeFrame:{name:Fp.$type,properties:{dataInlineValue:{name:Fp.dataInlineValue},dataReference:{name:Fp.dataReference,referenceType:O2.$type},dataType:{name:Fp.dataType},entityIdentifier:{name:Fp.entityIdentifier},modelEntityType:{name:Fp.modelEntityType},name:{name:Fp.name},sourceFrames:{name:Fp.sourceFrames,defaultValue:[],referenceType:c1.$type}},superTypes:[c1.$type]},Entry:{name:HH.$type,properties:{axis:{name:HH.axis,referenceType:QM.$type},value:{name:HH.value}},superTypes:[]},EventModel:{name:Nf.$type,properties:{accDescr:{name:Nf.accDescr},accTitle:{name:Nf.accTitle},dataEntities:{name:Nf.dataEntities,defaultValue:[]},frames:{name:Nf.frames,defaultValue:[]},gwtEntities:{name:Nf.gwtEntities,defaultValue:[]},modelEntities:{name:Nf.modelEntities,defaultValue:[]},noteEntities:{name:Nf.noteEntities,defaultValue:[]},title:{name:Nf.title}},superTypes:[]},Evolution:{name:Pve.$type,properties:{stages:{name:Pve.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:iR.$type,properties:{boundary:{name:iR.boundary},name:{name:iR.name},secondName:{name:iR.secondName}},superTypes:[]},Evolve:{name:GH.$type,properties:{component:{name:GH.component},target:{name:GH.target}},superTypes:[]},GitGraph:{name:_1.$type,properties:{accDescr:{name:_1.accDescr},accTitle:{name:_1.accTitle},statements:{name:_1.statements,defaultValue:[]},title:{name:_1.title}},superTypes:[]},Group:{name:gk.$type,properties:{icon:{name:gk.icon},id:{name:gk.id},in:{name:gk.in},title:{name:gk.title}},superTypes:[]},Info:{name:fS.$type,properties:{accDescr:{name:fS.accDescr},accTitle:{name:fS.accTitle},title:{name:fS.title}},superTypes:[]},Item:{name:mk.$type,properties:{classSelector:{name:mk.classSelector},name:{name:mk.name}},superTypes:[]},Junction:{name:WH.$type,properties:{id:{name:WH.id},in:{name:WH.in}},superTypes:[]},Label:{name:yk.$type,properties:{negX:{name:yk.negX,defaultValue:!1},negY:{name:yk.negY,defaultValue:!1},offsetX:{name:yk.offsetX},offsetY:{name:yk.offsetY}},superTypes:[]},Leaf:{name:sR.$type,properties:{classSelector:{name:sR.classSelector},name:{name:sR.name},value:{name:sR.value}},superTypes:[mk.$type]},Link:{name:u1.$type,properties:{arrow:{name:u1.arrow},from:{name:u1.from},fromPort:{name:u1.fromPort},linkLabel:{name:u1.linkLabel},to:{name:u1.to},toPort:{name:u1.toPort}},superTypes:[]},Merge:{name:hb.$type,properties:{branch:{name:hb.branch},id:{name:hb.id},tags:{name:hb.tags,defaultValue:[]},type:{name:hb.type}},superTypes:[P2.$type]},Note:{name:aR.$type,properties:{evolution:{name:aR.evolution},text:{name:aR.text},visibility:{name:aR.visibility}},superTypes:[]},Option:{name:qH.$type,properties:{name:{name:qH.name},value:{name:qH.value,defaultValue:!1}},superTypes:[]},Packet:{name:db.$type,properties:{accDescr:{name:db.accDescr},accTitle:{name:db.accTitle},blocks:{name:db.blocks,defaultValue:[]},title:{name:db.title}},superTypes:[]},PacketBlock:{name:fb.$type,properties:{bits:{name:fb.bits},end:{name:fb.end},label:{name:fb.label},start:{name:fb.start}},superTypes:[]},PegAny:{name:$ve.$type,properties:{dot:{name:$ve.dot}},superTypes:[vk.$type]},PegGroup:{name:Bve.$type,properties:{element:{name:Bve.element}},superTypes:[vk.$type]},PegIdentifier:{name:Fve.$type,properties:{name:{name:Fve.name}},superTypes:[vk.$type]},PegLiteral:{name:zve.$type,properties:{value:{name:zve.value}},superTypes:[vk.$type]},PegOrderedChoice:{name:Vve.$type,properties:{alternatives:{name:Vve.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:UH.$type,properties:{operator:{name:UH.operator},suffix:{name:UH.suffix}},superTypes:[]},PegPrimary:{name:vk.$type,properties:{},superTypes:[]},PegRule:{name:jH.$type,properties:{definition:{name:jH.definition},name:{name:jH.name}},superTypes:[]},PegSequence:{name:Hve.$type,properties:{elements:{name:Hve.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:YH.$type,properties:{operator:{name:YH.operator},primary:{name:YH.primary}},superTypes:[]},Pie:{name:L1.$type,properties:{accDescr:{name:L1.accDescr},accTitle:{name:L1.accTitle},sections:{name:L1.sections,defaultValue:[]},showData:{name:L1.showData,defaultValue:!1},title:{name:L1.title}},superTypes:[]},PieSection:{name:q9.$type,properties:{label:{name:q9.label},value:{name:q9.value}},superTypes:[]},Pipeline:{name:XH.$type,properties:{components:{name:XH.components,defaultValue:[]},parent:{name:XH.parent}},superTypes:[]},PipelineComponent:{name:oR.$type,properties:{evolution:{name:oR.evolution},label:{name:oR.label},name:{name:oR.name}},superTypes:[]},Radar:{name:h1.$type,properties:{accDescr:{name:h1.accDescr},accTitle:{name:h1.accTitle},axes:{name:h1.axes,defaultValue:[]},curves:{name:h1.curves,defaultValue:[]},options:{name:h1.options,defaultValue:[]},title:{name:h1.title}},superTypes:[]},Railroad:{name:pb.$type,properties:{accDescr:{name:pb.accDescr},accTitle:{name:pb.accTitle},rules:{name:pb.rules,defaultValue:[]},title:{name:pb.title}},superTypes:[]},RailroadAbnf:{name:gb.$type,properties:{accDescr:{name:gb.accDescr},accTitle:{name:gb.accTitle},rules:{name:gb.rules,defaultValue:[]},title:{name:gb.title}},superTypes:[]},RailroadChoiceExpr:{name:Gve.$type,properties:{alternatives:{name:Gve.alternatives,defaultValue:[]}},superTypes:[Of.$type]},RailroadEbnf:{name:mb.$type,properties:{accDescr:{name:mb.accDescr},accTitle:{name:mb.accTitle},rules:{name:mb.rules,defaultValue:[]},title:{name:mb.title}},superTypes:[]},RailroadExpression:{name:Of.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Wve.$type,properties:{name:{name:Wve.name}},superTypes:[Of.$type]},RailroadOneOrMoreExpr:{name:qve.$type,properties:{element:{name:qve.element}},superTypes:[Of.$type]},RailroadOptionalExpr:{name:Uve.$type,properties:{element:{name:Uve.element}},superTypes:[Of.$type]},RailroadPeg:{name:yb.$type,properties:{accDescr:{name:yb.accDescr},accTitle:{name:yb.accTitle},rules:{name:yb.rules,defaultValue:[]},title:{name:yb.title}},superTypes:[]},RailroadRule:{name:KH.$type,properties:{definition:{name:KH.definition},name:{name:KH.name}},superTypes:[]},RailroadSequenceExpr:{name:jve.$type,properties:{elements:{name:jve.elements,defaultValue:[]}},superTypes:[Of.$type]},RailroadSpecialExpr:{name:Yve.$type,properties:{text:{name:Yve.text}},superTypes:[Of.$type]},RailroadTerminalExpr:{name:Xve.$type,properties:{value:{name:Xve.value}},superTypes:[Of.$type]},RailroadZeroOrMoreExpr:{name:Kve.$type,properties:{element:{name:Kve.element}},superTypes:[Of.$type]},Section:{name:ZH.$type,properties:{classSelector:{name:ZH.classSelector},name:{name:ZH.name}},superTypes:[mk.$type]},Service:{name:D2.$type,properties:{icon:{name:D2.icon},iconText:{name:D2.iconText},id:{name:D2.id},in:{name:D2.in},title:{name:D2.title}},superTypes:[]},Size:{name:QH.$type,properties:{height:{name:QH.height},width:{name:QH.width}},superTypes:[]},Statement:{name:P2.$type,properties:{},superTypes:[]},Transition:{name:pS.$type,properties:{from:{name:pS.from},label:{name:pS.label},to:{name:pS.to}},superTypes:[]},TreeNode:{name:$2.$type,properties:{classAnnotation:{name:$2.classAnnotation},descAnnotation:{name:$2.descAnnotation},iconAnnotation:{name:$2.iconAnnotation},indent:{name:$2.indent},name:{name:$2.name}},superTypes:[]},TreeView:{name:bk.$type,properties:{accDescr:{name:bk.accDescr},accTitle:{name:bk.accTitle},nodes:{name:bk.nodes,defaultValue:[]},title:{name:bk.title}},superTypes:[]},Treemap:{name:vb.$type,properties:{accDescr:{name:vb.accDescr},accTitle:{name:vb.accTitle},title:{name:vb.title},TreemapRows:{name:vb.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:JH.$type,properties:{indent:{name:JH.indent},item:{name:JH.item}},superTypes:[]},Wardley:{name:xo.$type,properties:{accDescr:{name:xo.accDescr},accelerators:{name:xo.accelerators,defaultValue:[]},accTitle:{name:xo.accTitle},anchors:{name:xo.anchors,defaultValue:[]},annotation:{name:xo.annotation,defaultValue:[]},annotations:{name:xo.annotations,defaultValue:[]},components:{name:xo.components,defaultValue:[]},deaccelerators:{name:xo.deaccelerators,defaultValue:[]},evolution:{name:xo.evolution},evolves:{name:xo.evolves,defaultValue:[]},links:{name:xo.links,defaultValue:[]},notes:{name:xo.notes,defaultValue:[]},pipelines:{name:xo.pipelines,defaultValue:[]},size:{name:xo.size},title:{name:xo.title}},superTypes:[]}}}},_(lT,"MermaidAstReflection"),lT),ra=new BUe,Zve,Epr=_(()=>Zve??(Zve=fo(`{"$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":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Qve,Apr=_(()=>Qve??(Qve=fo(`{"$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"),Jve,Mpr=_(()=>Jve??(Jve=fo('{"$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"),e2e,Rpr=_(()=>e2e??(e2e=fo(`{"$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"),t2e,_pr=_(()=>t2e??(t2e=fo(`{"$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"),r2e,Lpr=_(()=>r2e??(r2e=fo(`{"$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"),n2e,Ipr=_(()=>n2e??(n2e=fo(`{"$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"),i2e,Npr=_(()=>i2e??(i2e=fo(`{"$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"),s2e,Opr=_(()=>s2e??(s2e=fo('{"$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"),a2e,Dpr=_(()=>a2e??(a2e=fo(`{"$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"),o2e,Ppr=_(()=>o2e??(o2e=fo(`{"$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"),l2e,$pr=_(()=>l2e??(l2e=fo(`{"$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"),c2e,Bpr=_(()=>c2e??(c2e=fo(`{"$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"),u2e,Fpr=_(()=>u2e??(u2e=fo(`{"$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"),h2e,zpr=_(()=>h2e??(h2e=fo(`{"$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"),Vpr={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hpr={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Gpr={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wpr={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},qpr={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Upr={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},jpr={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ypr={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Xpr={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kpr={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Zpr={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Qpr={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Jpr={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},egr={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tgr={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rc={AstReflection:_(()=>new BUe,"AstReflection")},rgr={Grammar:_(()=>Epr(),"Grammar"),LanguageMetaData:_(()=>Vpr,"LanguageMetaData"),parser:{}},ngr={Grammar:_(()=>Apr(),"Grammar"),LanguageMetaData:_(()=>Hpr,"LanguageMetaData"),parser:{}},igr={Grammar:_(()=>Mpr(),"Grammar"),LanguageMetaData:_(()=>Gpr,"LanguageMetaData"),parser:{}},sgr={Grammar:_(()=>Rpr(),"Grammar"),LanguageMetaData:_(()=>Wpr,"LanguageMetaData"),parser:{}},agr={Grammar:_(()=>_pr(),"Grammar"),LanguageMetaData:_(()=>qpr,"LanguageMetaData"),parser:{}},ogr={Grammar:_(()=>Lpr(),"Grammar"),LanguageMetaData:_(()=>Upr,"LanguageMetaData"),parser:{}},lgr={Grammar:_(()=>Ipr(),"Grammar"),LanguageMetaData:_(()=>jpr,"LanguageMetaData"),parser:{}},cgr={Grammar:_(()=>Npr(),"Grammar"),LanguageMetaData:_(()=>Ypr,"LanguageMetaData"),parser:{}},ugr={Grammar:_(()=>Opr(),"Grammar"),LanguageMetaData:_(()=>Xpr,"LanguageMetaData"),parser:{}},hgr={Grammar:_(()=>Dpr(),"Grammar"),LanguageMetaData:_(()=>Kpr,"LanguageMetaData"),parser:{}},dgr={Grammar:_(()=>Ppr(),"Grammar"),LanguageMetaData:_(()=>Zpr,"LanguageMetaData"),parser:{}},fgr={Grammar:_(()=>$pr(),"Grammar"),LanguageMetaData:_(()=>Qpr,"LanguageMetaData"),parser:{}},pgr={Grammar:_(()=>Bpr(),"Grammar"),LanguageMetaData:_(()=>Jpr,"LanguageMetaData"),parser:{}},ggr={Grammar:_(()=>Fpr(),"Grammar"),LanguageMetaData:_(()=>egr,"LanguageMetaData"),parser:{}},mgr={Grammar:_(()=>zpr(),"Grammar"),LanguageMetaData:_(()=>tgr,"LanguageMetaData"),parser:{}},ygr=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,vgr=/accTitle[\t ]*:([^\n\r]*)/,bgr=/title([\t ][^\n\r]*|)/,xgr={ACC_DESCR:ygr,ACC_TITLE:vgr,TITLE:bgr},cT,wf=(cT=class extends Xie{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=xgr[e.name];if(i===void 0)return;const s=i.exec(r);if(s!==null){if(s[1]!==void 0)return s[1].trim().replace(/[\t ]{2,}/gm," ");if(s[2]!==void 0)return s[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` -`)}}},_(cT,"AbstractMermaidValueConverter"),cT),uT,SC=(uT=class extends wf{runCustomConverter(e,r,n){}},_(uT,"CommonValueConverter"),uT),hT,nc=(hT=class extends U${constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},_(hT,"AbstractMermaidTokenBuilder"),hT),dT;dT=class extends nc{},_(dT,"CommonTokenBuilder");/*! Bundled license information: +`}M(WX,"fillNewlines");var e8,Fqe=(e8=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Uae(r))return mae(r).toMarkdown({renderLink:M((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:M(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=Oh(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)}},M(e8,"JSDocDocumentationProvider"),e8),t8,zqe=(t8=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return hae(e)?e.$comment:(r=bne(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},M(t8,"DefaultCommentProvider"),t8),r8,Vqe=(r8=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},M(r8,"DefaultAsyncParser"),r8),n8,wpr=(n8=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 X0;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 X0;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Od)}),this.queue.push(r),r.promise}},M(n8,"AbstractThreadedAsyncParser"),n8),i8,Tpr=(i8=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new eB.Emitter,this.deferred=new X0,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(Od),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 X0,this.sendMessage(e),this.deferred.promise}},M(i8,"ParserWorker"),i8),a8,Hqe=(a8=class{constructor(){this.previousTokenSource=new Vi.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=ZP();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Vi.CancellationToken.None){const i=new X0,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){i2(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},M(a8,"DefaultWorkspaceLock"),a8),s8,Gqe=(s8=class{constructor(e){this.grammarElementIdMap=new KN,this.tokenTypeIdMap=new KN,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 _h(e))r.set(i,{});if(e.$cstNode)for(const i of x4(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)ls(o)?s.push(this.dehydrateAstNode(o,r)):_l(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else ls(a)?n[i]=this.dehydrateAstNode(a,r):_l(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 Z_(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),z0(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):$5(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 _h(e))r.set(a,{});let i;if(e.$cstNode)for(const a of x4(e.$cstNode)){let s;"fullText"in a?(s=new Xie(a.fullText),i=s):"content"in a?s=new qP:"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)ls(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):_l(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else ls(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):_l(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),z0(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 WN(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 _h(this.grammar))J_(r)&&this.grammarElementIdMap.set(r,e++)}},M(s8,"DefaultHydrator"),s8);function uo(t){return{documentation:{CommentProvider:M(e=>new zqe(e),"CommentProvider"),DocumentationProvider:M(e=>new Fqe(e),"DocumentationProvider")},parser:{AsyncParser:M(e=>new Vqe(e),"AsyncParser"),GrammarConfig:M(e=>Hne(e),"GrammarConfig"),LangiumParser:M(e=>tae(e),"LangiumParser"),CompletionParser:M(e=>eae(e),"CompletionParser"),ValueConverter:M(()=>new nae,"ValueConverter"),TokenBuilder:M(()=>new XP,"TokenBuilder"),Lexer:M(e=>new gae(e),"Lexer"),ParserErrorMessageProvider:M(()=>new Zie,"ParserErrorMessageProvider"),LexerErrorMessageProvider:M(()=>new Mqe,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:M(()=>new Cqe,"AstNodeLocator"),AstNodeDescriptionProvider:M(e=>new wqe(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:M(e=>new Tqe(e),"ReferenceDescriptionProvider")},references:{Linker:M(e=>new uqe(e),"Linker"),NameProvider:M(()=>new hqe,"NameProvider"),ScopeProvider:M(e=>new mqe(e),"ScopeProvider"),ScopeComputation:M(e=>new fqe(e),"ScopeComputation"),References:M(e=>new dqe(e),"References")},serializer:{Hydrator:M(e=>new Gqe(e),"Hydrator"),JsonSerializer:M(e=>new Uqe(e),"JsonSerializer")},validation:{DocumentValidator:M(e=>new xqe(e),"DocumentValidator"),ValidationRegistry:M(e=>new bqe(e),"ValidationRegistry")},shared:M(()=>t.shared,"shared")}}M(uo,"createDefaultCoreModule");function ho(t){return{ServiceRegistry:M(e=>new yqe(e),"ServiceRegistry"),workspace:{LangiumDocuments:M(e=>new cqe(e),"LangiumDocuments"),LangiumDocumentFactory:M(e=>new lqe(e),"LangiumDocumentFactory"),DocumentBuilder:M(e=>new Sqe(e),"DocumentBuilder"),IndexManager:M(e=>new Eqe(e),"IndexManager"),WorkspaceManager:M(e=>new Aqe(e),"WorkspaceManager"),FileSystemProvider:M(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:M(()=>new Hqe,"WorkspaceLock"),ConfigurationProvider:M(e=>new kqe(e),"ConfigurationProvider")},profilers:{}}}M(ho,"createDefaultSharedCoreModule");var qX;(function(t){t.merge=(e,r)=>S4(S4({},e),r)})(qX||(qX={}));function Yn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(S4,{});return Tae(u)}M(Yn,"inject");var Wqe=Symbol("isProxy");function wae(t){if(t&&t[Wqe])for(const e of Object.values(t))wae(e);return t}M(wae,"eagerLoad");function Tae(t,e){const r=new Proxy({},{deleteProperty:M(()=>!1,"deleteProperty"),set:M(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:M((n,i)=>i===Wqe?!0:jX(n,i,t,e||r),"get"),getOwnPropertyDescriptor:M((n,i)=>(jX(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:M((n,i)=>i in t,"has"),ownKeys:M(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}M(Tae,"_inject");var T5e=Symbol();function jX(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]===T5e)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]=T5e;try{t[e]=typeof i=="function"?i(n):Tae(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}M(jX,"_resolve");function S4(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]=S4(i,n):t[r]=S4({},n)}else t[r]=n}return t}M(S4,"_merge");var YX={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},vU;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(vU||(vU={}));var o8,qqe=(o8=class extends XP{constructor(e=YX){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...YX,...e},this.indentTokenType=k6({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=k6({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!tB(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=vU.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:{[vU.REGULAR]:[l,u,...d,h],[vU.IGNORE_INDENTATION]:[...d,h]},defaultMode:vU.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 Kk(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}},M(o8,"IndentationAwareTokenBuilder"),o8),l8,Cpr=(l8=class extends gae{constructor(e){if(super(e),e.parser.TokenBuilder instanceof qqe)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=pae){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}},M(l8,"IndentationAwareLexer"),l8),Cae={};P1(Cae,{AstUtils:()=>jre,BiMap:()=>KN,Cancellation:()=>Vi,ContextCache:()=>QP,CstUtils:()=>Gre,DONE_RESULT:()=>kl,Deferred:()=>X0,Disposable:()=>DU,DisposableCache:()=>JP,DocumentCache:()=>gqe,EMPTY_STREAM:()=>m4,ErrorWithLocation:()=>aP,GrammarUtils:()=>Tne,MultiMap:()=>K0,OperationCancelled:()=>Od,Reduction:()=>rC,RegExpUtils:()=>kne,SimpleCache:()=>cae,StreamImpl:()=>Dd,TreeStreamImpl:()=>U4,URI:()=>Qc,UriTrie:()=>oae,UriUtils:()=>Pl,WorkspaceCache:()=>uae,assertCondition:()=>Cne,assertUnreachable:()=>B1,delayNextTick:()=>KP,interruptAndCheck:()=>Xs,isOperationCancelled:()=>i2,loadGrammarFromJson:()=>fo,setInterruptionPeriod:()=>iae,startCancelableOperation:()=>ZP,stream:()=>Ti});Y_(Cae,eB);var c8,jqe=(c8=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[]}},M(c8,"EmptyFileSystemProvider"),c8),$o={fileSystemProvider:M(()=>new jqe,"fileSystemProvider")},kpr={Grammar:M(()=>{},"Grammar"),LanguageMetaData:M(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},Spr={AstReflection:M(()=>new pne,"AstReflection")};function Yqe(){const t=Yn(ho($o),Spr),e=Yn(uo({shared:t}),kpr);return t.ServiceRegistry.register(e),e}M(Yqe,"createMinimalGrammarServices");function fo(t){const e=Yqe(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Qc.parse(`memory:/${r.name??"grammar"}.langium`)),r}M(fo,"loadGrammarFromJson");Y_(a_e,Cae);var u8,Epr=(u8=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new K0}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 Xqe(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 M(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])}},M(u8,"DefaultLangiumProfiler"),u8),h8,Xqe=(h8=class{constructor(e,r){this.stack=[],this.entries=new K0,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)}},M(h8,"ProfilingTask"),h8),XX;(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:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(XX||(XX={}));var KX;(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]*/}})(KX||(KX={}));var ZX;(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]*/}})(ZX||(ZX={}));var JX;(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])?/}})(JX||(JX={}));var QX;(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]*/}})(QX||(QX={}));var eK;(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]*/}})(eK||(eK={}));var tK;(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]*/}})(tK||(tK={}));var rK;(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]*/}})(rK||(rK={}));var nK;(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]*/}})(nK||(nK={}));var iK;(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]*?\*\)/}})(iK||(iK={}));var aK;(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]*?\*\//}})(aK||(aK={}));var sK;(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]*/}})(sK||(sK={}));var oK;(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:/"[^"]*"|'[^']*'/}})(oK||(oK={}));var lK;(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])*/}})(lK||(lK={}));var cK;(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]*/}})(cK||(cK={}));({...XX.Terminals,...KX.Terminals,...ZX.Terminals,...JX.Terminals,...QX.Terminals,...eK.Terminals,...tK.Terminals,...rK.Terminals,...nK.Terminals,...iK.Terminals,...aK.Terminals,...sK.Terminals,...lK.Terminals,...oK.Terminals,...cK.Terminals});var C5e={$type:"AbnfAlternation",alternatives:"alternatives"},k5e={$type:"AbnfConcatenation",elements:"elements"},$V={$type:"AbnfElement",primary:"primary",repeat:"repeat"},S5e={$type:"AbnfGroup",element:"element"},E5e={$type:"AbnfNumVal",value:"value"},A5e={$type:"AbnfOptionalGroup",element:"element"},O2={$type:"AbnfPrimary"},FV={$type:"AbnfRule",definition:"definition",name:"name"},M5e={$type:"AbnfRuleName",name:"name"},R5e={$type:"AbnfStringLiteral",value:"value"},QE={$type:"Accelerator",name:"name",x:"x",y:"y"},zV={$type:"Alignment",direction:"direction",members:"members"},eA={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},g3={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},VV={$type:"Annotations",x:"x",y:"y"},dd={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function Apr(t){return ts.isInstance(t,dd.$type)}M(Apr,"isArchitecture");var tA={$type:"Axis",label:"label",name:"name"},qM={$type:"Branch",name:"name",order:"order"};function Mpr(t){return ts.isInstance(t,qM.$type)}M(Mpr,"isBranch");var L5e={$type:"Checkout",branch:"branch"},rA={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},HV={$type:"ClassDefStatement",className:"className",styleText:"styleText"},fy={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function Rpr(t){return ts.isInstance(t,fy.$type)}M(Rpr,"isCommit");var nA={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},um={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},iA={$type:"Curve",entries:"entries",label:"label",name:"name"},Im={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function Lpr(t){return ts.isInstance(t,Im.$type)}M(Lpr,"isCynefin");var aA={$type:"Deaccelerator",name:"name",x:"x",y:"y"},I5e={$type:"Decorator",strategy:"strategy"},_2={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},jM={$type:"DomainBlock",domain:"domain",items:"items"};function Ipr(t){return ts.isInstance(t,jM.$type)}M(Ipr,"isDomainBlock");var uK={$type:"DomainItem",label:"label"};function Npr(t){return ts.isInstance(t,uK.$type)}M(Npr,"isDomainItem");var N5e={$type:"EbnfChoice",alternatives:"alternatives"},D5e={$type:"EbnfExceptionPostfix",except:"except"},O5e={$type:"EbnfGroup",element:"element"},_5e={$type:"EbnfNonTerminal",name:"name"},P5e={$type:"EbnfOneOrMorePostfix",operator:"operator"},B5e={$type:"EbnfOptional",element:"element"},$5e={$type:"EbnfOptionalPostfix",operator:"operator"},m3={$type:"EbnfPostfix"},hm={$type:"EbnfPrimary"},F5e={$type:"EbnfRepetition",element:"element"},GV={$type:"EbnfRule",definition:"definition",name:"name"},z5e={$type:"EbnfSequence",elements:"elements"},V5e={$type:"EbnfSpecial",text:"text"},WV={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},H5e={$type:"EbnfTerminal",value:"value"},G5e={$type:"EbnfZeroOrMorePostfix",operator:"operator"},ad={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},P2={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},dm={$type:"EmFrame"},U3={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},W5e={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},qV={$type:"EmModelEntity",name:"name"};function Dpr(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}M(Dpr,"isEmModelEntityType");var sA={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},Hf={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function Kqe(t){return ts.isInstance(t,Hf.$type)}M(Kqe,"isEmResetFrame");var Fp={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},jV={$type:"Entry",axis:"axis",value:"value"},Df={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},q5e={$type:"Evolution",stages:"stages"},oA={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},YV={$type:"Evolve",component:"component",target:"target"},Nm={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function Opr(t){return ts.isInstance(t,Nm.$type)}M(Opr,"isGitGraph");var y3={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Ux={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function _pr(t){return ts.isInstance(t,Ux.$type)}M(_pr,"isInfo");var b3={$type:"Item",classSelector:"classSelector",name:"name"},XV={$type:"Junction",id:"id",in:"in"},v3={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},lA={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},fm={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},py={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function Ppr(t){return ts.isInstance(t,py.$type)}M(Ppr,"isMerge");var cA={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},KV={$type:"Option",name:"name",value:"value"},gy={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function Bpr(t){return ts.isInstance(t,gy.$type)}M(Bpr,"isPacket");var my={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function $pr(t){return ts.isInstance(t,my.$type)}M($pr,"isPacketBlock");var j5e={$type:"PegAny",dot:"dot"},Y5e={$type:"PegGroup",element:"element"},X5e={$type:"PegIdentifier",name:"name"},K5e={$type:"PegLiteral",value:"value"},Z5e={$type:"PegOrderedChoice",alternatives:"alternatives"},ZV={$type:"PegPrefix",operator:"operator",suffix:"suffix"},x3={$type:"PegPrimary"},JV={$type:"PegRule",definition:"definition",name:"name"},J5e={$type:"PegSequence",elements:"elements"},QV={$type:"PegSuffix",operator:"operator",primary:"primary"},Dm={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Fpr(t){return ts.isInstance(t,Dm.$type)}M(Fpr,"isPie");var YM={$type:"PieSection",label:"label",value:"value"};function zpr(t){return ts.isInstance(t,YM.$type)}M(zpr,"isPieSection");var eH={$type:"Pipeline",components:"components",parent:"parent"},uA={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},pm={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Uy={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Vpr(t){return ts.isInstance(t,Uy.$type)}M(Vpr,"isRailroad");var yy={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Hpr(t){return ts.isInstance(t,yy.$type)}M(Hpr,"isRailroadAbnf");var Q5e={$type:"RailroadChoiceExpr",alternatives:"alternatives"},by={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Gpr(t){return ts.isInstance(t,by.$type)}M(Gpr,"isRailroadEbnf");var Of={$type:"RailroadExpression"},e2e={$type:"RailroadNonTerminalExpr",name:"name"},t2e={$type:"RailroadOneOrMoreExpr",element:"element"},r2e={$type:"RailroadOptionalExpr",element:"element"},vy={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function Wpr(t){return ts.isInstance(t,vy.$type)}M(Wpr,"isRailroadPeg");var tH={$type:"RailroadRule",definition:"definition",name:"name"},n2e={$type:"RailroadSequenceExpr",elements:"elements"},i2e={$type:"RailroadSpecialExpr",text:"text"},a2e={$type:"RailroadTerminalExpr",value:"value"},s2e={$type:"RailroadZeroOrMoreExpr",element:"element"},rH={$type:"Section",classSelector:"classSelector",name:"name"},B2={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},nH={$type:"Size",height:"height",width:"width"},$2={$type:"Statement"},yx={$type:"Transition",from:"from",label:"label",to:"to"};function qpr(t){return ts.isInstance(t,yx.$type)}M(qpr,"isTransition");var xy={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function jpr(t){return ts.isInstance(t,xy.$type)}M(jpr,"isTreemap");var iH={$type:"TreemapRow",indent:"indent",item:"item"},F2={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},w3={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},vo={$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 Ypr(t){return ts.isInstance(t,vo.$type)}M(Ypr,"isWardley");var d8,Zqe=(d8=class extends qre{constructor(){super(...arguments),this.types={AbnfAlternation:{name:C5e.$type,properties:{alternatives:{name:C5e.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:k5e.$type,properties:{elements:{name:k5e.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:$V.$type,properties:{primary:{name:$V.primary},repeat:{name:$V.repeat}},superTypes:[]},AbnfGroup:{name:S5e.$type,properties:{element:{name:S5e.element}},superTypes:[O2.$type]},AbnfNumVal:{name:E5e.$type,properties:{value:{name:E5e.value}},superTypes:[O2.$type]},AbnfOptionalGroup:{name:A5e.$type,properties:{element:{name:A5e.element}},superTypes:[O2.$type]},AbnfPrimary:{name:O2.$type,properties:{},superTypes:[]},AbnfRule:{name:FV.$type,properties:{definition:{name:FV.definition},name:{name:FV.name}},superTypes:[]},AbnfRuleName:{name:M5e.$type,properties:{name:{name:M5e.name}},superTypes:[O2.$type]},AbnfStringLiteral:{name:R5e.$type,properties:{value:{name:R5e.value}},superTypes:[O2.$type]},Accelerator:{name:QE.$type,properties:{name:{name:QE.name},x:{name:QE.x},y:{name:QE.y}},superTypes:[]},Alignment:{name:zV.$type,properties:{direction:{name:zV.direction},members:{name:zV.members,defaultValue:[]}},superTypes:[]},Anchor:{name:eA.$type,properties:{evolution:{name:eA.evolution},name:{name:eA.name},visibility:{name:eA.visibility}},superTypes:[]},Annotation:{name:g3.$type,properties:{number:{name:g3.number},text:{name:g3.text},x:{name:g3.x},y:{name:g3.y}},superTypes:[]},Annotations:{name:VV.$type,properties:{x:{name:VV.x},y:{name:VV.y}},superTypes:[]},Architecture:{name:dd.$type,properties:{accDescr:{name:dd.accDescr},accTitle:{name:dd.accTitle},alignments:{name:dd.alignments,defaultValue:[]},edges:{name:dd.edges,defaultValue:[]},groups:{name:dd.groups,defaultValue:[]},junctions:{name:dd.junctions,defaultValue:[]},services:{name:dd.services,defaultValue:[]},title:{name:dd.title}},superTypes:[]},Axis:{name:tA.$type,properties:{label:{name:tA.label},name:{name:tA.name}},superTypes:[]},Branch:{name:qM.$type,properties:{name:{name:qM.name},order:{name:qM.order}},superTypes:[$2.$type]},Checkout:{name:L5e.$type,properties:{branch:{name:L5e.branch}},superTypes:[$2.$type]},CherryPicking:{name:rA.$type,properties:{id:{name:rA.id},parent:{name:rA.parent},tags:{name:rA.tags,defaultValue:[]}},superTypes:[$2.$type]},ClassDefStatement:{name:HV.$type,properties:{className:{name:HV.className},styleText:{name:HV.styleText}},superTypes:[]},Commit:{name:fy.$type,properties:{id:{name:fy.id},message:{name:fy.message},tags:{name:fy.tags,defaultValue:[]},type:{name:fy.type}},superTypes:[$2.$type]},Common:{name:nA.$type,properties:{accDescr:{name:nA.accDescr},accTitle:{name:nA.accTitle},title:{name:nA.title}},superTypes:[]},Component:{name:um.$type,properties:{decorator:{name:um.decorator},evolution:{name:um.evolution},inertia:{name:um.inertia,defaultValue:!1},label:{name:um.label},name:{name:um.name},visibility:{name:um.visibility}},superTypes:[]},Curve:{name:iA.$type,properties:{entries:{name:iA.entries,defaultValue:[]},label:{name:iA.label},name:{name:iA.name}},superTypes:[]},Cynefin:{name:Im.$type,properties:{accDescr:{name:Im.accDescr},accTitle:{name:Im.accTitle},domains:{name:Im.domains,defaultValue:[]},title:{name:Im.title},transitions:{name:Im.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:aA.$type,properties:{name:{name:aA.name},x:{name:aA.x},y:{name:aA.y}},superTypes:[]},Decorator:{name:I5e.$type,properties:{strategy:{name:I5e.strategy}},superTypes:[]},Direction:{name:_2.$type,properties:{accDescr:{name:_2.accDescr},accTitle:{name:_2.accTitle},dir:{name:_2.dir},statements:{name:_2.statements,defaultValue:[]},title:{name:_2.title}},superTypes:[Nm.$type]},DomainBlock:{name:jM.$type,properties:{domain:{name:jM.domain},items:{name:jM.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:uK.$type,properties:{label:{name:uK.label}},superTypes:[]},EbnfChoice:{name:N5e.$type,properties:{alternatives:{name:N5e.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:D5e.$type,properties:{except:{name:D5e.except}},superTypes:[m3.$type]},EbnfGroup:{name:O5e.$type,properties:{element:{name:O5e.element}},superTypes:[hm.$type]},EbnfNonTerminal:{name:_5e.$type,properties:{name:{name:_5e.name}},superTypes:[hm.$type]},EbnfOneOrMorePostfix:{name:P5e.$type,properties:{operator:{name:P5e.operator}},superTypes:[m3.$type]},EbnfOptional:{name:B5e.$type,properties:{element:{name:B5e.element}},superTypes:[hm.$type]},EbnfOptionalPostfix:{name:$5e.$type,properties:{operator:{name:$5e.operator}},superTypes:[m3.$type]},EbnfPostfix:{name:m3.$type,properties:{},superTypes:[]},EbnfPrimary:{name:hm.$type,properties:{},superTypes:[]},EbnfRepetition:{name:F5e.$type,properties:{element:{name:F5e.element}},superTypes:[hm.$type]},EbnfRule:{name:GV.$type,properties:{definition:{name:GV.definition},name:{name:GV.name}},superTypes:[]},EbnfSequence:{name:z5e.$type,properties:{elements:{name:z5e.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:V5e.$type,properties:{text:{name:V5e.text}},superTypes:[hm.$type]},EbnfTerm:{name:WV.$type,properties:{base:{name:WV.base},postfixes:{name:WV.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:H5e.$type,properties:{value:{name:H5e.value}},superTypes:[hm.$type]},EbnfZeroOrMorePostfix:{name:G5e.$type,properties:{operator:{name:G5e.operator}},superTypes:[m3.$type]},Edge:{name:ad.$type,properties:{lhsDir:{name:ad.lhsDir},lhsGroup:{name:ad.lhsGroup,defaultValue:!1},lhsId:{name:ad.lhsId},lhsInto:{name:ad.lhsInto,defaultValue:!1},rhsDir:{name:ad.rhsDir},rhsGroup:{name:ad.rhsGroup,defaultValue:!1},rhsId:{name:ad.rhsId},rhsInto:{name:ad.rhsInto,defaultValue:!1},title:{name:ad.title}},superTypes:[]},EmDataEntity:{name:P2.$type,properties:{dataBlockValue:{name:P2.dataBlockValue},dataType:{name:P2.dataType},name:{name:P2.name}},superTypes:[]},EmFrame:{name:dm.$type,properties:{},superTypes:[]},EmGwt:{name:U3.$type,properties:{givenStatements:{name:U3.givenStatements,defaultValue:[]},sourceFrame:{name:U3.sourceFrame,referenceType:dm.$type},thenStatements:{name:U3.thenStatements,defaultValue:[]},whenStatements:{name:U3.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:W5e.$type,properties:{entityIdentifier:{name:W5e.entityIdentifier,referenceType:qV.$type}},superTypes:[]},EmModelEntity:{name:qV.$type,properties:{name:{name:qV.name}},superTypes:[]},EmNoteEntity:{name:sA.$type,properties:{dataBlockValue:{name:sA.dataBlockValue},dataType:{name:sA.dataType},sourceFrame:{name:sA.sourceFrame,referenceType:dm.$type}},superTypes:[]},EmResetFrame:{name:Hf.$type,properties:{dataInlineValue:{name:Hf.dataInlineValue},dataReference:{name:Hf.dataReference,referenceType:P2.$type},dataType:{name:Hf.dataType},entityIdentifier:{name:Hf.entityIdentifier},modelEntityType:{name:Hf.modelEntityType},name:{name:Hf.name},sourceFrames:{name:Hf.sourceFrames,defaultValue:[],referenceType:dm.$type}},superTypes:[dm.$type]},EmTimeFrame:{name:Fp.$type,properties:{dataInlineValue:{name:Fp.dataInlineValue},dataReference:{name:Fp.dataReference,referenceType:P2.$type},dataType:{name:Fp.dataType},entityIdentifier:{name:Fp.entityIdentifier},modelEntityType:{name:Fp.modelEntityType},name:{name:Fp.name},sourceFrames:{name:Fp.sourceFrames,defaultValue:[],referenceType:dm.$type}},superTypes:[dm.$type]},Entry:{name:jV.$type,properties:{axis:{name:jV.axis,referenceType:tA.$type},value:{name:jV.value}},superTypes:[]},EventModel:{name:Df.$type,properties:{accDescr:{name:Df.accDescr},accTitle:{name:Df.accTitle},dataEntities:{name:Df.dataEntities,defaultValue:[]},frames:{name:Df.frames,defaultValue:[]},gwtEntities:{name:Df.gwtEntities,defaultValue:[]},modelEntities:{name:Df.modelEntities,defaultValue:[]},noteEntities:{name:Df.noteEntities,defaultValue:[]},title:{name:Df.title}},superTypes:[]},Evolution:{name:q5e.$type,properties:{stages:{name:q5e.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:oA.$type,properties:{boundary:{name:oA.boundary},name:{name:oA.name},secondName:{name:oA.secondName}},superTypes:[]},Evolve:{name:YV.$type,properties:{component:{name:YV.component},target:{name:YV.target}},superTypes:[]},GitGraph:{name:Nm.$type,properties:{accDescr:{name:Nm.accDescr},accTitle:{name:Nm.accTitle},statements:{name:Nm.statements,defaultValue:[]},title:{name:Nm.title}},superTypes:[]},Group:{name:y3.$type,properties:{icon:{name:y3.icon},id:{name:y3.id},in:{name:y3.in},title:{name:y3.title}},superTypes:[]},Info:{name:Ux.$type,properties:{accDescr:{name:Ux.accDescr},accTitle:{name:Ux.accTitle},title:{name:Ux.title}},superTypes:[]},Item:{name:b3.$type,properties:{classSelector:{name:b3.classSelector},name:{name:b3.name}},superTypes:[]},Junction:{name:XV.$type,properties:{id:{name:XV.id},in:{name:XV.in}},superTypes:[]},Label:{name:v3.$type,properties:{negX:{name:v3.negX,defaultValue:!1},negY:{name:v3.negY,defaultValue:!1},offsetX:{name:v3.offsetX},offsetY:{name:v3.offsetY}},superTypes:[]},Leaf:{name:lA.$type,properties:{classSelector:{name:lA.classSelector},name:{name:lA.name},value:{name:lA.value}},superTypes:[b3.$type]},Link:{name:fm.$type,properties:{arrow:{name:fm.arrow},from:{name:fm.from},fromPort:{name:fm.fromPort},linkLabel:{name:fm.linkLabel},to:{name:fm.to},toPort:{name:fm.toPort}},superTypes:[]},Merge:{name:py.$type,properties:{branch:{name:py.branch},id:{name:py.id},tags:{name:py.tags,defaultValue:[]},type:{name:py.type}},superTypes:[$2.$type]},Note:{name:cA.$type,properties:{evolution:{name:cA.evolution},text:{name:cA.text},visibility:{name:cA.visibility}},superTypes:[]},Option:{name:KV.$type,properties:{name:{name:KV.name},value:{name:KV.value,defaultValue:!1}},superTypes:[]},Packet:{name:gy.$type,properties:{accDescr:{name:gy.accDescr},accTitle:{name:gy.accTitle},blocks:{name:gy.blocks,defaultValue:[]},title:{name:gy.title}},superTypes:[]},PacketBlock:{name:my.$type,properties:{bits:{name:my.bits},end:{name:my.end},label:{name:my.label},start:{name:my.start}},superTypes:[]},PegAny:{name:j5e.$type,properties:{dot:{name:j5e.dot}},superTypes:[x3.$type]},PegGroup:{name:Y5e.$type,properties:{element:{name:Y5e.element}},superTypes:[x3.$type]},PegIdentifier:{name:X5e.$type,properties:{name:{name:X5e.name}},superTypes:[x3.$type]},PegLiteral:{name:K5e.$type,properties:{value:{name:K5e.value}},superTypes:[x3.$type]},PegOrderedChoice:{name:Z5e.$type,properties:{alternatives:{name:Z5e.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:ZV.$type,properties:{operator:{name:ZV.operator},suffix:{name:ZV.suffix}},superTypes:[]},PegPrimary:{name:x3.$type,properties:{},superTypes:[]},PegRule:{name:JV.$type,properties:{definition:{name:JV.definition},name:{name:JV.name}},superTypes:[]},PegSequence:{name:J5e.$type,properties:{elements:{name:J5e.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:QV.$type,properties:{operator:{name:QV.operator},primary:{name:QV.primary}},superTypes:[]},Pie:{name:Dm.$type,properties:{accDescr:{name:Dm.accDescr},accTitle:{name:Dm.accTitle},sections:{name:Dm.sections,defaultValue:[]},showData:{name:Dm.showData,defaultValue:!1},title:{name:Dm.title}},superTypes:[]},PieSection:{name:YM.$type,properties:{label:{name:YM.label},value:{name:YM.value}},superTypes:[]},Pipeline:{name:eH.$type,properties:{components:{name:eH.components,defaultValue:[]},parent:{name:eH.parent}},superTypes:[]},PipelineComponent:{name:uA.$type,properties:{evolution:{name:uA.evolution},label:{name:uA.label},name:{name:uA.name}},superTypes:[]},Radar:{name:pm.$type,properties:{accDescr:{name:pm.accDescr},accTitle:{name:pm.accTitle},axes:{name:pm.axes,defaultValue:[]},curves:{name:pm.curves,defaultValue:[]},options:{name:pm.options,defaultValue:[]},title:{name:pm.title}},superTypes:[]},Railroad:{name:Uy.$type,properties:{accDescr:{name:Uy.accDescr},accTitle:{name:Uy.accTitle},rules:{name:Uy.rules,defaultValue:[]},title:{name:Uy.title}},superTypes:[]},RailroadAbnf:{name:yy.$type,properties:{accDescr:{name:yy.accDescr},accTitle:{name:yy.accTitle},rules:{name:yy.rules,defaultValue:[]},title:{name:yy.title}},superTypes:[]},RailroadChoiceExpr:{name:Q5e.$type,properties:{alternatives:{name:Q5e.alternatives,defaultValue:[]}},superTypes:[Of.$type]},RailroadEbnf:{name:by.$type,properties:{accDescr:{name:by.accDescr},accTitle:{name:by.accTitle},rules:{name:by.rules,defaultValue:[]},title:{name:by.title}},superTypes:[]},RailroadExpression:{name:Of.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:e2e.$type,properties:{name:{name:e2e.name}},superTypes:[Of.$type]},RailroadOneOrMoreExpr:{name:t2e.$type,properties:{element:{name:t2e.element}},superTypes:[Of.$type]},RailroadOptionalExpr:{name:r2e.$type,properties:{element:{name:r2e.element}},superTypes:[Of.$type]},RailroadPeg:{name:vy.$type,properties:{accDescr:{name:vy.accDescr},accTitle:{name:vy.accTitle},rules:{name:vy.rules,defaultValue:[]},title:{name:vy.title}},superTypes:[]},RailroadRule:{name:tH.$type,properties:{definition:{name:tH.definition},name:{name:tH.name}},superTypes:[]},RailroadSequenceExpr:{name:n2e.$type,properties:{elements:{name:n2e.elements,defaultValue:[]}},superTypes:[Of.$type]},RailroadSpecialExpr:{name:i2e.$type,properties:{text:{name:i2e.text}},superTypes:[Of.$type]},RailroadTerminalExpr:{name:a2e.$type,properties:{value:{name:a2e.value}},superTypes:[Of.$type]},RailroadZeroOrMoreExpr:{name:s2e.$type,properties:{element:{name:s2e.element}},superTypes:[Of.$type]},Section:{name:rH.$type,properties:{classSelector:{name:rH.classSelector},name:{name:rH.name}},superTypes:[b3.$type]},Service:{name:B2.$type,properties:{icon:{name:B2.icon},iconText:{name:B2.iconText},id:{name:B2.id},in:{name:B2.in},title:{name:B2.title}},superTypes:[]},Size:{name:nH.$type,properties:{height:{name:nH.height},width:{name:nH.width}},superTypes:[]},Statement:{name:$2.$type,properties:{},superTypes:[]},Transition:{name:yx.$type,properties:{from:{name:yx.from},label:{name:yx.label},to:{name:yx.to}},superTypes:[]},TreeNode:{name:F2.$type,properties:{classAnnotation:{name:F2.classAnnotation},descAnnotation:{name:F2.descAnnotation},iconAnnotation:{name:F2.iconAnnotation},indent:{name:F2.indent},name:{name:F2.name}},superTypes:[]},TreeView:{name:w3.$type,properties:{accDescr:{name:w3.accDescr},accTitle:{name:w3.accTitle},nodes:{name:w3.nodes,defaultValue:[]},title:{name:w3.title}},superTypes:[]},Treemap:{name:xy.$type,properties:{accDescr:{name:xy.accDescr},accTitle:{name:xy.accTitle},title:{name:xy.title},TreemapRows:{name:xy.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:iH.$type,properties:{indent:{name:iH.indent},item:{name:iH.item}},superTypes:[]},Wardley:{name:vo.$type,properties:{accDescr:{name:vo.accDescr},accelerators:{name:vo.accelerators,defaultValue:[]},accTitle:{name:vo.accTitle},anchors:{name:vo.anchors,defaultValue:[]},annotation:{name:vo.annotation,defaultValue:[]},annotations:{name:vo.annotations,defaultValue:[]},components:{name:vo.components,defaultValue:[]},deaccelerators:{name:vo.deaccelerators,defaultValue:[]},evolution:{name:vo.evolution},evolves:{name:vo.evolves,defaultValue:[]},links:{name:vo.links,defaultValue:[]},notes:{name:vo.notes,defaultValue:[]},pipelines:{name:vo.pipelines,defaultValue:[]},size:{name:vo.size},title:{name:vo.title}},superTypes:[]}}}},M(d8,"MermaidAstReflection"),d8),ts=new Zqe,o2e,Xpr=M(()=>o2e??(o2e=fo(`{"$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":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),l2e,Kpr=M(()=>l2e??(l2e=fo(`{"$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"),c2e,Zpr=M(()=>c2e??(c2e=fo('{"$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"),u2e,Jpr=M(()=>u2e??(u2e=fo(`{"$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"),h2e,Qpr=M(()=>h2e??(h2e=fo(`{"$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"),d2e,egr=M(()=>d2e??(d2e=fo(`{"$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"),f2e,tgr=M(()=>f2e??(f2e=fo(`{"$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"),p2e,rgr=M(()=>p2e??(p2e=fo(`{"$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"),g2e,ngr=M(()=>g2e??(g2e=fo('{"$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"),m2e,igr=M(()=>m2e??(m2e=fo(`{"$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"),U2e,agr=M(()=>U2e??(U2e=fo(`{"$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"),y2e,sgr=M(()=>y2e??(y2e=fo(`{"$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"),b2e,ogr=M(()=>b2e??(b2e=fo(`{"$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"),v2e,lgr=M(()=>v2e??(v2e=fo(`{"$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"),x2e,cgr=M(()=>x2e??(x2e=fo(`{"$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"),ugr={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},hgr={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},dgr={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},fgr={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},pgr={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ggr={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mgr={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ugr={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ygr={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bgr={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vgr={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xgr={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wgr={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tgr={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Cgr={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rc={AstReflection:M(()=>new Zqe,"AstReflection")},kgr={Grammar:M(()=>Xpr(),"Grammar"),LanguageMetaData:M(()=>ugr,"LanguageMetaData"),parser:{}},Sgr={Grammar:M(()=>Kpr(),"Grammar"),LanguageMetaData:M(()=>hgr,"LanguageMetaData"),parser:{}},Egr={Grammar:M(()=>Zpr(),"Grammar"),LanguageMetaData:M(()=>dgr,"LanguageMetaData"),parser:{}},Agr={Grammar:M(()=>Jpr(),"Grammar"),LanguageMetaData:M(()=>fgr,"LanguageMetaData"),parser:{}},Mgr={Grammar:M(()=>Qpr(),"Grammar"),LanguageMetaData:M(()=>pgr,"LanguageMetaData"),parser:{}},Rgr={Grammar:M(()=>egr(),"Grammar"),LanguageMetaData:M(()=>ggr,"LanguageMetaData"),parser:{}},Lgr={Grammar:M(()=>tgr(),"Grammar"),LanguageMetaData:M(()=>mgr,"LanguageMetaData"),parser:{}},Igr={Grammar:M(()=>rgr(),"Grammar"),LanguageMetaData:M(()=>Ugr,"LanguageMetaData"),parser:{}},Ngr={Grammar:M(()=>ngr(),"Grammar"),LanguageMetaData:M(()=>ygr,"LanguageMetaData"),parser:{}},Dgr={Grammar:M(()=>igr(),"Grammar"),LanguageMetaData:M(()=>bgr,"LanguageMetaData"),parser:{}},Ogr={Grammar:M(()=>agr(),"Grammar"),LanguageMetaData:M(()=>vgr,"LanguageMetaData"),parser:{}},_gr={Grammar:M(()=>sgr(),"Grammar"),LanguageMetaData:M(()=>xgr,"LanguageMetaData"),parser:{}},Pgr={Grammar:M(()=>ogr(),"Grammar"),LanguageMetaData:M(()=>wgr,"LanguageMetaData"),parser:{}},Bgr={Grammar:M(()=>lgr(),"Grammar"),LanguageMetaData:M(()=>Tgr,"LanguageMetaData"),parser:{}},$gr={Grammar:M(()=>cgr(),"Grammar"),LanguageMetaData:M(()=>Cgr,"LanguageMetaData"),parser:{}},Fgr=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,zgr=/accTitle[\t ]*:([^\n\r]*)/,Vgr=/title([\t ][^\n\r]*|)/,Hgr={ACC_DESCR:Fgr,ACC_TITLE:zgr,TITLE:Vgr},f8,wf=(f8=class extends nae{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=Hgr[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,` +`)}}},M(f8,"AbstractMermaidValueConverter"),f8),p8,A9=(p8=class extends wf{runCustomConverter(e,r,n){}},M(p8,"CommonValueConverter"),p8),g8,nc=(g8=class extends XP{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}},M(g8,"AbstractMermaidTokenBuilder"),g8),m8;m8=class extends nc{},M(m8,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: (** @@ -3837,67 +3970,67 @@ lodash-es/lodash.js: * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) -*/var fT,wgr=(fT=class extends nc{constructor(){super(["radar-beta"])}},_(fT,"RadarTokenBuilder"),fT),FUe={parser:{TokenBuilder:_(()=>new wgr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")}};function zUe(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),cgr,FUe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}_(zUe,"createRadarServices");var pT,Tgr=(pT=class extends nc{constructor(){super(["railroad-beta"])}},_(pT,"RailroadTokenBuilder"),pT),d2e=_(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Tgr,"TokenBuilder"),ValueConverter:_(()=>new Cgr,"ValueConverter")}};function yse(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),dgr,VUe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}_(yse,"createRailroadServices");var mT,kgr=(mT=class extends nc{constructor(){super(["railroad-ebnf-beta"])}},_(mT,"RailroadEbnfTokenBuilder"),mT),f2e=_(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew kgr,"TokenBuilder"),ValueConverter:_(()=>new Sgr,"ValueConverter")}};function vse(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),hgr,HUe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}_(vse,"createRailroadEbnfServices");var vT,Egr=(vT=class extends nc{constructor(){super(["railroad-abnf-beta"])}},_(vT,"RailroadAbnfTokenBuilder"),vT),bT,Agr=(bT=class extends wf{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const s=i.trim();if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))return s.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},_(bT,"RailroadAbnfValueConverter"),bT),GUe={parser:{TokenBuilder:_(()=>new Egr,"TokenBuilder"),ValueConverter:_(()=>new Agr,"ValueConverter")}};function bse(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),ugr,GUe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}_(bse,"createRailroadAbnfServices");var xT,Mgr=(xT=class extends nc{constructor(){super(["railroad-peg-beta"])}},_(xT,"RailroadPegTokenBuilder"),xT),p2e=_(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Mgr,"TokenBuilder"),ValueConverter:_(()=>new Rgr,"ValueConverter")}};function xse(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),fgr,WUe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}_(xse,"createRailroadPegServices");var TT,_gr=(TT=class extends nc{constructor(){super(["treemap"])}},_(TT,"TreemapTokenBuilder"),TT),Lgr=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,CT,Igr=(CT=class extends wf{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=Lgr.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},_(CT,"TreemapValueConverter"),CT);function qUe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}_(qUe,"registerValidationChecks");var kT,Ngr=(kT=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"}))}},_(kT,"TreemapValidator"),kT),UUe={parser:{TokenBuilder:_(()=>new _gr,"TokenBuilder"),ValueConverter:_(()=>new Igr,"ValueConverter")},validation:{TreemapValidator:_(()=>new Ngr,"TreemapValidator")}};function jUe(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),pgr,UUe);return e.ServiceRegistry.register(r),qUe(r),{shared:e,Treemap:r}}_(jUe,"createTreemapServices");var ST,Ogr=(ST=class extends wf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},_(ST,"WardleyValueConverter"),ST),YUe={parser:{ValueConverter:_(()=>new Ogr,"ValueConverter")}};function XUe(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),mgr,YUe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}_(XUe,"createWardleyServices");var ET,Dgr=(ET=class extends nc{constructor(){super(["cynefin-beta"])}},_(ET,"CynefinTokenBuilder"),ET),KUe={parser:{TokenBuilder:_(()=>new Dgr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")}};function ZUe(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),ngr,KUe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}_(ZUe,"createCynefinServices");var AT,Pgr=(AT=class extends nc{constructor(){super(["gitGraph"])}},_(AT,"GitGraphTokenBuilder"),AT),QUe={parser:{TokenBuilder:_(()=>new Pgr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")}};function JUe(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),sgr,QUe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}_(JUe,"createGitGraphServices");var MT,$gr=(MT=class extends nc{constructor(){super(["info","showInfo"])}},_(MT,"InfoTokenBuilder"),MT),eje={parser:{TokenBuilder:_(()=>new $gr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")}};function tje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),agr,eje);return e.ServiceRegistry.register(r),{shared:e,Info:r}}_(tje,"createInfoServices");var RT,Bgr=(RT=class extends nc{constructor(){super(["packet"])}},_(RT,"PacketTokenBuilder"),RT),rje={parser:{TokenBuilder:_(()=>new Bgr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")}};function nje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),ogr,rje);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}_(nje,"createPacketServices");var _T,Fgr=(_T=class extends nc{constructor(){super(["pie","showData"])}},_(_T,"PieTokenBuilder"),_T),LT,zgr=(LT=class extends wf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},_(LT,"PieValueConverter"),LT),ije={parser:{TokenBuilder:_(()=>new Fgr,"TokenBuilder"),ValueConverter:_(()=>new zgr,"ValueConverter")}};function sje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),lgr,ije);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}_(sje,"createPieServices");var IT,Vgr=(IT=class extends wf{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()}},_(IT,"TreeViewValueConverter"),IT),NT,Hgr=(NT=class extends nc{constructor(){super(["treeView-beta"])}},_(NT,"TreeViewTokenBuilder"),NT),aje={parser:{TokenBuilder:_(()=>new Hgr,"TokenBuilder"),ValueConverter:_(()=>new Vgr,"ValueConverter")}};function oje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),ggr,aje);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}_(oje,"createTreeViewServices");var OT,Ggr=(OT=class extends nc{constructor(){super(["architecture"])}},_(OT,"ArchitectureTokenBuilder"),OT),DT,Wgr=(DT=class extends wf{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()}}},_(DT,"ArchitectureValueConverter"),DT),lje={parser:{TokenBuilder:_(()=>new Ggr,"TokenBuilder"),ValueConverter:_(()=>new Wgr,"ValueConverter")}};function cje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),rgr,lje);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}_(cje,"createArchitectureServices");var PT,qgr=(PT=class extends nc{constructor(){super(["eventmodeling"])}},_(PT,"EventModelingTokenBuilder"),PT),g2e=new Set(["cmd","command"]),m2e=new Set(["evt","event"]),eG=new Set(["rmo","readmodel"]),y2e=new Set(["pcr","processor"]),v2e=new Set(["ui"]);function uje(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)}}_(uje,"registerValidationChecks");var $T,Ugr=($T=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(g2e.has(e.modelEntityType)?this.validateSources(e,new Set([...v2e,...y2e]),"command","ui or processor",r):m2e.has(e.modelEntityType)?this.validateSources(e,g2e,"event","command",r):eG.has(e.modelEntityType)?this.validateSources(e,m2e,"read model","event",r):y2e.has(e.modelEntityType)?this.validateSources(e,eG,"processor","read model",r):v2e.has(e.modelEntityType)&&this.validateSources(e,eG,"ui","read model",r))}validateSources(e,r,n,i,s){for(const a of e.sourceFrames){const o=a.ref;o!==void 0&&!r.has(o.modelEntityType)&&s("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},_($T,"EventModelingValidator"),$T),hje={parser:{TokenBuilder:_(()=>new qgr,"TokenBuilder"),ValueConverter:_(()=>new SC,"ValueConverter")},validation:{EventModelingValidator:_(()=>new Ugr,"EventModelingValidator")}};function dje(t=Fo){const e=jn(ho(t),rc),r=jn(uo({shared:e}),igr,hje);return e.ServiceRegistry.register(r),uje(r),{shared:e,EventModel:r}}_(dje,"createEventModelingServices");var To={},jgr={info:_(async()=>{const{createInfoServices:t}=await Mr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>Akr);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;To.info=e},"info"),packet:_(async()=>{const{createPacketServices:t}=await Mr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>Mkr);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;To.packet=e},"packet"),pie:_(async()=>{const{createPieServices:t}=await Mr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Rkr);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;To.pie=e},"pie"),treeView:_(async()=>{const{createTreeViewServices:t}=await Mr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>_kr);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;To.treeView=e},"treeView"),architecture:_(async()=>{const{createArchitectureServices:t}=await Mr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Lkr);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;To.architecture=e},"architecture"),gitGraph:_(async()=>{const{createGitGraphServices:t}=await Mr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Ikr);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;To.gitGraph=e},"gitGraph"),eventmodeling:_(async()=>{const{createEventModelingServices:t}=await Mr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Nkr);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;To.eventmodeling=e},"eventmodeling"),radar:_(async()=>{const{createRadarServices:t}=await Mr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>Okr);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;To.radar=e},"radar"),railroad:_(async()=>{const{createRailroadServices:t}=await Mr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>Dkr);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;To.railroad=e},"railroad"),railroadEbnf:_(async()=>{const{createRailroadEbnfServices:t}=await Mr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Pkr);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;To.railroadEbnf=e},"railroadEbnf"),railroadAbnf:_(async()=>{const{createRailroadAbnfServices:t}=await Mr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>$kr);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;To.railroadAbnf=e},"railroadAbnf"),railroadPeg:_(async()=>{const{createRailroadPegServices:t}=await Mr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>Bkr);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;To.railroadPeg=e},"railroadPeg"),treemap:_(async()=>{const{createTreemapServices:t}=await Mr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Fkr);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;To.treemap=e},"treemap"),wardley:_(async()=>{const{createWardleyServices:t}=await Mr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>zkr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;To.wardley=e},"wardley"),cynefin:_(async()=>{const{createCynefinServices:t}=await Mr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Vkr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;To.cynefin=e},"cynefin")};async function Ju(t,e){const r=jgr[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);To[t]||await r();const i=To[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Z7(i);return i.value}_(Ju,"parse");var BT,Z7=(BT=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const s=i.line!==void 0&&!isNaN(i.line)?i.line:"?",a=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${s}, column ${a}: ${i.message}`}).join(` -`),n=e.parserErrors.map(i=>{const s=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",a=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${s}, column ${a}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},_(BT,"MermaidParseError"),BT),Ai={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Ygr=En.gitGraph,r2=w(()=>rs({...Ygr,...xr().gitGraph}),"getConfig"),Jt=new _re(()=>{const t=r2(),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 tB(){return _Ee({length:7})}w(tB,"getID");function fje(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const s=e(i);return r[s]||(r[s]=!0,n.push(i)),n},[])}w(fje,"uniqBy");var Xgr=w(function(t){Jt.records.direction=t},"setDirection"),Kgr=w(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Jt.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),Zgr=w(function(){return Jt.records.options},"getOptions"),Qgr=w(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const s=r2();r=Gt.sanitizeText(r,s),e=Gt.sanitizeText(e,s),i=i==null?void 0:i.map(o=>Gt.sanitizeText(o,s));const a={id:r||Jt.records.seq+"-"+tB(),message:e,seq:Jt.records.seq++,type:n??Ai.NORMAL,tags:i??[],parents:Jt.records.head==null?[]:[Jt.records.head.id],branch:Jt.records.currBranch};Jt.records.head=a,de.info("main branch",s.mainBranchName),Jt.records.commits.has(a.id)&&de.warn(`Commit ID ${a.id} already exists`),Jt.records.commits.set(a.id,a),Jt.records.branches.set(Jt.records.currBranch,a.id),de.debug("in pushCommit "+a.id)},"commit"),Jgr=w(function(t){let e=t.name;const r=t.order;if(e=Gt.sanitizeText(e,r2()),Jt.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}")`);Jt.records.branches.set(e,Jt.records.head!=null?Jt.records.head.id:null),Jt.records.branchConfig.set(e,{name:e,order:r}),pje(e),de.debug("in createBranch")},"branch"),emr=w(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,s=r2();e=Gt.sanitizeText(e,s),r&&(r=Gt.sanitizeText(r,s));const a=Jt.records.branches.get(Jt.records.currBranch),o=Jt.records.branches.get(e),l=a?Jt.records.commits.get(a):void 0,u=o?Jt.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Jt.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 (${Jt.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Jt.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&&Jt.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||`${Jt.records.seq}-${tB()}`,message:`merged branch ${e} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,h],branch:Jt.records.currBranch,type:Ai.MERGE,customType:n,customId:!!r,tags:i??[]};Jt.records.head=d,Jt.records.commits.set(d.id,d),Jt.records.branches.set(Jt.records.currBranch,d.id),de.debug(Jt.records.branches),de.debug("in mergeBranch")},"merge"),tmr=w(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const s=r2();if(e=Gt.sanitizeText(e,s),r=Gt.sanitizeText(r,s),n=n==null?void 0:n.map(l=>Gt.sanitizeText(l,s)),i=Gt.sanitizeText(i,s),!e||!Jt.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 a=Jt.records.commits.get(e);if(a===void 0||!a)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=a.branch;if(a.type===Ai.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||!Jt.records.commits.has(r)){if(o===Jt.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=Jt.records.branches.get(Jt.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Jt.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Jt.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Jt.records.seq+"-"+tB(),message:`cherry-picked ${a==null?void 0:a.message} into ${Jt.records.currBranch}`,seq:Jt.records.seq++,parents:Jt.records.head==null?[]:[Jt.records.head.id,a.id],branch:Jt.records.currBranch,type:Ai.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ai.MERGE?`|parent:${i}`:""}`]};Jt.records.head=h,Jt.records.commits.set(h.id,h),Jt.records.branches.set(Jt.records.currBranch,h.id),de.debug(Jt.records.branches),de.debug("in cherryPick")}},"cherryPick"),pje=w(function(t){if(t=Gt.sanitizeText(t,r2()),Jt.records.branches.has(t)){Jt.records.currBranch=t;const e=Jt.records.branches.get(Jt.records.currBranch);e===void 0||!e?Jt.records.head=null:Jt.records.head=Jt.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 iK(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}w(iK,"upsert");function wse(t){const e=t.reduce((i,s)=>i.seq>s.seq?i:s,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Jt.records.branches)Jt.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Jt.records.commits.get(e.parents[0]);iK(t,e,i),e.parents[1]&&t.push(Jt.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Jt.records.commits.get(e.parents[0]);iK(t,e,i)}}t=fje(t,i=>i.id),wse(t)}w(wse,"prettyPrintCommitHistory");var rmr=w(function(){de.debug(Jt.records.commits);const t=gje()[0];wse([t])},"prettyPrint"),nmr=w(function(){Jt.reset(),Oi()},"clear"),imr=w(function(){return[...Jt.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"),smr=w(function(){return Jt.records.branches},"getBranches"),amr=w(function(){return Jt.records.commits},"getCommits"),gje=w(function(){const t=[...Jt.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),omr=w(function(){return Jt.records.currBranch},"getCurrentBranch"),lmr=w(function(){return Jt.records.direction},"getDirection"),cmr=w(function(){return Jt.records.head},"getHead"),mje={commitType:Ai,getConfig:r2,setDirection:Xgr,setOptions:Kgr,getOptions:Zgr,commit:Qgr,branch:Jgr,merge:emr,cherryPick:tmr,checkout:pje,prettyPrint:rmr,clear:nmr,getBranchesAsObjArray:imr,getBranches:smr,getCommits:amr,getCommitsArray:gje,getCurrentBranch:omr,getDirection:lmr,getHead:cmr,setAccTitle:qi,getAccTitle:ns,getAccDescription:ss,setAccDescription:is,setDiagramTitle:ts,getDiagramTitle:ji},umr=w((t,e)=>{ec(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)hmr(r,e)},"populate"),hmr=w((t,e)=>{const n={Commit:w(i=>e.commit(dmr(i)),"Commit"),Branch:w(i=>e.branch(fmr(i)),"Branch"),Merge:w(i=>e.merge(pmr(i)),"Merge"),Checkout:w(i=>e.checkout(gmr(i)),"Checkout"),CherryPicking:w(i=>e.cherryPick(mmr(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),dmr=w(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ai[t.type]:Ai.NORMAL,tags:t.tags??void 0}),"parseCommit"),fmr=w(t=>({name:t.name,order:t.order??0}),"parseBranch"),pmr=w(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ai[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),gmr=w(t=>t.branch,"parseCheckout"),mmr=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"),ymr={parse:w(async t=>{const e=await Ju("gitGraph",t);de.debug(e),umr(e,mje)},"parse")},yg=10,vg=40,yd=4,Yf=2,Q1=8,rB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),sK=12,Tse=new Set(["redux-color","redux-dark-color"]),vmr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),J1=w((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),vc=new Map,Cc=new Map,ZN=30,gS=new Map,QN=[],Xf=0,Dn="LR",bmr=w(()=>{vc.clear(),Cc.clear(),gS.clear(),Xf=0,QN=[],Dn="LR"},"clear"),yje=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"),vje=w(t=>{let e,r,n;return Dn==="BT"?(r=w((i,s)=>i<=s,"comparisonFunc"),n=1/0):(r=w((i,s)=>i>=s,"comparisonFunc"),n=0),t.forEach(i=>{var a,o;const s=Dn==="TB"||Dn=="BT"?(a=Cc.get(i))==null?void 0:a.y:(o=Cc.get(i))==null?void 0:o.x;s!==void 0&&r(s,n)&&(e=i,n=s)}),e},"findClosestParent"),xmr=w(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Cc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),wmr=w((t,e,r)=>{let n=r,i=r;const s=[];t.forEach(a=>{const o=e.get(a);if(!o)throw new Error(`Commit not found for key ${a}`);o.parents.length?(n=Cmr(o),i=Math.max(n,i)):s.push(o),kmr(o,n)}),n=i,s.forEach(a=>{Smr(a,n,r)}),t.forEach(a=>{const o=e.get(a);if(o!=null&&o.parents.length){const l=xmr(o.parents);n=Cc.get(l).y-vg,n<=i&&(i=n);const u=vc.get(o.branch).pos,h=n-yg;Cc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),Tmr=w(t=>{var n;const e=vje(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Cc.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"),Cmr=w(t=>Tmr(t)+vg,"calculateCommitPosition"),kmr=w((t,e)=>{const r=vc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+yg;return Cc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Smr=w((t,e,r)=>{const n=vc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,s=n.pos;Cc.set(t.id,{x:s,y:i})},"setRootPosition"),Emr=w((t,e,r,n,i,s)=>{const{theme:a}=He(),o=rB.has(a??""),l=Tse.has(a??""),u=vmr.has(a??"");if(s===Ai.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${J1(i,Q1,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${J1(i,Q1,l)} ${n}-inner`);else if(s===Ai.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${J1(i,Q1,l)}`),s===Ai.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${J1(i,Q1,l)}`)}if(s===Ai.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${J1(i,Q1,l)}`)}}},"drawCommitBullet"),Amr=w((t,e,r,n,i)=>{var s;if(e.type!==Ai.CHERRY_PICK&&(e.customId&&e.type===Ai.MERGE||e.type!==Ai.MERGE)&&i.showCommitLabel){const a=t.append("g"),o=a.insert("rect").attr("class","commit-label-bkg"),l=a.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(s=l.node())==null?void 0:s.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-Yf).attr("y",r.y+13.5).attr("width",u.width+2*Yf).attr("height",u.height+2*Yf),Dn==="TB"||Dn==="BT"?(o.attr("x",r.x-(u.width+4*yd+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*yd)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Dn==="TB"||Dn==="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;a.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),Mmr=w((t,e,r,n)=>{var i;if(e.tags.length>0){let s=0,a=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-s).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");a=Math.max(a,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:s}),s+=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-a/2-yd/2},${g+Yf} - ${n-a/2-yd/2},${g-Yf} - ${r.posWithOffset-a/2-yd},${g-p-Yf} - ${r.posWithOffset+a/2+yd},${g-p-Yf} - ${r.posWithOffset+a/2+yd},${g+p+Yf} - ${r.posWithOffset-a/2-yd},${g+p+Yf}`),h.attr("cy",g).attr("cx",n-a/2+yd/2).attr("r",1.5).attr("class","tag-hole"),Dn==="TB"||Dn==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` +*/var U8,Ggr=(U8=class extends nc{constructor(){super(["radar-beta"])}},M(U8,"RadarTokenBuilder"),U8),Jqe={parser:{TokenBuilder:M(()=>new Ggr,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")}};function Qqe(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Igr,Jqe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}M(Qqe,"createRadarServices");var y8,Wgr=(y8=class extends nc{constructor(){super(["railroad-beta"])}},M(y8,"RailroadTokenBuilder"),y8),w2e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Wgr,"TokenBuilder"),ValueConverter:M(()=>new qgr,"ValueConverter")}};function kae(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Ogr,eje);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}M(kae,"createRailroadServices");var v8,jgr=(v8=class extends nc{constructor(){super(["railroad-ebnf-beta"])}},M(v8,"RailroadEbnfTokenBuilder"),v8),T2e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew jgr,"TokenBuilder"),ValueConverter:M(()=>new Ygr,"ValueConverter")}};function Sae(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Dgr,tje);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}M(Sae,"createRailroadEbnfServices");var w8,Xgr=(w8=class extends nc{constructor(){super(["railroad-abnf-beta"])}},M(w8,"RailroadAbnfTokenBuilder"),w8),T8,Kgr=(T8=class extends wf{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)}},M(T8,"RailroadAbnfValueConverter"),T8),rje={parser:{TokenBuilder:M(()=>new Xgr,"TokenBuilder"),ValueConverter:M(()=>new Kgr,"ValueConverter")}};function Eae(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Ngr,rje);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}M(Eae,"createRailroadAbnfServices");var C8,Zgr=(C8=class extends nc{constructor(){super(["railroad-peg-beta"])}},M(C8,"RailroadPegTokenBuilder"),C8),C2e=M(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew Zgr,"TokenBuilder"),ValueConverter:M(()=>new Jgr,"ValueConverter")}};function Aae(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),_gr,nje);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}M(Aae,"createRailroadPegServices");var S8,Qgr=(S8=class extends nc{constructor(){super(["treemap"])}},M(S8,"TreemapTokenBuilder"),S8),e1r=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,E8,t1r=(E8=class extends wf{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=e1r.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},M(E8,"TreemapValueConverter"),E8);function ije(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}M(ije,"registerValidationChecks");var A8,r1r=(A8=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"}))}},M(A8,"TreemapValidator"),A8),aje={parser:{TokenBuilder:M(()=>new Qgr,"TokenBuilder"),ValueConverter:M(()=>new t1r,"ValueConverter")},validation:{TreemapValidator:M(()=>new r1r,"TreemapValidator")}};function sje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Pgr,aje);return e.ServiceRegistry.register(r),ije(r),{shared:e,Treemap:r}}M(sje,"createTreemapServices");var M8,n1r=(M8=class extends wf{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},M(M8,"WardleyValueConverter"),M8),oje={parser:{ValueConverter:M(()=>new n1r,"ValueConverter")}};function lje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),$gr,oje);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}M(lje,"createWardleyServices");var R8,i1r=(R8=class extends nc{constructor(){super(["cynefin-beta"])}},M(R8,"CynefinTokenBuilder"),R8),cje={parser:{TokenBuilder:M(()=>new i1r,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")}};function uje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Sgr,cje);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}M(uje,"createCynefinServices");var L8,a1r=(L8=class extends nc{constructor(){super(["gitGraph"])}},M(L8,"GitGraphTokenBuilder"),L8),hje={parser:{TokenBuilder:M(()=>new a1r,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")}};function dje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Agr,hje);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}M(dje,"createGitGraphServices");var I8,s1r=(I8=class extends nc{constructor(){super(["info","showInfo"])}},M(I8,"InfoTokenBuilder"),I8),fje={parser:{TokenBuilder:M(()=>new s1r,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")}};function pje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Mgr,fje);return e.ServiceRegistry.register(r),{shared:e,Info:r}}M(pje,"createInfoServices");var N8,o1r=(N8=class extends nc{constructor(){super(["packet"])}},M(N8,"PacketTokenBuilder"),N8),gje={parser:{TokenBuilder:M(()=>new o1r,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")}};function mje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Rgr,gje);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}M(mje,"createPacketServices");var D8,l1r=(D8=class extends nc{constructor(){super(["pie","showData"])}},M(D8,"PieTokenBuilder"),D8),O8,c1r=(O8=class extends wf{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},M(O8,"PieValueConverter"),O8),Uje={parser:{TokenBuilder:M(()=>new l1r,"TokenBuilder"),ValueConverter:M(()=>new c1r,"ValueConverter")}};function yje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Lgr,Uje);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}M(yje,"createPieServices");var _8,u1r=(_8=class extends wf{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()}},M(_8,"TreeViewValueConverter"),_8),P8,h1r=(P8=class extends nc{constructor(){super(["treeView-beta"])}},M(P8,"TreeViewTokenBuilder"),P8),bje={parser:{TokenBuilder:M(()=>new h1r,"TokenBuilder"),ValueConverter:M(()=>new u1r,"ValueConverter")}};function vje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Bgr,bje);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}M(vje,"createTreeViewServices");var B8,d1r=(B8=class extends nc{constructor(){super(["architecture"])}},M(B8,"ArchitectureTokenBuilder"),B8),$8,f1r=($8=class extends wf{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()}}},M($8,"ArchitectureValueConverter"),$8),xje={parser:{TokenBuilder:M(()=>new d1r,"TokenBuilder"),ValueConverter:M(()=>new f1r,"ValueConverter")}};function wje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),kgr,xje);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}M(wje,"createArchitectureServices");var F8,p1r=(F8=class extends nc{constructor(){super(["eventmodeling"])}},M(F8,"EventModelingTokenBuilder"),F8),k2e=new Set(["cmd","command"]),S2e=new Set(["evt","event"]),aH=new Set(["rmo","readmodel"]),E2e=new Set(["pcr","processor"]),A2e=new Set(["ui"]);function Tje(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)}}M(Tje,"registerValidationChecks");var z8,g1r=(z8=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(k2e.has(e.modelEntityType)?this.validateSources(e,new Set([...A2e,...E2e]),"command","ui or processor",r):S2e.has(e.modelEntityType)?this.validateSources(e,k2e,"event","command",r):aH.has(e.modelEntityType)?this.validateSources(e,S2e,"read model","event",r):E2e.has(e.modelEntityType)?this.validateSources(e,aH,"processor","read model",r):A2e.has(e.modelEntityType)&&this.validateSources(e,aH,"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"})}}},M(z8,"EventModelingValidator"),z8),Cje={parser:{TokenBuilder:M(()=>new p1r,"TokenBuilder"),ValueConverter:M(()=>new A9,"ValueConverter")},validation:{EventModelingValidator:M(()=>new g1r,"EventModelingValidator")}};function kje(t=$o){const e=Yn(ho(t),rc),r=Yn(uo({shared:e}),Egr,Cje);return e.ServiceRegistry.register(r),Tje(r),{shared:e,EventModel:r}}M(kje,"createEventModelingServices");var wo={},m1r={info:M(async()=>{const{createInfoServices:t}=await Mr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>K3r);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;wo.info=e},"info"),packet:M(async()=>{const{createPacketServices:t}=await Mr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>Z3r);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;wo.packet=e},"packet"),pie:M(async()=>{const{createPieServices:t}=await Mr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>J3r);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;wo.pie=e},"pie"),treeView:M(async()=>{const{createTreeViewServices:t}=await Mr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>Q3r);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;wo.treeView=e},"treeView"),architecture:M(async()=>{const{createArchitectureServices:t}=await Mr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>exr);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;wo.architecture=e},"architecture"),gitGraph:M(async()=>{const{createGitGraphServices:t}=await Mr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>txr);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;wo.gitGraph=e},"gitGraph"),eventmodeling:M(async()=>{const{createEventModelingServices:t}=await Mr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>rxr);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;wo.eventmodeling=e},"eventmodeling"),radar:M(async()=>{const{createRadarServices:t}=await Mr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>nxr);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;wo.radar=e},"radar"),railroad:M(async()=>{const{createRailroadServices:t}=await Mr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>ixr);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;wo.railroad=e},"railroad"),railroadEbnf:M(async()=>{const{createRailroadEbnfServices:t}=await Mr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>axr);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;wo.railroadEbnf=e},"railroadEbnf"),railroadAbnf:M(async()=>{const{createRailroadAbnfServices:t}=await Mr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>sxr);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;wo.railroadAbnf=e},"railroadAbnf"),railroadPeg:M(async()=>{const{createRailroadPegServices:t}=await Mr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>oxr);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;wo.railroadPeg=e},"railroadPeg"),treemap:M(async()=>{const{createTreemapServices:t}=await Mr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>lxr);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;wo.treemap=e},"treemap"),wardley:M(async()=>{const{createWardleyServices:t}=await Mr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>cxr);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;wo.wardley=e},"wardley"),cynefin:M(async()=>{const{createCynefinServices:t}=await Mr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>uxr);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;wo.cynefin=e},"cynefin")};async function Qu(t,e){const r=m1r[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);wo[t]||await r();const i=wo[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new eS(i);return i.value}M(Qu,"parse");var V8,eS=(V8=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}},M(V8,"MermaidParseError"),V8),Ai={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},U1r=An.gitGraph,a2=x(()=>na({...U1r,...xr().gitGraph}),"getConfig"),er=new Bre(()=>{const t=a2(),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 iB(){return Fwe({length:7})}x(iB,"getID");function Sje(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(Sje,"uniqBy");var y1r=x(function(t){er.records.direction=t},"setDirection"),b1r=x(function(t){de.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{er.records.options=JSON.parse(t)}catch(e){de.error("error while parsing gitGraph options",e.message)}},"setOptions"),v1r=x(function(){return er.records.options},"getOptions"),x1r=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;de.info("commit",e,r,n,i),de.debug("Entering commit:",e,r,n,i);const a=a2();r=Ht.sanitizeText(r,a),e=Ht.sanitizeText(e,a),i=i==null?void 0:i.map(o=>Ht.sanitizeText(o,a));const s={id:r||er.records.seq+"-"+iB(),message:e,seq:er.records.seq++,type:n??Ai.NORMAL,tags:i??[],parents:er.records.head==null?[]:[er.records.head.id],branch:er.records.currBranch};er.records.head=s,de.info("main branch",a.mainBranchName),er.records.commits.has(s.id)&&de.warn(`Commit ID ${s.id} already exists`),er.records.commits.set(s.id,s),er.records.branches.set(er.records.currBranch,s.id),de.debug("in pushCommit "+s.id)},"commit"),w1r=x(function(t){let e=t.name;const r=t.order;if(e=Ht.sanitizeText(e,a2()),er.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}")`);er.records.branches.set(e,er.records.head!=null?er.records.head.id:null),er.records.branchConfig.set(e,{name:e,order:r}),Eje(e),de.debug("in createBranch")},"branch"),T1r=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=a2();e=Ht.sanitizeText(e,a),r&&(r=Ht.sanitizeText(r,a));const s=er.records.branches.get(er.records.currBranch),o=er.records.branches.get(e),l=s?er.records.commits.get(s):void 0,u=o?er.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(er.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 (${er.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!er.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&&er.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||`${er.records.seq}-${iB()}`,message:`merged branch ${e} into ${er.records.currBranch}`,seq:er.records.seq++,parents:er.records.head==null?[]:[er.records.head.id,h],branch:er.records.currBranch,type:Ai.MERGE,customType:n,customId:!!r,tags:i??[]};er.records.head=d,er.records.commits.set(d.id,d),er.records.branches.set(er.records.currBranch,d.id),de.debug(er.records.branches),de.debug("in mergeBranch")},"merge"),C1r=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;de.debug("Entering cherryPick:",e,r,n);const a=a2();if(e=Ht.sanitizeText(e,a),r=Ht.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Ht.sanitizeText(l,a)),i=Ht.sanitizeText(i,a),!e||!er.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=er.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===Ai.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||!er.records.commits.has(r)){if(o===er.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=er.records.branches.get(er.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${er.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=er.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${er.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:er.records.seq+"-"+iB(),message:`cherry-picked ${s==null?void 0:s.message} into ${er.records.currBranch}`,seq:er.records.seq++,parents:er.records.head==null?[]:[er.records.head.id,s.id],branch:er.records.currBranch,type:Ai.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Ai.MERGE?`|parent:${i}`:""}`]};er.records.head=h,er.records.commits.set(h.id,h),er.records.branches.set(er.records.currBranch,h.id),de.debug(er.records.branches),de.debug("in cherryPick")}},"cherryPick"),Eje=x(function(t){if(t=Ht.sanitizeText(t,a2()),er.records.branches.has(t)){er.records.currBranch=t;const e=er.records.branches.get(er.records.currBranch);e===void 0||!e?er.records.head=null:er.records.head=er.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 hK(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(hK,"upsert");function Mae(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 er.records.branches)er.records.branches.get(i)===e.id&&n.push(i);if(de.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=er.records.commits.get(e.parents[0]);hK(t,e,i),e.parents[1]&&t.push(er.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=er.records.commits.get(e.parents[0]);hK(t,e,i)}}t=Sje(t,i=>i.id),Mae(t)}x(Mae,"prettyPrintCommitHistory");var k1r=x(function(){de.debug(er.records.commits);const t=Aje()[0];Mae([t])},"prettyPrint"),S1r=x(function(){er.reset(),Oi()},"clear"),E1r=x(function(){return[...er.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"),A1r=x(function(){return er.records.branches},"getBranches"),M1r=x(function(){return er.records.commits},"getCommits"),Aje=x(function(){const t=[...er.records.commits.values()];return t.forEach(function(e){de.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),R1r=x(function(){return er.records.currBranch},"getCurrentBranch"),L1r=x(function(){return er.records.direction},"getDirection"),I1r=x(function(){return er.records.head},"getHead"),Mje={commitType:Ai,getConfig:a2,setDirection:y1r,setOptions:b1r,getOptions:v1r,commit:x1r,branch:w1r,merge:T1r,cherryPick:C1r,checkout:Eje,prettyPrint:k1r,clear:S1r,getBranchesAsObjArray:E1r,getBranches:A1r,getCommits:M1r,getCommitsArray:Aje,getCurrentBranch:R1r,getDirection:L1r,getHead:I1r,setAccTitle:qi,getAccTitle:ia,getAccDescription:sa,setAccDescription:aa,setDiagramTitle:ra,getDiagramTitle:Yi},N1r=x((t,e)=>{ec(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)D1r(r,e)},"populate"),D1r=x((t,e)=>{const n={Commit:x(i=>e.commit(O1r(i)),"Commit"),Branch:x(i=>e.branch(_1r(i)),"Branch"),Merge:x(i=>e.merge(P1r(i)),"Merge"),Checkout:x(i=>e.checkout(B1r(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick($1r(i)),"CherryPicking")}[t.$type];n?n(t):de.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),O1r=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Ai[t.type]:Ai.NORMAL,tags:t.tags??void 0}),"parseCommit"),_1r=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),P1r=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Ai[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),B1r=x(t=>t.branch,"parseCheckout"),$1r=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),F1r={parse:x(async t=>{const e=await Qu("gitGraph",t);de.debug(e),N1r(e,Mje)},"parse")},yg=10,bg=40,yd=4,Xf=2,tU=8,aB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),dK=12,Rae=new Set(["redux-color","redux-dark-color"]),z1r=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),rU=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),yc=new Map,Tc=new Map,eD=30,bx=new Map,tD=[],Kf=0,_n="LR",V1r=x(()=>{yc.clear(),Tc.clear(),bx.clear(),Kf=0,tD=[],_n="LR"},"clear"),Rje=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),Lje=x(t=>{let e,r,n;return _n==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=_n==="TB"||_n=="BT"?(s=Tc.get(i))==null?void 0:s.y:(o=Tc.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),H1r=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=Tc.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),G1r=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=q1r(o),i=Math.max(n,i)):a.push(o),j1r(o,n)}),n=i,a.forEach(s=>{Y1r(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=H1r(o.parents);n=Tc.get(l).y-bg,n<=i&&(i=n);const u=yc.get(o.branch).pos,h=n-yg;Tc.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),W1r=x(t=>{var n;const e=Lje(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=Tc.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"),q1r=x(t=>W1r(t)+bg,"calculateCommitPosition"),j1r=x((t,e)=>{const r=yc.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+yg;return Tc.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),Y1r=x((t,e,r)=>{const n=yc.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Tc.set(t.id,{x:a,y:i})},"setRootPosition"),X1r=x((t,e,r,n,i,a)=>{const{theme:s}=He(),o=aB.has(s??""),l=Rae.has(s??""),u=z1r.has(s??"");if(a===Ai.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${rU(i,tU,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${rU(i,tU,l)} ${n}-inner`);else if(a===Ai.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${rU(i,tU,l)}`),a===Ai.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${rU(i,tU,l)}`)}if(a===Ai.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${rU(i,tU,l)}`)}}},"drawCommitBullet"),K1r=x((t,e,r,n,i)=>{var a;if(e.type!==Ai.CHERRY_PICK&&(e.customId&&e.type===Ai.MERGE||e.type!==Ai.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-Xf).attr("y",r.y+13.5).attr("width",u.width+2*Xf).attr("height",u.height+2*Xf),_n==="TB"||_n==="BT"?(o.attr("x",r.x-(u.width+4*yd+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*yd)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(_n==="TB"||_n==="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"),Z1r=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` + ${n-s/2-yd/2},${g+Xf} + ${n-s/2-yd/2},${g-Xf} + ${r.posWithOffset-s/2-yd},${g-p-Xf} + ${r.posWithOffset+s/2+yd},${g-p-Xf} + ${r.posWithOffset+s/2+yd},${g+p+Xf} + ${r.posWithOffset-s/2-yd},${g+p+Xf}`),h.attr("cy",g).attr("cx",n-s/2+yd/2).attr("r",1.5).attr("class","tag-hole"),_n==="TB"||_n==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",` ${r.x},${m+2} ${r.x},${m-2} ${r.x+yg},${m-p-2} - ${r.x+yg+a+4},${m-p-2} - ${r.x+yg+a+4},${m+p+2} - ${r.x+yg},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+yd/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"),Rmr=w(t=>{switch(t.customType??t.type){case Ai.NORMAL:return"commit-normal";case Ai.REVERSE:return"commit-reverse";case Ai.HIGHLIGHT:return"commit-highlight";case Ai.MERGE:return"commit-merge";case Ai.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),_mr=w((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const s=vje(t.parents);if(s){const a=n.get(s)??i;return e==="TB"?a.y+vg:e==="BT"?(n.get(t.id)??i).y-vg:a.x+vg}}else return e==="TB"?ZN:e==="BT"?(n.get(t.id)??i).y-vg:0;return 0},"calculatePosition"),Lmr=w((t,e,r)=>{var l,u;const n=Dn==="BT"&&r?e:e+yg,i=(l=vc.get(t.branch))==null?void 0:l.pos,s=Dn==="TB"||Dn==="BT"?(u=vc.get(t.branch))==null?void 0:u.pos:n;if(s===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const a=rB.has(He().theme??""),o=Dn==="TB"||Dn==="BT"?n:i+(a?sK/2+1:-2);return{x:s,y:o,posWithOffset:n}},"getCommitPosition"),b2e=w((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let a=Dn==="TB"||Dn==="BT"?ZN: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);Dn==="BT"&&(l&&wmr(h,e,a),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&&(a=_mr(f,Dn,a,Cc));const p=Lmr(f,a,l);if(r){const m=Rmr(f),y=f.customType??f.type,v=((g=vc.get(f.branch))==null?void 0:g.index)??0;Emr(i,f,p,m,v,y),Amr(s,f,p,a,n),Mmr(s,f,p,a)}Dn==="TB"||Dn==="BT"?Cc.set(f.id,{x:p.x,y:p.posWithOffset}):Cc.set(f.id,{x:p.posWithOffset,y:p.y}),a=Dn==="BT"&&l?a+vg:a+vg+yg,a>Xf&&(Xf=a)})},"drawCommits"),Imr=w((t,e,r,n,i)=>{const a=(Dn==="TB"||Dn==="BT"?r.xu.branch===a,"isOnBranchToGetCurve"),l=w(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),mS=w((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(QN.every(a=>Math.abs(a-n)>=10))return QN.push(n),n;const s=Math.abs(t-e);return mS(t,e-s/5,r+1)},"findLane"),Nmr=w((t,e,r,n)=>{var m,y,v,b,x;const{theme:i}=He(),s=Tse.has(i??""),a=Cc.get(e.id),o=Cc.get(r.id);if(a===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=Imr(e,r,a,o,n);let u="",h="",d=0,f=0,p=(m=vc.get(r.branch))==null?void 0:m.index;r.type===Ai.MERGE&&e.id!==r.parents[0]&&(p=(y=vc.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=a.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ai.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y-d} ${h} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${u} ${o.x} ${a.y+f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):Dn==="BT"?(a.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ai.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${u} ${a.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${o.x+d} ${a.y} ${h} ${o.x} ${a.y-f} L ${o.x} ${o.y}`),a.x===o.x&&(g=`M ${a.x} ${a.y} L ${o.x} ${o.y}`)):(a.yo.y&&(r.type===Ai.MERGE&&e.id!==r.parents[0]?g=`M ${a.x} ${a.y} L ${o.x-d} ${a.y} ${u} ${o.x} ${a.y-f} L ${o.x} ${o.y}`:g=`M ${a.x} ${a.y} L ${a.x} ${o.y+d} ${h} ${a.x+f} ${o.y} L ${o.x} ${o.y}`),a.y===o.y&&(g=`M ${a.x} ${a.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"+J1(p,Q1,s))},"drawArrow"),Omr=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(s=>{Nmr(r,e.get(s),i,e)})})},"drawArrows"),Dmr=w((t,e,r,n)=>{const{look:i,theme:s,themeVariables:a}=He(),{dropShadow:o,THEME_COLOR_LIMIT:l}=a,u=rB.has(s??""),h=Tse.has(s??""),d=t.append("g");e.forEach((f,p)=>{var R;const g=J1(p,u?l:Q1,h),m=(R=vc.get(f.name))==null?void 0:R.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Dn==="TB"||Dn==="BT"?m:u?m+sK/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Xf),v.attr("y2",y),v.attr("class","branch branch"+g),Dn==="TB"?(v.attr("y1",ZN),v.attr("x1",m),v.attr("y2",Xf),v.attr("x2",m)):Dn==="BT"&&(v.attr("y1",Xf),v.attr("x1",m),v.attr("y2",ZN),v.attr("x2",m)),QN.push(y);const b=f.name,x=yje(b),T=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(x);const k=x.getBBox(),E=u?0:4,A=u?16:0,M=u?sK: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",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+A).attr("height",k.height+4+M),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+A/2)+", "+(y-k.height/2-2)+")"),Dn==="TB"?(T.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(T.attr("transform",`translate(${-A/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-M*2+7)+")"))):Dn==="BT"?(T.attr("x",m-k.width/2-10).attr("y",Xf),S.attr("transform","translate("+(m-k.width/2-5)+", "+Xf+")"),u&&(T.attr("transform",`translate(${-A/2-3}, ${M+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(Xf+M*2+4)+")"))):T.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),Pmr=w(function(t,e,r,n,i){return vc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Dn==="TB"||Dn==="BT"?n.width/2:0),e},"setBranchPosition"),$mr=w(function(t,e,r,n){bmr(),de.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){de.error("getConfig method is not available on db");return}const s=i.getConfig(),a=s.rotateCommitLabel??!1;gS=i.getCommits();const o=i.getBranchesAsObjArray();Dn=i.getDirection();const l=xt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=He(),{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"&&rB.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,b)=>{var E;const x=yje(v.name),T=l.append("g"),C=T.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(x);const k=x.getBBox();y=Pmr(v.name,y,b,k,a),S.remove(),C.remove(),T.remove()}),b2e(l,gS,!1,s),s.showBranches&&Dmr(l,o,s,e),Omr(l,gS),b2e(l,gS,!0,s),Kr.insertTitle(l,"gitTitleText",s.titleTopMargin??0,i.getDiagramTitle()),OQ(void 0,l,s.diagramPadding,s.useMaxWidth)},"draw"),Bmr={draw:$mr},bje=8,xje=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Fmr=new Set(["redux-color","redux-dark-color"]),zmr=new Set(["neo","neo-dark"]),Vmr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Hmr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Gmr=w(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Ai.NORMAL:return"commit-normal";case Ai.REVERSE:return"commit-reverse";case Ai.HIGHLIGHT:return"commit-highlight";case Ai.MERGE:return"commit-merge";case Ai.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Q1r=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=Lje(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+bg:e==="BT"?(n.get(t.id)??i).y-bg:s.x+bg}}else return e==="TB"?eD:e==="BT"?(n.get(t.id)??i).y-bg:0;return 0},"calculatePosition"),emr=x((t,e,r)=>{var l,u;const n=_n==="BT"&&r?e:e+yg,i=(l=yc.get(t.branch))==null?void 0:l.pos,a=_n==="TB"||_n==="BT"?(u=yc.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=aB.has(He().theme??""),o=_n==="TB"||_n==="BT"?n:i+(s?dK/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),M2e=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=_n==="TB"||_n==="BT"?eD:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,U;const p=(m=e.get(d))==null?void 0:m.seq,g=(U=e.get(f))==null?void 0:U.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);_n==="BT"&&(l&&G1r(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=Q1r(f,_n,s,Tc));const p=emr(f,s,l);if(r){const m=J1r(f),U=f.customType??f.type,y=((g=yc.get(f.branch))==null?void 0:g.index)??0;X1r(i,f,p,m,y,U),K1r(a,f,p,s,n),Z1r(a,f,p,s)}_n==="TB"||_n==="BT"?Tc.set(f.id,{x:p.x,y:p.posWithOffset}):Tc.set(f.id,{x:p.posWithOffset,y:p.y}),s=_n==="BT"&&l?s+bg:s+bg+yg,s>Kf&&(Kf=s)})},"drawCommits"),tmr=x((t,e,r,n,i)=>{const s=(_n==="TB"||_n==="BT"?r.xu.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seql(u)&&o(u))},"shouldRerouteArrow"),vx=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(tD.every(s=>Math.abs(s-n)>=10))return tD.push(n),n;const a=Math.abs(t-e);return vx(t,e-a/5,r+1)},"findLane"),rmr=x((t,e,r,n)=>{var m,U,y,b,v;const{theme:i}=He(),a=Rae.has(i??""),s=Tc.get(e.id),o=Tc.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=tmr(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=yc.get(r.branch))==null?void 0:m.index;r.type===Ai.MERGE&&e.id!==r.parents[0]&&(p=(U=yc.get(e.branch))==null?void 0:U.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.yo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ai.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}`)):_n==="BT"?(s.xo.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Ai.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===Ai.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"+rU(p,tU,a))},"drawArrow"),nmr=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{rmr(r,e.get(a),i,e)})})},"drawArrows"),imr=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=He(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=aB.has(a??""),h=Rae.has(a??""),d=t.append("g");e.forEach((f,p)=>{var R;const g=rU(p,u?l:tU,h),m=(R=yc.get(f.name))==null?void 0:R.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const U=_n==="TB"||_n==="BT"?m:u?m+dK/2+1:m-2,y=d.append("line");y.attr("x1",0),y.attr("y1",U),y.attr("x2",Kf),y.attr("y2",U),y.attr("class","branch branch"+g),_n==="TB"?(y.attr("y1",eD),y.attr("x1",m),y.attr("y2",Kf),y.attr("x2",m)):_n==="BT"&&(y.attr("y1",Kf),y.attr("x1",m),y.attr("y2",eD),y.attr("x2",m)),tD.push(U);const b=f.name,v=Rje(b),w=d.insert("rect"),k=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);k.node().appendChild(v);const C=v.getBBox(),S=u?0:4,E=u?16:0,A=u?dK:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",S).attr("ry",S).attr("x",-C.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-C.height/2+10).attr("width",C.width+18+E).attr("height",C.height+4+A),k.attr("transform","translate("+(-C.width-14-(r.rotateCommitLabel===!0?30:0)+E/2)+", "+(U-C.height/2-2)+")"),_n==="TB"?(w.attr("x",m-C.width/2-10).attr("y",0),k.attr("transform","translate("+(m-C.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-E/2-3}, ${-A-10})`),k.attr("transform","translate("+(m-C.width/2-5)+", "+(-A*2+7)+")"))):_n==="BT"?(w.attr("x",m-C.width/2-10).attr("y",Kf),k.attr("transform","translate("+(m-C.width/2-5)+", "+Kf+")"),u&&(w.attr("transform",`translate(${-E/2-3}, ${A+10})`),k.attr("transform","translate("+(m-C.width/2-5)+", "+(Kf+A*2+4)+")"))):w.attr("transform","translate(-19, "+(U-12-A/2)+")")})},"drawBranches"),amr=x(function(t,e,r,n,i){return yc.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(_n==="TB"||_n==="BT"?n.width/2:0),e},"setBranchPosition"),smr=x(function(t,e,r,n){V1r(),de.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){de.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;bx=i.getCommits();const o=i.getBranchesAsObjArray();_n=i.getDirection();const l=vt(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=He(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const y=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");y.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),y.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&aB.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 U=0;o.forEach((y,b)=>{var S;const v=Rje(y.name),w=l.append("g"),T=w.insert("g").attr("class","branchLabel"),k=T.insert("g").attr("class","label branch-label");(S=k.node())==null||S.appendChild(v);const C=v.getBBox();U=amr(y.name,U,b,C,s),k.remove(),T.remove(),w.remove()}),M2e(l,bx,!1,a),a.showBranches&&imr(l,o,a,e),nmr(l,bx),M2e(l,bx,!0,a),Kr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),zJ(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),omr={draw:smr},Ije=8,Nje=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),lmr=new Set(["redux-color","redux-dark-color"]),cmr=new Set(["neo","neo-dark"]),umr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),hmr=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),dmr=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{const e=xr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,s=xje.has(r);if(zmr.has(r)){let a="";for(let o=0;o{const e=xr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=Nje.has(r);if(cmr.has(r)){let s="";for(let o=0;o`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%bje;return` + `;return s}},"genColor"),pmr=x(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%Ije;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"),Umr=w(t=>{const e=xr(),{theme:r}=e,n=Hmr.has(r);return` +`)}`,"normalTheme"),gmr=x(t=>{const e=xr(),{theme:r}=e,n=hmr.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -3907,7 +4040,7 @@ lodash-es/lodash.js: font-family: var(--mermaid-font-family); } - ${n?Wmr(t):qmr(t)} + ${n?fmr(t):pmr(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -3938,7 +4071,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: ${xje.has(r)?t.strokeWidth:8}; + stroke-width: ${Nje.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -3947,12 +4080,12 @@ lodash-es/lodash.js: font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),jmr=Umr,Ymr={parser:ymr,db:mje,renderer:Bmr,styles:jmr};const Xmr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ymr},Symbol.toStringTag,{value:"Module"}));var U9={exports:{}},Kmr=U9.exports,x2e;function Zmr(){return x2e||(x2e=1,(function(t,e){(function(r,n){t.exports=n()})(Kmr,(function(){var r="day";return function(n,i,s){var a=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return a(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=a(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?s.utc:s)().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)}}}))})(U9)),U9.exports}var Qmr=Zmr();const Jmr=wm(Qmr);var j9={exports:{}},e1r=j9.exports,w2e;function t1r(){return w2e||(w2e=1,(function(t,e){(function(r,n){t.exports=n()})(e1r,(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/,s=/\d\d/,a=/\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 b=v.match(/([+-]|\d\d)/g),x=60*b[1]+(+b[2]||0);return x===0?0:b[0]==="+"?-x:x})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var b,x=l.meridiem;if(x){for(var T=1;T<=24;T+=1)if(y.indexOf(x(T,0,v))>-1){b=T>12;break}}else b=y===(v?"pm":"PM");return b},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:[s,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[s,h("day")],Do:[o,function(y){var v=l.ordinal,b=y.match(/\d+/);if(this.day=b[0],v)for(var x=1;x<=31;x+=1)v(x).replace(/\[|\]/g,"")===y&&(this.day=x)}],w:[a,h("week")],ww:[s,h("week")],M:[a,h("month")],MM:[s,h("month")],MMM:[o,function(y){var v=f("months"),b=(f("monthsShort")||v.map((function(x){return x.slice(0,3)}))).indexOf(y)+1;if(b<1)throw new Error;this.month=b%12||b}],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:[s,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,b;v=y,b=l&&l.formats;for(var x=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,R,P){var N=P&&P.toUpperCase();return R||b[P]||r[P]||b[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(L,I,$){return I||$.slice(1)}))}))).match(n),T=x.length,C=0;C-1)return new Date((D==="X"?1e3:1)*O);var V=m(D)(O),F=V.year,H=V.month,G=V.day,W=V.hours,K=V.minutes,q=V.seconds,oe=V.milliseconds,Z=V.zone,Q=V.week,ne=new Date,ie=G||(F||H?1:ne.getDate()),me=F||ne.getFullYear(),te=0;F&&!H||(te=H>0?H-1:ne.getMonth());var _e,$e=W||0,Ve=K||0,ce=q||0,he=oe||0;return Z?new Date(Date.UTC(me,te,ie,$e,Ve,ce,he+60*Z.offset*1e3)):B?new Date(Date.UTC(me,te,ie,$e,Ve,ce,he)):(_e=new Date(me,te,ie,$e,Ve,ce,he),Q&&(_e=z(_e).week(Q).toDate()),_e)}catch{return new Date("")}})(S,A,k,b),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 L=A.length,I=1;I<=L;I+=1){E[1]=A[I-1];var $=b.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===L&&(this.$d=new Date(""))}else T.call(this,C)}}}))})(j9)),j9.exports}var r1r=t1r();const n1r=wm(r1r);var Y9={exports:{}},i1r=Y9.exports,T2e;function s1r(){return T2e||(T2e=1,(function(t,e){(function(r,n){t.exports=n()})(i1r,(function(){return function(r,n){var i=n.prototype,s=i.format;i.format=function(a){var o=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var u=this.$utils(),h=(a||"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 s.bind(this)(h)}}}))})(Y9)),Y9.exports}var a1r=s1r();const o1r=wm(a1r);var X9={exports:{}},l1r=X9.exports,C2e;function c1r(){return C2e||(C2e=1,(function(t,e){(function(r,n){t.exports=n()})(l1r,(function(){var r,n,i=1e3,s=6e4,a=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:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof T},g=function(S,k,E){return new T(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},b=function(S){return Math.abs(S)},x=function(S,k){return S?y(S)?{negative:!0,format:""+b(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},T=(function(){function S(E,A,M){var R=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){R.$d[m(L)]=E[L]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var N=P.slice(2).map((function(L){return L!=null?Number(L):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 k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(A,M){return A+(E.$d[M]||0)*f[M]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/a),E%=a,this.$d.minutes=v(E/s),E%=s,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=x(this.$d.years,"Y"),A=x(this.$d.months,"M"),M=+this.$d.days||0;this.$d.weeks&&(M+=7*this.$d.weeks);var R=x(M,"D"),P=x(this.$d.hours,"H"),N=x(this.$d.minutes,"M"),L=this.$d.seconds||0;this.$d.milliseconds&&(L+=this.$d.milliseconds/1e3,L=Math.round(1e3*L)/1e3);var I=x(L,"S"),$=E.negative||A.negative||R.negative||P.negative||N.negative||I.negative,O=P.format||N.format||I.format?"T":"",D=($?"-":"")+"P"+E.format+A.format+R.format+O+P.format+N.format+I.format;return D==="P"||D==="-P"?"P0D":D},k.toJSON=function(){return this.toISOString()},k.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(R,P){return P||String(M[R])}))},k.as=function(E){return this.$ms/f[m(E)]},k.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},k.add=function(E,A,M){var R;return R=A?E*f[m(A)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+R*(M?-1:1),this)},k.subtract=function(E,A){return this.add(E,A,!0)},k.locale=function(E){var A=this.clone();return A.$l=E,A},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(R,P){var N=E.locale();return g(R,{$l:N},P)},E.isDuration=p;var A=k.prototype.add,M=k.prototype.subtract;k.prototype.add=function(R,P){return p(R)?C(this,R,1):A.bind(this)(R,P)},k.prototype.subtract=function(R,P){return p(R)?C(this,R,-1):M.bind(this)(R,P)}}}))})(X9)),X9.exports}var u1r=c1r();const h1r=wm(u1r);var aK=(function(){var t=w(function(N,L,I,$){for(I=I||{},$=N.length;$--;I[N[$]]=L);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],s=[1,29],a=[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],b=[1,16],x=[1,19],T=[1,20],C=[1,21],S=[1,22],k=[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(L,I,$,O,D,B,z){var V=B.length-1;switch(D){case 1:return B[V-1];case 2:this.$=[];break;case 3:B[V-1].push(B[V]),this.$=B[V-1];break;case 4:case 5:this.$=B[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(B[V].substr(11)),this.$=B[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=B[V].substr(18);break;case 19:O.TopAxis(),this.$=B[V].substr(8);break;case 20:O.setAxisFormat(B[V].substr(11)),this.$=B[V].substr(11);break;case 21:O.setTickInterval(B[V].substr(13)),this.$=B[V].substr(13);break;case 22:O.setExcludes(B[V].substr(9)),this.$=B[V].substr(9);break;case 23:O.setIncludes(B[V].substr(9)),this.$=B[V].substr(9);break;case 24:O.setTodayMarker(B[V].substr(12)),this.$=B[V].substr(12);break;case 27:O.setDiagramTitle(B[V].substr(6)),this.$=B[V].substr(6);break;case 28:this.$=B[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=B[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(B[V].substr(8)),this.$=B[V].substr(8);break;case 33:O.addTask(B[V-1],B[V]),this.$="task";break;case 34:this.$=B[V-1],O.setClickEvent(B[V-1],B[V],null);break;case 35:this.$=B[V-2],O.setClickEvent(B[V-2],B[V-1],B[V]);break;case 36:this.$=B[V-2],O.setClickEvent(B[V-2],B[V-1],null),O.setLink(B[V-2],B[V]);break;case 37:this.$=B[V-3],O.setClickEvent(B[V-3],B[V-2],B[V-1]),O.setLink(B[V-3],B[V]);break;case 38:this.$=B[V-2],O.setClickEvent(B[V-2],B[V],null),O.setLink(B[V-2],B[V-1]);break;case 39:this.$=B[V-3],O.setClickEvent(B[V-3],B[V-1],B[V]),O.setLink(B[V-3],B[V-2]);break;case 40:this.$=B[V-1],O.setLink(B[V-1],B[V]);break;case 41:case 47:this.$=B[V-1]+" "+B[V];break;case 42:case 43:case 45:this.$=B[V-2]+" "+B[V-1]+" "+B[V];break;case 44:case 46:this.$=B[V-3]+" "+B[V-2]+" "+B[V-1]+" "+B[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:s,16:a,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:b,30:x,31:T,33:C,35:S,36:k,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:s,16:a,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:b,30:x,31:T,33:C,35:S,36:k,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(L,I){if(I.recoverable)this.trace(L);else{var $=new Error(L);throw $.hash=I,$}},"parseError"),parse:w(function(L){var I=this,$=[0],O=[],D=[null],B=[],z=this.table,V="",F=0,H=0,G=2,W=1,K=B.slice.call(arguments,1),q=Object.create(this.lexer),oe={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(oe.yy[Z]=this.yy[Z]);q.setInput(L,oe.yy),oe.yy.lexer=q,oe.yy.parser=this,typeof q.yylloc>"u"&&(q.yylloc={});var Q=q.yylloc;B.push(Q);var ne=q.options&&q.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(Ae){$.length=$.length-2*Ae,D.length=D.length-Ae,B.length=B.length-Ae}w(ie,"popStack");function me(){var Ae;return Ae=O.pop()||q.lex()||W,typeof Ae!="number"&&(Ae instanceof Array&&(O=Ae,Ae=O.pop()),Ae=I.symbols_[Ae]||Ae),Ae}w(me,"lex");for(var te,_e,$e,Ve,ce={},he,Te,ge,ze;;){if(_e=$[$.length-1],this.defaultActions[_e]?$e=this.defaultActions[_e]:((te===null||typeof te>"u")&&(te=me()),$e=z[_e]&&z[_e][te]),typeof $e>"u"||!$e.length||!$e[0]){var we="";ze=[];for(he in z[_e])this.terminals_[he]&&he>G&&ze.push("'"+this.terminals_[he]+"'");q.showPosition?we="Parse error on line "+(F+1)+`: -`+q.showPosition()+` -Expecting `+ze.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse error on line "+(F+1)+": Unexpected "+(te==W?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(we,{text:q.match,token:this.terminals_[te]||te,line:q.yylineno,loc:Q,expected:ze})}if($e[0]instanceof Array&&$e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_e+", token: "+te);switch($e[0]){case 1:$.push(te),D.push(q.yytext),B.push(q.yylloc),$.push($e[1]),te=null,H=q.yyleng,V=q.yytext,F=q.yylineno,Q=q.yylloc;break;case 2:if(Te=this.productions_[$e[1]][1],ce.$=D[D.length-Te],ce._$={first_line:B[B.length-(Te||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(Te||1)].first_column,last_column:B[B.length-1].last_column},ne&&(ce._$.range=[B[B.length-(Te||1)].range[0],B[B.length-1].range[1]]),Ve=this.performAction.apply(ce,[V,H,F,oe.yy,$e[1],D,B].concat(K)),typeof Ve<"u")return Ve;Te&&($=$.slice(0,-1*Te*2),D=D.slice(0,-1*Te),B=B.slice(0,-1*Te)),$.push(this.productions_[$e[1]][0]),D.push(ce.$),B.push(ce._$),ge=z[$[$.length-2]][$[$.length-1]],$.push(ge);break;case 3:return!0}}return!0},"parse")},R=(function(){var N={EOF:1,parseError:w(function(I,$){if(this.yy.parser)this.yy.parser.parseError(I,$);else throw new Error(I)},"parseError"),setInput:w(function(L,I){return this.yy=I||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 I=L.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),L},"input"),unput:w(function(L){var I=L.length,$=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[D[0],D[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(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(),I=new Array(L.length+1).join("-");return L+this.upcomingInput()+` -`+I+"^"},"showPosition"),test_match:w(function(L,I){var $,O,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),O=L[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],$=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var B in D)this[B]=D[B];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,I,$,O;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),B=0;BI[0].length)){if(I=$,O=B,this.options.backtrack_lexer){if(L=this.test_match($,D[B]),L!==!1)return L;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(L=this.test_match(I,D[O]),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 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(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return N})();M.lexer=R;function P(){this.yy={}}return w(P,"Parser"),P.prototype=M,M.Parser=P,new P})();aK.parser=aK;var d1r=aK;Ja.extend(Jmr);Ja.extend(n1r);Ja.extend(o1r);var k2e={friday:5,saturday:6},Dd="",Cse="",kse=void 0,Sse="",k3=[],S3=[],Ese=new Map,Ase=[],JN=[],E3="",Mse="",wje=["active","done","crit","milestone","vert"],Rse=[],jb="",Q7=!1,_se=!1,Lse="sunday",eO="saturday",oK=0,f1r=w(function(){Ase=[],JN=[],E3="",Rse=[],K9=0,cK=void 0,Z9=void 0,Ta=[],Dd="",Cse="",Mse="",kse=void 0,Sse="",k3=[],S3=[],Q7=!1,_se=!1,oK=0,Ese=new Map,jb="",Oi(),Lse="sunday",eO="saturday"},"clear"),p1r=w(function(t){jb=t},"setDiagramId"),g1r=w(function(t){Cse=t},"setAxisFormat"),m1r=w(function(){return Cse},"getAxisFormat"),y1r=w(function(t){kse=t},"setTickInterval"),v1r=w(function(){return kse},"getTickInterval"),b1r=w(function(t){Sse=t},"setTodayMarker"),x1r=w(function(){return Sse},"getTodayMarker"),w1r=w(function(t){Dd=t},"setDateFormat"),T1r=w(function(){Q7=!0},"enableInclusiveEndDates"),C1r=w(function(){return Q7},"endDatesAreInclusive"),k1r=w(function(){_se=!0},"enableTopAxis"),S1r=w(function(){return _se},"topAxisEnabled"),E1r=w(function(t){Mse=t},"setDisplayMode"),A1r=w(function(){return Mse},"getDisplayMode"),M1r=w(function(){return Dd},"getDateFormat"),Tje=w((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),R1r=w(function(t){k3=Tje(k3,t)},"setIncludes"),_1r=w(function(){return k3},"getIncludes"),L1r=w(function(t){S3=Tje(S3,t)},"setExcludes"),I1r=w(function(){return S3},"getExcludes"),N1r=w(function(){return Ese},"getLinks"),O1r=w(function(t){E3=t,Ase.push(t)},"addSection"),D1r=w(function(){return Ase},"getSections"),P1r=w(function(){let t=S2e();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,a]},"fixTaskDates"),lK=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 s=/^after\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let o=null;for(const u of s.groups.ids.split(" ")){let h=n2(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 a=Ja(r,e.trim(),!0);if(a.isValid())return a.toDate();{de.debug("Invalid date:"+r),de.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"),Sje=w(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Eje=w(function(t,e,r,n=!1){r=r.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(r);if(s!==null){let h=null;for(const f of s.groups.ids.split(" ")){let p=n2(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),Ese.set(n,r))}),Mje(t,"clickable")},"setLink"),Mje=w(function(t,e){t.split(",").forEach(function(r){let n=n2(r);n!==void 0&&n.classes.push(e)})},"setClass"),U1r=w(function(t,e,r){if(He().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{Kr.runFunc(e,...n)})},"setClickFun"),Rje=w(function(t,e){Rse.push(function(){const r=jb?`${jb}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=jb?`${jb}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),j1r=w(function(t,e,r){t.split(",").forEach(function(n){U1r(n,e,r)}),Mje(t,"clickable")},"setClickEvent"),Y1r=w(function(t){Rse.forEach(function(e){e(t)})},"bindFunctions"),X1r={getConfig:w(()=>He().gantt,"getConfig"),clear:f1r,setDateFormat:w1r,getDateFormat:M1r,enableInclusiveEndDates:T1r,endDatesAreInclusive:C1r,enableTopAxis:k1r,topAxisEnabled:S1r,setAxisFormat:g1r,getAxisFormat:m1r,setTickInterval:y1r,getTickInterval:v1r,setTodayMarker:b1r,getTodayMarker:x1r,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,setDiagramId:p1r,setDisplayMode:E1r,getDisplayMode:A1r,setAccDescription:is,getAccDescription:ss,addSection:O1r,getSections:D1r,getTasks:P1r,addTask:G1r,findTaskById:n2,addTaskOrg:W1r,setIncludes:R1r,getIncludes:_1r,setExcludes:L1r,getExcludes:I1r,setClickEvent:j1r,setLink:q1r,getLinks:N1r,bindFunctions:Y1r,parseDuration:Sje,isInvalidDate:Cje,setWeekday:$1r,getWeekday:B1r,setWeekend:F1r};function Ise(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),n=!0)})}w(Ise,"getTaskTags");Ja.extend(h1r);var K1r=w(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),E2e={monday:o6,tuesday:VCe,wednesday:HCe,thursday:Xy,friday:GCe,saturday:WCe,sunday:JA},Z1r=w((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of n)for(let a=0;a=r[a]){r[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),Df,tG=1e4,Q1r=w(function(t,e,r,n){const i=He().gantt;n.db.setDiagramId(e);const s=He().securityLevel;let a;s==="sandbox"&&(a=xt("#i"+e));const o=xt(s==="sandbox"?a.nodes()[0].contentDocument.body:"body"),l=s==="sandbox"?a.nodes()[0].contentDocument:document,u=l.getElementById(e);Df=u.parentElement.offsetWidth,Df===void 0&&(Df=1200),i.useWidth!==void 0&&(Df=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 R=0;for(const P of Object.keys(M)){const N=Z1r(M[P],R)+1;R+=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(R=>R.type===M).length}u.setAttribute("viewBox","0 0 "+Df+" "+g);const m=o.select(`[id="${e}"]`),y=A5t().domain([O2t(h,function(M){return M.startTime}),N2t(h,function(M){return M.endTime})]).rangeRound([0,Df-i.leftPadding-i.rightPadding]);function v(M,R){const P=M.startTime,N=R.startTime;let L=0;return P>N?L=1:PH.vert===G.vert?0:H.vert?1:-1);const O=M.filter(H=>!H.vert),B=[...new Set(O.map(H=>H.order))].map(H=>O.find(G=>G.order===H));m.append("g").selectAll("rect").data(B).enter().append("rect").attr("x",0).attr("y",function(H,G){return G=H.order,G*R+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",R).attr("class",function(H){for(const[G,W]of f.entries())if(H.type===W)return"section section"+G%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(H){return e+"-"+H.id}).attr("rx",3).attr("ry",3).attr("x",function(H){return H.milestone?y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))-.5*L:y(H.startTime)+N}).attr("y",function(H,G){return G=H.order,H.vert?i.gridLineStartPadding:G*R+P}).attr("width",function(H){return H.milestone?L:H.vert?.08*L:y(H.renderEndTime||H.endTime)-y(H.startTime)}).attr("height",function(H){return H.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:L}).attr("transform-origin",function(H,G){return G=H.order,(y(H.startTime)+N+.5*(y(H.endTime)-y(H.startTime))).toString()+"px "+(G*R+P+.5*L).toString()+"px"}).attr("class",function(H){const G="task";let W="";H.classes.length>0&&(W=H.classes.join(" "));let K=0;for(const[oe,Z]of f.entries())H.type===Z&&(K=oe%i.numberSectionStyles);let q="";return H.active?H.crit?q+=" activeCrit":q=" active":H.done?H.crit?q=" doneCrit":q=" done":H.crit&&(q+=" crit"),q.length===0&&(q=" task"),H.milestone&&(q=" milestone "+q),H.vert&&(q=" vert "+q),q+=K,q+=" "+W,G+q}),z.append("text").attr("id",function(H){return e+"-"+H.id+"-text"}).text(function(H){return H.task}).attr("font-size",i.fontSize).attr("x",function(H){let G=y(H.startTime),W=y(H.renderEndTime||H.endTime);if(H.milestone&&(G+=.5*(y(H.endTime)-y(H.startTime))-.5*L,W=G+L),H.vert)return y(H.startTime)+N;const K=this.getBBox().width;return K>W-G?W+K+1.5*i.leftPadding>$?G+N-5:W+N+5:(W-G)/2+G+N}).attr("y",function(H,G){return H.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(G=H.order,G*R+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",L).attr("class",function(H){const G=y(H.startTime);let W=y(H.endTime);H.milestone&&(W=G+L);const K=this.getBBox().width;let q="";H.classes.length>0&&(q=H.classes.join(" "));let oe=0;for(const[Q,ne]of f.entries())H.type===ne&&(oe=Q%i.numberSectionStyles);let Z="";return H.active&&(H.crit?Z="activeCritText"+oe:Z="activeText"+oe),H.done?H.crit?Z=Z+" doneCritText"+oe:Z=Z+" doneText"+oe:H.crit&&(Z=Z+" critText"+oe),H.milestone&&(Z+=" milestoneText"),H.vert&&(Z+=" vertText"),K>W-G?W+K+1.5*i.leftPadding>$?q+" taskTextOutsideLeft taskTextOutside"+oe+" "+Z:q+" taskTextOutsideRight taskTextOutside"+oe+" "+Z+" width-"+K:q+" taskText taskText"+oe+" "+Z+" width-"+K}),He().securityLevel==="sandbox"){let H;H=xt("#i"+e);const G=H.nodes()[0].contentDocument;z.filter(function(W){return V.has(W.id)}).each(function(W){var K=G.querySelector("#"+CSS.escape(e+"-"+W.id)),q=G.querySelector("#"+CSS.escape(e+"-"+W.id+"-text"));const oe=K.parentNode;var Z=G.createElement("a");Z.setAttribute("xlink:href",V.get(W.id)),Z.setAttribute("target","_top"),oe.appendChild(Z),Z.appendChild(K),Z.appendChild(q)})}}w(x,"drawRects");function T(M,R,P,N,L,I,$,O){if($.length===0&&O.length===0)return;let D,B;for(const{startTime:W,endTime:K}of I)(D===void 0||WB)&&(B=K);if(!D||!B)return;if(Ja(B).diff(Ja(D),"year")>5){de.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let F=null,H=Ja(D);for(;H.valueOf()<=B;)n.db.isInvalidDate(H,z,$,O)?F?F.end=H:F={start:H,end:H}:F&&(V.push(F),F=null),H=H.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",W=>e+"-exclude-"+W.start.format("YYYY-MM-DD")).attr("x",W=>y(W.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",W=>y(W.end.endOf("day"))-y(W.start.startOf("day"))).attr("height",L-R-i.gridLineStartPadding).attr("transform-origin",function(W,K){return(y(W.start)+P+.5*(y(W.end)-y(W.start))).toString()+"px "+(K*M+.5*L).toString()+"px"}).attr("class","exclude-range")}w(T,"drawExcludeDays");function C(M,R,P,N){if(P<=0||M>R)return 1/0;const L=R-M,I=Ja.duration({[N??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(L/I)}w(C,"getEstimatedTickCount");function S(M,R,P,N){const L=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:L==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=G2t(y).tickSize(-N+R+i.gridLineStartPadding).tickFormat(tL($));const B=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(B!==null){const z=parseInt(B[1],10);if(isNaN(z)||z<=0)de.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const V=B[2],F=n.db.getWeekday()||i.weekday,H=y.domain(),G=H[0],W=H[1],K=C(G,W,z,V);if(K>tG)de.warn(`The tick interval "${z}${V}" would generate ${K} ticks, which exceeds the maximum allowed (${tG}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks($5.every(z));break;case"second":O.ticks(lg.every(z));break;case"minute":O.ticks(s6.every(z));break;case"hour":O.ticks(a6.every(z));break;case"day":O.ticks(Yy.every(z));break;case"week":O.ticks(E2e[F].every(z));break;case"month":O.ticks(l6.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(N-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=H2t(y).tickSize(-N+R+i.gridLineStartPadding).tickFormat(tL($));if(B!==null){const V=parseInt(B[1],10);if(isNaN(V)||V<=0)de.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const F=B[2],H=n.db.getWeekday()||i.weekday,G=y.domain(),W=G[0],K=G[1];if(C(W,K,V,F)<=tG)switch(F){case"millisecond":z.ticks($5.every(V));break;case"second":z.ticks(lg.every(V));break;case"minute":z.ticks(s6.every(V));break;case"hour":z.ticks(a6.every(V));break;case"day":z.ticks(Yy.every(V));break;case"week":z.ticks(E2e[H].every(V));break;case"month":z.ticks(l6.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+M+", "+R+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}w(S,"makeGrid");function k(M,R){let P=0;const N=Object.keys(p).map(L=>[L,p[L]]);m.append("g").selectAll("text").data(N).enter().append(function(L){const I=L[0].split(Gt.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[D,B]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),D>0&&z.setAttribute("dy","1em"),z.textContent=B,O.appendChild(z)}return O}).attr("x",10).attr("y",function(L,I){if(I>0)for(let $=0;$` +`},"getStyles"),mmr=gmr,Umr={parser:F1r,db:Mje,renderer:omr,styles:mmr};const ymr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Umr},Symbol.toStringTag,{value:"Module"}));var XM={exports:{}},bmr=XM.exports,R2e;function vmr(){return R2e||(R2e=1,(function(t,e){(function(r,n){t.exports=n()})(bmr,(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)}}}))})(XM)),XM.exports}var xmr=vmr();const wmr=T1(xmr);var KM={exports:{}},Tmr=KM.exports,L2e;function Cmr(){return L2e||(L2e=1,(function(t,e){(function(r,n){t.exports=n()})(Tmr,(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(U){return(U=+U)+(U>68?1900:2e3)},h=function(U){return function(y){this[U]=+y}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(U){(this.zone||(this.zone={})).offset=(function(y){if(!y||y==="Z")return 0;var b=y.match(/([+-]|\d\d)/g),v=60*b[1]+(+b[2]||0);return v===0?0:b[0]==="+"?-v:v})(U)}],f=function(U){var y=l[U];return y&&(y.indexOf?y:y.s.concat(y.f))},p=function(U,y){var b,v=l.meridiem;if(v){for(var w=1;w<=24;w+=1)if(U.indexOf(v(w,0,y))>-1){b=w>12;break}}else b=U===(y?"pm":"PM");return b},g={A:[o,function(U){this.afternoon=p(U,!1)}],a:[o,function(U){this.afternoon=p(U,!0)}],Q:[i,function(U){this.month=3*(U-1)+1}],S:[i,function(U){this.milliseconds=100*+U}],SS:[a,function(U){this.milliseconds=10*+U}],SSS:[/\d{3}/,function(U){this.milliseconds=+U}],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(U){var y=l.ordinal,b=U.match(/\d+/);if(this.day=b[0],y)for(var v=1;v<=31;v+=1)y(v).replace(/\[|\]/g,"")===U&&(this.day=v)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(U){var y=f("months"),b=(f("monthsShort")||y.map((function(v){return v.slice(0,3)}))).indexOf(U)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[o,function(U){var y=f("months").indexOf(U)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(U){this.year=u(U)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(U){var y,b;y=U,b=l&&l.formats;for(var v=(U=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(A,R,_){var N=_&&_.toUpperCase();return R||b[_]||r[_]||b[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(L,I,P){return I||P.slice(1)}))}))).match(n),w=v.length,T=0;T-1)return new Date((D==="X"?1e3:1)*O);var z=m(D)(O),$=z.year,V=z.month,H=z.day,G=z.hours,K=z.minutes,W=z.seconds,oe=z.milliseconds,Z=z.zone,J=z.week,ne=new Date,ie=H||($||V?1:ne.getDate()),me=$||ne.getFullYear(),te=0;$&&!V||(te=V>0?V-1:ne.getMonth());var Re,Pe=G||0,Ve=K||0,ce=W||0,he=oe||0;return Z?new Date(Date.UTC(me,te,ie,Pe,Ve,ce,he+60*Z.offset*1e3)):B?new Date(Date.UTC(me,te,ie,Pe,Ve,ce,he)):(Re=new Date(me,te,ie,Pe,Ve,ce,he),J&&(Re=F(Re).week(J).toDate()),Re)}catch{return new Date("")}})(k,E,C,b),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),_&&k!=this.format(E)&&(this.$d=new Date("")),l={}}else if(E instanceof Array)for(var L=E.length,I=1;I<=L;I+=1){S[1]=E[I-1];var P=b.apply(this,S);if(P.isValid()){this.$d=P.$d,this.$L=P.$L,this.init();break}I===L&&(this.$d=new Date(""))}else w.call(this,T)}}}))})(KM)),KM.exports}var kmr=Cmr();const Smr=T1(kmr);var ZM={exports:{}},Emr=ZM.exports,I2e;function Amr(){return I2e||(I2e=1,(function(t,e){(function(r,n){t.exports=n()})(Emr,(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)}}}))})(ZM)),ZM.exports}var Mmr=Amr();const Rmr=T1(Mmr);var JM={exports:{}},Lmr=JM.exports,N2e;function Imr(){return N2e||(N2e=1,(function(t,e){(function(r,n){t.exports=n()})(Lmr,(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(k){return k instanceof w},g=function(k,C,S){return new w(k,S,C.$l)},m=function(k){return n.p(k)+"s"},U=function(k){return k<0},y=function(k){return U(k)?Math.ceil(k):Math.floor(k)},b=function(k){return Math.abs(k)},v=function(k,C){return k?U(k)?{negative:!0,format:""+b(k)+C}:{negative:!1,format:""+k+C}:{negative:!1,format:""}},w=(function(){function k(S,E,A){var R=this;if(this.$d={},this.$l=A,S===void 0&&(this.$ms=0,this.parseFromMilliseconds()),E)return g(S*f[m(E)],this);if(typeof S=="number")return this.$ms=S,this.parseFromMilliseconds(),this;if(typeof S=="object")return Object.keys(S).forEach((function(L){R.$d[m(L)]=S[L]})),this.calMilliseconds(),this;if(typeof S=="string"){var _=S.match(h);if(_){var N=_.slice(2).map((function(L){return L!=null?Number(L):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=k.prototype;return C.calMilliseconds=function(){var S=this;this.$ms=Object.keys(this.$d).reduce((function(E,A){return E+(S.$d[A]||0)*f[A]}),0)},C.parseFromMilliseconds=function(){var S=this.$ms;this.$d.years=y(S/l),S%=l,this.$d.months=y(S/u),S%=u,this.$d.days=y(S/o),S%=o,this.$d.hours=y(S/s),S%=s,this.$d.minutes=y(S/a),S%=a,this.$d.seconds=y(S/i),S%=i,this.$d.milliseconds=S},C.toISOString=function(){var S=v(this.$d.years,"Y"),E=v(this.$d.months,"M"),A=+this.$d.days||0;this.$d.weeks&&(A+=7*this.$d.weeks);var R=v(A,"D"),_=v(this.$d.hours,"H"),N=v(this.$d.minutes,"M"),L=this.$d.seconds||0;this.$d.milliseconds&&(L+=this.$d.milliseconds/1e3,L=Math.round(1e3*L)/1e3);var I=v(L,"S"),P=S.negative||E.negative||R.negative||_.negative||N.negative||I.negative,O=_.format||N.format||I.format?"T":"",D=(P?"-":"")+"P"+S.format+E.format+R.format+O+_.format+N.format+I.format;return D==="P"||D==="-P"?"P0D":D},C.toJSON=function(){return this.toISOString()},C.format=function(S){var E=S||"YYYY-MM-DDTHH:mm:ss",A={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 E.replace(d,(function(R,_){return _||String(A[R])}))},C.as=function(S){return this.$ms/f[m(S)]},C.get=function(S){var E=this.$ms,A=m(S);return A==="milliseconds"?E%=1e3:E=A==="weeks"?y(E/f[A]):this.$d[A],E||0},C.add=function(S,E,A){var R;return R=E?S*f[m(E)]:p(S)?S.$ms:g(S,this).$ms,g(this.$ms+R*(A?-1:1),this)},C.subtract=function(S,E){return this.add(S,E,!0)},C.locale=function(S){var E=this.clone();return E.$l=S,E},C.clone=function(){return g(this.$ms,this)},C.humanize=function(S){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!S)},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")},k})(),T=function(k,C,S){return k.add(C.years()*S,"y").add(C.months()*S,"M").add(C.days()*S,"d").add(C.hours()*S,"h").add(C.minutes()*S,"m").add(C.seconds()*S,"s").add(C.milliseconds()*S,"ms")};return function(k,C,S){r=S,n=S().$utils(),S.duration=function(R,_){var N=S.locale();return g(R,{$l:N},_)},S.isDuration=p;var E=C.prototype.add,A=C.prototype.subtract;C.prototype.add=function(R,_){return p(R)?T(this,R,1):E.bind(this)(R,_)},C.prototype.subtract=function(R,_){return p(R)?T(this,R,-1):A.bind(this)(R,_)}}}))})(JM)),JM.exports}var Nmr=Imr();const Dmr=T1(Nmr);var fK=(function(){var t=x(function(N,L,I,P){for(I=I||{},P=N.length;P--;I[N[P]]=L);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],U=[1,14],y=[1,15],b=[1,16],v=[1,19],w=[1,20],T=[1,21],k=[1,22],C=[1,23],S=[1,25],E=[1,35],A={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(L,I,P,O,D,B,F){var z=B.length-1;switch(D){case 1:return B[z-1];case 2:this.$=[];break;case 3:B[z-1].push(B[z]),this.$=B[z-1];break;case 4:case 5:this.$=B[z];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(B[z].substr(11)),this.$=B[z].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=B[z].substr(18);break;case 19:O.TopAxis(),this.$=B[z].substr(8);break;case 20:O.setAxisFormat(B[z].substr(11)),this.$=B[z].substr(11);break;case 21:O.setTickInterval(B[z].substr(13)),this.$=B[z].substr(13);break;case 22:O.setExcludes(B[z].substr(9)),this.$=B[z].substr(9);break;case 23:O.setIncludes(B[z].substr(9)),this.$=B[z].substr(9);break;case 24:O.setTodayMarker(B[z].substr(12)),this.$=B[z].substr(12);break;case 27:O.setDiagramTitle(B[z].substr(6)),this.$=B[z].substr(6);break;case 28:this.$=B[z].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=B[z].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(B[z].substr(8)),this.$=B[z].substr(8);break;case 33:O.addTask(B[z-1],B[z]),this.$="task";break;case 34:this.$=B[z-1],O.setClickEvent(B[z-1],B[z],null);break;case 35:this.$=B[z-2],O.setClickEvent(B[z-2],B[z-1],B[z]);break;case 36:this.$=B[z-2],O.setClickEvent(B[z-2],B[z-1],null),O.setLink(B[z-2],B[z]);break;case 37:this.$=B[z-3],O.setClickEvent(B[z-3],B[z-2],B[z-1]),O.setLink(B[z-3],B[z]);break;case 38:this.$=B[z-2],O.setClickEvent(B[z-2],B[z],null),O.setLink(B[z-2],B[z-1]);break;case 39:this.$=B[z-3],O.setClickEvent(B[z-3],B[z-1],B[z]),O.setLink(B[z-3],B[z-2]);break;case 40:this.$=B[z-1],O.setLink(B[z-1],B[z]);break;case 41:case 47:this.$=B[z-1]+" "+B[z];break;case 42:case 43:case 45:this.$=B[z-2]+" "+B[z-1]+" "+B[z];break;case 44:case 46:this.$=B[z-3]+" "+B[z-2]+" "+B[z-1]+" "+B[z];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:U,28:y,29:b,30:v,31:w,33:T,35:k,36:C,37:24,38:S,40:E},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:U,28:y,29:b,30:v,31:w,33:T,35:k,36:C,37:24,38:S,40:E},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(L,I){if(I.recoverable)this.trace(L);else{var P=new Error(L);throw P.hash=I,P}},"parseError"),parse:x(function(L){var I=this,P=[0],O=[],D=[null],B=[],F=this.table,z="",$=0,V=0,H=2,G=1,K=B.slice.call(arguments,1),W=Object.create(this.lexer),oe={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(oe.yy[Z]=this.yy[Z]);W.setInput(L,oe.yy),oe.yy.lexer=W,oe.yy.parser=this,typeof W.yylloc>"u"&&(W.yylloc={});var J=W.yylloc;B.push(J);var ne=W.options&&W.options.ranges;typeof oe.yy.parseError=="function"?this.parseError=oe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ie(Ee){P.length=P.length-2*Ee,D.length=D.length-Ee,B.length=B.length-Ee}x(ie,"popStack");function me(){var Ee;return Ee=O.pop()||W.lex()||G,typeof Ee!="number"&&(Ee instanceof Array&&(O=Ee,Ee=O.pop()),Ee=I.symbols_[Ee]||Ee),Ee}x(me,"lex");for(var te,Re,Pe,Ve,ce={},he,we,ge,ze;;){if(Re=P[P.length-1],this.defaultActions[Re]?Pe=this.defaultActions[Re]:((te===null||typeof te>"u")&&(te=me()),Pe=F[Re]&&F[Re][te]),typeof Pe>"u"||!Pe.length||!Pe[0]){var xe="";ze=[];for(he in F[Re])this.terminals_[he]&&he>H&&ze.push("'"+this.terminals_[he]+"'");W.showPosition?xe="Parse error on line "+($+1)+`: +`+W.showPosition()+` +Expecting `+ze.join(", ")+", got '"+(this.terminals_[te]||te)+"'":xe="Parse error on line "+($+1)+": Unexpected "+(te==G?"end of input":"'"+(this.terminals_[te]||te)+"'"),this.parseError(xe,{text:W.match,token:this.terminals_[te]||te,line:W.yylineno,loc:J,expected:ze})}if(Pe[0]instanceof Array&&Pe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Re+", token: "+te);switch(Pe[0]){case 1:P.push(te),D.push(W.yytext),B.push(W.yylloc),P.push(Pe[1]),te=null,V=W.yyleng,z=W.yytext,$=W.yylineno,J=W.yylloc;break;case 2:if(we=this.productions_[Pe[1]][1],ce.$=D[D.length-we],ce._$={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},ne&&(ce._$.range=[B[B.length-(we||1)].range[0],B[B.length-1].range[1]]),Ve=this.performAction.apply(ce,[z,V,$,oe.yy,Pe[1],D,B].concat(K)),typeof Ve<"u")return Ve;we&&(P=P.slice(0,-1*we*2),D=D.slice(0,-1*we),B=B.slice(0,-1*we)),P.push(this.productions_[Pe[1]][0]),D.push(ce.$),B.push(ce._$),ge=F[P[P.length-2]][P[P.length-1]],P.push(ge);break;case 3:return!0}}return!0},"parse")},R=(function(){var N={EOF:1,parseError:x(function(I,P){if(this.yy.parser)this.yy.parser.parseError(I,P);else throw new Error(I)},"parseError"),setInput:x(function(L,I){return this.yy=I||this.yy||{},this._input=L,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var I=L.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),L},"input"),unput:x(function(L){var I=L.length,P=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var D=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:P?(P.length===O.length?this.yylloc.first_column:0)+O[O.length-P.length].length-P[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-I]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(L){this.unput(this.match.slice(L))},"less"),pastInput:x(function(){var L=this.matched.substr(0,this.matched.length-this.match.length);return(L.length>20?"...":"")+L.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var L=this.match;return L.length<20&&(L+=this._input.substr(0,20-L.length)),(L.substr(0,20)+(L.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var L=this.pastInput(),I=new Array(L.length+1).join("-");return L+this.upcomingInput()+` +`+I+"^"},"showPosition"),test_match:x(function(L,I){var P,O,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),O=L[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],P=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var B in D)this[B]=D[B];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,I,P,O;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),B=0;BI[0].length)){if(I=P,O=B,this.options.backtrack_lexer){if(L=this.test_match(P,D[B]),L!==!1)return L;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(L=this.test_match(I,D[O]),L!==!1?L:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var I=this.next();return I||this.lex()},"lex"),begin:x(function(I){this.conditionStack.push(I)},"begin"),popState:x(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:x(function(I){this.begin(I)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(I,P,O,D){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return N})();A.lexer=R;function _(){this.yy={}}return x(_,"Parser"),_.prototype=A,A.Parser=_,new _})();fK.parser=fK;var Omr=fK;Qs.extend(wmr);Qs.extend(Smr);Qs.extend(Rmr);var D2e={friday:5,saturday:6},_d="",Lae="",Iae=void 0,Nae="",E4=[],A4=[],Dae=new Map,Oae=[],rD=[],M4="",_ae="",Dje=["active","done","crit","milestone","vert"],Pae=[],Zy="",tS=!1,Bae=!1,$ae="sunday",nD="saturday",pK=0,_mr=x(function(){Oae=[],rD=[],M4="",Pae=[],QM=0,mK=void 0,eR=void 0,ws=[],_d="",Lae="",_ae="",Iae=void 0,Nae="",E4=[],A4=[],tS=!1,Bae=!1,pK=0,Dae=new Map,Zy="",Oi(),$ae="sunday",nD="saturday"},"clear"),Pmr=x(function(t){Zy=t},"setDiagramId"),Bmr=x(function(t){Lae=t},"setAxisFormat"),$mr=x(function(){return Lae},"getAxisFormat"),Fmr=x(function(t){Iae=t},"setTickInterval"),zmr=x(function(){return Iae},"getTickInterval"),Vmr=x(function(t){Nae=t},"setTodayMarker"),Hmr=x(function(){return Nae},"getTodayMarker"),Gmr=x(function(t){_d=t},"setDateFormat"),Wmr=x(function(){tS=!0},"enableInclusiveEndDates"),qmr=x(function(){return tS},"endDatesAreInclusive"),jmr=x(function(){Bae=!0},"enableTopAxis"),Ymr=x(function(){return Bae},"topAxisEnabled"),Xmr=x(function(t){_ae=t},"setDisplayMode"),Kmr=x(function(){return _ae},"getDisplayMode"),Zmr=x(function(){return _d},"getDateFormat"),Oje=x((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Jmr=x(function(t){E4=Oje(E4,t)},"setIncludes"),Qmr=x(function(){return E4},"getIncludes"),eUr=x(function(t){A4=Oje(A4,t)},"setExcludes"),tUr=x(function(){return A4},"getExcludes"),rUr=x(function(){return Dae},"getLinks"),nUr=x(function(t){M4=t,Oae.push(t)},"addSection"),iUr=x(function(){return Oae},"getSections"),aUr=x(function(){let t=O2e();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"),gK=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=s2(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=Qs(r,e.trim(),!0);if(s.isValid())return s.toDate();{de.debug("Invalid date:"+r),de.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"),Bje=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),$je=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=s2(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),Dae.set(n,r))}),zje(t,"clickable")},"setLink"),zje=x(function(t,e){t.split(",").forEach(function(r){let n=s2(r);n!==void 0&&n.classes.push(e)})},"setClass"),gUr=x(function(t,e,r){if(He().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{Kr.runFunc(e,...n)})},"setClickFun"),Vje=x(function(t,e){Pae.push(function(){const r=Zy?`${Zy}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=Zy?`${Zy}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),mUr=x(function(t,e,r){t.split(",").forEach(function(n){gUr(n,e,r)}),zje(t,"clickable")},"setClickEvent"),UUr=x(function(t){Pae.forEach(function(e){e(t)})},"bindFunctions"),yUr={getConfig:x(()=>He().gantt,"getConfig"),clear:_mr,setDateFormat:Gmr,getDateFormat:Zmr,enableInclusiveEndDates:Wmr,endDatesAreInclusive:qmr,enableTopAxis:jmr,topAxisEnabled:Ymr,setAxisFormat:Bmr,getAxisFormat:$mr,setTickInterval:Fmr,getTickInterval:zmr,setTodayMarker:Vmr,getTodayMarker:Hmr,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,setDiagramId:Pmr,setDisplayMode:Xmr,getDisplayMode:Kmr,setAccDescription:aa,getAccDescription:sa,addSection:nUr,getSections:iUr,getTasks:aUr,addTask:dUr,findTaskById:s2,addTaskOrg:fUr,setIncludes:Jmr,getIncludes:Qmr,setExcludes:eUr,getExcludes:tUr,setClickEvent:mUr,setLink:pUr,getLinks:rUr,bindFunctions:UUr,parseDuration:Bje,isInvalidDate:_je,setWeekday:sUr,getWeekday:oUr,setWeekend:lUr};function Fae(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(Fae,"getTaskTags");Qs.extend(Dmr);var bUr=x(function(){de.debug("Something is calling, setConf, remove the call")},"setConf"),_2e={monday:hT,tuesday:Z9e,wednesday:J9e,thursday:JU,friday:Q9e,saturday:e3e,sunday:nk},vUr=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),_f,sH=1e4,xUr=x(function(t,e,r,n){const i=He().gantt;n.db.setDiagramId(e);const a=He().securityLevel;let s;a==="sandbox"&&(s=vt("#i"+e));const o=vt(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);_f=u.parentElement.offsetWidth,_f===void 0&&(_f=1200),i.useWidth!==void 0&&(_f=i.useWidth);const h=n.db.getTasks(),d=h.filter(A=>!A.vert);let f=[];for(const A of d)f.push(A.type);f=E(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const A={};for(const _ of d)A[_.section]===void 0?A[_.section]=[_]:A[_.section].push(_);let R=0;for(const _ of Object.keys(A)){const N=vUr(A[_],R)+1;R+=N,g+=N*(i.barHeight+i.barGap),p[_]=N}}else{g+=d.length*(i.barHeight+i.barGap);for(const A of f)p[A]=d.filter(R=>R.type===A).length}u.setAttribute("viewBox","0 0 "+_f+" "+g);const m=o.select(`[id="${e}"]`),U=r4t().domain([cyt(h,function(A){return A.startTime}),lyt(h,function(A){return A.endTime})]).rangeRound([0,_f-i.leftPadding-i.rightPadding]);function y(A,R){const _=A.startTime,N=R.startTime;let L=0;return _>N?L=1:_V.vert===H.vert?0:V.vert?1:-1);const O=A.filter(V=>!V.vert),B=[...new Set(O.map(V=>V.order))].map(V=>O.find(H=>H.order===V));m.append("g").selectAll("rect").data(B).enter().append("rect").attr("x",0).attr("y",function(V,H){return H=V.order,H*R+_-2}).attr("width",function(){return P-i.rightPadding/2}).attr("height",R).attr("class",function(V){for(const[H,G]of f.entries())if(V.type===G)return"section section"+H%i.numberSectionStyles;return"section section0"}).enter();const F=m.append("g").selectAll("rect").data(A).enter(),z=n.db.getLinks();if(F.append("rect").attr("id",function(V){return e+"-"+V.id}).attr("rx",3).attr("ry",3).attr("x",function(V){return V.milestone?U(V.startTime)+N+.5*(U(V.endTime)-U(V.startTime))-.5*L:U(V.startTime)+N}).attr("y",function(V,H){return H=V.order,V.vert?i.gridLineStartPadding:H*R+_}).attr("width",function(V){return V.milestone?L:V.vert?.08*L:U(V.renderEndTime||V.endTime)-U(V.startTime)}).attr("height",function(V){return V.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:L}).attr("transform-origin",function(V,H){return H=V.order,(U(V.startTime)+N+.5*(U(V.endTime)-U(V.startTime))).toString()+"px "+(H*R+_+.5*L).toString()+"px"}).attr("class",function(V){const H="task";let G="";V.classes.length>0&&(G=V.classes.join(" "));let K=0;for(const[oe,Z]of f.entries())V.type===Z&&(K=oe%i.numberSectionStyles);let W="";return V.active?V.crit?W+=" activeCrit":W=" active":V.done?V.crit?W=" doneCrit":W=" done":V.crit&&(W+=" crit"),W.length===0&&(W=" task"),V.milestone&&(W=" milestone "+W),V.vert&&(W=" vert "+W),W+=K,W+=" "+G,H+W}),F.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 H=U(V.startTime),G=U(V.renderEndTime||V.endTime);if(V.milestone&&(H+=.5*(U(V.endTime)-U(V.startTime))-.5*L,G=H+L),V.vert)return U(V.startTime)+N;const K=this.getBBox().width;return K>G-H?G+K+1.5*i.leftPadding>P?H+N-5:G+N+5:(G-H)/2+H+N}).attr("y",function(V,H){return V.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(H=V.order,H*R+i.barHeight/2+(i.fontSize/2-2)+_)}).attr("text-height",L).attr("class",function(V){const H=U(V.startTime);let G=U(V.endTime);V.milestone&&(G=H+L);const K=this.getBBox().width;let W="";V.classes.length>0&&(W=V.classes.join(" "));let oe=0;for(const[J,ne]of f.entries())V.type===ne&&(oe=J%i.numberSectionStyles);let Z="";return V.active&&(V.crit?Z="activeCritText"+oe:Z="activeText"+oe),V.done?V.crit?Z=Z+" doneCritText"+oe:Z=Z+" doneText"+oe:V.crit&&(Z=Z+" critText"+oe),V.milestone&&(Z+=" milestoneText"),V.vert&&(Z+=" vertText"),K>G-H?G+K+1.5*i.leftPadding>P?W+" taskTextOutsideLeft taskTextOutside"+oe+" "+Z:W+" taskTextOutsideRight taskTextOutside"+oe+" "+Z+" width-"+K:W+" taskText taskText"+oe+" "+Z+" width-"+K}),He().securityLevel==="sandbox"){let V;V=vt("#i"+e);const H=V.nodes()[0].contentDocument;F.filter(function(G){return z.has(G.id)}).each(function(G){var K=H.querySelector("#"+CSS.escape(e+"-"+G.id)),W=H.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const oe=K.parentNode;var Z=H.createElement("a");Z.setAttribute("xlink:href",z.get(G.id)),Z.setAttribute("target","_top"),oe.appendChild(Z),Z.appendChild(K),Z.appendChild(W)})}}x(v,"drawRects");function w(A,R,_,N,L,I,P,O){if(P.length===0&&O.length===0)return;let D,B;for(const{startTime:G,endTime:K}of I)(D===void 0||GB)&&(B=K);if(!D||!B)return;if(Qs(B).diff(Qs(D),"year")>5){de.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 F=n.db.getDateFormat(),z=[];let $=null,V=Qs(D);for(;V.valueOf()<=B;)n.db.isInvalidDate(V,F,P,O)?$?$.end=V:$={start:V,end:V}:$&&(z.push($),$=null),V=V.add(1,"d");m.append("g").selectAll("rect").data(z).enter().append("rect").attr("id",G=>e+"-exclude-"+G.start.format("YYYY-MM-DD")).attr("x",G=>U(G.start.startOf("day"))+_).attr("y",i.gridLineStartPadding).attr("width",G=>U(G.end.endOf("day"))-U(G.start.startOf("day"))).attr("height",L-R-i.gridLineStartPadding).attr("transform-origin",function(G,K){return(U(G.start)+_+.5*(U(G.end)-U(G.start))).toString()+"px "+(K*A+.5*L).toString()+"px"}).attr("class","exclude-range")}x(w,"drawExcludeDays");function T(A,R,_,N){if(_<=0||A>R)return 1/0;const L=R-A,I=Qs.duration({[N??"day"]:_}).asMilliseconds();return I<=0?1/0:Math.ceil(L/I)}x(T,"getEstimatedTickCount");function k(A,R,_,N){const L=n.db.getDateFormat(),I=n.db.getAxisFormat();let P;I?P=I:L==="D"?P="%d":P=i.axisFormat??"%Y-%m-%d";let O=yyt(U).tickSize(-N+R+i.gridLineStartPadding).tickFormat(aL(P));const B=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(B!==null){const F=parseInt(B[1],10);if(isNaN(F)||F<=0)de.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const z=B[2],$=n.db.getWeekday()||i.weekday,V=U.domain(),H=V[0],G=V[1],K=T(H,G,F,z);if(K>sH)de.warn(`The tick interval "${F}${z}" would generate ${K} ticks, which exceeds the maximum allowed (${sH}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(z){case"millisecond":O.ticks(zv.every(F));break;case"second":O.ticks(cg.every(F));break;case"minute":O.ticks(cT.every(F));break;case"hour":O.ticks(uT.every(F));break;case"day":O.ticks(ZU.every(F));break;case"week":O.ticks(_2e[$].every(F));break;case"month":O.ticks(dT.every(F));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+A+", "+(N-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let F=Uyt(U).tickSize(-N+R+i.gridLineStartPadding).tickFormat(aL(P));if(B!==null){const z=parseInt(B[1],10);if(isNaN(z)||z<=0)de.warn(`Invalid tick interval value: "${B[1]}". Skipping custom tick interval.`);else{const $=B[2],V=n.db.getWeekday()||i.weekday,H=U.domain(),G=H[0],K=H[1];if(T(G,K,z,$)<=sH)switch($){case"millisecond":F.ticks(zv.every(z));break;case"second":F.ticks(cg.every(z));break;case"minute":F.ticks(cT.every(z));break;case"hour":F.ticks(uT.every(z));break;case"day":F.ticks(ZU.every(z));break;case"week":F.ticks(_2e[V].every(z));break;case"month":F.ticks(dT.every(z));break}}}m.append("g").attr("class","grid").attr("transform","translate("+A+", "+R+")").call(F).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(k,"makeGrid");function C(A,R){let _=0;const N=Object.keys(p).map(L=>[L,p[L]]);m.append("g").selectAll("text").data(N).enter().append(function(L){const I=L[0].split(Ht.lineBreakRegex),P=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",P+"em");for(const[D,B]of I.entries()){const F=l.createElementNS("http://www.w3.org/2000/svg","tspan");F.setAttribute("alignment-baseline","central"),F.setAttribute("x","10"),D>0&&F.setAttribute("dy","1em"),F.textContent=B,O.appendChild(F)}return O}).attr("x",10).attr("y",function(L,I){if(I>0)for(let P=0;P` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -4238,8 +4371,8 @@ Expecting `+ze.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),tyr=eyr,ryr={parser:d1r,db:X1r,renderer:J1r,styles:tyr};const nyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ryr},Symbol.toStringTag,{value:"Module"}));var iyr={parse:w(async t=>{const e=await Ju("info",t);de.debug(e)},"parse")},syr={version:"11.16.1"},ayr=w(()=>syr.version,"getVersion"),oyr={getVersion:ayr},lyr=w((t,e,r)=>{de.debug(`rendering info diagram -`+t);const n=al(e);qs(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"),cyr={draw:lyr},uyr={parser:iyr,db:oyr,renderer:cyr};const hyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:uyr},Symbol.toStringTag,{value:"Module"}));var dyr=En.pie,Nse={sections:new Map,showData:!1},tO=Nse.sections,Ose=Nse.showData,fyr=structuredClone(dyr),pyr=w(()=>structuredClone(fyr),"getConfig"),gyr=w(()=>{tO=new Map,Ose=Nse.showData,Oi()},"clear"),myr=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.`);tO.has(t)||(tO.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),yyr=w(()=>tO,"getSections"),vyr=w(t=>{Ose=t},"setShowData"),byr=w(()=>Ose,"getShowData"),_je={getConfig:pyr,clear:gyr,setDiagramTitle:ts,getDiagramTitle:ji,setAccTitle:qi,getAccTitle:ns,setAccDescription:is,getAccDescription:ss,addSection:myr,getSections:yyr,setShowData:vyr,getShowData:byr},xyr=w((t,e)=>{ec(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),wyr={parse:w(async t=>{const e=await Ju("pie",t);de.debug(e),xyr(e,_je)},"parse")},Tyr=w(t=>` +`,"getStyles"),CUr=TUr,kUr={parser:Omr,db:yUr,renderer:wUr,styles:CUr};const SUr=Object.freeze(Object.defineProperty({__proto__:null,diagram:kUr},Symbol.toStringTag,{value:"Module"}));var EUr={parse:x(async t=>{const e=await Qu("info",t);de.debug(e)},"parse")},AUr={version:"11.16.1"},MUr=x(()=>AUr.version,"getVersion"),RUr={getVersion:MUr},LUr=x((t,e,r)=>{de.debug(`rendering info diagram +`+t);const n=sl(e);Ga(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"),IUr={draw:LUr},NUr={parser:EUr,db:RUr,renderer:IUr};const DUr=Object.freeze(Object.defineProperty({__proto__:null,diagram:NUr},Symbol.toStringTag,{value:"Module"}));var OUr=An.pie,zae={sections:new Map,showData:!1},iD=zae.sections,Vae=zae.showData,_Ur=structuredClone(OUr),PUr=x(()=>structuredClone(_Ur),"getConfig"),BUr=x(()=>{iD=new Map,Vae=zae.showData,Oi()},"clear"),$Ur=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);iD.has(t)||(iD.set(t,e),de.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),FUr=x(()=>iD,"getSections"),zUr=x(t=>{Vae=t},"setShowData"),VUr=x(()=>Vae,"getShowData"),Hje={getConfig:PUr,clear:BUr,setDiagramTitle:ra,getDiagramTitle:Yi,setAccTitle:qi,getAccTitle:ia,setAccDescription:aa,getAccDescription:sa,addSection:$Ur,getSections:FUr,setShowData:zUr,getShowData:VUr},HUr=x((t,e)=>{ec(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),GUr={parse:x(async t=>{const e=await Qu("pie",t);de.debug(e),HUr(e,Hje)},"parse")},WUr=x(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -4276,37 +4409,37 @@ Expecting `+ze.join(", ")+", got '"+(this.terminals_[te]||te)+"'":we="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),Cyr=Tyr,kyr=w(t=>{const e=[...t.values()].reduce((i,s)=>i+s,0),r=[...t.entries()].map(([i,s])=>({label:i,value:s})).filter(i=>i.value/e*100>=1);return H5t().value(i=>i.value).sort(null)(r)},"createPieArcs"),Syr=w((t,e,r,n)=>{var q;de.debug(`rendering pie chart -`+t);const i=n.db,s=He(),a=rs(i.getConfig(),s.pie),o=40,l=18,u=4,h=450,d=h,f=al(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=s;let[m]=np(g.pieOuterStrokeWidth);m??(m=2);const y=a.legendPosition,v=a.textPosition,b=a.donutHole>0&&a.donutHole<=.9?a.donutHole:0,x=Math.min(d,h)/2-o,T=F5().innerRadius(b*x).outerRadius(x),C=F5().innerRadius(x*v).outerRadius(x*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",x+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=kyr(k),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;k.forEach(oe=>{M+=oe});const R=E.filter(oe=>(oe.data.value/M*100).toFixed(0)!=="0"),P=Ey(A).domain([...k.keys()]);S.selectAll("mySlices").data(R).enter().append("path").attr("d",T).attr("fill",oe=>P(oe.data.label)).attr("class",oe=>{let Z="pieCircle";return a.highlightSlice==="hover"?Z+=" highlightedOnHover":a.highlightSlice===oe.data.label&&(Z+=" highlighted"),Z}),S.selectAll("mySlices").data(R).enter().append("text").text(oe=>(oe.data.value/M*100).toFixed(0)+"%").attr("transform",oe=>"translate("+C.centroid(oe)+")").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"),L=[...k.entries()].map(([oe,Z])=>({label:oe,value:Z})),I=p.selectAll(".legend").data(L).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",oe=>P(oe.label)).style("stroke",oe=>P(oe.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(oe=>i.getShowData()?`${oe.label} [${oe.value}]`:oe.label);const $=Math.max(...I.selectAll("text").nodes().map(oe=>(oe==null?void 0:oe.getBoundingClientRect().width)??0));let O=h,D=d+o;const B=l+u,z=L.length*B;switch(y){case"center":I.attr("transform",(oe,Z)=>{const Q=B*L.length/2,ne=-$/2-(l+u),ie=Z*B-Q;return"translate("+ne+","+ie+")"});break;case"top":O+=z,I.attr("transform",(oe,Z)=>{const Q=x,ne=-$/2-(l+u),ie=Z*B-Q;return`translate(${ne}, ${ie})`}),S.attr("transform",()=>`translate(0, ${z+B})`);break;case"bottom":O+=z,I.attr("transform",(oe,Z)=>{const Q=-x-B,ne=-$/2-(l+u),ie=Z*B-Q;return"translate("+ne+","+ie+")"});break;case"left":D+=l+u+$,I.attr("transform",(oe,Z)=>{const Q=B*L.length/2,ne=-x-(l+u),ie=Z*B-Q;return"translate("+ne+","+ie+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:D+=l+u+$,I.attr("transform",(oe,Z)=>{const Q=B*L.length/2,ne=12*l,ie=Z*B-Q;return"translate("+ne+","+ie+")"});break}const V=((q=N.node())==null?void 0:q.getBoundingClientRect().width)??0,F=d/2-V/2,H=d/2+V/2,G=Math.min(0,F),K=Math.max(D,H)-G;f.attr("viewBox",`${G} 0 ${K} ${O}`),qs(f,O,K,a.useMaxWidth)},"draw"),Eyr={draw:Syr},Ayr={parser:wyr,db:_je,renderer:Eyr,styles:Cyr};const Myr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ayr},Symbol.toStringTag,{value:"Module"}));var uK=(function(){var t=w(function(X,fe,ee,Me){for(ee=ee||{},Me=X.length;Me--;ee[X[Me]]=fe);return ee},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[1,7],a=[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],b=[1,23],x=[1,18],T=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],A=[1,25],M=[1,26],R=[1,27],P=[1,28],N=[1,29],L=[1,32],I=[1,33],$=[1,34],O=[1,39],D=[1,40],B=[1,42],z=[1,44],V=[1,63],F=[1,62],H=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],G=[1,66],W=[1,67],K=[1,68],q=[1,69],oe=[1,70],Z=[1,71],Q=[1,72],ne=[1,73],ie=[1,74],me=[1,75],te=[1,76],_e=[1,77],$e=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ve=[1,91],ce=[1,92],he=[1,93],Te=[1,100],ge=[1,94],ze=[1,97],we=[1,95],Ae=[1,96],qe=[1,98],le=[1,99],pe=[1,103],Ce=[10,55,56,57],re=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Y={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(fe,ee,Me,Re,Ke,Ne,je){var Oe=Ne.length-1;switch(Ke){case 23:this.$=Ne[Oe];break;case 24:this.$=Ne[Oe-1]+""+Ne[Oe];break;case 26:this.$=Ne[Oe-1]+Ne[Oe];break;case 27:this.$=[Ne[Oe].trim()];break;case 28:Ne[Oe-2].push(Ne[Oe].trim()),this.$=Ne[Oe-2];break;case 29:this.$=Ne[Oe-4],Re.addClass(Ne[Oe-2],Ne[Oe]);break;case 37:this.$=[];break;case 42:this.$=Ne[Oe].trim(),Re.setDiagramTitle(this.$);break;case 43:this.$=Ne[Oe].trim(),Re.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[Oe].trim(),Re.setAccDescription(this.$);break;case 46:Re.addSection(Ne[Oe].substr(8)),this.$=Ne[Oe].substr(8);break;case 47:Re.addPoint(Ne[Oe-3],"",Ne[Oe-1],Ne[Oe],[]);break;case 48:Re.addPoint(Ne[Oe-4],Ne[Oe-3],Ne[Oe-1],Ne[Oe],[]);break;case 49:Re.addPoint(Ne[Oe-4],"",Ne[Oe-2],Ne[Oe-1],Ne[Oe]);break;case 50:Re.addPoint(Ne[Oe-5],Ne[Oe-4],Ne[Oe-2],Ne[Oe-1],Ne[Oe]);break;case 51:Re.setXAxisLeftText(Ne[Oe-2]),Re.setXAxisRightText(Ne[Oe]);break;case 52:Ne[Oe-1].text+=" ⟶ ",Re.setXAxisLeftText(Ne[Oe-1]);break;case 53:Re.setXAxisLeftText(Ne[Oe]);break;case 54:Re.setYAxisBottomText(Ne[Oe-2]),Re.setYAxisTopText(Ne[Oe]);break;case 55:Ne[Oe-1].text+=" ⟶ ",Re.setYAxisBottomText(Ne[Oe-1]);break;case 56:Re.setYAxisBottomText(Ne[Oe]);break;case 57:Re.setQuadrant1Text(Ne[Oe]);break;case 58:Re.setQuadrant2Text(Ne[Oe]);break;case 59:Re.setQuadrant3Text(Ne[Oe]);break;case 60:Re.setQuadrant4Text(Ne[Oe]);break;case 64:this.$={text:Ne[Oe],type:"text"};break;case 65:this.$={text:Ne[Oe-1].text+""+Ne[Oe],type:Ne[Oe-1].type};break;case 66:this.$={text:Ne[Oe],type:"text"};break;case 67:this.$={text:Ne[Oe],type:"markdown"};break;case 68:this.$=Ne[Oe];break;case 69:this.$=Ne[Oe-1]+""+Ne[Oe];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:s},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:s},{18:e,26:9,27:2,28:r,55:n,56:i,57:s},t(a,[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:b,35:x,37:T,39:C,41:S,42:k,48:E,50:A,51:M,52:R,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:B,67:z}),t(a,[2,34]),{27:46,55:n,56:i,57:s},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:b,35:x,37:T,39:C,41:S,42:k,48:E,50:A,51:M,52:R,53:P,54:N,60:L,61:I,63:$,64:O,65:D,66:B,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:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:L,61:I,63:$,64:O,65:D,66:B,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:D,66:B,67:z},t(H,[2,64]),t(H,[2,66]),t(H,[2,67]),t(H,[2,70]),t(H,[2,71]),t(H,[2,72]),t(H,[2,73]),t(H,[2,74]),t(H,[2,75]),t(H,[2,76]),t(H,[2,77]),t(H,[2,78]),t(H,[2,79]),t(H,[2,80]),t(H,[2,81]),t(a,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:G,5:W,6:K,7:q,8:oe,9:Z,10:Q,11:ne,12:ie,13:me,14:te,15:_e,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,49:[1,78],63:$,64:O,65:D,66:B,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,49:[1,79],63:$,64:O,65:D,66:B,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),{45:[1,80]},{44:[1,81]},t(H,[2,65]),t(H,[2,82]),t(H,[2,83]),t(H,[2,84]),{3:83,4:G,5:W,6:K,7:q,8:oe,9:Z,10:Q,11:ne,12:ie,13:me,14:te,15:_e,18:[1,82]},t($e,[2,23]),t($e,[2,1]),t($e,[2,2]),t($e,[2,3]),t($e,[2,4]),t($e,[2,5]),t($e,[2,6]),t($e,[2,7]),t($e,[2,8]),t($e,[2,9]),t($e,[2,10]),t($e,[2,11]),t($e,[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:L,61:I,63:$,64:O,65:D,66:B,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:L,61:I,63:$,64:O,65:D,66:B,67:z}),{46:[1,86]},{45:[1,87]},{4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,16:90,17:we,18:Ae,19:qe,20:le,22:89,23:88},t($e,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:F,63:$,64:O,65:D,66:B,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,17:we,18:Ae,19:qe,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Ce,[2,27],{16:104,4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,17:we,18:Ae,19:qe,20:le}),t(re,[2,25]),t(re,[2,13]),t(re,[2,14]),t(re,[2,15]),t(re,[2,16]),t(re,[2,17]),t(re,[2,18]),t(re,[2,19]),t(re,[2,20]),t(re,[2,21]),t(re,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,17:we,18:Ae,19:qe,20:le}),{4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,16:90,17:we,18:Ae,19:qe,20:le,22:106},t(re,[2,26]),t(l,[2,50],{10:pe}),t(Ce,[2,28],{16:104,4:Ve,5:ce,6:he,8:Te,11:ge,13:ze,17:we,18:Ae,19:qe,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:w(function(fe,ee){if(ee.recoverable)this.trace(fe);else{var Me=new Error(fe);throw Me.hash=ee,Me}},"parseError"),parse:w(function(fe){var ee=this,Me=[0],Re=[],Ke=[null],Ne=[],je=this.table,Oe="",Ze=0,Fe=0,st=2,Pe=1,gt=Ne.slice.call(arguments,1),Le=Object.create(this.lexer),kt={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(kt.yy[Et]=this.yy[Et]);Le.setInput(fe,kt.yy),kt.yy.lexer=Le,kt.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var ot=Le.yylloc;Ne.push(ot);var Ht=Le.options&&Le.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _t(nr){Me.length=Me.length-2*nr,Ke.length=Ke.length-nr,Ne.length=Ne.length-nr}w(_t,"popStack");function dt(){var nr;return nr=Re.pop()||Le.lex()||Pe,typeof nr!="number"&&(nr instanceof Array&&(Re=nr,nr=Re.pop()),nr=ee.symbols_[nr]||nr),nr}w(dt,"lex");for(var xe,Lt,wt,mt,Mt={},Or,Ee,it,pt;;){if(Lt=Me[Me.length-1],this.defaultActions[Lt]?wt=this.defaultActions[Lt]:((xe===null||typeof xe>"u")&&(xe=dt()),wt=je[Lt]&&je[Lt][xe]),typeof wt>"u"||!wt.length||!wt[0]){var bt="";pt=[];for(Or in je[Lt])this.terminals_[Or]&&Or>st&&pt.push("'"+this.terminals_[Or]+"'");Le.showPosition?bt="Parse error on line "+(Ze+1)+`: +`,"getStyles"),qUr=WUr,jUr=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return U4t().value(i=>i.value).sort(null)(r)},"createPieArcs"),YUr=x((t,e,r,n)=>{var W;de.debug(`rendering pie chart +`+t);const i=n.db,a=He(),s=na(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=sl(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=ip(g.pieOuterStrokeWidth);m??(m=2);const U=s.legendPosition,y=s.textPosition,b=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,v=Math.min(d,h)/2-o,w=Hv().innerRadius(b*v).outerRadius(v),T=Hv().innerRadius(v*y).outerRadius(v*y),k=p.append("g");k.append("circle").attr("cx",0).attr("cy",0).attr("r",v+m/2).attr("class","pieOuterCircle");const C=i.getSections(),S=jUr(C),E=[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 A=0;C.forEach(oe=>{A+=oe});const R=S.filter(oe=>(oe.data.value/A*100).toFixed(0)!=="0"),_=MU(E).domain([...C.keys()]);k.selectAll("mySlices").data(R).enter().append("path").attr("d",w).attr("fill",oe=>_(oe.data.label)).attr("class",oe=>{let Z="pieCircle";return s.highlightSlice==="hover"?Z+=" highlightedOnHover":s.highlightSlice===oe.data.label&&(Z+=" highlighted"),Z}),k.selectAll("mySlices").data(R).enter().append("text").text(oe=>(oe.data.value/A*100).toFixed(0)+"%").attr("transform",oe=>"translate("+T.centroid(oe)+")").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"),L=[...C.entries()].map(([oe,Z])=>({label:oe,value:Z})),I=p.selectAll(".legend").data(L).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",oe=>_(oe.label)).style("stroke",oe=>_(oe.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(oe=>i.getShowData()?`${oe.label} [${oe.value}]`:oe.label);const P=Math.max(...I.selectAll("text").nodes().map(oe=>(oe==null?void 0:oe.getBoundingClientRect().width)??0));let O=h,D=d+o;const B=l+u,F=L.length*B;switch(U){case"center":I.attr("transform",(oe,Z)=>{const J=B*L.length/2,ne=-P/2-(l+u),ie=Z*B-J;return"translate("+ne+","+ie+")"});break;case"top":O+=F,I.attr("transform",(oe,Z)=>{const J=v,ne=-P/2-(l+u),ie=Z*B-J;return`translate(${ne}, ${ie})`}),k.attr("transform",()=>`translate(0, ${F+B})`);break;case"bottom":O+=F,I.attr("transform",(oe,Z)=>{const J=-v-B,ne=-P/2-(l+u),ie=Z*B-J;return"translate("+ne+","+ie+")"});break;case"left":D+=l+u+P,I.attr("transform",(oe,Z)=>{const J=B*L.length/2,ne=-v-(l+u),ie=Z*B-J;return"translate("+ne+","+ie+")"}),k.attr("transform",()=>`translate(${P+l+u}, 0)`);break;case"right":default:D+=l+u+P,I.attr("transform",(oe,Z)=>{const J=B*L.length/2,ne=12*l,ie=Z*B-J;return"translate("+ne+","+ie+")"});break}const z=((W=N.node())==null?void 0:W.getBoundingClientRect().width)??0,$=d/2-z/2,V=d/2+z/2,H=Math.min(0,$),K=Math.max(D,V)-H;f.attr("viewBox",`${H} 0 ${K} ${O}`),Ga(f,O,K,s.useMaxWidth)},"draw"),XUr={draw:YUr},KUr={parser:GUr,db:Hje,renderer:XUr,styles:qUr};const ZUr=Object.freeze(Object.defineProperty({__proto__:null,diagram:KUr},Symbol.toStringTag,{value:"Module"}));var UK=(function(){var t=x(function(X,fe,ee,Ae){for(ee=ee||{},Ae=X.length;Ae--;ee[X[Ae]]=fe);return ee},"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],U=[1,45],y=[1,14],b=[1,23],v=[1,18],w=[1,19],T=[1,20],k=[1,21],C=[1,22],S=[1,24],E=[1,25],A=[1,26],R=[1,27],_=[1,28],N=[1,29],L=[1,32],I=[1,33],P=[1,34],O=[1,39],D=[1,40],B=[1,42],F=[1,44],z=[1,63],$=[1,62],V=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],H=[1,66],G=[1,67],K=[1,68],W=[1,69],oe=[1,70],Z=[1,71],J=[1,72],ne=[1,73],ie=[1,74],me=[1,75],te=[1,76],Re=[1,77],Pe=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ve=[1,91],ce=[1,92],he=[1,93],we=[1,100],ge=[1,94],ze=[1,97],xe=[1,95],Ee=[1,96],qe=[1,98],le=[1,99],pe=[1,103],Te=[10,55,56,57],re=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(fe,ee,Ae,Me,Ke,Ne,je){var De=Ne.length-1;switch(Ke){case 23:this.$=Ne[De];break;case 24:this.$=Ne[De-1]+""+Ne[De];break;case 26:this.$=Ne[De-1]+Ne[De];break;case 27:this.$=[Ne[De].trim()];break;case 28:Ne[De-2].push(Ne[De].trim()),this.$=Ne[De-2];break;case 29:this.$=Ne[De-4],Me.addClass(Ne[De-2],Ne[De]);break;case 37:this.$=[];break;case 42:this.$=Ne[De].trim(),Me.setDiagramTitle(this.$);break;case 43:this.$=Ne[De].trim(),Me.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[De].trim(),Me.setAccDescription(this.$);break;case 46:Me.addSection(Ne[De].substr(8)),this.$=Ne[De].substr(8);break;case 47:Me.addPoint(Ne[De-3],"",Ne[De-1],Ne[De],[]);break;case 48:Me.addPoint(Ne[De-4],Ne[De-3],Ne[De-1],Ne[De],[]);break;case 49:Me.addPoint(Ne[De-4],"",Ne[De-2],Ne[De-1],Ne[De]);break;case 50:Me.addPoint(Ne[De-5],Ne[De-4],Ne[De-2],Ne[De-1],Ne[De]);break;case 51:Me.setXAxisLeftText(Ne[De-2]),Me.setXAxisRightText(Ne[De]);break;case 52:Ne[De-1].text+=" ⟶ ",Me.setXAxisLeftText(Ne[De-1]);break;case 53:Me.setXAxisLeftText(Ne[De]);break;case 54:Me.setYAxisBottomText(Ne[De-2]),Me.setYAxisTopText(Ne[De]);break;case 55:Ne[De-1].text+=" ⟶ ",Me.setYAxisBottomText(Ne[De-1]);break;case 56:Me.setYAxisBottomText(Ne[De]);break;case 57:Me.setQuadrant1Text(Ne[De]);break;case 58:Me.setQuadrant2Text(Ne[De]);break;case 59:Me.setQuadrant3Text(Ne[De]);break;case 60:Me.setQuadrant4Text(Ne[De]);break;case 64:this.$={text:Ne[De],type:"text"};break;case 65:this.$={text:Ne[De-1].text+""+Ne[De],type:Ne[De-1].type};break;case 66:this.$={text:Ne[De],type:"text"};break;case 67:this.$={text:Ne[De],type:"markdown"};break;case 68:this.$=Ne[De];break;case 69:this.$=Ne[De-1]+""+Ne[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:U,18:y,25:b,35:v,37:w,39:T,41:k,42:C,48:S,50:E,51:A,52:R,53:_,54:N,60:L,61:I,63:P,64:O,65:D,66:B,67:F}),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:U,18:y,25:b,35:v,37:w,39:T,41:k,42:C,48:S,50:E,51:A,52:R,53:_,54:N,60:L,61:I,63:P,64:O,65:D,66:B,67:F}),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:U,43:52,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:U,43:53,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:U,43:54,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:U,43:55,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:U,43:56,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,10:f,12:p,13:g,14:m,15:U,43:57,58:31,60:L,61:I,63:P,64:O,65:D,66:B,67:F},{4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,44:[1,58],47:[1,59],58:61,59:60,63:P,64:O,65:D,66:B,67:F},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:H,5:G,6:K,7:W,8:oe,9:Z,10:J,11:ne,12:ie,13:me,14:te,15:Re,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,49:[1,78],63:P,64:O,65:D,66:B,67:F}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,49:[1,79],63:P,64:O,65:D,66:B,67:F}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),{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:H,5:G,6:K,7:W,8:oe,9:Z,10:J,11:ne,12:ie,13:me,14:te,15:Re,18:[1,82]},t(Pe,[2,23]),t(Pe,[2,1]),t(Pe,[2,2]),t(Pe,[2,3]),t(Pe,[2,4]),t(Pe,[2,5]),t(Pe,[2,6]),t(Pe,[2,7]),t(Pe,[2,8]),t(Pe,[2,9]),t(Pe,[2,10]),t(Pe,[2,11]),t(Pe,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:U,60:L,61:I,63:P,64:O,65:D,66:B,67:F}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:U,60:L,61:I,63:P,64:O,65:D,66:B,67:F}),{46:[1,86]},{45:[1,87]},{4:Ve,5:ce,6:he,8:we,11:ge,13:ze,16:90,17:xe,18:Ee,19:qe,20:le,22:89,23:88},t(Pe,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:z,10:f,12:p,13:g,14:m,15:U,18:$,63:P,64:O,65:D,66:B,67:F}),t(l,[2,47],{22:89,16:90,23:101,4:Ve,5:ce,6:he,8:we,11:ge,13:ze,17:xe,18:Ee,19:qe,20:le}),{46:[1,102]},t(l,[2,29],{10:pe}),t(Te,[2,27],{16:104,4:Ve,5:ce,6:he,8:we,11:ge,13:ze,17:xe,18:Ee,19:qe,20:le}),t(re,[2,25]),t(re,[2,13]),t(re,[2,14]),t(re,[2,15]),t(re,[2,16]),t(re,[2,17]),t(re,[2,18]),t(re,[2,19]),t(re,[2,20]),t(re,[2,21]),t(re,[2,22]),t(l,[2,49],{10:pe}),t(l,[2,48],{22:89,16:90,23:105,4:Ve,5:ce,6:he,8:we,11:ge,13:ze,17:xe,18:Ee,19:qe,20:le}),{4:Ve,5:ce,6:he,8:we,11:ge,13:ze,16:90,17:xe,18:Ee,19:qe,20:le,22:106},t(re,[2,26]),t(l,[2,50],{10:pe}),t(Te,[2,28],{16:104,4:Ve,5:ce,6:he,8:we,11:ge,13:ze,17:xe,18:Ee,19:qe,20:le})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(fe,ee){if(ee.recoverable)this.trace(fe);else{var Ae=new Error(fe);throw Ae.hash=ee,Ae}},"parseError"),parse:x(function(fe){var ee=this,Ae=[0],Me=[],Ke=[null],Ne=[],je=this.table,De="",Ze=0,Fe=0,at=2,_e=1,gt=Ne.slice.call(arguments,1),Le=Object.create(this.lexer),kt={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(kt.yy[Et]=this.yy[Et]);Le.setInput(fe,kt.yy),kt.yy.lexer=Le,kt.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var ot=Le.yylloc;Ne.push(ot);var Vt=Le.options&&Le.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Lt(ir){Ae.length=Ae.length-2*ir,Ke.length=Ke.length-ir,Ne.length=Ne.length-ir}x(Lt,"popStack");function dt(){var ir;return ir=Me.pop()||Le.lex()||_e,typeof ir!="number"&&(ir instanceof Array&&(Me=ir,ir=Me.pop()),ir=ee.symbols_[ir]||ir),ir}x(dt,"lex");for(var ve,It,xt,mt,Mt={},Or,Se,it,pt;;){if(It=Ae[Ae.length-1],this.defaultActions[It]?xt=this.defaultActions[It]:((ve===null||typeof ve>"u")&&(ve=dt()),xt=je[It]&&je[It][ve]),typeof xt>"u"||!xt.length||!xt[0]){var bt="";pt=[];for(Or in je[It])this.terminals_[Or]&&Or>at&&pt.push("'"+this.terminals_[Or]+"'");Le.showPosition?bt="Parse error on line "+(Ze+1)+`: `+Le.showPosition()+` -Expecting `+pt.join(", ")+", got '"+(this.terminals_[xe]||xe)+"'":bt="Parse error on line "+(Ze+1)+": Unexpected "+(xe==Pe?"end of input":"'"+(this.terminals_[xe]||xe)+"'"),this.parseError(bt,{text:Le.match,token:this.terminals_[xe]||xe,line:Le.yylineno,loc:ot,expected:pt})}if(wt[0]instanceof Array&&wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Lt+", token: "+xe);switch(wt[0]){case 1:Me.push(xe),Ke.push(Le.yytext),Ne.push(Le.yylloc),Me.push(wt[1]),xe=null,Fe=Le.yyleng,Oe=Le.yytext,Ze=Le.yylineno,ot=Le.yylloc;break;case 2:if(Ee=this.productions_[wt[1]][1],Mt.$=Ke[Ke.length-Ee],Mt._$={first_line:Ne[Ne.length-(Ee||1)].first_line,last_line:Ne[Ne.length-1].last_line,first_column:Ne[Ne.length-(Ee||1)].first_column,last_column:Ne[Ne.length-1].last_column},Ht&&(Mt._$.range=[Ne[Ne.length-(Ee||1)].range[0],Ne[Ne.length-1].range[1]]),mt=this.performAction.apply(Mt,[Oe,Fe,Ze,kt.yy,wt[1],Ke,Ne].concat(gt)),typeof mt<"u")return mt;Ee&&(Me=Me.slice(0,-1*Ee*2),Ke=Ke.slice(0,-1*Ee),Ne=Ne.slice(0,-1*Ee)),Me.push(this.productions_[wt[1]][0]),Ke.push(Mt.$),Ne.push(Mt._$),it=je[Me[Me.length-2]][Me[Me.length-1]],Me.push(it);break;case 3:return!0}}return!0},"parse")},J=(function(){var X={EOF:1,parseError:w(function(ee,Me){if(this.yy.parser)this.yy.parser.parseError(ee,Me);else throw new Error(ee)},"parseError"),setInput:w(function(fe,ee){return this.yy=ee||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 ee=fe.match(/(?:\r\n?|\n).*/g);return ee?(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 ee=fe.length,Me=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ee),this.offset-=ee;var Re=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),Me.length-1&&(this.yylineno-=Me.length-1);var Ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Me?(Me.length===Re.length?this.yylloc.first_column:0)+Re[Re.length-Me.length].length-Me[0].length:this.yylloc.first_column-ee},this.options.ranges&&(this.yylloc.range=[Ke[0],Ke[0]+this.yyleng-ee]),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(),ee=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+` -`+ee+"^"},"showPosition"),test_match:w(function(fe,ee){var Me,Re,Ke;if(this.options.backtrack_lexer&&(Ke={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ke.yylloc.range=this.yylloc.range.slice(0))),Re=fe[0].match(/(?:\r\n?|\n).*/g),Re&&(this.yylineno+=Re.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Re?Re[Re.length-1].length-Re[Re.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],Me=this.performAction.call(this,this.yy,this,ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Me)return Me;if(this._backtrack){for(var Ne in Ke)this[Ne]=Ke[Ne];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,ee,Me,Re;this._more||(this.yytext="",this.match="");for(var Ke=this._currentRules(),Ne=0;Neee[0].length)){if(ee=Me,Re=Ne,this.options.backtrack_lexer){if(fe=this.test_match(Me,Ke[Ne]),fe!==!1)return fe;if(this._backtrack){ee=!1;continue}else return!1}else if(!this.options.flex)break}return ee?(fe=this.test_match(ee,Ke[Re]),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 ee=this.next();return ee||this.lex()},"lex"),begin:w(function(ee){this.conditionStack.push(ee)},"begin"),popState:w(function(){var ee=this.conditionStack.length-1;return ee>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(ee){return ee=this.conditionStack.length-1-Math.abs(ee||0),ee>=0?this.conditionStack[ee]:"INITIAL"},"topState"),pushState:w(function(ee){this.begin(ee)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(ee,Me,Re,Ke){switch(Re){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 X})();Y.lexer=J;function ue(){this.yy={}}return w(ue,"Parser"),ue.prototype=Y,Y.Parser=ue,new ue})();uK.parser=uK;var Ryr=uK,pl=rp(),FT,_yr=(FT=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,s,a,o,l,u,h,d,f,p,g,m,y,v,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=En.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=En.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=En.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=En.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((s=En.quadrantChart)==null?void 0:s.quadrantPadding)||5,xAxisLabelPadding:((a=En.quadrantChart)==null?void 0:a.xAxisLabelPadding)||5,yAxisLabelPadding:((o=En.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=En.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=En.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=En.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=En.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=En.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=En.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=En.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=En.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=En.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=En.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=En.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:pl.quadrant1Fill,quadrant2Fill:pl.quadrant2Fill,quadrant3Fill:pl.quadrant3Fill,quadrant4Fill:pl.quadrant4Fill,quadrant1TextFill:pl.quadrant1TextFill,quadrant2TextFill:pl.quadrant2TextFill,quadrant3TextFill:pl.quadrant3TextFill,quadrant4TextFill:pl.quadrant4TextFill,quadrantPointFill:pl.quadrantPointFill,quadrantPointTextFill:pl.quadrantPointTextFill,quadrantXAxisTextFill:pl.quadrantXAxisTextFill,quadrantYAxisTextFill:pl.quadrantYAxisTextFill,quadrantTitleFill:pl.quadrantTitleFill,quadrantInternalBorderStrokeFill:pl.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:pl.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,de.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){de.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){de.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const s=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:e==="top"&&r?s:0,bottom:e==="bottom"&&r?s: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+a.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:a,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:s,titleSpace:a}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=s,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+a.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+a.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:s,quadrantTop:a}=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+s,y:a,width:s,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:a,width:s,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:a+n,width:s,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+s,y:a+n,width:s,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:s,quadrantWidth:a}=r,o=P5().domain([0,1]).range([i,a+i]),l=P5().domain([0,1]).range([n+s,s]);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:s,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l,x2:a+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+u,y1:l+r,x2:a+u,y2:l+s-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-r,y1:l+s,x2:a+u+r,y2:l+s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:l+r,x2:a,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:l+r,x2:a+o,y2:l+s-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+r,y1:l+i,x2:a+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,s=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(s),quadrants:this.getQuadrants(s),axisLabels:this.getAxisLabels(i,e,r,s),borderLines:this.getBorders(s),title:this.getTitle(n)}}},w(FT,"QuadrantBuilder"),FT),zT,lR=(zT=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},w(zT,"InvalidStyleError"),zT);function hK(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}w(hK,"validateHexCode");function Lje(t){return!/^\d+$/.test(t)}w(Lje,"validateNumber");function Ije(t){return!/^\d+px$/.test(t)}w(Ije,"validateSizeInPixels");function Tf(t){return Nn(t.trim(),He())}w(Tf,"textSanitizer");var Lo=new _yr;function Nje(t){Lo.setData({quadrant1Text:Tf(t.text)})}w(Nje,"setQuadrant1Text");function Oje(t){Lo.setData({quadrant2Text:Tf(t.text)})}w(Oje,"setQuadrant2Text");function Dje(t){Lo.setData({quadrant3Text:Tf(t.text)})}w(Dje,"setQuadrant3Text");function Pje(t){Lo.setData({quadrant4Text:Tf(t.text)})}w(Pje,"setQuadrant4Text");function $je(t){Lo.setData({xAxisLeftText:Tf(t.text)})}w($je,"setXAxisLeftText");function Bje(t){Lo.setData({xAxisRightText:Tf(t.text)})}w(Bje,"setXAxisRightText");function Fje(t){Lo.setData({yAxisTopText:Tf(t.text)})}w(Fje,"setYAxisTopText");function zje(t){Lo.setData({yAxisBottomText:Tf(t.text)})}w(zje,"setYAxisBottomText");function nB(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Lje(i))throw new lR(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(hK(i))throw new lR(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(hK(i))throw new lR(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Ije(i))throw new lR(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}w(nB,"parseStyles");function Vje(t,e,r,n,i){const s=nB(i);Lo.addPoints([{x:r,y:n,text:Tf(t.text),className:e,...s}])}w(Vje,"addPoint");function Hje(t,e){Lo.addClass(t,nB(e))}w(Hje,"addClass");function Gje(t){Lo.setConfig({chartWidth:t})}w(Gje,"setWidth");function Wje(t){Lo.setConfig({chartHeight:t})}w(Wje,"setHeight");function qje(){const t=He(),{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:ji()}),Lo.build()}w(qje,"getQuadrantData");var Lyr=w(function(){Lo.clear(),Oi()},"clear"),Iyr={setWidth:Gje,setHeight:Wje,setQuadrant1Text:Nje,setQuadrant2Text:Oje,setQuadrant3Text:Dje,setQuadrant4Text:Pje,setXAxisLeftText:$je,setXAxisRightText:Bje,setYAxisTopText:Fje,setYAxisBottomText:zje,parseStyles:nB,addPoint:Vje,addClass:Hje,getQuadrantData:qje,clear:Lyr,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is},Nyr=w((t,e,r,n)=>{var E,A,M;function i(R){return R==="top"?"hanging":"middle"}w(i,"getDominantBaseLine");function s(R){return R==="left"?"start":"middle"}w(s,"getTextAnchor");function a(R){return`translate(${R.x}, ${R.y}) rotate(${R.rotation||0})`}w(a,"getTransformation");const o=He();de.debug(`Rendering quadrant chart -`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=xt("#i"+e));const d=xt(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;qs(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"),b=f.append("g").attr("class","data-points"),x=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",s(m.title.verticalPos)).attr("transform",a(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",R=>R.x1).attr("y1",R=>R.y1).attr("x2",R=>R.x2).attr("y2",R=>R.y2).style("stroke",R=>R.strokeFill).style("stroke-width",R=>R.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",R=>R.x).attr("y",R=>R.y).attr("width",R=>R.width).attr("height",R=>R.height).attr("fill",R=>R.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",R=>R.text.fill).attr("font-size",R=>R.text.fontSize).attr("dominant-baseline",R=>i(R.text.horizontalPos)).attr("text-anchor",R=>s(R.text.verticalPos)).attr("transform",R=>a(R.text)).text(R=>R.text.text),x.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(R=>R.text).attr("fill",R=>R.fill).attr("font-size",R=>R.fontSize).attr("dominant-baseline",R=>i(R.horizontalPos)).attr("text-anchor",R=>s(R.verticalPos)).attr("transform",R=>a(R));const k=b.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",R=>R.x).attr("cy",R=>R.y).attr("r",R=>R.radius).attr("fill",R=>R.fill).attr("stroke",R=>R.strokeColor).attr("stroke-width",R=>R.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(R=>R.text.text).attr("fill",R=>R.text.fill).attr("font-size",R=>R.text.fontSize).attr("dominant-baseline",R=>i(R.text.horizontalPos)).attr("text-anchor",R=>s(R.text.verticalPos)).attr("transform",R=>a(R.text))},"draw"),Oyr={draw:Nyr},Dyr={parser:Ryr,db:Iyr,renderer:Oyr,styles:w(()=>"","styles")};const Pyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dyr},Symbol.toStringTag,{value:"Module"}));var dK=(function(){var t=w(function($,O,D,B){for(D=D||{},B=$.length;B--;D[$[B]]=O);return D},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],s=[1,6],a=[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],b=[1,36],x=[1,37],T=[1,43],C=[1,42],S=[1,47],k=[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],R=[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(O,D,B,z,V,F,H){var G=F.length-1;switch(V){case 5:z.setOrientation(F[G]);break;case 9:z.setDiagramTitle(F[G].text.trim());break;case 12:z.setLineData({text:"",type:"text"},F[G]);break;case 13:z.setLineData(F[G-1],F[G]);break;case 14:z.setBarData({text:"",type:"text"},F[G]);break;case 15:z.setBarData(F[G-1],F[G]);break;case 16:this.$=F[G].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=F[G].trim(),z.setAccDescription(this.$);break;case 19:this.$=F[G-1];break;case 20:case 30:this.$=[F[G-2],...F[G]];break;case 21:case 31:this.$=[F[G]];break;case 22:this.$={value:Number(F[G-1]),label:F[G]};break;case 23:this.$={value:Number(F[G]),label:""};break;case 24:z.setXAxisTitle(F[G]);break;case 25:z.setXAxisTitle(F[G-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(F[G]);break;case 28:z.setXAxisRangeData(Number(F[G-2]),Number(F[G]));break;case 29:this.$=F[G-1];break;case 32:z.setYAxisTitle(F[G]);break;case 33:z.setYAxisTitle(F[G-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(F[G-2]),Number(F[G]));break;case 39:this.$={text:F[G],type:"text"};break;case 40:this.$={text:F[G],type:"text"};break;case 41:this.$={text:F[G],type:"markdown"};break;case 42:this.$=F[G];break;case 43:this.$=F[G-1]+""+F[G];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:s,38:a}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:s,38:a}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:s,38:a}),{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:s,38:a}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:s,38:a}),{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:b,51:x},{11:39,13:38,24:T,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:b,51:x},{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:b,51:x},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:b,51:x},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:b,51:x},{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:b,51:x}),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:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:b,51:x},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:R},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(M,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:b,51:x},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:R},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(O,D){if(D.recoverable)this.trace(O);else{var B=new Error(O);throw B.hash=D,B}},"parseError"),parse:w(function(O){var D=this,B=[0],z=[],V=[null],F=[],H=this.table,G="",W=0,K=0,q=2,oe=1,Z=F.slice.call(arguments,1),Q=Object.create(this.lexer),ne={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(ne.yy[ie]=this.yy[ie]);Q.setInput(O,ne.yy),ne.yy.lexer=Q,ne.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var me=Q.yylloc;F.push(me);var te=Q.options&&Q.options.ranges;typeof ne.yy.parseError=="function"?this.parseError=ne.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(pe){B.length=B.length-2*pe,V.length=V.length-pe,F.length=F.length-pe}w(_e,"popStack");function $e(){var pe;return pe=z.pop()||Q.lex()||oe,typeof pe!="number"&&(pe instanceof Array&&(z=pe,pe=z.pop()),pe=D.symbols_[pe]||pe),pe}w($e,"lex");for(var Ve,ce,he,Te,ge={},ze,we,Ae,qe;;){if(ce=B[B.length-1],this.defaultActions[ce]?he=this.defaultActions[ce]:((Ve===null||typeof Ve>"u")&&(Ve=$e()),he=H[ce]&&H[ce][Ve]),typeof he>"u"||!he.length||!he[0]){var le="";qe=[];for(ze in H[ce])this.terminals_[ze]&&ze>q&&qe.push("'"+this.terminals_[ze]+"'");Q.showPosition?le="Parse error on line "+(W+1)+`: -`+Q.showPosition()+` -Expecting `+qe.join(", ")+", got '"+(this.terminals_[Ve]||Ve)+"'":le="Parse error on line "+(W+1)+": Unexpected "+(Ve==oe?"end of input":"'"+(this.terminals_[Ve]||Ve)+"'"),this.parseError(le,{text:Q.match,token:this.terminals_[Ve]||Ve,line:Q.yylineno,loc:me,expected:qe})}if(he[0]instanceof Array&&he.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Ve);switch(he[0]){case 1:B.push(Ve),V.push(Q.yytext),F.push(Q.yylloc),B.push(he[1]),Ve=null,K=Q.yyleng,G=Q.yytext,W=Q.yylineno,me=Q.yylloc;break;case 2:if(we=this.productions_[he[1]][1],ge.$=V[V.length-we],ge._$={first_line:F[F.length-(we||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(we||1)].first_column,last_column:F[F.length-1].last_column},te&&(ge._$.range=[F[F.length-(we||1)].range[0],F[F.length-1].range[1]]),Te=this.performAction.apply(ge,[G,K,W,ne.yy,he[1],V,F].concat(Z)),typeof Te<"u")return Te;we&&(B=B.slice(0,-1*we*2),V=V.slice(0,-1*we),F=F.slice(0,-1*we)),B.push(this.productions_[he[1]][0]),V.push(ge.$),F.push(ge._$),Ae=H[B[B.length-2]][B[B.length-1]],B.push(Ae);break;case 3:return!0}}return!0},"parse")},L=(function(){var $={EOF:1,parseError:w(function(D,B){if(this.yy.parser)this.yy.parser.parseError(D,B);else throw new Error(D)},"parseError"),setInput:w(function(O,D){return this.yy=D||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var D=O.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:w(function(O){var D=O.length,B=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;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),B.length-1&&(this.yylineno-=B.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:B?(B.length===z.length?this.yylloc.first_column:0)+z[z.length-B.length].length-B[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-D]),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(O){this.unput(this.match.slice(O))},"less"),pastInput:w(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var O=this.pastInput(),D=new Array(O.length+1).join("-");return O+this.upcomingInput()+` -`+D+"^"},"showPosition"),test_match:w(function(O,D){var B,z,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),z=O[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],B=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var F in V)this[F]=V[F];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,D,B,z;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),F=0;FD[0].length)){if(D=B,z=F,this.options.backtrack_lexer){if(O=this.test_match(B,V[F]),O!==!1)return O;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(O=this.test_match(D,V[z]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var D=this.next();return D||this.lex()},"lex"),begin:w(function(D){this.conditionStack.push(D)},"begin"),popState:w(function(){var D=this.conditionStack.length-1;return D>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(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:w(function(D){this.begin(D)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(D,B,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return $})();N.lexer=L;function I(){this.yy={}}return w(I,"Parser"),I.prototype=N,N.Parser=I,new I})();dK.parser=dK;var $yr=dK;function fK(t){return t.type==="bar"}w(fK,"isBarPlot");function rO(t){return t.type==="band"}w(rO,"isBandAxisData");function kx(t){return t.type==="linear"}w(kx,"isLinearAxisData");var VT,Uje=(VT=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((s,a)=>Math.max(a.length,s),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const s of e){const a=i6e(i,1,s),o=a?a.width:s.length*r,l=a?a.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},w(VT,"TextDimensionCalculatorWithFont"),VT),A2e=.7,M2e=.2,HT,jje=(HT=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(){A2e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(A2e*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=M2e*e.width;this.outerPadding=Math.min(n.width/2,i);let s=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(s=Math.max(s,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),s+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,s<=r&&(r-=s,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=M2e*e.height;this.outerPadding=Math.min(n.height/2,i);const s=n.width+this.axisConfig.labelPadding*2;s<=r&&(r-=s,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(HT,"BaseAxis"),HT),GT,Byr=(GT=class extends jje{constructor(e,r,n,i,s){super(e,i,s,r),this.categories=n,this.scale=zW().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=zW().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),de.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},w(GT,"BandAxis"),GT),WT,Fyr=(WT=class extends jje{constructor(e,r,n,i,s){super(e,i,s,r),this.domain=n,this.scale=P5().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=P5().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},w(WT,"LinearAxis"),WT);function pK(t,e,r,n){const i=new Uje(n);return rO(t)?new Byr(e,r,t.categories,t.title,i):new Fyr(e,r,[t.min,t.max],t.title,i)}w(pK,"getAxis");var qT,zyr=(qT=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(qT,"ChartTitle"),qT);function Yje(t,e,r,n){const i=new Uje(n);return new zyr(i,t,e,r)}w(Yje,"getChartTitleComponent");var UT,Vyr=(UT=class{constructor(e,r,n,i,s){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=s}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=u6().y(i=>i[0]).x(i=>i[1])(e):r=u6().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 a=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?a.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):a.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}a.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:a})}return n}},w(UT,"LinePlot"),UT),jT,Hyr=(jT=class{constructor(e,r,n,i,s,a){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=s,this.plotIndex=a}getDrawableElement(){const e=this.barData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[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(s=>({x:this.boundingRect.x,y:s[0]-i,height:n,width:s[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(s=>({x:s[0]-i,y:s[1],width:n,height:this.boundingRect.y+this.boundingRect.height-s[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},w(jT,"BarPlot"),jT),YT,Gyr=(YT=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 Vyr(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new Hyr(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},w(YT,"BasePlot"),YT);function Xje(t,e,r){return new Gyr(t,e,r)}w(Xje,"getPlotComponent");var XT,Wyr=(XT=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Yje(e,r,n,i),plot:Xje(e,r,n),xAxis:pK(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:pK(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,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:s,height:a});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&&(s+=e,e=0),r>0&&(a+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+s]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+a}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>fK(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,s=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:a,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,s=n+l.height,e>0&&(a+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:s}),this.componentStore.yAxis.setRange([i,i+a]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(u=>fK(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(XT,"Orchestrator"),XT),KT,qyr=(KT=class{static build(e,r,n,i){return new Wyr(e,r,n,i).getDrawableElement()}},w(KT,"XYChartBuilder"),KT),gA=0,Kje,mA=$se(),yA=Pse(),Zn=Bse(),gK=yA.plotColorPalette.split(",").map(t=>t.trim()),iB=!1,Dse=!1;function Pse(){const t=rp(),e=xr();return rs(t.xyChart,e.themeVariables.xyChart)}w(Pse,"getChartDefaultThemeConfig");function $se(){const t=xr();return rs(En.xyChart,t.xyChart)}w($se,"getChartDefaultConfig");function Bse(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}w(Bse,"getChartDefaultData");function J7(t){const e=xr();return Nn(t.trim(),e)}w(J7,"textSanitizer");function Zje(t){Kje=t}w(Zje,"setTmpSVGG");function Qje(t){t==="horizontal"?mA.chartOrientation="horizontal":mA.chartOrientation="vertical"}w(Qje,"setOrientation");function Jje(t){Zn.xAxis.title=J7(t.text)}w(Jje,"setXAxisTitle");function Fse(t,e){Zn.xAxis={type:"linear",title:Zn.xAxis.title,min:t,max:e},iB=!0}w(Fse,"setXAxisRangeData");function eYe(t){Zn.xAxis={type:"band",title:Zn.xAxis.title,categories:t.map(e=>J7(e.text))},iB=!0}w(eYe,"setXAxisBand");function tYe(t){Zn.yAxis.title=J7(t.text)}w(tYe,"setYAxisTitle");function rYe(t,e){Zn.yAxis={type:"linear",title:Zn.yAxis.title,min:t,max:e},Dse=!0}w(rYe,"setYAxisRangeData");function nYe(t){const e=Math.min(...t),r=Math.max(...t),n=kx(Zn.yAxis)?Zn.yAxis.min:1/0,i=kx(Zn.yAxis)?Zn.yAxis.max:-1/0;Zn.yAxis={type:"linear",title:Zn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}w(nYe,"setYAxisRangeFromPlotData");function zse(t){let e=[];if(t.length===0)return e;if(!iB){const r=kx(Zn.xAxis)?Zn.xAxis.min:1/0,n=kx(Zn.xAxis)?Zn.xAxis.max:-1/0;Fse(Math.min(r,1),Math.max(n,t.length))}if(rO(Zn.xAxis)&&t.length>Zn.xAxis.categories.length&&(t=t.slice(0,Zn.xAxis.categories.length)),Dse||nYe(t),rO(Zn.xAxis)&&(e=Zn.xAxis.categories.map((r,n)=>[r,t[n]])),kx(Zn.xAxis)){const r=Zn.xAxis.min,n=Zn.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((s,a)=>[`${r+a*i}`,s])}}return e}w(zse,"transformDataWithoutCategory");function Vse(t){return gK[t===0?0:t%gK.length]}w(Vse,"getPlotColorFromPalette");function iYe(t,e){const r=e.map(a=>a.value),n=e.map(a=>a.label?J7(a.label):""),i=zse(r),s=n.some(a=>a!=="");Zn.plots.push({type:"line",strokeFill:Vse(gA),strokeWidth:2,data:i,...s?{pointLabels:n}:{}}),gA++}w(iYe,"setLineData");function sYe(t,e){const r=e.map(i=>i.value),n=zse(r);Zn.plots.push({type:"bar",fill:Vse(gA),data:n}),gA++}w(sYe,"setBarData");function aYe(){if(Zn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Zn.title=ji(),qyr.build(mA,Zn,yA,Kje)}w(aYe,"getDrawableElem");function oYe(){return yA}w(oYe,"getChartThemeConfig");function lYe(){return mA}w(lYe,"getChartConfig");function cYe(){return Zn}w(cYe,"getXYChartData");var Uyr=w(function(){Oi(),gA=0,mA=$se(),Zn=Bse(),yA=Pse(),gK=yA.plotColorPalette.split(",").map(t=>t.trim()),iB=!1,Dse=!1},"clear"),jyr={getDrawableElem:aYe,clear:Uyr,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is,setOrientation:Qje,setXAxisTitle:Jje,setXAxisRangeData:Fse,setXAxisBand:eYe,setYAxisTitle:tYe,setYAxisRangeData:rYe,setLineData:iYe,setBarData:sYe,setTmpSVGG:Zje,getChartThemeConfig:oYe,getChartConfig:lYe,getXYChartData:cYe},Yyr=w((t,e,r,n)=>{const i=n.db,s=i.getChartThemeConfig(),a=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"),de.debug(`Rendering xychart chart -`+t);const d=al(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");qs(d,a.height,a.width,!0),d.attr("viewBox",`0 0 ${a.width} ${a.height}`),p.attr("fill",s.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let b=f,x="";for(const[T]of v.entries()){let C=f;T>0&&m[x]&&(C=m[x]),x+=v[T],b=m[x],b||(b=m[x]=C.append("g").attr("class",v[T]))}return b}w(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const b=y(v.groupTexts);switch(v.type){case"rect":if(b.selectAll("rect").data(v.data).enter().append("rect").attr("x",x=>x.x).attr("y",x=>x.y).attr("width",x=>x.width).attr("height",x=>x.height).attr("fill",x=>x.fill).attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth),a.showDataLabel){const x=a.showDataLabelOutsideBar;if(a.chartOrientation==="horizontal"){let T=function(R,P){const{data:N,label:L}=R;return P*L.length*C<=N.width-S};w(T,"fitsHorizontally");const C=.7,S=10,k=v.data.map((R,P)=>({data:R,label:o[P].toString()})).filter(R=>R.data.width>0&&R.data.height>0),E=k.map(R=>{const{data:P}=R;let N=P.height*.7;for(;!T(R,N)&&N>0;)N-=1;return N}),A=Math.floor(Math.min(...E)),M=w(R=>x?R.data.x+R.data.width+S:R.data.x+R.data.width-S,"determineLabelXPosition");b.selectAll("text").data(k).enter().append("text").attr("x",M).attr("y",R=>R.data.y+R.data.height/2).attr("text-anchor",x?"start":"end").attr("dominant-baseline","middle").attr("fill",s.dataLabelColor).attr("font-size",`${A}px`).text(R=>R.label)}else{let T=function(M,R,P){const{data:N,label:L}=M,$=R*L.length*.7,O=N.x+N.width/2,D=O-$/2,B=O+$/2,z=D>=N.x&&B<=N.x+N.width,V=N.y+P+R<=N.y+N.height;return z&&V};w(T,"fitsInBar");const C=10,S=v.data.map((M,R)=>({data:M,label:o[R].toString()})).filter(M=>M.data.width>0&&M.data.height>0),k=S.map(M=>{const{data:R,label:P}=M;let N=R.width/(P.length*.7);for(;!T(M,N,C)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...k)),A=w(M=>x?M.data.y-C:M.data.y+C,"determineLabelYPosition");b.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",x?"auto":"hanging").attr("fill",s.dataLabelColor).attr("font-size",`${E}px`).text(M=>M.label)}}break;case"text":b.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",x=>x.fill).attr("font-size",x=>x.fontSize).attr("dominant-baseline",x=>l(x.verticalPos)).attr("text-anchor",x=>u(x.horizontalPos)).attr("transform",x=>h(x)).text(x=>x.text);break;case"path":b.selectAll("path").data(v.data).enter().append("path").attr("d",x=>x.path).attr("fill",x=>x.fill?x.fill:"none").attr("stroke",x=>x.strokeFill).attr("stroke-width",x=>x.strokeWidth);break}}},"draw"),Xyr={draw:Yyr},Kyr={parser:$yr,db:jyr,renderer:Xyr};const Zyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kyr},Symbol.toStringTag,{value:"Module"}));var mK=(function(){var t=w(function(re,Y,J,ue){for(J=J||{},ue=re.length;ue--;J[re[ue]]=Y);return J},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],s=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[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],b=[1,24],x=[1,31],T=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],A=[1,61],M=[89,90],R=[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],L=[1,71],I=[1,72],$=[1,73],O=[1,74],D=[1,75],B=[1,76],z=[1,83],V=[1,80],F=[1,84],H=[1,85],G=[1,86],W=[1,87],K=[1,88],q=[1,89],oe=[1,90],Z=[1,91],Q=[1,92],ne=[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],ie=[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],$e=[1,110],Ve=[1,106],ce=[1,107],he=[1,108],Te=[1,109],ge=[1,111],ze=[1,116],we=[1,117],Ae=[1,114],qe=[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(Y,J,ue,X,fe,ee,Me){var Re=ee.length-1;switch(fe){case 4:this.$=ee[Re].trim(),X.setAccTitle(this.$);break;case 5:case 6:this.$=ee[Re].trim(),X.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:X.setDirection("TB");break;case 18:X.setDirection("BT");break;case 19:X.setDirection("RL");break;case 20:X.setDirection("LR");break;case 21:X.addRequirement(ee[Re-3],ee[Re-4]);break;case 22:X.addRequirement(ee[Re-5],ee[Re-6]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 23:X.setNewReqId(ee[Re-2]);break;case 24:X.setNewReqText(ee[Re-2]);break;case 25:X.setNewReqRisk(ee[Re-2]);break;case 26:X.setNewReqVerifyMethod(ee[Re-2]);break;case 29:this.$=X.RequirementType.REQUIREMENT;break;case 30:this.$=X.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=X.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=X.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=X.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=X.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=X.RiskLevel.LOW_RISK;break;case 36:this.$=X.RiskLevel.MED_RISK;break;case 37:this.$=X.RiskLevel.HIGH_RISK;break;case 38:this.$=X.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=X.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=X.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=X.VerifyType.VERIFY_TEST;break;case 42:X.addElement(ee[Re-3]);break;case 43:X.addElement(ee[Re-5]),X.setClass([ee[Re-5]],ee[Re-3]);break;case 44:X.setNewElementType(ee[Re-2]);break;case 45:X.setNewElementDocRef(ee[Re-2]);break;case 48:X.addRelationship(ee[Re-2],ee[Re],ee[Re-4]);break;case 49:X.addRelationship(ee[Re-2],ee[Re-4],ee[Re]);break;case 50:this.$=X.Relationships.CONTAINS;break;case 51:this.$=X.Relationships.COPIES;break;case 52:this.$=X.Relationships.DERIVES;break;case 53:this.$=X.Relationships.SATISFIES;break;case 54:this.$=X.Relationships.VERIFIES;break;case 55:this.$=X.Relationships.REFINES;break;case 56:this.$=X.Relationships.TRACES;break;case 57:this.$=ee[Re-2],X.defineClass(ee[Re-1],ee[Re]);break;case 58:X.setClass(ee[Re-1],ee[Re]);break;case 59:X.setClass([ee[Re-2]],ee[Re]);break;case 60:case 62:this.$=[ee[Re]];break;case 61:case 63:this.$=ee[Re-2].concat([ee[Re]]);break;case 64:this.$=ee[Re-2],X.setCssStyle(ee[Re-1],ee[Re]);break;case 65:this.$=[ee[Re]];break;case 66:ee[Re-2].push(ee[Re]),this.$=ee[Re-2];break;case 68:this.$=ee[Re-1]+ee[Re];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(s,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},t(s,[2,4]),t(s,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{4:17,5:a,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:b,72:x,74:T,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:A,89:S,90:k},{30:63,33:62,75:A,89:S,90:k},{30:64,33:62,75:A,89:S,90:k},t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(M,[2,32]),t(M,[2,33]),t(M,[2,34]),t(R,[2,81]),t(R,[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:L,67:I,68:$,69:O,70:D,71:B},{62:77,65:N,66:L,67:I,68:$,69:O,70:D,71:B},{30:78,33:62,75:A,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:F,81:H,82:G,83:W,84:K,85:q,86:oe,87:Z,88:Q},t(ne,[2,60]),t(ne,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:F,81:H,82:G,83:W,84:K,85:q,86:oe,87:Z,88:Q},{30:94,33:62,75:A,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:A,89:S,90:k},{5:[1,97]},{30:98,33:62,75:A,89:S,90:k},{63:[1,99]},t(ie,[2,50]),t(ie,[2,51]),t(ie,[2,52]),t(ie,[2,53]),t(ie,[2,54]),t(ie,[2,55]),t(ie,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:me}),{33:103,75:[1,102],89:S,90:k},t(te,[2,65],{79:104,75:z,80:F,81:H,82:G,83:W,84:K,85:q,86:oe,87:Z,88:Q}),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:V}),{5:$e,28:105,31:Ve,34:ce,36:he,38:Te,40:ge},{27:[1,112],76:V},{5:ze,40:we,56:113,57:Ae,59:qe},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:F,81:H,82:G,83:W,84:K,85:q,86:oe,87:Z,88:Q},t(ne,[2,61]),t(ne,[2,63]),t(_e,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:$e,28:126,31:Ve,34:ce,36:he,38:Te,40:ge},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:ze,40:we,56:130,57:Ae,59:qe},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(te,[2,66],{79:104,75:z,80:F,81:H,82:G,83:W,84:K,85:q,86:oe,87:Z,88:Q}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:$e,28:145,31:Ve,34:ce,36:he,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:ze,40:we,56:152,57:Ae,59:qe},{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:$e,28:159,31:Ve,34:ce,36:he,38:Te,40:ge},{5:$e,28:160,31:Ve,34:ce,36:he,38:Te,40:ge},{5:$e,28:161,31:Ve,34:ce,36:he,38:Te,40:ge},{5:$e,28:162,31:Ve,34:ce,36:he,38:Te,40:ge},{5:ze,40:we,56:163,57:Ae,59:qe},{5:ze,40:we,56:164,57:Ae,59:qe},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(Y,J){if(J.recoverable)this.trace(Y);else{var ue=new Error(Y);throw ue.hash=J,ue}},"parseError"),parse:w(function(Y){var J=this,ue=[0],X=[],fe=[null],ee=[],Me=this.table,Re="",Ke=0,Ne=0,je=2,Oe=1,Ze=ee.slice.call(arguments,1),Fe=Object.create(this.lexer),st={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(st.yy[Pe]=this.yy[Pe]);Fe.setInput(Y,st.yy),st.yy.lexer=Fe,st.yy.parser=this,typeof Fe.yylloc>"u"&&(Fe.yylloc={});var gt=Fe.yylloc;ee.push(gt);var Le=Fe.options&&Fe.options.ranges;typeof st.yy.parseError=="function"?this.parseError=st.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(Ee){ue.length=ue.length-2*Ee,fe.length=fe.length-Ee,ee.length=ee.length-Ee}w(kt,"popStack");function Et(){var Ee;return Ee=X.pop()||Fe.lex()||Oe,typeof Ee!="number"&&(Ee instanceof Array&&(X=Ee,Ee=X.pop()),Ee=J.symbols_[Ee]||Ee),Ee}w(Et,"lex");for(var ot,Ht,_t,dt,xe={},Lt,wt,mt,Mt;;){if(Ht=ue[ue.length-1],this.defaultActions[Ht]?_t=this.defaultActions[Ht]:((ot===null||typeof ot>"u")&&(ot=Et()),_t=Me[Ht]&&Me[Ht][ot]),typeof _t>"u"||!_t.length||!_t[0]){var Or="";Mt=[];for(Lt in Me[Ht])this.terminals_[Lt]&&Lt>je&&Mt.push("'"+this.terminals_[Lt]+"'");Fe.showPosition?Or="Parse error on line "+(Ke+1)+`: +Expecting `+pt.join(", ")+", got '"+(this.terminals_[ve]||ve)+"'":bt="Parse error on line "+(Ze+1)+": Unexpected "+(ve==_e?"end of input":"'"+(this.terminals_[ve]||ve)+"'"),this.parseError(bt,{text:Le.match,token:this.terminals_[ve]||ve,line:Le.yylineno,loc:ot,expected:pt})}if(xt[0]instanceof Array&&xt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+It+", token: "+ve);switch(xt[0]){case 1:Ae.push(ve),Ke.push(Le.yytext),Ne.push(Le.yylloc),Ae.push(xt[1]),ve=null,Fe=Le.yyleng,De=Le.yytext,Ze=Le.yylineno,ot=Le.yylloc;break;case 2:if(Se=this.productions_[xt[1]][1],Mt.$=Ke[Ke.length-Se],Mt._$={first_line:Ne[Ne.length-(Se||1)].first_line,last_line:Ne[Ne.length-1].last_line,first_column:Ne[Ne.length-(Se||1)].first_column,last_column:Ne[Ne.length-1].last_column},Vt&&(Mt._$.range=[Ne[Ne.length-(Se||1)].range[0],Ne[Ne.length-1].range[1]]),mt=this.performAction.apply(Mt,[De,Fe,Ze,kt.yy,xt[1],Ke,Ne].concat(gt)),typeof mt<"u")return mt;Se&&(Ae=Ae.slice(0,-1*Se*2),Ke=Ke.slice(0,-1*Se),Ne=Ne.slice(0,-1*Se)),Ae.push(this.productions_[xt[1]][0]),Ke.push(Mt.$),Ne.push(Mt._$),it=je[Ae[Ae.length-2]][Ae[Ae.length-1]],Ae.push(it);break;case 3:return!0}}return!0},"parse")},Q=(function(){var X={EOF:1,parseError:x(function(ee,Ae){if(this.yy.parser)this.yy.parser.parseError(ee,Ae);else throw new Error(ee)},"parseError"),setInput:x(function(fe,ee){return this.yy=ee||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:x(function(){var fe=this._input[0];this.yytext+=fe,this.yyleng++,this.offset++,this.match+=fe,this.matched+=fe;var ee=fe.match(/(?:\r\n?|\n).*/g);return ee?(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:x(function(fe){var ee=fe.length,Ae=fe.split(/(?:\r\n?|\n)/g);this._input=fe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ee),this.offset-=ee;var Me=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),Ae.length-1&&(this.yylineno-=Ae.length-1);var Ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ae?(Ae.length===Me.length?this.yylloc.first_column:0)+Me[Me.length-Ae.length].length-Ae[0].length:this.yylloc.first_column-ee},this.options.ranges&&(this.yylloc.range=[Ke[0],Ke[0]+this.yyleng-ee]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(fe){this.unput(this.match.slice(fe))},"less"),pastInput:x(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:x(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:x(function(){var fe=this.pastInput(),ee=new Array(fe.length+1).join("-");return fe+this.upcomingInput()+` +`+ee+"^"},"showPosition"),test_match:x(function(fe,ee){var Ae,Me,Ke;if(this.options.backtrack_lexer&&(Ke={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ke.yylloc.range=this.yylloc.range.slice(0))),Me=fe[0].match(/(?:\r\n?|\n).*/g),Me&&(this.yylineno+=Me.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Me?Me[Me.length-1].length-Me[Me.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],Ae=this.performAction.call(this,this.yy,this,ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ae)return Ae;if(this._backtrack){for(var Ne in Ke)this[Ne]=Ke[Ne];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var fe,ee,Ae,Me;this._more||(this.yytext="",this.match="");for(var Ke=this._currentRules(),Ne=0;Neee[0].length)){if(ee=Ae,Me=Ne,this.options.backtrack_lexer){if(fe=this.test_match(Ae,Ke[Ne]),fe!==!1)return fe;if(this._backtrack){ee=!1;continue}else return!1}else if(!this.options.flex)break}return ee?(fe=this.test_match(ee,Ke[Me]),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:x(function(){var ee=this.next();return ee||this.lex()},"lex"),begin:x(function(ee){this.conditionStack.push(ee)},"begin"),popState:x(function(){var ee=this.conditionStack.length-1;return ee>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(ee){return ee=this.conditionStack.length-1-Math.abs(ee||0),ee>=0?this.conditionStack[ee]:"INITIAL"},"topState"),pushState:x(function(ee){this.begin(ee)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(ee,Ae,Me,Ke){switch(Me){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 X})();Y.lexer=Q;function ue(){this.yy={}}return x(ue,"Parser"),ue.prototype=Y,Y.Parser=ue,new ue})();UK.parser=UK;var JUr=UK,pl=np(),H8,QUr=(H8=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,U,y,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=An.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=An.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=An.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=An.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=An.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=An.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=An.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=An.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=An.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=An.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=An.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=An.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=An.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=An.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=An.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((U=An.quadrantChart)==null?void 0:U.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((y=An.quadrantChart)==null?void 0:y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=An.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:pl.quadrant1Fill,quadrant2Fill:pl.quadrant2Fill,quadrant3Fill:pl.quadrant3Fill,quadrant4Fill:pl.quadrant4Fill,quadrant1TextFill:pl.quadrant1TextFill,quadrant2TextFill:pl.quadrant2TextFill,quadrant3TextFill:pl.quadrant3TextFill,quadrant4TextFill:pl.quadrant4TextFill,quadrantPointFill:pl.quadrantPointFill,quadrantPointTextFill:pl.quadrantPointTextFill,quadrantXAxisTextFill:pl.quadrantXAxisTextFill,quadrantYAxisTextFill:pl.quadrantYAxisTextFill,quadrantTitleFill:pl.quadrantTitleFill,quadrantInternalBorderStrokeFill:pl.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:pl.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,de.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){de.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){de.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,U=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:U}}}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=Fv().domain([0,1]).range([i,s+i]),l=Fv().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(H8,"QuadrantBuilder"),H8),G8,hA=(G8=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(G8,"InvalidStyleError"),G8);function yK(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(yK,"validateHexCode");function Gje(t){return!/^\d+$/.test(t)}x(Gje,"validateNumber");function Wje(t){return!/^\d+px$/.test(t)}x(Wje,"validateSizeInPixels");function Tf(t){return Dn(t.trim(),He())}x(Tf,"textSanitizer");var Lo=new QUr;function qje(t){Lo.setData({quadrant1Text:Tf(t.text)})}x(qje,"setQuadrant1Text");function jje(t){Lo.setData({quadrant2Text:Tf(t.text)})}x(jje,"setQuadrant2Text");function Yje(t){Lo.setData({quadrant3Text:Tf(t.text)})}x(Yje,"setQuadrant3Text");function Xje(t){Lo.setData({quadrant4Text:Tf(t.text)})}x(Xje,"setQuadrant4Text");function Kje(t){Lo.setData({xAxisLeftText:Tf(t.text)})}x(Kje,"setXAxisLeftText");function Zje(t){Lo.setData({xAxisRightText:Tf(t.text)})}x(Zje,"setXAxisRightText");function Jje(t){Lo.setData({yAxisTopText:Tf(t.text)})}x(Jje,"setYAxisTopText");function Qje(t){Lo.setData({yAxisBottomText:Tf(t.text)})}x(Qje,"setYAxisBottomText");function sB(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Gje(i))throw new hA(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(yK(i))throw new hA(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(yK(i))throw new hA(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Wje(i))throw new hA(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(sB,"parseStyles");function eYe(t,e,r,n,i){const a=sB(i);Lo.addPoints([{x:r,y:n,text:Tf(t.text),className:e,...a}])}x(eYe,"addPoint");function tYe(t,e){Lo.addClass(t,sB(e))}x(tYe,"addClass");function rYe(t){Lo.setConfig({chartWidth:t})}x(rYe,"setWidth");function nYe(t){Lo.setConfig({chartHeight:t})}x(nYe,"setHeight");function iYe(){const t=He(),{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:Yi()}),Lo.build()}x(iYe,"getQuadrantData");var e5r=x(function(){Lo.clear(),Oi()},"clear"),t5r={setWidth:rYe,setHeight:nYe,setQuadrant1Text:qje,setQuadrant2Text:jje,setQuadrant3Text:Yje,setQuadrant4Text:Xje,setXAxisLeftText:Kje,setXAxisRightText:Zje,setYAxisTopText:Jje,setYAxisBottomText:Qje,parseStyles:sB,addPoint:eYe,addClass:tYe,getQuadrantData:iYe,clear:e5r,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa},r5r=x((t,e,r,n)=>{var S,E,A;function i(R){return R==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(R){return R==="left"?"start":"middle"}x(a,"getTextAnchor");function s(R){return`translate(${R.x}, ${R.y}) rotate(${R.rotation||0})`}x(s,"getTransformation");const o=He();de.debug(`Rendering quadrant chart +`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=vt("#i"+e));const d=vt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((S=o.quadrantChart)==null?void 0:S.chartWidth)??500,g=((E=o.quadrantChart)==null?void 0:E.chartHeight)??500;Ga(d,g,p,((A=o.quadrantChart)==null?void 0:A.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),U=f.append("g").attr("class","quadrants"),y=f.append("g").attr("class","border"),b=f.append("g").attr("class","data-points"),v=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&y.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",R=>R.x1).attr("y1",R=>R.y1).attr("x2",R=>R.x2).attr("y2",R=>R.y2).style("stroke",R=>R.strokeFill).style("stroke-width",R=>R.strokeWidth);const T=U.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");T.append("rect").attr("x",R=>R.x).attr("y",R=>R.y).attr("width",R=>R.width).attr("height",R=>R.height).attr("fill",R=>R.fill),T.append("text").attr("x",0).attr("y",0).attr("fill",R=>R.text.fill).attr("font-size",R=>R.text.fontSize).attr("dominant-baseline",R=>i(R.text.horizontalPos)).attr("text-anchor",R=>a(R.text.verticalPos)).attr("transform",R=>s(R.text)).text(R=>R.text.text),v.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(R=>R.text).attr("fill",R=>R.fill).attr("font-size",R=>R.fontSize).attr("dominant-baseline",R=>i(R.horizontalPos)).attr("text-anchor",R=>a(R.verticalPos)).attr("transform",R=>s(R));const C=b.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");C.append("circle").attr("cx",R=>R.x).attr("cy",R=>R.y).attr("r",R=>R.radius).attr("fill",R=>R.fill).attr("stroke",R=>R.strokeColor).attr("stroke-width",R=>R.strokeWidth),C.append("text").attr("x",0).attr("y",0).text(R=>R.text.text).attr("fill",R=>R.text.fill).attr("font-size",R=>R.text.fontSize).attr("dominant-baseline",R=>i(R.text.horizontalPos)).attr("text-anchor",R=>a(R.text.verticalPos)).attr("transform",R=>s(R.text))},"draw"),n5r={draw:r5r},i5r={parser:JUr,db:t5r,renderer:n5r,styles:x(()=>"","styles")};const a5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:i5r},Symbol.toStringTag,{value:"Module"}));var bK=(function(){var t=x(function(P,O,D,B){for(D=D||{},B=P.length;B--;D[P[B]]=O);return D},"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],U=[1,34],y=[1,35],b=[1,36],v=[1,37],w=[1,43],T=[1,42],k=[1,47],C=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[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],R=[1,65],_=[26,28],N={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:x(function(O,D,B,F,z,$,V){var H=$.length-1;switch(z){case 5:F.setOrientation($[H]);break;case 9:F.setDiagramTitle($[H].text.trim());break;case 12:F.setLineData({text:"",type:"text"},$[H]);break;case 13:F.setLineData($[H-1],$[H]);break;case 14:F.setBarData({text:"",type:"text"},$[H]);break;case 15:F.setBarData($[H-1],$[H]);break;case 16:this.$=$[H].trim(),F.setAccTitle(this.$);break;case 17:case 18:this.$=$[H].trim(),F.setAccDescription(this.$);break;case 19:this.$=$[H-1];break;case 20:case 30:this.$=[$[H-2],...$[H]];break;case 21:case 31:this.$=[$[H]];break;case 22:this.$={value:Number($[H-1]),label:$[H]};break;case 23:this.$={value:Number($[H]),label:""};break;case 24:F.setXAxisTitle($[H]);break;case 25:F.setXAxisTitle($[H-1]);break;case 26:F.setXAxisTitle({type:"text",text:""});break;case 27:F.setXAxisBand($[H]);break;case 28:F.setXAxisRangeData(Number($[H-2]),Number($[H]));break;case 29:this.$=$[H-1];break;case 32:F.setYAxisTitle($[H]);break;case 33:F.setYAxisTitle($[H-1]);break;case 34:F.setYAxisTitle({type:"text",text:""});break;case 35:F.setYAxisRangeData(Number($[H-2]),Number($[H]));break;case 39:this.$={text:$[H],type:"text"};break;case 40:this.$={text:$[H],type:"text"};break;case 41:this.$={text:$[H],type:"markdown"};break;case 42:this.$=$[H];break;case 43:this.$=$[H-1]+""+$[H];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:U,49:y,50:b,51:v},{11:39,13:38,24:w,29:T,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:U,49:y,50:b,51:v},{11:45,15:44,29:k,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:U,49:y,50:b,51:v},{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:U,49:y,50:b,51:v},{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:U,49:y,50:b,51:v},{20:[1,53]},{22:[1,54]},t(S,[2,18]),{1:[2,2]},t(S,[2,8]),t(S,[2,9]),t(E,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:U,49:y,50:b,51:v}),t(E,[2,40]),t(E,[2,41]),t(A,[2,42]),t(A,[2,44]),t(A,[2,45]),t(A,[2,46]),t(A,[2,47]),t(A,[2,48]),t(A,[2,49]),t(A,[2,50]),t(A,[2,51]),t(A,[2,52]),t(A,[2,53]),t(S,[2,10]),t(S,[2,24],{32:41,31:56,24:w,29:T}),t(S,[2,26]),t(S,[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:U,49:y,50:b,51:v},t(S,[2,11]),t(S,[2,32],{35:60,29:k}),t(S,[2,34]),{33:[1,61]},t(S,[2,12]),{17:62,24:C},{25:63,27:64,29:R},t(S,[2,14]),{17:66,24:C},t(S,[2,16]),t(S,[2,17]),t(A,[2,43]),t(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(S,[2,33]),{29:[1,70]},t(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(_,[2,23],{30:[1,73]}),t(S,[2,15]),t(S,[2,28]),t(S,[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:U,49:y,50:b,51:v},t(S,[2,35]),t(S,[2,19]),{25:75,27:64,29:R},t(_,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:x(function(O,D){if(D.recoverable)this.trace(O);else{var B=new Error(O);throw B.hash=D,B}},"parseError"),parse:x(function(O){var D=this,B=[0],F=[],z=[null],$=[],V=this.table,H="",G=0,K=0,W=2,oe=1,Z=$.slice.call(arguments,1),J=Object.create(this.lexer),ne={yy:{}};for(var ie in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ie)&&(ne.yy[ie]=this.yy[ie]);J.setInput(O,ne.yy),ne.yy.lexer=J,ne.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var me=J.yylloc;$.push(me);var te=J.options&&J.options.ranges;typeof ne.yy.parseError=="function"?this.parseError=ne.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(pe){B.length=B.length-2*pe,z.length=z.length-pe,$.length=$.length-pe}x(Re,"popStack");function Pe(){var pe;return pe=F.pop()||J.lex()||oe,typeof pe!="number"&&(pe instanceof Array&&(F=pe,pe=F.pop()),pe=D.symbols_[pe]||pe),pe}x(Pe,"lex");for(var Ve,ce,he,we,ge={},ze,xe,Ee,qe;;){if(ce=B[B.length-1],this.defaultActions[ce]?he=this.defaultActions[ce]:((Ve===null||typeof Ve>"u")&&(Ve=Pe()),he=V[ce]&&V[ce][Ve]),typeof he>"u"||!he.length||!he[0]){var le="";qe=[];for(ze in V[ce])this.terminals_[ze]&&ze>W&&qe.push("'"+this.terminals_[ze]+"'");J.showPosition?le="Parse error on line "+(G+1)+`: +`+J.showPosition()+` +Expecting `+qe.join(", ")+", got '"+(this.terminals_[Ve]||Ve)+"'":le="Parse error on line "+(G+1)+": Unexpected "+(Ve==oe?"end of input":"'"+(this.terminals_[Ve]||Ve)+"'"),this.parseError(le,{text:J.match,token:this.terminals_[Ve]||Ve,line:J.yylineno,loc:me,expected:qe})}if(he[0]instanceof Array&&he.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Ve);switch(he[0]){case 1:B.push(Ve),z.push(J.yytext),$.push(J.yylloc),B.push(he[1]),Ve=null,K=J.yyleng,H=J.yytext,G=J.yylineno,me=J.yylloc;break;case 2:if(xe=this.productions_[he[1]][1],ge.$=z[z.length-xe],ge._$={first_line:$[$.length-(xe||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(xe||1)].first_column,last_column:$[$.length-1].last_column},te&&(ge._$.range=[$[$.length-(xe||1)].range[0],$[$.length-1].range[1]]),we=this.performAction.apply(ge,[H,K,G,ne.yy,he[1],z,$].concat(Z)),typeof we<"u")return we;xe&&(B=B.slice(0,-1*xe*2),z=z.slice(0,-1*xe),$=$.slice(0,-1*xe)),B.push(this.productions_[he[1]][0]),z.push(ge.$),$.push(ge._$),Ee=V[B[B.length-2]][B[B.length-1]],B.push(Ee);break;case 3:return!0}}return!0},"parse")},L=(function(){var P={EOF:1,parseError:x(function(D,B){if(this.yy.parser)this.yy.parser.parseError(D,B);else throw new Error(D)},"parseError"),setInput:x(function(O,D){return this.yy=D||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var D=O.match(/(?:\r\n?|\n).*/g);return D?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:x(function(O){var D=O.length,B=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-D),this.offset-=D;var F=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 z=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===F.length?this.yylloc.first_column:0)+F[F.length-B.length].length-B[0].length:this.yylloc.first_column-D},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-D]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(O){this.unput(this.match.slice(O))},"less"),pastInput:x(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var O=this.pastInput(),D=new Array(O.length+1).join("-");return O+this.upcomingInput()+` +`+D+"^"},"showPosition"),test_match:x(function(O,D){var B,F,z;if(this.options.backtrack_lexer&&(z={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&&(z.yylloc.range=this.yylloc.range.slice(0))),F=O[0].match(/(?:\r\n?|\n).*/g),F&&(this.yylineno+=F.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:F?F[F.length-1].length-F[F.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],B=this.performAction.call(this,this.yy,this,D,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var $ in z)this[$]=z[$];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,D,B,F;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),$=0;$D[0].length)){if(D=B,F=$,this.options.backtrack_lexer){if(O=this.test_match(B,z[$]),O!==!1)return O;if(this._backtrack){D=!1;continue}else return!1}else if(!this.options.flex)break}return D?(O=this.test_match(D,z[F]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var D=this.next();return D||this.lex()},"lex"),begin:x(function(D){this.conditionStack.push(D)},"begin"),popState:x(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:x(function(D){this.begin(D)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(D,B,F,z){switch(F){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 P})();N.lexer=L;function I(){this.yy={}}return x(I,"Parser"),I.prototype=N,N.Parser=I,new I})();bK.parser=bK;var s5r=bK;function vK(t){return t.type==="bar"}x(vK,"isBarPlot");function aD(t){return t.type==="band"}x(aD,"isBandAxisData");function A6(t){return t.type==="linear"}x(A6,"isLinearAxisData");var W8,aYe=(W8=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=pTe(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(W8,"TextDimensionCalculatorWithFont"),W8),P2e=.7,B2e=.2,q8,sYe=(q8=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(){P2e*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(P2e*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=B2e*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=B2e*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(q8,"BaseAxis"),q8),j8,o5r=(j8=class extends sYe{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=jG().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=jG().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),de.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(j8,"BandAxis"),j8),Y8,l5r=(Y8=class extends sYe{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Fv().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Fv().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(Y8,"LinearAxis"),Y8);function xK(t,e,r,n){const i=new aYe(n);return aD(t)?new o5r(e,r,t.categories,t.title,i):new l5r(e,r,[t.min,t.max],t.title,i)}x(xK,"getAxis");var X8,c5r=(X8=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(X8,"ChartTitle"),X8);function oYe(t,e,r,n){const i=new aYe(n);return new c5r(i,t,e,r)}x(oYe,"getChartTitleComponent");var K8,u5r=(K8=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=pT().y(i=>i[0]).x(i=>i[1])(e):r=pT().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},x(K8,"LinePlot"),K8),Z8,h5r=(Z8=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Z8,"BarPlot"),Z8),J8,d5r=(J8=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 u5r(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new h5r(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x(J8,"BasePlot"),J8);function lYe(t,e,r){return new d5r(t,e,r)}x(lYe,"getPlotComponent");var Q8,f5r=(Q8=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:oYe(e,r,n,i),plot:lYe(e,r,n),xAxis:xK(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:xK(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=>vK(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=>vK(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(Q8,"Orchestrator"),Q8),ev,p5r=(ev=class{static build(e,r,n,i){return new f5r(e,r,n,i).getDrawableElement()}},x(ev,"XYChartBuilder"),ev),yC=0,cYe,bC=Wae(),vC=Gae(),Jn=qae(),wK=vC.plotColorPalette.split(",").map(t=>t.trim()),oB=!1,Hae=!1;function Gae(){const t=np(),e=xr();return na(t.xyChart,e.themeVariables.xyChart)}x(Gae,"getChartDefaultThemeConfig");function Wae(){const t=xr();return na(An.xyChart,t.xyChart)}x(Wae,"getChartDefaultConfig");function qae(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(qae,"getChartDefaultData");function rS(t){const e=xr();return Dn(t.trim(),e)}x(rS,"textSanitizer");function uYe(t){cYe=t}x(uYe,"setTmpSVGG");function hYe(t){t==="horizontal"?bC.chartOrientation="horizontal":bC.chartOrientation="vertical"}x(hYe,"setOrientation");function dYe(t){Jn.xAxis.title=rS(t.text)}x(dYe,"setXAxisTitle");function jae(t,e){Jn.xAxis={type:"linear",title:Jn.xAxis.title,min:t,max:e},oB=!0}x(jae,"setXAxisRangeData");function fYe(t){Jn.xAxis={type:"band",title:Jn.xAxis.title,categories:t.map(e=>rS(e.text))},oB=!0}x(fYe,"setXAxisBand");function pYe(t){Jn.yAxis.title=rS(t.text)}x(pYe,"setYAxisTitle");function gYe(t,e){Jn.yAxis={type:"linear",title:Jn.yAxis.title,min:t,max:e},Hae=!0}x(gYe,"setYAxisRangeData");function mYe(t){const e=Math.min(...t),r=Math.max(...t),n=A6(Jn.yAxis)?Jn.yAxis.min:1/0,i=A6(Jn.yAxis)?Jn.yAxis.max:-1/0;Jn.yAxis={type:"linear",title:Jn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(mYe,"setYAxisRangeFromPlotData");function Yae(t){let e=[];if(t.length===0)return e;if(!oB){const r=A6(Jn.xAxis)?Jn.xAxis.min:1/0,n=A6(Jn.xAxis)?Jn.xAxis.max:-1/0;jae(Math.min(r,1),Math.max(n,t.length))}if(aD(Jn.xAxis)&&t.length>Jn.xAxis.categories.length&&(t=t.slice(0,Jn.xAxis.categories.length)),Hae||mYe(t),aD(Jn.xAxis)&&(e=Jn.xAxis.categories.map((r,n)=>[r,t[n]])),A6(Jn.xAxis)){const r=Jn.xAxis.min,n=Jn.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}x(Yae,"transformDataWithoutCategory");function Xae(t){return wK[t===0?0:t%wK.length]}x(Xae,"getPlotColorFromPalette");function UYe(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?rS(s.label):""),i=Yae(r),a=n.some(s=>s!=="");Jn.plots.push({type:"line",strokeFill:Xae(yC),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),yC++}x(UYe,"setLineData");function yYe(t,e){const r=e.map(i=>i.value),n=Yae(r);Jn.plots.push({type:"bar",fill:Xae(yC),data:n}),yC++}x(yYe,"setBarData");function bYe(){if(Jn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return Jn.title=Yi(),p5r.build(bC,Jn,vC,cYe)}x(bYe,"getDrawableElem");function vYe(){return vC}x(vYe,"getChartThemeConfig");function xYe(){return bC}x(xYe,"getChartConfig");function wYe(){return Jn}x(wYe,"getXYChartData");var g5r=x(function(){Oi(),yC=0,bC=Wae(),Jn=qae(),vC=Gae(),wK=vC.plotColorPalette.split(",").map(t=>t.trim()),oB=!1,Hae=!1},"clear"),m5r={getDrawableElem:bYe,clear:g5r,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa,setOrientation:hYe,setXAxisTitle:dYe,setXAxisRangeData:jae,setXAxisBand:fYe,setYAxisTitle:pYe,setYAxisRangeData:gYe,setLineData:UYe,setBarData:yYe,setTmpSVGG:uYe,getChartThemeConfig:vYe,getChartConfig:xYe,getXYChartData:wYe},U5r=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}x(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}x(h,"getTextTransformation"),de.debug(`Rendering xychart chart +`+t);const d=sl(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Ga(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 U(y){let b=f,v="";for(const[w]of y.entries()){let T=f;w>0&&m[v]&&(T=m[v]),v+=y[w],b=m[v],b||(b=m[v]=T.append("g").attr("class",y[w]))}return b}x(U,"getGroup");for(const y of g){if(y.data.length===0)continue;const b=U(y.groupTexts);switch(y.type){case"rect":if(b.selectAll("rect").data(y.data).enter().append("rect").attr("x",v=>v.x).attr("y",v=>v.y).attr("width",v=>v.width).attr("height",v=>v.height).attr("fill",v=>v.fill).attr("stroke",v=>v.strokeFill).attr("stroke-width",v=>v.strokeWidth),s.showDataLabel){const v=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(R,_){const{data:N,label:L}=R;return _*L.length*T<=N.width-k};x(w,"fitsHorizontally");const T=.7,k=10,C=y.data.map((R,_)=>({data:R,label:o[_].toString()})).filter(R=>R.data.width>0&&R.data.height>0),S=C.map(R=>{const{data:_}=R;let N=_.height*.7;for(;!w(R,N)&&N>0;)N-=1;return N}),E=Math.floor(Math.min(...S)),A=x(R=>v?R.data.x+R.data.width+k:R.data.x+R.data.width-k,"determineLabelXPosition");b.selectAll("text").data(C).enter().append("text").attr("x",A).attr("y",R=>R.data.y+R.data.height/2).attr("text-anchor",v?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${E}px`).text(R=>R.label)}else{let w=function(A,R,_){const{data:N,label:L}=A,P=R*L.length*.7,O=N.x+N.width/2,D=O-P/2,B=O+P/2,F=D>=N.x&&B<=N.x+N.width,z=N.y+_+R<=N.y+N.height;return F&&z};x(w,"fitsInBar");const T=10,k=y.data.map((A,R)=>({data:A,label:o[R].toString()})).filter(A=>A.data.width>0&&A.data.height>0),C=k.map(A=>{const{data:R,label:_}=A;let N=R.width/(_.length*.7);for(;!w(A,N,T)&&N>0;)N-=1;return N}),S=Math.floor(Math.min(...C)),E=x(A=>v?A.data.y-T:A.data.y+T,"determineLabelYPosition");b.selectAll("text").data(k).enter().append("text").attr("x",A=>A.data.x+A.data.width/2).attr("y",E).attr("text-anchor","middle").attr("dominant-baseline",v?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${S}px`).text(A=>A.label)}}break;case"text":b.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",v=>v.fill).attr("font-size",v=>v.fontSize).attr("dominant-baseline",v=>l(v.verticalPos)).attr("text-anchor",v=>u(v.horizontalPos)).attr("transform",v=>h(v)).text(v=>v.text);break;case"path":b.selectAll("path").data(y.data).enter().append("path").attr("d",v=>v.path).attr("fill",v=>v.fill?v.fill:"none").attr("stroke",v=>v.strokeFill).attr("stroke-width",v=>v.strokeWidth);break}}},"draw"),y5r={draw:U5r},b5r={parser:s5r,db:m5r,renderer:y5r};const v5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:b5r},Symbol.toStringTag,{value:"Module"}));var TK=(function(){var t=x(function(re,Y,Q,ue){for(Q=Q||{},ue=re.length;ue--;Q[re[ue]]=Y);return Q},"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],U=[1,37],y=[1,38],b=[1,24],v=[1,31],w=[1,32],T=[1,30],k=[1,39],C=[1,40],S=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],A=[89,90],R=[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],_=[27,29],N=[1,70],L=[1,71],I=[1,72],P=[1,73],O=[1,74],D=[1,75],B=[1,76],F=[1,83],z=[1,80],$=[1,84],V=[1,85],H=[1,86],G=[1,87],K=[1,88],W=[1,89],oe=[1,90],Z=[1,91],J=[1,92],ne=[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],ie=[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],Re=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Pe=[1,110],Ve=[1,106],ce=[1,107],he=[1,108],we=[1,109],ge=[1,111],ze=[1,116],xe=[1,117],Ee=[1,114],qe=[1,115],le={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(Y,Q,ue,X,fe,ee,Ae){var Me=ee.length-1;switch(fe){case 4:this.$=ee[Me].trim(),X.setAccTitle(this.$);break;case 5:case 6:this.$=ee[Me].trim(),X.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:X.setDirection("TB");break;case 18:X.setDirection("BT");break;case 19:X.setDirection("RL");break;case 20:X.setDirection("LR");break;case 21:X.addRequirement(ee[Me-3],ee[Me-4]);break;case 22:X.addRequirement(ee[Me-5],ee[Me-6]),X.setClass([ee[Me-5]],ee[Me-3]);break;case 23:X.setNewReqId(ee[Me-2]);break;case 24:X.setNewReqText(ee[Me-2]);break;case 25:X.setNewReqRisk(ee[Me-2]);break;case 26:X.setNewReqVerifyMethod(ee[Me-2]);break;case 29:this.$=X.RequirementType.REQUIREMENT;break;case 30:this.$=X.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=X.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=X.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=X.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=X.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=X.RiskLevel.LOW_RISK;break;case 36:this.$=X.RiskLevel.MED_RISK;break;case 37:this.$=X.RiskLevel.HIGH_RISK;break;case 38:this.$=X.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=X.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=X.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=X.VerifyType.VERIFY_TEST;break;case 42:X.addElement(ee[Me-3]);break;case 43:X.addElement(ee[Me-5]),X.setClass([ee[Me-5]],ee[Me-3]);break;case 44:X.setNewElementType(ee[Me-2]);break;case 45:X.setNewElementDocRef(ee[Me-2]);break;case 48:X.addRelationship(ee[Me-2],ee[Me],ee[Me-4]);break;case 49:X.addRelationship(ee[Me-2],ee[Me-4],ee[Me]);break;case 50:this.$=X.Relationships.CONTAINS;break;case 51:this.$=X.Relationships.COPIES;break;case 52:this.$=X.Relationships.DERIVES;break;case 53:this.$=X.Relationships.SATISFIES;break;case 54:this.$=X.Relationships.VERIFIES;break;case 55:this.$=X.Relationships.REFINES;break;case 56:this.$=X.Relationships.TRACES;break;case 57:this.$=ee[Me-2],X.defineClass(ee[Me-1],ee[Me]);break;case 58:X.setClass(ee[Me-1],ee[Me]);break;case 59:X.setClass([ee[Me-2]],ee[Me]);break;case 60:case 62:this.$=[ee[Me]];break;case 61:case 63:this.$=ee[Me-2].concat([ee[Me]]);break;case 64:this.$=ee[Me-2],X.setCssStyle(ee[Me-1],ee[Me]);break;case 65:this.$=[ee[Me]];break;case 66:ee[Me-2].push(ee[Me]),this.$=ee[Me-2];break;case 68:this.$=ee[Me-1]+ee[Me];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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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:U,46:y,54:b,72:v,74:w,77:T,89:k,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(S,[2,17]),t(S,[2,18]),t(S,[2,19]),t(S,[2,20]),{30:60,33:62,75:E,89:k,90:C},{30:63,33:62,75:E,89:k,90:C},{30:64,33:62,75:E,89:k,90:C},t(A,[2,29]),t(A,[2,30]),t(A,[2,31]),t(A,[2,32]),t(A,[2,33]),t(A,[2,34]),t(R,[2,81]),t(R,[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(_,[2,79]),t(_,[2,80]),{27:[1,67],29:[1,68]},t(_,[2,85]),t(_,[2,86]),{62:69,65:N,66:L,67:I,68:P,69:O,70:D,71:B},{62:77,65:N,66:L,67:I,68:P,69:O,70:D,71:B},{30:78,33:62,75:E,89:k,90:C},{73:79,75:F,76:z,78:81,79:82,80:$,81:V,82:H,83:G,84:K,85:W,86:oe,87:Z,88:J},t(ne,[2,60]),t(ne,[2,62]),{73:93,75:F,76:z,78:81,79:82,80:$,81:V,82:H,83:G,84:K,85:W,86:oe,87:Z,88:J},{30:94,33:62,75:E,76:z,89:k,90:C},{5:[1,95]},{30:96,33:62,75:E,89:k,90:C},{5:[1,97]},{30:98,33:62,75:E,89:k,90:C},{63:[1,99]},t(ie,[2,50]),t(ie,[2,51]),t(ie,[2,52]),t(ie,[2,53]),t(ie,[2,54]),t(ie,[2,55]),t(ie,[2,56]),{64:[1,100]},t(S,[2,59],{76:z}),t(S,[2,64],{76:me}),{33:103,75:[1,102],89:k,90:C},t(te,[2,65],{79:104,75:F,80:$,81:V,82:H,83:G,84:K,85:W,86:oe,87:Z,88:J}),t(Re,[2,67]),t(Re,[2,69]),t(Re,[2,70]),t(Re,[2,71]),t(Re,[2,72]),t(Re,[2,73]),t(Re,[2,74]),t(Re,[2,75]),t(Re,[2,76]),t(Re,[2,77]),t(Re,[2,78]),t(S,[2,57],{76:me}),t(S,[2,58],{76:z}),{5:Pe,28:105,31:Ve,34:ce,36:he,38:we,40:ge},{27:[1,112],76:z},{5:ze,40:xe,56:113,57:Ee,59:qe},{27:[1,118],76:z},{33:119,89:k,90:C},{33:120,89:k,90:C},{75:F,78:121,79:82,80:$,81:V,82:H,83:G,84:K,85:W,86:oe,87:Z,88:J},t(ne,[2,61]),t(ne,[2,63]),t(Re,[2,68]),t(S,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Pe,28:126,31:Ve,34:ce,36:he,38:we,40:ge},t(S,[2,28]),{5:[1,127]},t(S,[2,42]),{32:[1,128]},{32:[1,129]},{5:ze,40:xe,56:130,57:Ee,59:qe},t(S,[2,47]),{5:[1,131]},t(S,[2,48]),t(S,[2,49]),t(te,[2,66],{79:104,75:F,80:$,81:V,82:H,83:G,84:K,85:W,86:oe,87:Z,88:J}),{33:132,89:k,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(S,[2,27]),{5:Pe,28:145,31:Ve,34:ce,36:he,38:we,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(S,[2,46]),{5:ze,40:xe,56:152,57:Ee,59:qe},{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(S,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(S,[2,43]),{5:Pe,28:159,31:Ve,34:ce,36:he,38:we,40:ge},{5:Pe,28:160,31:Ve,34:ce,36:he,38:we,40:ge},{5:Pe,28:161,31:Ve,34:ce,36:he,38:we,40:ge},{5:Pe,28:162,31:Ve,34:ce,36:he,38:we,40:ge},{5:ze,40:xe,56:163,57:Ee,59:qe},{5:ze,40:xe,56:164,57:Ee,59:qe},t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),t(S,[2,26]),t(S,[2,44]),t(S,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(Y,Q){if(Q.recoverable)this.trace(Y);else{var ue=new Error(Y);throw ue.hash=Q,ue}},"parseError"),parse:x(function(Y){var Q=this,ue=[0],X=[],fe=[null],ee=[],Ae=this.table,Me="",Ke=0,Ne=0,je=2,De=1,Ze=ee.slice.call(arguments,1),Fe=Object.create(this.lexer),at={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(at.yy[_e]=this.yy[_e]);Fe.setInput(Y,at.yy),at.yy.lexer=Fe,at.yy.parser=this,typeof Fe.yylloc>"u"&&(Fe.yylloc={});var gt=Fe.yylloc;ee.push(gt);var Le=Fe.options&&Fe.options.ranges;typeof at.yy.parseError=="function"?this.parseError=at.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(Se){ue.length=ue.length-2*Se,fe.length=fe.length-Se,ee.length=ee.length-Se}x(kt,"popStack");function Et(){var Se;return Se=X.pop()||Fe.lex()||De,typeof Se!="number"&&(Se instanceof Array&&(X=Se,Se=X.pop()),Se=Q.symbols_[Se]||Se),Se}x(Et,"lex");for(var ot,Vt,Lt,dt,ve={},It,xt,mt,Mt;;){if(Vt=ue[ue.length-1],this.defaultActions[Vt]?Lt=this.defaultActions[Vt]:((ot===null||typeof ot>"u")&&(ot=Et()),Lt=Ae[Vt]&&Ae[Vt][ot]),typeof Lt>"u"||!Lt.length||!Lt[0]){var Or="";Mt=[];for(It in Ae[Vt])this.terminals_[It]&&It>je&&Mt.push("'"+this.terminals_[It]+"'");Fe.showPosition?Or="Parse error on line "+(Ke+1)+`: `+Fe.showPosition()+` -Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Or="Parse error on line "+(Ke+1)+": Unexpected "+(ot==Oe?"end of input":"'"+(this.terminals_[ot]||ot)+"'"),this.parseError(Or,{text:Fe.match,token:this.terminals_[ot]||ot,line:Fe.yylineno,loc:gt,expected:Mt})}if(_t[0]instanceof Array&&_t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ht+", token: "+ot);switch(_t[0]){case 1:ue.push(ot),fe.push(Fe.yytext),ee.push(Fe.yylloc),ue.push(_t[1]),ot=null,Ne=Fe.yyleng,Re=Fe.yytext,Ke=Fe.yylineno,gt=Fe.yylloc;break;case 2:if(wt=this.productions_[_t[1]][1],xe.$=fe[fe.length-wt],xe._$={first_line:ee[ee.length-(wt||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(wt||1)].first_column,last_column:ee[ee.length-1].last_column},Le&&(xe._$.range=[ee[ee.length-(wt||1)].range[0],ee[ee.length-1].range[1]]),dt=this.performAction.apply(xe,[Re,Ne,Ke,st.yy,_t[1],fe,ee].concat(Ze)),typeof dt<"u")return dt;wt&&(ue=ue.slice(0,-1*wt*2),fe=fe.slice(0,-1*wt),ee=ee.slice(0,-1*wt)),ue.push(this.productions_[_t[1]][0]),fe.push(xe.$),ee.push(xe._$),mt=Me[ue[ue.length-2]][ue[ue.length-1]],ue.push(mt);break;case 3:return!0}}return!0},"parse")},pe=(function(){var re={EOF:1,parseError:w(function(J,ue){if(this.yy.parser)this.yy.parser.parseError(J,ue);else throw new Error(J)},"parseError"),setInput:w(function(Y,J){return this.yy=J||this.yy||{},this._input=Y,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 Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var J=Y.match(/(?:\r\n?|\n).*/g);return J?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Y},"input"),unput:w(function(Y){var J=Y.length,ue=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-J),this.offset-=J;var X=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 fe=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===X.length?this.yylloc.first_column:0)+X[X.length-ue.length].length-ue[0].length:this.yylloc.first_column-J},this.options.ranges&&(this.yylloc.range=[fe[0],fe[0]+this.yyleng-J]),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(Y){this.unput(this.match.slice(Y))},"less"),pastInput:w(function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var Y=this.match;return Y.length<20&&(Y+=this._input.substr(0,20-Y.length)),(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var Y=this.pastInput(),J=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+` -`+J+"^"},"showPosition"),test_match:w(function(Y,J){var ue,X,fe;if(this.options.backtrack_lexer&&(fe={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&&(fe.yylloc.range=this.yylloc.range.slice(0))),X=Y[0].match(/(?:\r\n?|\n).*/g),X&&(this.yylineno+=X.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:X?X[X.length-1].length-X[X.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Y[0].length},this.yytext+=Y[0],this.match+=Y[0],this.matches=Y,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(Y[0].length),this.matched+=Y[0],ue=this.performAction.call(this,this.yy,this,J,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var ee in fe)this[ee]=fe[ee];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Y,J,ue,X;this._more||(this.yytext="",this.match="");for(var fe=this._currentRules(),ee=0;eeJ[0].length)){if(J=ue,X=ee,this.options.backtrack_lexer){if(Y=this.test_match(ue,fe[ee]),Y!==!1)return Y;if(this._backtrack){J=!1;continue}else return!1}else if(!this.options.flex)break}return J?(Y=this.test_match(J,fe[X]),Y!==!1?Y:!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 J=this.next();return J||this.lex()},"lex"),begin:w(function(J){this.conditionStack.push(J)},"begin"),popState:w(function(){var J=this.conditionStack.length-1;return J>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(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:w(function(J){this.begin(J)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(J,ue,X,fe){switch(X){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 ue.yytext=ue.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 re})();le.lexer=pe;function Ce(){this.yy={}}return w(Ce,"Parser"),Ce.prototype=le,le.Parser=Ce,new Ce})();mK.parser=mK;var Qyr=mK,ZT,Jyr=(ZT=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=qi,this.getAccTitle=ns,this.setAccDescription=is,this.getAccDescription=ss,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getConfig=w(()=>He().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"]}),de.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,Oi()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const s of r)s.includes(",")?i.cssStyles.push(...s.split(",")):i.cssStyles.push(s)}}setClass(e,r){var n;for(const i of e){const s=this.requirements.get(i)??this.elements.get(i);if(s)for(const a of r){s.classes.push(a);const o=(n=this.classes.get(a))==null?void 0:n.styles;o&&s.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(s){if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.requirements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))}),this.elements.forEach(s=>{s.classes.includes(n)&&s.cssStyles.push(...r.flatMap(a=>a.split(",")))})}}getClasses(){return this.classes}getData(){var i,s,a,o;const e=He(),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)??((s=this.elements.get(l.src))==null?void 0:s.name),end:((a=this.requirements.get(l.dst))==null?void 0:a.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(ZT,"RequirementDB"),ZT),evr=w(t=>{const e=xr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:s}=r;if(!(s!=null&&s.length))return"";let a="";for(let o=0;o1)throw new Error("Parse Error: multiple actions possible at state: "+Vt+", token: "+ot);switch(Lt[0]){case 1:ue.push(ot),fe.push(Fe.yytext),ee.push(Fe.yylloc),ue.push(Lt[1]),ot=null,Ne=Fe.yyleng,Me=Fe.yytext,Ke=Fe.yylineno,gt=Fe.yylloc;break;case 2:if(xt=this.productions_[Lt[1]][1],ve.$=fe[fe.length-xt],ve._$={first_line:ee[ee.length-(xt||1)].first_line,last_line:ee[ee.length-1].last_line,first_column:ee[ee.length-(xt||1)].first_column,last_column:ee[ee.length-1].last_column},Le&&(ve._$.range=[ee[ee.length-(xt||1)].range[0],ee[ee.length-1].range[1]]),dt=this.performAction.apply(ve,[Me,Ne,Ke,at.yy,Lt[1],fe,ee].concat(Ze)),typeof dt<"u")return dt;xt&&(ue=ue.slice(0,-1*xt*2),fe=fe.slice(0,-1*xt),ee=ee.slice(0,-1*xt)),ue.push(this.productions_[Lt[1]][0]),fe.push(ve.$),ee.push(ve._$),mt=Ae[ue[ue.length-2]][ue[ue.length-1]],ue.push(mt);break;case 3:return!0}}return!0},"parse")},pe=(function(){var re={EOF:1,parseError:x(function(Q,ue){if(this.yy.parser)this.yy.parser.parseError(Q,ue);else throw new Error(Q)},"parseError"),setInput:x(function(Y,Q){return this.yy=Q||this.yy||{},this._input=Y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var Q=Y.match(/(?:\r\n?|\n).*/g);return Q?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Y},"input"),unput:x(function(Y){var Q=Y.length,ue=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Q),this.offset-=Q;var X=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 fe=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===X.length?this.yylloc.first_column:0)+X[X.length-ue.length].length-ue[0].length:this.yylloc.first_column-Q},this.options.ranges&&(this.yylloc.range=[fe[0],fe[0]+this.yyleng-Q]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Y){this.unput(this.match.slice(Y))},"less"),pastInput:x(function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Y=this.match;return Y.length<20&&(Y+=this._input.substr(0,20-Y.length)),(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Y=this.pastInput(),Q=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+` +`+Q+"^"},"showPosition"),test_match:x(function(Y,Q){var ue,X,fe;if(this.options.backtrack_lexer&&(fe={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&&(fe.yylloc.range=this.yylloc.range.slice(0))),X=Y[0].match(/(?:\r\n?|\n).*/g),X&&(this.yylineno+=X.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:X?X[X.length-1].length-X[X.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Y[0].length},this.yytext+=Y[0],this.match+=Y[0],this.matches=Y,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(Y[0].length),this.matched+=Y[0],ue=this.performAction.call(this,this.yy,this,Q,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var ee in fe)this[ee]=fe[ee];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Y,Q,ue,X;this._more||(this.yytext="",this.match="");for(var fe=this._currentRules(),ee=0;eeQ[0].length)){if(Q=ue,X=ee,this.options.backtrack_lexer){if(Y=this.test_match(ue,fe[ee]),Y!==!1)return Y;if(this._backtrack){Q=!1;continue}else return!1}else if(!this.options.flex)break}return Q?(Y=this.test_match(Q,fe[X]),Y!==!1?Y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Q=this.next();return Q||this.lex()},"lex"),begin:x(function(Q){this.conditionStack.push(Q)},"begin"),popState:x(function(){var Q=this.conditionStack.length-1;return Q>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Q){return Q=this.conditionStack.length-1-Math.abs(Q||0),Q>=0?this.conditionStack[Q]:"INITIAL"},"topState"),pushState:x(function(Q){this.begin(Q)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Q,ue,X,fe){switch(X){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 ue.yytext=ue.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 re})();le.lexer=pe;function Te(){this.yy={}}return x(Te,"Parser"),Te.prototype=le,le.Parser=Te,new Te})();TK.parser=TK;var x5r=TK,tv,w5r=(tv=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=qi,this.getAccTitle=ia,this.setAccDescription=aa,this.getAccDescription=sa,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getConfig=x(()=>He().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"]}),de.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,Oi()}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=He(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(tv,"RequirementDB"),tv),T5r=x(t=>{const e=xr(),{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=xr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${evr(t)} + `;return s},"genColor"),C5r=x(t=>{const e=xr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${T5r(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -4372,16 +4505,16 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ot]||ot)+"'":Or="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),rvr=tvr,uYe={};JO(uYe,{draw:()=>nvr});var nvr=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:s,layout:a,look:o}=He(),l=n.db.getData(),u=pC(e,i);l.type=n.type,l.layoutAlgorithm=a7(a),l.nodeSpacing=(s==null?void 0:s.nodeSpacing)??50,l.rankSpacing=(s==null?void 0:s.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await Y3(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),Ov(u,h,"requirementDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),ivr={parser:Qyr,get db(){return new Jyr},renderer:uYe,styles:rvr};const svr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ivr},Symbol.toStringTag,{value:"Module"}));var yK=(function(){var t=w(function(Ne,je,Oe,Ze){for(Oe=Oe||{},Ze=Ne.length;Ze--;Oe[Ne[Ze]]=je);return Oe},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[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],b=[1,30],x=[1,31],T=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],A=[1,37],M=[1,38],R=[1,39],P=[1,40],N=[1,42],L=[1,43],I=[1,44],$=[1,45],O=[1,46],D=[1,47],B=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],F=[1,81],H=[1,82],G=[1,83],W=[1,84],K=[1,85],q=[1,86],oe=[1,87],Z=[1,88],Q=[1,89],ne=[1,90],ie=[1,91],me=[1,92],te=[1,93],_e=[1,94],$e=[1,95],Ve=[1,96],ce=[1,97],he=[1,98],Te=[1,99],ge=[1,100],ze=[1,101],we=[1,102],Ae=[1,103],qe=[1,104],le=[1,105],pe=[2,78],Ce=[4,5,17,51,53,54],re=[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],Y=[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],J=[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],ue=[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],X=[5,52],fe=[70,71,72,73],ee=[1,151],Me={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(je,Oe,Ze,Fe,st,Pe,gt){var Le=Pe.length-1;switch(st){case 3:return Fe.apply(Pe[Le]),Pe[Le];case 4:case 10:this.$=[];break;case 5:case 11:Pe[Le-1].push(Pe[Le]),this.$=Pe[Le-1];break;case 6:case 7:case 12:case 13:this.$=Pe[Le];break;case 8:case 9:case 14:this.$=[];break;case 16:Pe[Le].type="createParticipant",this.$=Pe[Le];break;case 17:Pe[Le-1].unshift({type:"boxStart",boxData:Fe.parseBoxData(Pe[Le-2])}),Pe[Le-1].push({type:"boxEnd",boxText:Pe[Le-2]}),this.$=Pe[Le-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Le-2]),sequenceIndexStep:Number(Pe[Le-1]),sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Le-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Fe.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Fe.LINETYPE.ACTIVE_START,actor:Pe[Le-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Fe.LINETYPE.ACTIVE_END,actor:Pe[Le-1].actor};break;case 30:Fe.setDiagramTitle(Pe[Le].substring(6)),this.$=Pe[Le].substring(6);break;case 31:Fe.setDiagramTitle(Pe[Le].substring(7)),this.$=Pe[Le].substring(7);break;case 32:this.$=Pe[Le].trim(),Fe.setAccTitle(this.$);break;case 33:case 34:this.$=Pe[Le].trim(),Fe.setAccDescription(this.$);break;case 35:Pe[Le-1].unshift({type:"loopStart",loopText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.LOOP_START}),Pe[Le-1].push({type:"loopEnd",loopText:Pe[Le-2],signalType:Fe.LINETYPE.LOOP_END}),this.$=Pe[Le-1];break;case 36:Pe[Le-1].unshift({type:"rectStart",color:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.RECT_START}),Pe[Le-1].push({type:"rectEnd",color:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.RECT_END}),this.$=Pe[Le-1];break;case 37:Pe[Le-1].unshift({type:"optStart",optText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.OPT_START}),Pe[Le-1].push({type:"optEnd",optText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.OPT_END}),this.$=Pe[Le-1];break;case 38:Pe[Le-1].unshift({type:"altStart",altText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.ALT_START}),Pe[Le-1].push({type:"altEnd",signalType:Fe.LINETYPE.ALT_END}),this.$=Pe[Le-1];break;case 39:Pe[Le-1].unshift({type:"parStart",parText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.PAR_START}),Pe[Le-1].push({type:"parEnd",signalType:Fe.LINETYPE.PAR_END}),this.$=Pe[Le-1];break;case 40:Pe[Le-1].unshift({type:"parStart",parText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.PAR_OVER_START}),Pe[Le-1].push({type:"parEnd",signalType:Fe.LINETYPE.PAR_END}),this.$=Pe[Le-1];break;case 41:Pe[Le-1].unshift({type:"criticalStart",criticalText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.CRITICAL_START}),Pe[Le-1].push({type:"criticalEnd",signalType:Fe.LINETYPE.CRITICAL_END}),this.$=Pe[Le-1];break;case 42:Pe[Le-1].unshift({type:"breakStart",breakText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.BREAK_START}),Pe[Le-1].push({type:"breakEnd",optText:Fe.parseMessage(Pe[Le-2]),signalType:Fe.LINETYPE.BREAK_END}),this.$=Pe[Le-1];break;case 44:this.$=Pe[Le-3].concat([{type:"option",optionText:Fe.parseMessage(Pe[Le-1]),signalType:Fe.LINETYPE.CRITICAL_OPTION},Pe[Le]]);break;case 46:this.$=Pe[Le-3].concat([{type:"and",parText:Fe.parseMessage(Pe[Le-1]),signalType:Fe.LINETYPE.PAR_AND},Pe[Le]]);break;case 48:this.$=Pe[Le-3].concat([{type:"else",altText:Fe.parseMessage(Pe[Le-1]),signalType:Fe.LINETYPE.ALT_ELSE},Pe[Le]]);break;case 49:Pe[Le-3].draw="participant",Pe[Le-3].type="addParticipant",Pe[Le-3].description=Fe.parseMessage(Pe[Le-1]),this.$=Pe[Le-3];break;case 50:Pe[Le-1].draw="participant",Pe[Le-1].type="addParticipant",this.$=Pe[Le-1];break;case 51:Pe[Le-3].draw="actor",Pe[Le-3].type="addParticipant",Pe[Le-3].description=Fe.parseMessage(Pe[Le-1]),this.$=Pe[Le-3];break;case 52:case 57:Pe[Le-1].draw="actor",Pe[Le-1].type="addParticipant",this.$=Pe[Le-1];break;case 53:Pe[Le-1].type="destroyParticipant",this.$=Pe[Le-1];break;case 54:Pe[Le-3].draw="participant",Pe[Le-3].type="addParticipant",Pe[Le-3].description=Fe.parseMessage(Pe[Le-1]),this.$=Pe[Le-3];break;case 55:Pe[Le-1].draw="participant",Pe[Le-1].type="addParticipant",this.$=Pe[Le-1];break;case 56:Pe[Le-3].draw="actor",Pe[Le-3].type="addParticipant",Pe[Le-3].description=Fe.parseMessage(Pe[Le-1]),this.$=Pe[Le-3];break;case 58:this.$=[Pe[Le-1],{type:"addNote",placement:Pe[Le-2],actor:Pe[Le-1].actor,text:Pe[Le]}];break;case 59:Pe[Le-2]=[].concat(Pe[Le-1],Pe[Le-1]).slice(0,2),Pe[Le-2][0]=Pe[Le-2][0].actor,Pe[Le-2][1]=Pe[Le-2][1].actor,this.$=[Pe[Le-1],{type:"addNote",placement:Fe.PLACEMENT.OVER,actor:Pe[Le-2].slice(0,2),text:Pe[Le]}];break;case 60:this.$=[Pe[Le-1],{type:"addLinks",actor:Pe[Le-1].actor,text:Pe[Le]}];break;case 61:this.$=[Pe[Le-1],{type:"addALink",actor:Pe[Le-1].actor,text:Pe[Le]}];break;case 62:this.$=[Pe[Le-1],{type:"addProperties",actor:Pe[Le-1].actor,text:Pe[Le]}];break;case 63:this.$=[Pe[Le-1],{type:"addDetails",actor:Pe[Le-1].actor,text:Pe[Le]}];break;case 66:this.$=[Pe[Le-2],Pe[Le]];break;case 67:this.$=Pe[Le];break;case 68:this.$=Fe.PLACEMENT.LEFTOF;break;case 69:this.$=Fe.PLACEMENT.RIGHTOF;break;case 70:this.$=[Pe[Le-4],Pe[Le-1],{type:"addMessage",from:Pe[Le-4].actor,to:Pe[Le-1].actor,signalType:Pe[Le-3],msg:Pe[Le],activate:!0},{type:"activeStart",signalType:Fe.LINETYPE.ACTIVE_START,actor:Pe[Le-1].actor}];break;case 71:this.$=[Pe[Le-4],Pe[Le-1],{type:"addMessage",from:Pe[Le-4].actor,to:Pe[Le-1].actor,signalType:Pe[Le-3],msg:Pe[Le]},{type:"activeEnd",signalType:Fe.LINETYPE.ACTIVE_END,actor:Pe[Le-4].actor}];break;case 72:this.$=[Pe[Le-4],Pe[Le-1],{type:"addMessage",from:Pe[Le-4].actor,to:Pe[Le-1].actor,signalType:Pe[Le-3],msg:Pe[Le],activate:!0,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Fe.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Le-1].actor}];break;case 73:this.$=[Pe[Le-4],Pe[Le-1],{type:"addMessage",from:Pe[Le-4].actor,to:Pe[Le-1].actor,signalType:Pe[Le-2],msg:Pe[Le],activate:!1,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Le-4].actor}];break;case 74:this.$=[Pe[Le-5],Pe[Le-1],{type:"addMessage",from:Pe[Le-5].actor,to:Pe[Le-1].actor,signalType:Pe[Le-3],msg:Pe[Le],activate:!0,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Fe.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Le-1].actor},{type:"centralConnectionReverse",signalType:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Le-5].actor}];break;case 75:this.$=[Pe[Le-3],Pe[Le-1],{type:"addMessage",from:Pe[Le-3].actor,to:Pe[Le-1].actor,signalType:Pe[Le-2],msg:Pe[Le]}];break;case 76:this.$={type:"addParticipant",actor:Pe[Le-1],config:Pe[Le]};break;case 77:this.$=Pe[Le-1].trim();break;case 78:this.$={type:"addParticipant",actor:Pe[Le]};break;case 79:this.$=Fe.LINETYPE.SOLID_OPEN;break;case 80:this.$=Fe.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Fe.LINETYPE.SOLID;break;case 82:this.$=Fe.LINETYPE.SOLID_TOP;break;case 83:this.$=Fe.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Fe.LINETYPE.STICK_TOP;break;case 85:this.$=Fe.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Fe.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Fe.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Fe.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Fe.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Fe.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Fe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Fe.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Fe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Fe.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Fe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Fe.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Fe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Fe.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Fe.LINETYPE.DOTTED;break;case 100:this.$=Fe.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Fe.LINETYPE.SOLID_CROSS;break;case 102:this.$=Fe.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Fe.LINETYPE.SOLID_POINT;break;case 104:this.$=Fe.LINETYPE.DOTTED_POINT;break;case 105:this.$=Fe.parseMessage(Pe[Le].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:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(B,[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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),t(B,[2,15]),{13:49,51:M,53:R,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:D},{23:56,73:D},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(B,[2,30]),t(B,[2,31]),{33:[1,62]},{35:[1,63]},t(B,[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:D},{69:78,72:[1,79],78:V,79:F,80:H,81:G,82:W,83:K,84:q,85:oe,86:Z,87:Q,88:ne,89:ie,90:me,91:te,92:_e,93:$e,94:Ve,95:ce,96:he,97:Te,98:ge,99:ze,100:we,101:Ae,102:qe,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:D},{23:111,73:D},{23:112,73:D},{23:113,73:D},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(B,[2,6]),t(B,[2,16]),t(Ce,[2,10],{11:114}),t(B,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(B,[2,22]),{5:[1,118]},{5:[1,119]},t(B,[2,25]),t(B,[2,26]),t(B,[2,27]),t(B,[2,28]),t(B,[2,29]),t(B,[2,32]),t(B,[2,33]),t(re,i,{7:120}),t(re,i,{7:121}),t(re,i,{7:122}),t(Y,i,{41:123,7:124}),t(J,i,{43:125,7:126}),t(J,i,{7:126,43:127}),t(ue,i,{46:128,7:129}),t(re,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(X,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:D},{69:146,78:V,79:F,80:H,81:G,82:W,83:K,84:q,85:oe,86:Z,87:Q,88:ne,89:ie,90:me,91:te,92:_e,93:$e,94:Ve,95:ce,96:he,97:Te,98:ge,99:ze,100:we,101:Ae,102:qe,103:le},t(fe,[2,79]),t(fe,[2,80]),t(fe,[2,81]),t(fe,[2,82]),t(fe,[2,83]),t(fe,[2,84]),t(fe,[2,85]),t(fe,[2,86]),t(fe,[2,87]),t(fe,[2,88]),t(fe,[2,89]),t(fe,[2,90]),t(fe,[2,91]),t(fe,[2,92]),t(fe,[2,93]),t(fe,[2,94]),t(fe,[2,95]),t(fe,[2,96]),t(fe,[2,97]),t(fe,[2,98]),t(fe,[2,99]),t(fe,[2,100]),t(fe,[2,101]),t(fe,[2,102]),t(fe,[2,103]),t(fe,[2,104]),{23:147,73:D},{23:149,60:148,73:D},{73:[2,68]},{73:[2,69]},{58:150,104:ee},{58:152,104:ee},{58:153,104:ee},{58:154,104:ee},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:M,53:R,54:P},{5:[1,160]},t(B,[2,20]),t(B,[2,21]),t(B,[2,23]),t(B,[2,24]),{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,164]},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,50:[1,165],51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,166]},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,49:[1,167],51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{17:[1,168]},{17:[1,169]},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,48:[1,170],51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{4:s,5:a,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:b,38:x,39:T,40:C,42:S,44:k,45:E,47:A,51:M,53:R,54:P,56:N,61:L,62:I,63:$,64:O,73:D},{16:[1,172]},t(B,[2,50]),{16:[1,173]},t(B,[2,55]),t(X,[2,76]),{76:[1,174]},{16:[1,175]},t(B,[2,52]),{16:[1,176]},t(B,[2,57]),t(B,[2,53]),{23:177,73:D},{23:178,73:D},{23:179,73:D},{58:180,104:ee},{23:181,72:[1,182],73:D},{58:183,104:ee},{58:184,104:ee},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(B,[2,17]),t(Ce,[2,11]),{13:186,51:M,53:R,54:P},t(Ce,[2,13]),t(Ce,[2,14]),t(B,[2,19]),t(B,[2,35]),t(B,[2,36]),t(B,[2,37]),t(B,[2,38]),{16:[1,187]},t(B,[2,39]),{16:[1,188]},t(B,[2,40]),t(B,[2,41]),{16:[1,189]},t(B,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ee},{58:196,104:ee},{58:197,104:ee},{5:[2,75]},{58:198,104:ee},{23:199,73:D},{5:[2,58]},{5:[2,59]},{23:200,73:D},t(Ce,[2,12]),t(Y,i,{7:124,41:201}),t(J,i,{7:126,43:202}),t(ue,i,{7:129,46:203}),t(B,[2,49]),t(B,[2,54]),t(X,[2,77]),t(B,[2,51]),t(B,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ee},{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(je,Oe){if(Oe.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=Oe,Ze}},"parseError"),parse:w(function(je){var Oe=this,Ze=[0],Fe=[],st=[null],Pe=[],gt=this.table,Le="",kt=0,Et=0,ot=2,Ht=1,_t=Pe.slice.call(arguments,1),dt=Object.create(this.lexer),xe={yy:{}};for(var Lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Lt)&&(xe.yy[Lt]=this.yy[Lt]);dt.setInput(je,xe.yy),xe.yy.lexer=dt,xe.yy.parser=this,typeof dt.yylloc>"u"&&(dt.yylloc={});var wt=dt.yylloc;Pe.push(wt);var mt=dt.options&&dt.options.ranges;typeof xe.yy.parseError=="function"?this.parseError=xe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(Cr){Ze.length=Ze.length-2*Cr,st.length=st.length-Cr,Pe.length=Pe.length-Cr}w(Mt,"popStack");function Or(){var Cr;return Cr=Fe.pop()||dt.lex()||Ht,typeof Cr!="number"&&(Cr instanceof Array&&(Fe=Cr,Cr=Fe.pop()),Cr=Oe.symbols_[Cr]||Cr),Cr}w(Or,"lex");for(var Ee,it,pt,bt,nr={},$r,kr,jr,Er;;){if(it=Ze[Ze.length-1],this.defaultActions[it]?pt=this.defaultActions[it]:((Ee===null||typeof Ee>"u")&&(Ee=Or()),pt=gt[it]&>[it][Ee]),typeof pt>"u"||!pt.length||!pt[0]){var nn="";Er=[];for($r in gt[it])this.terminals_[$r]&&$r>ot&&Er.push("'"+this.terminals_[$r]+"'");dt.showPosition?nn="Parse error on line "+(kt+1)+`: +`},"getStyles"),k5r=C5r,TYe={};rO(TYe,{draw:()=>S5r});var S5r=x(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=He(),l=n.db.getData(),u=U9(e,i);l.type=n.type,l.layoutAlgorithm=uk(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 Z4(l,u);const h=8;Kr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),P5(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),E5r={parser:x5r,get db(){return new w5r},renderer:TYe,styles:k5r};const A5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:E5r},Symbol.toStringTag,{value:"Module"}));var CK=(function(){var t=x(function(Ne,je,De,Ze){for(De=De||{},Ze=Ne.length;Ze--;De[Ne[Ze]]=je);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],U=[1,28],y=[1,29],b=[1,30],v=[1,31],w=[1,32],T=[1,33],k=[1,34],C=[1,35],S=[1,36],E=[1,37],A=[1,38],R=[1,39],_=[1,40],N=[1,42],L=[1,43],I=[1,44],P=[1,45],O=[1,46],D=[1,47],B=[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],F=[1,74],z=[1,80],$=[1,81],V=[1,82],H=[1,83],G=[1,84],K=[1,85],W=[1,86],oe=[1,87],Z=[1,88],J=[1,89],ne=[1,90],ie=[1,91],me=[1,92],te=[1,93],Re=[1,94],Pe=[1,95],Ve=[1,96],ce=[1,97],he=[1,98],we=[1,99],ge=[1,100],ze=[1,101],xe=[1,102],Ee=[1,103],qe=[1,104],le=[1,105],pe=[2,78],Te=[4,5,17,51,53,54],re=[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],Y=[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],Q=[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],ue=[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],X=[5,52],fe=[70,71,72,73],ee=[1,151],Ae={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(je,De,Ze,Fe,at,_e,gt){var Le=_e.length-1;switch(at){case 3:return Fe.apply(_e[Le]),_e[Le];case 4:case 10:this.$=[];break;case 5:case 11:_e[Le-1].push(_e[Le]),this.$=_e[Le-1];break;case 6:case 7:case 12:case 13:this.$=_e[Le];break;case 8:case 9:case 14:this.$=[];break;case 16:_e[Le].type="createParticipant",this.$=_e[Le];break;case 17:_e[Le-1].unshift({type:"boxStart",boxData:Fe.parseBoxData(_e[Le-2])}),_e[Le-1].push({type:"boxEnd",boxText:_e[Le-2]}),this.$=_e[Le-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(_e[Le-2]),sequenceIndexStep:Number(_e[Le-1]),sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(_e[Le-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:Fe.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:Fe.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Fe.LINETYPE.ACTIVE_START,actor:_e[Le-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Fe.LINETYPE.ACTIVE_END,actor:_e[Le-1].actor};break;case 30:Fe.setDiagramTitle(_e[Le].substring(6)),this.$=_e[Le].substring(6);break;case 31:Fe.setDiagramTitle(_e[Le].substring(7)),this.$=_e[Le].substring(7);break;case 32:this.$=_e[Le].trim(),Fe.setAccTitle(this.$);break;case 33:case 34:this.$=_e[Le].trim(),Fe.setAccDescription(this.$);break;case 35:_e[Le-1].unshift({type:"loopStart",loopText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.LOOP_START}),_e[Le-1].push({type:"loopEnd",loopText:_e[Le-2],signalType:Fe.LINETYPE.LOOP_END}),this.$=_e[Le-1];break;case 36:_e[Le-1].unshift({type:"rectStart",color:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.RECT_START}),_e[Le-1].push({type:"rectEnd",color:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.RECT_END}),this.$=_e[Le-1];break;case 37:_e[Le-1].unshift({type:"optStart",optText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.OPT_START}),_e[Le-1].push({type:"optEnd",optText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.OPT_END}),this.$=_e[Le-1];break;case 38:_e[Le-1].unshift({type:"altStart",altText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.ALT_START}),_e[Le-1].push({type:"altEnd",signalType:Fe.LINETYPE.ALT_END}),this.$=_e[Le-1];break;case 39:_e[Le-1].unshift({type:"parStart",parText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.PAR_START}),_e[Le-1].push({type:"parEnd",signalType:Fe.LINETYPE.PAR_END}),this.$=_e[Le-1];break;case 40:_e[Le-1].unshift({type:"parStart",parText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.PAR_OVER_START}),_e[Le-1].push({type:"parEnd",signalType:Fe.LINETYPE.PAR_END}),this.$=_e[Le-1];break;case 41:_e[Le-1].unshift({type:"criticalStart",criticalText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.CRITICAL_START}),_e[Le-1].push({type:"criticalEnd",signalType:Fe.LINETYPE.CRITICAL_END}),this.$=_e[Le-1];break;case 42:_e[Le-1].unshift({type:"breakStart",breakText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.BREAK_START}),_e[Le-1].push({type:"breakEnd",optText:Fe.parseMessage(_e[Le-2]),signalType:Fe.LINETYPE.BREAK_END}),this.$=_e[Le-1];break;case 44:this.$=_e[Le-3].concat([{type:"option",optionText:Fe.parseMessage(_e[Le-1]),signalType:Fe.LINETYPE.CRITICAL_OPTION},_e[Le]]);break;case 46:this.$=_e[Le-3].concat([{type:"and",parText:Fe.parseMessage(_e[Le-1]),signalType:Fe.LINETYPE.PAR_AND},_e[Le]]);break;case 48:this.$=_e[Le-3].concat([{type:"else",altText:Fe.parseMessage(_e[Le-1]),signalType:Fe.LINETYPE.ALT_ELSE},_e[Le]]);break;case 49:_e[Le-3].draw="participant",_e[Le-3].type="addParticipant",_e[Le-3].description=Fe.parseMessage(_e[Le-1]),this.$=_e[Le-3];break;case 50:_e[Le-1].draw="participant",_e[Le-1].type="addParticipant",this.$=_e[Le-1];break;case 51:_e[Le-3].draw="actor",_e[Le-3].type="addParticipant",_e[Le-3].description=Fe.parseMessage(_e[Le-1]),this.$=_e[Le-3];break;case 52:case 57:_e[Le-1].draw="actor",_e[Le-1].type="addParticipant",this.$=_e[Le-1];break;case 53:_e[Le-1].type="destroyParticipant",this.$=_e[Le-1];break;case 54:_e[Le-3].draw="participant",_e[Le-3].type="addParticipant",_e[Le-3].description=Fe.parseMessage(_e[Le-1]),this.$=_e[Le-3];break;case 55:_e[Le-1].draw="participant",_e[Le-1].type="addParticipant",this.$=_e[Le-1];break;case 56:_e[Le-3].draw="actor",_e[Le-3].type="addParticipant",_e[Le-3].description=Fe.parseMessage(_e[Le-1]),this.$=_e[Le-3];break;case 58:this.$=[_e[Le-1],{type:"addNote",placement:_e[Le-2],actor:_e[Le-1].actor,text:_e[Le]}];break;case 59:_e[Le-2]=[].concat(_e[Le-1],_e[Le-1]).slice(0,2),_e[Le-2][0]=_e[Le-2][0].actor,_e[Le-2][1]=_e[Le-2][1].actor,this.$=[_e[Le-1],{type:"addNote",placement:Fe.PLACEMENT.OVER,actor:_e[Le-2].slice(0,2),text:_e[Le]}];break;case 60:this.$=[_e[Le-1],{type:"addLinks",actor:_e[Le-1].actor,text:_e[Le]}];break;case 61:this.$=[_e[Le-1],{type:"addALink",actor:_e[Le-1].actor,text:_e[Le]}];break;case 62:this.$=[_e[Le-1],{type:"addProperties",actor:_e[Le-1].actor,text:_e[Le]}];break;case 63:this.$=[_e[Le-1],{type:"addDetails",actor:_e[Le-1].actor,text:_e[Le]}];break;case 66:this.$=[_e[Le-2],_e[Le]];break;case 67:this.$=_e[Le];break;case 68:this.$=Fe.PLACEMENT.LEFTOF;break;case 69:this.$=Fe.PLACEMENT.RIGHTOF;break;case 70:this.$=[_e[Le-4],_e[Le-1],{type:"addMessage",from:_e[Le-4].actor,to:_e[Le-1].actor,signalType:_e[Le-3],msg:_e[Le],activate:!0},{type:"activeStart",signalType:Fe.LINETYPE.ACTIVE_START,actor:_e[Le-1].actor}];break;case 71:this.$=[_e[Le-4],_e[Le-1],{type:"addMessage",from:_e[Le-4].actor,to:_e[Le-1].actor,signalType:_e[Le-3],msg:_e[Le]},{type:"activeEnd",signalType:Fe.LINETYPE.ACTIVE_END,actor:_e[Le-4].actor}];break;case 72:this.$=[_e[Le-4],_e[Le-1],{type:"addMessage",from:_e[Le-4].actor,to:_e[Le-1].actor,signalType:_e[Le-3],msg:_e[Le],activate:!0,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Fe.LINETYPE.CENTRAL_CONNECTION,actor:_e[Le-1].actor}];break;case 73:this.$=[_e[Le-4],_e[Le-1],{type:"addMessage",from:_e[Le-4].actor,to:_e[Le-1].actor,signalType:_e[Le-2],msg:_e[Le],activate:!1,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:_e[Le-4].actor}];break;case 74:this.$=[_e[Le-5],_e[Le-1],{type:"addMessage",from:_e[Le-5].actor,to:_e[Le-1].actor,signalType:_e[Le-3],msg:_e[Le],activate:!0,centralConnection:Fe.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Fe.LINETYPE.CENTRAL_CONNECTION,actor:_e[Le-1].actor},{type:"centralConnectionReverse",signalType:Fe.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:_e[Le-5].actor}];break;case 75:this.$=[_e[Le-3],_e[Le-1],{type:"addMessage",from:_e[Le-3].actor,to:_e[Le-1].actor,signalType:_e[Le-2],msg:_e[Le]}];break;case 76:this.$={type:"addParticipant",actor:_e[Le-1],config:_e[Le]};break;case 77:this.$=_e[Le-1].trim();break;case 78:this.$={type:"addParticipant",actor:_e[Le]};break;case 79:this.$=Fe.LINETYPE.SOLID_OPEN;break;case 80:this.$=Fe.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Fe.LINETYPE.SOLID;break;case 82:this.$=Fe.LINETYPE.SOLID_TOP;break;case 83:this.$=Fe.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Fe.LINETYPE.STICK_TOP;break;case 85:this.$=Fe.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Fe.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Fe.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Fe.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Fe.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Fe.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Fe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Fe.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Fe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Fe.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Fe.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Fe.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Fe.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Fe.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Fe.LINETYPE.DOTTED;break;case 100:this.$=Fe.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Fe.LINETYPE.SOLID_CROSS;break;case 102:this.$=Fe.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Fe.LINETYPE.SOLID_POINT;break;case 104:this.$=Fe.LINETYPE.DOTTED_POINT;break;case 105:this.$=Fe.parseMessage(_e[Le].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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},t(B,[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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},t(B,[2,7]),t(B,[2,8]),t(B,[2,9]),t(B,[2,15]),{13:49,51:A,53:R,54:_},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:D},{23:56,73:D},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(B,[2,30]),t(B,[2,31]),{33:[1,62]},{35:[1,63]},t(B,[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:F},{23:75,55:76,73:F},{23:77,73:D},{69:78,72:[1,79],78:z,79:$,80:V,81:H,82:G,83:K,84:W,85:oe,86:Z,87:J,88:ne,89:ie,90:me,91:te,92:Re,93:Pe,94:Ve,95:ce,96:he,97:we,98:ge,99:ze,100:xe,101:Ee,102:qe,103:le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:D},{23:111,73:D},{23:112,73:D},{23:113,73:D},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(B,[2,6]),t(B,[2,16]),t(Te,[2,10],{11:114}),t(B,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(B,[2,22]),{5:[1,118]},{5:[1,119]},t(B,[2,25]),t(B,[2,26]),t(B,[2,27]),t(B,[2,28]),t(B,[2,29]),t(B,[2,32]),t(B,[2,33]),t(re,i,{7:120}),t(re,i,{7:121}),t(re,i,{7:122}),t(Y,i,{41:123,7:124}),t(Q,i,{43:125,7:126}),t(Q,i,{7:126,43:127}),t(ue,i,{46:128,7:129}),t(re,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(X,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:D},{69:146,78:z,79:$,80:V,81:H,82:G,83:K,84:W,85:oe,86:Z,87:J,88:ne,89:ie,90:me,91:te,92:Re,93:Pe,94:Ve,95:ce,96:he,97:we,98:ge,99:ze,100:xe,101:Ee,102:qe,103:le},t(fe,[2,79]),t(fe,[2,80]),t(fe,[2,81]),t(fe,[2,82]),t(fe,[2,83]),t(fe,[2,84]),t(fe,[2,85]),t(fe,[2,86]),t(fe,[2,87]),t(fe,[2,88]),t(fe,[2,89]),t(fe,[2,90]),t(fe,[2,91]),t(fe,[2,92]),t(fe,[2,93]),t(fe,[2,94]),t(fe,[2,95]),t(fe,[2,96]),t(fe,[2,97]),t(fe,[2,98]),t(fe,[2,99]),t(fe,[2,100]),t(fe,[2,101]),t(fe,[2,102]),t(fe,[2,103]),t(fe,[2,104]),{23:147,73:D},{23:149,60:148,73:D},{73:[2,68]},{73:[2,69]},{58:150,104:ee},{58:152,104:ee},{58:153,104:ee},{58:154,104:ee},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:A,53:R,54:_},{5:[1,160]},t(B,[2,20]),t(B,[2,21]),t(B,[2,23]),t(B,[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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,50:[1,165],51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,49:[1,167],51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,48:[1,170],51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{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:U,36:y,37:b,38:v,39:w,40:T,42:k,44:C,45:S,47:E,51:A,53:R,54:_,56:N,61:L,62:I,63:P,64:O,73:D},{16:[1,172]},t(B,[2,50]),{16:[1,173]},t(B,[2,55]),t(X,[2,76]),{76:[1,174]},{16:[1,175]},t(B,[2,52]),{16:[1,176]},t(B,[2,57]),t(B,[2,53]),{23:177,73:D},{23:178,73:D},{23:179,73:D},{58:180,104:ee},{23:181,72:[1,182],73:D},{58:183,104:ee},{58:184,104:ee},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(B,[2,17]),t(Te,[2,11]),{13:186,51:A,53:R,54:_},t(Te,[2,13]),t(Te,[2,14]),t(B,[2,19]),t(B,[2,35]),t(B,[2,36]),t(B,[2,37]),t(B,[2,38]),{16:[1,187]},t(B,[2,39]),{16:[1,188]},t(B,[2,40]),t(B,[2,41]),{16:[1,189]},t(B,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ee},{58:196,104:ee},{58:197,104:ee},{5:[2,75]},{58:198,104:ee},{23:199,73:D},{5:[2,58]},{5:[2,59]},{23:200,73:D},t(Te,[2,12]),t(Y,i,{7:124,41:201}),t(Q,i,{7:126,43:202}),t(ue,i,{7:129,46:203}),t(B,[2,49]),t(B,[2,54]),t(X,[2,77]),t(B,[2,51]),t(B,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ee},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(je,De){if(De.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=De,Ze}},"parseError"),parse:x(function(je){var De=this,Ze=[0],Fe=[],at=[null],_e=[],gt=this.table,Le="",kt=0,Et=0,ot=2,Vt=1,Lt=_e.slice.call(arguments,1),dt=Object.create(this.lexer),ve={yy:{}};for(var It in this.yy)Object.prototype.hasOwnProperty.call(this.yy,It)&&(ve.yy[It]=this.yy[It]);dt.setInput(je,ve.yy),ve.yy.lexer=dt,ve.yy.parser=this,typeof dt.yylloc>"u"&&(dt.yylloc={});var xt=dt.yylloc;_e.push(xt);var mt=dt.options&&dt.options.ranges;typeof ve.yy.parseError=="function"?this.parseError=ve.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(Cr){Ze.length=Ze.length-2*Cr,at.length=at.length-Cr,_e.length=_e.length-Cr}x(Mt,"popStack");function Or(){var Cr;return Cr=Fe.pop()||dt.lex()||Vt,typeof Cr!="number"&&(Cr instanceof Array&&(Fe=Cr,Cr=Fe.pop()),Cr=De.symbols_[Cr]||Cr),Cr}x(Or,"lex");for(var Se,it,pt,bt,ir={},Br,kr,jr,Er;;){if(it=Ze[Ze.length-1],this.defaultActions[it]?pt=this.defaultActions[it]:((Se===null||typeof Se>"u")&&(Se=Or()),pt=gt[it]&>[it][Se]),typeof pt>"u"||!pt.length||!pt[0]){var an="";Er=[];for(Br in gt[it])this.terminals_[Br]&&Br>ot&&Er.push("'"+this.terminals_[Br]+"'");dt.showPosition?an="Parse error on line "+(kt+1)+`: `+dt.showPosition()+` -Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse error on line "+(kt+1)+": Unexpected "+(Ee==Ht?"end of input":"'"+(this.terminals_[Ee]||Ee)+"'"),this.parseError(nn,{text:dt.match,token:this.terminals_[Ee]||Ee,line:dt.yylineno,loc:wt,expected:Er})}if(pt[0]instanceof Array&&pt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+it+", token: "+Ee);switch(pt[0]){case 1:Ze.push(Ee),st.push(dt.yytext),Pe.push(dt.yylloc),Ze.push(pt[1]),Ee=null,Et=dt.yyleng,Le=dt.yytext,kt=dt.yylineno,wt=dt.yylloc;break;case 2:if(kr=this.productions_[pt[1]][1],nr.$=st[st.length-kr],nr._$={first_line:Pe[Pe.length-(kr||1)].first_line,last_line:Pe[Pe.length-1].last_line,first_column:Pe[Pe.length-(kr||1)].first_column,last_column:Pe[Pe.length-1].last_column},mt&&(nr._$.range=[Pe[Pe.length-(kr||1)].range[0],Pe[Pe.length-1].range[1]]),bt=this.performAction.apply(nr,[Le,Et,kt,xe.yy,pt[1],st,Pe].concat(_t)),typeof bt<"u")return bt;kr&&(Ze=Ze.slice(0,-1*kr*2),st=st.slice(0,-1*kr),Pe=Pe.slice(0,-1*kr)),Ze.push(this.productions_[pt[1]][0]),st.push(nr.$),Pe.push(nr._$),jr=gt[Ze[Ze.length-2]][Ze[Ze.length-1]],Ze.push(jr);break;case 3:return!0}}return!0},"parse")},Re=(function(){var Ne={EOF:1,parseError:w(function(Oe,Ze){if(this.yy.parser)this.yy.parser.parseError(Oe,Ze);else throw new Error(Oe)},"parseError"),setInput:w(function(je,Oe){return this.yy=Oe||this.yy||{},this._input=je,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 je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var Oe=je.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),je},"input"),unput:w(function(je){var Oe=je.length,Ze=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Oe),this.offset-=Oe;var Fe=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),Ze.length-1&&(this.yylineno-=Ze.length-1);var st=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:Ze?(Ze.length===Fe.length?this.yylloc.first_column:0)+Fe[Fe.length-Ze.length].length-Ze[0].length:this.yylloc.first_column-Oe},this.options.ranges&&(this.yylloc.range=[st[0],st[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(je){this.unput(this.match.slice(je))},"less"),pastInput:w(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var je=this.pastInput(),Oe=new Array(je.length+1).join("-");return je+this.upcomingInput()+` -`+Oe+"^"},"showPosition"),test_match:w(function(je,Oe){var Ze,Fe,st;if(this.options.backtrack_lexer&&(st={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&&(st.yylloc.range=this.yylloc.range.slice(0))),Fe=je[0].match(/(?:\r\n?|\n).*/g),Fe&&(this.yylineno+=Fe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Fe?Fe[Fe.length-1].length-Fe[Fe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,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(je[0].length),this.matched+=je[0],Ze=this.performAction.call(this,this.yy,this,Oe,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ze)return Ze;if(this._backtrack){for(var Pe in st)this[Pe]=st[Pe];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,Oe,Ze,Fe;this._more||(this.yytext="",this.match="");for(var st=this._currentRules(),Pe=0;PeOe[0].length)){if(Oe=Ze,Fe=Pe,this.options.backtrack_lexer){if(je=this.test_match(Ze,st[Pe]),je!==!1)return je;if(this._backtrack){Oe=!1;continue}else return!1}else if(!this.options.flex)break}return Oe?(je=this.test_match(Oe,st[Fe]),je!==!1?je:!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:{"case-insensitive":!0},performAction:w(function(Oe,Ze,Fe,st){switch(Fe){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 Ze.yytext=Ze.yytext.trim(),73;case 12:return Ze.yytext=Ze.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ze.yytext=Ze.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ze.yytext=Ze.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 Ze.yytext=Ze.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 Ne})();Me.lexer=Re;function Ke(){this.yy={}}return w(Ke,"Parser"),Ke.prototype=Me,Me.Parser=Ke,new Ke})();yK.parser=yK;var avr=yK,ovr={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},lvr={FILLED:0,OPEN:1},cvr={LEFTOF:0,RIGHTOF:1,OVER:2},cR={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},QT,uvr=(QT=class{constructor(){this.state=new _re(()=>({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=qi,this.setAccDescription=is,this.setDiagramTitle=ts,this.getAccTitle=ns,this.getAccDescription=ss,this.getDiagramTitle=ji,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(He().wrap),this.LINETYPE=ovr,this.ARROWTYPE=lvr,this.PLACEMENT=cvr}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,s){let a=this.state.records.currentBox,o;if(s!==void 0){let u;s.includes(` -`)?u=s+` +Expecting `+Er.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":an="Parse error on line "+(kt+1)+": Unexpected "+(Se==Vt?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(an,{text:dt.match,token:this.terminals_[Se]||Se,line:dt.yylineno,loc:xt,expected:Er})}if(pt[0]instanceof Array&&pt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+it+", token: "+Se);switch(pt[0]){case 1:Ze.push(Se),at.push(dt.yytext),_e.push(dt.yylloc),Ze.push(pt[1]),Se=null,Et=dt.yyleng,Le=dt.yytext,kt=dt.yylineno,xt=dt.yylloc;break;case 2:if(kr=this.productions_[pt[1]][1],ir.$=at[at.length-kr],ir._$={first_line:_e[_e.length-(kr||1)].first_line,last_line:_e[_e.length-1].last_line,first_column:_e[_e.length-(kr||1)].first_column,last_column:_e[_e.length-1].last_column},mt&&(ir._$.range=[_e[_e.length-(kr||1)].range[0],_e[_e.length-1].range[1]]),bt=this.performAction.apply(ir,[Le,Et,kt,ve.yy,pt[1],at,_e].concat(Lt)),typeof bt<"u")return bt;kr&&(Ze=Ze.slice(0,-1*kr*2),at=at.slice(0,-1*kr),_e=_e.slice(0,-1*kr)),Ze.push(this.productions_[pt[1]][0]),at.push(ir.$),_e.push(ir._$),jr=gt[Ze[Ze.length-2]][Ze[Ze.length-1]],Ze.push(jr);break;case 3:return!0}}return!0},"parse")},Me=(function(){var Ne={EOF:1,parseError:x(function(De,Ze){if(this.yy.parser)this.yy.parser.parseError(De,Ze);else throw new Error(De)},"parseError"),setInput:x(function(je,De){return this.yy=De||this.yy||{},this._input=je,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var De=je.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),je},"input"),unput:x(function(je){var De=je.length,Ze=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-De),this.offset-=De;var Fe=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),Ze.length-1&&(this.yylineno-=Ze.length-1);var at=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:Ze?(Ze.length===Fe.length?this.yylloc.first_column:0)+Fe[Fe.length-Ze.length].length-Ze[0].length:this.yylloc.first_column-De},this.options.ranges&&(this.yylloc.range=[at[0],at[0]+this.yyleng-De]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(je){this.unput(this.match.slice(je))},"less"),pastInput:x(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var je=this.pastInput(),De=new Array(je.length+1).join("-");return je+this.upcomingInput()+` +`+De+"^"},"showPosition"),test_match:x(function(je,De){var Ze,Fe,at;if(this.options.backtrack_lexer&&(at={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&&(at.yylloc.range=this.yylloc.range.slice(0))),Fe=je[0].match(/(?:\r\n?|\n).*/g),Fe&&(this.yylineno+=Fe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Fe?Fe[Fe.length-1].length-Fe[Fe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,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(je[0].length),this.matched+=je[0],Ze=this.performAction.call(this,this.yy,this,De,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ze)return Ze;if(this._backtrack){for(var _e in at)this[_e]=at[_e];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,De,Ze,Fe;this._more||(this.yytext="",this.match="");for(var at=this._currentRules(),_e=0;_eDe[0].length)){if(De=Ze,Fe=_e,this.options.backtrack_lexer){if(je=this.test_match(Ze,at[_e]),je!==!1)return je;if(this._backtrack){De=!1;continue}else return!1}else if(!this.options.flex)break}return De?(je=this.test_match(De,at[Fe]),je!==!1?je:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var De=this.next();return De||this.lex()},"lex"),begin:x(function(De){this.conditionStack.push(De)},"begin"),popState:x(function(){var De=this.conditionStack.length-1;return De>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(De){return De=this.conditionStack.length-1-Math.abs(De||0),De>=0?this.conditionStack[De]:"INITIAL"},"topState"),pushState:x(function(De){this.begin(De)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(De,Ze,Fe,at){switch(Fe){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 Ze.yytext=Ze.yytext.trim(),73;case 12:return Ze.yytext=Ze.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ze.yytext=Ze.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ze.yytext=Ze.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 Ze.yytext=Ze.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 Ne})();Ae.lexer=Me;function Ke(){this.yy={}}return x(Ke,"Parser"),Ke.prototype=Ae,Ae.Parser=Ke,new Ke})();CK.parser=CK;var M5r=CK,R5r={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},L5r={FILLED:0,OPEN:1},I5r={LEFTOF:0,RIGHTOF:1,OVER:2},dA={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rv,N5r=(rv=class{constructor(){this.state=new Bre(()=>({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=qi,this.setAccDescription=aa,this.setDiagramTitle=ra,this.getAccTitle=ia,this.getAccDescription=sa,this.getDiagramTitle=Yi,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(He().wrap),this.LINETYPE=R5r,this.ARROWTYPE=L5r,this.PLACEMENT=I5r}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=`{ -`+s+` -}`,o=pD(u,{schema:fD})}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(a=l.box?l.box:this.state.records.currentBox,l.box=a,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:a,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:s,centralConnection:a??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=He().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Oi()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),s={text:i,wrap:n};return de.debug(`parseMessage: ${JSON.stringify(s)}`),s}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:s,cleanedText:a}=this.extractWrap(i);return{text:a?Nn(a,He()):void 0,color:n,wrap:s}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},s=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[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=Nn(r.text,He());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=JSON.parse(i);this.insertLinks(n,s)}catch(i){de.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let s=Nn(r.text,He());const a=s.indexOf("@");s=s.replace(/=/g,"="),s=s.replace(/&/g,"&");const o=s.slice(0,a-1).trim(),l=s.slice(a+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){de.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=Nn(r.text,He()),s=JSON.parse(i);this.insertProperties(n,s)}catch(i){de.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 s=i.innerHTML,a=JSON.parse(s);a.properties&&this.insertProperties(n,a.properties),a.links&&this.insertLinks(n,a.links)}catch(s){de.error("error while parsing actor details text",s)}}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":qi(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 He().sequence}},w(QT,"SequenceDB"),QT),hvr=w(t=>{const e=t.dropShadow??"none",{look:r}=He();return`.actor { +`+a+` +}`,o=UO(u,{schema:mO})}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=He().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),Oi()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return de.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?Dn(s,He()):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=Dn(r.text,He());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){de.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Dn(r.text,He());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){de.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=Dn(r.text,He()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){de.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){de.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":qi(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 He().sequence}},x(rv,"SequenceDB"),rv),D5r=x(t=>{const e=t.dropShadow??"none",{look:r}=He();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -4520,25 +4653,25 @@ Expecting `+Er.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":nn="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),dvr=hvr,vy=36,zm="actor-top",Vm="actor-bottom",sB="actor-box",pv="actor-man",xp=new Set(["redux-color","redux-dark-color"]),vA=w(function(t,e){const r=WP(t,e);return xr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),fvr=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 s=e.links,a=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+a+"_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),s!=null){var p=20;for(let y in s){var g=u.append("a"),m=kv.sanitizeUrl(s[y]);g.attr("xlink:href",m),g.attr("target","_blank"),Pvr(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"),aB=w(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),nO=w(async function(t,e,r=null){let n=t.append("foreignObject");const i=await rD(e.text,xr()),a=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(a.height)).attr("width",Math.round(a.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",a.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-a.width/2)).attr("y",Math.round(l.y+l.height/2-a.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-a.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-a.height))}return[n]},"drawKatex"),A3=w(function(t,e){let r=0,n=0;const i=e.text.split(Gt.lineBreakRegex),[s,a]=np(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&&s!==void 0&&(l=h*s);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),a!==void 0&&f.style("font-size",a),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||TEe;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"),hYe=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+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,A3(t,e),n},"drawLabel"),Fn=-1,dYe=w((t,e,r,n)=>{t.select&&r.forEach(i=>{const s=e.get(i),a=t.select("#actor"+s.actorCnt);!n.mirrorActors&&s.stopy?a.attr("y2",s.stopy+s.height/2):n.mirrorActors&&a.attr("y2",s.stopy)})},"fixLifeLineHeights"),pvr=w(function(t,e,r,n,i){var T,C;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",aB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();var y="actor";(T=e.properties)!=null&&T.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Vm}`:y+=` ${zm}`,m.x=e.x,m.y=s,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=vA(g,m),b=i.get(e.name)??0;if(xp.has(u)&&(v.style("stroke",f[b%f.length]),v.style("fill",d[b%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?wre(g,m.x+m.width-20,m.y+10,S.substr(1)):xre(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)),wp(r,ea(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${sB}`},r);let x=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,x=S.height}return x},"drawActorTypeParticipant"),gvr=w(function(t,e,r,n,i){var k,E;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",aB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Vm}`:y+=` ${zm}`,m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,b={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},x=vA(g,m),T=vA(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(xp.has(u)&&(x.style("stroke",f[C%f.length]),x.style("fill",d[C%f.length]),T.style("stroke",f[C%f.length]),T.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const A=e.properties.icon.trim();A.charAt(0)==="@"?wre(g,m.x+m.width-20,m.y+10,A.substr(1)):xre(g,m.x+m.width-20,m.y+10,A)}wp(r,ea(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${sB}`},r);let S=e.height;if(x.node){const A=x.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"),mvr=w(function(t,e,r,n,i){var A,M;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",aB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${Vm}`:y+=` ${zm}`,g.attr("class",y),m.x=e.x,m.y=s,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,b=v/(2.5+m.height/50),x=g.append("g"),T=g.append("g"),C=`M ${m.x},${m.y+v} - a ${b},${v} 0 0 0 0,${m.height} +`},"getStyles"),O5r=D5r,xU=36,V1="actor-top",H1="actor-bottom",lB="actor-box",U5="actor-man",xp=new Set(["redux-color","redux-dark-color"]),xC=x(function(t,e){const r=j_(t,e);return xr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),_5r=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let U in a){var g=u.append("a"),m=E5.sanitizeUrl(a[U]);g.attr("xlink:href",m),g.attr("target","_blank"),a2r(n)(U,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"),cB=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),sD=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await aO(e.text,xr()),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"),R4=x(function(t,e){let r=0,n=0;const i=e.text.split(Ht.lineBreakRegex),[a,s]=ip(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||Iwe;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"),CYe=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,R4(t,e),n},"drawLabel"),Fn=-1,kYe=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),P5r=x(function(t,e,r,n,i){var w,T;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||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",cB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();var U="actor";(w=e.properties)!=null&&w.class?U=e.properties.class:m.fill="#eaeaea",n?U+=` ${H1}`:U+=` ${V1}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=U,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const y=xC(g,m),b=i.get(e.name)??0;if(xp.has(u)&&(y.style("stroke",f[b%f.length]),y.style("fill",d[b%f.length])),l==="neo"&&y.attr("filter","url(#drop-shadow)"),e.rectData=m,(T=e.properties)!=null&&T.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?Mre(g,m.x+m.width-20,m.y+10,k.substr(1)):Are(g,m.x+m.width-20,m.y+10,k)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),wp(r,Qa(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${lB}`},r);let v=e.height;if(y.node){const k=y.node().getBBox();e.height=k.height,v=k.height}return v},"drawActorTypeParticipant"),B5r=x(function(t,e,r,n,i){var C,S;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||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",cB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();var U="actor";(C=e.properties)!=null&&C.class?U=e.properties.class:m.fill="#eaeaea",n?U+=` ${H1}`:U+=` ${V1}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=U,m.name=e.name;const y=6,b={...m,x:m.x+-y,y:m.y+ +y,class:"actor"},v=xC(g,m),w=xC(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;if(xp.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length]),w.style("stroke",f[T%f.length]),w.style("fill",d[T%f.length])),(S=e.properties)!=null&&S.icon){const E=e.properties.icon.trim();E.charAt(0)==="@"?Mre(g,m.x+m.width-20,m.y+10,E.substr(1)):Are(g,m.x+m.width-20,m.y+10,E)}wp(r,Qa(e.description))(e.description,g,m.x-y,m.y+y,m.width,m.height,{class:`actor ${lB}`},r);let k=e.height;if(v.node){const E=v.node().getBBox();e.height=E.height,k=E.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),k},"drawActorTypeCollections"),$5r=x(function(t,e,r,n,i){var E,A;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||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",cB(`actor${Fn}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Fn).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=Fn,e.links!=null&&g.attr("id","root-"+Fn),l==="neo"&&g.attr("data-look","neo"));const m=uu();let U="actor";(E=e.properties)!=null&&E.class?U=e.properties.class:m.fill="#eaeaea",n?U+=` ${H1}`:U+=` ${V1}`,g.attr("class",U),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const y=m.height/2,b=y/(2.5+m.height/50),v=g.append("g"),w=g.append("g"),T=`M ${m.x},${m.y+y} + a ${b},${y} 0 0 0 0,${m.height} h ${m.width-2*b} - a ${b},${v} 0 0 0 0,-${m.height} + a ${b},${y} 0 0 0 0,-${m.height} Z - `;x.append("path").attr("d",C),T.append("path").attr("d",`M ${m.x},${m.y+v} - a ${b},${v} 0 0 0 0,${m.height}`),x.attr("transform",`translate(${b}, ${-(m.height/2)})`),T.attr("transform",`translate(${m.width-b}, ${-m.height/2})`),e.rectData=m,l==="neo"&&x.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(xp.has(u)&&(x.style("stroke",f[S%f.length]),x.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 R=e.properties.icon.trim(),P=m.x+m.width-20,N=m.y+10;R.charAt(0)==="@"?wre(g,P,N,R.substr(1)):xre(g,P,N,R)}wp(r,ea(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${sB}`},r);let k=e.height;const E=x.select("path:last-child");if(E.node()){const R=E.node().getBBox();e.height=R.height,k=R.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),yvr=w(function(t,e,r,n,i,s){var A;const a=n?e.stopy:e.starty,o=e.x+e.width/2,l=a+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Fn++,y.append("line").attr("id","actor"+Fn).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=Fn);const v=t.append("g");let b=pv;n?b+=` ${Vm}`:b+=` ${zm}`,v.attr("class",b),v.attr("name",e.name);const x=uu();x.x=e.x,x.y=a,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const T=e.x+e.width/2,C=a+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",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${T}, ${C-S})`);const k=s.get(e.name)??0;xp.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((A=r==null?void 0:r.sequence)==null?void 0:A.labelBoxHeight)??0),wp(r,ea(e.description))(e.description,v,x.x,x.y+S+(n?5:12),x.width,x.height,{class:`actor ${pv}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),vvr=w(function(t,e,r,n,i){var S;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+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+=` ${Vm}`:m+=` ${zm}`,g.attr("class",m),g.attr("name",e.name);const y=uu();y.x=e.x,y.y=s,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,b=s+(n?10:25),x=22;g.append("circle").attr("cx",v).attr("cy",b).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-x).attr("x2",v+x).attr("y1",b+x).attr("y2",b+x).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const T=i.get(e.name)??0;xp.has(u)&&(g.style("stroke",f[T%f.length]),g.style("fill",d[T%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Fn++,p.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn),wp(r,ea(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${pv}`},r),n?g.attr("transform",`translate(0, ${x})`):(g.attr("transform",`translate(0, ${x/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),bvr=w(function(t,e,r,n,i){var M;const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+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||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",aB(`actor${Fn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn,e.links!=null&&m.attr("id","root-"+Fn),h==="neo"&&m.attr("data-look","neo"));const y=uu();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${Vm}`:v+=` ${zm}`,y.x=e.x,y.y=s,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=s;const b=y.width/3,x=y.width/3,T=b/2,C=T/(2.5+b/50),S=m.append("g");S.attr("class",v);const k=` - M ${y.x},${y.y+C} - a ${T},${C} 0 0 0 ${b},0 - a ${T},${C} 0 0 0 -${b},0 - l 0,${x-2*C} - a ${T},${C} 0 0 0 ${b},0 - l 0,-${x-2*C} -`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;xp.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${b}, ${C})`),e.rectData=y,wp(r,ea(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${sB}`},r);const A=S.select("path:last-child");if(A.node()){const R=A.node().getBBox();e.height=R.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"),xvr=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Fn++,u.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn);const y=t.append("g");let v=pv;n?v+=` ${Vm}`:v+=` ${zm}`,y.attr("class",v),y.attr("name",e.name);const b=uu();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor",y.append("line").attr("id","actor-man-torso"+Fn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+12).attr("x2",e.x+e.width/2-15).attr("y2",s+12),y.append("line").attr("id","actor-man-arms"+Fn).attr("x1",e.x+e.width/2-l*2.5).attr("y1",s+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",s+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",s+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const x=i.get(e.name)??0;xp.has(d)?(y.style("stroke",g[x%g.length]),y.style("fill",p[x%g.length])):y.style("stroke",m);const T=y.node().getBBox();return e.height=T.height+(r.sequence.labelBoxHeight??0),wp(r,ea(e.description))(e.description,y,b.x,b.y+15,b.width,b.height,{class:`actor ${pv}`},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"),wvr=w(function(t,e,r,n,i){const s=n?e.stopy:e.starty,a=e.x+e.width/2,o=s+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Fn++,g.append("line").attr("id","actor"+Fn).attr("x1",a).attr("y1",o).attr("x2",a).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=Fn);const m=t.append("g");let y=pv;n?y+=` ${Vm}`:y+=` ${zm}`,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,b=l==="neo"?s+(1-v)*30:s;m.append("line").attr("id","actor-man-torso"+Fn).attr("x1",a).attr("y1",b+25*v).attr("x2",a).attr("y2",b+45*v),m.append("line").attr("id","actor-man-arms"+Fn).attr("x1",a-vy/2*v).attr("y1",b+33*v).attr("x2",a+vy/2*v).attr("y2",b+33*v),m.append("line").attr("x1",a-vy/2*v).attr("y1",b+60*v).attr("x2",a).attr("y2",b+45*v),m.append("line").attr("x1",a).attr("y1",b+45*v).attr("x2",a+(vy/2-2)*v).attr("y2",b+60*v);const x=m.append("circle");x.attr("cx",e.x+e.width/2),x.attr("cy",b+10*v),x.attr("r",15*v),x.attr("width",e.width*v),x.attr("height",e.height*v);const T=m.node().getBBox();e.height=T.height;const C=uu();C.x=e.x,C.y=b,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return xp.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),wp(r,ea(e.description))(e.description,m,C.x,b+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${pv}`},r),e.height},"drawActorTypeActor"),Tvr=w(async function(t,e,r,n,i,s,a){const o=a??new Map([...s.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await wvr(t,e,r,n,o);case"participant":return await pvr(t,e,r,n,o);case"boundary":return await xvr(t,e,r,n,o);case"control":return await yvr(t,e,r,n,i,o);case"entity":return await vvr(t,e,r,n,o);case"database":return await bvr(t,e,r,n,o);case"collections":return await gvr(t,e,r,n,o);case"queue":return await mvr(t,e,r,n,o)}},"drawActor"),Cvr=w(function(t,e,r){const i=t.append("g");fYe(i,e),e.name&&wp(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),kvr=w(function(t){return t.append("g")},"anchorElement"),Svr=w(function(t,e,r,n,i,s,a){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=uu(),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=vA(p,f),v=(a??new Map([...s.db.getActors().values()].map((b,x)=>[b.name,x]))).get(g)??0;xp.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),Evr=w(async function(t,e,r,n,i){const{boxMargin:s,boxTextMargin:a,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,b,x){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",b).attr("y2",x).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=Tre();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=a,g.class="labelText",hYe(f,g),g=pYe(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+s+a,g.anchor="middle",g.valign="middle",g.textMargin=a,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ea(g.text)?await nO(f,g,e):A3(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+s+a,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,ea(g.text)?(e.starty=e.sections[y].y,await nO(f,g,e)):A3(f,g);let b=Math.round(m.map(x=>(x._groups||x)[0][0].getBBox().height).reduce((x,T)=>x+T));e.sections[y].height+=b-(s+a)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),fYe=w(function(t,e){MDe(t,e)},"drawBackgroundRect"),Avr=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"),Mvr=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"),Rvr=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"),_vr=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"),Lvr=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"),Ivr=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"),Nvr=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"),Ovr=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"),pYe=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"),Dvr=w(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),wp=(function(){function t(s,a,o,l,u,h,d){const f=a.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(s);i(f,d)}w(t,"byText");function e(s,a,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=np(p),b=s.split(Gt.lineBreakRegex);for(let x=0;xt.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,yYe(He())},"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 s=0;function a(o){return w(function(u){s++;const h=i.sequenceItems.length-s+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Rt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Rt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Rt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Rt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}w(a,"updateFn"),this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},"updateBounds"),insert:w(function(t,e,r,n){const i=Gt.getMin(t,r),s=Gt.getMax(t,r),a=Gt.getMin(e,n),o=Gt.getMax(e,n);this.updateVal(Rt.data,"startx",i,Math.min),this.updateVal(Rt.data,"starty",a,Math.min),this.updateVal(Rt.data,"stopx",s,Math.max),this.updateVal(Rt.data,"stopy",o,Math.max),this.updateBounds(i,a,s,o)},"insert"),newActivation:w(function(t,e,r){const n=r.get(t.from),i=oB(t.from).length||0,s=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+tt.activationWidth,stopy:void 0,actor:t.from,anchored:Bi.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:Rt.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=Gt.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")},Vvr=w(async function(t,e,r){Rt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Rt.getVerticalPos();const n=uu();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const s=Bi.drawRect(i,n),a=Tre();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=tt.noteFontFamily,a.fontSize=tt.noteFontSize,a.fontWeight=tt.noteFontWeight,a.anchor=tt.noteAlign,a.textMargin=tt.noteMargin,a.valign="center";const o=ea(a.text)?await nO(i,a):A3(i,a),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));s.attr("height",l+2*tt.noteMargin),e.height+=l+2*tt.noteMargin,Rt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Rt.insert(e.startx,e.starty,e.stopx,e.stopy),Rt.models.addNote(e)},"drawNote"),R2e=w(function(t,e,r,n,i,s,a){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=wYe(e,n),m=t.append("g"),y=16.5,v=w((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),b=w(S=>{m.append("circle").attr("cx",S).attr("cy",a).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:x,CENTRAL_CONNECTION_REVERSE:T,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case x:g&&(f+=v(p,!0));break;case T:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case x:b(f);break;case T:b(d);break;case C:b(d),b(f);break}},"drawCentralConnection"),gv=w(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),bb=w(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),vK=w(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function gYe(t,e){Rt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,s=Gt.splitBreaks(i).length,a=ea(i),o=a?await KA(i,He()):Kr.calculateTextDimensions(i,gv(tt));if(!a){const d=o.height/s;e.height+=d,Rt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Rt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Rt.getVerticalPos()+u),u+=30;const d=Gt.getMax(h/2,tt.width/2);Rt.insert(r-d,Rt.getVerticalPos()-10+u,n+d,Rt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Rt.getVerticalPos()+u,Rt.insert(r,l-10,n,l);return Rt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Rt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}w(gYe,"boundMessage");var Hvr=w(async function(t,e,r,n,i,s){const{startx:a,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Kr.calculateTextDimensions(u,gv(tt)),g=Tre();g.x=Math.min(a,o),g.y=l+10,g.width=Math.abs(o-a),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,ea(g.text)?await nO(t,g,{startx:a,stopx:o,starty:r}):A3(t,g);const m=p.width;let y;if(a===o){const b=f||tt.showSequenceNumbers,x=wYe(i,n),T=Xvr(i,n),C=a+(b&&(x||T)?10:0);tt.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${a+Gt.getMax(tt.width/2,m/2)} V ${r+25} H ${a}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(a+60)+","+(r+30)+" "+a+","+(r+20)),rG(i,n)&&R2e(t,i,e,n,a,o,r)}else y=t.append("line"),y.attr("x1",a),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),rG(i,n)&&R2e(t,i,e,n,a,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(tt.arrowMarkerAbsolute&&(v=tD(!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+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+s+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+s+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+s+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+s+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+s+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+s+"-crosshead)"),f||tt.showSequenceNumbers){const b=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,x=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,C=rG(i,n);let S=a,k=o;b?(aa?k=o-2*T:(k=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),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",a+T);let E=0;const A=a===o,M=a<=o;A?E=e.fromBounds+1:x?E=M?e.toBounds-1:e.fromBounds+1:E=M?e.fromBounds+1:e.toBounds-1;let R="12px";const P=d.toString().length;P>5?R="7px":P>3&&(R="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+"#"+s+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",R).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),Gvr=w(function(t,e,r,n,i,s,a){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(a||Rt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(a||(p.x=o+l,p.y=i),l+=p.margin),f.width=Gt.getMax(f.width||tt.width,tt.width),f.height=Gt.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=Gt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Rt.getVerticalPos(),Rt.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,Rt.models.addActor(f)}u&&!a&&Rt.models.addBox(u),Rt.bumpVerticalPos(h)},"addActorRenderingData"),bK=w(async function(t,e,r,n,i,s,a){if(n){let o=0;Rt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Rt.getVerticalPos());const h=await Bi.drawActor(t,u,tt,!0,i,s,a);o=Gt.getMax(o,h)}Rt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await Bi.drawActor(t,l,tt,!1,i,s,a)}},"drawActors"),mYe=w(function(t,e,r,n){let i=0,s=0;for(const a of r){const o=e.get(a),l=qvr(o),u=Bi.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>s&&(s=u.width+o.x)}return{maxHeight:i,maxWidth:s}},"drawActorsPopup"),yYe=w(function(t){oa(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),oB=w(function(t){return Rt.activations.filter(function(e){return e.actor===t})},"actorActivations"),_2e=w(function(t,e){const r=e.get(t),n=oB(t),i=n.reduce(function(a,o){return Gt.getMin(a,o.startx)},r.x+r.width/2-1),s=n.reduce(function(a,o){return Gt.getMax(a,o.stopx)},r.x+r.width/2+1);return[i,s]},"activationBounds");function ih(t,e,r,n,i){Rt.bumpVerticalPos(r);let s=n;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,o=gv(tt);e.message=Kr.wrapLabel(`[${e.message}]`,a-2*tt.wrapPadding,o),e.width=a,e.wrap=!0;const l=Kr.calculateTextDimensions(e.message,o),u=Gt.getMax(l.height,tt.labelBoxHeight);s=n+u,de.debug(`${u} - ${e.message}`)}i(e),Rt.bumpVerticalPos(s)}w(ih,"adjustLoopHeightForWrap");function vYe(t,e,r,n,i,s,a){function o(h,d){h.x{F.add(H.from),F.add(H.to)}),y=y.filter(H=>F.has(H))}const S=new Map(y.map((F,H)=>{var G;return[((G=f.get(F))==null?void 0:G.name)??F,H]}));Gvr(d,f,p,y,0,v,!1);const k=await Zvr(v,f,C,n);Bi.insertArrowHead(d,e),Bi.insertArrowCrossHead(d,e),Bi.insertArrowFilledHead(d,e),Bi.insertSequenceNumber(d,e),Bi.insertSolidTopArrowHead(d,e),Bi.insertSolidBottomArrowHead(d,e),Bi.insertStickTopArrowHead(d,e),Bi.insertStickBottomArrowHead(d,e),a==="neo"&&Bi.insertDropShadow(d,tt);function E(F,H){const G=Rt.endActivation(F);G.starty+18>H&&(G.starty=H-6,H+=12),Bi.drawActivation(d,G,H,tt,oB(F.from).length,n,S),Rt.insert(G.startx,H-10,G.stopx,H)}w(E,"activeEnd");let A=1,M=1;const R=[],P=[];let N=0;for(const F of v){let H,G,W;switch(F.type){case n.db.LINETYPE.NOTE:Rt.resetVerticalPos(),G=F.noteModel,await Vvr(d,G,F.id);break;case n.db.LINETYPE.ACTIVE_START:Rt.newActivation(F,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Rt.newActivation(F,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Rt.newActivation(F,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(F,Rt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.LOOP_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"loop",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;case n.db.LINETYPE.RECT_START:ih(k,F,tt.boxMargin,tt.boxMargin,K=>{let q=K.message;q||(q=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Rt.newLoop(void 0,q)});break;case n.db.LINETYPE.RECT_END:H=Rt.endLoop(),P.push(H),Rt.models.addLoop(H),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.OPT_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"opt",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;case n.db.LINETYPE.ALT_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.ALT_ELSE:ih(k,F,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.ALT_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"alt",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K)),Rt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:ih(k,F,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.PAR_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"par",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;case n.db.LINETYPE.AUTONUMBER:A=F.message.start||A,M=F.message.step||M,F.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.CRITICAL_OPTION:ih(k,F,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.CRITICAL_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"critical",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;case n.db.LINETYPE.BREAK_START:ih(k,F,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.BREAK_END:H=Rt.endLoop(),await Bi.drawLoop(d,H,"break",tt,F),Rt.bumpVerticalPos(H.stopy-Rt.getVerticalPos()),Rt.models.addLoop(H);break;default:try{W=F.msgModel,W.starty=Rt.getVerticalPos(),W.sequenceIndex=A,W.sequenceVisible=n.db.showSequenceNumbers(),W.id=F.id,W.from=F.from,W.to=F.to;const K=await gYe(d,W);vYe(F,W,K,N,f,p,g),R.push({messageModel:W,lineStartY:K,msg:F}),Rt.models.addMessage(W)}catch(K){de.error("error while drawing message",K)}}[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(F.type)&&(A=Math.round((A+M)*100)/100),N++}de.debug("createdActors",p),de.debug("destroyedActors",g),await bK(d,f,y,!1,e,n,S);for(const F of R)await Hvr(d,F.messageModel,F.lineStartY,n,F.msg,e);tt.mirrorActors&&await bK(d,f,y,!0,e,n,S),P.forEach(F=>Bi.drawBackgroundRect(d,F)),dYe(d,f,y,tt);for(const F of Rt.models.boxes){F.height=Rt.getVerticalPos()-F.y,Rt.insert(F.x,F.y,F.x+F.width,F.height);const H=tt.boxMargin*2;F.startx=F.x-H,F.starty=F.y-H*.25,F.stopx=F.startx+F.width+2*H,F.stopy=F.starty+F.height+H*.75,F.stroke="rgb(0,0,0, 0.5)",Bi.drawBox(d,F,tt)}x&&Rt.bumpVerticalPos(tt.boxMargin);const L=mYe(d,f,y,h),{bounds:I}=Rt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;${const a=gv(tt);let o=s.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,s.wrap&&(s.name=Kr.wrapLabel(s.name,o-2*tt.wrapPadding,a));const u=Kr.calculateTextDimensions(s.name,a);i=Gt.getMax(u.height,i);const h=Gt.getMax(o,u.width+2*tt.wrapPadding);if(s.margin=tt.boxTextMargin,os.textMaxHeight=i),Gt.getMax(n,tt.height)}w(xYe,"calculateActorMargins");var Uvr=w(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),s=n.x,a=i.x,o=t.wrap&&t.message;let l=ea(t.message)?await KA(t.message,He()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,bb(tt)):t.message,bb(tt));const u={width:o?tt.width:Gt.getMax(tt.width,l.width+2*tt.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?Gt.getMax(tt.width,l.width):Gt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Gt.getMax(tt.width,l.width+2*tt.noteMargin):Gt.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=s-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,Gt.getMax(tt.width,n.width),bb(tt)):t.message,bb(tt)),u.width=o?Gt.getMax(tt.width,n.width):Gt.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=s+(n.width-u.width)/2):(u.width=Math.abs(s+n.width/2-(a+i.width/2))+tt.actorMargin,u.startx=s2,f=w(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.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,s,a,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=Kr.wrapLabel(t.message,Gt.getMax(g+2*tt.wrapPadding,tt.width),gv(tt)));const m=Kr.calculateTextDimensions(t.message,gv(tt));return{width:Gt.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.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"),Zvr=w(async function(t,e,r,n){const i={},s=[];let a,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:s.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&&(a=s.pop(),i[a.id]=a,i[u.id]=a,s.push(a));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:a=s.pop(),i[a.id]=a;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=oB(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Rt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Rt.activations.map(f=>f.actor).lastIndexOf(u.from);Rt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await Uvr(u,e,n),u.noteModel=o,s.forEach(d=>{a=d,a.from=Gt.getMin(a.from,o.startx),a.to=Gt.getMax(a.to,o.startx+o.width),a.width=Gt.getMax(a.width,Math.abs(a.from-a.to))-tt.labelBoxWidth})):(l=Kvr(u,e,n),u.msgModel=l,l.startx&&l.stopx&&s.length>0&&s.forEach(d=>{if(a=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);a.from=Gt.getMin(f.x-l.width/2,f.x-f.width/2,a.from),a.to=Gt.getMax(p.x+l.width/2,p.x+f.width/2,a.to),a.width=Gt.getMax(a.width,Math.abs(a.to-a.from))-tt.labelBoxWidth}else a.from=Gt.getMin(l.startx,a.from),a.to=Gt.getMax(l.stopx,a.to),a.width=Gt.getMax(a.width,l.width)-tt.labelBoxWidth}))}return Rt.activations=[],de.debug("Loop type widths:",i),i},"calculateLoopBounds"),Qvr={bounds:Rt,drawActors:bK,drawActorsPopup:mYe,setConf:yYe,draw:Wvr},Jvr={parser:avr,get db(){return new uvr},renderer:Qvr,styles:dvr,init:w(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,SW({sequence:{wrap:t.wrap}}))},"init")};const e2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jvr},Symbol.toStringTag,{value:"Module"}));var xK=(function(){var t=w(function(pe,Ce,re,Y){for(re=re||{},Y=pe.length;Y--;re[pe[Y]]=Ce);return re},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],s=[1,26],a=[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],b=[1,28],x=[1,29],T=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],A=[1,47],M=[1,9],R=[1,8,9],P=[1,58],N=[1,59],L=[1,60],I=[1,61],$=[1,62],O=[1,63],D=[1,64],B=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],F=[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],H=[13,60,86,100,102,103],G=[13,60,73,74,86,100,102,103],W=[13,60,68,69,70,71,72,86,100,102,103],K=[1,103],q=[1,121],oe=[1,117],Z=[1,113],Q=[1,119],ne=[1,114],ie=[1,115],me=[1,116],te=[1,118],_e=[1,120],$e=[22,50,60,61,82,86,87,88,89,90],Ve=[1,128],ce=[12,39],he=[1,8,9,39,41,44,46],Te=[1,8,9,22],ge=[1,153],ze=[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,re,Y,J,ue,X,fe){var ee=X.length-1;switch(ue){case 8:this.$=X[ee-1];break;case 9:case 10:case 13:case 15:this.$=X[ee];break;case 11:case 14:this.$=X[ee-2]+"."+X[ee];break;case 12:case 16:this.$=X[ee-1]+X[ee];break;case 17:case 18:this.$=X[ee-1]+"~"+X[ee]+"~";break;case 19:J.addRelation(X[ee]);break;case 20:X[ee-1].title=J.cleanupLabel(X[ee]),J.addRelation(X[ee-1]);break;case 31:this.$=X[ee].trim(),J.setAccTitle(this.$);break;case 32:case 33:this.$=X[ee].trim(),J.setAccDescription(this.$);break;case 34:J.addClassesToNamespace(X[ee-3],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 35:J.addClassesToNamespace(X[ee-4],X[ee-1][0],X[ee-1][1]),J.popNamespace();break;case 36:this.$=J.addNamespace(X[ee]);break;case 37:this.$=J.addNamespace(X[ee-1],X[ee]);break;case 38:this.$=[[X[ee]],[]];break;case 39:this.$=[[X[ee-1]],[]];break;case 40:X[ee][0].unshift(X[ee-2]),this.$=X[ee];break;case 41:this.$=[[],[X[ee]]];break;case 42:this.$=[[],[X[ee-1]]];break;case 43:X[ee][1].unshift(X[ee-2]),this.$=X[ee];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=X[ee];break;case 48:J.setCssClass(X[ee-2],X[ee]);break;case 49:J.addMembers(X[ee-3],X[ee-1]);break;case 51:J.setCssClass(X[ee-5],X[ee-3]),J.addMembers(X[ee-5],X[ee-1]);break;case 52:J.addAnnotation(X[ee-3],X[ee-1]);break;case 53:J.addAnnotation(X[ee-6],X[ee-4]),J.addMembers(X[ee-6],X[ee-1]);break;case 54:J.addAnnotation(X[ee-5],X[ee-3]);break;case 55:this.$=X[ee],J.addClass(X[ee]);break;case 56:this.$=X[ee-1],J.addClass(X[ee-1]),J.setClassLabel(X[ee-1],X[ee]);break;case 60:J.addAnnotation(X[ee],X[ee-2]);break;case 61:case 74:this.$=[X[ee]];break;case 62:X[ee].push(X[ee-1]),this.$=X[ee];break;case 63:break;case 64:J.addMember(X[ee-1],J.cleanupLabel(X[ee]));break;case 65:break;case 66:break;case 67:this.$={id1:X[ee-2],id2:X[ee],relation:X[ee-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-1],relationTitle1:X[ee-2],relationTitle2:"none"};break;case 69:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-2],relationTitle1:"none",relationTitle2:X[ee-1]};break;case 70:this.$={id1:X[ee-4],id2:X[ee],relation:X[ee-2],relationTitle1:X[ee-3],relationTitle2:X[ee-1]};break;case 71:this.$=J.addNote(X[ee],X[ee-1]);break;case 72:this.$=J.addNote(X[ee]);break;case 73:this.$=X[ee-2],J.defineClass(X[ee-1],X[ee]);break;case 75:this.$=X[ee-2].concat([X[ee]]);break;case 76:J.setDirection("TB");break;case 77:J.setDirection("BT");break;case 78:J.setDirection("RL");break;case 79:J.setDirection("LR");break;case 80:this.$={type1:X[ee-2],type2:X[ee],lineType:X[ee-1]};break;case 81:this.$={type1:"none",type2:X[ee],lineType:X[ee-1]};break;case 82:this.$={type1:X[ee-1],type2:"none",lineType:X[ee]};break;case 83:this.$={type1:"none",type2:"none",lineType:X[ee]};break;case 84:this.$=J.relationType.AGGREGATION;break;case 85:this.$=J.relationType.EXTENSION;break;case 86:this.$=J.relationType.COMPOSITION;break;case 87:this.$=J.relationType.DEPENDENCY;break;case 88:this.$=J.relationType.LOLLIPOP;break;case 89:this.$=J.lineType.LINE;break;case 90:this.$=J.lineType.DOTTED_LINE;break;case 91:case 97:this.$=X[ee-2],J.setClickEvent(X[ee-1],X[ee]);break;case 92:case 98:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 93:this.$=X[ee-2],J.setLink(X[ee-1],X[ee]);break;case 94:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1],X[ee]);break;case 95:this.$=X[ee-3],J.setLink(X[ee-2],X[ee-1]),J.setTooltip(X[ee-2],X[ee]);break;case 96:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-2],X[ee]),J.setTooltip(X[ee-3],X[ee-1]);break;case 99:this.$=X[ee-3],J.setClickEvent(X[ee-2],X[ee-1],X[ee]);break;case 100:this.$=X[ee-4],J.setClickEvent(X[ee-3],X[ee-2],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 101:this.$=X[ee-3],J.setLink(X[ee-2],X[ee]);break;case 102:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1],X[ee]);break;case 103:this.$=X[ee-4],J.setLink(X[ee-3],X[ee-1]),J.setTooltip(X[ee-3],X[ee]);break;case 104:this.$=X[ee-5],J.setLink(X[ee-4],X[ee-2],X[ee]),J.setTooltip(X[ee-4],X[ee-1]);break;case 105:this.$=X[ee-2],J.setCssStyle(X[ee-1],X[ee]);break;case 106:J.setCssClass(X[ee-1],X[ee]);break;case 107:this.$=[X[ee]];break;case 108:X[ee-2].push(X[ee]),this.$=X[ee-2];break;case 110:this.$=X[ee-1]+X[ee];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:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:b,78:x,82:T,83:C,86:S,100:k,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(R,[2,19],{22:[1,50]}),t(R,[2,21]),t(R,[2,22]),t(R,[2,23]),t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,29]),t(R,[2,30]),{34:[1,51]},{36:[1,52]},t(R,[2,33]),t(R,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:N,70:L,71:I,72:$,73:O,74:D}),{39:[1,65]},t(B,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(R,[2,65]),t(R,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:A},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:A},{13:z,55:76},{58:78,60:[1,79]},t(R,[2,76]),t(R,[2,77]),t(R,[2,78]),t(R,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:A}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:A},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:A},t(F,[2,133]),t(F,[2,134]),t(F,[2,135]),t(F,[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:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:b,78:x,82:T,83:C,86:S,100:k,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:s,48:a,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:b,78:x,82:T,83:C,86:S,100:k,102:E,103:A},t(R,[2,20]),t(R,[2,31]),t(R,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:A},{53:92,66:56,67:57,68:P,69:N,70:L,71:I,72:$,73:O,74:D},t(R,[2,64]),{67:93,73:O,74:D},t(H,[2,83],{66:94,68:P,69:N,70:L,71:I,72:$}),t(G,[2,84]),t(G,[2,85]),t(G,[2,86]),t(G,[2,87]),t(G,[2,88]),t(W,[2,89]),t(W,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:a,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:K},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:q,50:oe,59:110,60:Z,82:Q,84:111,85:112,86:ne,87:ie,88:me,89:te,90:_e},{60:[1,122]},{13:z,55:123},t(B,[2,72]),t(B,[2,138]),{22:q,50:oe,59:124,60:Z,61:[1,125],82:Q,84:111,85:112,86:ne,87:ie,88:me,89:te,90:_e},t($e,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:A},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Ve,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:A}),t(ce,[2,10]),t(he,[2,55],{11:131,12:Ve}),t(M,[2,7]),{9:[1,132]},t(Te,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:A},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:A},t(H,[2,82],{66:136,68:P,69:N,70:L,71:I,72:$}),t(H,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:a,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(B,[2,48],{39:[1,142]}),{41:[1,143]},t(B,[2,50]),{41:[2,61],45:144,51:K},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:A},t(R,[2,91],{13:[1,147]}),t(R,[2,93],{13:[1,149],77:[1,148]}),t(R,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(R,[2,105],{61:ge}),t(ze,[2,107],{85:154,22:q,50:oe,60:Z,82:Q,86:ne,87:ie,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(R,[2,106]),t(B,[2,71]),t(R,[2,73],{61:ge}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:A},t(ce,[2,12]),t(he,[2,56]),{1:[2,4]},t(Te,[2,69]),t(Te,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:A},t(H,[2,80]),t(B,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:a,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:a,54:u,56:h},{45:163,51:K},t(B,[2,49]),{41:[2,62]},t(B,[2,52],{39:[1,164]}),t(R,[2,60]),t(R,[2,92]),t(R,[2,94]),t(R,[2,95],{77:[1,165]}),t(R,[2,98]),t(R,[2,99],{13:[1,166]}),t(R,[2,101],{13:[1,168],77:[1,167]}),{22:q,50:oe,60:Z,82:Q,84:169,85:112,86:ne,87:ie,88:me,89:te,90:_e},t(we,[2,110]),t($e,[2,75]),{14:[1,170]},t(ce,[2,11]),t(Te,[2,70]),t(B,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:K},t(R,[2,96]),t(R,[2,100]),t(R,[2,102]),t(R,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:q,50:oe,60:Z,82:Q,86:ne,87:ie,88:me,89:te,90:_e}),t(he,[2,8]),t(B,[2,51]),{41:[1,175]},t(B,[2,54]),t(R,[2,104]),t(B,[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,re){if(re.recoverable)this.trace(Ce);else{var Y=new Error(Ce);throw Y.hash=re,Y}},"parseError"),parse:w(function(Ce){var re=this,Y=[0],J=[],ue=[null],X=[],fe=this.table,ee="",Me=0,Re=0,Ke=2,Ne=1,je=X.slice.call(arguments,1),Oe=Object.create(this.lexer),Ze={yy:{}};for(var Fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Fe)&&(Ze.yy[Fe]=this.yy[Fe]);Oe.setInput(Ce,Ze.yy),Ze.yy.lexer=Oe,Ze.yy.parser=this,typeof Oe.yylloc>"u"&&(Oe.yylloc={});var st=Oe.yylloc;X.push(st);var Pe=Oe.options&&Oe.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gt(Mt){Y.length=Y.length-2*Mt,ue.length=ue.length-Mt,X.length=X.length-Mt}w(gt,"popStack");function Le(){var Mt;return Mt=J.pop()||Oe.lex()||Ne,typeof Mt!="number"&&(Mt instanceof Array&&(J=Mt,Mt=J.pop()),Mt=re.symbols_[Mt]||Mt),Mt}w(Le,"lex");for(var kt,Et,ot,Ht,_t={},dt,xe,Lt,wt;;){if(Et=Y[Y.length-1],this.defaultActions[Et]?ot=this.defaultActions[Et]:((kt===null||typeof kt>"u")&&(kt=Le()),ot=fe[Et]&&fe[Et][kt]),typeof ot>"u"||!ot.length||!ot[0]){var mt="";wt=[];for(dt in fe[Et])this.terminals_[dt]&&dt>Ke&&wt.push("'"+this.terminals_[dt]+"'");Oe.showPosition?mt="Parse error on line "+(Me+1)+`: -`+Oe.showPosition()+` -Expecting `+wt.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":mt="Parse error on line "+(Me+1)+": Unexpected "+(kt==Ne?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(mt,{text:Oe.match,token:this.terminals_[kt]||kt,line:Oe.yylineno,loc:st,expected:wt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+kt);switch(ot[0]){case 1:Y.push(kt),ue.push(Oe.yytext),X.push(Oe.yylloc),Y.push(ot[1]),kt=null,Re=Oe.yyleng,ee=Oe.yytext,Me=Oe.yylineno,st=Oe.yylloc;break;case 2:if(xe=this.productions_[ot[1]][1],_t.$=ue[ue.length-xe],_t._$={first_line:X[X.length-(xe||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(xe||1)].first_column,last_column:X[X.length-1].last_column},Pe&&(_t._$.range=[X[X.length-(xe||1)].range[0],X[X.length-1].range[1]]),Ht=this.performAction.apply(_t,[ee,Re,Me,Ze.yy,ot[1],ue,X].concat(je)),typeof Ht<"u")return Ht;xe&&(Y=Y.slice(0,-1*xe*2),ue=ue.slice(0,-1*xe),X=X.slice(0,-1*xe)),Y.push(this.productions_[ot[1]][0]),ue.push(_t.$),X.push(_t._$),Lt=fe[Y[Y.length-2]][Y[Y.length-1]],Y.push(Lt);break;case 3:return!0}}return!0},"parse")},qe=(function(){var pe={EOF:1,parseError:w(function(re,Y){if(this.yy.parser)this.yy.parser.parseError(re,Y);else throw new Error(re)},"parseError"),setInput:w(function(Ce,re){return this.yy=re||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 re=Ce.match(/(?:\r\n?|\n).*/g);return re?(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 re=Ce.length,Y=Ce.split(/(?:\r\n?|\n)/g);this._input=Ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var J=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Y.length-1&&(this.yylineno-=Y.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Y?(Y.length===J.length?this.yylloc.first_column:0)+J[J.length-Y.length].length-Y[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-re]),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(),re=new Array(Ce.length+1).join("-");return Ce+this.upcomingInput()+` -`+re+"^"},"showPosition"),test_match:w(function(Ce,re){var Y,J,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),J=Ce[0].match(/(?:\r\n?|\n).*/g),J&&(this.yylineno+=J.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:J?J[J.length-1].length-J[J.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],Y=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Y)return Y;if(this._backtrack){for(var X in ue)this[X]=ue[X];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ce,re,Y,J;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),X=0;Xre[0].length)){if(re=Y,J=X,this.options.backtrack_lexer){if(Ce=this.test_match(Y,ue[X]),Ce!==!1)return Ce;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(Ce=this.test_match(re,ue[J]),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 re=this.next();return re||this.lex()},"lex"),begin:w(function(re){this.conditionStack.push(re)},"begin"),popState:w(function(){var re=this.conditionStack.length-1;return re>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(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:w(function(re){this.begin(re)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(re,Y,J,ue){switch(J){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=qe;function le(){this.yy={}}return w(le,"Parser"),le.prototype=Ae,Ae.Parser=le,new le})();xK.parser=xK;var TYe=xK,L2e=["#","+","~","-",""],JT,I2e=(JT=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Nn(e,He());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Up(this.id);this.memberType==="method"&&(e+=`(${Up(this.parameters.trim())})`,this.returnType&&(e+=" : "+Up(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const s=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(s){const a=s[1]?s[1].trim():"";if(L2e.includes(a)&&(this.visibility=a),this.id=s[2],this.parameters=s[3]?s[3].trim():"",r=s[4]?s[4].trim():"",this.returnType=s[5]?s[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,s=e.substring(0,1),a=e.substring(i-1);L2e.includes(s)&&(this.visibility=s),/[$*]/.exec(a)&&(r=a),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:""}${Up(this.id)}${this.memberType==="method"?`(${Up(this.parameters)})${this.returnType?" : "+Up(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(JT,"ClassMember"),JT),uR="classId-",N2e=0,d1=w(t=>Gt.sanitizeText(t,He()),"sanitizeText"),Lg,CYe=(Lg=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=Cre();xt(e).select("svg").selectAll("g").filter(function(){return xt(this).attr("title")!==null}).on("mouseover",s=>{const a=xt(s.currentTarget),o=a.attr("title");if(!o)return;const l=s.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(M0.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),xt(s.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=qi,this.getAccTitle=ns,this.setAccDescription=is,this.getAccDescription=ss,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getConfig=w(()=>He().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=Gt.sanitizeText(e,He());let n="",i=r;if(r.indexOf("~")>0){const s=r.split("~");i=d1(s[0]),n=d1(s[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Gt.sanitizeText(e,He());r&&(r=d1(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=Gt.sanitizeText(e,He()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const s=Gt.sanitizeText(n,He());this.classes.set(s,{id:s,type:i,label:s,text:`${s}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:uR+s+"-"+N2e}),N2e++}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=Gt.sanitizeText(e,He());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",Oi()}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){de.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=Gt.sanitizeText(e.relationTitle1.trim(),He()),e.relationTitle2=Gt.sanitizeText(e.relationTitle2.trim(),He()),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 s=r.trim();s.startsWith("<<")&&s.endsWith(">>")?i.annotations.push(d1(s.substring(2,s.length-2))):s.indexOf(")")>0?i.methods.push(new I2e(s,"method")):s&&i.members.push(new I2e(s,"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)),d1(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=uR+i),i=this.splitClassNameAndType(i).className;const s=this.classes.get(i);s&&(s.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(s=>{if(/color/.exec(s)){const a=s.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(s)}),this.classes.forEach(s=>{s.cssClasses.includes(n)&&s.styles.push(...r.flatMap(a=>a.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,s=this.classes.get(i);s&&(s.tooltip=d1(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=He();e.split(",").forEach(s=>{let a=s;/\d/.exec(s[0])&&(a=uR+a),a=this.splitClassNameAndType(a).className;const o=this.classes.get(a);o&&(o.link=Kr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=d1(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const s=this.splitClassNameAndType(i).className,a=this.classes.get(s);a&&(a.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Gt.sanitizeText(e,He());if(He().securityLevel!=="loose"||r===void 0)return;const a=this.splitClassNameAndType(i).className;if(this.classes.has(a)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(a),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{Kr.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?s[a-1]:void 0,u=a===s.length-1,h=u&&r?r:i[a];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:s}=this.splitClassNameAndType(i),a=this.getClass(s);a.parent=e,this.namespaces.get(e).classes.set(s,a)}for(const i of n){const s=this.getNote(i);s.parent=e,this.namespaces.get(e).notes.set(i,s)}}}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 a,o;const e=[],r=[],n=He(),i=((a=n.class)==null?void 0:a.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 s=0;for(const l of this.relations){s++;const u={id:lx(l.id1,l.id2,{prefix:"id",counter:s}),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(Lg,"ClassDB"),Lg),t2r=w(t=>`g.classGroup text { + `;v.append("path").attr("d",T),w.append("path").attr("d",`M ${m.x},${m.y+y} + a ${b},${y} 0 0 0 0,${m.height}`),v.attr("transform",`translate(${b}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-b}, ${-m.height/2})`),e.rectData=m,l==="neo"&&v.attr("filter","url(#drop-shadow)");const k=i.get(e.name)??0;if(xp.has(u)&&(v.style("stroke",f[k%f.length]),v.style("fill",d[k%f.length]),w.style("stroke",f[k%f.length]),w.style("fill",d[k%f.length])),(A=e.properties)!=null&&A.icon){const R=e.properties.icon.trim(),_=m.x+m.width-20,N=m.y+10;R.charAt(0)==="@"?Mre(g,_,N,R.substr(1)):Are(g,_,N,R)}wp(r,Qa(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${lB}`},r);let C=e.height;const S=v.select("path:last-child");if(S.node()){const R=S.node().getBBox();e.height=R.height,C=R.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),C},"drawActorTypeQueue"),F5r=x(function(t,e,r,n,i,a){var E;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,U=t.append("g").lower();n||(Fn++,U.append("line").attr("id","actor"+Fn).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=Fn);const y=t.append("g");let b=U5;n?b+=` ${H1}`:b+=` ${V1}`,y.attr("class",b),y.attr("name",e.name);const v=uu();v.x=e.x,v.y=s,v.fill="#eaeaea",v.width=e.width,v.height=e.height,v.class="actor";const w=e.x+e.width/2,T=s+32,k=22;y.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"),y.append("circle").attr("cx",w).attr("cy",T).attr("r",k).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),y.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${T-k})`);const C=a.get(e.name)??0;xp.has(h)?(y.style("stroke",p[C%p.length]),y.style("fill",f[C%p.length])):(y.style("stroke",g),y.style("fill",m));const S=y.node().getBBox();return e.height=S.height+2*(((E=r==null?void 0:r.sequence)==null?void 0:E.labelBoxHeight)??0),wp(r,Qa(e.description))(e.description,y,v.x,v.y+k+(n?5:12),v.width,v.height,{class:`actor ${U5}`},r),n||(y.attr("data-et","participant"),y.attr("data-type","control"),y.attr("data-id",e.name)),e.height},"drawActorTypeControl"),z5r=x(function(t,e,r,n,i){var k;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+=` ${H1}`:m+=` ${V1}`,g.attr("class",m),g.attr("name",e.name);const U=uu();U.x=e.x,U.y=a,U.fill="#eaeaea",U.width=e.width,U.height=e.height,U.class="actor";const y=e.x+e.width/2,b=a+(n?10:25),v=22;g.append("circle").attr("cx",y).attr("cy",b).attr("r",v).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",y-v).attr("x2",y+v).attr("y1",b+v).attr("y2",b+v).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;xp.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const T=g.node().getBBox();return e.height=T.height+(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),n||(Fn++,p.append("line").attr("id","actor"+Fn).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=Fn),wp(r,Qa(e.description))(e.description,g,U.x,U.y+(n?15:30),U.width,U.height,{class:`actor ${U5}`},r),n?g.attr("transform",`translate(0, ${v})`):(g.attr("transform",`translate(0, ${v/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),V5r=x(function(t,e,r,n,i){var A;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||(Fn++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",cB(`actor${Fn}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Fn).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=Fn,e.links!=null&&m.attr("id","root-"+Fn),h==="neo"&&m.attr("data-look","neo"));const U=uu();let y="actor";(A=e.properties)!=null&&A.class?y=e.properties.class:U.fill="#eaeaea",n?y+=` ${H1}`:y+=` ${V1}`,U.x=e.x,U.y=a,U.width=e.width,U.height=e.height,U.class=y,U.name=e.name,U.x=e.x,U.y=a;const b=U.width/3,v=U.width/3,w=b/2,T=w/(2.5+b/50),k=m.append("g");k.attr("class",y);const C=` + M ${U.x},${U.y+T} + a ${w},${T} 0 0 0 ${b},0 + a ${w},${T} 0 0 0 -${b},0 + l 0,${v-2*T} + a ${w},${T} 0 0 0 ${b},0 + l 0,-${v-2*T} +`;k.append("path").attr("d",C),h==="neo"&&k.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;xp.has(l)?(k.style("stroke",f[S%f.length]),k.style("fill",d[S%f.length])):k.style("stroke",p),k.attr("transform",`translate(${b}, ${T})`),e.rectData=U,wp(r,Qa(e.description))(e.description,m,U.x,U.y+35,U.width,U.height,{class:`actor ${lB}`},r);const E=k.select("path:last-child");if(E.node()){const R=E.node().getBBox();e.height=R.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"),H5r=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Fn++,u.append("line").attr("id","actor"+Fn).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=Fn);const U=t.append("g");let y=U5;n?y+=` ${H1}`:y+=` ${V1}`,U.attr("class",y),U.attr("name",e.name);const b=uu();b.x=e.x,b.y=a,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor",U.append("line").attr("id","actor-man-torso"+Fn).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),U.append("line").attr("id","actor-man-arms"+Fn).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),U.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&U.attr("filter","url(#drop-shadow)");const v=i.get(e.name)??0;xp.has(d)?(U.style("stroke",g[v%g.length]),U.style("fill",p[v%g.length])):U.style("stroke",m);const w=U.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),wp(r,Qa(e.description))(e.description,U,b.x,b.y+15,b.width,b.height,{class:`actor ${U5}`},r),U.attr("transform",`translate(0,${l/2+10})`),n||(U.attr("data-et","participant"),U.attr("data-type","boundary"),U.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),G5r=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Fn++,g.append("line").attr("id","actor"+Fn).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=Fn);const m=t.append("g");let U=U5;n?U+=` ${H1}`:U+=` ${V1}`,m.attr("class",U),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const y=l==="neo"?.5:1,b=l==="neo"?a+(1-y)*30:a;m.append("line").attr("id","actor-man-torso"+Fn).attr("x1",s).attr("y1",b+25*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("id","actor-man-arms"+Fn).attr("x1",s-xU/2*y).attr("y1",b+33*y).attr("x2",s+xU/2*y).attr("y2",b+33*y),m.append("line").attr("x1",s-xU/2*y).attr("y1",b+60*y).attr("x2",s).attr("y2",b+45*y),m.append("line").attr("x1",s).attr("y1",b+45*y).attr("x2",s+(xU/2-2)*y).attr("y2",b+60*y);const v=m.append("circle");v.attr("cx",e.x+e.width/2),v.attr("cy",b+10*y),v.attr("r",15*y),v.attr("width",e.width*y),v.attr("height",e.height*y);const w=m.node().getBBox();e.height=w.height;const T=uu();T.x=e.x,T.y=b,T.fill="#eaeaea",T.width=e.width,T.height=e.height/y,T.class="actor",T.rx=3,T.ry=3;const k=i.get(e.name)??0;return xp.has(u)?(m.style("stroke",f[k%f.length]),m.style("fill",d[k%f.length])):m.style("stroke",p),wp(r,Qa(e.description))(e.description,m,T.x,b+35*y-(l==="neo"?10:0),T.width,T.height,{class:`actor ${U5}`},r),e.height},"drawActorTypeActor"),W5r=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await G5r(t,e,r,n,o);case"participant":return await P5r(t,e,r,n,o);case"boundary":return await H5r(t,e,r,n,o);case"control":return await F5r(t,e,r,n,i,o);case"entity":return await z5r(t,e,r,n,o);case"database":return await V5r(t,e,r,n,o);case"collections":return await B5r(t,e,r,n,o);case"queue":return await $5r(t,e,r,n,o)}},"drawActor"),q5r=x(function(t,e,r){const i=t.append("g");SYe(i,e),e.name&&wp(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),j5r=x(function(t){return t.append("g")},"anchorElement"),Y5r=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=uu(),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=xC(p,f),y=(s??new Map([...a.db.getActors().values()].map((b,v)=>[b.name,v]))).get(g)??0;xp.has(o)&&(m.style("stroke",h[y%h.length]),m.style("fill",u[y%h.length]??d))},"drawActivation"),X5r=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(U,y,b,v){return f.append("line").attr("x1",U).attr("y1",y).attr("x2",b).attr("y2",v).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(U){p(e.startx,U.y,e.stopx,U.y).style("stroke-dasharray","3, 3")});let g=Rre();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",CYe(f,g),g=EYe(),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=Qa(g.text)?await sD(f,g,e):R4(f,g);if(e.sectionTitles!==void 0){for(const[U,y]of Object.entries(e.sectionTitles))if(y.message){g.text=y.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[U].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,Qa(g.text)?(e.starty=e.sections[U].y,await sD(f,g,e)):R4(f,g);let b=Math.round(m.map(v=>(v._groups||v)[0][0].getBBox().height).reduce((v,w)=>v+w));e.sections[U].height+=b-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),SYe=x(function(t,e){zOe(t,e)},"drawBackgroundRect"),K5r=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Z5r=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),J5r=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Q5r=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),e2r=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),t2r=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),r2r=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),n2r=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),EYe=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),i2r=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),wp=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[U,y]=ip(p),b=a.split(Ht.lineBreakRegex);for(let v=0;vt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,RYe(He())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*tt.boxMargin,Math.max),i.updateVal(Rt.data,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(Rt.data,"stopx",r+h*tt.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*tt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*tt.boxMargin,Math.max),i.updateVal(Rt.data,"starty",e-h*tt.boxMargin,Math.min),i.updateVal(Rt.data,"stopy",n+h*tt.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=Ht.getMin(t,r),a=Ht.getMax(t,r),s=Ht.getMin(e,n),o=Ht.getMax(e,n);this.updateVal(Rt.data,"startx",i,Math.min),this.updateVal(Rt.data,"starty",s,Math.min),this.updateVal(Rt.data,"stopx",a,Math.max),this.updateVal(Rt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=uB(t.from).length||0,a=n.x+n.width/2+(i-1)*tt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+tt.activationWidth,stopy:void 0,actor:t.from,anchored:$i.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Rt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Ht.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},u2r=x(async function(t,e,r){Rt.bumpVerticalPos(tt.boxMargin),e.height=tt.boxMargin,e.starty=Rt.getVerticalPos();const n=uu();n.x=e.startx,n.y=e.starty,n.width=e.width||tt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=$i.drawRect(i,n),s=Rre();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=tt.noteFontFamily,s.fontSize=tt.noteFontSize,s.fontWeight=tt.noteFontWeight,s.anchor=tt.noteAlign,s.textMargin=tt.noteMargin,s.valign="center";const o=Qa(s.text)?await sD(i,s):R4(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*tt.noteMargin),e.height+=l+2*tt.noteMargin,Rt.bumpVerticalPos(l+2*tt.noteMargin),e.stopy=e.starty+l+2*tt.noteMargin,e.stopx=e.startx+n.width,Rt.insert(e.startx,e.starty,e.stopx,e.stopy),Rt.models.addNote(e)},"drawNote"),$2e=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=DYe(e,n),m=t.append("g"),U=16.5,y=x((k,C)=>{const S=k?U:-U;return C?-S:S},"getCircleOffset"),b=x(k=>{m.append("circle").attr("cx",k).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:v,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:T}=n.db.LINETYPE;if(h)switch(e.centralConnection){case v:g&&(f+=y(p,!0));break;case w:g||(d+=y(p,!1));break;case T:g?f+=y(p,!0):d+=y(p,!1);break}switch(e.centralConnection){case v:b(f);break;case w:b(d);break;case T:b(d),b(f);break}},"drawCentralConnection"),y5=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),wy=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),kK=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function AYe(t,e){Rt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Ht.splitBreaks(i).length,s=Qa(i),o=s?await ek(i,He()):Kr.calculateTextDimensions(i,y5(tt));if(!s){const d=o.height/a;e.height+=d,Rt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=Rt.getVerticalPos()+u,tt.rightAngles||(u+=tt.boxMargin,l=Rt.getVerticalPos()+u),u+=30;const d=Ht.getMax(h/2,tt.width/2);Rt.insert(r-d,Rt.getVerticalPos()-10+u,n+d,Rt.getVerticalPos()+30+u)}else u+=tt.boxMargin,l=Rt.getVerticalPos()+u,Rt.insert(r,l-10,n,l);return Rt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Rt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(AYe,"boundMessage");var h2r=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=Kr.calculateTextDimensions(u,y5(tt)),g=Rre();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=tt.messageFontFamily,g.fontSize=tt.messageFontSize,g.fontWeight=tt.messageFontWeight,g.anchor=tt.messageAlign,g.valign="center",g.textMargin=tt.wrapPadding,g.tspan=!1,Qa(g.text)?await sD(t,g,{startx:s,stopx:o,starty:r}):R4(t,g);const m=p.width;let U;if(s===o){const b=f||tt.showSequenceNumbers,v=DYe(i,n),w=y2r(i,n),T=s+(b&&(v||w)?10:0);tt.rightAngles?U=t.append("path").attr("d",`M ${T},${r} H ${s+Ht.getMax(tt.width/2,m/2)} V ${r+25} H ${s}`):U=t.append("path").attr("d","M "+T+","+r+" C "+(T+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),oH(i,n)&&$2e(t,i,e,n,s,o,r)}else U=t.append("line"),U.attr("x1",s),U.attr("y1",r),U.attr("x2",o),U.attr("y2",r),oH(i,n)&&$2e(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?(U.style("stroke-dasharray","3, 3"),U.attr("class","messageLine1")):U.attr("class","messageLine0"),U.attr("data-et","message"),U.attr("data-id","i"+e.id),U.attr("data-from",e.from),U.attr("data-to",e.to);let y="";if(tt.arrowMarkerAbsolute&&(y=iO(!0)),U.attr("stroke-width",2),U.attr("stroke","none"),U.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&U.attr("marker-end","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&U.attr("marker-end","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&U.attr("marker-end","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&U.attr("marker-end","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&U.attr("marker-start","url("+y+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&U.attr("marker-start","url("+y+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&U.attr("marker-start","url("+y+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&U.attr("marker-start","url("+y+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&U.attr("marker-end","url("+y+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(U.attr("marker-start","url("+y+"#"+a+"-arrowhead)"),U.attr("marker-end","url("+y+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&U.attr("marker-end","url("+y+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&U.attr("marker-end","url("+y+"#"+a+"-crosshead)"),f||tt.showSequenceNumbers){const b=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,v=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,T=oH(i,n);let k=s,C=o;b?(ss?C=o-2*w:(C=o-w,k+=(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+=T?15:0,U.attr("x2",C),U.attr("x1",k)):U.attr("x1",s+w);let S=0;const E=s===o,A=s<=o;E?S=e.fromBounds+1:v?S=A?e.toBounds-1:e.fromBounds+1:S=A?e.fromBounds+1:e.toBounds-1;let R="12px";const _=d.toString().length;_>5?R="7px":_>3&&(R="9px"),t.append("line").attr("x1",S).attr("y1",r).attr("x2",S).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+y+"#"+a+"-sequencenumber)"),t.append("text").attr("x",S).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",R).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),d2r=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||Rt.models.addBox(u),l+=tt.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=Ht.getMax(f.width||tt.width,tt.width),f.height=Ht.getMax(f.height||tt.height,tt.height),f.margin=f.margin||tt.actorMargin,h=Ht.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=Rt.getVerticalPos(),Rt.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,Rt.models.addActor(f)}u&&!s&&Rt.models.addBox(u),Rt.bumpVerticalPos(h)},"addActorRenderingData"),SK=x(async function(t,e,r,n,i,a,s){if(n){let o=0;Rt.bumpVerticalPos(tt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Rt.getVerticalPos());const h=await $i.drawActor(t,u,tt,!0,i,a,s);o=Ht.getMax(o,h)}Rt.bumpVerticalPos(o+tt.boxMargin)}else for(const o of r){const l=e.get(o);await $i.drawActor(t,l,tt,!1,i,a,s)}},"drawActors"),MYe=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=p2r(o),u=$i.drawPopup(t,o,l,tt,tt.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),RYe=x(function(t){ss(tt,t),t.fontFamily&&(tt.actorFontFamily=tt.noteFontFamily=tt.messageFontFamily=t.fontFamily),t.fontSize&&(tt.actorFontSize=tt.noteFontSize=tt.messageFontSize=t.fontSize),t.fontWeight&&(tt.actorFontWeight=tt.noteFontWeight=tt.messageFontWeight=t.fontWeight)},"setConf"),uB=x(function(t){return Rt.activations.filter(function(e){return e.actor===t})},"actorActivations"),F2e=x(function(t,e){const r=e.get(t),n=uB(t),i=n.reduce(function(s,o){return Ht.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return Ht.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function ih(t,e,r,n,i){Rt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=y5(tt);e.message=Kr.wrapLabel(`[${e.message}]`,s-2*tt.wrapPadding,o),e.width=s,e.wrap=!0;const l=Kr.calculateTextDimensions(e.message,o),u=Ht.getMax(l.height,tt.labelBoxHeight);a=n+u,de.debug(`${u} - ${e.message}`)}i(e),Rt.bumpVerticalPos(a)}x(ih,"adjustLoopHeightForWrap");function LYe(t,e,r,n,i,a,s){function o(h,d){h.x{$.add(V.from),$.add(V.to)}),U=U.filter(V=>$.has(V))}const k=new Map(U.map(($,V)=>{var H;return[((H=f.get($))==null?void 0:H.name)??$,V]}));d2r(d,f,p,U,0,y,!1);const C=await v2r(y,f,T,n);$i.insertArrowHead(d,e),$i.insertArrowCrossHead(d,e),$i.insertArrowFilledHead(d,e),$i.insertSequenceNumber(d,e),$i.insertSolidTopArrowHead(d,e),$i.insertSolidBottomArrowHead(d,e),$i.insertStickTopArrowHead(d,e),$i.insertStickBottomArrowHead(d,e),s==="neo"&&$i.insertDropShadow(d,tt);function S($,V){const H=Rt.endActivation($);H.starty+18>V&&(H.starty=V-6,V+=12),$i.drawActivation(d,H,V,tt,uB($.from).length,n,k),Rt.insert(H.startx,V-10,H.stopx,V)}x(S,"activeEnd");let E=1,A=1;const R=[],_=[];let N=0;for(const $ of y){let V,H,G;switch($.type){case n.db.LINETYPE.NOTE:Rt.resetVerticalPos(),H=$.noteModel,await u2r(d,H,$.id);break;case n.db.LINETYPE.ACTIVE_START:Rt.newActivation($,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Rt.newActivation($,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Rt.newActivation($,d,f);break;case n.db.LINETYPE.ACTIVE_END:S($,Rt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.LOOP_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"loop",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;case n.db.LINETYPE.RECT_START:ih(C,$,tt.boxMargin,tt.boxMargin,K=>{let W=K.message;W||(W=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),Rt.newLoop(void 0,W)});break;case n.db.LINETYPE.RECT_END:V=Rt.endLoop(),_.push(V),Rt.models.addLoop(V),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.OPT_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"opt",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;case n.db.LINETYPE.ALT_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.ALT_ELSE:ih(C,$,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.ALT_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"alt",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K)),Rt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:ih(C,$,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.PAR_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"par",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;case n.db.LINETYPE.AUTONUMBER:E=$.message.start||E,A=$.message.step||A,$.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.CRITICAL_OPTION:ih(C,$,tt.boxMargin+tt.boxTextMargin,tt.boxMargin,K=>Rt.addSectionToLoop(K));break;case n.db.LINETYPE.CRITICAL_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"critical",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;case n.db.LINETYPE.BREAK_START:ih(C,$,tt.boxMargin,tt.boxMargin+tt.boxTextMargin,K=>Rt.newLoop(K));break;case n.db.LINETYPE.BREAK_END:V=Rt.endLoop(),await $i.drawLoop(d,V,"break",tt,$),Rt.bumpVerticalPos(V.stopy-Rt.getVerticalPos()),Rt.models.addLoop(V);break;default:try{G=$.msgModel,G.starty=Rt.getVerticalPos(),G.sequenceIndex=E,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=$.id,G.from=$.from,G.to=$.to;const K=await AYe(d,G);LYe($,G,K,N,f,p,g),R.push({messageModel:G,lineStartY:K,msg:$}),Rt.models.addMessage(G)}catch(K){de.error("error while drawing message",K)}}[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($.type)&&(E=Math.round((E+A)*100)/100),N++}de.debug("createdActors",p),de.debug("destroyedActors",g),await SK(d,f,U,!1,e,n,k);for(const $ of R)await h2r(d,$.messageModel,$.lineStartY,n,$.msg,e);tt.mirrorActors&&await SK(d,f,U,!0,e,n,k),_.forEach($=>$i.drawBackgroundRect(d,$)),kYe(d,f,U,tt);for(const $ of Rt.models.boxes){$.height=Rt.getVerticalPos()-$.y,Rt.insert($.x,$.y,$.x+$.width,$.height);const V=tt.boxMargin*2;$.startx=$.x-V,$.starty=$.y-V*.25,$.stopx=$.startx+$.width+2*V,$.stopy=$.starty+$.height+V*.75,$.stroke="rgb(0,0,0, 0.5)",$i.drawBox(d,$,tt)}v&&Rt.bumpVerticalPos(tt.boxMargin);const L=MYe(d,f,U,h),{bounds:I}=Rt.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 P=I.stopy-I.starty;P{const s=y5(tt);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=tt.boxMargin*8;o+=l,o-=2*tt.boxTextMargin,a.wrap&&(a.name=Kr.wrapLabel(a.name,o-2*tt.wrapPadding,s));const u=Kr.calculateTextDimensions(a.name,s);i=Ht.getMax(u.height,i);const h=Ht.getMax(o,u.width+2*tt.wrapPadding);if(a.margin=tt.boxTextMargin,oa.textMaxHeight=i),Ht.getMax(n,tt.height)}x(NYe,"calculateActorMargins");var g2r=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=Qa(t.message)?await ek(t.message,He()):Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,tt.width,wy(tt)):t.message,wy(tt));const u={width:o?tt.width:Ht.getMax(tt.width,l.width+2*tt.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?Ht.getMax(tt.width,l.width):Ht.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a+(n.width+tt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?Ht.getMax(tt.width,l.width+2*tt.noteMargin):Ht.getMax(n.width/2+i.width/2,l.width+2*tt.noteMargin),u.startx=a-u.width+(n.width-tt.actorMargin)/2):t.to===t.from?(l=Kr.calculateTextDimensions(o?Kr.wrapLabel(t.message,Ht.getMax(tt.width,n.width),wy(tt)):t.message,wy(tt)),u.width=o?Ht.getMax(tt.width,n.width):Ht.getMax(n.width,tt.width,l.width+2*tt.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+tt.actorMargin,u.startx=a2,f=x(U=>l?-U:U,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(tt.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=Kr.wrapLabel(t.message,Ht.getMax(g+2*tt.wrapPadding,tt.width),y5(tt)));const m=Kr.calculateTextDimensions(t.message,y5(tt));return{width:Ht.getMax(t.wrap?0:m.width+2*tt.wrapPadding,g+2*tt.wrapPadding,tt.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"),v2r=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=uB(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*tt.activationWidth/2,g={startx:p,stopx:p+tt.activationWidth,actor:u.from,enabled:!0};Rt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Rt.activations.map(f=>f.actor).lastIndexOf(u.from);Rt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await g2r(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=Ht.getMin(s.from,o.startx),s.to=Ht.getMax(s.to,o.startx+o.width),s.width=Ht.getMax(s.width,Math.abs(s.from-s.to))-tt.labelBoxWidth})):(l=b2r(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=Ht.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=Ht.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=Ht.getMax(s.width,Math.abs(s.to-s.from))-tt.labelBoxWidth}else s.from=Ht.getMin(l.startx,s.from),s.to=Ht.getMax(l.stopx,s.to),s.width=Ht.getMax(s.width,l.width)-tt.labelBoxWidth}))}return Rt.activations=[],de.debug("Loop type widths:",i),i},"calculateLoopBounds"),x2r={bounds:Rt,drawActors:SK,drawActorsPopup:MYe,setConf:RYe,draw:f2r},w2r={parser:M5r,get db(){return new N5r},renderer:x2r,styles:O5r,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,IG({sequence:{wrap:t.wrap}}))},"init")};const T2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:w2r},Symbol.toStringTag,{value:"Module"}));var EK=(function(){var t=x(function(pe,Te,re,Y){for(re=re||{},Y=pe.length;Y--;re[pe[Y]]=Te);return re},"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],U=[1,38],y=[1,27],b=[1,28],v=[1,29],w=[1,30],T=[1,31],k=[1,44],C=[1,46],S=[1,43],E=[1,47],A=[1,9],R=[1,8,9],_=[1,58],N=[1,59],L=[1,60],I=[1,61],P=[1,62],O=[1,63],D=[1,64],B=[1,8,9,41],F=[1,77],z=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],$=[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],H=[13,60,73,74,86,100,102,103],G=[13,60,68,69,70,71,72,86,100,102,103],K=[1,103],W=[1,121],oe=[1,117],Z=[1,113],J=[1,119],ne=[1,114],ie=[1,115],me=[1,116],te=[1,118],Re=[1,120],Pe=[22,50,60,61,82,86,87,88,89,90],Ve=[1,128],ce=[12,39],he=[1,8,9,39,41,44,46],we=[1,8,9,22],ge=[1,153],ze=[1,8,9,61],xe=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ee={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(Te,re,Y,Q,ue,X,fe){var ee=X.length-1;switch(ue){case 8:this.$=X[ee-1];break;case 9:case 10:case 13:case 15:this.$=X[ee];break;case 11:case 14:this.$=X[ee-2]+"."+X[ee];break;case 12:case 16:this.$=X[ee-1]+X[ee];break;case 17:case 18:this.$=X[ee-1]+"~"+X[ee]+"~";break;case 19:Q.addRelation(X[ee]);break;case 20:X[ee-1].title=Q.cleanupLabel(X[ee]),Q.addRelation(X[ee-1]);break;case 31:this.$=X[ee].trim(),Q.setAccTitle(this.$);break;case 32:case 33:this.$=X[ee].trim(),Q.setAccDescription(this.$);break;case 34:Q.addClassesToNamespace(X[ee-3],X[ee-1][0],X[ee-1][1]),Q.popNamespace();break;case 35:Q.addClassesToNamespace(X[ee-4],X[ee-1][0],X[ee-1][1]),Q.popNamespace();break;case 36:this.$=Q.addNamespace(X[ee]);break;case 37:this.$=Q.addNamespace(X[ee-1],X[ee]);break;case 38:this.$=[[X[ee]],[]];break;case 39:this.$=[[X[ee-1]],[]];break;case 40:X[ee][0].unshift(X[ee-2]),this.$=X[ee];break;case 41:this.$=[[],[X[ee]]];break;case 42:this.$=[[],[X[ee-1]]];break;case 43:X[ee][1].unshift(X[ee-2]),this.$=X[ee];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=X[ee];break;case 48:Q.setCssClass(X[ee-2],X[ee]);break;case 49:Q.addMembers(X[ee-3],X[ee-1]);break;case 51:Q.setCssClass(X[ee-5],X[ee-3]),Q.addMembers(X[ee-5],X[ee-1]);break;case 52:Q.addAnnotation(X[ee-3],X[ee-1]);break;case 53:Q.addAnnotation(X[ee-6],X[ee-4]),Q.addMembers(X[ee-6],X[ee-1]);break;case 54:Q.addAnnotation(X[ee-5],X[ee-3]);break;case 55:this.$=X[ee],Q.addClass(X[ee]);break;case 56:this.$=X[ee-1],Q.addClass(X[ee-1]),Q.setClassLabel(X[ee-1],X[ee]);break;case 60:Q.addAnnotation(X[ee],X[ee-2]);break;case 61:case 74:this.$=[X[ee]];break;case 62:X[ee].push(X[ee-1]),this.$=X[ee];break;case 63:break;case 64:Q.addMember(X[ee-1],Q.cleanupLabel(X[ee]));break;case 65:break;case 66:break;case 67:this.$={id1:X[ee-2],id2:X[ee],relation:X[ee-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-1],relationTitle1:X[ee-2],relationTitle2:"none"};break;case 69:this.$={id1:X[ee-3],id2:X[ee],relation:X[ee-2],relationTitle1:"none",relationTitle2:X[ee-1]};break;case 70:this.$={id1:X[ee-4],id2:X[ee],relation:X[ee-2],relationTitle1:X[ee-3],relationTitle2:X[ee-1]};break;case 71:this.$=Q.addNote(X[ee],X[ee-1]);break;case 72:this.$=Q.addNote(X[ee]);break;case 73:this.$=X[ee-2],Q.defineClass(X[ee-1],X[ee]);break;case 75:this.$=X[ee-2].concat([X[ee]]);break;case 76:Q.setDirection("TB");break;case 77:Q.setDirection("BT");break;case 78:Q.setDirection("RL");break;case 79:Q.setDirection("LR");break;case 80:this.$={type1:X[ee-2],type2:X[ee],lineType:X[ee-1]};break;case 81:this.$={type1:"none",type2:X[ee],lineType:X[ee-1]};break;case 82:this.$={type1:X[ee-1],type2:"none",lineType:X[ee]};break;case 83:this.$={type1:"none",type2:"none",lineType:X[ee]};break;case 84:this.$=Q.relationType.AGGREGATION;break;case 85:this.$=Q.relationType.EXTENSION;break;case 86:this.$=Q.relationType.COMPOSITION;break;case 87:this.$=Q.relationType.DEPENDENCY;break;case 88:this.$=Q.relationType.LOLLIPOP;break;case 89:this.$=Q.lineType.LINE;break;case 90:this.$=Q.lineType.DOTTED_LINE;break;case 91:case 97:this.$=X[ee-2],Q.setClickEvent(X[ee-1],X[ee]);break;case 92:case 98:this.$=X[ee-3],Q.setClickEvent(X[ee-2],X[ee-1]),Q.setTooltip(X[ee-2],X[ee]);break;case 93:this.$=X[ee-2],Q.setLink(X[ee-1],X[ee]);break;case 94:this.$=X[ee-3],Q.setLink(X[ee-2],X[ee-1],X[ee]);break;case 95:this.$=X[ee-3],Q.setLink(X[ee-2],X[ee-1]),Q.setTooltip(X[ee-2],X[ee]);break;case 96:this.$=X[ee-4],Q.setLink(X[ee-3],X[ee-2],X[ee]),Q.setTooltip(X[ee-3],X[ee-1]);break;case 99:this.$=X[ee-3],Q.setClickEvent(X[ee-2],X[ee-1],X[ee]);break;case 100:this.$=X[ee-4],Q.setClickEvent(X[ee-3],X[ee-2],X[ee-1]),Q.setTooltip(X[ee-3],X[ee]);break;case 101:this.$=X[ee-3],Q.setLink(X[ee-2],X[ee]);break;case 102:this.$=X[ee-4],Q.setLink(X[ee-3],X[ee-1],X[ee]);break;case 103:this.$=X[ee-4],Q.setLink(X[ee-3],X[ee-1]),Q.setTooltip(X[ee-3],X[ee]);break;case 104:this.$=X[ee-5],Q.setLink(X[ee-4],X[ee-2],X[ee]),Q.setTooltip(X[ee-4],X[ee-1]);break;case 105:this.$=X[ee-2],Q.setCssStyle(X[ee-1],X[ee]);break;case 106:Q.setCssClass(X[ee-1],X[ee]);break;case 107:this.$=[X[ee]];break;case 108:X[ee-2].push(X[ee]),this.$=X[ee-2];break;case 110:this.$=X[ee-1]+X[ee];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:U,75:y,76:b,78:v,82:w,83:T,86:k,100:C,102:S,103:E},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(A,[2,5],{8:[1,48]}),{8:[1,49]},t(R,[2,19],{22:[1,50]}),t(R,[2,21]),t(R,[2,22]),t(R,[2,23]),t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,29]),t(R,[2,30]),{34:[1,51]},{36:[1,52]},t(R,[2,33]),t(R,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:_,69:N,70:L,71:I,72:P,73:O,74:D}),{39:[1,65]},t(B,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(R,[2,65]),t(R,[2,66]),{16:69,60:f,86:k,100:C,102:S},{16:39,17:40,19:70,60:f,86:k,100:C,102:S,103:E},{16:39,17:40,19:71,60:f,86:k,100:C,102:S,103:E},{16:39,17:40,19:72,60:f,86:k,100:C,102:S,103:E},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:k,100:C,102:S,103:E},{13:F,55:76},{58:78,60:[1,79]},t(R,[2,76]),t(R,[2,77]),t(R,[2,78]),t(R,[2,79]),t(z,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:k,100:C,102:S,103:E}),t(z,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:k,100:C,102:S,103:E},{16:39,17:40,19:87,60:f,86:k,100:C,102:S,103:E},t($,[2,133]),t($,[2,134]),t($,[2,135]),t($,[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(A,[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:U,75:y,76:b,78:v,82:w,83:T,86:k,100:C,102:S,103:E}),{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:U,75:y,76:b,78:v,82:w,83:T,86:k,100:C,102:S,103:E},t(R,[2,20]),t(R,[2,31]),t(R,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:k,100:C,102:S,103:E},{53:92,66:56,67:57,68:_,69:N,70:L,71:I,72:P,73:O,74:D},t(R,[2,64]),{67:93,73:O,74:D},t(V,[2,83],{66:94,68:_,69:N,70:L,71:I,72:P}),t(H,[2,84]),t(H,[2,85]),t(H,[2,86]),t(H,[2,87]),t(H,[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:k,100:C,102:S},{41:[1,102],45:101,51:K},{16:104,60:f,86:k,100:C,102:S},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:W,50:oe,59:110,60:Z,82:J,84:111,85:112,86:ne,87:ie,88:me,89:te,90:Re},{60:[1,122]},{13:F,55:123},t(B,[2,72]),t(B,[2,138]),{22:W,50:oe,59:124,60:Z,61:[1,125],82:J,84:111,85:112,86:ne,87:ie,88:me,89:te,90:Re},t(Pe,[2,74]),{16:39,17:40,19:126,60:f,86:k,100:C,102:S,103:E},t(z,[2,16]),t(z,[2,17]),t(z,[2,18]),{11:127,12:Ve,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:k,100:C,102:S,103:E}),t(ce,[2,10]),t(he,[2,55],{11:131,12:Ve}),t(A,[2,7]),{9:[1,132]},t(we,[2,67]),{16:39,17:40,19:133,60:f,86:k,100:C,102:S,103:E},{13:[1,135],16:39,17:40,19:134,60:f,86:k,100:C,102:S,103:E},t(V,[2,82],{66:136,68:_,69:N,70:L,71:I,72:P}),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(B,[2,48],{39:[1,142]}),{41:[1,143]},t(B,[2,50]),{41:[2,61],45:144,51:K},{47:[1,145]},{16:39,17:40,19:146,60:f,86:k,100:C,102:S,103:E},t(R,[2,91],{13:[1,147]}),t(R,[2,93],{13:[1,149],77:[1,148]}),t(R,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(R,[2,105],{61:ge}),t(ze,[2,107],{85:154,22:W,50:oe,60:Z,82:J,86:ne,87:ie,88:me,89:te,90:Re}),t(xe,[2,109]),t(xe,[2,111]),t(xe,[2,112]),t(xe,[2,113]),t(xe,[2,114]),t(xe,[2,115]),t(xe,[2,116]),t(xe,[2,117]),t(xe,[2,118]),t(xe,[2,119]),t(R,[2,106]),t(B,[2,71]),t(R,[2,73],{61:ge}),{60:[1,155]},t(z,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:k,100:C,102:S,103:E},t(ce,[2,12]),t(he,[2,56]),{1:[2,4]},t(we,[2,69]),t(we,[2,68]),{16:39,17:40,19:158,60:f,86:k,100:C,102:S,103:E},t(V,[2,80]),t(B,[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:K},t(B,[2,49]),{41:[2,62]},t(B,[2,52],{39:[1,164]}),t(R,[2,60]),t(R,[2,92]),t(R,[2,94]),t(R,[2,95],{77:[1,165]}),t(R,[2,98]),t(R,[2,99],{13:[1,166]}),t(R,[2,101],{13:[1,168],77:[1,167]}),{22:W,50:oe,60:Z,82:J,84:169,85:112,86:ne,87:ie,88:me,89:te,90:Re},t(xe,[2,110]),t(Pe,[2,75]),{14:[1,170]},t(ce,[2,11]),t(we,[2,70]),t(B,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:K},t(R,[2,96]),t(R,[2,100]),t(R,[2,102]),t(R,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:W,50:oe,60:Z,82:J,86:ne,87:ie,88:me,89:te,90:Re}),t(he,[2,8]),t(B,[2,51]),{41:[1,175]},t(B,[2,54]),t(R,[2,104]),t(B,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(Te,re){if(re.recoverable)this.trace(Te);else{var Y=new Error(Te);throw Y.hash=re,Y}},"parseError"),parse:x(function(Te){var re=this,Y=[0],Q=[],ue=[null],X=[],fe=this.table,ee="",Ae=0,Me=0,Ke=2,Ne=1,je=X.slice.call(arguments,1),De=Object.create(this.lexer),Ze={yy:{}};for(var Fe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Fe)&&(Ze.yy[Fe]=this.yy[Fe]);De.setInput(Te,Ze.yy),Ze.yy.lexer=De,Ze.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var at=De.yylloc;X.push(at);var _e=De.options&&De.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gt(Mt){Y.length=Y.length-2*Mt,ue.length=ue.length-Mt,X.length=X.length-Mt}x(gt,"popStack");function Le(){var Mt;return Mt=Q.pop()||De.lex()||Ne,typeof Mt!="number"&&(Mt instanceof Array&&(Q=Mt,Mt=Q.pop()),Mt=re.symbols_[Mt]||Mt),Mt}x(Le,"lex");for(var kt,Et,ot,Vt,Lt={},dt,ve,It,xt;;){if(Et=Y[Y.length-1],this.defaultActions[Et]?ot=this.defaultActions[Et]:((kt===null||typeof kt>"u")&&(kt=Le()),ot=fe[Et]&&fe[Et][kt]),typeof ot>"u"||!ot.length||!ot[0]){var mt="";xt=[];for(dt in fe[Et])this.terminals_[dt]&&dt>Ke&&xt.push("'"+this.terminals_[dt]+"'");De.showPosition?mt="Parse error on line "+(Ae+1)+`: +`+De.showPosition()+` +Expecting `+xt.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":mt="Parse error on line "+(Ae+1)+": Unexpected "+(kt==Ne?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(mt,{text:De.match,token:this.terminals_[kt]||kt,line:De.yylineno,loc:at,expected:xt})}if(ot[0]instanceof Array&&ot.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+kt);switch(ot[0]){case 1:Y.push(kt),ue.push(De.yytext),X.push(De.yylloc),Y.push(ot[1]),kt=null,Me=De.yyleng,ee=De.yytext,Ae=De.yylineno,at=De.yylloc;break;case 2:if(ve=this.productions_[ot[1]][1],Lt.$=ue[ue.length-ve],Lt._$={first_line:X[X.length-(ve||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(ve||1)].first_column,last_column:X[X.length-1].last_column},_e&&(Lt._$.range=[X[X.length-(ve||1)].range[0],X[X.length-1].range[1]]),Vt=this.performAction.apply(Lt,[ee,Me,Ae,Ze.yy,ot[1],ue,X].concat(je)),typeof Vt<"u")return Vt;ve&&(Y=Y.slice(0,-1*ve*2),ue=ue.slice(0,-1*ve),X=X.slice(0,-1*ve)),Y.push(this.productions_[ot[1]][0]),ue.push(Lt.$),X.push(Lt._$),It=fe[Y[Y.length-2]][Y[Y.length-1]],Y.push(It);break;case 3:return!0}}return!0},"parse")},qe=(function(){var pe={EOF:1,parseError:x(function(re,Y){if(this.yy.parser)this.yy.parser.parseError(re,Y);else throw new Error(re)},"parseError"),setInput:x(function(Te,re){return this.yy=re||this.yy||{},this._input=Te,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Te=this._input[0];this.yytext+=Te,this.yyleng++,this.offset++,this.match+=Te,this.matched+=Te;var re=Te.match(/(?:\r\n?|\n).*/g);return re?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Te},"input"),unput:x(function(Te){var re=Te.length,Y=Te.split(/(?:\r\n?|\n)/g);this._input=Te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-re),this.offset-=re;var Q=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),Y.length-1&&(this.yylineno-=Y.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Y?(Y.length===Q.length?this.yylloc.first_column:0)+Q[Q.length-Y.length].length-Y[0].length:this.yylloc.first_column-re},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-re]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Te){this.unput(this.match.slice(Te))},"less"),pastInput:x(function(){var Te=this.matched.substr(0,this.matched.length-this.match.length);return(Te.length>20?"...":"")+Te.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Te=this.match;return Te.length<20&&(Te+=this._input.substr(0,20-Te.length)),(Te.substr(0,20)+(Te.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Te=this.pastInput(),re=new Array(Te.length+1).join("-");return Te+this.upcomingInput()+` +`+re+"^"},"showPosition"),test_match:x(function(Te,re){var Y,Q,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),Q=Te[0].match(/(?:\r\n?|\n).*/g),Q&&(this.yylineno+=Q.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Q?Q[Q.length-1].length-Q[Q.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Te[0].length},this.yytext+=Te[0],this.match+=Te[0],this.matches=Te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Te[0].length),this.matched+=Te[0],Y=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Y)return Y;if(this._backtrack){for(var X in ue)this[X]=ue[X];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Te,re,Y,Q;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),X=0;Xre[0].length)){if(re=Y,Q=X,this.options.backtrack_lexer){if(Te=this.test_match(Y,ue[X]),Te!==!1)return Te;if(this._backtrack){re=!1;continue}else return!1}else if(!this.options.flex)break}return re?(Te=this.test_match(re,ue[Q]),Te!==!1?Te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var re=this.next();return re||this.lex()},"lex"),begin:x(function(re){this.conditionStack.push(re)},"begin"),popState:x(function(){var re=this.conditionStack.length-1;return re>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(re){return re=this.conditionStack.length-1-Math.abs(re||0),re>=0?this.conditionStack[re]:"INITIAL"},"topState"),pushState:x(function(re){this.begin(re)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(re,Y,Q,ue){switch(Q){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})();Ee.lexer=qe;function le(){this.yy={}}return x(le,"Parser"),le.prototype=Ee,Ee.Parser=le,new le})();EK.parser=EK;var OYe=EK,z2e=["#","+","~","-",""],nv,V2e=(nv=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Dn(e,He());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+jp(this.id);this.memberType==="method"&&(e+=`(${jp(this.parameters.trim())})`,this.returnType&&(e+=" : "+jp(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(z2e.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);z2e.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:""}${jp(this.id)}${this.memberType==="method"?`(${jp(this.parameters)})${this.returnType?" : "+jp(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(nv,"ClassMember"),nv),fA="classId-",H2e=0,gm=x(t=>Ht.sanitizeText(t,He()),"sanitizeText"),Ng,_Ye=(Ng=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=Lre();vt(e).select("svg").selectAll("g").filter(function(){return vt(this).attr("title")!==null}).on("mouseover",a=>{const s=vt(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(M0.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),vt(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=qi,this.getAccTitle=ia,this.setAccDescription=aa,this.getAccDescription=sa,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getConfig=x(()=>He().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=Ht.sanitizeText(e,He());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=gm(a[0]),n=gm(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Ht.sanitizeText(e,He());r&&(r=gm(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=Ht.sanitizeText(e,He()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Ht.sanitizeText(n,He());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:fA+a+"-"+H2e}),H2e++}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=Ht.sanitizeText(e,He());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",Oi()}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){de.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=Ht.sanitizeText(e.relationTitle1.trim(),He()),e.relationTitle2=Ht.sanitizeText(e.relationTitle2.trim(),He()),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(gm(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new V2e(a,"method")):a&&i.members.push(new V2e(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)),gm(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=fA+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=gm(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=He();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=fA+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=Kr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=gm(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=Ht.sanitizeText(e,He());if(He().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",()=>{Kr.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=He(),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:d6(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(Ng,"ClassDB"),Ng),C2r=x(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -4737,13 +4870,13 @@ g.classGroup line { } text-align: center; } - ${M7()} -`,"getStyles"),kYe=t2r,r2r=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"),n2r=w(function(t,e){return e.db.getClasses()},"getClasses"),i2r=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:s,layout:a}=He();n.db.setDiagramId(e);const o=n.db.getData(),l=pC(e,i);o.type=n.type,o.layoutAlgorithm=a7(a),o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await Y3(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),Ov(l,u,"classDiagram",(s==null?void 0:s.useMaxWidth)??!0)},"draw"),SYe={getClasses:n2r,draw:i2r,getDir:r2r},s2r={parser:TYe,get db(){return new CYe},renderer:SYe,styles:kYe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const a2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:s2r},Symbol.toStringTag,{value:"Module"}));var o2r={parser:TYe,get db(){return new CYe},renderer:SYe,styles:kYe,init:w(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const l2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:o2r},Symbol.toStringTag,{value:"Module"}));var wK=(function(){var t=w(function(B,z,V,F){for(V=V||{},F=B.length;F--;V[B[F]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],s=[1,9],a=[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],b=[1,27],x=[1,28],T=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],A=[1,36],M=[1,37],R=[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],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace: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,V,F,H,G,W,K){var q=W.length-1;switch(G){case 3:return H.setRootDoc(W[q]),W[q];case 4:this.$=[];break;case 5:W[q]!="nl"&&(W[q-1].push(W[q]),this.$=W[q-1]);break;case 6:case 7:this.$=W[q];break;case 8:this.$="nl";break;case 12:this.$=W[q];break;case 13:const ne=W[q-1];ne.description=H.trimColon(W[q]),this.$=ne;break;case 14:this.$={stmt:"relation",state1:W[q-2],state2:W[q]};break;case 15:const ie=H.trimColon(W[q]);this.$={stmt:"relation",state1:W[q-3],state2:W[q-1],description:ie};break;case 19:this.$={stmt:"state",id:W[q-3],type:"default",description:"",doc:W[q-1]};break;case 20:var oe=W[q],Z=W[q-2].trim();if(W[q].match(":")){var Q=W[q].split(":");oe=Q[0],Z=[Z,Q[1]]}this.$={stmt:"state",id:oe,type:"default",description:Z};break;case 21:this.$={stmt:"state",id:W[q-3],type:"default",description:W[q-5],doc:W[q-1]};break;case 22:this.$={stmt:"state",id:W[q],type:"fork"};break;case 23:this.$={stmt:"state",id:W[q],type:"join"};break;case 24:this.$={stmt:"state",id:W[q],type:"choice"};break;case 25:this.$={stmt:"state",id:H.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:W[q-1].trim(),note:{position:W[q-2].trim(),text:W[q].trim()}};break;case 29:this.$=W[q].trim(),H.setAccTitle(this.$);break;case 30:case 31:this.$=W[q].trim(),H.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:W[q-3],url:W[q-2],tooltip:W[q-1]};break;case 33:this.$={stmt:"click",id:W[q-3],url:W[q-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:W[q-1].trim(),classes:W[q].trim()};break;case 36:this.$={stmt:"style",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 37:this.$={stmt:"applyClass",id:W[q-1].trim(),styleClass:W[q].trim()};break;case 38:H.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:H.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:H.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:H.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:W[q].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:W[q-2].trim(),classes:[W[q].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:s,5:a,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:b,37:x,38:T,41:C,45:S,48:k,51:E,52:A,53:M,54:R,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:b,37:x,38:T,41:C,45:S,48:k,51:E,52:A,53:M,54:R,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(L,[2,44],{58:[1,56]}),t(L,[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:s,5:a,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:b,37:x,38:T,41:C,45:S,48:k,51:E,52:A,53:M,54:R,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(L,[2,46]),t(L,[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:s,5:a,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:b,37:x,38:T,41:C,45:S,48:k,51:E,52:A,53:M,54:R,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,V){if(V.recoverable)this.trace(z);else{var F=new Error(z);throw F.hash=V,F}},"parseError"),parse:w(function(z){var V=this,F=[0],H=[],G=[null],W=[],K=this.table,q="",oe=0,Z=0,Q=2,ne=1,ie=W.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 $e=me.yylloc;W.push($e);var Ve=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(Y){F.length=F.length-2*Y,G.length=G.length-Y,W.length=W.length-Y}w(ce,"popStack");function he(){var Y;return Y=H.pop()||me.lex()||ne,typeof Y!="number"&&(Y instanceof Array&&(H=Y,Y=H.pop()),Y=V.symbols_[Y]||Y),Y}w(he,"lex");for(var Te,ge,ze,we,Ae={},qe,le,pe,Ce;;){if(ge=F[F.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((Te===null||typeof Te>"u")&&(Te=he()),ze=K[ge]&&K[ge][Te]),typeof ze>"u"||!ze.length||!ze[0]){var re="";Ce=[];for(qe in K[ge])this.terminals_[qe]&&qe>Q&&Ce.push("'"+this.terminals_[qe]+"'");me.showPosition?re="Parse error on line "+(oe+1)+`: + ${Lk()} +`,"getStyles"),PYe=C2r,k2r=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),S2r=x(function(t,e){return e.db.getClasses()},"getClasses"),E2r=x(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.setDiagramId(e);const o=n.db.getData(),l=U9(e,i);o.type=n.type,o.layoutAlgorithm=uk(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 Z4(o,l);const u=8;Kr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),P5(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),BYe={getClasses:S2r,draw:E2r,getDir:k2r},A2r={parser:OYe,get db(){return new _Ye},renderer:BYe,styles:PYe,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const M2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:A2r},Symbol.toStringTag,{value:"Module"}));var R2r={parser:OYe,get db(){return new _Ye},renderer:BYe,styles:PYe,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const L2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:R2r},Symbol.toStringTag,{value:"Module"}));var AK=(function(){var t=x(function(B,F,z,$){for(z=z||{},$=B.length;$--;z[B[$]]=F);return z},"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],U=[1,24],y=[1,26],b=[1,27],v=[1,28],w=[1,29],T=[1,30],k=[1,31],C=[1,32],S=[1,35],E=[1,36],A=[1,37],R=[1,38],_=[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],L=[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],P={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(F,z,$,V,H,G,K){var W=G.length-1;switch(H){case 3:return V.setRootDoc(G[W]),G[W];case 4:this.$=[];break;case 5:G[W]!="nl"&&(G[W-1].push(G[W]),this.$=G[W-1]);break;case 6:case 7:this.$=G[W];break;case 8:this.$="nl";break;case 12:this.$=G[W];break;case 13:const ne=G[W-1];ne.description=V.trimColon(G[W]),this.$=ne;break;case 14:this.$={stmt:"relation",state1:G[W-2],state2:G[W]};break;case 15:const ie=V.trimColon(G[W]);this.$={stmt:"relation",state1:G[W-3],state2:G[W-1],description:ie};break;case 19:this.$={stmt:"state",id:G[W-3],type:"default",description:"",doc:G[W-1]};break;case 20:var oe=G[W],Z=G[W-2].trim();if(G[W].match(":")){var J=G[W].split(":");oe=J[0],Z=[Z,J[1]]}this.$={stmt:"state",id:oe,type:"default",description:Z};break;case 21:this.$={stmt:"state",id:G[W-3],type:"default",description:G[W-5],doc:G[W-1]};break;case 22:this.$={stmt:"state",id:G[W],type:"fork"};break;case 23:this.$={stmt:"state",id:G[W],type:"join"};break;case 24:this.$={stmt:"state",id:G[W],type:"choice"};break;case 25:this.$={stmt:"state",id:V.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:G[W-1].trim(),note:{position:G[W-2].trim(),text:G[W].trim()}};break;case 29:this.$=G[W].trim(),V.setAccTitle(this.$);break;case 30:case 31:this.$=G[W].trim(),V.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:G[W-3],url:G[W-2],tooltip:G[W-1]};break;case 33:this.$={stmt:"click",id:G[W-3],url:G[W-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:G[W-1].trim(),classes:G[W].trim()};break;case 36:this.$={stmt:"style",id:G[W-1].trim(),styleClass:G[W].trim()};break;case 37:this.$={stmt:"applyClass",id:G[W-1].trim(),styleClass:G[W].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[W].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:G[W-2].trim(),classes:[G[W].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:G[W-2].trim(),classes:[G[W].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:U,32:25,33:y,35:b,37:v,38:w,41:T,45:k,48:C,51:S,52:E,53:A,54:R,57:_},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:U,32:25,33:y,35:b,37:v,38:w,41:T,45:k,48:C,51:S,52:E,53:A,54:R,57:_},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:_},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[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:_},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:U,32:25,33:y,35:b,37:v,38:w,41:T,45:k,48:C,51:S,52:E,53:A,54:R,57:_},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(L,[2,46]),t(L,[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:U,32:25,33:y,35:b,37:v,38:w,41:T,45:k,48:C,51:S,52:E,53:A,54:R,57:_},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:x(function(F,z){if(z.recoverable)this.trace(F);else{var $=new Error(F);throw $.hash=z,$}},"parseError"),parse:x(function(F){var z=this,$=[0],V=[],H=[null],G=[],K=this.table,W="",oe=0,Z=0,J=2,ne=1,ie=G.slice.call(arguments,1),me=Object.create(this.lexer),te={yy:{}};for(var Re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Re)&&(te.yy[Re]=this.yy[Re]);me.setInput(F,te.yy),te.yy.lexer=me,te.yy.parser=this,typeof me.yylloc>"u"&&(me.yylloc={});var Pe=me.yylloc;G.push(Pe);var Ve=me.options&&me.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(Y){$.length=$.length-2*Y,H.length=H.length-Y,G.length=G.length-Y}x(ce,"popStack");function he(){var Y;return Y=V.pop()||me.lex()||ne,typeof Y!="number"&&(Y instanceof Array&&(V=Y,Y=V.pop()),Y=z.symbols_[Y]||Y),Y}x(he,"lex");for(var we,ge,ze,xe,Ee={},qe,le,pe,Te;;){if(ge=$[$.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((we===null||typeof we>"u")&&(we=he()),ze=K[ge]&&K[ge][we]),typeof ze>"u"||!ze.length||!ze[0]){var re="";Te=[];for(qe in K[ge])this.terminals_[qe]&&qe>J&&Te.push("'"+this.terminals_[qe]+"'");me.showPosition?re="Parse error on line "+(oe+1)+`: `+me.showPosition()+` -Expecting `+Ce.join(", ")+", got '"+(this.terminals_[Te]||Te)+"'":re="Parse error on line "+(oe+1)+": Unexpected "+(Te==ne?"end of input":"'"+(this.terminals_[Te]||Te)+"'"),this.parseError(re,{text:me.match,token:this.terminals_[Te]||Te,line:me.yylineno,loc:$e,expected:Ce})}if(ze[0]instanceof Array&&ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+Te);switch(ze[0]){case 1:F.push(Te),G.push(me.yytext),W.push(me.yylloc),F.push(ze[1]),Te=null,Z=me.yyleng,q=me.yytext,oe=me.yylineno,$e=me.yylloc;break;case 2:if(le=this.productions_[ze[1]][1],Ae.$=G[G.length-le],Ae._$={first_line:W[W.length-(le||1)].first_line,last_line:W[W.length-1].last_line,first_column:W[W.length-(le||1)].first_column,last_column:W[W.length-1].last_column},Ve&&(Ae._$.range=[W[W.length-(le||1)].range[0],W[W.length-1].range[1]]),we=this.performAction.apply(Ae,[q,Z,oe,te.yy,ze[1],G,W].concat(ie)),typeof we<"u")return we;le&&(F=F.slice(0,-1*le*2),G=G.slice(0,-1*le),W=W.slice(0,-1*le)),F.push(this.productions_[ze[1]][0]),G.push(Ae.$),W.push(Ae._$),pe=K[F[F.length-2]][F[F.length-1]],F.push(pe);break;case 3:return!0}}return!0},"parse")},O=(function(){var B={EOF:1,parseError:w(function(V,F){if(this.yy.parser)this.yy.parser.parseError(V,F);else throw new Error(V)},"parseError"),setInput:w(function(z,V){return this.yy=V||this.yy||{},this._input=z,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var V=z.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),z},"input"),unput:w(function(z){var V=z.length,F=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var H=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 G=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===H.length?this.yylloc.first_column:0)+H[H.length-F.length].length-F[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[G[0],G[0]+this.yyleng-V]),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(),V=new Array(z.length+1).join("-");return z+this.upcomingInput()+` -`+V+"^"},"showPosition"),test_match:w(function(z,V){var F,H,G;if(this.options.backtrack_lexer&&(G={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&&(G.yylloc.range=this.yylloc.range.slice(0))),H=z[0].match(/(?:\r\n?|\n).*/g),H&&(this.yylineno+=H.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:H?H[H.length-1].length-H[H.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],F=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var W in G)this[W]=G[W];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,V,F,H;this._more||(this.yytext="",this.match="");for(var G=this._currentRules(),W=0;WV[0].length)){if(V=F,H=W,this.options.backtrack_lexer){if(z=this.test_match(F,G[W]),z!==!1)return z;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(z=this.test_match(V,G[H]),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 V=this.next();return V||this.lex()},"lex"),begin:w(function(V){this.conditionStack.push(V)},"begin"),popState:w(function(){var V=this.conditionStack.length-1;return V>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(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:w(function(V){this.begin(V)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(V,F,H,G){function W(){const K=F.yytext.indexOf("%%");if(K===0)return!1;if(K>0){const q=F.yytext.slice(0,K),oe=F.yytext.slice(K);oe&&V.lexer.unput(oe),F.yytext=q}return!0}switch(w(W,"processId"),H){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(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),F.yytext=F.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),F.yytext=F.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 W()?(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: "'+F.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 W()?(this.popState(),"ID"):void 0;case 66:return W()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),F.yytext=F.yytext.substr(2).trim(),31;case 68:return this.popState(),F.yytext=F.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 W()?24:void 0;case 74:return F.yytext=F.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 B})();$.lexer=O;function D(){this.yy={}}return w(D,"Parser"),D.prototype=$,$.Parser=D,new D})();wK.parser=wK;var EYe=wK,c2r="TB",AYe="TB",O2e="dir",xb="state",B2="root",TK="relation",u2r="classDef",h2r="style",d2r="applyClass",bE="default",MYe="divider",RYe="fill:none",_Ye="fill: #333",LYe="c",IYe="markdown",NYe="normal",nG="rect",iG="rectWithTitle",f2r="stateStart",p2r="stateEnd",D2e="divider",P2e="roundedWithTitle",g2r="note",m2r="noteGroup",e8="statediagram",y2r="state",v2r=`${e8}-${y2r}`,OYe="transition",b2r="note",x2r="note-edge",w2r=`${OYe} ${x2r}`,T2r=`${e8}-${b2r}`,C2r="cluster",k2r=`${e8}-${C2r}`,S2r="cluster-alt",E2r=`${e8}-${S2r}`,DYe="parent",PYe="note",A2r="state",Hse="----",M2r=`${Hse}${PYe}`,$2e=`${Hse}${DYe}`,$Ye=w((t,e=AYe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),R2r=w(function(t,e){return e.db.getClasses()},"getClasses"),_2r=w(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:s,layout:a}=He();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=pC(e,i);o.type=n.type,o.layoutAlgorithm=a,o.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,o.rankSpacing=(s==null?void 0:s.rankSpacing)||50,He().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Y3(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){de.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){de.warn("⚠️ Could not find node matching text:",g);return}const b=v.parentNode;if(!b){de.warn("⚠️ Node has no parent, cannot wrap:",g);return}const x=document.createElementNS("http://www.w3.org/2000/svg","a"),T=f.url.replace(/^"+|"+$/g,"");if(x.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",T),x.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");x.setAttribute("title",S),v.setAttribute("title",S)}b.replaceChild(x,v),x.appendChild(v),de.info("🔗 Wrapped node in
    tag for:",g,f.url)})}catch(d){de.error("❌ Error injecting clickable links:",d)}Kr.insertTitle(l,"statediagramTitleText",(s==null?void 0:s.titleTopMargin)??25,n.db.getDiagramTitle()),Ov(l,h,e8,(s==null?void 0:s.useMaxWidth)??!0)},"draw"),L2r={getClasses:R2r,draw:_2r,getDir:$Ye},Q9=new Map,sg=0;function J9(t="",e=0,r="",n=Hse){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${A2r}-${t}${i}-${e}`}w(J9,"stateDomId");var I2r=w((t,e,r,n,i,s,a,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case xb:vS(t,l,r,n,i,s,a,o);break;case bE:vS(t,l,r,n,i,s,a,o);break;case TK:{vS(t,l.state1,r,n,i,s,a,o),vS(t,l.state2,r,n,i,s,a,o);const u=a==="neo",h={id:"edge"+sg,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:RYe,labelStyle:"",label:Gt.sanitizeText(l.description??"",He()),arrowheadStyle:_Ye,labelpos:LYe,labelType:IYe,thickness:NYe,classes:OYe,look:a};i.push(h),sg++}break}})},"setupDoc"),B2e=w((t,e=AYe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function yS(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 s=r.get(i);s&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...s.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}w(yS,"insertOrUpdateNode");function BYe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}w(BYe,"getClassesFromDbInfo");function FYe(t){return(t==null?void 0:t.styles)??[]}w(FYe,"getStylesFromDbInfo");var vS=w((t,e,r,n,i,s,a,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=BYe(u),d=FYe(u),f=He();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=nG;e.start===!0?y=f2r:e.start===!1&&(y=p2r),e.type!==bE&&(y=e.type),Q9.get(l)||Q9.set(l,{id:l,shape:y,description:Gt.sanitizeText(l,f),cssClasses:`${h} ${v2r}`,cssStyles:d});const v=Q9.get(l);e.description&&(Array.isArray(v.description)?(v.shape=iG,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=iG,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=nG,v.description=e.description),v.description=Gt.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===iG&&(v.type==="group"?v.shape=P2e:v.shape=nG),!v.type&&e.doc&&(de.info("Setting cluster for XCX",l,B2e(e)),v.type="group",v.isGroup=!0,v.dir=B2e(e),v.explicitDir=e.doc.some(x=>x.stmt==="dir"),v.shape=e.type===MYe?D2e:P2e,v.cssClasses=`${v.cssClasses} ${k2r} ${s?E2r:""}`);const b={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:J9(l,sg),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(b.shape===D2e&&(b.label=""),t&&t.id!=="root"&&(de.trace("Setting node ",l," to be child of its parent ",t.id),b.parentId=t.id),b.centerLabel=!0,e.note){const x={labelStyle:"",shape:g2r,label:e.note.text,labelType:"markdown",cssClasses:T2r,cssStyles:[],cssCompiledStyles:[],id:l+M2r+"-"+sg,domId:J9(l,sg,PYe),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:a,position:e.note.position},T=l+$2e,C={labelStyle:"",shape:m2r,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+$2e,domId:J9(l,sg,DYe),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position};sg++,C.id=T,x.parentId=T,yS(n,C,o),yS(n,x,o),yS(n,b,o);let S=l,k=x.id;e.note.position==="left of"&&(S=x.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:RYe,labelStyle:"",classes:w2r,arrowheadStyle:_Ye,labelpos:LYe,labelType:IYe,thickness:NYe,look:a})}else yS(n,b,o)}e.doc&&(de.trace("Adding nodes children "),I2r(e,e.doc,r,n,i,!s,a,o))},"dataFetcher"),N2r=w(()=>{Q9.clear(),sg=0},"reset"),gl={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},F2e=w(()=>new Map,"newClassesList"),z2e=w(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),hR=w(t=>JSON.parse(JSON.stringify(t)),"clone"),Dy,ey=(Dy=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=F2e(),this.documents={root:z2e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ns,this.setAccTitle=qi,this.getAccDescription=ss,this.setAccDescription=is,this.setDiagramTitle=ts,this.getDiagramTitle=ji,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 xb:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case TK:this.addRelation(i.state1,i.state2,i.description);break;case u2r:this.addStyleClass(i.id.trim(),i.classes);break;case h2r:this.handleStyleDef(i);break;case d2r:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=He();N2r(),vS(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 s=this.getState(i);if(!s){const a=i.trim();this.addState(a),s=this.getState(a)}s&&(s.styles=n.map(a=>{var o;return(o=a.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){de.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===TK){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===xb&&(r.id===gl.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==B2&&r.stmt!==xb||!r.doc)return;const i=[];let s=[];for(const a of r.doc)if(a.type===MYe){const o=hR(a);o.doc=hR(s),i.push(o),s=[]}else s.push(a);if(i.length>0&&s.length>0){const a={stmt:xb,id:MEe(),type:"divider",doc:hR(s)};i.push(hR(a)),r.doc=i}r.doc.forEach(a=>this.docTranslator(r,a,!0))}getRootDocV2(){return this.docTranslator({id:B2,stmt:B2},{id:B2,stmt:B2,doc:this.rootDoc},!0),{id:B2,doc:this.rootDoc}}addState(e,r=bE,n=void 0,i=void 0,s=void 0,a=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))de.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:xb,id:u,descriptions:[],type:r,doc:n,note:s,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&&(de.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),s){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=s,h.note.text=Gt.sanitizeText(h.note.text,He())}a&&(de.info("Setting state classes",u,a),(Array.isArray(a)?a:[a]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(de.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(de.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:z2e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=F2e(),e||(this.links=new Map,Oi())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){de.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),de.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===gl.START_NODE?(this.startEndCount++,`${gl.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=bE){return e===gl.START_NODE?gl.START_TYPE:r}endIdIfNeeded(e=""){return e===gl.END_NODE?(this.startEndCount++,`${gl.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=bE){return e===gl.END_NODE?gl.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:Gt.sanitizeText(n,He())})}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()),s=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,s),this.addState(a,o),this.currentDocument.relations.push({id1:i,id2:a,relationTitle:n?Gt.sanitizeText(n,He()):void 0})}}addDescription(e,r){var s;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(s=n==null?void 0:n.descriptions)==null||s.push(Gt.sanitizeText(i,He()))}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(gl.STYLECLASS_SEP).forEach(i=>{const s=i.replace(/([^;]*);/,"$1").trim();if(RegExp(gl.COLOR_KEYWORD).exec(i)){const o=s.replace(gl.FILL_KEYWORD,gl.BG_FILL).replace(gl.COLOR_KEYWORD,gl.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(s)})}getClasses(){return this.classes}setupToolTips(e){const r=Cre();xt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",s=>{var u;const a=xt(s.currentTarget),o=a.attr("title");if(o===null)return;const l=(u=s.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(M0.sanitize(o)),a.classed("hover",!0)}).on("mouseout",s=>{r.transition().duration(500).style("opacity",0),xt(s.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var s;let i=this.getState(n);if(!i){const a=n.trim();this.addState(a),i=this.getState(a)}(s=i==null?void 0:i.classes)==null||s.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===O2e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??c2r}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:O2e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=He();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:$Ye(this.getRootDocV2())}}getConfig(){return He().state}},w(Dy,"StateDB"),Dy.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Dy),O2r=w(t=>` +Expecting `+Te.join(", ")+", got '"+(this.terminals_[we]||we)+"'":re="Parse error on line "+(oe+1)+": Unexpected "+(we==ne?"end of input":"'"+(this.terminals_[we]||we)+"'"),this.parseError(re,{text:me.match,token:this.terminals_[we]||we,line:me.yylineno,loc:Pe,expected:Te})}if(ze[0]instanceof Array&&ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+we);switch(ze[0]){case 1:$.push(we),H.push(me.yytext),G.push(me.yylloc),$.push(ze[1]),we=null,Z=me.yyleng,W=me.yytext,oe=me.yylineno,Pe=me.yylloc;break;case 2:if(le=this.productions_[ze[1]][1],Ee.$=H[H.length-le],Ee._$={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},Ve&&(Ee._$.range=[G[G.length-(le||1)].range[0],G[G.length-1].range[1]]),xe=this.performAction.apply(Ee,[W,Z,oe,te.yy,ze[1],H,G].concat(ie)),typeof xe<"u")return xe;le&&($=$.slice(0,-1*le*2),H=H.slice(0,-1*le),G=G.slice(0,-1*le)),$.push(this.productions_[ze[1]][0]),H.push(Ee.$),G.push(Ee._$),pe=K[$[$.length-2]][$[$.length-1]],$.push(pe);break;case 3:return!0}}return!0},"parse")},O=(function(){var B={EOF:1,parseError:x(function(z,$){if(this.yy.parser)this.yy.parser.parseError(z,$);else throw new Error(z)},"parseError"),setInput:x(function(F,z){return this.yy=z||this.yy||{},this._input=F,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var F=this._input[0];this.yytext+=F,this.yyleng++,this.offset++,this.match+=F,this.matched+=F;var z=F.match(/(?:\r\n?|\n).*/g);return z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),F},"input"),unput:x(function(F){var z=F.length,$=F.split(/(?:\r\n?|\n)/g);this._input=F+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-z),this.offset-=z;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),$.length-1&&(this.yylineno-=$.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:$?($.length===V.length?this.yylloc.first_column:0)+V[V.length-$.length].length-$[0].length:this.yylloc.first_column-z},this.options.ranges&&(this.yylloc.range=[H[0],H[0]+this.yyleng-z]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(F){this.unput(this.match.slice(F))},"less"),pastInput:x(function(){var F=this.matched.substr(0,this.matched.length-this.match.length);return(F.length>20?"...":"")+F.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var F=this.match;return F.length<20&&(F+=this._input.substr(0,20-F.length)),(F.substr(0,20)+(F.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var F=this.pastInput(),z=new Array(F.length+1).join("-");return F+this.upcomingInput()+` +`+z+"^"},"showPosition"),test_match:x(function(F,z){var $,V,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))),V=F[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+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],$=this.performAction.call(this,this.yy,this,z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var G in H)this[G]=H[G];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var F,z,$,V;this._more||(this.yytext="",this.match="");for(var H=this._currentRules(),G=0;Gz[0].length)){if(z=$,V=G,this.options.backtrack_lexer){if(F=this.test_match($,H[G]),F!==!1)return F;if(this._backtrack){z=!1;continue}else return!1}else if(!this.options.flex)break}return z?(F=this.test_match(z,H[V]),F!==!1?F:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var z=this.next();return z||this.lex()},"lex"),begin:x(function(z){this.conditionStack.push(z)},"begin"),popState:x(function(){var z=this.conditionStack.length-1;return z>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(z){return z=this.conditionStack.length-1-Math.abs(z||0),z>=0?this.conditionStack[z]:"INITIAL"},"topState"),pushState:x(function(z){this.begin(z)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(z,$,V,H){function G(){const K=$.yytext.indexOf("%%");if(K===0)return!1;if(K>0){const W=$.yytext.slice(0,K),oe=$.yytext.slice(K);oe&&z.lexer.unput(oe),$.yytext=W}return!0}switch(x(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(),$.yytext=$.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),$.yytext=$.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),$.yytext=$.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),$.yytext=$.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),$.yytext=$.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),$.yytext=$.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: "'+$.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(),$.yytext=$.yytext.substr(2).trim(),31;case 68:return this.popState(),$.yytext=$.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 $.yytext=$.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 B})();P.lexer=O;function D(){this.yy={}}return x(D,"Parser"),D.prototype=P,P.Parser=D,new D})();AK.parser=AK;var $Ye=AK,I2r="TB",FYe="TB",G2e="dir",Ty="state",z2="root",MK="relation",N2r="classDef",D2r="style",O2r="applyClass",Tw="default",zYe="divider",VYe="fill:none",HYe="fill: #333",GYe="c",WYe="markdown",qYe="normal",lH="rect",cH="rectWithTitle",_2r="stateStart",P2r="stateEnd",W2e="divider",q2e="roundedWithTitle",B2r="note",$2r="noteGroup",nS="statediagram",F2r="state",z2r=`${nS}-${F2r}`,jYe="transition",V2r="note",H2r="note-edge",G2r=`${jYe} ${H2r}`,W2r=`${nS}-${V2r}`,q2r="cluster",j2r=`${nS}-${q2r}`,Y2r="cluster-alt",X2r=`${nS}-${Y2r}`,YYe="parent",XYe="note",K2r="state",Kae="----",Z2r=`${Kae}${XYe}`,j2e=`${Kae}${YYe}`,KYe=x((t,e=FYe)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),J2r=x(function(t,e){return e.db.getClasses()},"getClasses"),Q2r=x(async function(t,e,r,n){de.info("REF0:"),de.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=He();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=U9(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,He().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await Z4(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var T;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(k=>k.id===g);if(!g){de.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const U=(T=l.node())==null?void 0:T.querySelectorAll("g.node, g.rough-node");let y;if(U==null||U.forEach(k=>{var S;const C=(S=k.textContent)==null?void 0:S.trim();(k.id===(m==null?void 0:m.domId)||C===g)&&(y=k)}),!y){de.warn("⚠️ Could not find node matching text:",g);return}const b=y.parentNode;if(!b){de.warn("⚠️ Node has no parent, cannot wrap:",g);return}const v=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(v.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),v.setAttribute("target","_blank"),f.tooltip){const k=f.tooltip.replace(/^"+|"+$/g,"");v.setAttribute("title",k),y.setAttribute("title",k)}b.replaceChild(v,y),v.appendChild(y),de.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){de.error("❌ Error injecting clickable links:",d)}Kr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),P5(l,h,nS,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),eyr={getClasses:J2r,draw:Q2r,getDir:KYe},tR=new Map,sg=0;function rR(t="",e=0,r="",n=Kae){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${K2r}-${t}${i}-${e}`}x(rR,"stateDomId");var tyr=x((t,e,r,n,i,a,s,o)=>{de.trace("items",e),e.forEach(l=>{switch(l.stmt){case Ty:wx(t,l,r,n,i,a,s,o);break;case Tw:wx(t,l,r,n,i,a,s,o);break;case MK:{wx(t,l.state1,r,n,i,a,s,o),wx(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+sg,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:VYe,labelStyle:"",label:Ht.sanitizeText(l.description??"",He()),arrowheadStyle:HYe,labelpos:GYe,labelType:WYe,thickness:qYe,classes:jYe,look:s};i.push(h),sg++}break}})},"setupDoc"),Y2e=x((t,e=FYe)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function xx(t,e,r){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(xx,"insertOrUpdateNode");function ZYe(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(ZYe,"getClassesFromDbInfo");function JYe(t){return(t==null?void 0:t.styles)??[]}x(JYe,"getStylesFromDbInfo");var wx=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=ZYe(u),d=JYe(u),f=He();if(de.info("dataFetcher parsedItem",e,u,d),l!=="root"){let U=lH;e.start===!0?U=_2r:e.start===!1&&(U=P2r),e.type!==Tw&&(U=e.type),tR.get(l)||tR.set(l,{id:l,shape:U,description:Ht.sanitizeText(l,f),cssClasses:`${h} ${z2r}`,cssStyles:d});const y=tR.get(l);e.description&&(Array.isArray(y.description)?(y.shape=cH,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=cH,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=lH,y.description=e.description),y.description=Ht.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===cH&&(y.type==="group"?y.shape=q2e:y.shape=lH),!y.type&&e.doc&&(de.info("Setting cluster for XCX",l,Y2e(e)),y.type="group",y.isGroup=!0,y.dir=Y2e(e),y.explicitDir=e.doc.some(v=>v.stmt==="dir"),y.shape=e.type===zYe?W2e:q2e,y.cssClasses=`${y.cssClasses} ${j2r} ${a?X2r:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:rR(l,sg),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(b.shape===W2e&&(b.label=""),t&&t.id!=="root"&&(de.trace("Setting node ",l," to be child of its parent ",t.id),b.parentId=t.id),b.centerLabel=!0,e.note){const v={labelStyle:"",shape:B2r,label:e.note.text,labelType:"markdown",cssClasses:W2r,cssStyles:[],cssCompiledStyles:[],id:l+Z2r+"-"+sg,domId:rR(l,sg,XYe),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+j2e,T={labelStyle:"",shape:$2r,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+j2e,domId:rR(l,sg,YYe),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};sg++,T.id=w,v.parentId=w,xx(n,T,o),xx(n,v,o),xx(n,b,o);let k=l,C=v.id;e.note.position==="left of"&&(k=v.id,C=l),i.push({id:k+"-"+C,start:k,end:C,arrowhead:"none",arrowTypeEnd:"",style:VYe,labelStyle:"",classes:G2r,arrowheadStyle:HYe,labelpos:GYe,labelType:WYe,thickness:qYe,look:s})}else xx(n,b,o)}e.doc&&(de.trace("Adding nodes children "),tyr(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),ryr=x(()=>{tR.clear(),sg=0},"reset"),gl={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},X2e=x(()=>new Map,"newClassesList"),K2e=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pA=x(t=>JSON.parse(JSON.stringify(t)),"clone"),BU,nU=(BU=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=X2e(),this.documents={root:K2e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ia,this.setAccTitle=qi,this.getAccDescription=sa,this.setAccDescription=aa,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,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 Ty:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case MK:this.addRelation(i.state1,i.state2,i.description);break;case N2r:this.addStyleClass(i.id.trim(),i.classes);break;case D2r:this.handleStyleDef(i);break;case O2r:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=He();ryr(),wx(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){de.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===MK){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===Ty&&(r.id===gl.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==z2&&r.stmt!==Ty||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===zYe){const o=pA(s);o.doc=pA(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:Ty,id:Bwe(),type:"divider",doc:pA(a)};i.push(pA(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:z2,stmt:z2},{id:z2,stmt:z2,doc:this.rootDoc},!0),{id:z2,doc:this.rootDoc}}addState(e,r=Tw,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))de.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:Ty,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&&(de.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=Ht.sanitizeText(h.note.text,He())}s&&(de.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(de.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(de.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:K2e()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=X2e(),e||(this.links=new Map,Oi())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){de.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),de.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===gl.START_NODE?(this.startEndCount++,`${gl.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=Tw){return e===gl.START_NODE?gl.START_TYPE:r}endIdIfNeeded(e=""){return e===gl.END_NODE?(this.startEndCount++,`${gl.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=Tw){return e===gl.END_NODE?gl.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:Ht.sanitizeText(n,He())})}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?Ht.sanitizeText(n,He()):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(Ht.sanitizeText(i,He()))}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(gl.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(gl.COLOR_KEYWORD).exec(i)){const o=a.replace(gl.FILL_KEYWORD,gl.BG_FILL).replace(gl.COLOR_KEYWORD,gl.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=Lre();vt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=vt(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(M0.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),vt(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===G2e)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??I2r}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:G2e,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=He();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:KYe(this.getRootDocV2())}}getConfig(){return He().state}},x(BU,"StateDB"),BU.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},BU),nyr=x(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -4968,12 +5101,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),zYe=O2r,D2r=w(t=>t.append("circle").attr("class","start-state").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit).attr("cy",He().state.padding+He().state.sizeUnit),"drawStartState"),P2r=w(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",He().state.textHeight).attr("class","divider").attr("x2",He().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),$2r=w((t,e)=>{const r=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+2*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",n.width+2*He().state.padding).attr("height",n.height+2*He().state.padding).attr("rx",He().state.radius),r},"drawSimpleState"),B2r=w((t,e)=>{const r=w(function(f,p,g){const m=f.append("tspan").attr("x",2*He().state.padding).text(p);g||m.attr("dy",He().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+1.3*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=i.height,a=t.append("text").attr("x",He().state.padding).attr("y",s+He().state.padding*.4+He().state.dividerMargin+He().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(a,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",He().state.padding).attr("y1",He().state.padding+s+He().state.dividerMargin/2).attr("y2",He().state.padding+s+He().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*He().state.padding),t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",d+2*He().state.padding).attr("height",h.height+s+2*He().state.padding).attr("rx",He().state.radius),t},"drawDescrState"),F2r=w((t,e,r)=>{const n=He().state.padding,i=2*He().state.padding,s=t.node().getBBox(),a=s.width,o=s.x,l=t.append("text").attr("x",0).attr("y",He().state.titleShift).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,a);d===a&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>a&&(f=(a-d)/2+n),Math.abs(o-p.x)a&&(f=o-(h-a)/2);const g=1-He().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+He().state.textHeight+He().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=a&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",He().state.textHeight*3).attr("rx",He().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",p.height+3+2*He().state.textHeight).attr("rx",He().state.radius),t},"addTitleAndBox"),z2r=w(t=>(t.append("circle").attr("class","end-state-outer").attr("r",He().state.sizeUnit+He().state.miniPadding).attr("cx",He().state.padding+He().state.sizeUnit+He().state.miniPadding).attr("cy",He().state.padding+He().state.sizeUnit+He().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit+2).attr("cy",He().state.padding+He().state.sizeUnit+2)),"drawEndState"),V2r=w((t,e)=>{let r=He().state.forkWidth,n=He().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",He().state.padding).attr("y",He().state.padding)},"drawForkJoinState"),H2r=w((t,e,r,n)=>{let i=0;const s=n.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let a=t.replace(/\r\n/g,"
    ");a=a.replace(/\n/g,"
    ");const o=a.split(Gt.lineBreakRegex);let l=1.25*He().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=s.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+He().state.noteMargin),d.attr("y",r+i+1.25*He().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},"_drawLongText"),G2r=w((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",He().state.padding),n=e.append("g"),{textWidth:i,textHeight:s}=H2r(t,0,0,n);return r.attr("height",s+2*He().state.noteMargin),r.attr("width",i+He().state.noteMargin*2),r},"drawNote"),V2e=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"&&D2r(i),e.type==="end"&&z2r(i),(e.type==="fork"||e.type==="join")&&V2r(i,e),e.type==="note"&&G2r(e.note.text,i),e.type==="divider"&&P2r(i),e.type==="default"&&e.descriptions.length===0&&$2r(i,e),e.type==="default"&&e.descriptions.length>0&&B2r(i,e);const s=i.node().getBBox();return n.width=s.width+2*He().state.padding,n.height=s.height+2*He().state.padding,n},"drawState"),H2e=0,W2r=w(function(t,e,r){const n=w(function(l){switch(l){case ey.relationType.AGGREGATION:return"aggregation";case ey.relationType.EXTENSION:return"extension";case ey.relationType.COMPOSITION:return"composition";case ey.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,s=u6().x(function(l){return l.x}).y(function(l){return l.y}).curve(h6),a=t.append("path").attr("d",s(i)).attr("id","edge"+H2e).attr("class","transition");let o="";if(He().state.arrowMarkerAbsolute&&(o=tD(!0)),a.attr("marker-end","url("+o+"#"+n(ey.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Kr.calcLabelPosition(e.points),d=Gt.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let b=0;b<=d.length;b++){const x=l.append("text").attr("text-anchor","middle").text(d[b]).attr("x",u).attr("y",h+f),T=x.node().getBBox();g=Math.max(g,T.width),m=Math.min(m,T.x),de.info(T.x,u,h+f),f===0&&(f=x.node().getBBox().height,de.info("Title height",f,h)),p.push(x)}let y=f*d.length;if(d.length>1){const b=(d.length-1)*f*.5;p.forEach((x,T)=>x.attr("y",h+T*f-b)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-He().state.padding/2).attr("y",h-y/2-He().state.padding/2-3.5).attr("width",g+He().state.padding).attr("height",y+He().state.padding),de.info(v)}H2e++},"drawEdge"),Fc,sG={},q2r=w(function(){},"setConf"),U2r=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"),j2r=w(function(t,e,r,n){Fc=He().state;const i=He().securityLevel;let s;i==="sandbox"&&(s=xt("#i"+e));const a=xt(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?s.nodes()[0].contentDocument:document;de.debug("Rendering diagram "+t);const l=a.select(`[id='${e}']`);U2r(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");VYe(u,h,void 0,!1,a,o,n);const d=Fc.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;qs(l,g,m,Fc.useMaxWidth),l.attr("viewBox",`${f.x-Fc.padding} ${f.y-Fc.padding} `+p+" "+g)},"draw"),Y2r=w(t=>t?t.length*Fc.fontSizeFactor:1,"getLabelWidth"),VYe=w((t,e,r,n,i,s,a)=>{const o=new rl({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const T=x.parentElement;let C=0,S=0;T&&(T.parentElement&&(C=T.parentElement.getBBox().width),S=parseInt(T.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),x.setAttribute("x1",0-S+8),x.setAttribute("x2",C-S-8)})):de.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&&(de.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),W2r(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*Fc.padding,y.height=m.height+2*Fc.padding,de.debug("Doc rendered",y,o),y},"renderDoc"),X2r={setConf:q2r,draw:j2r},K2r={parser:EYe,get db(){return new ey(1)},renderer:X2r,styles:zYe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Z2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:K2r},Symbol.toStringTag,{value:"Module"}));var Q2r={parser:EYe,get db(){return new ey(2)},renderer:L2r,styles:zYe,init:w(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const J2r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Q2r},Symbol.toStringTag,{value:"Module"}));var CK=(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],s=[1,12],a=[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,b){var x=v.length-1;switch(y){case 1:return v[x-1];case 2:this.$=[];break;case 3:v[x-1].push(v[x]),this.$=v[x-1];break;case 4:case 5:this.$=v[x];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[x].substr(6)),this.$=v[x].substr(6);break;case 9:this.$=v[x].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[x].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[x].substr(8)),this.$=v[x].substr(8);break;case 13:m.addTask(v[x-1],v[x]),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:s,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:s,17:a,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=[],b=this.table,x="",T=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),A=Object.create(this.lexer),M={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(M.yy[R]=this.yy[R]);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 L(K){g.length=g.length-2*K,y.length=y.length-K,v.length=v.length-K}w(L,"popStack");function I(){var K;return K=m.pop()||A.lex()||k,typeof K!="number"&&(K instanceof Array&&(m=K,K=m.pop()),K=p.symbols_[K]||K),K}w(I,"lex");for(var $,O,D,B,z={},V,F,H,G;;){if(O=g[g.length-1],this.defaultActions[O]?D=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),D=b[O]&&b[O][$]),typeof D>"u"||!D.length||!D[0]){var W="";G=[];for(V in b[O])this.terminals_[V]&&V>S&&G.push("'"+this.terminals_[V]+"'");A.showPosition?W="Parse error on line "+(T+1)+`: -`+A.showPosition()+` -Expecting `+G.join(", ")+", got '"+(this.terminals_[$]||$)+"'":W="Parse error on line "+(T+1)+": Unexpected "+($==k?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(W,{text:A.match,token:this.terminals_[$]||$,line:A.yylineno,loc:P,expected:G})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+$);switch(D[0]){case 1:g.push($),y.push(A.yytext),v.push(A.yylloc),g.push(D[1]),$=null,C=A.yyleng,x=A.yytext,T=A.yylineno,P=A.yylloc;break;case 2:if(F=this.productions_[D[1]][1],z.$=y[y.length-F],z._$={first_line:v[v.length-(F||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(F||1)].first_column,last_column:v[v.length-1].last_column},N&&(z._$.range=[v[v.length-(F||1)].range[0],v[v.length-1].range[1]]),B=this.performAction.apply(z,[x,C,T,M.yy,D[1],y,v].concat(E)),typeof B<"u")return B;F&&(g=g.slice(0,-1*F*2),y=y.slice(0,-1*F),v=v.slice(0,-1*F)),g.push(this.productions_[D[1]][0]),y.push(z.$),v.push(z._$),H=b[g[g.length-2]][g[g.length-1]],g.push(H);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})();CK.parser=CK;var ebr=CK,M3="",Gse=[],bA=[],xA=[],tbr=w(function(){Gse.length=0,bA.length=0,M3="",xA.length=0,Oi()},"clear"),rbr=w(function(t){M3=t,Gse.push(t)},"addSection"),nbr=w(function(){return Gse},"getSections"),ibr=w(function(){let t=G2e();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),abr=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 s=i.map(o=>o.trim()),a={section:M3,type:M3,people:s,task:t,score:n};xA.push(a)},"addTask"),obr=w(function(t){const e={section:M3,type:M3,description:t,task:t,classes:[]};bA.push(e)},"addTaskOrg"),G2e=w(function(){const t=w(function(r){return xA[r].processed},"compileTask");let e=!0;for(const[r,n]of xA.entries())t(r),e=e&&n.processed;return e},"compileTasks"),lbr=w(function(){return sbr()},"getActors"),W2e={getConfig:w(()=>He().journey,"getConfig"),clear:tbr,setDiagramTitle:ts,getDiagramTitle:ji,setAccTitle:qi,getAccTitle:ns,setAccDescription:is,getAccDescription:ss,addSection:rbr,getSections:nbr,getTasks:ibr,addTask:abr,addTaskOrg:obr,getActors:lbr},cbr=w(t=>`.label { +`,"getStyles"),QYe=nyr,iyr=x(t=>t.append("circle").attr("class","start-state").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit).attr("cy",He().state.padding+He().state.sizeUnit),"drawStartState"),ayr=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",He().state.textHeight).attr("class","divider").attr("x2",He().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),syr=x((t,e)=>{const r=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+2*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",n.width+2*He().state.padding).attr("height",n.height+2*He().state.padding).attr("rx",He().state.radius),r},"drawSimpleState"),oyr=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*He().state.padding).text(p);g||m.attr("dy",He().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*He().state.padding).attr("y",He().state.textHeight+1.3*He().state.padding).attr("font-size",He().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",He().state.padding).attr("y",a+He().state.padding*.4+He().state.dividerMargin+He().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",He().state.padding).attr("y1",He().state.padding+a+He().state.dividerMargin/2).attr("y2",He().state.padding+a+He().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*He().state.padding),t.insert("rect",":first-child").attr("x",He().state.padding).attr("y",He().state.padding).attr("width",d+2*He().state.padding).attr("height",h.height+a+2*He().state.padding).attr("rx",He().state.radius),t},"drawDescrState"),lyr=x((t,e,r)=>{const n=He().state.padding,i=2*He().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",He().state.titleShift).attr("font-size",He().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-He().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+He().state.textHeight+He().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",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",He().state.textHeight*3).attr("rx",He().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",He().state.titleShift-He().state.textHeight-He().state.padding).attr("width",d).attr("height",p.height+3+2*He().state.textHeight).attr("rx",He().state.radius),t},"addTitleAndBox"),cyr=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",He().state.sizeUnit+He().state.miniPadding).attr("cx",He().state.padding+He().state.sizeUnit+He().state.miniPadding).attr("cy",He().state.padding+He().state.sizeUnit+He().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",He().state.sizeUnit).attr("cx",He().state.padding+He().state.sizeUnit+2).attr("cy",He().state.padding+He().state.sizeUnit+2)),"drawEndState"),uyr=x((t,e)=>{let r=He().state.forkWidth,n=He().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",He().state.padding).attr("y",He().state.padding)},"drawForkJoinState"),hyr=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"
    ");s=s.replace(/\n/g,"
    ");const o=s.split(Ht.lineBreakRegex);let l=1.25*He().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+He().state.noteMargin),d.attr("y",r+i+1.25*He().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),dyr=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",He().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=hyr(t,0,0,n);return r.attr("height",a+2*He().state.noteMargin),r.attr("width",i+He().state.noteMargin*2),r},"drawNote"),Z2e=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&iyr(i),e.type==="end"&&cyr(i),(e.type==="fork"||e.type==="join")&&uyr(i,e),e.type==="note"&&dyr(e.note.text,i),e.type==="divider"&&ayr(i),e.type==="default"&&e.descriptions.length===0&&syr(i,e),e.type==="default"&&e.descriptions.length>0&&oyr(i,e);const a=i.node().getBBox();return n.width=a.width+2*He().state.padding,n.height=a.height+2*He().state.padding,n},"drawState"),J2e=0,fyr=x(function(t,e,r){const n=x(function(l){switch(l){case nU.relationType.AGGREGATION:return"aggregation";case nU.relationType.EXTENSION:return"extension";case nU.relationType.COMPOSITION:return"composition";case nU.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=pT().x(function(l){return l.x}).y(function(l){return l.y}).curve(gT),s=t.append("path").attr("d",a(i)).attr("id","edge"+J2e).attr("class","transition");let o="";if(He().state.arrowMarkerAbsolute&&(o=iO(!0)),s.attr("marker-end","url("+o+"#"+n(nU.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=Kr.calcLabelPosition(e.points),d=Ht.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let b=0;b<=d.length;b++){const v=l.append("text").attr("text-anchor","middle").text(d[b]).attr("x",u).attr("y",h+f),w=v.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),de.info(w.x,u,h+f),f===0&&(f=v.node().getBBox().height,de.info("Title height",f,h)),p.push(v)}let U=f*d.length;if(d.length>1){const b=(d.length-1)*f*.5;p.forEach((v,w)=>v.attr("y",h+w*f-b)),U=f*d.length}const y=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-He().state.padding/2).attr("y",h-U/2-He().state.padding/2-3.5).attr("width",g+He().state.padding).attr("height",U+He().state.padding),de.info(y)}J2e++},"drawEdge"),$c,uH={},pyr=x(function(){},"setConf"),gyr=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),myr=x(function(t,e,r,n){$c=He().state;const i=He().securityLevel;let a;i==="sandbox"&&(a=vt("#i"+e));const s=vt(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;de.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);gyr(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");eXe(u,h,void 0,!1,s,o,n);const d=$c.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Ga(l,g,m,$c.useMaxWidth),l.attr("viewBox",`${f.x-$c.padding} ${f.y-$c.padding} `+p+" "+g)},"draw"),Uyr=x(t=>t?t.length*$c.fontSizeFactor:1,"getLabelWidth"),eXe=x((t,e,r,n,i,a,s)=>{const o=new rl({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l{const w=v.parentElement;let T=0,k=0;w&&(w.parentElement&&(T=w.parentElement.getBBox().width),k=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),v.setAttribute("x1",0-k+8),v.setAttribute("x2",T-k-8)})):de.debug("No Node "+y+": "+JSON.stringify(o.node(y)))});let m=g.getBBox();o.edges().forEach(function(y){y!==void 0&&o.edge(y)!==void 0&&(de.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(o.edge(y))),fyr(e,o.edge(y),o.edge(y).relation))}),m=g.getBBox();const U={id:r||"root",label:r||"root",width:0,height:0};return U.width=m.width+2*$c.padding,U.height=m.height+2*$c.padding,de.debug("Doc rendered",U,o),U},"renderDoc"),yyr={setConf:pyr,draw:myr},byr={parser:$Ye,get db(){return new nU(1)},renderer:yyr,styles:QYe,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const vyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:byr},Symbol.toStringTag,{value:"Module"}));var xyr={parser:$Ye,get db(){return new nU(2)},renderer:eyr,styles:QYe,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const wyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xyr},Symbol.toStringTag,{value:"Module"}));var RK=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,U,y,b){var v=y.length-1;switch(U){case 1:return y[v-1];case 2:this.$=[];break;case 3:y[v-1].push(y[v]),this.$=y[v-1];break;case 4:case 5:this.$=y[v];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(y[v].substr(6)),this.$=y[v].substr(6);break;case 9:this.$=y[v].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=y[v].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(y[v].substr(8)),this.$=y[v].substr(8);break;case 13:m.addTask(y[v-1],y[v]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],U=[null],y=[],b=this.table,v="",w=0,T=0,k=2,C=1,S=y.slice.call(arguments,1),E=Object.create(this.lexer),A={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(A.yy[R]=this.yy[R]);E.setInput(f,A.yy),A.yy.lexer=E,A.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var _=E.yylloc;y.push(_);var N=E.options&&E.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(K){g.length=g.length-2*K,U.length=U.length-K,y.length=y.length-K}x(L,"popStack");function I(){var K;return K=m.pop()||E.lex()||C,typeof K!="number"&&(K instanceof Array&&(m=K,K=m.pop()),K=p.symbols_[K]||K),K}x(I,"lex");for(var P,O,D,B,F={},z,$,V,H;;){if(O=g[g.length-1],this.defaultActions[O]?D=this.defaultActions[O]:((P===null||typeof P>"u")&&(P=I()),D=b[O]&&b[O][P]),typeof D>"u"||!D.length||!D[0]){var G="";H=[];for(z in b[O])this.terminals_[z]&&z>k&&H.push("'"+this.terminals_[z]+"'");E.showPosition?G="Parse error on line "+(w+1)+`: +`+E.showPosition()+` +Expecting `+H.join(", ")+", got '"+(this.terminals_[P]||P)+"'":G="Parse error on line "+(w+1)+": Unexpected "+(P==C?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(G,{text:E.match,token:this.terminals_[P]||P,line:E.yylineno,loc:_,expected:H})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+P);switch(D[0]){case 1:g.push(P),U.push(E.yytext),y.push(E.yylloc),g.push(D[1]),P=null,T=E.yyleng,v=E.yytext,w=E.yylineno,_=E.yylloc;break;case 2:if($=this.productions_[D[1]][1],F.$=U[U.length-$],F._$={first_line:y[y.length-($||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-($||1)].first_column,last_column:y[y.length-1].last_column},N&&(F._$.range=[y[y.length-($||1)].range[0],y[y.length-1].range[1]]),B=this.performAction.apply(F,[v,T,w,A.yy,D[1],U,y].concat(S)),typeof B<"u")return B;$&&(g=g.slice(0,-1*$*2),U=U.slice(0,-1*$),y=y.slice(0,-1*$)),g.push(this.productions_[D[1]][0]),U.push(F.$),y.push(F._$),V=b[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:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var U=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=[U[0],U[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` +`+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,U;if(this.options.backtrack_lexer&&(U={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&&(U.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 y in U)this[y]=U[y];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var U=this._currentRules(),y=0;yp[0].length)){if(p=g,m=y,this.options.backtrack_lexer){if(f=this.test_match(g,U[y]),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,U[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,U){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();RK.parser=RK;var Tyr=RK,L4="",Zae=[],wC=[],TC=[],Cyr=x(function(){Zae.length=0,wC.length=0,L4="",TC.length=0,Oi()},"clear"),kyr=x(function(t){L4=t,Zae.push(t)},"addSection"),Syr=x(function(){return Zae},"getSections"),Eyr=x(function(){let t=Q2e();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Myr=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:L4,type:L4,people:a,task:t,score:n};TC.push(s)},"addTask"),Ryr=x(function(t){const e={section:L4,type:L4,description:t,task:t,classes:[]};wC.push(e)},"addTaskOrg"),Q2e=x(function(){const t=x(function(r){return TC[r].processed},"compileTask");let e=!0;for(const[r,n]of TC.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Lyr=x(function(){return Ayr()},"getActors"),eye={getConfig:x(()=>He().journey,"getConfig"),clear:Cyr,setDiagramTitle:ra,getDiagramTitle:Yi,setAccTitle:qi,getAccTitle:ia,setAccDescription:aa,getAccDescription:sa,addSection:kyr,getSections:Syr,getTasks:Eyr,addTask:Myr,addTaskOrg:Ryr,getActors:Lyr},Iyr=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -5105,20 +5238,20 @@ Expecting `+G.join(", ")+", got '"+(this.terminals_[$]||$)+"'":W="Parse error on .actor-5 { ${t.actor5?`fill: ${t.actor5}`:""}; } - ${M7()} -`,"getStyles"),ubr=cbr,Wse=w(function(t,e){return WP(t,e)},"drawRect"),hbr=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 s(l){const u=F5().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(s,"smile");function a(l){const u=F5().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(a,"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?s(i):e.score<3?a(i):o(i),n},"drawFace"),HYe=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"),GYe=w(function(t,e){return Atr(t,e)},"drawText"),dbr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+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,GYe(t,e)},"drawLabel"),fbr=w(function(t,e,r){const n=t.append("g"),i=uu();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,Wse(n,i),WYe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),kK=-1,pbr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");kK++,s.append("line").attr("id",n+"-task"+kK).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"),hbr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=uu();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,Wse(s,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};HYe(s,d),l+=10}),WYe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),gbr=w(function(t,e){MDe(t,e)},"drawBackgroundRect"),WYe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+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,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y{const s=h0[i].color,a={cx:20,cy:n,r:7,fill:s,stroke:"#000",pos:h0[i].position};wA.drawCircle(t,a);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=wA.drawText(t,f).node().getBoundingClientRect().width;g>e_&&g>e.leftMargin-g&&(e_=g)}),n+=Math.max(20,u.length*20)})}w(qYe,"drawActorLegend");var oh=He().journey,eg=0,vbr=w(function(t,e,r,n){const i=He(),s=i.journey.titleColor,a=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=xt("#i"+e));const h=xt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");ku.init();const d=h.select("#"+e);wA.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const T in h0)delete h0[T];let m=0;g.forEach(T=>{h0[T]={color:oh.actorColours[m%oh.actorColours.length],position:m},m++}),qYe(d),eg=oh.leftMargin+e_,ku.insert(0,0,eg,Object.keys(h0).length*50),bbr(d,f,0,e);const y=ku.getBounds();p&&d.append("text").text(p).attr("x",eg).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",s).attr("font-family",o);const v=y.stopy-y.starty+2*oh.diagramMarginY,b=eg+y.stopx+2*oh.diagramMarginX;qs(d,v,b,oh.useMaxWidth),d.append("line").attr("x1",eg).attr("y1",oh.height*4).attr("x2",b-eg-4).attr("y2",oh.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const x=p?70:0;d.attr("viewBox",`${y.startx} -25 ${b} ${v+x}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+x+25)},"draw"),ku={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=He().journey,s=this;let a=0;function o(l){return w(function(h){a++;const d=s.sequenceItems.length-a+1;s.updateVal(h,"starty",e-d*i.boxMargin,Math.min),s.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),s.updateVal(ku.data,"startx",t-d*i.boxMargin,Math.min),s.updateVal(ku.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(s.updateVal(h,"startx",t-d*i.boxMargin,Math.min),s.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),s.updateVal(ku.data,"starty",e-d*i.boxMargin,Math.min),s.updateVal(ku.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),s=Math.max(t,r),a=Math.min(e,n),o=Math.max(e,n);this.updateVal(ku.data,"startx",i,Math.min),this.updateVal(ku.data,"starty",a,Math.min),this.updateVal(ku.data,"stopx",s,Math.max),this.updateVal(ku.data,"stopy",o,Math.max),this.updateBounds(i,a,s,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")},aG=oh.sectionFills,q2e=oh.sectionColours,bbr=w(function(t,e,r,n){const i=He().journey;let s="";const a=i.height*2+i.diagramMarginY,o=r+a;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(s!==p.section){u=aG[l%aG.length],d=l%aG.length,h=q2e[l%q2e.length];let m=0;const y=p.section;for(let b=f;b(h0[y]&&(m[y]=h0[y]),m),{});p.x=f*i.taskMargin+f*i.width+eg,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,wA.drawTask(t,p,i,n),ku.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),U2e={setConf:ybr,draw:vbr},xbr={parser:ebr,db:W2e,renderer:U2e,styles:ubr,init:w(t=>{U2e.setConf(t.journey),W2e.clear()},"init")};const wbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:xbr},Symbol.toStringTag,{value:"Module"}));var SK=(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],s=[1,15],a=[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,b,x){var T=b.length-1;switch(v){case 1:return b[T-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:b[T-1].push(b[T]),this.$=b[T-1];break;case 7:case 8:this.$=b[T];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(b[T].substr(6)),this.$=b[T].substr(6);break;case 12:this.$=b[T].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=b[T].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(b[T].substr(8)),this.$=b[T].substr(8);break;case 18:y.addTask(b[T],0,""),this.$=b[T];break;case 19:y.addEvent(b[T].substr(2)),this.$=b[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:s,20:a,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:s,20:a,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],b=[],x=this.table,T="",C=0,S=0,k=2,E=1,A=b.slice.call(arguments,1),M=Object.create(this.lexer),R={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(R.yy[P]=this.yy[P]);M.setInput(p,R.yy),R.yy.lexer=M,R.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var N=M.yylloc;b.push(N);var L=M.options&&M.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(q){m.length=m.length-2*q,v.length=v.length-q,b.length=b.length-q}w(I,"popStack");function $(){var q;return q=y.pop()||M.lex()||E,typeof q!="number"&&(q instanceof Array&&(y=q,q=y.pop()),q=g.symbols_[q]||q),q}w($,"lex");for(var O,D,B,z,V={},F,H,G,W;;){if(D=m[m.length-1],this.defaultActions[D]?B=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=$()),B=x[D]&&x[D][O]),typeof B>"u"||!B.length||!B[0]){var K="";W=[];for(F in x[D])this.terminals_[F]&&F>k&&W.push("'"+this.terminals_[F]+"'");M.showPosition?K="Parse error on line "+(C+1)+`: -`+M.showPosition()+` -Expecting `+W.join(", ")+", got '"+(this.terminals_[O]||O)+"'":K="Parse error on line "+(C+1)+": Unexpected "+(O==E?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(K,{text:M.match,token:this.terminals_[O]||O,line:M.yylineno,loc:N,expected:W})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+O);switch(B[0]){case 1:m.push(O),v.push(M.yytext),b.push(M.yylloc),m.push(B[1]),O=null,S=M.yyleng,T=M.yytext,C=M.yylineno,N=M.yylloc;break;case 2:if(H=this.productions_[B[1]][1],V.$=v[v.length-H],V._$={first_line:b[b.length-(H||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(H||1)].first_column,last_column:b[b.length-1].last_column},L&&(V._$.range=[b[b.length-(H||1)].range[0],b[b.length-1].range[1]]),z=this.performAction.apply(V,[T,S,C,R.yy,B[1],v,b].concat(A)),typeof z<"u")return z;H&&(m=m.slice(0,-1*H*2),v=v.slice(0,-1*H),b=b.slice(0,-1*H)),m.push(this.productions_[B[1]][0]),v.push(V.$),b.push(V._$),G=x[m[m.length-2]][m[m.length-1]],m.push(G);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 b in v)this[b]=v[b];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(),b=0;bg[0].length)){if(g=m,y=b,this.options.backtrack_lexer){if(p=this.test_match(m,v[b]),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})();SK.parser=SK;var Tbr=SK,UYe={};JO(UYe,{addEvent:()=>rXe,addSection:()=>QYe,addTask:()=>tXe,addTaskOrg:()=>nXe,clear:()=>XYe,default:()=>Cbr,getCommonDb:()=>YYe,getDirection:()=>ZYe,getSections:()=>JYe,getTasks:()=>eXe,setDirection:()=>KYe});var R3="",jYe=0,qse="LR",Use=[],iO=[],_3=[],YYe=w(()=>MQ,"getCommonDb"),XYe=w(function(){Use.length=0,iO.length=0,R3="",_3.length=0,qse="LR",Oi()},"clear"),KYe=w(function(t){qse=t},"setDirection"),ZYe=w(function(){return qse},"getDirection"),QYe=w(function(t){R3=t,Use.push(t)},"addSection"),JYe=w(function(){return Use},"getSections"),eXe=w(function(){let t=j2e();const e=100;let r=0;for(;!t&&rr.id===jYe-1).events.push(t)},"addEvent"),nXe=w(function(t){const e={section:R3,type:R3,description:t,task:t,classes:[]};iO.push(e)},"addTaskOrg"),j2e=w(function(){const t=w(function(r){return _3[r].processed},"compileTask");let e=!0;for(const[r,n]of _3.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Cbr={clear:XYe,getCommonDb:YYe,getDirection:ZYe,setDirection:KYe,addSection:QYe,getSections:JYe,getTasks:eXe,addTask:tXe,addTaskOrg:nXe,addEvent:rXe},iXe=0,lB=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"),kbr=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 s(l){const u=F5().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(s,"smile");function a(l){const u=F5().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(a,"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?s(i):e.score<3?a(i):o(i),n},"drawFace"),Sbr=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"),sXe=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"),Ebr=w(function(t,e){function r(i,s,a,o,l){return i+","+s+" "+(i+a)+","+s+" "+(i+a)+","+(s+o-l)+" "+(i+a-l*1.2)+","+(s+o)+" "+i+","+(s+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,sXe(t,e)},"drawLabel"),Abr=w(function(t,e,r){const n=t.append("g"),i=jse();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,lB(n,i),aXe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),EK=-1,Mbr=w(function(t,e,r,n){const i=e.x+r.width/2,s=t.append("g");EK++,s.append("line").attr("id",n+"-task"+EK).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"),kbr(s,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=jse();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,lB(s,o),aXe(r)(e.task,s,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Rbr=w(function(t,e){lB(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),_br=w(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),jse=w(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),aXe=(function(){function t(i,s,a,o,l,u,h,d){const f=s.append("text").attr("x",a+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,s,a,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let y=0;y)/).reverse(),i,s=[],a=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==="
    ")&&(s.pop(),u.text(s.join(" ").trim()),i==="
    "?s=[""]:s=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",a+"em").text(i))})}w(Yse,"wrap");var Ibr=w(function(t,e,r,n,i,s=!1){var v,b,x;const{theme:a,look:o}=n,l=a==null?void 0:a.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(Yse,e.width).node().getBBox(),y=(b=n.fontSize)!=null&&b.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}, ${s?e.padding/2+3:e.padding})`),Obr(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const T=a.includes("dark"),C=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),S=xt(C),k=S.attr("id")??"",E=k?`${k}-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"),Nbr=w(function(t,e,r){var o;const n=t.append("g"),s=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Yse,e.width).node().getBBox(),a=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),s.height+a*1.1*.5+e.padding},"getVirtualNodeHeight"),Obr=w(function(t,e,r,n,i){const{theme:s}=i,a=s!=null&&s.includes("redux")?0:5,o=5,l=a>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${a},${a},-${a} h${e.width-2*o} q${a},0,${a},${a} 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-"+iXe++).attr("class","node-bkg node-"+e.type).attr("d",l),s!=null&&s.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"),bc={drawRect:lB,drawCircle:Sbr,drawSection:Abr,drawText:sXe,drawLabel:Ebr,drawTask:Mbr,drawBackgroundRect:Rbr,getTextObj:_br,getNoteRect:jse,initGraphics:Lbr,drawNode:Ibr,getVirtualNodeHeight:Nbr},Dbr=w(function(t,e,r,n){var I,$,O;const i=He(),{look:s,theme:a,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=xt("#i"+e));const m=xt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();de.debug("task",y),bc.initGraphics(m,e);const b=n.db.getSections();de.debug("sections",b);let x=0,T=0,C=0,S=0,k=50+d,E=50;S=50;let A=0,M=!0;b.forEach(function(D){const B={number:A,descr:D,section:A,width:150,padding:20,maxHeight:x},z=bc.getVirtualNodeHeight(m,B,i);de.debug("sectionHeight before draw",z),x=Math.max(x,z+20)});let R=0,P=0;de.debug("tasks.length",y.length);for(const[D,B]of y.entries()){const z={number:D,descr:B,section:B.section,width:150,padding:20,maxHeight:T},V=bc.getVirtualNodeHeight(m,z,i);de.debug("taskHeight before draw",V),T=Math.max(T,V+20),R=Math.max(R,B.events.length);let F=0;for(const H of B.events){const G={descr:H,section:B.section,number:B.section,width:150,padding:20,maxHeight:50};F+=bc.getVirtualNodeHeight(m,G,i)}B.events.length>0&&(F+=(B.events.length-1)*10),P=Math.max(P,F)}de.debug("maxSectionHeight before draw",x),de.debug("maxTaskHeight before draw",T),b&&b.length>0?b.forEach(D=>{const B=y.filter(H=>H.section===D),z={number:A,descr:D,section:A,width:200*Math.max(B.length,1)-50,padding:20,maxHeight:x};de.debug("sectionNode",z);const V=m.append("g"),F=bc.drawNode(V,z,A,i,e);de.debug("sectionNode output",F),V.attr("transform",`translate(${k}, ${S})`),E+=x+50,B.length>0&&Y2e(m,B,A,k,E,T,i,R,P,x,!1,e),k+=200*Math.max(B.length,1),E=S,A++}):(M=!1,Y2e(m,y,A,k,E,T,i,R,P,x,!0,e));const N=m.node().getBBox();if(de.debug("bounds",N),v&&m.append("text").text(v).attr("x",s==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=M?x+T+150:T+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",N.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),s==="neo"&&l&&a!=="neutral"){const D=m.select("defs"),z=(D.empty()?m.append("defs"):D).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)}W3(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),Y2e=w(function(t,e,r,n,i,s,a,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:s};de.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=bc.drawNode(m,g,r,a,d).height;if(de.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),s=Math.max(s,v),p.events){const b=t.append("g").attr("class","lineWrapper");let x=s;i+=100,x=x+Pbr(t,p.events,r,n,i,a,d),i-=100,b.append("line").attr("x1",n+190/2).attr("y1",i+s).attr("x2",n+190/2).attr("y2",i+s+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=a.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),Pbr=w(function(t,e,r,n,i,s,a){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};de.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=bc.drawNode(d,h,r,s,a,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),$br={setConf:w(()=>{},"setConf"),draw:Dbr},cB=200,Zf=5,Bbr=cB+Zf*2,Xse=cB+100,Fbr=Xse+Zf*2,oXe=10,zbr=0,X2e=20,lXe=20,K2e=30,cXe=50,Vbr=w(function(t,e,r,n){var I,$,O,D,B;const i=He(),s=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const a=al(e);a.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),bc.initGraphics(a);const u=n.db.getSections();de.debug("sections",u);let h=0,d=0;const f=50+s;let p=50;const g=p,m=f,y=Bbr+lXe,v=Fbr+cXe,b=m+y;let x=0;const T=u&&u.length>0,C=T?b:f+y,S=Math.max(50,y+v-Zf*2);u.forEach(function(z){const V={number:x,descr:z,section:x,width:S,padding:Zf,maxHeight:h},F=bc.getVirtualNodeHeight(a,V,i);de.debug("sectionHeight before draw",F),h=Math.max(h,F)});let k=0;de.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const F={number:z,descr:V,section:V.section,width:cB,padding:Zf,maxHeight:d},H=bc.getVirtualNodeHeight(a,F,i);de.debug("taskHeight before draw",H),d=Math.max(d,H);let G=0;for(const W of V.events){const K={descr:W,section:V.section,number:V.section,width:Xse,padding:Zf,maxHeight:50};G+=bc.getVirtualNodeHeight(a,K,i)}V.events.length>0&&(G+=(V.events.length-1)*oXe),k=Math.max(k,G)+zbr}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const A=Math.max(d,k)+K2e;T?u.forEach(z=>{const V=o.filter(Z=>Z.section===z),F={number:x,descr:z,section:x,width:S,padding:Zf,maxHeight:h};de.debug("sectionNode",F);const H=a.append("g"),G=bc.drawNode(H,F,x,i);de.debug("sectionNode output",G);const W=C-y;H.attr("transform",`translate(${W}, ${p})`);const K=p+G.height+X2e;V.length>0&&Z2e(a,V,x,C,K,d,i,A,!1);const q=V.length,oe=G.height+X2e+A*Math.max(q,1)-(q>0?K2e*2:0);p+=oe,x++}):Z2e(a,o,x,C,p,d,i,A,!0);let M=($=a.node())==null?void 0:$.getBBox();if(!M)throw new Error("bbox not found");if(de.debug("bounds",M),l){if(a.append("text").text(l).attr("x",M.width/2-s).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=(O=a.node())==null?void 0:O.getBBox(),!M)throw new Error("bbox not found");de.debug("bounds after title",M)}const[R]=np(i.fontSize),P=(R??16)*2,N=(R??16)*.5+20,L=a.append("g").attr("class","lineWrapper");L.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",M.y+M.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),W3(void 0,a,((D=i.timeline)==null?void 0:D.padding)??50,((B=i.timeline)==null?void 0:B.useMaxWidth)??!1)},"draw"),Z2e=w(function(t,e,r,n,i,s,a,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:cB,padding:Zf,maxHeight:s};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=bc.drawNode(f,d,r,a),g=p.height;de.debug("taskHeight after draw",g);const m=n-lXe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),s=Math.max(s,g),h.events&&h.events.length>0){const y=i,v=n+cXe;Hbr(t,h.events,r,n,v,y,a)}i=i+o,l&&!((u=a.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),Hbr=w(function(t,e,r,n,i,s,a){let o=s;for(const l of e){const u={descr:l,section:r,number:r,width:Xse,padding:Zf,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=bc.drawNode(h,u,r,a).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+oXe}return o-s},"drawEvents"),Gbr={setConf:w(()=>{},"setConf"),draw:Vbr},Wbr=w(t=>{var o;const{theme:e}=xr(),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(/^#/,""))??"",s=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let a="";for(let l=0;l3?a(i):e.score<3?s(i):o(i),n},"drawFace"),tXe=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),rXe=x(function(t,e){return Ktr(t,e)},"drawText"),Oyr=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,rXe(t,e)},"drawLabel"),_yr=x(function(t,e,r){const n=t.append("g"),i=uu();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,Jae(n,i),nXe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),LK=-1,Pyr=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");LK++,a.append("line").attr("id",n+"-task"+LK).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"),Dyr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=uu();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,Jae(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};tXe(a,d),l+=10}),nXe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Byr=x(function(t,e){zOe(t,e)},"drawBackgroundRect"),nXe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let U=0;U{const a=d0[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:d0[i].position};CC.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 U of f)m+=U,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=U);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=CC.drawText(t,f).node().getBoundingClientRect().width;g>nR&&g>e.leftMargin-g&&(nR=g)}),n+=Math.max(20,u.length*20)})}x(iXe,"drawActorLegend");var oh=He().journey,tg=0,zyr=x(function(t,e,r,n){const i=He(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=vt("#i"+e));const h=vt(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Cu.init();const d=h.select("#"+e);CC.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in d0)delete d0[w];let m=0;g.forEach(w=>{d0[w]={color:oh.actorColours[m%oh.actorColours.length],position:m},m++}),iXe(d),tg=oh.leftMargin+nR,Cu.insert(0,0,tg,Object.keys(d0).length*50),Vyr(d,f,0,e);const U=Cu.getBounds();p&&d.append("text").text(p).attr("x",tg).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const y=U.stopy-U.starty+2*oh.diagramMarginY,b=tg+U.stopx+2*oh.diagramMarginX;Ga(d,y,b,oh.useMaxWidth),d.append("line").attr("x1",tg).attr("y1",oh.height*4).attr("x2",b-tg-4).attr("y2",oh.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const v=p?70:0;d.attr("viewBox",`${U.startx} -25 ${b} ${y+v}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",y+v+25)},"draw"),Cu={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=He().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Cu.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Cu.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(Cu.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Cu.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(Cu.data,"startx",i,Math.min),this.updateVal(Cu.data,"starty",s,Math.min),this.updateVal(Cu.data,"stopx",a,Math.max),this.updateVal(Cu.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},hH=oh.sectionFills,tye=oh.sectionColours,Vyr=x(function(t,e,r,n){const i=He().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=hH[l%hH.length],d=l%hH.length,h=tye[l%tye.length];let m=0;const U=p.section;for(let b=f;b(d0[U]&&(m[U]=d0[U]),m),{});p.x=f*i.taskMargin+f*i.width+tg,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,CC.drawTask(t,p,i,n),Cu.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),rye={setConf:Fyr,draw:zyr},Hyr={parser:Tyr,db:eye,renderer:rye,styles:Nyr,init:x(t=>{rye.setConf(t.journey),eye.clear()},"init")};const Gyr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Hyr},Symbol.toStringTag,{value:"Module"}));var IK=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,U,y,b,v){var w=b.length-1;switch(y){case 1:return b[w-1];case 3:U.setDirection("LR");break;case 4:U.setDirection("TD");break;case 5:this.$=[];break;case 6:b[w-1].push(b[w]),this.$=b[w-1];break;case 7:case 8:this.$=b[w];break;case 9:case 10:this.$=[];break;case 11:U.getCommonDb().setDiagramTitle(b[w].substr(6)),this.$=b[w].substr(6);break;case 12:this.$=b[w].trim(),U.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=b[w].trim(),U.getCommonDb().setAccDescription(this.$);break;case 15:U.addSection(b[w].substr(8)),this.$=b[w].substr(8);break;case 18:U.addTask(b[w],0,""),this.$=b[w];break;case 19:U.addEvent(b[w].substr(2)),this.$=b[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],U=[],y=[null],b=[],v=this.table,w="",T=0,k=0,C=2,S=1,E=b.slice.call(arguments,1),A=Object.create(this.lexer),R={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(R.yy[_]=this.yy[_]);A.setInput(p,R.yy),R.yy.lexer=A,R.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var N=A.yylloc;b.push(N);var L=A.options&&A.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(W){m.length=m.length-2*W,y.length=y.length-W,b.length=b.length-W}x(I,"popStack");function P(){var W;return W=U.pop()||A.lex()||S,typeof W!="number"&&(W instanceof Array&&(U=W,W=U.pop()),W=g.symbols_[W]||W),W}x(P,"lex");for(var O,D,B,F,z={},$,V,H,G;;){if(D=m[m.length-1],this.defaultActions[D]?B=this.defaultActions[D]:((O===null||typeof O>"u")&&(O=P()),B=v[D]&&v[D][O]),typeof B>"u"||!B.length||!B[0]){var K="";G=[];for($ in v[D])this.terminals_[$]&&$>C&&G.push("'"+this.terminals_[$]+"'");A.showPosition?K="Parse error on line "+(T+1)+`: +`+A.showPosition()+` +Expecting `+G.join(", ")+", got '"+(this.terminals_[O]||O)+"'":K="Parse error on line "+(T+1)+": Unexpected "+(O==S?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(K,{text:A.match,token:this.terminals_[O]||O,line:A.yylineno,loc:N,expected:G})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+O);switch(B[0]){case 1:m.push(O),y.push(A.yytext),b.push(A.yylloc),m.push(B[1]),O=null,k=A.yyleng,w=A.yytext,T=A.yylineno,N=A.yylloc;break;case 2:if(V=this.productions_[B[1]][1],z.$=y[y.length-V],z._$={first_line:b[b.length-(V||1)].first_line,last_line:b[b.length-1].last_line,first_column:b[b.length-(V||1)].first_column,last_column:b[b.length-1].last_column},L&&(z._$.range=[b[b.length-(V||1)].range[0],b[b.length-1].range[1]]),F=this.performAction.apply(z,[w,k,T,R.yy,B[1],y,b].concat(E)),typeof F<"u")return F;V&&(m=m.slice(0,-1*V*2),y=y.slice(0,-1*V),b=b.slice(0,-1*V)),m.push(this.productions_[B[1]][0]),y.push(z.$),b.push(z._$),H=v[m[m.length-2]][m[m.length-1]],m.push(H);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var U=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 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:m?(m.length===U.length?this.yylloc.first_column:0)+U[U.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` +`+g+"^"},"showPosition"),test_match:x(function(p,g){var m,U,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))),U=p[0].match(/(?:\r\n?|\n).*/g),U&&(this.yylineno+=U.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:U?U[U.length-1].length-U[U.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 b in y)this[b]=y[b];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,U;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),b=0;bg[0].length)){if(g=m,U=b,this.options.backtrack_lexer){if(p=this.test_match(m,y[b]),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,y[U]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,U,y){switch(U){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();IK.parser=IK;var Wyr=IK,aXe={};rO(aXe,{addEvent:()=>gXe,addSection:()=>hXe,addTask:()=>pXe,addTaskOrg:()=>mXe,clear:()=>lXe,default:()=>qyr,getCommonDb:()=>oXe,getDirection:()=>uXe,getSections:()=>dXe,getTasks:()=>fXe,setDirection:()=>cXe});var I4="",sXe=0,Qae="LR",ese=[],oD=[],N4=[],oXe=x(()=>OJ,"getCommonDb"),lXe=x(function(){ese.length=0,oD.length=0,I4="",N4.length=0,Qae="LR",Oi()},"clear"),cXe=x(function(t){Qae=t},"setDirection"),uXe=x(function(){return Qae},"getDirection"),hXe=x(function(t){I4=t,ese.push(t)},"addSection"),dXe=x(function(){return ese},"getSections"),fXe=x(function(){let t=nye();const e=100;let r=0;for(;!t&&rr.id===sXe-1).events.push(t)},"addEvent"),mXe=x(function(t){const e={section:I4,type:I4,description:t,task:t,classes:[]};oD.push(e)},"addTaskOrg"),nye=x(function(){const t=x(function(r){return N4[r].processed},"compileTask");let e=!0;for(const[r,n]of N4.entries())t(r),e=e&&n.processed;return e},"compileTasks"),qyr={clear:lXe,getCommonDb:oXe,getDirection:uXe,setDirection:cXe,addSection:hXe,getSections:dXe,getTasks:fXe,addTask:pXe,addTaskOrg:mXe,addEvent:gXe},UXe=0,hB=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),jyr=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=Hv().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=Hv().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),Yyr=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),yXe=x(function(t,e){const r=e.text.replace(//gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),Xyr=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,yXe(t,e)},"drawLabel"),Kyr=x(function(t,e,r){const n=t.append("g"),i=tse();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,hB(n,i),bXe(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),NK=-1,Zyr=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");NK++,a.append("line").attr("id",n+"-task"+NK).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"),jyr(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=tse();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,hB(a,o),bXe(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),Jyr=x(function(t,e){hB(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Qyr=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),tse=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),bXe=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let U=0;U)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;he||i==="
    ")&&(a.pop(),u.text(a.join(" ").trim()),i==="
    "?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(rse,"wrap");var t6r=x(function(t,e,r,n,i,a=!1){var y,b,v;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((y=n==null?void 0:n.themeVariables)==null?void 0:y.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(rse,e.width).node().getBBox(),U=(b=n.fontSize)!=null&&b.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+U*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})`),n6r(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),T=((v=t.node())==null?void 0:v.ownerSVGElement)??t.node(),k=vt(T),C=k.attr("id")??"",S=C?`${C}-drop-shadow`:"drop-shadow";if(k.select(`#${S}`).empty()){const E=k.select("defs");(E.empty()?k.append("defs"):E).append("filter").attr("id",S).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),r6r=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(rse,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"),n6r=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+UXe++).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"),bc={drawRect:hB,drawCircle:Yyr,drawSection:Kyr,drawText:yXe,drawLabel:Xyr,drawTask:Zyr,drawBackgroundRect:Jyr,getTextObj:Qyr,getNoteRect:tse,initGraphics:e6r,drawNode:t6r,getVirtualNodeHeight:r6r},i6r=x(function(t,e,r,n){var I,P,O;const i=He(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=vt("#i"+e));const m=vt(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const U=n.db.getTasks(),y=n.db.getCommonDb().getDiagramTitle();de.debug("task",U),bc.initGraphics(m,e);const b=n.db.getSections();de.debug("sections",b);let v=0,w=0,T=0,k=0,C=50+d,S=50;k=50;let E=0,A=!0;b.forEach(function(D){const B={number:E,descr:D,section:E,width:150,padding:20,maxHeight:v},F=bc.getVirtualNodeHeight(m,B,i);de.debug("sectionHeight before draw",F),v=Math.max(v,F+20)});let R=0,_=0;de.debug("tasks.length",U.length);for(const[D,B]of U.entries()){const F={number:D,descr:B,section:B.section,width:150,padding:20,maxHeight:w},z=bc.getVirtualNodeHeight(m,F,i);de.debug("taskHeight before draw",z),w=Math.max(w,z+20),R=Math.max(R,B.events.length);let $=0;for(const V of B.events){const H={descr:V,section:B.section,number:B.section,width:150,padding:20,maxHeight:50};$+=bc.getVirtualNodeHeight(m,H,i)}B.events.length>0&&($+=(B.events.length-1)*10),_=Math.max(_,$)}de.debug("maxSectionHeight before draw",v),de.debug("maxTaskHeight before draw",w),b&&b.length>0?b.forEach(D=>{const B=U.filter(V=>V.section===D),F={number:E,descr:D,section:E,width:200*Math.max(B.length,1)-50,padding:20,maxHeight:v};de.debug("sectionNode",F);const z=m.append("g"),$=bc.drawNode(z,F,E,i,e);de.debug("sectionNode output",$),z.attr("transform",`translate(${C}, ${k})`),S+=v+50,B.length>0&&iye(m,B,E,C,S,w,i,R,_,v,!1,e),C+=200*Math.max(B.length,1),S=k,E++}):(A=!1,iye(m,U,E,C,S,w,i,R,_,v,!0,e));const N=m.node().getBBox();if(de.debug("bounds",N),y&&m.append("text").text(y).attr("x",a==="neo"?N.x*2+d:N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=A?v+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",T).attr("x2",N.width+3*d).attr("y2",T).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const D=m.select("defs"),F=(D.empty()?m.append("defs"):D).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");F.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),F.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}j4(void 0,m,((P=i.timeline)==null?void 0:P.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),iye=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};de.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),y=bc.drawNode(m,g,r,s,d).height;if(de.debug("taskHeight after draw",y),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,y),p.events){const b=t.append("g").attr("class","lineWrapper");let v=a;i+=100,v=v+a6r(t,p.events,r,n,i,s,d),i-=100,b.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"),a6r=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};de.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=bc.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"),s6r={setConf:x(()=>{},"setConf"),draw:i6r},dB=200,Jf=5,o6r=dB+Jf*2,nse=dB+100,l6r=nse+Jf*2,vXe=10,c6r=0,aye=20,xXe=20,sye=30,wXe=50,u6r=x(function(t,e,r,n){var I,P,O,D,B;const i=He(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;de.debug("timeline",n.db);const s=sl(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();de.debug("task",o),bc.initGraphics(s);const u=n.db.getSections();de.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,U=o6r+xXe,y=l6r+wXe,b=m+U;let v=0;const w=u&&u.length>0,T=w?b:f+U,k=Math.max(50,U+y-Jf*2);u.forEach(function(F){const z={number:v,descr:F,section:v,width:k,padding:Jf,maxHeight:h},$=bc.getVirtualNodeHeight(s,z,i);de.debug("sectionHeight before draw",$),h=Math.max(h,$)});let C=0;de.debug("tasks.length",o.length);for(const[F,z]of o.entries()){const $={number:F,descr:z,section:z.section,width:dB,padding:Jf,maxHeight:d},V=bc.getVirtualNodeHeight(s,$,i);de.debug("taskHeight before draw",V),d=Math.max(d,V);let H=0;for(const G of z.events){const K={descr:G,section:z.section,number:z.section,width:nse,padding:Jf,maxHeight:50};H+=bc.getVirtualNodeHeight(s,K,i)}z.events.length>0&&(H+=(z.events.length-1)*vXe),C=Math.max(C,H)+c6r}de.debug("maxSectionHeight before draw",h),de.debug("maxTaskHeight before draw",d);const E=Math.max(d,C)+sye;w?u.forEach(F=>{const z=o.filter(Z=>Z.section===F),$={number:v,descr:F,section:v,width:k,padding:Jf,maxHeight:h};de.debug("sectionNode",$);const V=s.append("g"),H=bc.drawNode(V,$,v,i);de.debug("sectionNode output",H);const G=T-U;V.attr("transform",`translate(${G}, ${p})`);const K=p+H.height+aye;z.length>0&&oye(s,z,v,T,K,d,i,E,!1);const W=z.length,oe=H.height+aye+E*Math.max(W,1)-(W>0?sye*2:0);p+=oe,v++}):oye(s,o,v,T,p,d,i,E,!0);let A=(P=s.node())==null?void 0:P.getBBox();if(!A)throw new Error("bbox not found");if(de.debug("bounds",A),l){if(s.append("text").text(l).attr("x",A.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),A=(O=s.node())==null?void 0:O.getBBox(),!A)throw new Error("bbox not found");de.debug("bounds after title",A)}const[R]=ip(i.fontSize),_=(R??16)*2,N=(R??16)*.5+20,L=s.append("g").attr("class","lineWrapper");L.append("line").attr("x1",T).attr("y1",g-_).attr("x2",T).attr("y2",A.y+A.height+N).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),j4(void 0,s,((D=i.timeline)==null?void 0:D.padding)??50,((B=i.timeline)==null?void 0:B.useMaxWidth)??!1)},"draw"),oye=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:dB,padding:Jf,maxHeight:a};de.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=bc.drawNode(f,d,r,s),g=p.height;de.debug("taskHeight after draw",g);const m=n-xXe-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const U=i,y=n+wXe;h6r(t,h.events,r,n,y,U,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),h6r=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:nse,padding:Jf,maxHeight:0};de.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=bc.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+vXe}return o-a},"drawEvents"),d6r={setConf:x(()=>{},"setConf"),draw:u6r},f6r=x(t=>{var o;const{theme:e}=xr(),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 a;const{theme:e}=xr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((a=t.svgId)==null?void 0:a.replace(/^#/,""))??"";let s="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o{var s;const{theme:e}=xr(),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 s,a;return(((a=(s=n==null?void 0:n.db)==null?void 0:s.getDirection)==null?void 0:a.call(s))??"LR")==="TD"?Gbr.draw(t,e,r,n):$br.draw(t,e,r,n)},"draw")},Xbr={db:UYe,renderer:Ybr,parser:Tbr,styles:jbr};const Kbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Xbr},Symbol.toStringTag,{value:"Module"})),wo=[];for(let t=0;t<256;++t)wo.push((t+256).toString(16).slice(1));function Zbr(t,e=0){return(wo[t[e+0]]+wo[t[e+1]]+wo[t[e+2]]+wo[t[e+3]]+"-"+wo[t[e+4]]+wo[t[e+5]]+"-"+wo[t[e+6]]+wo[t[e+7]]+"-"+wo[t[e+8]]+wo[t[e+9]]+"-"+wo[t[e+10]]+wo[t[e+11]]+wo[t[e+12]]+wo[t[e+13]]+wo[t[e+14]]+wo[t[e+15]]).toLowerCase()}const Qbr=new Uint8Array(16);function Jbr(){return crypto.getRandomValues(Qbr)}function exr(t,e,r){return crypto.randomUUID?crypto.randomUUID():txr(t)}function txr(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??Jbr();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,Zbr(n)}var AK=(function(){var t=w(function(T,C,S,k){for(S=S||{},k=T.length;k--;S[T[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[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(C,S,k,E,A,M,R){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:s,17:17,18:18,19:a,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:s,17:17,18:18,19:a,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:s,17:17,18:18,19:a,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:a,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:s,17:17,18:18,19:a,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(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:w(function(C){var S=this,k=[0],E=[],A=[null],M=[],R=this.table,P="",N=0,L=0,I=2,$=1,O=M.slice.call(arguments,1),D=Object.create(this.lexer),B={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(B.yy[z]=this.yy[z]);D.setInput(C,B.yy),B.yy.lexer=D,B.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var V=D.yylloc;M.push(V);var F=D.options&&D.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(_e){k.length=k.length-2*_e,A.length=A.length-_e,M.length=M.length-_e}w(H,"popStack");function G(){var _e;return _e=E.pop()||D.lex()||$,typeof _e!="number"&&(_e instanceof Array&&(E=_e,_e=E.pop()),_e=S.symbols_[_e]||_e),_e}w(G,"lex");for(var W,K,q,oe,Z={},Q,ne,ie,me;;){if(K=k[k.length-1],this.defaultActions[K]?q=this.defaultActions[K]:((W===null||typeof W>"u")&&(W=G()),q=R[K]&&R[K][W]),typeof q>"u"||!q.length||!q[0]){var te="";me=[];for(Q in R[K])this.terminals_[Q]&&Q>I&&me.push("'"+this.terminals_[Q]+"'");D.showPosition?te="Parse error on line "+(N+1)+`: +`},"getStyles"),m6r=g6r,U6r={setConf:x(()=>{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?d6r.draw(t,e,r,n):s6r.draw(t,e,r,n)},"draw")},y6r={db:aXe,renderer:U6r,parser:Wyr,styles:m6r};const b6r=Object.freeze(Object.defineProperty({__proto__:null,diagram:y6r},Symbol.toStringTag,{value:"Module"})),xo=[];for(let t=0;t<256;++t)xo.push((t+256).toString(16).slice(1));function v6r(t,e=0){return(xo[t[e+0]]+xo[t[e+1]]+xo[t[e+2]]+xo[t[e+3]]+"-"+xo[t[e+4]]+xo[t[e+5]]+"-"+xo[t[e+6]]+xo[t[e+7]]+"-"+xo[t[e+8]]+xo[t[e+9]]+"-"+xo[t[e+10]]+xo[t[e+11]]+xo[t[e+12]]+xo[t[e+13]]+xo[t[e+14]]+xo[t[e+15]]).toLowerCase()}const x6r=new Uint8Array(16);function w6r(){return crypto.getRandomValues(x6r)}function T6r(t,e,r){return crypto.randomUUID?crypto.randomUUID():C6r(t)}function C6r(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??w6r();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,v6r(n)}var DK=(function(){var t=x(function(w,T,k,C){for(k=k||{},C=w.length;C--;k[w[C]]=T);return k},"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],U=[1,6,7,11,13,15,16,19,22],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(T,k,C,S,E,A,R){var _=A.length-1;switch(E){case 6:case 7:return S;case 8:S.getLogger().trace("Stop NL ");break;case 9:S.getLogger().trace("Stop EOF ");break;case 11:S.getLogger().trace("Stop NL2 ");break;case 12:S.getLogger().trace("Stop EOF2 ");break;case 15:S.getLogger().info("Node: ",A[_].id),S.addNode(A[_-1].length,A[_].id,A[_].descr,A[_].type);break;case 16:S.getLogger().trace("Icon: ",A[_]),S.decorateNode({icon:A[_]});break;case 17:case 21:S.decorateNode({class:A[_]});break;case 18:S.getLogger().trace("SPACELIST");break;case 19:S.getLogger().trace("Node: ",A[_].id),S.addNode(0,A[_].id,A[_].descr,A[_].type);break;case 20:S.decorateNode({icon:A[_]});break;case 25:S.getLogger().trace("node found ..",A[_-2]),this.$={id:A[_-1],descr:A[_-1],type:S.getType(A[_-2],A[_])};break;case 26:this.$={id:A[_],descr:A[_],type:S.nodeType.DEFAULT};break;case 27:S.getLogger().trace("node found ..",A[_-3]),this.$={id:A[_-3],descr:A[_-1],type:S.getType(A[_-2],A[_])};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(U,[2,8]),t(U,[2,9]),t(U,[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(U,[2,11]),t(U,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,k){if(k.recoverable)this.trace(T);else{var C=new Error(T);throw C.hash=k,C}},"parseError"),parse:x(function(T){var k=this,C=[0],S=[],E=[null],A=[],R=this.table,_="",N=0,L=0,I=2,P=1,O=A.slice.call(arguments,1),D=Object.create(this.lexer),B={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(B.yy[F]=this.yy[F]);D.setInput(T,B.yy),B.yy.lexer=D,B.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var z=D.yylloc;A.push(z);var $=D.options&&D.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(Re){C.length=C.length-2*Re,E.length=E.length-Re,A.length=A.length-Re}x(V,"popStack");function H(){var Re;return Re=S.pop()||D.lex()||P,typeof Re!="number"&&(Re instanceof Array&&(S=Re,Re=S.pop()),Re=k.symbols_[Re]||Re),Re}x(H,"lex");for(var G,K,W,oe,Z={},J,ne,ie,me;;){if(K=C[C.length-1],this.defaultActions[K]?W=this.defaultActions[K]:((G===null||typeof G>"u")&&(G=H()),W=R[K]&&R[K][G]),typeof W>"u"||!W.length||!W[0]){var te="";me=[];for(J in R[K])this.terminals_[J]&&J>I&&me.push("'"+this.terminals_[J]+"'");D.showPosition?te="Parse error on line "+(N+1)+`: `+D.showPosition()+` -Expecting `+me.join(", ")+", got '"+(this.terminals_[W]||W)+"'":te="Parse error on line "+(N+1)+": Unexpected "+(W==$?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[W]||W,line:D.yylineno,loc:V,expected:me})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+W);switch(q[0]){case 1:k.push(W),A.push(D.yytext),M.push(D.yylloc),k.push(q[1]),W=null,L=D.yyleng,P=D.yytext,N=D.yylineno,V=D.yylloc;break;case 2:if(ne=this.productions_[q[1]][1],Z.$=A[A.length-ne],Z._$={first_line:M[M.length-(ne||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(ne||1)].first_column,last_column:M[M.length-1].last_column},F&&(Z._$.range=[M[M.length-(ne||1)].range[0],M[M.length-1].range[1]]),oe=this.performAction.apply(Z,[P,L,N,B.yy,q[1],A,M].concat(O)),typeof oe<"u")return oe;ne&&(k=k.slice(0,-1*ne*2),A=A.slice(0,-1*ne),M=M.slice(0,-1*ne)),k.push(this.productions_[q[1]][0]),A.push(Z.$),M.push(Z._$),ie=R[k[k.length-2]][k[k.length-1]],k.push(ie);break;case 3:return!0}}return!0},"parse")},b=(function(){var T={EOF:1,parseError:w(function(S,k){if(this.yy.parser)this.yy.parser.parseError(S,k);else throw new Error(S)},"parseError"),setInput:w(function(C,S){return this.yy=S||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:w(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var S=C.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:w(function(C){var S=C.length,k=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var 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:k?(k.length===E.length?this.yylloc.first_column:0)+E[E.length-k.length].length-k[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[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(C){this.unput(this.match.slice(C))},"less"),pastInput:w(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var C=this.pastInput(),S=new Array(C.length+1).join("-");return C+this.upcomingInput()+` -`+S+"^"},"showPosition"),test_match:w(function(C,S){var k,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=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],k=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var M in 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 C,S,k,E;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),M=0;MS[0].length)){if(S=k,E=M,this.options.backtrack_lexer){if(C=this.test_match(k,A[M]),C!==!1)return C;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(C=this.test_match(S,A[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex: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,k,E,A){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return T})();v.lexer=b;function x(){this.yy={}}return w(x,"Parser"),x.prototype=v,v.Parser=x,new x})();AK.parser=AK;var rxr=AK,nxr=12,Pf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},e5,ixr=(e5=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Pf,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;de.info("addNode",e,r,n,i);let s=!1;this.nodes.length===0?(this.baseLevel=e,e=0,s=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,s=!1);const a=He();let o=((h=a.mindmap)==null?void 0:h.padding)??En.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:Nn(r,a),level:e,descr:Nn(n,a),type:i,children:[],width:((d=a.mindmap)==null?void 0:d.maxNodeWidth)??En.mindmap.maxNodeWidth,padding:o,isRoot:s},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(s)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(de.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=He(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Nn(e.icon,r)),e.class&&(n.class=Nn(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 s=e.level===0?n%(nxr-1):r;this.assignSections(i,s)}}flattenNodes(e,r){const n=He(),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 s=i.join(" "),a=w(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Pf.CIRCLE:return"mindmapCircle";case Pf.RECT:return"rect";case Pf.ROUNDED_RECT:return"rounded";case Pf.CLOUD:return"cloud";case Pf.BANG:return"bang";case Pf.HEXAGON:return"hexagon";case Pf.DEFAULT:return h?"rounded":"defaultMindmapNode";case Pf.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:a(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:s,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=He();for(const i of e.children){let s="edge";i.section!==void 0&&(s+=` section-edge-${i.section}`);const a=e.level+1;s+=` edge-depth-${a}`;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:s,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=He(),i=X3e().layout!==void 0,s=r;if(i||(s.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:s};de.debug("getData: mindmapRoot",e,r),this.assignSections(e);const a=[],o=[];this.flattenNodes(e,a),this.generateEdges(e,o),de.debug(`getData: processed ${a.length} nodes and ${o.length} edges`);const l=new Map;for(const u of a)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:a,edges:o,config:s,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+exr()}}getLogger(){return de}},w(e5,"MindmapDB"),e5),sxr=w(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram -`+t);const i=n.db,s=i.getData(),a=pC(e,s.config.securityLevel);if(s.type=n.type,s.layoutAlgorithm=a7(s.config.layout,{fallback:"cose-bilkent"}),s.diagramId=e,!i.getMindmap())return;s.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 Y3(s,a);const{themeVariables:l}=xr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=a.attr("id"),m=a.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)}Ov(a,((f=s.config.mindmap)==null?void 0:f.padding)??En.mindmap.padding,"mindmapDiagram",((p=s.config.mindmap)==null?void 0:p.useMaxWidth)??En.mindmap.useMaxWidth)},"draw"),axr={draw:sxr},oxr=w(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+G);switch(W[0]){case 1:C.push(G),E.push(D.yytext),A.push(D.yylloc),C.push(W[1]),G=null,L=D.yyleng,_=D.yytext,N=D.yylineno,z=D.yylloc;break;case 2:if(ne=this.productions_[W[1]][1],Z.$=E[E.length-ne],Z._$={first_line:A[A.length-(ne||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(ne||1)].first_column,last_column:A[A.length-1].last_column},$&&(Z._$.range=[A[A.length-(ne||1)].range[0],A[A.length-1].range[1]]),oe=this.performAction.apply(Z,[_,L,N,B.yy,W[1],E,A].concat(O)),typeof oe<"u")return oe;ne&&(C=C.slice(0,-1*ne*2),E=E.slice(0,-1*ne),A=A.slice(0,-1*ne)),C.push(this.productions_[W[1]][0]),E.push(Z.$),A.push(Z._$),ie=R[C[C.length-2]][C[C.length-1]],C.push(ie);break;case 3:return!0}}return!0},"parse")},b=(function(){var w={EOF:1,parseError:x(function(k,C){if(this.yy.parser)this.yy.parser.parseError(k,C);else throw new Error(k)},"parseError"),setInput:x(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:x(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:x(function(T){var k=T.length,C=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 S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var 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:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[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:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),k=new Array(T.length+1).join("-");return T+this.upcomingInput()+` +`+k+"^"},"showPosition"),test_match:x(function(T,k){var C,S,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))),S=T[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+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],C=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var A in E)this[A]=E[A];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,k,C,S;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),A=0;Ak[0].length)){if(k=C,S=A,this.options.backtrack_lexer){if(T=this.test_match(C,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[S]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var k=this.next();return k||this.lex()},"lex"),begin:x(function(k){this.conditionStack.push(k)},"begin"),popState:x(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:x(function(k){this.begin(k)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(k,C,S,E){switch(S){case 0:return k.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:k.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return k.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:k.getLogger().trace("end icon"),this.popState();break;case 10:return k.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return k.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return k.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return k.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:k.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return k.getLogger().trace("description:",C.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),k.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),k.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),k.getLogger().trace("node end ...",C.yytext),"NODE_DEND";case 30:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),k.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),k.getLogger().trace("node end (("),"NODE_DEND";case 35:return k.getLogger().trace("Long description:",C.yytext),20;case 36:return k.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 w})();y.lexer=b;function v(){this.yy={}}return x(v,"Parser"),v.prototype=y,y.Parser=v,new v})();DK.parser=DK;var k6r=DK,S6r=12,Pf={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iv,E6r=(iv=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Pf,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;de.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=He();let o=((h=s.mindmap)==null?void 0:h.padding)??An.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:Dn(r,s),level:e,descr:Dn(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??An.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(de.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=He(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Dn(e.icon,r)),e.class&&(n.class=Dn(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%(S6r-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=He(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Pf.CIRCLE:return"mindmapCircle";case Pf.RECT:return"rect";case Pf.ROUNDED_RECT:return"rounded";case Pf.CLOUD:return"cloud";case Pf.BANG:return"bang";case Pf.HEXAGON:return"hexagon";case Pf.DEFAULT:return h?"rounded":"defaultMindmapNode";case Pf.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=He();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=He(),i=a9e().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};de.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),de.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-"+T6r()}}getLogger(){return de}},x(iv,"MindmapDB"),iv),A6r=x(async(t,e,r,n)=>{var f,p;de.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),s=U9(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=uk(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 Z4(a,s);const{themeVariables:l}=xr(),{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)}P5(s,((f=a.config.mindmap)==null?void 0:f.padding)??An.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??An.mindmap.useMaxWidth)},"draw"),M6r={draw:A6r},R6r=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),I6r=x(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${oxr(t)} + ${R6r(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5319,18 +5452,18 @@ Expecting `+me.join(", ")+", got '"+(this.terminals_[W]||W)+"'":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?lxr(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),uxr=cxr,hxr={get db(){return new ixr},renderer:axr,parser:rxr,styles:uxr};const dxr=Object.freeze(Object.defineProperty({__proto__:null,diagram:hxr},Symbol.toStringTag,{value:"Module"}));var MK=(function(){var t=w(function(k,E,A,M){for(A=A||{},M=k.length;M--;A[k[M]]=E);return A},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],s=[1,16],a=[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],b=[1,6,7,11,13,16,17,20,23],x=[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,R,P,N,L){var I=N.length-1;switch(P){case 6:case 7:return R;case 8:R.getLogger().trace("Stop NL ");break;case 9:R.getLogger().trace("Stop EOF ");break;case 11:R.getLogger().trace("Stop NL2 ");break;case 12:R.getLogger().trace("Stop EOF2 ");break;case 15:R.getLogger().info("Node: ",N[I-1].id),R.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:R.getLogger().info("Node: ",N[I].id),R.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:R.getLogger().trace("Icon: ",N[I]),R.decorateNode({icon:N[I]});break;case 18:case 23:R.decorateNode({class:N[I]});break;case 19:R.getLogger().trace("SPACELIST");break;case 20:R.getLogger().trace("Node: ",N[I-1].id),R.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:R.getLogger().trace("Node: ",N[I].id),R.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:R.decorateNode({icon:N[I]});break;case 27:R.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:R.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:R.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:R.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:s,18:17,19:18,20:a,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:s,18:17,19:18,20:a,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:s,18:17,19:18,20:a,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:a,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:s,18:17,19:18,20:a,23:o},t(m,[2,14],{7:y,11:v}),t(b,[2,8]),t(b,[2,9]),t(b,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:x}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(b,[2,11]),t(b,[2,12]),t(f,[2,15],{24:x}),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],R=[],P=[null],N=[],L=this.table,I="",$=0,O=0,D=2,B=1,z=N.slice.call(arguments,1),V=Object.create(this.lexer),F={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(F.yy[H]=this.yy[H]);V.setInput(E,F.yy),F.yy.lexer=V,F.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var G=V.yylloc;N.push(G);var W=V.options&&V.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(ce){M.length=M.length-2*ce,P.length=P.length-ce,N.length=N.length-ce}w(K,"popStack");function q(){var ce;return ce=R.pop()||V.lex()||B,typeof ce!="number"&&(ce instanceof Array&&(R=ce,ce=R.pop()),ce=A.symbols_[ce]||ce),ce}w(q,"lex");for(var oe,Z,Q,ne,ie={},me,te,_e,$e;;){if(Z=M[M.length-1],this.defaultActions[Z]?Q=this.defaultActions[Z]:((oe===null||typeof oe>"u")&&(oe=q()),Q=L[Z]&&L[Z][oe]),typeof Q>"u"||!Q.length||!Q[0]){var Ve="";$e=[];for(me in L[Z])this.terminals_[me]&&me>D&&$e.push("'"+this.terminals_[me]+"'");V.showPosition?Ve="Parse error on line "+($+1)+`: -`+V.showPosition()+` -Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Ve="Parse error on line "+($+1)+": Unexpected "+(oe==B?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(Ve,{text:V.match,token:this.terminals_[oe]||oe,line:V.yylineno,loc:G,expected:$e})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+oe);switch(Q[0]){case 1:M.push(oe),P.push(V.yytext),N.push(V.yylloc),M.push(Q[1]),oe=null,O=V.yyleng,I=V.yytext,$=V.yylineno,G=V.yylloc;break;case 2:if(te=this.productions_[Q[1]][1],ie.$=P[P.length-te],ie._$={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},W&&(ie._$.range=[N[N.length-(te||1)].range[0],N[N.length-1].range[1]]),ne=this.performAction.apply(ie,[I,O,$,F.yy,Q[1],P,N].concat(z)),typeof ne<"u")return ne;te&&(M=M.slice(0,-1*te*2),P=P.slice(0,-1*te),N=N.slice(0,-1*te)),M.push(this.productions_[Q[1]][0]),P.push(ie.$),N.push(ie._$),_e=L[M[M.length-2]][M[M.length-1]],M.push(_e);break;case 3:return!0}}return!0},"parse")},C=(function(){var k={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 R=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===R.length?this.yylloc.first_column:0)+R[R.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,R,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))),R=E[0].match(/(?:\r\n?|\n).*/g),R&&(this.yylineno+=R.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:R?R[R.length-1].length-R[R.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,R;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),N=0;NA[0].length)){if(A=M,R=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[R]),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,R,P){switch(R){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 k})();T.lexer=C;function S(){this.yy={}}return w(S,"Parser"),S.prototype=T,T.Parser=S,new S})();MK.parser=MK;var fxr=MK,Au=[],Kse=[],RK=0,Zse={},pxr=w(()=>{Au=[],Kse=[],RK=0,Zse={}},"clear"),gxr=w(t=>{if(Au.length===0)return null;const e=Au[0].level;let r=null;for(let n=Au.length-1;n>=0;n--)if(Au[n].level===e&&!r&&(r=Au[n]),Au[n].levelo.parentId===i.id);for(const o of a){const l={id:o.id,parentId:i.id,label:Nn(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:He()}},"getData"),yxr=w((t,e,r,n,i)=>{var u,h;const s=He();let a=((u=s.mindmap)==null?void 0:u.padding)??En.mindmap.padding;switch(n){case Ma.ROUNDED_RECT:case Ma.RECT:case Ma.HEXAGON:a*=2}const o={id:Nn(e,s)||"kbn"+RK++,level:t,label:Nn(r,s),width:((h=s.mindmap)==null?void 0:h.maxNodeWidth)??En.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(i!==void 0){let d;i.includes(` + ${t.useGradient&&r&&t.mainBkg?L6r(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),N6r=I6r,D6r={get db(){return new E6r},renderer:M6r,parser:k6r,styles:N6r};const O6r=Object.freeze(Object.defineProperty({__proto__:null,diagram:D6r},Symbol.toStringTag,{value:"Module"}));var OK=(function(){var t=x(function(C,S,E,A){for(E=E||{},A=C.length;A--;E[C[A]]=S);return E},"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],U=[1,35],y=[1,36],b=[1,6,7,11,13,16,17,20,23],v=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(S,E,A,R,_,N,L){var I=N.length-1;switch(_){case 6:case 7:return R;case 8:R.getLogger().trace("Stop NL ");break;case 9:R.getLogger().trace("Stop EOF ");break;case 11:R.getLogger().trace("Stop NL2 ");break;case 12:R.getLogger().trace("Stop EOF2 ");break;case 15:R.getLogger().info("Node: ",N[I-1].id),R.addNode(N[I-2].length,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 16:R.getLogger().info("Node: ",N[I].id),R.addNode(N[I-1].length,N[I].id,N[I].descr,N[I].type);break;case 17:R.getLogger().trace("Icon: ",N[I]),R.decorateNode({icon:N[I]});break;case 18:case 23:R.decorateNode({class:N[I]});break;case 19:R.getLogger().trace("SPACELIST");break;case 20:R.getLogger().trace("Node: ",N[I-1].id),R.addNode(0,N[I-1].id,N[I-1].descr,N[I-1].type,N[I]);break;case 21:R.getLogger().trace("Node: ",N[I].id),R.addNode(0,N[I].id,N[I].descr,N[I].type);break;case 22:R.decorateNode({icon:N[I]});break;case 27:R.getLogger().trace("node found ..",N[I-2]),this.$={id:N[I-1],descr:N[I-1],type:R.getType(N[I-2],N[I])};break;case 28:this.$={id:N[I],descr:N[I],type:0};break;case 29:R.getLogger().trace("node found ..",N[I-3]),this.$={id:N[I-3],descr:N[I-1],type:R.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:U,11:y}),t(b,[2,8]),t(b,[2,9]),t(b,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:v}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:U,11:y}),t(b,[2,11]),t(b,[2,12]),t(f,[2,15],{24:v}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(S,E){if(E.recoverable)this.trace(S);else{var A=new Error(S);throw A.hash=E,A}},"parseError"),parse:x(function(S){var E=this,A=[0],R=[],_=[null],N=[],L=this.table,I="",P=0,O=0,D=2,B=1,F=N.slice.call(arguments,1),z=Object.create(this.lexer),$={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&($.yy[V]=this.yy[V]);z.setInput(S,$.yy),$.yy.lexer=z,$.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var H=z.yylloc;N.push(H);var G=z.options&&z.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function K(ce){A.length=A.length-2*ce,_.length=_.length-ce,N.length=N.length-ce}x(K,"popStack");function W(){var ce;return ce=R.pop()||z.lex()||B,typeof ce!="number"&&(ce instanceof Array&&(R=ce,ce=R.pop()),ce=E.symbols_[ce]||ce),ce}x(W,"lex");for(var oe,Z,J,ne,ie={},me,te,Re,Pe;;){if(Z=A[A.length-1],this.defaultActions[Z]?J=this.defaultActions[Z]:((oe===null||typeof oe>"u")&&(oe=W()),J=L[Z]&&L[Z][oe]),typeof J>"u"||!J.length||!J[0]){var Ve="";Pe=[];for(me in L[Z])this.terminals_[me]&&me>D&&Pe.push("'"+this.terminals_[me]+"'");z.showPosition?Ve="Parse error on line "+(P+1)+`: +`+z.showPosition()+` +Expecting `+Pe.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Ve="Parse error on line "+(P+1)+": Unexpected "+(oe==B?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(Ve,{text:z.match,token:this.terminals_[oe]||oe,line:z.yylineno,loc:H,expected:Pe})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+oe);switch(J[0]){case 1:A.push(oe),_.push(z.yytext),N.push(z.yylloc),A.push(J[1]),oe=null,O=z.yyleng,I=z.yytext,P=z.yylineno,H=z.yylloc;break;case 2:if(te=this.productions_[J[1]][1],ie.$=_[_.length-te],ie._$={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&&(ie._$.range=[N[N.length-(te||1)].range[0],N[N.length-1].range[1]]),ne=this.performAction.apply(ie,[I,O,P,$.yy,J[1],_,N].concat(F)),typeof ne<"u")return ne;te&&(A=A.slice(0,-1*te*2),_=_.slice(0,-1*te),N=N.slice(0,-1*te)),A.push(this.productions_[J[1]][0]),_.push(ie.$),N.push(ie._$),Re=L[A[A.length-2]][A[A.length-1]],A.push(Re);break;case 3:return!0}}return!0},"parse")},T=(function(){var C={EOF:1,parseError:x(function(E,A){if(this.yy.parser)this.yy.parser.parseError(E,A);else throw new Error(E)},"parseError"),setInput:x(function(S,E){return this.yy=E||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var E=S.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:x(function(S){var E=S.length,A=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var R=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),A.length-1&&(this.yylineno-=A.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:A?(A.length===R.length?this.yylloc.first_column:0)+R[R.length-A.length].length-A[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),E=new Array(S.length+1).join("-");return S+this.upcomingInput()+` +`+E+"^"},"showPosition"),test_match:x(function(S,E){var A,R,_;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))),R=S[0].match(/(?:\r\n?|\n).*/g),R&&(this.yylineno+=R.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:R?R[R.length-1].length-R[R.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,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(S[0].length),this.matched+=S[0],A=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var N in _)this[N]=_[N];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,E,A,R;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),N=0;N<_.length;N++)if(A=this._input.match(this.rules[_[N]]),A&&(!E||A[0].length>E[0].length)){if(E=A,R=N,this.options.backtrack_lexer){if(S=this.test_match(A,_[N]),S!==!1)return S;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(S=this.test_match(E,_[R]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var E=this.next();return E||this.lex()},"lex"),begin:x(function(E){this.conditionStack.push(E)},"begin"),popState:x(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:x(function(E){this.begin(E)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(E,A,R,_){switch(R){case 0:return this.pushState("shapeData"),A.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const N=/\n\s*/g;return A.yytext=A.yytext.replace(N,"
    "),24;case 4:return 24;case 5:this.popState();break;case 6:return E.getLogger().trace("Found comment",A.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:E.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return E.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:E.getLogger().trace("end icon"),this.popState();break;case 16:return E.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return E.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return E.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return E.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:E.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return E.getLogger().trace("description:",A.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),E.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),E.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),E.getLogger().trace("node end ...",A.yytext),"NODE_DEND";case 36:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),E.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),E.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),E.getLogger().trace("node end (("),"NODE_DEND";case 41:return E.getLogger().trace("Long description:",A.yytext),21;case 42:return E.getLogger().trace("Long description:",A.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})();w.lexer=T;function k(){this.yy={}}return x(k,"Parser"),k.prototype=w,w.Parser=k,new k})();OK.parser=OK;var _6r=OK,Eu=[],ise=[],_K=0,ase={},P6r=x(()=>{Eu=[],ise=[],_K=0,ase={}},"clear"),B6r=x(t=>{if(Eu.length===0)return null;const e=Eu[0].level;let r=null;for(let n=Eu.length-1;n>=0;n--)if(Eu[n].level===e&&!r&&(r=Eu[n]),Eu[n].levelo.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Dn(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:He()}},"getData"),F6r=x((t,e,r,n,i)=>{var u,h;const a=He();let s=((u=a.mindmap)==null?void 0:u.padding)??An.mindmap.padding;switch(n){case As.ROUNDED_RECT:case As.RECT:case As.HEXAGON:s*=2}const o={id:Dn(e,a)||"kbn"+_K++,level:t,label:Dn(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??An.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=pD(d,{schema:fD});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=gxr(t);l?o.parentId=l.id||"kbn"+RK++:Kse.push(o),Au.push(o)},"addNode"),Ma={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},vxr=w((t,e)=>{switch(de.debug("In get type",t,e),t){case"[":return Ma.RECT;case"(":return e===")"?Ma.ROUNDED_RECT:Ma.CLOUD;case"((":return Ma.CIRCLE;case")":return Ma.CLOUD;case"))":return Ma.BANG;case"{{":return Ma.HEXAGON;default:return Ma.DEFAULT}},"getType"),bxr=w((t,e)=>{Zse[t]=e},"setElementForId"),xxr=w(t=>{if(!t)return;const e=He(),r=Au[Au.length-1];t.icon&&(r.icon=Nn(t.icon,e)),t.class&&(r.cssClasses=Nn(t.class,e))},"decorateNode"),wxr=w(t=>{switch(t){case Ma.DEFAULT:return"no-border";case Ma.RECT:return"rect";case Ma.ROUNDED_RECT:return"rounded-rect";case Ma.CIRCLE:return"circle";case Ma.CLOUD:return"cloud";case Ma.BANG:return"bang";case Ma.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Txr=w(()=>de,"getLogger"),Cxr=w(t=>Zse[t],"getElementById"),kxr={clear:pxr,addNode:yxr,getSections:uXe,getData:mxr,nodeType:Ma,getType:vxr,setElementForId:bxr,decorateNode:xxr,type2Str:wxr,getLogger:Txr,getElementById:Cxr},Sxr=kxr,Exr=w(async(t,e,r,n)=>{var y,v,b,x,T;de.debug(`Rendering kanban diagram -`+t);const s=n.db.getData(),a=He();a.htmlLabels=!1;const o=al(e);for(const C of s.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=s.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=a==null?void 0:a.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await TD(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((b=a==null?void 0:a.kanban)==null?void 0:b.sectionWidth)||200,E=-k*3/2+g;let A=E;const M=s.nodes.filter(N=>N.parentId===C.id);for(const N of M){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=C.x,N.width=k-1.5*f;const I=(await s7(u,N,{config:a})).node().getBBox();N.y=A+I.height/2,await TL(N),A=N.y+I.height/2+f/2}const R=S.cluster.select("rect"),P=Math.max(A-E+3*f,50)+(g-25);R.attr("height",P)}W3(void 0,o,((x=a.mindmap)==null?void 0:x.padding)??En.kanban.padding,((T=a.mindmap)==null?void 0:T.useMaxWidth)??En.kanban.useMaxWidth)},"draw"),Axr={draw:Exr},Mxr=w(t=>{let e="";for(let n=0;nt.darkMode?ct(n,i):lt(n,i),"adjuster");for(let n=0;n{switch(de.debug("In get type",t,e),t){case"[":return As.RECT;case"(":return e===")"?As.ROUNDED_RECT:As.CLOUD;case"((":return As.CIRCLE;case")":return As.CLOUD;case"))":return As.BANG;case"{{":return As.HEXAGON;default:return As.DEFAULT}},"getType"),V6r=x((t,e)=>{ase[t]=e},"setElementForId"),H6r=x(t=>{if(!t)return;const e=He(),r=Eu[Eu.length-1];t.icon&&(r.icon=Dn(t.icon,e)),t.class&&(r.cssClasses=Dn(t.class,e))},"decorateNode"),G6r=x(t=>{switch(t){case As.DEFAULT:return"no-border";case As.RECT:return"rect";case As.ROUNDED_RECT:return"rounded-rect";case As.CIRCLE:return"circle";case As.CLOUD:return"cloud";case As.BANG:return"bang";case As.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),W6r=x(()=>de,"getLogger"),q6r=x(t=>ase[t],"getElementById"),j6r={clear:P6r,addNode:F6r,getSections:TXe,getData:$6r,nodeType:As,getType:z6r,setElementForId:V6r,decorateNode:H6r,type2Str:G6r,getLogger:W6r,getElementById:q6r},Y6r=j6r,X6r=x(async(t,e,r,n)=>{var U,y,b,v,w;de.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),s=He();s.htmlLabels=!1;const o=sl(e);for(const T of a.nodes)T.domId=`${e}-${T.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(T=>T.isGroup);let d=0;const f=10,p=[];let g=25;for(const T of h){const k=((U=s==null?void 0:s.kanban)==null?void 0:U.sectionWidth)||200;d=d+1,T.x=k*d+(d-1)*f/2,T.width=k,T.y=0,T.height=k*3,T.rx=5,T.ry=5,T.cssClasses=T.cssClasses+" section-"+d;const C=await kO(l,T);g=Math.max(g,(y=C==null?void 0:C.labelBBox)==null?void 0:y.height),p.push(C)}let m=0;for(const T of h){const k=p[m];m=m+1;const C=((b=s==null?void 0:s.kanban)==null?void 0:b.sectionWidth)||200,S=-C*3/2+g;let E=S;const A=a.nodes.filter(N=>N.parentId===T.id);for(const N of A){if(N.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");N.x=T.x,N.width=C-1.5*f;const I=(await ck(u,N,{config:s})).node().getBBox();N.y=E+I.height/2,await SL(N),E=N.y+I.height/2+f/2}const R=k.cluster.select("rect"),_=Math.max(E-S+3*f,50)+(g-25);R.attr("height",_)}j4(void 0,o,((v=s.mindmap)==null?void 0:v.padding)??An.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??An.kanban.useMaxWidth)},"draw"),K6r={draw:X6r},Z6r=x(t=>{let e="";for(let n=0;nt.darkMode?ct(n,i):lt(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),J6r=x(t=>` .edge { stroke-width: 3; } - ${Mxr(t)} + ${Z6r(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -5407,15 +5540,15 @@ Expecting `+$e.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":Ve="Parse erro dominant-baseline: middle; text-align: center; } - ${M7()} -`,"getStyles"),_xr=Rxr,Lxr={db:Sxr,renderer:Axr,parser:fxr,styles:_xr};const Ixr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lxr},Symbol.toStringTag,{value:"Module"}));function Q2e(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 hXe(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 oG(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 Nxr(t){return t.target.depth}function Oxr(t){return t.depth}function Dxr(t,e){return e-1-t.height}function dXe(t,e){return t.sourceLinks.length?t.depth:e-1}function Pxr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?hXe(t.sourceLinks,Nxr)-1:0}function dR(t){return function(){return t}}function J2e(t,e){return sO(t.source,e.source)||t.index-e.index}function ebe(t,e){return sO(t.target,e.target)||t.index-e.index}function sO(t,e){return t.y0-e.y0}function lG(t){return t.value}function $xr(t){return t.index}function Bxr(t){return t.nodes}function Fxr(t){return t.links}function tbe(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function rbe({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 zxr(){let t=0,e=0,r=1,n=1,i=24,s=8,a,o=$xr,l=dXe,u,h,d=Bxr,f=Fxr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),b(I),C(I),rbe(I),I}g.update=function(I){return rbe(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:dR(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:dR(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?(s=a=+I,g):s},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:dR(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:dR(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[D,B]of I.entries())B.index=D,B.sourceLinks=[],B.targetLinks=[];const O=new Map(I.map((D,B)=>[o(D,B,I),D]));for(const[D,B]of $.entries()){B.index=D;let{source:z,target:V}=B;typeof z!="object"&&(z=B.source=tbe(O,z)),typeof V!="object"&&(V=B.target=tbe(O,V)),z.sourceLinks.push(B),V.targetLinks.push(B)}if(h!=null)for(const{sourceLinks:D,targetLinks:B}of I)D.sort(h),B.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(oG($.sourceLinks,lG),oG($.targetLinks,lG)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,B=0;for(;O.size;){for(const z of O){z.depth=B;for(const{target:V}of z.sourceLinks)D.add(V)}if(++B>$)throw new Error("circular link");O=D,D=new Set}}function b({nodes:I}){const $=I.length;let O=new Set(I),D=new Set,B=0;for(;O.size;){for(const z of O){z.height=B;for(const{source:V}of z.targetLinks)D.add(V)}if(++B>$)throw new Error("circular link");O=D,D=new Set}}function x({nodes:I}){const $=Q2e(I,B=>B.depth)+1,O=(r-t-i)/($-1),D=new Array($);for(const B of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,B,$))));B.layer=z,B.x0=t+z*O,B.x1=B.x0+i,D[z]?D[z].push(B):D[z]=[B]}if(u)for(const B of D)B.sort(u);return D}function T(I){const $=hXe(I,O=>(n-e-(O.length-1)*a)/oG(O,lG));for(const O of I){let D=e;for(const B of O){B.y0=D,B.y1=D+B.value*$,D=B.y1+a;for(const z of B.sourceLinks)z.width=z.value*$}D=(n-D+a)/(O.length+1);for(let B=0;BO.length)-1)),T($);for(let O=0;O0))continue;let G=(F/H-V.y0)*$;V.y0+=G,V.y1+=G,R(V)}u===void 0&&z.sort(sO),E(z,O)}}function k(I,$,O){for(let D=I.length,B=D-2;B>=0;--B){const z=I[B];for(const V of z){let F=0,H=0;for(const{target:W,value:K}of V.sourceLinks){let q=K*(W.layer-V.layer);F+=L(V,W)*q,H+=q}if(!(H>0))continue;let G=(F/H-V.y0)*$;V.y0+=G,V.y1+=G,R(V)}u===void 0&&z.sort(sO),E(z,O)}}function E(I,$){const O=I.length>>1,D=I[O];M(I,D.y0-a,O-1,$),A(I,D.y1+a,O+1,$),M(I,n,I.length-1,$),A(I,e,0,$)}function A(I,$,O,D){for(;O1e-6&&(B.y0+=z,B.y1+=z),$=B.y1+a}}function M(I,$,O,D){for(;O>=0;--O){const B=I[O],z=(B.y1-$)*D;z>1e-6&&(B.y0-=z,B.y1-=z),$=B.y0-a}}function R({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(ebe);for(const{target:{targetLinks:O}}of I)O.sort(J2e)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(ebe),O.sort(J2e)}function N(I,$){let O=I.y0-(I.sourceLinks.length-1)*a/2;for(const{target:D,width:B}of I.sourceLinks){if(D===$)break;O+=B+a}for(const{source:D,width:B}of $.targetLinks){if(D===I)break;O-=B}return O}function L(I,$){let O=$.y0-($.targetLinks.length-1)*a/2;for(const{source:D,width:B}of $.targetLinks){if(D===I)break;O+=B+a}for(const{target:D,width:B}of I.sourceLinks){if(D===$)break;O-=B}return O}return g}var _K=Math.PI,LK=2*_K,I1=1e-6,Vxr=LK-I1;function IK(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function fXe(){return new IK}IK.prototype=fXe.prototype={constructor:IK,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,s){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var s=this._x1,a=this._y1,o=r-t,l=n-e,u=s-t,h=a-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>I1)if(!(Math.abs(h*o-l*u)>I1)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-s,p=n-a,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),b=i*Math.tan((_K-Math.acos((g+d-m)/(2*y*v)))/2),x=b/v,T=b/y;Math.abs(x-1)>I1&&(this._+="L"+(t+x*u)+","+(e+x*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,s){t=+t,e=+e,r=+r,s=!!s;var a=r*Math.cos(n),o=r*Math.sin(n),l=t+a,u=e+o,h=1^s,d=s?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)>I1||Math.abs(this._y1-u)>I1)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%LK+LK),d>Vxr?this._+="A"+r+","+r+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>I1&&(this._+="A"+r+","+r+",0,"+ +(d>=_K)+","+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 nbe(t){return function(){return t}}function Hxr(t){return t[0]}function Gxr(t){return t[1]}var Wxr=Array.prototype.slice;function qxr(t){return t.source}function Uxr(t){return t.target}function jxr(t){var e=qxr,r=Uxr,n=Hxr,i=Gxr,s=null;function a(){var o,l=Wxr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(s||(s=o=fXe()),t(s,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(e=o,a):e},a.target=function(o){return arguments.length?(r=o,a):r},a.x=function(o){return arguments.length?(n=typeof o=="function"?o:nbe(+o),a):n},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:nbe(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Yxr(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function Xxr(){return jxr(Yxr)}function Kxr(t){return[t.source.x1,t.y0]}function Zxr(t){return[t.target.x0,t.y1]}function Qxr(){return Xxr().source(Kxr).target(Zxr)}var NK=(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('""','"')),b=parseFloat(p[m].trim());d.addLink(y,v,b);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,b=2,x=1,T=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var A=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(F){h.length=h.length-2*F,f.length=f.length-F,p.length=p.length-F}w(M,"popStack");function R(){var F;return F=d.pop()||C.lex()||x,typeof F!="number"&&(F instanceof Array&&(d=F,F=d.pop()),F=u.symbols_[F]||F),F}w(R,"lex");for(var P,N,L,I,$={},O,D,B,z;;){if(N=h[h.length-1],this.defaultActions[N]?L=this.defaultActions[N]:((P===null||typeof P>"u")&&(P=R()),L=g[N]&&g[N][P]),typeof L>"u"||!L.length||!L[0]){var V="";z=[];for(O in g[N])this.terminals_[O]&&O>b&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`: -`+C.showPosition()+` -Expecting `+z.join(", ")+", got '"+(this.terminals_[P]||P)+"'":V="Parse error on line "+(y+1)+": Unexpected "+(P==x?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(V,{text:C.match,token:this.terminals_[P]||P,line:C.yylineno,loc:E,expected:z})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+P);switch(L[0]){case 1:h.push(P),f.push(C.yytext),p.push(C.yylloc),h.push(L[1]),P=null,v=C.yyleng,m=C.yytext,y=C.yylineno,E=C.yylloc;break;case 2:if(D=this.productions_[L[1]][1],$.$=f[f.length-D],$._$={first_line:p[p.length-(D||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(D||1)].first_column,last_column:p[p.length-1].last_column},A&&($._$.range=[p[p.length-(D||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply($,[m,v,y,S.yy,L[1],f,p].concat(T)),typeof I<"u")return I;D&&(h=h.slice(0,-1*D*2),f=f.slice(0,-1*D),p=p.slice(0,-1*D)),h.push(this.productions_[L[1]][0]),f.push($.$),p.push($._$),B=g[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},s=(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=s;function a(){this.yy={}}return w(a,"Parser"),a.prototype=i,i.Parser=a,new a})();NK.parser=NK;var aO=NK,uB=[],hB=[],oO=new Map,Jxr=w(()=>{uB=[],hB=[],oO=new Map,Oi()},"clear"),t5,ewr=(t5=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},w(t5,"SankeyLink"),t5),twr=w((t,e,r)=>{uB.push(new ewr(t,e,r))},"addLink"),r5,rwr=(r5=class{constructor(e){this.ID=e}},w(r5,"SankeyNode"),r5),nwr=w(t=>{t=Gt.sanitizeText(t,He());let e=oO.get(t);return e===void 0&&(e=new rwr(t),oO.set(t,e),hB.push(e)),e},"findOrCreateNode"),iwr=w(()=>hB,"getNodes"),swr=w(()=>uB,"getLinks"),awr=w(()=>({nodes:hB.map(t=>({id:t.ID})),links:uB.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),owr={nodesMap:oO,getConfig:w(()=>He().sankey,"getConfig"),getNodes:iwr,getLinks:swr,getGraph:awr,addLink:twr,findOrCreateNode:nwr,getAccTitle:ns,setAccTitle:qi,getAccDescription:ss,setAccDescription:is,getDiagramTitle:ji,setDiagramTitle:ts,clear:Jxr},d0,ibe=(d0=class{static next(e){return new d0(e+ ++d0.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},w(d0,"Uid"),d0.count=0,d0),lwr={left:Oxr,right:Dxr,center:Pxr,justify:dXe},cwr=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"),uwr=w(function(t,e,r,n){const{securityLevel:i,sankey:s}=He(),a=rCe.sankey;let o;i==="sandbox"&&(o=xt("#i"+e));const l=xt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):xt(`[id="${e}"]`),h=(s==null?void 0:s.width)??a.width,d=(s==null?void 0:s.height)??a.width,f=(s==null?void 0:s.useMaxWidth)??a.useMaxWidth,p=(s==null?void 0:s.nodeAlignment)??a.nodeAlignment,g=(s==null?void 0:s.prefix)??a.prefix,m=(s==null?void 0:s.suffix)??a.suffix,y=(s==null?void 0:s.showValues)??a.showValues,v=(s==null?void 0:s.nodeWidth)??a.nodeWidth??10,b=(s==null?void 0:s.nodePadding)??a.nodePadding??12,x=(s==null?void 0:s.labelStyle)??a.labelStyle??"legacy",T=(s==null?void 0:s.nodeColors)??{},C=n.db.getGraph(),S=lwr[p];zxr().nodeId(D=>D.id).nodeWidth(v).nodePadding(b+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=cwr(C.nodes),A=Ey(R5t),M=w(D=>T[D]??A(D),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",D=>(D.uid=ibe.next("node-")).id).attr("transform",function(D){return"translate("+D.x0+","+D.y0+")"}).attr("x",D=>D.x0).attr("y",D=>D.y0).append("rect").attr("height",D=>D.y1-D.y0).attr("width",D=>D.x1-D.x0).attr("fill",D=>M(D.id));const R=w(({id:D,value:B})=>y?`${D} -${g}${Math.round(B*100)/100}${m}`:D,"getText"),P=w(D=>x==="outlined"?(D.layer??0)N.selectAll(D?`.${D}`:"text").data(C.nodes).join("text").attr("class",D??null).attr("x",B=>P(B).x).attr("y",B=>(B.y1+B.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",B=>P(B).anchor).text(R),"appendLabel");x==="outlined"?(L("sankey-label-bg"),L("sankey-label-fg")):L();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(s==null?void 0:s.linkColor)??"gradient";if($==="gradient"){const D=I.append("linearGradient").attr("id",B=>(B.uid=ibe.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",B=>B.source.x1).attr("x2",B=>B.target.x0);D.append("stop").attr("offset","0%").attr("stop-color",B=>M(B.source.id)),D.append("stop").attr("offset","100%").attr("stop-color",B=>M(B.target.id))}let O;switch($){case"gradient":O=w(D=>D.uid,"coloring");break;case"source":O=w(D=>M(D.source.id),"coloring");break;case"target":O=w(D=>M(D.target.id),"coloring");break;default:O=$}I.append("path").attr("d",Qxr()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),W3(void 0,u,0,f)},"draw"),hwr={draw:uwr},dwr=w(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),fwr=w(t=>`.label { + ${Lk()} +`,"getStyles"),Q6r=J6r,ebr={db:Y6r,renderer:K6r,parser:_6r,styles:Q6r};const tbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:ebr},Symbol.toStringTag,{value:"Module"}));function lye(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 CXe(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 dH(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 rbr(t){return t.target.depth}function nbr(t){return t.depth}function ibr(t,e){return e-1-t.height}function kXe(t,e){return t.sourceLinks.length?t.depth:e-1}function abr(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?CXe(t.sourceLinks,rbr)-1:0}function gA(t){return function(){return t}}function cye(t,e){return lD(t.source,e.source)||t.index-e.index}function uye(t,e){return lD(t.target,e.target)||t.index-e.index}function lD(t,e){return t.y0-e.y0}function fH(t){return t.value}function sbr(t){return t.index}function obr(t){return t.nodes}function lbr(t){return t.links}function hye(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function dye({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 cbr(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=sbr,l=kXe,u,h,d=obr,f=lbr,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),U(I),y(I),b(I),T(I),dye(I),I}g.update=function(I){return dye(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:gA(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:gA(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:gA(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:gA(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:P}){for(const[D,B]of I.entries())B.index=D,B.sourceLinks=[],B.targetLinks=[];const O=new Map(I.map((D,B)=>[o(D,B,I),D]));for(const[D,B]of P.entries()){B.index=D;let{source:F,target:z}=B;typeof F!="object"&&(F=B.source=hye(O,F)),typeof z!="object"&&(z=B.target=hye(O,z)),F.sourceLinks.push(B),z.targetLinks.push(B)}if(h!=null)for(const{sourceLinks:D,targetLinks:B}of I)D.sort(h),B.sort(h)}function U({nodes:I}){for(const P of I)P.value=P.fixedValue===void 0?Math.max(dH(P.sourceLinks,fH),dH(P.targetLinks,fH)):P.fixedValue}function y({nodes:I}){const P=I.length;let O=new Set(I),D=new Set,B=0;for(;O.size;){for(const F of O){F.depth=B;for(const{target:z}of F.sourceLinks)D.add(z)}if(++B>P)throw new Error("circular link");O=D,D=new Set}}function b({nodes:I}){const P=I.length;let O=new Set(I),D=new Set,B=0;for(;O.size;){for(const F of O){F.height=B;for(const{source:z}of F.targetLinks)D.add(z)}if(++B>P)throw new Error("circular link");O=D,D=new Set}}function v({nodes:I}){const P=lye(I,B=>B.depth)+1,O=(r-t-i)/(P-1),D=new Array(P);for(const B of I){const F=Math.max(0,Math.min(P-1,Math.floor(l.call(null,B,P))));B.layer=F,B.x0=t+F*O,B.x1=B.x0+i,D[F]?D[F].push(B):D[F]=[B]}if(u)for(const B of D)B.sort(u);return D}function w(I){const P=CXe(I,O=>(n-e-(O.length-1)*s)/dH(O,fH));for(const O of I){let D=e;for(const B of O){B.y0=D,B.y1=D+B.value*P,D=B.y1+s;for(const F of B.sourceLinks)F.width=F.value*P}D=(n-D+s)/(O.length+1);for(let B=0;BO.length)-1)),w(P);for(let O=0;O0))continue;let H=($/V-z.y0)*P;z.y0+=H,z.y1+=H,R(z)}u===void 0&&F.sort(lD),S(F,O)}}function C(I,P,O){for(let D=I.length,B=D-2;B>=0;--B){const F=I[B];for(const z of F){let $=0,V=0;for(const{target:G,value:K}of z.sourceLinks){let W=K*(G.layer-z.layer);$+=L(z,G)*W,V+=W}if(!(V>0))continue;let H=($/V-z.y0)*P;z.y0+=H,z.y1+=H,R(z)}u===void 0&&F.sort(lD),S(F,O)}}function S(I,P){const O=I.length>>1,D=I[O];A(I,D.y0-s,O-1,P),E(I,D.y1+s,O+1,P),A(I,n,I.length-1,P),E(I,e,0,P)}function E(I,P,O,D){for(;O1e-6&&(B.y0+=F,B.y1+=F),P=B.y1+s}}function A(I,P,O,D){for(;O>=0;--O){const B=I[O],F=(B.y1-P)*D;F>1e-6&&(B.y0-=F,B.y1-=F),P=B.y0-s}}function R({sourceLinks:I,targetLinks:P}){if(h===void 0){for(const{source:{sourceLinks:O}}of P)O.sort(uye);for(const{target:{targetLinks:O}}of I)O.sort(cye)}}function _(I){if(h===void 0)for(const{sourceLinks:P,targetLinks:O}of I)P.sort(uye),O.sort(cye)}function N(I,P){let O=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:D,width:B}of I.sourceLinks){if(D===P)break;O+=B+s}for(const{source:D,width:B}of P.targetLinks){if(D===I)break;O-=B}return O}function L(I,P){let O=P.y0-(P.targetLinks.length-1)*s/2;for(const{source:D,width:B}of P.targetLinks){if(D===I)break;O+=B+s}for(const{target:D,width:B}of I.sourceLinks){if(D===P)break;O-=B}return O}return g}var PK=Math.PI,BK=2*PK,Om=1e-6,ubr=BK-Om;function $K(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function SXe(){return new $K}$K.prototype=SXe.prototype={constructor:$K,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>Om)if(!(Math.abs(h*o-l*u)>Om)||!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,U=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((PK-Math.acos((g+d-m)/(2*U*y)))/2),v=b/y,w=b/U;Math.abs(v-1)>Om&&(this._+="L"+(t+v*u)+","+(e+v*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Om||Math.abs(this._y1-u)>Om)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%BK+BK),d>ubr?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>Om&&(this._+="A"+r+","+r+",0,"+ +(d>=PK)+","+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 fye(t){return function(){return t}}function hbr(t){return t[0]}function dbr(t){return t[1]}var fbr=Array.prototype.slice;function pbr(t){return t.source}function gbr(t){return t.target}function mbr(t){var e=pbr,r=gbr,n=hbr,i=dbr,a=null;function s(){var o,l=fbr.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=SXe()),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:fye(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:fye(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function Ubr(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function ybr(){return mbr(Ubr)}function bbr(t){return[t.source.x1,t.y0]}function vbr(t){return[t.target.x0,t.y1]}function xbr(){return ybr().source(bbr).target(vbr)}var FK=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const U=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),y=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),b=parseFloat(p[m].trim());d.addLink(U,y,b);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",U=0,y=0,b=2,v=1,w=p.slice.call(arguments,1),T=Object.create(this.lexer),k={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(k.yy[C]=this.yy[C]);T.setInput(l,k.yy),k.yy.lexer=T,k.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var S=T.yylloc;p.push(S);var E=T.options&&T.options.ranges;typeof k.yy.parseError=="function"?this.parseError=k.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function A($){h.length=h.length-2*$,f.length=f.length-$,p.length=p.length-$}x(A,"popStack");function R(){var $;return $=d.pop()||T.lex()||v,typeof $!="number"&&($ instanceof Array&&(d=$,$=d.pop()),$=u.symbols_[$]||$),$}x(R,"lex");for(var _,N,L,I,P={},O,D,B,F;;){if(N=h[h.length-1],this.defaultActions[N]?L=this.defaultActions[N]:((_===null||typeof _>"u")&&(_=R()),L=g[N]&&g[N][_]),typeof L>"u"||!L.length||!L[0]){var z="";F=[];for(O in g[N])this.terminals_[O]&&O>b&&F.push("'"+this.terminals_[O]+"'");T.showPosition?z="Parse error on line "+(U+1)+`: +`+T.showPosition()+` +Expecting `+F.join(", ")+", got '"+(this.terminals_[_]||_)+"'":z="Parse error on line "+(U+1)+": Unexpected "+(_==v?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(z,{text:T.match,token:this.terminals_[_]||_,line:T.yylineno,loc:S,expected:F})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+_);switch(L[0]){case 1:h.push(_),f.push(T.yytext),p.push(T.yylloc),h.push(L[1]),_=null,y=T.yyleng,m=T.yytext,U=T.yylineno,S=T.yylloc;break;case 2:if(D=this.productions_[L[1]][1],P.$=f[f.length-D],P._$={first_line:p[p.length-(D||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(D||1)].first_column,last_column:p[p.length-1].last_column},E&&(P._$.range=[p[p.length-(D||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply(P,[m,y,U,k.yy,L[1],f,p].concat(w)),typeof I<"u")return I;D&&(h=h.slice(0,-1*D*2),f=f.slice(0,-1*D),p=p.slice(0,-1*D)),h.push(this.productions_[L[1]][0]),f.push(P.$),p.push(P._$),B=g[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pu[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();FK.parser=FK;var cD=FK,fB=[],pB=[],uD=new Map,wbr=x(()=>{fB=[],pB=[],uD=new Map,Oi()},"clear"),av,Tbr=(av=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(av,"SankeyLink"),av),Cbr=x((t,e,r)=>{fB.push(new Tbr(t,e,r))},"addLink"),sv,kbr=(sv=class{constructor(e){this.ID=e}},x(sv,"SankeyNode"),sv),Sbr=x(t=>{t=Ht.sanitizeText(t,He());let e=uD.get(t);return e===void 0&&(e=new kbr(t),uD.set(t,e),pB.push(e)),e},"findOrCreateNode"),Ebr=x(()=>pB,"getNodes"),Abr=x(()=>fB,"getLinks"),Mbr=x(()=>({nodes:pB.map(t=>({id:t.ID})),links:fB.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),Rbr={nodesMap:uD,getConfig:x(()=>He().sankey,"getConfig"),getNodes:Ebr,getLinks:Abr,getGraph:Mbr,addLink:Cbr,findOrCreateNode:Sbr,getAccTitle:ia,setAccTitle:qi,getAccDescription:sa,setAccDescription:aa,getDiagramTitle:Yi,setDiagramTitle:ra,clear:wbr},f0,pye=(f0=class{static next(e){return new f0(e+ ++f0.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(f0,"Uid"),f0.count=0,f0),Lbr={left:nbr,right:ibr,center:abr,justify:kXe},Ibr=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),Nbr=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=He(),s=d9e.sankey;let o;i==="sandbox"&&(o=vt("#i"+e));const l=vt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):vt(`[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,U=(a==null?void 0:a.showValues)??s.showValues,y=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,b=(a==null?void 0:a.nodePadding)??s.nodePadding??12,v=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},T=n.db.getGraph(),k=Lbr[p];cbr().nodeId(D=>D.id).nodeWidth(y).nodePadding(b+(U?15:0)).nodeAlign(k).extent([[0,0],[h,d]])(T);const S=Ibr(T.nodes),E=MU(i4t),A=x(D=>w[D]??E(D),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",D=>(D.uid=pye.next("node-")).id).attr("transform",function(D){return"translate("+D.x0+","+D.y0+")"}).attr("x",D=>D.x0).attr("y",D=>D.y0).append("rect").attr("height",D=>D.y1-D.y0).attr("width",D=>D.x1-D.x0).attr("fill",D=>A(D.id));const R=x(({id:D,value:B})=>U?`${D} +${g}${Math.round(B*100)/100}${m}`:D,"getText"),_=x(D=>v==="outlined"?(D.layer??0)N.selectAll(D?`.${D}`:"text").data(T.nodes).join("text").attr("class",D??null).attr("x",B=>_(B).x).attr("y",B=>(B.y1+B.y0)/2).attr("dy",`${U?"0":"0.35"}em`).attr("text-anchor",B=>_(B).anchor).text(R),"appendLabel");v==="outlined"?(L("sankey-label-bg"),L("sankey-label-fg")):L();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),P=(a==null?void 0:a.linkColor)??"gradient";if(P==="gradient"){const D=I.append("linearGradient").attr("id",B=>(B.uid=pye.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",B=>B.source.x1).attr("x2",B=>B.target.x0);D.append("stop").attr("offset","0%").attr("stop-color",B=>A(B.source.id)),D.append("stop").attr("offset","100%").attr("stop-color",B=>A(B.target.id))}let O;switch(P){case"gradient":O=x(D=>D.uid,"coloring");break;case"source":O=x(D=>A(D.source.id),"coloring");break;case"target":O=x(D=>A(D.target.id),"coloring");break;default:O=P}I.append("path").attr("d",xbr()).attr("stroke",O).attr("stroke-width",D=>Math.max(1,D.width)),j4(void 0,u,0,f)},"draw"),Dbr={draw:Nbr},Obr=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),_br=x(t=>`.label { font-family: ${t.fontFamily}; } @@ -5447,7 +5580,7 @@ ${g}${Math.round(B*100)/100}${m}`:D,"getText"),P=w(D=>x==="outlined"?(D.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),pwr=fwr,gwr=aO.parse.bind(aO);aO.parse=t=>gwr(dwr(t));var mwr={styles:pwr,parser:aO,db:owr,renderer:hwr};const ywr=Object.freeze(Object.defineProperty({__proto__:null,diagram:mwr},Symbol.toStringTag,{value:"Module"}));var vwr=En.packet,n5,pXe=(n5=class{constructor(){this.packet=[],this.setAccTitle=qi,this.getAccTitle=ns,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getAccDescription=ss,this.setAccDescription=is}getConfig(){const e=rs({...vwr,...xr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Oi(),this.packet=[]}},w(n5,"PacketDB"),n5),bwr=1e4,xwr=w((t,e)=>{ec(t,e);let r=-1,n=[],i=1;const{bitsPerRow:s}=e.getConfig();for(let{start:a,end:o,bits:l,label:u}of t.blocks){if(a!==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"),gXe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await Ju("packet",t),r=(n=gXe.parser)==null?void 0:n.yy;if(!(r instanceof pXe))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.");de.debug(e),xwr(e,r)},"parse")},Twr=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:l,bitsPerRow:u}=s,h=i.getPacket(),d=i.getDiagramTitle(),f=a+o,p=f*(h.length+1)-(d?0:a),g=l*u+2,m=al(e);m.attr("viewBox",`0 0 ${g} ${p}`),qs(m,p,g,s.useMaxWidth);for(const[y,v]of h.entries())Cwr(m,v,y,s);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"),Cwr=w((t,e,r,{rowHeight:n,paddingX:i,paddingY:s,bitWidth:a,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+s)+s;for(const d of e){const f=d.start%o*a+1,p=(d.end-d.start+1)*a-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"),kwr={draw:Twr},Swr={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Ewr=w(({packet:t}={})=>{const e=rs(Swr,t);return` +`,"getStyles"),Pbr=_br,Bbr=cD.parse.bind(cD);cD.parse=t=>Bbr(Obr(t));var $br={styles:Pbr,parser:cD,db:Rbr,renderer:Dbr};const Fbr=Object.freeze(Object.defineProperty({__proto__:null,diagram:$br},Symbol.toStringTag,{value:"Module"}));var zbr=An.packet,ov,EXe=(ov=class{constructor(){this.packet=[],this.setAccTitle=qi,this.getAccTitle=ia,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getAccDescription=sa,this.setAccDescription=aa}getConfig(){const e=na({...zbr,...xr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Oi(),this.packet=[]}},x(ov,"PacketDB"),ov),Vbr=1e4,Hbr=x((t,e)=>{ec(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"),AXe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qu("packet",t),r=(n=AXe.parser)==null?void 0:n.yy;if(!(r instanceof EXe))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.");de.debug(e),Hbr(e,r)},"parse")},Wbr=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=sl(e);m.attr("viewBox",`0 0 ${g} ${p}`),Ga(m,p,g,a.useMaxWidth);for(const[U,y]of h.entries())qbr(m,y,U,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"),qbr=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),jbr={draw:Wbr},Ybr={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Xbr=x(({packet:t}={})=>{const e=na(Ybr,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -5470,7 +5603,7 @@ ${g}${Math.round(B*100)/100}${m}`:D,"getText"),P=w(D=>x==="outlined"?(D.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),Awr={parser:gXe,get db(){return new pXe},renderer:kwr,styles:Ewr};const Mwr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Awr},Symbol.toStringTag,{value:"Module"}));var wb={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},fR=32,mXe={axes:[],curves:[],options:wb},Pd=structuredClone(mXe),Rwr=En.radar,_wr=w(()=>rs({...Rwr,...xr().radar}),"getConfig"),yXe=w(()=>Pd.axes,"getAxes"),Lwr=w(()=>Pd.curves,"getCurves"),Iwr=w(()=>Pd.options,"getOptions"),Nwr=w(t=>{Pd.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),Owr=w(t=>{Pd.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:Dwr(e.entries)}))},"setCurves"),Dwr=w(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=yXe();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 s;return((s=i.axis)==null?void 0:s.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),Pwr=w(t=>{var r,n,i,s,a;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Pd.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??wb.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??wb.ticks,max:((i=e.max)==null?void 0:i.value)??wb.max,min:((s=e.min)==null?void 0:s.value)??wb.min,graticule:((a=e.graticule)==null?void 0:a.value)??wb.graticule},Pd.options.ticks>fR&&(de.warn(`Radar diagram ticks (${Pd.options.ticks}) exceeds maximum allowed (${fR}). Using ${fR} instead.`),Pd.options.ticks=fR)},"setOptions"),$wr=w(()=>{Oi(),Pd=structuredClone(mXe)},"clear"),bS={getAxes:yXe,getCurves:Lwr,getOptions:Iwr,setAxes:Nwr,setCurves:Owr,setOptions:Pwr,getConfig:_wr,clear:$wr,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is},Bwr=w(t=>{ec(t,bS);const{axes:e,curves:r,options:n}=t;bS.setAxes(e),bS.setCurves(r),bS.setOptions(n)},"populate"),Fwr={parse:w(async t=>{const e=await Ju("radar",t);de.debug(e),Bwr(e)},"parse")},zwr=w((t,e,r,n)=>{const i=n.db,s=i.getAxes(),a=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=al(e),d=Vwr(h,l),f=o.max??Math.max(...a.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;Hwr(d,s,g,o.ticks,o.graticule),Gwr(d,s,g,l),vXe(d,s,a,p,f,o.graticule,l),wXe(d,a,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),Vwr=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 qs(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"),Hwr=w((t,e,r,n,i)=>{if(i==="circle")for(let s=0;s{const d=2*h*Math.PI/s-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"),Gwr=w((t,e,r,n)=>{const i=e.length;for(let s=0;s.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(a).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 vXe(t,e,r,n,i,s,a){const o=e.length,l=Math.min(a.width,a.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=bXe(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});s==="circle"?t.append("path").attr("d",xXe(d,a.curveTension)).attr("class",`radarCurve-${h}`):s==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}w(vXe,"drawCurves");function bXe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}w(bXe,"relativeRadius");function xXe(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}, ${s+l*a})`);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(wXe,"drawLegend");var Wwr={draw:zwr},qwr=w((t,e)=>{let r="";for(let n=0;nna({...Jbr,...xr().radar}),"getConfig"),RXe=x(()=>Pd.axes,"getAxes"),e7r=x(()=>Pd.curves,"getCurves"),t7r=x(()=>Pd.options,"getOptions"),r7r=x(t=>{Pd.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),n7r=x(t=>{Pd.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:i7r(e.entries)}))},"setCurves"),i7r=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=RXe();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"),a7r=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Pd.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??Cy.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??Cy.ticks,max:((i=e.max)==null?void 0:i.value)??Cy.max,min:((a=e.min)==null?void 0:a.value)??Cy.min,graticule:((s=e.graticule)==null?void 0:s.value)??Cy.graticule},Pd.options.ticks>mA&&(de.warn(`Radar diagram ticks (${Pd.options.ticks}) exceeds maximum allowed (${mA}). Using ${mA} instead.`),Pd.options.ticks=mA)},"setOptions"),s7r=x(()=>{Oi(),Pd=structuredClone(MXe)},"clear"),Tx={getAxes:RXe,getCurves:e7r,getOptions:t7r,setAxes:r7r,setCurves:n7r,setOptions:a7r,getConfig:Qbr,clear:s7r,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa},o7r=x(t=>{ec(t,Tx);const{axes:e,curves:r,options:n}=t;Tx.setAxes(e),Tx.setCurves(r),Tx.setOptions(n)},"populate"),l7r={parse:x(async t=>{const e=await Qu("radar",t);de.debug(e),o7r(e)},"parse")},c7r=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=sl(e),d=u7r(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;h7r(d,a,g,o.ticks,o.graticule),d7r(d,a,g,l),LXe(d,a,s,p,f,o.graticule,l),DXe(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),u7r=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Ga(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"),h7r=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),d7r=x((t,e,r,n)=>{const i=e.length;for(let a=0;a.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function LXe(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=IXe(f,n,i,l),U=m*Math.cos(g),y=m*Math.sin(g);return{x:U,y}});a==="circle"?t.append("path").attr("d",NXe(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(LXe,"drawCurves");function IXe(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x(IXe,"relativeRadius");function NXe(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(DXe,"drawLegend");var f7r={draw:c7r},p7r=x((t,e)=>{let r="";for(let n=0;nx==="outlined"?(D.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),Uwr=w(t=>{const e=rp(),r=xr(),n=rs(e,r.themeVariables),i=rs(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),jwr=w(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=Uwr(t);return` + `}return r},"genIndexStyles"),g7r=x(t=>{const e=np(),r=xr(),n=na(e,r.themeVariables),i=na(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),m7r=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=g7r(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -5509,13 +5642,13 @@ ${g}${Math.round(B*100)/100}${m}`:D,"getText"),P=w(D=>x==="outlined"?(D.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${qwr(e,r)} - `},"styles"),Ywr={parser:Fwr,db:bS,renderer:Wwr,styles:jwr};const Xwr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ywr},Symbol.toStringTag,{value:"Module"}));var OK=(function(){var t=w(function(x,T,C,S){for(C=C||{},S=x.length;S--;C[x[S]]=T);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],s=[1,19],a=[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,C,S,k,E,A,M){var R=A.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",A[R-1]),k.setHierarchy(A[R-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",A[R]),typeof A[R].length=="number"?this.$=A[R]:this.$=[A[R]];break;case 13:k.getLogger().debug("Rule: statement #2: ",A[R-1]),this.$=[A[R-1]].concat(A[R]);break;case 14:k.getLogger().debug("Rule: link: ",A[R],T),this.$={edgeTypeStr:A[R],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",A[R-3],A[R-1],A[R]),this.$={edgeTypeStr:A[R],label:A[R-1]};break;case 18:const P=parseInt(A[R]),N=k.generateId();this.$={id:N,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",A[R-2],A[R-1],A[R]," typestr: ",A[R-1].edgeTypeStr);const L=k.edgeStrToEdgeData(A[R-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(A[R-1].edgeTypeStr),$=k.edgeStrToThickness(A[R-1].edgeTypeStr),O=k.edgeStrToPattern(A[R-1].edgeTypeStr);this.$=[{id:A[R-2].id,label:A[R-2].label,type:A[R-2].type,directions:A[R-2].directions},{id:A[R-2].id+"-"+A[R].id,start:A[R-2].id,end:A[R].id,label:A[R-1].label,type:"edge",thickness:$,pattern:O,directions:A[R].directions,arrowTypeEnd:L,arrowTypeStart:I},{id:A[R].id,label:A[R].label,type:k.typeStr2Type(A[R].typeStr),directions:A[R].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",A[R-1],A[R]),this.$={id:A[R-1].id,label:A[R-1].label,type:k.typeStr2Type(A[R-1].typeStr),directions:A[R-1].directions,widthInColumns:parseInt(A[R],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",A[R]),this.$={id:A[R].id,label:A[R].label,type:k.typeStr2Type(A[R].typeStr),directions:A[R].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",A[R]),this.$={type:"column-setting",columns:A[R]==="auto"?-1:parseInt(A[R])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",A[R-2],A[R-1]),k.generateId(),this.$={...A[R-2],type:"composite",children:A[R-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",A[R-2],A[R-1],A[R]);const D=k.generateId();this.$={id:D,type:"composite",label:"",children:A[R-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",A[R]),this.$={id:A[R]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",A[R-1],A[R]),this.$={id:A[R-1],label:A[R].label,typeStr:A[R].typeStr,directions:A[R].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",A[R]),this.$=[A[R]];break;case 32:k.getLogger().debug("Rule: dirList: ",A[R-1],A[R]),this.$=[A[R-1]].concat(A[R]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",A[R-2],A[R-1],A[R]),this.$={typeStr:A[R-2]+A[R],label:A[R-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",A[R-3],A[R-2]," #3:",A[R-1],A[R]),this.$={typeStr:A[R-3]+A[R],label:A[R-2],directions:A[R-1]};break;case 35:case 36:this.$={type:"classDef",id:A[R-1].trim(),css:A[R].trim()};break;case 37:this.$={type:"applyClass",id:A[R-1].trim(),styleClass:A[R].trim()};break;case 38:this.$={type:"applyStyles",id:A[R-1].trim(),stylesStr:A[R].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:s,39:a,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:s,39:a,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:s},{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:s,39:a,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:s},{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:s,39:a,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,C){if(C.recoverable)this.trace(T);else{var S=new Error(T);throw S.hash=C,S}},"parseError"),parse:w(function(T){var C=this,S=[0],k=[],E=[null],A=[],M=this.table,R="",P=0,N=0,L=2,I=1,$=A.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(D.yy[B]=this.yy[B]);O.setInput(T,D.yy),D.yy.lexer=O,D.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;A.push(z);var V=O.options&&O.options.ranges;typeof D.yy.parseError=="function"?this.parseError=D.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(te){S.length=S.length-2*te,E.length=E.length-te,A.length=A.length-te}w(F,"popStack");function H(){var te;return te=k.pop()||O.lex()||I,typeof te!="number"&&(te instanceof Array&&(k=te,te=k.pop()),te=C.symbols_[te]||te),te}w(H,"lex");for(var G,W,K,q,oe={},Z,Q,ne,ie;;){if(W=S[S.length-1],this.defaultActions[W]?K=this.defaultActions[W]:((G===null||typeof G>"u")&&(G=H()),K=M[W]&&M[W][G]),typeof K>"u"||!K.length||!K[0]){var me="";ie=[];for(Z in M[W])this.terminals_[Z]&&Z>L&&ie.push("'"+this.terminals_[Z]+"'");O.showPosition?me="Parse error on line "+(P+1)+`: + ${p7r(e,r)} + `},"styles"),U7r={parser:l7r,db:Tx,renderer:f7r,styles:m7r};const y7r=Object.freeze(Object.defineProperty({__proto__:null,diagram:U7r},Symbol.toStringTag,{value:"Module"}));var zK=(function(){var t=x(function(v,w,T,k){for(T=T||{},k=v.length;k--;T[v[k]]=w);return T},"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],U={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,T,k,C,S,E,A){var R=E.length-1;switch(S){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: ",E[R-1]),C.setHierarchy(E[R-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: ",E[R]),typeof E[R].length=="number"?this.$=E[R]:this.$=[E[R]];break;case 13:C.getLogger().debug("Rule: statement #2: ",E[R-1]),this.$=[E[R-1]].concat(E[R]);break;case 14:C.getLogger().debug("Rule: link: ",E[R],w),this.$={edgeTypeStr:E[R],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",E[R-3],E[R-1],E[R]),this.$={edgeTypeStr:E[R],label:E[R-1]};break;case 18:const _=parseInt(E[R]),N=C.generateId();this.$={id:N,type:"space",label:"",width:_,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",E[R-2],E[R-1],E[R]," typestr: ",E[R-1].edgeTypeStr);const L=C.edgeStrToEdgeData(E[R-1].edgeTypeStr),I=C.edgeStrToEdgeStartData(E[R-1].edgeTypeStr),P=C.edgeStrToThickness(E[R-1].edgeTypeStr),O=C.edgeStrToPattern(E[R-1].edgeTypeStr);this.$=[{id:E[R-2].id,label:E[R-2].label,type:E[R-2].type,directions:E[R-2].directions},{id:E[R-2].id+"-"+E[R].id,start:E[R-2].id,end:E[R].id,label:E[R-1].label,type:"edge",thickness:P,pattern:O,directions:E[R].directions,arrowTypeEnd:L,arrowTypeStart:I},{id:E[R].id,label:E[R].label,type:C.typeStr2Type(E[R].typeStr),directions:E[R].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",E[R-1],E[R]),this.$={id:E[R-1].id,label:E[R-1].label,type:C.typeStr2Type(E[R-1].typeStr),directions:E[R-1].directions,widthInColumns:parseInt(E[R],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",E[R]),this.$={id:E[R].id,label:E[R].label,type:C.typeStr2Type(E[R].typeStr),directions:E[R].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",E[R]),this.$={type:"column-setting",columns:E[R]==="auto"?-1:parseInt(E[R])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",E[R-2],E[R-1]),C.generateId(),this.$={...E[R-2],type:"composite",children:E[R-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",E[R-2],E[R-1],E[R]);const D=C.generateId();this.$={id:D,type:"composite",label:"",children:E[R-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",E[R]),this.$={id:E[R]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",E[R-1],E[R]),this.$={id:E[R-1],label:E[R].label,typeStr:E[R].typeStr,directions:E[R].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",E[R]),this.$=[E[R]];break;case 32:C.getLogger().debug("Rule: dirList: ",E[R-1],E[R]),this.$=[E[R-1]].concat(E[R]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",E[R-2],E[R-1],E[R]),this.$={typeStr:E[R-2]+E[R],label:E[R-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",E[R-3],E[R-2]," #3:",E[R-1],E[R]),this.$={typeStr:E[R-3]+E[R],label:E[R-2],directions:E[R-1]};break;case 35:case 36:this.$={type:"classDef",id:E[R-1].trim(),css:E[R].trim()};break;case 37:this.$={type:"applyClass",id:E[R-1].trim(),styleClass:E[R].trim()};break;case 38:this.$={type:"applyStyles",id:E[R-1].trim(),stylesStr:E[R].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,T){if(T.recoverable)this.trace(w);else{var k=new Error(w);throw k.hash=T,k}},"parseError"),parse:x(function(w){var T=this,k=[0],C=[],S=[null],E=[],A=this.table,R="",_=0,N=0,L=2,I=1,P=E.slice.call(arguments,1),O=Object.create(this.lexer),D={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(D.yy[B]=this.yy[B]);O.setInput(w,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 $(te){k.length=k.length-2*te,S.length=S.length-te,E.length=E.length-te}x($,"popStack");function V(){var te;return te=C.pop()||O.lex()||I,typeof te!="number"&&(te instanceof Array&&(C=te,te=C.pop()),te=T.symbols_[te]||te),te}x(V,"lex");for(var H,G,K,W,oe={},Z,J,ne,ie;;){if(G=k[k.length-1],this.defaultActions[G]?K=this.defaultActions[G]:((H===null||typeof H>"u")&&(H=V()),K=A[G]&&A[G][H]),typeof K>"u"||!K.length||!K[0]){var me="";ie=[];for(Z in A[G])this.terminals_[Z]&&Z>L&&ie.push("'"+this.terminals_[Z]+"'");O.showPosition?me="Parse error on line "+(_+1)+`: `+O.showPosition()+` -Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error on line "+(P+1)+": Unexpected "+(G==I?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(me,{text:O.match,token:this.terminals_[G]||G,line:O.yylineno,loc:z,expected:ie})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+G);switch(K[0]){case 1:S.push(G),E.push(O.yytext),A.push(O.yylloc),S.push(K[1]),G=null,N=O.yyleng,R=O.yytext,P=O.yylineno,z=O.yylloc;break;case 2:if(Q=this.productions_[K[1]][1],oe.$=E[E.length-Q],oe._$={first_line:A[A.length-(Q||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Q||1)].first_column,last_column:A[A.length-1].last_column},V&&(oe._$.range=[A[A.length-(Q||1)].range[0],A[A.length-1].range[1]]),q=this.performAction.apply(oe,[R,N,P,D.yy,K[1],E,A].concat($)),typeof q<"u")return q;Q&&(S=S.slice(0,-1*Q*2),E=E.slice(0,-1*Q),A=A.slice(0,-1*Q)),S.push(this.productions_[K[1]][0]),E.push(oe.$),A.push(oe._$),ne=M[S[S.length-2]][S[S.length-1]],S.push(ne);break;case 3:return!0}}return!0},"parse")},v=(function(){var x={EOF:1,parseError:w(function(C,S){if(this.yy.parser)this.yy.parser.parseError(C,S);else throw new Error(C)},"parseError"),setInput:w(function(T,C){return this.yy=C||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 C=T.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:w(function(T){var C=T.length,S=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===k.length?this.yylloc.first_column:0)+k[k.length-S.length].length-S[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more: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(),C=new Array(T.length+1).join("-");return T+this.upcomingInput()+` -`+C+"^"},"showPosition"),test_match:w(function(T,C){var S,k,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),k=T[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+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,C,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,C,S,k;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),A=0;AC[0].length)){if(C=S,k=A,this.options.backtrack_lexer){if(T=this.test_match(S,E[A]),T!==!1)return T;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(T=this.test_match(C,E[k]),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 C=this.next();return C||this.lex()},"lex"),begin:w(function(C){this.conditionStack.push(C)},"begin"),popState:w(function(){var C=this.conditionStack.length-1;return C>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(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:w(function(C){this.begin(C)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:w(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return x})();y.lexer=v;function b(){this.yy={}}return w(b,"Parser"),b.prototype=y,y.Parser=b,new b})();OK.parser=OK;var Kwr=OK,Fh=new Map,Qse=[],DK=new Map,sbe="color",abe="fill",Zwr="bgFill",TXe=",",lO=new Map,Jse="",Qwr=w(t=>Gt.sanitizeText(t,He()),"sanitizeText"),Jwr=w(function(t,e=""){let r=lO.get(t);r||(r={id:t,styles:[],textStyles:[]},lO.set(t,r)),e!=null&&e.split(TXe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(sbe).exec(n)){const a=i.replace(abe,Zwr).replace(sbe,abe);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),e4r=w(function(t,e=""){const r=Fh.get(t);e!=null&&(r.styles=e.split(TXe))},"addStyle2Node"),t4r=w(function(t,e){t.split(",").forEach(function(r){let n=Fh.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},Fh.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),CXe=w((t,e)=>{const r=t.flat(),n=[],i=r.find(a=>(a==null?void 0:a.type)==="column-setting"),s=(i==null?void 0:i.columns)??-1;for(const a of r){if(typeof s=="number"&&s>0&&a.type!=="column-setting"&&typeof a.widthInColumns=="number"&&a.widthInColumns>s&&de.warn(`Block ${a.id} width ${a.widthInColumns} exceeds configured column width ${s}`),a.label&&(a.label=Qwr(a.label)),a.type==="classDef"){Jwr(a.id,a.css);continue}if(a.type==="applyClass"){t4r(a.id,(a==null?void 0:a.styleClass)??"");continue}if(a.type==="applyStyles"){a!=null&&a.stylesStr&&e4r(a.id,a==null?void 0:a.stylesStr);continue}if(a.type==="column-setting")e.columns=a.columns??-1;else if(a.type==="edge"){const o=(DK.get(a.id)??0)+1;DK.set(a.id,o),a.id=o+"-"+a.id,Qse.push(a)}else{a.label||(a.type==="composite"?a.label="":a.label=a.id);const o=Fh.get(a.id);if(o===void 0?Fh.set(a.id,a):(a.type!=="na"&&(o.type=a.type),a.label!==a.id&&(o.label=a.label)),a.children&&CXe(a.children,a),a.type==="space"){const l=a.width??1;for(let u=0;u{de.debug("Clear called"),Oi(),xE={id:"root",type:"composite",children:[],columns:-1},Fh=new Map([["root",xE]]),eae=[],lO=new Map,Qse=[],DK=new Map,Jse=""},"clear");function kXe(t){switch(de.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return de.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(kXe,"typeStr2Type");function SXe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}w(SXe,"edgeTypeStr2Type");function EXe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}w(EXe,"edgeStrToEdgeData");function AXe(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(AXe,"edgeStrToEdgeStartData");function MXe(t){return t.includes("==")?"thick":"normal"}w(MXe,"edgeStrToThickness");function RXe(t){return t.includes(".-")?"dotted":"solid"}w(RXe,"edgeStrToPattern");var obe=0,n4r=w(()=>(obe++,"id-"+Math.random().toString(36).substr(2,12)+"-"+obe),"generateId"),i4r=w(t=>{xE.children=t,CXe(t,xE),eae=xE.children},"setHierarchy"),s4r=w(t=>{const e=Fh.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),a4r=w(()=>[...Fh.values()],"getBlocksFlat"),o4r=w(()=>eae||[],"getBlocks"),l4r=w(()=>Qse,"getEdges"),c4r=w(t=>Fh.get(t),"getBlock"),u4r=w(t=>{Fh.set(t.id,t)},"setBlock"),h4r=w(t=>{Jse=t},"setDiagramId"),d4r=w(()=>Jse,"getDiagramId"),f4r=w(()=>de,"getLogger"),p4r=w(function(){return lO},"getClasses"),g4r={getConfig:w(()=>xr().block,"getConfig"),typeStr2Type:kXe,edgeTypeStr2Type:SXe,edgeStrToEdgeData:EXe,edgeStrToEdgeStartData:AXe,edgeStrToThickness:MXe,edgeStrToPattern:RXe,getLogger:f4r,getBlocksFlat:a4r,getBlocks:o4r,getEdges:l4r,setHierarchy:i4r,getBlock:c4r,setBlock:u4r,getColumns:s4r,getClasses:p4r,clear:r4r,generateId:n4r,setDiagramId:h4r,getDiagramId:d4r},m4r=g4r,cG=w((t,e)=>{const r=SQ,n=r(t,"r"),i=r(t,"g"),s=r(t,"b");return Ah(n,i,s,e)},"fade"),y4r=w(t=>`.label { +Expecting `+ie.join(", ")+", got '"+(this.terminals_[H]||H)+"'":me="Parse error on line "+(_+1)+": Unexpected "+(H==I?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(me,{text:O.match,token:this.terminals_[H]||H,line:O.yylineno,loc:F,expected:ie})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+H);switch(K[0]){case 1:k.push(H),S.push(O.yytext),E.push(O.yylloc),k.push(K[1]),H=null,N=O.yyleng,R=O.yytext,_=O.yylineno,F=O.yylloc;break;case 2:if(J=this.productions_[K[1]][1],oe.$=S[S.length-J],oe._$={first_line:E[E.length-(J||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(J||1)].first_column,last_column:E[E.length-1].last_column},z&&(oe._$.range=[E[E.length-(J||1)].range[0],E[E.length-1].range[1]]),W=this.performAction.apply(oe,[R,N,_,D.yy,K[1],S,E].concat(P)),typeof W<"u")return W;J&&(k=k.slice(0,-1*J*2),S=S.slice(0,-1*J),E=E.slice(0,-1*J)),k.push(this.productions_[K[1]][0]),S.push(oe.$),E.push(oe._$),ne=A[k[k.length-2]][k[k.length-1]],k.push(ne);break;case 3:return!0}}return!0},"parse")},y=(function(){var v={EOF:1,parseError:x(function(T,k){if(this.yy.parser)this.yy.parser.parseError(T,k);else throw new Error(T)},"parseError"),setInput:x(function(w,T){return this.yy=T||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var T=w.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),w},"input"),unput:x(function(w){var T=w.length,k=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;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),k.length-1&&(this.yylineno-=k.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:k?(k.length===C.length?this.yylloc.first_column:0)+C[C.length-k.length].length-k[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-T]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),T=new Array(w.length+1).join("-");return w+this.upcomingInput()+` +`+T+"^"},"showPosition"),test_match:x(function(w,T){var k,C,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),C=w[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+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],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 S)this[E]=S[E];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,T,k,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),E=0;ET[0].length)){if(T=k,C=E,this.options.backtrack_lexer){if(w=this.test_match(k,S[E]),w!==!1)return w;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(w=this.test_match(T,S[C]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var T=this.next();return T||this.lex()},"lex"),begin:x(function(T){this.conditionStack.push(T)},"begin"),popState:x(function(){var T=this.conditionStack.length-1;return T>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(T){return T=this.conditionStack.length-1-Math.abs(T||0),T>=0?this.conditionStack[T]:"INITIAL"},"topState"),pushState:x(function(T){this.begin(T)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(T,k,C,S){switch(C){case 0:return T.getLogger().debug("Found block-beta"),10;case 1:return T.getLogger().debug("Found id-block"),29;case 2:return T.getLogger().debug("Found block"),10;case 3:T.getLogger().debug(".",k.yytext);break;case 4:T.getLogger().debug("_",k.yytext);break;case 5:return 5;case 6:return k.yytext=-1,28;case 7:return k.yytext=k.yytext.replace(/columns\s+/,""),T.getLogger().debug("COLUMNS (LEX)",k.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:T.getLogger().debug("LEX: POPPING STR:",k.yytext),this.popState();break;case 13:return T.getLogger().debug("LEX: STR end:",k.yytext),"STR";case 14:return k.yytext=k.yytext.replace(/space\:/,""),T.getLogger().debug("SPACE NUM (LEX)",k.yytext),21;case 15:return k.yytext="1",T.getLogger().debug("COLUMNS (LEX)",k.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(),T.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),T.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),T.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),T.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),T.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),T.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),T.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),T.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),T.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),T.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),T.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),T.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),T.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),T.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return T.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return T.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return T.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return T.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return T.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return T.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return T.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return T.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 T.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),T.getLogger().debug("LEX ARR START"),37;case 74:return T.getLogger().debug("Lex: NODE_ID",k.yytext),31;case 75:return T.getLogger().debug("Lex: EOF",k.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:T.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:T.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return T.getLogger().debug("LEX: NODE_DESCR:",k.yytext),"NODE_DESCR";case 83:T.getLogger().debug("LEX POPPING"),this.popState();break;case 84:T.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (right): dir:",k.yytext),"DIR";case 86:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (left):",k.yytext),"DIR";case 87:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (x):",k.yytext),"DIR";case 88:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (y):",k.yytext),"DIR";case 89:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (up):",k.yytext),"DIR";case 90:return k.yytext=k.yytext.replace(/^,\s*/,""),T.getLogger().debug("Lex (down):",k.yytext),"DIR";case 91:return k.yytext="]>",T.getLogger().debug("Lex (ARROW_DIR end):",k.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return T.getLogger().debug("Lex: LINK","#"+k.yytext+"#"),15;case 93:return T.getLogger().debug("Lex: LINK",k.yytext),15;case 94:return T.getLogger().debug("Lex: LINK",k.yytext),15;case 95:return T.getLogger().debug("Lex: LINK",k.yytext),15;case 96:return T.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 97:return T.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 98:return T.getLogger().debug("Lex: START_LINK",k.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return T.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),T.getLogger().debug("Lex: LINK","#"+k.yytext+"#"),15;case 102:return this.popState(),T.getLogger().debug("Lex: LINK",k.yytext),15;case 103:return this.popState(),T.getLogger().debug("Lex: LINK",k.yytext),15;case 104:return T.getLogger().debug("Lex: COLON",k.yytext),k.yytext=k.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 v})();U.lexer=y;function b(){this.yy={}}return x(b,"Parser"),b.prototype=U,U.Parser=b,new b})();zK.parser=zK;var b7r=zK,$h=new Map,sse=[],VK=new Map,gye="color",mye="fill",v7r="bgFill",OXe=",",hD=new Map,ose="",x7r=x(t=>Ht.sanitizeText(t,He()),"sanitizeText"),w7r=x(function(t,e=""){let r=hD.get(t);r||(r={id:t,styles:[],textStyles:[]},hD.set(t,r)),e!=null&&e.split(OXe).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(gye).exec(n)){const s=i.replace(mye,v7r).replace(gye,mye);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),T7r=x(function(t,e=""){const r=$h.get(t);e!=null&&(r.styles=e.split(OXe))},"addStyle2Node"),C7r=x(function(t,e){t.split(",").forEach(function(r){let n=$h.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},$h.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),_Xe=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&de.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=x7r(s.label)),s.type==="classDef"){w7r(s.id,s.css);continue}if(s.type==="applyClass"){C7r(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&T7r(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=(VK.get(s.id)??0)+1;VK.set(s.id,o),s.id=o+"-"+s.id,sse.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=$h.get(s.id);if(o===void 0?$h.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&_Xe(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u{de.debug("Clear called"),Oi(),Cw={id:"root",type:"composite",children:[],columns:-1},$h=new Map([["root",Cw]]),lse=[],hD=new Map,sse=[],VK=new Map,ose=""},"clear");function PXe(t){switch(de.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return de.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(PXe,"typeStr2Type");function BXe(t){switch(de.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(BXe,"edgeTypeStr2Type");function $Xe(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x($Xe,"edgeStrToEdgeData");function FXe(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(FXe,"edgeStrToEdgeStartData");function zXe(t){return t.includes("==")?"thick":"normal"}x(zXe,"edgeStrToThickness");function VXe(t){return t.includes(".-")?"dotted":"solid"}x(VXe,"edgeStrToPattern");var Uye=0,S7r=x(()=>(Uye++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Uye),"generateId"),E7r=x(t=>{Cw.children=t,_Xe(t,Cw),lse=Cw.children},"setHierarchy"),A7r=x(t=>{const e=$h.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),M7r=x(()=>[...$h.values()],"getBlocksFlat"),R7r=x(()=>lse||[],"getBlocks"),L7r=x(()=>sse,"getEdges"),I7r=x(t=>$h.get(t),"getBlock"),N7r=x(t=>{$h.set(t.id,t)},"setBlock"),D7r=x(t=>{ose=t},"setDiagramId"),O7r=x(()=>ose,"getDiagramId"),_7r=x(()=>de,"getLogger"),P7r=x(function(){return hD},"getClasses"),B7r={getConfig:x(()=>xr().block,"getConfig"),typeStr2Type:PXe,edgeTypeStr2Type:BXe,edgeStrToEdgeData:$Xe,edgeStrToEdgeStartData:FXe,edgeStrToThickness:zXe,edgeStrToPattern:VXe,getLogger:_7r,getBlocksFlat:M7r,getBlocks:R7r,getEdges:L7r,setHierarchy:E7r,getBlock:I7r,setBlock:N7r,getColumns:A7r,getClasses:P7r,clear:k7r,generateId:S7r,setDiagramId:D7r,getDiagramId:O7r},$7r=B7r,pH=x((t,e)=>{const r=IJ,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Eh(n,i,a,e)},"fade"),F7r=x(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -5600,9 +5733,9 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error } .node .cluster { - // fill: ${cG(t.mainBkg,.5)}; - fill: ${cG(t.clusterBkg,.5)}; - stroke: ${cG(t.clusterBorder,.2)}; + // fill: ${pH(t.mainBkg,.5)}; + fill: ${pH(t.clusterBkg,.5)}; + stroke: ${pH(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; } @@ -5637,14 +5770,14 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error font-size: 18px; fill: ${t.textColor}; } - ${M7()} -`,"getStyles"),v4r=y4r,b4r=w((t,e,r,n)=>{e.forEach(i=>{R4r[i](t,r,n)})},"insertMarkers"),x4r=w((t,e,r)=>{de.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"),w4r=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"),T4r=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"),C4r=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"),k4r=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"),S4r=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"),E4r=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"),A4r=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"),M4r=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"),R4r={extension:x4r,composition:w4r,aggregation:T4r,dependency:C4r,lollipop:k4r,point:S4r,circle:E4r,cross:A4r,barb:M4r},_4r=b4r;function PK(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(PK,"calculateBlockPosition");var L4r=w(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:s,x:a,y:o}=n.size??{width:0,height:0,x:0,y:0};if(de.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",s,"x:",a,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),s>r&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function cO(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;de.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 s=0,a=0;if(((u=t.children)==null?void 0:u.length)>0){for(const A of t.children)cO(A,e,0,0,i);const b=L4r(t);s=b.width,a=b.height,de.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",s,a);for(const A of t.children)A.size&&(de.debug(`abc95 Setting size of children of ${t.id} id=${A.id} ${s} ${a} ${JSON.stringify(A.size)}`),A.size.width=s*(A.widthInColumns??1)+i*((A.widthInColumns??1)-1),A.size.height=a,A.size.x=0,A.size.y=0,de.debug(`abc95 updating size of ${t.id} children child:${A.id} maxWidth:${s} maxHeight:${a}`));for(const A of t.children)cO(A,e,s,a,i);const x=t.columns??-1;let T=0;for(const A of t.children)T+=A.widthInColumns??1;let C=t.children.length;x>0&&x0?Math.min(t.children.length,x):t.children.length;if(A>0){const M=(k-A*i-i)/A;de.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,M);for(const R of t.children)R.size&&(R.size.width=M)}}t.size={width:k,height:E,x:0,y:0}}de.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(cO,"setBlockSizes");function tae(t,e,r=8){var i,s,a,o,l,u,h,d,f,p,g,m,y,v,b,x,T;de.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(s=t==null?void 0:t.size)==null?void 0:s.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const n=t.columns??-1;if(de.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;de.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const N of t.children){if(!N.size)continue;const{py:L}=PK(n,P),I=k.get(L)??0;N.size.height>I&&k.set(L,N.size.height);let $=(N==null?void 0:N.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const N=[...k.keys()].sort((L,I)=>L-I);for(const L of N)E.set(L,P),P+=(k.get(L)??0)+r}let A=0;de.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,R=0;for(const P of t.children){const N=t;if(!P.size)continue;const{width:L,height:I}=P.size,{px:$,py:O}=PK(n,A);if(O!=R&&(R=O,M=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,de.debug("New row in layout for block",t.id," and child ",P.id,R)),de.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${A} (px, py) ${$},${O} (${(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: ${L}${r}`),N.size){const B=L/2;P.size.x=M+r+B,de.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${B} padding=${r} width=${L} halfWidth=${B} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${L*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+B;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=N.size.y-N.size.height/2+z+V/2+r,de.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${M}${r}${B}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${L*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&tae(P,e,r);let D=(P==null?void 0:P.widthInColumns)??1;n>0&&(D=Math.min(D,n-A%n)),A+=D,de.debug("abc88 columnsPos",P,A)}}de.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(b=t==null?void 0:t.size)==null?void 0:b.x} y: ${(x=t==null?void 0:t.size)==null?void 0:x.y} width: ${(T=t==null?void 0:t.size)==null?void 0:T.width}`)}w(tae,"layoutBlocks");function rae(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:s,y:a,width:o,height:l}=t.size;s-o/2n&&(n=s+o/2),a+l/2>i&&(i=a+l/2)}if(t.children)for(const s of t.children)({minX:e,minY:r,maxX:n,maxY:i}=rae(s,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}w(rae,"findBounds");function _Xe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=He())==null?void 0:u.block)==null?void 0:h.padding)??8;cO(e,t,0,0,r),tae(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:s,maxY:a}=rae(e),o=a-i,l=s-n;return{x:n,y:i,width:l,height:o}}w(_Xe,"layout");var I4r=w(async(t,e,r,n=!1,i=!1)=>{let s=e||"";typeof s=="object"&&(s=s[0]);const a=He(),o=yi(a);return await ll(t,s,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Th=I4r,N4r=w((t,e,r,n,i)=>{e.arrowTypeStart&&lbe(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&lbe(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),O4r={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},lbe=w((t,e,r,n,i,s)=>{const a=O4r[r];if(!a){de.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${s}-${a}${o})`)},"addEdgeMarker"),$K={},qo={},D4r=w(async(t,e)=>{const r=He(),n=yi(r),i=t.insert("g").attr("class","edgeLabel"),s=i.insert("g").attr("class","label"),a=e.labelType==="markdown",o=await ll(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:a,isNode:!1,markdown:a,width:a?void 0:Number.POSITIVE_INFINITY},r);s.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=xt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=xt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}s.attr("transform",Ad(u,n)),$K[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 Th(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=xt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Ad(g,n)),qo[e.id]||(qo[e.id]={}),qo[e.id].startLeft=d,xS(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Th(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=xt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Ad(g,n)),qo[e.id]||(qo[e.id]={}),qo[e.id].startRight=d,xS(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Th(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=xt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Ad(g,n)),qo[e.id]||(qo[e.id]={}),qo[e.id].endLeft=d,xS(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Th(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=xt(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Ad(g,n)),qo[e.id]||(qo[e.id]={}),qo[e.id].endRight=d,xS(h,e.endLabelRight)}return o},"insertEdgeLabel");function xS(t,e){yi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}w(xS,"setTerminalWidth");var P4r=w((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,$K[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=U3(n);if(t.label){const s=$K[t.id];let a=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.debug("Moving label "+t.label+" from (",a,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(a=l.x,o=l.y)}s.attr("transform",`translate(${a}, ${o+i/2})`)}if(t.startLabelLeft){const s=qo[t.id].startLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.startLabelRight){const s=qo[t.id].startRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelLeft){const s=qo[t.id].endLeft;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}if(t.endLabelRight){const s=qo[t.id].endRight;let a=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=l.x,o=l.y}s.attr("transform",`translate(${a}, ${o})`)}},"positionEdgeLabel"),$4r=w((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),s=Math.abs(e.y-n),a=t.width/2,o=t.height/2;return i>=a||s>=o},"outsideNode"),B4r=w((t,e,r)=>{de.debug(`intersection calc abc89: + ${Lk()} +`,"getStyles"),z7r=F7r,V7r=x((t,e,r,n)=>{e.forEach(i=>{J7r[i](t,r,n)})},"insertMarkers"),H7r=x((t,e,r)=>{de.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"),G7r=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),W7r=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),q7r=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),j7r=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Y7r=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),X7r=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),K7r=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Z7r=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),J7r={extension:H7r,composition:G7r,aggregation:W7r,dependency:q7r,lollipop:j7r,point:Y7r,circle:X7r,cross:K7r,barb:Z7r},Q7r=V7r;function HK(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(HK,"calculateBlockPosition");var e8r=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(de.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 dD(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,U,y;de.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 E of t.children)dD(E,e,0,0,i);const b=e8r(t);a=b.width,s=b.height,de.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const E of t.children)E.size&&(de.debug(`abc95 Setting size of children of ${t.id} id=${E.id} ${a} ${s} ${JSON.stringify(E.size)}`),E.size.width=a*(E.widthInColumns??1)+i*((E.widthInColumns??1)-1),E.size.height=s,E.size.x=0,E.size.y=0,de.debug(`abc95 updating size of ${t.id} children child:${E.id} maxWidth:${a} maxHeight:${s}`));for(const E of t.children)dD(E,e,a,s,i);const v=t.columns??-1;let w=0;for(const E of t.children)w+=E.widthInColumns??1;let T=t.children.length;v>0&&v0?Math.min(t.children.length,v):t.children.length;if(E>0){const A=(C-E*i-i)/E;de.debug("abc95 (growing to fit) width",t.id,C,(p=t.size)==null?void 0:p.width,A);for(const R of t.children)R.size&&(R.size.width=A)}}t.size={width:C,height:S,x:0,y:0}}de.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,(U=t==null?void 0:t.size)==null?void 0:U.y,(y=t==null?void 0:t.size)==null?void 0:y.height)}x(dD,"setBlockSizes");function cse(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,U,y,b,v,w;de.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(de.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const T=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,k=t.children.length*T+(t.children.length-1)*r;de.debug("widthOfChildren 88",k,"posX");const C=new Map;{let _=0;for(const N of t.children){if(!N.size)continue;const{py:L}=HK(n,_),I=C.get(L)??0;N.size.height>I&&C.set(L,N.size.height);let P=(N==null?void 0:N.widthInColumns)??1;n>0&&(P=Math.min(P,n-_%n)),_+=P}}const S=new Map;{let _=0;const N=[...C.keys()].sort((L,I)=>L-I);for(const L of N)S.set(L,_),_+=(C.get(L)??0)+r}let E=0;de.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let A=(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,R=0;for(const _ of t.children){const N=t;if(!_.size)continue;const{width:L,height:I}=_.size,{px:P,py:O}=HK(n,E);if(O!=R&&(R=O,A=(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,de.debug("New row in layout for block",t.id," and child ",_.id,R)),de.debug(`abc89 layout blocks (child) id: ${_.id} Pos: ${E} (px, py) ${P},${O} (${(U=N==null?void 0:N.size)==null?void 0:U.x},${(y=N==null?void 0:N.size)==null?void 0:y.y}) parent: ${N.id} width: ${L}${r}`),N.size){const B=L/2;_.size.x=A+r+B,de.debug(`abc91 layout blocks (calc) px, pyid:${_.id} startingPos=X${A} new startingPosX${_.size.x} ${B} padding=${r} width=${L} halfWidth=${B} => x:${_.size.x} y:${_.size.y} ${_.widthInColumns} (width * (child?.w || 1)) / 2 ${L*((_==null?void 0:_.widthInColumns)??1)/2}`),A=_.size.x+B;const F=S.get(O)??0,z=C.get(O)??I;_.size.y=N.size.y-N.size.height/2+F+z/2+r,de.debug(`abc88 layout blocks (calc) px, pyid:${_.id}startingPosX${A}${r}${B}=>x:${_.size.x}y:${_.size.y}${_.widthInColumns}(width * (child?.w || 1)) / 2${L*((_==null?void 0:_.widthInColumns)??1)/2}`)}_.children&&cse(_,e,r);let D=(_==null?void 0:_.widthInColumns)??1;n>0&&(D=Math.min(D,n-E%n)),E+=D,de.debug("abc88 columnsPos",_,E)}}de.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(b=t==null?void 0:t.size)==null?void 0:b.x} y: ${(v=t==null?void 0:t.size)==null?void 0:v.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}x(cse,"layoutBlocks");function use(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}=use(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(use,"findBounds");function HXe(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=He())==null?void 0:u.block)==null?void 0:h.padding)??8;dD(e,t,0,0,r),cse(e,t,r),de.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=use(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}x(HXe,"layout");var t8r=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=He(),o=yi(s);return await ll(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),wh=t8r,r8r=x((t,e,r,n,i)=>{e.arrowTypeStart&&yye(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&yye(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),n8r={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},yye=x((t,e,r,n,i,a)=>{const s=n8r[r];if(!s){de.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),GK={},Wo={},i8r=x(async(t,e)=>{const r=He(),n=yi(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await ll(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=vt(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=vt(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Ad(u,n)),GK[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 wh(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],U=vt(p);g=m.getBoundingClientRect(),U.attr("width",g.width),U.attr("height",g.height)}f.attr("transform",Ad(g,n)),Wo[e.id]||(Wo[e.id]={}),Wo[e.id].startLeft=d,Cx(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await wh(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],U=vt(p);g=m.getBoundingClientRect(),U.attr("width",g.width),U.attr("height",g.height)}f.attr("transform",Ad(g,n)),Wo[e.id]||(Wo[e.id]={}),Wo[e.id].startRight=d,Cx(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await wh(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],U=vt(p);g=m.getBoundingClientRect(),U.attr("width",g.width),U.attr("height",g.height)}f.attr("transform",Ad(g,n)),Wo[e.id]||(Wo[e.id]={}),Wo[e.id].endLeft=d,Cx(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await wh(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],U=vt(p);g=m.getBoundingClientRect(),U.attr("width",g.width),U.attr("height",g.height)}f.attr("transform",Ad(g,n)),Wo[e.id]||(Wo[e.id]={}),Wo[e.id].endRight=d,Cx(h,e.endLabelRight)}return o},"insertEdgeLabel");function Cx(t,e){yi(He())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(Cx,"setTerminalWidth");var a8r=x((t,e)=>{de.debug("Moving label abc88 ",t.id,t.label,GK[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=He(),{subGraphTitleTotalMargin:i}=X4(n);if(t.label){const a=GK[t.id];let s=t.x,o=t.y;if(r){const l=Kr.calcLabelPosition(r);de.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=Wo[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Kr.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=Wo[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Kr.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=Wo[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Kr.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=Wo[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Kr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),s8r=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),o8r=x((t,e,r)=>{de.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,s=Math.abs(n-r.x),a=t.width/2;let o=r.xMath.abs(n-e.x)*l){let d=r.y{de.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(s=>{if(!$4r(e,s)&&!i){const a=B4r(e,n,s);let o=!1;r.forEach(l=>{o=o||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)||r.push(a),i=!0}else n=s,i||r.push(s)}),r},"cutPathAtIntersect"),F4r=w(function(t,e,r,n,i,s,a){let o=r.points;de.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=s.node(e.v);var h=s.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&&(de.debug("to cluster abc88",n[r.toCluster]),o=cbe(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=cbe(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=h6;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=$Ae(r),m=u6().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 b="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(b=tD(!0)),N4r(v,r,b,a,i);let x={};return l&&(x.updatedPath=o),x.originalPath=r.points,x},"insertEdge"),z4r=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"),V4r=w((t,e,r,n)=>{const i=z4r(t),s=2,a=e.height+2*r.padding,o=a/s,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:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-o,y:-a},{x:l/2,y:-a-2*u},{x:o,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-a},{x:l-o,y:-a},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-a+o},{x:0,y:-a}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-a+o},{x:l,y:-a}]: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:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+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:-a}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-a}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-a+u},{x:o,y:-a+u},{x:o,y:-a},{x:0,y:-a/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-o,y:-a+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:-a+u},{x:l-o,y:-a+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function LXe(t,e){return t.intersect(e)}w(LXe,"intersectNode");var H4r=LXe;function IXe(t,e,r,n){var i=t.x,s=t.y,a=i-n.x,o=s-n.y,l=Math.sqrt(e*e*o*o+r*r*a*a),u=Math.abs(e*r*a/l);n.x0}w(BK,"sameSign");var W4r=DXe,q4r=PXe;function PXe(t,e,r){var n=t.x,i=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){a=Math.min(a,g.x),o=Math.min(o,g.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-a,u=i-t.height/2-o,h=0;h1&&s.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,b=Math.sqrt(y*y+v*v),x=m.x-r.x,T=m.y-r.y,C=Math.sqrt(x*x+T*T);return b{var r=t.x,n=t.y,i=e.x-r,s=e.y-n,a=t.width/2,o=t.height/2,l,u;return Math.abs(s)*a>Math.abs(i)*o?(s<0&&(o=-o),l=s===0?0:o*i/s,u=o):(i<0&&(a=-a),l=a,u=i===0?0:a*s/i),{x:r+l,y:n+u}},"intersectRect"),j4r=U4r,ys={node:H4r,circle:G4r,ellipse:NXe,polygon:q4r,rect:j4r},po=w(async(t,e,r,n)=>{const i=He();let s;const a=e.useHtmlLabels||yi(i);r?s=r:s="node default";const o=t.insert("g").attr("class",s).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=ll(l,Nn(I0(u),i),{useHtmlLabels:a,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Th(l,Nn(I0(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(yi(i)){const p=h.children[0],g=xt(h);await mJ(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return a?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"),js=w((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function ed(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(ed,"insertPolygonShape");var Y4r=w(async(t,e)=>{e.useHtmlLabels||yi(He())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await po(t,e,"node "+e.classes,!0);de.info("Classes = ",e.classes);const a=n.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-s).attr("y",-i.height/2-s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),js(e,a),e.intersect=function(o){return ys.rect(e,o)},n},"note"),X4r=Y4r,ube=w(t=>t?" "+t:"","formatClass"),fu=w((t,e)=>`${e||"node default"}${ube(t.classes)} ${ube(t.class)}`,"getClassesFromNode"),hbe=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=i+s,o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];de.info("Question main (Circle)");const l=ed(r,a,a,o);return l.attr("style",e.style),js(e,l),e.intersect=function(u){return de.warn("Intersect called"),ys.polygon(e,o,u)},r},"question"),K4r=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(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(a){return ys.circle(e,14,a)},r},"choice"),Z4r=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=4,s=e.positioned?e.height:n.height+e.padding,a=s/i,o=e.positioned?e.width:n.width+2*a+e.padding,l=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-s/2},{x:o-a,y:-s},{x:a,y:-s},{x:0,y:-s/2}],u=ed(r,o,s,l);return u.attr("style",e.style),js(e,u),e.intersect=function(h){return ys.polygon(e,l,h)},r},"hexagon"),Q4r=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,void 0,!0),i=2,s=n.height+2*e.padding,a=s/i,o=n.width+2*a+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=V4r(e.directions,n,e,u),d=ed(r,u,s,h);return d.attr("style",e.style),js(e,d),e.intersect=function(f){return ys.polygon(e,h,f)},r},"block_arrow"),J4r=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return ed(r,i,s,a).attr("style",e.style),e.width=i+s,e.height=s,e.intersect=function(l){return ys.polygon(e,a,l)},r},"rect_left_inv_arrow"),eTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"lean_right"),tTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"lean_left"),rTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"trapezoid"),nTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"inv_trapezoid"),iTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"rect_right_inv_arrow"),sTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=i/2,a=s/(2.5+i/50),o=n.height+a+e.padding,l="M 0,"+a+" a "+s+","+a+" 0,0,0 "+i+" 0 a "+s+","+a+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+s+","+a+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+a)+")");return js(e,u),e.intersect=function(h){const d=ys.rect(e,h),f=d.x-e.x;if(s!=0&&(Math.abs(f)e.height/2-a)){let p=a*a*(1-f*f/(s*s));p!=0&&(p=Math.sqrt(p)),p=a-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),aTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,"node "+e.classes+" "+e.class,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.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",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(dB(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return js(e,s),e.intersect=function(h){return ys.rect(e,h)},r},"rect"),oTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,"node "+e.classes,!0),s=r.insert("rect",":first-child"),a=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-a/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(s.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",a).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(dB(s,e.props.borders,a,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return js(e,s),e.intersect=function(h){return ys.rect(e,h)},r},"composite"),lTr=w(async(t,e)=>{const{shapeSvg:r}=await po(t,e,"label",!0);de.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,s=0;if(n.attr("width",i).attr("height",s),r.attr("class","label edgeLabel"),e.props){const a=new Set(Object.keys(e.props));e.props.borders&&(dB(n,e.props.borders,i,s),a.delete("borders")),a.forEach(o=>{de.warn(`Unknown node property ${o}`)})}return js(e,n),e.intersect=function(a){return ys.rect(e,a)},r},"labelRect");function dB(t,e,r,n){const i=[],s=w(o=>{i.push(o,0)},"addBorder"),a=w(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(de.debug("add top border"),s(r)):a(r),e.includes("r")?(de.debug("add right border"),s(n)):a(n),e.includes("b")?(de.debug("add bottom border"),s(r)):a(r),e.includes("l")?(de.debug("add left border"),s(n)):a(n),t.attr("stroke-dasharray",i.join(" "))}w(dB,"applyNodePropertyBorders");var cTr=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"),s=n.insert("line"),a=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,de.info("Label text abc79",l,o,typeof o=="object");const u=await Th(a,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(yi(He())){const m=u.children[0],y=xt(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}de.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Th(a,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(yi(He())){const m=p.children[0],y=xt(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return xt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),xt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.height+e.padding,s=n.width+i/4+e.padding,a=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return js(e,a),e.intersect=function(o){return ys.rect(e,o)},r},"stadium"),hTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,fu(e,void 0),!0),s=r.insert("circle",":first-child");return s.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),de.info("Circle main"),js(e,s),e.intersect=function(a){return de.info("Circle intersect",e,n.width/2+i,a),ys.circle(e,n.width/2+i,a)},r},"circle"),dTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,fu(e,void 0),!0),s=5,a=r.insert("g",":first-child"),o=a.insert("circle"),l=a.insert("circle");return a.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+s).attr("width",n.width+e.padding+s*2).attr("height",n.height+e.padding+s*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),de.info("DoubleCircle main"),js(e,o),e.intersect=function(u){return de.info("DoubleCircle intersect",e,n.width/2+i+s,u),ys.circle(e,n.width/2+i+s,u)},r},"doublecircle"),fTr=w(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(e,void 0),!0),i=n.width+e.padding,s=n.height+e.padding,a=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=ed(r,i,s,a);return o.attr("style",e.style),js(e,o),e.intersect=function(l){return ys.polygon(e,a,l)},r},"subroutine"),pTr=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),js(e,n),e.intersect=function(i){return ys.circle(e,7,i)},r},"start"),dbe=w((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,s=10;r==="LR"&&(i=10,s=70);const a=n.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join");return js(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ys.rect(e,o)},n},"forkJoin"),gTr=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),js(e,i),e.intersect=function(s){return ys.circle(e,7,s)},r},"end"),mTr=w(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let s;e.classes?s="node "+e.classes:s="node default";const a=t.insert("g").attr("class",s).attr("id",e.domId||e.id),o=a.insert("rect",":first-child"),l=a.insert("line"),u=a.insert("line");let h=0,d=n;const f=a.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 Th(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(yi(He())){const A=y.children[0],M=xt(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 b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(yi(He())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await Th(f,b,e.labelStyle,!0,!0);xt(x).attr("class","classTitle");let T=x.getBBox();if(yi(He())){const A=x.children[0],M=xt(x);T=A.getBoundingClientRect(),M.attr("width",T.width),M.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const C=[];e.classData.members.forEach(async A=>{const M=A.getDisplayDetails();let R=M.displayText;yi(He())&&(R=R.replace(//g,">"));const P=await Th(f,R,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(yi(He())){const L=P.children[0],I=xt(P);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async A=>{const M=A.getDisplayDetails();let R=M.displayText;yi(He())&&(R=R.replace(//g,">"));const P=await Th(f,R,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let N=P.getBBox();if(yi(He())){const L=P.children[0],I=xt(P);N=L.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;xt(y).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=v.height+n}let k=(h-T.width)/2;return xt(x).attr("transform","translate( "+(-1*h/2+k)+", "+(-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,C.forEach(A=>{xt(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=>{xt(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),js(e,o),e.intersect=function(A){return ys.rect(e,A)},a},"class_box"),fbe={rhombus:hbe,composite:oTr,question:hbe,rect:aTr,labelRect:lTr,rectWithTitle:cTr,choice:K4r,circle:hTr,doublecircle:dTr,stadium:uTr,hexagon:Z4r,block_arrow:Q4r,rect_left_inv_arrow:J4r,lean_right:eTr,lean_left:tTr,trapezoid:rTr,inv_trapezoid:nTr,rect_right_inv_arrow:iTr,cylinder:sTr,start:pTr,end:gTr,note:X4r,subroutine:fTr,fork:dbe,join:dbe,class_box:mTr},t_={},$Xe=w(async(t,e,r)=>{let n,i;if(e.link){let s;He().securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),i=await fbe[e.shape](n,e,r)}else i=await fbe[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),t_[e.id]=n,e.haveCallback&&t_[e.id].attr("class",t_[e.id].attr("class")+" clickable"),n},"insertNode"),yTr=w(t=>{const e=t_[t.id];de.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 nae(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 s=0,a="",o;switch(n.type){case"round":s=5,a="rect";break;case"composite":s=0,a="composite",o=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const l=pJ((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:a,labelText:u,rx:s,ry:s,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=xr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}w(nae,"getNodeFromBlock");async function BXe(t,e,r){const n=nae(e,r,!1);if(n.type==="group")return;const i=xr(),s=await $Xe(t,n,{config:i}),a=s.node().getBBox(),o=r.getBlock(n.id);o.size={width:a.width,height:a.height,x:0,y:0,node:s},r.setBlock(o),s.remove()}w(BXe,"calculateBlockSize");async function FXe(t,e,r){const n=nae(e,r,!0);if(r.getBlock(n.id).type!=="space"){const s=xr();await $Xe(t,n,{config:s}),e.intersect=n==null?void 0:n.intersect,yTr(n)}}w(FXe,"insertBlockPositioned");async function fB(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await fB(t,i.children,r,n)}w(fB,"performOperations");async function zXe(t,e,r){await fB(t,e,r,BXe)}w(zXe,"calculateBlockSizes");async function VXe(t,e,r){await fB(t,e,r,FXe)}w(VXe,"insertBlocks");async function HXe(t,e,r,n,i){const s=new rl({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of r)a.size&&s.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of e)if(a.start&&a.end){const o=n.getBlock(a.start),l=n.getBlock(a.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}-${a.id}`:a.id,p=a.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=a.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;F4r(t,{v:a.start,w:a.end,name:f},{...a,id:f,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m},void 0,"block",s,i),a.label&&(await D4r(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:d,classes:m}),P4r({...a,x:d[1].x,y:d[1].y},{originalPath:d}))}}}w(HXe,"insertEdges");var vTr=w(function(t,e){return e.db.getClasses()},"getClasses"),bTr=w(async function(t,e,r,n){const{securityLevel:i,block:s}=xr(),a=n.db;a.setDiagramId(e);let o;i==="sandbox"&&(o=xt("#i"+e));const l=xt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):xt(`[id="${e}"]`);_4r(u,["point","circle","cross"],n.type,e);const d=a.getBlocks(),f=a.getBlocksFlat(),p=a.getEdges(),g=u.insert("g").attr("class","block");await zXe(g,d,a);const m=_Xe(a);if(await VXe(g,d,a),await HXe(g,p,f,a,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),b=y.height+v+10,x=y.width+10,{useMaxWidth:T}=s;qs(u,b,x,!!T),de.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),xTr={draw:bTr,getClasses:vTr},wTr={parser:Kwr,db:m4r,renderer:xTr,styles:v4r};const TTr=Object.freeze(Object.defineProperty({__proto__:null,diagram:wTr},Symbol.toStringTag,{value:"Module"}));var GXe=/[─━│┃└┗├┣]/,WXe=/[└┗├┣]/,CTr=/[─━]/,pbe=/^[\s│┃]+$/,gbe=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,mbe=/^\s*%%/,kTr=" ";function qXe(t){return t.some(e=>GXe.test(e))}w(qXe,"isBoxDrawingFormat");function UXe(t){for(const e of t){const r=WXe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}w(UXe,"inferSegmentWidth");function jXe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),s=e.get(i);return s?`line ${s}`:r})}w(jXe,"remapErrorLines");function YXe(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:[]}]})),STr=w(()=>{Cd.reset(),Oi()},"clear"),ETr=w(()=>Cd.records.stack[0],"getRoot"),ATr=w(()=>Cd.records.cnt,"getCount"),MTr=En.treeView,RTr=w(()=>rs(MTr,xr().treeView),"getConfig"),_Tr=w((t,e,r,n,i,s)=>{for(;t<=Cd.records.stack[Cd.records.stack.length-1].level;)Cd.records.stack.pop();const a={id:Cd.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:s,children:[]};Cd.records.stack[Cd.records.stack.length-1].children.push(a),Cd.records.stack.push(a)},"addNode"),LTr={clear:STr,addNode:_Tr,getRoot:ETr,getCount:ATr,getConfig:RTr,getAccTitle:ns,getAccDescription:ss,getDiagramTitle:ji,setAccDescription:is,setAccTitle:qi,setDiagramTitle:ts},FK=LTr,ITr=w(t=>{ec(t,FK);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 s=i?"directory":"file",a=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Nn(u,xr()):void 0;FK.addNode(r,n,s,a,l,h)}},"populate"),NTr={parse:w(async t=>{const{text:e,lineMap:r}=YXe(t);try{const n=await Ju("treeView",e);de.debug(n),ITr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=jXe(n.message,r)),n}},"parse")},TA={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function XXe(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 s=t.substring(n).toLowerCase(),a=e==null?void 0:e.extensionIcons;return(a==null?void 0:a[s])??(a==null?void 0:a[s.slice(1)])}}w(XXe,"detectIcon");function zK(t,e){return t.includes(":")?t:t in TA.icons||!e?`${TA.prefix}:${t}`:`${e}:${t}`}w(zK,"qualifyIcon");function iae(t,e){if(t.icon!=="none"){if(t.icon)return zK(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=XXe(t.name,e);if(r==="none")return;if(r)return zK(r,e.defaultIconPack)}return`${TA.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}w(iae,"getNodeIcon");yJ([{name:TA.prefix,icons:TA}]);var VK=14,OTr=4,DTr=16,KXe=w((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),PTr=w(async(t,e,r,n)=>{const i=new Set,s=w(l=>{const u=iae(l,r);u&&i.add(u),l.children.forEach(s)},"collect");if(s(e),i.size===0)return;const a=await Promise.all([...i].map(async l=>({icon:l,svg:await N0(l,{height:VK,width:VK})}))),o=t.append("defs");for(const{icon:l,svg:u}of a)o.append("g").attr("id",KXe(n,l)).html(u)},"injectIconDefs"),$Tr=w((t,e,r,n,i,s)=>{var b;const a=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=VK+OTr,u=iae(r,i),h=u!==void 0;u&&a.append("use").attr("xlink:href",`#${KXe(s,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=a.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},(b=r.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&a.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:a,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),ybe=w((t,e,r,n,i,s)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),BTr=w((t,e,r,n)=>{var h;let i=0,s=0;const a=[],o=w((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=$Tr(m,i,f,d,p,n);a.push(y);const{height:v,width:b}=f.BBox;ybe(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),s=Math.max(s,m+b),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;ybe(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=a.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...a.map(p=>p.labelRightEdge))+DTr;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();s=Math.max(s,f+m.width+r.paddingX)}}for(const d of a)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=s-d.node.BBox.x+8;f.attr("width",p),s=Math.max(s,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:s}},"drawTree"),FTr=w(async(t,e,r,n)=>{de.debug(`Rendering treeView diagram -`+t);const i=n.db,s=i.getRoot(),a=i.getConfig(),o=al(e);await PTr(o,s,a,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=BTr(l,s,a,e);o.attr("viewBox",`-${a.lineThickness/2} 0 ${h} ${u}`),qs(o,u,h,a.useMaxWidth)},"draw"),zTr={draw:FTr},VTr=zTr,HTr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},GTr=w(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:s,highlightBg:a,highlightStroke:o}=rs(HTr,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{de.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!s8r(e,a)&&!i){const s=o8r(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"),l8r=x(function(t,e,r,n,i,a,s){let o=r.points;de.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&&(de.debug("to cluster abc88",n[r.toCluster]),o=bye(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(de.debug("from cluster abc88",n[r.fromCluster]),o=bye(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=gT;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=jCe(r),m=pT().x(p).y(g).curve(f);let U;switch(r.thickness){case"normal":U="edge-thickness-normal";break;case"thick":U="edge-thickness-thick";break;case"invisible":U="edge-thickness-thick";break;default:U=""}switch(r.pattern){case"solid":U+=" edge-pattern-solid";break;case"dotted":U+=" edge-pattern-dotted";break;case"dashed":U+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+U+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(He().flowchart.arrowMarkerAbsolute||He().state.arrowMarkerAbsolute)&&(b=iO(!0)),r8r(y,r,b,s,i);let v={};return l&&(v.updatedPath=o),v.originalPath=r.points,v},"insertEdge"),c8r=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),u8r=x((t,e,r,n)=>{const i=c8r(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 GXe(t,e){return t.intersect(e)}x(GXe,"intersectNode");var h8r=GXe;function WXe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x0}x(WK,"sameSign");var f8r=YXe,p8r=XXe;function XXe(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 U=g.x-r.x,y=g.y-r.y,b=Math.sqrt(U*U+y*y),v=m.x-r.x,w=m.y-r.y,T=Math.sqrt(v*v+w*w);return b{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"),m8r=g8r,ma={node:h8r,circle:d8r,ellipse:qXe,polygon:p8r,rect:m8r},po=x(async(t,e,r,n)=>{const i=He();let a;const s=e.useHtmlLabels||yi(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=ll(l,Dn(N0(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await wh(l,Dn(N0(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(yi(i)){const p=h.children[0],g=vt(h);await TQ(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"),qa=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function ed(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(ed,"insertPolygonShape");var U8r=x(async(t,e)=>{e.useHtmlLabels||yi(He())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await po(t,e,"node "+e.classes,!0);de.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),qa(e,s),e.intersect=function(o){return ma.rect(e,o)},n},"note"),y8r=U8r,vye=x(t=>t?" "+t:"","formatClass"),fu=x((t,e)=>`${e||"node default"}${vye(t.classes)} ${vye(t.class)}`,"getClassesFromNode"),xye=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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}];de.info("Question main (Circle)");const l=ed(r,s,s,o);return l.attr("style",e.style),qa(e,l),e.intersect=function(u){return de.warn("Intersect called"),ma.polygon(e,o,u)},r},"question"),b8r=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return ma.circle(e,14,s)},r},"choice"),v8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,o,a,l);return u.attr("style",e.style),qa(e,u),e.intersect=function(h){return ma.polygon(e,l,h)},r},"hexagon"),x8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(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=u8r(e.directions,n,e,u),d=ed(r,u,a,h);return d.attr("style",e.style),qa(e,d),e.intersect=function(f){return ma.polygon(e,h,f)},r},"block_arrow"),w8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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 ed(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return ma.polygon(e,s,l)},r},"rect_left_inv_arrow"),T8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"lean_right"),C8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"lean_left"),k8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"trapezoid"),S8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"inv_trapezoid"),E8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"rect_right_inv_arrow"),A8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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 qa(e,u),e.intersect=function(h){const d=ma.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"),M8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(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&&(gB(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return qa(e,a),e.intersect=function(h){return ma.rect(e,h)},r},"rect"),R8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(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&&(gB(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{de.warn(`Unknown node property ${d}`)})}return qa(e,a),e.intersect=function(h){return ma.rect(e,h)},r},"composite"),L8r=x(async(t,e)=>{const{shapeSvg:r}=await po(t,e,"label",!0);de.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&&(gB(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{de.warn(`Unknown node property ${o}`)})}return qa(e,n),e.intersect=function(s){return ma.rect(e,s)},r},"labelRect");function gB(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(de.debug("add top border"),a(r)):s(r),e.includes("r")?(de.debug("add right border"),a(n)):s(n),e.includes("b")?(de.debug("add bottom border"),a(r)):s(r),e.includes("l")?(de.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(gB,"applyNodePropertyBorders");var I8r=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,de.info("Label text abc79",l,o,typeof o=="object");const u=await wh(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(yi(He())){const m=u.children[0],U=vt(u);h=m.getBoundingClientRect(),U.attr("width",h.width),U.attr("height",h.height)}de.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await wh(s,d.join?d.join("
    "):d,e.labelStyle,!0,!0);if(yi(He())){const m=p.children[0],U=vt(p);h=m.getBoundingClientRect(),U.attr("width",h.width),U.attr("height",h.height)}const g=e.padding/2;return vt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),vt(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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 qa(e,s),e.intersect=function(o){return ma.rect(e,o)},r},"stadium"),D8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,fu(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),de.info("Circle main"),qa(e,a),e.intersect=function(s){return de.info("Circle intersect",e,n.width/2+i,s),ma.circle(e,n.width/2+i,s)},r},"circle"),O8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await po(t,e,fu(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),de.info("DoubleCircle main"),qa(e,o),e.intersect=function(u){return de.info("DoubleCircle intersect",e,n.width/2+i+a,u),ma.circle(e,n.width/2+i+a,u)},r},"doublecircle"),_8r=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await po(t,e,fu(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=ed(r,i,a,s);return o.attr("style",e.style),qa(e,o),e.intersect=function(l){return ma.polygon(e,s,l)},r},"subroutine"),P8r=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),qa(e,n),e.intersect=function(i){return ma.circle(e,7,i)},r},"start"),wye=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return qa(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return ma.rect(e,o)},n},"forkJoin"),B8r=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),qa(e,i),e.intersect=function(a){return ma.circle(e,7,a)},r},"end"),$8r=x(async(t,e)=>{var S;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=(S=e.classData.annotations)==null?void 0:S[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",U=await wh(f,m,e.labelStyle,!0,!0);let y=U.getBBox();if(yi(He())){const E=U.children[0],A=vt(U);y=E.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(yi(He())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const v=await wh(f,b,e.labelStyle,!0,!0);vt(v).attr("class","classTitle");let w=v.getBBox();if(yi(He())){const E=v.children[0],A=vt(v);w=E.getBoundingClientRect(),A.attr("width",w.width),A.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const T=[];e.classData.members.forEach(async E=>{const A=E.getDisplayDetails();let R=A.displayText;yi(He())&&(R=R.replace(//g,">"));const _=await wh(f,R,A.cssStyle?A.cssStyle:e.labelStyle,!0,!0);let N=_.getBBox();if(yi(He())){const L=_.children[0],I=vt(_);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,T.push(_)}),d+=i;const k=[];if(e.classData.methods.forEach(async E=>{const A=E.getDisplayDetails();let R=A.displayText;yi(He())&&(R=R.replace(//g,">"));const _=await wh(f,R,A.cssStyle?A.cssStyle:e.labelStyle,!0,!0);let N=_.getBBox();if(yi(He())){const L=_.children[0],I=vt(_);N=L.getBoundingClientRect(),I.attr("width",N.width),I.attr("height",N.height)}N.width>h&&(h=N.width),d+=N.height+n,k.push(_)}),d+=i,g){let E=(h-y.width)/2;vt(U).attr("transform","translate( "+(-1*h/2+E)+", "+-1*d/2+")"),p=y.height+n}let C=(h-w.width)/2;return vt(v).attr("transform","translate( "+(-1*h/2+C)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,T.forEach(E=>{vt(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const A=E==null?void 0:E.getBBox();p+=((A==null?void 0:A.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,k.forEach(E=>{vt(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const A=E==null?void 0:E.getBBox();p+=((A==null?void 0:A.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),qa(e,o),e.intersect=function(E){return ma.rect(e,E)},s},"class_box"),Tye={rhombus:xye,composite:R8r,question:xye,rect:M8r,labelRect:L8r,rectWithTitle:I8r,choice:b8r,circle:D8r,doublecircle:O8r,stadium:N8r,hexagon:v8r,block_arrow:x8r,rect_left_inv_arrow:w8r,lean_right:T8r,lean_left:C8r,trapezoid:k8r,inv_trapezoid:S8r,rect_right_inv_arrow:E8r,cylinder:A8r,start:P8r,end:B8r,note:y8r,subroutine:_8r,fork:wye,join:wye,class_box:$8r},iR={},KXe=x(async(t,e,r)=>{let n,i;if(e.link){let a;He().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 Tye[e.shape](n,e,r)}else i=await Tye[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),iR[e.id]=n,e.haveCallback&&iR[e.id].attr("class",iR[e.id].attr("class")+" clickable"),n},"insertNode"),F8r=x(t=>{const e=iR[t.id];de.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 hse(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=xQ((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=xr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(hse,"getNodeFromBlock");async function ZXe(t,e,r){const n=hse(e,r,!1);if(n.type==="group")return;const i=xr(),a=await KXe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(ZXe,"calculateBlockSize");async function JXe(t,e,r){const n=hse(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=xr();await KXe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,F8r(n)}}x(JXe,"insertBlockPositioned");async function mB(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await mB(t,i.children,r,n)}x(mB,"performOperations");async function QXe(t,e,r){await mB(t,e,r,ZXe)}x(QXe,"calculateBlockSizes");async function eKe(t,e,r){await mB(t,e,r,JXe)}x(eKe,"insertBlocks");async function tKe(t,e,r,n,i){const a=new rl({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`;l8r(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 i8r(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),a8r({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(tKe,"insertEdges");var z8r=x(function(t,e){return e.db.getClasses()},"getClasses"),V8r=x(async function(t,e,r,n){const{securityLevel:i,block:a}=xr(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=vt("#i"+e));const l=vt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):vt(`[id="${e}"]`);Q7r(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 QXe(g,d,s);const m=HXe(s);if(await eKe(g,d,s),await tKe(g,p,f,s,e),m){const U=m,y=Math.max(1,Math.round(.125*(U.width/U.height))),b=U.height+y+10,v=U.width+10,{useMaxWidth:w}=a;Ga(u,b,v,!!w),de.debug("Here Bounds",m,U),u.attr("viewBox",`${U.x-5} ${U.y-5} ${U.width+10} ${U.height+10}`)}},"draw"),H8r={draw:V8r,getClasses:z8r},G8r={parser:b7r,db:$7r,renderer:H8r,styles:z7r};const W8r=Object.freeze(Object.defineProperty({__proto__:null,diagram:G8r},Symbol.toStringTag,{value:"Module"}));var rKe=/[─━│┃└┗├┣]/,nKe=/[└┗├┣]/,q8r=/[─━]/,Cye=/^[\s│┃]+$/,kye=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Sye=/^\s*%%/,j8r=" ";function iKe(t){return t.some(e=>rKe.test(e))}x(iKe,"isBoxDrawingFormat");function aKe(t){for(const e of t){const r=nKe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}x(aKe,"inferSegmentWidth");function sKe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}x(sKe,"remapErrorLines");function oKe(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:[]}]})),Y8r=x(()=>{Cd.reset(),Oi()},"clear"),X8r=x(()=>Cd.records.stack[0],"getRoot"),K8r=x(()=>Cd.records.cnt,"getCount"),Z8r=An.treeView,J8r=x(()=>na(Z8r,xr().treeView),"getConfig"),Q8r=x((t,e,r,n,i,a)=>{for(;t<=Cd.records.stack[Cd.records.stack.length-1].level;)Cd.records.stack.pop();const s={id:Cd.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Cd.records.stack[Cd.records.stack.length-1].children.push(s),Cd.records.stack.push(s)},"addNode"),evr={clear:Y8r,addNode:Q8r,getRoot:X8r,getCount:K8r,getConfig:J8r,getAccTitle:ia,getAccDescription:sa,getDiagramTitle:Yi,setAccDescription:aa,setAccTitle:qi,setDiagramTitle:ra},qK=evr,tvr=x(t=>{ec(t,qK);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?Dn(u,xr()):void 0;qK.addNode(r,n,a,s,l,h)}},"populate"),rvr={parse:x(async t=>{const{text:e,lineMap:r}=oKe(t);try{const n=await Qu("treeView",e);de.debug(n),tvr(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=sKe(n.message,r)),n}},"parse")},kC={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function lKe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}x(lKe,"detectIcon");function jK(t,e){return t.includes(":")?t:t in kC.icons||!e?`${kC.prefix}:${t}`:`${e}:${t}`}x(jK,"qualifyIcon");function dse(t,e){if(t.icon!=="none"){if(t.icon)return jK(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=lKe(t.name,e);if(r==="none")return;if(r)return jK(r,e.defaultIconPack)}return`${kC.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}x(dse,"getNodeIcon");CQ([{name:kC.prefix,icons:kC}]);var YK=14,nvr=4,ivr=16,cKe=x((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),avr=x(async(t,e,r,n)=>{const i=new Set,a=x(l=>{const u=dse(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 D0(l,{height:YK,width:YK})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",cKe(n,l)).html(u)},"injectIconDefs"),svr=x((t,e,r,n,i,a)=>{var b;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=YK+nvr,u=dse(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${cKe(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 U=m+p,y=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:y,height:g},(b=r.cssClass)!=null&&b.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:U,centerY:e+g/2}},"positionLabel"),Eye=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),ovr=x((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=x((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),U=svr(m,i,f,d,p,n);s.push(U);const{height:y,width:b}=f.BBox;Eye(d,m-p.rowIndent,i+y/2,m,i+y/2,p.lineThickness),a=Math.max(a,m+b),i+=y},"drawNode"),l=x((d,f=0)=>{o(t,d,r,f),d.children.forEach(U=>{l(U,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y:U,height:y}=d.children[d.children.length-1].BBox;Eye(t,p+r.paddingX,g+m,p+r.paddingX,U+y/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))+ivr;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"),lvr=x(async(t,e,r,n)=>{de.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=sl(e);await avr(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=ovr(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),Ga(o,u,h,s.useMaxWidth)},"draw"),cvr={draw:lvr},uvr=cvr,hvr={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},dvr=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=na(hvr,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -5661,16 +5794,16 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error } .treeView-node-description { font-size: ${e}; - fill: ${s}; + fill: ${a}; font-style: italic; white-space: pre; } .treeView-highlight-bg { - fill: ${a}; + fill: ${s}; stroke: ${o}; stroke-width: 1; } - `},"styles"),WTr=GTr,qTr={db:FK,renderer:VTr,parser:NTr,styles:WTr};const UTr=Object.freeze(Object.defineProperty({__proto__:null,diagram:qTr},Symbol.toStringTag,{value:"Module"}));var r_={exports:{}},n_={exports:{}},i_={exports:{}},jTr=i_.exports,vbe;function YTr(){return vbe||(vbe=1,(function(t,e){(function(n,i){t.exports=i()})(jTr,function(){return(function(r){var n={};function i(s){if(n[s])return n[s].exports;var a=n[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=r,i.c=n,i.i=function(s){return s},i.d=function(s,a,o){i.o(s,a)||Object.defineProperty(s,a,{configurable:!1,enumerable:!0,get:o})},i.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(a,"a",a),a},i.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},i.p="",i(i.s=28)})([(function(r,n,i){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1e3,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,r.exports=s}),(function(r,n,i){var s=i(2),a=i(8),o=i(9);function l(h,d,f){s.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(s.prototype);for(var u in s)l[u]=s[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=a.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 s(a){this.vGraphObject=a}r.exports=s}),(function(r,n,i){var s=i(2),a=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),s.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.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(s.prototype);for(var f in s)d[f]=s[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==a.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 s=i(0);function a(){}for(var o in s)a[o]=s[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=a}),(function(r,n,i){function s(a,o){a==null&&o==null?(this.x=0,this.y=0):(this.x=a,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(a){this.x=a},s.prototype.setY=function(a){this.y=a},s.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},r.exports=s}),(function(r,n,i){var s=i(2),a=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,b){s.call(this,b),this.estimatedSize=a.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(s.prototype);for(var m in s)g[m]=s[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,b){if(v==null&&b==null){var x=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(x)>-1)throw"Node already in graph!";return x.owner=this,this.getNodes().push(x),x}else{var T=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(v.owner==b.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=b.owner?null:(T.source=v,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),b!=v&&b.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 b=v.edges.slice(),x,T=b.length,C=0;C-1&&E>-1))throw"Source and/or target doesn't know this edge!";x.source.edges.splice(k,1),x.target!=x.source&&x.target.edges.splice(E,1);var S=x.source.owner.getEdges().indexOf(x);if(S==-1)throw"Not in owner's edge list!";x.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=a.MAX_VALUE,v=a.MAX_VALUE,b,x,T,C=this.getNodes(),S=C.length,k=0;kb&&(y=b),v>x&&(v=x)}return y==a.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[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=a.MAX_VALUE,b=-a.MAX_VALUE,x=a.MAX_VALUE,T=-a.MAX_VALUE,C,S,k,E,A,M=this.nodes,R=M.length,P=0;PC&&(v=C),bk&&(x=k),TC&&(v=C),bk&&(x=k),T=this.nodes.length){var R=0;b.forEach(function(P){P.owner==y&&R++}),R==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var s,a=i(1);function o(l){s=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 s){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]=b,L=!0):(u[0]=y,u[1]=m,L=!0):$===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=x,u[1]=b,L=!0)),-O===D?f>h?(u[2]=A,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===D&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=R,u[3]=M,I=!0)),L&&I)return!1;if(h>f?d>p?(B=this.getCardinalDirection($,D,4),z=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-$,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-$,D,1),z=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection($,D,2),z=this.getCardinalDirection(O,D,4)),!L)switch(B){case 1:F=m,V=h+-C/D,u[0]=V,u[1]=F;break;case 2:V=x,F=d+T*D,u[0]=V,u[1]=F;break;case 3:F=b,V=h+C/D,u[0]=V,u[1]=F;break;case 4:V=v,F=d+-T*D,u[0]=V,u[1]=F;break}if(!I)switch(z){case 1:G=k,H=f+-N/D,u[2]=H,u[3]=G;break;case 2:H=R,G=p+P*D,u[2]=H,u[3]=G;break;case 3:G=M,H=f+N/D,u[2]=H,u[3]=G;break;case 4:H=A,G=p+-P*D,u[2]=H,u[3]=G;break}}return!1},a.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},a.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,b=h.y,x=void 0,T=void 0,C=void 0,S=void 0,k=void 0,E=void 0,A=void 0,M=void 0,R=void 0;return C=g-f,k=d-p,A=p*f-d*g,S=b-y,E=m-v,M=v*y-m*b,R=C*E-S*k,R===0?null:(x=(k*M-E*A)/R,T=(S*A-C*M)/R,new s(x,T))},a.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var b=(-m+Math.sqrt(m*m-4*g*y))/(2*g),x=(-m-Math.sqrt(m*m-4*g*y))/(2*g),T=null;return b>=0&&b<=1?[b]:x>=0&&x<=1?[x]:T}else return null},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,r.exports=a}),(function(r,n,i){function s(){}s.sign=function(a){return a>0?1:a<0?-1:0},s.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},s.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},r.exports=s}),(function(r,n,i){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s}),(function(r,n,i){var s=(function(){function d(f,p){for(var g=0;g"u"?"undefined":s(o);return o==null||l!="object"&&l!="function"},r.exports=a}),(function(r,n,i){function s(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),T.add(E);for(var A=E.getEdges(),x=0;x-1&&k.splice(N,1)}T=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),x=0;x0){for(var b=this.edgeToDummyNodes.get(v),x=0;x=0&&y.splice(M,1);var R=S.getNeighborsList();R.forEach(function(L){if(v.indexOf(L)<0){var I=b.get(L),$=I-1;$==1&&E.push(L),b.set(L,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(x=!0,T=y[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s}),(function(r,n,i){var s=i(5);function a(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}a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(o){this.lworldExtX=o},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(o){this.lworldExtY=o},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},a.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},a.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},a.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},a.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},a.prototype.inverseTransformPoint=function(o){var l=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=a}),(function(r,n,i){function s(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,b,x=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;mC||T>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*b)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(x>C||T>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*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=x.length||C>=x[0].length)){for(var S=0;Sd}}]),u})();r.exports=l}),(function(r,n,i){function s(){}s.svd=function(a){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=a.length,this.n=a[0].length;var o=Math.min(this.m,this.n);this.s=(function(_t){for(var dt=[];_t-- >0;)dt.push(0);return dt})(Math.min(this.m+1,this.n)),this.U=(function(_t){var dt=function xe(Lt){if(Lt.length==0)return 0;for(var wt=[],mt=0;mt0;)dt.push(0);return dt})(this.n),u=(function(_t){for(var dt=[];_t-- >0;)dt.push(0);return dt})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var D=O+1;D=0;W--){if((function(_t,dt){return _t&&dt})(W0;){var te=void 0,_e=void 0;for(te=L-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ie*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===L-2)_e=4;else{var $e=void 0;for($e=L-1;$e>=te&&$e!==te;$e--){var Ve=($e!==L?Math.abs(l[$e]):0)+($e!==te+1?Math.abs(l[$e-1]):0);if(Math.abs(this.s[$e])<=me+ie*Ve){this.s[$e]=0;break}}$e===te?_e=3:$e===L-1?_e=1:(_e=2,te=$e)}switch(te++,_e){case 1:{var ce=l[L-2];l[L-2]=0;for(var he=L-2;he>=te;he--){var Te=s.hypot(this.s[he],ce),ge=this.s[he]/Te,ze=ce/Te;this.s[he]=Te,he!==te&&(ce=-ze*l[he-1],l[he-1]=ge*l[he-1]);for(var we=0;we=this.s[te+1]);){var kt=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=kt,teMath.abs(o)?(l=o/a,l=Math.abs(a)*Math.sqrt(1+l*l)):o!=0?(l=a/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=s}),(function(r,n,i){var s=(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;a(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)}},a.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,b=u(551).LayoutConstants,x=u(551).Point,T=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,A=u(551).LGraph,M=u(551).Transform,R=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 L=new d(this);return this.graphManager=L,L},P.prototype.newGraph=function(L){return new f(null,this.graphManager,L)},P.prototype.newNode=function(L){return new p(this.graphManager,L)},P.prototype.newEdge=function(L){return new g(null,null,L)},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 L=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return L&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(B){return I.has(B)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var L=this.getFlatForest();if(L.length>0)this.positionNodesRadially(L);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(D){return L.has(D)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var L=this.graphManager.getAllNodes(),I={},$=0;$0&&this.updateDisplacements();for(var $=0;$0&&(O.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Z){L.fixedNodesOnHorizontal.add(Z),L.fixedNodesOnVertical.add(Z)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,$=0;$=2*Z.length/3;ie--)Q=Math.floor(Math.random()*(ie+1)),ne=Z[ie],Z[ie]=Z[Q],Z[Q]=ne;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 Q=z.has(Z.left)?z.get(Z.left):Z.left,ne=z.has(Z.right)?z.get(Z.right):Z.right;L.nodesInRelativeHorizontal.includes(Q)||(L.nodesInRelativeHorizontal.push(Q),L.nodeToRelativeConstraintMapHorizontal.set(Q,[]),L.dummyToNodeForVerticalAlignment.has(Q)?L.nodeToTempPositionMapHorizontal.set(Q,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(Q)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(Q,L.idToNodeMap.get(Q).getCenterX())),L.nodesInRelativeHorizontal.includes(ne)||(L.nodesInRelativeHorizontal.push(ne),L.nodeToRelativeConstraintMapHorizontal.set(ne,[]),L.dummyToNodeForVerticalAlignment.has(ne)?L.nodeToTempPositionMapHorizontal.set(ne,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(ne)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(ne,L.idToNodeMap.get(ne).getCenterX())),L.nodeToRelativeConstraintMapHorizontal.get(Q).push({right:ne,gap:Z.gap}),L.nodeToRelativeConstraintMapHorizontal.get(ne).push({left:Q,gap:Z.gap})}else{var ie=V.has(Z.top)?V.get(Z.top):Z.top,me=V.has(Z.bottom)?V.get(Z.bottom):Z.bottom;L.nodesInRelativeVertical.includes(ie)||(L.nodesInRelativeVertical.push(ie),L.nodeToRelativeConstraintMapVertical.set(ie,[]),L.dummyToNodeForHorizontalAlignment.has(ie)?L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(ie)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(ie).getCenterY())),L.nodesInRelativeVertical.includes(me)||(L.nodesInRelativeVertical.push(me),L.nodeToRelativeConstraintMapVertical.set(me,[]),L.dummyToNodeForHorizontalAlignment.has(me)?L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(me).getCenterY())),L.nodeToRelativeConstraintMapVertical.get(ie).push({bottom:me,gap:Z.gap}),L.nodeToRelativeConstraintMapVertical.get(me).push({top:ie,gap:Z.gap})}});else{var G=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(Z){if(Z.left){var Q=z.has(Z.left)?z.get(Z.left):Z.left,ne=z.has(Z.right)?z.get(Z.right):Z.right;G.has(Q)?G.get(Q).push(ne):G.set(Q,[ne]),G.has(ne)?G.get(ne).push(Q):G.set(ne,[Q])}else{var ie=V.has(Z.top)?V.get(Z.top):Z.top,me=V.has(Z.bottom)?V.get(Z.bottom):Z.bottom;W.has(ie)?W.get(ie).push(me):W.set(ie,[me]),W.has(me)?W.get(me).push(ie):W.set(me,[ie])}});var K=function(Q,ne){var ie=[],me=[],te=new R,_e=new Set,$e=0;return Q.forEach(function(Ve,ce){if(!_e.has(ce)){ie[$e]=[],me[$e]=!1;var he=ce;for(te.push(he),_e.add(he),ie[$e].push(he);te.length!=0;){he=te.shift(),ne.has(he)&&(me[$e]=!0);var Te=Q.get(he);Te.forEach(function(ge){_e.has(ge)||(te.push(ge),_e.add(ge),ie[$e].push(ge))})}$e++}}),{components:ie,isFixed:me}},q=K(G,L.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var oe=K(W,L.fixedNodesOnVertical);this.componentsOnVertical=oe.components,this.fixedComponentsOnVertical=oe.isFixed}}},P.prototype.updateDisplacements=function(){var L=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(oe){var Z=L.idToNodeMap.get(oe.nodeId);Z.displacementX=0,Z.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$1){var V;for(V=0;VO&&(O=Math.floor(z.y)),B=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(b.WORLD_CENTER_X-z.x/2,b.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(L,I,$){var O=Math.max(this.maxDiagonalInTree(L),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var D=A.calculateBounds(L),B=new M;B.setDeviceOrgX(D.getMinX()),B.setDeviceOrgY(D.getMinY()),B.setWorldOrgX($.x),B.setWorldOrgY($.y);for(var z=0;z1;){var ne=Q[0];Q.splice(0,1);var ie=W.indexOf(ne);ie>=0&&W.splice(ie,1),oe--,K--}I!=null?Z=(W.indexOf(Q[0])+1)%oe:Z=0;for(var me=Math.abs(O-$)/K,te=Z;q!=K;te=++te%oe){var _e=W[te].getOtherEnd(L);if(_e!=I){var $e=($+q*me)%360,Ve=($e+me)%360;P.branchRadialLayout(_e,L,$e,Ve,D+B,B),q++}}},P.maxDiagonalInTree=function(L){for(var I=k.MIN_VALUE,$=0;$I&&(I=D)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var L=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(I[V]=[]),I[V]=I[V].concat(B)}Object.keys(I).forEach(function(F){if(I[F].length>1){var H="DummyCompound_"+F;L.memberGroups[H]=I[F];var G=I[F][0].getParent(),W=new p(L.graphManager);W.id=H,W.paddingLeft=G.paddingLeft||0,W.paddingRight=G.paddingRight||0,W.paddingBottom=G.paddingBottom||0,W.paddingTop=G.paddingTop||0,L.idToDummyNode[H]=W;var K=L.getGraphManager().add(L.newGraph(),W),q=G.getChild();q.add(W);for(var oe=0;oeD?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(B+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>B?(O.rect.y-=(O.labelHeight-B)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-B)/2):O.labelPosVertical=="bottom"&&O.setHeight(B+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var L=this.compoundOrder.length-1;L>=0;L--){var I=this.compoundOrder[L],$=I.id,O=I.paddingLeft,D=I.paddingTop,B=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,D,B,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var L=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=L.idToDummyNode[$],D=O.paddingLeft,B=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;L.adjustLocations(I[$],O.rect.x,O.rect.y,D,B,z,V)})},P.prototype.getToBeTiled=function(L){var I=L.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=L.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),D=0;D0)return this.toBeTiled[I]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(L){L.id;for(var I=L.getEdges(),$=0,O=0;OG&&(G=K.rect.height)}$+=G+L.verticalPadding}},P.prototype.tileCompoundMembers=function(L,I){var $=this;this.tiledMemberPack=[],Object.keys(L).forEach(function(O){var D=I[O];if($.tiledMemberPack[O]=$.tileNodes(L[O],D.paddingLeft+D.paddingRight),D.rect.width=$.tiledMemberPack[O].width,D.rect.height=$.tiledMemberPack[O].height,D.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=D.rect.width,z=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(B+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>B?(D.rect.x-=(D.labelWidth-B)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-B)/2):D.labelPosHorizontal=="right"&&D.setWidth(B+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(z+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>z?(D.rect.y-=(D.labelHeight-z)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-z)/2):D.labelPosVertical=="bottom"&&D.setHeight(z+D.labelHeight))}})},P.prototype.tileNodes=function(L,I){var $=this.tileNodesByFavoringDim(L,I,!0),O=this.tileNodesByFavoringDim(L,I,!1),D=this.getOrgRatio($),B=this.getOrgRatio(O),z;return BV&&(V=oe.getWidth())});var F=B/D,H=z/D,G=Math.pow($-O,2)+4*(F+O)*(H+$)*D,W=(O-$+Math.sqrt(G))/(2*(F+O)),K;I?(K=Math.ceil(W),K==W&&K++):K=Math.floor(W);var q=K*(F+O)-O;return V>q&&(q=V),q+=O*2,q},P.prototype.tileNodesByFavoringDim=function(L,I,$){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};B&&(z.idealRowWidth=this.calcIdealRowWidth(L,$));var V=function(Z){return Z.rect.width*Z.rect.height},F=function(Z,Q){return V(Q)-V(Z)};L.sort(function(oe,Z){var Q=F;return z.idealRowWidth?(Q=B,Q(oe.id,Z.id)):Q(oe,Z)});for(var H=0,G=0,W=0;W0&&(z+=L.horizontalPadding),L.rowWidth[$]=z,L.width0&&(V+=L.verticalPadding);var F=0;V>L.rowHeight[$]&&(F=L.rowHeight[$],L.rowHeight[$]=V,F=L.rowHeight[$]-F),L.height+=F,L.rows[$].push(I)},P.prototype.getShortestRowIndex=function(L){for(var I=-1,$=Number.MAX_VALUE,O=0;O$&&(I=O,$=L.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(L,I,$){if(L.idealRowWidth){var O=L.rows.length-1,D=L.rowWidth[O];return D+I+L.horizontalPadding<=L.idealRowWidth}var B=this.getShortestRowIndex(L);if(B<0)return!0;var z=L.rowWidth[B];if(z+L.horizontalPadding+I<=L.width)return!0;var V=0;L.rowHeight[B]<$&&B>0&&(V=$+L.verticalPadding-L.rowHeight[B]);var F;L.width-z>=I+L.horizontalPadding?F=(L.height+V)/(z+I+L.horizontalPadding):F=(L.height+V)/L.width,V=$+L.verticalPadding;var H;return L.widthB&&I!=$){O.splice(-1,1),L.rows[$].push(D),L.rowWidth[I]=L.rowWidth[I]-B,L.rowWidth[$]=L.rowWidth[$]+B,L.width=L.rowWidth[instance.getLongestRowIndex(L)];for(var z=Number.MIN_VALUE,V=0;Vz&&(z=O[V].height);I>0&&(z+=L.verticalPadding);var F=L.rowHeight[I]+L.rowHeight[$];L.rowHeight[I]=z,L.rowHeight[$]0)for(var q=D;q<=B;q++)K[0]+=this.grid[q][z-1].length+this.grid[q][z].length-1;if(B0)for(var q=z;q<=V;q++)K[3]+=this.grid[D-1][q].length+this.grid[D][q].length-1;for(var oe=k.MAX_VALUE,Z,Q,ne=0;ne{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,b=0;b{function h(y){if(Array.isArray(y)){for(var v=0,b=Array(y.length);v0){var kt=0;Le.forEach(function(ot){fe=="horizontal"?(je.set(ot,x.has(ot)?T[x.get(ot)]:Me.get(ot)),kt+=je.get(ot)):(je.set(ot,x.has(ot)?C[x.get(ot)]:Me.get(ot)),kt+=je.get(ot))}),kt=kt/Le.length,gt.forEach(function(ot){ee.has(ot)||je.set(ot,kt)})}else{var Et=0;gt.forEach(function(ot){fe=="horizontal"?Et+=x.has(ot)?T[x.get(ot)]:Me.get(ot):Et+=x.has(ot)?C[x.get(ot)]:Me.get(ot)}),Et=Et/gt.length,gt.forEach(function(ot){je.set(ot,Et)})}});for(var Fe=function(){var Le=Ze.shift(),kt=X.get(Le);kt.forEach(function(Et){if(je.get(Et.id)ot&&(ot=Mt),OrHt&&(Ht=Or)}}catch(jr){dt=!0,xe=jr}finally{try{!_t&&Lt.return&&Lt.return()}finally{if(dt)throw xe}}var Ee=(kt+ot)/2-(Et+Ht)/2,it=!0,pt=!1,bt=void 0;try{for(var nr=gt[Symbol.iterator](),$r;!(it=($r=nr.next()).done);it=!0){var kr=$r.value;je.set(kr,je.get(kr)+Ee)}}catch(jr){pt=!0,bt=jr}finally{try{!it&&nr.return&&nr.return()}finally{if(pt)throw bt}}})}return je},N=function(X){var fe=0,ee=0,Me=0,Re=0;if(X.forEach(function(Oe){Oe.left?T[x.get(Oe.left)]-T[x.get(Oe.right)]>=0?fe++:ee++:C[x.get(Oe.top)]-C[x.get(Oe.bottom)]>=0?Me++:Re++}),fe>ee&&Me>Re)for(var Ke=0;Keee)for(var Ne=0;NeRe)for(var je=0;je1)v.fixedNodeConstraint.forEach(function(ue,X){O[X]=[ue.position.x,ue.position.y],D[X]=[T[x.get(ue.nodeId)],C[x.get(ue.nodeId)]]}),B=!0;else if(v.alignmentConstraint)(function(){var ue=0;if(v.alignmentConstraint.vertical){for(var X=v.alignmentConstraint.vertical,fe=function(je){var Oe=new Set;X[je].forEach(function(st){Oe.add(st)});var Ze=new Set([].concat(h(Oe)).filter(function(st){return V.has(st)})),Fe=void 0;Ze.size>0?Fe=T[x.get(Ze.values().next().value)]:Fe=R(Oe).x,X[je].forEach(function(st){O[ue]=[Fe,C[x.get(st)]],D[ue]=[T[x.get(st)],C[x.get(st)]],ue++})},ee=0;ee0?Fe=T[x.get(Ze.values().next().value)]:Fe=R(Oe).y,Me[je].forEach(function(st){O[ue]=[T[x.get(st)],Fe],D[ue]=[T[x.get(st)],C[x.get(st)]],ue++})},Ke=0;KeW&&(W=G[q].length,K=q);if(W0){var we={x:0,y:0};v.fixedNodeConstraint.forEach(function(ue,X){var fe={x:T[x.get(ue.nodeId)],y:C[x.get(ue.nodeId)]},ee=ue.position,Me=M(ee,fe);we.x+=Me.x,we.y+=Me.y}),we.x/=v.fixedNodeConstraint.length,we.y/=v.fixedNodeConstraint.length,T.forEach(function(ue,X){T[X]+=we.x}),C.forEach(function(ue,X){C[X]+=we.y}),v.fixedNodeConstraint.forEach(function(ue){T[x.get(ue.nodeId)]=ue.position.x,C[x.get(ue.nodeId)]=ue.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ae=v.alignmentConstraint.vertical,qe=function(X){var fe=new Set;Ae[X].forEach(function(Re){fe.add(Re)});var ee=new Set([].concat(h(fe)).filter(function(Re){return V.has(Re)})),Me=void 0;ee.size>0?Me=T[x.get(ee.values().next().value)]:Me=R(fe).x,fe.forEach(function(Re){V.has(Re)||(T[x.get(Re)]=Me)})},le=0;le0?Me=C[x.get(ee.values().next().value)]:Me=R(fe).y,fe.forEach(function(Re){V.has(Re)||(C[x.get(Re)]=Me)})},re=0;re{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(45);return a})()})})(n_)),n_.exports}var ZTr=r_.exports,xbe;function QTr(){return xbe||(xbe=1,(function(t,e){(function(n,i){t.exports=i(KTr())})(ZTr,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,b=!1,x=void 0;try{for(var T=g[Symbol.iterator](),C;!(v=(C=T.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){b=!0,x=S}finally{try{!v&&T.return&&T.return()}finally{if(b)throw x}}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&&B.merge(H)});for(var z=0;z1){C=x[0],S=C.connectedEdges().length,x.forEach(function(D){D.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,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(T=(E=k.next()).done);T=!0){var A=E.value,M=h(A,2),R=M[0],P=M[1],N=m.cy.getElementById(R);if(N){var L=N.boundingBox(),I=g.xCoords[P]-L.w/2,$=g.xCoords[P]+L.w/2,O=g.yCoords[P]-L.h/2,D=g.yCoords[P]+L.h/2;Iv&&(v=$),Ox&&(x=D)}}}catch(H){C=!0,S=H}finally{try{!T&&k.return&&k.return()}finally{if(C)throw S}}var B=p.x-(v+y)/2,z=p.y-(x+b)/2;g.xCoords=g.xCoords.map(function(H){return H+B}),g.yCoords=g.yCoords.map(function(H){return H+z})}else{Object.keys(g).forEach(function(H){var G=g[H],W=G.getRect().x,K=G.getRect().x+G.getRect().width,q=G.getRect().y,oe=G.getRect().y+G.getRect().height;Wv&&(v=K),qx&&(x=oe)});var V=p.x-(v+y)/2,F=p.y-(x+b)/2;Object.keys(g).forEach(function(H){var G=g[H];G.setCenter(G.getCenterX()+V,G.getCenterY()+F)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,x=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,A=p.descendants().not(":parent"),M=A.length,R=0;RC&&(v=C),bk&&(x=k),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,b=function(T,C){var S=T.cy,k=T.eles,E=k.nodes(),A=k.edges(),M=void 0,R=void 0,P=void 0,N={};T.randomize&&(M=C.nodeIndexes,R=C.xCoords,P=C.yCoords);var L=function(H){return typeof H=="function"},I=function(H,G){return L(H)?H(G):H},$=h.calcParentsWithoutChildren(S,k),O=function F(H,G,W,K){for(var q=G.length,oe=0;oe0){var te=void 0;te=W.getGraphManager().add(W.newGraph(),ne),F(te,Q,W,K)}}},D=function(H,G,W){for(var K=0,q=0,oe=0;oe0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=K/q:L(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)},B=function(H,G){G.fixedNodeConstraint&&(H.constraints.fixedNodeConstraint=G.fixedNodeConstraint),G.alignmentConstraint&&(H.constraints.alignmentConstraint=G.alignmentConstraint),G.relativePlacementConstraint&&(H.constraints.relativePlacementConstraint=G.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,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,T),D(z,V,A),B(z,T),z.runLayout(),N};o.exports={coseLayout:b}}),212:((o,l,u)=>{var h=(function(){function T(C,S){for(var k=0;k0)if($){var B=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,B),P.forEach(function(Ve){var ce=Ve.boundingBox();N.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Ve){k.eles=Ve,M.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,F=[],H=[],G=0,W={nodeIndexes:V,xCoords:F,yCoords:H},K=[];if(P.forEach(function(Ve,ce){Ve.edges().length==0&&(Ve.nodes().forEach(function(he,Te){z.merge(Ve.nodes()[Te]),he.isParent()||(W.nodeIndexes.set(Ve.nodes()[Te].id(),G++),W.xCoords.push(Ve.nodes()[0].position().x),W.yCoords.push(Ve.nodes()[0].position().y))}),K.push(ce))}),z.length>1){var q=z.boundingBox();N.push({x:q.x1+q.w/2,y:q.y1+q.h/2}),P.push(z),M.push(W);for(var oe=K.length-1;oe>=0;oe--)P.splice(K[oe],1),M.splice(K[oe],1),N.splice(K[oe],1)}}P.forEach(function(Ve,ce){k.eles=Ve,R.push(v(k,M[ce])),p.relocateComponent(N[ce],R[ce],k)})}else P.forEach(function(Ve,ce){p.relocateComponent(N[ce],M[ce],k)});var Z=new Set;if(P.length>1){var Q=[],ne=A.filter(function(Ve){return Ve.css("display")=="none"});P.forEach(function(Ve,ce){var he=void 0;if(k.quality=="draft"&&(he=M[ce].nodeIndexes),Ve.nodes().not(ne).length>0){var Te={};Te.edges=[],Te.nodes=[];var ge=void 0;Ve.nodes().not(ne).forEach(function(ze){if(k.quality=="draft")if(!ze.isParent())ge=he.get(ze.id()),Te.nodes.push({x:M[ce].xCoords[ge]-ze.boundingbox().w/2,y:M[ce].yCoords[ge]-ze.boundingbox().h/2,width:ze.boundingbox().w,height:ze.boundingbox().h});else{var we=p.calcBoundingBox(ze,M[ce].xCoords,M[ce].yCoords,he);Te.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else R[ce][ze.id()]&&Te.nodes.push({x:R[ce][ze.id()].getLeft(),y:R[ce][ze.id()].getTop(),width:R[ce][ze.id()].getWidth(),height:R[ce][ze.id()].getHeight()})}),Ve.edges().forEach(function(ze){var we=ze.source(),Ae=ze.target();if(we.css("display")!="none"&&Ae.css("display")!="none")if(k.quality=="draft"){var qe=he.get(we.id()),le=he.get(Ae.id()),pe=[],Ce=[];if(we.isParent()){var re=p.calcBoundingBox(we,M[ce].xCoords,M[ce].yCoords,he);pe.push(re.topLeftX+re.width/2),pe.push(re.topLeftY+re.height/2)}else pe.push(M[ce].xCoords[qe]),pe.push(M[ce].yCoords[qe]);if(Ae.isParent()){var Y=p.calcBoundingBox(Ae,M[ce].xCoords,M[ce].yCoords,he);Ce.push(Y.topLeftX+Y.width/2),Ce.push(Y.topLeftY+Y.height/2)}else Ce.push(M[ce].xCoords[le]),Ce.push(M[ce].yCoords[le]);Te.edges.push({startX:pe[0],startY:pe[1],endX:Ce[0],endY:Ce[1]})}else R[ce][we.id()]&&R[ce][Ae.id()]&&Te.edges.push({startX:R[ce][we.id()].getCenterX(),startY:R[ce][we.id()].getCenterY(),endX:R[ce][Ae.id()].getCenterX(),endY:R[ce][Ae.id()].getCenterY()})}),Te.nodes.length>0&&(Q.push(Te),Z.add(ce))}});var ie=I.packComponents(Q,k.randomize).shifts;if(k.quality=="draft")M.forEach(function(Ve,ce){var he=Ve.xCoords.map(function(ge){return ge+ie[ce].dx}),Te=Ve.yCoords.map(function(ge){return ge+ie[ce].dy});Ve.xCoords=he,Ve.yCoords=Te});else{var me=0;Z.forEach(function(Ve){Object.keys(R[Ve]).forEach(function(ce){var he=R[Ve][ce];he.setCenter(he.getCenterX()+ie[me].dx,he.getCenterY()+ie[me].dy)}),me++})}}}else{var O=k.eles.boundingBox();if(N.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var D=m(k);M.push(D)}k.quality=="default"||k.quality=="proof"?(R.push(v(k,M[0])),p.relocateComponent(N[0],R[0],k)):p.relocateComponent(N[0],M[0],k)}var te=function(ce,he){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=he);var Te=void 0,ge=void 0,ze=ce.data("id");return R.forEach(function(Ae){ze in Ae&&(Te={x:Ae[ze].getRect().getCenterX(),y:Ae[ze].getRect().getCenterY()},ge=Ae[ze])}),k.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:ce.position("x"),y:ce.position("y")}),{x:Te.x,y:Te.y}}else{var we=void 0;return M.forEach(function(Ae){var qe=Ae.nodeIndexes.get(ce.id());qe!=null&&(we={x:Ae.xCoords[qe],y:Ae.yCoords[qe]})}),we==null&&(we={x:ce.position("x"),y:ce.position("y")}),{x:we.x,y:we.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var _e=p.calcParentsWithoutChildren(E,A),$e=A.filter(function(Ve){return Ve.css("display")=="none"});k.eles=A.not($e),A.nodes().not(":parent").not($e).layoutPositions(S,k,te),_e.length>0&&_e.forEach(function(Ve){Ve.position(te(Ve))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T})();o.exports=x}),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,b=v.nodes(),x=v.nodes(":parent"),T=new Map,C=new Map,S=new Map,k=[],E=[],A=[],M=[],R=[],P=[],N=[],L=[],I=void 0,$=1e8,O=1e-9,D=m.piTol,B=m.samplingType,z=m.nodeSeparation,V=void 0,F=function(){for(var X=0,fe=0,ee=!1;fe=Re;){Ne=Me[Re++];for(var Pe=k[Ne],gt=0;gtZe&&(Ze=R[kt],Fe=kt)}return Fe},G=function(X){var fe=void 0;if(X){fe=Math.floor(Math.random()*I);for(var Me=0;Me=1)break;Oe=je}for(var st=0;st=1)break;Oe=je}for(var gt=0;gt0&&(fe.isParent()?k[X].push(S.get(fe.id())):k[X].push(fe.id()))})});var $e=function(X){var fe=C.get(X),ee=void 0;T.get(X).forEach(function(Me){y.getElementById(Me).isParent()?ee=S.get(Me):ee=Me,k[fe].push(ee),k[C.get(ee)].push(X)})},Ve=!0,ce=!1,he=void 0;try{for(var Te=T.keys()[Symbol.iterator](),ge;!(Ve=(ge=Te.next()).done);Ve=!0){var ze=ge.value;$e(ze)}}catch(ue){ce=!0,he=ue}finally{try{!Ve&&Te.return&&Te.return()}finally{if(ce)throw he}}I=C.size;var we=void 0;if(I>2){V=I{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function s(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,s),u.exports}var a=s(579);return a})()})})(r_)),r_.exports}var JTr=QTr();const e5r=wm(JTr);var wbe={L:"left",R:"right",T:"top",B:"bottom"},Tbe={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")},pR={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")},t5r=w(function(t){return El(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Cbe=w(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),El=w(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),dm=w(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),sae=w(function(t,e){const r=El(t)&&dm(e),n=dm(t)&&El(e);return r||n},"isArchitectureDirectionXY"),r5r=w(function(t){const e=t[0],r=t[1],n=El(e)&&dm(r),i=dm(e)&&El(r);return n||i},"isArchitecturePairXY"),n5r=w(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),HK=w(function(t,e){const r=`${t}${e}`;return n5r(r)?r:void 0},"getArchitectureDirectionPair"),i5r=w(function([t,e],r){const n=r[0],i=r[1];return El(n)?dm(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:El(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),s5r=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"),a5r=w(function(t,e){return sae(t,e)?"bend":El(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),o5r=w(function(t){return t.type==="service"},"isArchitectureService"),l5r=w(function(t){return t.type==="junction"},"isArchitectureJunction"),ZXe=w((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),QXe=w(t=>t.data(),"edgeData"),Yb=w(t=>t.data(),"nodeData"),c5r=En.architecture,i5,JXe=(i5=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=qi,this.getAccTitle=ns,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getAccDescription=ss,this.setAccDescription=is,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="",Oi()}addService({id:e,icon:r,in:n,title:i,iconText:s}){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:s,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(o5r)}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(l5r)}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:s,rhsInto:a,lhsGroup:o,rhsGroup:l,title:u}){if(!Cbe(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Cbe(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:s,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:a,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=a5r(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(ZXe(p,g),m)}if(f.lhsId===u){const m=HK(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=HK(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const s=new Set,a=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){s.add(f),a.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,b)=>{s.has(v)||(h.set(v,i5r([m,y],b)),d.push(v))})}}return h},"BFS"),l=[];for(;a.size>0;){const u=a.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 rs({...c5r,...xr().architecture})}getConfigField(e){return this.getConfig()[e]}},w(i5,"ArchitectureDB"),i5),u5r=w((t,e)=>{var r;ec(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"),eKe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await Ju("architecture",t);de.debug(e);const r=(n=eKe.parser)==null?void 0:n.yy;if(!(r instanceof JXe))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.");u5r(e,r)},"parse")},h5r=w(t=>` + `},"styles"),fvr=dvr,pvr={db:qK,renderer:uvr,parser:rvr,styles:fvr};const gvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:pvr},Symbol.toStringTag,{value:"Module"}));var aR={exports:{}},sR={exports:{}},oR={exports:{}},mvr=oR.exports,Aye;function Uvr(){return Aye||(Aye=1,(function(t,e){(function(n,i){t.exports=i()})(mvr,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,U){m==null&&U==null&&(U=g),a.call(this,U),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=U,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(U){if(U.target==p){if(U.source!=m)throw"Incorrect edge source!";g.push(U)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(U){if(!(U.source==m||U.target==m))throw"Incorrect edge source and/or target";(U.target==p||U.source==p)&&g.push(U)}),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 U=this.child.getNodes(),y=0;yg?(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 U=new h(g,m),y=p.inverseTransformPoint(U);this.setLocation(y.x,y.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(U,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=U,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.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(U,y,b){if(y==null&&b==null){var v=U;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var w=U;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(w.source=y,w.target=b,w.isInterGraph=!1,this.getEdges().push(w),y.edges.push(w),b!=y&&b.edges.push(w),w)}},g.prototype.remove=function(U){var y=U;if(U instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),v,w=b.length,T=0;T-1&&S>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(C,1),v.target!=v.source&&v.target.edges.splice(S,1);var k=v.source.owner.getEdges().indexOf(v);if(k==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var U=s.MAX_VALUE,y=s.MAX_VALUE,b,v,w,T=this.getNodes(),k=T.length,C=0;Cb&&(U=b),y>v&&(y=v)}return U==s.MAX_VALUE?null:(T[0].getParent().paddingLeft!=null?w=T[0].getParent().paddingLeft:w=this.margin,this.left=y-w,this.top=U-w,new f(this.left,this.top))},g.prototype.updateBounds=function(U){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,v=s.MAX_VALUE,w=-s.MAX_VALUE,T,k,C,S,E,A=this.nodes,R=A.length,_=0;_T&&(y=T),bC&&(v=C),wT&&(y=T),bC&&(v=C),w=this.nodes.length){var R=0;b.forEach(function(_){_.owner==U&&R++}),R==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]=A,!1;if(df)return u[0]=g,u[1]=d,u[2]=S,u[3]=p,!1;if(hf?(u[0]=y,u[1]=b,L=!0):(u[0]=U,u[1]=m,L=!0):P===D&&(h>f?(u[0]=g,u[1]=m,L=!0):(u[0]=v,u[1]=b,L=!0)),-O===D?f>h?(u[2]=E,u[3]=A,I=!0):(u[2]=S,u[3]=C,I=!0):O===D&&(f>h?(u[2]=k,u[3]=C,I=!0):(u[2]=R,u[3]=A,I=!0)),L&&I)return!1;if(h>f?d>p?(B=this.getCardinalDirection(P,D,4),F=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-P,D,3),F=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-P,D,1),F=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection(P,D,2),F=this.getCardinalDirection(O,D,4)),!L)switch(B){case 1:$=m,z=h+-T/D,u[0]=z,u[1]=$;break;case 2:z=v,$=d+w*D,u[0]=z,u[1]=$;break;case 3:$=b,z=h+T/D,u[0]=z,u[1]=$;break;case 4:z=y,$=d+-w*D,u[0]=z,u[1]=$;break}if(!I)switch(F){case 1:H=C,V=f+-N/D,u[2]=V,u[3]=H;break;case 2:V=R,H=p+_*D,u[2]=V,u[3]=H;break;case 3:H=A,V=f+N/D,u[2]=V,u[3]=H;break;case 4:V=E,H=p+-_*D,u[2]=V,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,U=u.y,y=h.x,b=h.y,v=void 0,w=void 0,T=void 0,k=void 0,C=void 0,S=void 0,E=void 0,A=void 0,R=void 0;return T=g-f,C=d-p,E=p*f-d*g,k=b-U,S=m-y,A=y*U-m*b,R=T*S-k*C,R===0?null:(v=(C*A-S*E)/R,w=(k*E-T*A)/R,new a(v,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u=0){var b=(-m+Math.sqrt(m*m-4*g*U))/(2*g),v=(-m-Math.sqrt(m*m-4*g*U))/(2*g),w=null;return b>=0&&b<=1?[b]:v>=0&&v<=1?[v]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var U=0,y=Array(m.length);U0&&U;){for(T.push(C[0]);T.length>0&&U;){var S=T[0];T.splice(0,1),w.add(S);for(var E=S.getEdges(),v=0;v-1&&C.splice(N,1)}w=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var U=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),v=0;v0){for(var b=this.edgeToDummyNodes.get(y),v=0;v=0&&U.splice(A,1);var R=k.getNeighborsList();R.forEach(function(L){if(y.indexOf(L)<0){var I=b.get(L),P=I-1;P==1&&S.push(L),b.set(L,P)}})}y=y.concat(S),(U.length==1||U.length==2)&&(v=!0,w=U[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);go.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,U,y,b,v=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;mT||w>T)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(T=g.getEstimatedSize()*this.compoundGravityRangeFactor,(v>T||w>T)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*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=v.length||T>=v[0].length)){for(var k=0;kd}}]),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(Lt){for(var dt=[];Lt-- >0;)dt.push(0);return dt})(Math.min(this.m+1,this.n)),this.U=(function(Lt){var dt=function ve(It){if(It.length==0)return 0;for(var xt=[],mt=0;mt0;)dt.push(0);return dt})(this.n),u=(function(Lt){for(var dt=[];Lt-- >0;)dt.push(0);return dt})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p=0;O--)if(this.s[O]!==0){for(var D=O+1;D=0;G--){if((function(Lt,dt){return Lt&&dt})(G0;){var te=void 0,Re=void 0;for(te=L-2;te>=-1&&te!==-1;te--)if(Math.abs(l[te])<=me+ie*(Math.abs(this.s[te])+Math.abs(this.s[te+1]))){l[te]=0;break}if(te===L-2)Re=4;else{var Pe=void 0;for(Pe=L-1;Pe>=te&&Pe!==te;Pe--){var Ve=(Pe!==L?Math.abs(l[Pe]):0)+(Pe!==te+1?Math.abs(l[Pe-1]):0);if(Math.abs(this.s[Pe])<=me+ie*Ve){this.s[Pe]=0;break}}Pe===te?Re=3:Pe===L-1?Re=1:(Re=2,te=Pe)}switch(te++,Re){case 1:{var ce=l[L-2];l[L-2]=0;for(var he=L-2;he>=te;he--){var we=a.hypot(this.s[he],ce),ge=this.s[he]/we,ze=ce/we;this.s[he]=we,he!==te&&(ce=-ze*l[he-1],l[he-1]=ge*l[he-1]);for(var xe=0;xe=this.s[te+1]);){var kt=this.s[te];if(this.s[te]=this.s[te+1],this.s[te+1]=kt,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),U=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,v=u(551).Point,w=u(551).PointD,T=u(551).DimensionD,k=u(551).Layout,C=u(551).Integer,S=u(551).IGeometry,E=u(551).LGraph,A=u(551).Transform,R=u(551).LinkedList;function _(){h.call(this),this.toBeTiled={},this.constraints={}}_.prototype=Object.create(h.prototype);for(var N in h)_[N]=h[N];_.prototype.newGraphManager=function(){var L=new d(this);return this.graphManager=L,L},_.prototype.newGraph=function(L){return new f(null,this.graphManager,L)},_.prototype.newNode=function(L){return new p(this.graphManager,L)},_.prototype.newEdge=function(L){return new g(null,null,L)},_.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=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},_.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},_.prototype.layout=function(){var L=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return L&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},_.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()),P=this.nodesWithGravity.filter(function(B){return I.has(B)});this.graphManager.setAllNodesToApplyGravitation(P)}}else{var L=this.getFlatForest();if(L.length>0)this.positionNodesRadially(L);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),P=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation(P),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(U.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},_.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%y.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 L=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(D){return L.has(D)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.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=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var P=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(P,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},_.prototype.getPositionsData=function(){for(var L=this.graphManager.getAllNodes(),I={},P=0;P0&&this.updateDisplacements();for(var P=0;P0&&(O.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var F=new Map,z=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(Z){L.fixedNodesOnHorizontal.add(Z),L.fixedNodesOnVertical.add(Z)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var $=this.constraints.alignmentConstraint.vertical,P=0;P<$.length;P++)this.dummyToNodeForVerticalAlignment.set("dummy"+P,[]),$[P].forEach(function(J){F.set(J,"dummy"+P),L.dummyToNodeForVerticalAlignment.get("dummy"+P).push(J),L.fixedNodeSet.has(J)&&L.fixedNodesOnHorizontal.add("dummy"+P)});if(this.constraints.alignmentConstraint.horizontal)for(var V=this.constraints.alignmentConstraint.horizontal,P=0;P=2*Z.length/3;ie--)J=Math.floor(Math.random()*(ie+1)),ne=Z[ie],Z[ie]=Z[J],Z[J]=ne;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=F.has(Z.left)?F.get(Z.left):Z.left,ne=F.has(Z.right)?F.get(Z.right):Z.right;L.nodesInRelativeHorizontal.includes(J)||(L.nodesInRelativeHorizontal.push(J),L.nodeToRelativeConstraintMapHorizontal.set(J,[]),L.dummyToNodeForVerticalAlignment.has(J)?L.nodeToTempPositionMapHorizontal.set(J,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(J,L.idToNodeMap.get(J).getCenterX())),L.nodesInRelativeHorizontal.includes(ne)||(L.nodesInRelativeHorizontal.push(ne),L.nodeToRelativeConstraintMapHorizontal.set(ne,[]),L.dummyToNodeForVerticalAlignment.has(ne)?L.nodeToTempPositionMapHorizontal.set(ne,L.idToNodeMap.get(L.dummyToNodeForVerticalAlignment.get(ne)[0]).getCenterX()):L.nodeToTempPositionMapHorizontal.set(ne,L.idToNodeMap.get(ne).getCenterX())),L.nodeToRelativeConstraintMapHorizontal.get(J).push({right:ne,gap:Z.gap}),L.nodeToRelativeConstraintMapHorizontal.get(ne).push({left:J,gap:Z.gap})}else{var ie=z.has(Z.top)?z.get(Z.top):Z.top,me=z.has(Z.bottom)?z.get(Z.bottom):Z.bottom;L.nodesInRelativeVertical.includes(ie)||(L.nodesInRelativeVertical.push(ie),L.nodeToRelativeConstraintMapVertical.set(ie,[]),L.dummyToNodeForHorizontalAlignment.has(ie)?L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(ie)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(ie,L.idToNodeMap.get(ie).getCenterY())),L.nodesInRelativeVertical.includes(me)||(L.nodesInRelativeVertical.push(me),L.nodeToRelativeConstraintMapVertical.set(me,[]),L.dummyToNodeForHorizontalAlignment.has(me)?L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(L.dummyToNodeForHorizontalAlignment.get(me)[0]).getCenterY()):L.nodeToTempPositionMapVertical.set(me,L.idToNodeMap.get(me).getCenterY())),L.nodeToRelativeConstraintMapVertical.get(ie).push({bottom:me,gap:Z.gap}),L.nodeToRelativeConstraintMapVertical.get(me).push({top:ie,gap:Z.gap})}});else{var H=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(Z){if(Z.left){var J=F.has(Z.left)?F.get(Z.left):Z.left,ne=F.has(Z.right)?F.get(Z.right):Z.right;H.has(J)?H.get(J).push(ne):H.set(J,[ne]),H.has(ne)?H.get(ne).push(J):H.set(ne,[J])}else{var ie=z.has(Z.top)?z.get(Z.top):Z.top,me=z.has(Z.bottom)?z.get(Z.bottom):Z.bottom;G.has(ie)?G.get(ie).push(me):G.set(ie,[me]),G.has(me)?G.get(me).push(ie):G.set(me,[ie])}});var K=function(J,ne){var ie=[],me=[],te=new R,Re=new Set,Pe=0;return J.forEach(function(Ve,ce){if(!Re.has(ce)){ie[Pe]=[],me[Pe]=!1;var he=ce;for(te.push(he),Re.add(he),ie[Pe].push(he);te.length!=0;){he=te.shift(),ne.has(he)&&(me[Pe]=!0);var we=J.get(he);we.forEach(function(ge){Re.has(ge)||(te.push(ge),Re.add(ge),ie[Pe].push(ge))})}Pe++}}),{components:ie,isFixed:me}},W=K(H,L.fixedNodesOnHorizontal);this.componentsOnHorizontal=W.components,this.fixedComponentsOnHorizontal=W.isFixed;var oe=K(G,L.fixedNodesOnVertical);this.componentsOnVertical=oe.components,this.fixedComponentsOnVertical=oe.isFixed}}},_.prototype.updateDisplacements=function(){var L=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(oe){var Z=L.idToNodeMap.get(oe.nodeId);Z.displacementX=0,Z.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,P=0;P1){var z;for(z=0;zO&&(O=Math.floor(F.y)),B=Math.floor(F.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(b.WORLD_CENTER_X-F.x/2,b.WORLD_CENTER_Y-F.y/2))},_.radialLayout=function(L,I,P){var O=Math.max(this.maxDiagonalInTree(L),m.DEFAULT_RADIAL_SEPARATION);_.branchRadialLayout(I,null,0,359,0,O);var D=E.calculateBounds(L),B=new A;B.setDeviceOrgX(D.getMinX()),B.setDeviceOrgY(D.getMinY()),B.setWorldOrgX(P.x),B.setWorldOrgY(P.y);for(var F=0;F1;){var ne=J[0];J.splice(0,1);var ie=G.indexOf(ne);ie>=0&&G.splice(ie,1),oe--,K--}I!=null?Z=(G.indexOf(J[0])+1)%oe:Z=0;for(var me=Math.abs(O-P)/K,te=Z;W!=K;te=++te%oe){var Re=G[te].getOtherEnd(L);if(Re!=I){var Pe=(P+W*me)%360,Ve=(Pe+me)%360;_.branchRadialLayout(Re,L,Pe,Ve,D+B,B),W++}}},_.maxDiagonalInTree=function(L){for(var I=C.MIN_VALUE,P=0;PI&&(I=D)}return I},_.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},_.prototype.groupZeroDegreeMembers=function(){var L=this,I={};this.memberGroups={},this.idToDummyNode={};for(var P=[],O=this.graphManager.getAllNodes(),D=0;D"u"&&(I[z]=[]),I[z]=I[z].concat(B)}Object.keys(I).forEach(function($){if(I[$].length>1){var V="DummyCompound_"+$;L.memberGroups[V]=I[$];var H=I[$][0].getParent(),G=new p(L.graphManager);G.id=V,G.paddingLeft=H.paddingLeft||0,G.paddingRight=H.paddingRight||0,G.paddingBottom=H.paddingBottom||0,G.paddingTop=H.paddingTop||0,L.idToDummyNode[V]=G;var K=L.getGraphManager().add(L.newGraph(),G),W=H.getChild();W.add(G);for(var oe=0;oeD?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(B+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>B?(O.rect.y-=(O.labelHeight-B)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-B)/2):O.labelPosVertical=="bottom"&&O.setHeight(B+O.labelHeight))}})},_.prototype.repopulateCompounds=function(){for(var L=this.compoundOrder.length-1;L>=0;L--){var I=this.compoundOrder[L],P=I.id,O=I.paddingLeft,D=I.paddingTop,B=I.labelMarginLeft,F=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[P],I.rect.x,I.rect.y,O,D,B,F)}},_.prototype.repopulateZeroDegreeMembers=function(){var L=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(P){var O=L.idToDummyNode[P],D=O.paddingLeft,B=O.paddingTop,F=O.labelMarginLeft,z=O.labelMarginTop;L.adjustLocations(I[P],O.rect.x,O.rect.y,D,B,F,z)})},_.prototype.getToBeTiled=function(L){var I=L.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var P=L.getChild();if(P==null)return this.toBeTiled[I]=!1,!1;for(var O=P.getNodes(),D=0;D0)return this.toBeTiled[I]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},_.prototype.getNodeDegree=function(L){L.id;for(var I=L.getEdges(),P=0,O=0;OH&&(H=K.rect.height)}P+=H+L.verticalPadding}},_.prototype.tileCompoundMembers=function(L,I){var P=this;this.tiledMemberPack=[],Object.keys(L).forEach(function(O){var D=I[O];if(P.tiledMemberPack[O]=P.tileNodes(L[O],D.paddingLeft+D.paddingRight),D.rect.width=P.tiledMemberPack[O].width,D.rect.height=P.tiledMemberPack[O].height,D.setCenter(P.tiledMemberPack[O].centerX,P.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=D.rect.width,F=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(B+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>B?(D.rect.x-=(D.labelWidth-B)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-B)/2):D.labelPosHorizontal=="right"&&D.setWidth(B+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))}})},_.prototype.tileNodes=function(L,I){var P=this.tileNodesByFavoringDim(L,I,!0),O=this.tileNodesByFavoringDim(L,I,!1),D=this.getOrgRatio(P),B=this.getOrgRatio(O),F;return Bz&&(z=oe.getWidth())});var $=B/D,V=F/D,H=Math.pow(P-O,2)+4*($+O)*(V+P)*D,G=(O-P+Math.sqrt(H))/(2*($+O)),K;I?(K=Math.ceil(G),K==G&&K++):K=Math.floor(G);var W=K*($+O)-O;return z>W&&(W=z),W+=O*2,W},_.prototype.tileNodesByFavoringDim=function(L,I,P){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,F={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};B&&(F.idealRowWidth=this.calcIdealRowWidth(L,P));var z=function(Z){return Z.rect.width*Z.rect.height},$=function(Z,J){return z(J)-z(Z)};L.sort(function(oe,Z){var J=$;return F.idealRowWidth?(J=B,J(oe.id,Z.id)):J(oe,Z)});for(var V=0,H=0,G=0;G0&&(F+=L.horizontalPadding),L.rowWidth[P]=F,L.width0&&(z+=L.verticalPadding);var $=0;z>L.rowHeight[P]&&($=L.rowHeight[P],L.rowHeight[P]=z,$=L.rowHeight[P]-$),L.height+=$,L.rows[P].push(I)},_.prototype.getShortestRowIndex=function(L){for(var I=-1,P=Number.MAX_VALUE,O=0;OP&&(I=O,P=L.rowWidth[O]);return I},_.prototype.canAddHorizontal=function(L,I,P){if(L.idealRowWidth){var O=L.rows.length-1,D=L.rowWidth[O];return D+I+L.horizontalPadding<=L.idealRowWidth}var B=this.getShortestRowIndex(L);if(B<0)return!0;var F=L.rowWidth[B];if(F+L.horizontalPadding+I<=L.width)return!0;var z=0;L.rowHeight[B]0&&(z=P+L.verticalPadding-L.rowHeight[B]);var $;L.width-F>=I+L.horizontalPadding?$=(L.height+z)/(F+I+L.horizontalPadding):$=(L.height+z)/L.width,z=P+L.verticalPadding;var V;return L.widthB&&I!=P){O.splice(-1,1),L.rows[P].push(D),L.rowWidth[I]=L.rowWidth[I]-B,L.rowWidth[P]=L.rowWidth[P]+B,L.width=L.rowWidth[instance.getLongestRowIndex(L)];for(var F=Number.MIN_VALUE,z=0;zF&&(F=O[z].height);I>0&&(F+=L.verticalPadding);var $=L.rowHeight[I]+L.rowHeight[P];L.rowHeight[I]=F,L.rowHeight[P]0)for(var W=D;W<=B;W++)K[0]+=this.grid[W][F-1].length+this.grid[W][F].length-1;if(B0)for(var W=F;W<=z;W++)K[3]+=this.grid[D-1][W].length+this.grid[D][W].length-1;for(var oe=C.MAX_VALUE,Z,J,ne=0;ne{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,U,y){h.call(this,g,m,U,y)}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 U=this.getChild().getNodes(),y,b=0;b{function h(U){if(Array.isArray(U)){for(var y=0,b=Array(U.length);y0){var kt=0;Le.forEach(function(ot){fe=="horizontal"?(je.set(ot,v.has(ot)?w[v.get(ot)]:Ae.get(ot)),kt+=je.get(ot)):(je.set(ot,v.has(ot)?T[v.get(ot)]:Ae.get(ot)),kt+=je.get(ot))}),kt=kt/Le.length,gt.forEach(function(ot){ee.has(ot)||je.set(ot,kt)})}else{var Et=0;gt.forEach(function(ot){fe=="horizontal"?Et+=v.has(ot)?w[v.get(ot)]:Ae.get(ot):Et+=v.has(ot)?T[v.get(ot)]:Ae.get(ot)}),Et=Et/gt.length,gt.forEach(function(ot){je.set(ot,Et)})}});for(var Fe=function(){var Le=Ze.shift(),kt=X.get(Le);kt.forEach(function(Et){if(je.get(Et.id)ot&&(ot=Mt),OrVt&&(Vt=Or)}}catch(jr){dt=!0,ve=jr}finally{try{!Lt&&It.return&&It.return()}finally{if(dt)throw ve}}var Se=(kt+ot)/2-(Et+Vt)/2,it=!0,pt=!1,bt=void 0;try{for(var ir=gt[Symbol.iterator](),Br;!(it=(Br=ir.next()).done);it=!0){var kr=Br.value;je.set(kr,je.get(kr)+Se)}}catch(jr){pt=!0,bt=jr}finally{try{!it&&ir.return&&ir.return()}finally{if(pt)throw bt}}})}return je},N=function(X){var fe=0,ee=0,Ae=0,Me=0;if(X.forEach(function(De){De.left?w[v.get(De.left)]-w[v.get(De.right)]>=0?fe++:ee++:T[v.get(De.top)]-T[v.get(De.bottom)]>=0?Ae++:Me++}),fe>ee&&Ae>Me)for(var Ke=0;Keee)for(var Ne=0;NeMe)for(var je=0;je1)y.fixedNodeConstraint.forEach(function(ue,X){O[X]=[ue.position.x,ue.position.y],D[X]=[w[v.get(ue.nodeId)],T[v.get(ue.nodeId)]]}),B=!0;else if(y.alignmentConstraint)(function(){var ue=0;if(y.alignmentConstraint.vertical){for(var X=y.alignmentConstraint.vertical,fe=function(je){var De=new Set;X[je].forEach(function(at){De.add(at)});var Ze=new Set([].concat(h(De)).filter(function(at){return z.has(at)})),Fe=void 0;Ze.size>0?Fe=w[v.get(Ze.values().next().value)]:Fe=R(De).x,X[je].forEach(function(at){O[ue]=[Fe,T[v.get(at)]],D[ue]=[w[v.get(at)],T[v.get(at)]],ue++})},ee=0;ee0?Fe=w[v.get(Ze.values().next().value)]:Fe=R(De).y,Ae[je].forEach(function(at){O[ue]=[w[v.get(at)],Fe],D[ue]=[w[v.get(at)],T[v.get(at)]],ue++})},Ke=0;KeG&&(G=H[W].length,K=W);if(G0){var xe={x:0,y:0};y.fixedNodeConstraint.forEach(function(ue,X){var fe={x:w[v.get(ue.nodeId)],y:T[v.get(ue.nodeId)]},ee=ue.position,Ae=A(ee,fe);xe.x+=Ae.x,xe.y+=Ae.y}),xe.x/=y.fixedNodeConstraint.length,xe.y/=y.fixedNodeConstraint.length,w.forEach(function(ue,X){w[X]+=xe.x}),T.forEach(function(ue,X){T[X]+=xe.y}),y.fixedNodeConstraint.forEach(function(ue){w[v.get(ue.nodeId)]=ue.position.x,T[v.get(ue.nodeId)]=ue.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Ee=y.alignmentConstraint.vertical,qe=function(X){var fe=new Set;Ee[X].forEach(function(Me){fe.add(Me)});var ee=new Set([].concat(h(fe)).filter(function(Me){return z.has(Me)})),Ae=void 0;ee.size>0?Ae=w[v.get(ee.values().next().value)]:Ae=R(fe).x,fe.forEach(function(Me){z.has(Me)||(w[v.get(Me)]=Ae)})},le=0;le0?Ae=T[v.get(ee.values().next().value)]:Ae=R(fe).y,fe.forEach(function(Me){z.has(Me)||(T[v.get(Me)]=Ae)})},re=0;re{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})()})})(sR)),sR.exports}var vvr=aR.exports,Rye;function xvr(){return Rye||(Rye=1,(function(t,e){(function(n,i){t.exports=i(bvr())})(vvr,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 U=[],y=!0,b=!1,v=void 0;try{for(var w=g[Symbol.iterator](),T;!(y=(T=w.next()).done)&&(U.push(T.value),!(m&&U.length===m));y=!0);}catch(k){b=!0,v=k}finally{try{!y&&w.return&&w.return()}finally{if(b)throw v}}return U}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&&B.merge(V)});for(var F=0;F1){T=v[0],k=T.connectedEdges().length,v.forEach(function(D){D.connectedEdges().length0&&U.set("dummy"+(U.size+1),E),A},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var U=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,T=!1,k=void 0;try{for(var C=g.nodeIndexes[Symbol.iterator](),S;!(w=(S=C.next()).done);w=!0){var E=S.value,A=h(E,2),R=A[0],_=A[1],N=m.cy.getElementById(R);if(N){var L=N.boundingBox(),I=g.xCoords[_]-L.w/2,P=g.xCoords[_]+L.w/2,O=g.yCoords[_]-L.h/2,D=g.yCoords[_]+L.h/2;Iy&&(y=P),Ov&&(v=D)}}}catch(V){T=!0,k=V}finally{try{!w&&C.return&&C.return()}finally{if(T)throw k}}var B=p.x-(y+U)/2,F=p.y-(v+b)/2;g.xCoords=g.xCoords.map(function(V){return V+B}),g.yCoords=g.yCoords.map(function(V){return V+F})}else{Object.keys(g).forEach(function(V){var H=g[V],G=H.getRect().x,K=H.getRect().x+H.getRect().width,W=H.getRect().y,oe=H.getRect().y+H.getRect().height;Gy&&(y=K),Wv&&(v=oe)});var z=p.x-(y+U)/2,$=p.y-(v+b)/2;Object.keys(g).forEach(function(V){var H=g[V];H.setCenter(H.getCenterX()+z,H.getCenterY()+$)})}}},f.calcBoundingBox=function(p,g,m,U){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,T=void 0,k=void 0,C=void 0,S=void 0,E=p.descendants().not(":parent"),A=E.length,R=0;RT&&(y=T),bC&&(v=C),w{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,U=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(w,T){var k=w.cy,C=w.eles,S=C.nodes(),E=C.edges(),A=void 0,R=void 0,_=void 0,N={};w.randomize&&(A=T.nodeIndexes,R=T.xCoords,_=T.yCoords);var L=function(V){return typeof V=="function"},I=function(V,H){return L(V)?V(H):V},P=h.calcParentsWithoutChildren(k,C),O=function $(V,H,G,K){for(var W=H.length,oe=0;oe0){var te=void 0;te=G.getGraphManager().add(G.newGraph(),ne),$(te,J,G,K)}}},D=function(V,H,G){for(var K=0,W=0,oe=0;oe0?y.DEFAULT_EDGE_LENGTH=U.DEFAULT_EDGE_LENGTH=K/W:L(w.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=U.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=U.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,y.MIN_REPULSION_DIST=U.MIN_REPULSION_DIST=U.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=U.DEFAULT_EDGE_LENGTH)},B=function(V,H){H.fixedNodeConstraint&&(V.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(V.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(V.constraints.relativePlacementConstraint=H.relativePlacementConstraint)};w.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=U.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=U.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(y.MAX_ITERATIONS=U.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=U.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=U.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=U.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=U.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=U.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=U.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,y.ANIMATE=U.ANIMATE=m.ANIMATE=w.animate,y.TILE=w.tile,y.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=U.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),w.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),w.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var F=new d,z=F.newGraphManager();return O(z.addRoot(),h.getTopMostNodes(S),F,w),D(F,z,E),B(F,w),F.runLayout(),N};o.exports={coseLayout:b}}),212:((o,l,u)=>{var h=(function(){function w(T,k){for(var C=0;C0)if(P){var B=p.getTopMostNodes(C.eles.nodes());if(_=p.connectComponents(S,C.eles,B),_.forEach(function(Ve){var ce=Ve.boundingBox();N.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),C.randomize&&_.forEach(function(Ve){C.eles=Ve,A.push(m(C))}),C.quality=="default"||C.quality=="proof"){var F=S.collection();if(C.tile){var z=new Map,$=[],V=[],H=0,G={nodeIndexes:z,xCoords:$,yCoords:V},K=[];if(_.forEach(function(Ve,ce){Ve.edges().length==0&&(Ve.nodes().forEach(function(he,we){F.merge(Ve.nodes()[we]),he.isParent()||(G.nodeIndexes.set(Ve.nodes()[we].id(),H++),G.xCoords.push(Ve.nodes()[0].position().x),G.yCoords.push(Ve.nodes()[0].position().y))}),K.push(ce))}),F.length>1){var W=F.boundingBox();N.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),_.push(F),A.push(G);for(var oe=K.length-1;oe>=0;oe--)_.splice(K[oe],1),A.splice(K[oe],1),N.splice(K[oe],1)}}_.forEach(function(Ve,ce){C.eles=Ve,R.push(y(C,A[ce])),p.relocateComponent(N[ce],R[ce],C)})}else _.forEach(function(Ve,ce){p.relocateComponent(N[ce],A[ce],C)});var Z=new Set;if(_.length>1){var J=[],ne=E.filter(function(Ve){return Ve.css("display")=="none"});_.forEach(function(Ve,ce){var he=void 0;if(C.quality=="draft"&&(he=A[ce].nodeIndexes),Ve.nodes().not(ne).length>0){var we={};we.edges=[],we.nodes=[];var ge=void 0;Ve.nodes().not(ne).forEach(function(ze){if(C.quality=="draft")if(!ze.isParent())ge=he.get(ze.id()),we.nodes.push({x:A[ce].xCoords[ge]-ze.boundingbox().w/2,y:A[ce].yCoords[ge]-ze.boundingbox().h/2,width:ze.boundingbox().w,height:ze.boundingbox().h});else{var xe=p.calcBoundingBox(ze,A[ce].xCoords,A[ce].yCoords,he);we.nodes.push({x:xe.topLeftX,y:xe.topLeftY,width:xe.width,height:xe.height})}else R[ce][ze.id()]&&we.nodes.push({x:R[ce][ze.id()].getLeft(),y:R[ce][ze.id()].getTop(),width:R[ce][ze.id()].getWidth(),height:R[ce][ze.id()].getHeight()})}),Ve.edges().forEach(function(ze){var xe=ze.source(),Ee=ze.target();if(xe.css("display")!="none"&&Ee.css("display")!="none")if(C.quality=="draft"){var qe=he.get(xe.id()),le=he.get(Ee.id()),pe=[],Te=[];if(xe.isParent()){var re=p.calcBoundingBox(xe,A[ce].xCoords,A[ce].yCoords,he);pe.push(re.topLeftX+re.width/2),pe.push(re.topLeftY+re.height/2)}else pe.push(A[ce].xCoords[qe]),pe.push(A[ce].yCoords[qe]);if(Ee.isParent()){var Y=p.calcBoundingBox(Ee,A[ce].xCoords,A[ce].yCoords,he);Te.push(Y.topLeftX+Y.width/2),Te.push(Y.topLeftY+Y.height/2)}else Te.push(A[ce].xCoords[le]),Te.push(A[ce].yCoords[le]);we.edges.push({startX:pe[0],startY:pe[1],endX:Te[0],endY:Te[1]})}else R[ce][xe.id()]&&R[ce][Ee.id()]&&we.edges.push({startX:R[ce][xe.id()].getCenterX(),startY:R[ce][xe.id()].getCenterY(),endX:R[ce][Ee.id()].getCenterX(),endY:R[ce][Ee.id()].getCenterY()})}),we.nodes.length>0&&(J.push(we),Z.add(ce))}});var ie=I.packComponents(J,C.randomize).shifts;if(C.quality=="draft")A.forEach(function(Ve,ce){var he=Ve.xCoords.map(function(ge){return ge+ie[ce].dx}),we=Ve.yCoords.map(function(ge){return ge+ie[ce].dy});Ve.xCoords=he,Ve.yCoords=we});else{var me=0;Z.forEach(function(Ve){Object.keys(R[Ve]).forEach(function(ce){var he=R[Ve][ce];he.setCenter(he.getCenterX()+ie[me].dx,he.getCenterY()+ie[me].dy)}),me++})}}}else{var O=C.eles.boundingBox();if(N.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),C.randomize){var D=m(C);A.push(D)}C.quality=="default"||C.quality=="proof"?(R.push(y(C,A[0])),p.relocateComponent(N[0],R[0],C)):p.relocateComponent(N[0],A[0],C)}var te=function(ce,he){if(C.quality=="default"||C.quality=="proof"){typeof ce=="number"&&(ce=he);var we=void 0,ge=void 0,ze=ce.data("id");return R.forEach(function(Ee){ze in Ee&&(we={x:Ee[ze].getRect().getCenterX(),y:Ee[ze].getRect().getCenterY()},ge=Ee[ze])}),C.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?we.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(we.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?we.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(we.y-=ge.labelHeight/2))),we==null&&(we={x:ce.position("x"),y:ce.position("y")}),{x:we.x,y:we.y}}else{var xe=void 0;return A.forEach(function(Ee){var qe=Ee.nodeIndexes.get(ce.id());qe!=null&&(xe={x:Ee.xCoords[qe],y:Ee.yCoords[qe]})}),xe==null&&(xe={x:ce.position("x"),y:ce.position("y")}),{x:xe.x,y:xe.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var Re=p.calcParentsWithoutChildren(S,E),Pe=E.filter(function(Ve){return Ve.css("display")=="none"});C.eles=E.not(Pe),E.nodes().not(":parent").not(Pe).layoutPositions(k,C,te),Re.length>0&&Re.forEach(function(Ve){Ve.position(te(Ve))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=v}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var U=m.cy,y=m.eles,b=y.nodes(),v=y.nodes(":parent"),w=new Map,T=new Map,k=new Map,C=[],S=[],E=[],A=[],R=[],_=[],N=[],L=[],I=void 0,P=1e8,O=1e-9,D=m.piTol,B=m.samplingType,F=m.nodeSeparation,z=void 0,$=function(){for(var X=0,fe=0,ee=!1;fe=Me;){Ne=Ae[Me++];for(var _e=C[Ne],gt=0;gt<_e.length;gt++)je=T.get(_e[gt]),De[je]==P&&(De[je]=De[Ne]+1,Ae[++Ke]=je);_[Ne][fe]=De[Ne]*F}if(ee){for(var Le=0;LeZe&&(Ze=R[kt],Fe=kt)}return Fe},H=function(X){var fe=void 0;if(X){fe=Math.floor(Math.random()*I);for(var Ae=0;Ae=1)break;De=je}for(var at=0;at=1)break;De=je}for(var gt=0;gt0&&(fe.isParent()?C[X].push(k.get(fe.id())):C[X].push(fe.id()))})});var Pe=function(X){var fe=T.get(X),ee=void 0;w.get(X).forEach(function(Ae){U.getElementById(Ae).isParent()?ee=k.get(Ae):ee=Ae,C[fe].push(ee),C[T.get(ee)].push(X)})},Ve=!0,ce=!1,he=void 0;try{for(var we=w.keys()[Symbol.iterator](),ge;!(Ve=(ge=we.next()).done);Ve=!0){var ze=ge.value;Pe(ze)}}catch(ue){ce=!0,he=ue}finally{try{!Ve&&we.return&&we.return()}finally{if(ce)throw he}}I=T.size;var xe=void 0;if(I>2){z=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})()})})(aR)),aR.exports}var wvr=xvr();const Tvr=T1(wvr);var Lye={L:"left",R:"right",T:"top",B:"bottom"},Iye={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},UA={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},Cvr=x(function(t){return Sl(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Nye=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Sl=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),p1=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),fse=x(function(t,e){const r=Sl(t)&&p1(e),n=p1(t)&&Sl(e);return r||n},"isArchitectureDirectionXY"),kvr=x(function(t){const e=t[0],r=t[1],n=Sl(e)&&p1(r),i=p1(e)&&Sl(r);return n||i},"isArchitecturePairXY"),Svr=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),XK=x(function(t,e){const r=`${t}${e}`;return Svr(r)?r:void 0},"getArchitectureDirectionPair"),Evr=x(function([t,e],r){const n=r[0],i=r[1];return Sl(n)?p1(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Sl(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Avr=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Mvr=x(function(t,e){return fse(t,e)?"bend":Sl(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Rvr=x(function(t){return t.type==="service"},"isArchitectureService"),Lvr=x(function(t){return t.type==="junction"},"isArchitectureJunction"),uKe=x((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),hKe=x(t=>t.data(),"edgeData"),Jy=x(t=>t.data(),"nodeData"),Ivr=An.architecture,lv,dKe=(lv=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=qi,this.getAccTitle=ia,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getAccDescription=sa,this.setAccDescription=aa,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="",Oi()}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(Rvr)}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(Lvr)}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(!Nye(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Nye(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=Mvr(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(uKe(p,g),m)}if(f.lhsId===u){const m=XK(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=XK(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=x(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,U]=g;p.forEach((y,b)=>{a.has(y)||(h.set(y,Evr([m,U],b)),d.push(y))})}}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 na({...Ivr,...xr().architecture})}getConfigField(e){return this.getConfig()[e]}},x(lv,"ArchitectureDB"),lv),Nvr=x((t,e)=>{var r;ec(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"),fKe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qu("architecture",t);de.debug(e);const r=(n=fKe.parser)==null?void 0:n.yy;if(!(r instanceof dKe))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.");Nvr(e,r)},"parse")},Dvr=x(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -5701,19 +5834,19 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[G]||G)+"'":me="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),d5r=h5r;function GK(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(GK,"withSeededRandom");var F2=w(t=>`${t}`,"wrapIcon"),CA={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:F2('')},server:{body:F2('')},disk:{body:F2('')},internet:{body:F2('')},cloud:{body:F2('')},unknown:NEe,blank:{body:F2("")}}},f5r=w(async function(t,e,r,n){const i=r.getConfigField("padding"),s=r.getConfigField("iconSize"),a=s/2,o=s/6,l=o/2;await Promise.all(e.edges().map(async u=>{var M,R;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:b}=QXe(u);let{x,y:T}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const A=i+4;if(p&&(El(d)?x+=d==="L"?-A:A:T+=d==="T"?-A:A+18),v&&(El(m)?k+=m==="L"?-A:A:E+=m==="T"?-A:A+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(El(d)?x+=d==="L"?a:-a:T+=d==="T"?a:-a),!v&&((R=r.getNode(g))==null?void 0:R.type)==="junction"&&(El(m)?k+=m==="L"?a:-a:E+=m==="T"?a:-a),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${x},${T} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${lx(h,g,{prefix:"L"})}`),f){const N=El(d)?pR[d](x,o):x-l,L=dm(d)?pR[d](T,o):T-l;P.insert("polygon").attr("points",Tbe[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(y){const N=El(m)?pR[m](k,o):k-l,L=dm(m)?pR[m](E,o):E-l;P.insert("polygon").attr("points",Tbe[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(b){const N=sae(d,m)?"XY":El(d)?"X":"Y";let L=0;N==="X"?L=Math.abs(x-k):N==="Y"?L=Math.abs(T-E)/1.5:L=Math.abs(x-k)/2;const I=P.append("g");if(await ll(I,b,{useHtmlLabels:!1,width:L,classes:"architecture-service-label"},He()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+C+", "+S+")");else if(N==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(N==="XY"){const $=HK(d,m);if($&&r5r($)){const O=I.node().getBoundingClientRect(),[D,B]=s5r($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*B*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",` - translate(${C}, ${S-O.height/2}) - translate(${D*z.width/2}, ${B*z.height/2}) +`,"getStyles"),Ovr=Dvr;function KK(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}x(KK,"withSeededRandom");var V2=x(t=>`${t}`,"wrapIcon"),SC={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:V2('')},server:{body:V2('')},disk:{body:V2('')},internet:{body:V2('')},cloud:{body:V2('')},unknown:Hwe,blank:{body:V2("")}}},_vr=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var A,R;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:U,targetGroup:y,label:b}=hKe(u);let{x:v,y:w}=u[0].sourceEndpoint();const{x:T,y:k}=u[0].midpoint();let{x:C,y:S}=u[0].targetEndpoint();const E=i+4;if(p&&(Sl(d)?v+=d==="L"?-E:E:w+=d==="T"?-E:E+18),y&&(Sl(m)?C+=m==="L"?-E:E:S+=m==="T"?-E:E+18),!p&&((A=r.getNode(h))==null?void 0:A.type)==="junction"&&(Sl(d)?v+=d==="L"?s:-s:w+=d==="T"?s:-s),!y&&((R=r.getNode(g))==null?void 0:R.type)==="junction"&&(Sl(m)?C+=m==="L"?s:-s:S+=m==="T"?s:-s),u[0]._private.rscratch){const _=t.insert("g");if(_.insert("path").attr("d",`M ${v},${w} L ${T},${k} L${C},${S} `).attr("class","edge").attr("id",`${n}-${d6(h,g,{prefix:"L"})}`),f){const N=Sl(d)?UA[d](v,o):v-l,L=p1(d)?UA[d](w,o):w-l;_.insert("polygon").attr("points",Iye[d](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(U){const N=Sl(m)?UA[m](C,o):C-l,L=p1(m)?UA[m](S,o):S-l;_.insert("polygon").attr("points",Iye[m](o)).attr("transform",`translate(${N},${L})`).attr("class","arrow")}if(b){const N=fse(d,m)?"XY":Sl(d)?"X":"Y";let L=0;N==="X"?L=Math.abs(v-C):N==="Y"?L=Math.abs(w-S)/1.5:L=Math.abs(v-C)/2;const I=_.append("g");if(await ll(I,b,{useHtmlLabels:!1,width:L,classes:"architecture-service-label"},He()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),N==="X")I.attr("transform","translate("+T+", "+k+")");else if(N==="Y")I.attr("transform","translate("+T+", "+k+") rotate(-90)");else if(N==="XY"){const P=XK(d,m);if(P&&kvr(P)){const O=I.node().getBoundingClientRect(),[D,B]=Avr(P);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*D*B*45})`);const F=I.node().getBoundingClientRect();I.attr("transform",` + translate(${T}, ${k-O.height/2}) + translate(${D*F.width/2}, ${B*F.height/2}) rotate(${-1*D*B*45}, 0, ${O.height/2}) - `)}}}}}))},"drawEdges"),p5r=w(async function(t,e,r,n){const s=r.getConfigField("padding")*.75,a=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=Yb(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,b=g;if(h.icon){const x=y.append("g");x.html(`${await N0(h.icon,{height:s,width:s,fallbackPrefix:CA.prefix})}`),x.attr("transform","translate("+(v+l+1)+", "+(b+l+1)+")"),v+=s,b+=a/2-1-2}if(h.label){const x=y.append("g");await ll(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},He()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),x.attr("transform","translate("+(v+l+4)+", "+(b+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),g5r=w(async function(t,e,r,n){const i=He();for(const s of r){const a=e.append("g"),o=t.getConfigField("iconSize");if(s.title){const d=a.append("g");await ll(d,s.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=a.append("g");if(s.icon)l.html(`${await N0(s.icon,{height:o,width:o,fallbackPrefix:CA.prefix})}`);else if(s.iconText){l.html(`${await N0("blank",{height:o,width:o,fallbackPrefix:CA.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(Nn(s.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-${s.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);a.attr("id",`${n}-service-${s.id}`).attr("class","architecture-service");const{width:u,height:h}=a.node().getBBox();s.width=u,s.height=h,t.setElementForId(s.id,a)}return 0},"drawServices"),m5r=w(function(t,e,r,n){r.forEach(i=>{const s=e.append("g"),a=t.getConfigField("iconSize");s.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a),s.attr("class","architecture-junction");const{width:l,height:u}=s._groups[0][0].getBBox();s.width=l,s.height=u,t.setElementForId(i.id,s)})},"drawJunctions");yJ([{name:CA.prefix,icons:CA}]);Jd.use(e5r);function tKe(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(tKe,"addServices");function rKe(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(rKe,"addJunctions");function nKe(t,e){e.nodes().map(r=>{const n=Yb(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(nKe,"positionNodes");function iKe(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(iKe,"addGroups");function sKe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:s,lhsGroup:a,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=sae(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:s,sourceGroup:a,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(sKe,"addEdges");function aKe(t,e,r,n=[]){const i=w((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let b=0;const x=[...y.entries()];if(x.length===1){g.set(v,x[0][1]);continue}for(let T=0;T{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const b=((C=t.getNode(v))==null?void 0:C.in)??"default",x=p.get(y)??new Map;p.has(y)||p.set(y,x);const T=g.get(m)??new Map;g.has(m)||g.set(m,T);for(const S of[x,T]){const k=S.get(b)??[];S.has(b)||S.set(b,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[a,o]=s.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(a),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(aKe,"getAlignments");function oKe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),s=e.getConfigField("idealEdgeLengthMultiplier"),a=s*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(([b,x])=>{const T=l([v[0]+x[0],v[1]+x[1]]),C=d.get(T);if(C&&!p[T]){if(f.push(T),o.has(`${y}|${C}`))return;n.push({[wbe[b]]:C,[wbe[t5r(b)]]:y,gap:s*i})}})}}}}),n}w(oKe,"getRelativeConstraints");function lKe(t,e,r,n,i,{spatialMaps:s,groupAlignments:a}){return new Promise(o=>{const l=xt("body").append("div").attr("id","cy").attr("style","display:none"),u=Jd({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(),iKe(r,u),tKe(t,u,i),rKe(e,u,i),sKe(n,u);const h=i.getLayoutHints(),d=aKe(i,s,a,h),f=oKe(s,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),b=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(x){const[T,C]=x.connectedNodes(),{parent:S}=Yb(T),{parent:k}=Yb(C);return S===k?g:m},edgeElasticity(x){const[T,C]=x.connectedNodes(),{parent:S}=Yb(T),{parent:k}=Yb(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var T;function x(C,S,k,E){let A,M;const{x:R,y:P}=C,{x:N,y:L}=S;M=(E-P+(R-k)*(P-L)/(R-N))/Math.sqrt(1+Math.pow((P-L)/(R-N),2)),A=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-R,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(N-R,2)+Math.pow(L-P,2));A=A/I;let $=(N-R)*(E-P)-(L-P)*(k-R);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(N-R)*(k-R)+(L-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return M=Math.abs(M)*$,A=A*O,{distances:M,weights:A}}w(x,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((T=C.data)!=null&&T.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:A}=C.target().position();if(S!==E&&k!==A){const M=C.sourceEndpoint(),R=C.targetEndpoint(),{sourceDir:P}=QXe(C),[N,L]=dm(P)?[M.x,R.y]:[R.x,M.y],{weights:I,distances:$}=x(M,R,N,L);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),GK(v,()=>b.run())});try{GK(v,()=>b.run())}catch(x){throw x instanceof RangeError&&x.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."):x}u.ready(x=>{de.info("Ready",x),o(u)})})}w(lKe,"layoutArchitecture");var y5r=w(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const s=i.getServices(),a=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=al(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 g5r(i,f,s,e),m5r(i,f,a,e);const g=await lKe(s,a,o,l,i,u);await f5r(d,g,i,e),await p5r(p,g,i,e),nKe(i,g),W3(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),v5r={draw:y5r},b5r={parser:eKe,get db(){return new JXe},renderer:v5r,styles:d5r};const x5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:b5r},Symbol.toStringTag,{value:"Module"}));var cKe="position frame",uKe="frame positioned",WK="position relation",hKe="relation positioned",w5r=w(function(t){de.debug("options str",t)},"setOptions"),T5r=w(function(){return{}},"getOptions"),C5r=w(function(){dKe(),Oi()},"clear");function dKe(){aae={}}w(dKe,"reset");var k5r=En.eventmodeling,S5r=w(()=>rs({...k5r,...xr().eventmodeling}),"getConfig"),aae={};function fKe(){let t=E5r;const{ast:e}=aae,r=oae();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const s=xKe(n,e.dataEntities,r);t=a_(t,{$kind:cKe,index:i,frame:n,textProps:s});let a;EKe(n)?(de.debug("source frame",n.sourceFrames),a=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),a.forEach(o=>{t=a_(t,{$kind:WK,index:i,frame:n,sourceFrame:o})})):t=a_(t,{$kind:WK,index:i,frame:n})}),t={...t,sortedSwimlanesArray:lae(t.swimlanes)},t}w(fKe,"getState");function pKe(t){aae.ast=t}w(pKe,"setAst");var ni={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 oae(){return ni}w(oae,"getDiagramProps");var E5r={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function gKe(t){const e=t.split(".");if(e.length===2)return e[0]}w(gKe,"extractNamespace");function mKe(t){const e=t.split(".");return e.length===2?e[1]:t}w(mKe,"extractName");function yKe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}w(yKe,"findSwimlaneByNamespace");function s_(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(s_,"findNextAvailableIndex");function vKe(t,e){const r=gKe(t.entityIdentifier),n=yKe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||ni.labelUiAutomation}:r?{index:s_(e,0,100),label:ni.labelUiAutomationPrefix+r}:{index:0,label:ni.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||ni.labelCommandReadModel}:r?{index:s_(e,100,200),label:ni.labelCommandReadModelPrefix+r}:{index:100,label:ni.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||ni.labelEvents}:r?{index:s_(e,200,300),label:ni.labelEventsPrefix+r}:{index:200,label:ni.labelEvents}}}w(vKe,"calculateSwimlaneProps");function bKe(t){const{themeVariables:e}=xr();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(bKe,"calculateEntityVisualProps");function xKe(t,e,r){const n=xr(),i=Nn(mKe(t.entityIdentifier)??"",n);let s;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${zS(i,r.textMaxWidth,a)}`;if(t.dataInlineValue&&(s=t.dataInlineValue,s=s.substring(s.indexOf("{")+1),s=s.substring(0,s.lastIndexOf("}")-1),s=Nn(s,n),s=zS(s,r.textMaxWidth,a),s=s.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(s=g.dataBlockValue,s=s.substring(s.indexOf(`{ -`)+2),s=s.substring(0,s.lastIndexOf("}")-1),s=Nn(s,n),s=zS(s,r.textMaxWidth,a),s=s.replaceAll(" "," "),s+="
    ")}const u=s!==void 0;u&&(l+=`

    ${s}`);const h={fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:a.fontFamily},d=mD(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return de.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}w(xKe,"calculateTextProps");function wKe(t,e){const r=e,n=bKe(r.frame),i={width:r.textProps.width+2*ni.boxTextPadding,height:r.textProps.height+2*ni.boxTextPadding};return[{$kind:uKe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}w(wKe,"decidePositionFrame");function TKe(t,e,r){return e===void 0?ni.contentStartX:e.index===t.index&&t.r?t.r+ni.boxPadding:r===void 0?ni.contentStartX:r.r-ni.boxOverlap+ni.boxPadding}w(TKe,"calculateX");function CKe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}w(CKe,"calculateMaxRight");function lae(t){return Object.values(t).sort((e,r)=>e.index-r.index)}w(lae,"sortedSwimlanesArray");function kKe(t,e){const r=e,n=vKe(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*ni.swimlaneMinHeight+ni.swimlaneGap,height:ni.swimlaneMinHeight,maxHeight:ni.swimlaneMinHeight};const s=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,a=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(ni.boxMinWidth,Math.min(ni.boxMaxWidth,r.dimension.width))+2*ni.boxPadding,height:Math.max(ni.boxMinHeight,Math.min(ni.boxMaxHeight,r.dimension.height))+2*ni.boxPadding},l=TKe(i,a,s),u=l+o.width+ni.boxPadding,h=CKe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(ni.swimlaneMinHeight,i.maxHeight)+2*ni.swimlanePadding;const d={x:l,y:ni.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=lae(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}w(EKe,"hasSourceFrame");function qK(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}w(qK,"findBoxByFrame");function AKe(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(AKe,"findBoxByLineIndex");function MKe(t,e){const r=e;if($Ue(r.frame)||SKe(r.index,r.frame))return[];const n=qK(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=qK(t.boxes,r.sourceFrame):i=AKe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:hKe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}w(MKe,"decidePositionRelation");function RKe(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(RKe,"evolveRelationPositioned");var A5r={[cKe]:wKe,[WK]:MKe},M5r={[uKe]:kKe,[hKe]:RKe};function _Ke(t,e){const r=A5r[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}w(_Ke,"decide");function LKe(t,e){const r=e.reduce((n,i)=>{const s=M5r[i.$kind];return s==null?n:s(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}w(LKe,"evolve");function a_(t,e){const r=_Ke(t,e);return LKe(t,r)}w(a_,"dispatch");var UK={getConfig:S5r,setOptions:w5r,getOptions:T5r,clear:C5r,setAccTitle:qi,getAccTitle:ns,getAccDescription:ss,setAccDescription:is,setDiagramTitle:ts,getDiagramTitle:ji,setAst:pKe,getDiagramProps:oae,getState:fKe},R5r={parse:w(async t=>{const e=await Ju("eventmodeling",t);de.debug(e),UK.setAst(e),ec(e,UK)},"parse")},uG=He(),_5r=uG==null?void 0:uG.eventmodeling;function IKe(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(IKe,"renderD3Box");function NKe(t,e){return t>e}w(NKe,"dirUpwards");function OKe(t,e,r,n){return i=>{const s=i.sourceBox.swimlane.y+e.swimlanePadding,a=i.targetBox.swimlane.y+e.swimlanePadding,o=NKe(s,a),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;de.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=s,d=a+i.targetBox.dimension.height):(h=s+i.sourceBox.dimension.height,d=a);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(OKe,"renderD3Relation");function DKe(t,e,r,n){return i=>{const s=t.append("g").attr("class","em-swimlane"),a=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";s.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",a).attr("stroke",o),s.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}w(DKe,"renderD3Swimlane");var L5r=w(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!_5r)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:s,eventmodeling:a}=He(),o=xt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=s.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(DKe(o,u.maxR,l,s)),u.boxes.forEach(IKe(o,l)),u.relations.forEach(OKe(o,l,h,s)),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),OQ(void 0,o,(a==null?void 0:a.padding)??30,a==null?void 0:a.useMaxWidth)},"draw"),I5r={draw:L5r},N5r=w(t=>"","getStyles"),O5r=N5r,D5r={parser:R5r,db:UK,renderer:I5r,styles:O5r};const P5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:D5r},Symbol.toStringTag,{value:"Module"}));var jK=(function(){var t=w(function(v,b,x,T){for(x=x||{},T=v.length;T--;x[v[T]]=b);return x},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],s=[6,7,8],a=[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(b,x,T,C,S,k,E){var A=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[A-1].length,k[A].trim());break;case 16:C.addNode(0,k[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(s,[2,3]),{1:[2,2]},t(s,[2,4]),t(s,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:a,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:a,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(b,x){if(x.recoverable)this.trace(b);else{var T=new Error(b);throw T.hash=x,T}},"parseError"),parse:w(function(b){var x=this,T=[0],C=[],S=[null],k=[],E=this.table,A="",M=0,R=0,P=2,N=1,L=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(b,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var D=I.yylloc;k.push(D);var B=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ie){T.length=T.length-2*ie,S.length=S.length-ie,k.length=k.length-ie}w(z,"popStack");function V(){var ie;return ie=C.pop()||I.lex()||N,typeof ie!="number"&&(ie instanceof Array&&(C=ie,ie=C.pop()),ie=x.symbols_[ie]||ie),ie}w(V,"lex");for(var F,H,G,W,K={},q,oe,Z,Q;;){if(H=T[T.length-1],this.defaultActions[H]?G=this.defaultActions[H]:((F===null||typeof F>"u")&&(F=V()),G=E[H]&&E[H][F]),typeof G>"u"||!G.length||!G[0]){var ne="";Q=[];for(q in E[H])this.terminals_[q]&&q>P&&Q.push("'"+this.terminals_[q]+"'");I.showPosition?ne="Parse error on line "+(M+1)+`: + `)}}}}}))},"drawEdges"),Pvr=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=Jy(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 U=t.append("g");let y=p,b=g;if(h.icon){const v=U.append("g");v.html(`${await D0(h.icon,{height:a,width:a,fallbackPrefix:SC.prefix})}`),v.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=s/2-1-2}if(h.label){const v=U.append("g");await ll(v,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},He()),v.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),v.attr("transform","translate("+(y+l+4)+", "+(b+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),Bvr=x(async function(t,e,r,n){const i=He();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await ll(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 D0(a.icon,{height:o,width:o,fallbackPrefix:SC.prefix})}`);else if(a.iconText){l.html(`${await D0("blank",{height:o,width:o,fallbackPrefix:SC.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(Dn(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"),$vr=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");CQ([{name:SC.prefix,icons:SC}]);ef.use(Tvr);function pKe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(pKe,"addServices");function gKe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(gKe,"addJunctions");function mKe(t,e){e.nodes().map(r=>{const n=Jy(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(mKe,"positionNodes");function UKe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(UKe,"addGroups");function yKe(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=fse(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(yKe,"addEdges");function bKe(t,e,r,n=[]){const i=x((f,p)=>{const g=new Map;for(const[m,U]of f.entries()){const y=`${m}`;let b=0;const v=[...U.entries()];if(v.length===1){g.set(y,v[0][1]);continue}for(let w=0;w{const p=new Map,g=new Map;return f.forEach(([m,U],y)=>{var T;const b=((T=t.getNode(y))==null?void 0:T.in)??"default",v=p.get(U)??new Map;p.has(U)||p.set(U,v);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const k of[v,w]){const C=k.get(b)??[];k.has(b)||k.set(b,C),C.push(y)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=x(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}x(bKe,"getAlignments");function vKe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=x(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,U])=>[l(U),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 U=d.get(m);if(U){const y=u(m);Object.entries(g).forEach(([b,v])=>{const w=l([y[0]+v[0],y[1]+v[1]]),T=d.get(w);if(T&&!p[w]){if(f.push(w),o.has(`${U}|${T}`))return;n.push({[Lye[b]]:T,[Lye[Cvr(b)]]:U,gap:a*i})}})}}}}),n}x(vKe,"getRelativeConstraints");function xKe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=vt("body").append("div").attr("id","cy").attr("style","display:none"),u=ef({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(),UKe(r,u),pKe(t,u,i),gKe(e,u,i),yKe(n,u);const h=i.getLayoutHints(),d=bKe(i,a,s,h),f=vKe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,U=i.getConfigField("edgeElasticity"),y=i.getConfigField("seed"),b=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(v){const[w,T]=v.connectedNodes(),{parent:k}=Jy(w),{parent:C}=Jy(T);return k===C?g:m},edgeElasticity(v){const[w,T]=v.connectedNodes(),{parent:k}=Jy(w),{parent:C}=Jy(T);return k===C?U:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function v(T,k,C,S){let E,A;const{x:R,y:_}=T,{x:N,y:L}=k;A=(S-_+(R-C)*(_-L)/(R-N))/Math.sqrt(1+Math.pow((_-L)/(R-N),2)),E=Math.sqrt(Math.pow(S-_,2)+Math.pow(C-R,2)-Math.pow(A,2));const I=Math.sqrt(Math.pow(N-R,2)+Math.pow(L-_,2));E=E/I;let P=(N-R)*(S-_)-(L-_)*(C-R);switch(!0){case P>=0:P=1;break;case P<0:P=-1;break}let O=(N-R)*(C-R)+(L-_)*(S-_);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return A=Math.abs(A)*P,E=E*O,{distances:A,weights:E}}x(v,"getSegmentWeights"),u.startBatch();for(const T of Object.values(u.edges()))if((w=T.data)!=null&&w.call(T)){const{x:k,y:C}=T.source().position(),{x:S,y:E}=T.target().position();if(k!==S&&C!==E){const A=T.sourceEndpoint(),R=T.targetEndpoint(),{sourceDir:_}=hKe(T),[N,L]=p1(_)?[A.x,R.y]:[R.x,A.y],{weights:I,distances:P}=v(A,R,N,L);T.style("segment-distances",P),T.style("segment-weights",I)}}u.endBatch(),KK(y,()=>b.run())});try{KK(y,()=>b.run())}catch(v){throw v instanceof RangeError&&v.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."):v}u.ready(v=>{de.info("Ready",v),o(u)})})}x(xKe,"layoutArchitecture");var Fvr=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=sl(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 Bvr(i,f,a,e),$vr(i,f,s,e);const g=await xKe(a,s,o,l,i,u);await _vr(d,g,i,e),await Pvr(p,g,i,e),mKe(i,g),j4(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),zvr={draw:Fvr},Vvr={parser:fKe,get db(){return new dKe},renderer:zvr,styles:Ovr};const Hvr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vvr},Symbol.toStringTag,{value:"Module"}));var wKe="position frame",TKe="frame positioned",ZK="position relation",CKe="relation positioned",Gvr=x(function(t){de.debug("options str",t)},"setOptions"),Wvr=x(function(){return{}},"getOptions"),qvr=x(function(){kKe(),Oi()},"clear");function kKe(){pse={}}x(kKe,"reset");var jvr=An.eventmodeling,Yvr=x(()=>na({...jvr,...xr().eventmodeling}),"getConfig"),pse={};function SKe(){let t=Xvr;const{ast:e}=pse,r=gse();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=NKe(n,e.dataEntities,r);t=cR(t,{$kind:wKe,index:i,frame:n,textProps:a});let s;$Ke(n)?(de.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=cR(t,{$kind:ZK,index:i,frame:n,sourceFrame:o})})):t=cR(t,{$kind:ZK,index:i,frame:n})}),t={...t,sortedSwimlanesArray:mse(t.swimlanes)},t}x(SKe,"getState");function EKe(t){pse.ast=t}x(EKe,"setAst");var ii={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 gse(){return ii}x(gse,"getDiagramProps");var Xvr={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function AKe(t){const e=t.split(".");if(e.length===2)return e[0]}x(AKe,"extractNamespace");function MKe(t){const e=t.split(".");return e.length===2?e[1]:t}x(MKe,"extractName");function RKe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(RKe,"findSwimlaneByNamespace");function lR(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}x(lR,"findNextAvailableIndex");function LKe(t,e){const r=AKe(t.entityIdentifier),n=RKe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||ii.labelUiAutomation}:r?{index:lR(e,0,100),label:ii.labelUiAutomationPrefix+r}:{index:0,label:ii.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||ii.labelCommandReadModel}:r?{index:lR(e,100,200),label:ii.labelCommandReadModelPrefix+r}:{index:100,label:ii.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||ii.labelEvents}:r?{index:lR(e,200,300),label:ii.labelEventsPrefix+r}:{index:200,label:ii.labelEvents}}}x(LKe,"calculateSwimlaneProps");function IKe(t){const{themeVariables:e}=xr();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x(IKe,"calculateEntityVisualProps");function NKe(t,e,r){const n=xr(),i=Dn(MKe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};let l=`${Gx(i,r.textMaxWidth,s)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Dn(a,n),a=Gx(a,r.textMaxWidth,s),a=a.replaceAll(" "," ")),t.dataReference){const g=e.find(m=>{var U;return m.name===((U=t.dataReference)==null?void 0:U.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{ +`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Dn(a,n),a=Gx(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=bO(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return de.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(NKe,"calculateTextProps");function DKe(t,e){const r=e,n=IKe(r.frame),i={width:r.textProps.width+2*ii.boxTextPadding,height:r.textProps.height+2*ii.boxTextPadding};return[{$kind:TKe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(DKe,"decidePositionFrame");function OKe(t,e,r){return e===void 0?ii.contentStartX:e.index===t.index&&t.r?t.r+ii.boxPadding:r===void 0?ii.contentStartX:r.r-ii.boxOverlap+ii.boxPadding}x(OKe,"calculateX");function _Ke(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(_Ke,"calculateMaxRight");function mse(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(mse,"sortedSwimlanesArray");function PKe(t,e){const r=e,n=LKe(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*ii.swimlaneMinHeight+ii.swimlaneGap,height:ii.swimlaneMinHeight,maxHeight:ii.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(ii.boxMinWidth,Math.min(ii.boxMaxWidth,r.dimension.width))+2*ii.boxPadding,height:Math.max(ii.boxMinHeight,Math.min(ii.boxMaxHeight,r.dimension.height))+2*ii.boxPadding},l=OKe(i,s,a),u=l+o.width+ii.boxPadding,h=_Ke(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(ii.swimlaneMinHeight,i.maxHeight)+2*ii.swimlanePadding;const d={x:l,y:ii.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=mse(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}x($Ke,"hasSourceFrame");function JK(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(JK,"findBoxByFrame");function FKe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(FKe,"findBoxByLineIndex");function zKe(t,e){const r=e;if(Kqe(r.frame)||BKe(r.index,r.frame))return[];const n=JK(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=JK(t.boxes,r.sourceFrame):i=FKe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:CKe,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(zKe,"decidePositionRelation");function VKe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(VKe,"evolveRelationPositioned");var Kvr={[wKe]:DKe,[ZK]:zKe},Zvr={[TKe]:PKe,[CKe]:VKe};function HKe(t,e){const r=Kvr[e.$kind];if(r==null)return[];const n=r(t,e);return de.debug("decided events",n),n}x(HKe,"decide");function GKe(t,e){const r=e.reduce((n,i)=>{const a=Zvr[i.$kind];return a==null?n:a(n,i)},t);return de.debug("evolve events",{state:t,newState:r,events:e}),r}x(GKe,"evolve");function cR(t,e){const r=HKe(t,e);return GKe(t,r)}x(cR,"dispatch");var QK={getConfig:Yvr,setOptions:Gvr,getOptions:Wvr,clear:qvr,setAccTitle:qi,getAccTitle:ia,getAccDescription:sa,setAccDescription:aa,setDiagramTitle:ra,getDiagramTitle:Yi,setAst:EKe,getDiagramProps:gse,getState:SKe},Jvr={parse:x(async t=>{const e=await Qu("eventmodeling",t);de.debug(e),QK.setAst(e),ec(e,QK)},"parse")},gH=He(),Qvr=gH==null?void 0:gH.eventmodeling;function WKe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(WKe,"renderD3Box");function qKe(t,e){return t>e}x(qKe,"dirUpwards");function jKe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=qKe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;de.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(jKe,"renderD3Relation");function YKe(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(YKe,"renderD3Swimlane");var e4r=x(function(t,e,r,n){if(de.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!Qvr)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=He(),o=vt(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(YKe(o,u.maxR,l,a)),u.boxes.forEach(WKe(o,l)),u.relations.forEach(jKe(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),zJ(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),t4r={draw:e4r},r4r=x(t=>"","getStyles"),n4r=r4r,i4r={parser:Jvr,db:QK,renderer:t4r,styles:n4r};const a4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:i4r},Symbol.toStringTag,{value:"Module"}));var eZ=(function(){var t=x(function(y,b,v,w){for(v=v||{},w=y.length;w--;v[y[w]]=b);return v},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(b,v,w,T,k,C,S){var E=C.length-1;switch(k){case 6:case 7:return T;case 15:T.addNode(C[E-1].length,C[E].trim());break;case 16:T.addNode(0,C[E].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(b,v){if(v.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=v,w}},"parseError"),parse:x(function(b){var v=this,w=[0],T=[],k=[null],C=[],S=this.table,E="",A=0,R=0,_=2,N=1,L=C.slice.call(arguments,1),I=Object.create(this.lexer),P={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(P.yy[O]=this.yy[O]);I.setInput(b,P.yy),P.yy.lexer=I,P.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var D=I.yylloc;C.push(D);var B=I.options&&I.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(ie){w.length=w.length-2*ie,k.length=k.length-ie,C.length=C.length-ie}x(F,"popStack");function z(){var ie;return ie=T.pop()||I.lex()||N,typeof ie!="number"&&(ie instanceof Array&&(T=ie,ie=T.pop()),ie=v.symbols_[ie]||ie),ie}x(z,"lex");for(var $,V,H,G,K={},W,oe,Z,J;;){if(V=w[w.length-1],this.defaultActions[V]?H=this.defaultActions[V]:(($===null||typeof $>"u")&&($=z()),H=S[V]&&S[V][$]),typeof H>"u"||!H.length||!H[0]){var ne="";J=[];for(W in S[V])this.terminals_[W]&&W>_&&J.push("'"+this.terminals_[W]+"'");I.showPosition?ne="Parse error on line "+(A+1)+`: `+I.showPosition()+` -Expecting `+Q.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ne="Parse error on line "+(M+1)+": Unexpected "+(F==N?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ne,{text:I.match,token:this.terminals_[F]||F,line:I.yylineno,loc:D,expected:Q})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+F);switch(G[0]){case 1:T.push(F),S.push(I.yytext),k.push(I.yylloc),T.push(G[1]),F=null,R=I.yyleng,A=I.yytext,M=I.yylineno,D=I.yylloc;break;case 2:if(oe=this.productions_[G[1]][1],K.$=S[S.length-oe],K._$={first_line:k[k.length-(oe||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(oe||1)].first_column,last_column:k[k.length-1].last_column},B&&(K._$.range=[k[k.length-(oe||1)].range[0],k[k.length-1].range[1]]),W=this.performAction.apply(K,[A,R,M,$.yy,G[1],S,k].concat(L)),typeof W<"u")return W;oe&&(T=T.slice(0,-1*oe*2),S=S.slice(0,-1*oe),k=k.slice(0,-1*oe)),T.push(this.productions_[G[1]][0]),S.push(K.$),k.push(K._$),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(x,T){if(this.yy.parser)this.yy.parser.parseError(x,T);else throw new Error(x)},"parseError"),setInput:w(function(b,x){return this.yy=x||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 x=b.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),b},"input"),unput:w(function(b){var x=b.length,T=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;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),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===C.length?this.yylloc.first_column:0)+C[C.length-T.length].length-T[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[S[0],S[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(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(),x=new Array(b.length+1).join("-");return b+this.upcomingInput()+` -`+x+"^"},"showPosition"),test_match:w(function(b,x){var T,C,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),C=b[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+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],T=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var k in S)this[k]=S[k];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,x,T,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),k=0;kx[0].length)){if(x=T,C=k,this.options.backtrack_lexer){if(b=this.test_match(T,S[k]),b!==!1)return b;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(b=this.test_match(x,S[C]),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 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,T,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return w(y,"Parser"),y.prototype=g,g.Parser=y,new y})();jK.parser=jK;var $5r=jK,s5,B5r=(s5=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,Oi()}getRoot(){return this.root}addNode(e,r){const n=Gt.sanitizeText(r,He());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ts(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 s=this.stack[this.stack.length-1].node,a={text:n,children:[]};s.children.push(a),this.stack.push({level:i,node:a})}getAccTitle(){return ns()}setAccTitle(e){qi(e)}getAccDescription(){return ss()}setAccDescription(e){is(e)}getDiagramTitle(){return ji()}setDiagramTitle(e){ts(e)}},w(s5,"IshikawaDB"),s5),F5r=14,z2=250,z5r=30,V5r=60,H5r=5,PKe=82*Math.PI/180,kbe=Math.cos(PKe),Sbe=Math.sin(PKe),Ebe=w((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,s=n.height+e*2;qs(t,s,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${s}`)},"applyPaddedViewBox"),G5r=w((t,e,r,n)=>{var $,O;const s=n.db.getRoot();if(!s)return;const a=He(),{look:o,handDrawnSeed:l,themeVariables:u}=a,h=np(a.fontSize)[0]??F5r,d=o==="handDrawn",f=s.children??[],p=(($=a.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=a.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=al(e),y=m.append("g").attr("class","ishikawa"),v=d?dr.svg(m.node()):void 0,b=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,x=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",x).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,C=z2;const S=d?void 0:Sx(y,T,C,T,C,"ishikawa-spine");if(W5r(y,T,C,s.text,h,b),!f.length){d&&Sx(y,T,C,T,C,"ishikawa-spine",b),Ebe(m,p,g);return}T-=20;const k=f.filter((D,B)=>B%2===0),E=f.filter((D,B)=>B%2===1),A=Abe(k),M=Abe(E),R=A.total+M.total;let P=z2,N=z2;if(R>0){const D=z2*2,B=z2*.3;P=Math.max(B,D*(A.total/R)),N=Math.max(B,D*(M.total/R))}const L=h*2;P=Math.max(P,A.max*L),N=Math.max(N,M.max*L),C=Math.max(P,z2),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let D=0;DMath.min(z,V.getBBox().x),1/0)}if(d)Sx(y,T,C,0,C,"ishikawa-spine",b);else{S.attr("x1",T);const D=`url(#${x})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",D)}Ebe(m,p,g)},"draw"),Abe=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"),W5r=w((t,e,r,n,i,s)=>{const a=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=uO(o,$Ke(n,a),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(s){const p=s.roughSvg.path(f,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.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"),q5r=w((t,e)=>{const r=[],n=[],i=w((s,a,o)=>{const l=e===-1?[...s].reverse():s;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:$Ke(u.text,15),parentIndex:a,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"),U5r=w((t,e,r,n,i,s,a)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=uO(o,e,r,n+11*i,"ishikawa-label cause","middle",s).node().getBBox();if(a){const h=a.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.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"),hG=w((t,e,r,n,i,s)=>{const a=Math.sqrt(n*n+i*i);if(a===0)return;const o=n/a,l=i/a,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=s.roughSvg.path(g,{roughness:1,seed:s.seed,fill:s.lineColor,fillStyle:"solid",stroke:s.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),j5r=w((t,e,r,n,i,s,a,o)=>{const l=e.children??[],u=s*(l.length?1:.2),h=-kbe*u,d=Sbe*u*i,f=r+h,p=n+d;if(Sx(t,r,n,f,p,"ishikawa-branch",o),o&&hG(t,r,n,r-f,n-p,o),U5r(t,e.text,f,p,i,a,o),!l.length)return;const{entries:g,yOrder:m}=q5r(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const b=new Map;b.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const x=-kbe,T=Sbe*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],A=b.get(k.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let R=0,P=0,N=0;if(k.depth%2===0){const L=A.y1-A.y0;R=Mbe(A.x0,A.x1,L?(E-A.y0)/L:.5),P=E,N=R-(k.childCount>0?V5r+k.childCount*H5r:z5r),Sx(M,R,E,N,E,"ishikawa-sub-branch",o),o&&hG(M,R,E,1,0,o),uO(M,k.text,N,E,"ishikawa-label align","end",a)}else{const L=A.childrenDrawn++;R=Mbe(A.x0,A.x1,(A.childCount-L)/(A.childCount+1)),P=A.y0,N=R+x*((E-P)/T),Sx(M,R,P,N,E,"ishikawa-sub-branch",o),o&&hG(M,R,P,R-N,P-E,o),uO(M,k.text,N,E,C,"end",a)}k.childCount>0&&b.set(S,{x0:R,y0:P,x1:N,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),Y5r=w(t=>t.split(/|\n/),"splitLines"),$Ke=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"),uO=w((t,e,r,n,i,s,a)=>{const o=Y5r(e),l=a*1.05,u=t.append("text").attr("class",i).attr("text-anchor",s).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"),Mbe=w((t,e,r)=>t+(e-t)*r,"lerp"),Sx=w((t,e,r,n,i,s,a)=>{if(a){const o=a.roughSvg.line(e,r,n,i,{roughness:1.5,seed:a.seed,stroke:a.lineColor,strokeWidth:2});t.append(()=>o).attr("class",s);return}return t.append("line").attr("class",s).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),X5r={draw:G5r},K5r=w(t=>` +Expecting `+J.join(", ")+", got '"+(this.terminals_[$]||$)+"'":ne="Parse error on line "+(A+1)+": Unexpected "+($==N?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(ne,{text:I.match,token:this.terminals_[$]||$,line:I.yylineno,loc:D,expected:J})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+$);switch(H[0]){case 1:w.push($),k.push(I.yytext),C.push(I.yylloc),w.push(H[1]),$=null,R=I.yyleng,E=I.yytext,A=I.yylineno,D=I.yylloc;break;case 2:if(oe=this.productions_[H[1]][1],K.$=k[k.length-oe],K._$={first_line:C[C.length-(oe||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(oe||1)].first_column,last_column:C[C.length-1].last_column},B&&(K._$.range=[C[C.length-(oe||1)].range[0],C[C.length-1].range[1]]),G=this.performAction.apply(K,[E,R,A,P.yy,H[1],k,C].concat(L)),typeof G<"u")return G;oe&&(w=w.slice(0,-1*oe*2),k=k.slice(0,-1*oe),C=C.slice(0,-1*oe)),w.push(this.productions_[H[1]][0]),k.push(K.$),C.push(K._$),Z=S[w[w.length-2]][w[w.length-1]],w.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var y={EOF:1,parseError:x(function(v,w){if(this.yy.parser)this.yy.parser.parseError(v,w);else throw new Error(v)},"parseError"),setInput:x(function(b,v){return this.yy=v||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var v=b.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var v=b.length,w=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===T.length?this.yylloc.first_column:0)+T[T.length-w.length].length-w[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),v=new Array(b.length+1).join("-");return b+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:x(function(b,v){var w,T,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),T=b[0].match(/(?:\r\n?|\n).*/g),T&&(this.yylineno+=T.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:T?T[T.length-1].length-T[T.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],w=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var C in k)this[C]=k[C];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,v,w,T;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),C=0;Cv[0].length)){if(v=w,T=C,this.options.backtrack_lexer){if(b=this.test_match(w,k[C]),b!==!1)return b;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(b=this.test_match(v,k[T]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var v=this.next();return v||this.lex()},"lex"),begin:x(function(v){this.conditionStack.push(v)},"begin"),popState:x(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:x(function(v){this.begin(v)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(v,w,T,k){switch(T){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 y})();g.lexer=m;function U(){this.yy={}}return x(U,"Parser"),U.prototype=g,g.Parser=U,new U})();eZ.parser=eZ;var s4r=eZ,cv,o4r=(cv=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,Oi()}getRoot(){return this.root}addNode(e,r){const n=Ht.sanitizeText(r,He());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ra(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 ia()}setAccTitle(e){qi(e)}getAccDescription(){return sa()}setAccDescription(e){aa(e)}getDiagramTitle(){return Yi()}setDiagramTitle(e){ra(e)}},x(cv,"IshikawaDB"),cv),l4r=14,H2=250,c4r=30,u4r=60,h4r=5,XKe=82*Math.PI/180,Dye=Math.cos(XKe),Oye=Math.sin(XKe),_ye=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Ga(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),d4r=x((t,e,r,n)=>{var P,O;const a=n.db.getRoot();if(!a)return;const s=He(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=ip(s.fontSize)[0]??l4r,d=o==="handDrawn",f=a.children??[],p=((P=s.ishikawa)==null?void 0:P.diagramPadding)??20,g=((O=s.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=sl(e),U=m.append("g").attr("class","ishikawa"),y=d?fr.svg(m.node()):void 0,b=y?{roughSvg:y,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,v=`ishikawa-arrow-${e}`;d||U.append("defs").append("marker").attr("id",v).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,T=H2;const k=d?void 0:M6(U,w,T,w,T,"ishikawa-spine");if(f4r(U,w,T,a.text,h,b),!f.length){d&&M6(U,w,T,w,T,"ishikawa-spine",b),_ye(m,p,g);return}w-=20;const C=f.filter((D,B)=>B%2===0),S=f.filter((D,B)=>B%2===1),E=Pye(C),A=Pye(S),R=E.total+A.total;let _=H2,N=H2;if(R>0){const D=H2*2,B=H2*.3;_=Math.max(B,D*(E.total/R)),N=Math.max(B,D*(A.total/R))}const L=h*2;_=Math.max(_,E.max*L),N=Math.max(N,A.max*L),T=Math.max(_,H2),k&&k.attr("y1",T).attr("y2",T),U.select(".ishikawa-head-group").attr("transform",`translate(0,${T})`);const I=Math.ceil(f.length/2);for(let D=0;DMath.min(F,z.getBBox().x),1/0)}if(d)M6(U,w,T,0,T,"ishikawa-spine",b);else{k.attr("x1",w);const D=`url(#${v})`;U.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",D)}_ye(m,p,g)},"draw"),Pye=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),f4r=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=fD(o,KKe(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"),p4r=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:KKe(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"),g4r=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=fD(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=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),m4r=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-Dye*u,d=Oye*u*i,f=r+h,p=n+d;if(M6(t,r,n,f,p,"ishikawa-branch",o),o&&mH(t,r,n,r-f,n-p,o),g4r(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=p4r(l,i),U=g.length,y=new Array(U);for(const[k,C]of m.entries())y[C]=n+d*((k+1)/(U+1));const b=new Map;b.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const v=-Dye,w=Oye*i,T=i<0?"ishikawa-label up":"ishikawa-label down";for(const[k,C]of g.entries()){const S=y[k],E=b.get(C.parentIndex),A=t.append("g").attr("class","ishikawa-sub-group");let R=0,_=0,N=0;if(C.depth%2===0){const L=E.y1-E.y0;R=Bye(E.x0,E.x1,L?(S-E.y0)/L:.5),_=S,N=R-(C.childCount>0?u4r+C.childCount*h4r:c4r),M6(A,R,S,N,S,"ishikawa-sub-branch",o),o&&mH(A,R,S,1,0,o),fD(A,C.text,N,S,"ishikawa-label align","end",s)}else{const L=E.childrenDrawn++;R=Bye(E.x0,E.x1,(E.childCount-L)/(E.childCount+1)),_=E.y0,N=R+v*((S-_)/w),M6(A,R,_,N,S,"ishikawa-sub-branch",o),o&&mH(A,R,_,R-N,_-S,o),fD(A,C.text,N,S,T,"end",s)}C.childCount>0&&b.set(k,{x0:R,y0:_,x1:N,y1:S,childCount:C.childCount,childrenDrawn:0})}},"drawBranch"),U4r=x(t=>t.split(/|\n/),"splitLines"),KKe=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(` +`)},"wrapText"),fD=x((t,e,r,n,i,a,s)=>{const o=U4r(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"),Bye=x((t,e,r)=>t+(e-t)*r,"lerp"),M6=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),y4r={draw:d4r},b4r=x(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -5776,18 +5909,18 @@ Expecting `+Q.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ne="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),Z5r=K5r,Q5r={parser:$5r,get db(){return new B5r},renderer:X5r,styles:Z5r};const J5r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Q5r},Symbol.toStringTag,{value:"Module"})),BKe=1e-10;function pB(t,e){const r=t3r(t),n=r.filter(o=>e3r(o,t));let i=0,s=0;const a=[];if(n.length>1){const o=zKe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(x=g.radius*2),(f==null||f.width>x)&&(f={circle:g,width:x,p1:h,p2:l,large:x>g.radius,sweep:!0})}f!=null&&(a.push(f),i+=YK(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=s=0:(i=o.radius*o.radius*Math.PI,a.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-BKe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return s/=2,e&&(e.area=i+s,e.arcArea=i,e.polygonArea=s,e.arcs=a,e.innerPoints=n,e.intersectionPoints=r),i+s}function e3r(t,e){return e.every(r=>kc(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 YK(t,n)+YK(e,i)}function FKe(t,e){const r=kc(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const s=(n*n-i*i+r*r)/(2*r),a=Math.sqrt(n*n-s*s),o=t.x+s*(e.x-t.x)/r,l=t.y+s*(e.y-t.y)/r,u=-(e.y-t.y)*(a/r),h=-(e.x-t.x)*(a/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function zKe(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 r3r(t,e,r,n){n=n||{};const i=n.maxIterations||100,s=n.tolerance||1e-10,a=t(e),o=t(r);let l=r-e;if(a*o>0)throw"Initial bisect points must have opposite signs";if(a===0)return e;if(o===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)XK(e))}function Ex(t,e){let r=0;for(let n=0;nC.fx-S.fx,v=e.slice(),b=e.slice(),x=e.slice(),T=e.slice();for(let C=0;C{const A=E.slice();return A.fx=E.fx,A.id=E.id,A});k.sort((E,A)=>E.id-A.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k=g[p-1].fx){let k=!1;if(b.fx>S.fx?(Qf(x,1+h,v,-h,S),x.fx=t(x),x.fx=1)break;for(let E=1;Eo+s*i*l||u>=y)m=i;else{if(Math.abs(d)<=-a*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Qf(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ex(n.fxprime,e),u>o+s*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-a*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function i3r(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const s=e.slice();let a,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),a=n.fxprime.slice(),ZK(a,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fcae(t,e,n)-r,0,t+e)}function s3r(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:os.sets.length===2).forEach(s=>{const a=r[s.sets[0]],o=r[s.sets[1]],l=Math.sqrt(e[a].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=QK(l,u,s.size);n[a][o]=n[o][a]=h;let d=0;s.size+1e-10>=Math.min(e[a].size,e[o].size)?d=1:s.size<=1e-10&&(d=-1),i[a][o]=i[o][a]=d}),{distances:n,constraints:i}}function o3r(t,e,r,n){for(let s=0;s0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*s]+=4*m*(a-u),e[2*s+1]+=4*m*(o-h),e[2*l]+=4*m*(u-a),e[2*l+1]+=4*m*(h-o))}}return i}function l3r(t,e={}){let r=u3r(t,e);const n=e.lossFunction||L3;if(t.length>=8){const i=c3r(t,e),s=n(i,t),a=n(r,t);s+1e-8f.map(p=>p/o));const l=(f,p)=>o3r(f,p,s,a);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+GKe>=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 s=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;pt[a]));const s=n.weight!=null?n.weight:1;r+=s*(i-n.size)*(i-n.size)}return r}function WKe(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=cae(o.radius,l.radius,kc(o,l))}else i=pB(n.sets.map(o=>t[o]));const s=n.weight!=null?n.weight:1,a=Math.log((i+1)/(n.size+1));r+=s*a*a}return r}function h3r(t,e,r){if(r==null?t.sort((i,s)=>s.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,s=t[0].y;for(const a of t)a.x-=i,a.y-=s}if(t.length===2&&kc(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(i),a=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=s*l-a*u,o.y=a*l+s*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 s=t[1].y/(1e-10+t[1].x);for(const a of t){var n=(a.x+s*a.y)/(1+s*s);a.x=2*n-a.x,a.y=2*n*s-a.y}}}}function d3r(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,s){const a=e(i),o=e(s);a.parent=o}for(let i=0;i{delete i.parent}),Array.from(n.values())}function JK(t){const e=r=>{const n=t.reduce((s,a)=>Math.max(s,a[r]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((s,a)=>Math.min(s,a[r]-a.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function qKe(t,e,r){e==null&&(e=Math.PI/2);let n=YKe(t).map(u=>Object.assign({},u));const i=d3r(n);for(const u of i){h3r(u,e,r);const h=JK(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 s=n.bounds;const a=(s.xRange.max-s.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=s.xRange.max-f.xRange.min+a;else{p=s.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(s.xRange.max-s.xRange.min)/2;m<0&&(p+=m)}if(d)g=s.yRange.max-f.yRange.min+a;else{g=s.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(s.yRange.max-s.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-a.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function jKe(t){const e={};for(const r of t)e[r.setid]=r;return e}function YKe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function f3r(t={}){let e=!1,r=600,n=350,i=15,s=1e3,a=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"],b=0,x=function(k){if(k in y)return y[k];var E=y[k]=v[b];return b+=1,b>=v.length&&(b=0),E},T=HKe,C=L3;function S(k){let E=k.datum();const A=new Set;E.forEach(q=>{q.size==0&&q.sets.length==1&&A.add(q.sets[0])}),E=E.filter(q=>!q.sets.some(oe=>A.has(oe)));let M={},R={};if(E.length>0){let q=T(E,{lossFunction:C,distinct:p});o&&(q=qKe(q,a,f)),M=UKe(q,r,n,i,l),R=KKe(M,E,m)}const P={};E.forEach(q=>{q.label&&(P[q.sets]=q.label)});function N(q){if(q.sets in P)return P[q.sets];if(q.sets.length==1)return""+q.sets[0]}k.selectAll("svg").data([M]).enter().append("svg");const L=k.select("svg");e?L.attr("viewBox",`0 0 ${r} ${n}`):L.attr("width",r).attr("height",n);const I={};let $=!1;L.selectAll(".venn-area path").each(function(q){const oe=this.getAttribute("d");q.sets.length==1&&oe&&!p&&($=!0,I[q.sets[0]]=m3r(oe))});function O(q){return oe=>{const Z=q.sets.map(Q=>{let ne=I[Q],ie=M[Q];return ne||(ne={x:r/2,y:n/2,radius:1}),ie||(ie={x:r/2,y:n/2,radius:1}),{x:ne.x*(1-oe)+ie.x*oe,y:ne.y*(1-oe)+ie.y*oe,radius:ne.radius*(1-oe)+ie.radius*oe}});return _be(Z,g)}}const D=L.selectAll(".venn-area").data(E,q=>q.sets),B=D.enter().append("g").attr("class",q=>`venn-area venn-${q.sets.length==1?"circle":"intersection"}${q.colour||q.color?" venn-coloured":""}`).attr("data-venn-sets",q=>q.sets.join("_")),z=B.append("path"),V=B.append("text").attr("class","label").text(q=>N(q)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(q=>q.sets.length==1).style("fill",q=>q.colour?q.colour:q.color?q.color:x(q.sets)).style("fill-opacity",".25"),V.style("fill",q=>q.colour||q.color?"#FFF":t.textFill?t.textFill:q.sets.length==1?x(q.sets):"#444"));function F(q){return typeof q.transition=="function"?q.transition("venn").duration(s):q}let H=k;$&&typeof H.transition=="function"?(H=F(k),H.selectAll("path").attrTween("d",O)):H.selectAll("path").attr("d",q=>_be(q.sets.map(oe=>M[oe])),g);const G=H.selectAll("text").filter(q=>q.sets in R).text(q=>N(q)).attr("x",q=>Math.floor(R[q.sets].x)).attr("y",q=>Math.floor(R[q.sets].y));u&&($?"on"in G?G.on("end",dG(M,N)):G.each("end",dG(M,N)):G.each(dG(M,N)));const W=F(D.exit()).remove();typeof D.transition=="function"&&W.selectAll("path").attrTween("d",O);const K=W.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),G.style("font-size",d),K.style("font-size","0px")),{circles:M,textCentres:R,nodes:D,enter:B,update:H,exit:W}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(x=k,S):x},S.colors=function(k){return arguments.length?(x=k,S):x},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(s=k,S):s},S.layoutFunction=function(k){return arguments.length?(T=k,S):T},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(a=k,S):a},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?L3:k==="logRatio"?WKe:k,S):C},S}function dG(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,s=e(r)||"",a=s.split(/\s+/).reverse(),l=(s.length+a.length)/3;let u=a.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(x){const T=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return T.textContent=x,p.push(T),n.append(T),T}let m=g(u);for(;u=a.pop(),!!u;){h.push(u);const x=h.join(" ");m.textContent=x,x.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"),b=n.getAttribute("y");p.forEach((x,T)=>{x.setAttribute("x",v),x.setAttribute("y",b),x.setAttribute("dy",`${y+T*f}em`)})}}function fG(t,e,r){let n=e[0].radius-kc(e[0],t);for(let i=1;i=s&&(i=n[h],s=d)}const a=VKe(h=>-1*fG({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:a[0],y:a[1]};let l=!0;for(const h of t)if(kc(o,h)>h.radius){l=!1;break}for(const h of e)if(kc(o,h)h.p1))}function p3r(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+a+" not represented on screen")}return n}function g3r(t,e,r){const n=[];return n.push(` +`,"getStyles"),v4r=b4r,x4r={parser:s4r,get db(){return new o4r},renderer:y4r,styles:v4r};const w4r=Object.freeze(Object.defineProperty({__proto__:null,diagram:x4r},Symbol.toStringTag,{value:"Module"})),ZKe=1e-10;function UB(t,e){const r=C4r(t),n=r.filter(o=>T4r(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=QKe(n);for(let u=0;uh.angle-u.angle);let l=n[n.length-1];for(let u=0;ug.radius*2&&(v=g.radius*2),(f==null||f.width>v)&&(f={circle:g,width:v,p1:h,p2:l,large:v>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=tZ(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-ZKe,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 T4r(t,e){return e.every(r=>Cc(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 tZ(t,n)+tZ(e,i)}function JKe(t,e){const r=Cc(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 QKe(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 k4r(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)rZ(e))}function R6(t,e){let r=0;for(let n=0;nT.fx-k.fx,y=e.slice(),b=e.slice(),v=e.slice(),w=e.slice();for(let T=0;T{const E=S.slice();return E.fx=S.fx,E.id=S.id,E});C.sort((S,E)=>S.id-E.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(b.fx>k.fx?(Qf(v,1+h,y,-h,k),v.fx=t(v),v.fx=1)break;for(let S=1;So+a*i*l||u>=U)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,U=u}return 0}for(let g=0;g<10;++g){if(Qf(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=R6(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 E4r(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(),iZ(s,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fUse(t,e,n)-r,0,t+e)}function A4r(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=aZ(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 R4r(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 L4r(t,e={}){let r=N4r(t,e);const n=e.lossFunction||D4;if(t.length>=8){const i=I4r(t,e),a=n(i,t),s=n(r,t);a+1e-8f.map(p=>p/o));const l=(f,p)=>R4r(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+rZe>=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 nZe(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=Use(o.radius,l.radius,Cc(o,l))}else i=UB(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 D4r(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&&Cc(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 O4r(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 sZ(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 iZe(t,e,r){e==null&&(e=Math.PI/2);let n=oZe(t).map(u=>Object.assign({},u));const i=O4r(n);for(const u of i){D4r(u,e,r);const h=sZ(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 sZe(t){const e={};for(const r of t)e[r.setid]=r;return e}function oZe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function _4r(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,U={},y=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],b=0,v=function(C){if(C in U)return U[C];var S=U[C]=y[b];return b+=1,b>=y.length&&(b=0),S},w=tZe,T=D4;function k(C){let S=C.datum();const E=new Set;S.forEach(W=>{W.size==0&&W.sets.length==1&&E.add(W.sets[0])}),S=S.filter(W=>!W.sets.some(oe=>E.has(oe)));let A={},R={};if(S.length>0){let W=w(S,{lossFunction:T,distinct:p});o&&(W=iZe(W,s,f)),A=aZe(W,r,n,i,l),R=cZe(A,S,m)}const _={};S.forEach(W=>{W.label&&(_[W.sets]=W.label)});function N(W){if(W.sets in _)return _[W.sets];if(W.sets.length==1)return""+W.sets[0]}C.selectAll("svg").data([A]).enter().append("svg");const L=C.select("svg");e?L.attr("viewBox",`0 0 ${r} ${n}`):L.attr("width",r).attr("height",n);const I={};let P=!1;L.selectAll(".venn-area path").each(function(W){const oe=this.getAttribute("d");W.sets.length==1&&oe&&!p&&(P=!0,I[W.sets[0]]=$4r(oe))});function O(W){return oe=>{const Z=W.sets.map(J=>{let ne=I[J],ie=A[J];return ne||(ne={x:r/2,y:n/2,radius:1}),ie||(ie={x:r/2,y:n/2,radius:1}),{x:ne.x*(1-oe)+ie.x*oe,y:ne.y*(1-oe)+ie.y*oe,radius:ne.radius*(1-oe)+ie.radius*oe}});return Fye(Z,g)}}const D=L.selectAll(".venn-area").data(S,W=>W.sets),B=D.enter().append("g").attr("class",W=>`venn-area venn-${W.sets.length==1?"circle":"intersection"}${W.colour||W.color?" venn-coloured":""}`).attr("data-venn-sets",W=>W.sets.join("_")),F=B.append("path"),z=B.append("text").attr("class","label").text(W=>N(W)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(F.style("fill-opacity","0").filter(W=>W.sets.length==1).style("fill",W=>W.colour?W.colour:W.color?W.color:v(W.sets)).style("fill-opacity",".25"),z.style("fill",W=>W.colour||W.color?"#FFF":t.textFill?t.textFill:W.sets.length==1?v(W.sets):"#444"));function $(W){return typeof W.transition=="function"?W.transition("venn").duration(a):W}let V=C;P&&typeof V.transition=="function"?(V=$(C),V.selectAll("path").attrTween("d",O)):V.selectAll("path").attr("d",W=>Fye(W.sets.map(oe=>A[oe])),g);const H=V.selectAll("text").filter(W=>W.sets in R).text(W=>N(W)).attr("x",W=>Math.floor(R[W.sets].x)).attr("y",W=>Math.floor(R[W.sets].y));u&&(P?"on"in H?H.on("end",UH(A,N)):H.each("end",UH(A,N)):H.each(UH(A,N)));const G=$(D.exit()).remove();typeof D.transition=="function"&&G.selectAll("path").attrTween("d",O);const K=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(z.style("font-size","0px"),H.style("font-size",d),K.style("font-size","0px")),{circles:A,textCentres:R,nodes:D,enter:B,update:V,exit:G}}return k.wrap=function(C){return arguments.length?(u=C,k):u},k.useViewBox=function(){return e=!0,k},k.width=function(C){return arguments.length?(r=C,k):r},k.height=function(C){return arguments.length?(n=C,k):n},k.padding=function(C){return arguments.length?(i=C,k):i},k.distinct=function(C){return arguments.length?(p=C,k):p},k.colours=function(C){return arguments.length?(v=C,k):v},k.colors=function(C){return arguments.length?(v=C,k):v},k.fontSize=function(C){return arguments.length?(d=C,k):d},k.round=function(C){return arguments.length?(g=C,k):g},k.duration=function(C){return arguments.length?(a=C,k):a},k.layoutFunction=function(C){return arguments.length?(w=C,k):w},k.normalize=function(C){return arguments.length?(o=C,k):o},k.scaleToFit=function(C){return arguments.length?(l=C,k):l},k.styled=function(C){return arguments.length?(h=C,k):h},k.orientation=function(C){return arguments.length?(s=C,k):s},k.orientationOrder=function(C){return arguments.length?(f=C,k):f},k.lossFunction=function(C){return arguments.length?(T=C==="default"?D4:C==="logRatio"?nZe:C,k):T},k}function UH(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(v){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=v,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const v=h.join(" ");m.textContent=v,v.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const U=.35-d*f/2,y=n.getAttribute("x"),b=n.getAttribute("y");p.forEach((v,w)=>{v.setAttribute("x",y),v.setAttribute("y",b),v.setAttribute("dy",`${U+w*f}em`)})}}function yH(t,e,r){let n=e[0].radius-Cc(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const s=eZe(h=>-1*yH({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(Cc(o,h)>h.radius){l=!1;break}for(const h of e)if(Cc(o,h)h.p1))}function P4r(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 B4r(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 m3r(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function ZKe(t){if(t.length===0)return[];const e={};return pB(t,e),e.arcs}function QKe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?s=>Math.round(s*r)/r:s=>s;if(t.length==1){const s=t[0].circle;return g3r(n(s.x),n(s.y),n(s.radius))}const i=[` -M`,n(t[0].p2.x),n(t[0].p2.y)];for(const s of t){const a=n(s.circle.radius);i.push(` -A`,a,a,0,s.large?1:0,s.sweep?1:0,n(s.p1.x),n(s.p1.y))}return i.join(" ")}function _be(t,e){return QKe(ZKe(t),e)}function y3r(t,e={}){const{lossFunction:r,layoutFunction:n=HKe,normalize:i=!0,orientation:s=Math.PI/2,orientationOrder:a,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?L3:r==="logRatio"?WKe:r,distinct:f});i&&(g=qKe(g,s,a));const m=UKe(g,o,l,u,h),y=KKe(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}])),b=t.map(T=>{const C=T.sets.map(E=>v.get(E)),S=ZKe(C),k=QKe(S,p);return{circles:C,arcs:S,path:k,area:T,has:new Set(T.sets)}});function x(T){let C="";for(const S of b)S.has.size>T.length&&T.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return b.map(({circles:T,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:T,arcs:C,path:S,distinctPath:S+x(k.sets)}))}var eZ=(function(){var t=w(function(b,x,T,C){for(T=T||{},C=b.length;C--;T[b[C]]=x);return T},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],s=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[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(x,T,C,S,k,E,A){var M=E.length-1;switch(k){case 1:return E[M-1];case 2:case 3:case 4:this.$=[];break;case 5:E[M-1].push(E[M]),this.$=E[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[M];break;case 8:S.setDiagramTitle(E[M].substr(6)),this.$=E[M].substr(6);break;case 9:S.addSubsetData([E[M]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[M-1]],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[M-2]],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[M-3]],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[M].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M]),S.addSubsetData(E[M],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[M-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-1]),S.addSubsetData(E[M-1],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[M-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-2]),S.addSubsetData(E[M-2],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[M-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-3]),S.addSubsetData(E[M-3],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[M-1],E[M],void 0);break;case 20:case 21:S.addTextData(E[M-2],E[M-1],E[M]);break;case 23:S.addStyleData(E[M-1],E[M]);break;case 24:case 25:case 26:var R=S.getCurrentSets();if(!R)throw new Error("text requires set");S.addTextData(R,E[M],void 0);break;case 27:case 28:var R=S.getCurrentSets();if(!R)throw new Error("text requires set");S.addTextData(R,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(s,[2,43]),t(s,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:a}),t(s,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},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:a},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(s,[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(x,T){if(T.recoverable)this.trace(x);else{var C=new Error(x);throw C.hash=T,C}},"parseError"),parse:w(function(x){var T=this,C=[0],S=[],k=[null],E=[],A=this.table,M="",R=0,P=0,N=2,L=1,I=E.slice.call(arguments,1),$=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]);$.setInput(x,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var B=$.yylloc;E.push(B);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(me){C.length=C.length-2*me,k.length=k.length-me,E.length=E.length-me}w(V,"popStack");function F(){var me;return me=S.pop()||$.lex()||L,typeof me!="number"&&(me instanceof Array&&(S=me,me=S.pop()),me=T.symbols_[me]||me),me}w(F,"lex");for(var H,G,W,K,q={},oe,Z,Q,ne;;){if(G=C[C.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((H===null||typeof H>"u")&&(H=F()),W=A[G]&&A[G][H]),typeof W>"u"||!W.length||!W[0]){var ie="";ne=[];for(oe in A[G])this.terminals_[oe]&&oe>N&&ne.push("'"+this.terminals_[oe]+"'");$.showPosition?ie="Parse error on line "+(R+1)+`: -`+$.showPosition()+` -Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error on line "+(R+1)+": Unexpected "+(H==L?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ie,{text:$.match,token:this.terminals_[H]||H,line:$.yylineno,loc:B,expected:ne})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+H);switch(W[0]){case 1:C.push(H),k.push($.yytext),E.push($.yylloc),C.push(W[1]),H=null,P=$.yyleng,M=$.yytext,R=$.yylineno,B=$.yylloc;break;case 2:if(Z=this.productions_[W[1]][1],q.$=k[k.length-Z],q._$={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&&(q._$.range=[E[E.length-(Z||1)].range[0],E[E.length-1].range[1]]),K=this.performAction.apply(q,[M,P,R,O.yy,W[1],k,E].concat(I)),typeof K<"u")return K;Z&&(C=C.slice(0,-1*Z*2),k=k.slice(0,-1*Z),E=E.slice(0,-1*Z)),C.push(this.productions_[W[1]][0]),k.push(q.$),E.push(q._$),Q=A[C[C.length-2]][C[C.length-1]],C.push(Q);break;case 3:return!0}}return!0},"parse")},y=(function(){var b={EOF:1,parseError:w(function(T,C){if(this.yy.parser)this.yy.parser.parseError(T,C);else throw new Error(T)},"parseError"),setInput:w(function(x,T){return this.yy=T||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 T=x.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),x},"input"),unput:w(function(x){var T=x.length,C=x.split(/(?:\r\n?|\n)/g);this._input=x+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),C.length-1&&(this.yylineno-=C.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[0].length:this.yylloc.first_column-T},this.options.ranges&&(this.yylloc.range=[k[0],k[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(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(),T=new Array(x.length+1).join("-");return x+this.upcomingInput()+` -`+T+"^"},"showPosition"),test_match:w(function(x,T){var C,S,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),S=x[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+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],C=this.performAction.call(this,this.yy,this,T,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,T,C,S;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;ET[0].length)){if(T=C,S=E,this.options.backtrack_lexer){if(x=this.test_match(C,k[E]),x!==!1)return x;if(this._backtrack){T=!1;continue}else return!1}else if(!this.options.flex)break}return T?(x=this.test_match(T,k[S]),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 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,C,S,k){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(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(T.consumeIndentText)T.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return b})();m.lexer=y;function v(){this.yy={}}return w(v,"Parser"),v.prototype=m,m.Parser=v,new v})();eZ.parser=eZ;var v3r=eZ,uae=[],hae=[],dae=[],fae=new Set,pae,gae=!1,b3r=w((t,e,r)=>{const n=gB(t).sort(),i=r??10/Math.pow(t.length,2);pae=n,n.length===1&&fae.add(n[0]),uae.push({sets:n,size:i,label:e?kA(e):void 0})},"addSubsetData"),x3r=w(()=>uae,"getSubsetData"),kA=w(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),w3r=w(t=>t&&kA(t),"normalizeStyleValue"),T3r=w((t,e,r)=>{const n=kA(e);hae.push({sets:gB(t).sort(),id:n,label:r?kA(r):void 0})},"addTextData"),C3r=w((t,e)=>{const r=gB(t).sort(),n={};for(const[i,s]of e)n[i]=w3r(s)??s;dae.push({targets:r,styles:n})},"addStyleData"),k3r=w(()=>dae,"getStyleData"),gB=w(t=>t.map(e=>kA(e)),"normalizeIdentifierList"),S3r=w(t=>{const r=gB(t).filter(n=>!fae.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),E3r=w(()=>hae,"getTextData"),A3r=w(()=>pae,"getCurrentSets"),M3r=w(()=>gae,"getIndentMode"),R3r=w(t=>{gae=t},"setIndentMode"),_3r=En.venn;function JKe(){return rs(_3r,xr().venn)}w(JKe,"getConfig");var L3r=w(()=>{Oi(),uae.length=0,hae.length=0,dae.length=0,fae.clear(),pae=void 0,gae=!1},"customClear"),I3r={getConfig:JKe,clear:L3r,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is,addSubsetData:b3r,getSubsetData:x3r,addTextData:T3r,addStyleData:C3r,validateUnionIdentifiers:S3r,getTextData:E3r,getStyleData:k3r,getCurrentSets:A3r,getIndentMode:M3r,setIndentMode:R3r},N3r=w(t=>` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function $4r(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function uZe(t){if(t.length===0)return[];const e={};return UB(t,e),e.arcs}function hZe(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 B4r(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 Fye(t,e){return hZe(uZe(t),e)}function F4r(t,e={}){const{lossFunction:r,layoutFunction:n=tZe,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?D4:r==="logRatio"?nZe:r,distinct:f});i&&(g=iZe(g,a,s));const m=aZe(g,o,l,u,h),U=cZe(m,t,d),y=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),b=t.map(w=>{const T=w.sets.map(S=>y.get(S)),k=uZe(T),C=hZe(k,p);return{circles:T,arcs:k,path:C,area:w,has:new Set(w.sets)}});function v(w){let T="";for(const k of b)k.has.size>w.length&&w.every(C=>k.has.has(C))&&(T+=" "+k.path);return T}return b.map(({circles:w,arcs:T,path:k,area:C})=>({data:C,text:U[C.sets],circles:w,arcs:T,path:k,distinctPath:k+v(C.sets)}))}var oZ=(function(){var t=x(function(b,v,w,T){for(w=w||{},T=b.length;T--;w[b[T]]=v);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(v,w,T,k,C,S,E){var A=S.length-1;switch(C){case 1:return S[A-1];case 2:case 3:case 4:this.$=[];break;case 5:S[A-1].push(S[A]),this.$=S[A-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=S[A];break;case 8:k.setDiagramTitle(S[A].substr(6)),this.$=S[A].substr(6);break;case 9:k.addSubsetData([S[A]],void 0,void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 10:k.addSubsetData([S[A-1]],S[A],void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 11:k.addSubsetData([S[A-2]],void 0,parseFloat(S[A])),k.setIndentMode&&k.setIndentMode(!0);break;case 12:k.addSubsetData([S[A-3]],S[A-2],parseFloat(S[A])),k.setIndentMode&&k.setIndentMode(!0);break;case 13:if(S[A].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(S[A]),k.addSubsetData(S[A],void 0,void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 14:if(S[A-1].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(S[A-1]),k.addSubsetData(S[A-1],S[A],void 0),k.setIndentMode&&k.setIndentMode(!0);break;case 15:if(S[A-2].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(S[A-2]),k.addSubsetData(S[A-2],void 0,parseFloat(S[A])),k.setIndentMode&&k.setIndentMode(!0);break;case 16:if(S[A-3].length<2)throw new Error("union requires multiple identifiers");k.validateUnionIdentifiers&&k.validateUnionIdentifiers(S[A-3]),k.addSubsetData(S[A-3],S[A-2],parseFloat(S[A])),k.setIndentMode&&k.setIndentMode(!0);break;case 17:case 18:case 19:k.addTextData(S[A-1],S[A],void 0);break;case 20:case 21:k.addTextData(S[A-2],S[A-1],S[A]);break;case 23:k.addStyleData(S[A-1],S[A]);break;case 24:case 25:case 26:var R=k.getCurrentSets();if(!R)throw new Error("text requires set");k.addTextData(R,S[A],void 0);break;case 27:case 28:var R=k.getCurrentSets();if(!R)throw new Error("text requires set");k.addTextData(R,S[A-1],S[A]);break;case 29:case 41:this.$=[S[A]];break;case 30:case 42:this.$=[...S[A-2],S[A]];break;case 31:this.$=[S[A-2],S[A]];break;case 33:this.$=S[A].join(" ");break;case 34:this.$=[S[A]];break;case 35:S[A-1].push(S[A]),this.$=S[A-1];break;case 43:case 44:this.$=S[A];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(v,w){if(w.recoverable)this.trace(v);else{var T=new Error(v);throw T.hash=w,T}},"parseError"),parse:x(function(v){var w=this,T=[0],k=[],C=[null],S=[],E=this.table,A="",R=0,_=0,N=2,L=1,I=S.slice.call(arguments,1),P=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]);P.setInput(v,O.yy),O.yy.lexer=P,O.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var B=P.yylloc;S.push(B);var F=P.options&&P.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(me){T.length=T.length-2*me,C.length=C.length-me,S.length=S.length-me}x(z,"popStack");function $(){var me;return me=k.pop()||P.lex()||L,typeof me!="number"&&(me instanceof Array&&(k=me,me=k.pop()),me=w.symbols_[me]||me),me}x($,"lex");for(var V,H,G,K,W={},oe,Z,J,ne;;){if(H=T[T.length-1],this.defaultActions[H]?G=this.defaultActions[H]:((V===null||typeof V>"u")&&(V=$()),G=E[H]&&E[H][V]),typeof G>"u"||!G.length||!G[0]){var ie="";ne=[];for(oe in E[H])this.terminals_[oe]&&oe>N&&ne.push("'"+this.terminals_[oe]+"'");P.showPosition?ie="Parse error on line "+(R+1)+`: +`+P.showPosition()+` +Expecting `+ne.join(", ")+", got '"+(this.terminals_[V]||V)+"'":ie="Parse error on line "+(R+1)+": Unexpected "+(V==L?"end of input":"'"+(this.terminals_[V]||V)+"'"),this.parseError(ie,{text:P.match,token:this.terminals_[V]||V,line:P.yylineno,loc:B,expected:ne})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+V);switch(G[0]){case 1:T.push(V),C.push(P.yytext),S.push(P.yylloc),T.push(G[1]),V=null,_=P.yyleng,A=P.yytext,R=P.yylineno,B=P.yylloc;break;case 2:if(Z=this.productions_[G[1]][1],W.$=C[C.length-Z],W._$={first_line:S[S.length-(Z||1)].first_line,last_line:S[S.length-1].last_line,first_column:S[S.length-(Z||1)].first_column,last_column:S[S.length-1].last_column},F&&(W._$.range=[S[S.length-(Z||1)].range[0],S[S.length-1].range[1]]),K=this.performAction.apply(W,[A,_,R,O.yy,G[1],C,S].concat(I)),typeof K<"u")return K;Z&&(T=T.slice(0,-1*Z*2),C=C.slice(0,-1*Z),S=S.slice(0,-1*Z)),T.push(this.productions_[G[1]][0]),C.push(W.$),S.push(W._$),J=E[T[T.length-2]][T[T.length-1]],T.push(J);break;case 3:return!0}}return!0},"parse")},U=(function(){var b={EOF:1,parseError:x(function(w,T){if(this.yy.parser)this.yy.parser.parseError(w,T);else throw new Error(w)},"parseError"),setInput:x(function(v,w){return this.yy=w||this.yy||{},this._input=v,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var v=this._input[0];this.yytext+=v,this.yyleng++,this.offset++,this.match+=v,this.matched+=v;var w=v.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),v},"input"),unput:x(function(v){var w=v.length,T=v.split(/(?:\r\n?|\n)/g);this._input=v+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),T.length-1&&(this.yylineno-=T.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:T?(T.length===k.length?this.yylloc.first_column:0)+k[k.length-T.length].length-T[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(v){this.unput(this.match.slice(v))},"less"),pastInput:x(function(){var v=this.matched.substr(0,this.matched.length-this.match.length);return(v.length>20?"...":"")+v.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var v=this.match;return v.length<20&&(v+=this._input.substr(0,20-v.length)),(v.substr(0,20)+(v.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var v=this.pastInput(),w=new Array(v.length+1).join("-");return v+this.upcomingInput()+` +`+w+"^"},"showPosition"),test_match:x(function(v,w){var T,k,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))),k=v[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+v[0].length},this.yytext+=v[0],this.match+=v[0],this.matches=v,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(v[0].length),this.matched+=v[0],T=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var S in C)this[S]=C[S];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var v,w,T,k;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),S=0;Sw[0].length)){if(w=T,k=S,this.options.backtrack_lexer){if(v=this.test_match(T,C[S]),v!==!1)return v;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(v=this.test_match(w,C[k]),v!==!1?v:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,T,k,C){switch(k){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(T.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return T.yytext=T.yytext.slice(2,-2),14;case 17:return T.yytext=T.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 b})();m.lexer=U;function y(){this.yy={}}return x(y,"Parser"),y.prototype=m,m.Parser=y,new y})();oZ.parser=oZ;var z4r=oZ,yse=[],bse=[],vse=[],xse=new Set,wse,Tse=!1,V4r=x((t,e,r)=>{const n=yB(t).sort(),i=r??10/Math.pow(t.length,2);wse=n,n.length===1&&xse.add(n[0]),yse.push({sets:n,size:i,label:e?EC(e):void 0})},"addSubsetData"),H4r=x(()=>yse,"getSubsetData"),EC=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),G4r=x(t=>t&&EC(t),"normalizeStyleValue"),W4r=x((t,e,r)=>{const n=EC(e);bse.push({sets:yB(t).sort(),id:n,label:r?EC(r):void 0})},"addTextData"),q4r=x((t,e)=>{const r=yB(t).sort(),n={};for(const[i,a]of e)n[i]=G4r(a)??a;vse.push({targets:r,styles:n})},"addStyleData"),j4r=x(()=>vse,"getStyleData"),yB=x(t=>t.map(e=>EC(e)),"normalizeIdentifierList"),Y4r=x(t=>{const r=yB(t).filter(n=>!xse.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),X4r=x(()=>bse,"getTextData"),K4r=x(()=>wse,"getCurrentSets"),Z4r=x(()=>Tse,"getIndentMode"),J4r=x(t=>{Tse=t},"setIndentMode"),Q4r=An.venn;function dZe(){return na(Q4r,xr().venn)}x(dZe,"getConfig");var e9r=x(()=>{Oi(),yse.length=0,bse.length=0,vse.length=0,xse.clear(),wse=void 0,Tse=!1},"customClear"),t9r={getConfig:dZe,clear:e9r,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa,addSubsetData:V4r,getSubsetData:H4r,addTextData:W4r,addStyleData:q4r,validateUnionIdentifiers:Y4r,getTextData:X4r,getStyleData:j4r,getCurrentSets:K4r,getIndentMode:Z4r,setIndentMode:J4r},r9r=x(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -5809,7 +5942,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),O3r=N3r;function eZe(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(eZe,"buildStyleByKey");var D3r=w((t,e,r,n)=>{var I,$,O;const i=n.db,s=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:a,look:o,handDrawnSeed:l}=xr(),u=o==="handDrawn",h=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=eZe(i.getStyleData()),m=rZe(f),y=(s==null?void 0:s.width)??800,v=(s==null?void 0:s.height)??450,x=y/1600,T=d?48*x:0,C=a.primaryTextColor??a.textColor,S=al(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*x}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*x).style("fill",a.vennTitleTextColor||a.titleColor);const k=xt(document.createElement("div")),E=f3r().width(y).height(v-T);k.datum(m).call(E);const A=u?dr.svg(k.select("svg").node()):void 0,M=y3r(m,{width:y,height:v-T,padding:(s==null?void 0:s.padding)??15}),R=new Map;for(const D of M){const B=tg([...D.data.sets].sort());R.set(B,D)}p.length>0&&tZe(s,R,k,p,x,g);const P=Kl(a.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(D,B){var Z;const z=xt(this),F=tg([...D.sets].sort()),H=g.get(F),G=(H==null?void 0:H.fill)||h[B%h.length]||a.primaryColor;z.classed(`venn-set-${B%8}`,!0);const W=(H==null?void 0:H["fill-opacity"])??.1,K=(H==null?void 0:H.stroke)||G,q=(H==null?void 0:H["stroke-width"])||`${5*x}`;if(u&&A){const Q=R.get(F);if(Q&&Q.circles.length>0){const ne=Q.circles[0],ie=A.circle(ne.x,ne.y,ne.radius*2,{roughness:.7,seed:l,fill:Kce(G,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+B*60,stroke:K,strokeWidth:parseFloat(String(q))});z.select("path").remove(),(Z=z.node())==null||Z.insertBefore(ie,z.select("text").node())}}else z.select("path").style("fill",G).style("fill-opacity",W).style("stroke",K).style("stroke-width",q).style("stroke-opacity",.95);const oe=(H==null?void 0:H.color)||(P?lt(G,30):ct(G,30));z.select("text").style("font-size",`${48*x}px`).style("fill",oe)}),u&&A?k.selectAll(".venn-intersection").each(function(D){var G;const B=xt(this),V=tg([...D.sets].sort()),F=g.get(V),H=F==null?void 0:F.fill;if(H){const W=B.select("path"),K=W.attr("d");if(K){const q=A.path(K,{roughness:.7,seed:l,fill:Kce(H,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),oe=W.node();(G=oe==null?void 0:oe.parentNode)==null||G.insertBefore(q,oe),W.remove()}}else B.select("path").style("fill-opacity",0);B.select("text").style("font-size",`${48*x}px`).style("fill",(F==null?void 0:F.color)??a.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",D=>{var V;const z=tg([...D.sets].sort());return((V=g.get(z))==null?void 0:V.color)??a.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",D=>{var V;const z=tg([...D.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",D=>{var V;const z=tg([...D.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const N=S.append("g").attr("transform",`translate(0, ${T})`),L=k.select("svg").node();if(L&&"childNodes"in L)for(const D of[...L.childNodes])(O=N.node())==null||O.appendChild(D);qs(S,v,y,(s==null?void 0:s.useMaxWidth)??!0)},"draw");function tg(t){return t.join("|")}w(tg,"stableSetsKey");function tZe(t,e,r,n,i,s){var h;const a=(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=tg(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 b=Number.isFinite(v)?Math.max(0,v):0;b===0&&Number.isFinite(y)&&(b=y*.6);const x=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);a&&x.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",b).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,b*2*.95),C=Math.max(60*i,b*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,b*.25):0)+(f.length<=2?30*i:0),A=g-T/2,M=m-C/2+E,R=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/R)),N=T/R,L=C/P;for(const[I,$]of f.entries()){const O=I%R,D=Math.floor(I/R),B=A+N*(O+.5),z=M+L*(D+.5);a&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",A+N*O).attr("y",M+L*D).attr("width",N).attr("height",L).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=N*.9,F=L*.9,H=x.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",F).attr("x",B-V/2).attr("y",z-F/2).attr("overflow","visible"),G=(h=s.get($.id))==null?void 0:h.color,W=H.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);G&&W.style("color",G)}}}w(tZe,"renderTextNodes");function rZe(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 s=[...i.sets].sort();for(let a=0;a0?[...t,...n]:t}w(rZe,"ensurePairwiseSubsets");var P3r={draw:D3r},$3r={parser:v3r,db:I3r,renderer:P3r,styles:O3r};const B3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:$3r},Symbol.toStringTag,{value:"Module"}));var a5,nZe=(a5=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=qi,this.getAccTitle=ns,this.setDiagramTitle=ts,this.getDiagramTitle=ji,this.getAccDescription=ss,this.setAccDescription=is}getNodes(){return this.nodes}getConfig(){const e=En,r=xr();return rs({...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(s=>{iJ(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),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(){Oi(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(a5,"TreeMapDB"),a5);function iZe(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 s=r[r.length-1].node;s.children?s.children.push(i):s.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}w(iZe,"buildHierarchy");var F3r=w((t,e)=>{ec(t,e);const r=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&e.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const a=s.item;if(!a)continue;const o=s.indent?parseInt(s.indent):0,l=z3r(a),u=a.classSelector?e.getStylesForClass(a.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:a.$type,value:a.value,classSelector:a.classSelector,cssCompiledStyles:h};r.push(d)}const n=iZe(r),i=w((s,a)=>{for(const o of s)e.addNode(o,a),o.children&&o.children.length>0&&i(o.children,a+1)},"addNodesRecursively");i(n,0)},"populate"),z3r=w(t=>t.name?String(t.name):"","getItemName"),sZe={parser:{yy:void 0},parse:w(async t=>{var e;try{const n=await Ju("treemap",t);de.debug("Treemap AST:",n);const i=(e=sZe.parser)==null?void 0:e.yy;if(!(i instanceof nZe))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.");F3r(n,i)}catch(r){throw de.error("Error parsing treemap:",r),r}},"parse")},V3r=10,V2=10,xk=25,H3r=w((t,e,r,n)=>{const i=n.db,s=i.getConfig(),a=s.padding??V3r,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=xr();if(!l)return;const h=o?30:0,d=al(e),f=s.nodeWidth?s.nodeWidth*V2:960,p=s.nodeHeight?s.nodeHeight*V2:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),qs(d,m,g,s.useMaxWidth);let y;try{const F=s.valueFormat||",";if(F==="$0,0")y=w(H=>"$"+O1(",")(H),"valueFormat");else if(F.startsWith("$")&&F.includes(",")){const H=/\.\d+/.exec(F),G=H?H[0]:"";y=w(W=>"$"+O1(","+G)(W),"valueFormat")}else if(F.startsWith("$")){const H=F.substring(1);y=w(G=>"$"+O1(H||"")(G),"valueFormat")}else y=O1(F)}catch(F){de.error("Error creating format function:",F),y=O1(",")}const v=Ey().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]),b=Ey().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]),x=Ey().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"),C=GQ(l).sum(F=>F.value??0).sort((F,H)=>(H.value??0)-(F.value??0)),k=nTt().size([f,p]).paddingTop(F=>F.children&&F.children.length>0?xk+V2:0).paddingInner(a).paddingLeft(F=>F.children&&F.children.length>0?V2:0).paddingRight(F=>F.children&&F.children.length>0?V2:0).paddingBottom(F=>F.children&&F.children.length>0?V2:0).round(!0)(C),E=k.descendants().filter(F=>F.children&&F.children.length>0),A=T.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",F=>`translate(${F.x0},${F.y0})`);A.append("rect").attr("width",F=>F.x1-F.x0).attr("height",xk).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",F=>F.depth===0?"display: none;":""),A.append("clipPath").attr("id",(F,H)=>`clip-section-${e}-${H}`).append("rect").attr("width",F=>Math.max(0,F.x1-F.x0-12)).attr("height",xk),A.append("rect").attr("width",F=>F.x1-F.x0).attr("height",F=>F.y1-F.y0).attr("class",(F,H)=>`treemapSection section${H}`).attr("fill",F=>v(F.data.name)).attr("fill-opacity",.6).attr("stroke",F=>b(F.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",F=>{if(F.depth===0)return"display: none;";const H=cr({cssCompiledStyles:F.data.cssCompiledStyles});return H.nodeStyles+";"+H.borderStyles.join(";")}),A.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",xk/2).attr("dominant-baseline","middle").text(F=>F.depth===0?"":F.data.name).attr("font-weight","bold").attr("clip-path",(F,H)=>`url(#clip-section-${e}-${H})`).attr("style",F=>{if(F.depth===0)return"display: none;";const H="dominant-baseline: middle; font-size: 12px; fill:"+x(F.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:F.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).each(function(F){if(F.depth===0)return;const H=xt(this),G=F.data.name;H.text(G);const W=F.x1-F.x0,K=6;let q;s.showValues!==!1&&F.value?q=W-10-30-10-K:q=W-K-6;const Z=Math.max(15,q),Q=H.node();if(Q.getComputedTextLength()>Z){let me=G;for(;me.length>0;){if(me=G.substring(0,me.length-1),me.length===0){H.text("..."),Q.getComputedTextLength()>Z&&H.text("");break}if(H.text(me+"..."),Q.getComputedTextLength()<=Z)break}}}),s.showValues!==!1&&A.append("text").attr("class","treemapSectionValue").attr("x",F=>F.x1-F.x0-10).attr("y",xk/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(F=>F.value?y(F.value):"").attr("font-style","italic").attr("style",F=>{if(F.depth===0)return"display: none;";const H="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+x(F.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",G=cr({cssCompiledStyles:F.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")});const M=k.leaves(),R=M.length>20,P=R?16:38,N=R?14:28,L=R?4:8,I=R?4:6,$=R?2:4,O=R?8:10,D=R?1:2,B=T.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(F,H)=>`treemapNode treemapLeafGroup leaf${H}${F.data.classSelector?` ${F.data.classSelector}`:""}x`).attr("transform",F=>`translate(${F.x0},${F.y0})`);B.append("rect").attr("width",F=>F.x1-F.x0).attr("height",F=>F.y1-F.y0).attr("class","treemapLeaf").attr("fill",F=>F.parent?v(F.parent.data.name):v(F.data.name)).attr("style",F=>cr({cssCompiledStyles:F.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",F=>F.parent?v(F.parent.data.name):v(F.data.name)).attr("stroke-width",3),B.append("clipPath").attr("id",(F,H)=>`clip-${e}-${H}`).append("rect").attr("width",F=>Math.max(0,F.x1-F.x0-4)).attr("height",F=>Math.max(0,F.y1-F.y0-4)),B.append("text").attr("class","treemapLabel").attr("x",F=>(F.x1-F.x0)/2).attr("y",F=>(F.y1-F.y0)/2).attr("style",F=>{const H=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+x(F.data.name)+";",G=cr({cssCompiledStyles:F.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(F,H)=>`url(#clip-${e}-${H})`).text(F=>F.data.name).each(function(F){const H=xt(this),G=F.x1-F.x0,W=F.y1-F.y0,K=H.node(),q=G-2*$,oe=W-2*$;if(qq&&Z>L;)Z--,H.style("font-size",`${Z}px`);let ne=Math.max(I,Math.min(N,Math.round(Z*Q))),ie=Z+D+ne;for(;ie>oe&&Z>L&&(Z--,ne=Math.max(I,Math.min(N,Math.round(Z*Q))),!(neq||Z(H.x1-H.x0)/2).attr("y",function(H){return(H.y1-H.y0)/2}).attr("style",H=>{const G=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+x(H.data.name)+";",W=cr({cssCompiledStyles:H.data.cssCompiledStyles});return G+W.labelStyles.replace("color:","fill:")}).attr("clip-path",(H,G)=>`url(#clip-${e}-${G})`).text(H=>H.value?y(H.value):"").each(function(H){const G=xt(this),W=this.parentNode;if(!W){G.style("display","none");return}const K=xt(W).select(".treemapLabel");if(K.empty()||K.style("display")==="none"){G.style("display","none");return}const q=parseFloat(K.style("font-size")),Z=Math.max(I,Math.min(N,Math.round(q*.6)));G.style("font-size",`${Z}px`);const ne=(H.y1-H.y0)/2+q/2+D;G.attr("y",ne);const ie=H.x1-H.x0,_e=H.y1-H.y0-4,$e=ie-2*$;G.node().getComputedTextLength()>$e||ne+Z>_e||Z{const e=rp(),r=xr(),n=rs(e,r.themeVariables),i=rs(q3r,t),s=i.titleColor??n.titleColor,a=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return` +`,"getStyles"),n9r=r9r;function fZe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(fZe,"buildStyleByKey");var i9r=x((t,e,r,n)=>{var I,P,O;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=xr(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=(P=i.getDiagramTitle)==null?void 0:P.call(i),f=i.getSubsetData(),p=i.getTextData(),g=fZe(i.getStyleData()),m=gZe(f),U=(a==null?void 0:a.width)??800,y=(a==null?void 0:a.height)??450,v=U/1600,w=d?48*v:0,T=s.primaryTextColor??s.textColor,k=sl(e);k.attr("viewBox",`0 0 ${U} ${y}`),d&&k.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*v}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*v).style("fill",s.vennTitleTextColor||s.titleColor);const C=vt(document.createElement("div")),S=_4r().width(U).height(y-w);C.datum(m).call(S);const E=u?fr.svg(C.select("svg").node()):void 0,A=F4r(m,{width:U,height:y-w,padding:(a==null?void 0:a.padding)??15}),R=new Map;for(const D of A){const B=rg([...D.data.sets].sort());R.set(B,D)}p.length>0&&pZe(a,R,C,p,v,g);const _=Kl(s.background||"#f4f4f4");C.selectAll(".venn-circle").each(function(D,B){var Z;const F=vt(this),$=rg([...D.sets].sort()),V=g.get($),H=(V==null?void 0:V.fill)||h[B%h.length]||s.primaryColor;F.classed(`venn-set-${B%8}`,!0);const G=(V==null?void 0:V["fill-opacity"])??.1,K=(V==null?void 0:V.stroke)||H,W=(V==null?void 0:V["stroke-width"])||`${5*v}`;if(u&&E){const J=R.get($);if(J&&J.circles.length>0){const ne=J.circles[0],ie=E.circle(ne.x,ne.y,ne.radius*2,{roughness:.7,seed:l,fill:lue(H,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+B*60,stroke:K,strokeWidth:parseFloat(String(W))});F.select("path").remove(),(Z=F.node())==null||Z.insertBefore(ie,F.select("text").node())}}else F.select("path").style("fill",H).style("fill-opacity",G).style("stroke",K).style("stroke-width",W).style("stroke-opacity",.95);const oe=(V==null?void 0:V.color)||(_?lt(H,30):ct(H,30));F.select("text").style("font-size",`${48*v}px`).style("fill",oe)}),u&&E?C.selectAll(".venn-intersection").each(function(D){var H;const B=vt(this),z=rg([...D.sets].sort()),$=g.get(z),V=$==null?void 0:$.fill;if(V){const G=B.select("path"),K=G.attr("d");if(K){const W=E.path(K,{roughness:.7,seed:l,fill:lue(V,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),oe=G.node();(H=oe==null?void 0:oe.parentNode)==null||H.insertBefore(W,oe),G.remove()}}else B.select("path").style("fill-opacity",0);B.select("text").style("font-size",`${48*v}px`).style("fill",($==null?void 0:$.color)??s.vennSetTextColor??T)}):(C.selectAll(".venn-intersection text").style("font-size",`${48*v}px`).style("fill",D=>{var z;const F=rg([...D.sets].sort());return((z=g.get(F))==null?void 0:z.color)??s.vennSetTextColor??T}),C.selectAll(".venn-intersection path").style("fill-opacity",D=>{var z;const F=rg([...D.sets].sort());return(z=g.get(F))!=null&&z.fill?1:0}).style("fill",D=>{var z;const F=rg([...D.sets].sort());return((z=g.get(F))==null?void 0:z.fill)??"transparent"}));const N=k.append("g").attr("transform",`translate(0, ${w})`),L=C.select("svg").node();if(L&&"childNodes"in L)for(const D of[...L.childNodes])(O=N.node())==null||O.appendChild(D);Ga(k,y,U,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function rg(t){return t.join("|")}x(rg,"stableSetsKey");function pZe(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=rg(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,U=Math.min(...p.circles.map(I=>I.radius)),y=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let b=Number.isFinite(y)?Math.max(0,y):0;b===0&&Number.isFinite(U)&&(b=U*.6);const v=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&v.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",b).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,b*2*.95),T=Math.max(60*i,b*2*.95),S=(p.data.label&&p.data.label.length>0?Math.min(32*i,b*.25):0)+(f.length<=2?30*i:0),E=g-w/2,A=m-T/2+S,R=Math.max(1,Math.ceil(Math.sqrt(f.length))),_=Math.max(1,Math.ceil(f.length/R)),N=w/R,L=T/_;for(const[I,P]of f.entries()){const O=I%R,D=Math.floor(I/R),B=E+N*(O+.5),F=A+L*(D+.5);s&&v.append("rect").attr("class","venn-text-debug-cell").attr("x",E+N*O).attr("y",A+L*D).attr("width",N).attr("height",L).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const z=N*.9,$=L*.9,V=v.append("foreignObject").attr("class","venn-text-node-fo").attr("width",z).attr("height",$).attr("x",B-z/2).attr("y",F-$/2).attr("overflow","visible"),H=(h=a.get(P.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(P.label??P.id);H&&G.style("color",H)}}}x(pZe,"renderTextNodes");function gZe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s0?[...t,...n]:t}x(gZe,"ensurePairwiseSubsets");var a9r={draw:i9r},s9r={parser:z4r,db:t9r,renderer:a9r,styles:n9r};const o9r=Object.freeze(Object.defineProperty({__proto__:null,diagram:s9r},Symbol.toStringTag,{value:"Module"}));var uv,mZe=(uv=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=qi,this.getAccTitle=ia,this.setDiagramTitle=ra,this.getDiagramTitle=Yi,this.getAccDescription=sa,this.setAccDescription=aa}getNodes(){return this.nodes}getConfig(){const e=An,r=xr();return na({...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=>{hQ(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(){Oi(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(uv,"TreeMapDB"),uv);function UZe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(UZe,"buildHierarchy");var l9r=x((t,e)=>{ec(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=c9r(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=UZe(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),c9r=x(t=>t.name?String(t.name):"","getItemName"),yZe={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Qu("treemap",t);de.debug("Treemap AST:",n);const i=(e=yZe.parser)==null?void 0:e.yy;if(!(i instanceof mZe))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.");l9r(n,i)}catch(r){throw de.error("Error parsing treemap:",r),r}},"parse")},u9r=10,G2=10,T3=25,h9r=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??u9r,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=xr();if(!l)return;const h=o?30:0,d=sl(e),f=a.nodeWidth?a.nodeWidth*G2:960,p=a.nodeHeight?a.nodeHeight*G2:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Ga(d,m,g,a.useMaxWidth);let U;try{const $=a.valueFormat||",";if($==="$0,0")U=x(V=>"$"+Pm(",")(V),"valueFormat");else if($.startsWith("$")&&$.includes(",")){const V=/\.\d+/.exec($),H=V?V[0]:"";U=x(G=>"$"+Pm(","+H)(G),"valueFormat")}else if($.startsWith("$")){const V=$.substring(1);U=x(H=>"$"+Pm(V||"")(H),"valueFormat")}else U=Pm($)}catch($){de.error("Error creating format function:",$),U=Pm(",")}const y=MU().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]),b=MU().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]),v=MU().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),T=KJ(l).sum($=>$.value??0).sort(($,V)=>(V.value??0)-($.value??0)),C=I8t().size([f,p]).paddingTop($=>$.children&&$.children.length>0?T3+G2:0).paddingInner(s).paddingLeft($=>$.children&&$.children.length>0?G2:0).paddingRight($=>$.children&&$.children.length>0?G2:0).paddingBottom($=>$.children&&$.children.length>0?G2:0).round(!0)(T),S=C.descendants().filter($=>$.children&&$.children.length>0),E=w.selectAll(".treemapSection").data(S).enter().append("g").attr("class","treemapSection").attr("transform",$=>`translate(${$.x0},${$.y0})`);E.append("rect").attr("width",$=>$.x1-$.x0).attr("height",T3).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",$=>$.depth===0?"display: none;":""),E.append("clipPath").attr("id",($,V)=>`clip-section-${e}-${V}`).append("rect").attr("width",$=>Math.max(0,$.x1-$.x0-12)).attr("height",T3),E.append("rect").attr("width",$=>$.x1-$.x0).attr("height",$=>$.y1-$.y0).attr("class",($,V)=>`treemapSection section${V}`).attr("fill",$=>y($.data.name)).attr("fill-opacity",.6).attr("stroke",$=>b($.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",$=>{if($.depth===0)return"display: none;";const V=ur({cssCompiledStyles:$.data.cssCompiledStyles});return V.nodeStyles+";"+V.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",T3/2).attr("dominant-baseline","middle").text($=>$.depth===0?"":$.data.name).attr("font-weight","bold").attr("clip-path",($,V)=>`url(#clip-section-${e}-${V})`).attr("style",$=>{if($.depth===0)return"display: none;";const V="dominant-baseline: middle; font-size: 12px; fill:"+v($.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=ur({cssCompiledStyles:$.data.cssCompiledStyles});return V+H.labelStyles.replace("color:","fill:")}).each(function($){if($.depth===0)return;const V=vt(this),H=$.data.name;V.text(H);const G=$.x1-$.x0,K=6;let W;a.showValues!==!1&&$.value?W=G-10-30-10-K:W=G-K-6;const Z=Math.max(15,W),J=V.node();if(J.getComputedTextLength()>Z){let me=H;for(;me.length>0;){if(me=H.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&&E.append("text").attr("class","treemapSectionValue").attr("x",$=>$.x1-$.x0-10).attr("y",T3/2).attr("text-anchor","end").attr("dominant-baseline","middle").text($=>$.value?U($.value):"").attr("font-style","italic").attr("style",$=>{if($.depth===0)return"display: none;";const V="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+v($.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=ur({cssCompiledStyles:$.data.cssCompiledStyles});return V+H.labelStyles.replace("color:","fill:")});const A=C.leaves(),R=A.length>20,_=R?16:38,N=R?14:28,L=R?4:8,I=R?4:6,P=R?2:4,O=R?8:10,D=R?1:2,B=w.selectAll(".treemapLeafGroup").data(A).enter().append("g").attr("class",($,V)=>`treemapNode treemapLeafGroup leaf${V}${$.data.classSelector?` ${$.data.classSelector}`:""}x`).attr("transform",$=>`translate(${$.x0},${$.y0})`);B.append("rect").attr("width",$=>$.x1-$.x0).attr("height",$=>$.y1-$.y0).attr("class","treemapLeaf").attr("fill",$=>$.parent?y($.parent.data.name):y($.data.name)).attr("style",$=>ur({cssCompiledStyles:$.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",$=>$.parent?y($.parent.data.name):y($.data.name)).attr("stroke-width",3),B.append("clipPath").attr("id",($,V)=>`clip-${e}-${V}`).append("rect").attr("width",$=>Math.max(0,$.x1-$.x0-4)).attr("height",$=>Math.max(0,$.y1-$.y0-4)),B.append("text").attr("class","treemapLabel").attr("x",$=>($.x1-$.x0)/2).attr("y",$=>($.y1-$.y0)/2).attr("style",$=>{const V=`text-anchor: middle; dominant-baseline: middle; font-size: ${_}px;fill:`+v($.data.name)+";",H=ur({cssCompiledStyles:$.data.cssCompiledStyles});return V+H.labelStyles.replace("color:","fill:")}).attr("clip-path",($,V)=>`url(#clip-${e}-${V})`).text($=>$.data.name).each(function($){const V=vt(this),H=$.x1-$.x0,G=$.y1-$.y0,K=V.node(),W=H-2*P,oe=G-2*P;if(WW&&Z>L;)Z--,V.style("font-size",`${Z}px`);let ne=Math.max(I,Math.min(N,Math.round(Z*J))),ie=Z+D+ne;for(;ie>oe&&Z>L&&(Z--,ne=Math.max(I,Math.min(N,Math.round(Z*J))),!(neW||Z(V.x1-V.x0)/2).attr("y",function(V){return(V.y1-V.y0)/2}).attr("style",V=>{const H=`text-anchor: middle; dominant-baseline: hanging; font-size: ${N}px;fill:`+v(V.data.name)+";",G=ur({cssCompiledStyles:V.data.cssCompiledStyles});return H+G.labelStyles.replace("color:","fill:")}).attr("clip-path",(V,H)=>`url(#clip-${e}-${H})`).text(V=>V.value?U(V.value):"").each(function(V){const H=vt(this),G=this.parentNode;if(!G){H.style("display","none");return}const K=vt(G).select(".treemapLabel");if(K.empty()||K.style("display")==="none"){H.style("display","none");return}const W=parseFloat(K.style("font-size")),Z=Math.max(I,Math.min(N,Math.round(W*.6)));H.style("font-size",`${Z}px`);const ne=(V.y1-V.y0)/2+W/2+D;H.attr("y",ne);const ie=V.x1-V.x0,Re=V.y1-V.y0-4,Pe=ie-2*P;H.node().getComputedTextLength()>Pe||ne+Z>Re||Z{const e=np(),r=xr(),n=na(e,r.themeVariables),i=na(p9r,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}; @@ -5821,7 +5954,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error fill: ${i.leafFillColor}; } .treemapLabel { - fill: ${a}; + fill: ${s}; font-size: ${i.labelFontSize}; } .treemapValue { @@ -5829,29 +5962,29 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-size: ${i.valueFontSize}; } .treemapTitle { - fill: ${s}; + fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),j3r=U3r,Y3r={parser:sZe,get db(){return new nZe},renderer:W3r,styles:j3r};const X3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:Y3r},Symbol.toStringTag,{value:"Module"}));var hO=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"),f1=w((t,e,r)=>({x:hO(e,`${r} evolution`),y:hO(t,`${r} visibility`)}),"toCoordinates"),Lbe=w(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),K3r=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"),Z3r=w((t,e)=>{if(ec(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=f1(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=f1(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,s=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,a=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,s,r.inertia,a)}),t.notes.forEach(r=>{const n=f1(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(s=>{const a=`${r.parent}_${s.name}`,o=s.label?(s.label.negX?-1:1)*s.label.offsetX:void 0,l=s.label?(s.label.negY?-1:1)*s.label.offsetY:void 0,u=hO(s.evolution,`Pipeline component "${s.name}" evolution`);e.addNode(a,s.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,a)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=Lbe(r.fromPort)??Lbe(r.toPort);const{flow:s,label:a}=K3r(r.arrow);!i&&s&&(i=s);const o=r.linkLabel,l=a??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=hO(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=f1(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=f1(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=f1(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=f1(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),aZe={parser:{yy:void 0},parse:w(async t=>{var n;const e=await Ju("wardley",t);de.debug(e);const r=(n=aZe.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.");Z3r(e,r)},"parse")},o5,Q3r=(o5=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(o5,"WardleyBuilder"),o5),ul=new Q3r;function oZe(){return He()["wardley-beta"]}w(oZe,"getConfig");function lZe(t,e,r,n,i,s,a,o,l){ul.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:s,labelOffsetY:a,inertia:o,sourceStrategy:l})}w(lZe,"addNode");function cZe(t,e,r=!1,n,i){ul.addLink({source:t,target:e,dashed:r,label:n,flow:i})}w(cZe,"addLink");function uZe(t,e,r){ul.addTrend({nodeId:t,targetX:e,targetY:r})}w(uZe,"addTrend");function hZe(t,e,r){ul.addAnnotation({number:t,coordinates:e,text:r})}w(hZe,"addAnnotation");function dZe(t,e,r){ul.addNote({text:t,x:e,y:r})}w(dZe,"addNote");function fZe(t,e,r){ul.addAccelerator({name:t,x:e,y:r})}w(fZe,"addAccelerator");function pZe(t,e,r){ul.addDeaccelerator({name:t,x:e,y:r})}w(pZe,"addDeaccelerator");function gZe(t,e){ul.setAnnotationsBox(t,e)}w(gZe,"setAnnotationsBox");function mZe(t,e){ul.setSize(t,e)}w(mZe,"setSize");function yZe(t){ul.startPipeline(t)}w(yZe,"startPipeline");function vZe(t,e){ul.addPipelineComponent(t,e)}w(vZe,"addPipelineComponent");function bZe(t){ul.setAxes(t)}w(bZe,"updateAxes");function xZe(t){return ul.getNode(t)}w(xZe,"getNode");function wZe(t){return ul.resolveNodeId(t)}w(wZe,"resolveNodeId");function TZe(){return ul.build()}w(TZe,"getWardleyData");function CZe(){ul.clear(),Oi()}w(CZe,"clear");var J3r={getConfig:oZe,addNode:lZe,addLink:cZe,addTrend:uZe,addAnnotation:hZe,addNote:dZe,addAccelerator:fZe,addDeaccelerator:pZe,setAnnotationsBox:gZe,setSize:mZe,startPipeline:yZe,addPipelineComponent:vZe,updateAxes:bZe,getNode:xZe,resolveNodeId:wZe,getWardleyData:TZe,clear:CZe,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is},eCr=["Genesis","Custom Built","Product","Commodity"],tCr=w(()=>{var e,r,n,i,s,a,o,l,u,h,d,f;const{themeVariables:t}=He();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:((s=t.wardley)==null?void 0:s.componentFill)??"#fff",componentStroke:((a=t.wardley)==null?void 0:a.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"),rCr=w(()=>{const t=He()["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"),nCr=w((t,e,r,n)=>{var D,B;de.debug(`Rendering Wardley map -`+t);const i=rCr(),s=tCr(),a=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((D=l.size)==null?void 0:D.width)??i.width,d=((B=l.size)==null?void 0:B.height)??i.height,f=al(e);f.selectAll("*").remove(),qs(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",s.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",s.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",s.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",s.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",s.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"),b=w(z=>d-i.padding-z/100*y,"projectY"),x=p.append("g").attr("class","wardley-axes");x.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1),x.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.axisColor).attr("stroke-width",1);const T=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";x.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",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(T),x.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:eCr;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,F=[];if(V&&V.length===S.length){let H=0;V.forEach(G=>{F.push({start:H,end:G}),H=G})}else{const H=1/S.length;S.forEach((G,W)=>{F.push({start:W*H,end:(W+1)*H})})}S.forEach((H,G)=>{const W=F[G],K=i.padding+W.start*m,q=i.padding+W.end*m,oe=(K+q)/2;G>0&&z.append("line").attr("x1",K).attr("x2",K).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",oe).attr("y",d-i.padding/1.5).attr("fill",s.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(H)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const F=V/4,H=i.padding+m*F;z.append("line").attr("x1",H).attr("x2",H).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*F).attr("y2",d-i.padding-y*F).attr("stroke",s.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:b(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(F=>{if(F.componentIds.length===0)return;const H=F.componentIds.map(q=>({id:q,pos:k.get(q),node:l.nodes.find(oe=>oe.id===q)})).filter(q=>q.pos&&q.node).sort((q,oe)=>q.node.x-oe.node.x);for(let q=0;q{const oe=k.get(q);oe&&(G=Math.min(G,oe.x),W=Math.max(W,oe.x),K=oe.y)}),G!==1/0&&W!==-1/0){const oe=i.nodeRadius*4,Z=K-oe/2,Q=k.get(F.nodeId);if(Q){const ne=(G+W)/2;Q.x=ne,Q.y=Z-a/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",G-15).attr("y",Z).attr("width",W-G+30).attr("height",oe).attr("fill","none").attr("stroke",s.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(!k.has(z.source)||!k.has(z.target))return!1;const V=A.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(M).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),F=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=F.x-V.x,K=F.y-V.y,q=Math.sqrt(W*W+K*K);return V.x+W/q*G}).attr("y1",z=>{const V=k.get(z.source),F=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.source).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=F.x-V.x,K=F.y-V.y,q=Math.sqrt(W*W+K*K);return V.y+K/q*G}).attr("x2",z=>{const V=k.get(z.source),F=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-F.x,K=V.y-F.y,q=Math.sqrt(W*W+K*K);return F.x+W/q*G}).attr("y2",z=>{const V=k.get(z.source),F=k.get(z.target),G=l.nodes.find(oe=>oe.id===z.target).isPipelineParent?a/Math.sqrt(2):i.nodeRadius,W=V.x-F.x,K=V.y-F.y,q=Math.sqrt(W*W+K*K);return F.y+K/q*G}).attr("stroke",s.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(M.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),F=k.get(z.target),H=(V.x+F.x)/2,G=F.y-V.y,W=F.x-V.x,K=Math.sqrt(W*W+G*G),q=8,oe=G/K;return H+oe*q}).attr("y",z=>{const V=k.get(z.source),F=k.get(z.target),H=(V.y+F.y)/2,G=F.x-V.x,W=F.y-V.y,K=Math.sqrt(G*G+W*W),q=8,oe=-G/K;return H+oe*q}).attr("fill",s.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),F=k.get(z.target),H=(V.x+F.x)/2,G=(V.y+F.y)/2,W=F.x-V.x,K=F.y-V.y,q=Math.sqrt(W*W+K*K),oe=8,Z=K/q,Q=-W/q,ne=H+Z*oe,ie=G+Q*oe;let me=Math.atan2(K,W)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${ne} ${ie})`}).text(z=>z.label);const R=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const F=v(z.targetX),H=b(z.targetY),G=F-V.x,W=H-V.y,K=Math.sqrt(G*G+W*W),q=i.nodeRadius+2,oe=K>q?F-G/K*q:F,Z=K>q?H-W/K*q:H;return{origin:V,targetX:F,targetY:H,adjustedX2:oe,adjustedY2:Z}}).filter(z=>z!==null);R.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",s.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const L=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(" "));L.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=L.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",s.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",2),L.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-a/2).attr("y",z=>k.get(z.id).y-a/2).attr("width",a).attr("height",a).attr("fill",s.componentFill).attr("stroke",s.componentStroke).attr("stroke-width",1),L.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let F=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(F+=i.nodeRadius+10),V.x+F}).attr("y1",z=>{const V=k.get(z.id),F=z.isPipelineParent?a:i.nodeRadius*2;return V.y-F/2}).attr("x2",z=>{const V=k.get(z.id);let F=z.isPipelineParent?a/2+15:i.nodeRadius+15;return z.sourceStrategy&&(F+=i.nodeRadius+10),V.x+F}).attr("y2",z=>{const V=k.get(z.id),F=z.isPipelineParent?a:i.nodeRadius*2;return V.y+F/2}).attr("stroke",s.componentStroke).attr("stroke-width",6),L.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let F=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(F+=10);const H=z.labelOffsetX??F;return V.x+H}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let F=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(F-=10);const H=z.labelOffsetY??F;return V.y+H}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?s.evolutionStroke:z.className==="anchor"?"#000":s.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const F=V.coordinates.map(H=>({x:v(H.x),y:b(H.y)}));if(F.length>1)for(let H=0;H{const G=z.append("g").attr("class","wardley-annotation");G.append("circle").attr("cx",H.x).attr("cy",H.y).attr("r",10).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5),G.append("text").attr("x",H.x).attr("y",H.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),F=b(l.annotationsBox.y);const H=10,G=16,W=11,K=z.append("g").attr("class","wardley-annotations-box"),q=[...l.annotations].filter(Z=>Z.text).sort((Z,Q)=>Z.number-Q.number),oe=[];if(q.forEach((Z,Q)=>{const ne=K.append("text").attr("x",V+H).attr("y",F+H+(Q+1)*G).attr("font-size",W).attr("fill",s.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Z.number}. ${Z.text}`);oe.push(ne)}),oe.length>0){let Z=0,Q=0;oe.forEach(Ve=>{const ce=Ve.node(),he=ce.getComputedTextLength();Z=Math.max(Z,he);const Te=ce.getBBox();Q=Math.max(Q,Te.height)});const ne=Z+H*2+105,ie=q.length*G+H*2+Q/2,me=i.padding,te=h-i.padding-ne,_e=i.padding,$e=d-i.padding-ie;V=Math.max(me,Math.min(V,te)),F=Math.max(_e,Math.min(F,$e)),oe.forEach((Ve,ce)=>{Ve.attr("x",V+H).attr("y",F+H+(ce+1)*G)}),K.insert("rect","text").attr("x",V).attr("y",F).attr("width",ne).attr("height",ie).attr("fill","white").attr("stroke",s.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const F=v(V.x),H=b(V.y);z.append("text").attr("x",F).attr("y",H).attr("text-anchor","start").attr("font-size",11).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const F=v(V.x),H=b(V.y),G=60,W=30,K=20,q=` - M ${F} ${H-W/2} - L ${F+G-K} ${H-W/2} - L ${F+G-K} ${H-W/2-8} - L ${F+G} ${H} - L ${F+G-K} ${H+W/2+8} - L ${F+G-K} ${H+W/2} - L ${F} ${H+W/2} + `},"getStyles"),m9r=g9r,U9r={parser:yZe,get db(){return new mZe},renderer:f9r,styles:m9r};const y9r=Object.freeze(Object.defineProperty({__proto__:null,diagram:U9r},Symbol.toStringTag,{value:"Module"}));var pD=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),mm=x((t,e,r)=>({x:pD(e,`${r} evolution`),y:pD(t,`${r} visibility`)}),"toCoordinates"),zye=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),b9r=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),v9r=x((t,e)=>{if(ec(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=mm(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=mm(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=mm(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=pD(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=zye(r.fromPort)??zye(r.toPort);const{flow:a,label:s}=b9r(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=pD(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=mm(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=mm(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=mm(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=mm(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),bZe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Qu("wardley",t);de.debug(e);const r=(n=bZe.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.");v9r(e,r)},"parse")},hv,x9r=(hv=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(hv,"WardleyBuilder"),hv),ul=new x9r;function vZe(){return He()["wardley-beta"]}x(vZe,"getConfig");function xZe(t,e,r,n,i,a,s,o,l){ul.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x(xZe,"addNode");function wZe(t,e,r=!1,n,i){ul.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(wZe,"addLink");function TZe(t,e,r){ul.addTrend({nodeId:t,targetX:e,targetY:r})}x(TZe,"addTrend");function CZe(t,e,r){ul.addAnnotation({number:t,coordinates:e,text:r})}x(CZe,"addAnnotation");function kZe(t,e,r){ul.addNote({text:t,x:e,y:r})}x(kZe,"addNote");function SZe(t,e,r){ul.addAccelerator({name:t,x:e,y:r})}x(SZe,"addAccelerator");function EZe(t,e,r){ul.addDeaccelerator({name:t,x:e,y:r})}x(EZe,"addDeaccelerator");function AZe(t,e){ul.setAnnotationsBox(t,e)}x(AZe,"setAnnotationsBox");function MZe(t,e){ul.setSize(t,e)}x(MZe,"setSize");function RZe(t){ul.startPipeline(t)}x(RZe,"startPipeline");function LZe(t,e){ul.addPipelineComponent(t,e)}x(LZe,"addPipelineComponent");function IZe(t){ul.setAxes(t)}x(IZe,"updateAxes");function NZe(t){return ul.getNode(t)}x(NZe,"getNode");function DZe(t){return ul.resolveNodeId(t)}x(DZe,"resolveNodeId");function OZe(){return ul.build()}x(OZe,"getWardleyData");function _Ze(){ul.clear(),Oi()}x(_Ze,"clear");var w9r={getConfig:vZe,addNode:xZe,addLink:wZe,addTrend:TZe,addAnnotation:CZe,addNote:kZe,addAccelerator:SZe,addDeaccelerator:EZe,setAnnotationsBox:AZe,setSize:MZe,startPipeline:RZe,addPipelineComponent:LZe,updateAxes:IZe,getNode:NZe,resolveNodeId:DZe,getWardleyData:OZe,clear:_Ze,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa},T9r=["Genesis","Custom Built","Product","Commodity"],C9r=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=He();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"),k9r=x(()=>{const t=He()["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"),S9r=x((t,e,r,n)=>{var D,B;de.debug(`Rendering Wardley map +`+t);const i=k9r(),a=C9r(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((D=l.size)==null?void 0:D.width)??i.width,d=((B=l.size)==null?void 0:B.height)??i.height,f=sl(e);f.selectAll("*").remove(),Ga(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,U=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 y=x(F=>i.padding+F/100*m,"projectX"),b=x(F=>d-i.padding-F/100*U,"projectY"),v=p.append("g").attr("class","wardley-axes");v.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),v.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",T=l.axes.yLabel??"Visibility";v.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),v.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+U/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+U/2})`).text(T);const k=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:T9r;if(k.length>0){const F=p.append("g").attr("class","wardley-stages"),z=l.axes.stageBoundaries,$=[];if(z&&z.length===k.length){let V=0;z.forEach(H=>{$.push({start:V,end:H}),V=H})}else{const V=1/k.length;k.forEach((H,G)=>{$.push({start:G*V,end:(G+1)*V})})}k.forEach((V,H)=>{const G=$[H],K=i.padding+G.start*m,W=i.padding+G.end*m,oe=(K+W)/2;H>0&&F.append("line").attr("x1",K).attr("x2",K).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),F.append("text").attr("class","wardley-stage-label").attr("x",oe).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 F=p.append("g").attr("class","wardley-grid");for(let z=1;z<4;z++){const $=z/4,V=i.padding+m*$;F.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"),F.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-U*$).attr("y2",d-i.padding-U*$).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const C=new Map;if(l.nodes.forEach(F=>{C.set(F.id,{x:y(F.x),y:b(F.y),node:F})}),l.pipelines.length>0){const F=p.append("g").attr("class","wardley-pipelines"),z=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach($=>{if($.componentIds.length===0)return;const V=$.componentIds.map(W=>({id:W,pos:C.get(W),node:l.nodes.find(oe=>oe.id===W)})).filter(W=>W.pos&&W.node).sort((W,oe)=>W.node.x-oe.node.x);for(let W=0;W{const oe=C.get(W);oe&&(H=Math.min(H,oe.x),G=Math.max(G,oe.x),K=oe.y)}),H!==1/0&&G!==-1/0){const oe=i.nodeRadius*4,Z=K-oe/2,J=C.get($.nodeId);if(J){const ne=(H+G)/2;J.x=ne,J.y=Z-s/6}F.append("rect").attr("class","wardley-pipeline-box").attr("x",H-15).attr("y",Z).attr("width",G-H+30).attr("height",oe).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const S=p.append("g").attr("class","wardley-links"),E=new Map;l.pipelines.forEach(F=>{E.set(F.nodeId,new Set(F.componentIds))});const A=l.links.filter(F=>{if(!C.has(F.source)||!C.has(F.target))return!1;const z=E.get(F.target);return!(z!=null&&z.has(F.source))});S.selectAll("line").data(A).enter().append("line").attr("class",F=>`wardley-link${F.dashed?" wardley-link--dashed":""}`).attr("x1",F=>{const z=C.get(F.source),$=C.get(F.target),H=l.nodes.find(oe=>oe.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=$.x-z.x,K=$.y-z.y,W=Math.sqrt(G*G+K*K);return z.x+G/W*H}).attr("y1",F=>{const z=C.get(F.source),$=C.get(F.target),H=l.nodes.find(oe=>oe.id===F.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=$.x-z.x,K=$.y-z.y,W=Math.sqrt(G*G+K*K);return z.y+K/W*H}).attr("x2",F=>{const z=C.get(F.source),$=C.get(F.target),H=l.nodes.find(oe=>oe.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-$.x,K=z.y-$.y,W=Math.sqrt(G*G+K*K);return $.x+G/W*H}).attr("y2",F=>{const z=C.get(F.source),$=C.get(F.target),H=l.nodes.find(oe=>oe.id===F.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,G=z.x-$.x,K=z.y-$.y,W=Math.sqrt(G*G+K*K);return $.y+K/W*H}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",F=>F.dashed?"6 6":null).attr("marker-end",F=>F.flow==="forward"||F.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",F=>F.flow==="backward"||F.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),S.selectAll("text").data(A.filter(F=>F.label)).enter().append("text").attr("class","wardley-link-label").attr("x",F=>{const z=C.get(F.source),$=C.get(F.target),V=(z.x+$.x)/2,H=$.y-z.y,G=$.x-z.x,K=Math.sqrt(G*G+H*H),W=8,oe=H/K;return V+oe*W}).attr("y",F=>{const z=C.get(F.source),$=C.get(F.target),V=(z.y+$.y)/2,H=$.x-z.x,G=$.y-z.y,K=Math.sqrt(H*H+G*G),W=8,oe=-H/K;return V+oe*W}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",F=>{const z=C.get(F.source),$=C.get(F.target),V=(z.x+$.x)/2,H=(z.y+$.y)/2,G=$.x-z.x,K=$.y-z.y,W=Math.sqrt(G*G+K*K),oe=8,Z=K/W,J=-G/W,ne=V+Z*oe,ie=H+J*oe;let me=Math.atan2(K,G)*180/Math.PI;return(me>90||me<-90)&&(me+=180),`rotate(${me} ${ne} ${ie})`}).text(F=>F.label);const R=p.append("g").attr("class","wardley-trends"),_=l.trends.map(F=>{const z=C.get(F.nodeId);if(!z)return null;const $=y(F.targetX),V=b(F.targetY),H=$-z.x,G=V-z.y,K=Math.sqrt(H*H+G*G),W=i.nodeRadius+2,oe=K>W?$-H/K*W:$,Z=K>W?V-G/K*W:V;return{origin:z,targetX:$,targetY:V,adjustedX2:oe,adjustedY2:Z}}).filter(F=>F!==null);R.selectAll("line").data(_).enter().append("line").attr("class","wardley-trend").attr("x1",F=>F.origin.x).attr("y1",F=>F.origin.y).attr("x2",F=>F.adjustedX2).attr("y2",F=>F.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const L=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",F=>["wardley-node",F.className?`wardley-node--${F.className}`:""].filter(Boolean).join(" "));L.filter(F=>F.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),L.filter(F=>F.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),L.filter(F=>F.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=L.filter(F=>F.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),L.filter(F=>!F.isPipelineParent&&F.sourceStrategy!=="market"&&F.className!=="anchor").append("circle").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const P=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",F=>C.get(F.id).x).attr("y1",F=>C.get(F.id).y-O).attr("x2",F=>C.get(F.id).x-O*Math.cos(Math.PI/6)).attr("y2",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",F=>C.get(F.id).x-O*Math.cos(Math.PI/6)).attr("y1",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("x2",F=>C.get(F.id).x+O*Math.cos(Math.PI/6)).attr("y2",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",F=>C.get(F.id).x+O*Math.cos(Math.PI/6)).attr("y1",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("x2",F=>C.get(F.id).x).attr("y2",F=>C.get(F.id).y-O).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>C.get(F.id).x).attr("cy",F=>C.get(F.id).y-O).attr("r",P).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>C.get(F.id).x-O*Math.cos(Math.PI/6)).attr("cy",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("r",P).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",F=>C.get(F.id).x+O*Math.cos(Math.PI/6)).attr("cy",F=>C.get(F.id).y+O*Math.sin(Math.PI/6)).attr("r",P).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),L.filter(F=>F.isPipelineParent===!0).append("rect").attr("x",F=>C.get(F.id).x-s/2).attr("y",F=>C.get(F.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),L.filter(F=>F.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",F=>{const z=C.get(F.id);let $=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&($+=i.nodeRadius+10),z.x+$}).attr("y1",F=>{const z=C.get(F.id),$=F.isPipelineParent?s:i.nodeRadius*2;return z.y-$/2}).attr("x2",F=>{const z=C.get(F.id);let $=F.isPipelineParent?s/2+15:i.nodeRadius+15;return F.sourceStrategy&&($+=i.nodeRadius+10),z.x+$}).attr("y2",F=>{const z=C.get(F.id),$=F.isPipelineParent?s:i.nodeRadius*2;return z.y+$/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),L.append("text").attr("x",F=>{const z=C.get(F.id);if(F.className==="anchor")return F.labelOffsetX!==void 0?z.x+F.labelOffsetX:z.x;let $=i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetX===void 0&&($+=10);const V=F.labelOffsetX??$;return z.x+V}).attr("y",F=>{const z=C.get(F.id);if(F.className==="anchor")return F.labelOffsetY!==void 0?z.y+F.labelOffsetY:z.y-3;let $=-i.nodeLabelOffset;F.sourceStrategy&&F.labelOffsetY===void 0&&($-=10);const V=F.labelOffsetY??$;return z.y+V}).attr("class","wardley-node-label").attr("fill",F=>F.className==="evolved"?a.evolutionStroke:F.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",F=>F.className==="anchor"?"bold":"normal").attr("text-anchor",F=>F.className==="anchor"?"middle":"start").attr("dominant-baseline",F=>F.className==="anchor"?"middle":"auto").text(F=>F.label),l.annotations.length>0){const F=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(z=>{const $=z.coordinates.map(V=>({x:y(V.x),y:b(V.y)}));if($.length>1)for(let V=0;V<$.length-1;V++)F.append("line").attr("class","wardley-annotation-line").attr("x1",$[V].x).attr("y1",$[V].y).attr("x2",$[V+1].x).attr("y2",$[V+1].y).attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");$.forEach(V=>{const H=F.append("g").attr("class","wardley-annotation");H.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),H.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(z.number)})}),l.annotationsBox){let z=y(l.annotationsBox.x),$=b(l.annotationsBox.y);const V=10,H=16,G=11,K=F.append("g").attr("class","wardley-annotations-box"),W=[...l.annotations].filter(Z=>Z.text).sort((Z,J)=>Z.number-J.number),oe=[];if(W.forEach((Z,J)=>{const ne=K.append("text").attr("x",z+V).attr("y",$+V+(J+1)*H).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${Z.number}. ${Z.text}`);oe.push(ne)}),oe.length>0){let Z=0,J=0;oe.forEach(Ve=>{const ce=Ve.node(),he=ce.getComputedTextLength();Z=Math.max(Z,he);const we=ce.getBBox();J=Math.max(J,we.height)});const ne=Z+V*2+105,ie=W.length*H+V*2+J/2,me=i.padding,te=h-i.padding-ne,Re=i.padding,Pe=d-i.padding-ie;z=Math.max(me,Math.min(z,te)),$=Math.max(Re,Math.min($,Pe)),oe.forEach((Ve,ce)=>{Ve.attr("x",z+V).attr("y",$+V+(ce+1)*H)}),K.insert("rect","text").attr("x",z).attr("y",$).attr("width",ne).attr("height",ie).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const F=p.append("g").attr("class","wardley-notes");l.notes.forEach(z=>{const $=y(z.x),V=b(z.y);F.append("text").attr("x",$).attr("y",V).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(z.text)})}if(l.accelerators.length>0){const F=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(z=>{const $=y(z.x),V=b(z.y),H=60,G=30,K=20,W=` + M ${$} ${V-G/2} + L ${$+H-K} ${V-G/2} + L ${$+H-K} ${V-G/2-8} + L ${$+H} ${V} + L ${$+H-K} ${V+G/2+8} + L ${$+H-K} ${V+G/2} + L ${$} ${V+G/2} Z - `;z.append("path").attr("d",q).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),z.append("text").attr("x",F+G/2).attr("y",H+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.name)})}if(l.deaccelerators.length>0){const z=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(V=>{const F=v(V.x),H=b(V.y),G=60,W=30,K=20,q=` - M ${F+G} ${H-W/2} - L ${F+K} ${H-W/2} - L ${F+K} ${H-W/2-8} - L ${F} ${H} - L ${F+K} ${H+W/2+8} - L ${F+K} ${H+W/2} - L ${F+G} ${H+W/2} + `;F.append("path").attr("d",W).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",$+H/2).attr("y",V+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(z.name)})}if(l.deaccelerators.length>0){const F=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(z=>{const $=y(z.x),V=b(z.y),H=60,G=30,K=20,W=` + M ${$+H} ${V-G/2} + L ${$+K} ${V-G/2} + L ${$+K} ${V-G/2-8} + L ${$} ${V} + L ${$+K} ${V+G/2+8} + L ${$+K} ${V+G/2} + L ${$+H} ${V+G/2} Z - `;z.append("path").attr("d",q).attr("fill","white").attr("stroke",s.componentStroke).attr("stroke-width",1),z.append("text").attr("x",F+G/2).attr("y",H+W/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",s.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),iCr={draw:nCr},sCr=w(({wardley:t}={})=>{const e=rp(),r=xr(),n=rs(e,r.themeVariables),i=rs(n.wardley,t);return` + `;F.append("path").attr("d",W).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),F.append("text").attr("x",$+H/2).attr("y",V+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(z.name)})}},"draw"),E9r={draw:S9r},A9r=x(({wardley:t}={})=>{const e=np(),r=xr(),n=na(e,r.themeVariables),i=na(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -5909,7 +6042,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),aCr={parser:aZe,db:J3r,renderer:iCr,styles:sCr};const oCr=Object.freeze(Object.defineProperty({__proto__:null,diagram:aCr},Symbol.toStringTag,{value:"Module"}));var kZe=w(()=>({domains:new Map,transitions:[]}),"createDefaultData"),t8=kZe(),lCr=w(()=>t8.domains,"getDomains"),cCr=w(()=>t8.transitions,"getTransitions"),uCr=w(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));t8.domains.set(r,{name:r,items:n})}},"setDomains"),hCr=w(t=>{t&&(t8.transitions=t.filter(e=>e.from===e.to?(de.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"),dCr=w(()=>rs({...En.cynefin,...xr().cynefin}),"getConfig"),fCr=w(()=>{Oi(),t8=kZe()},"clear"),o_={getDomains:lCr,getTransitions:cCr,setDomains:uCr,setTransitions:hCr,getConfig:dCr,clear:fCr,setAccTitle:qi,getAccTitle:ns,setDiagramTitle:ts,getDiagramTitle:ji,getAccDescription:ss,setAccDescription:is},pCr=w(t=>{ec(t,o_),o_.setDomains(t.domains),o_.setTransitions(t.transitions)},"populate"),gCr={parse:w(async t=>{const e=await Ju("cynefin",t);de.debug(e),pCr(e)},"parse")};function SA(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(SA,"seededRandom");function SZe(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"),yCr=w(()=>{const t=rp(),e=xr();return rs(t,e.themeVariables).cynefin},"getCynefinDomainColors"),pG=3,vCr=w((t,e,r,n)=>{const i=n.db,s=i.getDomains(),a=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=yCr();de.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,b=p+g*2,x={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},T=al(e);qs(T,b,v,h.useMaxWidth??!0),T.attr("viewBox",`0 0 ${v} ${b}`),l&&T.append("title").text(l),u&&T.append("desc").text(u);const C=T.append("g").attr("transform",`translate(${g}, ${g})`),S=mCr(f,p),k=EZe(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),A=["complex","complicated","chaotic","clear"];for(const D of A){const B=S[D];E.append("rect").attr("class","cynefinDomain").attr("x",B.x).attr("y",B.y).attr("width",B.w).attr("height",B.h).attr("fill",x[D]).attr("fill-opacity",.4).attr("stroke","none")}const M=C.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",AZe(f,p,k,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",MZe(f,p,k+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",RZe(f,p)).attr("fill","none");const R=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",_Ze(f/2,p/2,R,P)).attr("fill",x.confusion).attr("fill-opacity",.5);const N=C.append("g").attr("class","cynefin-labels");for(const D of A){const B=S[D];N.append("text").attr("class","cynefinDomainLabel").attr("x",B.cx).attr("y",m?B.cy-30:B.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(D.charAt(0).toUpperCase()+D.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 D=C.append("g").attr("class","cynefin-subtitles");for(const B of A){const z=S[B],V=Ibe[B];D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),D.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}D.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Ibe.confusion.practice)}const L=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const D of O){const B=s.get(D);if(!B||B.items.length===0)continue;const z=S[D],V=D==="confusion";let F=B.items,H=0;V&&B.items.length>pG&&(H=B.items.length-pG,F=B.items.slice(0,pG));let G;if(V){const W=m?22:14;G=z.cy+W}else G=z.cy+(m?25:15);if([...F].forEach((W,K)=>{const q=G+K*(I+4),oe=L.append("g"),Z=oe.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(W.label);let Q=W.label.length*7;const ne=Z.node();if(ne&&typeof ne.getBBox=="function"){const te=ne.getBBox();te.width>0&&(Q=te.width)}const ie=Q+$*2,me=z.cx-ie/2;oe.attr("transform",`translate(${me}, ${q})`),oe.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ie).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",x[D]).attr("fill-opacity",.95),Z.attr("x",ie/2).attr("y",I/2)}),H>0){const W=G+F.length*(I+4),K=`+${H} more`,q=L.append("g"),oe=q.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(K);let Z=K.length*7;const Q=oe.node();if(Q&&typeof Q.getBBox=="function"){const me=Q.getBBox();me.width>0&&(Z=me.width)}const ne=Z+$*2,ie=z.cx-ne/2;q.attr("transform",`translate(${ie}, ${W})`),q.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ne).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",x[D]).attr("fill-opacity",.6),oe.attr("x",ne/2).attr("y",I/2)}}if(a.length>0){const D=T.select("defs").empty()?T.append("defs"):T.select("defs"),B=`cynefin-arrow-${e}`;D.append("marker").attr("id",B).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");a.forEach(V=>{const F=S[V.from],H=S[V.to];if(!F||!H)return;if(V.from===V.to){de.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const G=F.cx,W=F.cy,K=H.cx,q=H.cy,oe=(G+K)/2,Z=(W+q)/2,Q=K-G,ne=q-W,ie=Math.sqrt(Q*Q+ne*ne),me=ie*.15,te=-ne/ie,_e=Q/ie,$e=oe+te*me,Ve=Z+_e*me;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${G},${W} Q${$e},${Ve} ${K},${q}`).attr("fill","none").attr("marker-end",`url(#${B})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",$e).attr("y",Ve-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),bCr={draw:vCr},xCr=w(()=>{const t=rp(),e=xr();return rs(t,e.themeVariables).cynefin},"getCynefinTheme"),wCr=w(()=>{const t=xCr();return` + `},"styles"),M9r={parser:bZe,db:w9r,renderer:E9r,styles:A9r};const R9r=Object.freeze(Object.defineProperty({__proto__:null,diagram:M9r},Symbol.toStringTag,{value:"Module"}));var PZe=x(()=>({domains:new Map,transitions:[]}),"createDefaultData"),iS=PZe(),L9r=x(()=>iS.domains,"getDomains"),I9r=x(()=>iS.transitions,"getTransitions"),N9r=x(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));iS.domains.set(r,{name:r,items:n})}},"setDomains"),D9r=x(t=>{t&&(iS.transitions=t.filter(e=>e.from===e.to?(de.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"),O9r=x(()=>na({...An.cynefin,...xr().cynefin}),"getConfig"),_9r=x(()=>{Oi(),iS=PZe()},"clear"),uR={getDomains:L9r,getTransitions:I9r,setDomains:N9r,setTransitions:D9r,getConfig:O9r,clear:_9r,setAccTitle:qi,getAccTitle:ia,setDiagramTitle:ra,getDiagramTitle:Yi,getAccDescription:sa,setAccDescription:aa},P9r=x(t=>{ec(t,uR),uR.setDomains(t.domains),uR.setTransitions(t.transitions)},"populate"),B9r={parse:x(async t=>{const e=await Qu("cynefin",t);de.debug(e),P9r(e)},"parse")};function AC(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}x(AC,"seededRandom");function BZe(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"),F9r=x(()=>{const t=np(),e=xr();return na(t,e.themeVariables).cynefin},"getCynefinDomainColors"),bH=3,z9r=x((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=F9r();de.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,U=h.boundaryAmplitude,y=f+g*2,b=p+g*2,v={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=sl(e);Ga(w,b,y,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${y} ${b}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const T=w.append("g").attr("transform",`translate(${g}, ${g})`),k=$9r(f,p),C=$Ze(h.seed,e),S=T.append("g").attr("class","cynefin-backgrounds"),E=["complex","complicated","chaotic","clear"];for(const D of E){const B=k[D];S.append("rect").attr("class","cynefinDomain").attr("x",B.x).attr("y",B.y).attr("width",B.w).attr("height",B.h).attr("fill",v[D]).attr("fill-opacity",.4).attr("stroke","none")}const A=T.append("g").attr("class","cynefin-boundaries");A.append("path").attr("class","cynefinBoundary").attr("d",FZe(f,p,C,U)).attr("fill","none"),A.append("path").attr("class","cynefinBoundary").attr("d",zZe(f,p,C+100,U)).attr("fill","none"),A.append("path").attr("class","cynefinCliff").attr("d",VZe(f,p)).attr("fill","none");const R=f*.15,_=p*.15;T.append("path").attr("class","cynefinConfusion").attr("d",HZe(f/2,p/2,R,_)).attr("fill",v.confusion).attr("fill-opacity",.5);const N=T.append("g").attr("class","cynefin-labels");for(const D of E){const B=k[D];N.append("text").attr("class","cynefinDomainLabel").attr("x",B.cx).attr("y",m?B.cy-30:B.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(D.charAt(0).toUpperCase()+D.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 D=T.append("g").attr("class","cynefin-subtitles");for(const B of E){const F=k[B],z=Vye[B];D.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(z.model),D.append("text").attr("class","cynefinSubtitle").attr("x",F.cx).attr("y",F.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(z.practice)}D.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(Vye.confusion.practice)}const L=T.append("g").attr("class","cynefin-items"),I=26,P=10,O=["complex","complicated","chaotic","clear","confusion"];for(const D of O){const B=a.get(D);if(!B||B.items.length===0)continue;const F=k[D],z=D==="confusion";let $=B.items,V=0;z&&B.items.length>bH&&(V=B.items.length-bH,$=B.items.slice(0,bH));let H;if(z){const G=m?22:14;H=F.cy+G}else H=F.cy+(m?25:15);if([...$].forEach((G,K)=>{const W=H+K*(I+4),oe=L.append("g"),Z=oe.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 ne=Z.node();if(ne&&typeof ne.getBBox=="function"){const te=ne.getBBox();te.width>0&&(J=te.width)}const ie=J+P*2,me=F.cx-ie/2;oe.attr("transform",`translate(${me}, ${W})`),oe.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",ie).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",v[D]).attr("fill-opacity",.95),Z.attr("x",ie/2).attr("y",I/2)}),V>0){const G=H+$.length*(I+4),K=`+${V} more`,W=L.append("g"),oe=W.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(K);let Z=K.length*7;const J=oe.node();if(J&&typeof J.getBBox=="function"){const me=J.getBBox();me.width>0&&(Z=me.width)}const ne=Z+P*2,ie=F.cx-ne/2;W.attr("transform",`translate(${ie}, ${G})`),W.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",ne).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",v[D]).attr("fill-opacity",.6),oe.attr("x",ne/2).attr("y",I/2)}}if(s.length>0){const D=w.select("defs").empty()?w.append("defs"):w.select("defs"),B=`cynefin-arrow-${e}`;D.append("marker").attr("id",B).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 F=T.append("g").attr("class","cynefin-arrows");s.forEach(z=>{const $=k[z.from],V=k[z.to];if(!$||!V)return;if(z.from===z.to){de.warn(`Cynefin renderer: skipping self-loop on domain "${z.from}"`);return}const H=$.cx,G=$.cy,K=V.cx,W=V.cy,oe=(H+K)/2,Z=(G+W)/2,J=K-H,ne=W-G,ie=Math.sqrt(J*J+ne*ne),me=ie*.15,te=-ne/ie,Re=J/ie,Pe=oe+te*me,Ve=Z+Re*me;F.append("path").attr("class","cynefinArrowLine").attr("d",`M${H},${G} Q${Pe},${Ve} ${K},${W}`).attr("fill","none").attr("marker-end",`url(#${B})`),z.label&&F.append("text").attr("class","cynefinArrowLabel").attr("x",Pe).attr("y",Ve-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(z.label)})}o&&T.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),V9r={draw:z9r},H9r=x(()=>{const t=np(),e=xr();return na(t,e.themeVariables).cynefin},"getCynefinTheme"),G9r=x(()=>{const t=H9r();return` .cynefinDomain { stroke: none; } @@ -5970,8 +6103,8 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),TCr=wCr,CCr={parser:gCr,db:o_,renderer:bCr,styles:TCr};const kCr=Object.freeze(Object.defineProperty({__proto__:null,diagram:CCr},Symbol.toStringTag,{value:"Module"}));var mae="",yae="",vae="",bae=[],dO=new Map,Rg=w(t=>Nn(t,He()),"sanitizeText"),Tb=w(t=>{switch(t.type){case"terminal":return{...t,value:Rg(t.value)};case"nonterminal":return{...t,name:Rg(t.name)};case"sequence":return{...t,elements:t.elements.map(Tb)};case"choice":return{...t,alternatives:t.alternatives.map(Tb)};case"optional":return{...t,element:Tb(t.element)};case"repetition":return{...t,element:Tb(t.element),separator:t.separator?Tb(t.separator):void 0};case"special":return{...t,text:Rg(t.text)}}},"sanitizeAstNode"),SCr=w(()=>{mae="",yae="",vae="",bae.length=0,dO.clear(),Oi(),de.debug("[Railroad] Database cleared")},"clear"),LZe=w(t=>{mae=Rg(t),de.debug("[Railroad] Title set:",t)},"setTitle"),IZe=w(()=>mae,"getTitle"),ECr=w(t=>{const e={...t,name:Rg(t.name),definition:Tb(t.definition),comment:t.comment?Rg(t.comment):void 0};de.debug("[Railroad] Adding rule:",e.name),dO.has(e.name)&&de.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),bae.push(e),dO.set(e.name,e)},"addRule"),ACr=w(()=>bae,"getRules"),MCr=w(t=>dO.get(t),"getRule"),RCr=w(t=>{yae=Rg(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),_Cr=w(()=>yae,"getAccTitle"),LCr=w(t=>{vae=Rg(t).replace(/\n\s+/g,` -`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),ICr=w(()=>vae,"getAccDescription"),NCr=LZe,OCr=IZe,es={clear:SCr,setTitle:LZe,getTitle:IZe,addRule:ECr,getRules:ACr,getRule:MCr,setAccTitle:RCr,getAccTitle:_Cr,setAccDescription:LCr,getAccDescription:ICr,setDiagramTitle:NCr,getDiagramTitle:OCr},yo={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},DCr=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,PCr=/^[\w "',.-]+$/,$Cr=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"]),NZe=w(t=>t?Object.keys(t).every(e=>e==="railroad"||$Cr.has(e)):!1,"isRailroadStyleOptions"),BCr=w(t=>t?"railroad"in t&&t.railroad?t.railroad:NZe(t)?t:{}:{},"extractRailroadOverrides"),FCr=w(t=>{if(!t||NZe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...s}=t;return s},"extractThemeOverrides"),Si=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return DCr.test(r)?r:e},"sanitizeColorValue"),OZe=w((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return PCr.test(r)?r:e},"sanitizeFontFamilyValue"),p1=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"),zCr=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"),VCr=w(t=>{const e=OZe(t.fontFamily,yo.fontFamily),r=zCr(t.fontSize)??yo.fontSize;return{...yo,fontFamily:e,fontSize:r,terminalFill:Si(t.secondBkg??t.secondaryColor,yo.terminalFill),terminalStroke:Si(t.secondaryBorderColor??t.lineColor,yo.terminalStroke),terminalTextColor:Si(t.secondaryTextColor??t.textColor,yo.terminalTextColor),nonTerminalFill:Si(t.mainBkg??t.background,yo.nonTerminalFill),nonTerminalStroke:Si(t.primaryBorderColor??t.lineColor,yo.nonTerminalStroke),nonTerminalTextColor:Si(t.primaryTextColor??t.textColor,yo.nonTerminalTextColor),lineColor:Si(t.lineColor,yo.lineColor),markerFill:Si(t.lineColor,yo.markerFill),commentFill:Si(t.labelBackground??t.tertiaryColor,yo.commentFill),commentStroke:Si(t.tertiaryBorderColor??t.lineColor,yo.commentStroke),commentTextColor:Si(t.tertiaryTextColor??t.textColor,yo.commentTextColor),specialFill:Si(t.tertiaryColor??t.secondaryColor,yo.specialFill),specialStroke:Si(t.tertiaryBorderColor??t.secondaryBorderColor,yo.specialStroke),ruleNameColor:Si(t.titleColor??t.textColor,yo.ruleNameColor)}},"buildThemeDefaults"),xae=w(t=>{const e=xr(),r={...rp(),...e.themeVariables??{},...FCr(t)},n=VCr(r),i={...e.railroad??{},...BCr(t)};return{compactMode:i.compactMode??n.compactMode,padding:p1(i.padding,n.padding),verticalSeparation:p1(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:p1(i.horizontalSeparation,n.horizontalSeparation),arcRadius:p1(i.arcRadius,n.arcRadius),fontSize:p1(i.fontSize,n.fontSize),fontFamily:OZe(i.fontFamily,n.fontFamily),terminalFill:Si(i.terminalFill,n.terminalFill),terminalStroke:Si(i.terminalStroke,n.terminalStroke),terminalTextColor:Si(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Si(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Si(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Si(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Si(i.lineColor,n.lineColor),strokeWidth:p1(i.strokeWidth,n.strokeWidth),markerFill:Si(i.markerFill,n.markerFill),commentFill:Si(i.commentFill,n.commentFill),commentStroke:Si(i.commentStroke,n.commentStroke),commentTextColor:Si(i.commentTextColor,n.commentTextColor),specialFill:Si(i.specialFill,n.specialFill),specialStroke:Si(i.specialStroke,n.specialStroke),ruleNameColor:Si(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:p1(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),mB=w(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:s,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=xae(t);return` + `},"styles"),W9r=G9r,q9r={parser:B9r,db:uR,renderer:V9r,styles:W9r};const j9r=Object.freeze(Object.defineProperty({__proto__:null,diagram:q9r},Symbol.toStringTag,{value:"Module"}));var Cse="",kse="",Sse="",Ese=[],gD=new Map,Lg=x(t=>Dn(t,He()),"sanitizeText"),ky=x(t=>{switch(t.type){case"terminal":return{...t,value:Lg(t.value)};case"nonterminal":return{...t,name:Lg(t.name)};case"sequence":return{...t,elements:t.elements.map(ky)};case"choice":return{...t,alternatives:t.alternatives.map(ky)};case"optional":return{...t,element:ky(t.element)};case"repetition":return{...t,element:ky(t.element),separator:t.separator?ky(t.separator):void 0};case"special":return{...t,text:Lg(t.text)}}},"sanitizeAstNode"),Y9r=x(()=>{Cse="",kse="",Sse="",Ese.length=0,gD.clear(),Oi(),de.debug("[Railroad] Database cleared")},"clear"),GZe=x(t=>{Cse=Lg(t),de.debug("[Railroad] Title set:",t)},"setTitle"),WZe=x(()=>Cse,"getTitle"),X9r=x(t=>{const e={...t,name:Lg(t.name),definition:ky(t.definition),comment:t.comment?Lg(t.comment):void 0};de.debug("[Railroad] Adding rule:",e.name),gD.has(e.name)&&de.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),Ese.push(e),gD.set(e.name,e)},"addRule"),K9r=x(()=>Ese,"getRules"),Z9r=x(t=>gD.get(t),"getRule"),J9r=x(t=>{kse=Lg(t).replace(/^\s+/g,""),de.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Q9r=x(()=>kse,"getAccTitle"),e3r=x(t=>{Sse=Lg(t).replace(/\n\s+/g,` +`),de.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),t3r=x(()=>Sse,"getAccDescription"),r3r=GZe,n3r=WZe,ta={clear:Y9r,setTitle:GZe,getTitle:WZe,addRule:X9r,getRules:K9r,getRule:Z9r,setAccTitle:J9r,getAccTitle:Q9r,setAccDescription:e3r,getAccDescription:t3r,setDiagramTitle:r3r,getDiagramTitle:n3r},Uo={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},i3r=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,a3r=/^[\w "',.-]+$/,s3r=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"]),qZe=x(t=>t?Object.keys(t).every(e=>e==="railroad"||s3r.has(e)):!1,"isRailroadStyleOptions"),o3r=x(t=>t?"railroad"in t&&t.railroad?t.railroad:qZe(t)?t:{}:{},"extractRailroadOverrides"),l3r=x(t=>{if(!t||qZe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Si=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return i3r.test(r)?r:e},"sanitizeColorValue"),jZe=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return a3r.test(r)?r:e},"sanitizeFontFamilyValue"),Um=x((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),c3r=x(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),u3r=x(t=>{const e=jZe(t.fontFamily,Uo.fontFamily),r=c3r(t.fontSize)??Uo.fontSize;return{...Uo,fontFamily:e,fontSize:r,terminalFill:Si(t.secondBkg??t.secondaryColor,Uo.terminalFill),terminalStroke:Si(t.secondaryBorderColor??t.lineColor,Uo.terminalStroke),terminalTextColor:Si(t.secondaryTextColor??t.textColor,Uo.terminalTextColor),nonTerminalFill:Si(t.mainBkg??t.background,Uo.nonTerminalFill),nonTerminalStroke:Si(t.primaryBorderColor??t.lineColor,Uo.nonTerminalStroke),nonTerminalTextColor:Si(t.primaryTextColor??t.textColor,Uo.nonTerminalTextColor),lineColor:Si(t.lineColor,Uo.lineColor),markerFill:Si(t.lineColor,Uo.markerFill),commentFill:Si(t.labelBackground??t.tertiaryColor,Uo.commentFill),commentStroke:Si(t.tertiaryBorderColor??t.lineColor,Uo.commentStroke),commentTextColor:Si(t.tertiaryTextColor??t.textColor,Uo.commentTextColor),specialFill:Si(t.tertiaryColor??t.secondaryColor,Uo.specialFill),specialStroke:Si(t.tertiaryBorderColor??t.secondaryBorderColor,Uo.specialStroke),ruleNameColor:Si(t.titleColor??t.textColor,Uo.ruleNameColor)}},"buildThemeDefaults"),Ase=x(t=>{const e=xr(),r={...np(),...e.themeVariables??{},...l3r(t)},n=u3r(r),i={...e.railroad??{},...o3r(t)};return{compactMode:i.compactMode??n.compactMode,padding:Um(i.padding,n.padding),verticalSeparation:Um(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:Um(i.horizontalSeparation,n.horizontalSeparation),arcRadius:Um(i.arcRadius,n.arcRadius),fontSize:Um(i.fontSize,n.fontSize),fontFamily:jZe(i.fontFamily,n.fontFamily),terminalFill:Si(i.terminalFill,n.terminalFill),terminalStroke:Si(i.terminalStroke,n.terminalStroke),terminalTextColor:Si(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Si(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Si(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Si(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Si(i.lineColor,n.lineColor),strokeWidth:Um(i.strokeWidth,n.strokeWidth),markerFill:Si(i.markerFill,n.markerFill),commentFill:Si(i.commentFill,n.commentFill),commentStroke:Si(i.commentStroke,n.commentStroke),commentTextColor:Si(i.commentTextColor,n.commentTextColor),specialFill:Si(i.specialFill,n.specialFill),specialStroke:Si(i.specialStroke,n.specialStroke),ruleNameColor:Si(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:Um(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),bB=x(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:U,ruleNameColor:y}=Ase(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -5984,7 +6117,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error } .railroad-terminal text { - fill: ${s}; + fill: ${a}; font-family: ${e}; font-size: ${r}px; text-anchor: middle; @@ -5992,7 +6125,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error } .railroad-nonterminal rect { - fill: ${a}; + fill: ${s}; stroke: ${o}; stroke-width: ${h}px; } @@ -6033,7 +6166,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .railroad-special rect { fill: ${m}; - stroke: ${y}; + stroke: ${U}; stroke-width: ${h}px; stroke-dasharray: 5,3; } @@ -6048,7 +6181,7 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .railroad-rule-name { font-weight: bold; - fill: ${v}; + fill: ${y}; font-family: ${e}; font-size: ${r}px; } @@ -6056,8 +6189,8 @@ Expecting `+ne.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ie="Parse error .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),l5,xu=(l5=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,s,a,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${s?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},w(l5,"PathBuilder"),l5),c5,HCr=(c5=class{constructor(e,r=xae()){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,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s).attr("rx",10).attr("ry",10),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text(r),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,s=0,a=0;for(const u of n)i+=u.dimensions.width,s=Math.max(s,u.dimensions.up),a=Math.max(a,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,s=0;for(const f of n)i=Math.max(i,f.dimensions.width),s+=f.dimensions.height;s+=(n.length-1)*this.config.verticalSeparation;const a=this.config.arcRadius,o=a*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=s/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=a*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new xu,b=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(a,a,0,!1,b,a,d+(b?a:-a)).lineTo(a,g-(b?a:-a)).arcTo(a,a,0,!1,!b,a*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const x=new xu,T=m+f.dimensions.width,C=l-a*2;g===d?x.moveTo(T,g).lineTo(l,d):x.moveTo(T,g).lineTo(C,g).arcTo(a,a,0,!1,!b,l-a,g+(b?-a:a)).lineTo(l-a,d+(b?a:-a)).arcTo(a,a,0,!1,b,l,d),u.append("path").attr("class","railroad-line").attr("d",x.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:s,up:d,down:s-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,s=i*2,a=n.dimensions.width+i*4,o=n.dimensions.height+s,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=s;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new xu().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new xu().moveTo(u+n.dimensions.width,f).lineTo(a,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new xu().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(a-i*2,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,f-i).arcTo(i,i,0,!1,!1,a,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:a,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),s=this.config.arcRadius,a=s*2,o=i.dimensions.width+s*4,l=n===0,u=i.dimensions.height+a+(l?a:0),h=e.append("g").attr("class","railroad-repetition"),d=s*2,f=l?a: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 xu().moveTo(0,g).lineTo(s*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new xu().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+s,y=new xu().moveTo(d+i.dimensions.width,g).arcTo(s,s,0,!1,!0,d+i.dimensions.width+s,g+s).lineTo(d+i.dimensions.width+s,m).arcTo(s,s,0,!1,!0,d+i.dimensions.width,m+s).lineTo(s*2,m+s).arcTo(s,s,0,!1,!0,s,m).lineTo(s,g+s).arcTo(s,s,0,!1,!0,s*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new xu().moveTo(0,g).arcTo(s,s,0,!1,!1,s,g-s).lineTo(s,s).arcTo(s,s,0,!1,!0,s*2,0).lineTo(o-s*2,0).arcTo(s,s,0,!1,!0,o-s,s).lineTo(o-s,g-s).arcTo(s,s,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,s=n.height+this.config.padding*2,a=e.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",s),a.append("text").attr("x",i/2).attr("y",s/2).text("? "+r+" ?"),{element:a.node(),dimensions:{width:i,height:s,up:s/2,down:s/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+" =",s=this.measureText(i).width+20,a=s+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(${a}, ${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",s).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new xu().moveTo(s+this.config.markerRadius,u).lineTo(a,u).build()),n.append("path").attr("class","railroad-line").attr("d",new xu().moveTo(a+l.dimensions.width,u).lineTo(a+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const s=this.renderRule(i,r);r+=s.height+this.config.verticalSeparation,n=Math.max(n,s.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},w(c5,"RailroadRenderer"),c5),Nbe=w((t,e,r)=>{qs(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),GCr=w((t,e,r)=>{de.debug(`[Railroad] Rendering diagram -`+t);try{const n=al(e);n.attr("class","railroad-diagram");const i=xr().railroad,s=(i==null?void 0:i.useMaxWidth)??!0,a=es.getRules();if(de.debug(`[Railroad] Rendering ${a.length} rules`),a.length===0){de.warn("[Railroad] No rules to render"),Nbe(n,{height:100,width:200},s);return}const l=new HCr(n,xae()).renderDiagram(a);Nbe(n,l,s),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),yB={draw:GCr},WCr=yse().Railroad.parser.LangiumParser,Cb=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(Cb);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Cb);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Cb(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Cb(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Cb(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),qCr=w(t=>({name:t.name,definition:Cb(t.definition)}),"transformRule"),UCr=w(t=>{ec(t,es),t.title&&es.setTitle(t.title),t.rules.map(e=>es.addRule(qCr(e)))},"populateDb"),jCr={parse:w(t=>{es.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=WCr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),UCr(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:es}},YCr={parser:jCr,db:es,renderer:yB,styles:mB};const XCr=Object.freeze(Object.defineProperty({__proto__:null,diagram:YCr},Symbol.toStringTag,{value:"Module"}));var KCr=vse().RailroadEbnf.parser.LangiumParser,l_=w(t=>{const e=t.alternatives.map(ZCr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),ZCr=w(t=>{const e=t.elements.map(JCr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),DZe=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 l_(t.element);case"EbnfOptional":return{type:"optional",element:l_(t.element)};case"EbnfRepetition":return{type:"repetition",element:l_(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),QCr=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:"-"},DZe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),JCr=w(t=>t.postfixes.reduce((e,r)=>QCr(e,r),DZe(t.base)),"transformTerm"),ekr=w(t=>({name:t.name,definition:l_(t.definition)}),"transformRule"),tkr=w(t=>{ec(t,es),t.title&&es.setTitle(t.title),t.rules.map(e=>es.addRule(ekr(e)))},"populateDb"),rkr={parse:w(t=>{es.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=KCr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),tkr(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:es}},nkr={parser:rkr,db:es,renderer:yB,styles:mB};const ikr=Object.freeze(Object.defineProperty({__proto__:null,diagram:nkr},Symbol.toStringTag,{value:"Module"}));var skr=bse().RailroadAbnf.parser.LangiumParser,tZ=w(t=>{const e=t.alternatives.map(akr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),akr=w(t=>{const e=t.elements.map(lkr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),okr=w(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,s=n?parseInt(n,10):1/0;return{min:i,max:s}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),lkr=w(t=>{const e=ckr(t.primary);if(!t.repeat)return e;const{min:r,max:n}=okr(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),ckr=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 tZ(t.element);case"AbnfOptionalGroup":return{type:"optional",element:tZ(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),ukr=w(t=>({name:t.name,definition:tZ(t.definition)}),"transformRule"),hkr=w(t=>{ec(t,es),t.title&&es.setTitle(t.title),t.rules.map(e=>es.addRule(ukr(e)))},"populateDb"),dkr={parse:w(t=>{es.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=skr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),hkr(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:es}},fkr={parser:dkr,db:es,renderer:yB,styles:mB};const pkr=Object.freeze(Object.defineProperty({__proto__:null,diagram:fkr},Symbol.toStringTag,{value:"Module"}));var gkr=xse().RailroadPeg.parser.LangiumParser,PZe=w(t=>{const e=t.alternatives.map(mkr);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),mkr=w(t=>{const e=t.elements.map(ykr);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),ykr=w(t=>{const e=vkr(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Obe(e)}`:`!${Obe(e)}`}:e},"transformPrefix"),Obe=w(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),vkr=w(t=>{const e=bkr(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"),bkr=w(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return PZe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),xkr=w(t=>({name:t.name,definition:PZe(t.definition)}),"transformRule"),wkr=w(t=>{ec(t,es),t.title&&es.setTitle(t.title),t.rules.map(e=>es.addRule(xkr(e)))},"populateDb"),Tkr={parse:w(t=>{es.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=gkr.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Z7(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),wkr(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:es}},Ckr={parser:Tkr,db:es,renderer:yB,styles:mB};const kkr=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ckr},Symbol.toStringTag,{value:"Module"}));var Skr=1;function wae(){if(!(typeof globalThis>"u"))return globalThis}w(wae,"getCaptureGlobal");function $Ze(){var t;return!!((t=wae())!=null&&t.mermaidCaptureSizes)}w($Ze,"shouldCaptureSizes");function BZe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}w(BZe,"capturedFromLocation");function FZe(t,e){const r=wae();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,s=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const a={svgId:s,sizes:t};r.mermaidCapturedSizes.push(a),r.mermaidLastCapturedSizes=a}w(FZe,"emitCapturedSizes");function zZe(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&&FZe({metadata:{captureVersion:Skr,capturedAt:new Date().toISOString(),capturedFrom:BZe()},nodes:r},t)}w(zZe,"captureNodeSizes");const Ekr=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:zZe,shouldCaptureSizes:$Ze},Symbol.toStringTag,{value:"Module"})),Akr=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:eje,createInfoServices:tje},Symbol.toStringTag,{value:"Module"})),Mkr=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:rje,createPacketServices:nje},Symbol.toStringTag,{value:"Module"})),Rkr=Object.freeze(Object.defineProperty({__proto__:null,PieModule:ije,createPieServices:sje},Symbol.toStringTag,{value:"Module"})),_kr=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:aje,createTreeViewServices:oje},Symbol.toStringTag,{value:"Module"})),Lkr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:lje,createArchitectureServices:cje},Symbol.toStringTag,{value:"Module"})),Ikr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:QUe,createGitGraphServices:JUe},Symbol.toStringTag,{value:"Module"})),Nkr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:hje,createEventModelingServices:dje},Symbol.toStringTag,{value:"Module"})),Okr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:FUe,createRadarServices:zUe},Symbol.toStringTag,{value:"Module"})),Dkr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:VUe,createRailroadServices:yse},Symbol.toStringTag,{value:"Module"})),Pkr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:HUe,createRailroadEbnfServices:vse},Symbol.toStringTag,{value:"Module"})),$kr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:GUe,createRailroadAbnfServices:bse},Symbol.toStringTag,{value:"Module"})),Bkr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:WUe,createRailroadPegServices:xse},Symbol.toStringTag,{value:"Module"})),Fkr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:UUe,createTreemapServices:jUe},Symbol.toStringTag,{value:"Module"})),zkr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:YUe,createWardleyServices:XUe},Symbol.toStringTag,{value:"Module"})),Vkr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:KUe,createCynefinServices:ZUe},Symbol.toStringTag,{value:"Module"})); +`},"getStyles"),dv,vu=(dv=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(dv,"PathBuilder"),dv),fv,h3r=(fv=class{constructor(e,r=Ase()){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 y=new vu,b=g>d;g===d?y.moveTo(0,d).lineTo(m,g):y.moveTo(0,d).arcTo(s,s,0,!1,b,s,d+(b?s:-s)).lineTo(s,g-(b?s:-s)).arcTo(s,s,0,!1,!b,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",y.build());const v=new vu,w=m+f.dimensions.width,T=l-s*2;g===d?v.moveTo(w,g).lineTo(l,d):v.moveTo(w,g).lineTo(T,g).arcTo(s,s,0,!1,!b,l-s,g+(b?-s:s)).lineTo(l-s,d+(b?s:-s)).arcTo(s,s,0,!1,b,l,d),u.append("path").attr("class","railroad-line").attr("d",v.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 vu().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new vu().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new vu().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 vu().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new vu().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,U=new vu().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",U.build()),l){const y=new vu().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",y.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 vu().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new vu().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fv,"RailroadRenderer"),fv),Hye=x((t,e,r)=>{Ga(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),d3r=x((t,e,r)=>{de.debug(`[Railroad] Rendering diagram +`+t);try{const n=sl(e);n.attr("class","railroad-diagram");const i=xr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ta.getRules();if(de.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){de.warn("[Railroad] No rules to render"),Hye(n,{height:100,width:200},a);return}const l=new h3r(n,Ase()).renderDiagram(s);Hye(n,l,a),de.debug("[Railroad] Render complete")}catch(n){throw de.error("[Railroad] Render error:",n),n}},"draw"),vB={draw:d3r},f3r=kae().Railroad.parser.LangiumParser,Sy=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Sy);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Sy);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Sy(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Sy(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Sy(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),p3r=x(t=>({name:t.name,definition:Sy(t.definition)}),"transformRule"),g3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(p3r(e)))},"populateDb"),m3r={parse:x(t=>{ta.clear(),de.debug("[Railroad Parser] Starting Langium parse");const e=f3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[Railroad Parser] Parsed rules:",r.rules.length),g3r(r),de.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ta}},U3r={parser:m3r,db:ta,renderer:vB,styles:bB};const y3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:U3r},Symbol.toStringTag,{value:"Module"}));var b3r=Sae().RailroadEbnf.parser.LangiumParser,hR=x(t=>{const e=t.alternatives.map(v3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),v3r=x(t=>{const e=t.elements.map(w3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),YZe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return hR(t.element);case"EbnfOptional":return{type:"optional",element:hR(t.element)};case"EbnfRepetition":return{type:"repetition",element:hR(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),x3r=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},YZe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),w3r=x(t=>t.postfixes.reduce((e,r)=>x3r(e,r),YZe(t.base)),"transformTerm"),T3r=x(t=>({name:t.name,definition:hR(t.definition)}),"transformRule"),C3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(T3r(e)))},"populateDb"),k3r={parse:x(t=>{ta.clear(),de.debug("[EBNF Parser] Starting Langium parse");const e=b3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[EBNF Parser] Parsed rules:",r.rules.length),C3r(r),de.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ta}},S3r={parser:k3r,db:ta,renderer:vB,styles:bB};const E3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:S3r},Symbol.toStringTag,{value:"Module"}));var A3r=Eae().RailroadAbnf.parser.LangiumParser,lZ=x(t=>{const e=t.alternatives.map(M3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),M3r=x(t=>{const e=t.elements.map(L3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),R3r=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),L3r=x(t=>{const e=I3r(t.primary);if(!t.repeat)return e;const{min:r,max:n}=R3r(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),I3r=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return lZ(t.element);case"AbnfOptionalGroup":return{type:"optional",element:lZ(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),N3r=x(t=>({name:t.name,definition:lZ(t.definition)}),"transformRule"),D3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(N3r(e)))},"populateDb"),O3r={parse:x(t=>{ta.clear(),de.debug("[ABNF Parser] Starting Langium parse");const e=A3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[ABNF Parser] Parsed rules:",r.rules.length),D3r(r),de.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ta}},_3r={parser:O3r,db:ta,renderer:vB,styles:bB};const P3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:_3r},Symbol.toStringTag,{value:"Module"}));var B3r=Aae().RailroadPeg.parser.LangiumParser,XZe=x(t=>{const e=t.alternatives.map($3r);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),$3r=x(t=>{const e=t.elements.map(F3r);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),F3r=x(t=>{const e=z3r(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Gye(e)}`:`!${Gye(e)}`}:e},"transformPrefix"),Gye=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),z3r=x(t=>{const e=V3r(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"),V3r=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return XZe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),H3r=x(t=>({name:t.name,definition:XZe(t.definition)}),"transformRule"),G3r=x(t=>{ec(t,ta),t.title&&ta.setTitle(t.title),t.rules.map(e=>ta.addRule(H3r(e)))},"populateDb"),W3r={parse:x(t=>{ta.clear(),de.debug("[PEG Parser] Starting Langium parse");const e=B3r.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new eS(e);const r=e.value;de.debug("[PEG Parser] Parsed rules:",r.rules.length),G3r(r),de.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ta}},q3r={parser:W3r,db:ta,renderer:vB,styles:bB};const j3r=Object.freeze(Object.defineProperty({__proto__:null,diagram:q3r},Symbol.toStringTag,{value:"Module"}));var Y3r=1;function Mse(){if(!(typeof globalThis>"u"))return globalThis}x(Mse,"getCaptureGlobal");function KZe(){var t;return!!((t=Mse())!=null&&t.mermaidCaptureSizes)}x(KZe,"shouldCaptureSizes");function ZZe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(ZZe,"capturedFromLocation");function JZe(t,e){const r=Mse();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(JZe,"emitCapturedSizes");function QZe(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&&JZe({metadata:{captureVersion:Y3r,capturedAt:new Date().toISOString(),capturedFrom:ZZe()},nodes:r},t)}x(QZe,"captureNodeSizes");const X3r=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:QZe,shouldCaptureSizes:KZe},Symbol.toStringTag,{value:"Module"})),K3r=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:fje,createInfoServices:pje},Symbol.toStringTag,{value:"Module"})),Z3r=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:gje,createPacketServices:mje},Symbol.toStringTag,{value:"Module"})),J3r=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Uje,createPieServices:yje},Symbol.toStringTag,{value:"Module"})),Q3r=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:bje,createTreeViewServices:vje},Symbol.toStringTag,{value:"Module"})),exr=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:xje,createArchitectureServices:wje},Symbol.toStringTag,{value:"Module"})),txr=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:hje,createGitGraphServices:dje},Symbol.toStringTag,{value:"Module"})),rxr=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Cje,createEventModelingServices:kje},Symbol.toStringTag,{value:"Module"})),nxr=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Jqe,createRadarServices:Qqe},Symbol.toStringTag,{value:"Module"})),ixr=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:eje,createRailroadServices:kae},Symbol.toStringTag,{value:"Module"})),axr=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:tje,createRailroadEbnfServices:Sae},Symbol.toStringTag,{value:"Module"})),sxr=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:rje,createRailroadAbnfServices:Eae},Symbol.toStringTag,{value:"Module"})),oxr=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:nje,createRailroadPegServices:Aae},Symbol.toStringTag,{value:"Module"})),lxr=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:aje,createTreemapServices:sje},Symbol.toStringTag,{value:"Module"})),cxr=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:oje,createWardleyServices:lje},Symbol.toStringTag,{value:"Module"})),uxr=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:cje,createCynefinServices:uje},Symbol.toStringTag,{value:"Module"})); diff --git a/apps/ios/EditorSource/src/main.ts b/apps/ios/EditorSource/src/main.ts index c28c9964..26a242b5 100644 --- a/apps/ios/EditorSource/src/main.ts +++ b/apps/ios/EditorSource/src/main.ts @@ -1,3 +1,5 @@ +import { prepareNoteImageAssets } from "@edgeever/shared/note-image-fonts"; +import { noteImageAssetUrls } from "@edgeever/shared/note-image-assets"; import "./styles.css"; import "katex/dist/katex.min.css"; import { Graph } from "@antv/x6"; @@ -1297,6 +1299,8 @@ async function exportNoteImage(request: ImageExportRequest) { document.body.appendChild(host); try { + const assets = await prepareNoteImageAssets({ theme: resolvedTheme, fontStyle, text: [request.title, request.notebook, ...(request.tags || []), request.updatedAt, bodyHtml].join(" "), urls: noteImageAssetUrls }); + style.textContent = assets.css + generateCardCss({ theme: resolvedTheme, fontStyle, fontSize, cardWidth }); const images = Array.from(documentRoot.querySelectorAll("img")); await Promise.race([ Promise.all([ @@ -1341,7 +1345,7 @@ async function exportNoteImage(request: ImageExportRequest) { } }, pixelRatio: renderPlan.pixelRatio, - skipFonts: true, + fontEmbedCSS: assets.fontCss, width, }); let canvas: HTMLCanvasElement; diff --git a/apps/ios/EditorSource/vite.config.ts b/apps/ios/EditorSource/vite.config.ts index 019a2c34..45589699 100644 --- a/apps/ios/EditorSource/vite.config.ts +++ b/apps/ios/EditorSource/vite.config.ts @@ -2,7 +2,8 @@ import { defineConfig } from "vite"; import { viteSingleFile } from "vite-plugin-singlefile"; export default defineConfig({ - plugins: [viteSingleFile()], + plugins: [viteSingleFile({ useRecommendedBuildConfig: false })], + base: "./", // The shared workspace package is linked from outside EditorSource. Preserve // that symlink so Vite resolves its TipTap imports from this package's clean // install as well as from a fully installed monorepo checkout. @@ -12,10 +13,14 @@ export default defineConfig({ build: { outDir: "../EditorBundle", emptyOutDir: true, - assetsInlineLimit: 100_000_000, + // Keep large, on-demand card fonts out of the editor's initial HTML parse. + assetsInlineLimit: (path) => !path.includes("/note-image-assets/"), cssCodeSplit: false, rollupOptions: { input: "index.html", + // The script is inlined into root index.html, so asset URLs must also + // be calculated relative to the root rather than assets/editor.js. + output: { inlineDynamicImports: true, entryFileNames: "editor.js" }, }, }, }); diff --git a/apps/ios/Scripts/build-editor-bundle.sh b/apps/ios/Scripts/build-editor-bundle.sh index 606e7514..0e8a49e3 100755 --- a/apps/ios/Scripts/build-editor-bundle.sh +++ b/apps/ios/Scripts/build-editor-bundle.sh @@ -28,4 +28,8 @@ fi RES_OUT="$ROOT/EdgeEver/Resources/EditorBundle" mkdir -p "$RES_OUT" cp -f "$OUT/index.html" "$RES_OUT/index.html" +if [[ -d "$OUT/assets" ]]; then + mkdir -p "$RES_OUT/assets" + rsync -a --delete "$OUT/assets/" "$RES_OUT/assets/" +fi echo "Built EditorBundle → $OUT (mirrored to $RES_OUT)" diff --git a/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift b/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift index 3401ee09..a5dc0cc8 100644 --- a/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift +++ b/apps/ios/Tests/EdgeEverTests/MobileUIParityTests.swift @@ -4,6 +4,55 @@ import XCTest /// Exercises shipped parity helpers (same semantics as Android `@edgeever/shared/mobile-ui` + notebooks). final class MobileUIParityTests: XCTestCase { + @MainActor + func testImageShareChoicesPersistAcrossStoreRecreation() throws { + let suite = "image-share-tests-\(UUID().uuidString)" + let defaults = try XCTUnwrap(UserDefaults(suiteName: suite)) + defer { defaults.removePersistentDomain(forName: suite) } + let first = PreferencesStore(defaults: defaults) + first.noteImageShare.theme = "book" + first.noteImageShare.fontStyle = "serif" + first.noteImageShare.fontSize = "md" + first.noteImageShare.cardWidth = "compact" + first.noteImageShare.format = "jpeg" + first.noteImageShare.showTitle = false + first.noteImageShare.showNotebook = true + first.noteImageShare.showTags = true + first.noteImageShare.showUpdatedAt = false + first.noteImageShare.showBranding = false + let reopened = PreferencesStore(defaults: try XCTUnwrap(UserDefaults(suiteName: suite))) + XCTAssertEqual(reopened.noteImageShare, first.noteImageShare) + // False and true choices both persist when changed back. + reopened.noteImageShare = NoteImageSharePreferences() + XCTAssertEqual(PreferencesStore(defaults: defaults).noteImageShare, NoteImageSharePreferences()) + } + + func testImageShareInvalidFieldsDoNotDiscardValidChoices() throws { + let raw = #"{"theme":"removed","fontStyle":"serif","fontSize":12,"cardWidth":"compact","format":"svg","showTitle":false,"showNotebook":true,"showTags":"true","showUpdatedAt":false,"showBranding":false}"# + let settings = try JSONDecoder().decode(NoteImageSharePreferences.self, from: Data(raw.utf8)) + XCTAssertEqual(settings.theme, "gradient") + XCTAssertEqual(settings.fontStyle, "serif") + XCTAssertEqual(settings.fontSize, "lg") + XCTAssertEqual(settings.cardWidth, "compact") + XCTAssertEqual(settings.format, "png") + XCTAssertFalse(settings.showTitle) + XCTAssertTrue(settings.showNotebook) + XCTAssertFalse(settings.showTags) + XCTAssertFalse(settings.showUpdatedAt) + XCTAssertFalse(settings.showBranding) + } + + @MainActor + func testImageShareCorruptStorageFallsBackWithoutRewritingOnLoad() throws { + let suite = "image-share-corrupt-\(UUID().uuidString)" + let defaults = try XCTUnwrap(UserDefaults(suiteName: suite)) + defer { defaults.removePersistentDomain(forName: suite) } + let raw = Data("{broken".utf8) + defaults.set(raw, forKey: "edgeever.ios.noteImagePreferences") + XCTAssertEqual(PreferencesStore(defaults: defaults).noteImageShare, NoteImageSharePreferences()) + XCTAssertEqual(defaults.data(forKey: "edgeever.ios.noteImagePreferences"), raw) + } + func testUnmatchedSystemLanguageUsesEnglishUI() { // Japanese is a first-class UI language, so a Japanese system no longer falls back to English. XCTAssertFalse(AppUILocale.usesEnglish(preferenceCode: "system", systemLanguageCode: "ja")) diff --git a/apps/ios/project.yml b/apps/ios/project.yml index 23e82b99..56f01736 100644 --- a/apps/ios/project.yml +++ b/apps/ios/project.yml @@ -42,11 +42,17 @@ targets: - path: EdgeEver excludes: - Resources/Info.plist + - Resources/EditorBundle/assets + - path: EdgeEver/Resources/EditorBundle/assets + type: folder + buildPhase: resources resources: - path: EdgeEver/Resources/Assets.xcassets - path: EdgeEver/Resources/Localizable.xcstrings - path: EdgeEver/Resources/PrivacyInfo.xcprivacy - path: EdgeEver/Resources/EditorBundle + excludes: + - assets dependencies: - package: GRDB product: GRDB diff --git a/apps/mobile/metro.config.cjs b/apps/mobile/metro.config.cjs new file mode 100644 index 00000000..9255c870 --- /dev/null +++ b/apps/mobile/metro.config.cjs @@ -0,0 +1,7 @@ +const { getDefaultConfig } = require("expo/metro-config"); + +const config = getDefaultConfig(__dirname); +// The DOM editor ships the same offline WOFF2 card fonts as the Web client. +config.resolver.assetExts = [...new Set([...config.resolver.assetExts, "woff2"])]; + +module.exports = config; diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsx index ee8070b2..fb41de4b 100644 --- a/apps/mobile/src/components/LocalTiptapEditor.tsx +++ b/apps/mobile/src/components/LocalTiptapEditor.tsx @@ -1,5 +1,7 @@ 'use dom'; +import { prepareNoteImageAssets } from "@edgeever/shared/note-image-fonts"; +import { noteImageAssetUrls } from "./note-image-asset-urls"; import "katex/dist/katex.min.css"; import { attachMobileReaderScroll } from "../lib/mobile-reader-scroll"; import { Graph } from "@antv/x6"; @@ -1299,6 +1301,8 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { document.body.appendChild(host); try { + const assets = await prepareNoteImageAssets({ theme: resolvedTheme, fontStyle, text: [request.title, request.notebook, ...(request.tags || []), request.updatedAt, bodyHtml].join(" "), urls: noteImageAssetUrls }); + style.textContent = assets.css + generateCardCss({ theme: resolvedTheme, fontStyle, fontSize, cardWidth }); const images = Array.from(documentRoot.querySelectorAll("img")); await Promise.race([ Promise.all([ @@ -1344,7 +1348,7 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) { } }, pixelRatio: renderPlan.pixelRatio, - skipFonts: true, + fontEmbedCSS: assets.fontCss, width, }); let canvas: HTMLCanvasElement; diff --git a/apps/mobile/src/components/note-image-asset-urls.ts b/apps/mobile/src/components/note-image-asset-urls.ts new file mode 100644 index 00000000..5dc4347c --- /dev/null +++ b/apps/mobile/src/components/note-image-asset-urls.ts @@ -0,0 +1,122 @@ +// Expo DOM resolves non-image local assets to URLs. Keep requires static for Metro. +export const noteImageAssetUrls: Record = { + "geist/GeistMono.ttf": require("../../../../packages/shared/src/note-image-assets/geist/GeistMono.ttf"), + "puhui/e084fc75.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/e084fc75.woff2"), + "puhui/f1da1a83.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/f1da1a83.woff2"), + "puhui/06937cd9.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/06937cd9.woff2"), + "puhui/83ea2cba.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/83ea2cba.woff2"), + "puhui/69aba650.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/69aba650.woff2"), + "puhui/f692aa37.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/f692aa37.woff2"), + "puhui/79088b33.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/79088b33.woff2"), + "puhui/dcb1ff4a.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/dcb1ff4a.woff2"), + "puhui/67a3cdde.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/67a3cdde.woff2"), + "puhui/7efb8990.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/7efb8990.woff2"), + "puhui/668b1bf5.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/668b1bf5.woff2"), + "puhui/b50d627f.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/b50d627f.woff2"), + "puhui/71b36260.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/71b36260.woff2"), + "puhui/e776ebdb.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/e776ebdb.woff2"), + "puhui/e16b3f49.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/e16b3f49.woff2"), + "puhui/6880f229.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/6880f229.woff2"), + "puhui/562341ba.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/562341ba.woff2"), + "puhui/b04d2f05.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/b04d2f05.woff2"), + "puhui/1be2c28b.woff2": require("../../../../packages/shared/src/note-image-assets/puhui/1be2c28b.woff2"), + "misans/0b091a88.woff2": require("../../../../packages/shared/src/note-image-assets/misans/0b091a88.woff2"), + "misans/4dd21d3a.woff2": require("../../../../packages/shared/src/note-image-assets/misans/4dd21d3a.woff2"), + "misans/227fd1ab.woff2": require("../../../../packages/shared/src/note-image-assets/misans/227fd1ab.woff2"), + "misans/6defc511.woff2": require("../../../../packages/shared/src/note-image-assets/misans/6defc511.woff2"), + "misans/41a1ce17.woff2": require("../../../../packages/shared/src/note-image-assets/misans/41a1ce17.woff2"), + "misans/eba750fc.woff2": require("../../../../packages/shared/src/note-image-assets/misans/eba750fc.woff2"), + "misans/874104a4.woff2": require("../../../../packages/shared/src/note-image-assets/misans/874104a4.woff2"), + "misans/edbfaf60.woff2": require("../../../../packages/shared/src/note-image-assets/misans/edbfaf60.woff2"), + "misans/4b5dd3c7.woff2": require("../../../../packages/shared/src/note-image-assets/misans/4b5dd3c7.woff2"), + "misans/8609d775.woff2": require("../../../../packages/shared/src/note-image-assets/misans/8609d775.woff2"), + "misans/7639be88.woff2": require("../../../../packages/shared/src/note-image-assets/misans/7639be88.woff2"), + "misans/db53347f.woff2": require("../../../../packages/shared/src/note-image-assets/misans/db53347f.woff2"), + "misans/a70208e3.woff2": require("../../../../packages/shared/src/note-image-assets/misans/a70208e3.woff2"), + "misans/c2f7cd5e.woff2": require("../../../../packages/shared/src/note-image-assets/misans/c2f7cd5e.woff2"), + "misans/b3149c79.woff2": require("../../../../packages/shared/src/note-image-assets/misans/b3149c79.woff2"), + "misans/2dda088b.woff2": require("../../../../packages/shared/src/note-image-assets/misans/2dda088b.woff2"), + "misans/7f4db008.woff2": require("../../../../packages/shared/src/note-image-assets/misans/7f4db008.woff2"), + "song/43f1e8f0.woff2": require("../../../../packages/shared/src/note-image-assets/song/43f1e8f0.woff2"), + "song/cdac0154.woff2": require("../../../../packages/shared/src/note-image-assets/song/cdac0154.woff2"), + "song/9bc91d93.woff2": require("../../../../packages/shared/src/note-image-assets/song/9bc91d93.woff2"), + "song/dd2bb5c1.woff2": require("../../../../packages/shared/src/note-image-assets/song/dd2bb5c1.woff2"), + "song/d1ab5ca3.woff2": require("../../../../packages/shared/src/note-image-assets/song/d1ab5ca3.woff2"), + "song/26e008cd.woff2": require("../../../../packages/shared/src/note-image-assets/song/26e008cd.woff2"), + "song/bc7cfa5c.woff2": require("../../../../packages/shared/src/note-image-assets/song/bc7cfa5c.woff2"), + "song/3573d10a.woff2": require("../../../../packages/shared/src/note-image-assets/song/3573d10a.woff2"), + "song/02ee1677.woff2": require("../../../../packages/shared/src/note-image-assets/song/02ee1677.woff2"), + "song/bb0a13c3.woff2": require("../../../../packages/shared/src/note-image-assets/song/bb0a13c3.woff2"), + "song/96c7a439.woff2": require("../../../../packages/shared/src/note-image-assets/song/96c7a439.woff2"), + "song/16680299.woff2": require("../../../../packages/shared/src/note-image-assets/song/16680299.woff2"), + "song/62b5cc7e.woff2": require("../../../../packages/shared/src/note-image-assets/song/62b5cc7e.woff2"), + "song/67621f47.woff2": require("../../../../packages/shared/src/note-image-assets/song/67621f47.woff2"), + "song/9e217aaa.woff2": require("../../../../packages/shared/src/note-image-assets/song/9e217aaa.woff2"), + "song/a2d2ee87.woff2": require("../../../../packages/shared/src/note-image-assets/song/a2d2ee87.woff2"), + "song/0102836d.woff2": require("../../../../packages/shared/src/note-image-assets/song/0102836d.woff2"), + "song/56f1aec8.woff2": require("../../../../packages/shared/src/note-image-assets/song/56f1aec8.woff2"), + "song/7ce74f0c.woff2": require("../../../../packages/shared/src/note-image-assets/song/7ce74f0c.woff2"), + "song/301b7546.woff2": require("../../../../packages/shared/src/note-image-assets/song/301b7546.woff2"), + "song/387e99e8.woff2": require("../../../../packages/shared/src/note-image-assets/song/387e99e8.woff2"), + "song/c2062f2d.woff2": require("../../../../packages/shared/src/note-image-assets/song/c2062f2d.woff2"), + "song/f68c886a.woff2": require("../../../../packages/shared/src/note-image-assets/song/f68c886a.woff2"), + "song/d6b5c292.woff2": require("../../../../packages/shared/src/note-image-assets/song/d6b5c292.woff2"), + "song/e378c475.woff2": require("../../../../packages/shared/src/note-image-assets/song/e378c475.woff2"), + "song/f2e6ea1a.woff2": require("../../../../packages/shared/src/note-image-assets/song/f2e6ea1a.woff2"), + "song/6dd16229.woff2": require("../../../../packages/shared/src/note-image-assets/song/6dd16229.woff2"), + "song/20740682.woff2": require("../../../../packages/shared/src/note-image-assets/song/20740682.woff2"), + "song/bf4f0cec.woff2": require("../../../../packages/shared/src/note-image-assets/song/bf4f0cec.woff2"), + "song/19d3f828.woff2": require("../../../../packages/shared/src/note-image-assets/song/19d3f828.woff2"), + "song/689dad6f.woff2": require("../../../../packages/shared/src/note-image-assets/song/689dad6f.woff2"), + "song/584f6234.woff2": require("../../../../packages/shared/src/note-image-assets/song/584f6234.woff2"), + "song/17d9b0c9.woff2": require("../../../../packages/shared/src/note-image-assets/song/17d9b0c9.woff2"), + "song/8c02979a.woff2": require("../../../../packages/shared/src/note-image-assets/song/8c02979a.woff2"), + "song/5201e37a.woff2": require("../../../../packages/shared/src/note-image-assets/song/5201e37a.woff2"), + "mincho/830e4d9e.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/830e4d9e.woff2"), + "mincho/d6820235.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/d6820235.woff2"), + "mincho/5513e1aa.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/5513e1aa.woff2"), + "mincho/48b63d0d.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/48b63d0d.woff2"), + "mincho/7f8eb8b4.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/7f8eb8b4.woff2"), + "mincho/23249574.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/23249574.woff2"), + "mincho/e0d8cfc8.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/e0d8cfc8.woff2"), + "mincho/c27f9909.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/c27f9909.woff2"), + "mincho/a703591d.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/a703591d.woff2"), + "mincho/42ec73d1.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/42ec73d1.woff2"), + "mincho/3a4b22f4.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/3a4b22f4.woff2"), + "mincho/020fd7d8.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/020fd7d8.woff2"), + "mincho/4ccb7939.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/4ccb7939.woff2"), + "mincho/f8002d41.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/f8002d41.woff2"), + "mincho/88c36a6e.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/88c36a6e.woff2"), + "mincho/62a95b91.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/62a95b91.woff2"), + "mincho/337f2131.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/337f2131.woff2"), + "mincho/bbc24ab8.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/bbc24ab8.woff2"), + "mincho/90e67073.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/90e67073.woff2"), + "mincho/6501caba.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/6501caba.woff2"), + "mincho/b2523abb.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/b2523abb.woff2"), + "mincho/182f21d5.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/182f21d5.woff2"), + "mincho/a9b5b5a2.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/a9b5b5a2.woff2"), + "mincho/920f4cca.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/920f4cca.woff2"), + "mincho/c754c613.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/c754c613.woff2"), + "mincho/5a4bccb9.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/5a4bccb9.woff2"), + "mincho/624f240b.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/624f240b.woff2"), + "mincho/c0a40189.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/c0a40189.woff2"), + "mincho/5d23163e.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/5d23163e.woff2"), + "mincho/ed0f0b3c.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/ed0f0b3c.woff2"), + "mincho/ecf8047c.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/ecf8047c.woff2"), + "mincho/6a1f04cc.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/6a1f04cc.woff2"), + "mincho/5a608b11.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/5a608b11.woff2"), + "mincho/ed0f25c7.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/ed0f25c7.woff2"), + "mincho/73fa0c45.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/73fa0c45.woff2"), + "mincho/3c472988.woff2": require("../../../../packages/shared/src/note-image-assets/mincho/3c472988.woff2"), + "longcang/c43d20a2.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/c43d20a2.woff2"), + "longcang/ca658d72.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/ca658d72.woff2"), + "longcang/c6e97809.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/c6e97809.woff2"), + "longcang/6492a981.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/6492a981.woff2"), + "longcang/ba987875.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/ba987875.woff2"), + "longcang/5edc68fa.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/5edc68fa.woff2"), + "longcang/462ccc04.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/462ccc04.woff2"), + "longcang/a78d6046.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/a78d6046.woff2"), + "longcang/550528c8.woff2": require("../../../../packages/shared/src/note-image-assets/longcang/550528c8.woff2"), + "paper.png": require("../../../../packages/shared/src/note-image-assets/paper.png"), + "paper-text.png": require("../../../../packages/shared/src/note-image-assets/paper-text.png"), +}; diff --git a/apps/mobile/src/hooks/useMobileNoteImagePreferences.ts b/apps/mobile/src/hooks/useMobileNoteImagePreferences.ts new file mode 100644 index 00000000..8876dd2b --- /dev/null +++ b/apps/mobile/src/hooks/useMobileNoteImagePreferences.ts @@ -0,0 +1,16 @@ +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { useEffect, useSyncExternalStore } from "react"; +import { DEFAULT_NOTE_IMAGE_PREFERENCES } from "@edgeever/shared/note-image-preferences"; +import { createMobileNoteImagePreferenceStore } from "../lib/note-image-preferences"; + +const store = createMobileNoteImagePreferenceStore(AsyncStorage); + +export const useMobileNoteImagePreferences = () => { + const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot); + useEffect(() => { void store.load(); }, []); + return { + preferences: snapshot ?? DEFAULT_NOTE_IMAGE_PREFERENCES, + ready: snapshot !== undefined, + setPreference: store.update, + }; +}; diff --git a/apps/mobile/src/lib/note-image-preferences.test.mjs b/apps/mobile/src/lib/note-image-preferences.test.mjs new file mode 100644 index 00000000..553690be --- /dev/null +++ b/apps/mobile/src/lib/note-image-preferences.test.mjs @@ -0,0 +1,92 @@ +import { expect, test } from 'bun:test'; +import { createMobileNoteImagePreferenceStore } from './note-image-preferences'; +import { DEFAULT_NOTE_IMAGE_PREFERENCES } from '@edgeever/shared/note-image-preferences'; + +const changed = { + ...DEFAULT_NOTE_IMAGE_PREFERENCES, theme: 'book', fontStyle: 'serif', fontSize: 'md', + cardWidth: 'compact', format: 'jpeg', showTitle: false, showNotebook: true, + showTags: true, showUpdatedAt: false, showBranding: false, +}; + +test('all mobile share choices survive switching views and a fresh store after restart', async () => { + let raw = null; + const storage = { getItem: async () => raw, setItem: async (_key, value) => { raw = value; } }; + const first = createMobileNoteImagePreferenceStore(storage); + await first.load(); + let notified = 0; + const unsubscribe = first.subscribe(() => notified++); + for (const [key, value] of Object.entries(changed)) first.update(key, value); + await first.flush(); + expect(first.getSnapshot()).toEqual(changed); + expect(notified).toBe(Object.keys(changed).length); + unsubscribe(); + const restarted = createMobileNoteImagePreferenceStore(storage); + await restarted.load(); + expect(restarted.getSnapshot()).toEqual(changed); + for (const [key, value] of Object.entries(DEFAULT_NOTE_IMAGE_PREFERENCES)) restarted.update(key, value); + await restarted.flush(); + const again = createMobileNoteImagePreferenceStore(storage); + await again.load(); + expect(again.getSnapshot()).toEqual(DEFAULT_NOTE_IMAGE_PREFERENCES); +}); + +test('slow startup reads never write defaults over saved choices', async () => { + let finishRead; + let writes = 0; + const store = createMobileNoteImagePreferenceStore({ + getItem: () => new Promise(resolve => { finishRead = resolve; }), + setItem: async () => { writes++; }, + }); + const loading = store.load(); + expect(store.getSnapshot()).toBeUndefined(); + expect(store.load()).toBe(loading); + store.update('theme', 'gradient'); + finishRead(JSON.stringify(changed)); + await loading; + expect(store.getSnapshot()).toEqual(changed); + expect(writes).toBe(0); +}); + +test('slow writes are serialized and the last change wins on restart', async () => { + let raw = null; + let release; + const writes = []; + const storage = { + getItem: async () => raw, + setItem: async (_key, value) => { + writes.push(JSON.parse(value).theme); + if (writes.length === 1) await new Promise(resolve => { release = resolve; }); + raw = value; + }, + }; + const store = createMobileNoteImagePreferenceStore(storage); + await store.load(); + store.update('theme', 'book'); + store.update('theme', 'code'); + await Promise.resolve(); + expect(writes).toEqual(['book']); + release(); + await store.flush(); + expect(writes).toEqual(['book', 'code']); + const restarted = createMobileNoteImagePreferenceStore(storage); + await restarted.load(); + expect(restarted.getSnapshot().theme).toBe('code'); +}); + +test('corrupt fields are isolated and rejected writes keep session choices usable', async () => { + const store = createMobileNoteImagePreferenceStore({ + getItem: async () => JSON.stringify({ ...changed, theme: 'removed', fontSize: 123, showTitle: 'true' }), + setItem: async () => { throw new Error('Storage unavailable'); }, + }); + await store.load(); + expect(store.getSnapshot()).toEqual({ ...changed, theme: 'gradient', fontSize: 'lg', showTitle: true }); + store.update('showTitle', false); + store.update('theme', 'code'); + await store.flush(); + expect(store.getSnapshot()).toMatchObject({ showTitle: false, theme: 'code' }); + const unavailable = createMobileNoteImagePreferenceStore({ + getItem: async () => { throw new Error('Storage unavailable'); }, setItem: async () => {}, + }); + await unavailable.load(); + expect(unavailable.getSnapshot()).toEqual(DEFAULT_NOTE_IMAGE_PREFERENCES); +}); diff --git a/apps/mobile/src/lib/note-image-preferences.ts b/apps/mobile/src/lib/note-image-preferences.ts new file mode 100644 index 00000000..0893cf6a --- /dev/null +++ b/apps/mobile/src/lib/note-image-preferences.ts @@ -0,0 +1,46 @@ +import { + DEFAULT_NOTE_IMAGE_PREFERENCES, + parseNoteImagePreferences, + type NoteImagePreferences, +} from "@edgeever/shared/note-image-preferences"; + +export const MOBILE_NOTE_IMAGE_PREFERENCES_KEY = "edgeever.mobile.noteImagePreferences"; + +type PreferenceStorage = { + getItem: (key: string) => Promise; + setItem: (key: string, value: string) => Promise; +}; + +export const createMobileNoteImagePreferenceStore = (storage: PreferenceStorage) => { + let snapshot: NoteImagePreferences | undefined; + let loading: Promise | undefined; + let writing: Promise = Promise.resolve(); + const listeners = new Set<() => void>(); + const notify = () => listeners.forEach(listener => listener()); + return { + getSnapshot: () => snapshot, + subscribe: (listener: () => void) => { + listeners.add(listener); + return () => { listeners.delete(listener); }; + }, + load: () => loading ??= (async () => { + try { + snapshot = parseNoteImagePreferences(await storage.getItem(MOBILE_NOTE_IMAGE_PREFERENCES_KEY)); + } catch { + snapshot = { ...DEFAULT_NOTE_IMAGE_PREFERENCES }; + } + notify(); + })(), + update: (key: K, value: NoteImagePreferences[K]) => { + // The sheet stays in its loading state until hydration finishes. + if (!snapshot) return; + snapshot = { ...snapshot, [key]: value }; + const raw = JSON.stringify(snapshot); + notify(); + // Serialize writes so a slow earlier write cannot replace the latest choice. + // Keep the in-memory snapshot if persistence fails for this session. + writing = writing.then(() => storage.setItem(MOBILE_NOTE_IMAGE_PREFERENCES_KEY, raw)).catch(() => undefined); + }, + flush: () => writing, + }; +}; diff --git a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx index e7fd9ecf..ab83a950 100644 --- a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx +++ b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx @@ -2,6 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } fro import { DEFAULT_MEMO_TITLE, parseDiagramDocument, type MemoDetail, type Notebook, type TiptapDoc } from "@edgeever/shared"; import { NOTE_IMAGE_THEMES, + NOTE_IMAGE_THEME_OPTIONS, + NOTE_IMAGE_BACKGROUND_COLORS, type NoteImageTheme, type NoteImageFontStyle, type NoteImageFontSize, @@ -40,6 +42,7 @@ import { loadProtectedResourceDataUrl, type ProtectedResourceLoadFailure, } from "../lib/mobile-protected-resources"; +import { useMobileNoteImagePreferences } from "../hooks/useMobileNoteImagePreferences"; import { useMobileRichEditor, type MobileMemoUpdateMutation } from "../hooks/useMobileRichEditor"; import type { MobileMemoDraft } from "../lib/mobile-drafts"; import { createMobileDataScope } from "../lib/local-mirror"; @@ -213,21 +216,22 @@ const loadAuthenticatedSvg = (source: AuthenticatedImageSource) => { return pending; }; -const MOBILE_THEME_OPTIONS: Array<{ - id: NoteImageTheme; - labelZh: string; - labelEn: string; - previewBg: string; -}> = [ - { id: "paper", labelZh: "纸间便签", labelEn: "Paper Memo", previewBg: "#fbf9f4" }, - { id: "press", labelZh: "人文报刊", labelEn: "Press Journal", previewBg: "#f7f7f5" }, - { id: "highlight", labelZh: "社交高光", labelEn: "Highlight", previewBg: "#fefce8" }, - { id: "slate", labelZh: "纯白", labelEn: "Pure White", previewBg: "#ffffff" }, - { id: "mint", labelZh: "薄荷", labelEn: "Mint", previewBg: "#ecfdf5" }, - { id: "aurora", labelZh: "极光渐变", labelEn: "Aurora", previewBg: "#a7f3d0" }, - { id: "sunset", labelZh: "暮色晚霞", labelEn: "Sunset", previewBg: "#fde68a" }, - { id: "terminal", labelZh: "极客终端", labelEn: "Terminal", previewBg: "#0d1117" }, -]; +const MOBILE_THEME_LABELS = { + "gradient": { labelZh: "默认", labelEn: "Classic" }, + "glass": { labelZh: "透明", labelEn: "Glass" }, + "quote": { labelZh: "金句", labelEn: "Quote" }, + "book": { labelZh: "书摘", labelEn: "Book excerpt" }, + "memo": { labelZh: "备忘录", labelEn: "Memo" }, + "bento": { labelZh: "便当", labelEn: "Bento" }, + "black-sun": { labelZh: "黑日", labelEn: "Black Sun" }, + "frame": { labelZh: "框界", labelEn: "Frame" }, + "handwritten": { labelZh: "手写", labelEn: "Handwritten" }, + "code": { labelZh: "代码", labelEn: "Code" }, +}; + +const MOBILE_THEME_OPTIONS = NOTE_IMAGE_THEME_OPTIONS.map((id) => ({ + id, ...MOBILE_THEME_LABELS[id], previewBg: NOTE_IMAGE_BACKGROUND_COLORS[id], +})); const MOBILE_FONT_OPTIONS: Array<{ id: NoteImageFontStyle; labelZh: string; labelEn: string }> = [ { id: "auto", labelZh: "跟随主题", labelEn: "Follow Theme" }, @@ -520,16 +524,13 @@ export const MemoDetailModal = ({ const [isExportingImage, setIsExportingImage] = useState(false); const [imageExportStage, setImageExportStage] = useState<"prepare" | "render" | "transfer">("prepare"); const [imageShareOptionsOpen, setImageShareOptionsOpen] = useState(false); - const [imageShareFormat, setImageShareFormat] = useState<"jpeg" | "png">("png"); - const [imageShareTheme, setImageShareTheme] = useState("paper"); - const [imageShareFontStyle, setImageShareFontStyle] = useState("auto"); - const [imageShareFontSize, setImageShareFontSize] = useState("lg"); - const [imageShareCardWidth, setImageShareCardWidth] = useState("wide"); - const [imageShareTitle, setImageShareTitle] = useState(false); - const [imageShareNotebook, setImageShareNotebook] = useState(false); - const [imageShareTags, setImageShareTags] = useState(false); - const [imageShareUpdatedAt, setImageShareUpdatedAt] = useState(true); - const [imageShareBranding, setImageShareBranding] = useState(true); + const { preferences: imageSharePreferences, ready: imageSharePreferencesReady, setPreference: setImageSharePreference } = useMobileNoteImagePreferences(); + const { + format: imageShareFormat, theme: imageShareTheme, fontStyle: imageShareFontStyle, + fontSize: imageShareFontSize, cardWidth: imageShareCardWidth, showTitle: imageShareTitle, + showNotebook: imageShareNotebook, showTags: imageShareTags, showUpdatedAt: imageShareUpdatedAt, + showBranding: imageShareBranding, + } = imageSharePreferences; const [viewerNotebookPickerOpen, setViewerNotebookPickerOpen] = useState(false); const [viewerTagsOpen, setViewerTagsOpen] = useState(false); const [viewerTags, setViewerTags] = useState([]); @@ -1528,7 +1529,7 @@ export const MemoDetailModal = ({ onPress={() => closeActionsAndRun(() => void copyMemoId())} /> : } label={isExportingImage ? (resolvedLocale !== "zh-CN" ? "Generating share image" : "正在生成分享图片") @@ -1536,13 +1537,13 @@ export const MemoDetailModal = ({ onPress={() => closeActionsAndRun(() => setImageShareOptionsOpen(true))} /> } label={resolvedLocale !== "zh-CN" ? "Advanced export PNG" : "高级导出 PNG"} onPress={() => closeActionsAndRun(() => exportMemoImage("png"))} /> } label={resolvedLocale !== "zh-CN" ? "Advanced export JPEG" : "高级导出 JPEG"} onPress={() => closeActionsAndRun(() => exportMemoImage("jpeg"))} @@ -1629,6 +1630,7 @@ export const MemoDetailModal = ({ {resolvedLocale !== "zh-CN" ? "Share as image" : "分享为图片"} + {imageSharePreferencesReady ? <> {resolvedLocale !== "zh-CN" ? "Theme" : "主题风格"} {MOBILE_THEME_OPTIONS.map((item) => { @@ -1639,7 +1641,7 @@ export const MemoDetailModal = ({ key={item.id} accessibilityRole="button" accessibilityState={{ selected: isSelected }} - onPress={() => setImageShareTheme(item.id)} + onPress={() => setImageSharePreference("theme", item.id)} style={[ imageShareStyles.themeCard, { backgroundColor: item.previewBg }, @@ -1651,7 +1653,7 @@ export const MemoDetailModal = ({ - + {label} @@ -1666,7 +1668,7 @@ export const MemoDetailModal = ({ ["md", resolvedLocale !== "zh-CN" ? "Standard" : "标准"], ["lg", resolvedLocale !== "zh-CN" ? "Comfortable" : "舒适"], ] as const).map(([value, label]) => ( - setImageShareFontSize(value)} style={[imageShareStyles.choice, imageShareFontSize === value && imageShareStyles.choiceActive]}> + setImageSharePreference("fontSize", value)} style={[imageShareStyles.choice, imageShareFontSize === value && imageShareStyles.choiceActive]}> {label} ))} @@ -1679,7 +1681,7 @@ export const MemoDetailModal = ({ ["standard", resolvedLocale !== "zh-CN" ? "Standard" : "标准"], ["wide", resolvedLocale !== "zh-CN" ? "Wide" : "宽屏"], ] as const).map(([value, label]) => ( - setImageShareCardWidth(value)} style={[imageShareStyles.choice, imageShareCardWidth === value && imageShareStyles.choiceActive]}> + setImageSharePreference("cardWidth", value)} style={[imageShareStyles.choice, imageShareCardWidth === value && imageShareStyles.choiceActive]}> {label} ))} @@ -1694,7 +1696,7 @@ export const MemoDetailModal = ({ setImageShareFontStyle(item.id)} + onPress={() => setImageSharePreference("fontStyle", item.id)} style={[ imageShareStyles.choice, isSelected && imageShareStyles.choiceActive, @@ -1708,13 +1710,13 @@ export const MemoDetailModal = ({ {resolvedLocale !== "zh-CN" ? "Content Elements" : "显示内容"} {([ - [resolvedLocale !== "zh-CN" ? "Title" : "笔记标题", imageShareTitle, setImageShareTitle], - [resolvedLocale !== "zh-CN" ? "Notebook" : "笔记本", imageShareNotebook, setImageShareNotebook], - [resolvedLocale !== "zh-CN" ? "Tags" : "标签", imageShareTags, setImageShareTags], - [resolvedLocale !== "zh-CN" ? "Updated time" : "更新时间", imageShareUpdatedAt, setImageShareUpdatedAt], - [resolvedLocale !== "zh-CN" ? "EdgeEver branding" : "EdgeEver 品牌标识", imageShareBranding, setImageShareBranding], - ] as const).map(([label, selected, setSelected]) => ( - setSelected(!selected)} style={imageShareStyles.optionRow}> + [resolvedLocale !== "zh-CN" ? "Title" : "笔记标题", imageShareTitle, "showTitle"], + [resolvedLocale !== "zh-CN" ? "Notebook" : "笔记本", imageShareNotebook, "showNotebook"], + [resolvedLocale !== "zh-CN" ? "Tags" : "标签", imageShareTags, "showTags"], + [resolvedLocale !== "zh-CN" ? "Updated time" : "更新时间", imageShareUpdatedAt, "showUpdatedAt"], + [resolvedLocale !== "zh-CN" ? "EdgeEver branding" : "EdgeEver 品牌标识", imageShareBranding, "showBranding"], + ] as const).map(([label, selected, preferenceKey]) => ( + setImageSharePreference(preferenceKey, !selected)} style={imageShareStyles.optionRow}> {label} {selected ? "✓" : ""} @@ -1723,7 +1725,7 @@ export const MemoDetailModal = ({ {resolvedLocale !== "zh-CN" ? "Format" : "格式"} {(["png", "jpeg"] as const).map((value) => ( - setImageShareFormat(value)} style={[imageShareStyles.formatChoice, imageShareFormat === value && imageShareStyles.choiceActive]}> + setImageSharePreference("format", value)} style={[imageShareStyles.formatChoice, imageShareFormat === value && imageShareStyles.choiceActive]}> {value === "png" ? (resolvedLocale !== "zh-CN" ? "PNG · Crisp text" : "PNG · 超清无损") @@ -1732,11 +1734,12 @@ export const MemoDetailModal = ({ ))} + : } { exportMemoImage(imageShareFormat, { theme: imageShareTheme, @@ -1751,7 +1754,7 @@ export const MemoDetailModal = ({ intent: "preview", }); }} - style={[imageShareStyles.shareButton, (isExportingImage || !viewerReady) && styles.buttonDisabled]} + style={[imageShareStyles.shareButton, (isExportingImage || !viewerReady || !imageSharePreferencesReady) && styles.buttonDisabled]} > {isExportingImage ? : } diff --git a/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx b/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx index eeac6d1a..e1edac17 100644 --- a/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx +++ b/apps/web/src/components/dialogs/ShareNoteImageDialog.tsx @@ -1,3 +1,5 @@ +import { prepareNoteImageAssets } from "@edgeever/shared/note-image-fonts"; +import { noteImageAssetUrls } from "@edgeever/shared/note-image-assets"; import { Check, Copy, Download, LoaderCircle, Palette, Share2, Type } from "lucide-react"; import { useEffect, useMemo, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -21,12 +23,12 @@ import { type NoteImageCardWidth, type NoteImageFontSize, type NoteImageFontStyle, - type NoteImageFormat, type NoteImageTheme, type PreparedNoteImage, } from "@/lib/note-image-export"; -import { NOTE_IMAGE_THEME_OPTIONS, NOTE_IMAGE_THEMES, resolveNoteImageTypography } from "@edgeever/shared/note-image-card"; +import { NOTE_IMAGE_THEME_OPTIONS, NOTE_IMAGE_TEMPLATE_FONT_FAMILIES, resolveTheme, buildNoteImageCardMarkup, escapeCardHtml, generateCardCss } from "@edgeever/shared/note-image-card"; import { getHtmlImageEmbedNoticeKind } from "@/lib/note-html-export"; +import { readNoteImagePreferences, writeNoteImagePreferences, type NoteImagePreferences } from "@/lib/note-image-preference"; import { cn } from "@/lib/utils"; export type ShareNoteImageSource = Omit; @@ -51,6 +53,63 @@ const WIDTH_OPTIONS: Array<{ id: NoteImageCardWidth; labelKey: string }> = [ { id: "wide", labelKey: "editor.imageShare.cardWidths.wide" }, ]; +/** Use the export renderer itself so thumbnails show each theme's actual layout. */ +const NoteImageThemePreview = ({ + theme, fontStyle, title, body, quote, +}: { + theme: NoteImageTheme; + fontStyle: NoteImageFontStyle; + title: string; + body: string; + quote: string; +}) => { + const containerRef = useRef(null); + const [scale, setScale] = useState(0.24); + const [assetCss, setAssetCss] = useState(""); + useEffect(() => { + let active = true; + setAssetCss(""); + void prepareNoteImageAssets({ theme, fontStyle, text: `${title} ${body} ${quote}`, urls: noteImageAssetUrls }) + .then(assets => { if (active) setAssetCss(assets.css); }) + .catch(() => { /* The full preview reports asset loading errors and offers retry. */ }); + return () => { active = false; }; + }, [theme, fontStyle, title, body, quote]); + useEffect(() => { + const container = containerRef.current; + if (!container) return; + const observer = new ResizeObserver(([entry]) => { + if (entry) setScale(entry.contentRect.width / NOTE_IMAGE_CARD_WIDTH_PIXELS.compact); + }); + observer.observe(container); + return () => observer.disconnect(); + }, []); + const document = useMemo(() => `${buildNoteImageCardMarkup({ + theme, + title, + bodyHtml: `

    ${escapeCardHtml(body)}

    ${escapeCardHtml(quote)}

    `, + showTitle: true, + showUpdatedAt: false, + showBranding: false, + })}`, [theme, fontStyle, title, body, quote, assetCss]); + return ( +