<!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>P2616R4: Making std::atomic notification/wait operations usable in more situations</title>
        <style>
/* From extension vscode.github */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

.vscode-dark img[src$=\#gh-light-mode-only],
.vscode-light img[src$=\#gh-dark-mode-only] {
	display: none;
}

/* From extension bierner.markdown-checkbox */
.contains-task-list {
    padding-left: 0;
}

.contains-task-list li {
    margin-left: 24px;
}

.contains-task-list .task-list-item {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.contains-task-list .contains-task-list {
    padding-left: 20px;
} 
/* From extension bierner.markdown-preview-github-styles */
html,
body,
.github-markdown-body {
    padding: 0 !important;
    max-width: auto !important;
}

.github-markdown-body {
    background-color: var(--color-canvas-default);
    color: var(--color-fg-default);
}

.github-markdown-body {
    border: 1px solid transparent;
    box-sizing: border-box;
    margin: 0 auto;
    width: 100% !important;
}

.github-markdown-content {
    padding: 32px !important;
    max-width: 980px;
    min-width: 200px;
    margin: 0 auto;
}


.vscode-body.scrollBeyondLastLine {
    margin-bottom: 0;
}
.vscode-body.scrollBeyondLastLine .github-markdown-body {
    padding-bottom: calc(100vh + 10px) !important;
}

.github-markdown-body blockquote {
    background-color: initial;
}

.github-markdown-body pre {
    color: initial;
}

.github-markdown-body code {
    color: inherit;
}

.github-markdown-body pre code {
    color: initial;
}

.github-markdown-body code > div {
    background: none
}

.github-markdown-body.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.github-markdown-body p,
.github-markdown-body blockquote,
.github-markdown-body ul,
.github-markdown-body ol,
.github-markdown-body dl,
.github-markdown-body table,
.github-markdown-body pre {
  margin-top: 16px;
  margin-bottom: 16px;
}

/* Generated from 'node_modules/github-markdown-css/github-markdown.css' */

.github-markdown-light,
.vscode-body.vscode-light .github-markdown-auto {
  color-scheme: light;
  --color-prettylights-syntax-comment: #6e7781;
  --color-prettylights-syntax-constant: #0550ae;
  --color-prettylights-syntax-entity: #8250df;
  --color-prettylights-syntax-storage-modifier-import: #24292f;
  --color-prettylights-syntax-entity-tag: #116329;
  --color-prettylights-syntax-keyword: #cf222e;
  --color-prettylights-syntax-string: #0a3069;
  --color-prettylights-syntax-variable: #953800;
  --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
  --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
  --color-prettylights-syntax-invalid-illegal-bg: #82071e;
  --color-prettylights-syntax-carriage-return-text: #f6f8fa;
  --color-prettylights-syntax-carriage-return-bg: #cf222e;
  --color-prettylights-syntax-string-regexp: #116329;
  --color-prettylights-syntax-markup-list: #3b2300;
  --color-prettylights-syntax-markup-heading: #0550ae;
  --color-prettylights-syntax-markup-italic: #24292f;
  --color-prettylights-syntax-markup-bold: #24292f;
  --color-prettylights-syntax-markup-deleted-text: #82071e;
  --color-prettylights-syntax-markup-deleted-bg: #FFEBE9;
  --color-prettylights-syntax-markup-inserted-text: #116329;
  --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
  --color-prettylights-syntax-markup-changed-text: #953800;
  --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
  --color-prettylights-syntax-markup-ignored-text: #eaeef2;
  --color-prettylights-syntax-markup-ignored-bg: #0550ae;
  --color-prettylights-syntax-meta-diff-range: #8250df;
  --color-prettylights-syntax-brackethighlighter-angle: #57606a;
  --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
  --color-prettylights-syntax-constant-other-reference-link: #0a3069;
  --color-fg-default: #24292f;
  --color-fg-muted: #57606a;
  --color-fg-subtle: #6e7781;
  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f6f8fa;
  --color-border-default: #d0d7de;
  --color-border-muted: hsla(210,18%,87%,1);
  --color-neutral-muted: rgba(175,184,193,0.2);
  --color-accent-fg: #0969da;
  --color-accent-emphasis: #0969da;
  --color-danger-fg: #cf222e;
}

.github-markdown-dark,
.vscode-body.vscode-dark .github-markdown-auto {
  color-scheme: dark;
  --color-prettylights-syntax-comment: #8b949e;
  --color-prettylights-syntax-constant: #79c0ff;
  --color-prettylights-syntax-entity: #d2a8ff;
  --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
  --color-prettylights-syntax-entity-tag: #7ee787;
  --color-prettylights-syntax-keyword: #ff7b72;
  --color-prettylights-syntax-string: #a5d6ff;
  --color-prettylights-syntax-variable: #ffa657;
  --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
  --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
  --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
  --color-prettylights-syntax-carriage-return-text: #f0f6fc;
  --color-prettylights-syntax-carriage-return-bg: #b62324;
  --color-prettylights-syntax-string-regexp: #7ee787;
  --color-prettylights-syntax-markup-list: #f2cc60;
  --color-prettylights-syntax-markup-heading: #1f6feb;
  --color-prettylights-syntax-markup-italic: #c9d1d9;
  --color-prettylights-syntax-markup-bold: #c9d1d9;
  --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
  --color-prettylights-syntax-markup-deleted-bg: #67060c;
  --color-prettylights-syntax-markup-inserted-text: #aff5b4;
  --color-prettylights-syntax-markup-inserted-bg: #033a16;
  --color-prettylights-syntax-markup-changed-text: #ffdfb6;
  --color-prettylights-syntax-markup-changed-bg: #5a1e02;
  --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
  --color-prettylights-syntax-markup-ignored-bg: #1158c7;
  --color-prettylights-syntax-meta-diff-range: #d2a8ff;
  --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
  --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
  --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
  --color-fg-default: #c9d1d9;
  --color-fg-muted: #8b949e;
  --color-fg-subtle: #484f58;
  --color-canvas-default: #0d1117;
  --color-canvas-subtle: #161b22;
  --color-border-default: #30363d;
  --color-border-muted: #21262d;
  --color-neutral-muted: rgba(110,118,129,0.4);
  --color-accent-fg: #58a6ff;
  --color-accent-emphasis: #1f6feb;
  --color-danger-fg: #f85149;
}

@media (prefers-color-scheme: dark) {
  .github-markdown-system {
    color-scheme: dark;
    --color-prettylights-syntax-comment: #8b949e;
    --color-prettylights-syntax-constant: #79c0ff;
    --color-prettylights-syntax-entity: #d2a8ff;
    --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
    --color-prettylights-syntax-entity-tag: #7ee787;
    --color-prettylights-syntax-keyword: #ff7b72;
    --color-prettylights-syntax-string: #a5d6ff;
    --color-prettylights-syntax-variable: #ffa657;
    --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
    --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
    --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
    --color-prettylights-syntax-carriage-return-text: #f0f6fc;
    --color-prettylights-syntax-carriage-return-bg: #b62324;
    --color-prettylights-syntax-string-regexp: #7ee787;
    --color-prettylights-syntax-markup-list: #f2cc60;
    --color-prettylights-syntax-markup-heading: #1f6feb;
    --color-prettylights-syntax-markup-italic: #c9d1d9;
    --color-prettylights-syntax-markup-bold: #c9d1d9;
    --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
    --color-prettylights-syntax-markup-deleted-bg: #67060c;
    --color-prettylights-syntax-markup-inserted-text: #aff5b4;
    --color-prettylights-syntax-markup-inserted-bg: #033a16;
    --color-prettylights-syntax-markup-changed-text: #ffdfb6;
    --color-prettylights-syntax-markup-changed-bg: #5a1e02;
    --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
    --color-prettylights-syntax-markup-ignored-bg: #1158c7;
    --color-prettylights-syntax-meta-diff-range: #d2a8ff;
    --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
    --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
    --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
    --color-fg-default: #c9d1d9;
    --color-fg-muted: #8b949e;
    --color-fg-subtle: #484f58;
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #161b22;
    --color-border-default: #30363d;
    --color-border-muted: #21262d;
    --color-neutral-muted: rgba(110,118,129,0.4);
    --color-accent-fg: #58a6ff;
    --color-accent-emphasis: #1f6feb;
    --color-danger-fg: #f85149;
  }
}

@media (prefers-color-scheme: light) {
  .github-markdown-system {
    color-scheme: light;
    --color-prettylights-syntax-comment: #6e7781;
    --color-prettylights-syntax-constant: #0550ae;
    --color-prettylights-syntax-entity: #8250df;
    --color-prettylights-syntax-storage-modifier-import: #24292f;
    --color-prettylights-syntax-entity-tag: #116329;
    --color-prettylights-syntax-keyword: #cf222e;
    --color-prettylights-syntax-string: #0a3069;
    --color-prettylights-syntax-variable: #953800;
    --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
    --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
    --color-prettylights-syntax-invalid-illegal-bg: #82071e;
    --color-prettylights-syntax-carriage-return-text: #f6f8fa;
    --color-prettylights-syntax-carriage-return-bg: #cf222e;
    --color-prettylights-syntax-string-regexp: #116329;
    --color-prettylights-syntax-markup-list: #3b2300;
    --color-prettylights-syntax-markup-heading: #0550ae;
    --color-prettylights-syntax-markup-italic: #24292f;
    --color-prettylights-syntax-markup-bold: #24292f;
    --color-prettylights-syntax-markup-deleted-text: #82071e;
    --color-prettylights-syntax-markup-deleted-bg: #FFEBE9;
    --color-prettylights-syntax-markup-inserted-text: #116329;
    --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
    --color-prettylights-syntax-markup-changed-text: #953800;
    --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
    --color-prettylights-syntax-markup-ignored-text: #eaeef2;
    --color-prettylights-syntax-markup-ignored-bg: #0550ae;
    --color-prettylights-syntax-meta-diff-range: #8250df;
    --color-prettylights-syntax-brackethighlighter-angle: #57606a;
    --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
    --color-prettylights-syntax-constant-other-reference-link: #0a3069;
    --color-fg-default: #24292f;
    --color-fg-muted: #57606a;
    --color-fg-subtle: #6e7781;
    --color-canvas-default: #ffffff;
    --color-canvas-subtle: #f6f8fa;
    --color-border-default: #d0d7de;
    --color-border-muted: hsla(210,18%,87%,1);
    --color-neutral-muted: rgba(175,184,193,0.2);
    --color-accent-fg: #0969da;
    --color-accent-emphasis: #0969da;
    --color-danger-fg: #cf222e;
  }
}

.github-markdown-body {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  color: var(--color-fg-default);
  background-color: var(--color-canvas-default);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.5;
  word-wrap: break-word;
}

.github-markdown-body .octicon {
  display: inline-block;
  fill: currentColor;
  vertical-align: text-bottom;
}

.github-markdown-body h1:hover .anchor .octicon-link:before,
.github-markdown-body h2:hover .anchor .octicon-link:before,
.github-markdown-body h3:hover .anchor .octicon-link:before,
.github-markdown-body h4:hover .anchor .octicon-link:before,
.github-markdown-body h5:hover .anchor .octicon-link:before,
.github-markdown-body h6:hover .anchor .octicon-link:before {
  width: 16px;
  height: 16px;
  content: ' ';
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
}

.github-markdown-body details,
.github-markdown-body figcaption,
.github-markdown-body figure {
  display: block;
}

.github-markdown-body summary {
  display: list-item;
}

.github-markdown-body a {
  background-color: transparent;
  color: var(--color-accent-fg);
  text-decoration: none;
}

.github-markdown-body a:active,
.github-markdown-body a:hover {
  outline-width: 0;
}

.github-markdown-body abbr[title] {
  border-bottom: none;
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

.github-markdown-body b,
.github-markdown-body strong {
  font-weight: 600;
}

.github-markdown-body dfn {
  font-style: italic;
}

.github-markdown-body h1 {
  margin: .67em 0;
  font-weight: 600;
  padding-bottom: .3em;
  font-size: 2em;
  border-bottom: 1px solid var(--color-border-muted);
}

.github-markdown-body mark {
  background-color: #ff0;
  color: var(--color-text-primary);
}

.github-markdown-body small {
  font-size: 90%;
}

.github-markdown-body sub,
.github-markdown-body sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.github-markdown-body sub {
  bottom: -0.25em;
}

.github-markdown-body sup {
  top: -0.5em;
}

.github-markdown-body img {
  border-style: none;
  max-width: 100%;
  box-sizing: content-box;
  background-color: var(--color-canvas-default);
}

.github-markdown-body code,
.github-markdown-body kbd,
.github-markdown-body pre,
.github-markdown-body samp {
  font-family: monospace,monospace;
  font-size: 1em;
}

.github-markdown-body figure {
  margin: 1em 40px;
}

.github-markdown-body hr {
  box-sizing: content-box;
  overflow: hidden;
  background: transparent;
  border-bottom: 1px solid var(--color-border-muted);
  height: .25em;
  padding: 0;
  margin: 24px 0;
  background-color: var(--color-border-default);
  border: 0;
}

.github-markdown-body html [type=button],
.github-markdown-body [type=reset],
.github-markdown-body [type=submit] {
  -webkit-appearance: button;
}

.github-markdown-body [type=button]::-moz-focus-inner,
.github-markdown-body [type=reset]::-moz-focus-inner,
.github-markdown-body [type=submit]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

.github-markdown-body [type=button]:-moz-focusring,
.github-markdown-body [type=reset]:-moz-focusring,
.github-markdown-body [type=submit]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

.github-markdown-body [type=checkbox],
.github-markdown-body [type=radio] {
  box-sizing: border-box;
  padding: 0;
}

.github-markdown-body [type=number]::-webkit-inner-spin-button,
.github-markdown-body [type=number]::-webkit-outer-spin-button {
  height: auto;
}

.github-markdown-body [type=search] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

.github-markdown-body [type=search]::-webkit-search-cancel-button,
.github-markdown-body [type=search]::-webkit-search-decoration {
  -webkit-appearance: none;
}

.github-markdown-body ::-webkit-input-placeholder {
  color: inherit;
  opacity: .54;
}

.github-markdown-body ::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

.github-markdown-body a:hover {
  text-decoration: underline;
}

.github-markdown-body hr::before {
  display: table;
  content: "";
}

.github-markdown-body hr::after {
  display: table;
  clear: both;
  content: "";
}

.github-markdown-body table {
  border-spacing: 0;
  border-collapse: collapse;
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
}

.github-markdown-body td,
.github-markdown-body th {
  padding: 0;
}

.github-markdown-body details summary {
  cursor: pointer;
}

.github-markdown-body details:not([open])>*:not(summary) {
  display: none !important;
}

.github-markdown-body kbd {
  display: inline-block;
  padding: 3px 5px;
  font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
  line-height: 10px;
  color: var(--color-fg-default);
  vertical-align: middle;
  background-color: var(--color-canvas-subtle);
  border: solid 1px var(--color-neutral-muted);
  border-bottom-color: var(--color-neutral-muted);
  border-radius: 6px;
  box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
}

.github-markdown-body h1,
.github-markdown-body h2,
.github-markdown-body h3,
.github-markdown-body h4,
.github-markdown-body h5,
.github-markdown-body h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.github-markdown-body h2 {
  font-weight: 600;
  padding-bottom: .3em;
  font-size: 1.5em;
  border-bottom: 1px solid var(--color-border-muted);
}

.github-markdown-body h3 {
  font-weight: 600;
  font-size: 1.25em;
}

.github-markdown-body h4 {
  font-weight: 600;
  font-size: 1em;
}

.github-markdown-body h5 {
  font-weight: 600;
  font-size: .875em;
}

.github-markdown-body h6 {
  font-weight: 600;
  font-size: .85em;
  color: var(--color-fg-muted);
}

.github-markdown-body p {
  margin-top: 0;
  margin-bottom: 10px;
}

.github-markdown-body blockquote {
  margin: 0;
  padding: 0 1em;
  color: var(--color-fg-muted);
  border-left: .25em solid var(--color-border-default);
}

.github-markdown-body ul,
.github-markdown-body ol {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 2em;
}

.github-markdown-body ol ol,
.github-markdown-body ul ol {
  list-style-type: lower-roman;
}

.github-markdown-body ul ul ol,
.github-markdown-body ul ol ol,
.github-markdown-body ol ul ol,
.github-markdown-body ol ol ol {
  list-style-type: lower-alpha;
}

.github-markdown-body dd {
  margin-left: 0;
}

.github-markdown-body tt,
.github-markdown-body code {
  font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
  font-size: 12px;
}

.github-markdown-body pre {
  margin-top: 0;
  margin-bottom: 0;
  font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
  font-size: 12px;
  word-wrap: normal;
}

.github-markdown-body :-ms-input-placeholder {
  color: var(--color-fg-subtle);
  opacity: 1;
}

.github-markdown-body ::-ms-input-placeholder {
  color: var(--color-fg-subtle);
  opacity: 1;
}

.github-markdown-body ::placeholder {
  color: var(--color-fg-subtle);
  opacity: 1;
}

.github-markdown-body .pl-c {
  color: var(--color-prettylights-syntax-comment);
}

.github-markdown-body .pl-c1,
.github-markdown-body .pl-s .pl-v {
  color: var(--color-prettylights-syntax-constant);
}

.github-markdown-body .pl-e,
.github-markdown-body .pl-en {
  color: var(--color-prettylights-syntax-entity);
}

.github-markdown-body .pl-smi,
.github-markdown-body .pl-s .pl-s1 {
  color: var(--color-prettylights-syntax-storage-modifier-import);
}

.github-markdown-body .pl-ent {
  color: var(--color-prettylights-syntax-entity-tag);
}

.github-markdown-body .pl-k {
  color: var(--color-prettylights-syntax-keyword);
}

.github-markdown-body .pl-s,
.github-markdown-body .pl-pds,
.github-markdown-body .pl-s .pl-pse .pl-s1,
.github-markdown-body .pl-sr,
.github-markdown-body .pl-sr .pl-cce,
.github-markdown-body .pl-sr .pl-sre,
.github-markdown-body .pl-sr .pl-sra {
  color: var(--color-prettylights-syntax-string);
}

.github-markdown-body .pl-v,
.github-markdown-body .pl-smw {
  color: var(--color-prettylights-syntax-variable);
}

.github-markdown-body .pl-bu {
  color: var(--color-prettylights-syntax-brackethighlighter-unmatched);
}

.github-markdown-body .pl-ii {
  color: var(--color-prettylights-syntax-invalid-illegal-text);
  background-color: var(--color-prettylights-syntax-invalid-illegal-bg);
}

.github-markdown-body .pl-c2 {
  color: var(--color-prettylights-syntax-carriage-return-text);
  background-color: var(--color-prettylights-syntax-carriage-return-bg);
}

.github-markdown-body .pl-sr .pl-cce {
  font-weight: bold;
  color: var(--color-prettylights-syntax-string-regexp);
}

.github-markdown-body .pl-ml {
  color: var(--color-prettylights-syntax-markup-list);
}

.github-markdown-body .pl-mh,
.github-markdown-body .pl-mh .pl-en,
.github-markdown-body .pl-ms {
  font-weight: bold;
  color: var(--color-prettylights-syntax-markup-heading);
}

.github-markdown-body .pl-mi {
  font-style: italic;
  color: var(--color-prettylights-syntax-markup-italic);
}

.github-markdown-body .pl-mb {
  font-weight: bold;
  color: var(--color-prettylights-syntax-markup-bold);
}

.github-markdown-body .pl-md {
  color: var(--color-prettylights-syntax-markup-deleted-text);
  background-color: var(--color-prettylights-syntax-markup-deleted-bg);
}

.github-markdown-body .pl-mi1 {
  color: var(--color-prettylights-syntax-markup-inserted-text);
  background-color: var(--color-prettylights-syntax-markup-inserted-bg);
}

.github-markdown-body .pl-mc {
  color: var(--color-prettylights-syntax-markup-changed-text);
  background-color: var(--color-prettylights-syntax-markup-changed-bg);
}

.github-markdown-body .pl-mi2 {
  color: var(--color-prettylights-syntax-markup-ignored-text);
  background-color: var(--color-prettylights-syntax-markup-ignored-bg);
}

.github-markdown-body .pl-mdr {
  font-weight: bold;
  color: var(--color-prettylights-syntax-meta-diff-range);
}

.github-markdown-body .pl-ba {
  color: var(--color-prettylights-syntax-brackethighlighter-angle);
}

.github-markdown-body .pl-sg {
  color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);
}

.github-markdown-body .pl-corl {
  text-decoration: underline;
  color: var(--color-prettylights-syntax-constant-other-reference-link);
}

.github-markdown-body [data-catalyst] {
  display: block;
}

.github-markdown-body g-emoji {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
  font-size: 1em;
  font-style: normal !important;
  font-weight: 400;
  line-height: 1;
  vertical-align: -0.075em;
}

.github-markdown-body g-emoji img {
  width: 1em;
  height: 1em;
}

.github-markdown-body::before {
  display: table;
  content: "";
}

.github-markdown-body::after {
  display: table;
  clear: both;
  content: "";
}

.github-markdown-body>*:first-child {
  margin-top: 0 !important;
}

.github-markdown-body>*:last-child {
  margin-bottom: 0 !important;
}

.github-markdown-body a:not([href]) {
  color: inherit;
  text-decoration: none;
}

.github-markdown-body .absent {
  color: var(--color-danger-fg);
}

.github-markdown-body .anchor {
  float: left;
  padding-right: 4px;
  margin-left: -20px;
  line-height: 1;
}

.github-markdown-body .anchor:focus {
  outline: none;
}

.github-markdown-body p,
.github-markdown-body blockquote,
.github-markdown-body ul,
.github-markdown-body ol,
.github-markdown-body dl,
.github-markdown-body table,
.github-markdown-body pre,
.github-markdown-body details {
  margin-top: 0;
  margin-bottom: 16px;
}

.github-markdown-body blockquote>:first-child {
  margin-top: 0;
}

.github-markdown-body blockquote>:last-child {
  margin-bottom: 0;
}

.github-markdown-body sup>a::before {
  content: "[";
}

.github-markdown-body sup>a::after {
  content: "]";
}

.github-markdown-body h1 .octicon-link,
.github-markdown-body h2 .octicon-link,
.github-markdown-body h3 .octicon-link,
.github-markdown-body h4 .octicon-link,
.github-markdown-body h5 .octicon-link,
.github-markdown-body h6 .octicon-link {
  color: var(--color-fg-default);
  vertical-align: middle;
  visibility: hidden;
}

.github-markdown-body h1:hover .anchor,
.github-markdown-body h2:hover .anchor,
.github-markdown-body h3:hover .anchor,
.github-markdown-body h4:hover .anchor,
.github-markdown-body h5:hover .anchor,
.github-markdown-body h6:hover .anchor {
  text-decoration: none;
}

.github-markdown-body h1:hover .anchor .octicon-link,
.github-markdown-body h2:hover .anchor .octicon-link,
.github-markdown-body h3:hover .anchor .octicon-link,
.github-markdown-body h4:hover .anchor .octicon-link,
.github-markdown-body h5:hover .anchor .octicon-link,
.github-markdown-body h6:hover .anchor .octicon-link {
  visibility: visible;
}

.github-markdown-body h1 tt,
.github-markdown-body h1 code,
.github-markdown-body h2 tt,
.github-markdown-body h2 code,
.github-markdown-body h3 tt,
.github-markdown-body h3 code,
.github-markdown-body h4 tt,
.github-markdown-body h4 code,
.github-markdown-body h5 tt,
.github-markdown-body h5 code,
.github-markdown-body h6 tt,
.github-markdown-body h6 code {
  padding: 0 .2em;
  font-size: inherit;
}

.github-markdown-body ul.no-list,
.github-markdown-body ol.no-list {
  padding: 0;
  list-style-type: none;
}

.github-markdown-body ol[type="1"] {
  list-style-type: decimal;
}

.github-markdown-body ol[type=a] {
  list-style-type: lower-alpha;
}

.github-markdown-body ol[type=i] {
  list-style-type: lower-roman;
}

.github-markdown-body div>ol:not([type]) {
  list-style-type: decimal;
}

.github-markdown-body ul ul,
.github-markdown-body ul ol,
.github-markdown-body ol ol,
.github-markdown-body ol ul {
  margin-top: 0;
  margin-bottom: 0;
}

.github-markdown-body li>p {
  margin-top: 16px;
}

.github-markdown-body li+li {
  margin-top: .25em;
}

.github-markdown-body dl {
  padding: 0;
}

.github-markdown-body dl dt {
  padding: 0;
  margin-top: 16px;
  font-size: 1em;
  font-style: italic;
  font-weight: 600;
}

.github-markdown-body dl dd {
  padding: 0 16px;
  margin-bottom: 16px;
}

.github-markdown-body table th {
  font-weight: 600;
}

.github-markdown-body table th,
.github-markdown-body table td {
  padding: 6px 13px;
  border: 1px solid var(--color-border-default);
}

.github-markdown-body table tr {
  background-color: var(--color-canvas-default);
  border-top: 1px solid var(--color-border-muted);
}

.github-markdown-body table tr:nth-child(2n) {
  background-color: var(--color-canvas-subtle);
}

.github-markdown-body table img {
  background-color: transparent;
}

.github-markdown-body img[align=right] {
  padding-left: 20px;
}

.github-markdown-body img[align=left] {
  padding-right: 20px;
}

.github-markdown-body .emoji {
  max-width: none;
  vertical-align: text-top;
  background-color: transparent;
}

.github-markdown-body span.frame {
  display: block;
  overflow: hidden;
}

.github-markdown-body span.frame>span {
  display: block;
  float: left;
  width: auto;
  padding: 7px;
  margin: 13px 0 0;
  overflow: hidden;
  border: 1px solid var(--color-border-default);
}

.github-markdown-body span.frame span img {
  display: block;
  float: left;
}

.github-markdown-body span.frame span span {
  display: block;
  padding: 5px 0 0;
  clear: both;
  color: var(--color-fg-default);
}

.github-markdown-body span.align-center {
  display: block;
  overflow: hidden;
  clear: both;
}

.github-markdown-body span.align-center>span {
  display: block;
  margin: 13px auto 0;
  overflow: hidden;
  text-align: center;
}

.github-markdown-body span.align-center span img {
  margin: 0 auto;
  text-align: center;
}

.github-markdown-body span.align-right {
  display: block;
  overflow: hidden;
  clear: both;
}

.github-markdown-body span.align-right>span {
  display: block;
  margin: 13px 0 0;
  overflow: hidden;
  text-align: right;
}

.github-markdown-body span.align-right span img {
  margin: 0;
  text-align: right;
}

.github-markdown-body span.float-left {
  display: block;
  float: left;
  margin-right: 13px;
  overflow: hidden;
}

.github-markdown-body span.float-left span {
  margin: 13px 0 0;
}

.github-markdown-body span.float-right {
  display: block;
  float: right;
  margin-left: 13px;
  overflow: hidden;
}

.github-markdown-body span.float-right>span {
  display: block;
  margin: 13px auto 0;
  overflow: hidden;
  text-align: right;
}

.github-markdown-body code,
.github-markdown-body tt {
  padding: .2em .4em;
  margin: 0;
  font-size: 85%;
  background-color: var(--color-neutral-muted);
  border-radius: 6px;
}

.github-markdown-body code br,
.github-markdown-body tt br {
  display: none;
}

.github-markdown-body del code {
  text-decoration: inherit;
}

.github-markdown-body pre code {
  font-size: 100%;
}

.github-markdown-body pre>code {
  padding: 0;
  margin: 0;
  word-break: normal;
  white-space: pre;
  background: transparent;
  border: 0;
}

.github-markdown-body .highlight {
  margin-bottom: 16px;
}

.github-markdown-body .highlight pre {
  margin-bottom: 0;
  word-break: normal;
}

.github-markdown-body .highlight pre,
.github-markdown-body pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: var(--color-canvas-subtle);
  border-radius: 6px;
}

.github-markdown-body pre code,
.github-markdown-body pre tt {
  display: inline;
  max-width: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  line-height: inherit;
  word-wrap: normal;
  background-color: transparent;
  border: 0;
}

.github-markdown-body .csv-data td,
.github-markdown-body .csv-data th {
  padding: 5px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.github-markdown-body .csv-data .blob-num {
  padding: 10px 8px 9px;
  text-align: right;
  background: var(--color-canvas-default);
  border: 0;
}

.github-markdown-body .csv-data tr {
  border-top: 0;
}

.github-markdown-body .csv-data th {
  font-weight: 600;
  background: var(--color-canvas-subtle);
  border-top: 0;
}

.github-markdown-body .footnotes {
  font-size: 12px;
  color: var(--color-fg-muted);
  border-top: 1px solid var(--color-border-default);
}

.github-markdown-body .footnotes ol {
  padding-left: 16px;
}

.github-markdown-body .footnotes li {
  position: relative;
}

.github-markdown-body .footnotes li:target::before {
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -24px;
  pointer-events: none;
  content: "";
  border: 2px solid var(--color-accent-emphasis);
  border-radius: 6px;
}

.github-markdown-body .footnotes li:target {
  color: var(--color-fg-default);
}

.github-markdown-body .footnotes .data-footnote-backref g-emoji {
  font-family: monospace;
}

.github-markdown-body [hidden] {
  display: none !important;
}

.github-markdown-body ::-webkit-calendar-picker-indicator {
  filter: invert(50%);
}
/*!
  Theme: GitHub
  Description: Highlight-js port of github.com theme
  Author: github.com
  Maintainer: @SNDST00M, @mjbvz
  Updated: 2021-12-08
*/
.markdown-body pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 16px;
}

.markdown-body code.hljs {
  padding: 3px 5px;
}

/*!
  Theme: GitHub
  Description: Theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-dark
  Current colors taken from GitHub's CSS
*/
.markdown-body .hljs {
  color: var(--color-fg-default);
  background: var(--color-canvas-subtle);
}

.markdown-body .hljs-doctag,
.markdown-body .hljs-keyword,
.markdown-body .hljs-meta .hljs-keyword,
.markdown-body .hljs-template-tag,
.markdown-body .hljs-template-variable,
.markdown-body .hljs-type,
.markdown-body .hljs-variable.language_ {
  color: var(--color-prettylights-syntax-keyword);
}

.markdown-body .hljs-title,
.markdown-body .hljs-title.class_,
.markdown-body .hljs-title.class_.inherited__,
.markdown-body .hljs-title.function_ {
  color: var(--color-prettylights-syntax-entity);
}

.markdown-body .hljs-attr,
.markdown-body .hljs-attribute,
.markdown-body .hljs-literal,
.markdown-body .hljs-meta,
.markdown-body .hljs-number,
.markdown-body .hljs-operator,
.markdown-body .hljs-selector-attr,
.markdown-body .hljs-selector-class,
.markdown-body .hljs-selector-id,
.markdown-body .hljs-variable {
  color: var(--color-prettylights-syntax-constant);
}

.markdown-body .hljs-meta .hljs-string,
.markdown-body .hljs-regexp,
.markdown-body .hljs-string {
  color: var(--color-prettylights-syntax-string);
}

.markdown-body .hljs-built_in,
.markdown-body .hljs-symbol {
  color: var(--color-prettylights-syntax-variable);
}

.markdown-body .hljs-code,
.markdown-body .hljs-comment,
.markdown-body .hljs-formula {
  color: var(--color-prettylights-syntax-comment);
}

.markdown-body .hljs-name,
.markdown-body .hljs-quote,
.markdown-body .hljs-selector-pseudo,
.markdown-body .hljs-selector-tag {
  color: var(--color-prettylights-syntax-entity-tag);
}

.markdown-body .hljs-subst {
  color: var(--color-prettylights-syntax-constant);
}

.markdown-body .hljs-section {
  color: var(--color-prettylights-syntax-markup-heading);
  font-weight: bold;
}

.markdown-body .hljs-bullet {
  color: var(--color-prettylights-syntax-markup-list);
}

.markdown-body .hljs-emphasis {
  color: var(--color-prettylights-syntax-constant);
  font-style: italic;
}

.markdown-body .hljs-strong {
  color: var(--color-prettylights-syntax-constant);
  font-weight: bold;
}

.markdown-body .hljs-addition {
  color: var(--color-prettylights-syntax-markup-inserted-text);
  background-color: var(--color-prettylights-syntax-markup-inserted-bg);
}

.markdown-body .hljs-deletion {
  color: var(--color-prettylights-syntax-markup-deleted-text);
  background-color: var(--color-prettylights-syntax-markup-deleted-bg);
}

/* From extension ms-toolsai.jupyter */
/* These classnames are inherited from bootstrap, but are present in most notebook renderers */

.alert {
    width: auto;
    padding: 1em;
    margin-top: 1em;
    margin-bottom: 1em;
}
.alert > *:last-child {
    margin-bottom: 0;
}
#preview > .alert:last-child {
    /* Prevent this being set to zero by the default notebook stylesheet */
    padding-bottom: 1em;
}

.alert-success {
    /* Note there is no suitable color available, so we just copy "info" */
    background-color: var(--theme-info-background);
    color: var(--theme-info-foreground);
}
.alert-info {
    background-color: var(--theme-info-background);
    color: var(--theme-info-foreground);
}
.alert-warning {
    background-color: var(--theme-warning-background);
    color: var(--theme-warning-foreground);
}
.alert-danger {
    background-color: var(--theme-error-background);
    color: var(--theme-error-foreground);
}

</style>
        
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
<style>
            body {
                font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
                font-size: 14px;
                line-height: 1.6;
            }
        </style>
        <style>
.task-list-item {
    list-style-type: none;
}

.task-list-item-checkbox {
    margin-left: -20px;
    vertical-align: middle;
    pointer-events: none;
}
</style>
        
    </head>
    <body class="vscode-body vscode-light">
        <div class="github-markdown-body github-markdown-auto">
            <div class="github-markdown-content"><span id="markdown-mermaid" aria-hidden="true"
                    data-dark-mode-theme="dark"
                    data-light-mode-theme="default"></span>
                <table>
<thead>
<tr>
<th>document</th>
<th>title</th>
<th>author</th>
<th>date</th>
<th>target</th>
<th>audience</th>
</tr>
</thead>
<tbody>
<tr>
<td>P2616R4</td>
<td>Making std::atomic notification/wait operations usable in more situations</td>
<td>Lewis Baker <a href="mailto:lewissbaker@gmail.com">lewissbaker@gmail.com</a></td>
<td>2023-02-15</td>
<td>C++26</td>
<td>LEWG</td>
</tr>
</tbody>
</table>
<ul>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#motivation">Motivation</a></li>
<li><a href="#proposed-design">Proposed design</a></li>
<li><a href="#design-discussion">Design discussion</a></li>
<li><a href="#potential-implementation-strategies">Potential Implementation Strategies</a></li>
<li><a href="#proposed-wording">Proposed Wording</a></li>
<li><a href="#references">References</a></li>
</ul>
<h1 id="revision-history">Revision History</h1>
<h2 id="r4">R4</h2>
<ul>
<li>Apply feedback from SG1 review in Issaquah 2023.</li>
<li>Remove deprecation of existing atomic notify functions as SG1 feedback
indicated there may still be some use-cases for them.</li>
<li>Move mention of lifetime in the effects of <code>notify_token::notify_one/all</code>
into a non-normative note.</li>
<li>Fix non-escaped angle brackets in wording synopsis.</li>
<li>Add wording to be applied to P2689R1 if both are accepted.</li>
</ul>
<h2 id="r3">R3</h2>
<ul>
<li>Rename <code>atomic_notify_token</code> to <code>notify_token</code> and change template
parameter to be the atomic-object type rather than the value-type.</li>
</ul>
<h2 id="r2">R2</h2>
<ul>
<li>Reduce paper down to option 3 only at request of SG1</li>
<li>Rephrase abstract</li>
<li>Add design discussion</li>
<li>Add proposed wording</li>
<li>Extend changes to <code>atomic_flag</code></li>
</ul>
<h2 id="r1">R1</h2>
<ul>
<li>Added Option 3 - <code>atomic_notify_token</code> approach.</li>
<li>Incorporate feedback on limitations of option 2.</li>
</ul>
<h2 id="r0">R0</h2>
<p>Proposed two options.</p>
<ul>
<li>Option 1 - allow <code>std::atomic_notify_one/all()</code> on potentially destroyed pointer</li>
<li>Option 2 - add fused modify + notify overloads, <code>std::memory_notification</code> enum</li>
</ul>
<h1 id="abstract">Abstract</h1>
<p>C++20 added support to <code>std::atomic</code> for <code>notify_one()</code>, <code>notify_all()</code> and <code>wait()</code> operations
which give applications an efficient, light-weight way to block until the value of an atomic
object reaches a certain value.</p>
<p>A waiting thread calls the <code>x.wait(oldValue)</code> to wait until the atomic object, <code>x</code>'s value
changes from <code>oldValue</code> to something else and a signalling thread first stores a new value
to the atomic object, <code>x</code>, and then calls one of the notify-methods to wake up any threads
that have blocked inside a call to <code>wait()</code>.</p>
<p>For use-cases where a waiting thread can go on to destroy the atomic object once it
has observed the store, the signalling thread's subsequent call to the atomic object's
<code>notify_one()</code> or <code>notify_all()</code> member function can potentially have undefined behaviour.
This is becasue the standard <code>[basic.life]</code> p6.2 states that a call to a member function
on a pointer to an object whose lifetime has ended has undefined behaviour.</p>
<p>This paper proposes introducing a new API for obtaining a <code>std::notify_token&lt;Atomic&gt;</code> from
a <code>std::atomic&lt;T&gt;</code>, <code>std::atomic_ref&lt;T&gt;</code> or <code>std::atomic_flag</code> which can then be used to
notify threads waiting on that atomic object without worrying about whether the underlying
atomic object is still alive.</p>
<p>This paper does not propose deprecating or changing the specification of <code>std::atomic_[flag_]notify_one/all()</code> at this time.</p>
<p>Usages of the namespace-scope functions will still have potential for undefined behaviour
in some cases, however. Resolving these issues is deferred pending the outcome of core
language changes proposed by the &quot;pointer zap&quot; papers (P1726 and P2188) with regards to
pointer provenance.</p>
<p>This paper does not attempt to address the undefined behaviour C compatibility layer for <code>std::atomic</code>.</p>
<h1 id="motivation">Motivation</h1>
<p>Consider the following example:</p>
<pre><code class="language-c++"><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
  thread_pool tp;

  {
    std::atomic&lt;<span class="hljs-type">int</span>&gt; x{<span class="hljs-number">0</span>}; <span class="hljs-comment">// #1</span>
    tp.<span class="hljs-built_in">execute</span>([&amp;] {       <span class="hljs-comment">// #2</span>
      x.<span class="hljs-built_in">store</span>(<span class="hljs-number">1</span>);          <span class="hljs-comment">// #3</span>
      x.<span class="hljs-built_in">notify_one</span>();      <span class="hljs-comment">// #4</span>
    });
    x.<span class="hljs-built_in">wait</span>(<span class="hljs-number">0</span>);             <span class="hljs-comment">// #5</span>
    <span class="hljs-built_in">assert</span>(x.<span class="hljs-built_in">load</span>() == <span class="hljs-number">1</span>);
  }                        <span class="hljs-comment">// #6</span>
}
</code></pre>
<p>Let T1 be the thread executing <code>main()</code> and T2 be the thread-pool thread that executes the lambda.</p>
<p>We might end up with a situation where the following sequence of events is executed:</p>
<pre><code>T1: constructs the atomic `x` and initialises to 0 (#1)
T1: enqueues the task to execute on the T1 (#2)
T2: dequeues the task and invokes the lambda
T2: stores the value 1 to the `x` (#3)
T1: executes `x.wait(0)`, sees value is now 1 and returns immediately (#5)
T1: destroys the object `x` (#6)
T2: executes `x.notify_one()` on a now destroyed object `x` (#4)
</code></pre>
<p>The final call to <code>x.notify_one()</code> member function on a destroyed object in (#4) has
undefined behaviour.</p>
<p>To work around this potential for operating on a dangling reference, we can use two
separate atomic variables - <code>wait()</code> on one and then spin-wait on the other.</p>
<pre><code class="language-c++"><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
  thread_pool tp;

  {
    std::atomic&lt;<span class="hljs-type">int</span>&gt; x{<span class="hljs-number">0</span>};
    std::atomic_flag f{<span class="hljs-literal">true</span>};
    tp.<span class="hljs-built_in">execute</span>([&amp;] {
      x.<span class="hljs-built_in">store</span>(<span class="hljs-number">1</span>);
      x.<span class="hljs-built_in">notify_one</span>();
      f.<span class="hljs-built_in">clear</span>();
    });
    x.<span class="hljs-built_in">wait</span>(<span class="hljs-number">0</span>);        <span class="hljs-comment">// efficient-wait</span>
    <span class="hljs-keyword">while</span> (f.<span class="hljs-built_in">test</span>()); <span class="hljs-comment">// spin-wait</span>
    <span class="hljs-built_in">assert</span>(x.<span class="hljs-built_in">load</span>() == <span class="hljs-number">1</span>);
  }
}
</code></pre>
<p>This has a couple of downsides, however:</p>
<ul>
<li>It needs to perform two atomic operations instead of one</li>
<li>The spin-wait can still result in occasional long busy-wait times, wasting CPU resources
e.g. if the signalling thread is context-switched out by the OS after the call to
<code>x.notify_one()</code> but before the call to <code>f.clear()</code>, the main thread will busy-wait
spin until the signalling thread is rescheduled.</li>
</ul>
<p>For this particular situation, we could instead use a <code>std::binary_semaphore</code>, as its
<code>acquire()</code> and <code>release()</code> operations are defined as being atomic, and thus they do
not have the same lifetime issues as the first <code>std::atomic</code> implementation.</p>
<pre><code class="language-c++"><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
  thread_pool tp;

  {
    std::binary_semaphore sem{<span class="hljs-number">0</span>};
    tp.<span class="hljs-built_in">execute</span>([&amp;] {
      sem.<span class="hljs-built_in">release</span>();
    });
    sem.<span class="hljs-built_in">acquire</span>();
  }   
}
</code></pre>
<p>However, if we then ask the question &quot;Can we implement <code>std::counting_semaphore</code> using <code>std::atomic</code>?&quot;,
we quickly run into the same lifetime questions regarding use of <code>notify_one/all()</code> methods.</p>
<p>Indeed, if we look at some of the standard library implementations of <code>std::counting_semaphore</code> we
see that they do actually follow the same pattern as above for the <code>release()</code> operation - an atomic
store followed by a call to either <code>notify_all()</code> or <code>notify_one()</code> on the atomic object.</p>
<ul>
<li>See <a href="https://github.com/llvm/llvm-project/blob/643df8fa8ef58d883cbb554c7e71910dc8a8673c/libcxx/include/semaphore#L90-L99">libc++ counting_semaphore::release() implementation</a>.</li>
<li>See <a href="https://github.com/gcc-mirror/gcc/blob/8467574d8daac47e0cf5b694f6c012aad8d630a6/libstdc%2B%2B-v3/include/bits/semaphore_base.h#L248-L259">libstdc++ counting_semaphore::release() implementation</a></li>
<li>See <a href="https://github.com/microsoft/STL/blob/c34f24920e463a71791c2ee3d2bed14926518965/stl/inc/semaphore#L74-L112">msvc counting_semaphore::release() implementation</a></li>
</ul>
<p>So why don't they run into the same lifetime issues?</p>
<p>The reason is that in all major standard library implementations of <code>std::atomic::notify_all()</code> and
<code>std::atomic::notify_one()</code> depend only on the address of the atomic object, but do not actually
access any data-members of the atomic object. These platforms also do not seem to target architectures
that enforce pointer provenance rules.</p>
<p>The underlying implementations of these notifying functions typically boil down to a call to:</p>
<ul>
<li><code>WakeByAddressSingle()</code> / <code>WakeByAddressAll()</code> on Windows platforms</li>
<li><code>futex()</code> with <code>futex_op</code> set to <code>FUTEX_WAKE</code> on Linux platforms</li>
<li><code>__ulock_wake()</code> on Mac OS platforms</li>
<li>Use of one of a collection of statically-allocated condition-variables, with the particular one
chosen based on the bit-representation of the provided address.</li>
</ul>
<p>All of these depend only on the bit-representation of address of the atomic variable,
which makes calling <code>count.notify_all()</code> work, even though the <code>count</code> object may have
since been destroyed, as it doesn't try to dereference the pointer.</p>
<p>Standard library implementations have extra knowledge about the semantics of the <code>std::atomic::notify_one/all()</code>
methods which they can leverage to allow safely implementing <code>std::counting_semaphore</code> in terms of
<code>std::atomic</code> operations. However, users of the standard library which want to be portable cannot make
these same assumptions - the standard library specification does not currently require that all implementations
have this same behaviour, and so users must resort to other, more portable means.</p>
<p>Instead of requiring users to work-around these limitations of the interface, we should provide
some standard/portable way for users to safely modify an atomic value and notify waiting threads
of the change.</p>
<h1 id="proposed-design">Proposed design</h1>
<p>This paper proposes the following:</p>
<ul>
<li>Adding the <code>std::notify_token&lt;Atomic&gt;</code> class template which provides an interface for
safely notifying threads waiting on the value to change.</li>
<li>Adding the <code>get_notify_token()</code> member function to <code>std::atomic&lt;T&gt;</code>, <code>std::atomic_ref&lt;T&gt;</code> and <code>std::atomic_flag</code> types
for obtaining a notify-token for the corresponding atomic object.</li>
</ul>
<p>Synopsis:</p>
<pre><code class="language-c++"><span class="hljs-keyword">namespace</span> std {
  <span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> Atomic&gt;
  <span class="hljs-keyword">class</span> <span class="hljs-title class_">notify_token</span>;

  <span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> T&gt;e
  <span class="hljs-keyword">class</span> <span class="hljs-title class_">atomic</span> {
  <span class="hljs-keyword">public</span>:
    <span class="hljs-comment">// Existing members...</span>
    
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span></span>;
  
    notify_token&lt;atomic&lt;T&gt;&gt; <span class="hljs-built_in">get_notify_token</span>() <span class="hljs-keyword">noexcept</span>;
    notify_token&lt;<span class="hljs-keyword">volatile</span> atomic&lt;T&gt;&gt; <span class="hljs-built_in">get_notify_token</span>() <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span>;
  };
  
  <span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> T&gt;
  <span class="hljs-keyword">class</span> <span class="hljs-title class_">atomic_ref</span> {
  <span class="hljs-keyword">public</span>:
    <span class="hljs-comment">// Existing members...</span>
  
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    
    notify_token&lt;atomic_ref&lt;T&gt;&gt; <span class="hljs-built_in">get_notify_token</span>() <span class="hljs-keyword">noexcept</span>;
  };

  <span class="hljs-keyword">class</span> <span class="hljs-title class_">atomic_flag</span> {
  <span class="hljs-keyword">public</span>:
    <span class="hljs-comment">// Existing members...</span>

    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span></span>;
    
    <span class="hljs-function">notify_token&lt;atomic_flag&gt; <span class="hljs-title">get_notify_token</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function">notify_token&lt;<span class="hljs-keyword">volatile</span> atomic_flag&gt; <span class="hljs-title">get_notify_token</span><span class="hljs-params">()</span> <span class="hljs-keyword">volatile</span> <span class="hljs-keyword">noexcept</span></span>;
  };
  
  <span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> Atomic&gt;
  <span class="hljs-keyword">class</span> <span class="hljs-title class_">notify_token</span> {
  <span class="hljs-keyword">public</span>:
    <span class="hljs-comment">// Copyable</span>
    <span class="hljs-built_in">notify_token</span>(<span class="hljs-type">const</span> notify_token&amp;) <span class="hljs-keyword">noexcept</span> = <span class="hljs-keyword">default</span>;
    notify_token&amp; <span class="hljs-keyword">operator</span>=(<span class="hljs-type">const</span> notify_token&amp;) <span class="hljs-keyword">noexcept</span> = <span class="hljs-keyword">default</span>;
    
    <span class="hljs-comment">// Perform notifications</span>
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-type">const</span> <span class="hljs-keyword">noexcept</span></span>;
    <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-type">const</span> <span class="hljs-keyword">noexcept</span></span>;
  <span class="hljs-keyword">private</span>:
    <span class="hljs-comment">// exposition-only</span>
    <span class="hljs-keyword">friend</span> Atomic;
    <span class="hljs-function"><span class="hljs-keyword">explicit</span> <span class="hljs-title">notify_token</span><span class="hljs-params">(std::<span class="hljs-type">uintptr_t</span> p)</span> <span class="hljs-keyword">noexcept</span> : address(p) {</span>}
    std::<span class="hljs-type">uintptr_t</span> address;
  };
}
</code></pre>
<p>The API would be used as follows:</p>
<pre><code class="language-c++"><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
  thread_pool tp;

  {
    std::atomic&lt;<span class="hljs-type">int</span>&gt; x{<span class="hljs-number">0</span>};
    tp.<span class="hljs-built_in">execute</span>([&amp;] {
      <span class="hljs-comment">// Obtain a notify-token while the object is definitely still alive.</span>
      <span class="hljs-keyword">auto</span> tok = x.<span class="hljs-built_in">get_notify_token</span>();
    
      <span class="hljs-comment">// Perform the store - this may cause wait() to return and the main</span>
      <span class="hljs-comment">// thread to destroy `x&#x27;.</span>
      x.<span class="hljs-built_in">store</span>(<span class="hljs-number">1</span>);
    
      <span class="hljs-comment">// `x&#x27; is potentially destroyed from this point on</span>
    
      <span class="hljs-comment">// Safely notify any objects still waiting on `x&#x27; (if any)</span>
      tok.<span class="hljs-built_in">notify_one</span>();
    });
    x.<span class="hljs-built_in">wait</span>(<span class="hljs-number">0</span>);
    <span class="hljs-built_in">assert</span>(x.<span class="hljs-built_in">load</span>() == <span class="hljs-number">1</span>);
  }
}
</code></pre>
<h1 id="design-discussion">Design discussion</h1>
<h2 id="why-does-this-solution-avoid-the-undefined-behaviour">Why does this solution avoid the undefined behaviour?</h2>
<p>Current implementations of <code>std::atomic</code> notify/wait mechanisms use some kind of hash-table
of synchronisation primitives for recording waiting threads and waking them up.</p>
<p>This could either be implemented on the kernel-side of the underlying OS in a
<code>futex()</code>-like API, or could be implemented in user-space using standard C++
synchronisation primitives.</p>
<p>When obtaining a notify-token, the implementation can perform any necessary hashing
of the atomic object address at the time that <code>get_notify_token()</code> is called, when the
atomic object is still known to be alive.</p>
<p>Then later, when actually performing the notification the implementation can lookup the
corresponding hash-table entry to use for synchronisation using the pre-hashed address
without needing the address of a potentially destroyed atomic object.</p>
<p>For implementations where the hashing of the address is done in the OS, they would
need to at least define it as valid to pass the address of a potentially destroyed
object to the syscall.</p>
<h2 id="conditional-notification">Conditional notification</h2>
<p>This design still retains the ability to conditionally notify waiting threads based
on the result of a read-modify-write operation.</p>
<p>This would not be possible were we to take a fused store-and-notify approach.</p>
<h2 id="why-is-stdnotify_token-a-template">Why is <code>std::notify_token</code> a template?</h2>
<p>The strategy used for notify/wait can vary depending on the type of value being synchronised.</p>
<p>For example, on Linux the <code>futex()</code> API on which notifications are based only works natively
for 32-bit values. When notifying/waiting for types that are not 32-bits in size, the
implementation needs to use a proxy 32-bit value which is incremented for every call to notify.</p>
<p>As different types of atomics may need to have different strategies for notification, the
<code>notify_token</code> needs to be be a type that depends on the type of atomic value.</p>
<p>Having the template parameter be the type of the atomic object rather than the value-type
of the atomic object allows for different implementation strategies for <code>atomic&lt;T&gt;</code> and
<code>atomic_ref&lt;T&gt;</code> (some <code>atomic_ref&lt;T&gt;</code> implementations might use an external lock while
<code>atomic&lt;T&gt;</code> might use an internal lock).</p>
<p>It also allows having different specialisations for <code>Atomic</code> and <code>volatile Atomic</code>
in case implementations need the flexibility to do something different for notifying
volatile-qualified atomic objects.</p>
<h2 id="const-qualification-of-get_notify_token-and-notify_token-methods">Const-qualification of <code>get_notify_token()</code> and <code>notify_token</code> methods</h2>
<p>The status quo is that the <code>std::atomic</code> methods <code>notify_one()</code> and <code>notify_all()</code>
methods are non-const and thus are only callable on a non-const <code>std::atomic</code> value.</p>
<p>This proposal preserves the requirement that the user cannot notify a const-qualified
atomic by marking the <code>get_notify_token()</code> method as non-const. This prevents the user
from obtaining a token if they only have a const-reference to an atomic object.</p>
<p>Once the user has obtained a notify-token, they have shown that they have non-const
access to the atomic object.</p>
<p>The notify-token member-functions do not need to also be non-const to enforce const-correctness
as the notify-tokens effectively have pointer-semantics. Marking the member-functions as non-const
would be easily worked around by just copying the token.</p>
<h2 id="where-should-the-notify-token-type-be-defined">Where should the notify-token type be defined?</h2>
<p>This paper proposes introducing a new namespace-scope class template <code>std::atomic_notify_token&lt;T&gt;</code>.</p>
<p>This type is needed by methods in both <code>std::atomic&lt;T&gt;</code> and <code>std::atomic_ref&lt;T&gt;</code>.</p>
<p>An alternative to consider is defining a nested <code>std::atomic&lt;T&gt;::notify_token</code> type and
then defining <code>std::atomic_ref&lt;T&gt;::notify_token</code> as a type-alias of <code>std::atomic&lt;T&gt;::notify_token</code>.
However, this would have the consequence of forcing an template instantiation of <code>std::atomic&lt;T&gt;</code>
for every template instantiation of <code>std::atomic_ref&lt;T&gt;</code>, even if it's not used.</p>
<h2 id="naming-of-notify_token">Naming of <code>notify_token</code></h2>
<p>Is the use of the term &quot;token&quot; here consistent with other usages in the standard library?
e.g. <code>std::stop_token</code>, <code>std::barrier::arrival_token</code></p>
<p>A brief discussion of naming in SG1 Kona 2022 indicated there was no concern about reserving
the name <code>notify_token</code> for use by the atomic notify/wait mechanisms.</p>
<p>An alternative could be to name this <code>atomic_notify_token</code>, although this would then tend to
duplicate the term &quot;atomic&quot; within specialisations.
e.g. <code>std:::atomic_notify_token&lt;std::atomic&lt;int&gt;&gt;</code></p>
<h2 id="fixing-stdatomic_notify_oneall">Fixing <code>std::atomic_notify_one/all()</code></h2>
<p>This proposal does not attempt to change the definition of the namespace-scope functions
<code>std::atomic_notify_one/all()</code>.</p>
<p>These functions are invoked with a pointer to the atomic object rather than being member
functions. So unlike a call to the notify member-functions, which has undefined behaviour
if the object's lifetime has ended, the behaviour of passing a pointer to an object whose
lifetime has ended is implementation-defined.</p>
<p>So while some implementations might define passing a pointer to an object whose lifetime
has ended as valid, other implementations might choose to trap on such uses of a pointer,
making writing portably correct code using this API difficult/impossible.</p>
<p>Whether or not this can be made portably safe depends on the resolution to the &quot;pointer zap&quot;
issue, which is the subject of papers P1726 and P2188, and so I do not attempt to address
the issue in this paper.</p>
<p>If desired, the existing namespace-scope functions could be deprecated and new
notify-token-based replacements added. However, it has not yet been explored what the
impacts would be on compatibility with C atomics.</p>
<p>In the meantime, we could consider changing the wording of <code>std::atomic_notify_one/all()</code>
to no longer be in terms of the corresponding atomic member functions so that we can
at least allow the correctness to be implementation-defined instead of undefined-behaviour
for the end-of-lifetime cases.</p>
<h1 id="potential-implementation-strategies">Potential Implementation Strategies</h1>
<h2 id="platforms-without-native-os-support">Platforms without native OS support</h2>
<p>On platforms without native OS support for address-based notification, the notify/wait
mechanisms of <code>std::atomic</code> could be implemented in terms of existing synchronisation
primitives.</p>
<p>For example: Given the following <code>__wait_state</code> helper class definition</p>
<pre><code class="language-c++"><span class="hljs-keyword">struct</span> <span class="hljs-title class_">__wait_state</span> {
  std::atomic&lt;<span class="hljs-type">uint64_t</span>&gt; _M_waiters{<span class="hljs-number">0</span>};
  std::mutex _M_mut;
  std::condition_variable _M_cv;
  std::<span class="hljs-type">uint64_t</span> _M_version{<span class="hljs-number">0</span>};

  <span class="hljs-comment">// Get the wait state for a given address.</span>
  <span class="hljs-type">static</span> __wait_state&amp; __for_address(<span class="hljs-keyword">volatile</span> <span class="hljs-type">void</span>* __address) <span class="hljs-keyword">noexcept</span> {
    <span class="hljs-keyword">constexpr</span> std::<span class="hljs-type">uintptr_t</span> __count = <span class="hljs-number">16</span>;
    <span class="hljs-type">static</span> __wait_state __w[__count];
    <span class="hljs-keyword">auto</span> __key = (<span class="hljs-built_in">reinterpret_cast</span>&lt;std::<span class="hljs-type">uintptr_t</span>&gt;(__address) &gt;&gt; <span class="hljs-number">2</span>) % __count;
    <span class="hljs-keyword">return</span> __w[__key];
  }

  <span class="hljs-type">void</span> __notify() <span class="hljs-keyword">noexcept</span> {
    <span class="hljs-keyword">if</span> (_M_waiters.<span class="hljs-built_in">load</span>() != <span class="hljs-number">0</span>) {
      {
        std::lock_guard __lk{_M_mut};
        ++_M_version;
      }
      _M_cv.<span class="hljs-built_in">notify_all</span>();
    }
  }

  <span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> _Pred&gt;
  <span class="hljs-type">void</span> __wait(_Pred __pred) <span class="hljs-keyword">noexcept</span> {
    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> __i = <span class="hljs-number">0</span>; __i &lt; <span class="hljs-number">10</span>; ++__i) {
      <span class="hljs-keyword">if</span> (__pred()) <span class="hljs-keyword">return</span>;
      __yield_thread();
    }

    _M_waiters.<span class="hljs-built_in">fetch_add</span>(<span class="hljs-number">1</span>, std::memory_order_seq_cst);
    std::<span class="hljs-type">uint64_t</span> __prev_version = [&amp;] {
      std::unique_lock __lk{_M_mut};
      <span class="hljs-keyword">return</span> _M_version;
    }();
    <span class="hljs-keyword">while</span> (!__pred()) {
      std::unique_lock __lk{_M_mut};
      <span class="hljs-keyword">if</span> (_M_version == __prev_version) {
        _M_cv.<span class="hljs-built_in">wait</span>(__lk);
      }
      __prev_version = _M_version;
    }
    _M_waiters.<span class="hljs-built_in">fetch_sub</span>(<span class="hljs-number">1</span>, std::memory_order_release);
  }
};
</code></pre>
<p>The atomic notify/wait methods can then be defined as follows:</p>
<pre><code class="language-c++"><span class="hljs-keyword">namespace</span> std {

<span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> Atomic&gt;
<span class="hljs-keyword">class</span> <span class="hljs-title class_">notify_token</span> {
<span class="hljs-keyword">public</span>:
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{ __state_-&gt;__notify(); }
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{ __state_-&gt;__notify(); }
<span class="hljs-keyword">private</span>:
  <span class="hljs-keyword">friend</span> Atomic;
  <span class="hljs-function"><span class="hljs-keyword">explicit</span> <span class="hljs-title">atomic_notify_token</span><span class="hljs-params">(__wait_state&amp; __state)</span> <span class="hljs-keyword">noexcept</span>
  : __state_(&amp;__state) {</span>}
  __wait_state* __state_;
};
  
<span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> T&gt;
<span class="hljs-keyword">class</span> <span class="hljs-title class_">atomic</span> {
<span class="hljs-keyword">public</span>:
  
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-built_in">get_notify_token</span>().<span class="hljs-built_in">notify_one</span>();
  }
  
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-built_in">get_notify_token</span>().<span class="hljs-built_in">notify_all</span>();
  }

  notify_token&lt;atomic&lt;T&gt;&gt; <span class="hljs-built_in">get_notify_token</span>() <span class="hljs-keyword">noexcept</span> {
    __wait_state&amp; __s = __wait_state::__for_address(<span class="hljs-keyword">this</span>);
    <span class="hljs-keyword">return</span> atomic_notify_token&lt;T&gt;{__s};
  }

  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">wait</span><span class="hljs-params">(T __old, memory_order __mo = memory_order_seq_cst)</span> <span class="hljs-type">const</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-keyword">auto</span> __pred = [__mo, __old, <span class="hljs-keyword">this</span>]() <span class="hljs-keyword">noexcept</span> { <span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>-&gt;<span class="hljs-built_in">load</span>(__mo) != __old; };
    <span class="hljs-keyword">auto</span>&amp; __s = __wait_state::__for_address(<span class="hljs-keyword">this</span>);
    __s.<span class="hljs-built_in">wait</span>(__pred);
  }

  <span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> volatile overloads omitted for brevity.</span>
};
  
} <span class="hljs-comment">// namespace std</span>
</code></pre>
<p>In usage of this implementation, the <code>__wait_state*</code> object is computed from the address
of the atomic object during the call to <code>get_notify_token()</code>, while the atomic object is
still alive.</p>
<p>Once the address of the <code>__wait_state</code> object is computed there is no need for the atomic
object address any more - and thus no need to use a pointer to a potentially destroyed object.</p>
<h2 id="platforms-with-native-os-support">Platforms with native OS support</h2>
<p>On platforms that use a <code>futex()</code>-like OS API to implement waiting, the token could hold the address
of the object (e.g. as a <code>void*</code> or <code>std::uintptr_t</code>) assuming on this particular implementation that
it defines it as valid to pass a pointer to a potentially destroyed object.</p>
<p>Example: Possible implementation on Windows</p>
<pre><code class="language-c++"><span class="hljs-keyword">namespace</span> std {
  
<span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> Atomic&gt;
<span class="hljs-keyword">class</span> <span class="hljs-title class_">notify_token</span> {
<span class="hljs-keyword">public</span>:
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{ <span class="hljs-built_in">WakeByAddressSingle</span>(ptr); }
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{ <span class="hljs-built_in">WakeByAddressAll</span>(ptr); }
<span class="hljs-keyword">private</span>:
  <span class="hljs-keyword">friend</span> Atomic;
  <span class="hljs-function"><span class="hljs-keyword">explicit</span> <span class="hljs-title">notify_token</span><span class="hljs-params">(<span class="hljs-type">void</span>* p)</span> <span class="hljs-keyword">noexcept</span> : ptr(p) {</span>}
  <span class="hljs-type">void</span>* ptr;
};

<span class="hljs-keyword">template</span>&lt;<span class="hljs-keyword">typename</span> T&gt;
<span class="hljs-keyword">class</span> <span class="hljs-title class_">atomic</span> {
<span class="hljs-keyword">public</span>:
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_one</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-built_in">get_notify_token</span>().<span class="hljs-built_in">notify_one</span>();
  }
  
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">notify_all</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-built_in">get_notify_token</span>().<span class="hljs-built_in">notify_all</span>();
  }

  <span class="hljs-function">atomic_notify_token&lt;T&gt; <span class="hljs-title">get_notify_token</span><span class="hljs-params">()</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-keyword">return</span> atomic_notify_token&lt;T&gt;{<span class="hljs-keyword">this</span>};
  }
  
  <span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">wait</span><span class="hljs-params">(T __old, memory_order __mo = memory_order_seq_cst)</span> <span class="hljs-keyword">noexcept</span> </span>{
    <span class="hljs-keyword">while</span> (<span class="hljs-built_in">load</span>(__mo) == __old) {
      <span class="hljs-built_in">WaitOnAddress</span>(<span class="hljs-keyword">this</span>, std::<span class="hljs-built_in">addressof</span>(__old), <span class="hljs-built_in">sizeof</span>(T), INFINITE);
    }
  }

  <span class="hljs-comment">// <span class="hljs-doctag">NOTE:</span> volatile overloads omitted for brevity</span>
};

}
</code></pre>
<h1 id="proposed-wording">Proposed Wording</h1>
<h2 id="modify-atomicswait-note-3-as-follows">Modify <code>[atomics.wait]</code> Note 3 as follows:</h2>
<blockquote>
<p>[Note 3: The following functions are atomic notifying operations:</p>
<ul>
<li><code>atomic&lt;T&gt;​::​notify_­one</code> and <code>atomic&lt;T&gt;​::​notify_­all</code>,</li>
<li><code>atomic_­flag​::​notify_­one</code> and <code>atomic_­flag​::​notify_­all</code>,</li>
<li><code>atomic_­notify_­one</code> and <code>atomic_­notify_­all</code>,</li>
<li><code>atomic_­flag_­notify_­one</code> and <code>atomic_­flag_­notify_­all</code>, and</li>
<li><code>atomic_­ref&lt;T&gt;​::​notify_­one</code> and <code>atomic_­ref&lt;T&gt;​::​notify_­all</code>, and</li>
<li><span style="color:green"><code style="color:green">notify_token&lt;Atomic&gt;::notify_one</code> and <code style="color:green">notify_token&lt;Atomic&gt;::notify_all</code></span>, and</li>
</ul>
<p>— end note]</p>
</blockquote>
<h2 id="modify-atomicsrefgenericgeneral-as-follows">Modify <code>[atomics.ref.generic.general]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic_ref {
  private:
    T* ptr;             // exposition only
  public:
    ...

    void wait(T, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() const noexcept;
    void notify_all() const noexcept;
    <span style="color:green">notify_token&lt;atomic_ref&lt;T&gt;&gt; get_notify_token() const noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicsrefops-as-follows">Modify <code>[atomics.ref.ops]</code> as follows</h2>
<p>Add following at end of the section:</p>
<blockquote>
<p><code>notify_token&lt;atomic_ref&lt;T&gt;&gt; get_notify_token() const noexcept;</code></p>
<p><em>Effects</em>: None.</p>
<p><em>Returns</em>: An atomic notify token that can be used to unblock the execution of
atomic waiting operations on <code>*ptr</code>.</p>
</blockquote>
<h2 id="modify-atomicsrefint-as-follows">Modify <code>[atomics.ref.int]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;&gt; struct atomic_ref&lt;<i>integral</i>&gt; {
  private:
    <i>integral</i>* ptr;             // exposition only
  public:
    ...

    void wait(<i>integral</i>, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() const noexcept;
    void notify_all() const noexcept;
    <span style="color:green">notify_token&lt;atomic_ref&lt;<i>integral</i>&gt;&gt; get_notify_token() const noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicsreffloat-as-follows">Modify <code>[atomics.ref.float]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;&gt; struct atomic_ref&lt;<i>floating-point</i>&gt; {
  private:
    <i>floating-point</i>* ptr;             // exposition only
  public:
    ...

    void wait(<i>floating-point</i>, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() const noexcept;
    void notify_all() const noexcept;
    <span style="color:green">notify_token&lt;atomic_ref&lt;<i>floating-point</i>&gt;&gt; get_notify_token() const noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicsrefpointer-as-follows">Modify <code>[atomics.ref.pointer]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic_ref&lt;T*&gt; {
  private:
    T* ptr;             // exposition only
  public:
    ...

    void wait(T*, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() const noexcept;
    void notify_all() const noexcept;
    <span style="color:green">notify_token&lt;atomic_ref&lt;T*&gt;&gt; get_notify_token() const noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicstypesgenericgeneral-as-follows">Modify <code>[atomics.types.generic.general]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic {
  public:
    ...

    void wait(T*, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() volatile noexcept;
    void notify_one() noexcept;    
    void notify_all() volatile noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;volatile atomic&lt;T&gt;&gt; get_notify_token() volatile noexcept;</span>
    <span style="color:green">notify_token&lt;atomic&lt;T&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicstypesoperations-as-follows">Modify <code>[atomics.types.operations]</code> as follows:</h2>
<p>Add the following at the end of the section:</p>
<blockquote>
<p><code>notify_token&lt;volatile atomic&lt;T&gt;&gt; get_notify_token() volatile noexcept;</code><br/>
<code>notify_token&lt;atomic&lt;T&gt;&gt; get_notify_token() noexcept;</code><br/></p>
<p><em>Effects</em>: None</p>
<p><em>Returns</em>: An atomic notify token that can be used to unblock the execution of
atomic waiting operations on <code>*this</code>.</p>
</blockquote>
<h2 id="modify-atomicstypesint-as-follows">Modify <code>[atomics.types.int]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;&gt; struct atomic&lt;<i>integral</i>&gt; {
    ...

    void wait(<i>integral</i>, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() volatile noexcept;
    void notify_one() noexcept;
    void notify_all() volatile noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;volatile atomic&lt;<i>integral</i>&gt;&gt; get_notify_token() volatile noexcept;</span>
    <span style="color:green">notify_token&lt;atomic&lt;<i>integral</i>&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicstypesfloat-as-follows">Modify <code>[atomics.types.float]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;&gt; struct atomic&lt;<i>floating-point</i>&gt; {
    ...

    void wait(<i>floating-point</i>, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() volatile noexcept;
    void notify_one() noexcept;
    void notify_all() volatile noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;volatile atomic&lt;<i>floating-point</i>&gt;&gt; get_notify_token() volatile noexcept;</span>
    <span style="color:green">notify_token&lt;atomic&lt;<i>floating-point</i>&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<h2 id="modify-atomicstypespointer-as-follows">Modify <code>[atomics.types.pointer]</code> as follows:</h2>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic&lt;T*&gt; {
    ...

    void wait(T*, memory_order = memory_order::seq_cst) const noexcept;
    void notify_one() volatile noexcept;
    void notify_one() noexcept;
    void notify_all() volatile noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;volatile atomic&lt;T*&gt;&gt; get_notify_token() volatile noexcept;</span>
    <span style="color:green">notify_token&lt;atomic&lt;T*&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<h2 id="modify-utilsmartptratomicshared-as-follows">Modify <code>[util.smartptr.atomic.shared]</code> as follows</h2>
<p>Modify the synopsis as follows:</p>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic&lt;shared_ptr&lt;T&gt;&gt; {
    ...

    void wait(shared_ptr&lt;T&gt; old, memory_order order = memory_order::seq_cst) const noexcept;
    void notify_one() noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;atomic&lt;shared_ptr&lt;T&gt;&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<p>Add the following to the end of the section:</p>
<blockquote>
<p><code>notify_token&lt;atomic&lt;shared_ptr&lt;T&gt;&gt;&gt; get_notify_token() noexcept;</code></p>
<p><em>Effects</em>: None.</p>
<p><em>Returns</em>: An atomic notify token that can be used to unblock the execution of
atomic waiting operations on <code>*this</code>.</p>
</blockquote>
<h2 id="modify-utilsmartptratomicweak-as-follows">Modify <code>[util.smartptr.atomic.weak]</code> as follows</h2>
<p>Modify the synopsis as follows:</p>
<pre>
namespace std {
  template&lt;class T&gt; struct atomic&lt;weak_ptr&lt;T&gt;&gt; {
    ...

    void wait(weak_ptr&lt;T&gt; old, memory_order order = memory_order::seq_cst) const noexcept;
    void notify_one() noexcept;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;atomic&lt;weak_ptr&lt;T&gt;&gt;&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<p>Add the following to the end of the section:</p>
<blockquote>
<p><code>notify_token&lt;atomic&lt;weak_ptr&lt;T&gt;&gt;&gt; get_notify_token() noexcept;</code></p>
<p><em>Effects</em>: None.</p>
<p><em>Returns</em>: An atomic notify token that can be used to unblock the execution of
atomic waiting operations on <code>*this</code>.</p>
</blockquote>
<h2 id="modify-atomicsflag-as-follows">Modify <code>[atomics.flag]</code> as follows</h2>
<p>Modify the synopsis as follows:</p>
<pre>
namespace std {
  struct atomic_flag {
    ...

    void wait(bool, memory_order order = memory_order::seq_cst) const noexcept;
    void notify_one() noexcept volatile;
    void notify_one() noexcept;
    void notify_all() noexcept volatile;
    void notify_all() noexcept;
    <span style="color:green">notify_token&lt;volatile atomic_flag&gt; get_notify_token() noexcept volatile;</span>
    <span style="color:green">notify_token&lt;atomic_flag&gt; get_notify_token() noexcept;</span>
  };
}
</pre>
<p>Add the following to the end of the section:</p>
<blockquote>
<p><code>notify_token&lt;volatile atomic_flag&gt; get_notify_token() volatile noexcept;</code>
<code>notify_token&lt;atomic_flag&gt; get_notify_token() noexcept;</code></p>
<p><em>Effects</em>: None.</p>
<p><em>Returns</em>: An atomic notify token that can be used to unblock the execution of
atomic waiting operations on <code>*this</code>.</p>
</blockquote>
<h2 id="add-new-section-under-atomics">Add new section under <code>[atomics]</code></h2>
<blockquote>
<h1 id="atomic-notify-tokens---atomicsnotifytoken">Atomic notify tokens   <code>[atomics.notifytoken]</code></h1>
<h2 id="general-atomicsnotifytokengeneral">General <code>[atomics.notifytoken.general]</code></h2>
<p>An <em>atomic notify token</em> is a token obtained from an atomic object, <code>M</code>, that provides
the ability for the caller to later perform an atomic notifying operation on the atomic
object, <code>M</code>, without regard to whether <code>M</code>'s lifetime has ended.</p>
<p>An atomic notifying operation on an atomic notify token obtained from an atomic object,
<code>M</code>, has no effect if <code>M</code>'s lifetime has ended as all atomic waiting operations on <code>M</code>
are required to happens-before <code>M</code>'s lifetime ends.</p>
<p>All copies of an atomic notify token obtained from atomic object <code>M</code> can be used to
unblock atomic waiting operations on <code>M</code>.</p>
<h2 id="class-template-notify_token---atomicsnotifytokengeneric">Class template <code>notify_token</code>   <code>[atomics.notifytoken.generic]</code></h2>
<pre>
namespace std {
  template&lt;class Atomic&gt; struct notify_token {
  public:
    notify_token(const notify_token&) noexcept = default;
    notify_token& operator=(const notify_token&) noexcept = default;

    void notify_one() const noexcept;
    void notify_all() const noexcept;
  };
}
</pre>
<p><code>void notify_one() const noexcept;</code></p>
<p><em>Effects</em>: If <code>*this</code> was obtained from an atomic object, <code>M</code>,
then unblocks the execution of at least one atomic waiting operation on <code>M</code> that is eligible
to be unblocked (<code>[atomics.wait]</code>) by this call, if any such atomic waiting operations exist.
Otherwise has no effect.
[[Note: If the object <code>M</code>'s lifetime has ended then there will not be any atomic
waiting operations that are eligible to be unblocked and so this call will have
no effect.]]</p>
<p><em>Remarks</em>: This function is an atomic notifying operation (<code>[atomics.wait]</code>).</p>
<p><code>void notify_all() const noexcept;</code></p>
<p><em>Effects</em>: If <code>*this</code> was obtained from an atomic object, <code>M</code>
then unblocks the execution of all atomic waiting operations on <code>M</code> that are eligible
to be unblocked (<code>[atomics.wait]</code>) by this call.
Otherwise has no effect.
[[Note: If the object <code>M</code>'s lifetime has ended then there will not be any atomic
waiting operations that are eligible to be unblocked and so this call will have
no effect.]]</p>
<p><em>Remarks</em>: This function is an atomic notifying operation (<code>[atomics.wait]</code>).</p>
</blockquote>
<h1 id="wording-changes-to-apply-to-p2689r2">Wording changes to apply to P2689R2</h1>
<p>If both this paper and the paper P2689R2 are merged into the working draft then
  apply the following changes to the wording added by P2689R2.</p>  
<h2 id="modify-atomicsrefboundgeneral-as-follows">Modify <code>[atomics.ref.bound.general]</code> as follows</h2>
<p>Modify synopsis to add <code>get_notify_token()</code> method:</p>
<blockquote>
<pre>
template &lt;class T, memory_order MemoryOrder&gt;
struct <i>atomic-ref-bound</i> {  // exposition only

  // [other members omitted for brevity]

  void wait(T old) const noexcept;
  void notify_one() const noexcept;
  void notify_all() const noexcept;
  <span style="color:green">notify_token&lt;<i>atomic-ref-bound</i>&gt; get_notify_token() noexcept;</span>
};
</pre>
</blockquote>
<h2 id="modify-atomicsrefboundops-as-follows">Modify <code>[atomics.ref.bound.ops]</code> as follows</h2>
<p>Append the following to the end of this section:</p>
<blockquote>
<p><code>notify_token&lt;<i>atomic-ref-bound</i>&gt; get_notify_token() noexcept;</code></p>
<p><em>Effects</em>: Equivalent to <code>ref.get_notify_token()</code>.</p>
</blockquote>
<h1 id="references">References</h1>
<p>SG1 mailing list thread on the issue
<a href="https://lists.isocpp.org/parallel/2020/07/3270.php">https://lists.isocpp.org/parallel/2020/07/3270.php</a></p>
<p>P1726R5 - &quot;Pointer lifetime-end zap and provenance, too&quot; (Paul McKenney, Maged Michael, et. al.)
<a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1726r5.pdf">https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1726r5.pdf</a></p>
<p>P2188R1 - &quot;Zap the Zap: Pointers are sometimes just bags of bits&quot;
<a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2188r1.html">https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2188r1.html</a></p>
</div>
        </div>
        
        <script async type="text/javascript">
/* From extension bierner.markdown-mermaid */
/*! For license information please see index.bundle.js.LICENSE.txt */
(()=>{var t={967:(t,e)=>{"use strict";e.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,i=/&#(\w+)(^\w|;)?/g,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,s=/^([^:]+):/gm,a=[".","/"];e.N=function(t){var e,o=(e=t||"",e.replace(i,(function(t,e){return String.fromCharCode(e)}))).replace(r,"").trim();if(!o)return"about:blank";if(function(t){return a.indexOf(t[0])>-1}(o))return o;var c=o.match(s);if(!c)return o;var l=c[0];return n.test(l)?"about:blank":o}},856:function(t){t.exports=function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function i(t,r,s){return i=n()?Reflect.construct:function(t,n,i){var r=[null];r.push.apply(r,n);var s=new(Function.bind.apply(t,r));return i&&e(s,i.prototype),s},i.apply(null,arguments)}function r(t){return s(t)||a(t)||o(t)||l()}function s(t){if(Array.isArray(t))return c(t)}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=Object.hasOwnProperty,u=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor,g=Object.freeze,y=Object.seal,m=Object.create,b="undefined"!=typeof Reflect&&Reflect,_=b.apply,x=b.construct;_||(_=function(t,e,n){return t.apply(e,n)}),g||(g=function(t){return t}),y||(y=function(t){return t}),x||(x=function(t,e){return i(t,r(e))});var v=M(Array.prototype.forEach),k=M(Array.prototype.pop),w=M(Array.prototype.push),T=M(String.prototype.toLowerCase),C=M(String.prototype.toString),E=M(String.prototype.match),S=M(String.prototype.replace),A=M(String.prototype.indexOf),D=M(String.prototype.trim),L=M(RegExp.prototype.test),O=B(TypeError);function M(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return _(t,e,i)}}function B(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return x(t,n)}}function N(t,e,n){n=n||T,u&&u(t,null);for(var i=e.length;i--;){var r=e[i];if("string"==typeof r){var s=n(r);s!==r&&(d(e)||(e[i]=s),r=s)}t[r]=!0}return t}function I(t){var e,n=m(null);for(e in t)_(h,t,[e])&&(n[e]=t[e]);return n}function F(t,e){for(;null!==t;){var n=p(t,e);if(n){if(n.get)return M(n.get);if("function"==typeof n.value)return M(n.value)}t=f(t)}function i(t){return console.warn("fallback value for",t),null}return i}var R=g(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$=g(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=g(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Y=g(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),j=g(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),z=g(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=g(["#text"]),W=g(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),H=g(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),q=g(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=g(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),X=y(/<%[\w\W]*|[\w\W]*%>/gm),Z=y(/\${[\w\W]*}/gm),Q=y(/^data-[\-\w.\u00B7-\uFFFF]/),K=y(/^aria-[\-\w]+$/),J=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tt=y(/^(?:\w+script|data):/i),et=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nt=y(/^html$/i),it=function(){return"undefined"==typeof window?null:window},rt=function(e,n){if("object"!==t(e)||"function"!=typeof e.createPolicy)return null;var i=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(i=n.currentScript.getAttribute(r));var s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function st(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:it(),n=function(t){return st(t)};if(n.version="2.4.1",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var i=e.document,s=e.document,a=e.DocumentFragment,o=e.HTMLTemplateElement,c=e.Node,l=e.Element,h=e.NodeFilter,u=e.NamedNodeMap,d=void 0===u?e.NamedNodeMap||e.MozNamedAttrMap:u,f=e.HTMLFormElement,p=e.DOMParser,y=e.trustedTypes,m=l.prototype,b=F(m,"cloneNode"),_=F(m,"nextSibling"),x=F(m,"childNodes"),M=F(m,"parentNode");if("function"==typeof o){var B=s.createElement("template");B.content&&B.content.ownerDocument&&(s=B.content.ownerDocument)}var at=rt(y,i),ot=at?at.createHTML(""):"",ct=s,lt=ct.implementation,ht=ct.createNodeIterator,ut=ct.createDocumentFragment,dt=ct.getElementsByTagName,ft=i.importNode,pt={};try{pt=I(s).documentMode?s.documentMode:{}}catch(t){}var gt={};n.isSupported="function"==typeof M&&lt&&void 0!==lt.createHTMLDocument&&9!==pt;var yt,mt,bt=G,_t=X,xt=Z,vt=Q,kt=K,wt=tt,Tt=et,Ct=J,Et=null,St=N({},[].concat(r(R),r($),r(P),r(j),r(U))),At=null,Dt=N({},[].concat(r(W),r(H),r(q),r(V))),Lt=Object.seal(Object.create(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}})),Ot=null,Mt=null,Bt=!0,Nt=!0,It=!1,Ft=!1,Rt=!1,$t=!1,Pt=!1,Yt=!1,jt=!1,zt=!1,Ut=!0,Wt=!1,Ht="user-content-",qt=!0,Vt=!1,Gt={},Xt=null,Zt=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qt=null,Kt=N({},["audio","video","img","source","image","track"]),Jt=null,te=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ee="http://www.w3.org/1998/Math/MathML",ne="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml",re=ie,se=!1,ae=null,oe=N({},[ee,ne,ie],C),ce=["application/xhtml+xml","text/html"],le="text/html",he=null,ue=s.createElement("form"),de=function(t){return t instanceof RegExp||t instanceof Function},fe=function(e){he&&he===e||(e&&"object"===t(e)||(e={}),e=I(e),yt=yt=-1===ce.indexOf(e.PARSER_MEDIA_TYPE)?le:e.PARSER_MEDIA_TYPE,mt="application/xhtml+xml"===yt?C:T,Et="ALLOWED_TAGS"in e?N({},e.ALLOWED_TAGS,mt):St,At="ALLOWED_ATTR"in e?N({},e.ALLOWED_ATTR,mt):Dt,ae="ALLOWED_NAMESPACES"in e?N({},e.ALLOWED_NAMESPACES,C):oe,Jt="ADD_URI_SAFE_ATTR"in e?N(I(te),e.ADD_URI_SAFE_ATTR,mt):te,Qt="ADD_DATA_URI_TAGS"in e?N(I(Kt),e.ADD_DATA_URI_TAGS,mt):Kt,Xt="FORBID_CONTENTS"in e?N({},e.FORBID_CONTENTS,mt):Zt,Ot="FORBID_TAGS"in e?N({},e.FORBID_TAGS,mt):{},Mt="FORBID_ATTR"in e?N({},e.FORBID_ATTR,mt):{},Gt="USE_PROFILES"in e&&e.USE_PROFILES,Bt=!1!==e.ALLOW_ARIA_ATTR,Nt=!1!==e.ALLOW_DATA_ATTR,It=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=e.SAFE_FOR_TEMPLATES||!1,Rt=e.WHOLE_DOCUMENT||!1,Yt=e.RETURN_DOM||!1,jt=e.RETURN_DOM_FRAGMENT||!1,zt=e.RETURN_TRUSTED_TYPE||!1,Pt=e.FORCE_BODY||!1,Ut=!1!==e.SANITIZE_DOM,Wt=e.SANITIZE_NAMED_PROPS||!1,qt=!1!==e.KEEP_CONTENT,Vt=e.IN_PLACE||!1,Ct=e.ALLOWED_URI_REGEXP||Ct,re=e.NAMESPACE||ie,e.CUSTOM_ELEMENT_HANDLING&&de(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Lt.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&de(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Lt.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Lt.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ft&&(Nt=!1),jt&&(Yt=!0),Gt&&(Et=N({},r(U)),At=[],!0===Gt.html&&(N(Et,R),N(At,W)),!0===Gt.svg&&(N(Et,$),N(At,H),N(At,V)),!0===Gt.svgFilters&&(N(Et,P),N(At,H),N(At,V)),!0===Gt.mathMl&&(N(Et,j),N(At,q),N(At,V))),e.ADD_TAGS&&(Et===St&&(Et=I(Et)),N(Et,e.ADD_TAGS,mt)),e.ADD_ATTR&&(At===Dt&&(At=I(At)),N(At,e.ADD_ATTR,mt)),e.ADD_URI_SAFE_ATTR&&N(Jt,e.ADD_URI_SAFE_ATTR,mt),e.FORBID_CONTENTS&&(Xt===Zt&&(Xt=I(Xt)),N(Xt,e.FORBID_CONTENTS,mt)),qt&&(Et["#text"]=!0),Rt&&N(Et,["html","head","body"]),Et.table&&(N(Et,["tbody"]),delete Ot.tbody),g&&g(e),he=e)},pe=N({},["mi","mo","mn","ms","mtext"]),ge=N({},["foreignobject","desc","title","annotation-xml"]),ye=N({},["title","style","font","a","script"]),me=N({},$);N(me,P),N(me,Y);var be=N({},j);N(be,z);var _e=function(t){var e=M(t);e&&e.tagName||(e={namespaceURI:re,tagName:"template"});var n=T(t.tagName),i=T(e.tagName);return!!ae[t.namespaceURI]&&(t.namespaceURI===ne?e.namespaceURI===ie?"svg"===n:e.namespaceURI===ee?"svg"===n&&("annotation-xml"===i||pe[i]):Boolean(me[n]):t.namespaceURI===ee?e.namespaceURI===ie?"math"===n:e.namespaceURI===ne?"math"===n&&ge[i]:Boolean(be[n]):t.namespaceURI===ie?!(e.namespaceURI===ne&&!ge[i])&&!(e.namespaceURI===ee&&!pe[i])&&!be[n]&&(ye[n]||!me[n]):!("application/xhtml+xml"!==yt||!ae[t.namespaceURI]))},xe=function(t){w(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=ot}catch(e){t.remove()}}},ve=function(t,e){try{w(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){w(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!At[t])if(Yt||jt)try{xe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ke=function(t){var e,n;if(Pt)t="<remove></remove>"+t;else{var i=E(t,/^[\r\n\t ]+/);n=i&&i[0]}"application/xhtml+xml"===yt&&re===ie&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var r=at?at.createHTML(t):t;if(re===ie)try{e=(new p).parseFromString(r,yt)}catch(t){}if(!e||!e.documentElement){e=lt.createDocument(re,"template",null);try{e.documentElement.innerHTML=se?"":r}catch(t){}}var a=e.body||e.documentElement;return t&&n&&a.insertBefore(s.createTextNode(n),a.childNodes[0]||null),re===ie?dt.call(e,Rt?"html":"body")[0]:Rt?e.documentElement:a},we=function(t){return ht.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT,null,!1)},Te=function(t){return t instanceof f&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof d)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Ce=function(e){return"object"===t(c)?e instanceof c:e&&"object"===t(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ee=function(t,e,i){gt[t]&&v(gt[t],(function(t){t.call(n,e,i,he)}))},Se=function(t){var e;if(Ee("beforeSanitizeElements",t,null),Te(t))return xe(t),!0;if(L(/[\u0080-\uFFFF]/,t.nodeName))return xe(t),!0;var i=mt(t.nodeName);if(Ee("uponSanitizeElement",t,{tagName:i,allowedTags:Et}),t.hasChildNodes()&&!Ce(t.firstElementChild)&&(!Ce(t.content)||!Ce(t.content.firstElementChild))&&L(/<[/\w]/g,t.innerHTML)&&L(/<[/\w]/g,t.textContent))return xe(t),!0;if("select"===i&&L(/<template/i,t.innerHTML))return xe(t),!0;if(!Et[i]||Ot[i]){if(!Ot[i]&&De(i)){if(Lt.tagNameCheck instanceof RegExp&&L(Lt.tagNameCheck,i))return!1;if(Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(i))return!1}if(qt&&!Xt[i]){var r=M(t)||t.parentNode,s=x(t)||t.childNodes;if(s&&r)for(var a=s.length-1;a>=0;--a)r.insertBefore(b(s[a],!0),_(t))}return xe(t),!0}return t instanceof l&&!_e(t)?(xe(t),!0):"noscript"!==i&&"noembed"!==i||!L(/<\/no(script|embed)/i,t.innerHTML)?(Ft&&3===t.nodeType&&(e=t.textContent,e=S(e,bt," "),e=S(e,_t," "),e=S(e,xt," "),t.textContent!==e&&(w(n.removed,{element:t.cloneNode()}),t.textContent=e)),Ee("afterSanitizeElements",t,null),!1):(xe(t),!0)},Ae=function(t,e,n){if(Ut&&("id"===e||"name"===e)&&(n in s||n in ue))return!1;if(Nt&&!Mt[e]&&L(vt,e));else if(Bt&&L(kt,e));else if(!At[e]||Mt[e]){if(!(De(t)&&(Lt.tagNameCheck instanceof RegExp&&L(Lt.tagNameCheck,t)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(t))&&(Lt.attributeNameCheck instanceof RegExp&&L(Lt.attributeNameCheck,e)||Lt.attributeNameCheck instanceof Function&&Lt.attributeNameCheck(e))||"is"===e&&Lt.allowCustomizedBuiltInElements&&(Lt.tagNameCheck instanceof RegExp&&L(Lt.tagNameCheck,n)||Lt.tagNameCheck instanceof Function&&Lt.tagNameCheck(n))))return!1}else if(Jt[e]);else if(L(Ct,S(n,Tt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==A(n,"data:")||!Qt[t])if(It&&!L(wt,S(n,Tt,"")));else if(n)return!1;return!0},De=function(t){return t.indexOf("-")>0},Le=function(e){var i,r,s,a;Ee("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:At};for(a=o.length;a--;){var l=i=o[a],h=l.name,u=l.namespaceURI;if(r="value"===h?i.value:D(i.value),s=mt(h),c.attrName=s,c.attrValue=r,c.keepAttr=!0,c.forceKeepAttr=void 0,Ee("uponSanitizeAttribute",e,c),r=c.attrValue,!c.forceKeepAttr&&(ve(h,e),c.keepAttr))if(L(/\/>/i,r))ve(h,e);else{Ft&&(r=S(r,bt," "),r=S(r,_t," "),r=S(r,xt," "));var d=mt(e.nodeName);if(Ae(d,s,r)){if(!Wt||"id"!==s&&"name"!==s||(ve(h,e),r=Ht+r),at&&"object"===t(y)&&"function"==typeof y.getAttributeType)if(u);else switch(y.getAttributeType(d,s)){case"TrustedHTML":r=at.createHTML(r);break;case"TrustedScriptURL":r=at.createScriptURL(r)}try{u?e.setAttributeNS(u,h,r):e.setAttribute(h,r),k(n.removed)}catch(t){}}}}Ee("afterSanitizeAttributes",e,null)}},Oe=function t(e){var n,i=we(e);for(Ee("beforeSanitizeShadowDOM",e,null);n=i.nextNode();)Ee("uponSanitizeShadowNode",n,null),Se(n)||(n.content instanceof a&&t(n.content),Le(n));Ee("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(r){var s,o,l,h,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((se=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!Ce(r)){if("function"!=typeof r.toString)throw O("toString is not a function");if("string"!=typeof(r=r.toString()))throw O("dirty is not a string, aborting")}if(!n.isSupported){if("object"===t(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(Ce(r))return e.toStaticHTML(r.outerHTML)}return r}if($t||fe(d),n.removed=[],"string"==typeof r&&(Vt=!1),Vt){if(r.nodeName){var f=mt(r.nodeName);if(!Et[f]||Ot[f])throw O("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof c)1===(o=(s=ke("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?s=o:s.appendChild(o);else{if(!Yt&&!Ft&&!Rt&&-1===r.indexOf("<"))return at&&zt?at.createHTML(r):r;if(!(s=ke(r)))return Yt?null:zt?ot:""}s&&Pt&&xe(s.firstChild);for(var p=we(Vt?r:s);l=p.nextNode();)3===l.nodeType&&l===h||Se(l)||(l.content instanceof a&&Oe(l.content),Le(l),h=l);if(h=null,Vt)return r;if(Yt){if(jt)for(u=ut.call(s.ownerDocument);s.firstChild;)u.appendChild(s.firstChild);else u=s;return At.shadowroot&&(u=ft.call(i,u,!0)),u}var g=Rt?s.outerHTML:s.innerHTML;return Rt&&Et["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&L(nt,s.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+g),Ft&&(g=S(g,bt," "),g=S(g,_t," "),g=S(g,xt," ")),at&&zt?at.createHTML(g):g},n.setConfig=function(t){fe(t),$t=!0},n.clearConfig=function(){he=null,$t=!1},n.isValidAttribute=function(t,e,n){he||fe({});var i=mt(t),r=mt(e);return Ae(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&(gt[t]=gt[t]||[],w(gt[t],e))},n.removeHook=function(t){if(gt[t])return k(gt[t])},n.removeHooks=function(t){gt[t]&&(gt[t]=[])},n.removeAllHooks=function(){gt={}},n}return st()}()},234:()=>{},748:(t,e,n)=>{var i={"./locale":234,"./locale.js":234};function r(t){var e=s(t);return n(e)}function s(t){if(!n.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}r.keys=function(){return Object.keys(i)},r.resolve=s,t.exports=r,r.id=748},941:function(t,e,n){(t=n.nmd(t)).exports=function(){"use strict";var e,i;function r(){return e.apply(null,arguments)}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function o(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function u(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function d(t,e){for(var n in e)u(e,n)&&(t[n]=e[n]);return u(e,"toString")&&(t.toString=e.toString),u(e,"valueOf")&&(t.valueOf=e.valueOf),t}function f(t,e,n,i){return De(t,e,n,i,!0).utc()}function p(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function g(t){if(null==t._isValid){var e=p(t),n=i.call(e.parsedDateParts,(function(t){return null!=t})),r=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(r=r&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return r;t._isValid=r}return t._isValid}function y(t){var e=f(NaN);return null!=t?d(p(e),t):p(e).userInvalidated=!0,e}i=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};var m=r.momentProperties=[];function b(t,e){var n,i,r;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=p(e)),o(e._locale)||(t._locale=e._locale),0<m.length)for(n=0;n<m.length;n++)o(r=e[i=m[n]])||(t[i]=r);return t}var _=!1;function x(t){b(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===_&&(_=!0,r.updateOffset(this),_=!1)}function v(t){return t instanceof x||null!=t&&null!=t._isAMomentObject}function k(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=k(e)),n}function T(t,e,n){var i,r=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),a=0;for(i=0;i<r;i++)(n&&t[i]!==e[i]||!n&&w(t[i])!==w(e[i]))&&a++;return a+s}function C(t){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function E(t,e){var n=!0;return d((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,t),n){for(var i,s=[],a=0;a<arguments.length;a++){if(i="","object"==typeof arguments[a]){for(var o in i+="\n["+a+"] ",arguments[0])i+=o+": "+arguments[0][o]+", ";i=i.slice(0,-2)}else i=arguments[a];s.push(i)}C(t+"\nArguments: "+Array.prototype.slice.call(s).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)}),e)}var S,A={};function D(t,e){null!=r.deprecationHandler&&r.deprecationHandler(t,e),A[t]||(C(e),A[t]=!0)}function L(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function O(t,e){var n,i=d({},t);for(n in e)u(e,n)&&(a(t[n])&&a(e[n])?(i[n]={},d(i[n],t[n]),d(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)u(t,n)&&!u(e,n)&&a(t[n])&&(i[n]=d({},i[n]));return i}function M(t){null!=t&&this.set(t)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,S=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)u(t,e)&&n.push(e);return n};var B={};function N(t,e){var n=t.toLowerCase();B[n]=B[n+"s"]=B[e]=t}function I(t){return"string"==typeof t?B[t]||B[t.toLowerCase()]:void 0}function F(t){var e,n,i={};for(n in t)u(t,n)&&(e=I(n))&&(i[e]=t[n]);return i}var R={};function $(t,e){R[t]=e}function P(t,e,n){var i=""+Math.abs(t),r=e-i.length;return(0<=t?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var Y=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,j=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,z={},U={};function W(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(U[t]=r),e&&(U[e[0]]=function(){return P(r.apply(this,arguments),e[1],e[2])}),n&&(U[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function H(t,e){return t.isValid()?(e=q(e,t.localeData()),z[e]=z[e]||function(t){var e,n,i,r=t.match(Y);for(e=0,n=r.length;e<n;e++)U[r[e]]?r[e]=U[r[e]]:r[e]=(i=r[e]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(e){var i,s="";for(i=0;i<n;i++)s+=L(r[i])?r[i].call(e,t):r[i];return s}}(e),z[e](t)):t.localeData().invalidDate()}function q(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(j.lastIndex=0;0<=n&&j.test(t);)t=t.replace(j,i),j.lastIndex=0,n-=1;return t}var V=/\d/,G=/\d\d/,X=/\d{3}/,Z=/\d{4}/,Q=/[+-]?\d{6}/,K=/\d\d?/,J=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,nt=/\d{1,4}/,it=/[+-]?\d{1,6}/,rt=/\d+/,st=/[+-]?\d+/,at=/Z|[+-]\d\d:?\d\d/gi,ot=/Z|[+-]\d\d(?::?\d\d)?/gi,ct=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lt={};function ht(t,e,n){lt[t]=L(e)?e:function(t,i){return t&&n?n:e}}function ut(t,e){return u(lt,t)?lt[t](e._strict,e._locale):new RegExp(dt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,r){return e||n||i||r}))))}function dt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function pt(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),c(e)&&(i=function(t,n){n[e]=w(t)}),n=0;n<t.length;n++)ft[t[n]]=i}function gt(t,e){pt(t,(function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)}))}var yt=0,mt=1,bt=2,_t=3,xt=4,vt=5,kt=6,wt=7,Tt=8;function Ct(t){return Et(t)?366:365}function Et(t){return t%4==0&&t%100!=0||t%400==0}W("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),W(0,["YY",2],0,(function(){return this.year()%100})),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),N("year","y"),$("year",1),ht("Y",st),ht("YY",K,G),ht("YYYY",nt,Z),ht("YYYYY",it,Q),ht("YYYYYY",it,Q),pt(["YYYYY","YYYYYY"],yt),pt("YYYY",(function(t,e){e[yt]=2===t.length?r.parseTwoDigitYear(t):w(t)})),pt("YY",(function(t,e){e[yt]=r.parseTwoDigitYear(t)})),pt("Y",(function(t,e){e[yt]=parseInt(t,10)})),r.parseTwoDigitYear=function(t){return w(t)+(68<w(t)?1900:2e3)};var St,At=Dt("FullYear",!0);function Dt(t,e){return function(n){return null!=n?(Ot(this,t,n),r.updateOffset(this,e),this):Lt(this,t)}}function Lt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function Ot(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Et(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),Mt(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function Mt(t,e){if(isNaN(t)||isNaN(e))return NaN;var n,i=(e%(n=12)+n)%n;return t+=(e-i)/12,1===i?Et(t)?29:28:31-i%7%2}St=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},W("M",["MM",2],"Mo",(function(){return this.month()+1})),W("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),W("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),N("month","M"),$("month",8),ht("M",K),ht("MM",K,G),ht("MMM",(function(t,e){return e.monthsShortRegex(t)})),ht("MMMM",(function(t,e){return e.monthsRegex(t)})),pt(["M","MM"],(function(t,e){e[mt]=w(t)-1})),pt(["MMM","MMMM"],(function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);null!=r?e[mt]=r:p(n).invalidMonth=t}));var Bt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Nt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),It="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ft(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=w(e);else if(!c(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),Mt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function Rt(t){return null!=t?(Ft(this,t),r.updateOffset(this,!0),this):Lt(this,"Month")}var $t=ct,Pt=ct;function Yt(){function t(t,e){return e.length-t.length}var e,n,i=[],r=[],s=[];for(e=0;e<12;e++)n=f([2e3,e]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));for(i.sort(t),r.sort(t),s.sort(t),e=0;e<12;e++)i[e]=dt(i[e]),r[e]=dt(r[e]);for(e=0;e<24;e++)s[e]=dt(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function jt(t){var e;if(t<100&&0<=t){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function zt(t,e,n){var i=7+e-n;return-(7+jt(t,0,i).getUTCDay()-e)%7+i-1}function Ut(t,e,n,i,r){var s,a,o=1+7*(e-1)+(7+n-i)%7+zt(t,i,r);return a=o<=0?Ct(s=t-1)+o:o>Ct(t)?(s=t+1,o-Ct(t)):(s=t,o),{year:s,dayOfYear:a}}function Wt(t,e,n){var i,r,s=zt(t.year(),e,n),a=Math.floor((t.dayOfYear()-s-1)/7)+1;return a<1?i=a+Ht(r=t.year()-1,e,n):a>Ht(t.year(),e,n)?(i=a-Ht(t.year(),e,n),r=t.year()+1):(r=t.year(),i=a),{week:i,year:r}}function Ht(t,e,n){var i=zt(t,e,n),r=zt(t+1,e,n);return(Ct(t)-i+r)/7}function qt(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),$("week",5),$("isoWeek",5),ht("w",K),ht("ww",K,G),ht("W",K),ht("WW",K,G),gt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=w(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),$("day",11),$("weekday",11),$("isoWeekday",11),ht("d",K),ht("e",K),ht("E",K),ht("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ht("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ht("dddd",(function(t,e){return e.weekdaysRegex(t)})),gt(["dd","ddd","dddd"],(function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:p(n).invalidWeekday=t})),gt(["d","e","E"],(function(t,e,n,i){e[i]=w(t)}));var Vt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Zt=ct,Qt=ct,Kt=ct;function Jt(){function t(t,e){return e.length-t.length}var e,n,i,r,s,a=[],o=[],c=[],l=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),s=this.weekdays(n,""),a.push(i),o.push(r),c.push(s),l.push(i),l.push(r),l.push(s);for(a.sort(t),o.sort(t),c.sort(t),l.sort(t),e=0;e<7;e++)o[e]=dt(o[e]),c[e]=dt(c[e]),l[e]=dt(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function te(){return this.hours()%12||12}function ee(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function ne(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,te),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+te.apply(this)+P(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+te.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),ee("a",!0),ee("A",!1),N("hour","h"),$("hour",13),ht("a",ne),ht("A",ne),ht("H",K),ht("h",K),ht("k",K),ht("HH",K,G),ht("hh",K,G),ht("kk",K,G),ht("hmm",J),ht("hmmss",tt),ht("Hmm",J),ht("Hmmss",tt),pt(["H","HH"],_t),pt(["k","kk"],(function(t,e,n){var i=w(t);e[_t]=24===i?0:i})),pt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),pt(["h","hh"],(function(t,e,n){e[_t]=w(t),p(n).bigHour=!0})),pt("hmm",(function(t,e,n){var i=t.length-2;e[_t]=w(t.substr(0,i)),e[xt]=w(t.substr(i)),p(n).bigHour=!0})),pt("hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[_t]=w(t.substr(0,i)),e[xt]=w(t.substr(i,2)),e[vt]=w(t.substr(r)),p(n).bigHour=!0})),pt("Hmm",(function(t,e,n){var i=t.length-2;e[_t]=w(t.substr(0,i)),e[xt]=w(t.substr(i))})),pt("Hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[_t]=w(t.substr(0,i)),e[xt]=w(t.substr(i,2)),e[vt]=w(t.substr(r))}));var ie,re=Dt("Hours",!0),se={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Nt,monthsShort:It,week:{dow:0,doy:6},weekdays:Vt,weekdaysMin:Xt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},ae={},oe={};function ce(t){return t?t.toLowerCase().replace("_","-"):t}function le(e){var i=null;if(!ae[e]&&t&&t.exports)try{i=ie._abbr,n(748)("./"+e),he(i)}catch(e){}return ae[e]}function he(t,e){var n;return t&&((n=o(e)?de(t):ue(t,e))?ie=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ie._abbr}function ue(t,e){if(null===e)return delete ae[t],null;var n,i=se;if(e.abbr=t,null!=ae[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=ae[t]._config;else if(null!=e.parentLocale)if(null!=ae[e.parentLocale])i=ae[e.parentLocale]._config;else{if(null==(n=le(e.parentLocale)))return oe[e.parentLocale]||(oe[e.parentLocale]=[]),oe[e.parentLocale].push({name:t,config:e}),null;i=n._config}return ae[t]=new M(O(i,e)),oe[t]&&oe[t].forEach((function(t){ue(t.name,t.config)})),he(t),ae[t]}function de(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ie;if(!s(t)){if(e=le(t))return e;t=[t]}return function(t){for(var e,n,i,r,s=0;s<t.length;){for(e=(r=ce(t[s]).split("-")).length,n=(n=ce(t[s+1]))?n.split("-"):null;0<e;){if(i=le(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&T(r,n,!0)>=e-1)break;e--}s++}return ie}(t)}function fe(t){var e,n=t._a;return n&&-2===p(t).overflow&&(e=n[mt]<0||11<n[mt]?mt:n[bt]<1||n[bt]>Mt(n[yt],n[mt])?bt:n[_t]<0||24<n[_t]||24===n[_t]&&(0!==n[xt]||0!==n[vt]||0!==n[kt])?_t:n[xt]<0||59<n[xt]?xt:n[vt]<0||59<n[vt]?vt:n[kt]<0||999<n[kt]?kt:-1,p(t)._overflowDayOfYear&&(e<yt||bt<e)&&(e=bt),p(t)._overflowWeeks&&-1===e&&(e=wt),p(t)._overflowWeekday&&-1===e&&(e=Tt),p(t).overflow=e),t}function pe(t,e,n){return null!=t?t:null!=e?e:n}function ge(t){var e,n,i,s,a,o=[];if(!t._d){var c,l;for(c=t,l=new Date(r.now()),i=c._useUTC?[l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()]:[l.getFullYear(),l.getMonth(),l.getDate()],t._w&&null==t._a[bt]&&null==t._a[mt]&&function(t){var e,n,i,r,s,a,o,c;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)s=1,a=4,n=pe(e.GG,t._a[yt],Wt(Le(),1,4).year),i=pe(e.W,1),((r=pe(e.E,1))<1||7<r)&&(c=!0);else{s=t._locale._week.dow,a=t._locale._week.doy;var l=Wt(Le(),s,a);n=pe(e.gg,t._a[yt],l.year),i=pe(e.w,l.week),null!=e.d?((r=e.d)<0||6<r)&&(c=!0):null!=e.e?(r=e.e+s,(e.e<0||6<e.e)&&(c=!0)):r=s}i<1||i>Ht(n,s,a)?p(t)._overflowWeeks=!0:null!=c?p(t)._overflowWeekday=!0:(o=Ut(n,i,r,s,a),t._a[yt]=o.year,t._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(a=pe(t._a[yt],i[yt]),(t._dayOfYear>Ct(a)||0===t._dayOfYear)&&(p(t)._overflowDayOfYear=!0),n=jt(a,0,t._dayOfYear),t._a[mt]=n.getUTCMonth(),t._a[bt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[_t]&&0===t._a[xt]&&0===t._a[vt]&&0===t._a[kt]&&(t._nextDay=!0,t._a[_t]=0),t._d=(t._useUTC?jt:function(t,e,n,i,r,s,a){var o;return t<100&&0<=t?(o=new Date(t+400,e,n,i,r,s,a),isFinite(o.getFullYear())&&o.setFullYear(t)):o=new Date(t,e,n,i,r,s,a),o}).apply(null,o),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[_t]=24),t._w&&void 0!==t._w.d&&t._w.d!==s&&(p(t).weekdayMismatch=!0)}}var ye=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,me=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,be=/Z|[+-]\d\d(?::?\d\d)?/,_e=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],xe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ve=/^\/?Date\((\-?\d+)/i;function ke(t){var e,n,i,r,s,a,o=t._i,c=ye.exec(o)||me.exec(o);if(c){for(p(t).iso=!0,e=0,n=_e.length;e<n;e++)if(_e[e][1].exec(c[1])){r=_e[e][0],i=!1!==_e[e][2];break}if(null==r)return void(t._isValid=!1);if(c[3]){for(e=0,n=xe.length;e<n;e++)if(xe[e][1].exec(c[3])){s=(c[2]||" ")+xe[e][0];break}if(null==s)return void(t._isValid=!1)}if(!i&&null!=s)return void(t._isValid=!1);if(c[4]){if(!be.exec(c[4]))return void(t._isValid=!1);a="Z"}t._f=r+(s||"")+(a||""),Se(t)}else t._isValid=!1}var we=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Te(t,e,n,i,r,s){var a=[function(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}(t),It.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(r,10)];return s&&a.push(parseInt(s,10)),a}var Ce={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ee(t){var e,n,i,r=we.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(r){var s=Te(r[4],r[3],r[2],r[5],r[6],r[7]);if(n=s,i=t,(e=r[1])&&Gt.indexOf(e)!==new Date(n[0],n[1],n[2]).getDay()&&(p(i).weekdayMismatch=!0,!(i._isValid=!1)))return;t._a=s,t._tzm=function(t,e,n){if(t)return Ce[t];if(e)return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}(r[8],r[9],r[10]),t._d=jt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),p(t).rfc2822=!0}else t._isValid=!1}function Se(t){if(t._f!==r.ISO_8601)if(t._f!==r.RFC_2822){t._a=[],p(t).empty=!0;var e,n,i,s,a,o,c,l,h=""+t._i,d=h.length,f=0;for(i=q(t._f,t._locale).match(Y)||[],e=0;e<i.length;e++)s=i[e],(n=(h.match(ut(s,t))||[])[0])&&(0<(a=h.substr(0,h.indexOf(n))).length&&p(t).unusedInput.push(a),h=h.slice(h.indexOf(n)+n.length),f+=n.length),U[s]?(n?p(t).empty=!1:p(t).unusedTokens.push(s),o=s,l=t,null!=(c=n)&&u(ft,o)&&ft[o](c,l._a,l,o)):t._strict&&!n&&p(t).unusedTokens.push(s);p(t).charsLeftOver=d-f,0<h.length&&p(t).unusedInput.push(h),t._a[_t]<=12&&!0===p(t).bigHour&&0<t._a[_t]&&(p(t).bigHour=void 0),p(t).parsedDateParts=t._a.slice(0),p(t).meridiem=t._meridiem,t._a[_t]=function(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):(null!=t.isPM&&((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0)),e)}(t._locale,t._a[_t],t._meridiem),ge(t),fe(t)}else Ee(t);else ke(t)}function Ae(t){var e,n,i,u,f=t._i,m=t._f;return t._locale=t._locale||de(t._l),null===f||void 0===m&&""===f?y({nullInput:!0}):("string"==typeof f&&(t._i=f=t._locale.preparse(f)),v(f)?new x(fe(f)):(l(f)?t._d=f:s(m)?function(t){var e,n,i,r,s;if(0===t._f.length)return p(t).invalidFormat=!0,t._d=new Date(NaN);for(r=0;r<t._f.length;r++)s=0,e=b({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],Se(e),g(e)&&(s+=p(e).charsLeftOver,s+=10*p(e).unusedTokens.length,p(e).score=s,(null==i||s<i)&&(i=s,n=e));d(t,n||e)}(t):m?Se(t):o(n=(e=t)._i)?e._d=new Date(r.now()):l(n)?e._d=new Date(n.valueOf()):"string"==typeof n?(i=e,null===(u=ve.exec(i._i))?(ke(i),!1===i._isValid&&(delete i._isValid,Ee(i),!1===i._isValid&&(delete i._isValid,r.createFromInputFallback(i)))):i._d=new Date(+u[1])):s(n)?(e._a=h(n.slice(0),(function(t){return parseInt(t,10)})),ge(e)):a(n)?function(t){if(!t._d){var e=F(t._i);t._a=h([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),ge(t)}}(e):c(n)?e._d=new Date(n):r.createFromInputFallback(e),g(t)||(t._d=null),t))}function De(t,e,n,i,r){var o,c={};return!0!==n&&!1!==n||(i=n,n=void 0),(a(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||s(t)&&0===t.length)&&(t=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=r,c._l=n,c._i=t,c._f=e,c._strict=i,(o=new x(fe(Ae(c))))._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function Le(t,e,n,i){return De(t,e,n,i,!1)}r.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var Oe=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Le.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:y()})),Me=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Le.apply(null,arguments);return this.isValid()&&t.isValid()?this<t?this:t:y()}));function Be(t,e){var n,i;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Le();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}var Ne=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ie(t){var e=F(t),n=e.year||0,i=e.quarter||0,r=e.month||0,s=e.week||e.isoWeek||0,a=e.day||0,o=e.hour||0,c=e.minute||0,l=e.second||0,h=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===St.call(Ne,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<Ne.length;++i)if(t[Ne[i]]){if(n)return!1;parseFloat(t[Ne[i]])!==w(t[Ne[i]])&&(n=!0)}return!0}(e),this._milliseconds=+h+1e3*l+6e4*c+1e3*o*60*60,this._days=+a+7*s,this._months=+r+3*i+12*n,this._data={},this._locale=de(),this._bubble()}function Fe(t){return t instanceof Ie}function Re(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function $e(t,e){W(t,0,0,(function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+P(~~(t/60),2)+e+P(~~t%60,2)}))}$e("Z",":"),$e("ZZ",""),ht("Z",ot),ht("ZZ",ot),pt(["Z","ZZ"],(function(t,e,n){n._useUTC=!0,n._tzm=Ye(ot,t)}));var Pe=/([\+\-]|\d\d)/gi;function Ye(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Pe)||["-",0,0],r=60*i[1]+w(i[2]);return 0===r?0:"+"===i[0]?r:-r}function je(t,e){var n,i;return e._isUTC?(n=e.clone(),i=(v(t)||l(t)?t.valueOf():Le(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):Le(t).local()}function ze(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Ue(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var We=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,He=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function qe(t,e){var n,i,r,s=t,a=null;return Fe(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:c(t)?(s={},e?s[e]=t:s.milliseconds=t):(a=We.exec(t))?(n="-"===a[1]?-1:1,s={y:0,d:w(a[bt])*n,h:w(a[_t])*n,m:w(a[xt])*n,s:w(a[vt])*n,ms:w(Re(1e3*a[kt]))*n}):(a=He.exec(t))?(n="-"===a[1]?-1:1,s={y:Ve(a[2],n),M:Ve(a[3],n),w:Ve(a[4],n),d:Ve(a[5],n),h:Ve(a[6],n),m:Ve(a[7],n),s:Ve(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=function(t,e){var n;return t.isValid()&&e.isValid()?(e=je(e,t),t.isBefore(e)?n=Ge(t,e):((n=Ge(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}(Le(s.from),Le(s.to)),(s={}).ms=r.milliseconds,s.M=r.months),i=new Ie(s),Fe(t)&&u(t,"_locale")&&(i._locale=t._locale),i}function Ve(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ge(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Xe(t,e){return function(n,i){var r;return null===i||isNaN(+i)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Ze(this,qe(n="string"==typeof n?+n:n,i),t),this}}function Ze(t,e,n,i){var s=e._milliseconds,a=Re(e._days),o=Re(e._months);t.isValid()&&(i=null==i||i,o&&Ft(t,Lt(t,"Month")+o*n),a&&Ot(t,"Date",Lt(t,"Date")+a*n),s&&t._d.setTime(t._d.valueOf()+s*n),i&&r.updateOffset(t,a||o))}qe.fn=Ie.prototype,qe.invalid=function(){return qe(NaN)};var Qe=Xe(1,"add"),Ke=Xe(-1,"subtract");function Je(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,"months");return-(n+(e-i<0?(e-i)/(i-t.clone().add(n-1,"months")):(e-i)/(t.clone().add(n+1,"months")-i)))||0}function tn(t){var e;return void 0===t?this._locale._abbr:(null!=(e=de(t))&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var en=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function nn(){return this._locale}var rn=126227808e5;function sn(t,e){return(t%e+e)%e}function an(t,e,n){return t<100&&0<=t?new Date(t+400,e,n)-rn:new Date(t,e,n).valueOf()}function on(t,e,n){return t<100&&0<=t?Date.UTC(t+400,e,n)-rn:Date.UTC(t,e,n)}function cn(t,e){W(0,[t,t.length],0,e)}function ln(t,e,n,i,r){var s;return null==t?Wt(this,i,r).year:((s=Ht(t,i,r))<e&&(e=s),function(t,e,n,i,r){var s=Ut(t,e,n,i,r),a=jt(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,t,e,n,i,r))}W(0,["gg",2],0,(function(){return this.weekYear()%100})),W(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),cn("gggg","weekYear"),cn("ggggg","weekYear"),cn("GGGG","isoWeekYear"),cn("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),$("weekYear",1),$("isoWeekYear",1),ht("G",st),ht("g",st),ht("GG",K,G),ht("gg",K,G),ht("GGGG",nt,Z),ht("gggg",nt,Z),ht("GGGGG",it,Q),ht("ggggg",it,Q),gt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=w(t)})),gt(["gg","GG"],(function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)})),W("Q",0,"Qo","quarter"),N("quarter","Q"),$("quarter",7),ht("Q",V),pt("Q",(function(t,e){e[mt]=3*(w(t)-1)})),W("D",["DD",2],"Do","date"),N("date","D"),$("date",9),ht("D",K),ht("DD",K,G),ht("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),pt(["D","DD"],bt),pt("Do",(function(t,e){e[bt]=w(t.match(K)[0])}));var hn=Dt("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),$("dayOfYear",4),ht("DDD",et),ht("DDDD",X),pt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=w(t)})),W("m",["mm",2],0,"minute"),N("minute","m"),$("minute",14),ht("m",K),ht("mm",K,G),pt(["m","mm"],xt);var un=Dt("Minutes",!1);W("s",["ss",2],0,"second"),N("second","s"),$("second",15),ht("s",K),ht("ss",K,G),pt(["s","ss"],vt);var dn,fn=Dt("Seconds",!1);for(W("S",0,0,(function(){return~~(this.millisecond()/100)})),W(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),W(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),W(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),W(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),W(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),W(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),N("millisecond","ms"),$("millisecond",16),ht("S",et,V),ht("SS",et,G),ht("SSS",et,X),dn="SSSS";dn.length<=9;dn+="S")ht(dn,rt);function pn(t,e){e[kt]=w(1e3*("0."+t))}for(dn="S";dn.length<=9;dn+="S")pt(dn,pn);var gn=Dt("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var yn=x.prototype;function mn(t){return t}yn.add=Qe,yn.calendar=function(t,e){var n=t||Le(),i=je(n,this).startOf("day"),s=r.calendarFormat(this,i)||"sameElse",a=e&&(L(e[s])?e[s].call(this,n):e[s]);return this.format(a||this.localeData().calendar(s,this,Le(n)))},yn.clone=function(){return new x(this)},yn.diff=function(t,e,n){var i,r,s;if(!this.isValid())return NaN;if(!(i=je(t,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),e=I(e)){case"year":s=Je(this,i)/12;break;case"month":s=Je(this,i);break;case"quarter":s=Je(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-r)/864e5;break;case"week":s=(this-i-r)/6048e5;break;default:s=this-i}return n?s:k(s)},yn.endOf=function(t){var e;if(void 0===(t=I(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?on:an;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=36e5-sn(e+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":e=this._d.valueOf(),e+=6e4-sn(e,6e4)-1;break;case"second":e=this._d.valueOf(),e+=1e3-sn(e,1e3)-1}return this._d.setTime(e),r.updateOffset(this,!0),this},yn.format=function(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=H(this,t);return this.localeData().postformat(e)},yn.from=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||Le(t).isValid())?qe({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},yn.fromNow=function(t){return this.from(Le(),t)},yn.to=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||Le(t).isValid())?qe({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},yn.toNow=function(t){return this.to(Le(),t)},yn.get=function(t){return L(this[t=I(t)])?this[t]():this},yn.invalidAt=function(){return p(this).overflow},yn.isAfter=function(t,e){var n=v(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=I(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},yn.isBefore=function(t,e){var n=v(t)?t:Le(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=I(e)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},yn.isBetween=function(t,e,n,i){var r=v(t)?t:Le(t),s=v(e)?e:Le(e);return!!(this.isValid()&&r.isValid()&&s.isValid())&&("("===(i=i||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===i[1]?this.isBefore(s,n):!this.isAfter(s,n))},yn.isSame=function(t,e){var n,i=v(t)?t:Le(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=I(e)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},yn.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},yn.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},yn.isValid=function(){return g(this)},yn.lang=en,yn.locale=tn,yn.localeData=nn,yn.max=Me,yn.min=Oe,yn.parsingFlags=function(){return d({},p(this))},yn.set=function(t,e){if("object"==typeof t)for(var n=function(t){var e=[];for(var n in t)e.push({unit:n,priority:R[n]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=F(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(L(this[t=I(t)]))return this[t](e);return this},yn.startOf=function(t){var e;if(void 0===(t=I(t))||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?on:an;switch(t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=sn(e+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":e=this._d.valueOf(),e-=sn(e,6e4);break;case"second":e=this._d.valueOf(),e-=sn(e,1e3)}return this._d.setTime(e),r.updateOffset(this,!0),this},yn.subtract=Ke,yn.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},yn.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},yn.toDate=function(){return new Date(this.valueOf())},yn.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||9999<n.year()?H(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",H(n,"Z")):H(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+r)},yn.toJSON=function(){return this.isValid()?this.toISOString():null},yn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yn.unix=function(){return Math.floor(this.valueOf()/1e3)},yn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yn.year=At,yn.isLeapYear=function(){return Et(this.year())},yn.weekYear=function(t){return ln.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yn.isoWeekYear=function(t){return ln.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},yn.quarter=yn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},yn.month=Rt,yn.daysInMonth=function(){return Mt(this.year(),this.month())},yn.week=yn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},yn.isoWeek=yn.isoWeeks=function(t){var e=Wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},yn.weeksInYear=function(){var t=this.localeData()._week;return Ht(this.year(),t.dow,t.doy)},yn.isoWeeksInYear=function(){return Ht(this.year(),1,4)},yn.date=hn,yn.day=yn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e,n,i=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(e=t,n=this.localeData(),t="string"!=typeof e?e:isNaN(e)?"number"==typeof(e=n.weekdaysParse(e))?e:null:parseInt(e,10),this.add(t-i,"d")):i},yn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},yn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null==t)return this.day()||7;var e,n,i=(e=t,n=this.localeData(),"string"==typeof e?n.weekdaysParse(e)%7||7:isNaN(e)?null:e);return this.day(this.day()%7?i:i-7)},yn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},yn.hour=yn.hours=re,yn.minute=yn.minutes=un,yn.second=yn.seconds=fn,yn.millisecond=yn.milliseconds=gn,yn.utcOffset=function(t,e,n){var i,s=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null==t)return this._isUTC?s:ze(this);if("string"==typeof t){if(null===(t=Ye(ot,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(i=ze(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==t&&(!e||this._changeInProgress?Ze(this,qe(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this},yn.utc=function(t){return this.utcOffset(0,t)},yn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(ze(this),"m")),this},yn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ye(at,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},yn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Le(t).utcOffset():0,(this.utcOffset()-t)%60==0)},yn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yn.isLocal=function(){return!!this.isValid()&&!this._isUTC},yn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yn.isUtc=Ue,yn.isUTC=Ue,yn.zoneAbbr=function(){return this._isUTC?"UTC":""},yn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yn.dates=E("dates accessor is deprecated. Use date instead.",hn),yn.months=E("months accessor is deprecated. Use month instead",Rt),yn.years=E("years accessor is deprecated. Use year instead",At),yn.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),yn.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=Ae(t))._a){var e=t._isUTC?f(t._a):Le(t._a);this._isDSTShifted=this.isValid()&&0<T(t._a,e.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}));var bn=M.prototype;function _n(t,e,n,i){var r=de(),s=f().set(i,e);return r[n](s,t)}function xn(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return _n(t,e,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=_n(t,i,n,"month");return r}function vn(t,e,n,i){"boolean"==typeof t?c(e)&&(n=e,e=void 0):(e=t,t=!1,c(n=e)&&(n=e,e=void 0)),e=e||"";var r,s=de(),a=t?s._week.dow:0;if(null!=n)return _n(e,(n+a)%7,i,"day");var o=[];for(r=0;r<7;r++)o[r]=_n(e,(r+a)%7,i,"day");return o}bn.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return L(i)?i.call(e,n):i},bn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},bn.invalidDate=function(){return this._invalidDate},bn.ordinal=function(t){return this._ordinal.replace("%d",t)},bn.preparse=mn,bn.postformat=mn,bn.relativeTime=function(t,e,n,i){var r=this._relativeTime[n];return L(r)?r(t,e,n,i):r.replace(/%d/i,t)},bn.pastFuture=function(t,e){var n=this._relativeTime[0<t?"future":"past"];return L(n)?n(e):n.replace(/%s/i,e)},bn.set=function(t){var e,n;for(n in t)L(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},bn.months=function(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Bt).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone},bn.monthsShort=function(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Bt.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},bn.monthsParse=function(t,e,n){var i,r,s;if(this._monthsParseExact)return function(t,e,n){var i,r,s,a=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=f([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(r=St.call(this._shortMonthsParse,a))?r:null:-1!==(r=St.call(this._longMonthsParse,a))?r:null:"MMM"===e?-1!==(r=St.call(this._shortMonthsParse,a))||-1!==(r=St.call(this._longMonthsParse,a))?r:null:-1!==(r=St.call(this._longMonthsParse,a))||-1!==(r=St.call(this._shortMonthsParse,a))?r:null}.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},bn.monthsRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Yt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=Pt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},bn.monthsShortRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Yt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=$t),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},bn.week=function(t){return Wt(t,this._week.dow,this._week.doy).week},bn.firstDayOfYear=function(){return this._week.doy},bn.firstDayOfWeek=function(){return this._week.dow},bn.weekdays=function(t,e){var n=s(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?qt(n,this._week.dow):t?n[t.day()]:n},bn.weekdaysMin=function(t){return!0===t?qt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},bn.weekdaysShort=function(t){return!0===t?qt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},bn.weekdaysParse=function(t,e,n){var i,r,s;if(this._weekdaysParseExact)return function(t,e,n){var i,r,s,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(r=St.call(this._weekdaysParse,a))?r:null:"ddd"===e?-1!==(r=St.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=St.call(this._minWeekdaysParse,a))?r:null:"dddd"===e?-1!==(r=St.call(this._weekdaysParse,a))||-1!==(r=St.call(this._shortWeekdaysParse,a))||-1!==(r=St.call(this._minWeekdaysParse,a))?r:null:"ddd"===e?-1!==(r=St.call(this._shortWeekdaysParse,a))||-1!==(r=St.call(this._weekdaysParse,a))||-1!==(r=St.call(this._minWeekdaysParse,a))?r:null:-1!==(r=St.call(this._minWeekdaysParse,a))||-1!==(r=St.call(this._weekdaysParse,a))||-1!==(r=St.call(this._shortWeekdaysParse,a))?r:null}.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},bn.weekdaysRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Zt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},bn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Qt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},bn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Kt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},bn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},bn.meridiem=function(t,e,n){return 11<t?n?"pm":"PM":n?"am":"AM"},he("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),r.lang=E("moment.lang is deprecated. Use moment.locale instead.",he),r.langData=E("moment.langData is deprecated. Use moment.localeData instead.",de);var kn=Math.abs;function wn(t,e,n,i){var r=qe(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Tn(t){return t<0?Math.floor(t):Math.ceil(t)}function Cn(t){return 4800*t/146097}function En(t){return 146097*t/4800}function Sn(t){return function(){return this.as(t)}}var An=Sn("ms"),Dn=Sn("s"),Ln=Sn("m"),On=Sn("h"),Mn=Sn("d"),Bn=Sn("w"),Nn=Sn("M"),In=Sn("Q"),Fn=Sn("y");function Rn(t){return function(){return this.isValid()?this._data[t]:NaN}}var $n=Rn("milliseconds"),Pn=Rn("seconds"),Yn=Rn("minutes"),jn=Rn("hours"),zn=Rn("days"),Un=Rn("months"),Wn=Rn("years"),Hn=Math.round,qn={ss:44,s:45,m:45,h:22,d:26,M:11},Vn=Math.abs;function Gn(t){return(0<t)-(t<0)||+t}function Xn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=Vn(this._milliseconds)/1e3,i=Vn(this._days),r=Vn(this._months);e=k((t=k(n/60))/60),n%=60,t%=60;var s=k(r/12),a=r%=12,o=i,c=e,l=t,h=n?n.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var d=u<0?"-":"",f=Gn(this._months)!==Gn(u)?"-":"",p=Gn(this._days)!==Gn(u)?"-":"",g=Gn(this._milliseconds)!==Gn(u)?"-":"";return d+"P"+(s?f+s+"Y":"")+(a?f+a+"M":"")+(o?p+o+"D":"")+(c||l||h?"T":"")+(c?g+c+"H":"")+(l?g+l+"M":"")+(h?g+h+"S":"")}var Zn=Ie.prototype;return Zn.isValid=function(){return this._isValid},Zn.abs=function(){var t=this._data;return this._milliseconds=kn(this._milliseconds),this._days=kn(this._days),this._months=kn(this._months),t.milliseconds=kn(t.milliseconds),t.seconds=kn(t.seconds),t.minutes=kn(t.minutes),t.hours=kn(t.hours),t.months=kn(t.months),t.years=kn(t.years),this},Zn.add=function(t,e){return wn(this,t,e,1)},Zn.subtract=function(t,e){return wn(this,t,e,-1)},Zn.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=I(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+Cn(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(En(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},Zn.asMilliseconds=An,Zn.asSeconds=Dn,Zn.asMinutes=Ln,Zn.asHours=On,Zn.asDays=Mn,Zn.asWeeks=Bn,Zn.asMonths=Nn,Zn.asQuarters=In,Zn.asYears=Fn,Zn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN},Zn._bubble=function(){var t,e,n,i,r,s=this._milliseconds,a=this._days,o=this._months,c=this._data;return 0<=s&&0<=a&&0<=o||s<=0&&a<=0&&o<=0||(s+=864e5*Tn(En(o)+a),o=a=0),c.milliseconds=s%1e3,t=k(s/1e3),c.seconds=t%60,e=k(t/60),c.minutes=e%60,n=k(e/60),c.hours=n%24,o+=r=k(Cn(a+=k(n/24))),a-=Tn(En(r)),i=k(o/12),o%=12,c.days=a,c.months=o,c.years=i,this},Zn.clone=function(){return qe(this)},Zn.get=function(t){return t=I(t),this.isValid()?this[t+"s"]():NaN},Zn.milliseconds=$n,Zn.seconds=Pn,Zn.minutes=Yn,Zn.hours=jn,Zn.days=zn,Zn.weeks=function(){return k(this.days()/7)},Zn.months=Un,Zn.years=Wn,Zn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e,n,i,r,s,a,o,c,l,h,u,d=this.localeData(),f=(n=!t,i=d,r=qe(e=this).abs(),s=Hn(r.as("s")),a=Hn(r.as("m")),o=Hn(r.as("h")),c=Hn(r.as("d")),l=Hn(r.as("M")),h=Hn(r.as("y")),(u=s<=qn.ss&&["s",s]||s<qn.s&&["ss",s]||a<=1&&["m"]||a<qn.m&&["mm",a]||o<=1&&["h"]||o<qn.h&&["hh",o]||c<=1&&["d"]||c<qn.d&&["dd",c]||l<=1&&["M"]||l<qn.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=n,u[3]=0<+e,u[4]=i,function(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}.apply(null,u));return t&&(f=d.pastFuture(+this,f)),d.postformat(f)},Zn.toISOString=Xn,Zn.toString=Xn,Zn.toJSON=Xn,Zn.locale=tn,Zn.localeData=nn,Zn.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),Zn.lang=en,W("X",0,0,"unix"),W("x",0,0,"valueOf"),ht("x",st),ht("X",/[+-]?\d+(\.\d{1,3})?/),pt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))})),pt("x",(function(t,e,n){n._d=new Date(w(t))})),r.version="2.24.0",e=Le,r.fn=yn,r.min=function(){return Be("isBefore",[].slice.call(arguments,0))},r.max=function(){return Be("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=f,r.unix=function(t){return Le(1e3*t)},r.months=function(t,e){return xn(t,e,"months")},r.isDate=l,r.locale=he,r.invalid=y,r.duration=qe,r.isMoment=v,r.weekdays=function(t,e,n){return vn(t,e,n,"weekdays")},r.parseZone=function(){return Le.apply(null,arguments).parseZone()},r.localeData=de,r.isDuration=Fe,r.monthsShort=function(t,e){return xn(t,e,"monthsShort")},r.weekdaysMin=function(t,e,n){return vn(t,e,n,"weekdaysMin")},r.defineLocale=ue,r.updateLocale=function(t,e){if(null!=e){var n,i,r=se;null!=(i=le(t))&&(r=i._config),(n=new M(e=O(r,e))).parentLocale=ae[t],ae[t]=n,he(t)}else null!=ae[t]&&(null!=ae[t].parentLocale?ae[t]=ae[t].parentLocale:null!=ae[t]&&delete ae[t]);return ae[t]},r.locales=function(){return S(ae)},r.weekdaysShort=function(t,e,n){return vn(t,e,n,"weekdaysShort")},r.normalizeUnits=I,r.relativeTimeRounding=function(t){return void 0===t?Hn:"function"==typeof t&&(Hn=t,!0)},r.relativeTimeThreshold=function(t,e){return void 0!==qn[t]&&(void 0===e?qn[t]:(qn[t]=e,"s"===t&&(qn.ss=e-1),!0))},r.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=yn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";var t=n(941),e=n(967);function i(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function r(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function s(t){return t}var a=1e-6;function o(t){return"translate("+t+",0)"}function l(t){return"translate(0,"+t+")"}function h(t){return e=>+t(e)}function u(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function d(){return!this.__axis}function f(t,e){var n=[],i=null,r=null,c=6,f=6,p=3,g="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,y=1===t||4===t?-1:1,m=4===t||2===t?"x":"y",b=1===t||3===t?o:l;function _(o){var l=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,_=null==r?e.tickFormat?e.tickFormat.apply(e,n):s:r,x=Math.max(c,0)+p,v=e.range(),k=+v[0]+g,w=+v[v.length-1]+g,T=(e.bandwidth?u:h)(e.copy(),g),C=o.selection?o.selection():o,E=C.selectAll(".domain").data([null]),S=C.selectAll(".tick").data(l,e).order(),A=S.exit(),D=S.enter().append("g").attr("class","tick"),L=S.select("line"),O=S.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(D),L=L.merge(D.append("line").attr("stroke","currentColor").attr(m+"2",y*c)),O=O.merge(D.append("text").attr("fill","currentColor").attr(m,y*x).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),o!==C&&(E=E.transition(o),S=S.transition(o),L=L.transition(o),O=O.transition(o),A=A.transition(o).attr("opacity",a).attr("transform",(function(t){return isFinite(t=T(t))?b(t+g):this.getAttribute("transform")})),D.attr("opacity",a).attr("transform",(function(t){var e=this.parentNode.__axis;return b((e&&isFinite(e=e(t))?e:T(t))+g)}))),A.remove(),E.attr("d",4===t||2===t?f?"M"+y*f+","+k+"H"+g+"V"+w+"H"+y*f:"M"+g+","+k+"V"+w:f?"M"+k+","+y*f+"V"+g+"H"+w+"V"+y*f:"M"+k+","+g+"H"+w),S.attr("opacity",1).attr("transform",(function(t){return b(T(t)+g)})),L.attr(m+"2",y*c),O.attr(m,y*x).text(_),C.filter(d).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),C.each((function(){this.__axis=T}))}return _.scale=function(t){return arguments.length?(e=t,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),_):n.slice()},_.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),_):i&&i.slice()},_.tickFormat=function(t){return arguments.length?(r=t,_):r},_.tickSize=function(t){return arguments.length?(c=f=+t,_):c},_.tickSizeInner=function(t){return arguments.length?(c=+t,_):c},_.tickSizeOuter=function(t){return arguments.length?(f=+t,_):f},_.tickPadding=function(t){return arguments.length?(p=+t,_):p},_.offset=function(t){return arguments.length?(g=+t,_):g},_}function p(){}function g(t){return null==t?p:function(){return this.querySelector(t)}}function y(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function m(){return[]}function b(t){return null==t?m:function(){return this.querySelectorAll(t)}}function _(t){return function(){return this.matches(t)}}function x(t){return function(e){return e.matches(t)}}var v=Array.prototype.find;function k(){return this.firstElementChild}var w=Array.prototype.filter;function T(){return Array.from(this.children)}function C(t){return new Array(t.length)}function E(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function S(t){return function(){return t}}function A(t,e,n,i,r,s){for(var a,o=0,c=e.length,l=s.length;o<l;++o)(a=e[o])?(a.__data__=s[o],i[o]=a):n[o]=new E(t,s[o]);for(;o<c;++o)(a=e[o])&&(r[o]=a)}function D(t,e,n,i,r,s,a){var o,c,l,h=new Map,u=e.length,d=s.length,f=new Array(u);for(o=0;o<u;++o)(c=e[o])&&(f[o]=l=a.call(c,c.__data__,o,e)+"",h.has(l)?r[o]=c:h.set(l,c));for(o=0;o<d;++o)l=a.call(t,s[o],o,s)+"",(c=h.get(l))?(i[o]=c,c.__data__=s[o],h.delete(l)):n[o]=new E(t,s[o]);for(o=0;o<u;++o)(c=e[o])&&h.get(f[o])===c&&(r[o]=c)}function L(t){return t.__data__}function O(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function M(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}E.prototype={constructor:E,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var B="http://www.w3.org/1999/xhtml";const N={svg:"http://www.w3.org/2000/svg",xhtml:B,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),N.hasOwnProperty(e)?{space:N[e],local:t}:t}function F(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $(t,e){return function(){this.setAttribute(t,e)}}function P(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Y(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function j(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function z(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function U(t){return function(){this.style.removeProperty(t)}}function W(t,e,n){return function(){this.style.setProperty(t,e,n)}}function H(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function q(t,e){return t.style.getPropertyValue(e)||z(t).getComputedStyle(t,null).getPropertyValue(e)}function V(t){return function(){delete this[t]}}function G(t,e){return function(){this[t]=e}}function X(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Z(t){return t.trim().split(/^|\s+/)}function Q(t){return t.classList||new K(t)}function K(t){this._node=t,this._names=Z(t.getAttribute("class")||"")}function J(t,e){for(var n=Q(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function tt(t,e){for(var n=Q(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function et(t){return function(){J(this,t)}}function nt(t){return function(){tt(this,t)}}function it(t,e){return function(){(e.apply(this,arguments)?J:tt)(this,t)}}function rt(){this.textContent=""}function st(t){return function(){this.textContent=t}}function at(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ot(){this.innerHTML=""}function ct(t){return function(){this.innerHTML=t}}function lt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ht(){this.nextSibling&&this.parentNode.appendChild(this)}function ut(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===B&&e.documentElement.namespaceURI===B?e.createElement(t):e.createElementNS(n,t)}}function ft(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pt(t){var e=I(t);return(e.local?ft:dt)(e)}function gt(){return null}function yt(){var t=this.parentNode;t&&t.removeChild(this)}function mt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function bt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _t(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function xt(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i<s;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function vt(t,e,n){return function(){var i,r=this.__on,s=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),void(i.value=e);this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function kt(t,e,n){var i=z(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function wt(t,e){return function(){return kt(this,t,e)}}function Tt(t,e){return function(){return kt(this,t,e.apply(this,arguments))}}K.prototype={add:function(t){this._names.indexOf(t)<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}};var Ct=[null];function Et(t,e){this._groups=t,this._parents=e}function St(){return new Et([[document.documentElement]],Ct)}Et.prototype=St.prototype={constructor:Et,select:function(t){"function"!=typeof t&&(t=g(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,a,o=e[r],c=o.length,l=i[r]=new Array(c),h=0;h<c;++h)(s=o[h])&&(a=t.call(s,s.__data__,h,o))&&("__data__"in s&&(a.__data__=s.__data__),l[h]=a);return new Et(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return y(t.apply(this,arguments))}}(t):b(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var a,o=e[s],c=o.length,l=0;l<c;++l)(a=o[l])&&(i.push(t.call(a,a.__data__,l,o)),r.push(a));return new Et(i,r)},selectChild:function(t){return this.select(null==t?k:function(t){return function(){return v.call(this.children,t)}}("function"==typeof t?t:x(t)))},selectChildren:function(t){return this.selectAll(null==t?T:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:x(t)))},filter:function(t){"function"!=typeof t&&(t=_(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,a=e[r],o=a.length,c=i[r]=[],l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&c.push(s);return new Et(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,L);var n=e?D:A,i=this._parents,r=this._groups;"function"!=typeof t&&(t=S(t));for(var s=r.length,a=new Array(s),o=new Array(s),c=new Array(s),l=0;l<s;++l){var h=i[l],u=r[l],d=u.length,f=O(t.call(h,h&&h.__data__,l,i)),p=f.length,g=o[l]=new Array(p),y=a[l]=new Array(p),m=c[l]=new Array(d);n(h,u,g,y,m,f,e);for(var b,_,x=0,v=0;x<p;++x)if(b=g[x]){for(x>=v&&(v=x+1);!(_=y[v])&&++v<p;);b._next=_||null}}return(a=new Et(a,i))._enter=o,a._exit=c,a},enter:function(){return new Et(this._enter||this._groups.map(C),this._parents)},exit:function(){return new Et(this._exit||this._groups.map(C),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,s=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?s.remove():n(s),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),c=0;c<a;++c)for(var l,h=n[c],u=i[c],d=h.length,f=o[c]=new Array(d),p=0;p<d;++p)(l=h[p]||u[p])&&(f[p]=l);for(;c<r;++c)o[c]=n[c];return new Et(o,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],s=r.length-1,a=r[s];--s>=0;)(i=r[s])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=M);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a,o=n[s],c=o.length,l=r[s]=new Array(c),h=0;h<c;++h)(a=o[h])&&(l[h]=a);l.sort(e)}return new Et(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,s=e[n],a=0,o=s.length;a<o;++a)(r=s[a])&&t.call(r,r.__data__,a,s);return this},attr:function(t,e){var n=I(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?R:F:"function"==typeof e?n.local?j:Y:n.local?P:$)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?U:"function"==typeof e?H:W)(t,e,null==n?"":n)):q(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?V:"function"==typeof e?X:G)(t,e)):this.node()[t]},classed:function(t,e){var n=Z(t+"");if(arguments.length<2){for(var i=Q(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?it:e?et:nt)(n,e))},text:function(t){return arguments.length?this.each(null==t?rt:("function"==typeof t?at:st)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ot:("function"==typeof t?lt:ct)(t)):this.node().innerHTML},raise:function(){return this.each(ht)},lower:function(){return this.each(ut)},append:function(t){var e="function"==typeof t?t:pt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:pt(t),i=null==e?gt:"function"==typeof e?e:g(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(yt)},clone:function(t){return this.select(t?bt:mt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,s=_t(t+""),a=s.length;if(!(arguments.length<2)){for(o=e?vt:xt,i=0;i<a;++i)this.each(o(s[i],e,n));return this}var o=this.node().__on;if(o)for(var c,l=0,h=o.length;l<h;++l)for(i=0,c=o[l];i<a;++i)if((r=s[i]).type===c.type&&r.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?Tt:wt)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],s=0,a=r.length;s<a;++s)(i=r[s])&&(yield i)}};const At=St;var Dt={value:()=>{}};function Lt(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Ot(i)}function Ot(t){this._=t}function Mt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Bt(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Nt(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Dt,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Ot.prototype=Lt.prototype={constructor:Ot,on:function(t,e){var n,i=this._,r=Mt(t+"",i),s=-1,a=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=r[s]).type)i[n]=Nt(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Nt(i[n],t.name,null);return this}for(;++s<a;)if((n=(t=r[s]).type)&&(n=Bt(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ot(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),s=0;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=0,n=(i=this._[t]).length;s<n;++s)i[s].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};const It=Lt;var Ft,Rt,$t=0,Pt=0,Yt=0,jt=0,zt=0,Ut=0,Wt="object"==typeof performance&&performance.now?performance:Date,Ht="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qt(){return zt||(Ht(Vt),zt=Wt.now()+Ut)}function Vt(){zt=0}function Gt(){this._call=this._time=this._next=null}function Xt(t,e,n){var i=new Gt;return i.restart(t,e,n),i}function Zt(){zt=(jt=Wt.now())+Ut,$t=Pt=0;try{!function(){qt(),++$t;for(var t,e=Ft;e;)(t=zt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--$t}()}finally{$t=0,function(){var t,e,n=Ft,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ft=e);Rt=t,Kt(i)}(),zt=0}}function Qt(){var t=Wt.now(),e=t-jt;e>1e3&&(Ut-=e,jt=t)}function Kt(t){$t||(Pt&&(Pt=clearTimeout(Pt)),t-zt>24?(t<1/0&&(Pt=setTimeout(Zt,t-Wt.now()-Ut)),Yt&&(Yt=clearInterval(Yt))):(Yt||(jt=Wt.now(),Yt=setInterval(Qt,1e3)),$t=1,Ht(Zt)))}function Jt(t,e,n){var i=new Gt;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}Gt.prototype=Xt.prototype={constructor:Gt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?qt():+n)+(null==e?0:+e),this._next||Rt===this||(Rt?Rt._next=this:Ft=this,Rt=this),this._call=t,this._time=n,Kt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Kt())}};var te=It("start","end","cancel","interrupt"),ee=[];function ne(t,e,n,i,r,s){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(t){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(s){var l,h,u,d;if(1!==n.state)return c();for(l in r)if((d=r[l]).name===n.name){if(3===d.state)return Jt(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[l]):+l<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[l])}if(Jt((function(){3===n.state&&(n.state=4,n.timer.restart(o,n.delay,n.time),o(s))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(u=n.tween.length),l=0,h=-1;l<u;++l)(d=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=d);i.length=h+1}}function o(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(c),n.state=5,1),s=-1,a=i.length;++s<a;)i[s].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=Xt(s,0,n.time)}(t,n,{name:e,index:i,group:r,on:te,tween:ee,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:0})}function ie(t,e){var n=se(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function re(t,e){var n=se(t,e);if(n.state>3)throw new Error("too late; already running");return n}function se(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ae(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe,ce=180/Math.PI,le={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function he(t,e,n,i,r,s){var a,o,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,c/=o),t*i<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*ce,skewX:Math.atan(c)*ce,scaleX:a,scaleY:o}}function ue(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(s,a){var o=[],c=[];return s=t(s),a=t(a),function(t,i,r,s,a,o){if(t!==r||i!==s){var c=a.push("translate(",null,e,null,n);o.push({i:c-4,x:ae(t,r)},{i:c-2,x:ae(i,s)})}else(r||s)&&a.push("translate("+r+e+s+n)}(s.translateX,s.translateY,a.translateX,a.translateY,o,c),function(t,e,n,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ae(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,a.rotate,o,c),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ae(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,a.skewX,o,c),function(t,e,n,i,s,a){if(t!==n||e!==i){var o=s.push(r(s)+"scale(",null,",",null,")");a.push({i:o-4,x:ae(t,n)},{i:o-2,x:ae(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,a.scaleX,a.scaleY,o,c),s=a=null,function(t){for(var e,n=-1,i=c.length;++n<i;)o[(e=c[n]).i]=e.x(t);return o.join("")}}}var de=ue((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?le:he(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),fe=ue((function(t){return null==t?le:(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),(t=oe.transform.baseVal.consolidate())?he((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):le)}),", ",")",")");function pe(t,e){var n,i;return function(){var r=re(this,t),s=r.tween;if(s!==n)for(var a=0,o=(i=n=s).length;a<o;++a)if(i[a].name===e){(i=i.slice()).splice(a,1);break}r.tween=i}}function ge(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var s=re(this,t),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:e,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===e){r[c]=o;break}c===l&&r.push(o)}s.tween=r}}function ye(t,e,n){var i=t._id;return t.each((function(){var t=re(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return se(t,i).value[e]}}function me(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function be(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function _e(){}var xe=.7,ve=1/xe,ke="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Te="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ce=/^#([0-9a-f]{3,8})$/,Ee=new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`),Se=new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`),Ae=new RegExp(`^rgba\\(${ke},${ke},${ke},${we}\\)$`),De=new RegExp(`^rgba\\(${Te},${Te},${Te},${we}\\)$`),Le=new RegExp(`^hsl\\(${we},${Te},${Te}\\)$`),Oe=new RegExp(`^hsla\\(${we},${Te},${Te},${we}\\)$`),Me={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Be(){return this.rgb().formatHex()}function Ne(){return this.rgb().formatRgb()}function Ie(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ce.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Fe(e):3===n?new Ye(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Re(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Re(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ee.exec(t))?new Ye(e[1],e[2],e[3],1):(e=Se.exec(t))?new Ye(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ae.exec(t))?Re(e[1],e[2],e[3],e[4]):(e=De.exec(t))?Re(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Le.exec(t))?qe(e[1],e[2]/100,e[3]/100,1):(e=Oe.exec(t))?qe(e[1],e[2]/100,e[3]/100,e[4]):Me.hasOwnProperty(t)?Fe(Me[t]):"transparent"===t?new Ye(NaN,NaN,NaN,0):null}function Fe(t){return new Ye(t>>16&255,t>>8&255,255&t,1)}function Re(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ye(t,e,n,i)}function $e(t){return t instanceof _e||(t=Ie(t)),t?new Ye((t=t.rgb()).r,t.g,t.b,t.opacity):new Ye}function Pe(t,e,n,i){return 1===arguments.length?$e(t):new Ye(t,e,n,null==i?1:i)}function Ye(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function je(){return`#${He(this.r)}${He(this.g)}${He(this.b)}`}function ze(){const t=Ue(this.opacity);return`${1===t?"rgb(":"rgba("}${We(this.r)}, ${We(this.g)}, ${We(this.b)}${1===t?")":`, ${t})`}`}function Ue(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function We(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function He(t){return((t=We(t))<16?"0":"")+t.toString(16)}function qe(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ge(t,e,n,i)}function Ve(t){if(t instanceof Ge)return new Ge(t.h,t.s,t.l,t.opacity);if(t instanceof _e||(t=Ie(t)),!t)return new Ge;if(t instanceof Ge)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),a=NaN,o=s-r,c=(s+r)/2;return o?(a=e===s?(n-i)/o+6*(n<i):n===s?(i-e)/o+2:(e-n)/o+4,o/=c<.5?s+r:2-s-r,a*=60):o=c>0&&c<1?0:a,new Ge(a,o,c,t.opacity)}function Ge(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Xe(t){return(t=(t||0)%360)<0?t+360:t}function Ze(t){return Math.max(0,Math.min(1,t||0))}function Qe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ke(t,e,n,i,r){var s=t*t,a=s*t;return((1-3*t+3*s-a)*e+(4-6*s+3*a)*n+(1+3*t+3*s-3*a)*i+a*r)/6}me(_e,Ie,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Be,formatHex:Be,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ve(this).formatHsl()},formatRgb:Ne,toString:Ne}),me(Ye,Pe,be(_e,{brighter(t){return t=null==t?ve:Math.pow(ve,t),new Ye(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?xe:Math.pow(xe,t),new Ye(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ye(We(this.r),We(this.g),We(this.b),Ue(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:je,formatHex:je,formatHex8:function(){return`#${He(this.r)}${He(this.g)}${He(this.b)}${He(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ze,toString:ze})),me(Ge,(function(t,e,n,i){return 1===arguments.length?Ve(t):new Ge(t,e,n,null==i?1:i)}),be(_e,{brighter(t){return t=null==t?ve:Math.pow(ve,t),new Ge(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?xe:Math.pow(xe,t),new Ge(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ye(Qe(t>=240?t-240:t+120,r,i),Qe(t,r,i),Qe(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Ge(Xe(this.h),Ze(this.s),Ze(this.l),Ue(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=Ue(this.opacity);return`${1===t?"hsl(":"hsla("}${Xe(this.h)}, ${100*Ze(this.s)}%, ${100*Ze(this.l)}%${1===t?")":`, ${t})`}`}}));const Je=t=>()=>t;function tn(t,e){return function(n){return t+n*e}}function en(t){return 1==(t=+t)?nn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Je(isNaN(e)?n:e)}}function nn(t,e){var n=e-t;return n?tn(t,n):Je(isNaN(t)?e:t)}const rn=function t(e){var n=en(e);function i(t,e){var i=n((t=Pe(t)).r,(e=Pe(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),a=nn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function sn(t){return function(e){var n,i,r=e.length,s=new Array(r),a=new Array(r),o=new Array(r);for(n=0;n<r;++n)i=Pe(e[n]),s[n]=i.r||0,a[n]=i.g||0,o[n]=i.b||0;return s=t(s),a=t(a),o=t(o),i.opacity=1,function(t){return i.r=s(t),i.g=a(t),i.b=o(t),i+""}}}sn((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1],a=i>0?t[i-1]:2*r-s,o=i<e-1?t[i+2]:2*s-r;return Ke((n-i/e)*e,a,r,s,o)}})),sn((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],s=t[i%e],a=t[(i+1)%e],o=t[(i+2)%e];return Ke((n-i/e)*e,r,s,a,o)}}));var an=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,on=new RegExp(an.source,"g");function cn(t,e){var n,i,r,s=an.lastIndex=on.lastIndex=0,a=-1,o=[],c=[];for(t+="",e+="";(n=an.exec(t))&&(i=on.exec(e));)(r=i.index)>s&&(r=e.slice(s,r),o[a]?o[a]+=r:o[++a]=r),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:ae(n,i)})),s=on.lastIndex;return s<e.length&&(r=e.slice(s),o[a]?o[a]+=r:o[++a]=r),o.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var n,i=0;i<e;++i)o[(n=c[i]).i]=n.x(t);return o.join("")})}function ln(t,e){var n;return("number"==typeof e?ae:e instanceof Ie?rn:(n=Ie(e))?(e=n,rn):cn)(t,e)}function hn(t){return function(){this.removeAttribute(t)}}function un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function dn(t,e,n){var i,r,s=n+"";return function(){var a=this.getAttribute(t);return a===s?null:a===i?r:r=e(i=a,n)}}function fn(t,e,n){var i,r,s=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===s?null:a===i?r:r=e(i=a,n)}}function pn(t,e,n){var i,r,s;return function(){var a,o,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(o=c+"")?null:a===i&&o===r?s:(r=o,s=e(i=a,c));this.removeAttribute(t)}}function gn(t,e,n){var i,r,s;return function(){var a,o,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(o=c+"")?null:a===i&&o===r?s:(r=o,s=e(i=a,c));this.removeAttributeNS(t.space,t.local)}}function yn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function mn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function bn(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&mn(t,r)),n}return r._value=e,r}function _n(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&yn(t,r)),n}return r._value=e,r}function xn(t,e){return function(){ie(this,t).delay=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){ie(this,t).delay=e}}function kn(t,e){return function(){re(this,t).duration=+e.apply(this,arguments)}}function wn(t,e){return e=+e,function(){re(this,t).duration=e}}function Tn(t,e){if("function"!=typeof e)throw new Error;return function(){re(this,t).ease=e}}function Cn(t,e,n){var i,r,s=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ie:re;return function(){var a=s(this,t),o=a.on;o!==i&&(r=(i=o).copy()).on(e,n),a.on=r}}var En=At.prototype.constructor;function Sn(t){return function(){this.style.removeProperty(t)}}function An(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function Dn(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&An(t,s,n)),i}return s._value=e,s}function Ln(t){return function(e){this.textContent=t.call(this,e)}}function On(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Ln(i)),e}return i._value=t,i}var Mn=0;function Bn(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Nn(){return++Mn}var In=At.prototype;Bn.prototype=function(t){return At().transition(t)}.prototype={constructor:Bn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=g(t));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o,c,l=i[a],h=l.length,u=s[a]=new Array(h),d=0;d<h;++d)(o=l[d])&&(c=t.call(o,o.__data__,d,l))&&("__data__"in o&&(c.__data__=o.__data__),u[d]=c,ne(u[d],e,n,d,u,se(o,n)));return new Bn(s,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=b(t));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var c,l=i[o],h=l.length,u=0;u<h;++u)if(c=l[u]){for(var d,f=t.call(c,c.__data__,u,l),p=se(c,n),g=0,y=f.length;g<y;++g)(d=f[g])&&ne(d,e,n,g,f,p);s.push(f),a.push(c)}return new Bn(s,a,e,n)},selectChild:In.selectChild,selectChildren:In.selectChildren,filter:function(t){"function"!=typeof t&&(t=_(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,a=e[r],o=a.length,c=i[r]=[],l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&c.push(s);return new Bn(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var c,l=e[o],h=n[o],u=l.length,d=a[o]=new Array(u),f=0;f<u;++f)(c=l[f]||h[f])&&(d[f]=c);for(;o<i;++o)a[o]=e[o];return new Bn(a,this._parents,this._name,this._id)},selection:function(){return new En(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Nn(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a,o=i[s],c=o.length,l=0;l<c;++l)if(a=o[l]){var h=se(a,e);ne(a,t,n,l,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Bn(i,this._parents,t,n)},call:In.call,nodes:In.nodes,node:In.node,size:In.size,empty:In.empty,each:In.each,on:function(t,e){var n=this._id;return arguments.length<2?se(this.node(),n).on.on(t):this.each(Cn(n,t,e))},attr:function(t,e){var n=I(t),i="transform"===n?fe:ln;return this.attrTween(t,"function"==typeof e?(n.local?gn:pn)(n,i,ye(this,"attr."+t,e)):null==e?(n.local?un:hn)(n):(n.local?fn:dn)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=I(t);return this.tween(n,(i.local?bn:_n)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?de:ln;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var s=q(this,t),a=(this.style.removeProperty(t),q(this,t));return s===a?null:s===n&&a===i?r:r=e(n=s,i=a)}}(t,i)).on("end.style."+t,Sn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,s;return function(){var a=q(this,t),o=n(this),c=o+"";return null==o&&(this.style.removeProperty(t),c=o=q(this,t)),a===c?null:a===i&&c===r?s:(r=c,s=e(i=a,o))}}(t,i,ye(this,"style."+t,e))).each(function(t,e){var n,i,r,s,a="style."+e,o="end."+a;return function(){var c=re(this,t),l=c.on,h=null==c.value[a]?s||(s=Sn(e)):void 0;l===n&&r===h||(i=(n=l).copy()).on(o,r=h),c.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,s=n+"";return function(){var a=q(this,t);return a===s?null:a===i?r:r=e(i=a,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,Dn(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,On(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=se(this.node(),n).tween,s=0,a=r.length;s<a;++s)if((i=r[s]).name===t)return i.value;return null}return this.each((null==e?pe:ge)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xn:vn)(e,t)):se(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?kn:wn)(e,t)):se(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Tn(e,t)):se(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;re(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(s,a){var o={value:a},c={value:function(){0==--r&&s()}};n.each((function(){var n=re(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(o),e._.interrupt.push(o),e._.end.push(c)),n.on=e})),0===r&&s()}))},[Symbol.iterator]:In[Symbol.iterator]};var Fn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Rn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}At.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,i,r,s=t.__transition,a=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):a=!1;a&&delete t.__transition}}(this,t)}))},At.prototype.transition=function(t){var e,n;t instanceof Bn?(e=t._id,t=t._name):(e=Nn(),(n=Fn).time=qt(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a,o=i[s],c=o.length,l=0;l<c;++l)(a=o[l])&&ne(a,t,e,l,o,n||Rn(a,e));return new Bn(i,this._parents,t,e)};const{abs:$n,max:Pn,min:Yn}=Math;function jn(t){return[+t[0],+t[1]]}function zn(t){return[jn(t[0]),jn(t[1])]}["w","e"].map(Un),["n","s"].map(Un),["n","w","e","s","nw","ne","sw","se"].map(Un);function Un(t){return{type:t}}function Wn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Hn(t){return(e,n)=>function(t,e){return fetch(t,e).then(Wn)}(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}Hn("application/xml");Hn("text/html"),Hn("image/svg+xml");const qn=Math.PI/180,Vn=180/Math.PI,Gn=.96422,Xn=.82521,Zn=4/29,Qn=6/29,Kn=3*Qn*Qn;function Jn(t){if(t instanceof ti)return new ti(t.l,t.a,t.b,t.opacity);if(t instanceof oi)return ci(t);t instanceof Ye||(t=$e(t));var e,n,i=ri(t.r),r=ri(t.g),s=ri(t.b),a=ei((.2225045*i+.7168786*r+.0606169*s)/1);return i===r&&r===s?e=n=a:(e=ei((.4360747*i+.3850649*r+.1430804*s)/Gn),n=ei((.0139322*i+.0971045*r+.7141733*s)/Xn)),new ti(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ti(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function ei(t){return t>.008856451679035631?Math.pow(t,1/3):t/Kn+Zn}function ni(t){return t>Qn?t*t*t:Kn*(t-Zn)}function ii(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ri(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function si(t){if(t instanceof oi)return new oi(t.h,t.c,t.l,t.opacity);if(t instanceof ti||(t=Jn(t)),0===t.a&&0===t.b)return new oi(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Vn;return new oi(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function ai(t,e,n,i){return 1===arguments.length?si(t):new oi(t,e,n,null==i?1:i)}function oi(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function ci(t){if(isNaN(t.h))return new ti(t.l,0,0,t.opacity);var e=t.h*qn;return new ti(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function li(t){return function(e,n){var i=t((e=ai(e)).h,(n=ai(n)).h),r=nn(e.c,n.c),s=nn(e.l,n.l),a=nn(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=s(t),e.opacity=a(t),e+""}}}me(ti,(function(t,e,n,i){return 1===arguments.length?Jn(t):new ti(t,e,n,null==i?1:i)}),be(_e,{brighter(t){return new ti(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ti(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Ye(ii(3.1338561*(e=Gn*ni(e))-1.6168667*(t=1*ni(t))-.4906146*(n=Xn*ni(n))),ii(-.9787684*e+1.9161415*t+.033454*n),ii(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),me(oi,ai,be(_e,{brighter(t){return new oi(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new oi(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ci(this).rgb()}}));const hi=li((function(t,e){var n=e-t;return n?tn(t,n>180||n<-180?n-360*Math.round(n/360):n):Je(isNaN(t)?e:t)}));li(nn);var ui=Math.sqrt(50),di=Math.sqrt(10),fi=Math.sqrt(2);function pi(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=ui?10:s>=di?5:s>=fi?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=ui?10:s>=di?5:s>=fi?2:1)}function gi(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=ui?r*=10:s>=di?r*=5:s>=fi&&(r*=2),e<t?-r:r}function yi(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mi(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bi(t){let e,n,i;function r(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<0?r=e+1:s=e}while(r<s)}return r}return 2!==t.length?(e=yi,n=(e,n)=>yi(t(e),n),i=(e,n)=>t(e)-n):(e=t===yi||t===mi?t:_i,n=t,i=t),{left:r,center:function(t,e,n=0,s=t.length){const a=r(t,e,n,s-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<=0?r=e+1:s=e}while(r<s)}return r}}}function _i(){return 0}const xi=bi(yi),vi=xi.right,ki=(xi.left,bi((function(t){return null===t?NaN:+t})).center,vi);function wi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,s=new Array(r),a=new Array(i);for(n=0;n<r;++n)s[n]=Si(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=s[n](t);return a}}function Ti(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ci(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Si(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}function Ei(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}}function Si(t,e){var n,i,r=typeof e;return null==e||"boolean"===r?Je(e):("number"===r?ae:"string"===r?(n=Ie(e))?(e=n,rn):cn:e instanceof Ie?rn:e instanceof Date?Ti:(i=e,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(e)?wi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ci:ae:Ei))(t,e)}function Ai(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Di(t){return+t}var Li=[0,1];function Oi(t){return t}function Mi(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Bi(t,e,n){var i=t[0],r=t[1],s=e[0],a=e[1];return r<i?(i=Mi(r,i),s=n(a,s)):(i=Mi(i,r),s=n(s,a)),function(t){return s(i(t))}}function Ni(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=Mi(t[a],t[a+1]),s[a]=n(e[a],e[a+1]);return function(e){var n=ki(t,e,1,i)-1;return s[n](r[n](e))}}function Ii(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Fi(){var t,e,n,i,r,s,a=Li,o=Li,c=Si,l=Oi;function h(){var t,e,n,c=Math.min(a.length,o.length);return l!==Oi&&(t=a[0],e=a[c-1],t>e&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),i=c>2?Ni:Bi,r=s=null,u}function u(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),o,c)))(t(l(e)))}return u.invert=function(n){return l(e((s||(s=i(o,a.map(t),ae)))(n)))},u.domain=function(t){return arguments.length?(a=Array.from(t,Di),h()):a.slice()},u.range=function(t){return arguments.length?(o=Array.from(t),h()):o.slice()},u.rangeRound=function(t){return o=Array.from(t),c=Ai,h()},u.clamp=function(t){return arguments.length?(l=!!t||Oi,h()):l!==Oi},u.interpolate=function(t){return arguments.length?(c=t,h()):c},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,i){return t=n,e=i,h()}}function Ri(){return Fi()(Oi,Oi)}function $i(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Pi,Yi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ji(t){if(!(e=Yi.exec(t)))throw new Error("invalid format: "+t);var e;return new zi({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]})}function zi(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ui(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Wi(t){return(t=Ui(Math.abs(t)))?t[1]:NaN}function Hi(t,e){var n=Ui(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}ji.prototype=zi.prototype,zi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const qi={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},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)=>Hi(100*t,e),r:Hi,s:function(t,e){var n=Ui(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(Pi=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Ui(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Vi(t){return t}var Gi,Xi,Zi,Qi=Array.prototype.map,Ki=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ji(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Vi:(e=Qi.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],a=0,o=e[0],c=0;r>0&&o>0&&(c+o+1>i&&(o=Math.max(1,i-c)),s.push(t.substring(r-=o,r+o)),!((c+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Vi:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Qi.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=ji(t)).fill,n=t.align,u=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,y=t.precision,m=t.trim,b=t.type;"n"===b?(g=!0,b="g"):qi[b]||(void 0===y&&(y=12),m=!0,b="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===d?r:"#"===d&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",x="$"===d?s:/[%p]/.test(b)?c:"",v=qi[b],k=/[defgprs%]/.test(b);function w(t){var r,s,c,d=_,w=x;if("c"===b)w=v(t)+w,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:v(Math.abs(t),y),m&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==u&&(T=!1),d=(T?"("===u?u:l:"-"===u||"("===u?"":u)+d,w=("s"===b?Ki[8+Pi/3]:"")+w+(T&&"("===u?")":""),k)for(r=-1,s=t.length;++r<s;)if(48>(c=t.charCodeAt(r))||c>57){w=(46===c?a+t.slice(r+1):t.slice(r))+w,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var C=d.length+t.length+w.length,E=C<p?new Array(p-C+1).join(e):"";switch(g&&f&&(t=i(E+t,E.length?p-w.length:1/0),E=""),n){case"<":t=d+t+w+E;break;case"=":t=d+E+t+w;break;case"^":t=E.slice(0,C=E.length>>1)+d+t+w+E.slice(C);break;default:t=E+d+t+w}return o(t)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),w.toString=function(){return t+""},w}return{format:u,formatPrefix:function(t,e){var n=u(((t=ji(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Wi(e)/3))),r=Math.pow(10,-i),s=Ki[8+i/3];return function(t){return n(r*t)+s}}}}function tr(t,e,n,i){var r,s=gi(t,e,n);switch((i=ji(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Wi(e)/3)))-Wi(Math.abs(t)))}(s,a))||(i.precision=r),Zi(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Wi(e)-Wi(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Wi(Math.abs(t)))}(s))||(i.precision=r-2*("%"===i.type))}return Xi(i)}function er(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var i,r,s,a,o=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(a=pi(t,e,n))||!isFinite(a))return[];if(a>0){let n=Math.round(t/a),i=Math.round(e/a);for(n*a<t&&++n,i*a>e&&--i,s=new Array(r=i-n+1);++o<r;)s[o]=(n+o)*a}else{a=-a;let n=Math.round(t*a),i=Math.round(e*a);for(n/a<t&&++n,i/a>e&&--i,s=new Array(r=i-n+1);++o<r;)s[o]=(n+o)/a}return i&&s.reverse(),s}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return tr(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,s=e(),a=0,o=s.length-1,c=s[a],l=s[o],h=10;for(l<c&&(r=c,c=l,l=r,r=a,a=o,o=r);h-- >0;){if((r=pi(c,l,n))===i)return s[a]=c,s[o]=l,e(s);if(r>0)c=Math.floor(c/r)*r,l=Math.ceil(l/r)*r;else{if(!(r<0))break;c=Math.ceil(c*r)/r,l=Math.floor(l*r)/r}i=r}return t},t}function nr(){var t=Ri();return t.copy=function(){return Ii(t,nr())},$i.apply(t,arguments),er(t)}Gi=Ji({thousands:",",grouping:[3],currency:["$",""]}),Xi=Gi.format,Zi=Gi.formatPrefix;class ir extends Map{constructor(t,e=or){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(rr(this,t))}has(t){return super.has(rr(this,t))}set(t,e){return super.set(sr(this,t),e)}delete(t){return super.delete(ar(this,t))}}Set;function rr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function sr({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function ar({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function or(t){return null!==t&&"object"==typeof t?t.valueOf():t}const cr=Symbol("implicit");function lr(){var t=new ir,e=[],n=[],i=cr;function r(r){let s=t.get(r);if(void 0===s){if(i!==cr)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new ir;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return lr(e,n).unknown(i)},$i.apply(r,arguments),r}const hr=1e3,ur=6e4,dr=36e5,fr=864e5,pr=6048e5,gr=2592e6,yr=31536e6;var mr=new Date,br=new Date;function _r(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},r.range=function(n,i,s){var a,o=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return o;do{o.push(a=new Date(+n)),e(n,s),t(n)}while(a<n&&n<i);return o},r.filter=function(n){return _r((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}))},n&&(r.count=function(e,i){return mr.setTime(+e),br.setTime(+i),t(mr),t(br),Math.floor(n(mr,br))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var xr=_r((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));xr.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?_r((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):xr:null};const vr=xr;xr.range;var kr=_r((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*hr)}),(function(t,e){return(e-t)/hr}),(function(t){return t.getUTCSeconds()}));const wr=kr;kr.range;var Tr=_r((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hr)}),(function(t,e){t.setTime(+t+e*ur)}),(function(t,e){return(e-t)/ur}),(function(t){return t.getMinutes()}));const Cr=Tr;Tr.range;var Er=_r((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*hr-t.getMinutes()*ur)}),(function(t,e){t.setTime(+t+e*dr)}),(function(t,e){return(e-t)/dr}),(function(t){return t.getHours()}));const Sr=Er;Er.range;var Ar=_r((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ur)/fr),(t=>t.getDate()-1));const Dr=Ar;Ar.range;function Lr(t){return _r((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ur)/pr}))}var Or=Lr(0),Mr=Lr(1),Br=Lr(2),Nr=Lr(3),Ir=Lr(4),Fr=Lr(5),Rr=Lr(6),$r=(Or.range,Mr.range,Br.range,Nr.range,Ir.range,Fr.range,Rr.range,_r((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));const Pr=$r;$r.range;var Yr=_r((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Yr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?_r((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const jr=Yr;Yr.range;var zr=_r((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*ur)}),(function(t,e){return(e-t)/ur}),(function(t){return t.getUTCMinutes()}));const Ur=zr;zr.range;var Wr=_r((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*dr)}),(function(t,e){return(e-t)/dr}),(function(t){return t.getUTCHours()}));const Hr=Wr;Wr.range;var qr=_r((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/fr}),(function(t){return t.getUTCDate()-1}));const Vr=qr;qr.range;function Gr(t){return _r((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/pr}))}var Xr=Gr(0),Zr=Gr(1),Qr=Gr(2),Kr=Gr(3),Jr=Gr(4),ts=Gr(5),es=Gr(6),ns=(Xr.range,Zr.range,Qr.range,Kr.range,Jr.range,ts.range,es.range,_r((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})));const is=ns;ns.range;var rs=_r((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rs.every=function(t){return isFinite(t=Math.floor(t))&&t>0?_r((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const ss=rs;rs.range;function as(t,e,n,i,r,s){const a=[[wr,1,hr],[wr,5,5e3],[wr,15,15e3],[wr,30,3e4],[s,1,ur],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,dr],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,fr],[i,2,1728e5],[n,1,pr],[e,1,gr],[e,3,7776e6],[t,1,yr]];function o(e,n,i){const r=Math.abs(n-e)/i,s=bi((([,,t])=>t)).right(a,r);if(s===a.length)return t.every(gi(e/yr,n/yr,i));if(0===s)return vr.every(Math.max(gi(e,n,i),1));const[o,c]=a[r/a[s-1][2]<a[s][2]/r?s-1:s];return o.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:o(t,e,n),s=r?r.range(t,+e+1):[];return i?s.reverse():s},o]}const[os,cs]=as(ss,is,Xr,Vr,Hr,Ur),[ls,hs]=as(jr,Pr,Or,Dr,Sr,Cr);function us(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ds(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function fs(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var ps,gs,ys={"-":"",_:" ",0:"0"},ms=/^\s*\d+/,bs=/^%/,_s=/[\\^$*+?|[\]().{}]/g;function xs(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(e)+r:r)}function vs(t){return t.replace(_s,"\\$&")}function ks(t){return new RegExp("^(?:"+t.map(vs).join("|")+")","i")}function ws(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Ts(t,e,n){var i=ms.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Cs(t,e,n){var i=ms.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Es(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Ss(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function As(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Ds(t,e,n){var i=ms.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Ls(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Os(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Ms(t,e,n){var i=ms.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Bs(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ns(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Is(t,e,n){var i=ms.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function Fs(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Rs(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function $s(t,e,n){var i=ms.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Ps(t,e,n){var i=ms.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Ys(t,e,n){var i=ms.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function js(t,e,n){var i=bs.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zs(t,e,n){var i=ms.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Us(t,e,n){var i=ms.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Ws(t,e){return xs(t.getDate(),e,2)}function Hs(t,e){return xs(t.getHours(),e,2)}function qs(t,e){return xs(t.getHours()%12||12,e,2)}function Vs(t,e){return xs(1+Dr.count(jr(t),t),e,3)}function Gs(t,e){return xs(t.getMilliseconds(),e,3)}function Xs(t,e){return Gs(t,e)+"000"}function Zs(t,e){return xs(t.getMonth()+1,e,2)}function Qs(t,e){return xs(t.getMinutes(),e,2)}function Ks(t,e){return xs(t.getSeconds(),e,2)}function Js(t){var e=t.getDay();return 0===e?7:e}function ta(t,e){return xs(Or.count(jr(t)-1,t),e,2)}function ea(t){var e=t.getDay();return e>=4||0===e?Ir(t):Ir.ceil(t)}function na(t,e){return t=ea(t),xs(Ir.count(jr(t),t)+(4===jr(t).getDay()),e,2)}function ia(t){return t.getDay()}function ra(t,e){return xs(Mr.count(jr(t)-1,t),e,2)}function sa(t,e){return xs(t.getFullYear()%100,e,2)}function aa(t,e){return xs((t=ea(t)).getFullYear()%100,e,2)}function oa(t,e){return xs(t.getFullYear()%1e4,e,4)}function ca(t,e){var n=t.getDay();return xs((t=n>=4||0===n?Ir(t):Ir.ceil(t)).getFullYear()%1e4,e,4)}function la(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+xs(e/60|0,"0",2)+xs(e%60,"0",2)}function ha(t,e){return xs(t.getUTCDate(),e,2)}function ua(t,e){return xs(t.getUTCHours(),e,2)}function da(t,e){return xs(t.getUTCHours()%12||12,e,2)}function fa(t,e){return xs(1+Vr.count(ss(t),t),e,3)}function pa(t,e){return xs(t.getUTCMilliseconds(),e,3)}function ga(t,e){return pa(t,e)+"000"}function ya(t,e){return xs(t.getUTCMonth()+1,e,2)}function ma(t,e){return xs(t.getUTCMinutes(),e,2)}function ba(t,e){return xs(t.getUTCSeconds(),e,2)}function _a(t){var e=t.getUTCDay();return 0===e?7:e}function xa(t,e){return xs(Xr.count(ss(t)-1,t),e,2)}function va(t){var e=t.getUTCDay();return e>=4||0===e?Jr(t):Jr.ceil(t)}function ka(t,e){return t=va(t),xs(Jr.count(ss(t),t)+(4===ss(t).getUTCDay()),e,2)}function wa(t){return t.getUTCDay()}function Ta(t,e){return xs(Zr.count(ss(t)-1,t),e,2)}function Ca(t,e){return xs(t.getUTCFullYear()%100,e,2)}function Ea(t,e){return xs((t=va(t)).getUTCFullYear()%100,e,2)}function Sa(t,e){return xs(t.getUTCFullYear()%1e4,e,4)}function Aa(t,e){var n=t.getUTCDay();return xs((t=n>=4||0===n?Jr(t):Jr.ceil(t)).getUTCFullYear()%1e4,e,4)}function Da(){return"+0000"}function La(){return"%"}function Oa(t){return+t}function Ma(t){return Math.floor(+t/1e3)}function Ba(t){return new Date(t)}function Na(t){return t instanceof Date?+t:+new Date(+t)}function Ia(t,e,n,i,r,s,a,o,c,l){var h=Ri(),u=h.invert,d=h.domain,f=l(".%L"),p=l(":%S"),g=l("%I:%M"),y=l("%I %p"),m=l("%a %d"),b=l("%b %d"),_=l("%B"),x=l("%Y");function v(t){return(c(t)<t?f:o(t)<t?p:a(t)<t?g:s(t)<t?y:i(t)<t?r(t)<t?m:b:n(t)<t?_:x)(t)}return h.invert=function(t){return new Date(u(t))},h.domain=function(t){return arguments.length?d(Array.from(t,Na)):d().map(Ba)},h.ticks=function(e){var n=d();return t(n[0],n[n.length-1],null==e?10:e)},h.tickFormat=function(t,e){return null==e?v:l(e)},h.nice=function(t){var n=d();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?d(function(t,e){var n,i=0,r=(t=t.slice()).length-1,s=t[i],a=t[r];return a<s&&(n=i,i=r,r=n,n=s,s=a,a=n),t[i]=e.floor(s),t[r]=e.ceil(a),t}(n,t)):h},h.copy=function(){return Ii(h,Ia(t,e,n,i,r,s,a,o,c,l))},h}function Fa(t){return"string"==typeof t?new Et([[document.querySelector(t)]],[document.documentElement]):new Et([[t]],Ct)}function Ra(t){return"string"==typeof t?new Et([document.querySelectorAll(t)],[document.documentElement]):new Et([y(t)],Ct)}!function(t){ps=function(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,a=t.shortDays,o=t.months,c=t.shortMonths,l=ks(r),h=ws(r),u=ks(s),d=ws(s),f=ks(a),p=ws(a),g=ks(o),y=ws(o),m=ks(c),b=ws(c),_={a:function(t){return a[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return o[t.getMonth()]},c:null,d:Ws,e:Ws,f:Xs,g:aa,G:ca,H:Hs,I:qs,j:Vs,L:Gs,m:Zs,M:Qs,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Oa,s:Ma,S:Ks,u:Js,U:ta,V:na,w:ia,W:ra,x:null,X:null,y:sa,Y:oa,Z:la,"%":La},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return o[t.getUTCMonth()]},c:null,d:ha,e:ha,f:ga,g:Ea,G:Aa,H:ua,I:da,j:fa,L:pa,m:ya,M:ma,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Oa,s:Ma,S:ba,u:_a,U:xa,V:ka,w:wa,W:Ta,x:null,X:null,y:Ca,Y:Sa,Z:Da,"%":La},v={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=b.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return T(t,e,n,i)},d:Ns,e:Ns,f:Ys,g:Ls,G:Ds,H:Fs,I:Fs,j:Is,L:Ps,m:Bs,M:Rs,p:function(t,e,n){var i=l.exec(e.slice(n));return i?(t.p=h.get(i[0].toLowerCase()),n+i[0].length):-1},q:Ms,Q:zs,s:Us,S:$s,u:Cs,U:Es,V:Ss,w:Ts,W:As,x:function(t,e,i){return T(t,n,e,i)},X:function(t,e,n){return T(t,i,e,n)},y:Ls,Y:Ds,Z:Os,"%":js};function k(t,e){return function(n){var i,r,s,a=[],o=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++o<l;)37===t.charCodeAt(o)&&(a.push(t.slice(c,o)),null!=(r=ys[i=t.charAt(++o)])?i=t.charAt(++o):r="e"===i?" ":"0",(s=e[i])&&(i=s(n,r)),a.push(i),c=o+1);return a.push(t.slice(c,o)),a.join("")}}function w(t,e){return function(n){var i,r,s=fs(1900,void 0,1);if(T(s,t,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(e&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=ds(fs(s.y,0,1))).getUTCDay(),i=r>4||0===r?Zr.ceil(i):Zr(i),i=Vr.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=us(fs(s.y,0,1))).getDay(),i=r>4||0===r?Mr.ceil(i):Mr(i),i=Dr.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?ds(fs(s.y,0,1)).getUTCDay():us(fs(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,ds(s)):us(s)}}function T(t,e,n,i){for(var r,s,a=0,o=e.length,c=n.length;a<o;){if(i>=c)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(s=v[r in ys?e.charAt(a++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return _.x=k(n,_),_.X=k(i,_),_.c=k(e,_),x.x=k(n,x),x.X=k(i,x),x.c=k(e,x),{format:function(t){var e=k(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=w(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=k(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=w(t+="",!0);return e.toString=function(){return t},e}}}(t),gs=ps.format,ps.parse,ps.utcFormat,ps.utcParse}({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"]});const $a=Math.PI,Pa=2*$a,Ya=1e-6,ja=Pa-Ya;function za(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ua(){return new za}za.prototype=Ua.prototype={constructor:za,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(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,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,a=this._y1,o=n-t,c=i-e,l=s-t,h=a-e,u=l*l+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>Ya)if(Math.abs(h*o-c*l)>Ya&&r){var d=n-s,f=i-a,p=o*o+c*c,g=d*d+f*f,y=Math.sqrt(p),m=Math.sqrt(u),b=r*Math.tan(($a-Math.acos((p+u-g)/(2*y*m)))/2),_=b/m,x=b/y;Math.abs(_-1)>Ya&&(this._+="L"+(t+_*l)+","+(e+_*h)),this._+="A"+r+","+r+",0,0,"+ +(h*d>l*f)+","+(this._x1=t+x*o)+","+(this._y1=e+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var a=(n=+n)*Math.cos(i),o=n*Math.sin(i),c=t+a,l=e+o,h=1^s,u=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Ya||Math.abs(this._y1-l)>Ya)&&(this._+="L"+c+","+l),n&&(u<0&&(u=u%Pa+Pa),u>ja?this._+="A"+n+","+n+",0,1,"+h+","+(t-a)+","+(e-o)+"A"+n+","+n+",0,1,"+h+","+(this._x1=c)+","+(this._y1=l):u>Ya&&(this._+="A"+n+","+n+",0,"+ +(u>=$a)+","+h+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const Wa=Ua;function Ha(t){return function(){return t}}const qa=Math.abs,Va=Math.atan2,Ga=Math.cos,Xa=Math.max,Za=Math.min,Qa=Math.sin,Ka=Math.sqrt,Ja=1e-12,to=Math.PI,eo=to/2,no=2*to;function io(t){return t>1?0:t<-1?to:Math.acos(t)}function ro(t){return t>=1?eo:t<=-1?-eo:Math.asin(t)}function so(t){return t.innerRadius}function ao(t){return t.outerRadius}function oo(t){return t.startAngle}function co(t){return t.endAngle}function lo(t){return t&&t.padAngle}function ho(t,e,n,i,r,s,a,o){var c=n-t,l=i-e,h=a-r,u=o-s,d=u*c-h*l;if(!(d*d<Ja))return[t+(d=(h*(e-s)-u*(t-r))/d)*c,e+d*l]}function uo(t,e,n,i,r,s,a){var o=t-n,c=e-i,l=(a?s:-s)/Ka(o*o+c*c),h=l*c,u=-l*o,d=t+h,f=e+u,p=n+h,g=i+u,y=(d+p)/2,m=(f+g)/2,b=p-d,_=g-f,x=b*b+_*_,v=r-s,k=d*g-p*f,w=(_<0?-1:1)*Ka(Xa(0,v*v*x-k*k)),T=(k*_-b*w)/x,C=(-k*b-_*w)/x,E=(k*_+b*w)/x,S=(-k*b+_*w)/x,A=T-y,D=C-m,L=E-y,O=S-m;return A*A+D*D>L*L+O*O&&(T=E,C=S),{cx:T,cy:C,x01:-h,y01:-u,x11:T*(r/v-1),y11:C*(r/v-1)}}function fo(){var t=so,e=ao,n=Ha(0),i=null,r=oo,s=co,a=lo,o=null;function c(){var c,l,h=+t.apply(this,arguments),u=+e.apply(this,arguments),d=r.apply(this,arguments)-eo,f=s.apply(this,arguments)-eo,p=qa(f-d),g=f>d;if(o||(o=c=Wa()),u<h&&(l=u,u=h,h=l),u>Ja)if(p>no-Ja)o.moveTo(u*Ga(d),u*Qa(d)),o.arc(0,0,u,d,f,!g),h>Ja&&(o.moveTo(h*Ga(f),h*Qa(f)),o.arc(0,0,h,f,d,g));else{var y,m,b=d,_=f,x=d,v=f,k=p,w=p,T=a.apply(this,arguments)/2,C=T>Ja&&(i?+i.apply(this,arguments):Ka(h*h+u*u)),E=Za(qa(u-h)/2,+n.apply(this,arguments)),S=E,A=E;if(C>Ja){var D=ro(C/h*Qa(T)),L=ro(C/u*Qa(T));(k-=2*D)>Ja?(x+=D*=g?1:-1,v-=D):(k=0,x=v=(d+f)/2),(w-=2*L)>Ja?(b+=L*=g?1:-1,_-=L):(w=0,b=_=(d+f)/2)}var O=u*Ga(b),M=u*Qa(b),B=h*Ga(v),N=h*Qa(v);if(E>Ja){var I,F=u*Ga(_),R=u*Qa(_),$=h*Ga(x),P=h*Qa(x);if(p<to&&(I=ho(O,M,$,P,F,R,B,N))){var Y=O-I[0],j=M-I[1],z=F-I[0],U=R-I[1],W=1/Qa(io((Y*z+j*U)/(Ka(Y*Y+j*j)*Ka(z*z+U*U)))/2),H=Ka(I[0]*I[0]+I[1]*I[1]);S=Za(E,(h-H)/(W-1)),A=Za(E,(u-H)/(W+1))}}w>Ja?A>Ja?(y=uo($,P,O,M,u,A,g),m=uo(F,R,B,N,u,A,g),o.moveTo(y.cx+y.x01,y.cy+y.y01),A<E?o.arc(y.cx,y.cy,A,Va(y.y01,y.x01),Va(m.y01,m.x01),!g):(o.arc(y.cx,y.cy,A,Va(y.y01,y.x01),Va(y.y11,y.x11),!g),o.arc(0,0,u,Va(y.cy+y.y11,y.cx+y.x11),Va(m.cy+m.y11,m.cx+m.x11),!g),o.arc(m.cx,m.cy,A,Va(m.y11,m.x11),Va(m.y01,m.x01),!g))):(o.moveTo(O,M),o.arc(0,0,u,b,_,!g)):o.moveTo(O,M),h>Ja&&k>Ja?S>Ja?(y=uo(B,N,F,R,h,-S,g),m=uo(O,M,$,P,h,-S,g),o.lineTo(y.cx+y.x01,y.cy+y.y01),S<E?o.arc(y.cx,y.cy,S,Va(y.y01,y.x01),Va(m.y01,m.x01),!g):(o.arc(y.cx,y.cy,S,Va(y.y01,y.x01),Va(y.y11,y.x11),!g),o.arc(0,0,h,Va(y.cy+y.y11,y.cx+y.x11),Va(m.cy+m.y11,m.cx+m.x11),g),o.arc(m.cx,m.cy,S,Va(m.y11,m.x11),Va(m.y01,m.x01),!g))):o.arc(0,0,h,v,x,g):o.lineTo(B,N)}else o.moveTo(0,0);if(o.closePath(),c)return o=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-to/2;return[Ga(i)*n,Qa(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ha(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ha(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ha(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ha(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ha(+t),c):r},c.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ha(+t),c):s},c.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ha(+t),c):a},c.context=function(t){return arguments.length?(o=null==t?null:t,c):o},c}Array.prototype.slice;function po(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function go(t){this._context=t}function yo(t){return new go(t)}function mo(t){return t[0]}function bo(t){return t[1]}function _o(t,e){var n=Ha(!0),i=null,r=yo,s=null;function a(a){var o,c,l,h=(a=po(a)).length,u=!1;for(null==i&&(s=r(l=Wa())),o=0;o<=h;++o)!(o<h&&n(c=a[o],o,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(c,o,a),+e(c,o,a));if(l)return s=null,l+""||null}return t="function"==typeof t?t:void 0===t?mo:Ha(t),e="function"==typeof e?e:void 0===e?bo:Ha(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Ha(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Ha(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ha(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(s=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=s=null:s=r(i=t),a):i},a}function xo(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function vo(t){return t}function ko(){}function wo(t,e,n){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+n)/6)}function To(t){this._context=t}function Co(t){return new To(t)}function Eo(t){this._context=t}function So(t){this._context=t}function Ao(t){this._context=t}function Do(t){return t<0?-1:1}function Lo(t,e,n){var i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return(Do(s)+Do(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Oo(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Mo(t,e,n){var i=t._x0,r=t._y0,s=t._x1,a=t._y1,o=(s-i)/3;t._context.bezierCurveTo(i+o,r+o*e,s-o,a-o*n,s,a)}function Bo(t){this._context=t}function No(t){this._context=new Io(t)}function Io(t){this._context=t}function Fo(t){this._context=t}function Ro(t){var e,n,i=t.length-1,r=new Array(i),s=new Array(i),a=new Array(i);for(r[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,s[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/s[e-1],s[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/s[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/s[e];for(s[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)s[e]=2*t[e+1]-r[e+1];return[r,s]}function $o(t,e){this._context=t,this._t=e}function Po(t,e,n){this.k=t,this.x=e,this.y=n}go.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&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;default:this._context.lineTo(t,e)}}},To.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:wo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&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:wo(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Eo.prototype={areaStart:ko,areaEnd:ko,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)}},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:wo(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},So.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||0!==this._line&&3===this._point)&&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 n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:wo(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ao.prototype={areaStart:ko,areaEnd:ko,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))}},Bo.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:Mo(this,this._t0,Oo(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+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,Mo(this,Oo(this,n=Lo(this,t,e)),n);break;default:Mo(this,this._t0,n=Lo(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(No.prototype=Object.create(Bo.prototype)).point=function(t,e){Bo.prototype.point.call(this,e,t)},Io.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,n,i,r,s){this._context.bezierCurveTo(e,t,i,n,s,r)}},Fo.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,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Ro(t),r=Ro(e),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},$o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=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 n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},Po.prototype={constructor:Po,scale:function(t){return 1===t?this:new Po(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Po(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+")"}};new Po(1,0,0);Po.prototype;var Yo=n(856);const jo={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,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},i)=>{if(!e)return 2.55*n;t/=360,e/=100;const r=(n/=100)<.5?n*(1+e):n+e-n*e,s=2*n-r;switch(i){case"r":return 255*jo.hue2rgb(s,r,t+1/3);case"g":return 255*jo.hue2rgb(s,r,t);case"b":return 255*jo.hue2rgb(s,r,t-1/3)}},rgb2hsl:({r:t,g:e,b:n},i)=>{t/=255,e/=255,n/=255;const r=Math.max(t,e,n),s=Math.min(t,e,n),a=(r+s)/2;if("l"===i)return 100*a;if(r===s)return 0;const o=r-s;if("s"===i)return 100*(a>.5?o/(2-r-s):o/(r+s));switch(r){case t:return 60*((e-n)/o+(e<n?6:0));case e:return 60*((n-t)/o+2);case n:return 60*((t-e)/o+4);default:return-1}}},zo={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10},Uo={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Wo={channel:jo,lang:zo,unit:Uo},Ho={};for(let t=0;t<=255;t++)Ho[t]=Wo.unit.dec2hex(t);const qo=0,Vo=1,Go=2;const Xo=class{constructor(){this.type=qo}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=qo}is(t){return this.type===t}};const Zo=class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new Xo}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=qo,this}_ensureHSL(){const t=this.data,{h:e,s:n,l:i}=t;void 0===e&&(t.h=Wo.channel.rgb2hsl(t,"h")),void 0===n&&(t.s=Wo.channel.rgb2hsl(t,"s")),void 0===i&&(t.l=Wo.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:n,b:i}=t;void 0===e&&(t.r=Wo.channel.hsl2rgb(t,"r")),void 0===n&&(t.g=Wo.channel.hsl2rgb(t,"g")),void 0===i&&(t.b=Wo.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(Go)||void 0===e?(this._ensureHSL(),Wo.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(Go)||void 0===e?(this._ensureHSL(),Wo.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(Go)||void 0===e?(this._ensureHSL(),Wo.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(Vo)||void 0===e?(this._ensureRGB(),Wo.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(Vo)||void 0===e?(this._ensureRGB(),Wo.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(Vo)||void 0===e?(this._ensureRGB(),Wo.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(Vo),this.changed=!0,this.data.r=t}set g(t){this.type.set(Vo),this.changed=!0,this.data.g=t}set b(t){this.type.set(Vo),this.changed=!0,this.data.b=t}set h(t){this.type.set(Go),this.changed=!0,this.data.h=t}set s(t){this.type.set(Go),this.changed=!0,this.data.s=t}set l(t){this.type.set(Go),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},Qo=new Zo({r:0,g:0,b:0,a:0},"transparent"),Ko={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;const e=t.match(Ko.re);if(!e)return;const n=e[1],i=parseInt(n,16),r=n.length,s=r%4==0,a=r>4,o=a?1:17,c=a?8:4,l=s?0:-1,h=a?255:15;return Qo.set({r:(i>>c*(l+3)&h)*o,g:(i>>c*(l+2)&h)*o,b:(i>>c*(l+1)&h)*o,a:s?(i&h)*o/255:1},t)},stringify:t=>{const{r:e,g:n,b:i,a:r}=t;return r<1?`#${Ho[Math.round(e)]}${Ho[Math.round(n)]}${Ho[Math.round(i)]}${Ho[Math.round(255*r)]}`:`#${Ho[Math.round(e)]}${Ho[Math.round(n)]}${Ho[Math.round(i)]}`}},Jo=Ko,tc={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(tc.hueRe);if(e){const[,t,n]=e;switch(n){case"grad":return Wo.channel.clamp.h(.9*parseFloat(t));case"rad":return Wo.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return Wo.channel.clamp.h(360*parseFloat(t))}}return Wo.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const n=t.match(tc.re);if(!n)return;const[,i,r,s,a,o]=n;return Qo.set({h:tc._hue2deg(i),s:Wo.channel.clamp.s(parseFloat(r)),l:Wo.channel.clamp.l(parseFloat(s)),a:a?Wo.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},t)},stringify:t=>{const{h:e,s:n,l:i,a:r}=t;return r<1?`hsla(${Wo.lang.round(e)}, ${Wo.lang.round(n)}%, ${Wo.lang.round(i)}%, ${r})`:`hsl(${Wo.lang.round(e)}, ${Wo.lang.round(n)}%, ${Wo.lang.round(i)}%)`}},ec=tc,nc={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=nc.colors[t];if(e)return Jo.parse(e)},stringify:t=>{const e=Jo.stringify(t);for(const t in nc.colors)if(nc.colors[t]===e)return t}},ic=nc,rc={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(114!==e&&82!==e)return;const n=t.match(rc.re);if(!n)return;const[,i,r,s,a,o,c,l,h]=n;return Qo.set({r:Wo.channel.clamp.r(r?2.55*parseFloat(i):parseFloat(i)),g:Wo.channel.clamp.g(a?2.55*parseFloat(s):parseFloat(s)),b:Wo.channel.clamp.b(c?2.55*parseFloat(o):parseFloat(o)),a:l?Wo.channel.clamp.a(h?parseFloat(l)/100:parseFloat(l)):1},t)},stringify:t=>{const{r:e,g:n,b:i,a:r}=t;return r<1?`rgba(${Wo.lang.round(e)}, ${Wo.lang.round(n)}, ${Wo.lang.round(i)}, ${Wo.lang.round(r)})`:`rgb(${Wo.lang.round(e)}, ${Wo.lang.round(n)}, ${Wo.lang.round(i)})`}},sc=rc,ac={format:{keyword:ic,hex:Jo,rgb:sc,rgba:sc,hsl:ec,hsla:ec},parse:t=>{if("string"!=typeof t)return t;const e=Jo.parse(t)||sc.parse(t)||ec.parse(t)||ic.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Go)||void 0===t.data.r?ec.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?sc.stringify(t):Jo.stringify(t)},oc=ac,cc=(t,e)=>{const n=oc.parse(t);for(const t in e)n[t]=Wo.channel.clamp[t](e[t]);return oc.stringify(n)},lc=(t,e)=>{const n=oc.parse(t),i={};for(const t in e)e[t]&&(i[t]=n[t]+e[t]);return cc(t,i)},hc=(t,e,n=0,i=1)=>{if("number"!=typeof t)return cc(t,{a:e});const r=Qo.set({r:Wo.channel.clamp.r(t),g:Wo.channel.clamp.g(e),b:Wo.channel.clamp.b(n),a:Wo.channel.clamp.a(i)});return oc.stringify(r)},uc=(t,e,n=50)=>{const{r:i,g:r,b:s,a}=oc.parse(t),{r:o,g:c,b:l,a:h}=oc.parse(e),u=n/100,d=2*u-1,f=a-h,p=((d*f==-1?d:(d+f)/(1+d*f))+1)/2,g=1-p;return hc(i*p+o*g,r*p+c*g,s*p+l*g,a*u+h*(1-u))},dc=(t,e=100)=>{const n=oc.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,uc(n,t,e)},fc=(t,e,n)=>{const i=oc.parse(t),r=i[e],s=Wo.channel.clamp[e](r+n);return r!==s&&(i[e]=s),oc.stringify(i)},pc=(t,e)=>fc(t,"l",-e),gc=(t,e)=>fc(t,"l",e);const yc="object"==typeof global&&global&&global.Object===Object&&global;var mc="object"==typeof self&&self&&self.Object===Object&&self;const bc=yc||mc||Function("return this")();const _c=bc.Symbol;var xc=Object.prototype,vc=xc.hasOwnProperty,kc=xc.toString,wc=_c?_c.toStringTag:void 0;const Tc=function(t){var e=vc.call(t,wc),n=t[wc];try{t[wc]=void 0;var i=!0}catch(t){}var r=kc.call(t);return i&&(e?t[wc]=n:delete t[wc]),r};var Cc=Object.prototype.toString;const Ec=function(t){return Cc.call(t)};var Sc=_c?_c.toStringTag:void 0;const Ac=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Sc&&Sc in Object(t)?Tc(t):Ec(t)};const Dc=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const Lc=function(t){if(!Dc(t))return!1;var e=Ac(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const Oc=bc["__core-js_shared__"];var Mc,Bc=(Mc=/[^.]+$/.exec(Oc&&Oc.keys&&Oc.keys.IE_PROTO||""))?"Symbol(src)_1."+Mc:"";const Nc=function(t){return!!Bc&&Bc in t};var Ic=Function.prototype.toString;const Fc=function(t){if(null!=t){try{return Ic.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var Rc=/^\[object .+?Constructor\]$/,$c=Function.prototype,Pc=Object.prototype,Yc=$c.toString,jc=Pc.hasOwnProperty,zc=RegExp("^"+Yc.call(jc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Uc=function(t){return!(!Dc(t)||Nc(t))&&(Lc(t)?zc:Rc).test(Fc(t))};const Wc=function(t,e){return null==t?void 0:t[e]};const Hc=function(t,e){var n=Wc(t,e);return Uc(n)?n:void 0};const qc=Hc(Object,"create");const Vc=function(){this.__data__=qc?qc(null):{},this.size=0};const Gc=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var Xc=Object.prototype.hasOwnProperty;const Zc=function(t){var e=this.__data__;if(qc){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Xc.call(e,t)?e[t]:void 0};var Qc=Object.prototype.hasOwnProperty;const Kc=function(t){var e=this.__data__;return qc?void 0!==e[t]:Qc.call(e,t)};const Jc=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=qc&&void 0===e?"__lodash_hash_undefined__":e,this};function tl(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}tl.prototype.clear=Vc,tl.prototype.delete=Gc,tl.prototype.get=Zc,tl.prototype.has=Kc,tl.prototype.set=Jc;const el=tl;const nl=function(){this.__data__=[],this.size=0};const il=function(t,e){return t===e||t!=t&&e!=e};const rl=function(t,e){for(var n=t.length;n--;)if(il(t[n][0],e))return n;return-1};var sl=Array.prototype.splice;const al=function(t){var e=this.__data__,n=rl(e,t);return!(n<0)&&(n==e.length-1?e.pop():sl.call(e,n,1),--this.size,!0)};const ol=function(t){var e=this.__data__,n=rl(e,t);return n<0?void 0:e[n][1]};const cl=function(t){return rl(this.__data__,t)>-1};const ll=function(t,e){var n=this.__data__,i=rl(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};function hl(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}hl.prototype.clear=nl,hl.prototype.delete=al,hl.prototype.get=ol,hl.prototype.has=cl,hl.prototype.set=ll;const ul=hl;const dl=Hc(bc,"Map");const fl=function(){this.size=0,this.__data__={hash:new el,map:new(dl||ul),string:new el}};const pl=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const gl=function(t,e){var n=t.__data__;return pl(e)?n["string"==typeof e?"string":"hash"]:n.map};const yl=function(t){var e=gl(this,t).delete(t);return this.size-=e?1:0,e};const ml=function(t){return gl(this,t).get(t)};const bl=function(t){return gl(this,t).has(t)};const _l=function(t,e){var n=gl(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};function xl(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}xl.prototype.clear=fl,xl.prototype.delete=yl,xl.prototype.get=ml,xl.prototype.has=bl,xl.prototype.set=_l;const vl=xl;function kl(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var a=t.apply(this,i);return n.cache=s.set(r,a)||s,a};return n.cache=new(kl.Cache||vl),n}kl.Cache=vl;const wl=kl;var Tl="comm",Cl="rule",El="decl",Sl=Math.abs,Al=String.fromCharCode;Object.assign;function Dl(t){return t.trim()}function Ll(t,e,n){return t.replace(e,n)}function Ol(t,e){return t.indexOf(e)}function Ml(t,e){return 0|t.charCodeAt(e)}function Bl(t,e,n){return t.slice(e,n)}function Nl(t){return t.length}function Il(t){return t.length}function Fl(t,e){return e.push(t),t}function Rl(t,e){for(var n="",i=Il(t),r=0;r<i;r++)n+=e(t[r],r,t,e)||"";return n}function $l(t,e,n,i){switch(t.type){case"@import":case El:return t.return=t.return||t.value;case Tl:return"";case"@keyframes":return t.return=t.value+"{"+Rl(t.children,i)+"}";case Cl:t.value=t.props.join(",")}return Nl(n=Rl(t.children,i))?t.return=t.value+"{"+n+"}":""}var Pl=1,Yl=1,jl=0,zl=0,Ul=0,Wl="";function Hl(t,e,n,i,r,s,a){return{value:t,root:e,parent:n,type:i,props:r,children:s,line:Pl,column:Yl,length:a,return:""}}function ql(){return Ul=zl>0?Ml(Wl,--zl):0,Yl--,10===Ul&&(Yl=1,Pl--),Ul}function Vl(){return Ul=zl<jl?Ml(Wl,zl++):0,Yl++,10===Ul&&(Yl=1,Pl++),Ul}function Gl(){return Ml(Wl,zl)}function Xl(){return zl}function Zl(t,e){return Bl(Wl,t,e)}function Ql(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Kl(t){return Pl=Yl=1,jl=Nl(Wl=t),zl=0,[]}function Jl(t){return Wl="",t}function th(t){return Dl(Zl(zl-1,ih(91===t?t+2:40===t?t+1:t)))}function eh(t){for(;(Ul=Gl())&&Ul<33;)Vl();return Ql(t)>2||Ql(Ul)>3?"":" "}function nh(t,e){for(;--e&&Vl()&&!(Ul<48||Ul>102||Ul>57&&Ul<65||Ul>70&&Ul<97););return Zl(t,Xl()+(e<6&&32==Gl()&&32==Vl()))}function ih(t){for(;Vl();)switch(Ul){case t:return zl;case 34:case 39:34!==t&&39!==t&&ih(Ul);break;case 40:41===t&&ih(t);break;case 92:Vl()}return zl}function rh(t,e){for(;Vl()&&t+Ul!==57&&(t+Ul!==84||47!==Gl()););return"/*"+Zl(e,zl-1)+"*"+Al(47===t?t:Vl())}function sh(t){for(;!Ql(Gl());)Vl();return Zl(t,zl)}function ah(t){return Jl(oh("",null,null,null,[""],t=Kl(t),0,[0],t))}function oh(t,e,n,i,r,s,a,o,c){for(var l=0,h=0,u=a,d=0,f=0,p=0,g=1,y=1,m=1,b=0,_="",x=r,v=s,k=i,w=_;y;)switch(p=b,b=Vl()){case 40:if(108!=p&&58==Ml(w,u-1)){-1!=Ol(w+=Ll(th(b),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:w+=th(b);break;case 9:case 10:case 13:case 32:w+=eh(p);break;case 92:w+=nh(Xl()-1,7);continue;case 47:switch(Gl()){case 42:case 47:Fl(lh(rh(Vl(),Xl()),e,n),c);break;default:w+="/"}break;case 123*g:o[l++]=Nl(w)*m;case 125*g:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+h:f>0&&Nl(w)-u&&Fl(f>32?hh(w+";",i,n,u-1):hh(Ll(w," ","")+";",i,n,u-2),c);break;case 59:w+=";";default:if(Fl(k=ch(w,e,n,l,h,r,o,_,x=[],v=[],u),s),123===b)if(0===h)oh(w,e,k,k,x,s,u,o,v);else switch(99===d&&110===Ml(w,3)?100:d){case 100:case 109:case 115:oh(t,k,k,i&&Fl(ch(t,k,k,0,0,r,o,_,r,x=[],u),v),r,v,u,o,i?x:v);break;default:oh(w,k,k,k,[""],v,0,o,v)}}l=h=f=0,g=m=1,_=w="",u=a;break;case 58:u=1+Nl(w),f=p;default:if(g<1)if(123==b)--g;else if(125==b&&0==g++&&125==ql())continue;switch(w+=Al(b),b*g){case 38:m=h>0?1:(w+="\f",-1);break;case 44:o[l++]=(Nl(w)-1)*m,m=1;break;case 64:45===Gl()&&(w+=th(Vl())),d=Gl(),h=u=Nl(_=w+=sh(Xl())),b++;break;case 45:45===p&&2==Nl(w)&&(g=0)}}return s}function ch(t,e,n,i,r,s,a,o,c,l,h){for(var u=r-1,d=0===r?s:[""],f=Il(d),p=0,g=0,y=0;p<i;++p)for(var m=0,b=Bl(t,u+1,u=Sl(g=a[p])),_=t;m<f;++m)(_=Dl(g>0?d[m]+" "+b:Ll(b,/&\f/g,d[m])))&&(c[y++]=_);return Hl(t,e,n,0===r?Cl:o,c,l,h)}function lh(t,e,n){return Hl(t,e,n,Tl,Al(Ul),Bl(t,2,-2),0)}function hh(t,e,n,i){return Hl(t,e,n,El,Bl(t,0,i),Bl(t,i+1,-1),i)}const uh=function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t};const dh=function(t){return function(e,n,i){for(var r=-1,s=Object(e),a=i(e),o=a.length;o--;){var c=a[t?o:++r];if(!1===n(s[c],c,s))break}return e}};const fh=dh();const ph=function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i};const gh=function(t){return null!=t&&"object"==typeof t};const yh=function(t){return gh(t)&&"[object Arguments]"==Ac(t)};var mh=Object.prototype,bh=mh.hasOwnProperty,_h=mh.propertyIsEnumerable,xh=yh(function(){return arguments}())?yh:function(t){return gh(t)&&bh.call(t,"callee")&&!_h.call(t,"callee")};const vh=xh;const kh=Array.isArray;const wh=function(){return!1};var Th="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ch=Th&&"object"==typeof module&&module&&!module.nodeType&&module,Eh=Ch&&Ch.exports===Th?bc.Buffer:void 0;const Sh=(Eh?Eh.isBuffer:void 0)||wh;var Ah=/^(?:0|[1-9]\d*)$/;const Dh=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Ah.test(t))&&t>-1&&t%1==0&&t<e};const Lh=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Oh={};Oh["[object Float32Array]"]=Oh["[object Float64Array]"]=Oh["[object Int8Array]"]=Oh["[object Int16Array]"]=Oh["[object Int32Array]"]=Oh["[object Uint8Array]"]=Oh["[object Uint8ClampedArray]"]=Oh["[object Uint16Array]"]=Oh["[object Uint32Array]"]=!0,Oh["[object Arguments]"]=Oh["[object Array]"]=Oh["[object ArrayBuffer]"]=Oh["[object Boolean]"]=Oh["[object DataView]"]=Oh["[object Date]"]=Oh["[object Error]"]=Oh["[object Function]"]=Oh["[object Map]"]=Oh["[object Number]"]=Oh["[object Object]"]=Oh["[object RegExp]"]=Oh["[object Set]"]=Oh["[object String]"]=Oh["[object WeakMap]"]=!1;const Mh=function(t){return gh(t)&&Lh(t.length)&&!!Oh[Ac(t)]};const Bh=function(t){return function(e){return t(e)}};var Nh="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ih=Nh&&"object"==typeof module&&module&&!module.nodeType&&module,Fh=Ih&&Ih.exports===Nh&&yc.process,Rh=function(){try{var t=Ih&&Ih.require&&Ih.require("util").types;return t||Fh&&Fh.binding&&Fh.binding("util")}catch(t){}}();const $h=Rh;var Ph=$h&&$h.isTypedArray;const Yh=Ph?Bh(Ph):Mh;var jh=Object.prototype.hasOwnProperty;const zh=function(t,e){var n=kh(t),i=!n&&vh(t),r=!n&&!i&&Sh(t),s=!n&&!i&&!r&&Yh(t),a=n||i||r||s,o=a?ph(t.length,String):[],c=o.length;for(var l in t)!e&&!jh.call(t,l)||a&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Dh(l,c))||o.push(l);return o};var Uh=Object.prototype;const Wh=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Uh)};const Hh=function(t,e){return function(n){return t(e(n))}};const qh=Hh(Object.keys,Object);var Vh=Object.prototype.hasOwnProperty;const Gh=function(t){if(!Wh(t))return qh(t);var e=[];for(var n in Object(t))Vh.call(t,n)&&"constructor"!=n&&e.push(n);return e};const Xh=function(t){return null!=t&&Lh(t.length)&&!Lc(t)};const Zh=function(t){return Xh(t)?zh(t):Gh(t)};const Qh=function(t,e){return t&&fh(t,e,Zh)};const Kh=function(t,e){return function(n,i){if(null==n)return n;if(!Xh(n))return t(n,i);for(var r=n.length,s=e?r:-1,a=Object(n);(e?s--:++s<r)&&!1!==i(a[s],s,a););return n}}(Qh);const Jh=function(t){return t};const tu=function(t){return"function"==typeof t?t:Jh};const eu=function(t,e){return(kh(t)?uh:Kh)(t,tu(e))};const nu=function(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r};const iu=function(t){return"symbol"==typeof t||gh(t)&&"[object Symbol]"==Ac(t)};var ru=_c?_c.prototype:void 0,su=ru?ru.toString:void 0;const au=function t(e){if("string"==typeof e)return e;if(kh(e))return nu(e,t)+"";if(iu(e))return su?su.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n};const ou=function(t){return null==t?"":au(t)};var cu=0;const lu=function(t){var e=++cu;return ou(t)+e};var hu=Object.prototype.hasOwnProperty;const uu=function(t,e){return null!=t&&hu.call(t,e)};var du=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fu=/^\w*$/;const pu=function(t,e){if(kh(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!iu(t))||(fu.test(t)||!du.test(t)||null!=e&&t in Object(e))};var gu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yu=/\\(\\)?/g,mu=function(t){var e=wl(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(gu,(function(t,n,i,r){e.push(i?r.replace(yu,"$1"):n||t)})),e}));const bu=mu;const _u=function(t,e){return kh(t)?t:pu(t,e)?[t]:bu(ou(t))};const xu=function(t){if("string"==typeof t||iu(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e};const vu=function(t,e,n){for(var i=-1,r=(e=_u(e,t)).length,s=!1;++i<r;){var a=xu(e[i]);if(!(s=null!=t&&n(t,a)))break;t=t[a]}return s||++i!=r?s:!!(r=null==t?0:t.length)&&Lh(r)&&Dh(a,r)&&(kh(t)||vh(t))};const ku=function(t,e){return null!=t&&vu(t,e,uu)};const wu=function(t){return function(){return t}};const Tu=function(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t};var Cu=_c?_c.isConcatSpreadable:void 0;const Eu=function(t){return kh(t)||vh(t)||!!(Cu&&t&&t[Cu])};const Su=function t(e,n,i,r,s){var a=-1,o=e.length;for(i||(i=Eu),s||(s=[]);++a<o;){var c=e[a];n>0&&i(c)?n>1?t(c,n-1,i,r,s):Tu(s,c):r||(s[s.length]=c)}return s};const Au=function(t){return(null==t?0:t.length)?Su(t,1):[]};const Du=function(){this.__data__=new ul,this.size=0};const Lu=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};const Ou=function(t){return this.__data__.get(t)};const Mu=function(t){return this.__data__.has(t)};const Bu=function(t,e){var n=this.__data__;if(n instanceof ul){var i=n.__data__;if(!dl||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new vl(i)}return n.set(t,e),this.size=n.size,this};function Nu(t){var e=this.__data__=new ul(t);this.size=e.size}Nu.prototype.clear=Du,Nu.prototype.delete=Lu,Nu.prototype.get=Ou,Nu.prototype.has=Mu,Nu.prototype.set=Bu;const Iu=Nu;const Fu=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const Ru=function(t){return this.__data__.has(t)};function $u(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new vl;++e<n;)this.add(t[e])}$u.prototype.add=$u.prototype.push=Fu,$u.prototype.has=Ru;const Pu=$u;const Yu=function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1};const ju=function(t,e){return t.has(e)};const zu=function(t,e,n,i,r,s){var a=1&n,o=t.length,c=e.length;if(o!=c&&!(a&&c>o))return!1;var l=s.get(t),h=s.get(e);if(l&&h)return l==e&&h==t;var u=-1,d=!0,f=2&n?new Pu:void 0;for(s.set(t,e),s.set(e,t);++u<o;){var p=t[u],g=e[u];if(i)var y=a?i(g,p,u,e,t,s):i(p,g,u,t,e,s);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!Yu(e,(function(t,e){if(!ju(f,e)&&(p===t||r(p,t,n,i,s)))return f.push(e)}))){d=!1;break}}else if(p!==g&&!r(p,g,n,i,s)){d=!1;break}}return s.delete(t),s.delete(e),d};const Uu=bc.Uint8Array;const Wu=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n};const Hu=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var qu=_c?_c.prototype:void 0,Vu=qu?qu.valueOf:void 0;const Gu=function(t,e,n,i,r,s,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new Uu(t),new Uu(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return il(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var o=Wu;case"[object Set]":var c=1&i;if(o||(o=Hu),t.size!=e.size&&!c)return!1;var l=a.get(t);if(l)return l==e;i|=2,a.set(t,e);var h=zu(o(t),o(e),i,r,s,a);return a.delete(t),h;case"[object Symbol]":if(Vu)return Vu.call(t)==Vu.call(e)}return!1};const Xu=function(t,e,n){var i=e(t);return kh(t)?i:Tu(i,n(t))};const Zu=function(t,e){for(var n=-1,i=null==t?0:t.length,r=0,s=[];++n<i;){var a=t[n];e(a,n,t)&&(s[r++]=a)}return s};const Qu=function(){return[]};var Ku=Object.prototype.propertyIsEnumerable,Ju=Object.getOwnPropertySymbols,td=Ju?function(t){return null==t?[]:(t=Object(t),Zu(Ju(t),(function(e){return Ku.call(t,e)})))}:Qu;const ed=td;const nd=function(t){return Xu(t,Zh,ed)};var id=Object.prototype.hasOwnProperty;const rd=function(t,e,n,i,r,s){var a=1&n,o=nd(t),c=o.length;if(c!=nd(e).length&&!a)return!1;for(var l=c;l--;){var h=o[l];if(!(a?h in e:id.call(e,h)))return!1}var u=s.get(t),d=s.get(e);if(u&&d)return u==e&&d==t;var f=!0;s.set(t,e),s.set(e,t);for(var p=a;++l<c;){var g=t[h=o[l]],y=e[h];if(i)var m=a?i(y,g,h,e,t,s):i(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){f=!1;break}p||(p="constructor"==h)}if(f&&!p){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(f=!1)}return s.delete(t),s.delete(e),f};const sd=Hc(bc,"DataView");const ad=Hc(bc,"Promise");const od=Hc(bc,"Set");const cd=Hc(bc,"WeakMap");var ld="[object Map]",hd="[object Promise]",ud="[object Set]",dd="[object WeakMap]",fd="[object DataView]",pd=Fc(sd),gd=Fc(dl),yd=Fc(ad),md=Fc(od),bd=Fc(cd),_d=Ac;(sd&&_d(new sd(new ArrayBuffer(1)))!=fd||dl&&_d(new dl)!=ld||ad&&_d(ad.resolve())!=hd||od&&_d(new od)!=ud||cd&&_d(new cd)!=dd)&&(_d=function(t){var e=Ac(t),n="[object Object]"==e?t.constructor:void 0,i=n?Fc(n):"";if(i)switch(i){case pd:return fd;case gd:return ld;case yd:return hd;case md:return ud;case bd:return dd}return e});const xd=_d;var vd="[object Arguments]",kd="[object Array]",wd="[object Object]",Td=Object.prototype.hasOwnProperty;const Cd=function(t,e,n,i,r,s){var a=kh(t),o=kh(e),c=a?kd:xd(t),l=o?kd:xd(e),h=(c=c==vd?wd:c)==wd,u=(l=l==vd?wd:l)==wd,d=c==l;if(d&&Sh(t)){if(!Sh(e))return!1;a=!0,h=!1}if(d&&!h)return s||(s=new Iu),a||Yh(t)?zu(t,e,n,i,r,s):Gu(t,e,c,n,i,r,s);if(!(1&n)){var f=h&&Td.call(t,"__wrapped__"),p=u&&Td.call(e,"__wrapped__");if(f||p){var g=f?t.value():t,y=p?e.value():e;return s||(s=new Iu),r(g,y,n,i,s)}}return!!d&&(s||(s=new Iu),rd(t,e,n,i,r,s))};const Ed=function t(e,n,i,r,s){return e===n||(null==e||null==n||!gh(e)&&!gh(n)?e!=e&&n!=n:Cd(e,n,i,r,t,s))};const Sd=function(t,e,n,i){var r=n.length,s=r,a=!i;if(null==t)return!s;for(t=Object(t);r--;){var o=n[r];if(a&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++r<s;){var c=(o=n[r])[0],l=t[c],h=o[1];if(a&&o[2]){if(void 0===l&&!(c in t))return!1}else{var u=new Iu;if(i)var d=i(l,h,c,t,e,u);if(!(void 0===d?Ed(h,l,3,i,u):d))return!1}}return!0};const Ad=function(t){return t==t&&!Dc(t)};const Dd=function(t){for(var e=Zh(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Ad(r)]}return e};const Ld=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}};const Od=function(t){var e=Dd(t);return 1==e.length&&e[0][2]?Ld(e[0][0],e[0][1]):function(n){return n===t||Sd(n,t,e)}};const Md=function(t,e){for(var n=0,i=(e=_u(e,t)).length;null!=t&&n<i;)t=t[xu(e[n++])];return n&&n==i?t:void 0};const Bd=function(t,e,n){var i=null==t?void 0:Md(t,e);return void 0===i?n:i};const Nd=function(t,e){return null!=t&&e in Object(t)};const Id=function(t,e){return null!=t&&vu(t,e,Nd)};const Fd=function(t,e){return pu(t)&&Ad(e)?Ld(xu(t),e):function(n){var i=Bd(n,t);return void 0===i&&i===e?Id(n,t):Ed(e,i,3)}};const Rd=function(t){return function(e){return null==e?void 0:e[t]}};const $d=function(t){return function(e){return Md(e,t)}};const Pd=function(t){return pu(t)?Rd(xu(t)):$d(t)};const Yd=function(t){return"function"==typeof t?t:null==t?Jh:"object"==typeof t?kh(t)?Fd(t[0],t[1]):Od(t):Pd(t)};const jd=function(t,e){var n=-1,i=Xh(t)?Array(t.length):[];return Kh(t,(function(t,r,s){i[++n]=e(t,r,s)})),i};const zd=function(t,e){return(kh(t)?nu:jd)(t,Yd(e,3))};var Ud=Math.ceil,Wd=Math.max;const Hd=function(t,e,n,i){for(var r=-1,s=Wd(Ud((e-t)/(n||1)),0),a=Array(s);s--;)a[i?s:++r]=t,t+=n;return a};const qd=function(t,e,n){if(!Dc(n))return!1;var i=typeof e;return!!("number"==i?Xh(n)&&Dh(e,n.length):"string"==i&&e in n)&&il(n[e],t)};var Vd=/\s/;const Gd=function(t){for(var e=t.length;e--&&Vd.test(t.charAt(e)););return e};var Xd=/^\s+/;const Zd=function(t){return t?t.slice(0,Gd(t)+1).replace(Xd,""):t};var Qd=/^[-+]0x[0-9a-f]+$/i,Kd=/^0b[01]+$/i,Jd=/^0o[0-7]+$/i,tf=parseInt;const ef=function(t){if("number"==typeof t)return t;if(iu(t))return NaN;if(Dc(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Dc(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Zd(t);var n=Kd.test(t);return n||Jd.test(t)?tf(t.slice(2),n?2:8):Qd.test(t)?NaN:+t};var nf=1/0;const rf=function(t){return t?(t=ef(t))===nf||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};const sf=function(t){return function(e,n,i){return i&&"number"!=typeof i&&qd(e,n,i)&&(n=i=void 0),e=rf(e),void 0===n?(n=e,e=0):n=rf(n),i=void 0===i?e<n?1:-1:rf(i),Hd(e,n,i,t)}};const af=sf();const of=function(t,e){var n=[];return Kh(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n};const cf=function(t,e){return(kh(t)?Zu:of)(t,Yd(e,3))};var lf=Object.prototype.hasOwnProperty;const hf=function(t){if(null==t)return!0;if(Xh(t)&&(kh(t)||"string"==typeof t||"function"==typeof t.splice||Sh(t)||Yh(t)||vh(t)))return!t.length;var e=xd(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Wh(t))return!Gh(t).length;for(var n in t)if(lf.call(t,n))return!1;return!0};const uf=function(t){return void 0===t};const df=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)};var ff=Math.max;const pf=function(t,e,n){return e=ff(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=ff(i.length-e,0),a=Array(s);++r<s;)a[r]=i[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=i[r];return o[e]=n(a),df(t,this,o)}};const gf=function(){try{var t=Hc(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var yf=gf?function(t,e){return gf(t,"toString",{configurable:!0,enumerable:!1,value:wu(e),writable:!0})}:Jh;const mf=yf;var bf=Date.now;const _f=function(t){var e=0,n=0;return function(){var i=bf(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(mf);const xf=function(t,e){return _f(pf(t,e,Jh),t+"")};const vf=function(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1};const kf=function(t){return t!=t};const wf=function(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1};const Tf=function(t,e,n){return e==e?wf(t,e,n):vf(t,kf,n)};const Cf=function(t,e){return!!(null==t?0:t.length)&&Tf(t,e,0)>-1};const Ef=function(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1};const Sf=function(){};var Af=od&&1/Hu(new od([,-0]))[1]==1/0?function(t){return new od(t)}:Sf;const Df=Af;const Lf=function(t,e,n){var i=-1,r=Cf,s=t.length,a=!0,o=[],c=o;if(n)a=!1,r=Ef;else if(s>=200){var l=e?null:Df(t);if(l)return Hu(l);a=!1,r=ju,c=new Pu}else c=e?[]:o;t:for(;++i<s;){var h=t[i],u=e?e(h):h;if(h=n||0!==h?h:0,a&&u==u){for(var d=c.length;d--;)if(c[d]===u)continue t;e&&c.push(u),o.push(h)}else r(c,u,n)||(c!==o&&c.push(u),o.push(h))}return o};const Of=function(t){return gh(t)&&Xh(t)};const Mf=xf((function(t){return Lf(Su(t,1,Of,!0))}));const Bf=function(t,e){return nu(e,(function(e){return t[e]}))};const Nf=function(t){return null==t?[]:Bf(t,Zh(t))};const If=function(t,e,n,i){var r=-1,s=null==t?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n};const Ff=function(t,e,n,i,r){return r(t,(function(t,r,s){n=i?(i=!1,t):e(n,t,r,s)})),n};const Rf=function(t,e,n){var i=kh(t)?If:Ff,r=arguments.length<3;return i(t,Yd(e,4),n,r,Kh)};var $f="\0";class Pf{constructor(t={}){this._isDirected=!ku(t,"directed")||t.directed,this._isMultigraph=!!ku(t,"multigraph")&&t.multigraph,this._isCompound=!!ku(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=wu(void 0),this._defaultEdgeLabelFn=wu(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Lc(t)||(t=wu(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Zh(this._nodes)}sources(){var t=this;return cf(this.nodes(),(function(e){return hf(t._in[e])}))}sinks(){var t=this;return cf(this.nodes(),(function(e){return hf(t._out[e])}))}setNodes(t,e){var n=arguments,i=this;return eu(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),this}setNode(t,e){return ku(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=$f,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return ku(this._nodes,t)}removeNode(t){var e=this;if(ku(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],eu(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),eu(Zh(this._in[t]),n),delete this._in[t],delete this._preds[t],eu(Zh(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(uf(e))e=$f;else{for(var n=e+="";!uf(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==$f)return e}}children(t){if(uf(t)&&(t=$f),this._isCompound){var e=this._children[t];if(e)return Zh(e)}else{if(t===$f)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Zh(e)}successors(t){var e=this._sucs[t];if(e)return Zh(e)}neighbors(t){var e=this.predecessors(t);if(e)return Mf(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;eu(this._nodes,(function(n,i){t(i)&&e.setNode(i,n)})),eu(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var i={};function r(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(i[t]=s,s):s in i?i[s]:r(s)}return this._isCompound&&eu(e.nodes(),(function(t){e.setParent(t,r(t))})),e}setDefaultEdgeLabel(t){return Lc(t)||(t=wu(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Nf(this._edgeObjs)}setPath(t,e){var n=this,i=arguments;return Rf(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this}setEdge(){var t,e,n,i,r=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,uf(n)||(n=""+n);var a=zf(this._isDirected,t,e,n);if(ku(this._edgeLabels,a))return r&&(this._edgeLabels[a]=i),this;if(!uf(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=r?i:this._defaultEdgeLabelFn(t,e,n);var o=function(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var a=r;r=s,s=a}var o={v:r,w:s};i&&(o.name=i);return o}(this._isDirected,t,e,n);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[a]=o,Yf(this._preds[e],t),Yf(this._sucs[t],e),this._in[e][a]=o,this._out[t][a]=o,this._edgeCount++,this}edge(t,e,n){var i=1===arguments.length?Uf(this._isDirected,arguments[0]):zf(this._isDirected,t,e,n);return this._edgeLabels[i]}hasEdge(t,e,n){var i=1===arguments.length?Uf(this._isDirected,arguments[0]):zf(this._isDirected,t,e,n);return ku(this._edgeLabels,i)}removeEdge(t,e,n){var i=1===arguments.length?Uf(this._isDirected,arguments[0]):zf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],jf(this._preds[e],t),jf(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var i=Nf(n);return e?cf(i,(function(t){return t.v===e})):i}}outEdges(t,e){var n=this._out[t];if(n){var i=Nf(n);return e?cf(i,(function(t){return t.w===e})):i}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}}function Yf(t,e){t[e]?t[e]++:t[e]=1}function jf(t,e){--t[e]||delete t[e]}function zf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var a=r;r=s,s=a}return r+""+s+""+(uf(i)?"\0":i)}function Uf(t,e){return zf(t,e.v,e.w,e.name)}Pf.prototype._nodeCount=0,Pf.prototype._edgeCount=0;class Wf{constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,e=t._prev;if(e!==t)return Hf(e),e}enqueue(t){var e=this._sentinel;t._prev&&t._next&&Hf(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,qf)),n=n._prev;return"["+t.join(", ")+"]"}}function Hf(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function qf(t,e){if("_next"!==t&&"_prev"!==t)return e}var Vf=wu(1);function Gf(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new Pf,i=0,r=0;eu(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),eu(t.edges(),(function(t){var s=n.edge(t.v,t.w)||0,a=e(t),o=s+a;n.setEdge(t.v,t.w,o),r=Math.max(r,n.node(t.v).out+=a),i=Math.max(i,n.node(t.w).in+=a)}));var s=af(r+i+3).map((function(){return new Wf})),a=i+1;return eu(n.nodes(),(function(t){Zf(s,a,n.node(t))})),{graph:n,buckets:s,zeroIdx:a}}(t,e||Vf),i=function(t,e,n){var i,r=[],s=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;i=a.dequeue();)Xf(t,e,n,i);for(;i=s.dequeue();)Xf(t,e,n,i);if(t.nodeCount())for(var o=e.length-2;o>0;--o)if(i=e[o].dequeue()){r=r.concat(Xf(t,e,n,i,!0));break}}return r}(n.graph,n.buckets,n.zeroIdx);return Au(zd(i,(function(e){return t.outEdges(e.v,e.w)})),!0)}function Xf(t,e,n,i,r){var s=r?[]:void 0;return eu(t.inEdges(i.v),(function(i){var a=t.edge(i),o=t.node(i.v);r&&s.push({v:i.v,w:i.w}),o.out-=a,Zf(e,n,o)})),eu(t.outEdges(i.v),(function(i){var r=t.edge(i),s=i.w,a=t.node(s);a.in-=r,Zf(e,n,a)})),t.removeNode(i.v),s}function Zf(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}function Qf(t){var e="greedy"===t.graph().acyclicer?Gf(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function r(s){ku(i,s)||(i[s]=!0,n[s]=!0,eu(t.outEdges(s),(function(t){ku(n,t.w)?e.push(t):r(t.w)})),delete n[s])}return eu(t.nodes(),r),e}(t);eu(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,lu("rev"))}))}const Kf=function(t,e,n){"__proto__"==e&&gf?gf(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n};const Jf=function(t,e,n){(void 0!==n&&!il(t[e],n)||void 0===n&&!(e in t))&&Kf(t,e,n)};var tp="object"==typeof exports&&exports&&!exports.nodeType&&exports,ep=tp&&"object"==typeof module&&module&&!module.nodeType&&module,np=ep&&ep.exports===tp?bc.Buffer:void 0,ip=np?np.allocUnsafe:void 0;const rp=function(t,e){if(e)return t.slice();var n=t.length,i=ip?ip(n):new t.constructor(n);return t.copy(i),i};const sp=function(t){var e=new t.constructor(t.byteLength);return new Uu(e).set(new Uu(t)),e};const ap=function(t,e){var n=e?sp(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};const op=function(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e};var cp=Object.create,lp=function(){function t(){}return function(e){if(!Dc(e))return{};if(cp)return cp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const hp=lp;const up=Hh(Object.getPrototypeOf,Object);const dp=function(t){return"function"!=typeof t.constructor||Wh(t)?{}:hp(up(t))};var fp=Function.prototype,pp=Object.prototype,gp=fp.toString,yp=pp.hasOwnProperty,mp=gp.call(Object);const bp=function(t){if(!gh(t)||"[object Object]"!=Ac(t))return!1;var e=up(t);if(null===e)return!0;var n=yp.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&gp.call(n)==mp};const _p=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var xp=Object.prototype.hasOwnProperty;const vp=function(t,e,n){var i=t[e];xp.call(t,e)&&il(i,n)&&(void 0!==n||e in t)||Kf(t,e,n)};const kp=function(t,e,n,i){var r=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var o=e[s],c=i?i(n[o],t[o],o,n,t):void 0;void 0===c&&(c=t[o]),r?Kf(n,o,c):vp(n,o,c)}return n};const wp=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e};var Tp=Object.prototype.hasOwnProperty;const Cp=function(t){if(!Dc(t))return wp(t);var e=Wh(t),n=[];for(var i in t)("constructor"!=i||!e&&Tp.call(t,i))&&n.push(i);return n};const Ep=function(t){return Xh(t)?zh(t,!0):Cp(t)};const Sp=function(t){return kp(t,Ep(t))};const Ap=function(t,e,n,i,r,s,a){var o=_p(t,n),c=_p(e,n),l=a.get(c);if(l)Jf(t,n,l);else{var h=s?s(o,c,n+"",t,e,a):void 0,u=void 0===h;if(u){var d=kh(c),f=!d&&Sh(c),p=!d&&!f&&Yh(c);h=c,d||f||p?kh(o)?h=o:Of(o)?h=op(o):f?(u=!1,h=rp(c,!0)):p?(u=!1,h=ap(c,!0)):h=[]:bp(c)||vh(c)?(h=o,vh(o)?h=Sp(o):Dc(o)&&!Lc(o)||(h=dp(c))):u=!1}u&&(a.set(c,h),r(h,c,i,s,a),a.delete(c)),Jf(t,n,h)}};const Dp=function t(e,n,i,r,s){e!==n&&fh(n,(function(a,o){if(s||(s=new Iu),Dc(a))Ap(e,n,o,i,t,r,s);else{var c=r?r(_p(e,o),a,o+"",e,n,s):void 0;void 0===c&&(c=a),Jf(e,o,c)}}),Ep)};const Lp=function(t){return xf((function(e,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(r--,s):void 0,a&&qd(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++i<r;){var o=n[i];o&&t(e,o,i,s)}return e}))};var Op=Lp((function(t,e,n){Dp(t,e,n)}));const Mp=Op;const Bp=function(t,e,n,i){if(!Dc(t))return t;for(var r=-1,s=(e=_u(e,t)).length,a=s-1,o=t;null!=o&&++r<s;){var c=xu(e[r]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(r!=a){var h=o[c];void 0===(l=i?i(h,c,o):void 0)&&(l=Dc(h)?h:Dh(e[r+1])?[]:{})}vp(o,c,l),o=o[c]}return t};const Np=function(t,e,n){for(var i=-1,r=e.length,s={};++i<r;){var a=e[i],o=Md(t,a);n(o,a)&&Bp(s,_u(a,t),o)}return s};const Ip=function(t,e){return Np(t,e,(function(e,n){return Id(t,n)}))};var Fp=function(t){return _f(pf(t,void 0,Au),t+"")}((function(t,e){return null==t?{}:Ip(t,e)}));const Rp=Fp;var $p=Object.prototype,Pp=$p.hasOwnProperty,Yp=xf((function(t,e){t=Object(t);var n=-1,i=e.length,r=i>2?e[2]:void 0;for(r&&qd(e[0],e[1],r)&&(i=1);++n<i;)for(var s=e[n],a=Ep(s),o=-1,c=a.length;++o<c;){var l=a[o],h=t[l];(void 0===h||il(h,$p[l])&&!Pp.call(t,l))&&(t[l]=s[l])}return t}));const jp=Yp;const zp=function(t,e,n){for(var i=-1,r=t.length;++i<r;){var s=t[i],a=e(s);if(null!=a&&(void 0===o?a==a&&!iu(a):n(a,o)))var o=a,c=s}return c};const Up=function(t,e){return t>e};const Wp=function(t){return t&&t.length?zp(t,Jh,Up):void 0};const Hp=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};const qp=function(t,e){var n={};return e=Yd(e,3),Qh(t,(function(t,i,r){Kf(n,i,e(t,i,r))})),n};const Vp=function(t,e){return t<e};const Gp=function(t){return t&&t.length?zp(t,Jh,Vp):void 0};const Xp=function(){return bc.Date.now()};function Zp(t,e,n,i){var r;do{r=lu(i)}while(t.hasNode(r));return n.dummy=e,t.setNode(r,n),r}function Qp(t){var e=new Pf({multigraph:t.isMultigraph()}).setGraph(t.graph());return eu(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),eu(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e}function Kp(t,e){var n,i,r=t.x,s=t.y,a=e.x-r,o=e.y-s,c=t.width/2,l=t.height/2;if(!a&&!o)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(o)*c>Math.abs(a)*l?(o<0&&(l=-l),n=l*a/o,i=l):(a<0&&(c=-c),n=c,i=c*o/a),{x:r+n,y:s+i}}function Jp(t){var e=zd(af(eg(t)+1),(function(){return[]}));return eu(t.nodes(),(function(n){var i=t.node(n),r=i.rank;uf(r)||(e[r][i.order]=n)})),e}function tg(t,e,n,i){var r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Zp(t,"border",r,e)}function eg(t){return Wp(zd(t.nodes(),(function(e){var n=t.node(e).rank;if(!uf(n))return n})))}function ng(t,e){var n=Xp();try{return e()}finally{console.log(t+" time: "+(Xp()-n)+"ms")}}function ig(t,e){return e()}function rg(t,e,n,i,r,s){var a={width:0,height:0,rank:s,borderType:e},o=r[e][s-1],c=Zp(t,"border",a,n);r[e][s]=c,t.setParent(c,i),o&&t.setEdge(o,c,{weight:1})}function sg(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){eu(t.nodes(),(function(e){cg(t.node(e))})),eu(t.edges(),(function(e){var n=t.edge(e);eu(n.points,cg),ku(n,"y")&&cg(n)}))}(t),"lr"!==e&&"rl"!==e||(!function(t){eu(t.nodes(),(function(e){lg(t.node(e))})),eu(t.edges(),(function(e){var n=t.edge(e);eu(n.points,lg),ku(n,"x")&&lg(n)}))}(t),ag(t))}function ag(t){eu(t.nodes(),(function(e){og(t.node(e))})),eu(t.edges(),(function(e){og(t.edge(e))}))}function og(t){var e=t.width;t.width=t.height,t.height=e}function cg(t){t.y=-t.y}function lg(t){var e=t.x;t.x=t.y,t.y=e}function hg(t){var e=Zp(t,"root",{},"_root"),n=function(t){var e={};function n(i,r){var s=t.children(i);s&&s.length&&eu(s,(function(t){n(t,r+1)})),e[i]=r}return eu(t.children(),(function(t){n(t,1)})),e}(t),i=Wp(Nf(n))-1,r=2*i+1;t.graph().nestingRoot=e,eu(t.edges(),(function(e){t.edge(e).minlen*=r}));var s=function(t){return Rf(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;eu(t.children(),(function(a){ug(t,e,r,s,i,n,a)})),t.graph().nodeRankFactor=r}function ug(t,e,n,i,r,s,a){var o=t.children(a);if(o.length){var c=tg(t,"_bt"),l=tg(t,"_bb"),h=t.node(a);t.setParent(c,a),h.borderTop=c,t.setParent(l,a),h.borderBottom=l,eu(o,(function(o){ug(t,e,n,i,r,s,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,f=h.borderTop?i:2*i,p=u!==d?1:r-s[a]+1;t.setEdge(c,u,{weight:f,minlen:p,nestingEdge:!0}),t.setEdge(d,l,{weight:f,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,c,{weight:0,minlen:r+s[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}const dg=function(t,e){return t&&kp(e,Zh(e),t)};const fg=function(t,e){return t&&kp(e,Ep(e),t)};const pg=function(t,e){return kp(t,ed(t),e)};var gg=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Tu(e,ed(t)),t=up(t);return e}:Qu;const yg=gg;const mg=function(t,e){return kp(t,yg(t),e)};const bg=function(t){return Xu(t,Ep,yg)};var _g=Object.prototype.hasOwnProperty;const xg=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&_g.call(t,"index")&&(n.index=t.index,n.input=t.input),n};const vg=function(t,e){var n=e?sp(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)};var kg=/\w*$/;const wg=function(t){var e=new t.constructor(t.source,kg.exec(t));return e.lastIndex=t.lastIndex,e};var Tg=_c?_c.prototype:void 0,Cg=Tg?Tg.valueOf:void 0;const Eg=function(t){return Cg?Object(Cg.call(t)):{}};const Sg=function(t,e,n){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return sp(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return vg(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ap(t,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return wg(t);case"[object Symbol]":return Eg(t)}};const Ag=function(t){return gh(t)&&"[object Map]"==xd(t)};var Dg=$h&&$h.isMap;const Lg=Dg?Bh(Dg):Ag;const Og=function(t){return gh(t)&&"[object Set]"==xd(t)};var Mg=$h&&$h.isSet;const Bg=Mg?Bh(Mg):Og;var Ng="[object Arguments]",Ig="[object Function]",Fg="[object Object]",Rg={};Rg[Ng]=Rg["[object Array]"]=Rg["[object ArrayBuffer]"]=Rg["[object DataView]"]=Rg["[object Boolean]"]=Rg["[object Date]"]=Rg["[object Float32Array]"]=Rg["[object Float64Array]"]=Rg["[object Int8Array]"]=Rg["[object Int16Array]"]=Rg["[object Int32Array]"]=Rg["[object Map]"]=Rg["[object Number]"]=Rg["[object Object]"]=Rg["[object RegExp]"]=Rg["[object Set]"]=Rg["[object String]"]=Rg["[object Symbol]"]=Rg["[object Uint8Array]"]=Rg["[object Uint8ClampedArray]"]=Rg["[object Uint16Array]"]=Rg["[object Uint32Array]"]=!0,Rg["[object Error]"]=Rg[Ig]=Rg["[object WeakMap]"]=!1;const $g=function t(e,n,i,r,s,a){var o,c=1&n,l=2&n,h=4&n;if(i&&(o=s?i(e,r,s,a):i(e)),void 0!==o)return o;if(!Dc(e))return e;var u=kh(e);if(u){if(o=xg(e),!c)return op(e,o)}else{var d=xd(e),f=d==Ig||"[object GeneratorFunction]"==d;if(Sh(e))return rp(e,c);if(d==Fg||d==Ng||f&&!s){if(o=l||f?{}:dp(e),!c)return l?mg(e,fg(o,e)):pg(e,dg(o,e))}else{if(!Rg[d])return s?e:{};o=Sg(e,d,c)}}a||(a=new Iu);var p=a.get(e);if(p)return p;a.set(e,o),Bg(e)?e.forEach((function(r){o.add(t(r,n,i,r,e,a))})):Lg(e)&&e.forEach((function(r,s){o.set(s,t(r,n,i,s,e,a))}));var g=u?void 0:(h?l?bg:nd:l?Ep:Zh)(e);return uh(g||e,(function(r,s){g&&(r=e[s=r]),vp(o,s,t(r,n,i,s,e,a))})),o};const Pg=function(t){return $g(t,5)};function Yg(t,e,n){var i=function(t){var e;for(;t.hasNode(e=lu("_root")););return e}(t),r=new Pf({compound:!0}).setGraph({root:i}).setDefaultNodeLabel((function(e){return t.node(e)}));return eu(t.nodes(),(function(s){var a=t.node(s),o=t.parent(s);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(r.setNode(s),r.setParent(s,o||i),eu(t[n](s),(function(e){var n=e.v===s?e.w:e.v,i=r.edge(n,s),a=uf(i)?0:i.weight;r.setEdge(n,s,{weight:t.edge(e).weight+a})})),ku(a,"minRank")&&r.setNode(s,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),r}const jg=function(t,e,n){for(var i=-1,r=t.length,s=e.length,a={};++i<r;){var o=i<s?e[i]:void 0;n(a,t[i],o)}return a};const zg=function(t,e){return jg(t||[],e||[],vp)};const Ug=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t};const Wg=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t==t,s=iu(t),a=void 0!==e,o=null===e,c=e==e,l=iu(e);if(!o&&!l&&!s&&t>e||s&&a&&c&&!o&&!l||i&&a&&c||!n&&c||!r)return 1;if(!i&&!s&&!l&&t<e||l&&n&&r&&!i&&!s||o&&n&&r||!a&&r||!c)return-1}return 0};const Hg=function(t,e,n){for(var i=-1,r=t.criteria,s=e.criteria,a=r.length,o=n.length;++i<a;){var c=Wg(r[i],s[i]);if(c)return i>=o?c:c*("desc"==n[i]?-1:1)}return t.index-e.index};const qg=function(t,e,n){e=e.length?nu(e,(function(t){return kh(t)?function(e){return Md(e,1===t.length?t[0]:t)}:t})):[Jh];var i=-1;e=nu(e,Bh(Yd));var r=jd(t,(function(t,n,r){return{criteria:nu(e,(function(e){return e(t)})),index:++i,value:t}}));return Ug(r,(function(t,e){return Hg(t,e,n)}))};const Vg=xf((function(t,e){if(null==t)return[];var n=e.length;return n>1&&qd(t,e[0],e[1])?e=[]:n>2&&qd(e[0],e[1],e[2])&&(e=[e[0]]),qg(t,Su(e,1),[])}));function Gg(t,e){for(var n=0,i=1;i<e.length;++i)n+=Xg(t,e[i-1],e[i]);return n}function Xg(t,e,n){for(var i=zg(n,zd(n,(function(t,e){return e}))),r=Au(zd(e,(function(e){return Vg(zd(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),s=1;s<n.length;)s<<=1;var a=2*s-1;s-=1;var o=zd(new Array(a),(function(){return 0})),c=0;return eu(r.forEach((function(t){var e=t.pos+s;o[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=o[e+1]),o[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}function Zg(t,e){var n={};return eu(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};uf(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),eu(e.edges(),(function(t){var e=n[t.v],i=n[t.w];uf(e)||uf(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(uf(e.barycenter)||uf(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight);e.weight&&(n+=e.barycenter*e.weight,i+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var r=t.pop();e.push(r),eu(r.in.reverse(),n(r)),eu(r.out,i(r))}return zd(cf(e,(function(t){return!t.merged})),(function(t){return Rp(t,["vs","i","barycenter","weight"])}))}(cf(n,(function(t){return!t.indegree})))}function Qg(t,e){var n,i=function(t,e){var n={lhs:[],rhs:[]};return eu(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n}(t,(function(t){return ku(t,"barycenter")})),r=i.lhs,s=Vg(i.rhs,(function(t){return-t.i})),a=[],o=0,c=0,l=0;r.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),l=Kg(a,s,l),eu(r,(function(t){l+=t.vs.length,a.push(t.vs),o+=t.barycenter*t.weight,c+=t.weight,l=Kg(a,s,l)}));var h={vs:Au(a,!0)};return c&&(h.barycenter=o/c,h.weight=c),h}function Kg(t,e,n){for(var i;e.length&&(i=Hp(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}function Jg(t,e,n,i){var r=t.children(e),s=t.node(e),a=s?s.borderLeft:void 0,o=s?s.borderRight:void 0,c={};a&&(r=cf(r,(function(t){return t!==a&&t!==o})));var l=function(t,e){return zd(e,(function(e){var n=t.inEdges(e);if(n.length){var i=Rf(n,(function(e,n){var i=t.edge(n),r=t.node(n.v);return{sum:e.sum+i.weight*r.order,weight:e.weight+i.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}(t,r);eu(l,(function(e){if(t.children(e.v).length){var r=Jg(t,e.v,n,i);c[e.v]=r,ku(r,"barycenter")&&(a=r,uf((s=e).barycenter)?(s.barycenter=a.barycenter,s.weight=a.weight):(s.barycenter=(s.barycenter*s.weight+a.barycenter*a.weight)/(s.weight+a.weight),s.weight+=a.weight))}var s,a}));var h=Zg(l,n);!function(t,e){eu(t,(function(t){t.vs=Au(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(h,c);var u=Qg(h,i);if(a&&(u.vs=Au([a,u.vs,o],!0),t.predecessors(a).length)){var d=t.node(t.predecessors(a)[0]),f=t.node(t.predecessors(o)[0]);ku(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+d.order+f.order)/(u.weight+2),u.weight+=2}return u}function ty(t){var e=eg(t),n=ey(t,af(1,e+1),"inEdges"),i=ey(t,af(e-1,-1,-1),"outEdges"),r=function(t){var e={},n=cf(t.nodes(),(function(e){return!t.children(e).length})),i=Wp(zd(n,(function(e){return t.node(e).rank}))),r=zd(af(i+1),(function(){return[]})),s=Vg(n,(function(e){return t.node(e).rank}));return eu(s,(function n(i){if(!ku(e,i)){e[i]=!0;var s=t.node(i);r[s.rank].push(i),eu(t.successors(i),n)}})),r}(t);iy(t,r);for(var s,a=Number.POSITIVE_INFINITY,o=0,c=0;c<4;++o,++c){ny(o%2?n:i,o%4>=2);var l=Gg(t,r=Jp(t));l<a&&(c=0,s=Pg(r),a=l)}iy(t,s)}function ey(t,e,n){return zd(e,(function(e){return Yg(t,e,n)}))}function ny(t,e){var n=new Pf;eu(t,(function(t){var i=t.graph().root,r=Jg(t,i,n,e);eu(r.vs,(function(e,n){t.node(e).order=n})),function(t,e,n){var i,r={};eu(n,(function(n){for(var s,a,o=t.parent(n);o;){if((s=t.parent(o))?(a=r[s],r[s]=o):(a=i,i=o),a&&a!==o)return void e.setEdge(a,o);o=s}}))}(t,n,r.vs)}))}function iy(t,e){eu(e,(function(e){eu(e,(function(e,n){t.node(e).order=n}))}))}function ry(t){var e=function(t){var e={},n=0;function i(r){var s=n;eu(t.children(r),i),e[r]={low:s,lim:n++}}return eu(t.children(),i),e}(t);eu(t.graph().dummyChains,(function(n){for(var i=t.node(n),r=i.edgeObj,s=function(t,e,n,i){var r,s,a=[],o=[],c=Math.min(e[n].low,e[i].low),l=Math.max(e[n].lim,e[i].lim);r=n;do{r=t.parent(r),a.push(r)}while(r&&(e[r].low>c||l>e[r].lim));s=r,r=i;for(;(r=t.parent(r))!==s;)o.push(r);return{path:a.concat(o.reverse()),lca:s}}(t,e,r.v,r.w),a=s.path,o=s.lca,c=0,l=a[c],h=!0;n!==r.w;){if(i=t.node(n),h){for(;(l=a[c])!==o&&t.node(l).maxRank<i.rank;)c++;l===o&&(h=!1)}if(!h){for(;c<a.length-1&&t.node(l=a[c+1]).minRank<=i.rank;)c++;l=a[c]}t.setParent(n,l),n=t.successors(n)[0]}}))}const sy=function(t){return function(e,n,i){var r=Object(e);if(!Xh(e)){var s=Yd(n,3);e=Zh(e),n=function(t){return s(r[t],t,r)}}var a=t(e,n,i);return a>-1?r[s?e[a]:a]:void 0}};const ay=function(t){var e=rf(t),n=e%1;return e==e?n?e-n:e:0};var oy=Math.max;const cy=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ay(n);return r<0&&(r=oy(i+r,0)),vf(t,Yd(e,3),r)};const ly=sy(cy);const hy=function(t,e){return t&&t.length?zp(t,Yd(e,2),Vp):void 0};const uy=function(t,e){return null==t?t:fh(t,tu(e),Ep)};function dy(t,e){var n={};return Rf(e,(function(e,i){var r=0,s=0,a=e.length,o=Hp(i);return eu(i,(function(e,c){var l=function(t,e){if(t.node(e).dummy)return ly(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=l?t.node(l).order:a;(l||e===o)&&(eu(i.slice(s,c+1),(function(e){eu(t.predecessors(e),(function(i){var s=t.node(i),a=s.order;!(a<r||h<a)||s.dummy&&t.node(e).dummy||fy(n,i,e)}))})),s=c+1,r=h)})),i})),n}function fy(t,e,n){if(e>n){var i=e;e=n,n=i}var r=t[e];r||(t[e]=r={}),r[n]=!0}function py(t,e,n){if(e>n){var i=e;e=n,n=i}return ku(t[e],n)}function gy(t,e,n,i,r){var s={},a=function(t,e,n,i){var r=new Pf,s=t.graph(),a=function(t,e,n){return function(i,r,s){var a,o=i.node(r),c=i.node(s),l=0;if(l+=o.width/2,ku(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":a=-o.width/2;break;case"r":a=o.width/2}if(a&&(l+=n?a:-a),a=0,l+=(o.dummy?e:t)/2,l+=(c.dummy?e:t)/2,l+=c.width/2,ku(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(l+=n?a:-a),a=0,l}}(s.nodesep,s.edgesep,i);return eu(e,(function(e){var i;eu(e,(function(e){var s=n[e];if(r.setNode(s),i){var o=n[i],c=r.edge(o,s);r.setEdge(o,s,Math.max(a(t,e,i),c||0))}i=e}))})),r}(t,e,n,r),o=r?"borderLeft":"borderRight";function c(t,e){for(var n=a.nodes(),i=n.pop(),r={};i;)r[i]?t(i):(r[i]=!0,n.push(i),n=n.concat(e(i))),i=n.pop()}return c((function(t){s[t]=a.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),c((function(e){var n=a.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),i=t.node(e);n!==Number.POSITIVE_INFINITY&&i.borderType!==o&&(s[e]=Math.max(s[e],n))}),a.successors.bind(a)),eu(i,(function(t){s[t]=s[n[t]]})),s}function yy(t){var e,n=Jp(t),i=Mp(dy(t,n),function(t,e){var n={};function i(e,i,r,s,a){var o;eu(af(i,r),(function(i){o=e[i],t.node(o).dummy&&eu(t.predecessors(o),(function(e){var i=t.node(e);i.dummy&&(i.order<s||i.order>a)&&fy(n,e,o)}))}))}return Rf(e,(function(e,n){var r,s=-1,a=0;return eu(n,(function(o,c){if("border"===t.node(o).dummy){var l=t.predecessors(o);l.length&&(r=t.node(l[0]).order,i(n,a,c,s,r),a=c,s=r)}i(n,a,n.length,r,e.length)})),n})),n}(t,n)),r={};eu(["u","d"],(function(s){e="u"===s?n:Nf(n).reverse(),eu(["l","r"],(function(n){"r"===n&&(e=zd(e,(function(t){return Nf(t).reverse()})));var a=("u"===s?t.predecessors:t.successors).bind(t),o=function(t,e,n,i){var r={},s={},a={};return eu(e,(function(t){eu(t,(function(t,e){r[t]=t,s[t]=t,a[t]=e}))})),eu(e,(function(t){var e=-1;eu(t,(function(t){var o=i(t);if(o.length){o=Vg(o,(function(t){return a[t]}));for(var c=(o.length-1)/2,l=Math.floor(c),h=Math.ceil(c);l<=h;++l){var u=o[l];s[t]===t&&e<a[u]&&!py(n,t,u)&&(s[u]=t,s[t]=r[t]=r[u],e=a[u])}}}))})),{root:r,align:s}}(0,e,i,a),c=gy(t,e,o.root,o.align,"r"===n);"r"===n&&(c=qp(c,(function(t){return-t}))),r[s+n]=c}))}));var s=function(t,e){return hy(Nf(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return uy(e,(function(e,r){var s=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+s,n),i=Math.min(e-s,i)})),n-i}))}(t,r);return function(t,e){var n=Nf(e),i=Gp(n),r=Wp(n);eu(["u","d"],(function(n){eu(["l","r"],(function(s){var a,o=n+s,c=t[o];if(c!==e){var l=Nf(c);(a="l"===s?i-Gp(l):r-Wp(l))&&(t[o]=qp(c,(function(t){return t+a})))}}))}))}(r,s),function(t,e){return qp(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var r=Vg(zd(t,i));return(r[1]+r[2])/2}))}(r,t.graph().align)}function my(t){(function(t){var e=Jp(t),n=t.graph().ranksep,i=0;eu(e,(function(e){var r=Wp(zd(e,(function(e){return t.node(e).height})));eu(e,(function(e){t.node(e).y=i+r/2})),i+=r+n}))})(t=Qp(t)),eu(yy(t),(function(e,n){t.node(n).x=e}))}function by(t,e){var n=e&&e.debugTiming?ng:ig;n("layout",(function(){var e=n("  buildLayoutGraph",(function(){return function(t){var e=new Pf({multigraph:!0,compound:!0}),n=Ay(t.graph());return e.setGraph(Mp({},xy,Sy(n,_y),Rp(n,vy))),eu(t.nodes(),(function(n){var i=Ay(t.node(n));e.setNode(n,jp(Sy(i,ky),wy)),e.setParent(n,t.parent(n))})),eu(t.edges(),(function(n){var i=Ay(t.edge(n));e.setEdge(n,Mp({},Cy,Sy(i,Ty),Rp(i,Ey)))})),e}(t)}));n("  runLayout",(function(){!function(t,e){e("    makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,eu(t.edges(),(function(n){var i=t.edge(n);i.minlen*=2,"c"!==i.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(t)})),e("    removeSelfEdges",(function(){!function(t){eu(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e("    acyclic",(function(){Qf(t)})),e("    nestingGraph.run",(function(){hg(t)})),e("    rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:rm(t);break;case"tight-tree":!function(t){Dy(t),Oy(t)}(t);break;case"longest-path":im(t)}}(Qp(t))})),e("    injectEdgeLabelProxies",(function(){!function(t){eu(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var i=t.node(e.v),r={rank:(t.node(e.w).rank-i.rank)/2+i.rank,e};Zp(t,"edge-proxy",r,"_ep")}}))}(t)})),e("    removeEmptyRanks",(function(){!function(t){var e=Gp(zd(t.nodes(),(function(e){return t.node(e).rank}))),n=[];eu(t.nodes(),(function(i){var r=t.node(i).rank-e;n[r]||(n[r]=[]),n[r].push(i)}));var i=0,r=t.graph().nodeRankFactor;eu(n,(function(e,n){uf(e)&&n%r!=0?--i:i&&eu(e,(function(e){t.node(e).rank+=i}))}))}(t)})),e("    nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,eu(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e("    normalizeRanks",(function(){!function(t){var e=Gp(zd(t.nodes(),(function(e){return t.node(e).rank})));eu(t.nodes(),(function(n){var i=t.node(n);ku(i,"rank")&&(i.rank-=e)}))}(t)})),e("    assignRankMinMax",(function(){!function(t){var e=0;eu(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=Wp(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e("    removeEdgeLabelProxies",(function(){!function(t){eu(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e("    normalize.run",(function(){!function(t){t.graph().dummyChains=[],eu(t.edges(),(function(e){!function(t,e){var n,i,r,s=e.v,a=t.node(s).rank,o=e.w,c=t.node(o).rank,l=e.name,h=t.edge(e),u=h.labelRank;if(c===a+1)return;for(t.removeEdge(e),r=0,++a;a<c;++r,++a)h.points=[],n=Zp(t,"edge",i={width:0,height:0,edgeLabel:h,edgeObj:e,rank:a},"_d"),a===u&&(i.width=h.width,i.height=h.height,i.dummy="edge-label",i.labelpos=h.labelpos),t.setEdge(s,n,{weight:h.weight},l),0===r&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,o,{weight:h.weight},l)}(t,e)}))}(t)})),e("    parentDummyChains",(function(){ry(t)})),e("    addBorderSegments",(function(){!function(t){eu(t.children(),(function e(n){var i=t.children(n),r=t.node(n);if(i.length&&eu(i,e),ku(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(var s=r.minRank,a=r.maxRank+1;s<a;++s)rg(t,"borderLeft","_bl",n,r,s),rg(t,"borderRight","_br",n,r,s)}}))}(t)})),e("    order",(function(){ty(t)})),e("    insertSelfEdges",(function(){!function(t){var e=Jp(t);eu(e,(function(e){var n=0;eu(e,(function(e,i){var r=t.node(e);r.order=i+n,eu(r.selfEdges,(function(e){Zp(t,"selfedge",{width:e.label.width,height:e.label.height,rank:r.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete r.selfEdges}))}))}(t)})),e("    adjustCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||ag(t)}(t)})),e("    position",(function(){my(t)})),e("    positionSelfEdges",(function(){!function(t){eu(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var i=t.node(n.e.v),r=i.x+i.width/2,s=i.y,a=n.x-r,o=i.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*a/3,y:s-o},{x:r+5*a/6,y:s-o},{x:r+a,y:s},{x:r+5*a/6,y:s+o},{x:r+2*a/3,y:s+o}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e("    removeBorderNodes",(function(){!function(t){eu(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),r=t.node(n.borderBottom),s=t.node(Hp(n.borderLeft)),a=t.node(Hp(n.borderRight));n.width=Math.abs(a.x-s.x),n.height=Math.abs(r.y-i.y),n.x=s.x+n.width/2,n.y=i.y+n.height/2}})),eu(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e("    normalize.undo",(function(){!function(t){eu(t.graph().dummyChains,(function(e){var n,i=t.node(e),r=i.edgeLabel;for(t.setEdge(i.edgeObj,r);i.dummy;)n=t.successors(e)[0],t.removeNode(e),r.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(r.x=i.x,r.y=i.y,r.width=i.width,r.height=i.height),e=n,i=t.node(e)}))}(t)})),e("    fixupEdgeLabelCoords",(function(){!function(t){eu(t.edges(),(function(e){var n=t.edge(e);if(ku(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e("    undoCoordinateSystem",(function(){sg(t)})),e("    translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,r=0,s=t.graph(),a=s.marginx||0,o=s.marginy||0;function c(t){var s=t.x,a=t.y,o=t.width,c=t.height;e=Math.min(e,s-o/2),n=Math.max(n,s+o/2),i=Math.min(i,a-c/2),r=Math.max(r,a+c/2)}eu(t.nodes(),(function(e){c(t.node(e))})),eu(t.edges(),(function(e){var n=t.edge(e);ku(n,"x")&&c(n)})),e-=a,i-=o,eu(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),eu(t.edges(),(function(n){var r=t.edge(n);eu(r.points,(function(t){t.x-=e,t.y-=i})),ku(r,"x")&&(r.x-=e),ku(r,"y")&&(r.y-=i)})),s.width=n-e+a,s.height=r-i+o}(t)})),e("    assignNodeIntersects",(function(){!function(t){eu(t.edges(),(function(e){var n,i,r=t.edge(e),s=t.node(e.v),a=t.node(e.w);r.points?(n=r.points[0],i=r.points[r.points.length-1]):(r.points=[],n=a,i=s),r.points.unshift(Kp(s,n)),r.points.push(Kp(a,i))}))}(t)})),e("    reversePoints",(function(){!function(t){eu(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e("    acyclic.undo",(function(){!function(t){eu(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var i=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,i)}}))}(t)}))}(e,n)})),n("  updateInputGraph",(function(){!function(t,e){eu(t.nodes(),(function(n){var i=t.node(n),r=e.node(n);i&&(i.x=r.x,i.y=r.y,e.children(n).length&&(i.width=r.width,i.height=r.height))})),eu(t.edges(),(function(n){var i=t.edge(n),r=e.edge(n);i.points=r.points,ku(r,"x")&&(i.x=r.x,i.y=r.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))}var _y=["nodesep","edgesep","ranksep","marginx","marginy"],xy={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vy=["acyclicer","ranker","rankdir","align"],ky=["width","height"],wy={width:0,height:0},Ty=["minlen","weight","width","height","labeloffset"],Cy={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ey=["labelpos"];function Sy(t,e){return qp(Rp(t,e),Number)}function Ay(t){var e={};return eu(t,(function(t,n){e[n.toLowerCase()]=t})),e}function Dy(t){var e={};eu(t.sources(),(function n(i){var r=t.node(i);if(ku(e,i))return r.rank;e[i]=!0;var s=Gp(zd(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),r.rank=s}))}function Ly(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function Oy(t){var e,n,i=new Pf({directed:!1}),r=t.nodes()[0],s=t.nodeCount();for(i.setNode(r,{});My(i,t)<s;)e=By(i,t),n=i.hasNode(e.v)?Ly(t,e):-Ly(t,e),Ny(i,t,n);return i}function My(t,e){return eu(t.nodes(),(function n(i){eu(e.nodeEdges(i),(function(r){var s=r.v,a=i===s?r.w:s;t.hasNode(a)||Ly(e,r)||(t.setNode(a,{}),t.setEdge(i,a,{}),n(a))}))})),t.nodeCount()}function By(t,e){return hy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Ly(e,n)}))}function Ny(t,e,n){eu(t.nodes(),(function(t){e.node(t).rank+=n}))}wu(1);wu(1);Rd("length");RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Iy="[\\ud800-\\udfff]",Fy="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ry="\\ud83c[\\udffb-\\udfff]",$y="[^\\ud800-\\udfff]",Py="(?:\\ud83c[\\udde6-\\uddff]){2}",Yy="[\\ud800-\\udbff][\\udc00-\\udfff]",jy="(?:"+Fy+"|"+Ry+")"+"?",zy="[\\ufe0e\\ufe0f]?",Uy=zy+jy+("(?:\\u200d(?:"+[$y,Py,Yy].join("|")+")"+zy+jy+")*"),Wy="(?:"+[$y+Fy+"?",Fy,Py,Yy,Iy].join("|")+")";RegExp(Ry+"(?="+Ry+")|"+Wy+Uy,"g");function Hy(){}function qy(t,e,n){kh(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return eu(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Vy(t,e,"post"===n,s,i,r)})),r}function Vy(t,e,n,i,r,s){ku(i,e)||(i[e]=!0,n||s.push(e),eu(r(e),(function(e){Vy(t,e,n,i,r,s)})),n&&s.push(e))}function Gy(t){t=function(t){var e=(new Pf).setGraph(t.graph());return eu(t.nodes(),(function(n){e.setNode(n,t.node(n))})),eu(t.edges(),(function(n){var i=e.edge(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:i.weight+r.weight,minlen:Math.max(i.minlen,r.minlen)})})),e}(t),Dy(t);var e,n=Oy(t);for(Qy(n),Xy(n,t);e=Jy(n);)em(n,t,e,tm(n,t,e))}function Xy(t,e){var n=function(t,e){return qy(t,e,"post")}(t,t.nodes());n=n.slice(0,n.length-1),eu(n,(function(n){!function(t,e,n){var i=t.node(n).parent;t.edge(n,i).cutvalue=Zy(t,e,n)}(t,e,n)}))}function Zy(t,e,n){var i=t.node(n).parent,r=!0,s=e.edge(n,i),a=0;return s||(r=!1,s=e.edge(i,n)),a=s.weight,eu(e.nodeEdges(n),(function(s){var o,c,l=s.v===n,h=l?s.w:s.v;if(h!==i){var u=l===r,d=e.edge(s).weight;if(a+=u?d:-d,o=n,c=h,t.hasEdge(o,c)){var f=t.edge(n,h).cutvalue;a+=u?-f:f}}})),a}function Qy(t,e){arguments.length<2&&(e=t.nodes()[0]),Ky(t,{},1,e)}function Ky(t,e,n,i,r){var s=n,a=t.node(i);return e[i]=!0,eu(t.neighbors(i),(function(r){ku(e,r)||(n=Ky(t,e,n,r,i))})),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function Jy(t){return ly(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function tm(t,e,n){var i=n.v,r=n.w;e.hasEdge(i,r)||(i=n.w,r=n.v);var s=t.node(i),a=t.node(r),o=s,c=!1;s.lim>a.lim&&(o=a,c=!0);var l=cf(e.edges(),(function(e){return c===nm(t,t.node(e.v),o)&&c!==nm(t,t.node(e.w),o)}));return hy(l,(function(t){return Ly(e,t)}))}function em(t,e,n,i){var r=n.v,s=n.w;t.removeEdge(r,s),t.setEdge(i.v,i.w,{}),Qy(t),Xy(t,e),function(t,e){var n=ly(t.nodes(),(function(t){return!e.node(t).parent})),i=function(t,e){return qy(t,e,"pre")}(t,n);i=i.slice(1),eu(i,(function(n){var i=t.node(n).parent,r=e.edge(n,i),s=!1;r||(r=e.edge(i,n),s=!0),e.node(n).rank=e.node(i).rank+(s?r.minlen:-r.minlen)}))}(t,e)}function nm(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Hy.prototype=new Error,Gy.initLowLimValues=Qy,Gy.initCutValues=Xy,Gy.calcCutValue=Zy,Gy.leaveEdge=Jy,Gy.enterEdge=tm,Gy.exchangeEdges=em;var im=Dy;function rm(t){Gy(t)}const sm=function(t){return $g(t,4)};function am(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:om(t),edges:cm(t)};return uf(t.graph())||(e.value=sm(t.graph())),e}function om(t){return zd(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),r={v:e};return uf(n)||(r.value=n),uf(i)||(r.parent=i),r}))}function cm(t){return zd(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return uf(e.name)||(i.name=e.name),uf(n)||(i.value=n),i}))}const lm={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let hm;const um=new Uint8Array(16);function dm(){if(!hm&&(hm="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hm(um)}const fm=[];for(let t=0;t<256;++t)fm.push((t+256).toString(16).slice(1));function pm(t,e=0){return(fm[t[e+0]]+fm[t[e+1]]+fm[t[e+2]]+fm[t[e+3]]+"-"+fm[t[e+4]]+fm[t[e+5]]+"-"+fm[t[e+6]]+fm[t[e+7]]+"-"+fm[t[e+8]]+fm[t[e+9]]+"-"+fm[t[e+10]]+fm[t[e+11]]+fm[t[e+12]]+fm[t[e+13]]+fm[t[e+14]]+fm[t[e+15]]).toLowerCase()}const gm=function(t,e,n){if(lm.randomUUID&&!e&&!t)return lm.randomUUID();const i=(t=t||{}).random||(t.rng||dm)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return pm(i)};function ym(t,e){e&&t.attr("style",e)}function mm(t,e){var n=t.append("foreignObject").attr("width","100000"),i=n.append("xhtml:div");i.attr("xmlns","http://www.w3.org/1999/xhtml");var r=e.label;switch(typeof r){case"function":i.insert(r);break;case"object":i.insert((function(){return r}));break;default:i.html(r)}ym(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap");var s=i.node().getBoundingClientRect();return n.attr("width",s.width).attr("height",s.height),n}var bm=Object.defineProperty,_m=(t,e,n)=>(((t,e,n)=>{e in t?bm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const xm={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},vm={trace:(...t)=>{},debug:(...t)=>{},info:(...t)=>{},warn:(...t)=>{},error:(...t)=>{},fatal:(...t)=>{}},km=function(t="fatal"){let e=xm.fatal;"string"==typeof t?(t=t.toLowerCase())in xm&&(e=xm[t]):"number"==typeof t&&(e=t),vm.trace=()=>{},vm.debug=()=>{},vm.info=()=>{},vm.warn=()=>{},vm.error=()=>{},vm.fatal=()=>{},e<=xm.fatal&&(vm.fatal=console.error?console.error.bind(console,wm("FATAL"),"color: orange"):console.log.bind(console,"[35m",wm("FATAL"))),e<=xm.error&&(vm.error=console.error?console.error.bind(console,wm("ERROR"),"color: orange"):console.log.bind(console,"[31m",wm("ERROR"))),e<=xm.warn&&(vm.warn=console.warn?console.warn.bind(console,wm("WARN"),"color: orange"):console.log.bind(console,"[33m",wm("WARN"))),e<=xm.info&&(vm.info=console.info?console.info.bind(console,wm("INFO"),"color: lightblue"):console.log.bind(console,"[34m",wm("INFO"))),e<=xm.debug&&(vm.debug=console.debug?console.debug.bind(console,wm("DEBUG"),"color: lightgreen"):console.log.bind(console,"[32m",wm("DEBUG"))),e<=xm.trace&&(vm.trace=console.debug?console.debug.bind(console,wm("TRACE"),"color: lightgreen"):console.log.bind(console,"[32m",wm("TRACE")))},wm=e=>`%c${t().format("ss.SSS")} : ${e} : `,Tm=t=>Yo.sanitize(t),Cm=(t,e)=>{var n;if(!1!==(null==(n=e.flowchart)?void 0:n.htmlLabels)){const n=e.securityLevel;"antiscript"===n||"strict"===n?t=Tm(t):"loose"!==n&&(t=(t=(t=Dm(t)).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/=/g,"&equals;"),t=Am(t))}return t},Em=(t,e)=>t?t=e.dompurifyConfig?Yo.sanitize(Cm(t,e),e.dompurifyConfig).toString():Yo.sanitize(Cm(t,e),{FORBID_TAGS:["style"]}).toString():t,Sm=/<br\s*\/?>/gi,Am=t=>t.replace(/#br#/g,"<br/>"),Dm=t=>t.replace(Sm,"#br#"),Lm=t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase()),Om=function(t){let e=t;return t.includes("~")?(e=e.replace(/~([^~].*)/,"<$1"),e=e.replace(/~([^~]*)$/,">$1"),Om(e)):e},Mm={getRows:t=>{if(!t)return[""];return Dm(t).replace(/\\n/g,"#br#").split("#br#")},sanitizeText:Em,sanitizeTextOrArray:(t,e)=>"string"==typeof t?Em(t,e):t.flat().map((t=>Em(t,e))),hasBreaks:t=>Sm.test(t),splitBreaks:t=>t.split(Sm),lineBreakRegex:Sm,removeScript:Tm,getUrl:t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=e.replaceAll(/\(/g,"\\("),e=e.replaceAll(/\)/g,"\\)")),e},evaluate:Lm},Bm=(t,e)=>lc(t,e?{s:-40,l:10}:{s:-40,l:-10}),Nm="#ffffff",Im="#f2f2f2";class Fm{constructor(){this.background="#f4f4f4",this.darkMode=!1,this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||lc(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||lc(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Bm(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Bm(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Bm(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Bm(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||dc(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||dc(this.tertiaryColor),this.lineColor=this.lineColor||dc(this.background),this.textColor=this.textColor||this.primaryTextColor,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?pc(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||"grey",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||pc(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||dc(this.lineColor),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||gc(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.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||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||lc(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lc(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lc(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lc(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lc(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lc(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||lc(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lc(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lc(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=pc(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=pc(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||dc(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||gc(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||pc(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||lc(this.primaryColor,{h:64}),this.fillType3=this.fillType3||lc(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||lc(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||lc(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||lc(this.primaryColor,{h:128}),this.fillType7=this.fillType7||lc(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||lc(this.primaryColor,{l:-10}),this.pie5=this.pie5||lc(this.secondaryColor,{l:-10}),this.pie6=this.pie6||lc(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||lc(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||lc(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||lc(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||lc(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||lc(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||lc(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?pc(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||lc(this.primaryColor,{h:-30}),this.git4=this.git4||lc(this.primaryColor,{h:-60}),this.git5=this.git5||lc(this.primaryColor,{h:-90}),this.git6=this.git6||lc(this.primaryColor,{h:60}),this.git7=this.git7||lc(this.primaryColor,{h:120}),this.darkMode?(this.git0=gc(this.git0,25),this.git1=gc(this.git1,25),this.git2=gc(this.git2,25),this.git3=gc(this.git3,25),this.git4=gc(this.git4,25),this.git5=gc(this.git5,25),this.git6=gc(this.git6,25),this.git7=gc(this.git7,25)):(this.git0=pc(this.git0,25),this.git1=pc(this.git1,25),this.git2=pc(this.git2,25),this.git3=pc(this.git3,25),this.git4=pc(this.git4,25),this.git5=pc(this.git5,25),this.git6=pc(this.git6,25),this.git7=pc(this.git7,25)),this.gitInv0=this.gitInv0||dc(this.git0),this.gitInv1=this.gitInv1||dc(this.git1),this.gitInv2=this.gitInv2||dc(this.git2),this.gitInv3=this.gitInv3||dc(this.git3),this.gitInv4=this.gitInv4||dc(this.git4),this.gitInv5=this.gitInv5||dc(this.git5),this.gitInv6=this.gitInv6||dc(this.git6),this.gitInv7=this.gitInv7||dc(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Nm,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Im}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class Rm{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gc(this.primaryColor,16),this.tertiaryColor=lc(this.primaryColor,{h:-160}),this.primaryBorderColor=dc(this.background),this.secondaryBorderColor=Bm(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bm(this.tertiaryColor,this.darkMode),this.primaryTextColor=dc(this.primaryColor),this.secondaryTextColor=dc(this.secondaryColor),this.tertiaryTextColor=dc(this.tertiaryColor),this.lineColor=dc(this.background),this.textColor=dc(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gc(dc("#323D47"),10),this.lineColor="calculated",this.border1="#81B1DB",this.border2=hc(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.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.sectionBkgColor=pc("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.taskBorderColor=hc(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=hc(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.personBorder="calculated",this.personBkg="calculated",this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=gc(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=gc(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.mainContrastColor,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.altSectionBkgColor=this.background,this.taskBkgColor=gc(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=this.darkTextColor,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=lc(this.primaryColor,{h:64}),this.fillType3=lc(this.secondaryColor,{h:64}),this.fillType4=lc(this.primaryColor,{h:-64}),this.fillType5=lc(this.secondaryColor,{h:-64}),this.fillType6=lc(this.primaryColor,{h:128}),this.fillType7=lc(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||lc(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lc(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lc(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lc(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lc(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lc(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lc(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lc(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lc(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||dc(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||gc(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?pc(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=gc(this.secondaryColor,20),this.git1=gc(this.pie2||this.secondaryColor,20),this.git2=gc(this.pie3||this.tertiaryColor,20),this.git3=gc(this.pie4||lc(this.primaryColor,{h:-30}),20),this.git4=gc(this.pie5||lc(this.primaryColor,{h:-60}),20),this.git5=gc(this.pie6||lc(this.primaryColor,{h:-90}),10),this.git6=gc(this.pie7||lc(this.primaryColor,{h:60}),10),this.git7=gc(this.pie8||lc(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||dc(this.git0),this.gitInv1=this.gitInv1||dc(this.git1),this.gitInv2=this.gitInv2||dc(this.git2),this.gitInv3=this.gitInv3||dc(this.git3),this.gitInv4=this.gitInv4||dc(this.git4),this.gitInv5=this.gitInv5||dc(this.git5),this.gitInv6=this.gitInv6||dc(this.git6),this.gitInv7=this.gitInv7||dc(this.git7),this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||gc(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||gc(this.background,2)}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class $m{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=lc(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=lc(this.primaryColor,{h:-160}),this.primaryBorderColor=Bm(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bm(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bm(this.tertiaryColor,this.darkMode),this.primaryTextColor=dc(this.primaryColor),this.secondaryTextColor=dc(this.secondaryColor),this.tertiaryTextColor=dc(this.tertiaryColor),this.lineColor=dc(this.background),this.textColor=dc(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#e8e8e8",this.textColor="#333",this.THEME_COLOR_LIMIT=12,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="grey",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.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.sectionBkgColor=hc(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.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||lc(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lc(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lc(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lc(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lc(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lc(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lc(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lc(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lc(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||pc(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||pc(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=pc(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||pc(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lc(this["cScale"+t],{h:180});if(this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,"calculated"!==this.labelTextColor){this.cScaleLabel0=this.cScaleLabel0||dc(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||dc(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=gc(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,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.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=lc(this.primaryColor,{h:64}),this.fillType3=lc(this.secondaryColor,{h:64}),this.fillType4=lc(this.primaryColor,{h:-64}),this.fillType5=lc(this.secondaryColor,{h:-64}),this.fillType6=lc(this.primaryColor,{h:128}),this.fillType7=lc(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||lc(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||lc(this.primaryColor,{l:-10}),this.pie5=this.pie5||lc(this.secondaryColor,{l:-30}),this.pie6=this.pie6||lc(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||lc(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||lc(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||lc(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||lc(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||lc(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||lc(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||lc(this.primaryColor,{h:-30}),this.git4=this.git4||lc(this.primaryColor,{h:-60}),this.git5=this.git5||lc(this.primaryColor,{h:-90}),this.git6=this.git6||lc(this.primaryColor,{h:60}),this.git7=this.git7||lc(this.primaryColor,{h:120}),this.darkMode?(this.git0=gc(this.git0,25),this.git1=gc(this.git1,25),this.git2=gc(this.git2,25),this.git3=gc(this.git3,25),this.git4=gc(this.git4,25),this.git5=gc(this.git5,25),this.git6=gc(this.git6,25),this.git7=gc(this.git7,25)):(this.git0=pc(this.git0,25),this.git1=pc(this.git1,25),this.git2=pc(this.git2,25),this.git3=pc(this.git3,25),this.git4=pc(this.git4,25),this.git5=pc(this.git5,25),this.git6=pc(this.git6,25),this.git7=pc(this.git7,25)),this.gitInv0=this.gitInv0||pc(dc(this.git0),25),this.gitInv1=this.gitInv1||dc(this.git1),this.gitInv2=this.gitInv2||dc(this.git2),this.gitInv3=this.gitInv3||dc(this.git3),this.gitInv4=this.gitInv4||dc(this.git4),this.gitInv5=this.gitInv5||dc(this.git5),this.gitInv6=this.gitInv6||dc(this.git6),this.gitInv7=this.gitInv7||dc(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||dc(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||dc(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Nm,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Im}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class Pm{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=gc("#cde498",10),this.primaryBorderColor=Bm(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bm(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bm(this.tertiaryColor,this.darkMode),this.primaryTextColor=dc(this.primaryColor),this.secondaryTextColor=dc(this.secondaryColor),this.tertiaryTextColor=dc(this.primaryColor),this.lineColor=dc(this.background),this.textColor=dc(this.background),this.THEME_COLOR_LIMIT=12,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="grey",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.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||lc(this.primaryColor,{h:30}),this.cScale4=this.cScale4||lc(this.primaryColor,{h:60}),this.cScale5=this.cScale5||lc(this.primaryColor,{h:90}),this.cScale6=this.cScale6||lc(this.primaryColor,{h:120}),this.cScale7=this.cScale7||lc(this.primaryColor,{h:150}),this.cScale8=this.cScale8||lc(this.primaryColor,{h:210}),this.cScale9=this.cScale9||lc(this.primaryColor,{h:270}),this.cScale10=this.cScale10||lc(this.primaryColor,{h:300}),this.cScale11=this.cScale11||lc(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||pc(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||pc(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=pc(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||pc(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lc(this["cScale"+t],{h:180});this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.actorBorder=pc(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.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=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.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=lc(this.primaryColor,{h:64}),this.fillType3=lc(this.secondaryColor,{h:64}),this.fillType4=lc(this.primaryColor,{h:-64}),this.fillType5=lc(this.secondaryColor,{h:-64}),this.fillType6=lc(this.primaryColor,{h:128}),this.fillType7=lc(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||lc(this.primaryColor,{l:-30}),this.pie5=this.pie5||lc(this.secondaryColor,{l:-30}),this.pie6=this.pie6||lc(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||lc(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||lc(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||lc(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||lc(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||lc(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||lc(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||lc(this.primaryColor,{h:-30}),this.git4=this.git4||lc(this.primaryColor,{h:-60}),this.git5=this.git5||lc(this.primaryColor,{h:-90}),this.git6=this.git6||lc(this.primaryColor,{h:60}),this.git7=this.git7||lc(this.primaryColor,{h:120}),this.darkMode?(this.git0=gc(this.git0,25),this.git1=gc(this.git1,25),this.git2=gc(this.git2,25),this.git3=gc(this.git3,25),this.git4=gc(this.git4,25),this.git5=gc(this.git5,25),this.git6=gc(this.git6,25),this.git7=gc(this.git7,25)):(this.git0=pc(this.git0,25),this.git1=pc(this.git1,25),this.git2=pc(this.git2,25),this.git3=pc(this.git3,25),this.git4=pc(this.git4,25),this.git5=pc(this.git5,25),this.git6=pc(this.git6,25),this.git7=pc(this.git7,25)),this.gitInv0=this.gitInv0||dc(this.git0),this.gitInv1=this.gitInv1||dc(this.git1),this.gitInv2=this.gitInv2||dc(this.git2),this.gitInv3=this.gitInv3||dc(this.git3),this.gitInv4=this.gitInv4||dc(this.git4),this.gitInv5=this.gitInv5||dc(this.git5),this.gitInv6=this.gitInv6||dc(this.git6),this.gitInv7=this.gitInv7||dc(this.git7),this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Nm,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Im}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}class Ym{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=gc(this.contrast,55),this.background="#ffffff",this.tertiaryColor=lc(this.primaryColor,{h:-160}),this.primaryBorderColor=Bm(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bm(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bm(this.tertiaryColor,this.darkMode),this.primaryTextColor=dc(this.primaryColor),this.secondaryTextColor=dc(this.secondaryColor),this.tertiaryTextColor=dc(this.tertiaryColor),this.lineColor=dc(this.background),this.textColor=dc(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.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="calculated",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.personBorder="calculated",this.personBkg="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=gc(this.contrast,55),this.border2=this.contrast,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 t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||dc(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||gc(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||pc(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.actorBorder=gc(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.lineColor,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.sectionBkgColor=gc(this.contrast,30),this.sectionBkgColor2=gc(this.contrast,30),this.taskBorderColor=pc(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=gc(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=pc(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.transitionColor=this.transitionColor||"#000",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||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=lc(this.primaryColor,{h:64}),this.fillType3=lc(this.secondaryColor,{h:64}),this.fillType4=lc(this.primaryColor,{h:-64}),this.fillType5=lc(this.secondaryColor,{h:-64}),this.fillType6=lc(this.primaryColor,{h:128}),this.fillType7=lc(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOpacity=this.pieOpacity||"0.7",this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||this.primaryBorderColor,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=pc(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||lc(this.primaryColor,{h:-30}),this.git4=this.pie5||lc(this.primaryColor,{h:-60}),this.git5=this.pie6||lc(this.primaryColor,{h:-90}),this.git6=this.pie7||lc(this.primaryColor,{h:60}),this.git7=this.pie8||lc(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||dc(this.git0),this.gitInv1=this.gitInv1||dc(this.git1),this.gitInv2=this.gitInv2||dc(this.git2),this.gitInv3=this.gitInv3||dc(this.git3),this.gitInv4=this.gitInv4||dc(this.git4),this.gitInv5=this.gitInv5||dc(this.git5),this.gitInv6=this.gitInv6||dc(this.git6),this.gitInv7=this.gitInv7||dc(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Nm,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Im}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}}const jm={base:{getThemeVariables:t=>{const e=new Fm;return e.calculate(t),e}},dark:{getThemeVariables:t=>{const e=new Rm;return e.calculate(t),e}},default:{getThemeVariables:t=>{const e=new $m;return e.calculate(t),e}},forest:{getThemeVariables:t=>{const e=new Pm;return e.calculate(t),e}},neutral:{getThemeVariables:t=>{const e=new Ym;return e.calculate(t),e}}},zm={theme:"default",themeVariables:jm.default.getThemeVariables(),themeCSS:void 0,maxTextSize:5e4,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize"],deterministicIds:!1,deterministicIDSeed:void 0,flowchart:{titleTopMargin:25,diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},sequence:{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,useMaxWidth:!0,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,messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},noteFont:function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},actorFont:function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",tickInterval:void 0,useMaxWidth:!0,topAxis:!1,useWidth:void 0},journey:{diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,useMaxWidth:!0,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"]},class:{titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},state:{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,useMaxWidth:!0,defaultRenderer:"dagre-wrapper"},er:{titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,stroke:"gray",fill:"honeydew",fontSize:12,useMaxWidth:!0},pie:{useWidth:void 0,useMaxWidth:!0},requirement:{useWidth:void 0,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},gitGraph:{titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0},c4:{useWidth:void 0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,useMaxWidth:!0,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,personFont:function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},external_personFont:function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},systemFont:function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},external_systemFont:function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},system_dbFont:function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},external_system_dbFont:function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},system_queueFont:function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},external_system_queueFont:function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},containerFont:function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},external_containerFont:function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},container_dbFont:function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},external_container_dbFont:function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},container_queueFont:function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},external_container_queueFont:function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},componentFont:function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},external_componentFont:function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},component_dbFont:function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},external_component_dbFont:function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},component_queueFont:function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},external_component_queueFont:function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},boundaryFont:function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},messageFont:function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},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"},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},fontSize:16};zm.class&&(zm.class.arrowMarkerAbsolute=zm.arrowMarkerAbsolute),zm.gitGraph&&(zm.gitGraph.arrowMarkerAbsolute=zm.arrowMarkerAbsolute);const Um=(t,e="")=>Object.keys(t).reduce(((n,i)=>Array.isArray(t[i])?n:"object"==typeof t[i]&&null!==t[i]?[...n,e+i,...Um(t[i],"")]:[...n,e+i]),[]),Wm=Um(zm,""),Hm=zm;function qm(t){return null==t}var Vm=function(t,e){var n,i="";for(n=0;n<e;n+=1)i+=t;return i},Gm=function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},Xm={isNothing:qm,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:qm(t)?[]:[t]},repeat:Vm,isNegativeZero:Gm,extend:function(t,e){var n,i,r,s;if(e)for(n=0,i=(s=Object.keys(e)).length;n<i;n+=1)t[r=s[n]]=e[r];return t}};function Zm(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+="\n\n"+t.mark.snippet),i+" "+n):i}function Qm(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Zm(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}Qm.prototype=Object.create(Error.prototype),Qm.prototype.constructor=Qm,Qm.prototype.toString=function(t){return this.name+": "+Zm(this,t)};var Km=Qm;function Jm(t,e,n,i,r){var s="",a="",o=Math.floor(r/2)-1;return i-e>o&&(e=i-o+(s=" ... ").length),n-i>o&&(n=i+o-(a=" ...").length),{str:s+t.slice(e,n).replace(/\t/g,"→")+a,pos:i-e+s.length}}function tb(t,e){return Xm.repeat(" ",e-t.length)+t}var eb=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],s=[],a=-1;n=i.exec(t.buffer);)s.push(n.index),r.push(n.index+n[0].length),t.position<=n.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var o,c,l="",h=Math.min(t.line+e.linesAfter,s.length).toString().length,u=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(a-o<0);o++)c=Jm(t.buffer,r[a-o],s[a-o],t.position-(r[a]-r[a-o]),u),l=Xm.repeat(" ",e.indent)+tb((t.line-o+1).toString(),h)+" | "+c.str+"\n"+l;for(c=Jm(t.buffer,r[a],s[a],t.position,u),l+=Xm.repeat(" ",e.indent)+tb((t.line+1).toString(),h)+" | "+c.str+"\n",l+=Xm.repeat("-",e.indent+h+3+c.pos)+"^\n",o=1;o<=e.linesAfter&&!(a+o>=s.length);o++)c=Jm(t.buffer,r[a+o],s[a+o],t.position-(r[a]-r[a+o]),u),l+=Xm.repeat(" ",e.indent)+tb((t.line+o+1).toString(),h)+" | "+c.str+"\n";return l.replace(/\n$/,"")},nb=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ib=["scalar","sequence","mapping"];var rb=function(t,e){var n,i;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===nb.indexOf(e))throw new Km('Unknown option "'+e+'" 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(t){return t},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=(n=e.styleAliases||null,i={},null!==n&&Object.keys(n).forEach((function(t){n[t].forEach((function(e){i[String(e)]=t}))})),i),-1===ib.indexOf(this.kind))throw new Km('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function sb(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,i){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=i)})),n[e]=t})),n}function ab(t){return this.extend(t)}ab.prototype.extend=function(t){var e=[],n=[];if(t instanceof rb)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Km("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof rb))throw new Km("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Km("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new Km("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof rb))throw new Km("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(ab.prototype);return i.implicit=(this.implicit||[]).concat(e),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=sb(i,"implicit"),i.compiledExplicit=sb(i,"explicit"),i.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var ob=ab,cb=new rb("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}}),lb=new rb("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}}),hb=new rb("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}}),ub=new ob({explicit:[cb,lb,hb]});var db=new rb("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var fb=new rb("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function pb(t){return 48<=t&&t<=55}function gb(t){return 48<=t&&t<=57}var yb=new rb("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,s=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r<i;r++)if("_"!==(e=t[r])){if("0"!==e&&"1"!==e)return!1;s=!0}return s&&"_"!==e}if("x"===e){for(r++;r<i;r++)if("_"!==(e=t[r])){if(!(48<=(n=t.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==e}if("o"===e){for(r++;r<i;r++)if("_"!==(e=t[r])){if(!pb(t.charCodeAt(r)))return!1;s=!0}return s&&"_"!==e}}if("_"===e)return!1;for(;r<i;r++)if("_"!==(e=t[r])){if(!gb(t.charCodeAt(r)))return!1;s=!0}return!(!s||"_"===e)},construct:function(t){var e,n=t,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(e=n[0])&&"+"!==e||("-"===e&&(i=-1),e=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===e){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!Xm.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),mb=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var bb=/^[-+]?[0-9]+e/;var _b=new rb("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!mb.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Xm.isNegativeZero(t))},represent:function(t,e){var n;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(Xm.isNegativeZero(t))return"-0.0";return n=t.toString(10),bb.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),xb=ub.extend({implicit:[db,fb,yb,_b]}),vb=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),kb=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]))?))?$");var wb=new rb("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==vb.exec(t)||null!==kb.exec(t))},construct:function(t){var e,n,i,r,s,a,o,c,l=0,h=null;if(null===(e=vb.exec(t))&&(e=kb.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));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=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),c=new Date(Date.UTC(n,i,r,s,a,o,l)),h&&c.setTime(c.getTime()-h),c},instanceOf:Date,represent:function(t){return t.toISOString()}});var Tb=new rb("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),Cb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Eb=new rb("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,s=Cb;for(n=0;n<r;n++)if(!((e=s.indexOf(t.charAt(n)))>64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=Cb,a=0,o=[];for(e=0;e<r;e++)e%4==0&&e&&(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(i.charAt(e));return 0===(n=r%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===n?(o.push(a>>10&255),o.push(a>>2&255)):12===n&&o.push(a>>4&255),new Uint8Array(o)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,n,i="",r=0,s=t.length,a=Cb;for(e=0;e<s;e++)e%3==0&&e&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+t[e];return 0===(n=s%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),Sb=Object.prototype.hasOwnProperty,Ab=Object.prototype.toString;var Db=new rb("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,i,r,s,a=[],o=t;for(e=0,n=o.length;e<n;e+=1){if(i=o[e],s=!1,"[object Object]"!==Ab.call(i))return!1;for(r in i)if(Sb.call(i,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(t){return null!==t?t:[]}}),Lb=Object.prototype.toString;var Ob=new rb("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,i,r,s,a=t;for(s=new Array(a.length),e=0,n=a.length;e<n;e+=1){if(i=a[e],"[object Object]"!==Lb.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;s[e]=[r[0],i[r[0]]]}return!0},construct:function(t){if(null===t)return[];var e,n,i,r,s,a=t;for(s=new Array(a.length),e=0,n=a.length;e<n;e+=1)i=a[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}}),Mb=Object.prototype.hasOwnProperty;var Bb=new rb("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(Mb.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}}),Nb=xb.extend({implicit:[wb,Tb],explicit:[Eb,Db,Ob,Bb]}),Ib=Object.prototype.hasOwnProperty,Fb=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Rb=/[\x85\u2028\u2029]/,$b=/[,\[\]\{\}]/,Pb=/^(?:!|!!|![a-z\-]+!)$/i,Yb=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function jb(t){return Object.prototype.toString.call(t)}function zb(t){return 10===t||13===t}function Ub(t){return 9===t||32===t}function Wb(t){return 9===t||32===t||10===t||13===t}function Hb(t){return 44===t||91===t||93===t||123===t||125===t}function qb(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function Vb(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function Gb(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var Xb=new Array(256),Zb=new Array(256),Qb=0;Qb<256;Qb++)Xb[Qb]=Vb(Qb)?1:0,Zb[Qb]=Vb(Qb);function Kb(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Nb,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=[]}function Jb(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=eb(n),new Km(e,n)}function t_(t,e){throw Jb(t,e)}function e_(t,e){t.onWarning&&t.onWarning.call(null,Jb(t,e))}var n_={YAML:function(t,e,n){var i,r,s;null!==t.version&&t_(t,"duplication of %YAML directive"),1!==n.length&&t_(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&t_(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&t_(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&e_(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&t_(t,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],Pb.test(i)||t_(t,"ill-formed tag handle (first argument) of the TAG directive"),Ib.call(t.tagMap,i)&&t_(t,'there is a previously declared suffix for "'+i+'" tag handle'),Yb.test(r)||t_(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(e){t_(t,"tag prefix is malformed: "+r)}t.tagMap[i]=r}};function i_(t,e,n,i){var r,s,a,o;if(e<n){if(o=t.input.slice(e,n),i)for(r=0,s=o.length;r<s;r+=1)9===(a=o.charCodeAt(r))||32<=a&&a<=1114111||t_(t,"expected valid JSON character");else Fb.test(o)&&t_(t,"the stream contains non-printable characters");t.result+=o}}function r_(t,e,n,i){var r,s,a,o;for(Xm.isObject(n)||t_(t,"cannot merge mappings; the provided source object is unacceptable"),a=0,o=(r=Object.keys(n)).length;a<o;a+=1)s=r[a],Ib.call(e,s)||(e[s]=n[s],i[s]=!0)}function s_(t,e,n,i,r,s,a,o,c){var l,h;if(Array.isArray(r))for(l=0,h=(r=Array.prototype.slice.call(r)).length;l<h;l+=1)Array.isArray(r[l])&&t_(t,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===jb(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===jb(r)&&(r="[object Object]"),r=String(r),null===e&&(e={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(s))for(l=0,h=s.length;l<h;l+=1)r_(t,e,s[l],n);else r_(t,e,s,n);else t.json||Ib.call(n,r)||!Ib.call(e,r)||(t.line=a||t.line,t.lineStart=o||t.lineStart,t.position=c||t.position,t_(t,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[r]=s,delete n[r];return e}function a_(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):t_(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function o_(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);0!==r;){for(;Ub(r);)9===r&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&35===r)do{r=t.input.charCodeAt(++t.position)}while(10!==r&&13!==r&&0!==r);if(!zb(r))break;for(a_(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;32===r;)t.lineIndent++,r=t.input.charCodeAt(++t.position)}return-1!==n&&0!==i&&t.lineIndent<n&&e_(t,"deficient indentation"),i}function c_(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!Wb(e)))}function l_(t,e){1===e?t.result+=" ":e>1&&(t.result+=Xm.repeat("\n",e-1))}function h_(t,e){var n,i,r=t.tag,s=t.anchor,a=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),i=t.input.charCodeAt(t.position);0!==i&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,t_(t,"tab characters must not be used in indentation")),45===i)&&Wb(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,o_(t,!0,-1)&&t.lineIndent<=e)a.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,f_(t,e,3,!1,!0),a.push(t.result),o_(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)t_(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!o&&(t.tag=r,t.anchor=s,t.kind="sequence",t.result=a,!0)}function u_(t){var e,n,i,r,s=!1,a=!1;if(33!==(r=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&t_(t,"duplication of a tag property"),60===(r=t.input.charCodeAt(++t.position))?(s=!0,r=t.input.charCodeAt(++t.position)):33===r?(a=!0,n="!!",r=t.input.charCodeAt(++t.position)):n="!",e=t.position,s){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&62!==r);t.position<t.length?(i=t.input.slice(e,t.position),r=t.input.charCodeAt(++t.position)):t_(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!Wb(r);)33===r&&(a?t_(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),Pb.test(n)||t_(t,"named tag handle cannot contain such characters"),a=!0,e=t.position+1)),r=t.input.charCodeAt(++t.position);i=t.input.slice(e,t.position),$b.test(i)&&t_(t,"tag suffix cannot contain flow indicator characters")}i&&!Yb.test(i)&&t_(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(e){t_(t,"tag name is malformed: "+i)}return s?t.tag=i:Ib.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:"!"===n?t.tag="!"+i:"!!"===n?t.tag="tag:yaml.org,2002:"+i:t_(t,'undeclared tag handle "'+n+'"'),!0}function d_(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&t_(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!Wb(n)&&!Hb(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&t_(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function f_(t,e,n,i,r){var s,a,o,c,l,h,u,d,f,p=1,g=!1,y=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=a=o=4===n||3===n,i&&o_(t,!0,-1)&&(g=!0,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)),1===p)for(;u_(t)||d_(t);)o_(t,!0,-1)?(g=!0,o=s,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)):o=!1;if(o&&(o=g||r),1!==p&&4!==n||(d=1===n||2===n?e:e+1,f=t.position-t.lineStart,1===p?o&&(h_(t,f)||function(t,e,n){var i,r,s,a,o,c,l,h=t.tag,u=t.anchor,d={},f=Object.create(null),p=null,g=null,y=null,m=!1,b=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=d),l=t.input.charCodeAt(t.position);0!==l;){if(m||-1===t.firstTabInLine||(t.position=t.firstTabInLine,t_(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,63!==l&&58!==l||!Wb(i)){if(a=t.line,o=t.lineStart,c=t.position,!f_(t,n,2,!1,!0))break;if(t.line===s){for(l=t.input.charCodeAt(t.position);Ub(l);)l=t.input.charCodeAt(++t.position);if(58===l)Wb(l=t.input.charCodeAt(++t.position))||t_(t,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(s_(t,d,f,p,g,null,a,o,c),p=g=y=null),b=!0,m=!1,r=!1,p=t.tag,g=t.result;else{if(!b)return t.tag=h,t.anchor=u,!0;t_(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return t.tag=h,t.anchor=u,!0;t_(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(m&&(s_(t,d,f,p,g,null,a,o,c),p=g=y=null),b=!0,m=!0,r=!0):m?(m=!1,r=!0):t_(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,l=i;if((t.line===s||t.lineIndent>e)&&(m&&(a=t.line,o=t.lineStart,c=t.position),f_(t,e,4,!0,r)&&(m?g=t.result:y=t.result),m||(s_(t,d,f,p,g,y,a,o,c),p=g=y=null),o_(t,!0,-1),l=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&0!==l)t_(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return m&&s_(t,d,f,p,g,null,a,o,c),b&&(t.tag=h,t.anchor=u,t.kind="mapping",t.result=d),b}(t,f,d))||function(t,e){var n,i,r,s,a,o,c,l,h,u,d,f,p=!0,g=t.tag,y=t.anchor,m=Object.create(null);if(91===(f=t.input.charCodeAt(t.position)))a=93,l=!1,s=[];else{if(123!==f)return!1;a=125,l=!0,s={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),f=t.input.charCodeAt(++t.position);0!==f;){if(o_(t,!0,e),(f=t.input.charCodeAt(t.position))===a)return t.position++,t.tag=g,t.anchor=y,t.kind=l?"mapping":"sequence",t.result=s,!0;p?44===f&&t_(t,"expected the node content, but found ','"):t_(t,"missed comma between flow collection entries"),d=null,o=c=!1,63===f&&Wb(t.input.charCodeAt(t.position+1))&&(o=c=!0,t.position++,o_(t,!0,e)),n=t.line,i=t.lineStart,r=t.position,f_(t,e,1,!1,!0),u=t.tag,h=t.result,o_(t,!0,e),f=t.input.charCodeAt(t.position),!c&&t.line!==n||58!==f||(o=!0,f=t.input.charCodeAt(++t.position),o_(t,!0,e),f_(t,e,1,!1,!0),d=t.result),l?s_(t,s,m,u,h,d,n,i,r):o?s.push(s_(t,null,m,u,h,d,n,i,r)):s.push(h),o_(t,!0,e),44===(f=t.input.charCodeAt(t.position))?(p=!0,f=t.input.charCodeAt(++t.position)):p=!1}t_(t,"unexpected end of the stream within a flow collection")}(t,d)?y=!0:(a&&function(t,e){var n,i,r,s,a,o=1,c=!1,l=!1,h=e,u=0,d=!1;if(124===(s=t.input.charCodeAt(t.position)))i=!1;else{if(62!==s)return!1;i=!0}for(t.kind="scalar",t.result="";0!==s;)if(43===(s=t.input.charCodeAt(++t.position))||45===s)1===o?o=43===s?3:2:t_(t,"repeat of a chomping mode identifier");else{if(!((r=48<=(a=s)&&a<=57?a-48:-1)>=0))break;0===r?t_(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?t_(t,"repeat of an indentation width identifier"):(h=e+r-1,l=!0)}if(Ub(s)){do{s=t.input.charCodeAt(++t.position)}while(Ub(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!zb(s)&&0!==s)}for(;0!==s;){for(a_(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!l||t.lineIndent<h)&&32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>h&&(h=t.lineIndent),zb(s))u++;else{if(t.lineIndent<h){3===o?t.result+=Xm.repeat("\n",c?1+u:u):1===o&&c&&(t.result+="\n");break}for(i?Ub(s)?(d=!0,t.result+=Xm.repeat("\n",c?1+u:u)):d?(d=!1,t.result+=Xm.repeat("\n",u+1)):0===u?c&&(t.result+=" "):t.result+=Xm.repeat("\n",u):t.result+=Xm.repeat("\n",c?1+u:u),c=!0,l=!0,u=0,n=t.position;!zb(s)&&0!==s;)s=t.input.charCodeAt(++t.position);i_(t,n,t.position,!1)}}return!0}(t,d)||function(t,e){var n,i,r;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(i_(t,i,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;i=t.position,t.position++,r=t.position}else zb(n)?(i_(t,i,r,!0),l_(t,o_(t,!1,e)),i=r=t.position):t.position===t.lineStart&&c_(t)?t_(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);t_(t,"unexpected end of the stream within a single quoted scalar")}(t,d)||function(t,e){var n,i,r,s,a,o,c;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return i_(t,n,t.position,!0),t.position++,!0;if(92===o){if(i_(t,n,t.position,!0),zb(o=t.input.charCodeAt(++t.position)))o_(t,!1,e);else if(o<256&&Xb[o])t.result+=Zb[o],t.position++;else if((a=120===(c=o)?2:117===c?4:85===c?8:0)>0){for(r=a,s=0;r>0;r--)(a=qb(o=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+a:t_(t,"expected hexadecimal character");t.result+=Gb(s),t.position++}else t_(t,"unknown escape sequence");n=i=t.position}else zb(o)?(i_(t,n,i,!0),l_(t,o_(t,!1,e)),n=i=t.position):t.position===t.lineStart&&c_(t)?t_(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}t_(t,"unexpected end of the stream within a double quoted scalar")}(t,d)?y=!0:!function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!Wb(i)&&!Hb(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&t_(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),Ib.call(t.anchorMap,n)||t_(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],o_(t,!0,-1),!0}(t)?function(t,e,n){var i,r,s,a,o,c,l,h,u=t.kind,d=t.result;if(Wb(h=t.input.charCodeAt(t.position))||Hb(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(Wb(i=t.input.charCodeAt(t.position+1))||n&&Hb(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,a=!1;0!==h;){if(58===h){if(Wb(i=t.input.charCodeAt(t.position+1))||n&&Hb(i))break}else if(35===h){if(Wb(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&c_(t)||n&&Hb(h))break;if(zb(h)){if(o=t.line,c=t.lineStart,l=t.lineIndent,o_(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=o,t.lineStart=c,t.lineIndent=l;break}}a&&(i_(t,r,s,!1),l_(t,t.line-o),r=s=t.position,a=!1),Ub(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return i_(t,r,s,!1),!!t.result||(t.kind=u,t.result=d,!1)}(t,d,1===n)&&(y=!0,null===t.tag&&(t.tag="?")):(y=!0,null===t.tag&&null===t.anchor||t_(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===p&&(y=o&&h_(t,f))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&t_(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),c=0,l=t.implicitTypes.length;c<l;c+=1)if((u=t.implicitTypes[c]).resolve(t.result)){t.result=u.construct(t.result),t.tag=u.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(Ib.call(t.typeMap[t.kind||"fallback"],t.tag))u=t.typeMap[t.kind||"fallback"][t.tag];else for(u=null,c=0,l=(h=t.typeMap.multi[t.kind||"fallback"]).length;c<l;c+=1)if(t.tag.slice(0,h[c].tag.length)===h[c].tag){u=h[c];break}u||t_(t,"unknown tag !<"+t.tag+">"),null!==t.result&&u.kind!==t.kind&&t_(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+u.kind+'", not "'+t.kind+'"'),u.resolve(t.result,t.tag)?(t.result=u.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):t_(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function p_(t){var e,n,i,r,s=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(r=t.input.charCodeAt(t.position))&&(o_(t,!0,-1),r=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==r));){for(a=!0,r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!Wb(r);)r=t.input.charCodeAt(++t.position);for(i=[],(n=t.input.slice(e,t.position)).length<1&&t_(t,"directive name must not be less than one character in length");0!==r;){for(;Ub(r);)r=t.input.charCodeAt(++t.position);if(35===r){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&!zb(r));break}if(zb(r))break;for(e=t.position;0!==r&&!Wb(r);)r=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==r&&a_(t),Ib.call(n_,n)?n_[n](t,n,i):e_(t,'unknown document directive "'+n+'"')}o_(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,o_(t,!0,-1)):a&&t_(t,"directives end mark is expected"),f_(t,t.lineIndent-1,4,!1,!0),o_(t,!0,-1),t.checkLineBreaks&&Rb.test(t.input.slice(s,t.position))&&e_(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&c_(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,o_(t,!0,-1)):t.position<t.length-1&&t_(t,"end of the stream or a document separator is expected")}function g_(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var n=new Kb(t,e),i=t.indexOf("\0");for(-1!==i&&(n.position=i,t_(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)p_(n);return n.documents}var y_=ub,m_={loadAll:function(t,e,n){null!==e&&"object"==typeof e&&void 0===n&&(n=e,e=null);var i=g_(t,n);if("function"!=typeof e)return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])},load:function(t,e){var n=g_(t,e);if(0!==n.length){if(1===n.length)return n[0];throw new Km("expected a single document in the stream, but found more")}}}.load;const b_=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;const __=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,x_=/\s*%%.*\n/gm,v_={},k_=function(t,e){t=t.replace(b_,"").replace(__,"").replace(x_,"\n");for(const[n,{detector:i}]of Object.entries(v_)){if(i(t,e))return n}throw new Error(`No diagram type detected for text: ${t}`)},w_=(t,e,n)=>{if(v_[t])throw new Error(`Detector with key ${t} already exists`);v_[t]={detector:e,loader:n},vm.debug(`Detector with key ${t} added${n?" with loader":""}`)},T_=function(t,e,n){const{depth:i,clobber:r}=Object.assign({depth:2,clobber:!1},n);return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>T_(t,e,n))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||i<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach((n=>{"object"!=typeof e[n]||void 0!==t[n]&&"object"!=typeof t[n]?(r||"object"!=typeof t[n]&&"object"!=typeof e[n])&&(t[n]=e[n]):(void 0===t[n]&&(t[n]=Array.isArray(e[n])?[]:{}),t[n]=T_(t[n],e[n],{depth:i-1,clobber:r}))})),t)},C_=T_,E_={curveBasis:Co,curveBasisClosed:function(t){return new Eo(t)},curveBasisOpen:function(t){return new So(t)},curveLinear:yo,curveLinearClosed:function(t){return new Ao(t)},curveMonotoneX:function(t){return new Bo(t)},curveMonotoneY:function(t){return new No(t)},curveNatural:function(t){return new Fo(t)},curveStep:function(t){return new $o(t,.5)},curveStepAfter:function(t){return new $o(t,1)},curveStepBefore:function(t){return new $o(t,0)}},S_=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,A_=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,D_=function(t,e=null){try{const n=new RegExp(`[%]{2}(?![{]${A_.source})(?=[}][%]{2}).*\n`,"ig");let i;t=t.trim().replace(n,"").replace(/'/gm,'"'),vm.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const r=[];for(;null!==(i=S_.exec(t));)if(i.index===S_.lastIndex&&S_.lastIndex++,i&&!e||e&&i[1]&&i[1].match(e)||e&&i[2]&&i[2].match(e)){const t=i[1]?i[1]:i[2],e=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;r.push({type:t,args:e})}return 0===r.length&&r.push({type:t,args:null}),1===r.length?r[0]:r}catch(n){return vm.error(`ERROR: ${n.message} - Unable to parse directive\n      ${null!==e?" type:"+e:""} based on the text:${t}`),{type:null,args:null}}};function L_(t,e){if(!t)return e;const n=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return E_[n]||e}function O_(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function M_(t){let e="",n="";for(const i of t)void 0!==i&&(i.startsWith("color:")||i.startsWith("text-align:")?n=n+i+";":e=e+i+";");return{style:e,labelStyle:n}}let B_=0;const N_=()=>(B_++,"id-"+Math.random().toString(36).substr(2,12)+"-"+B_);const I_=t=>function(t){let e="";const n="0123456789abcdef",i=n.length;for(let r=0;r<t;r++)e+=n.charAt(Math.floor(Math.random()*i));return e}(t.length),F_=function(t,e){const n=e.text.replace(Mm.lineBreakRegex," "),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",e.fontSize),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.attr("fill",e.fill),r.text(n),i},R_=wl(((t,e,n)=>{if(!t)return t;if(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},n),Mm.lineBreakRegex.test(t))return t;const i=t.split(" "),r=[];let s="";return i.forEach(((t,a)=>{const o=Y_(`${t} `,n),c=Y_(s,n);if(o>e){const{hyphenatedStrings:i,remainingWord:a}=$_(t,e,"-",n);r.push(s,...i),s=a}else c+o>=e?(r.push(s),s=t):s=[s,t].filter(Boolean).join(" ");a+1===i.length&&r.push(s)})),r.filter((t=>""!==t)).join(n.joinWith)}),((t,e,n)=>`${t}${e}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`)),$_=wl(((t,e,n="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const r=[...t],s=[];let a="";return r.forEach(((t,o)=>{const c=`${a}${t}`;if(Y_(c,i)>=e){const t=o+1,e=r.length===t,i=`${c}${n}`;s.push(e?c:i),a=""}else a=c})),{hyphenatedStrings:s,remainingWord:a}}),((t,e,n="-",i)=>`${t}${e}${n}${i.fontSize}${i.fontWeight}${i.fontFamily}`));function P_(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},e),j_(t,e).height}function Y_(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),j_(t,e).width}const j_=wl(((t,e)=>{e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e);const{fontSize:n,fontFamily:i,fontWeight:r}=e;if(!t)return{width:0,height:0};const s=["sans-serif",i],a=t.split(Mm.lineBreakRegex),o=[],c=Fa("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const l=c.append("svg");for(const t of s){let e=0;const i={width:0,height:0,lineHeight:0};for(const s of a){const a={x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0};a.text=s;const o=F_(l,a).style("font-size",n).style("font-weight",r).style("font-family",t),c=(o._groups||o)[0][0].getBBox();i.width=Math.round(Math.max(i.width,c.width)),e=Math.round(c.height),i.height+=e,i.lineHeight=Math.round(Math.max(i.lineHeight,e))}o.push(i)}l.remove();return o[isNaN(o[1].height)||isNaN(o[1].width)||isNaN(o[1].lineHeight)||o[0].height>o[1].height&&o[0].width>o[1].width&&o[0].lineHeight>o[1].lineHeight?0:1]}),((t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`));let z_;const U_=t=>{if(vm.debug("directiveSanitizer called with",t),"object"==typeof t&&(t.length?t.forEach((t=>U_(t))):Object.keys(t).forEach((e=>{vm.debug("Checking key",e),e.startsWith("__")&&(vm.debug("sanitize deleting __ option",e),delete t[e]),e.includes("proto")&&(vm.debug("sanitize deleting proto option",e),delete t[e]),e.includes("constr")&&(vm.debug("sanitize deleting constr option",e),delete t[e]),e.includes("themeCSS")&&(vm.debug("sanitizing themeCss option"),t[e]=W_(t[e])),e.includes("fontFamily")&&(vm.debug("sanitizing fontFamily option"),t[e]=W_(t[e])),e.includes("altFontFamily")&&(vm.debug("sanitizing altFontFamily option"),t[e]=W_(t[e])),Wm.includes(e)?"object"==typeof t[e]&&(vm.debug("sanitize deleting object",e),U_(t[e])):(vm.debug("sanitize deleting option",e),delete t[e])}))),t.themeVariables){const e=Object.keys(t.themeVariables);for(const n of e){const e=t.themeVariables[n];e&&e.match&&!e.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[n]="")}}vm.debug("After sanitization",t)},W_=t=>{let e=0,n=0;for(const i of t){if(e<n)return"{ /* ERROR: Unbalanced CSS */ }";"{"===i?e++:"}"===i&&n++}return e!==n?"{ /* ERROR: Unbalanced CSS */ }":t};function H_(t){return"str"in t}const q_={assignWithDepth:C_,wrapLabel:R_,calculateTextHeight:P_,calculateTextWidth:Y_,calculateTextDimensions:j_,detectInit:function(t,e){const n=D_(t,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(n)){const t=n.map((t=>t.args));U_(t),i=C_(i,[...t])}else i=n.args;if(i){let n=k_(t,e);["config"].forEach((t=>{void 0!==i[t]&&("flowchart-v2"===n&&(n="flowchart"),i[n]=i[t],delete i[t])}))}return i},detectDirective:D_,isSubstringInArray:function(t,e){for(const[n,i]of e.entries())if(i.match(t))return n;return-1},interpolateToCurve:L_,calcLabelPosition:function(t){return 1===t.length?t[0]:function(t){let e,n=0;t.forEach((t=>{n+=O_(t,e),e=t}));let i,r=n/2;return e=void 0,t.forEach((t=>{if(e&&!i){const n=O_(t,e);if(n<r)r-=n;else{const s=r/n;s<=0&&(i=e),s>=1&&(i={x:t.x,y:t.y}),s>0&&s<1&&(i={x:(1-s)*e.x+s*t.x,y:(1-s)*e.y+s*t.y})}}e=t})),i}(t)},calcCardinalityPosition:(t,e,n)=>{let i;vm.info(`our points ${JSON.stringify(e)}`),e[0]!==n&&(e=e.reverse());let r,s=25;i=void 0,e.forEach((t=>{if(i&&!r){const e=O_(t,i);if(e<s)s-=e;else{const n=s/e;n<=0&&(r=i),n>=1&&(r={x:t.x,y:t.y}),n>0&&n<1&&(r={x:(1-n)*i.x+n*t.x,y:(1-n)*i.y+n*t.y})}}i=t}));const a=t?10:5,o=Math.atan2(e[0].y-r.y,e[0].x-r.x),c={x:0,y:0};return c.x=Math.sin(o)*a+(e[0].x+r.x)/2,c.y=-Math.cos(o)*a+(e[0].y+r.y)/2,c},calcTerminalLabelPosition:function(t,e,n){let i,r=JSON.parse(JSON.stringify(n));vm.info("our points",r),"start_left"!==e&&"start_right"!==e&&(r=r.reverse()),r.forEach((t=>{i=t}));let s,a=25+t;i=void 0,r.forEach((t=>{if(i&&!s){const e=O_(t,i);if(e<a)a-=e;else{const n=a/e;n<=0&&(s=i),n>=1&&(s={x:t.x,y:t.y}),n>0&&n<1&&(s={x:(1-n)*i.x+n*t.x,y:(1-n)*i.y+n*t.y})}}i=t}));const o=10+.5*t,c=Math.atan2(r[0].y-s.y,r[0].x-s.x),l={x:0,y:0};return l.x=Math.sin(c)*o+(r[0].x+s.x)/2,l.y=-Math.cos(c)*o+(r[0].y+s.y)/2,"start_left"===e&&(l.x=Math.sin(c+Math.PI)*o+(r[0].x+s.x)/2,l.y=-Math.cos(c+Math.PI)*o+(r[0].y+s.y)/2),"end_right"===e&&(l.x=Math.sin(c-Math.PI)*o+(r[0].x+s.x)/2-5,l.y=-Math.cos(c-Math.PI)*o+(r[0].y+s.y)/2-5),"end_left"===e&&(l.x=Math.sin(c)*o+(r[0].x+s.x)/2-5,l.y=-Math.cos(c)*o+(r[0].y+s.y)/2-5),l},formatUrl:function(t,n){const i=t.trim();if(i)return"loose"!==n.securityLevel?(0,e.N)(i):i},getStylesFromArray:M_,generateId:N_,random:I_,runFunc:(t,...e)=>{const n=t.split("."),i=n.length-1,r=n[i];let s=window;for(let t=0;t<i;t++)if(s=s[n[t]],!s)return;s[r](...e)},entityDecode:function(t){return z_=z_||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),z_.innerHTML=t,unescape(z_.textContent)},initIdGenerator:class{constructor(t,e){this.deterministic=t,this.seed=e,this.count=e?e.length:0}next(){return this.deterministic?this.count++:Date.now()}},directiveSanitizer:U_,sanitizeCss:W_,insertTitle:(t,e,n,i)=>{if(!i)return;const r=t.node().getBBox();t.append("text").text(i).attr("x",r.x+r.width/2).attr("y",-n).attr("class",e)}},V_="9.3.0",G_=Object.freeze(Hm);let X_,Z_=C_({},G_),Q_=[],K_=C_({},G_);const J_=(t,e)=>{let n=C_({},t),i={};for(const t of e)ix(t),i=C_(i,t);if(n=C_(n,i),i.theme&&i.theme in jm){const t=C_({},X_),e=C_(t.themeVariables||{},i.themeVariables);n.theme&&n.theme in jm&&(n.themeVariables=jm[n.theme].getThemeVariables(e))}return K_=n,cx(K_),K_},tx=()=>C_({},Z_),ex=t=>(cx(t),C_(K_,t),nx()),nx=()=>C_({},K_),ix=t=>{var e;["secure",...null!=(e=Z_.secure)?e:[]].forEach((e=>{void 0!==t[e]&&(vm.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])})),Object.keys(t).forEach((e=>{0===e.indexOf("__")&&delete t[e]})),Object.keys(t).forEach((e=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&ix(t[e])}))},rx=t=>{t.fontFamily&&(t.themeVariables&&t.themeVariables.fontFamily||(t.themeVariables={fontFamily:t.fontFamily})),Q_.push(t),J_(Z_,Q_)},sx=(t=Z_)=>{Q_=[],J_(t,Q_)};var ax=(t=>(t.LAZY_LOAD_DEPRECATED="The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",t))(ax||{});const ox={},cx=t=>{var e;t&&((t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&(ox[e="LAZY_LOAD_DEPRECATED"]||(vm.warn(ax[e]),ox[e]=!0)))},lx=function(t,e,n,i){const r=function(t,e,n){let i=new Map;return n?(i.set("width","100%"),i.set("style",`max-width: ${e}px;`)):(i.set("height",t),i.set("width",e)),i}(e,n,i);!function(t,e){for(let n of e)t.attr(n[0],n[1])}(t,r)},hx=function(t,e,n,i){const r=e.node().getBBox(),s=r.width,a=r.height;vm.info(`SVG bounds: ${s}x${a}`,r);let o=0,c=0;vm.info(`Graph bounds: ${o}x${c}`,t),o=s+2*n,c=a+2*n,vm.info(`Calculated bounds: ${o}x${c}`),lx(e,c,o,i);const l=`${r.x-n} ${r.y-n} ${r.width+2*n} ${r.height+2*n}`;e.attr("viewBox",l)},ux=t=>`g.classGroup text {\n  fill: ${t.nodeBorder};\n  fill: ${t.classText};\n  stroke: none;\n  font-family: ${t.fontFamily};\n  font-size: 10px;\n\n  .title {\n    font-weight: bolder;\n  }\n\n}\n\n.nodeLabel, .edgeLabel {\n  color: ${t.classText};\n}\n.edgeLabel .label rect {\n  fill: ${t.mainBkg};\n}\n.label text {\n  fill: ${t.classText};\n}\n.edgeLabel .label span {\n  background: ${t.mainBkg};\n}\n\n.classTitle {\n  font-weight: bolder;\n}\n.node rect,\n  .node circle,\n  .node ellipse,\n  .node polygon,\n  .node path {\n    fill: ${t.mainBkg};\n    stroke: ${t.nodeBorder};\n    stroke-width: 1px;\n  }\n\n\n.divider {\n  stroke: ${t.nodeBorder};\n  stroke: 1;\n}\n\ng.clickable {\n  cursor: pointer;\n}\n\ng.classGroup rect {\n  fill: ${t.mainBkg};\n  stroke: ${t.nodeBorder};\n}\n\ng.classGroup line {\n  stroke: ${t.nodeBorder};\n  stroke-width: 1;\n}\n\n.classLabel .box {\n  stroke: none;\n  stroke-width: 0;\n  fill: ${t.mainBkg};\n  opacity: 0.5;\n}\n\n.classLabel .label {\n  fill: ${t.nodeBorder};\n  font-size: 10px;\n}\n\n.relation {\n  stroke: ${t.lineColor};\n  stroke-width: 1;\n  fill: none;\n}\n\n.dashed-line{\n  stroke-dasharray: 3;\n}\n\n.dotted-line{\n  stroke-dasharray: 1 2;\n}\n\n#compositionStart, .composition {\n  fill: ${t.lineColor} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n  fill: ${t.lineColor} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n  fill: ${t.lineColor} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n  fill: ${t.lineColor} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#extensionStart, .extension {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#lollipopStart, .lollipop {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n#lollipopEnd, .lollipop {\n  fill: ${t.mainBkg} !important;\n  stroke: ${t.lineColor} !important;\n  stroke-width: 1;\n}\n\n.edgeTerminals {\n  font-size: 11px;\n}\n\n.classTitleText {\n  text-anchor: middle;\n  font-size: 18px;\n  fill: ${t.textColor};\n}\n`,dx=t=>`\n  .entityBox {\n    fill: ${t.mainBkg};\n    stroke: ${t.nodeBorder};\n  }\n\n  .attributeBoxOdd {\n    fill: ${t.attributeBackgroundColorOdd};\n    stroke: ${t.nodeBorder};\n  }\n\n  .attributeBoxEven {\n    fill:  ${t.attributeBackgroundColorEven};\n    stroke: ${t.nodeBorder};\n  }\n\n  .relationshipLabelBox {\n    fill: ${t.tertiaryColor};\n    opacity: 0.7;\n    background-color: ${t.tertiaryColor};\n      rect {\n        opacity: 0.5;\n      }\n  }\n\n    .relationshipLine {\n      stroke: ${t.lineColor};\n    }\n\n  .entityTitleText {\n    text-anchor: middle;\n    font-size: 18px;\n    fill: ${t.textColor};\n  }    \n`,fx=()=>"",px=t=>`.label {\n    font-family: ${t.fontFamily};\n    color: ${t.nodeTextColor||t.textColor};\n  }\n  .cluster-label text {\n    fill: ${t.titleColor};\n  }\n  .cluster-label span {\n    color: ${t.titleColor};\n  }\n\n  .label text,span {\n    fill: ${t.nodeTextColor||t.textColor};\n    color: ${t.nodeTextColor||t.textColor};\n  }\n\n  .node rect,\n  .node circle,\n  .node ellipse,\n  .node polygon,\n  .node path {\n    fill: ${t.mainBkg};\n    stroke: ${t.nodeBorder};\n    stroke-width: 1px;\n  }\n\n  .node .label {\n    text-align: center;\n  }\n  .node.clickable {\n    cursor: pointer;\n  }\n\n  .arrowheadPath {\n    fill: ${t.arrowheadColor};\n  }\n\n  .edgePath .path {\n    stroke: ${t.lineColor};\n    stroke-width: 2.0px;\n  }\n\n  .flowchart-link {\n    stroke: ${t.lineColor};\n    fill: none;\n  }\n\n  .edgeLabel {\n    background-color: ${t.edgeLabelBackground};\n    rect {\n      opacity: 0.5;\n      background-color: ${t.edgeLabelBackground};\n      fill: ${t.edgeLabelBackground};\n    }\n    text-align: center;\n  }\n\n  .cluster rect {\n    fill: ${t.clusterBkg};\n    stroke: ${t.clusterBorder};\n    stroke-width: 1px;\n  }\n\n  .cluster text {\n    fill: ${t.titleColor};\n  }\n\n  .cluster span {\n    color: ${t.titleColor};\n  }\n  /* .cluster div {\n    color: ${t.titleColor};\n  } */\n\n  div.mermaidTooltip {\n    position: absolute;\n    text-align: center;\n    max-width: 200px;\n    padding: 2px;\n    font-family: ${t.fontFamily};\n    font-size: 12px;\n    background: ${t.tertiaryColor};\n    border: 1px solid ${t.border2};\n    border-radius: 2px;\n    pointer-events: none;\n    z-index: 100;\n  }\n\n  .flowchartTitleText {\n    text-anchor: middle;\n    font-size: 18px;\n    fill: ${t.textColor};\n  }\n`,gx=t=>`\n  .mermaid-main-font {\n    font-family: "trebuchet ms", verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n  }\n  .exclude-range {\n    fill: ${t.excludeBkgColor};\n  }\n\n  .section {\n    stroke: none;\n    opacity: 0.2;\n  }\n\n  .section0 {\n    fill: ${t.sectionBkgColor};\n  }\n\n  .section2 {\n    fill: ${t.sectionBkgColor2};\n  }\n\n  .section1,\n  .section3 {\n    fill: ${t.altSectionBkgColor};\n    opacity: 0.2;\n  }\n\n  .sectionTitle0 {\n    fill: ${t.titleColor};\n  }\n\n  .sectionTitle1 {\n    fill: ${t.titleColor};\n  }\n\n  .sectionTitle2 {\n    fill: ${t.titleColor};\n  }\n\n  .sectionTitle3 {\n    fill: ${t.titleColor};\n  }\n\n  .sectionTitle {\n    text-anchor: start;\n    // font-size: ${t.ganttFontSize};\n    // text-height: 14px;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n\n  }\n\n\n  /* Grid and axis */\n\n  .grid .tick {\n    stroke: ${t.gridColor};\n    opacity: 0.8;\n    shape-rendering: crispEdges;\n    text {\n      font-family: ${t.fontFamily};\n      fill: ${t.textColor};\n    }\n  }\n\n  .grid path {\n    stroke-width: 0;\n  }\n\n\n  /* Today line */\n\n  .today {\n    fill: none;\n    stroke: ${t.todayLineColor};\n    stroke-width: 2px;\n  }\n\n\n  /* Task styling */\n\n  /* Default task */\n\n  .task {\n    stroke-width: 2;\n  }\n\n  .taskText {\n    text-anchor: middle;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n  }\n\n  // .taskText:not([font-size]) {\n  //   font-size: ${t.ganttFontSize};\n  // }\n\n  .taskTextOutsideRight {\n    fill: ${t.taskTextDarkColor};\n    text-anchor: start;\n    // font-size: ${t.ganttFontSize};\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n\n  }\n\n  .taskTextOutsideLeft {\n    fill: ${t.taskTextDarkColor};\n    text-anchor: end;\n    // font-size: ${t.ganttFontSize};\n  }\n\n  /* Special case clickable */\n  .task.clickable {\n    cursor: pointer;\n  }\n  .taskText.clickable {\n    cursor: pointer;\n    fill: ${t.taskTextClickableColor} !important;\n    font-weight: bold;\n  }\n\n  .taskTextOutsideLeft.clickable {\n    cursor: pointer;\n    fill: ${t.taskTextClickableColor} !important;\n    font-weight: bold;\n  }\n\n  .taskTextOutsideRight.clickable {\n    cursor: pointer;\n    fill: ${t.taskTextClickableColor} !important;\n    font-weight: bold;\n  }\n\n  /* Specific task settings for the sections*/\n\n  .taskText0,\n  .taskText1,\n  .taskText2,\n  .taskText3 {\n    fill: ${t.taskTextColor};\n  }\n\n  .task0,\n  .task1,\n  .task2,\n  .task3 {\n    fill: ${t.taskBkgColor};\n    stroke: ${t.taskBorderColor};\n  }\n\n  .taskTextOutside0,\n  .taskTextOutside2\n  {\n    fill: ${t.taskTextOutsideColor};\n  }\n\n  .taskTextOutside1,\n  .taskTextOutside3 {\n    fill: ${t.taskTextOutsideColor};\n  }\n\n\n  /* Active task */\n\n  .active0,\n  .active1,\n  .active2,\n  .active3 {\n    fill: ${t.activeTaskBkgColor};\n    stroke: ${t.activeTaskBorderColor};\n  }\n\n  .activeText0,\n  .activeText1,\n  .activeText2,\n  .activeText3 {\n    fill: ${t.taskTextDarkColor} !important;\n  }\n\n\n  /* Completed task */\n\n  .done0,\n  .done1,\n  .done2,\n  .done3 {\n    stroke: ${t.doneTaskBorderColor};\n    fill: ${t.doneTaskBkgColor};\n    stroke-width: 2;\n  }\n\n  .doneText0,\n  .doneText1,\n  .doneText2,\n  .doneText3 {\n    fill: ${t.taskTextDarkColor} !important;\n  }\n\n\n  /* Tasks on the critical line */\n\n  .crit0,\n  .crit1,\n  .crit2,\n  .crit3 {\n    stroke: ${t.critBorderColor};\n    fill: ${t.critBkgColor};\n    stroke-width: 2;\n  }\n\n  .activeCrit0,\n  .activeCrit1,\n  .activeCrit2,\n  .activeCrit3 {\n    stroke: ${t.critBorderColor};\n    fill: ${t.activeTaskBkgColor};\n    stroke-width: 2;\n  }\n\n  .doneCrit0,\n  .doneCrit1,\n  .doneCrit2,\n  .doneCrit3 {\n    stroke: ${t.critBorderColor};\n    fill: ${t.doneTaskBkgColor};\n    stroke-width: 2;\n    cursor: pointer;\n    shape-rendering: crispEdges;\n  }\n\n  .milestone {\n    transform: rotate(45deg) scale(0.8,0.8);\n  }\n\n  .milestoneText {\n    font-style: italic;\n  }\n  .doneCritText0,\n  .doneCritText1,\n  .doneCritText2,\n  .doneCritText3 {\n    fill: ${t.taskTextDarkColor} !important;\n  }\n\n  .activeCritText0,\n  .activeCritText1,\n  .activeCritText2,\n  .activeCritText3 {\n    fill: ${t.taskTextDarkColor} !important;\n  }\n\n  .titleText {\n    text-anchor: middle;\n    font-size: 18px;\n    fill: ${t.textColor}    ;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n  }\n`,yx=()=>"",mx=t=>`\n  .pieCircle{\n    stroke: ${t.pieStrokeColor};\n    stroke-width : ${t.pieStrokeWidth};\n    opacity : ${t.pieOpacity};\n  }\n  .pieTitleText {\n    text-anchor: middle;\n    font-size: ${t.pieTitleTextSize};\n    fill: ${t.pieTitleTextColor};\n    font-family: ${t.fontFamily};\n  }\n  .slice {\n    font-family: ${t.fontFamily};\n    fill: ${t.pieSectionTextColor};\n    font-size:${t.pieSectionTextSize};\n    // fill: white;\n  }\n  .legend text {\n    fill: ${t.pieLegendTextColor};\n    font-family: ${t.fontFamily};\n    font-size: ${t.pieLegendTextSize};\n  }\n`,bx=t=>`\n\n  marker {\n    fill: ${t.relationColor};\n    stroke: ${t.relationColor};\n  }\n\n  marker.cross {\n    stroke: ${t.lineColor};\n  }\n\n  svg {\n    font-family: ${t.fontFamily};\n    font-size: ${t.fontSize};\n  }\n\n  .reqBox {\n    fill: ${t.requirementBackground};\n    fill-opacity: 100%;\n    stroke: ${t.requirementBorderColor};\n    stroke-width: ${t.requirementBorderSize};\n  }\n  \n  .reqTitle, .reqLabel{\n    fill:  ${t.requirementTextColor};\n  }\n  .reqLabelBox {\n    fill: ${t.relationLabelBackground};\n    fill-opacity: 100%;\n  }\n\n  .req-title-line {\n    stroke: ${t.requirementBorderColor};\n    stroke-width: ${t.requirementBorderSize};\n  }\n  .relationshipLine {\n    stroke: ${t.relationColor};\n    stroke-width: 1;\n  }\n  .relationshipLabel {\n    fill: ${t.relationLabelColor};\n  }\n\n`,_x=t=>`.actor {\n    stroke: ${t.actorBorder};\n    fill: ${t.actorBkg};\n  }\n\n  text.actor > tspan {\n    fill: ${t.actorTextColor};\n    stroke: none;\n  }\n\n  .actor-line {\n    stroke: ${t.actorLineColor};\n  }\n\n  .messageLine0 {\n    stroke-width: 1.5;\n    stroke-dasharray: none;\n    stroke: ${t.signalColor};\n  }\n\n  .messageLine1 {\n    stroke-width: 1.5;\n    stroke-dasharray: 2, 2;\n    stroke: ${t.signalColor};\n  }\n\n  #arrowhead path {\n    fill: ${t.signalColor};\n    stroke: ${t.signalColor};\n  }\n\n  .sequenceNumber {\n    fill: ${t.sequenceNumberColor};\n  }\n\n  #sequencenumber {\n    fill: ${t.signalColor};\n  }\n\n  #crosshead path {\n    fill: ${t.signalColor};\n    stroke: ${t.signalColor};\n  }\n\n  .messageText {\n    fill: ${t.signalTextColor};\n    stroke: none;\n  }\n\n  .labelBox {\n    stroke: ${t.labelBoxBorderColor};\n    fill: ${t.labelBoxBkgColor};\n  }\n\n  .labelText, .labelText > tspan {\n    fill: ${t.labelTextColor};\n    stroke: none;\n  }\n\n  .loopText, .loopText > tspan {\n    fill: ${t.loopTextColor};\n    stroke: none;\n  }\n\n  .loopLine {\n    stroke-width: 2px;\n    stroke-dasharray: 2, 2;\n    stroke: ${t.labelBoxBorderColor};\n    fill: ${t.labelBoxBorderColor};\n  }\n\n  .note {\n    //stroke: #decc93;\n    stroke: ${t.noteBorderColor};\n    fill: ${t.noteBkgColor};\n  }\n\n  .noteText, .noteText > tspan {\n    fill: ${t.noteTextColor};\n    stroke: none;\n  }\n\n  .activation0 {\n    fill: ${t.activationBkgColor};\n    stroke: ${t.activationBorderColor};\n  }\n\n  .activation1 {\n    fill: ${t.activationBkgColor};\n    stroke: ${t.activationBorderColor};\n  }\n\n  .activation2 {\n    fill: ${t.activationBkgColor};\n    stroke: ${t.activationBorderColor};\n  }\n\n  .actorPopupMenu {\n    position: absolute;\n  }\n\n  .actorPopupMenuPanel {\n    position: absolute;\n    fill: ${t.actorBkg};\n    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n    filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n  .actor-man line {\n    stroke: ${t.actorBorder};\n    fill: ${t.actorBkg};\n  }\n  .actor-man circle, line {\n    stroke: ${t.actorBorder};\n    fill: ${t.actorBkg};\n    stroke-width: 2px;\n  }\n`,xx=t=>`\ndefs #statediagram-barbEnd {\n    fill: ${t.transitionColor};\n    stroke: ${t.transitionColor};\n  }\ng.stateGroup text {\n  fill: ${t.nodeBorder};\n  stroke: none;\n  font-size: 10px;\n}\ng.stateGroup text {\n  fill: ${t.textColor};\n  stroke: none;\n  font-size: 10px;\n\n}\ng.stateGroup .state-title {\n  font-weight: bolder;\n  fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n  fill: ${t.mainBkg};\n  stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n  stroke: ${t.lineColor};\n  stroke-width: 1;\n}\n\n.transition {\n  stroke: ${t.transitionColor};\n  stroke-width: 1;\n  fill: none;\n}\n\n.stateGroup .composit {\n  fill: ${t.background};\n  border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n  fill: #e0e0e0;\n  border-bottom: 1px\n}\n\n.state-note {\n  stroke: ${t.noteBorderColor};\n  fill: ${t.noteBkgColor};\n\n  text {\n    fill: ${t.noteTextColor};\n    stroke: none;\n    font-size: 10px;\n  }\n}\n\n.stateLabel .box {\n  stroke: none;\n  stroke-width: 0;\n  fill: ${t.mainBkg};\n  opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n  fill: ${t.labelBackgroundColor};\n  opacity: 0.5;\n}\n.edgeLabel .label text {\n  fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n  color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n  fill: ${t.stateLabelColor};\n  font-size: 10px;\n  font-weight: bold;\n}\n\n.node circle.state-start {\n  fill: ${t.specialStateColor};\n  stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n  fill: ${t.specialStateColor};\n  stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n  fill: ${t.innerEndBackground};\n  stroke: ${t.background};\n  stroke-width: 1.5\n}\n.end-state-inner {\n  fill: ${t.compositeBackground||t.background};\n  // stroke: ${t.background};\n  stroke-width: 1.5\n}\n\n.node rect {\n  fill: ${t.stateBkg||t.mainBkg};\n  stroke: ${t.stateBorder||t.nodeBorder};\n  stroke-width: 1px;\n}\n.node polygon {\n  fill: ${t.mainBkg};\n  stroke: ${t.stateBorder||t.nodeBorder};;\n  stroke-width: 1px;\n}\n#statediagram-barbEnd {\n  fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n  fill: ${t.compositeTitleBackground};\n  stroke: ${t.stateBorder||t.nodeBorder};\n  stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n  color: ${t.stateLabelColor};\n}\n\n.statediagram-cluster rect.outer {\n  rx: 5px;\n  ry: 5px;\n}\n.statediagram-state .divider {\n  stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n  rx: 5px;\n  ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n  fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n  fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n  rx:0;\n  ry:0;\n}\n\n.statediagram-state rect.basic {\n  rx: 5px;\n  ry: 5px;\n}\n.statediagram-state rect.divider {\n  stroke-dasharray: 10,10;\n  fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n  stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n  fill: ${t.noteBkgColor};\n  stroke: ${t.noteBorderColor};\n  stroke-width: 1px;\n  rx: 0;\n  ry: 0;\n}\n.statediagram-note rect {\n  fill: ${t.noteBkgColor};\n  stroke: ${t.noteBorderColor};\n  stroke-width: 1px;\n  rx: 0;\n  ry: 0;\n}\n\n.statediagram-note text {\n  fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n  color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n  color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n  fill: ${t.lineColor};\n  stroke: ${t.lineColor};\n  stroke-width: 1;\n}\n\n.statediagramTitleText {\n  text-anchor: middle;\n  font-size: 18px;\n  fill: ${t.textColor};\n}\n`,vx=t=>`.label {\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n    color: ${t.textColor};\n  }\n  .mouth {\n    stroke: #666;\n  }\n\n  line {\n    stroke: ${t.textColor}\n  }\n\n  .legend {\n    fill: ${t.textColor};\n  }\n\n  .label text {\n    fill: #333;\n  }\n  .label {\n    color: ${t.textColor}\n  }\n\n  .face {\n    ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n    stroke: #999;\n  }\n\n  .node rect,\n  .node circle,\n  .node ellipse,\n  .node polygon,\n  .node path {\n    fill: ${t.mainBkg};\n    stroke: ${t.nodeBorder};\n    stroke-width: 1px;\n  }\n\n  .node .label {\n    text-align: center;\n  }\n  .node.clickable {\n    cursor: pointer;\n  }\n\n  .arrowheadPath {\n    fill: ${t.arrowheadColor};\n  }\n\n  .edgePath .path {\n    stroke: ${t.lineColor};\n    stroke-width: 1.5px;\n  }\n\n  .flowchart-link {\n    stroke: ${t.lineColor};\n    fill: none;\n  }\n\n  .edgeLabel {\n    background-color: ${t.edgeLabelBackground};\n    rect {\n      opacity: 0.5;\n    }\n    text-align: center;\n  }\n\n  .cluster rect {\n  }\n\n  .cluster text {\n    fill: ${t.titleColor};\n  }\n\n  div.mermaidTooltip {\n    position: absolute;\n    text-align: center;\n    max-width: 200px;\n    padding: 2px;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n    font-size: 12px;\n    background: ${t.tertiaryColor};\n    border: 1px solid ${t.border2};\n    border-radius: 2px;\n    pointer-events: none;\n    z-index: 100;\n  }\n\n  .task-type-0, .section-type-0  {\n    ${t.fillType0?`fill: ${t.fillType0}`:""};\n  }\n  .task-type-1, .section-type-1  {\n    ${t.fillType0?`fill: ${t.fillType1}`:""};\n  }\n  .task-type-2, .section-type-2  {\n    ${t.fillType0?`fill: ${t.fillType2}`:""};\n  }\n  .task-type-3, .section-type-3  {\n    ${t.fillType0?`fill: ${t.fillType3}`:""};\n  }\n  .task-type-4, .section-type-4  {\n    ${t.fillType0?`fill: ${t.fillType4}`:""};\n  }\n  .task-type-5, .section-type-5  {\n    ${t.fillType0?`fill: ${t.fillType5}`:""};\n  }\n  .task-type-6, .section-type-6  {\n    ${t.fillType0?`fill: ${t.fillType6}`:""};\n  }\n  .task-type-7, .section-type-7  {\n    ${t.fillType0?`fill: ${t.fillType7}`:""};\n  }\n\n  .actor-0 {\n    ${t.actor0?`fill: ${t.actor0}`:""};\n  }\n  .actor-1 {\n    ${t.actor1?`fill: ${t.actor1}`:""};\n  }\n  .actor-2 {\n    ${t.actor2?`fill: ${t.actor2}`:""};\n  }\n  .actor-3 {\n    ${t.actor3?`fill: ${t.actor3}`:""};\n  }\n  .actor-4 {\n    ${t.actor4?`fill: ${t.actor4}`:""};\n  }\n  .actor-5 {\n    ${t.actor5?`fill: ${t.actor5}`:""};\n  }\n`,kx=t=>`.person {\n    stroke: ${t.personBorder};\n    fill: ${t.personBkg};\n  }\n`,wx={flowchart:px,"flowchart-v2":px,sequence:_x,gantt:gx,classDiagram:ux,"classDiagram-v2":ux,class:ux,stateDiagram:xx,state:xx,info:yx,pie:mx,er:dx,error:fx,journey:vx,requirement:bx,c4:kx},Tx=(t,e,n)=>{let i="";return t in wx&&wx[t]?i=wx[t](n):vm.warn(`No theme found for ${t}`),` & {\n    font-family: ${n.fontFamily};\n    font-size: ${n.fontSize};\n    fill: ${n.textColor}\n  }\n\n  /* Classes common for multiple diagrams */\n\n  & .error-icon {\n    fill: ${n.errorBkgColor};\n  }\n  & .error-text {\n    fill: ${n.errorTextColor};\n    stroke: ${n.errorTextColor};\n  }\n\n  & .edge-thickness-normal {\n    stroke-width: 2px;\n  }\n  & .edge-thickness-thick {\n    stroke-width: 3.5px\n  }\n  & .edge-pattern-solid {\n    stroke-dasharray: 0;\n  }\n\n  & .edge-pattern-dashed{\n    stroke-dasharray: 3;\n  }\n  .edge-pattern-dotted {\n    stroke-dasharray: 2;\n  }\n\n  & .marker {\n    fill: ${n.lineColor};\n    stroke: ${n.lineColor};\n  }\n  & .marker.cross {\n    stroke: ${n.lineColor};\n  }\n\n  & svg {\n    font-family: ${n.fontFamily};\n    font-size: ${n.fontSize};\n  }\n\n  ${i}\n\n  ${e}\n`},Cx=vm,Ex=km,Sx=nx,Ax=t=>Em(t,Sx()),Dx=hx,Lx={},Ox=(t,e,n)=>{if(Lx[t])throw new Error(`Diagram ${t} already registered.`);var i,r;Lx[t]=e,n&&w_(t,n),i=t,r=e.styles,wx[i]=r,e.injectUtils&&e.injectUtils(Cx,Ex,Sx,Ax,Dx)},Mx=t=>{if(t in Lx)return Lx[t];throw new Error(`Diagram ${t} not found.`)};var Bx=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,4],i=[1,7],r=[1,5],s=[1,9],a=[1,6],o=[2,6],c=[1,16],l=[6,8,14,20,22,24,25,27,29,32,37,40,50,55],h=[8,14,20,22,24,25,27,29,32,37,40],u=[8,13,14,20,22,24,25,27,29,32,37,40],d=[1,26],f=[6,8,14,50,55],p=[8,14,55],g=[1,53],y=[1,52],m=[8,14,30,33,35,38,55],b=[1,67],_=[1,68],x=[1,69],v=[8,14,33,35,42,55],k={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,GG:6,document:7,EOF:8,":":9,DIR:10,options:11,body:12,OPT:13,NL:14,line:15,statement:16,commitStatement:17,mergeStatement:18,cherryPickStatement:19,acc_title:20,acc_title_value:21,acc_descr:22,acc_descr_value:23,acc_descr_multiline_value:24,section:25,branchStatement:26,CHECKOUT:27,ref:28,BRANCH:29,ORDER:30,NUM:31,CHERRY_PICK:32,COMMIT_ID:33,STR:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,openDirective:46,typeDirective:47,closeDirective:48,argDirective:49,open_directive:50,type_directive:51,arg_directive:52,close_directive:53,ID:54,";":55,$accept:0,$end:1},terminals_:{2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive",54:"ID",55:";"},productions_:[0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[19,5],[19,5],[19,5],[19,5],[18,2],[18,4],[18,4],[18,4],[18,6],[18,6],[18,6],[18,6],[18,6],[18,6],[18,8],[18,8],[18,8],[18,8],[18,8],[18,8],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[41,0],[41,1],[39,1],[39,1],[39,1],[5,3],[5,5],[46,1],[47,1],[49,1],[48,1],[28,1],[28,1],[4,1],[4,1],[4,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 3:return s[o];case 4:return s[o-1];case 5:return i.setDirection(s[o-3]),s[o-1];case 7:i.setOptions(s[o-1]),this.$=s[o];break;case 8:s[o-1]+=s[o],this.$=s[o-1];break;case 10:this.$=[];break;case 11:s[o-1].push(s[o]),this.$=s[o-1];break;case 12:this.$=s[o-1];break;case 17:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 18:case 19:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 20:i.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 22:i.checkout(s[o]);break;case 23:i.branch(s[o]);break;case 24:i.branch(s[o-2],s[o]);break;case 25:i.cherryPick(s[o],"",void 0);break;case 26:i.cherryPick(s[o-2],"",s[o]);break;case 27:case 29:i.cherryPick(s[o-2],"","");break;case 28:i.cherryPick(s[o],"",s[o-2]);break;case 30:i.merge(s[o],"","","");break;case 31:i.merge(s[o-2],s[o],"","");break;case 32:i.merge(s[o-2],"",s[o],"");break;case 33:i.merge(s[o-2],"","",s[o]);break;case 34:i.merge(s[o-4],s[o],"",s[o-2]);break;case 35:i.merge(s[o-4],"",s[o],s[o-2]);break;case 36:i.merge(s[o-4],"",s[o-2],s[o]);break;case 37:i.merge(s[o-4],s[o-2],s[o],"");break;case 38:i.merge(s[o-4],s[o-2],"",s[o]);break;case 39:i.merge(s[o-4],s[o],s[o-2],"");break;case 40:i.merge(s[o-6],s[o-4],s[o-2],s[o]);break;case 41:i.merge(s[o-6],s[o],s[o-4],s[o-2]);break;case 42:i.merge(s[o-6],s[o-4],s[o],s[o-2]);break;case 43:i.merge(s[o-6],s[o-2],s[o-4],s[o]);break;case 44:i.merge(s[o-6],s[o],s[o-2],s[o-4]);break;case 45:i.merge(s[o-6],s[o-2],s[o],s[o-4]);break;case 46:i.commit(s[o]);break;case 47:i.commit("","",i.commitType.NORMAL,s[o]);break;case 48:i.commit("","",s[o],"");break;case 49:i.commit("","",s[o],s[o-2]);break;case 50:i.commit("","",s[o-2],s[o]);break;case 51:i.commit("",s[o],i.commitType.NORMAL,"");break;case 52:i.commit("",s[o-2],i.commitType.NORMAL,s[o]);break;case 53:i.commit("",s[o],i.commitType.NORMAL,s[o-2]);break;case 54:i.commit("",s[o-2],s[o],"");break;case 55:i.commit("",s[o],s[o-2],"");break;case 56:i.commit("",s[o-4],s[o-2],s[o]);break;case 57:i.commit("",s[o-4],s[o],s[o-2]);break;case 58:i.commit("",s[o-2],s[o-4],s[o]);break;case 59:i.commit("",s[o],s[o-4],s[o-2]);break;case 60:i.commit("",s[o],s[o-2],s[o-4]);break;case 61:i.commit("",s[o-2],s[o],s[o-4]);break;case 62:i.commit(s[o],"",i.commitType.NORMAL,"");break;case 63:i.commit(s[o],"",i.commitType.NORMAL,s[o-2]);break;case 64:i.commit(s[o-2],"",i.commitType.NORMAL,s[o]);break;case 65:i.commit(s[o-2],"",s[o],"");break;case 66:i.commit(s[o],"",s[o-2],"");break;case 67:i.commit(s[o],s[o-2],i.commitType.NORMAL,"");break;case 68:i.commit(s[o-2],s[o],i.commitType.NORMAL,"");break;case 69:i.commit(s[o-4],"",s[o-2],s[o]);break;case 70:i.commit(s[o-4],"",s[o],s[o-2]);break;case 71:i.commit(s[o-2],"",s[o-4],s[o]);break;case 72:i.commit(s[o],"",s[o-4],s[o-2]);break;case 73:i.commit(s[o],"",s[o-2],s[o-4]);break;case 74:i.commit(s[o-2],"",s[o],s[o-4]);break;case 75:i.commit(s[o-4],s[o],s[o-2],"");break;case 76:i.commit(s[o-4],s[o-2],s[o],"");break;case 77:i.commit(s[o-2],s[o],s[o-4],"");break;case 78:i.commit(s[o],s[o-2],s[o-4],"");break;case 79:i.commit(s[o],s[o-4],s[o-2],"");break;case 80:i.commit(s[o-2],s[o-4],s[o],"");break;case 81:i.commit(s[o-4],s[o],i.commitType.NORMAL,s[o-2]);break;case 82:i.commit(s[o-4],s[o-2],i.commitType.NORMAL,s[o]);break;case 83:i.commit(s[o-2],s[o],i.commitType.NORMAL,s[o-4]);break;case 84:i.commit(s[o],s[o-2],i.commitType.NORMAL,s[o-4]);break;case 85:i.commit(s[o],s[o-4],i.commitType.NORMAL,s[o-2]);break;case 86:i.commit(s[o-2],s[o-4],i.commitType.NORMAL,s[o]);break;case 87:i.commit(s[o-6],s[o-4],s[o-2],s[o]);break;case 88:i.commit(s[o-6],s[o-4],s[o],s[o-2]);break;case 89:i.commit(s[o-6],s[o-2],s[o-4],s[o]);break;case 90:i.commit(s[o-6],s[o],s[o-4],s[o-2]);break;case 91:i.commit(s[o-6],s[o-2],s[o],s[o-4]);break;case 92:i.commit(s[o-6],s[o],s[o-2],s[o-4]);break;case 93:i.commit(s[o-4],s[o-6],s[o-2],s[o]);break;case 94:i.commit(s[o-4],s[o-6],s[o],s[o-2]);break;case 95:i.commit(s[o-2],s[o-6],s[o-4],s[o]);break;case 96:i.commit(s[o],s[o-6],s[o-4],s[o-2]);break;case 97:i.commit(s[o-2],s[o-6],s[o],s[o-4]);break;case 98:i.commit(s[o],s[o-6],s[o-2],s[o-4]);break;case 99:i.commit(s[o],s[o-4],s[o-2],s[o-6]);break;case 100:i.commit(s[o-2],s[o-4],s[o],s[o-6]);break;case 101:i.commit(s[o],s[o-2],s[o-4],s[o-6]);break;case 102:i.commit(s[o-2],s[o],s[o-4],s[o-6]);break;case 103:i.commit(s[o-4],s[o-2],s[o],s[o-6]);break;case 104:i.commit(s[o-4],s[o],s[o-2],s[o-6]);break;case 105:i.commit(s[o-2],s[o-4],s[o-6],s[o]);break;case 106:i.commit(s[o],s[o-4],s[o-6],s[o-2]);break;case 107:i.commit(s[o-2],s[o],s[o-6],s[o-4]);break;case 108:i.commit(s[o],s[o-2],s[o-6],s[o-4]);break;case 109:i.commit(s[o-4],s[o-2],s[o-6],s[o]);break;case 110:i.commit(s[o-4],s[o],s[o-6],s[o-2]);break;case 111:this.$="";break;case 112:this.$=s[o];break;case 113:this.$=i.commitType.NORMAL;break;case 114:this.$=i.commitType.REVERSE;break;case 115:this.$=i.commitType.HIGHLIGHT;break;case 118:i.parseDirective("%%{","open_directive");break;case 119:i.parseDirective(s[o],"type_directive");break;case 120:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 121:i.parseDirective("}%%","close_directive","gitGraph")}},table:[{3:1,4:2,5:3,6:n,8:i,14:r,46:8,50:s,55:a},{1:[3]},{3:10,4:2,5:3,6:n,8:i,14:r,46:8,50:s,55:a},{3:11,4:2,5:3,6:n,8:i,14:r,46:8,50:s,55:a},{7:12,8:o,9:[1,13],10:[1,14],11:15,14:c},e(l,[2,124]),e(l,[2,125]),e(l,[2,126]),{47:17,51:[1,18]},{51:[2,118]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:o,11:15,14:c},{9:[1,21]},e(h,[2,10],{12:22,13:[1,23]}),e(u,[2,9]),{9:[1,25],48:24,53:d},e([9,53],[2,119]),{1:[2,3]},{8:[1,27]},{7:28,8:o,11:15,14:c},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],37:[1,42],40:[1,41]},e(u,[2,8]),e(f,[2,116]),{49:45,52:[1,46]},e(f,[2,121]),{1:[2,4]},{8:[1,47]},e(h,[2,11]),{4:48,8:i,14:r,55:a},e(h,[2,13]),e(p,[2,14]),e(p,[2,15]),e(p,[2,16]),{21:[1,49]},{23:[1,50]},e(p,[2,19]),e(p,[2,20]),e(p,[2,21]),{28:51,34:g,54:y},e(p,[2,111],{41:54,33:[1,57],34:[1,59],35:[1,55],38:[1,56],42:[1,58]}),{28:60,34:g,54:y},{33:[1,61],35:[1,62]},{28:63,34:g,54:y},{48:64,53:d},{53:[2,120]},{1:[2,5]},e(h,[2,12]),e(p,[2,17]),e(p,[2,18]),e(p,[2,22]),e(m,[2,122]),e(m,[2,123]),e(p,[2,46]),{34:[1,65]},{39:66,43:b,44:_,45:x},{34:[1,70]},{34:[1,71]},e(p,[2,112]),e(p,[2,30],{33:[1,72],35:[1,74],38:[1,73]}),{34:[1,75]},{34:[1,76],36:[1,77]},e(p,[2,23],{30:[1,78]}),e(f,[2,117]),e(p,[2,47],{33:[1,80],38:[1,79],42:[1,81]}),e(p,[2,48],{33:[1,83],35:[1,82],42:[1,84]}),e(v,[2,113]),e(v,[2,114]),e(v,[2,115]),e(p,[2,51],{35:[1,85],38:[1,86],42:[1,87]}),e(p,[2,62],{33:[1,90],35:[1,88],38:[1,89]}),{34:[1,91]},{39:92,43:b,44:_,45:x},{34:[1,93]},e(p,[2,25],{35:[1,94]}),{33:[1,95]},{33:[1,96]},{31:[1,97]},{39:98,43:b,44:_,45:x},{34:[1,99]},{34:[1,100]},{34:[1,101]},{34:[1,102]},{34:[1,103]},{34:[1,104]},{39:105,43:b,44:_,45:x},{34:[1,106]},{34:[1,107]},{39:108,43:b,44:_,45:x},{34:[1,109]},e(p,[2,31],{35:[1,111],38:[1,110]}),e(p,[2,32],{33:[1,113],35:[1,112]}),e(p,[2,33],{33:[1,114],38:[1,115]}),{34:[1,116],36:[1,117]},{34:[1,118]},{34:[1,119]},e(p,[2,24]),e(p,[2,49],{33:[1,120],42:[1,121]}),e(p,[2,53],{38:[1,122],42:[1,123]}),e(p,[2,63],{33:[1,125],38:[1,124]}),e(p,[2,50],{33:[1,126],42:[1,127]}),e(p,[2,55],{35:[1,128],42:[1,129]}),e(p,[2,66],{33:[1,131],35:[1,130]}),e(p,[2,52],{38:[1,132],42:[1,133]}),e(p,[2,54],{35:[1,134],42:[1,135]}),e(p,[2,67],{35:[1,137],38:[1,136]}),e(p,[2,64],{33:[1,139],38:[1,138]}),e(p,[2,65],{33:[1,141],35:[1,140]}),e(p,[2,68],{35:[1,143],38:[1,142]}),{39:144,43:b,44:_,45:x},{34:[1,145]},{34:[1,146]},{34:[1,147]},{34:[1,148]},{39:149,43:b,44:_,45:x},e(p,[2,26]),e(p,[2,27]),e(p,[2,28]),e(p,[2,29]),{34:[1,150]},{34:[1,151]},{39:152,43:b,44:_,45:x},{34:[1,153]},{39:154,43:b,44:_,45:x},{34:[1,155]},{34:[1,156]},{34:[1,157]},{34:[1,158]},{34:[1,159]},{34:[1,160]},{34:[1,161]},{39:162,43:b,44:_,45:x},{34:[1,163]},{34:[1,164]},{34:[1,165]},{39:166,43:b,44:_,45:x},{34:[1,167]},{39:168,43:b,44:_,45:x},{34:[1,169]},{34:[1,170]},{34:[1,171]},{39:172,43:b,44:_,45:x},{34:[1,173]},e(p,[2,37],{35:[1,174]}),e(p,[2,38],{38:[1,175]}),e(p,[2,36],{33:[1,176]}),e(p,[2,39],{35:[1,177]}),e(p,[2,34],{38:[1,178]}),e(p,[2,35],{33:[1,179]}),e(p,[2,60],{42:[1,180]}),e(p,[2,73],{33:[1,181]}),e(p,[2,61],{42:[1,182]}),e(p,[2,84],{38:[1,183]}),e(p,[2,74],{33:[1,184]}),e(p,[2,83],{38:[1,185]}),e(p,[2,59],{42:[1,186]}),e(p,[2,72],{33:[1,187]}),e(p,[2,58],{42:[1,188]}),e(p,[2,78],{35:[1,189]}),e(p,[2,71],{33:[1,190]}),e(p,[2,77],{35:[1,191]}),e(p,[2,57],{42:[1,192]}),e(p,[2,85],{38:[1,193]}),e(p,[2,56],{42:[1,194]}),e(p,[2,79],{35:[1,195]}),e(p,[2,80],{35:[1,196]}),e(p,[2,86],{38:[1,197]}),e(p,[2,70],{33:[1,198]}),e(p,[2,81],{38:[1,199]}),e(p,[2,69],{33:[1,200]}),e(p,[2,75],{35:[1,201]}),e(p,[2,76],{35:[1,202]}),e(p,[2,82],{38:[1,203]}),{34:[1,204]},{39:205,43:b,44:_,45:x},{34:[1,206]},{34:[1,207]},{39:208,43:b,44:_,45:x},{34:[1,209]},{34:[1,210]},{34:[1,211]},{34:[1,212]},{39:213,43:b,44:_,45:x},{34:[1,214]},{39:215,43:b,44:_,45:x},{34:[1,216]},{34:[1,217]},{34:[1,218]},{34:[1,219]},{34:[1,220]},{34:[1,221]},{34:[1,222]},{39:223,43:b,44:_,45:x},{34:[1,224]},{34:[1,225]},{34:[1,226]},{39:227,43:b,44:_,45:x},{34:[1,228]},{39:229,43:b,44:_,45:x},{34:[1,230]},{34:[1,231]},{34:[1,232]},{39:233,43:b,44:_,45:x},e(p,[2,40]),e(p,[2,42]),e(p,[2,41]),e(p,[2,43]),e(p,[2,45]),e(p,[2,44]),e(p,[2,101]),e(p,[2,102]),e(p,[2,99]),e(p,[2,100]),e(p,[2,104]),e(p,[2,103]),e(p,[2,108]),e(p,[2,107]),e(p,[2,106]),e(p,[2,105]),e(p,[2,110]),e(p,[2,109]),e(p,[2,98]),e(p,[2,97]),e(p,[2,96]),e(p,[2,95]),e(p,[2,93]),e(p,[2,94]),e(p,[2,92]),e(p,[2,91]),e(p,[2,90]),e(p,[2,89]),e(p,[2,87]),e(p,[2,88])],defaultActions:{9:[2,118],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,120],47:[2,5]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},w=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),50;case 1:return this.begin("type_directive"),51;case 2:return this.popState(),this.begin("arg_directive"),9;case 3:return this.popState(),this.popState(),53;case 4:return 52;case 5:return this.begin("acc_title"),20;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),22;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 34:case 38:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:return 14;case 13:case 14:break;case 15:return 6;case 16:return 40;case 17:return 33;case 18:return 38;case 19:return 42;case 20:return 43;case 21:return 44;case 22:return 45;case 23:return 35;case 24:return 29;case 25:return 30;case 26:return 37;case 27:return 32;case 28:return 27;case 29:case 30:return 10;case 31:return 9;case 32:return"CARET";case 33:this.begin("options");break;case 35:return 13;case 36:return 36;case 37:this.begin("string");break;case 39:return 34;case 40:return 31;case 41:return 54;case 42:return 8}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit(?=\s|$))/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch(?=\s|$))/i,/^(?:order:)/i,/^(?:merge(?=\s|$))/i,/^(?:cherry-pick(?=\s|$))/i,/^(?:checkout(?=\s|$))/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+(?=\s|$))/i,/^(?:\w([-\./\w]*[-\w])?)/i,/^(?:$)/i,/^(?:\s+)/i],conditions:{acc_descr_multiline:{rules:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},options:{rules:[34,35],inclusive:!1},string:{rules:[38,39],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,40,41,42,43],inclusive:!0}}},t);function T(){this.yy={}}return k.lexer=w,T.prototype=k,k.Parser=T,new T}();Bx.parser=Bx;const Nx=Bx,Ix=t=>null!==t.match(/^\s*gitGraph/);let Fx="",Rx="",$x="";const Px=t=>Em(t,nx()),Yx=function(){Fx="",$x="",Rx=""},jx=function(t){Fx=Px(t).replace(/^\s+/g,"")},zx=function(){return Fx||Rx},Ux=function(t){$x=Px(t).replace(/\n\s+/g,"\n")},Wx=function(){return $x},Hx=function(t){Rx=Px(t)},qx=function(){return Rx};let Vx=nx().gitGraph.mainBranchName,Gx=nx().gitGraph.mainBranchOrder,Xx={},Zx=null,Qx={};Qx[Vx]={name:Vx,order:Gx};let Kx={};Kx[Vx]=Zx;let Jx=Vx,tv="LR",ev=0;function nv(){return I_({length:7})}let iv={};const rv=function(t){if(t=Mm.sanitizeText(t,nx()),void 0===Kx[t]){let 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,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"branch '+t+'"']},e}{Jx=t;const e=Kx[Jx];Zx=Xx[e]}};function sv(t,e,n){const i=t.indexOf(e);-1===i?t.push(n):t.splice(i,1,n)}function av(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let n="";t.forEach((function(t){n+=t===e?"\t*":"\t|"}));const i=[n,e.id,e.seq];for(let t in Kx)Kx[t]===e.id&&i.push(t);if(vm.debug(i.join(" ")),e.parents&&2==e.parents.length){const n=Xx[e.parents[0]];sv(t,e,n),t.push(Xx[e.parents[1]])}else{if(0==e.parents.length)return;{const n=Xx[e.parents];sv(t,e,n)}}av(t=function(t,e){const n=Object.create(null);return t.reduce(((t,i)=>{const r=e(i);return n[r]||(n[r]=!0,t.push(i)),t}),[])}(t,(t=>t.id)))}const ov=function(){const t=Object.keys(Xx).map((function(t){return Xx[t]}));return t.forEach((function(t){vm.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t},cv={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},lv={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().gitGraph,setDirection:function(t){tv=t},setOptions:function(t){vm.debug("options str",t),t=(t=t&&t.trim())||"{}";try{iv=JSON.parse(t)}catch(t){vm.error("error while parsing gitGraph options",t.message)}},getOptions:function(){return iv},commit:function(t,e,n,i){vm.debug("Entering commit:",t,e,n,i),e=Mm.sanitizeText(e,nx()),t=Mm.sanitizeText(t,nx()),i=Mm.sanitizeText(i,nx());const r={id:e||ev+"-"+nv(),message:t,seq:ev++,type:n||cv.NORMAL,tag:i||"",parents:null==Zx?[]:[Zx.id],branch:Jx};Zx=r,Xx[r.id]=r,Kx[Jx]=r.id,vm.debug("in pushCommit "+r.id)},branch:function(t,e){if(t=Mm.sanitizeText(t,nx()),void 0!==Kx[t]){let e=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 '+t+'")');throw e.hash={text:"branch "+t,token:"branch "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"checkout '+t+'"']},e}Kx[t]=null!=Zx?Zx.id:null,Qx[t]={name:t,order:e?parseInt(e,10):null},rv(t),vm.debug("in createBranch")},merge:function(t,e,n,i){t=Mm.sanitizeText(t,nx()),e=Mm.sanitizeText(e,nx());const r=Xx[Kx[Jx]],s=Xx[Kx[t]];if(Jx===t){let e=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(void 0===r||!r){let e=new Error('Incorrect usage of "merge". Current branch ('+Jx+")has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["commit"]},e}if(void 0===Kx[t]){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch "+t]},e}if(void 0===s||!s){let e=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:['"commit"']},e}if(r===s){let e=new Error('Incorrect usage of "merge". Both branches have same head');throw e.hash={text:"merge "+t,token:"merge "+t,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["branch abc"]},e}if(e&&void 0!==Xx[e]){let r=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom Id");throw r.hash={text:"merge "+t+e+n+i,token:"merge "+t+e+n+i,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["merge "+t+" "+e+"_UNIQUE "+n+" "+i]},r}const a={id:e||ev+"-"+nv(),message:"merged branch "+t+" into "+Jx,seq:ev++,parents:[null==Zx?null:Zx.id,Kx[t]],branch:Jx,type:cv.MERGE,customType:n,customId:!!e,tag:i||""};Zx=a,Xx[a.id]=a,Kx[Jx]=a.id,vm.debug(Kx),vm.debug("in mergeBranch")},cherryPick:function(t,e,n){if(vm.debug("Entering cherryPick:",t,e,n),t=Mm.sanitizeText(t,nx()),e=Mm.sanitizeText(e,nx()),n=Mm.sanitizeText(n,nx()),!t||void 0===Xx[t]){let n=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}let i=Xx[t],r=i.branch;if(i.type===cv.MERGE){let n=new Error('Incorrect usage of "cherryPick". Source commit should not be a merge commit');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}if(!e||void 0===Xx[e]){if(r===Jx){let n=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}const s=Xx[Kx[Jx]];if(void 0===s||!s){let n=new Error('Incorrect usage of "cherry-pick". Current branch ('+Jx+")has no commits");throw n.hash={text:"cherryPick "+t+" "+e,token:"cherryPick "+t+" "+e,line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["cherry-pick abc"]},n}const a={id:ev+"-"+nv(),message:"cherry-picked "+i+" into "+Jx,seq:ev++,parents:[null==Zx?null:Zx.id,i.id],branch:Jx,type:cv.CHERRY_PICK,tag:null!=n?n:"cherry-pick:"+i.id};Zx=a,Xx[a.id]=a,Kx[Jx]=a.id,vm.debug(Kx),vm.debug("in cherryPick")}},checkout:rv,prettyPrint:function(){vm.debug(Xx);av([ov()[0]])},clear:function(){Xx={},Zx=null;let t=nx().gitGraph.mainBranchName,e=nx().gitGraph.mainBranchOrder;Kx={},Kx[t]=null,Qx={},Qx[t]={name:t,order:e},Jx=t,ev=0,Yx()},getBranchesAsObjArray:function(){const t=Object.values(Qx).map(((t,e)=>null!==t.order?t:{...t,order:parseFloat(`0.${e}`,10)})).sort(((t,e)=>t.order-e.order)).map((({name:t})=>({name:t})));return t},getBranches:function(){return Kx},getCommits:function(){return Xx},getCommitsArray:ov,getCurrentBranch:function(){return Jx},getDirection:function(){return tv},getHead:function(){return Zx},setAccTitle:jx,getAccTitle:zx,getAccDescription:Wx,setAccDescription:Ux,setDiagramTitle:Hx,getDiagramTitle:qx,commitType:cv};let hv={};const uv=0,dv=1,fv=2,pv=3,gv=4;let yv={},mv={},bv=[],_v=0;const xv=(t,e,n)=>{const i=Sx().gitGraph,r=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let a=0;Object.keys(e).sort(((t,n)=>e[t].seq-e[n].seq)).forEach((t=>{const o=e[t],c=yv[o.branch].pos,l=a+10;if(n){let t,e=void 0!==o.customType&&""!==o.customType?o.customType:o.type;switch(e){case uv:t="commit-normal";break;case dv:t="commit-reverse";break;case fv:t="commit-highlight";break;case pv:t="commit-merge";break;case gv:t="commit-cherry-pick";break;default:t="commit-normal"}if(e===fv){const e=r.append("rect");e.attr("x",l-10),e.attr("y",c-10),e.attr("height",20),e.attr("width",20),e.attr("class",`commit ${o.id} commit-highlight${yv[o.branch].index%8} ${t}-outer`),r.append("rect").attr("x",l-6).attr("y",c-6).attr("height",12).attr("width",12).attr("class",`commit ${o.id} commit${yv[o.branch].index%8} ${t}-inner`)}else if(e===gv)r.append("circle").attr("cx",l).attr("cy",c).attr("r",10).attr("class",`commit ${o.id} ${t}`),r.append("circle").attr("cx",l-3).attr("cy",c+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),r.append("circle").attr("cx",l+3).attr("cy",c+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${o.id} ${t}`),r.append("line").attr("x1",l+3).attr("y1",c+1).attr("x2",l).attr("y2",c-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`),r.append("line").attr("x1",l-3).attr("y1",c+1).attr("x2",l).attr("y2",c-5).attr("stroke","#fff").attr("class",`commit ${o.id} ${t}`);else{const n=r.append("circle");if(n.attr("cx",l),n.attr("cy",c),n.attr("r",o.type===pv?9:10),n.attr("class",`commit ${o.id} commit${yv[o.branch].index%8}`),e===pv){const e=r.append("circle");e.attr("cx",l),e.attr("cy",c),e.attr("r",6),e.attr("class",`commit ${t} ${o.id} commit${yv[o.branch].index%8}`)}if(e===dv){r.append("path").attr("d",`M ${l-5},${c-5}L${l+5},${c+5}M${l-5},${c+5}L${l+5},${c-5}`).attr("class",`commit ${t} ${o.id} commit${yv[o.branch].index%8}`)}}}if(mv[o.id]={x:a+10,y:c},n){const t=4,e=2;if(o.type!==gv&&(o.customId&&o.type===pv||o.type!==pv)&&i.showCommitLabel){const t=s.append("g"),n=t.insert("rect").attr("class","commit-label-bkg"),r=t.append("text").attr("x",a).attr("y",c+25).attr("class","commit-label").text(o.id);let l=r.node().getBBox();if(n.attr("x",a+10-l.width/2-e).attr("y",c+13.5).attr("width",l.width+2*e).attr("height",l.height+2*e),r.attr("x",a+10-l.width/2),i.rotateCommitLabel){let e=-7.5-(l.width+10)/25*9.5,n=10+l.width/25*8.5;t.attr("transform","translate("+e+", "+n+") rotate("+"-45, "+a+", "+c+")")}}if(o.tag){const n=s.insert("polygon"),i=s.append("circle"),r=s.append("text").attr("y",c-16).attr("class","tag-label").text(o.tag);let l=r.node().getBBox();r.attr("x",a+10-l.width/2);const h=l.height/2,u=c-19.2;n.attr("class","tag-label-bkg").attr("points",`\n          ${a-l.width/2-t/2},${u+e}\n          ${a-l.width/2-t/2},${u-e}\n          ${a+10-l.width/2-t},${u-h-e}\n          ${a+10+l.width/2+t},${u-h-e}\n          ${a+10+l.width/2+t},${u+h+e}\n          ${a+10-l.width/2-t},${u+h+e}`),i.attr("cx",a-l.width/2+t/2).attr("cy",u).attr("r",1.5).attr("class","tag-hole")}}a+=50,a>_v&&(_v=a)}))},vv=(t,e,n=0)=>{const i=t+Math.abs(t-e)/2;if(n>5)return i;if(bv.every((t=>Math.abs(t-i)>=10)))return bv.push(i),i;const r=Math.abs(t-e);return vv(t,e-r/5,n+1)},kv=(t,e,n,i)=>{const r=mv[e.id],s=mv[n.id],a=((t,e,n)=>Object.keys(n).filter((i=>n[i].branch===e.branch&&n[i].seq>t.seq&&n[i].seq<e.seq)).length>0)(e,n,i);let o,c="",l="",h=0,u=0,d=yv[n.branch].index;if(a){c="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",h=10,u=10,d=yv[n.branch].index;const t=r.y<s.y?vv(r.y,s.y):vv(s.y,r.y);o=r.y<s.y?`M ${r.x} ${r.y} L ${r.x} ${t-h} ${c} ${r.x+u} ${t} L ${s.x-h} ${t} ${l} ${s.x} ${t+u} L ${s.x} ${s.y}`:`M ${r.x} ${r.y} L ${r.x} ${t+h} ${l} ${r.x+u} ${t} L ${s.x-h} ${t} ${c} ${s.x} ${t-u} L ${s.x} ${s.y}`}else r.y<s.y&&(c="A 20 20, 0, 0, 0,",h=20,u=20,d=yv[n.branch].index,o=`M ${r.x} ${r.y} L ${r.x} ${s.y-h} ${c} ${r.x+u} ${s.y} L ${s.x} ${s.y}`),r.y>s.y&&(c="A 20 20, 0, 0, 0,",h=20,u=20,d=yv[e.branch].index,o=`M ${r.x} ${r.y} L ${s.x-h} ${r.y} ${c} ${s.x} ${r.y-u} L ${s.x} ${s.y}`),r.y===s.y&&(d=yv[e.branch].index,o=`M ${r.x} ${r.y} L ${r.x} ${s.y-h} ${c} ${r.x+u} ${s.y} L ${s.x} ${s.y}`);t.append("path").attr("d",o).attr("class","arrow arrow"+d%8)},wv=(t,e)=>{const n=Sx().gitGraph,i=t.append("g");e.forEach(((t,e)=>{const r=e%8,s=yv[t.name].pos,a=i.append("line");a.attr("x1",0),a.attr("y1",s),a.attr("x2",_v),a.attr("y2",s),a.attr("class","branch branch"+r),bv.push(s);const o=(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");let n=[];n="string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(t)?t:[];for(const t of n){const n=document.createElementNS("http://www.w3.org/2000/svg","tspan");n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.setAttribute("dy","1em"),n.setAttribute("x","0"),n.setAttribute("class","row"),n.textContent=t.trim(),e.appendChild(n)}return e})(t.name),c=i.insert("rect"),l=i.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+r);l.node().appendChild(o);let h=o.getBBox();c.attr("class","branchLabelBkg label"+r).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===n.rotateCommitLabel?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4),l.attr("transform","translate("+(-h.width-14-(!0===n.rotateCommitLabel?30:0))+", "+(s-h.height/2-1)+")"),c.attr("transform","translate(-19, "+(s-h.height/2)+")")}))},Tv={draw:function(t,e,n,i){var r;yv={},mv={},hv={},_v=0,bv=[];const s=Sx(),a=s.gitGraph;vm.debug("in gitgraph renderer",t+"\n","id:",e,n),hv=i.db.getCommits();const o=i.db.getBranchesAsObjArray();let c=0;o.forEach(((t,e)=>{yv[t.name]={pos:c,index:e},c+=50+(a.rotateCommitLabel?40:0)}));const l=Fa(`[id="${e}"]`);xv(l,hv,!1),a.showBranches&&wv(l,o),((t,e)=>{const n=t.append("g").attr("class","commit-arrows");Object.keys(e).forEach((t=>{const i=e[t];i.parents&&i.parents.length>0&&i.parents.forEach((t=>{kv(n,e[t],i,e)}))}))})(l,hv),xv(l,hv,!0),q_.insertTitle(l,"gitTitleText",a.titleTopMargin,i.db.getDiagramTitle()),Dx(void 0,l,a.diagramPadding,null!=(r=a.useMaxWidth)?r:s.useMaxWidth)}},Cv=t=>`\n  .commit-id,\n  .commit-msg,\n  .branch-label {\n    fill: lightgrey;\n    color: lightgrey;\n    font-family: 'trebuchet ms', verdana, arial, sans-serif;\n    font-family: var(--mermaid-font-family);\n  }\n  ${[0,1,2,3,4,5,6,7].map((e=>`\n        .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n        .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n        .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n        .label${e}  { fill: ${t["git"+e]}; }\n        .arrow${e} { stroke: ${t["git"+e]}; }\n        `)).join("\n")}\n\n  .branch {\n    stroke-width: 1;\n    stroke: ${t.lineColor};\n    stroke-dasharray: 2;\n  }\n  .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n  .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n  .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n  .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n  .tag-hole { fill: ${t.textColor}; }\n\n  .commit-merge {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n  }\n  .commit-reverse {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n    stroke-width: 3;\n  }\n  .commit-highlight-outer {\n  }\n  .commit-highlight-inner {\n    stroke: ${t.primaryColor};\n    fill: ${t.primaryColor};\n  }\n\n  .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n  .gitTitleText {\n    text-anchor: middle;\n    font-size: 18px;\n    fill: ${t.textColor};\n  }\n  }\n`;var Ev=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,6],i=[1,7],r=[1,8],s=[1,9],a=[1,16],o=[1,11],l=[1,12],h=[1,13],u=[1,14],d=[1,15],f=[1,27],p=[1,33],g=[1,34],y=[1,35],m=[1,36],b=[1,37],_=[1,72],x=[1,73],v=[1,74],k=[1,75],w=[1,76],T=[1,77],C=[1,78],E=[1,38],S=[1,39],A=[1,40],D=[1,41],L=[1,42],O=[1,43],M=[1,44],B=[1,45],N=[1,46],I=[1,47],F=[1,48],R=[1,49],$=[1,50],P=[1,51],Y=[1,52],j=[1,53],z=[1,54],U=[1,55],W=[1,56],H=[1,57],q=[1,59],V=[1,60],G=[1,61],X=[1,62],Z=[1,63],Q=[1,64],K=[1,65],J=[1,66],tt=[1,67],et=[1,68],nt=[1,69],it=[24,52],rt=[24,44,46,47,48,49,50,51,52,54,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],st=[15,24,44,46,47,48,49,50,51,52,54,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],at=[1,94],ot=[1,95],ct=[1,96],lt=[1,97],ht=[15,24,52],ut=[7,8,9,10,18,22,25,26,27,28],dt=[15,24,43,52],ft=[15,24,43,52,86,87,89,90],pt=[15,43],gt=[44,46,47,48,49,50,51,54,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],yt={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,directive:6,direction_tb:7,direction_bt:8,direction_rl:9,direction_lr:10,graphConfig:11,openDirective:12,typeDirective:13,closeDirective:14,NEWLINE:15,":":16,argDirective:17,open_directive:18,type_directive:19,arg_directive:20,close_directive:21,C4_CONTEXT:22,statements:23,EOF:24,C4_CONTAINER:25,C4_COMPONENT:26,C4_DYNAMIC:27,C4_DEPLOYMENT:28,otherStatements:29,diagramStatements:30,otherStatement:31,title:32,accDescription:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,boundaryStatement:39,boundaryStartStatement:40,boundaryStopStatement:41,boundaryStart:42,LBRACE:43,ENTERPRISE_BOUNDARY:44,attributes:45,SYSTEM_BOUNDARY:46,BOUNDARY:47,CONTAINER_BOUNDARY:48,NODE:49,NODE_L:50,NODE_R:51,RBRACE:52,diagramStatement:53,PERSON:54,PERSON_EXT:55,SYSTEM:56,SYSTEM_DB:57,SYSTEM_QUEUE:58,SYSTEM_EXT:59,SYSTEM_EXT_DB:60,SYSTEM_EXT_QUEUE:61,CONTAINER:62,CONTAINER_DB:63,CONTAINER_QUEUE:64,CONTAINER_EXT:65,CONTAINER_EXT_DB:66,CONTAINER_EXT_QUEUE:67,COMPONENT:68,COMPONENT_DB:69,COMPONENT_QUEUE:70,COMPONENT_EXT:71,COMPONENT_EXT_DB:72,COMPONENT_EXT_QUEUE:73,REL:74,BIREL:75,REL_U:76,REL_D:77,REL_L:78,REL_R:79,REL_B:80,REL_INDEX:81,UPDATE_EL_STYLE:82,UPDATE_REL_STYLE:83,UPDATE_LAYOUT_CONFIG:84,attribute:85,STR:86,STR_KEY:87,STR_VALUE:88,ATTRIBUTE:89,ATTRIBUTE_EMPTY:90,$accept:0,$end:1},terminals_:{2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 4:i.setDirection("TB");break;case 5:i.setDirection("BT");break;case 6:i.setDirection("RL");break;case 7:i.setDirection("LR");break;case 11:i.parseDirective("%%{","open_directive");break;case 12:break;case 13:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 14:i.parseDirective("}%%","close_directive","c4Context");break;case 15:case 16:case 17:case 18:case 19:i.setC4Type(s[o-3]);break;case 26:i.setTitle(s[o].substring(6)),this.$=s[o].substring(6);break;case 27:i.setAccDescription(s[o].substring(15)),this.$=s[o].substring(15);break;case 28:this.$=s[o].trim(),i.setTitle(this.$);break;case 29:case 30:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 35:case 36:s[o].splice(2,0,"ENTERPRISE"),i.addPersonOrSystemBoundary(...s[o]),this.$=s[o];break;case 37:i.addPersonOrSystemBoundary(...s[o]),this.$=s[o];break;case 38:s[o].splice(2,0,"CONTAINER"),i.addContainerBoundary(...s[o]),this.$=s[o];break;case 39:i.addDeploymentNode("node",...s[o]),this.$=s[o];break;case 40:i.addDeploymentNode("nodeL",...s[o]),this.$=s[o];break;case 41:i.addDeploymentNode("nodeR",...s[o]),this.$=s[o];break;case 42:i.popBoundaryParseStack();break;case 46:i.addPersonOrSystem("person",...s[o]),this.$=s[o];break;case 47:i.addPersonOrSystem("external_person",...s[o]),this.$=s[o];break;case 48:i.addPersonOrSystem("system",...s[o]),this.$=s[o];break;case 49:i.addPersonOrSystem("system_db",...s[o]),this.$=s[o];break;case 50:i.addPersonOrSystem("system_queue",...s[o]),this.$=s[o];break;case 51:i.addPersonOrSystem("external_system",...s[o]),this.$=s[o];break;case 52:i.addPersonOrSystem("external_system_db",...s[o]),this.$=s[o];break;case 53:i.addPersonOrSystem("external_system_queue",...s[o]),this.$=s[o];break;case 54:i.addContainer("container",...s[o]),this.$=s[o];break;case 55:i.addContainer("container_db",...s[o]),this.$=s[o];break;case 56:i.addContainer("container_queue",...s[o]),this.$=s[o];break;case 57:i.addContainer("external_container",...s[o]),this.$=s[o];break;case 58:i.addContainer("external_container_db",...s[o]),this.$=s[o];break;case 59:i.addContainer("external_container_queue",...s[o]),this.$=s[o];break;case 60:i.addComponent("component",...s[o]),this.$=s[o];break;case 61:i.addComponent("component_db",...s[o]),this.$=s[o];break;case 62:i.addComponent("component_queue",...s[o]),this.$=s[o];break;case 63:i.addComponent("external_component",...s[o]),this.$=s[o];break;case 64:i.addComponent("external_component_db",...s[o]),this.$=s[o];break;case 65:i.addComponent("external_component_queue",...s[o]),this.$=s[o];break;case 67:i.addRel("rel",...s[o]),this.$=s[o];break;case 68:i.addRel("birel",...s[o]),this.$=s[o];break;case 69:i.addRel("rel_u",...s[o]),this.$=s[o];break;case 70:i.addRel("rel_d",...s[o]),this.$=s[o];break;case 71:i.addRel("rel_l",...s[o]),this.$=s[o];break;case 72:i.addRel("rel_r",...s[o]),this.$=s[o];break;case 73:i.addRel("rel_b",...s[o]),this.$=s[o];break;case 74:s[o].splice(0,1),i.addRel("rel",...s[o]),this.$=s[o];break;case 75:i.updateElStyle("update_el_style",...s[o]),this.$=s[o];break;case 76:i.updateRelStyle("update_rel_style",...s[o]),this.$=s[o];break;case 77:i.updateLayoutConfig("update_layout_config",...s[o]),this.$=s[o];break;case 78:this.$=[s[o]];break;case 79:s[o].unshift(s[o-1]),this.$=s[o];break;case 80:case 82:this.$=s[o].trim();break;case 81:let t={};t[s[o-1].trim()]=s[o].trim(),this.$=t;break;case 83:this.$=""}},table:[{3:1,4:2,5:3,6:4,7:n,8:i,9:r,10:s,11:5,12:10,18:a,22:o,25:l,26:h,27:u,28:d},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:n,8:i,9:r,10:s,11:5,12:10,18:a,22:o,25:l,26:h,27:u,28:d},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:f},e([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:p,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:79,29:29,30:30,31:31,32:p,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:80,29:29,30:30,31:31,32:p,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:81,29:29,30:30,31:31,32:p,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{23:82,29:29,30:30,31:31,32:p,33:g,34:y,36:m,38:b,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},e(it,[2,20],{53:32,39:58,40:70,42:71,30:87,44:_,46:x,47:v,48:k,49:w,50:T,51:C,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt}),e(it,[2,21]),e(rt,[2,23],{15:[1,88]}),e(it,[2,43],{15:[1,89]}),e(st,[2,26]),e(st,[2,27]),{35:[1,90]},{37:[1,91]},e(st,[2,30]),{45:92,85:93,86:at,87:ot,89:ct,90:lt},{45:98,85:93,86:at,87:ot,89:ct,90:lt},{45:99,85:93,86:at,87:ot,89:ct,90:lt},{45:100,85:93,86:at,87:ot,89:ct,90:lt},{45:101,85:93,86:at,87:ot,89:ct,90:lt},{45:102,85:93,86:at,87:ot,89:ct,90:lt},{45:103,85:93,86:at,87:ot,89:ct,90:lt},{45:104,85:93,86:at,87:ot,89:ct,90:lt},{45:105,85:93,86:at,87:ot,89:ct,90:lt},{45:106,85:93,86:at,87:ot,89:ct,90:lt},{45:107,85:93,86:at,87:ot,89:ct,90:lt},{45:108,85:93,86:at,87:ot,89:ct,90:lt},{45:109,85:93,86:at,87:ot,89:ct,90:lt},{45:110,85:93,86:at,87:ot,89:ct,90:lt},{45:111,85:93,86:at,87:ot,89:ct,90:lt},{45:112,85:93,86:at,87:ot,89:ct,90:lt},{45:113,85:93,86:at,87:ot,89:ct,90:lt},{45:114,85:93,86:at,87:ot,89:ct,90:lt},{45:115,85:93,86:at,87:ot,89:ct,90:lt},{45:116,85:93,86:at,87:ot,89:ct,90:lt},e(ht,[2,66]),{45:117,85:93,86:at,87:ot,89:ct,90:lt},{45:118,85:93,86:at,87:ot,89:ct,90:lt},{45:119,85:93,86:at,87:ot,89:ct,90:lt},{45:120,85:93,86:at,87:ot,89:ct,90:lt},{45:121,85:93,86:at,87:ot,89:ct,90:lt},{45:122,85:93,86:at,87:ot,89:ct,90:lt},{45:123,85:93,86:at,87:ot,89:ct,90:lt},{45:124,85:93,86:at,87:ot,89:ct,90:lt},{45:125,85:93,86:at,87:ot,89:ct,90:lt},{45:126,85:93,86:at,87:ot,89:ct,90:lt},{45:127,85:93,86:at,87:ot,89:ct,90:lt},{30:128,39:58,40:70,42:71,44:_,46:x,47:v,48:k,49:w,50:T,51:C,53:32,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt},{15:[1,130],43:[1,129]},{45:131,85:93,86:at,87:ot,89:ct,90:lt},{45:132,85:93,86:at,87:ot,89:ct,90:lt},{45:133,85:93,86:at,87:ot,89:ct,90:lt},{45:134,85:93,86:at,87:ot,89:ct,90:lt},{45:135,85:93,86:at,87:ot,89:ct,90:lt},{45:136,85:93,86:at,87:ot,89:ct,90:lt},{45:137,85:93,86:at,87:ot,89:ct,90:lt},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},e(ut,[2,9]),{14:142,21:f},{21:[2,13]},{1:[2,15]},e(it,[2,22]),e(rt,[2,24],{31:31,29:143,32:p,33:g,34:y,36:m,38:b}),e(it,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:p,33:g,34:y,36:m,38:b,44:_,46:x,47:v,48:k,49:w,50:T,51:C,54:E,55:S,56:A,57:D,58:L,59:O,60:M,61:B,62:N,63:I,64:F,65:R,66:$,67:P,68:Y,69:j,70:z,71:U,72:W,73:H,74:q,75:V,76:G,77:X,78:Z,79:Q,80:K,81:J,82:tt,83:et,84:nt}),e(st,[2,28]),e(st,[2,29]),e(ht,[2,46]),e(dt,[2,78],{85:93,45:145,86:at,87:ot,89:ct,90:lt}),e(ft,[2,80]),{88:[1,146]},e(ft,[2,82]),e(ft,[2,83]),e(ht,[2,47]),e(ht,[2,48]),e(ht,[2,49]),e(ht,[2,50]),e(ht,[2,51]),e(ht,[2,52]),e(ht,[2,53]),e(ht,[2,54]),e(ht,[2,55]),e(ht,[2,56]),e(ht,[2,57]),e(ht,[2,58]),e(ht,[2,59]),e(ht,[2,60]),e(ht,[2,61]),e(ht,[2,62]),e(ht,[2,63]),e(ht,[2,64]),e(ht,[2,65]),e(ht,[2,67]),e(ht,[2,68]),e(ht,[2,69]),e(ht,[2,70]),e(ht,[2,71]),e(ht,[2,72]),e(ht,[2,73]),e(ht,[2,74]),e(ht,[2,75]),e(ht,[2,76]),e(ht,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},e(pt,[2,35]),e(pt,[2,36]),e(pt,[2,37]),e(pt,[2,38]),e(pt,[2,39]),e(pt,[2,40]),e(pt,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},e(rt,[2,25]),e(it,[2,45]),e(dt,[2,79]),e(ft,[2,81]),e(ht,[2,31]),e(ht,[2,42]),e(gt,[2,32]),e(gt,[2,33],{15:[1,152]}),e(ut,[2,10]),e(gt,[2,34])],defaultActions:{2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},mt=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),18;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 10;case 5:return this.begin("type_directive"),19;case 6:return this.popState(),this.begin("arg_directive"),16;case 7:return this.popState(),this.popState(),21;case 8:return 20;case 9:return 32;case 10:return 33;case 11:return this.begin("acc_title"),34;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),36;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 78:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:case 21:case 75:break;case 19:c;break;case 20:return 15;case 22:return 22;case 23:return 25;case 24:return 26;case 25:return 27;case 26:return 28;case 27:return this.begin("person_ext"),55;case 28:return this.begin("person"),54;case 29:return this.begin("system_ext_queue"),61;case 30:return this.begin("system_ext_db"),60;case 31:return this.begin("system_ext"),59;case 32:return this.begin("system_queue"),58;case 33:return this.begin("system_db"),57;case 34:return this.begin("system"),56;case 35:return this.begin("boundary"),47;case 36:return this.begin("enterprise_boundary"),44;case 37:return this.begin("system_boundary"),46;case 38:return this.begin("container_ext_queue"),67;case 39:return this.begin("container_ext_db"),66;case 40:return this.begin("container_ext"),65;case 41:return this.begin("container_queue"),64;case 42:return this.begin("container_db"),63;case 43:return this.begin("container"),62;case 44:return this.begin("container_boundary"),48;case 45:return this.begin("component_ext_queue"),73;case 46:return this.begin("component_ext_db"),72;case 47:return this.begin("component_ext"),71;case 48:return this.begin("component_queue"),70;case 49:return this.begin("component_db"),69;case 50:return this.begin("component"),68;case 51:case 52:return this.begin("node"),49;case 53:return this.begin("node_l"),50;case 54:return this.begin("node_r"),51;case 55:return this.begin("rel"),74;case 56:return this.begin("birel"),75;case 57:case 58:return this.begin("rel_u"),76;case 59:case 60:return this.begin("rel_d"),77;case 61:case 62:return this.begin("rel_l"),78;case 63:case 64:return this.begin("rel_r"),79;case 65:return this.begin("rel_b"),80;case 66:return this.begin("rel_index"),81;case 67:return this.begin("update_el_style"),82;case 68:return this.begin("update_rel_style"),83;case 69:return this.begin("update_layout_config"),84;case 70:return"EOF_IN_STRUCT";case 71:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 72:this.begin("attribute");break;case 73:case 84:this.popState(),this.popState();break;case 74:case 76:return 90;case 77:this.begin("string");break;case 79:case 85:return"STR";case 80:this.begin("string_kv");break;case 81:return this.begin("string_kv_key"),"STR_KEY";case 82:this.popState(),this.begin("string_kv_value");break;case 83:return"STR_VALUE";case 86:return"LBRACE";case 87:return"RBRACE";case 88:return"SPACE";case 89:return"EOL";case 90:return 24}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\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:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},string_kv_value:{rules:[83,84],inclusive:!1},string_kv_key:{rules:[82],inclusive:!1},string_kv:{rules:[81],inclusive:!1},string:{rules:[78,79],inclusive:!1},attribute:{rules:[73,74,75,76,77,80,85],inclusive:!1},update_layout_config:{rules:[70,71,72,73],inclusive:!1},update_rel_style:{rules:[70,71,72,73],inclusive:!1},update_el_style:{rules:[70,71,72,73],inclusive:!1},rel_b:{rules:[70,71,72,73],inclusive:!1},rel_r:{rules:[70,71,72,73],inclusive:!1},rel_l:{rules:[70,71,72,73],inclusive:!1},rel_d:{rules:[70,71,72,73],inclusive:!1},rel_u:{rules:[70,71,72,73],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[70,71,72,73],inclusive:!1},node_r:{rules:[70,71,72,73],inclusive:!1},node_l:{rules:[70,71,72,73],inclusive:!1},node:{rules:[70,71,72,73],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[70,71,72,73],inclusive:!1},component_ext_queue:{rules:[],inclusive:!1},component_ext_db:{rules:[70,71,72,73],inclusive:!1},component_ext:{rules:[70,71,72,73],inclusive:!1},component_queue:{rules:[70,71,72,73],inclusive:!1},component_db:{rules:[70,71,72,73],inclusive:!1},component:{rules:[70,71,72,73],inclusive:!1},container_boundary:{rules:[70,71,72,73],inclusive:!1},container_ext_queue:{rules:[],inclusive:!1},container_ext_db:{rules:[70,71,72,73],inclusive:!1},container_ext:{rules:[70,71,72,73],inclusive:!1},container_queue:{rules:[70,71,72,73],inclusive:!1},container_db:{rules:[70,71,72,73],inclusive:!1},container:{rules:[70,71,72,73],inclusive:!1},birel:{rules:[70,71,72,73],inclusive:!1},system_boundary:{rules:[70,71,72,73],inclusive:!1},enterprise_boundary:{rules:[70,71,72,73],inclusive:!1},boundary:{rules:[70,71,72,73],inclusive:!1},system_ext_queue:{rules:[70,71,72,73],inclusive:!1},system_ext_db:{rules:[70,71,72,73],inclusive:!1},system_ext:{rules:[70,71,72,73],inclusive:!1},system_queue:{rules:[70,71,72,73],inclusive:!1},system_db:{rules:[70,71,72,73],inclusive:!1},system:{rules:[70,71,72,73],inclusive:!1},person_ext:{rules:[70,71,72,73],inclusive:!1},person:{rules:[70,71,72,73],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,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,65,66,67,68,69,86,87,88,89,90],inclusive:!0}}},t);function bt(){this.yy={}}return yt.lexer=mt,bt.prototype=yt,yt.Parser=bt,new bt}();Ev.parser=Ev;const Sv=Ev,Av=t=>null!==t.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/);let Dv=[],Lv=[""],Ov="global",Mv="",Bv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Nv=[],Iv="",Fv=!1,Rv=4,$v=2;var Pv;const Yv=function(t){return null==t?Dv:Dv.filter((e=>e.parentBoundary===t))},jv=function(){return Fv},zv={addPersonOrSystem:function(t,e,n,i,r,s,a){if(null===e||null===n)return;let o={};const c=Dv.find((t=>t.alias===e));if(c&&e===c.alias?o=c:(o.alias=e,Dv.push(o)),o.label=null==n?{text:""}:{text:n},null==i)o.descr={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]={text:e}}else o.descr={text:i};if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.sprite=r;if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=e}else o.tags=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=e}else o.link=a;o.typeC4Shape={text:t},o.parentBoundary=Ov,o.wrap=jv()},addPersonOrSystemBoundary:function(t,e,n,i,r){if(null===t||null===e)return;let s={};const a=Bv.find((e=>e.alias===t));if(a&&t===a.alias?s=a:(s.alias=t,Bv.push(s)),s.label=null==e?{text:""}:{text:e},null==n)s.type={text:"system"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];s[t]={text:e}}else s.type={text:n};if("object"==typeof i){let[t,e]=Object.entries(i)[0];s[t]=e}else s.tags=i;if("object"==typeof r){let[t,e]=Object.entries(r)[0];s[t]=e}else s.link=r;s.parentBoundary=Ov,s.wrap=jv(),Mv=Ov,Ov=t,Lv.push(Mv)},addContainer:function(t,e,n,i,r,s,a,o){if(null===e||null===n)return;let c={};const l=Dv.find((t=>t.alias===e));if(l&&e===l.alias?c=l:(c.alias=e,Dv.push(c)),c.label=null==n?{text:""}:{text:n},null==i)c.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.techn={text:i};if(null==r)c.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];c[t]={text:e}}else c.descr={text:r};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]=e}else c.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.link=o;c.wrap=jv(),c.typeC4Shape={text:t},c.parentBoundary=Ov},addContainerBoundary:function(t,e,n,i,r){if(null===t||null===e)return;let s={};const a=Bv.find((e=>e.alias===t));if(a&&t===a.alias?s=a:(s.alias=t,Bv.push(s)),s.label=null==e?{text:""}:{text:e},null==n)s.type={text:"container"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];s[t]={text:e}}else s.type={text:n};if("object"==typeof i){let[t,e]=Object.entries(i)[0];s[t]=e}else s.tags=i;if("object"==typeof r){let[t,e]=Object.entries(r)[0];s[t]=e}else s.link=r;s.parentBoundary=Ov,s.wrap=jv(),Mv=Ov,Ov=t,Lv.push(Mv)},addComponent:function(t,e,n,i,r,s,a,o){if(null===e||null===n)return;let c={};const l=Dv.find((t=>t.alias===e));if(l&&e===l.alias?c=l:(c.alias=e,Dv.push(c)),c.label=null==n?{text:""}:{text:n},null==i)c.techn={text:""};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.techn={text:i};if(null==r)c.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];c[t]={text:e}}else c.descr={text:r};if("object"==typeof s){let[t,e]=Object.entries(s)[0];c[t]=e}else c.sprite=s;if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]=e}else c.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.link=o;c.wrap=jv(),c.typeC4Shape={text:t},c.parentBoundary=Ov},addDeploymentNode:function(t,e,n,i,r,s,a,o){if(null===e||null===n)return;let c={};const l=Bv.find((t=>t.alias===e));if(l&&e===l.alias?c=l:(c.alias=e,Bv.push(c)),c.label=null==n?{text:""}:{text:n},null==i)c.type={text:"node"};else if("object"==typeof i){let[t,e]=Object.entries(i)[0];c[t]={text:e}}else c.type={text:i};if(null==r)c.descr={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];c[t]={text:e}}else c.descr={text:r};if("object"==typeof a){let[t,e]=Object.entries(a)[0];c[t]=e}else c.tags=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];c[t]=e}else c.link=o;c.nodeType=t,c.parentBoundary=Ov,c.wrap=jv(),Mv=Ov,Ov=e,Lv.push(Mv)},popBoundaryParseStack:function(){Ov=Mv,Lv.pop(),Mv=Lv.pop(),Lv.push(Mv)},addRel:function(t,e,n,i,r,s,a,o,c){if(null==t||null==e||null==n||null==i)return;let l={};const h=Nv.find((t=>t.from===e&&t.to===n));if(h?l=h:Nv.push(l),l.type=t,l.from=e,l.to=n,l.label={text:i},null==r)l.techn={text:""};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];l[t]={text:e}}else l.techn={text:r};if(null==s)l.descr={text:""};else if("object"==typeof s){let[t,e]=Object.entries(s)[0];l[t]={text:e}}else l.descr={text:s};if("object"==typeof a){let[t,e]=Object.entries(a)[0];l[t]=e}else l.sprite=a;if("object"==typeof o){let[t,e]=Object.entries(o)[0];l[t]=e}else l.tags=o;if("object"==typeof c){let[t,e]=Object.entries(c)[0];l[t]=e}else l.link=c;l.wrap=jv()},updateElStyle:function(t,e,n,i,r,s,a,o,c,l,h){let u=Dv.find((t=>t.alias===e));if(void 0!==u||(u=Bv.find((t=>t.alias===e)),void 0!==u)){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.bgColor=n;if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];u[t]=e}else u.fontColor=i;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.borderColor=r;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];u[t]=e}else u.shadowing=s;if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];u[t]=e}else u.shape=a;if(null!=o)if("object"==typeof o){let[t,e]=Object.entries(o)[0];u[t]=e}else u.sprite=o;if(null!=c)if("object"==typeof c){let[t,e]=Object.entries(c)[0];u[t]=e}else u.techn=c;if(null!=l)if("object"==typeof l){let[t,e]=Object.entries(l)[0];u[t]=e}else u.legendText=l;if(null!=h)if("object"==typeof h){let[t,e]=Object.entries(h)[0];u[t]=e}else u.legendSprite=h}},updateRelStyle:function(t,e,n,i,r,s,a){const o=Nv.find((t=>t.from===e&&t.to===n));if(void 0!==o){if(null!=i)if("object"==typeof i){let[t,e]=Object.entries(i)[0];o[t]=e}else o.textColor=i;if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];o[t]=e}else o.lineColor=r;if(null!=s)if("object"==typeof s){let[t,e]=Object.entries(s)[0];o[t]=parseInt(e)}else o.offsetX=parseInt(s);if(null!=a)if("object"==typeof a){let[t,e]=Object.entries(a)[0];o[t]=parseInt(e)}else o.offsetY=parseInt(a)}},updateLayoutConfig:function(t,e,n){let i=Rv,r=$v;if("object"==typeof e){const t=Object.values(e)[0];i=parseInt(t)}else i=parseInt(e);if("object"==typeof n){const t=Object.values(n)[0];r=parseInt(t)}else r=parseInt(n);i>=1&&(Rv=i),r>=1&&($v=r)},autoWrap:jv,setWrap:function(t){Fv=t},getC4ShapeArray:Yv,getC4Shape:function(t){return Dv.find((e=>e.alias===t))},getC4ShapeKeys:function(t){return Object.keys(Yv(t))},getBoundarys:function(t){return null==t?Bv:Bv.filter((e=>e.parentBoundary===t))},getCurrentBoundaryParse:function(){return Ov},getParentBoundaryParse:function(){return Mv},getRels:function(){return Nv},getTitle:function(){return Iv},getC4Type:function(){return Pv},getC4ShapeInRow:function(){return Rv},getC4BoundaryInRow:function(){return $v},setAccTitle:jx,getAccTitle:zx,getAccDescription:Wx,setAccDescription:Ux,parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().c4,clear:function(){Dv=[],Bv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Mv="",Ov="global",Lv=[""],Nv=[],Lv=[""],Iv="",Fv=!1,Rv=4,$v=2},LINETYPE:{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},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:function(t){let e=Em(t,nx());Iv=e},setC4Type:function(t){let e=Em(t,nx());Pv=e}},Uv=function(t,e){const n=t.append("rect");if(n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),"undefined"!==e.attrs&&null!==e.attrs)for(let t in e.attrs)n.attr(t,e.attrs[t]);return"undefined"!==e.class&&n.attr("class",e.class),n},Wv=function(t,n,i,r,s,a){const o=t.append("image");o.attr("width",n),o.attr("height",i),o.attr("x",r),o.attr("y",s);let c=a.startsWith("data:image/png;base64")?a:(0,e.N)(a);o.attr("xlink:href",c)},Hv=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},qv=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),Vv=function(){function t(t,e,n,r,s,a,o){i(e.append("text").attr("x",n+s/2).attr("y",r+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,s,a,o,c){const{fontSize:l,fontFamily:h,fontWeight:u}=c,d=t.split(Mm.lineBreakRegex);for(let t=0;t<d.length;t++){const a=t*l-l*(d.length-1)/2,c=e.append("text").attr("x",n+s/2).attr("y",r).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",l).style("font-weight",u).style("font-family",h);c.append("tspan").attr("dy",a).text(d[t]).attr("alignment-baseline","mathematical"),i(c,o)}}function n(t,n,r,s,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",s).attr("width",a).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,s,a,0,c,l),i(u,c)}function i(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),Gv=function(t,e,n){const i=t.append("g");let r=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 c={x:e.x,y:e.y,fill:r,stroke:s,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Uv(i,c);let l=n.boundaryFont();l.fontWeight="bold",l.fontSize=l.fontSize+2,l.fontColor=a,Vv(n)(e.label.text,i,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},l),e.type&&""!==e.type.text&&(l=n.boundaryFont(),l.fontColor=a,Vv(n)(e.type.text,i,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},l)),e.descr&&""!==e.descr.text&&(l=n.boundaryFont(),l.fontSize=l.fontSize-2,l.fontColor=a,Vv(n)(e.descr.text,i,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},l))},Xv=function(t,e,n){let i=e.bgColor?e.bgColor:n[e.typeC4Shape.text+"_bg_color"],r=e.borderColor?e.borderColor:n[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="}const o=t.append("g");o.attr("class","person-man");const c=Hv();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":c.x=e.x,c.y=e.y,c.fill=i,c.width=e.width,c.height=e.height,c.style="stroke:"+r+";stroke-width:0.5;",c.rx=2.5,c.ry=2.5,Uv(o,c);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",i).attr("stroke-width","0.5").attr("stroke",r).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",r).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",i).attr("stroke-width","0.5").attr("stroke",r).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",r).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))}let l=qv(n,e.typeC4Shape.text);switch(o.append("text").attr("fill",s).attr("font-family",l.fontFamily).attr("font-size",l.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":Wv(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,a)}let h=n[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=s,Vv(n)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:s},h),h=n[e.typeC4Shape.text+"Font"](),h.fontColor=s,e.thchn&&""!==e.thchn.text?Vv(n)(e.thchn.text,o,e.x,e.y+e.thchn.Y,e.width,e.height,{fill:s,"font-style":"italic"},h):e.type&&""!==e.type.text&&Vv(n)(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=n.personFont(),h.fontColor=s,Vv(n)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:s},h)),e.height},Zv=(t,e,n)=>{const i=t.append("g");let r=0;for(let t of e){let e=t.textColor?t.textColor:"#444444",s=t.lineColor?t.lineColor:"#444444",a=t.offsetX?parseInt(t.offsetX):0,o=t.offsetY?parseInt(t.offsetY):0,c="";if(0===r){let e=i.append("line");e.attr("x1",t.startPoint.x),e.attr("y1",t.startPoint.y),e.attr("x2",t.endPoint.x),e.attr("y2",t.endPoint.y),e.attr("stroke-width","1"),e.attr("stroke",s),e.style("fill","none"),"rel_b"!==t.type&&e.attr("marker-end","url("+c+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+c+"#arrowend)"),r=-1}else{let e=i.append("path");e.attr("fill","none").attr("stroke-width","1").attr("stroke",s).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",t.startPoint.x).replaceAll("starty",t.startPoint.y).replaceAll("controlx",t.startPoint.x+(t.endPoint.x-t.startPoint.x)/2-(t.endPoint.x-t.startPoint.x)/4).replaceAll("controly",t.startPoint.y+(t.endPoint.y-t.startPoint.y)/2).replaceAll("stopx",t.endPoint.x).replaceAll("stopy",t.endPoint.y)),"rel_b"!==t.type&&e.attr("marker-end","url("+c+"#arrowhead)"),"birel"!==t.type&&"rel_b"!==t.type||e.attr("marker-start","url("+c+"#arrowend)")}let l=n.messageFont();Vv(n)(t.label.text,i,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+a,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+o,t.label.width,t.label.height,{fill:e},l),t.techn&&""!==t.techn.text&&(l=n.messageFont(),Vv(n)("["+t.techn.text+"]",i,Math.min(t.startPoint.x,t.endPoint.x)+Math.abs(t.endPoint.x-t.startPoint.x)/2+a,Math.min(t.startPoint.y,t.endPoint.y)+Math.abs(t.endPoint.y-t.startPoint.y)/2+n.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},l))}},Qv=function(t){t.append("defs").append("marker").attr("id","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")},Kv=function(t){t.append("defs").append("marker").attr("id","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")},Jv=function(t){t.append("defs").append("marker").attr("id","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")},tk=function(t){const e=t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);e.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"),e.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")},ek=function(t){t.append("defs").append("symbol").attr("id","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")},nk=function(t){t.append("defs").append("symbol").attr("id","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")},ik=function(t){t.append("defs").append("symbol").attr("id","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")};e.N;let rk=0,sk=0,ak=4,ok=2;Ev.yy=zv;let ck={};class lk{constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,hk(t.db.getConfig())}setData(t,e,n,i){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let e=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+t.margin:this.nextData.stopx+2*t.margin,n=e+t.width,i=this.nextData.starty+2*t.margin,r=i+t.height;(e>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>ak)&&(e=this.nextData.startx+t.margin+ck.nextLinePaddingX,i=this.nextData.stopy+2*t.margin,this.nextData.stopx=n=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=r=i+t.height,this.nextData.cnt=1),t.x=e,t.y=i,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",r,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",r,Math.max)}init(t){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},hk(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}}const hk=function(t){C_(ck,t),t.fontFamily&&(ck.personFontFamily=ck.systemFontFamily=ck.messageFontFamily=t.fontFamily),t.fontSize&&(ck.personFontSize=ck.systemFontSize=ck.messageFontSize=t.fontSize),t.fontWeight&&(ck.personFontWeight=ck.systemFontWeight=ck.messageFontWeight=t.fontWeight)},uk=(t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),dk=t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight});function fk(t,e,n,i,r){if(!e[t].width)if(n)e[t].text=R_(e[t].text,r,i),e[t].textLines=e[t].text.split(Mm.lineBreakRegex).length,e[t].width=r,e[t].height=P_(e[t].text,i);else{let n=e[t].text.split(Mm.lineBreakRegex);e[t].textLines=n.length;let r=0;e[t].height=0,e[t].width=0;for(const s of n)e[t].width=Math.max(Y_(s,i),e[t].width),r=P_(s,i),e[t].height=e[t].height+r}}const pk=function(t,e,n){e.x=n.data.startx,e.y=n.data.starty,e.width=n.data.stopx-n.data.startx,e.height=n.data.stopy-n.data.starty,e.label.y=ck.c4ShapeMargin-35;let i=e.wrap&&ck.wrap,r=dk(ck);r.fontSize=r.fontSize+2,r.fontWeight="bold",fk("label",e,i,r,Y_(e.label.text,r)),Gv(t,e,ck)},gk=function(t,e,n,i){let r=0;for(const s of i){r=0;const i=n[s];let a=uk(ck,i.typeC4Shape.text);switch(a.fontSize=a.fontSize-2,i.typeC4Shape.width=Y_("<<"+i.typeC4Shape.text+">>",a),i.typeC4Shape.height=a.fontSize+2,i.typeC4Shape.Y=ck.c4ShapePadding,r=i.typeC4Shape.Y+i.typeC4Shape.height-4,i.image={width:0,height:0,Y:0},i.typeC4Shape.text){case"person":case"external_person":i.image.width=48,i.image.height=48,i.image.Y=r,r=i.image.Y+i.image.height}i.sprite&&(i.image.width=48,i.image.height=48,i.image.Y=r,r=i.image.Y+i.image.height);let o=i.wrap&&ck.wrap,c=ck.width-2*ck.c4ShapePadding,l=uk(ck,i.typeC4Shape.text);if(l.fontSize=l.fontSize+2,l.fontWeight="bold",fk("label",i,o,l,c),i.label.Y=r+8,r=i.label.Y+i.label.height,i.type&&""!==i.type.text){i.type.text="["+i.type.text+"]",fk("type",i,o,uk(ck,i.typeC4Shape.text),c),i.type.Y=r+5,r=i.type.Y+i.type.height}else if(i.techn&&""!==i.techn.text){i.techn.text="["+i.techn.text+"]",fk("techn",i,o,uk(ck,i.techn.text),c),i.techn.Y=r+5,r=i.techn.Y+i.techn.height}let h=r,u=i.label.width;if(i.descr&&""!==i.descr.text){fk("descr",i,o,uk(ck,i.typeC4Shape.text),c),i.descr.Y=r+20,r=i.descr.Y+i.descr.height,u=Math.max(i.label.width,i.descr.width),h=r-5*i.descr.textLines}u+=ck.c4ShapePadding,i.width=Math.max(i.width||ck.width,u,ck.width),i.height=Math.max(i.height||ck.height,h,ck.height),i.margin=i.margin||ck.c4ShapeMargin,t.insert(i),Xv(e,i,ck)}t.bumpLastMargin(ck.c4ShapeMargin)};class yk{constructor(t,e){this.x=t,this.y=e}}let mk=function(t,e){let n=t.x,i=t.y,r=e.x,s=e.y,a=n+t.width/2,o=i+t.height/2,c=Math.abs(n-r),l=Math.abs(i-s),h=l/c,u=t.height/t.width,d=null;return i==s&&n<r?d=new yk(n+t.width,o):i==s&&n>r?d=new yk(n,o):n==r&&i<s?d=new yk(a,i+t.height):n==r&&i>s&&(d=new yk(a,i)),n>r&&i<s?d=u>=h?new yk(n,o+h*t.width/2):new yk(a-c/l*t.height/2,i+t.height):n<r&&i<s?d=u>=h?new yk(n+t.width,o+h*t.width/2):new yk(a+c/l*t.height/2,i+t.height):n<r&&i>s?d=u>=h?new yk(n+t.width,o-h*t.width/2):new yk(a+t.height/2*c/l,i):n>r&&i>s&&(d=u>=h?new yk(n,o-t.width/2*h):new yk(a-t.height/2*c/l,i)),d},bk=function(t,e){let n={x:0,y:0};n.x=e.x+e.width/2,n.y=e.y+e.height/2;let i=mk(t,n);return n.x=t.x+t.width/2,n.y=t.y+t.height/2,{startPoint:i,endPoint:mk(e,n)}};function _k(t,e,n,i,r){let s=new lk(r);s.data.widthLimit=n.data.widthLimit/Math.min(ok,i.length);for(let[a,o]of i.entries()){let i=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height);let c=o.wrap&&ck.wrap,l=dk(ck);if(l.fontSize=l.fontSize+2,l.fontWeight="bold",fk("label",o,c,l,s.data.widthLimit),o.label.Y=i+8,i=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",fk("type",o,c,dk(ck),s.data.widthLimit),o.type.Y=i+5,i=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=dk(ck);t.fontSize=t.fontSize-2,fk("descr",o,c,t,s.data.widthLimit),o.descr.Y=i+20,i=o.descr.Y+o.descr.height}if(0==a||a%ok==0){let t=n.data.startx+ck.diagramMarginX,e=n.data.stopy+ck.diagramMarginY+i;s.setData(t,t,e,e)}else{let t=s.data.stopx!==s.data.startx?s.data.stopx+ck.diagramMarginX:s.data.startx,e=s.data.starty;s.setData(t,t,e,e)}s.name=o.alias;let h=r.db.getC4ShapeArray(o.alias),u=r.db.getC4ShapeKeys(o.alias);u.length>0&&gk(s,t,h,u),e=o.alias;let d=r.db.getBoundarys(e);d.length>0&&_k(t,e,s,d,r),"global"!==o.alias&&pk(t,o,s),n.data.stopy=Math.max(s.data.stopy+ck.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(s.data.stopx+ck.c4ShapeMargin,n.data.stopx),rk=Math.max(rk,n.data.stopx),sk=Math.max(sk,n.data.stopy)}}const xk={drawPersonOrSystemArray:gk,drawBoundary:pk,setConf:hk,draw:function(t,e,n,i){ck=nx().c4;const r=nx().securityLevel;let s;"sandbox"===r&&(s=Fa("#i"+e));const a=Fa("sandbox"===r?s.nodes()[0].contentDocument.body:"body");let o=i.db;i.db.setWrap(ck.wrap),ak=o.getC4ShapeInRow(),ok=o.getC4BoundaryInRow(),vm.debug(`C:${JSON.stringify(ck,null,2)}`);const c="sandbox"===r?a.select(`[id="${e}"]`):Fa(`[id="${e}"]`);nk(c),ek(c),ik(c);let l=new lk(i);l.setData(ck.diagramMarginX,ck.diagramMarginX,ck.diagramMarginY,ck.diagramMarginY),l.data.widthLimit=screen.availWidth,rk=ck.diagramMarginX,sk=ck.diagramMarginY;const h=i.db.getTitle();_k(c,"",l,i.db.getBoundarys(""),i),Qv(c),Kv(c),tk(c),Jv(c),function(t,e,n,i){let r=0;for(let t of e){r+=1;let e=t.wrap&&ck.wrap,a={fontFamily:(s=ck).messageFontFamily,fontSize:s.messageFontSize,fontWeight:s.messageFontWeight};"C4Dynamic"===i.db.getC4Type()&&(t.label.text=r+": "+t.label.text);let o=Y_(t.label.text,a);fk("label",t,e,a,o),t.techn&&""!==t.techn.text&&(o=Y_(t.techn.text,a),fk("techn",t,e,a,o)),t.descr&&""!==t.descr.text&&(o=Y_(t.descr.text,a),fk("descr",t,e,a,o));let c=n(t.from),l=n(t.to),h=bk(c,l);t.startPoint=h.startPoint,t.endPoint=h.endPoint}var s;Zv(t,e,ck)}(c,i.db.getRels(),i.db.getC4Shape,i),l.data.stopx=rk,l.data.stopy=sk;const u=l.data;let d=u.stopy-u.starty+2*ck.diagramMarginY;const f=u.stopx-u.startx+2*ck.diagramMarginX;h&&c.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*ck.diagramMarginX).attr("y",u.starty+ck.diagramMarginY),lx(c,d,f,ck.useMaxWidth);const p=h?60:0;c.attr("viewBox",u.startx-ck.diagramMarginX+" -"+(ck.diagramMarginY+p)+" "+f+" "+(d+p)),vm.debug("models:",u)}};var vk=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,3],i=[1,7],r=[1,8],s=[1,9],a=[1,10],o=[1,13],c=[1,12],l=[1,16,25],h=[1,20],u=[1,32],d=[1,33],f=[1,34],p=[1,36],g=[1,39],y=[1,37],m=[1,38],b=[1,44],_=[1,45],x=[1,40],v=[1,41],k=[1,42],w=[1,43],T=[1,48],C=[1,49],E=[1,50],S=[1,51],A=[16,25],D=[1,65],L=[1,66],O=[1,67],M=[1,68],B=[1,69],N=[1,70],I=[1,71],F=[1,80],R=[16,25,32,45,46,54,60,61,62,63,64,65,66,71,73],$=[16,25,30,32,45,46,50,54,60,61,62,63,64,65,66,71,73,88,89,90,91],P=[5,8,9,10,11,16,19,23,25],Y=[54,88,89,90,91],j=[54,65,66,88,89,90,91],z=[54,60,61,62,63,64,88,89,90,91],U=[16,25,32],W=[1,107],H={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statments:5,direction:6,directive:7,direction_tb:8,direction_bt:9,direction_rl:10,direction_lr:11,graphConfig:12,openDirective:13,typeDirective:14,closeDirective:15,NEWLINE:16,":":17,argDirective:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,CLASS_DIAGRAM:23,statements:24,EOF:25,statement:26,className:27,alphaNumToken:28,classLiteralName:29,GENERICTYPE:30,relationStatement:31,LABEL:32,classStatement:33,methodStatement:34,annotationStatement:35,clickStatement:36,cssClassStatement:37,noteStatement:38,acc_title:39,acc_title_value:40,acc_descr:41,acc_descr_value:42,acc_descr_multiline_value:43,CLASS:44,STYLE_SEPARATOR:45,STRUCT_START:46,members:47,STRUCT_STOP:48,ANNOTATION_START:49,ANNOTATION_END:50,MEMBER:51,SEPARATOR:52,relation:53,STR:54,NOTE_FOR:55,noteText:56,NOTE:57,relationType:58,lineType:59,AGGREGATION:60,EXTENSION:61,COMPOSITION:62,DEPENDENCY:63,LOLLIPOP:64,LINE:65,DOTTED_LINE:66,CALLBACK:67,LINK:68,LINK_TARGET:69,CLICK:70,CALLBACK_NAME:71,CALLBACK_ARGS:72,HREF:73,CSSCLASS:74,commentToken:75,textToken:76,graphCodeTokens:77,textNoTagsToken:78,TAGSTART:79,TAGEND:80,"==":81,"--":82,PCT:83,DEFAULT:84,SPACE:85,MINUS:86,keywords:87,UNICODE_TEXT:88,NUM:89,ALPHA:90,BQUOTE_STR:91,$accept:0,$end:1},terminals_:{2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",39:"acc_title",40:"acc_title_value",41:"acc_descr",42:"acc_descr_value",43:"acc_descr_multiline_value",44:"CLASS",45:"STYLE_SEPARATOR",46:"STRUCT_START",48:"STRUCT_STOP",49:"ANNOTATION_START",50:"ANNOTATION_END",51:"MEMBER",52:"SEPARATOR",54:"STR",55:"NOTE_FOR",57:"NOTE",60:"AGGREGATION",61:"EXTENSION",62:"COMPOSITION",63:"DEPENDENCY",64:"LOLLIPOP",65:"LINE",66:"DOTTED_LINE",67:"CALLBACK",68:"LINK",69:"LINK_TARGET",70:"CLICK",71:"CALLBACK_NAME",72:"CALLBACK_ARGS",73:"HREF",74:"CSSCLASS",77:"graphCodeTokens",79:"TAGSTART",80:"TAGEND",81:"==",82:"--",83:"PCT",84:"DEFAULT",85:"SPACE",86:"MINUS",87:"keywords",88:"UNICODE_TEXT",89:"NUM",90:"ALPHA",91:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[47,1],[47,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[38,3],[38,2],[53,3],[53,2],[53,2],[53,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[75,1],[75,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[78,1],[78,1],[78,1],[78,1],[28,1],[28,1],[28,1],[29,1],[56,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 5:i.setDirection("TB");break;case 6:i.setDirection("BT");break;case 7:i.setDirection("RL");break;case 8:i.setDirection("LR");break;case 12:i.parseDirective("%%{","open_directive");break;case 13:i.parseDirective(s[o],"type_directive");break;case 14:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 15:i.parseDirective("}%%","close_directive","class");break;case 20:case 21:this.$=s[o];break;case 22:this.$=s[o-1]+s[o];break;case 23:case 24:this.$=s[o-1]+"~"+s[o];break;case 25:i.addRelation(s[o]);break;case 26:s[o-1].title=i.cleanupLabel(s[o]),i.addRelation(s[o-1]);break;case 35:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 36:case 37:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 38:i.addClass(s[o]);break;case 39:i.addClass(s[o-2]),i.setCssClass(s[o-2],s[o]);break;case 40:i.addClass(s[o-3]),i.addMembers(s[o-3],s[o-1]);break;case 41:i.addClass(s[o-5]),i.setCssClass(s[o-5],s[o-3]),i.addMembers(s[o-5],s[o-1]);break;case 42:i.addAnnotation(s[o],s[o-2]);break;case 43:this.$=[s[o]];break;case 44:s[o].push(s[o-1]),this.$=s[o];break;case 45:case 47:case 48:break;case 46:i.addMember(s[o-1],i.cleanupLabel(s[o]));break;case 49:this.$={id1:s[o-2],id2:s[o],relation:s[o-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:s[o-3],id2:s[o],relation:s[o-1],relationTitle1:s[o-2],relationTitle2:"none"};break;case 51:this.$={id1:s[o-3],id2:s[o],relation:s[o-2],relationTitle1:"none",relationTitle2:s[o-1]};break;case 52:this.$={id1:s[o-4],id2:s[o],relation:s[o-2],relationTitle1:s[o-3],relationTitle2:s[o-1]};break;case 53:i.addNote(s[o],s[o-1]);break;case 54:i.addNote(s[o]);break;case 55:this.$={type1:s[o-2],type2:s[o],lineType:s[o-1]};break;case 56:this.$={type1:"none",type2:s[o],lineType:s[o-1]};break;case 57:this.$={type1:s[o-1],type2:"none",lineType:s[o]};break;case 58:this.$={type1:"none",type2:"none",lineType:s[o]};break;case 59:this.$=i.relationType.AGGREGATION;break;case 60:this.$=i.relationType.EXTENSION;break;case 61:this.$=i.relationType.COMPOSITION;break;case 62:this.$=i.relationType.DEPENDENCY;break;case 63:this.$=i.relationType.LOLLIPOP;break;case 64:this.$=i.lineType.LINE;break;case 65:this.$=i.lineType.DOTTED_LINE;break;case 66:case 72:this.$=s[o-2],i.setClickEvent(s[o-1],s[o]);break;case 67:case 73:this.$=s[o-3],i.setClickEvent(s[o-2],s[o-1]),i.setTooltip(s[o-2],s[o]);break;case 68:case 76:this.$=s[o-2],i.setLink(s[o-1],s[o]);break;case 69:case 77:this.$=s[o-3],i.setLink(s[o-2],s[o-1],s[o]);break;case 70:case 78:this.$=s[o-3],i.setLink(s[o-2],s[o-1]),i.setTooltip(s[o-2],s[o]);break;case 71:case 79:this.$=s[o-4],i.setLink(s[o-3],s[o-2],s[o]),i.setTooltip(s[o-3],s[o-1]);break;case 74:this.$=s[o-3],i.setClickEvent(s[o-2],s[o-1],s[o]);break;case 75:this.$=s[o-4],i.setClickEvent(s[o-3],s[o-2],s[o-1]),i.setTooltip(s[o-3],s[o]);break;case 80:i.setCssClass(s[o-1],s[o])}},table:[{3:1,4:2,5:n,6:4,7:5,8:i,9:r,10:s,11:a,12:6,13:11,19:o,23:c},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:n,6:4,7:5,8:i,9:r,10:s,11:a,12:6,13:11,19:o,23:c},{1:[2,9]},e(l,[2,5]),e(l,[2,6]),e(l,[2,7]),e(l,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:h},e([17,22],[2,13]),{6:31,7:30,8:i,9:r,10:s,11:a,13:11,19:o,24:21,26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:u,41:d,43:f,44:p,49:g,51:y,52:m,55:b,57:_,67:x,68:v,70:k,74:w,88:T,89:C,90:E,91:S},{16:[1,52]},{18:53,21:[1,54]},{16:[2,15]},{25:[1,55]},{16:[1,56],25:[2,17]},e(A,[2,25],{32:[1,57]}),e(A,[2,27]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),e(A,[2,33]),e(A,[2,34]),{40:[1,58]},{42:[1,59]},e(A,[2,37]),e(A,[2,45],{53:60,58:63,59:64,32:[1,62],54:[1,61],60:D,61:L,62:O,63:M,64:B,65:N,66:I}),{27:72,28:46,29:47,88:T,89:C,90:E,91:S},e(A,[2,47]),e(A,[2,48]),{28:73,88:T,89:C,90:E},{27:74,28:46,29:47,88:T,89:C,90:E,91:S},{27:75,28:46,29:47,88:T,89:C,90:E,91:S},{27:76,28:46,29:47,88:T,89:C,90:E,91:S},{54:[1,77]},{27:78,28:46,29:47,88:T,89:C,90:E,91:S},{54:F,56:79},e(R,[2,20],{28:46,29:47,27:81,30:[1,82],88:T,89:C,90:E,91:S}),e(R,[2,21],{30:[1,83]}),e($,[2,94]),e($,[2,95]),e($,[2,96]),e([16,25,30,32,45,46,54,60,61,62,63,64,65,66,71,73],[2,97]),e(P,[2,10]),{15:84,22:h},{22:[2,14]},{1:[2,16]},{6:31,7:30,8:i,9:r,10:s,11:a,13:11,19:o,24:85,25:[2,18],26:22,27:35,28:46,29:47,31:23,33:24,34:25,35:26,36:27,37:28,38:29,39:u,41:d,43:f,44:p,49:g,51:y,52:m,55:b,57:_,67:x,68:v,70:k,74:w,88:T,89:C,90:E,91:S},e(A,[2,26]),e(A,[2,35]),e(A,[2,36]),{27:86,28:46,29:47,54:[1,87],88:T,89:C,90:E,91:S},{53:88,58:63,59:64,60:D,61:L,62:O,63:M,64:B,65:N,66:I},e(A,[2,46]),{59:89,65:N,66:I},e(Y,[2,58],{58:90,60:D,61:L,62:O,63:M,64:B}),e(j,[2,59]),e(j,[2,60]),e(j,[2,61]),e(j,[2,62]),e(j,[2,63]),e(z,[2,64]),e(z,[2,65]),e(A,[2,38],{45:[1,91],46:[1,92]}),{50:[1,93]},{54:[1,94]},{54:[1,95]},{71:[1,96],73:[1,97]},{28:98,88:T,89:C,90:E},{54:F,56:99},e(A,[2,54]),e(A,[2,98]),e(R,[2,22]),e(R,[2,23]),e(R,[2,24]),{16:[1,100]},{25:[2,19]},e(U,[2,49]),{27:101,28:46,29:47,88:T,89:C,90:E,91:S},{27:102,28:46,29:47,54:[1,103],88:T,89:C,90:E,91:S},e(Y,[2,57],{58:104,60:D,61:L,62:O,63:M,64:B}),e(Y,[2,56]),{28:105,88:T,89:C,90:E},{47:106,51:W},{27:108,28:46,29:47,88:T,89:C,90:E,91:S},e(A,[2,66],{54:[1,109]}),e(A,[2,68],{54:[1,111],69:[1,110]}),e(A,[2,72],{54:[1,112],72:[1,113]}),e(A,[2,76],{54:[1,115],69:[1,114]}),e(A,[2,80]),e(A,[2,53]),e(P,[2,11]),e(U,[2,51]),e(U,[2,50]),{27:116,28:46,29:47,88:T,89:C,90:E,91:S},e(Y,[2,55]),e(A,[2,39],{46:[1,117]}),{48:[1,118]},{47:119,48:[2,43],51:W},e(A,[2,42]),e(A,[2,67]),e(A,[2,69]),e(A,[2,70],{69:[1,120]}),e(A,[2,73]),e(A,[2,74],{54:[1,121]}),e(A,[2,77]),e(A,[2,78],{69:[1,122]}),e(U,[2,52]),{47:123,51:W},e(A,[2,40]),{48:[2,44]},e(A,[2,71]),e(A,[2,75]),e(A,[2,79]),{48:[1,124]},e(A,[2,41])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],54:[2,14],55:[2,16],85:[2,19],119:[2,44]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},q=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),19;case 1:return 8;case 2:return 9;case 3:return 10;case 4:return 11;case 5:return this.begin("type_directive"),20;case 6:return this.popState(),this.begin("arg_directive"),17;case 7:return this.popState(),this.popState(),22;case 8:return 21;case 9:case 10:case 19:case 27:break;case 11:return this.begin("acc_title"),39;case 12:return this.popState(),"acc_title_value";case 13:return this.begin("acc_descr"),41;case 14:return this.popState(),"acc_descr_value";case 15:this.begin("acc_descr_multiline");break;case 16:case 39:case 42:case 45:case 48:case 51:case 54:this.popState();break;case 17:return"acc_descr_multiline_value";case 18:return 16;case 20:case 21:return 23;case 22:return this.begin("struct"),46;case 23:return"EDGE_STATE";case 24:return"EOF_IN_STRUCT";case 25:return"OPEN_IN_STRUCT";case 26:return this.popState(),48;case 28:return"MEMBER";case 29:return 44;case 30:return 74;case 31:return 67;case 32:return 68;case 33:return 70;case 34:return 55;case 35:return 57;case 36:return 49;case 37:return 50;case 38:this.begin("generic");break;case 40:return"GENERICTYPE";case 41:this.begin("string");break;case 43:return"STR";case 44:this.begin("bqstring");break;case 46:return"BQUOTE_STR";case 47:this.begin("href");break;case 49:return 73;case 50:this.begin("callback_name");break;case 52:this.popState(),this.begin("callback_args");break;case 53:return 71;case 55:return 72;case 56:case 57:case 58:case 59:return 69;case 60:case 61:return 61;case 62:case 63:return 63;case 64:return 62;case 65:return 60;case 66:return 64;case 67:return 65;case 68:return 66;case 69:return 32;case 70:return 45;case 71:return 86;case 72:return"DOT";case 73:return"PLUS";case 74:return 83;case 75:case 76:return"EQUALS";case 77:return 90;case 78:return"PUNCTUATION";case 79:return 89;case 80:return 88;case 81:return 85;case 82:return 25}},rules:[/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\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)/,/^(?:[{])/,/^(?:\[\*\])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_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)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[16,17],inclusive:!1},acc_descr:{rules:[14],inclusive:!1},acc_title:{rules:[12],inclusive:!1},arg_directive:{rules:[7,8],inclusive:!1},type_directive:{rules:[6,7],inclusive:!1},open_directive:{rules:[5],inclusive:!1},callback_args:{rules:[54,55],inclusive:!1},callback_name:{rules:[51,52,53],inclusive:!1},href:{rules:[48,49],inclusive:!1},struct:{rules:[23,24,25,26,27,28],inclusive:!1},generic:{rules:[39,40],inclusive:!1},bqstring:{rules:[45,46],inclusive:!1},string:{rules:[42,43],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,29,30,31,32,33,34,35,36,37,38,41,44,47,50,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],inclusive:!0}}},t);function V(){this.yy={}}return H.lexer=q,V.prototype=H,H.Parser=V,new V}();vk.parser=vk;const kk=vk,wk=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.class)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*classDiagram/)},Tk=(t,e)=>{var n;return null!==t.match(/^\s*classDiagram/)&&"dagre-wrapper"===(null==(n=null==e?void 0:e.class)?void 0:n.defaultRenderer)||null!==t.match(/^\s*classDiagram-v2/)},Ck="classid-";let Ek=[],Sk={},Ak=[],Dk=0,Lk=[];const Ok=t=>Mm.sanitizeText(t,nx()),Mk=function(t){let e="",n=t;if(t.indexOf("~")>0){let i=t.split("~");n=i[0],e=Mm.sanitizeText(i[1],nx())}return{className:n,type:e}},Bk=function(t){let e=Mk(t);void 0===Sk[e.className]&&(Sk[e.className]={id:e.className,type:e.type,cssClasses:[],methods:[],members:[],annotations:[],domId:Ck+e.className+"-"+Dk},Dk++)},Nk=function(t){const e=Object.keys(Sk);for(const n of e)if(Sk[n].id===t)return Sk[n].domId},Ik=function(t,e){const n=Mk(t).className,i=Sk[n];if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?i.annotations.push(Ok(t.substring(2,t.length-2))):t.indexOf(")")>0?i.methods.push(Ok(t)):t&&i.members.push(Ok(t))}},Fk=function(t,e){t.split(",").forEach((function(t){let n=t;t[0].match(/\d/)&&(n=Ck+n),void 0!==Sk[n]&&Sk[n].cssClasses.push(e)}))},Rk=function(t,e,n){const i=nx();let r=t,s=Nk(r);if("loose"===i.securityLevel&&void 0!==e&&void 0!==Sk[r]){let t=[];if("string"==typeof n){t=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<t.length;e++){let n=t[e].trim();'"'===n.charAt(0)&&'"'===n.charAt(n.length-1)&&(n=n.substr(1,n.length-2)),t[e]=n}}0===t.length&&t.push(s),Lk.push((function(){const n=document.querySelector(`[id="${s}"]`);null!==n&&n.addEventListener("click",(function(){q_.runFunc(e,...t)}),!1)}))}},$k=function(t){let e=Fa(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Fa("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Fa(t).select("svg").selectAll("g.node").on("mouseover",(function(){const t=Fa(this);if(null===t.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Fa(this).classed("hover",!1)}))};Lk.push($k);let Pk="TB";const Yk={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},setAccTitle:jx,getAccTitle:zx,getAccDescription:Wx,setAccDescription:Ux,getConfig:()=>nx().class,addClass:Bk,bindFunctions:function(t){Lk.forEach((function(e){e(t)}))},clear:function(){Ek=[],Sk={},Ak=[],Lk=[],Lk.push($k),Yx()},getClass:function(t){return Sk[t]},getClasses:function(){return Sk},getNotes:function(){return Ak},addAnnotation:function(t,e){const n=Mk(t).className;Sk[n].annotations.push(e)},addNote:function(t,e){const n={id:`note${Ak.length}`,class:e,text:t};Ak.push(n)},getRelations:function(){return Ek},addRelation:function(t){vm.debug("Adding relation: "+JSON.stringify(t)),Bk(t.id1),Bk(t.id2),t.id1=Mk(t.id1).className,t.id2=Mk(t.id2).className,t.relationTitle1=Mm.sanitizeText(t.relationTitle1.trim(),nx()),t.relationTitle2=Mm.sanitizeText(t.relationTitle2.trim(),nx()),Ek.push(t)},getDirection:()=>Pk,setDirection:t=>{Pk=t},addMember:Ik,addMembers:function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>Ik(t,e))))},cleanupLabel:function(t){return":"===t.substring(0,1)?Mm.sanitizeText(t.substr(1).trim(),nx()):Ok(t.trim())},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){Rk(t,e,n),Sk[t].haveCallback=!0})),Fk(t,"clickable")},setCssClass:Fk,setLink:function(t,e,n){const i=nx();t.split(",").forEach((function(t){let r=t;t[0].match(/\d/)&&(r=Ck+r),void 0!==Sk[r]&&(Sk[r].link=q_.formatUrl(e,i),"sandbox"===i.securityLevel?Sk[r].linkTarget="_top":Sk[r].linkTarget="string"==typeof n?Ok(n):"_blank")})),Fk(t,"clickable")},getTooltip:function(t){return Sk[t].tooltip},setTooltip:function(t,e){const n=nx();t.split(",").forEach((function(t){void 0!==e&&(Sk[t].tooltip=Mm.sanitizeText(e,n))}))},lookUpDomId:Nk,setDiagramTitle:Hx,getDiagramTitle:qx};let jk=0;const zk=function(t){let e=t.match(/^([#+~-])?(\w+)(~\w+~|\[])?\s+(\w+) *([$*])?$/),n=t.match(/^([#+|~-])?(\w+) *\( *(.*)\) *([$*])? *(\w*[[\]|~]*\s*\w*~?)$/);return e&&!n?Uk(e):n?Wk(n):Hk(t)},Uk=function(t){let e="",n="";try{let i=t[1]?t[1].trim():"",r=t[2]?t[2].trim():"",s=t[3]?Om(t[3].trim()):"",a=t[4]?t[4].trim():"",o=t[5]?t[5].trim():"";n=i+r+s+" "+a,e=Vk(o)}catch(e){n=t}return{displayText:n,cssStyle:e}},Wk=function(t){let e="",n="";try{let i=t[1]?t[1].trim():"",r=t[2]?t[2].trim():"",s=t[3]?Om(t[3].trim()):"",a=t[4]?t[4].trim():"";n=i+r+"("+s+")"+(t[5]?" : "+Om(t[5]).trim():""),e=Vk(a)}catch(e){n=t}return{displayText:n,cssStyle:e}},Hk=function(t){let e="",n="",i="",r=t.indexOf("("),s=t.indexOf(")");if(r>1&&s>r&&s<=t.length){let a="",o="",c=t.substring(0,1);c.match(/\w/)?o=t.substring(0,r).trim():(c.match(/[#+~-]/)&&(a=c),o=t.substring(1,r).trim());const l=t.substring(r+1,s);t.substring(s+1,1),n=Vk(t.substring(s+1,s+2)),e=a+o+"("+Om(l.trim())+")",s<t.length&&(i=t.substring(s+2).trim(),""!==i&&(i=" : "+Om(i),e+=i))}else e=Om(t);return{displayText:e,cssStyle:n}},qk=function(t,e,n,i){let r=zk(e);const s=t.append("tspan").attr("x",i.padding).text(r.displayText);""!==r.cssStyle&&s.attr("style",r.cssStyle),n||s.attr("dy",i.textHeight)},Vk=function(t){switch(t){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}},Gk=function(t,e,n,i){vm.debug("Rendering class ",e,n);const r=e.id,s={id:r,label:e.id,width:0,height:0},a=t.append("g").attr("id",i.db.lookUpDomId(r)).attr("class","classGroup");let o;o=e.link?a.append("svg:a").attr("xlink:href",e.link).attr("target",e.linkTarget).append("text").attr("y",n.textHeight+n.padding).attr("x",0):a.append("text").attr("y",n.textHeight+n.padding).attr("x",0);let c=!0;e.annotations.forEach((function(t){const e=o.append("tspan").text("«"+t+"»");c||e.attr("dy",n.textHeight),c=!1}));let l=e.id;void 0!==e.type&&""!==e.type&&(l+="<"+e.type+">");const h=o.append("tspan").text(l).attr("class","title");c||h.attr("dy",n.textHeight);const u=o.node().getBBox().height,d=a.append("line").attr("x1",0).attr("y1",n.padding+u+n.dividerMargin/2).attr("y2",n.padding+u+n.dividerMargin/2),f=a.append("text").attr("x",n.padding).attr("y",u+n.dividerMargin+n.textHeight).attr("fill","white").attr("class","classText");c=!0,e.members.forEach((function(t){qk(f,t,c,n),c=!1}));const p=f.node().getBBox(),g=a.append("line").attr("x1",0).attr("y1",n.padding+u+n.dividerMargin+p.height).attr("y2",n.padding+u+n.dividerMargin+p.height),y=a.append("text").attr("x",n.padding).attr("y",u+2*n.dividerMargin+p.height+n.textHeight).attr("fill","white").attr("class","classText");c=!0,e.methods.forEach((function(t){qk(y,t,c,n),c=!1}));const m=a.node().getBBox();var b=" ";e.cssClasses.length>0&&(b+=e.cssClasses.join(" "));const _=a.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",m.width+2*n.padding).attr("height",m.height+n.padding+.5*n.dividerMargin).attr("class",b).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(_-t.getBBox().width)/2)})),e.tooltip&&o.insert("title").text(e.tooltip),d.attr("x2",_),g.attr("x2",_),s.width=_,s.height=m.height+n.padding+.5*n.dividerMargin,s},Xk=function(t,e,n,i,r){const s=function(t){switch(t){case r.db.relationType.AGGREGATION:return"aggregation";case r.db.relationType.EXTENSION:return"extension";case r.db.relationType.COMPOSITION:return"composition";case r.db.relationType.DEPENDENCY:return"dependency";case r.db.relationType.LOLLIPOP:return"lollipop"}};e.points=e.points.filter((t=>!Number.isNaN(t.y)));const a=e.points,o=_o().x((function(t){return t.x})).y((function(t){return t.y})).curve(Co),c=t.append("path").attr("d",o(a)).attr("id","edge"+jk).attr("class","relation");let l,h,u="";i.arrowMarkerAbsolute&&(u=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,u=u.replace(/\(/g,"\\("),u=u.replace(/\)/g,"\\)")),1==n.relation.lineType&&c.attr("class","relation dashed-line"),10==n.relation.lineType&&c.attr("class","relation dotted-line"),"none"!==n.relation.type1&&c.attr("marker-start","url("+u+"#"+s(n.relation.type1)+"Start)"),"none"!==n.relation.type2&&c.attr("marker-end","url("+u+"#"+s(n.relation.type2)+"End)");const d=e.points.length;let f,p,g,y,m=q_.calcLabelPosition(e.points);if(l=m.x,h=m.y,d%2!=0&&d>1){let t=q_.calcCardinalityPosition("none"!==n.relation.type1,e.points,e.points[0]),i=q_.calcCardinalityPosition("none"!==n.relation.type2,e.points,e.points[d-1]);vm.debug("cardinality_1_point "+JSON.stringify(t)),vm.debug("cardinality_2_point "+JSON.stringify(i)),f=t.x,p=t.y,g=i.x,y=i.y}if(void 0!==n.title){const e=t.append("g").attr("class","classLabel"),r=e.append("text").attr("class","label").attr("x",l).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(n.title);window.label=r;const s=r.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",s.x-i.padding/2).attr("y",s.y-i.padding/2).attr("width",s.width+i.padding).attr("height",s.height+i.padding)}if(vm.info("Rendering relation "+JSON.stringify(n)),void 0!==n.relationTitle1&&"none"!==n.relationTitle1){t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",f).attr("y",p).attr("fill","black").attr("font-size","6").text(n.relationTitle1)}if(void 0!==n.relationTitle2&&"none"!==n.relationTitle2){t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",g).attr("y",y).attr("fill","black").attr("font-size","6").text(n.relationTitle2)}jk++},Zk=function(t,e,n,i){vm.debug("Rendering note ",e,n);const r=e.id,s={id:r,text:e.text,width:0,height:0},a=t.append("g").attr("id",r).attr("class","classGroup");let o=a.append("text").attr("y",n.textHeight+n.padding).attr("x",0);const c=JSON.parse(`"${e.text}"`).split("\n");c.forEach((function(t){vm.debug(`Adding line: ${t}`),o.append("tspan").text(t).attr("class","title").attr("dy",n.textHeight)}));const l=a.node().getBBox(),h=a.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",l.width+2*n.padding).attr("height",l.height+c.length*n.textHeight+n.padding+.5*n.dividerMargin).node().getBBox().width;return o.node().childNodes.forEach((function(t){t.setAttribute("x",(h-t.getBBox().width)/2)})),s.width=h,s.height=l.height+c.length*n.textHeight+n.padding+.5*n.dividerMargin,s};let Qk={};const Kk=function(t){const e=Object.entries(Qk).find((e=>e[1].label===t));if(e)return e[0]},Jk={draw:function(t,e,n,i){const r=nx().class;Qk={},vm.info("Rendering diagram "+t);const s=nx().securityLevel;let a;"sandbox"===s&&(a=Fa("#i"+e));const o=Fa("sandbox"===s?a.nodes()[0].contentDocument.body:"body"),c=o.select(`[id='${e}']`);var l;(l=c).append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),l.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),l.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).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"),l.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).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"),l.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).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"),l.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).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"),l.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).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"),l.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 18,7 L9,13 L14,7 L9,1 Z");const h=new Pf({multigraph:!0});h.setGraph({isMultiGraph:!0}),h.setDefaultEdgeLabel((function(){return{}}));const u=i.db.getClasses(),d=Object.keys(u);for(const t of d){const e=u[t],n=Gk(c,e,r,i);Qk[n.id]=n,h.setNode(n.id,n),vm.info("Org height: "+n.height)}i.db.getRelations().forEach((function(t){vm.info("tjoho"+Kk(t.id1)+Kk(t.id2)+JSON.stringify(t)),h.setEdge(Kk(t.id1),Kk(t.id2),{relation:t},t.title||"DEFAULT")}));i.db.getNotes().forEach((function(t){vm.debug(`Adding note: ${JSON.stringify(t)}`);const e=Zk(c,t,r,i);Qk[e.id]=e,h.setNode(e.id,e),t.class&&t.class in u&&h.setEdge(t.id,Kk(t.class),{relation:{id1:t.id,id2:t.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")})),by(h),h.nodes().forEach((function(t){void 0!==t&&void 0!==h.node(t)&&(vm.debug("Node "+t+": "+JSON.stringify(h.node(t))),o.select("#"+(i.db.lookUpDomId(t)||t)).attr("transform","translate("+(h.node(t).x-h.node(t).width/2)+","+(h.node(t).y-h.node(t).height/2)+" )"))})),h.edges().forEach((function(t){void 0!==t&&void 0!==h.edge(t)&&(vm.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(h.edge(t))),Xk(c,h.edge(t),h.edge(t).relation,r,i))}));const f=c.node().getBBox(),p=f.width+40,g=f.height+40;lx(c,g,p,r.useMaxWidth);const y=`${f.x-20} ${f.y-20} ${p} ${g}`;vm.debug(`viewBox ${y}`),c.attr("viewBox",y)}},tw={extension:(t,e,n)=>{vm.trace("Making markers for ",n),t.append("defs").append("marker").attr("id",e+"-extensionStart").attr("class","marker extension "+e).attr("refX",0).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",e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},composition:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-compositionStart").attr("class","marker composition "+e).attr("refX",0).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",e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",19).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:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",0).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",e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",19).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")},dependency:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",0).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",e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",19).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")},lollipop:(t,e)=>{t.append("defs").append("marker").attr("id",e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","white").attr("cx",6).attr("cy",7).attr("r",6)},point:(t,e)=>{t.append("marker").attr("id",e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",10).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",e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",0).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")},circle:(t,e)=>{t.append("marker").attr("id",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",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")},cross:(t,e)=>{t.append("marker").attr("id",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",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")},barb:(t,e)=>{t.append("defs").append("marker").attr("id",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")}},ew=(t,e,n,i)=>{e.forEach((e=>{tw[e](t,n,i)}))};const nw=(t,e,n,i)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),Lm(nx().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),vm.info("vertexText"+r);let t=function(t){const e=Fa(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),n=e.append("xhtml:div"),i=t.label,r=t.isNode?"nodeLabel":"edgeLabel";var s,a;return n.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+i+"</span>"),s=n,(a=t.labelStyle)&&s.attr("style",a),n.style("display","inline-block"),n.style("white-space","nowrap"),n.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}({isNode:i,label:eD(r).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`)),labelStyle:e.replace("fill:","color:")});return t}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let i=[];i="string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[];for(const e of i){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"),n?i.setAttribute("class","title-row"):i.setAttribute("class","row"),i.textContent=e.trim(),t.appendChild(i)}return t}},iw=(t,e,n,i)=>{let r;r=n||"node default";const s=t.insert("g").attr("class",r).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",e.labelStyle);let o;o=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const c=a.node().appendChild(nw(Em(eD(o),nx()),e.labelStyle,!1,i));let l=c.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=c.children[0],e=Fa(c);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}const h=e.padding/2;return a.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),{shapeSvg:s,bbox:l,halfPadding:h,label:a}},rw=(t,e)=>{const n=e.node().getBBox();t.width=n.width,t.height=n.height};function sw(t,e,n,i){return t.insert("polygon",":first-child").attr("points",i.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+n/2+")")}let aw={},ow={},cw={};const lw=(t,e)=>(vm.trace("In isDecendant",e," ",t," = ",ow[e].includes(t)),!!ow[e].includes(t)),hw=(t,e,n,i)=>{vm.warn("Copying children of ",t,"root",i,"data",e.node(t),i);const r=e.children(t)||[];t!==i&&r.push(t),vm.warn("Copying (nodes) clusterId",t,"nodes",r),r.forEach((r=>{if(e.children(r).length>0)hw(r,e,n,i);else{const s=e.node(r);vm.info("cp ",r," to ",i," with parent ",t),n.setNode(r,s),i!==e.parent(r)&&(vm.warn("Setting parent",r,e.parent(r)),n.setParent(r,e.parent(r))),t!==i&&r!==t?(vm.debug("Setting parent",r,t),n.setParent(r,t)):(vm.info("In copy ",t,"root",i,"data",e.node(t),i),vm.debug("Not Setting parent for node=",r,"cluster!==rootId",t!==i,"node!==clusterId",r!==t));const a=e.edges(r);vm.debug("Copying Edges",a),a.forEach((r=>{vm.info("Edge",r);const s=e.edge(r.v,r.w,r.name);vm.info("Edge data",s,i);try{((t,e)=>(vm.info("Decendants of ",e," is ",ow[e]),vm.info("Edge is ",t),t.v!==e&&t.w!==e&&(ow[e]?ow[e].includes(t.v)||lw(t.v,e)||lw(t.w,e)||ow[e].includes(t.w):(vm.debug("Tilt, ",e,",not in decendants"),!1))))(r,i)?(vm.info("Copying as ",r.v,r.w,s,r.name),n.setEdge(r.v,r.w,s,r.name),vm.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):vm.info("Skipping copy of edge ",r.v,"--\x3e",r.w," rootId: ",i," clusterId:",t)}catch(t){vm.error(t)}}))}vm.debug("Removing node",r),e.removeNode(r)}))},uw=(t,e)=>{const n=e.children(t);let i=[...n];for(const r of n)cw[r]=t,i=[...i,...uw(r,e)];return i},dw=(t,e)=>{vm.trace("Searching",t);const n=e.children(t);if(vm.trace("Searching children of id ",t,n),n.length<1)return vm.trace("This is a valid node",t),t;for(const i of n){const n=dw(i,e);if(n)return vm.trace("Found replacement for",t," => ",n),n}},fw=t=>aw[t]&&aw[t].externalConnections&&aw[t]?aw[t].id:t,pw=(t,e)=>{if(vm.warn("extractor - ",e,am(t),t.children("D")),e>10)return void vm.error("Bailing out");let n=t.nodes(),i=!1;for(const e of n){const n=t.children(e);i=i||n.length>0}if(i){vm.debug("Nodes = ",n,e);for(const i of n)if(vm.debug("Extracting node",i,aw,aw[i]&&!aw[i].externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",e),aw[i])if(!aw[i].externalConnections&&t.children(i)&&t.children(i).length>0){vm.warn("Cluster without external connections, without a parent and with children",i,e);let n="TB"===t.graph().rankdir?"LR":"TB";aw[i]&&aw[i].clusterData&&aw[i].clusterData.dir&&(n=aw[i].clusterData.dir,vm.warn("Fixing dir",aw[i].clusterData.dir,n));const r=new Pf({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));vm.warn("Old graph before copy",am(t)),hw(i,t,r,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:aw[i].clusterData,labelText:aw[i].labelText,graph:r}),vm.warn("New graph after copy node: (",i,")",am(r)),vm.debug("Old graph after copy",am(t))}else vm.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!aw[i].externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),e),vm.debug(aw);else vm.debug("Not a cluster",i,e);n=t.nodes(),vm.warn("New list of nodes",n);for(const i of n){const n=t.node(i);vm.warn(" Now next level",i,n),n.clusterNode&&pw(n.graph,e+1)}}else vm.debug("Done, no node has children",t.nodes())},gw=(t,e)=>{if(0===e.length)return[];let n=Object.assign(e);return e.forEach((e=>{const i=t.children(e),r=gw(t,i);n=[...n,...r]})),n};function yw(t,e,n,i){var r=t.x,s=t.y,a=r-i.x,o=s-i.y,c=Math.sqrt(e*e*o*o+n*n*a*a),l=Math.abs(e*n*a/c);i.x<r&&(l=-l);var h=Math.abs(e*n*o/c);return i.y<s&&(h=-h),{x:r+l,y:s+h}}function mw(t,e,n,i){var r,s,a,o,c,l,h,u,d,f,p,g,y;if(r=e.y-t.y,a=t.x-e.x,c=e.x*t.y-t.x*e.y,d=r*n.x+a*n.y+c,f=r*i.x+a*i.y+c,!(0!==d&&0!==f&&bw(d,f)||(s=i.y-n.y,o=n.x-i.x,l=i.x*n.y-n.x*i.y,h=s*t.x+o*t.y+l,u=s*e.x+o*e.y+l,0!==h&&0!==u&&bw(h,u)||0==(p=r*o-s*a))))return g=Math.abs(p/2),{x:(y=a*l-o*c)<0?(y-g)/p:(y+g)/p,y:(y=s*c-r*l)<0?(y-g)/p:(y+g)/p}}function bw(t,e){return t*e>0}const _w=(t,e)=>{var n,i,r=t.x,s=t.y,a=e.x-r,o=e.y-s,c=t.width/2,l=t.height/2;return Math.abs(o)*c>Math.abs(a)*l?(o<0&&(l=-l),n=0===o?0:l*a/o,i=l):(a<0&&(c=-c),n=c,i=0===a?0:c*o/a),{x:r+n,y:s+i}},xw={node:function(t,e){return t.intersect(e)},circle:function(t,e,n){return yw(t,e,e,n)},ellipse:yw,polygon:function(t,e,n){var i=t.x,r=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){a=Math.min(a,t.x),o=Math.min(o,t.y)})):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var c=i-t.width/2-a,l=r-t.height/2-o,h=0;h<e.length;h++){var u=e[h],d=e[h<e.length-1?h+1:0],f=mw(t,n,{x:c+u.x,y:l+u.y},{x:c+d.x,y:l+d.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort((function(t,e){var i=t.x-n.x,r=t.y-n.y,s=Math.sqrt(i*i+r*r),a=e.x-n.x,o=e.y-n.y,c=Math.sqrt(a*a+o*o);return s<c?-1:s===c?0:1})),s[0]):t},rect:_w},vw=(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=iw(t,e,"node "+e.classes,!0);vm.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-r).attr("y",-i.height/2-r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),rw(e,s),e.intersect=function(t){return xw.rect(e,t)},n};function kw(t,e,n,i){const r=[],s=t=>{r.push(t,0)},a=t=>{r.push(0,t)};e.includes("t")?(vm.debug("add top border"),s(n)):a(n),e.includes("r")?(vm.debug("add right border"),s(i)):a(i),e.includes("b")?(vm.debug("add bottom border"),s(n)):a(n),e.includes("l")?(vm.debug("add left border"),s(i)):a(i),t.attr("stroke-dasharray",r.join(" "))}const ww=(t,e,n)=>{const i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let r=70,s=10;"LR"===n&&(r=10,s=70);const a=i.append("rect").attr("x",-1*r/2).attr("y",-1*s/2).attr("width",r).attr("height",s).attr("class","fork-join");return rw(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return xw.rect(e,t)},i},Tw={question:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding+(i.height+e.padding),s=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];vm.info("Question main (Circle)");const a=sw(n,r,r,s);return a.attr("style",e.style),rw(e,a),e.intersect=function(t){return vm.warn("Intersect called"),xw.polygon(e,s,t)},n},rect:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=iw(t,e,"node "+e.classes,!0);vm.trace("Classes = ",e.classes);const s=n.insert("rect",":first-child"),a=i.width+e.padding,o=i.height+e.padding;if(s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-r).attr("y",-i.height/2-r).attr("width",a).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(kw(s,e.props.borders,a,o),t.delete("borders")),t.forEach((t=>{vm.warn(`Unknown node property ${t}`)}))}return rw(e,s),e.intersect=function(t){return xw.rect(e,t)},n},labelRect:(t,e)=>{const{shapeSvg:n}=iw(t,e,"label",!0);vm.trace("Classes = ",e.classes);const i=n.insert("rect",":first-child");if(i.attr("width",0).attr("height",0),n.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(kw(i,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{vm.warn(`Unknown node property ${t}`)}))}return rw(e,i),e.intersect=function(t){return xw.rect(e,t)},n},rectWithTitle:(t,e)=>{let n;n=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",n).attr("id",e.domId||e.id),r=i.insert("rect",":first-child"),s=i.insert("line"),a=i.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let c="";c="object"==typeof o?o[0]:o,vm.info("Label text abc79",c,o,"object"==typeof o);const l=a.node().appendChild(nw(c,e.labelStyle,!0,!0));let h={width:0,height:0};if(Lm(nx().flowchart.htmlLabels)){const t=l.children[0],e=Fa(l);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}vm.info("Text 2",o);const u=o.slice(1,o.length);let d=l.getBBox();const f=a.node().appendChild(nw(u.join?u.join("<br/>"):u,e.labelStyle,!0,!0));if(Lm(nx().flowchart.htmlLabels)){const t=f.children[0],e=Fa(f);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const p=e.padding/2;return Fa(f).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+p+5)+")"),Fa(l).attr("transform","translate( "+(h.width<d.width?0:-(d.width-h.width)/2)+", 0)"),h=a.node().getBBox(),a.attr("transform","translate("+-h.width/2+", "+(-h.height/2-p+3)+")"),r.attr("class","outer title-state").attr("x",-h.width/2-p).attr("y",-h.height/2-p).attr("width",h.width+e.padding).attr("height",h.height+e.padding),s.attr("class","divider").attr("x1",-h.width/2-p).attr("x2",h.width/2+p).attr("y1",-h.height/2-p+d.height+p).attr("y2",-h.height/2-p+d.height+p),rw(e,r),e.intersect=function(t){return xw.rect(e,t)},i},choice:(t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return n.insert("polygon",":first-child").attr("points",i.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return xw.circle(e,14,t)},n},circle:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=iw(t,e,void 0,!0),s=n.insert("circle",":first-child");return s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),vm.info("Circle main"),rw(e,s),e.intersect=function(t){return vm.info("Circle intersect",e,i.width/2+r,t),xw.circle(e,i.width/2+r,t)},n},doublecircle:(t,e)=>{const{shapeSvg:n,bbox:i,halfPadding:r}=iw(t,e,void 0,!0),s=n.insert("g",":first-child"),a=s.insert("circle"),o=s.insert("circle");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r+5).attr("width",i.width+e.padding+10).attr("height",i.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+r).attr("width",i.width+e.padding).attr("height",i.height+e.padding),vm.info("DoubleCircle main"),rw(e,a),e.intersect=function(t){return vm.info("DoubleCircle intersect",e,i.width/2+r+5,t),xw.circle(e,i.width/2+r+5,t)},n},stadium:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.height+e.padding,s=i.width+r/4+e.padding,a=n.insert("rect",":first-child").attr("style",e.style).attr("rx",r/2).attr("ry",r/2).attr("x",-s/2).attr("y",-r/2).attr("width",s).attr("height",r);return rw(e,a),e.intersect=function(t){return xw.rect(e,t)},n},hexagon:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.height+e.padding,s=r/4,a=i.width+2*s+e.padding,o=[{x:s,y:0},{x:a-s,y:0},{x:a,y:-r/2},{x:a-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],c=sw(n,a,r,o);return c.attr("style",e.style),rw(e,c),e.intersect=function(t){return xw.polygon(e,o,t)},n},rect_left_inv_arrow:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:-s/2,y:0},{x:r,y:0},{x:r,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return sw(n,r,s,a).attr("style",e.style),e.width=r+s,e.height=s,e.intersect=function(t){return xw.polygon(e,a,t)},n},lean_right:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:-2*s/6,y:0},{x:r-s/6,y:0},{x:r+2*s/6,y:-s},{x:s/6,y:-s}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},lean_left:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:2*s/6,y:0},{x:r+s/6,y:0},{x:r-2*s/6,y:-s},{x:-s/6,y:-s}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},trapezoid:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:-2*s/6,y:0},{x:r+2*s/6,y:0},{x:r-s/6,y:-s},{x:s/6,y:-s}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},inv_trapezoid:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:s/6,y:0},{x:r-s/6,y:0},{x:r+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},rect_right_inv_arrow:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:0,y:0},{x:r+s/2,y:0},{x:r,y:-s/2},{x:r+s/2,y:-s},{x:0,y:-s}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},cylinder:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=r/2,a=s/(2.5+r/50),o=i.height+a+e.padding,c="M 0,"+a+" a "+s+","+a+" 0,0,0 "+r+" 0 a "+s+","+a+" 0,0,0 "+-r+" 0 l 0,"+o+" a "+s+","+a+" 0,0,0 "+r+" 0 l 0,"+-o,l=n.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",c).attr("transform","translate("+-r/2+","+-(o/2+a)+")");return rw(e,l),e.intersect=function(t){const n=xw.rect(e,t),i=n.x-e.x;if(0!=s&&(Math.abs(i)<e.width/2||Math.abs(i)==e.width/2&&Math.abs(n.y-e.y)>e.height/2-a)){let r=a*a*(1-i*i/(s*s));0!=r&&(r=Math.sqrt(r)),r=a-r,t.y-e.y>0&&(r=-r),n.y+=r}return n},n},start:(t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),rw(e,i),e.intersect=function(t){return xw.circle(e,7,t)},n},end:(t,e)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=n.insert("circle",":first-child"),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),rw(e,r),e.intersect=function(t){return xw.circle(e,7,t)},n},note:vw,subroutine:(t,e)=>{const{shapeSvg:n,bbox:i}=iw(t,e,void 0,!0),r=i.width+e.padding,s=i.height+e.padding,a=[{x:0,y:0},{x:r,y:0},{x:r,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:r+8,y:0},{x:r+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=sw(n,r,s,a);return o.attr("style",e.style),rw(e,o),e.intersect=function(t){return xw.polygon(e,a,t)},n},fork:ww,join:ww,class_box:(t,e)=>{const n=e.padding/2;let i;i=e.classes?"node "+e.classes:"node default";const r=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=r.insert("rect",":first-child"),a=r.insert("line"),o=r.insert("line");let c=0,l=4;const h=r.insert("g").attr("class","label");let u=0;const d=e.classData.annotations&&e.classData.annotations[0],f=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",p=h.node().appendChild(nw(f,e.labelStyle,!0,!0));let g=p.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=p.children[0],e=Fa(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}e.classData.annotations[0]&&(l+=g.height+4,c+=g.width);let y=e.classData.id;void 0!==e.classData.type&&""!==e.classData.type&&(nx().flowchart.htmlLabels?y+="&lt;"+e.classData.type+"&gt;":y+="<"+e.classData.type+">");const m=h.node().appendChild(nw(y,e.labelStyle,!0,!0));Fa(m).attr("class","classTitle");let b=m.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=m.children[0],e=Fa(m);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}l+=b.height+4,b.width>c&&(c=b.width);const _=[];e.classData.members.forEach((t=>{const n=zk(t);let i=n.displayText;nx().flowchart.htmlLabels&&(i=i.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const r=h.node().appendChild(nw(i,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let s=r.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=r.children[0],e=Fa(r);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>c&&(c=s.width),l+=s.height+4,_.push(r)})),l+=8;const x=[];if(e.classData.methods.forEach((t=>{const n=zk(t);let i=n.displayText;nx().flowchart.htmlLabels&&(i=i.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const r=h.node().appendChild(nw(i,n.cssStyle?n.cssStyle:e.labelStyle,!0,!0));let s=r.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=r.children[0],e=Fa(r);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}s.width>c&&(c=s.width),l+=s.height+4,x.push(r)})),l+=8,d){let t=(c-g.width)/2;Fa(p).attr("transform","translate( "+(-1*c/2+t)+", "+-1*l/2+")"),u=g.height+4}let v=(c-b.width)/2;return Fa(m).attr("transform","translate( "+(-1*c/2+v)+", "+(-1*l/2+u)+")"),u+=b.height+4,a.attr("class","divider").attr("x1",-c/2-n).attr("x2",c/2+n).attr("y1",-l/2-n+8+u).attr("y2",-l/2-n+8+u),u+=8,_.forEach((t=>{Fa(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+u+4)+")"),u+=b.height+4})),u+=8,o.attr("class","divider").attr("x1",-c/2-n).attr("x2",c/2+n).attr("y1",-l/2-n+8+u).attr("y2",-l/2-n+8+u),u+=8,x.forEach((t=>{Fa(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+u)+")"),u+=b.height+4})),s.attr("class","outer title-state").attr("x",-c/2-n).attr("y",-l/2-n).attr("width",c+e.padding).attr("height",l+e.padding),rw(e,s),e.intersect=function(t){return xw.rect(e,t)},r}};let Cw={};const Ew=t=>{const e=Cw[t.id];vm.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},Sw={rect:(t,e)=>{vm.trace("Creating subgraph rect for ",e.id,e);const n=t.insert("g").attr("class","cluster"+(e.class?" "+e.class:"")).attr("id",e.id),i=n.insert("rect",":first-child"),r=n.insert("g").attr("class","cluster-label"),s=r.node().appendChild(nw(e.labelText,e.labelStyle,void 0,!0));let a=s.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=s.children[0],e=Fa(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}const o=0*e.padding,c=o/2,l=e.width<=a.width+o?a.width+o:e.width;e.width<=a.width+o?e.diff=(a.width-e.width)/2-e.padding/2:e.diff=-e.padding/2,vm.trace("Data ",e,JSON.stringify(e)),i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-l/2).attr("y",e.y-e.height/2-c).attr("width",l).attr("height",e.height+o),r.attr("transform","translate("+(e.x-a.width/2)+", "+(e.y-e.height/2)+")");const h=i.node().getBBox();return e.width=h.width,e.height=h.height,e.intersect=function(t){return _w(e,t)},n},roundedWithTitle:(t,e)=>{const n=t.insert("g").attr("class",e.classes).attr("id",e.id),i=n.insert("rect",":first-child"),r=n.insert("g").attr("class","cluster-label"),s=n.append("rect"),a=r.node().appendChild(nw(e.labelText,e.labelStyle,void 0,!0));let o=a.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=a.children[0],e=Fa(a);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}o=a.getBBox();const c=0*e.padding,l=c/2,h=e.width<=o.width+e.padding?o.width+e.padding:e.width;e.width<=o.width+e.padding?e.diff=(o.width+0*e.padding-e.width)/2:e.diff=-e.padding/2,i.attr("class","outer").attr("x",e.x-h/2-l).attr("y",e.y-e.height/2-l).attr("width",h+c).attr("height",e.height+c),s.attr("class","inner").attr("x",e.x-h/2-l).attr("y",e.y-e.height/2-l+o.height-1).attr("width",h+c).attr("height",e.height+c-o.height-3),r.attr("transform","translate("+(e.x-o.width/2)+", "+(e.y-e.height/2-e.padding/3+(Lm(nx().flowchart.htmlLabels)?5:3))+")");const u=i.node().getBBox();return e.height=u.height,e.intersect=function(t){return _w(e,t)},n},noteGroup:(t,e)=>{const n=t.insert("g").attr("class","note-cluster").attr("id",e.id),i=n.insert("rect",":first-child"),r=0*e.padding,s=r/2;i.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+r).attr("height",e.height+r).attr("fill","none");const a=i.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(t){return _w(e,t)},n},divider:(t,e)=>{const n=t.insert("g").attr("class",e.classes).attr("id",e.id),i=n.insert("rect",":first-child"),r=0*e.padding,s=r/2;i.attr("class","divider").attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2).attr("width",e.width+r).attr("height",e.height+r);const a=i.node().getBBox();return e.width=a.width,e.height=a.height,e.diff=-e.padding/2,e.intersect=function(t){return _w(e,t)},n}};let Aw={};let Dw={},Lw={};function Ow(t,e){nx().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}const Mw=(t,e)=>{vm.warn("abc88 cutPathAtIntersect",t,e);let n=[],i=t[0],r=!1;return t.forEach((t=>{if(vm.info("abc88 checking point",t,e),((t,e)=>{const n=t.x,i=t.y,r=Math.abs(e.x-n),s=Math.abs(e.y-i),a=t.width/2,o=t.height/2;return r>=a||s>=o})(e,t)||r)vm.warn("abc88 outside",t,i),i=t,r||n.push(t);else{const s=((t,e,n)=>{vm.warn(`intersection calc abc89:\n  outsidePoint: ${JSON.stringify(e)}\n  insidePoint : ${JSON.stringify(n)}\n  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const i=t.x,r=t.y,s=Math.abs(i-n.x),a=t.width/2;let o=n.x<e.x?a-s:a+s;const c=t.height/2,l=Math.abs(e.y-n.y),h=Math.abs(e.x-n.x);if(Math.abs(r-e.y)*a>Math.abs(i-e.x)*c){let t=n.y<e.y?e.y-c-r:r-c-e.y;o=h*t/l;const i={x:n.x<e.x?n.x+o:n.x-h+o,y:n.y<e.y?n.y+l-t:n.y-l+t};return 0===o&&(i.x=e.x,i.y=e.y),0===h&&(i.x=e.x),0===l&&(i.y=e.y),vm.warn(`abc89 topp/bott calc, Q ${l}, q ${t}, R ${h}, r ${o}`,i),i}{o=n.x<e.x?e.x-a-i:i-a-e.x;let t=l*o/h,r=n.x<e.x?n.x+h-o:n.x-h+o,s=n.y<e.y?n.y+t:n.y-t;return vm.warn(`sides calc abc89, Q ${l}, q ${t}, R ${h}, r ${o}`,{_x:r,_y:s}),0===o&&(r=e.x,s=e.y),0===h&&(r=e.x),0===l&&(s=e.y),{x:r,y:s}}})(e,i,t);vm.warn("abc88 inside",t,i,s),vm.warn("abc88 intersection",s);let a=!1;n.forEach((t=>{a=a||t.x===s.x&&t.y===s.y})),n.some((t=>t.x===s.x&&t.y===s.y))?vm.warn("abc88 no intersect",s,n):n.push(s),r=!0}})),vm.warn("abc88 returning points",n),n},Bw=(t,e,n,i)=>{vm.info("Graph in recursive render: XXX",am(e),i);const r=e.graph().rankdir;vm.trace("Dir in recursive render - dir:",r);const s=t.insert("g").attr("class","root");e.nodes()?vm.info("Recursive render XXX",e.nodes()):vm.info("No nodes found for",e),e.edges().length>0&&vm.trace("Recursive edges",e.edge(e.edges()[0]));const a=s.insert("g").attr("class","clusters"),o=s.insert("g").attr("class","edgePaths"),c=s.insert("g").attr("class","edgeLabels"),l=s.insert("g").attr("class","nodes");e.nodes().forEach((function(t){const s=e.node(t);if(void 0!==i){const n=JSON.parse(JSON.stringify(i.clusterData));vm.info("Setting data for cluster XXX (",t,") ",n,i),e.setNode(i.id,n),e.parent(t)||(vm.trace("Setting parent",t,i.id),e.setParent(t,i.id,n))}if(vm.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),s&&s.clusterNode){vm.info("Cluster identified",t,s.width,e.node(t));const i=Bw(l,s.graph,n,e.node(t)),r=i.elem;rw(s,r),s.diff=i.diff||0,vm.info("Node bounds (abc123)",t,s,s.width,s.x,s.y),((t,e)=>{Cw[e.id]=t})(r,s),vm.warn("Recursive render complete ",r,s)}else e.children(t).length>0?(vm.info("Cluster - the non recursive path XXX",t,s.id,s,e),vm.info(dw(s.id,e)),aw[s.id]={id:dw(s.id,e),node:s}):(vm.info("Node - the non recursive path",t,s.id,s),((t,e,n)=>{let i,r;if(e.link){let s;"sandbox"===nx().securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s),r=Tw[e.shape](i,e,n)}else r=Tw[e.shape](t,e,n),i=r;e.tooltip&&r.attr("title",e.tooltip),e.class&&r.attr("class","node default "+e.class),Cw[e.id]=i,e.haveCallback&&Cw[e.id].attr("class",Cw[e.id].attr("class")+" clickable")})(l,e.node(t),r))})),e.edges().forEach((function(t){const n=e.edge(t.v,t.w,t.name);vm.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),vm.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),vm.info("Fix",aw,"ids:",t.v,t.w,"Translateing: ",aw[t.v],aw[t.w]),((t,e)=>{const n=nw(e.label,e.labelStyle),i=t.insert("g").attr("class","edgeLabel"),r=i.insert("g").attr("class","label");r.node().appendChild(n);let s,a=n.getBBox();if(Lm(nx().flowchart.htmlLabels)){const t=n.children[0],e=Fa(n);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}if(r.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Dw[e.id]=i,e.width=a.width,e.height=a.height,e.startLabelLeft){const n=nw(e.startLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");s=r.node().appendChild(n);const a=n.getBBox();r.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Lw[e.id]||(Lw[e.id]={}),Lw[e.id].startLeft=i,Ow(s,e.startLabelLeft)}if(e.startLabelRight){const n=nw(e.startLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");s=i.node().appendChild(n),r.node().appendChild(n);const a=n.getBBox();r.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Lw[e.id]||(Lw[e.id]={}),Lw[e.id].startRight=i,Ow(s,e.startLabelRight)}if(e.endLabelLeft){const n=nw(e.endLabelLeft,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");s=r.node().appendChild(n);const a=n.getBBox();r.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.node().appendChild(n),Lw[e.id]||(Lw[e.id]={}),Lw[e.id].endLeft=i,Ow(s,e.endLabelLeft)}if(e.endLabelRight){const n=nw(e.endLabelRight,e.labelStyle),i=t.insert("g").attr("class","edgeTerminals"),r=i.insert("g").attr("class","inner");s=r.node().appendChild(n);const a=n.getBBox();r.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),i.node().appendChild(n),Lw[e.id]||(Lw[e.id]={}),Lw[e.id].endRight=i,Ow(s,e.endLabelRight)}})(c,n)})),e.edges().forEach((function(t){vm.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t))})),vm.info("#############################################"),vm.info("###                Layout                 ###"),vm.info("#############################################"),vm.info(e),by(e),vm.info("Graph after layout:",am(e));let h=0;return(t=>gw(t,t.children()))(e).forEach((function(t){const n=e.node(t);vm.info("Position "+t+": "+JSON.stringify(e.node(t))),vm.info("Position "+t+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n&&n.clusterNode?Ew(n):e.children(t).length>0?(((t,e)=>{vm.trace("Inserting cluster");const n=e.shape||"rect";Aw[e.id]=Sw[n](t,e)})(a,n),aw[n.id].node=n):Ew(n)})),e.edges().forEach((function(t){const i=e.edge(t);vm.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(i),i);const r=function(t,e,n,i,r,s){let a=n.points,o=!1;const c=s.node(e.v);var l=s.node(e.w);vm.info("abc88 InsertEdge: ",n),l.intersect&&c.intersect&&(a=a.slice(1,n.points.length-1),a.unshift(c.intersect(a[0])),vm.info("Last point",a[a.length-1],l,l.intersect(a[a.length-1])),a.push(l.intersect(a[a.length-1]))),n.toCluster&&(vm.info("to cluster abc88",i[n.toCluster]),a=Mw(n.points,i[n.toCluster].node),o=!0),n.fromCluster&&(vm.info("from cluster abc88",i[n.fromCluster]),a=Mw(a.reverse(),i[n.fromCluster].node).reverse(),o=!0);const h=a.filter((t=>!Number.isNaN(t.y)));let u;u=("graph"===r||"flowchart"===r)&&n.curve||Co;const d=_o().x((function(t){return t.x})).y((function(t){return t.y})).curve(u);let f;switch(n.thickness){case"normal":f="edge-thickness-normal";break;case"thick":f="edge-thickness-thick";break;default:f=""}switch(n.pattern){case"solid":f+=" edge-pattern-solid";break;case"dotted":f+=" edge-pattern-dotted";break;case"dashed":f+=" edge-pattern-dashed"}const p=t.append("path").attr("d",d(h)).attr("id",n.id).attr("class"," "+f+(n.classes?" "+n.classes:"")).attr("style",n.style);let g="";switch((nx().flowchart.arrowMarkerAbsolute||nx().state.arrowMarkerAbsolute)&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),vm.info("arrowTypeStart",n.arrowTypeStart),vm.info("arrowTypeEnd",n.arrowTypeEnd),n.arrowTypeStart){case"arrow_cross":p.attr("marker-start","url("+g+"#"+r+"-crossStart)");break;case"arrow_point":p.attr("marker-start","url("+g+"#"+r+"-pointStart)");break;case"arrow_barb":p.attr("marker-start","url("+g+"#"+r+"-barbStart)");break;case"arrow_circle":p.attr("marker-start","url("+g+"#"+r+"-circleStart)");break;case"aggregation":p.attr("marker-start","url("+g+"#"+r+"-aggregationStart)");break;case"extension":p.attr("marker-start","url("+g+"#"+r+"-extensionStart)");break;case"composition":p.attr("marker-start","url("+g+"#"+r+"-compositionStart)");break;case"dependency":p.attr("marker-start","url("+g+"#"+r+"-dependencyStart)");break;case"lollipop":p.attr("marker-start","url("+g+"#"+r+"-lollipopStart)")}switch(n.arrowTypeEnd){case"arrow_cross":p.attr("marker-end","url("+g+"#"+r+"-crossEnd)");break;case"arrow_point":p.attr("marker-end","url("+g+"#"+r+"-pointEnd)");break;case"arrow_barb":p.attr("marker-end","url("+g+"#"+r+"-barbEnd)");break;case"arrow_circle":p.attr("marker-end","url("+g+"#"+r+"-circleEnd)");break;case"aggregation":p.attr("marker-end","url("+g+"#"+r+"-aggregationEnd)");break;case"extension":p.attr("marker-end","url("+g+"#"+r+"-extensionEnd)");break;case"composition":p.attr("marker-end","url("+g+"#"+r+"-compositionEnd)");break;case"dependency":p.attr("marker-end","url("+g+"#"+r+"-dependencyEnd)");break;case"lollipop":p.attr("marker-end","url("+g+"#"+r+"-lollipopEnd)")}let y={};return o&&(y.updatedPath=a),y.originalPath=n.points,y}(o,t,i,aw,n,e);((t,e)=>{vm.info("Moving label abc78 ",t.id,t.label,Dw[t.id]);let n=e.updatedPath?e.updatedPath:e.originalPath;if(t.label){const i=Dw[t.id];let r=t.x,s=t.y;if(n){const i=q_.calcLabelPosition(n);vm.info("Moving label "+t.label+" from (",r,",",s,") to (",i.x,",",i.y,") abc78"),e.updatedPath&&(r=i.x,s=i.y)}i.attr("transform","translate("+r+", "+s+")")}if(t.startLabelLeft){const e=Lw[t.id].startLeft;let i=t.x,r=t.y;if(n){const e=q_.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.startLabelRight){const e=Lw[t.id].startRight;let i=t.x,r=t.y;if(n){const e=q_.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.endLabelLeft){const e=Lw[t.id].endLeft;let i=t.x,r=t.y;if(n){const e=q_.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}if(t.endLabelRight){const e=Lw[t.id].endRight;let i=t.x,r=t.y;if(n){const e=q_.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=e.x,r=e.y}e.attr("transform","translate("+i+", "+r+")")}})(i,r)})),e.nodes().forEach((function(t){const n=e.node(t);vm.info(t,n.type,n.diff),"group"===n.type&&(h=n.diff)})),{elem:s,diff:h}},Nw=(t,e,n,i,r)=>{ew(t,n,i,r),Cw={},Dw={},Lw={},Aw={},ow={},cw={},aw={},vm.warn("Graph at first:",am(e)),((t,e)=>{!t||e>10?vm.debug("Opting out, no graph "):(vm.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(vm.warn("Cluster identified",e," Replacement id in edges: ",dw(e,t)),ow[e]=uw(e,t),aw[e]={id:dw(e,t),clusterData:t.node(e)})})),t.nodes().forEach((function(e){const n=t.children(e),i=t.edges();n.length>0?(vm.debug("Cluster identified",e,ow),i.forEach((t=>{t.v!==e&&t.w!==e&&lw(t.v,e)^lw(t.w,e)&&(vm.warn("Edge: ",t," leaves cluster ",e),vm.warn("Decendants of XXX ",e,": ",ow[e]),aw[e].externalConnections=!0)}))):vm.debug("Not a cluster ",e,ow)})),t.edges().forEach((function(e){const n=t.edge(e);vm.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),vm.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let i=e.v,r=e.w;if(vm.warn("Fix XXX",aw,"ids:",e.v,e.w,"Translating: ",aw[e.v]," --- ",aw[e.w]),aw[e.v]&&aw[e.w]&&aw[e.v]===aw[e.w]){vm.warn("Fixing and trixing link to self - removing XXX",e.v,e.w,e.name),vm.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),i=fw(e.v),r=fw(e.w),t.removeEdge(e.v,e.w,e.name);const s=e.w+"---"+e.v;t.setNode(s,{domId:s,id:s,labelStyle:"",labelText:n.label,padding:0,shape:"labelRect",style:""});const a=JSON.parse(JSON.stringify(n)),o=JSON.parse(JSON.stringify(n));a.label="",a.arrowTypeEnd="none",o.label="",a.fromCluster=e.v,o.toCluster=e.v,t.setEdge(i,s,a,e.name+"-cyclic-special"),t.setEdge(s,r,o,e.name+"-cyclic-special")}else(aw[e.v]||aw[e.w])&&(vm.warn("Fixing and trixing - removing XXX",e.v,e.w,e.name),i=fw(e.v),r=fw(e.w),t.removeEdge(e.v,e.w,e.name),i!==e.v&&(n.fromCluster=e.v),r!==e.w&&(n.toCluster=e.w),vm.warn("Fix Replacing with XXX",i,r,e.name),t.setEdge(i,r,n,e.name))})),vm.warn("Adjusted Graph",am(t)),pw(t,0),vm.trace(aw))})(e),vm.warn("Graph after:",am(e)),Bw(t,e,i)},Iw=t=>Mm.sanitizeText(t,nx());let Fw={dividerMargin:10,padding:5,textHeight:10};function Rw(t){let e;switch(t){case 0:e="aggregation";break;case 1:e="extension";break;case 2:e="composition";break;case 3:e="dependency";break;case 4:e="lollipop";break;default:e="none"}return e}const $w={setConf:function(t){Object.keys(t).forEach((function(e){Fw[e]=t[e]}))},draw:function(t,e,n,i){vm.info("Drawing class - ",e);const r=nx().flowchart,s=nx().securityLevel;vm.info("config:",r);const a=r.nodeSpacing||50,o=r.rankSpacing||50,c=new Pf({multigraph:!0,compound:!0}).setGraph({rankdir:i.db.getDirection(),nodesep:a,ranksep:o,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),l=i.db.getClasses(),h=i.db.getRelations(),u=i.db.getNotes();let d;vm.info(h),function(t,e,n,i){const r=Object.keys(t);vm.info("keys:",r),vm.info(t),r.forEach((function(n){const r=t[n];let s="";r.cssClasses.length>0&&(s=s+" "+r.cssClasses.join(" "));const a={labelStyle:""};let o=void 0!==r.text?r.text:r.id,c="";r.type,c="class_box",e.setNode(r.id,{labelStyle:a.labelStyle,shape:c,labelText:Iw(o),classData:r,rx:0,ry:0,class:s,style:a.style,id:r.id,domId:r.domId,tooltip:i.db.getTooltip(r.id)||"",haveCallback:r.haveCallback,link:r.link,width:"group"===r.type?500:void 0,type:r.type,padding:nx().flowchart.padding}),vm.info("setNode",{labelStyle:a.labelStyle,shape:c,labelText:o,rx:0,ry:0,class:s,style:a.style,id:r.id,width:"group"===r.type?500:void 0,type:r.type,padding:nx().flowchart.padding})}))}(l,c,0,i),function(t,e){const n=nx().flowchart;let i=0;t.forEach((function(r){i++;const s={classes:"relation"};s.pattern=1==r.relation.lineType?"dashed":"solid",s.id="id"+i,"arrow_open"===r.type?s.arrowhead="none":s.arrowhead="normal",vm.info(s,r),s.startLabelRight="none"===r.relationTitle1?"":r.relationTitle1,s.endLabelLeft="none"===r.relationTitle2?"":r.relationTitle2,s.arrowTypeStart=Rw(r.relation.type1),s.arrowTypeEnd=Rw(r.relation.type2);let a="",o="";if(void 0!==r.style){const t=M_(r.style);a=t.style,o=t.labelStyle}else a="fill:none";s.style=a,s.labelStyle=o,void 0!==r.interpolate?s.curve=L_(r.interpolate,yo):void 0!==t.defaultInterpolate?s.curve=L_(t.defaultInterpolate,yo):s.curve=L_(n.curve,yo),r.text=r.title,void 0===r.text?void 0!==r.style&&(s.arrowheadStyle="fill: #333"):(s.arrowheadStyle="fill: #333",s.labelpos="c",nx().flowchart.htmlLabels?(s.labelType="html",s.label='<span class="edgeLabel">'+r.text+"</span>"):(s.labelType="text",s.label=r.text.replace(Mm.lineBreakRegex,"\n"),void 0===r.style&&(s.style=s.style||"stroke: #333; stroke-width: 1.5px;fill:none"),s.labelStyle=s.labelStyle.replace("color:","fill:"))),e.setEdge(r.id1,r.id2,s,i)}))}(h,c),function(t,e,n,i){vm.info(t),t.forEach((function(t,r){const s=t,a="",o="";let c=s.text,l="note";if(e.setNode(s.id,{labelStyle:a,shape:l,labelText:Iw(c),noteData:s,rx:0,ry:0,class:"",style:o,id:s.id,domId:s.id,tooltip:"",type:"note",padding:nx().flowchart.padding}),vm.info("setNode",{labelStyle:a,shape:l,labelText:c,rx:0,ry:0,style:o,id:s.id,type:"note",padding:nx().flowchart.padding}),!s.class||!(s.class in i))return;const h=n+r,u={classes:"relation",pattern:"dotted"};u.id=`edgeNote${h}`,u.arrowhead="none",vm.info(`Note edge: ${JSON.stringify(u)}, ${JSON.stringify(s)}`),u.startLabelRight="",u.endLabelLeft="",u.arrowTypeStart="none",u.arrowTypeEnd="none",u.style="fill:none",u.labelStyle="",u.curve=L_(Fw.curve,yo),e.setEdge(s.id,s.class,u,h)}))}(u,c,h.length+1,l),"sandbox"===s&&(d=Fa("#i"+e));const f=Fa("sandbox"===s?d.nodes()[0].contentDocument.body:"body"),p=f.select(`[id="${e}"]`),g=f.select("#"+e+" g");if(Nw(g,c,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",e),q_.insertTitle(p,"classTitleText",r.titleTopMargin,i.db.getDiagramTitle()),hx(c,p,r.diagramPadding,r.useMaxWidth),!r.htmlLabels){const t="sandbox"===s?d.nodes()[0].contentDocument:document,n=t.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const e of n){const n=e.getBBox(),i=t.createElementNS("http://www.w3.org/2000/svg","rect");i.setAttribute("rx",0),i.setAttribute("ry",0),i.setAttribute("width",n.width),i.setAttribute("height",n.height),e.insertBefore(i,e.firstChild)}}}};var Pw=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,5],r=[6,9,11,23,25,27,29,30,31,49],s=[1,17],a=[1,18],o=[1,19],c=[1,20],l=[1,21],h=[1,22],u=[1,25],d=[1,30],f=[1,31],p=[1,32],g=[1,33],y=[6,9,11,15,20,23,25,27,29,30,31,42,43,44,45,49],m=[1,45],b=[30,31,46,47],_=[4,6,9,11,23,25,27,29,30,31,49],x=[42,43,44,45],v=[22,37],k=[1,64],w={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,BLOCK_START:20,attributes:21,BLOCK_STOP:22,title:23,title_value:24,acc_title:25,acc_title_value:26,acc_descr:27,acc_descr_value:28,acc_descr_multiline_value:29,ALPHANUM:30,ENTITY_NAME:31,attribute:32,attributeType:33,attributeName:34,attributeKeyType:35,attributeComment:36,ATTRIBUTE_WORD:37,ATTRIBUTE_KEY:38,COMMENT:39,cardinality:40,relType:41,ZERO_OR_ONE:42,ZERO_OR_MORE:43,ONE_OR_MORE:44,ONLY_ONE:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,open_directive:49,type_directive:50,arg_directive:51,close_directive:52,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:"ENTITY_NAME",37:"ATTRIBUTE_WORD",38:"ATTRIBUTE_KEY",39:"COMMENT",42:"ZERO_OR_ONE",43:"ZERO_OR_MORE",44:"ONE_OR_MORE",45:"ONLY_ONE",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,1],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 1:break;case 3:case 7:case 8:this.$=[];break;case 4:s[o-1].push(s[o]),this.$=s[o-1];break;case 5:case 6:case 20:case 41:case 28:case 29:case 30:this.$=s[o];break;case 12:i.addEntity(s[o-4]),i.addEntity(s[o-2]),i.addRelationship(s[o-4],s[o],s[o-2],s[o-3]);break;case 13:i.addEntity(s[o-3]),i.addAttributes(s[o-3],s[o-1]);break;case 14:i.addEntity(s[o-2]);break;case 15:i.addEntity(s[o]);break;case 16:case 17:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 18:case 19:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 21:case 39:case 40:case 31:this.$=s[o].replace(/"/g,"");break;case 22:this.$=[s[o]];break;case 23:s[o].push(s[o-1]),this.$=s[o];break;case 24:this.$={attributeType:s[o-1],attributeName:s[o]};break;case 25:this.$={attributeType:s[o-2],attributeName:s[o-1],attributeKeyType:s[o]};break;case 26:this.$={attributeType:s[o-2],attributeName:s[o-1],attributeComment:s[o]};break;case 27:this.$={attributeType:s[o-3],attributeName:s[o-2],attributeKeyType:s[o-1],attributeComment:s[o]};break;case 32:this.$={cardA:s[o],relType:s[o-1],cardB:s[o-2]};break;case 33:this.$=i.Cardinality.ZERO_OR_ONE;break;case 34:this.$=i.Cardinality.ZERO_OR_MORE;break;case 35:this.$=i.Cardinality.ONE_OR_MORE;break;case 36:this.$=i.Cardinality.ONLY_ONE;break;case 37:this.$=i.Identification.NON_IDENTIFYING;break;case 38:this.$=i.Identification.IDENTIFYING;break;case 42:i.parseDirective("%%{","open_directive");break;case 43:i.parseDirective(s[o],"type_directive");break;case 44:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 45:i.parseDirective("}%%","close_directive","er")}},table:[{3:1,4:n,7:3,12:4,49:i},{1:[3]},e(r,[2,3],{5:6}),{3:7,4:n,7:3,12:4,49:i},{13:8,50:[1,9]},{50:[2,42]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:s,25:a,27:o,29:c,30:l,31:h,49:i},{1:[2,2]},{14:23,15:[1,24],52:u},e([15,52],[2,43]),e(r,[2,8],{1:[2,1]}),e(r,[2,4]),{7:15,10:26,12:4,17:16,23:s,25:a,27:o,29:c,30:l,31:h,49:i},e(r,[2,6]),e(r,[2,7]),e(r,[2,11]),e(r,[2,15],{18:27,40:29,20:[1,28],42:d,43:f,44:p,45:g}),{24:[1,34]},{26:[1,35]},{28:[1,36]},e(r,[2,19]),e(y,[2,20]),e(y,[2,21]),{11:[1,37]},{16:38,51:[1,39]},{11:[2,45]},e(r,[2,5]),{17:40,30:l,31:h},{21:41,22:[1,42],32:43,33:44,37:m},{41:46,46:[1,47],47:[1,48]},e(b,[2,33]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),e(r,[2,16]),e(r,[2,17]),e(r,[2,18]),e(_,[2,9]),{14:49,52:u},{52:[2,44]},{15:[1,50]},{22:[1,51]},e(r,[2,14]),{21:52,22:[2,22],32:43,33:44,37:m},{34:53,37:[1,54]},{37:[2,28]},{40:55,42:d,43:f,44:p,45:g},e(x,[2,37]),e(x,[2,38]),{11:[1,56]},{19:57,30:[1,60],31:[1,59],48:[1,58]},e(r,[2,13]),{22:[2,23]},e(v,[2,24],{35:61,36:62,38:[1,63],39:k}),e([22,37,38,39],[2,29]),e([30,31],[2,32]),e(_,[2,10]),e(r,[2,12]),e(r,[2,39]),e(r,[2,40]),e(r,[2,41]),e(v,[2,25],{36:65,39:k}),e(v,[2,26]),e([22,37,39],[2,30]),e(v,[2,31]),e(v,[2,27])],defaultActions:{5:[2,42],7:[2,2],25:[2,45],39:[2,44],45:[2,28],52:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},T=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("acc_title"),25;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),27;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.begin("open_directive"),49;case 8:return this.begin("type_directive"),50;case 9:return this.popState(),this.begin("arg_directive"),15;case 10:return this.popState(),this.popState(),52;case 11:return 51;case 12:case 13:case 15:case 21:case 26:break;case 14:return 11;case 16:return 9;case 17:return 31;case 18:return 48;case 19:return 4;case 20:return this.begin("block"),20;case 22:return 38;case 23:case 24:return 37;case 25:return 39;case 27:return this.popState(),22;case 28:case 57:return e.yytext[0];case 29:case 33:case 34:case 47:return 42;case 30:case 31:case 32:case 40:case 42:case 49:return 44;case 35:case 36:case 37:case 38:case 39:case 41:case 48:return 43;case 43:case 44:case 45:case 46:return 45;case 50:case 53:case 54:case 55:return 46;case 51:case 52:return 47;case 56:return 30;case 58:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[A-Za-z][A-Za-z0-9\-_\[\]]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/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,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},open_directive:{rules:[8],inclusive:!1},type_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[10,11],inclusive:!1},block:{rules:[21,22,23,24,25,26,27,28],inclusive:!1},INITIAL:{rules:[0,2,4,7,12,13,14,15,16,17,18,19,20,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],inclusive:!0}}},t);function C(){this.yy={}}return w.lexer=T,C.prototype=w,w.Parser=C,new C}();Pw.parser=Pw;const Yw=Pw,jw=t=>null!==t.match(/^\s*erDiagram/);let zw={},Uw=[];const Ww=function(t){return void 0===zw[t]&&(zw[t]={attributes:[]},vm.info("Added new entity :",t)),zw[t]},Hw={Cardinality:{ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().er,addEntity:Ww,addAttributes:function(t,e){let n,i=Ww(t);for(n=e.length-1;n>=0;n--)i.attributes.push(e[n]),vm.debug("Added attribute ",e[n].attributeName)},getEntities:()=>zw,addRelationship:function(t,e,n,i){let r={entityA:t,roleA:e,entityB:n,relSpec:i};Uw.push(r),vm.debug("Added new relationship :",r)},getRelationships:()=>Uw,clear:function(){zw={},Uw=[],Yx()},setAccTitle:jx,getAccTitle:zx,setAccDescription:Ux,getAccDescription:Wx,setDiagramTitle:Hx,getDiagramTitle:qx},qw={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END"},Vw=qw,Gw=function(t,e){let n;t.append("defs").append("marker").attr("id",qw.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",qw.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",qw.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),n=t.append("defs").append("marker").attr("id",qw.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",qw.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").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",qw.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),n=t.append("defs").append("marker").attr("id",qw.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),n=t.append("defs").append("marker").attr("id",qw.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),n.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},Xw=/[^\dA-Za-z](\W)*/g;let Zw={},Qw=new Map;const Kw=function(t,e,n){let i;return Object.keys(e).forEach((function(r){const s=function(t="",e=""){const n=t.replace(Xw,"");return`${eT(e)}${eT(n)}${gm()}`}(r,"entity");Qw.set(r,s);const a=t.append("g").attr("id",s);i=void 0===i?s:i;const o="text-"+s,c=a.append("text").classed("er entityLabel",!0).attr("id",o).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",nx().fontFamily).style("font-size",Zw.fontSize+"px").text(r),{width:l,height:h}=((t,e,n)=>{const i=Zw.entityPadding/3,r=Zw.entityPadding/3,s=.85*Zw.fontSize,a=e.node().getBBox(),o=[];let c=!1,l=!1,h=0,u=0,d=0,f=0,p=a.height+2*i,g=1;n.forEach((t=>{void 0!==t.attributeKeyType&&(c=!0),void 0!==t.attributeComment&&(l=!0)})),n.forEach((n=>{const r=`${e.node().id}-attr-${g}`;let a=0;const y=Om(n.attributeType),m=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",nx().fontFamily).style("font-size",s+"px").text(y),b=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",nx().fontFamily).style("font-size",s+"px").text(n.attributeName),_={};_.tn=m,_.nn=b;const x=m.node().getBBox(),v=b.node().getBBox();if(h=Math.max(h,x.width),u=Math.max(u,v.width),a=Math.max(x.height,v.height),c){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",nx().fontFamily).style("font-size",s+"px").text(n.attributeKeyType||"");_.kn=e;const i=e.node().getBBox();d=Math.max(d,i.width),a=Math.max(a,i.height)}if(l){const e=t.append("text").classed("er entityLabel",!0).attr("id",`${r}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",nx().fontFamily).style("font-size",s+"px").text(n.attributeComment||"");_.cn=e;const i=e.node().getBBox();f=Math.max(f,i.width),a=Math.max(a,i.height)}_.height=a,o.push(_),p+=a+2*i,g+=1}));let y=4;c&&(y+=2),l&&(y+=2);const m=h+u+d+f,b={width:Math.max(Zw.minEntityWidth,Math.max(a.width+2*Zw.entityPadding,m+r*y)),height:n.length>0?p:Math.max(Zw.minEntityHeight,a.height+2*Zw.entityPadding)};if(n.length>0){const n=Math.max(0,(b.width-m-r*y)/(y/2));e.attr("transform","translate("+b.width/2+","+(i+a.height/2)+")");let s=a.height+2*i,p="attributeBoxOdd";o.forEach((e=>{const a=s+i+e.height/2;e.tn.attr("transform","translate("+r+","+a+")");const o=t.insert("rect","#"+e.tn.node().id).classed(`er ${p}`,!0).attr("x",0).attr("y",s).attr("width",h+2*r+n).attr("height",e.height+2*i),g=parseFloat(o.attr("x"))+parseFloat(o.attr("width"));e.nn.attr("transform","translate("+(g+r)+","+a+")");const y=t.insert("rect","#"+e.nn.node().id).classed(`er ${p}`,!0).attr("x",g).attr("y",s).attr("width",u+2*r+n).attr("height",e.height+2*i);let m=parseFloat(y.attr("x"))+parseFloat(y.attr("width"));if(c){e.kn.attr("transform","translate("+(m+r)+","+a+")");const o=t.insert("rect","#"+e.kn.node().id).classed(`er ${p}`,!0).attr("x",m).attr("y",s).attr("width",d+2*r+n).attr("height",e.height+2*i);m=parseFloat(o.attr("x"))+parseFloat(o.attr("width"))}l&&(e.cn.attr("transform","translate("+(m+r)+","+a+")"),t.insert("rect","#"+e.cn.node().id).classed(`er ${p}`,"true").attr("x",m).attr("y",s).attr("width",f+2*r+n).attr("height",e.height+2*i)),s+=e.height+2*i,p="attributeBoxOdd"===p?"attributeBoxEven":"attributeBoxOdd"}))}else b.height=Math.max(Zw.minEntityHeight,p),e.attr("transform","translate("+b.width/2+","+b.height/2+")");return b})(a,c,e[r].attributes),u=a.insert("rect","#"+o).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",l).attr("height",h).node().getBBox();n.setNode(s,{width:u.width,height:u.height,shape:"rect",id:s})})),i},Jw=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")};let tT=0;function eT(t=""){return t.length>0?`${t}-`:""}const nT={setConf:function(t){const e=Object.keys(t);for(const n of e)Zw[n]=t[n]},draw:function(t,e,n,i){Zw=nx().er,vm.info("Drawing ER diagram");const r=nx().securityLevel;let s;"sandbox"===r&&(s=Fa("#i"+e));const a=Fa("sandbox"===r?s.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);let o;Gw(a,Zw),o=new Pf({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:Zw.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));const c=Kw(a,i.db.getEntities(),o),l=function(t,e){return t.forEach((function(t){e.setEdge(Qw.get(t.entityA),Qw.get(t.entityB),{relationship:t},Jw(t))})),t}(i.db.getRelationships(),o);by(o),function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )")}))}(a,o),l.forEach((function(t){!function(t,e,n,i,r){tT++;const s=n.edge(Qw.get(e.entityA),Qw.get(e.entityB),Jw(e)),a=_o().x((function(t){return t.x})).y((function(t){return t.y})).curve(Co),o=t.insert("path","#"+i).classed("er relationshipLine",!0).attr("d",a(s.points)).style("stroke",Zw.stroke).style("fill","none");e.relSpec.relType===r.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let c="";switch(Zw.arrowMarkerAbsolute&&(c=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,c=c.replace(/\(/g,"\\("),c=c.replace(/\)/g,"\\)")),e.relSpec.cardA){case r.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+c+"#"+Vw.ZERO_OR_ONE_END+")");break;case r.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+c+"#"+Vw.ZERO_OR_MORE_END+")");break;case r.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+c+"#"+Vw.ONE_OR_MORE_END+")");break;case r.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+c+"#"+Vw.ONLY_ONE_END+")")}switch(e.relSpec.cardB){case r.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+c+"#"+Vw.ZERO_OR_ONE_START+")");break;case r.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+c+"#"+Vw.ZERO_OR_MORE_START+")");break;case r.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+c+"#"+Vw.ONE_OR_MORE_START+")");break;case r.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+c+"#"+Vw.ONLY_ONE_START+")")}const l=o.node().getTotalLength(),h=o.node().getPointAtLength(.5*l),u="rel"+tT,d=t.append("text").classed("er relationshipLabel",!0).attr("id",u).attr("x",h.x).attr("y",h.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",nx().fontFamily).style("font-size",Zw.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+u).classed("er relationshipLabelBox",!0).attr("x",h.x-d.width/2).attr("y",h.y-d.height/2).attr("width",d.width).attr("height",d.height)}(a,t,o,c,i)}));const h=Zw.diagramPadding;q_.insertTitle(a,"entityTitleText",Zw.titleTopMargin,i.db.getDiagramTitle());const u=a.node().getBBox(),d=u.width+2*h,f=u.height+2*h;lx(a,f,d,Zw.useMaxWidth),a.attr("viewBox",`${u.x-h} ${u.y-h} ${d} ${f}`)}};var iT=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,9],i=[1,7],r=[1,6],s=[1,8],a=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],o=[2,10],c=[1,20],l=[1,21],h=[1,22],u=[1,23],d=[1,30],f=[1,32],p=[1,33],g=[1,34],y=[1,62],m=[1,48],b=[1,52],_=[1,36],x=[1,37],v=[1,38],k=[1,39],w=[1,40],T=[1,56],C=[1,63],E=[1,51],S=[1,53],A=[1,55],D=[1,59],L=[1,60],O=[1,41],M=[1,42],B=[1,43],N=[1,44],I=[1,61],F=[1,50],R=[1,54],$=[1,57],P=[1,58],Y=[1,49],j=[1,66],z=[1,71],U=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],W=[1,75],H=[1,74],q=[1,76],V=[20,21,23,81,82],G=[1,99],X=[1,104],Z=[1,107],Q=[1,108],K=[1,101],J=[1,106],tt=[1,109],et=[1,102],nt=[1,114],it=[1,113],rt=[1,103],st=[1,105],at=[1,110],ot=[1,111],ct=[1,112],lt=[1,115],ht=[20,21,22,23,81,82],ut=[20,21,22,23,53,81,82],dt=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],ft=[20,21,23],pt=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],gt=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],yt=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],mt=[1,149],bt=[1,157],_t=[1,158],xt=[1,159],vt=[1,160],kt=[1,144],wt=[1,145],Tt=[1,141],Ct=[1,152],Et=[1,153],St=[1,154],At=[1,155],Dt=[1,156],Lt=[1,161],Ot=[1,162],Mt=[1,147],Bt=[1,150],Nt=[1,146],It=[1,143],Ft=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],Rt=[1,165],$t=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],Pt=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],Yt=[12,21,22,24],jt=[22,106],zt=[1,250],Ut=[1,245],Wt=[1,246],Ht=[1,254],qt=[1,251],Vt=[1,248],Gt=[1,247],Xt=[1,249],Zt=[1,252],Qt=[1,253],Kt=[1,255],Jt=[1,273],te=[20,21,23,106],ee=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113],ne={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,openDirective:6,typeDirective:7,closeDirective:8,separator:9,":":10,argDirective:11,open_directive:12,type_directive:13,arg_directive:14,close_directive:15,graphConfig:16,document:17,line:18,statement:19,SEMI:20,NEWLINE:21,SPACE:22,EOF:23,GRAPH:24,NODIR:25,DIR:26,FirstStmtSeperator:27,ending:28,endToken:29,spaceList:30,spaceListNewline:31,verticeStatement:32,styleStatement:33,linkStyleStatement:34,classDefStatement:35,classStatement:36,clickStatement:37,subgraph:38,text:39,SQS:40,SQE:41,end:42,direction:43,acc_title:44,acc_title_value:45,acc_descr:46,acc_descr_value:47,acc_descr_multiline_value:48,link:49,node:50,vertex:51,AMP:52,STYLE_SEPARATOR:53,idString:54,DOUBLECIRCLESTART:55,DOUBLECIRCLEEND:56,PS:57,PE:58,"(-":59,"-)":60,STADIUMSTART:61,STADIUMEND:62,SUBROUTINESTART:63,SUBROUTINEEND:64,VERTEX_WITH_PROPS_START:65,ALPHA:66,COLON:67,PIPE:68,CYLINDERSTART:69,CYLINDEREND:70,DIAMOND_START:71,DIAMOND_STOP:72,TAGEND:73,TRAPSTART:74,TRAPEND:75,INVTRAPSTART:76,INVTRAPEND:77,linkStatement:78,arrowText:79,TESTSTR:80,START_LINK:81,LINK:82,textToken:83,STR:84,keywords:85,STYLE:86,LINKSTYLE:87,CLASSDEF:88,CLASS:89,CLICK:90,DOWN:91,UP:92,textNoTags:93,textNoTagsToken:94,DEFAULT:95,stylesOpt:96,alphaNum:97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,HEX:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,MINUS:109,UNIT:110,BRKT:111,DOT:112,PCT:113,TAGSTART:114,alphaNumToken:115,idStringToken:116,alphaNumStatement:117,direction_tb:118,direction_bt:119,direction_rl:120,direction_lr:121,PUNCTUATION:122,UNICODE_TEXT:123,PLUS:124,EQUALS:125,MULT:126,UNDERSCORE:127,graphCodeTokens:128,ARROW_CROSS:129,ARROW_POINT:130,ARROW_CIRCLE:131,ARROW_OPEN:132,QUOTE:133,$accept:0,$end:1},terminals_:{2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"},productions_:[0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 5:i.parseDirective("%%{","open_directive");break;case 6:i.parseDirective(s[o],"type_directive");break;case 7:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 8:i.parseDirective("}%%","close_directive","flowchart");break;case 10:case 36:case 37:case 38:case 39:case 40:this.$=[];break;case 11:(!Array.isArray(s[o])||s[o].length>0)&&s[o-1].push(s[o]),this.$=s[o-1];break;case 12:case 82:case 84:case 96:case 152:case 154:case 155:case 78:case 150:this.$=s[o];break;case 19:i.setDirection("TB"),this.$="TB";break;case 20:i.setDirection(s[o-1]),this.$=s[o-1];break;case 35:this.$=s[o-1].nodes;break;case 41:this.$=i.addSubGraph(s[o-6],s[o-1],s[o-4]);break;case 42:this.$=i.addSubGraph(s[o-3],s[o-1],s[o-3]);break;case 43:this.$=i.addSubGraph(void 0,s[o-1],void 0);break;case 45:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 46:case 47:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 51:i.addLink(s[o-2].stmt,s[o],s[o-1]),this.$={stmt:s[o],nodes:s[o].concat(s[o-2].nodes)};break;case 52:i.addLink(s[o-3].stmt,s[o-1],s[o-2]),this.$={stmt:s[o-1],nodes:s[o-1].concat(s[o-3].nodes)};break;case 53:this.$={stmt:s[o-1],nodes:s[o-1]};break;case 54:this.$={stmt:s[o],nodes:s[o]};break;case 55:case 123:case 125:this.$=[s[o]];break;case 56:this.$=s[o-4].concat(s[o]);break;case 57:this.$=[s[o-2]],i.setClass(s[o-2],s[o]);break;case 58:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"square");break;case 59:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"doublecircle");break;case 60:this.$=s[o-5],i.addVertex(s[o-5],s[o-2],"circle");break;case 61:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"ellipse");break;case 62:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"stadium");break;case 63:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"subroutine");break;case 64:this.$=s[o-7],i.addVertex(s[o-7],s[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[o-5],s[o-3]]]));break;case 65:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"cylinder");break;case 66:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"round");break;case 67:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"diamond");break;case 68:this.$=s[o-5],i.addVertex(s[o-5],s[o-2],"hexagon");break;case 69:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"odd");break;case 70:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"trapezoid");break;case 71:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"inv_trapezoid");break;case 72:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"lean_right");break;case 73:this.$=s[o-3],i.addVertex(s[o-3],s[o-1],"lean_left");break;case 74:this.$=s[o],i.addVertex(s[o]);break;case 75:s[o-1].text=s[o],this.$=s[o-1];break;case 76:case 77:s[o-2].text=s[o-1],this.$=s[o-2];break;case 79:var c=i.destructLink(s[o],s[o-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:s[o-1]};break;case 80:c=i.destructLink(s[o]);this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 81:this.$=s[o-1];break;case 83:case 97:case 153:case 151:this.$=s[o-1]+""+s[o];break;case 98:case 99:this.$=s[o-4],i.addClass(s[o-2],s[o]);break;case 100:this.$=s[o-4],i.setClass(s[o-2],s[o]);break;case 101:case 109:this.$=s[o-1],i.setClickEvent(s[o-1],s[o]);break;case 102:case 110:this.$=s[o-3],i.setClickEvent(s[o-3],s[o-2]),i.setTooltip(s[o-3],s[o]);break;case 103:this.$=s[o-2],i.setClickEvent(s[o-2],s[o-1],s[o]);break;case 104:this.$=s[o-4],i.setClickEvent(s[o-4],s[o-3],s[o-2]),i.setTooltip(s[o-4],s[o]);break;case 105:case 111:this.$=s[o-1],i.setLink(s[o-1],s[o]);break;case 106:case 112:this.$=s[o-3],i.setLink(s[o-3],s[o-2]),i.setTooltip(s[o-3],s[o]);break;case 107:case 113:this.$=s[o-3],i.setLink(s[o-3],s[o-2],s[o]);break;case 108:case 114:this.$=s[o-5],i.setLink(s[o-5],s[o-4],s[o]),i.setTooltip(s[o-5],s[o-2]);break;case 115:this.$=s[o-4],i.addVertex(s[o-2],void 0,void 0,s[o]);break;case 116:case 118:this.$=s[o-4],i.updateLink(s[o-2],s[o]);break;case 117:this.$=s[o-4],i.updateLink([s[o-2]],s[o]);break;case 119:this.$=s[o-8],i.updateLinkInterpolate([s[o-6]],s[o-2]),i.updateLink([s[o-6]],s[o]);break;case 120:this.$=s[o-8],i.updateLinkInterpolate(s[o-6],s[o-2]),i.updateLink(s[o-6],s[o]);break;case 121:this.$=s[o-6],i.updateLinkInterpolate([s[o-4]],s[o]);break;case 122:this.$=s[o-6],i.updateLinkInterpolate(s[o-4],s[o]);break;case 124:case 126:s[o-2].push(s[o]),this.$=s[o-2];break;case 128:this.$=s[o-1]+s[o];break;case 156:this.$="v";break;case 157:this.$="-";break;case 158:this.$={stmt:"dir",value:"TB"};break;case 159:this.$={stmt:"dir",value:"BT"};break;case 160:this.$={stmt:"dir",value:"RL"};break;case 161:this.$={stmt:"dir",value:"LR"}}},table:[{3:1,4:2,5:3,6:5,12:n,16:4,21:i,22:r,24:s},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:n,16:4,21:i,22:r,24:s},e(a,o,{17:11}),{7:12,13:[1,13]},{16:14,21:i,22:r,24:s},{16:15,21:i,22:r,24:s},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:c,21:l,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,43:31,44:f,46:p,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:M,120:B,121:N,122:I,123:F,124:R,125:$,126:P,127:Y},{8:64,10:[1,65],15:j},e([10,15],[2,6]),e(a,[2,17]),e(a,[2,18]),e(a,[2,19]),{20:[1,68],21:[1,69],22:z,27:67,30:70},e(U,[2,11]),e(U,[2,12]),e(U,[2,13]),e(U,[2,14]),e(U,[2,15]),e(U,[2,16]),{9:72,20:W,21:H,23:q,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:W,21:H,23:q},{9:81,20:W,21:H,23:q},{9:82,20:W,21:H,23:q},{9:83,20:W,21:H,23:q},{9:84,20:W,21:H,23:q},{9:86,20:W,21:H,22:[1,85],23:q},e(U,[2,44]),{45:[1,87]},{47:[1,88]},e(U,[2,47]),e(V,[2,54],{30:89,22:z}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:G,52:X,66:Z,67:Q,84:[1,97],91:K,97:96,98:[1,94],100:[1,95],105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(U,[2,158]),e(U,[2,159]),e(U,[2,160]),e(U,[2,161]),e(ht,[2,55],{53:[1,116]}),e(ut,[2,74],{116:129,40:[1,117],52:y,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:m,67:b,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:T,95:C,105:E,106:S,109:A,111:D,112:L,122:I,123:F,124:R,125:$,126:P,127:Y}),e(dt,[2,150]),e(dt,[2,175]),e(dt,[2,176]),e(dt,[2,177]),e(dt,[2,178]),e(dt,[2,179]),e(dt,[2,180]),e(dt,[2,181]),e(dt,[2,182]),e(dt,[2,183]),e(dt,[2,184]),e(dt,[2,185]),e(dt,[2,186]),e(dt,[2,187]),e(dt,[2,188]),e(dt,[2,189]),e(dt,[2,190]),{9:130,20:W,21:H,23:q},{11:131,14:[1,132]},e(ft,[2,8]),e(a,[2,20]),e(a,[2,26]),e(a,[2,27]),{21:[1,133]},e(pt,[2,34],{30:134,22:z}),e(U,[2,35]),{50:135,51:45,52:y,54:46,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},e(gt,[2,48]),e(gt,[2,49]),e(gt,[2,50]),e(yt,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:mt,24:bt,26:_t,38:xt,39:139,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),e(U,[2,36]),e(U,[2,37]),e(U,[2,38]),e(U,[2,39]),e(U,[2,40]),{22:mt,24:bt,26:_t,38:xt,39:163,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(Ft,o,{17:164}),e(U,[2,45]),e(U,[2,46]),e(V,[2,53],{52:Rt}),{26:G,52:X,66:Z,67:Q,91:K,97:166,102:[1,167],105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{95:[1,168],103:169,105:[1,170]},{26:G,52:X,66:Z,67:Q,91:K,95:[1,171],97:172,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{26:G,52:X,66:Z,67:Q,91:K,97:173,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ft,[2,101],{22:[1,174],99:[1,175]}),e(ft,[2,105],{22:[1,176]}),e(ft,[2,109],{115:100,117:178,22:[1,177],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:st,124:at,125:ot,126:ct,127:lt}),e(ft,[2,111],{22:[1,179]}),e($t,[2,152]),e($t,[2,154]),e($t,[2,155]),e($t,[2,156]),e($t,[2,157]),e(Pt,[2,162]),e(Pt,[2,163]),e(Pt,[2,164]),e(Pt,[2,165]),e(Pt,[2,166]),e(Pt,[2,167]),e(Pt,[2,168]),e(Pt,[2,169]),e(Pt,[2,170]),e(Pt,[2,171]),e(Pt,[2,172]),e(Pt,[2,173]),e(Pt,[2,174]),{52:y,54:180,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},{22:mt,24:bt,26:_t,38:xt,39:181,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:182,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:184,42:vt,52:X,57:[1,183],66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:185,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:186,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:187,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{66:[1,188]},{22:mt,24:bt,26:_t,38:xt,39:189,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:190,42:vt,52:X,66:Z,67:Q,71:[1,191],73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:192,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:193,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:194,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(dt,[2,151]),e(Yt,[2,3]),{8:195,15:j},{15:[2,7]},e(a,[2,28]),e(pt,[2,33]),e(V,[2,51],{30:196,22:z}),e(yt,[2,75],{22:[1,197]}),{22:[1,198]},{22:mt,24:bt,26:_t,38:xt,39:199,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,82:[1,200],83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(Pt,[2,82]),e(Pt,[2,84]),e(Pt,[2,140]),e(Pt,[2,141]),e(Pt,[2,142]),e(Pt,[2,143]),e(Pt,[2,144]),e(Pt,[2,145]),e(Pt,[2,146]),e(Pt,[2,147]),e(Pt,[2,148]),e(Pt,[2,149]),e(Pt,[2,85]),e(Pt,[2,86]),e(Pt,[2,87]),e(Pt,[2,88]),e(Pt,[2,89]),e(Pt,[2,90]),e(Pt,[2,91]),e(Pt,[2,92]),e(Pt,[2,93]),e(Pt,[2,94]),e(Pt,[2,95]),{9:203,20:W,21:H,22:mt,23:q,24:bt,26:_t,38:xt,40:[1,202],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{18:18,19:19,20:c,21:l,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,204],43:31,44:f,46:p,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:M,120:B,121:N,122:I,123:F,124:R,125:$,126:P,127:Y},{22:z,30:205},{22:[1,206],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},e(jt,[2,123]),{22:[1,211]},{22:[1,212],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:[1,213],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,115:100,117:178,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{84:[1,214]},e(ft,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},e($t,[2,153]),{84:[1,219],101:[1,220]},e(ht,[2,57],{116:129,52:y,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,122:I,123:F,124:R,125:$,126:P,127:Y}),{22:mt,24:bt,26:_t,38:xt,41:[1,221],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,56:[1,222],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:223,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,58:[1,224],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,60:[1,225],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,62:[1,226],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,64:[1,227],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{67:[1,228]},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,70:[1,229],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,72:[1,230],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,39:231,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,41:[1,232],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,75:[1,233],77:[1,234],81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,73:kt,75:[1,236],77:[1,235],81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{9:237,20:W,21:H,23:q},e(V,[2,52],{52:Rt}),e(yt,[2,77]),e(yt,[2,76]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,68:[1,238],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(yt,[2,79]),e(Pt,[2,83]),{22:mt,24:bt,26:_t,38:xt,39:239,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(Ft,o,{17:240}),e(U,[2,43]),{51:241,52:y,54:46,66:m,67:b,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,122:I,123:F,124:R,125:$,126:P,127:Y},{22:zt,66:Ut,67:Wt,86:Ht,96:242,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:256,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:257,102:qt,104:[1,258],105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:259,102:qt,104:[1,260],105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{105:[1,261]},{22:zt,66:Ut,67:Wt,86:Ht,96:262,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:263,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{26:G,52:X,66:Z,67:Q,91:K,97:264,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ft,[2,102]),{84:[1,265]},e(ft,[2,106],{22:[1,266]}),e(ft,[2,107]),e(ft,[2,110]),e(ft,[2,112],{22:[1,267]}),e(ft,[2,113]),e(ut,[2,58]),e(ut,[2,59]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,58:[1,268],66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ut,[2,66]),e(ut,[2,61]),e(ut,[2,62]),e(ut,[2,63]),{66:[1,269]},e(ut,[2,65]),e(ut,[2,67]),{22:mt,24:bt,26:_t,38:xt,42:vt,52:X,66:Z,67:Q,72:[1,270],73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ut,[2,69]),e(ut,[2,70]),e(ut,[2,72]),e(ut,[2,71]),e(ut,[2,73]),e(Yt,[2,4]),e([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:mt,24:bt,26:_t,38:xt,41:[1,271],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{18:18,19:19,20:c,21:l,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,272],43:31,44:f,46:p,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:M,120:B,121:N,122:I,123:F,124:R,125:$,126:P,127:Y},e(ht,[2,56]),e(ft,[2,115],{106:Jt}),e(te,[2,125],{108:274,22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt}),e(ee,[2,127]),e(ee,[2,129]),e(ee,[2,130]),e(ee,[2,131]),e(ee,[2,132]),e(ee,[2,133]),e(ee,[2,134]),e(ee,[2,135]),e(ee,[2,136]),e(ee,[2,137]),e(ee,[2,138]),e(ee,[2,139]),e(ft,[2,116],{106:Jt}),e(ft,[2,117],{106:Jt}),{22:[1,275]},e(ft,[2,118],{106:Jt}),{22:[1,276]},e(jt,[2,124]),e(ft,[2,98],{106:Jt}),e(ft,[2,99],{106:Jt}),e(ft,[2,100],{115:100,117:178,26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:st,124:at,125:ot,126:ct,127:lt}),e(ft,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:W,21:H,23:q},e(U,[2,42]),{22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,107:283,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},e(ee,[2,128]),{26:G,52:X,66:Z,67:Q,91:K,97:284,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{26:G,52:X,66:Z,67:Q,91:K,97:285,105:J,106:tt,109:et,111:nt,112:it,115:100,117:98,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ft,[2,108]),e(ft,[2,114]),e(ut,[2,60]),{22:mt,24:bt,26:_t,38:xt,39:286,42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:140,84:Tt,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},e(ut,[2,68]),e(Ft,o,{17:287}),e(te,[2,126],{108:274,22:zt,66:Ut,67:Wt,86:Ht,102:qt,105:Vt,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt}),e(ft,[2,121],{115:100,117:178,22:[1,288],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:st,124:at,125:ot,126:ct,127:lt}),e(ft,[2,122],{115:100,117:178,22:[1,289],26:G,52:X,66:Z,67:Q,91:K,105:J,106:tt,109:et,111:nt,112:it,122:rt,123:st,124:at,125:ot,126:ct,127:lt}),{22:mt,24:bt,26:_t,38:xt,41:[1,290],42:vt,52:X,66:Z,67:Q,73:kt,81:wt,83:201,85:151,86:Ct,87:Et,88:St,89:At,90:Dt,91:Lt,92:Ot,94:142,95:Mt,105:J,106:tt,109:Bt,111:nt,112:it,113:Nt,114:It,115:148,122:rt,123:st,124:at,125:ot,126:ct,127:lt},{18:18,19:19,20:c,21:l,22:h,23:u,32:24,33:25,34:26,35:27,36:28,37:29,38:d,42:[1,291],43:31,44:f,46:p,48:g,50:35,51:45,52:y,54:46,66:m,67:b,86:_,87:x,88:v,89:k,90:w,91:T,95:C,105:E,106:S,109:A,111:D,112:L,116:47,118:O,119:M,120:B,121:N,122:I,123:F,124:R,125:$,126:P,127:Y},{22:zt,66:Ut,67:Wt,86:Ht,96:292,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},{22:zt,66:Ut,67:Wt,86:Ht,96:293,102:qt,105:Vt,107:243,108:244,109:Gt,110:Xt,111:Zt,112:Qt,113:Kt},e(ut,[2,64]),e(U,[2,41]),e(ft,[2,119],{106:Jt}),e(ft,[2,120],{106:Jt})],defaultActions:{2:[2,1],9:[2,5],10:[2,2],132:[2,7]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},ie=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:case 6:break;case 7:return this.begin("acc_title"),44;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),46;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:case 15:case 24:case 27:case 30:case 33:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:this.begin("string");break;case 16:return"STR";case 17:return 86;case 18:return 95;case 19:return 87;case 20:return 104;case 21:return 88;case 22:return 89;case 23:this.begin("href");break;case 25:return 100;case 26:this.begin("callbackname");break;case 28:this.popState(),this.begin("callbackargs");break;case 29:return 98;case 31:return 99;case 32:this.begin("click");break;case 34:return 90;case 35:case 36:return t.lex.firstGraph()&&this.begin("dir"),24;case 37:return 38;case 38:return 42;case 39:case 40:case 41:case 42:return 101;case 43:return this.popState(),25;case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:return this.popState(),26;case 54:return 118;case 55:return 119;case 56:return 120;case 57:return 121;case 58:return 105;case 59:return 111;case 60:return 53;case 61:return 67;case 62:return 52;case 63:return 20;case 64:return 106;case 65:return 126;case 66:case 67:case 68:return 82;case 69:case 70:case 71:return 81;case 72:return 59;case 73:return 60;case 74:return 61;case 75:return 62;case 76:return 63;case 77:return 64;case 78:return 65;case 79:return 69;case 80:return 70;case 81:return 55;case 82:return 56;case 83:return 109;case 84:return 112;case 85:return 127;case 86:return 124;case 87:return 113;case 88:case 89:return 125;case 90:return 114;case 91:return 73;case 92:return 92;case 93:return"SEP";case 94:return 91;case 95:return 66;case 96:return 75;case 97:return 74;case 98:return 77;case 99:return 76;case 100:return 122;case 101:return 123;case 102:return 68;case 103:return 57;case 104:return 58;case 105:return 40;case 106:return 41;case 107:return 71;case 108:return 72;case 109:return 133;case 110:return 21;case 111:return 22;case 112:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?: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]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\])/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\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:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[30,31],inclusive:!1},callbackname:{rules:[27,28,29],inclusive:!1},href:{rules:[24,25],inclusive:!1},click:{rules:[33,34],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[43,44,45,46,47,48,49,50,51,52,53],inclusive:!1},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},string:{rules:[15,16],inclusive:!1},INITIAL:{rules:[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,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,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],inclusive:!0}}},t);function re(){this.yy={}}return ne.lexer=ie,re.prototype=ne,ne.Parser=re,new re}();iT.parser=iT;const rT=iT,sT=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.flowchart)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*graph/)},aT=(t,e)=>{var n;return"dagre-wrapper"===(null==(n=null==e?void 0:e.flowchart)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*graph/)||null!==t.match(/^\s*flowchart/)};let oT,cT,lT=0,hT=nx(),uT={},dT=[],fT={},pT=[],gT={},yT={},mT=0,bT=!0,_T=[];const xT=t=>Mm.sanitizeText(t,hT),vT=function(t){const e=Object.keys(uT);for(const n of e)if(uT[n].id===t)return uT[n].domId;return t},kT=function(t,e,n,i){const r={start:t,end:e,type:void 0,text:""};void 0!==(i=n.text)&&(r.text=xT(i.trim()),'"'===r.text[0]&&'"'===r.text[r.text.length-1]&&(r.text=r.text.substring(1,r.text.length-1))),void 0!==n&&(r.type=n.type,r.stroke=n.stroke,r.length=n.length),dT.push(r)},wT=function(t,e){t.split(",").forEach((function(t){let n=t;void 0!==uT[n]&&uT[n].classes.push(e),void 0!==gT[n]&&gT[n].classes.push(e)}))},TT=function(t){let e=Fa(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Fa("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Fa(t).select("svg").selectAll("g.node").on("mouseover",(function(){const t=Fa(this);if(null===t.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),t.classed("hover",!0)})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0);Fa(this).classed("hover",!1)}))};_T.push(TT);const CT=function(t){for(const[e,n]of pT.entries())if(n.id===t)return e;return-1};let ET=-1;const ST=[],AT=function(t,e){const n=pT[e].nodes;if(ET+=1,ET>2e3)return;if(ST[ET]=e,pT[e].id===t)return{result:!0,count:0};let i=0,r=1;for(;i<n.length;){const e=CT(n[i]);if(e>=0){const n=AT(t,e);if(n.result)return{result:!0,count:r+n.count};r+=n.count}i+=1}return{result:!1,count:r}},DT=(t,e)=>{let n=!1;return t.forEach((t=>{t.nodes.indexOf(e)>=0&&(n=!0)})),n},LT=(t,e)=>{const n=[];return t.nodes.forEach(((i,r)=>{DT(e,i)||n.push(t.nodes[r])})),{nodes:n}},OT={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},defaultConfig:()=>G_.flowchart,setAccTitle:jx,getAccTitle:zx,getAccDescription:Wx,setAccDescription:Ux,addVertex:function(t,e,n,i,r,s,a={}){let o,c=t;void 0!==c&&0!==c.trim().length&&(void 0===uT[c]&&(uT[c]={id:c,domId:"flowchart-"+c+"-"+lT,styles:[],classes:[]}),lT++,void 0!==e?(hT=nx(),o=xT(e.trim()),'"'===o[0]&&'"'===o[o.length-1]&&(o=o.substring(1,o.length-1)),uT[c].text=o):void 0===uT[c].text&&(uT[c].text=t),void 0!==n&&(uT[c].type=n),null!=i&&i.forEach((function(t){uT[c].styles.push(t)})),null!=r&&r.forEach((function(t){uT[c].classes.push(t)})),void 0!==s&&(uT[c].dir=s),void 0===uT[c].props?uT[c].props=a:void 0!==a&&Object.assign(uT[c].props,a))},lookUpDomId:vT,addLink:function(t,e,n,i){let r,s;for(r=0;r<t.length;r++)for(s=0;s<e.length;s++)kT(t[r],e[s],n,i)},updateLinkInterpolate:function(t,e){t.forEach((function(t){"default"===t?dT.defaultInterpolate=e:dT[t].interpolate=e}))},updateLink:function(t,e){t.forEach((function(t){"default"===t?dT.defaultStyle=e:(-1===q_.isSubstringInArray("fill",e)&&e.push("fill:none"),dT[t].style=e)}))},addClass:function(t,e){void 0===fT[t]&&(fT[t]={id:t,styles:[],textStyles:[]}),null!=e&&e.forEach((function(e){if(e.match("color")){const n=e.replace("fill","bgFill").replace("color","fill");fT[t].textStyles.push(n)}fT[t].styles.push(e)}))},setDirection:function(t){oT=t,oT.match(/.*</)&&(oT="RL"),oT.match(/.*\^/)&&(oT="BT"),oT.match(/.*>/)&&(oT="LR"),oT.match(/.*v/)&&(oT="TB")},setClass:wT,setTooltip:function(t,e){t.split(",").forEach((function(t){void 0!==e&&(yT["gen-1"===cT?vT(t):t]=xT(e))}))},getTooltip:function(t){return yT[t]},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){!function(t,e,n){let i=vT(t);if("loose"!==nx().securityLevel)return;if(void 0===e)return;let r=[];if("string"==typeof n){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<r.length;t++){let e=r[t].trim();'"'===e.charAt(0)&&'"'===e.charAt(e.length-1)&&(e=e.substr(1,e.length-2)),r[t]=e}}0===r.length&&r.push(t),void 0!==uT[t]&&(uT[t].haveCallback=!0,_T.push((function(){const t=document.querySelector(`[id="${i}"]`);null!==t&&t.addEventListener("click",(function(){q_.runFunc(e,...r)}),!1)})))}(t,e,n)})),wT(t,"clickable")},setLink:function(t,e,n){t.split(",").forEach((function(t){void 0!==uT[t]&&(uT[t].link=q_.formatUrl(e,hT),uT[t].linkTarget=n)})),wT(t,"clickable")},bindFunctions:function(t){_T.forEach((function(e){e(t)}))},getDirection:function(){return oT.trim()},getVertices:function(){return uT},getEdges:function(){return dT},getClasses:function(){return fT},clear:function(t="gen-1"){uT={},fT={},dT=[],_T=[TT],pT=[],gT={},mT=0,yT=[],bT=!0,cT=t,Yx()},setGen:t=>{cT=t||"gen-1"},defaultStyle:function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},addSubGraph:function(t,e,n){let i=t.trim(),r=n;t===n&&n.match(/\s/)&&(i=void 0);let s=[];const{nodeList:a,dir:o}=function(t){const e={boolean:{},number:{},string:{}},n=[];let i;return{nodeList:t.filter((function(t){const r=typeof t;return t.stmt&&"dir"===t.stmt?(i=t.value,!1):""!==t.trim()&&(r in e?!e[r].hasOwnProperty(t)&&(e[r][t]=!0):!n.includes(t)&&n.push(t))})),dir:i}}(s.concat.apply(s,e));if(s=a,"gen-1"===cT)for(let t=0;t<s.length;t++)s[t]=vT(s[t]);i=i||"subGraph"+mT,r=r||"",r=xT(r),mT+=1;const c={id:i,nodes:s,title:r.trim(),classes:[],dir:o};return vm.info("Adding",c.id,c.nodes,c.dir),c.nodes=LT(c,pT).nodes,pT.push(c),gT[i]=c,i},getDepthFirstPos:function(t){return ST[t]},indexNodes:function(){ET=-1,pT.length>0&&AT("none",pT.length-1)},getSubGraphs:function(){return pT},destructLink:(t,e)=>{const n=(t=>{const e=t.trim();let n=e.slice(0,-1),i="arrow_open";switch(e.slice(-1)){case"x":i="arrow_cross","x"===e[0]&&(i="double_"+i,n=n.slice(1));break;case">":i="arrow_point","<"===e[0]&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle","o"===e[0]&&(i="double_"+i,n=n.slice(1))}let r="normal",s=n.length-1;"="===n[0]&&(r="thick");let a=((t,e)=>{const n=e.length;let i=0;for(let r=0;r<n;++r)e[r]===t&&++i;return i})(".",n);return a&&(r="dotted",s=a),{type:i,stroke:r,length:s}})(t);let i;if(e){if(i=(t=>{let e=t.trim(),n="arrow_open";switch(e[0]){case"<":n="arrow_point",e=e.slice(1);break;case"x":n="arrow_cross",e=e.slice(1);break;case"o":n="arrow_circle",e=e.slice(1)}let i="normal";return e.includes("=")&&(i="thick"),e.includes(".")&&(i="dotted"),{type:n,stroke:i}})(e),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===i.type)i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return"double_arrow"===i.type&&(i.type="double_arrow_point"),i.length=n.length,i}return n},lex:{firstGraph:()=>!!bT&&(bT=!1,!0)},exists:DT,makeUniq:LT,setDiagramTitle:Hx,getDiagramTitle:qx};const MT={},BT=function(t){const e=Object.keys(t);for(const n of e)MT[n]=t[n]},NT={},IT=function(t,e,n,i,r,s){const a=i.select(`[id="${n}"]`);Object.keys(t).forEach((function(n){const i=t[n];let o="default";i.classes.length>0&&(o=i.classes.join(" "));const c=M_(i.styles);let l,h=void 0!==i.text?i.text:i.id;if(Lm(nx().flowchart.htmlLabels)){const t={label:h.replace(/fa[blrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`))};l=mm(a,t).node(),l.parentNode.removeChild(l)}else{const t=r.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",c.labelStyle.replace("color:","fill:"));const e=h.split(Mm.lineBreakRegex);for(const n of e){const e=r.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","1"),e.textContent=n,t.appendChild(e)}l=t}let u=0,d="";switch(i.type){case"round":u=5,d="rect";break;case"square":case"group":default:d="rect";break;case"diamond":d="question";break;case"hexagon":d="hexagon";break;case"odd":case"odd_right":d="rect_left_inv_arrow";break;case"lean_right":d="lean_right";break;case"lean_left":d="lean_left";break;case"trapezoid":d="trapezoid";break;case"inv_trapezoid":d="inv_trapezoid";break;case"circle":d="circle";break;case"ellipse":d="ellipse";break;case"stadium":d="stadium";break;case"subroutine":d="subroutine";break;case"cylinder":d="cylinder";break;case"doublecircle":d="doublecircle"}e.setNode(i.id,{labelStyle:c.labelStyle,shape:d,labelText:h,rx:u,ry:u,class:o,style:c.style,id:i.id,link:i.link,linkTarget:i.linkTarget,tooltip:s.db.getTooltip(i.id)||"",domId:s.db.lookUpDomId(i.id),haveCallback:i.haveCallback,width:"group"===i.type?500:void 0,dir:i.dir,type:i.type,props:i.props,padding:nx().flowchart.padding}),vm.info("setNode",{labelStyle:c.labelStyle,shape:d,labelText:h,rx:u,ry:u,class:o,style:c.style,id:i.id,domId:s.db.lookUpDomId(i.id),width:"group"===i.type?500:void 0,type:i.type,dir:i.dir,props:i.props,padding:nx().flowchart.padding})}))},FT=function(t,e,n){vm.info("abc78 edges = ",t);let i,r,s=0,a={};if(void 0!==t.defaultStyle){const e=M_(t.defaultStyle);i=e.style,r=e.labelStyle}t.forEach((function(n){s++;var o="L-"+n.start+"-"+n.end;void 0===a[o]?(a[o]=0,vm.info("abc78 new entry",o,a[o])):(a[o]++,vm.info("abc78 new entry",o,a[o]));let c=o+"-"+a[o];vm.info("abc78 new link id to be used is",o,c,a[o]);var l="LS-"+n.start,h="LE-"+n.end;const u={style:"",labelStyle:""};switch(u.minlen=n.length||1,"arrow_open"===n.type?u.arrowhead="none":u.arrowhead="normal",u.arrowTypeStart="arrow_open",u.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":u.arrowTypeStart="arrow_cross";case"arrow_cross":u.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":u.arrowTypeStart="arrow_point";case"arrow_point":u.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":u.arrowTypeStart="arrow_circle";case"arrow_circle":u.arrowTypeEnd="arrow_circle"}let d="",f="";switch(n.stroke){case"normal":d="fill:none;",void 0!==i&&(d=i),void 0!==r&&(f=r),u.thickness="normal",u.pattern="solid";break;case"dotted":u.thickness="normal",u.pattern="dotted",u.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":u.thickness="thick",u.pattern="solid",u.style="stroke-width: 3.5px;fill:none;"}if(void 0!==n.style){const t=M_(n.style);d=t.style,f=t.labelStyle}u.style=u.style+=d,u.labelStyle=u.labelStyle+=f,void 0!==n.interpolate?u.curve=L_(n.interpolate,yo):void 0!==t.defaultInterpolate?u.curve=L_(t.defaultInterpolate,yo):u.curve=L_(NT.curve,yo),void 0===n.text?void 0!==n.style&&(u.arrowheadStyle="fill: #333"):(u.arrowheadStyle="fill: #333",u.labelpos="c"),u.labelType="text",u.label=n.text.replace(Mm.lineBreakRegex,"\n"),void 0===n.style&&(u.style=u.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),u.labelStyle=u.labelStyle.replace("color:","fill:"),u.id=c,u.classes="flowchart-link "+l+" "+h,e.setEdge(n.start,n.end,u,s)}))},RT={setConf:function(t){const e=Object.keys(t);for(const n of e)NT[n]=t[n]},addVertices:IT,addEdges:FT,getClasses:function(t,e){vm.info("Extracting classes"),e.db.clear();try{return e.parse(t),e.db.getClasses()}catch(t){return}},draw:function(t,e,n,i){vm.info("Drawing flowchart"),i.db.clear(),OT.setGen("gen-2"),i.parser.parse(t);let r=i.db.getDirection();void 0===r&&(r="TD");const{securityLevel:s,flowchart:a}=nx(),o=a.nodeSpacing||50,c=a.rankSpacing||50;let l;"sandbox"===s&&(l=Fa("#i"+e));const h=Fa("sandbox"===s?l.nodes()[0].contentDocument.body:"body"),u="sandbox"===s?l.nodes()[0].contentDocument:document,d=new Pf({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:o,ranksep:c,marginx:0,marginy:0}).setDefaultEdgeLabel((function(){return{}}));let f;const p=i.db.getSubGraphs();vm.info("Subgraphs - ",p);for(let t=p.length-1;t>=0;t--)f=p[t],vm.info("Subgraph - ",f),i.db.addVertex(f.id,f.title,"group",void 0,f.classes,f.dir);const g=i.db.getVertices(),y=i.db.getEdges();vm.info(y);let m=0;for(m=p.length-1;m>=0;m--){f=p[m],Ra("cluster").append("text");for(let t=0;t<f.nodes.length;t++)vm.info("Setting up subgraphs",f.nodes[t],f.id),d.setParent(f.nodes[t],f.id)}IT(g,d,e,h,u,i),FT(y,d);const b=h.select(`[id="${e}"]`),_=h.select("#"+e+" g");if(Nw(_,d,["point","circle","cross"],"flowchart",e),q_.insertTitle(b,"flowchartTitleText",a.titleTopMargin,i.db.getDiagramTitle()),hx(d,b,a.diagramPadding,a.useMaxWidth),i.db.indexNodes("subGraph"+m),!a.htmlLabels){const t=u.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const e of t){const t=e.getBBox(),n=u.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",t.width),n.setAttribute("height",t.height),e.insertBefore(n,e.firstChild)}}Object.keys(g).forEach((function(t){const n=g[t];if(n.link){const i=Fa("#"+e+' [id="'+t+'"]');if(i){const t=u.createElementNS("http://www.w3.org/2000/svg","a");t.setAttributeNS("http://www.w3.org/2000/svg","class",n.classes.join(" ")),t.setAttributeNS("http://www.w3.org/2000/svg","href",n.link),t.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===s?t.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):n.linkTarget&&t.setAttributeNS("http://www.w3.org/2000/svg","target",n.linkTarget);const e=i.insert((function(){return t}),":first-child"),r=i.select(".label-container");r&&e.append((function(){return r.node()}));const a=i.select(".label");a&&e.append((function(){return a.node()}))}}}))}};var $T=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,3],i=[1,5],r=[7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],s=[1,15],a=[1,16],o=[1,17],c=[1,18],l=[1,19],h=[1,20],u=[1,21],d=[1,22],f=[1,23],p=[1,24],g=[1,25],y=[1,26],m=[1,27],b=[1,29],_=[1,31],x=[1,34],v=[5,7,9,11,12,13,14,15,16,17,18,19,20,21,23,25,26,28,35,40],k={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,gantt:5,document:6,EOF:7,line:8,SPACE:9,statement:10,NL:11,dateFormat:12,inclusiveEndDates:13,topAxis:14,axisFormat:15,tickInterval:16,excludes:17,includes:18,todayMarker:19,title:20,acc_title:21,acc_title_value:22,acc_descr:23,acc_descr_value:24,acc_descr_multiline_value:25,section:26,clickStatement:27,taskTxt:28,taskData:29,openDirective:30,typeDirective:31,closeDirective:32,":":33,argDirective:34,click:35,callbackname:36,callbackargs:37,href:38,clickStatementDebug:39,open_directive:40,type_directive:41,arg_directive:42,close_directive:43,$accept:0,$end:1},terminals_:{2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"tickInterval",17:"excludes",18:"includes",19:"todayMarker",20:"title",21:"acc_title",22:"acc_title_value",23:"acc_descr",24:"acc_descr_value",25:"acc_descr_multiline_value",26:"section",28:"taskTxt",29:"taskData",33:":",35:"click",36:"callbackname",37:"callbackargs",38:"href",40:"open_directive",41:"type_directive",42:"arg_directive",43:"close_directive"},productions_:[0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,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],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[27,2],[27,3],[27,3],[27,4],[27,3],[27,4],[27,2],[39,2],[39,3],[39,3],[39,4],[39,3],[39,4],[39,2],[30,1],[31,1],[34,1],[32,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 2:return s[o-1];case 3:case 7:case 8:this.$=[];break;case 4:s[o-1].push(s[o]),this.$=s[o-1];break;case 5:case 6:this.$=s[o];break;case 9:i.setDateFormat(s[o].substr(11)),this.$=s[o].substr(11);break;case 10:i.enableInclusiveEndDates(),this.$=s[o].substr(18);break;case 11:i.TopAxis(),this.$=s[o].substr(8);break;case 12:i.setAxisFormat(s[o].substr(11)),this.$=s[o].substr(11);break;case 13:i.setTickInterval(s[o].substr(13)),this.$=s[o].substr(13);break;case 14:i.setExcludes(s[o].substr(9)),this.$=s[o].substr(9);break;case 15:i.setIncludes(s[o].substr(9)),this.$=s[o].substr(9);break;case 16:i.setTodayMarker(s[o].substr(12)),this.$=s[o].substr(12);break;case 17:i.setDiagramTitle(s[o].substr(6)),this.$=s[o].substr(6);break;case 18:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 19:case 20:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 21:i.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 23:i.addTask(s[o-1],s[o]),this.$="task";break;case 27:this.$=s[o-1],i.setClickEvent(s[o-1],s[o],null);break;case 28:this.$=s[o-2],i.setClickEvent(s[o-2],s[o-1],s[o]);break;case 29:this.$=s[o-2],i.setClickEvent(s[o-2],s[o-1],null),i.setLink(s[o-2],s[o]);break;case 30:this.$=s[o-3],i.setClickEvent(s[o-3],s[o-2],s[o-1]),i.setLink(s[o-3],s[o]);break;case 31:this.$=s[o-2],i.setClickEvent(s[o-2],s[o],null),i.setLink(s[o-2],s[o-1]);break;case 32:this.$=s[o-3],i.setClickEvent(s[o-3],s[o-1],s[o]),i.setLink(s[o-3],s[o-2]);break;case 33:this.$=s[o-1],i.setLink(s[o-1],s[o]);break;case 34:case 40:this.$=s[o-1]+" "+s[o];break;case 35:case 36:case 38:this.$=s[o-2]+" "+s[o-1]+" "+s[o];break;case 37:case 39:this.$=s[o-3]+" "+s[o-2]+" "+s[o-1]+" "+s[o];break;case 41:i.parseDirective("%%{","open_directive");break;case 42:i.parseDirective(s[o],"type_directive");break;case 43:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 44:i.parseDirective("}%%","close_directive","gantt")}},table:[{3:1,4:2,5:n,30:4,40:i},{1:[3]},{3:6,4:2,5:n,30:4,40:i},e(r,[2,3],{6:7}),{31:8,41:[1,9]},{41:[2,41]},{1:[2,1]},{4:30,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:s,13:a,14:o,15:c,16:l,17:h,18:u,19:d,20:f,21:p,23:g,25:y,26:m,27:28,28:b,30:4,35:_,40:i},{32:32,33:[1,33],43:x},e([33,43],[2,42]),e(r,[2,8],{1:[2,2]}),e(r,[2,4]),{4:30,10:35,12:s,13:a,14:o,15:c,16:l,17:h,18:u,19:d,20:f,21:p,23:g,25:y,26:m,27:28,28:b,30:4,35:_,40:i},e(r,[2,6]),e(r,[2,7]),e(r,[2,9]),e(r,[2,10]),e(r,[2,11]),e(r,[2,12]),e(r,[2,13]),e(r,[2,14]),e(r,[2,15]),e(r,[2,16]),e(r,[2,17]),{22:[1,36]},{24:[1,37]},e(r,[2,20]),e(r,[2,21]),e(r,[2,22]),{29:[1,38]},e(r,[2,24]),{36:[1,39],38:[1,40]},{11:[1,41]},{34:42,42:[1,43]},{11:[2,44]},e(r,[2,5]),e(r,[2,18]),e(r,[2,19]),e(r,[2,23]),e(r,[2,27],{37:[1,44],38:[1,45]}),e(r,[2,33],{36:[1,46]}),e(v,[2,25]),{32:47,43:x},{43:[2,43]},e(r,[2,28],{38:[1,48]}),e(r,[2,29]),e(r,[2,31],{37:[1,49]}),{11:[1,50]},e(r,[2,30]),e(r,[2,32]),e(v,[2,26])],defaultActions:{5:[2,41],6:[2,1],34:[2,44],43:[2,43]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},w=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),40;case 1:return this.begin("type_directive"),41;case 2:return this.popState(),this.begin("arg_directive"),33;case 3:return this.popState(),this.popState(),43;case 4:return 42;case 5:return this.begin("acc_title"),21;case 6:return this.popState(),"acc_title_value";case 7:return this.begin("acc_descr"),23;case 8:return this.popState(),"acc_descr_value";case 9:this.begin("acc_descr_multiline");break;case 10:case 20:case 23:case 26:case 29:this.popState();break;case 11:return"acc_descr_multiline_value";case 12:case 13:case 14:case 16:case 17:case 18:break;case 15:return 11;case 19:this.begin("href");break;case 21:return 38;case 22:this.begin("callbackname");break;case 24:this.popState(),this.begin("callbackargs");break;case 25:return 36;case 27:return 37;case 28:this.begin("click");break;case 30:return 35;case 31:return 5;case 32:return 12;case 33:return 13;case 34:return 14;case 35:return 15;case 36:return 16;case 37:return 18;case 38:return 17;case 39:return 19;case 40:return"date";case 41:return 20;case 42:return"accDescription";case 43:return 26;case 44:return 28;case 45:return 29;case 46:return 33;case 47:return 7;case 48:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/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,/^(?:%[^\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,/^(?:\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:[10,11],inclusive:!1},acc_descr:{rules:[8],inclusive:!1},acc_title:{rules:[6],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[26,27],inclusive:!1},callbackname:{rules:[23,24,25],inclusive:!1},href:{rules:[20,21],inclusive:!1},click:{rules:[29,30],inclusive:!1},INITIAL:{rules:[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}},t);function T(){this.yy={}}return k.lexer=w,T.prototype=k,k.Parser=T,new T}();$T.parser=$T;const PT=$T,YT=t=>null!==t.match(/^\s*gantt/);let jT,zT="",UT="",WT="",HT=[],qT=[],VT={},GT=[],XT=[],ZT="";const QT=["active","done","crit","milestone"];let KT=[],JT=!1,tC=!1,eC=0;const nC=function(t,e,n,i){return!i.includes(t.format(e.trim()))&&(!!(t.isoWeekday()>=6&&n.includes("weekends"))||(!!n.includes(t.format("dddd").toLowerCase())||n.includes(t.format(e.trim()))))},iC=function(e,n,i,r){if(!i.length||e.manualEndTime)return;let s=t(e.startTime,n,!0);s.add(1,"d");let a=t(e.endTime,n,!0),o=rC(s,a,n,i,r);e.endTime=a.toDate(),e.renderEndTime=o},rC=function(t,e,n,i,r){let s=!1,a=null;for(;t<=e;)s||(a=e.toDate()),s=nC(t,n,i,r),s&&e.add(1,"d"),t.add(1,"d");return a},sC=function(e,n,i){i=i.trim();const r=/^after\s+([\d\w- ]+)/.exec(i.trim());if(null!==r){let t=null;if(r[1].split(" ").forEach((function(e){let n=pC(e);void 0!==n&&(t?n.endTime>t.endTime&&(t=n):t=n)})),t)return t.endTime;{const t=new Date;return t.setHours(0,0,0,0),t}}let s=t(i,n.trim(),!0);if(s.isValid())return s.toDate();{vm.debug("Invalid date:"+i),vm.debug("With date format:"+n.trim());const t=new Date(i);if(void 0===t||isNaN(t.getTime()))throw new Error("Invalid date:"+i);return t}},aC=function(e){const n=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return null!==n?t.duration(Number.parseFloat(n[1]),n[2]):t.duration.invalid()},oC=function(e,n,i,r=!1){i=i.trim();let s=t(i,n.trim(),!0);if(s.isValid())return r&&s.add(1,"d"),s.toDate();const a=t(e),o=aC(i);return o.isValid()&&a.add(o),a.toDate()};let cC=0;const lC=function(t){return void 0===t?(cC+=1,"task"+cC):t};let hC,uC,dC=[];const fC={},pC=function(t){const e=fC[t];return dC[e]},gC=function(){const e=function(e){const n=dC[e];let i="";switch(dC[e].raw.startTime.type){case"prevTaskEnd":{const t=pC(n.prevTaskId);n.startTime=t.endTime;break}case"getStartDate":i=sC(0,zT,dC[e].raw.startTime.startData),i&&(dC[e].startTime=i)}return dC[e].startTime&&(dC[e].endTime=oC(dC[e].startTime,zT,dC[e].raw.endTime.data,JT),dC[e].endTime&&(dC[e].processed=!0,dC[e].manualEndTime=t(dC[e].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),iC(dC[e],zT,qT,HT))),dC[e].processed};let n=!0;for(const[t,i]of dC.entries())e(t),n=n&&i.processed;return n},yC=function(t,e){t.split(",").forEach((function(t){let n=pC(t);void 0!==n&&n.classes.push(e)}))},mC=function(t,e){KT.push((function(){const n=document.querySelector(`[id="${t}"]`);null!==n&&n.addEventListener("click",(function(){e()}))}),(function(){const n=document.querySelector(`[id="${t}-text"]`);null!==n&&n.addEventListener("click",(function(){e()}))}))},bC={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().gantt,clear:function(){GT=[],XT=[],ZT="",KT=[],cC=0,hC=void 0,uC=void 0,dC=[],zT="",UT="",jT=void 0,WT="",HT=[],qT=[],JT=!1,tC=!1,eC=0,VT={},Yx()},setDateFormat:function(t){zT=t},getDateFormat:function(){return zT},enableInclusiveEndDates:function(){JT=!0},endDatesAreInclusive:function(){return JT},enableTopAxis:function(){tC=!0},topAxisEnabled:function(){return tC},setAxisFormat:function(t){UT=t},getAxisFormat:function(){return UT},setTickInterval:function(t){jT=t},getTickInterval:function(){return jT},setTodayMarker:function(t){WT=t},getTodayMarker:function(){return WT},setAccTitle:jx,getAccTitle:zx,setDiagramTitle:Hx,getDiagramTitle:qx,setAccDescription:Ux,getAccDescription:Wx,addSection:function(t){ZT=t,GT.push(t)},getSections:function(){return GT},getTasks:function(){let t=gC();let e=0;for(;!t&&e<10;)t=gC(),e++;return XT=dC,XT},addTask:function(t,e){const n={section:ZT,type:ZT,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},i=function(t,e){let n;n=":"===e.substr(0,1)?e.substr(1,e.length):e;const i=n.split(","),r={};_C(i,r,QT);for(let t=0;t<i.length;t++)i[t]=i[t].trim();switch(i.length){case 1:r.id=lC(),r.startTime={type:"prevTaskEnd",id:t},r.endTime={data:i[0]};break;case 2:r.id=lC(),r.startTime={type:"getStartDate",startData:i[0]},r.endTime={data:i[1]};break;case 3:r.id=lC(i[0]),r.startTime={type:"getStartDate",startData:i[1]},r.endTime={data:i[2]}}return r}(uC,e);n.raw.startTime=i.startTime,n.raw.endTime=i.endTime,n.id=i.id,n.prevTaskId=uC,n.active=i.active,n.done=i.done,n.crit=i.crit,n.milestone=i.milestone,n.order=eC,eC++;const r=dC.push(n);uC=n.id,fC[n.id]=r-1},findTaskById:pC,addTaskOrg:function(e,n){const i={section:ZT,type:ZT,description:e,task:e,classes:[]},r=function(e,n){let i;i=":"===n.substr(0,1)?n.substr(1,n.length):n;const r=i.split(","),s={};_C(r,s,QT);for(let t=0;t<r.length;t++)r[t]=r[t].trim();let a="";switch(r.length){case 1:s.id=lC(),s.startTime=e.endTime,a=r[0];break;case 2:s.id=lC(),s.startTime=sC(0,zT,r[0]),a=r[1];break;case 3:s.id=lC(r[0]),s.startTime=sC(0,zT,r[1]),a=r[2]}return a&&(s.endTime=oC(s.startTime,zT,a,JT),s.manualEndTime=t(a,"YYYY-MM-DD",!0).isValid(),iC(s,zT,qT,HT)),s}(hC,n);i.startTime=r.startTime,i.endTime=r.endTime,i.id=r.id,i.active=r.active,i.done=r.done,i.crit=r.crit,i.milestone=r.milestone,hC=i,XT.push(i)},setIncludes:function(t){HT=t.toLowerCase().split(/[\s,]+/)},getIncludes:function(){return HT},setExcludes:function(t){qT=t.toLowerCase().split(/[\s,]+/)},getExcludes:function(){return qT},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){!function(t,e,n){if("loose"!==nx().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof n){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<i.length;t++){let e=i[t].trim();'"'===e.charAt(0)&&'"'===e.charAt(e.length-1)&&(e=e.substr(1,e.length-2)),i[t]=e}}0===i.length&&i.push(t),void 0!==pC(t)&&mC(t,(()=>{q_.runFunc(e,...i)}))}(t,e,n)})),yC(t,"clickable")},setLink:function(t,n){let i=n;"loose"!==nx().securityLevel&&(i=(0,e.N)(n)),t.split(",").forEach((function(t){void 0!==pC(t)&&(mC(t,(()=>{window.open(i,"_self")})),VT[t]=i)})),yC(t,"clickable")},getLinks:function(){return VT},bindFunctions:function(t){KT.forEach((function(e){e(t)}))},parseDuration:aC,isInvalidDate:nC};function _C(t,e,n){let i=!0;for(;i;)i=!1,n.forEach((function(n){const r=new RegExp("^\\s*"+n+"\\s*$");t[0].match(r)&&(e[n]=!0,t.shift(1),i=!0)}))}let xC;const vC={setConf:function(){vm.debug("Something is calling, setConf, remove the call")},draw:function(e,n,s,a){const o=nx().gantt,c=nx().securityLevel;let l;"sandbox"===c&&(l=Fa("#i"+n));const h=Fa("sandbox"===c?l.nodes()[0].contentDocument.body:"body"),u="sandbox"===c?l.nodes()[0].contentDocument:document,d=u.getElementById(n);xC=d.parentElement.offsetWidth,void 0===xC&&(xC=1200),void 0!==o.useWidth&&(xC=o.useWidth);const p=a.db.getTasks(),g=p.length*(o.barHeight+o.barGap)+2*o.topPadding;d.setAttribute("viewBox","0 0 "+xC+" "+g);const y=h.select(`[id="${n}"]`),m=function(){return $i.apply(Ia(ls,hs,jr,Pr,Or,Dr,Sr,Cr,wr,gs).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}().domain([r(p,(function(t){return t.startTime})),i(p,(function(t){return t.endTime}))]).rangeRound([0,xC-o.leftPadding-o.rightPadding]);let b=[];for(const t of p)b.push(t.type);const _=b;function x(t,e){return function(t){let e=t.length;const n={};for(;e;)n[t[--e]]=(n[t[e]]||0)+1;return n}(e)[t]||0}b=function(t){const e={},n=[];for(let i=0,r=t.length;i<r;++i)Object.prototype.hasOwnProperty.call(e,t[i])||(e[t[i]]=!0,n.push(t[i]));return n}(b),p.sort((function(t,e){const n=t.startTime,i=e.startTime;let r=0;return n>i?r=1:n<i&&(r=-1),r})),function(e,i,r){const s=o.barHeight,c=s+o.barGap,l=o.topPadding,h=o.leftPadding;nr().domain([0,b.length]).range(["#00B9FA","#F95002"]).interpolate(hi);(function(e,n,i,r,s,c,l,h){const u=c.reduce(((t,{startTime:e})=>t?Math.min(t,e):e),0),d=c.reduce(((t,{endTime:e})=>t?Math.max(t,e):e),0),f=a.db.getDateFormat();if(!u||!d)return;const p=[];let g=null,b=t(u);for(;b.valueOf()<=d;)a.db.isInvalidDate(b,f,l,h)?g?g.end=b.clone():g={start:b.clone(),end:b.clone()}:g&&(p.push(g),g=null),b.add(1,"d");y.append("g").selectAll("rect").data(p).enter().append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return m(t.start)+i})).attr("y",o.gridLineStartPadding).attr("width",(function(t){const e=t.end.clone().add(1,"day");return m(e)-m(t.start)})).attr("height",s-n-o.gridLineStartPadding).attr("transform-origin",(function(t,n){return(m(t.start)+i+.5*(m(t.end)-m(t.start))).toString()+"px "+(n*e+.5*s).toString()+"px"})).attr("class","exclude-range")})(c,l,h,0,r,e,a.db.getExcludes(),a.db.getIncludes()),function(t,e,n,i){let r=(s=m,f(3,s)).tickSize(-i+e+o.gridLineStartPadding).tickFormat(gs(a.db.getAxisFormat()||o.axisFormat||"%Y-%m-%d"));var s;const c=/^([1-9]\d*)(minute|hour|day|week|month)$/.exec(a.db.getTickInterval()||o.tickInterval);if(null!==c){const t=c[1];switch(c[2]){case"minute":r.ticks(Cr.every(t));break;case"hour":r.ticks(Sr.every(t));break;case"day":r.ticks(Dr.every(t));break;case"week":r.ticks(Or.every(t));break;case"month":r.ticks(Pr.every(t))}}if(y.append("g").attr("class","grid").attr("transform","translate("+t+", "+(i-50)+")").call(r).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),a.db.topAxisEnabled()||o.topAxis){let n=function(t){return f(1,t)}(m).tickSize(-i+e+o.gridLineStartPadding).tickFormat(gs(a.db.getAxisFormat()||o.axisFormat||"%Y-%m-%d"));if(null!==c){const t=c[1];switch(c[2]){case"minute":n.ticks(Cr.every(t));break;case"hour":n.ticks(Sr.every(t));break;case"day":n.ticks(Dr.every(t));break;case"week":n.ticks(Or.every(t));break;case"month":n.ticks(Pr.every(t))}}y.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}(h,l,0,r),function(t,e,i,r,s,c,l){y.append("g").selectAll("rect").data(t).enter().append("rect").attr("x",0).attr("y",(function(t,n){return t.order*e+i-2})).attr("width",(function(){return l-o.rightPadding/2})).attr("height",e).attr("class",(function(t){for(const[e,n]of b.entries())if(t.type===n)return"section section"+e%o.numberSectionStyles;return"section section0"}));const h=y.append("g").selectAll("rect").data(t).enter(),u=a.db.getLinks();h.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){return t.milestone?m(t.startTime)+r+.5*(m(t.endTime)-m(t.startTime))-.5*s:m(t.startTime)+r})).attr("y",(function(t,n){return t.order*e+i})).attr("width",(function(t){return t.milestone?s:m(t.renderEndTime||t.endTime)-m(t.startTime)})).attr("height",s).attr("transform-origin",(function(t,n){return n=t.order,(m(t.startTime)+r+.5*(m(t.endTime)-m(t.startTime))).toString()+"px "+(n*e+i+.5*s).toString()+"px"})).attr("class",(function(t){const e="task";let n="";t.classes.length>0&&(n=t.classes.join(" "));let i=0;for(const[e,n]of b.entries())t.type===n&&(i=e%o.numberSectionStyles);let r="";return t.active?t.crit?r+=" activeCrit":r=" active":t.done?r=t.crit?" doneCrit":" done":t.crit&&(r+=" crit"),0===r.length&&(r=" task"),t.milestone&&(r=" milestone "+r),r+=i,r+=" "+n,e+r})),h.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",o.fontSize).attr("x",(function(t){let e=m(t.startTime),n=m(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(m(t.endTime)-m(t.startTime))-.5*s),t.milestone&&(n=e+s);const i=this.getBBox().width;return i>n-e?n+i+1.5*o.leftPadding>l?e+r-5:n+r+5:(n-e)/2+e+r})).attr("y",(function(t,n){return t.order*e+o.barHeight/2+(o.fontSize/2-2)+i})).attr("text-height",s).attr("class",(function(t){const e=m(t.startTime);let n=m(t.endTime);t.milestone&&(n=e+s);const i=this.getBBox().width;let r="";t.classes.length>0&&(r=t.classes.join(" "));let a=0;for(const[e,n]of b.entries())t.type===n&&(a=e%o.numberSectionStyles);let c="";return t.active&&(c=t.crit?"activeCritText"+a:"activeText"+a),t.done?c=t.crit?c+" doneCritText"+a:c+" doneText"+a:t.crit&&(c=c+" critText"+a),t.milestone&&(c+=" milestoneText"),i>n-e?n+i+1.5*o.leftPadding>l?r+" taskTextOutsideLeft taskTextOutside"+a+" "+c:r+" taskTextOutsideRight taskTextOutside"+a+" "+c+" width-"+i:r+" taskText taskText"+a+" "+c+" width-"+i}));if("sandbox"===nx().securityLevel){let t;t=Fa("#i"+n);const e=t.nodes()[0].contentDocument;h.filter((function(t){return void 0!==u[t.id]})).each((function(t){var n=e.querySelector("#"+t.id),i=e.querySelector("#"+t.id+"-text");const r=n.parentNode;var s=e.createElement("a");s.setAttribute("xlink:href",u[t.id]),s.setAttribute("target","_top"),r.appendChild(s),s.appendChild(n),s.appendChild(i)}))}}(e,c,l,h,s,0,i),function(t,e){const n=[];let i=0;for(const[t,e]of b.entries())n[t]=[e,x(e,_)];y.append("g").selectAll("text").data(n).enter().append((function(t){const e=t[0].split(Mm.lineBreakRegex),n=-(e.length-1)/2,i=u.createElementNS("http://www.w3.org/2000/svg","text");i.setAttribute("dy",n+"em");for(const[t,n]of e.entries()){const e=u.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttribute("alignment-baseline","central"),e.setAttribute("x","10"),t>0&&e.setAttribute("dy","1em"),e.textContent=n,i.appendChild(e)}return i})).attr("x",10).attr("y",(function(r,s){if(!(s>0))return r[1]*t/2+e;for(let a=0;a<s;a++)return i+=n[s-1][1],r[1]*t/2+i*t+e})).attr("font-size",o.sectionFontSize).attr("font-size",o.sectionFontSize).attr("class",(function(t){for(const[e,n]of b.entries())if(t[0]===n)return"sectionTitle sectionTitle"+e%o.numberSectionStyles;return"sectionTitle"}))}(c,l),function(t,e,n,i){const r=a.db.getTodayMarker();if("off"===r)return;const s=y.append("g").attr("class","today"),c=new Date,l=s.append("line");l.attr("x1",m(c)+t).attr("x2",m(c)+t).attr("y1",o.titleTopMargin).attr("y2",i-o.titleTopMargin).attr("class","today"),""!==r&&l.attr("style",r.replace(/,/g,";"))}(h,0,0,r)}(p,xC,g),lx(y,g,xC,o.useMaxWidth),y.append("text").text(a.db.getDiagramTitle()).attr("x",xC/2).attr("y",o.titleTopMargin).attr("class","titleText")}};var kC=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[6,9,10],i={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,e,n,i,r,s,a){switch(s.length,r){case 1:return i;case 4:break;case 6:i.setInfo(!0)}},table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},e(n,[2,3]),e(n,[2,4]),e(n,[2,5]),e(n,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},r=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}},t);function s(){this.yy={}}return i.lexer=r,s.prototype=i,i.Parser=s,new s}();kC.parser=kC;const wC=kC;var TC="",CC=!1;const EC={setMessage:t=>{vm.debug("Setting message to: "+t),TC=t},getMessage:()=>TC,setInfo:t=>{CC=t},getInfo:()=>CC,clear:Yx},SC={draw:(t,e,n)=>{try{vm.debug("Rendering info diagram\n"+t);const i=nx().securityLevel;let r;"sandbox"===i&&(r=Fa("#i"+e));const s=Fa("sandbox"===i?r.nodes()[0].contentDocument.body:"body").select("#"+e);s.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+n),s.attr("height",100),s.attr("width",400)}catch(t){vm.error("Error while rendering info diagram"),vm.error(t.message)}}},AC=t=>null!==t.match(/^\s*info/);var DC=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,4],i=[1,5],r=[1,6],s=[1,7],a=[1,9],o=[1,11,13,15,17,19,20,26,27,28,29],c=[2,5],l=[1,6,11,13,15,17,19,20,26,27,28,29],h=[26,27,28],u=[2,8],d=[1,18],f=[1,19],p=[1,20],g=[1,21],y=[1,22],m=[1,23],b=[1,28],_=[6,26,27,28,29],x={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,showData:8,line:9,statement:10,txt:11,value:12,title:13,title_value:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,openDirective:21,typeDirective:22,closeDirective:23,":":24,argDirective:25,NEWLINE:26,";":27,EOF:28,open_directive:29,type_directive:30,arg_directive:31,close_directive:32,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 4:i.setShowData(!0);break;case 7:this.$=s[o-1];break;case 9:i.addSection(s[o-1],i.cleanupValue(s[o]));break;case 10:this.$=s[o].trim(),i.setDiagramTitle(this.$);break;case 11:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 12:case 13:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 14:i.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 21:i.parseDirective("%%{","open_directive");break;case 22:i.parseDirective(s[o],"type_directive");break;case 23:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 24:i.parseDirective("}%%","close_directive","pie")}},table:[{3:1,4:2,5:3,6:n,21:8,26:i,27:r,28:s,29:a},{1:[3]},{3:10,4:2,5:3,6:n,21:8,26:i,27:r,28:s,29:a},{3:11,4:2,5:3,6:n,21:8,26:i,27:r,28:s,29:a},e(o,c,{7:12,8:[1,13]}),e(l,[2,18]),e(l,[2,19]),e(l,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},e(h,u,{21:8,9:16,10:17,5:24,1:[2,3],11:d,13:f,15:p,17:g,19:y,20:m,29:a}),e(o,c,{7:25}),{23:26,24:[1,27],32:b},e([24,32],[2,22]),e(o,[2,6]),{4:29,26:i,27:r,28:s},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},e(h,[2,13]),e(h,[2,14]),e(h,[2,15]),e(h,u,{21:8,9:16,10:17,5:24,1:[2,4],11:d,13:f,15:p,17:g,19:y,20:m,29:a}),e(_,[2,16]),{25:34,31:[1,35]},e(_,[2,24]),e(o,[2,7]),e(h,[2,9]),e(h,[2,10]),e(h,[2,11]),e(h,[2,12]),{23:36,32:b},{32:[2,23]},e(_,[2,17])],defaultActions:{9:[2,21],10:[2,1],11:[2,2],35:[2,23]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},v=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),29;case 1:return this.begin("type_directive"),30;case 2:return this.popState(),this.begin("arg_directive"),24;case 3:return this.popState(),this.popState(),32;case 4:return 31;case 5:case 6:case 8:case 9:break;case 7:return 26;case 10:return this.begin("title"),13;case 11:return this.popState(),"title_value";case 12:return this.begin("acc_title"),15;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),17;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:case 20:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:this.begin("string");break;case 21:return"txt";case 22:return 6;case 23:return 8;case 24:return"value";case 25:return 28}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/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,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[20,21],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],inclusive:!0}}},t);function k(){this.yy={}}return x.lexer=v,k.prototype=x,x.Parser=k,new k}();DC.parser=DC;const LC=DC,OC=t=>null!==t.match(/^\s*pie/)||null!==t.match(/^\s*bar/);let MC={},BC=!1;const NC={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().pie,addSection:function(t,e){t=Mm.sanitizeText(t,nx()),void 0===MC[t]&&(MC[t]=e,vm.debug("Added new section :",t))},getSections:()=>MC,cleanupValue:function(t){return":"===t.substring(0,1)?(t=t.substring(1).trim(),Number(t.trim())):Number(t.trim())},clear:function(){MC={},BC=!1,Yx()},setAccTitle:jx,getAccTitle:zx,setDiagramTitle:Hx,getDiagramTitle:qx,setShowData:function(t){BC=t},getShowData:function(){return BC},getAccDescription:Wx,setAccDescription:Ux};let IC,FC=nx();const RC=450,$C={draw:(t,e,n,i)=>{try{FC=nx(),vm.debug("Rendering info diagram\n"+t);const n=nx().securityLevel;let y;"sandbox"===n&&(y=Fa("#i"+e));const m=Fa("sandbox"===n?y.nodes()[0].contentDocument.body:"body"),b="sandbox"===n?y.nodes()[0].contentDocument:document;i.db.clear(),i.parser.parse(t),vm.debug("Parsed info diagram");const _=b.getElementById(e);IC=_.parentElement.offsetWidth,void 0===IC&&(IC=1200),void 0!==FC.useWidth&&(IC=FC.useWidth),void 0!==FC.pie.useWidth&&(IC=FC.pie.useWidth);const x=m.select("#"+e);lx(x,RC,IC,FC.pie.useMaxWidth),_.setAttribute("viewBox","0 0 "+IC+" "+RC);var r=18,s=Math.min(IC,RC)/2-40,a=x.append("g").attr("transform","translate("+IC/2+",225)"),o=i.db.getSections(),c=0;Object.keys(o).forEach((function(t){c+=o[t]}));const v=FC.themeVariables;var l=[v.pie1,v.pie2,v.pie3,v.pie4,v.pie5,v.pie6,v.pie7,v.pie8,v.pie9,v.pie10,v.pie11,v.pie12],h=lr().range(l),u=Object.entries(o).map((function(t,e){return{order:e,name:t[0],value:t[1]}})),d=function(){var t=vo,e=xo,n=null,i=Ha(0),r=Ha(no),s=Ha(0);function a(a){var o,c,l,h,u,d=(a=po(a)).length,f=0,p=new Array(d),g=new Array(d),y=+i.apply(this,arguments),m=Math.min(no,Math.max(-no,r.apply(this,arguments)-y)),b=Math.min(Math.abs(m)/d,s.apply(this,arguments)),_=b*(m<0?-1:1);for(o=0;o<d;++o)(u=g[p[o]=o]=+t(a[o],o,a))>0&&(f+=u);for(null!=e?p.sort((function(t,n){return e(g[t],g[n])})):null!=n&&p.sort((function(t,e){return n(a[t],a[e])})),o=0,l=f?(m-d*_)/f:0;o<d;++o,y=h)c=p[o],h=y+((u=g[c])>0?u*l:0)+_,g[c]={data:a[c],index:o,value:u,startAngle:y,endAngle:h,padAngle:b};return g}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:Ha(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ha(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ha(+t),a):r},a.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ha(+t),a):s},a}().value((function(t){return t.value})).sort((function(t,e){return t.order-e.order})),f=d(u),p=fo().innerRadius(0).outerRadius(s);a.selectAll("mySlices").data(f).enter().append("path").attr("d",p).attr("fill",(function(t){return h(t.data.name)})).attr("class","pieCircle"),a.selectAll("mySlices").data(f).enter().append("text").text((function(t){return(t.data.value/c*100).toFixed(0)+"%"})).attr("transform",(function(t){return"translate("+p.centroid(t)+")"})).style("text-anchor","middle").attr("class","slice"),a.append("text").text(i.db.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");var g=a.selectAll(".legend").data(h.domain()).enter().append("g").attr("class","legend").attr("transform",(function(t,e){return"translate(216,"+(22*e-22*h.domain().length/2)+")"}));g.append("rect").attr("width",r).attr("height",r).style("fill",h).style("stroke",h),g.data(f).append("text").attr("x",22).attr("y",14).text((function(t){return i.db.getShowData()||FC.showData||FC.pie.showData?t.data.name+" ["+t.data.value+"]":t.data.name}))}catch(t){vm.error("Error while rendering info diagram"),vm.error(t)}}};var PC=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,3],i=[1,5],r=[1,6],s=[1,7],a=[1,8],o=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],c=[1,22],l=[2,13],h=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,30],g=[1,31],y=[1,24],m=[1,32],b=[1,33],_=[1,36],x=[71,72],v=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],k=[1,56],w=[1,57],T=[1,58],C=[1,59],E=[1,60],S=[1,61],A=[1,62],D=[62,63],L=[1,74],O=[1,70],M=[1,71],B=[1,72],N=[1,73],I=[1,75],F=[1,79],R=[1,80],$=[1,77],P=[1,78],Y=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72],j={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,openDirective:9,typeDirective:10,closeDirective:11,":":12,argDirective:13,acc_title:14,acc_title_value:15,acc_descr:16,acc_descr_value:17,acc_descr_multiline_value:18,open_directive:19,type_directive:20,arg_directive:21,close_directive:22,requirementDef:23,elementDef:24,relationshipDef:25,requirementType:26,requirementName:27,STRUCT_START:28,requirementBody:29,ID:30,COLONSEP:31,id:32,TEXT:33,text:34,RISK:35,riskLevel:36,VERIFYMTHD:37,verifyType:38,STRUCT_STOP:39,REQUIREMENT:40,FUNCTIONAL_REQUIREMENT:41,INTERFACE_REQUIREMENT:42,PERFORMANCE_REQUIREMENT:43,PHYSICAL_REQUIREMENT:44,DESIGN_CONSTRAINT:45,LOW_RISK:46,MED_RISK:47,HIGH_RISK:48,VERIFY_ANALYSIS:49,VERIFY_DEMONSTRATION:50,VERIFY_INSPECTION:51,VERIFY_TEST:52,ELEMENT:53,elementName:54,elementBody:55,TYPE:56,type:57,DOCREF:58,ref:59,END_ARROW_L:60,relationship:61,LINE:62,END_ARROW_R:63,CONTAINS:64,COPIES:65,DERIVES:66,SATISFIES:67,VERIFIES:68,REFINES:69,TRACES:70,unqString:71,qString:72,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",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",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 6:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 7:case 8:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 9:i.parseDirective("%%{","open_directive");break;case 10:i.parseDirective(s[o],"type_directive");break;case 11:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 12:i.parseDirective("}%%","close_directive","pie");break;case 13:this.$=[];break;case 19:i.addRequirement(s[o-3],s[o-4]);break;case 20:i.setNewReqId(s[o-2]);break;case 21:i.setNewReqText(s[o-2]);break;case 22:i.setNewReqRisk(s[o-2]);break;case 23:i.setNewReqVerifyMethod(s[o-2]);break;case 26:this.$=i.RequirementType.REQUIREMENT;break;case 27:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 28:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 29:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 30:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 32:this.$=i.RiskLevel.LOW_RISK;break;case 33:this.$=i.RiskLevel.MED_RISK;break;case 34:this.$=i.RiskLevel.HIGH_RISK;break;case 35:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 36:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 37:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 38:this.$=i.VerifyType.VERIFY_TEST;break;case 39:i.addElement(s[o-3]);break;case 40:i.setNewElementType(s[o-2]);break;case 41:i.setNewElementDocRef(s[o-2]);break;case 44:i.addRelationship(s[o-2],s[o],s[o-4]);break;case 45:i.addRelationship(s[o-2],s[o-4],s[o]);break;case 46:this.$=i.Relationships.CONTAINS;break;case 47:this.$=i.Relationships.COPIES;break;case 48:this.$=i.Relationships.DERIVES;break;case 49:this.$=i.Relationships.SATISFIES;break;case 50:this.$=i.Relationships.VERIFIES;break;case 51:this.$=i.Relationships.REFINES;break;case 52:this.$=i.Relationships.TRACES}},table:[{3:1,4:2,6:n,9:4,14:i,16:r,18:s,19:a},{1:[3]},{3:10,4:2,5:[1,9],6:n,9:4,14:i,16:r,18:s,19:a},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},e(o,[2,8]),{20:[2,9]},{3:16,4:2,6:n,9:4,14:i,16:r,18:s,19:a},{1:[2,2]},{4:21,5:c,7:17,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{11:34,12:[1,35],22:_},e([12,22],[2,10]),e(o,[2,6]),e(o,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:c,7:38,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{4:21,5:c,7:39,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{4:21,5:c,7:40,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{4:21,5:c,7:41,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{4:21,5:c,7:42,8:l,9:4,14:i,16:r,18:s,19:a,23:18,24:19,25:20,26:23,32:25,40:h,41:u,42:d,43:f,44:p,45:g,53:y,71:m,72:b},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},e(x,[2,26]),e(x,[2,27]),e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),e(x,[2,31]),e(v,[2,55]),e(v,[2,56]),e(o,[2,4]),{13:51,21:[1,52]},e(o,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:k,65:w,66:T,67:C,68:E,69:S,70:A},{61:63,64:k,65:w,66:T,67:C,68:E,69:S,70:A},{11:64,22:_},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),{63:[1,68]},e(o,[2,5]),{5:L,29:69,30:O,33:M,35:B,37:N,39:I},{5:F,39:R,55:76,56:$,58:P},{32:81,71:m,72:b},{32:82,71:m,72:b},e(Y,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:L,29:87,30:O,33:M,35:B,37:N,39:I},e(Y,[2,25]),e(Y,[2,39]),{31:[1,88]},{31:[1,89]},{5:F,39:R,55:90,56:$,58:P},e(Y,[2,43]),e(Y,[2,44]),e(Y,[2,45]),{32:91,71:m,72:b},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},e(Y,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},e(Y,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:L,29:116,30:O,33:M,35:B,37:N,39:I},{5:L,29:117,30:O,33:M,35:B,37:N,39:I},{5:L,29:118,30:O,33:M,35:B,37:N,39:I},{5:L,29:119,30:O,33:M,35:B,37:N,39:I},{5:F,39:R,55:120,56:$,58:P},{5:F,39:R,55:121,56:$,58:P},e(Y,[2,20]),e(Y,[2,21]),e(Y,[2,22]),e(Y,[2,23]),e(Y,[2,40]),e(Y,[2,41])],defaultActions:{8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},z=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),19;case 1:return this.begin("type_directive"),20;case 2:return this.popState(),this.begin("arg_directive"),12;case 3:return this.popState(),this.popState(),22;case 4:return 21;case 5:return"title";case 6:return this.begin("acc_title"),14;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),16;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:case 53:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 5;case 14:case 15:case 16:break;case 17:return 8;case 18:return 6;case 19:return 28;case 20:return 39;case 21:return 31;case 22:return 30;case 23:return 33;case 24:return 35;case 25:return 37;case 26:return 40;case 27:return 41;case 28:return 42;case 29:return 43;case 30:return 44;case 31:return 45;case 32:return 46;case 33:return 47;case 34:return 48;case 35:return 49;case 36:return 50;case 37:return 51;case 38:return 52;case 39:return 53;case 40:return 64;case 41:return 65;case 42:return 66;case 43:return 67;case 44:return 68;case 45:return 69;case 46:return 70;case 47:return 56;case 48:return 58;case 49:return 60;case 50:return 63;case 51:return 62;case 52:this.begin("string");break;case 54:return"qString";case 55:return e.yytext=e.yytext.trim(),71}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/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,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[53,54],inclusive:!1},INITIAL:{rules:[0,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,55],inclusive:!0}}},t);function U(){this.yy={}}return j.lexer=z,U.prototype=j,j.Parser=U,new U}();PC.parser=PC;const YC=PC,jC=t=>null!==t.match(/^\s*requirement(Diagram)?/);let zC=[],UC={},WC={},HC={},qC={};const VC={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().req,addRequirement:(t,e)=>(void 0===WC[t]&&(WC[t]={name:t,type:e,id:UC.id,text:UC.text,risk:UC.risk,verifyMethod:UC.verifyMethod}),UC={},WC[t]),getRequirements:()=>WC,setNewReqId:t=>{void 0!==UC&&(UC.id=t)},setNewReqText:t=>{void 0!==UC&&(UC.text=t)},setNewReqRisk:t=>{void 0!==UC&&(UC.risk=t)},setNewReqVerifyMethod:t=>{void 0!==UC&&(UC.verifyMethod=t)},setAccTitle:jx,getAccTitle:zx,setAccDescription:Ux,getAccDescription:Wx,addElement:t=>(void 0===qC[t]&&(qC[t]={name:t,type:HC.type,docRef:HC.docRef},vm.info("Added new requirement: ",t)),HC={},qC[t]),getElements:()=>qC,setNewElementType:t=>{void 0!==HC&&(HC.type=t)},setNewElementDocRef:t=>{void 0!==HC&&(HC.docRef=t)},addRelationship:(t,e,n)=>{zC.push({type:t,src:e,dst:n})},getRelationships:()=>zC,clear:()=>{zC=[],UC={},WC={},HC={},qC={},Yx()}},GC={CONTAINS:"contains",ARROW:"arrow"},XC=GC,ZC=(t,e)=>{let n=t.append("defs").append("marker").attr("id",GC.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");n.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),n.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),n.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",GC.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n      L${e.line_height},${e.line_height/2}\n      M${e.line_height},${e.line_height/2}\n      L0,${e.line_height}`).attr("stroke-width",1)};let QC={},KC=0;const JC=(t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",QC.rect_min_width+"px").attr("height",QC.rect_min_height+"px"),tE=(t,e,n)=>{let i=QC.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",i).attr("y",QC.rect_padding).attr("dominant-baseline","hanging"),s=0;n.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",QC.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",QC.rect_min_width/2).attr("dy",.75*QC.line_height).text(t),s++}));let a=1.5*QC.rect_padding+s*QC.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",QC.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}},eE=(t,e,n,i)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",QC.rect_padding).attr("y",i).attr("dominant-baseline","hanging"),s=0;let a=[];return n.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let n=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=n,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",QC.rect_padding).attr("dy",QC.line_height).text(t)})),r},nE=function(t,e,n,i,r){const s=n.edge(iE(e.src),iE(e.dst)),a=_o().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+i).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+Mm.getUrl(QC.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+Mm.getUrl(QC.arrowMarkerAbsolute)+"#"+XC.ARROW+"_line_ending)")),((t,e,n,i)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+KC;KC++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(i).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")})(t,o,0,`<<${e.type}>>`)},iE=t=>t.replace(/\s/g,"").replace(/\./g,"_"),rE={draw:(t,e,n,i)=>{QC=nx().requirement,i.db.clear(),i.parser.parse(t);const r=QC.securityLevel;let s;"sandbox"===r&&(s=Fa("#i"+e));const a=Fa("sandbox"===r?s.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);ZC(a,QC);const o=new Pf({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:QC.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let c=i.db.getRequirements(),l=i.db.getElements(),h=i.db.getRelationships();((t,e,n)=>{Object.keys(t).forEach((i=>{let r=t[i];i=iE(i),vm.info("Added new requirement: ",i);const s=n.append("g").attr("id",i),a=JC(s,"req-"+i);let o=tE(s,i+"_title",[`<<${r.type}>>`,`${r.name}`]);eE(s,i+"_body",[`Id: ${r.id}`,`Text: ${r.text}`,`Risk: ${r.risk}`,`Verification: ${r.verifyMethod}`],o.y);const c=a.node().getBBox();e.setNode(i,{width:c.width,height:c.height,shape:"rect",id:i})}))})(c,o,a),((t,e,n)=>{Object.keys(t).forEach((i=>{let r=t[i];const s=iE(i),a=n.append("g").attr("id",s),o="element-"+s,c=JC(a,o);let l=tE(a,o+"_title",["<<Element>>",`${i}`]);eE(a,o+"_body",[`Type: ${r.type||"Not Specified"}`,`Doc Ref: ${r.docRef||"None"}`],l.y);const h=c.node().getBBox();e.setNode(s,{width:h.width,height:h.height,shape:"rect",id:s})}))})(l,o,a),((t,e)=>{t.forEach((function(t){let n=iE(t.src),i=iE(t.dst);e.setEdge(n,i,{relationship:t})}))})(h,o),by(o),function(t,e){e.nodes().forEach((function(n){void 0!==n&&void 0!==e.node(n)&&(t.select("#"+n),t.select("#"+n).attr("transform","translate("+(e.node(n).x-e.node(n).width/2)+","+(e.node(n).y-e.node(n).height/2)+" )"))}))}(a,o),h.forEach((function(t){nE(a,t,o,e,i)}));const u=QC.rect_padding,d=a.node().getBBox(),f=d.width+2*u,p=d.height+2*u;lx(a,p,f,QC.useMaxWidth),a.attr("viewBox",`${d.x-u} ${d.y-u} ${f} ${p}`)}};var sE=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,3],r=[1,5],s=[1,7],a=[2,5],o=[1,15],c=[1,17],l=[1,18],h=[1,19],u=[1,21],d=[1,22],f=[1,23],p=[1,29],g=[1,30],y=[1,31],m=[1,32],b=[1,33],_=[1,34],x=[1,35],v=[1,36],k=[1,37],w=[1,38],T=[1,39],C=[1,40],E=[1,43],S=[1,44],A=[1,45],D=[1,46],L=[1,47],O=[1,48],M=[1,51],B=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],N=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],I=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],F=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],R=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],$=[67,68,69],P=[1,121],Y=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],j={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,openDirective:11,typeDirective:12,closeDirective:13,":":14,argDirective:15,participant:16,actor:17,AS:18,restOfLine:19,participant_actor:20,signal:21,autonumber:22,NUM:23,off:24,activate:25,deactivate:26,note_statement:27,links_statement:28,link_statement:29,properties_statement:30,details_statement:31,title:32,legacy_title:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,loop:39,end:40,rect:41,opt:42,alt:43,else_sections:44,par:45,par_sections:46,critical:47,option_sections:48,break:49,option:50,and:51,else:52,note:53,placement:54,text2:55,over:56,actor_pair:57,links:58,link:59,properties:60,details:61,spaceList:62,",":63,left_of:64,right_of:65,signaltype:66,"+":67,"-":68,ACTOR:69,SOLID_OPEN_ARROW:70,DOTTED_OPEN_ARROW:71,SOLID_ARROW:72,DOTTED_ARROW:73,SOLID_CROSS:74,DOTTED_CROSS:75,SOLID_POINT:76,DOTTED_POINT:77,TXT:78,open_directive:79,type_directive:80,arg_directive:81,close_directive:82,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",39:"loop",40:"end",41:"rect",42:"opt",43:"alt",45:"par",47:"critical",49:"break",50:"option",51:"and",52:"else",53:"note",56:"over",58:"links",59:"link",60:"properties",61:"details",63:",",64:"left_of",65:"right_of",67:"+",68:"-",69:"ACTOR",70:"SOLID_OPEN_ARROW",71:"DOTTED_OPEN_ARROW",72:"SOLID_ARROW",73:"DOTTED_ARROW",74:"SOLID_CROSS",75:"DOTTED_CROSS",76:"SOLID_POINT",77:"DOTTED_POINT",78:"TXT",79:"open_directive",80:"type_directive",81:"arg_directive",82:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 4:return i.apply(s[o]),s[o];case 5:case 9:this.$=[];break;case 6:s[o-1].push(s[o]),this.$=s[o-1];break;case 7:case 8:case 56:this.$=s[o];break;case 12:s[o-3].type="addParticipant",s[o-3].description=i.parseMessage(s[o-1]),this.$=s[o-3];break;case 13:s[o-1].type="addParticipant",this.$=s[o-1];break;case 14:s[o-3].type="addActor",s[o-3].description=i.parseMessage(s[o-1]),this.$=s[o-3];break;case 15:s[o-1].type="addActor",this.$=s[o-1];break;case 17:this.$={type:"sequenceIndex",sequenceIndex:Number(s[o-2]),sequenceIndexStep:Number(s[o-1]),sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(s[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:i.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:s[o-1]};break;case 22:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:s[o-1]};break;case 28:i.setDiagramTitle(s[o].substring(6)),this.$=s[o].substring(6);break;case 29:i.setDiagramTitle(s[o].substring(7)),this.$=s[o].substring(7);break;case 30:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 31:case 32:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 33:s[o-1].unshift({type:"loopStart",loopText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.LOOP_START}),s[o-1].push({type:"loopEnd",loopText:s[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=s[o-1];break;case 34:s[o-1].unshift({type:"rectStart",color:i.parseMessage(s[o-2]),signalType:i.LINETYPE.RECT_START}),s[o-1].push({type:"rectEnd",color:i.parseMessage(s[o-2]),signalType:i.LINETYPE.RECT_END}),this.$=s[o-1];break;case 35:s[o-1].unshift({type:"optStart",optText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.OPT_START}),s[o-1].push({type:"optEnd",optText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.OPT_END}),this.$=s[o-1];break;case 36:s[o-1].unshift({type:"altStart",altText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.ALT_START}),s[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=s[o-1];break;case 37:s[o-1].unshift({type:"parStart",parText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.PAR_START}),s[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=s[o-1];break;case 38:s[o-1].unshift({type:"criticalStart",criticalText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.CRITICAL_START}),s[o-1].push({type:"criticalEnd",signalType:i.LINETYPE.CRITICAL_END}),this.$=s[o-1];break;case 39:s[o-1].unshift({type:"breakStart",breakText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.BREAK_START}),s[o-1].push({type:"breakEnd",optText:i.parseMessage(s[o-2]),signalType:i.LINETYPE.BREAK_END}),this.$=s[o-1];break;case 42:this.$=s[o-3].concat([{type:"option",optionText:i.parseMessage(s[o-1]),signalType:i.LINETYPE.CRITICAL_OPTION},s[o]]);break;case 44:this.$=s[o-3].concat([{type:"and",parText:i.parseMessage(s[o-1]),signalType:i.LINETYPE.PAR_AND},s[o]]);break;case 46:this.$=s[o-3].concat([{type:"else",altText:i.parseMessage(s[o-1]),signalType:i.LINETYPE.ALT_ELSE},s[o]]);break;case 47:this.$=[s[o-1],{type:"addNote",placement:s[o-2],actor:s[o-1].actor,text:s[o]}];break;case 48:s[o-2]=[].concat(s[o-1],s[o-1]).slice(0,2),s[o-2][0]=s[o-2][0].actor,s[o-2][1]=s[o-2][1].actor,this.$=[s[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:s[o-2].slice(0,2),text:s[o]}];break;case 49:this.$=[s[o-1],{type:"addLinks",actor:s[o-1].actor,text:s[o]}];break;case 50:this.$=[s[o-1],{type:"addALink",actor:s[o-1].actor,text:s[o]}];break;case 51:this.$=[s[o-1],{type:"addProperties",actor:s[o-1].actor,text:s[o]}];break;case 52:this.$=[s[o-1],{type:"addDetails",actor:s[o-1].actor,text:s[o]}];break;case 55:this.$=[s[o-2],s[o]];break;case 57:this.$=i.PLACEMENT.LEFTOF;break;case 58:this.$=i.PLACEMENT.RIGHTOF;break;case 59:this.$=[s[o-4],s[o-1],{type:"addMessage",from:s[o-4].actor,to:s[o-1].actor,signalType:s[o-3],msg:s[o]},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:s[o-1]}];break;case 60:this.$=[s[o-4],s[o-1],{type:"addMessage",from:s[o-4].actor,to:s[o-1].actor,signalType:s[o-3],msg:s[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:s[o-4]}];break;case 61:this.$=[s[o-3],s[o-1],{type:"addMessage",from:s[o-3].actor,to:s[o-1].actor,signalType:s[o-2],msg:s[o]}];break;case 62:this.$={type:"addParticipant",actor:s[o]};break;case 63:this.$=i.LINETYPE.SOLID_OPEN;break;case 64:this.$=i.LINETYPE.DOTTED_OPEN;break;case 65:this.$=i.LINETYPE.SOLID;break;case 66:this.$=i.LINETYPE.DOTTED;break;case 67:this.$=i.LINETYPE.SOLID_CROSS;break;case 68:this.$=i.LINETYPE.DOTTED_CROSS;break;case 69:this.$=i.LINETYPE.SOLID_POINT;break;case 70:this.$=i.LINETYPE.DOTTED_POINT;break;case 71:this.$=i.parseMessage(s[o].trim().substring(1));break;case 72:i.parseDirective("%%{","open_directive");break;case 73:i.parseDirective(s[o],"type_directive");break;case 74:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 75:i.parseDirective("}%%","close_directive","sequence")}},table:[{3:1,4:n,5:i,6:4,7:r,11:6,79:s},{1:[3]},{3:8,4:n,5:i,6:4,7:r,11:6,79:s},{3:9,4:n,5:i,6:4,7:r,11:6,79:s},{3:10,4:n,5:i,6:4,7:r,11:6,79:s},e([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],a,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},{13:49,14:[1,50],82:M},e([14,82],[2,73]),e(B,[2,6]),{6:41,10:52,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},e(B,[2,8]),e(B,[2,9]),{17:53,69:O},{17:54,69:O},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:O},{17:60,69:O},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},e(B,[2,28]),e(B,[2,29]),{35:[1,66]},{37:[1,67]},e(B,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},e(B,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:O},{17:89,69:O},{17:90,69:O},{17:91,69:O},e([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},e(B,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},e(B,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},e(B,[2,20]),{5:[1,102]},{5:[1,103]},e(B,[2,23]),e(B,[2,24]),e(B,[2,25]),e(B,[2,26]),e(B,[2,27]),e(B,[2,30]),e(B,[2,31]),e(N,a,{8:104}),e(N,a,{8:105}),e(N,a,{8:106}),e(I,a,{44:107,8:108}),e(F,a,{46:109,8:110}),e(R,a,{48:111,8:112}),e(N,a,{8:113}),{17:116,67:[1,114],68:[1,115],69:O},e($,[2,63]),e($,[2,64]),e($,[2,65]),e($,[2,66]),e($,[2,67]),e($,[2,68]),e($,[2,69]),e($,[2,70]),{17:117,69:O},{17:119,57:118,69:O},{69:[2,57]},{69:[2,58]},{55:120,78:P},{55:122,78:P},{55:123,78:P},{55:124,78:P},e(Y,[2,10]),{13:125,82:M},{82:[2,74]},{19:[1,126]},e(B,[2,13]),{19:[1,127]},e(B,[2,15]),{5:[1,128]},e(B,[2,18]),e(B,[2,19]),e(B,[2,21]),e(B,[2,22]),{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[1,129],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[1,130],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[1,131],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},{40:[1,132]},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[2,45],41:x,42:v,43:k,45:w,47:T,49:C,52:[1,133],53:E,58:S,59:A,60:D,61:L,69:O,79:s},{40:[1,134]},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[2,43],41:x,42:v,43:k,45:w,47:T,49:C,51:[1,135],53:E,58:S,59:A,60:D,61:L,69:O,79:s},{40:[1,136]},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[2,41],41:x,42:v,43:k,45:w,47:T,49:C,50:[1,137],53:E,58:S,59:A,60:D,61:L,69:O,79:s},{4:o,5:c,6:41,9:14,10:16,11:6,16:l,17:42,20:h,21:20,22:u,25:d,26:f,27:24,28:25,29:26,30:27,31:28,32:p,33:g,34:y,36:m,38:b,39:_,40:[1,138],41:x,42:v,43:k,45:w,47:T,49:C,53:E,58:S,59:A,60:D,61:L,69:O,79:s},{17:139,69:O},{17:140,69:O},{55:141,78:P},{55:142,78:P},{55:143,78:P},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},e(B,[2,17]),e(B,[2,33]),e(B,[2,34]),e(B,[2,35]),e(B,[2,36]),{19:[1,148]},e(B,[2,37]),{19:[1,149]},e(B,[2,38]),{19:[1,150]},e(B,[2,39]),{55:151,78:P},{55:152,78:P},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:O},e(Y,[2,11]),e(B,[2,12]),e(B,[2,14]),e(I,a,{8:108,44:154}),e(F,a,{8:110,46:155}),e(R,a,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}],defaultActions:{7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},z=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),79;case 1:return this.begin("type_directive"),80;case 2:return this.popState(),this.begin("arg_directive"),14;case 3:return this.popState(),this.popState(),82;case 4:return 81;case 5:case 52:case 65:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return 23;case 12:return this.begin("ID"),16;case 13:return this.begin("ID"),20;case 14:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),69;case 15:return this.popState(),this.popState(),this.begin("LINE"),18;case 16:return this.popState(),this.popState(),5;case 17:return this.begin("LINE"),39;case 18:return this.begin("LINE"),41;case 19:return this.begin("LINE"),42;case 20:return this.begin("LINE"),43;case 21:return this.begin("LINE"),52;case 22:return this.begin("LINE"),45;case 23:return this.begin("LINE"),51;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),50;case 26:return this.begin("LINE"),49;case 27:return this.popState(),19;case 28:return 40;case 29:return 64;case 30:return 65;case 31:return 58;case 32:return 59;case 33:return 60;case 34:return 61;case 35:return 56;case 36:return 53;case 37:return this.begin("ID"),25;case 38:return this.begin("ID"),26;case 39:return 32;case 40:return 33;case 41:return this.begin("acc_title"),34;case 42:return this.popState(),"acc_title_value";case 43:return this.begin("acc_descr"),36;case 44:return this.popState(),"acc_descr_value";case 45:this.begin("acc_descr_multiline");break;case 46:this.popState();break;case 47:return"acc_descr_multiline_value";case 48:return 7;case 49:return 22;case 50:return 24;case 51:return 63;case 53:return e.yytext=e.yytext.trim(),69;case 54:return 72;case 55:return 73;case 56:return 70;case 57:return 71;case 58:return 74;case 59:return 75;case 60:return 76;case 61:return 77;case 62:return 78;case 63:return 67;case 64:return 68;case 66:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\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,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[46,47],inclusive:!1},acc_descr:{rules:[44],inclusive:!1},acc_title:{rules:[42],inclusive:!1},open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,14],inclusive:!1},ALIAS:{rules:[7,8,15,16],inclusive:!1},LINE:{rules:[7,8,27],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],inclusive:!0}}},t);function U(){this.yy={}}return j.lexer=z,U.prototype=j,j.Parser=U,new U}();sE.parser=sE;const aE=sE,oE=t=>null!==t.match(/^\s*sequenceDiagram/);let cE,lE,hE={},uE=[],dE=!1;const fE=function(t,e,n,i){const r=hE[t];r&&e===r.name&&null==n||(null!=n&&null!=n.text||(n={text:e,wrap:null,type:i}),null!=i&&null!=n.text||(n={text:e,wrap:null,type:i}),hE[t]={name:e,description:n.text,wrap:void 0===n.wrap&&yE()||!!n.wrap,prevActor:cE,links:{},properties:{},actorCnt:null,rectData:null,type:i||"participant"},cE&&hE[cE]&&(hE[cE].nextActor=t),cE=t)},pE=function(t,e,n={text:void 0,wrap:void 0},i){if(i===mE.ACTIVE_END){const e=(t=>{let e,n=0;for(e=0;e<uE.length;e++)uE[e].type===mE.ACTIVE_START&&uE[e].from.actor===t&&n++,uE[e].type===mE.ACTIVE_END&&uE[e].from.actor===t&&n--;return n})(t.actor);if(e<1){let e=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return uE.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&yE()||!!n.wrap,type:i}),!0},gE=function(t){return hE[t]},yE=()=>void 0!==lE?lE:nx().sequence.wrap,mE={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},bE=function(t,e,n){n.text,void 0===n.wrap&&yE()||n.wrap;const i=[].concat(t,t);uE.push({from:i[0],to:i[1],message:n.text,wrap:void 0===n.wrap&&yE()||!!n.wrap,type:mE.NOTE,placement:e})},_E=function(t,e){const n=gE(t);try{let t=Em(e.text,nx());t=t.replace(/&amp;/g,"&"),t=t.replace(/&equals;/g,"=");xE(n,JSON.parse(t))}catch(t){vm.error("error while parsing actor link text",t)}};function xE(t,e){if(null==t.links)t.links=e;else for(let n in e)t.links[n]=e[n]}const vE=function(t,e){const n=gE(t);try{let t=Em(e.text,nx());kE(n,JSON.parse(t))}catch(t){vm.error("error while parsing actor properties text",t)}};function kE(t,e){if(null==t.properties)t.properties=e;else for(let n in e)t.properties[n]=e[n]}const wE=function(t,e){const n=gE(t),i=document.getElementById(e.text);try{const t=i.innerHTML,e=JSON.parse(t);e.properties&&kE(n,e.properties),e.links&&xE(n,e.links)}catch(t){vm.error("error while parsing actor details text",t)}},TE=function(t){if(Array.isArray(t))t.forEach((function(t){TE(t)}));else switch(t.type){case"sequenceIndex":uE.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":fE(t.actor,t.actor,t.description,"participant");break;case"addActor":fE(t.actor,t.actor,t.description,"actor");break;case"activeStart":case"activeEnd":pE(t.actor,void 0,void 0,t.signalType);break;case"addNote":bE(t.actor,t.placement,t.text);break;case"addLinks":_E(t.actor,t.text);break;case"addALink":!function(t,e){const n=gE(t);try{const t={};let a=Em(e.text,nx());var i=a.indexOf("@");a=a.replace(/&amp;/g,"&"),a=a.replace(/&equals;/g,"=");var r=a.slice(0,i-1).trim(),s=a.slice(i+1).trim();t[r]=s,xE(n,t)}catch(t){vm.error("error while parsing actor link text",t)}}(t.actor,t.text);break;case"addProperties":vE(t.actor,t.text);break;case"addDetails":wE(t.actor,t.text);break;case"addMessage":pE(t.from,t.to,t.msg,t.signalType);break;case"loopStart":pE(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":pE(void 0,void 0,void 0,t.signalType);break;case"rectStart":pE(void 0,void 0,t.color,t.signalType);break;case"optStart":pE(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":pE(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":jx(t.text);break;case"parStart":case"and":pE(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":pE(void 0,void 0,t.criticalText,t.signalType);break;case"option":pE(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":pE(void 0,void 0,t.breakText,t.signalType)}},CE={addActor:fE,addMessage:function(t,e,n,i){uE.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&yE()||!!n.wrap,answer:i})},addSignal:pE,addLinks:_E,addDetails:wE,addProperties:vE,autoWrap:yE,setWrap:function(t){lE=t},enableSequenceNumbers:function(){dE=!0},disableSequenceNumbers:function(){dE=!1},showSequenceNumbers:()=>dE,getMessages:function(){return uE},getActors:function(){return hE},getActor:gE,getActorKeys:function(){return Object.keys(hE)},getActorProperty:function(t,e){if(void 0!==t&&void 0!==t.properties)return t.properties[e]},getAccTitle:zx,getDiagramTitle:qx,setDiagramTitle:Hx,parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().sequence,clear:function(){hE={},uE=[],dE=!1,Yx()},parseMessage:function(t){const e=t.trim(),n={text:e.replace(/^:?(?:no)?wrap:/,"").trim(),wrap:null!==e.match(/^:?wrap:/)||null===e.match(/^:?nowrap:/)&&void 0};return vm.debug("parseMessage:",n),n},LINETYPE:mE,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:bE,setAccTitle:jx,apply:TE,setAccDescription:Ux,getAccDescription:Wx};let EE=[];const SE=()=>{EE.forEach((t=>{t()})),EE=[]},AE=function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},DE=(t,e)=>{var n;n=()=>{const n=document.querySelectorAll(t);0!==n.length&&(n[0].addEventListener("mouseover",(function(){ME("actor"+e+"_popup")})),n[0].addEventListener("mouseout",(function(){BE("actor"+e+"_popup")})))},EE.push(n)},LE=function(t,n,i,r){const s=t.append("image");s.attr("x",n),s.attr("y",i);var a=(0,e.N)(r);s.attr("xlink:href",a)},OE=function(t,n,i,r){const s=t.append("use");s.attr("x",n),s.attr("y",i);var a=(0,e.N)(r);s.attr("xlink:href","#"+a)},ME=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="block")},BE=function(t){var e=document.getElementById(t);null!=e&&(e.style.display="none")},NE=function(t,e){let n=0,i=0;const r=e.text.split(Mm.lineBreakRegex);let s=[],a=0,o=()=>e.y;if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":o=()=>Math.round(e.y+e.textMargin);break;case"middle":case"center":o=()=>Math.round(e.y+(n+i+e.textMargin)/2);break;case"bottom":case"end":o=()=>Math.round(e.y+(n+i+2*e.textMargin)-e.textMargin)}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)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"}for(let[c,l]of r.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==e.fontSize&&(a=c*e.fontSize);const r=t.append("text");if(r.attr("x",e.x),r.attr("y",o()),void 0!==e.anchor&&r.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&r.style("font-family",e.fontFamily),void 0!==e.fontSize&&r.style("font-size",e.fontSize),void 0!==e.fontWeight&&r.style("font-weight",e.fontWeight),void 0!==e.fill&&r.attr("fill",e.fill),void 0!==e.class&&r.attr("class",e.class),void 0!==e.dy?r.attr("dy",e.dy):0!==a&&r.attr("dy",a),e.tspan){const t=r.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(l)}else r.text(l);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(i+=(r._groups||r)[0][0].getBBox().height,n=i),s.push(r)}return s},IE=function(t,e){const n=t.append("polygon");var i,r,s,a,o;return n.attr("points",(i=e.x,r=e.y,s=e.width,a=e.height,i+","+r+" "+(i+s)+","+r+" "+(i+s)+","+(r+a-(o=7))+" "+(i+s-1.2*o)+","+(r+a)+" "+i+","+(r+a))),n.attr("class","labelBox"),e.y=e.y+e.height/2,NE(t,e),n};let FE=-1;const RE=(t,e)=>{t.selectAll&&t.selectAll(".actor-line").attr("class","200").attr("y2",e-55)},$E=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}},PE=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},YE=function(){function t(t,e,n,r,s,a,o){i(e.append("text").attr("x",n+s/2).attr("y",r+a/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,s,a,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:u}=c;let d=l&&l.replace?l.replace("px",""):l;const f=t.split(Mm.lineBreakRegex);for(let t=0;t<f.length;t++){const c=t*d-d*(f.length-1)/2,p=e.append("text").attr("x",n+s/2).attr("y",r).style("text-anchor","middle").style("font-size",l).style("font-weight",u).style("font-family",h);p.append("tspan").attr("x",n+s/2).attr("dy",c).text(f[t]),p.attr("y",r+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(p,o)}}function n(t,n,r,s,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",s).attr("width",a).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,s,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),jE=function(){function t(t,e,n,r,s,a,o){i(e.append("text").attr("x",n).attr("y",r).style("text-anchor","start").text(t),o)}function e(t,e,n,r,s,a,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:u}=c,d=t.split(Mm.lineBreakRegex);for(let t=0;t<d.length;t++){const s=t*l-l*(d.length-1)/2,c=e.append("text").attr("x",n).attr("y",r).style("text-anchor","start").style("font-size",l).style("font-weight",u).style("font-family",h);c.append("tspan").attr("x",n).attr("dy",s).text(d[t]),c.attr("y",r+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function n(t,n,r,s,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",s).attr("width",a).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,s,0,o,c,l),i(u,c)}function i(t,e){for(const n in e)e.hasOwnProperty(n)&&t.attr(n,e[n])}return function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),zE={drawRect:AE,drawText:NE,drawLabel:IE,drawActor:function(t,e,n){switch(e.type){case"actor":return function(t,e,n){const i=e.x+e.width/2;0===e.y&&(FE++,t.append("line").attr("id","actor"+FE).attr("x1",i).attr("y1",80).attr("x2",i).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"));const r=t.append("g");r.attr("class","actor-man");const s=PE();s.x=e.x,s.y=e.y,s.fill="#eaeaea",s.width=e.width,s.height=e.height,s.class="actor",s.rx=3,s.ry=3,r.append("line").attr("id","actor-man-torso"+FE).attr("x1",i).attr("y1",e.y+25).attr("x2",i).attr("y2",e.y+45),r.append("line").attr("id","actor-man-arms"+FE).attr("x1",i-18).attr("y1",e.y+33).attr("x2",i+18).attr("y2",e.y+33),r.append("line").attr("x1",i-18).attr("y1",e.y+60).attr("x2",i).attr("y2",e.y+45),r.append("line").attr("x1",i).attr("y1",e.y+45).attr("x2",i+16).attr("y2",e.y+60);const a=r.append("circle");a.attr("cx",e.x+e.width/2),a.attr("cy",e.y+10),a.attr("r",15),a.attr("width",e.width),a.attr("height",e.height);const o=r.node().getBBox();return e.height=o.height,YE(n)(e.description,r,s.x,s.y+35,s.width,s.height,{class:"actor"},n),e.height}(t,e,n);case"participant":return function(t,e,n){const i=e.x+e.width/2,r=t.append("g");var s=r;0===e.y&&(FE++,s.append("line").attr("id","actor"+FE).attr("x1",i).attr("y1",5).attr("x2",i).attr("y2",2e3).attr("class","actor-line").attr("stroke-width","0.5px").attr("stroke","#999"),s=r.append("g"),e.actorCnt=FE,null!=e.links&&(s.attr("id","root-"+FE),DE("#root-"+FE,FE)));const a=PE();var o="actor";null!=e.properties&&e.properties.class?o=e.properties.class:a.fill="#eaeaea",a.x=e.x,a.y=e.y,a.width=e.width,a.height=e.height,a.class=o,a.rx=3,a.ry=3;const c=AE(s,a);if(e.rectData=a,null!=e.properties&&e.properties.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?OE(s,a.x+a.width-20,a.y+10,t.substr(1)):LE(s,a.x+a.width-20,a.y+10,t)}YE(n)(e.description,s,a.x,a.y,a.width,a.height,{class:"actor"},n);let l=e.height;if(c.node){const t=c.node().getBBox();e.height=t.height,l=t.height}return l}(t,e,n)}},drawPopup:function(t,n,i,r,s){if(void 0===n.links||null===n.links||0===Object.keys(n.links).length)return{height:0,width:0};const a=n.links,o=n.actorCnt,c=n.rectData;var l="none";s&&(l="block !important");const h=t.append("g");h.attr("id","actor"+o+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",l),DE("#actor"+o+"_popup",o);var u="";void 0!==c.class&&(u=" "+c.class);let d=c.width>i?c.width:i;const f=h.append("rect");if(f.attr("class","actorPopupMenuPanel"+u),f.attr("x",c.x),f.attr("y",c.height),f.attr("fill",c.fill),f.attr("stroke",c.stroke),f.attr("width",d),f.attr("height",c.height),f.attr("rx",c.rx),f.attr("ry",c.ry),null!=a){var p=20;for(let t in a){var g=h.append("a"),y=(0,e.N)(a[t]);g.attr("xlink:href",y),g.attr("target","_blank"),jE(r)(t,g,c.x+10,c.height+p,d,20,{class:"actor"},r),p+=30}}return f.attr("height",p),{height:c.height+p,width:d}},drawImage:LE,drawEmbeddedImage:OE,anchorElement:function(t){return t.append("g")},drawActivation:function(t,e,n,i,r){const s=PE(),a=e.anchored;s.x=e.startx,s.y=e.starty,s.class="activation"+r%3,s.width=e.stopx-e.startx,s.height=n-e.starty,AE(a,s)},drawLoop:function(t,e,n,i){const{boxMargin:r,boxTextMargin:s,labelBoxHeight:a,labelBoxWidth:o,messageFontFamily:c,messageFontSize:l,messageFontWeight:h}=i,u=t.append("g"),d=function(t,e,n,i){return u.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",i).attr("class","loopLine")};d(e.startx,e.starty,e.stopx,e.starty),d(e.stopx,e.starty,e.stopx,e.stopy),d(e.startx,e.stopy,e.stopx,e.stopy),d(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach((function(t){d(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}));let f=$E();f.text=n,f.x=e.startx,f.y=e.starty,f.fontFamily=c,f.fontSize=l,f.fontWeight=h,f.anchor="middle",f.valign="middle",f.tspan=!1,f.width=o||50,f.height=a||20,f.textMargin=s,f.class="labelText",IE(u,f),f=$E(),f.text=e.title,f.x=e.startx+o/2+(e.stopx-e.startx)/2,f.y=e.starty+r+s,f.anchor="middle",f.valign="middle",f.textMargin=s,f.class="loopText",f.fontFamily=c,f.fontSize=l,f.fontWeight=h,f.wrap=!0;let p=NE(u,f);return void 0!==e.sectionTitles&&e.sectionTitles.forEach((function(t,n){if(t.message){f.text=t.message,f.x=e.startx+(e.stopx-e.startx)/2,f.y=e.sections[n].y+r+s,f.class="loopText",f.anchor="middle",f.valign="middle",f.tspan=!1,f.fontFamily=c,f.fontSize=l,f.fontWeight=h,f.wrap=e.wrap,p=NE(u,f);let i=Math.round(p.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[n].height+=i-(r+s)}})),e.height=Math.round(e.stopy-e.starty),u},drawBackgroundRect:function(t,e){AE(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},insertArrowHead:function(t){t.append("defs").append("marker").attr("id","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")},insertArrowFilledHead:function(t){t.append("defs").append("marker").attr("id","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")},insertSequenceNumber:function(t){t.append("defs").append("marker").attr("id","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)},insertArrowCrossHead:function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",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")},insertDatabaseIcon:function(t){t.append("defs").append("symbol").attr("id","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")},insertComputerIcon:function(t){t.append("defs").append("symbol").attr("id","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")},insertClockIcon:function(t){t.append("defs").append("symbol").attr("id","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")},getTextObj:$E,getNoteRect:PE,popupMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'block'; }"},popdownMenu:function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = 'none'; }"},fixLifeLineHeights:RE,sanitizeUrl:e.N};let UE={};const WE={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))},clear:function(){this.actors=[],this.loops=[],this.messages=[],this.notes=[]},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],loops:[],messages:[],notes:[]},init: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,ZE(nx())},updateVal:function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},updateBounds:function(t,e,n,i){const r=this;let s=0;function a(a){return function(o){s++;const c=r.sequenceItems.length-s+1;r.updateVal(o,"starty",e-c*UE.boxMargin,Math.min),r.updateVal(o,"stopy",i+c*UE.boxMargin,Math.max),r.updateVal(WE.data,"startx",t-c*UE.boxMargin,Math.min),r.updateVal(WE.data,"stopx",n+c*UE.boxMargin,Math.max),"activation"!==a&&(r.updateVal(o,"startx",t-c*UE.boxMargin,Math.min),r.updateVal(o,"stopx",n+c*UE.boxMargin,Math.max),r.updateVal(WE.data,"starty",e-c*UE.boxMargin,Math.min),r.updateVal(WE.data,"stopy",i+c*UE.boxMargin,Math.max))}}this.sequenceItems.forEach(a()),this.activations.forEach(a("activation"))},insert:function(t,e,n,i){const r=Math.min(t,n),s=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(WE.data,"startx",r,Math.min),this.updateVal(WE.data,"starty",a,Math.min),this.updateVal(WE.data,"stopx",s,Math.max),this.updateVal(WE.data,"stopy",o,Math.max),this.updateBounds(r,a,s,o)},newActivation:function(t,e,n){const i=n[t.from.actor],r=QE(t.from.actor).length||0,s=i.x+i.width/2+(r-1)*UE.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+UE.activationWidth,stopy:void 0,actor:t.from.actor,anchored:zE.anchorElement(e)})},endActivation:function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop: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}},newLoop:function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:WE.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},HE=t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),qE=t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),VE=t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight});const GE=function(t,e,n,i,r,s){if(!0===r.hideUnusedParticipants){const t=new Set;s.forEach((e=>{t.add(e.from),t.add(e.to)})),n=n.filter((e=>t.has(e)))}let a=0,o=0,c=0;for(const r of n){const n=e[r];n.width=n.width||UE.width,n.height=Math.max(n.height||UE.height,UE.height),n.margin=n.margin||UE.actorMargin,n.x=a+o,n.y=i;const s=zE.drawActor(t,n,UE);c=Math.max(c,s),WE.insert(n.x,i,n.x+n.width,n.height),a+=n.width,o+=n.margin,WE.models.addActor(n)}WE.bumpVerticalPos(c)},XE=function(t,e,n,i){let r=0,s=0;for(const a of n){const n=e[a],o=tS(n),c=zE.drawPopup(t,n,o,UE,UE.forceMenus,i);c.height>r&&(r=c.height),c.width+n.x>s&&(s=c.width+n.x)}return{maxHeight:r,maxWidth:s}},ZE=function(t){C_(UE,t),t.fontFamily&&(UE.actorFontFamily=UE.noteFontFamily=UE.messageFontFamily=t.fontFamily),t.fontSize&&(UE.actorFontSize=UE.noteFontSize=UE.messageFontSize=t.fontSize),t.fontWeight&&(UE.actorFontWeight=UE.noteFontWeight=UE.messageFontWeight=t.fontWeight)},QE=function(t){return WE.activations.filter((function(e){return e.actor===t}))},KE=function(t,e){const n=e[t],i=QE(t);return[i.reduce((function(t,e){return Math.min(t,e.startx)}),n.x+n.width/2),i.reduce((function(t,e){return Math.max(t,e.stopx)}),n.x+n.width/2)]};function JE(t,e,n,i,r){WE.bumpVerticalPos(n);let s=i;if(e.id&&e.message&&t[e.id]){const n=t[e.id].width,r=HE(UE);e.message=q_.wrapLabel(`[${e.message}]`,n-2*UE.wrapPadding,r),e.width=n,e.wrap=!0;const a=q_.calculateTextDimensions(e.message,r),o=Math.max(a.height,UE.labelBoxHeight);s=i+o,vm.debug(`${o} - ${e.message}`)}r(e),WE.bumpVerticalPos(s)}const tS=function(t){let e=0;const n=VE(UE);for(const i in t.links){const t=q_.calculateTextDimensions(i,n).width+2*UE.wrapPadding+2*UE.boxMargin;e<t&&(e=t)}return e};const eS=function(t,e,n,i){const r={},s=[];let a,o,c;return t.forEach((function(t){switch(t.id=q_.random({length:10}),t.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:s.push({id:t.id,msg:t.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:t.message&&(a=s.pop(),r[a.id]=a,r[t.id]=a,s.push(a));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:a=s.pop(),r[a.id]=a;break;case i.db.LINETYPE.ACTIVE_START:{const n=e[t.from?t.from.actor:t.to.actor],i=QE(t.from?t.from.actor:t.to.actor).length,r=n.x+n.width/2+(i-1)*UE.activationWidth/2,s={startx:r,stopx:r+UE.activationWidth,actor:t.from.actor,enabled:!0};WE.activations.push(s)}break;case i.db.LINETYPE.ACTIVE_END:{const e=WE.activations.map((t=>t.actor)).lastIndexOf(t.from.actor);delete WE.activations.splice(e,1)[0]}}void 0!==t.placement?(o=function(t,e,n){const i=e[t.from].x,r=e[t.to].x,s=t.wrap&&t.message;let a=q_.calculateTextDimensions(s?q_.wrapLabel(t.message,UE.width,qE(UE)):t.message,qE(UE));const o={width:s?UE.width:Math.max(UE.width,a.width+2*UE.noteMargin),height:0,startx:e[t.from].x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===n.db.PLACEMENT.RIGHTOF?(o.width=s?Math.max(UE.width,a.width):Math.max(e[t.from].width/2+e[t.to].width/2,a.width+2*UE.noteMargin),o.startx=i+(e[t.from].width+UE.actorMargin)/2):t.placement===n.db.PLACEMENT.LEFTOF?(o.width=s?Math.max(UE.width,a.width+2*UE.noteMargin):Math.max(e[t.from].width/2+e[t.to].width/2,a.width+2*UE.noteMargin),o.startx=i-o.width+(e[t.from].width-UE.actorMargin)/2):t.to===t.from?(a=q_.calculateTextDimensions(s?q_.wrapLabel(t.message,Math.max(UE.width,e[t.from].width),qE(UE)):t.message,qE(UE)),o.width=s?Math.max(UE.width,e[t.from].width):Math.max(e[t.from].width,UE.width,a.width+2*UE.noteMargin),o.startx=i+(e[t.from].width-o.width)/2):(o.width=Math.abs(i+e[t.from].width/2-(r+e[t.to].width/2))+UE.actorMargin,o.startx=i<r?i+e[t.from].width/2-UE.actorMargin/2:r+e[t.to].width/2-UE.actorMargin/2),s&&(o.message=q_.wrapLabel(t.message,o.width-2*UE.wrapPadding,qE(UE))),vm.debug(`NM:[${o.startx},${o.stopx},${o.starty},${o.stopy}:${o.width},${o.height}=${t.message}]`),o}(t,e,i),t.noteModel=o,s.forEach((t=>{a=t,a.from=Math.min(a.from,o.startx),a.to=Math.max(a.to,o.startx+o.width),a.width=Math.max(a.width,Math.abs(a.from-a.to))-UE.labelBoxWidth}))):(c=function(t,e,n){let i=!1;if([n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(i=!0),!i)return{};const r=KE(t.from,e),s=KE(t.to,e),a=r[0]<=s[0]?1:0,o=r[0]<s[0]?0:1,c=[...r,...s],l=Math.abs(s[o]-r[a]);t.wrap&&t.message&&(t.message=q_.wrapLabel(t.message,Math.max(l+2*UE.wrapPadding,UE.width),HE(UE)));const h=q_.calculateTextDimensions(t.message,HE(UE));return{width:Math.max(t.wrap?0:h.width+2*UE.wrapPadding,l+2*UE.wrapPadding,UE.width),height:0,startx:r[a],stopx:s[o],starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,c),toBounds:Math.max.apply(null,c)}}(t,e,i),t.msgModel=c,c.startx&&c.stopx&&s.length>0&&s.forEach((n=>{if(a=n,c.startx===c.stopx){const n=e[t.from],i=e[t.to];a.from=Math.min(n.x-c.width/2,n.x-n.width/2,a.from),a.to=Math.max(i.x+c.width/2,i.x+n.width/2,a.to),a.width=Math.max(a.width,Math.abs(a.to-a.from))-UE.labelBoxWidth}else a.from=Math.min(c.startx,a.from),a.to=Math.max(c.stopx,a.to),a.width=Math.max(a.width,c.width)-UE.labelBoxWidth})))})),WE.activations=[],vm.debug("Loop type widths:",r),r},nS={bounds:WE,drawActors:GE,drawActorsPopup:XE,setConf:ZE,draw:function(t,e,n,i){const{securityLevel:r,sequence:s}=nx();let a;UE=s,"sandbox"===r&&(a=Fa("#i"+e));const o=Fa("sandbox"===r?a.nodes()[0].contentDocument.body:"body"),c="sandbox"===r?a.nodes()[0].contentDocument:document;WE.init(),vm.debug(i.db);const l="sandbox"===r?o.select(`[id="${e}"]`):Fa(`[id="${e}"]`),h=i.db.getActors(),u=i.db.getActorKeys(),d=i.db.getMessages(),f=i.db.getDiagramTitle(),p=function(t,e,n){const i={};return e.forEach((function(e){if(t[e.to]&&t[e.from]){const r=t[e.to];if(e.placement===n.db.PLACEMENT.LEFTOF&&!r.prevActor)return;if(e.placement===n.db.PLACEMENT.RIGHTOF&&!r.nextActor)return;const s=void 0!==e.placement,a=!s,o=s?qE(UE):HE(UE),c=e.wrap?q_.wrapLabel(e.message,UE.width-2*UE.wrapPadding,o):e.message,l=q_.calculateTextDimensions(c,o).width+2*UE.wrapPadding;a&&e.from===r.nextActor?i[e.to]=Math.max(i[e.to]||0,l):a&&e.from===r.prevActor?i[e.from]=Math.max(i[e.from]||0,l):a&&e.from===e.to?(i[e.from]=Math.max(i[e.from]||0,l/2),i[e.to]=Math.max(i[e.to]||0,l/2)):e.placement===n.db.PLACEMENT.RIGHTOF?i[e.from]=Math.max(i[e.from]||0,l):e.placement===n.db.PLACEMENT.LEFTOF?i[r.prevActor]=Math.max(i[r.prevActor]||0,l):e.placement===n.db.PLACEMENT.OVER&&(r.prevActor&&(i[r.prevActor]=Math.max(i[r.prevActor]||0,l/2)),r.nextActor&&(i[e.from]=Math.max(i[e.from]||0,l/2)))}})),vm.debug("maxMessageWidthPerActor:",i),i}(h,d,i);UE.height=function(t,e){let n=0;Object.keys(t).forEach((e=>{const i=t[e];i.wrap&&(i.description=q_.wrapLabel(i.description,UE.width-2*UE.wrapPadding,VE(UE)));const r=q_.calculateTextDimensions(i.description,VE(UE));i.width=i.wrap?UE.width:Math.max(UE.width,r.width+2*UE.wrapPadding),i.height=i.wrap?Math.max(r.height,UE.height):UE.height,n=Math.max(n,i.height)}));for(const n in e){const i=t[n];if(!i)continue;const r=t[i.nextActor];if(!r)continue;const s=e[n]+UE.actorMargin-i.width/2-r.width/2;i.margin=Math.max(s,UE.actorMargin)}return Math.max(n,UE.height)}(h,p),zE.insertComputerIcon(l),zE.insertDatabaseIcon(l),zE.insertClockIcon(l),GE(l,h,u,0,UE,d);const g=eS(d,h,p,i);zE.insertArrowHead(l),zE.insertArrowCrossHead(l),zE.insertArrowFilledHead(l),zE.insertSequenceNumber(l);let y=1,m=1;const b=[];d.forEach((function(t){let e,n,r;switch(t.type){case i.db.LINETYPE.NOTE:n=t.noteModel,function(t,e){WE.bumpVerticalPos(UE.boxMargin),e.height=UE.boxMargin,e.starty=WE.getVerticalPos();const n=zE.getNoteRect();n.x=e.startx,n.y=e.starty,n.width=e.width||UE.width,n.class="note";const i=t.append("g"),r=zE.drawRect(i,n),s=zE.getTextObj();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=UE.noteFontFamily,s.fontSize=UE.noteFontSize,s.fontWeight=UE.noteFontWeight,s.anchor=UE.noteAlign,s.textMargin=UE.noteMargin,s.valign="center";const a=NE(i,s),o=Math.round(a.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));r.attr("height",o+2*UE.noteMargin),e.height+=o+2*UE.noteMargin,WE.bumpVerticalPos(o+2*UE.noteMargin),e.stopy=e.starty+o+2*UE.noteMargin,e.stopx=e.startx+n.width,WE.insert(e.startx,e.starty,e.stopx,e.stopy),WE.models.addNote(e)}(l,n);break;case i.db.LINETYPE.ACTIVE_START:WE.newActivation(t,l,h);break;case i.db.LINETYPE.ACTIVE_END:!function(t,e){const n=WE.endActivation(t);n.starty+18>e&&(n.starty=e-6,e+=12),zE.drawActivation(l,n,e,UE,QE(t.from.actor).length),WE.insert(n.startx,e-10,n.stopx,e)}(t,WE.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.LOOP_END:e=WE.endLoop(),zE.drawLoop(l,e,"loop",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;case i.db.LINETYPE.RECT_START:JE(g,t,UE.boxMargin,UE.boxMargin,(t=>WE.newLoop(void 0,t.message)));break;case i.db.LINETYPE.RECT_END:e=WE.endLoop(),zE.drawBackgroundRect(l,e),WE.models.addLoop(e),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos());break;case i.db.LINETYPE.OPT_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.OPT_END:e=WE.endLoop(),zE.drawLoop(l,e,"opt",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;case i.db.LINETYPE.ALT_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.ALT_ELSE:JE(g,t,UE.boxMargin+UE.boxTextMargin,UE.boxMargin,(t=>WE.addSectionToLoop(t)));break;case i.db.LINETYPE.ALT_END:e=WE.endLoop(),zE.drawLoop(l,e,"alt",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;case i.db.LINETYPE.PAR_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.PAR_AND:JE(g,t,UE.boxMargin+UE.boxTextMargin,UE.boxMargin,(t=>WE.addSectionToLoop(t)));break;case i.db.LINETYPE.PAR_END:e=WE.endLoop(),zE.drawLoop(l,e,"par",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;case i.db.LINETYPE.AUTONUMBER:y=t.message.start||y,m=t.message.step||m,t.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.CRITICAL_OPTION:JE(g,t,UE.boxMargin+UE.boxTextMargin,UE.boxMargin,(t=>WE.addSectionToLoop(t)));break;case i.db.LINETYPE.CRITICAL_END:e=WE.endLoop(),zE.drawLoop(l,e,"critical",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;case i.db.LINETYPE.BREAK_START:JE(g,t,UE.boxMargin,UE.boxMargin+UE.boxTextMargin,(t=>WE.newLoop(t)));break;case i.db.LINETYPE.BREAK_END:e=WE.endLoop(),zE.drawLoop(l,e,"break",UE),WE.bumpVerticalPos(e.stopy-WE.getVerticalPos()),WE.models.addLoop(e);break;default:try{r=t.msgModel,r.starty=WE.getVerticalPos(),r.sequenceIndex=y,r.sequenceVisible=i.db.showSequenceNumbers();const e=function(t,e){WE.bumpVerticalPos(10);const{startx:n,stopx:i,message:r}=e,s=Mm.splitBreaks(r).length,a=q_.calculateTextDimensions(r,HE(UE)),o=a.height/s;let c;e.height+=o,WE.bumpVerticalPos(o);let l=a.height-10;const h=a.width;if(n===i){c=WE.getVerticalPos()+l,UE.rightAngles||(l+=UE.boxMargin,c=WE.getVerticalPos()+l),l+=30;const t=Math.max(h/2,UE.width/2);WE.insert(n-t,WE.getVerticalPos()-10+l,i+t,WE.getVerticalPos()+30+l)}else l+=UE.boxMargin,c=WE.getVerticalPos()+l,WE.insert(n,c-10,i,c);return WE.bumpVerticalPos(l),e.height+=l,e.stopy=e.starty+e.height,WE.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}(0,r);b.push({messageModel:r,lineStartY:e}),WE.models.addMessage(r)}catch(t){vm.error("error while drawing message",t)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT].includes(t.type)&&(y+=m)})),b.forEach((t=>function(t,e,n,i){const{startx:r,stopx:s,starty:a,message:o,type:c,sequenceIndex:l,sequenceVisible:h}=e,u=q_.calculateTextDimensions(o,HE(UE)),d=zE.getTextObj();d.x=r,d.y=a+10,d.width=s-r,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=UE.messageFontFamily,d.fontSize=UE.messageFontSize,d.fontWeight=UE.messageFontWeight,d.anchor=UE.messageAlign,d.valign="center",d.textMargin=UE.wrapPadding,d.tspan=!1,NE(t,d);const f=u.width;let p;r===s?p=UE.rightAngles?t.append("path").attr("d",`M  ${r},${n} H ${r+Math.max(UE.width/2,f/2)} V ${n+25} H ${r}`):t.append("path").attr("d","M "+r+","+n+" C "+(r+60)+","+(n-10)+" "+(r+60)+","+(n+30)+" "+r+","+(n+20)):(p=t.append("line"),p.attr("x1",r),p.attr("y1",n),p.attr("x2",s),p.attr("y2",n)),c===i.db.LINETYPE.DOTTED||c===i.db.LINETYPE.DOTTED_CROSS||c===i.db.LINETYPE.DOTTED_POINT||c===i.db.LINETYPE.DOTTED_OPEN?(p.style("stroke-dasharray","3, 3"),p.attr("class","messageLine1")):p.attr("class","messageLine0");let g="";UE.arrowMarkerAbsolute&&(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,g=g.replace(/\(/g,"\\("),g=g.replace(/\)/g,"\\)")),p.attr("stroke-width",2),p.attr("stroke","none"),p.style("fill","none"),c!==i.db.LINETYPE.SOLID&&c!==i.db.LINETYPE.DOTTED||p.attr("marker-end","url("+g+"#arrowhead)"),c!==i.db.LINETYPE.SOLID_POINT&&c!==i.db.LINETYPE.DOTTED_POINT||p.attr("marker-end","url("+g+"#filled-head)"),c!==i.db.LINETYPE.SOLID_CROSS&&c!==i.db.LINETYPE.DOTTED_CROSS||p.attr("marker-end","url("+g+"#crosshead)"),(h||UE.showSequenceNumbers)&&(p.attr("marker-start","url("+g+"#sequencenumber)"),t.append("text").attr("x",r).attr("y",n+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(l))}(l,t.messageModel,t.lineStartY,i))),UE.mirrorActors&&(WE.bumpVerticalPos(2*UE.boxMargin),GE(l,h,u,WE.getVerticalPos(),UE,d),WE.bumpVerticalPos(UE.boxMargin),RE(l,WE.getVerticalPos()));const _=XE(l,h,u,c),{bounds:x}=WE.getBounds();vm.debug("For line height fix Querying: #"+e+" .actor-line");Ra("#"+e+" .actor-line").attr("y2",x.stopy);let v=x.stopy-x.starty;v<_.maxHeight&&(v=_.maxHeight);let k=v+2*UE.diagramMarginY;UE.mirrorActors&&(k=k-UE.boxMargin+UE.bottomMarginAdj);let w=x.stopx-x.startx;w<_.maxWidth&&(w=_.maxWidth);const T=w+2*UE.diagramMarginX;f&&l.append("text").text(f).attr("x",(x.stopx-x.startx)/2-2*UE.diagramMarginX).attr("y",-25),lx(l,k,T,UE.useMaxWidth);const C=f?40:0;l.attr("viewBox",x.startx-UE.diagramMarginX+" -"+(UE.diagramMarginY+C)+" "+T+" "+(k+C)),vm.debug("models:",WE.models)}};var iS=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,3],r=[1,5],s=[1,7],a=[2,5],o=[1,15],c=[1,17],l=[1,21],h=[1,22],u=[1,23],d=[1,24],f=[1,37],p=[1,25],g=[1,26],y=[1,27],m=[1,28],b=[1,29],_=[1,32],x=[1,33],v=[1,34],k=[1,35],w=[1,36],T=[1,39],C=[1,40],E=[1,41],S=[1,42],A=[1,38],D=[1,45],L=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],O=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],M=[1,4,5,7,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],B=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],N={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,directive:6,SD:7,document:8,line:9,statement:10,classDefStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":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,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,class:42,CLASSENTITY_IDS:43,STYLECLASS:44,openDirective:45,typeDirective:46,closeDirective:47,":":48,argDirective:49,direction_tb:50,direction_bt:51,direction_rl:52,direction_lr:53,eol:54,";":55,EDGE_STATE:56,STYLE_SEPARATOR:57,left_of:58,right_of:59,open_directive:60,type_directive:61,arg_directive:62,close_directive:63,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",7:"SD",14:"DESCR",15:"--\x3e",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:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"class",43:"CLASSENTITY_IDS",44:"STYLECLASS",48:":",50:"direction_tb",51:"direction_bt",52:"direction_rl",53:"direction_lr",55:";",56:"EDGE_STATE",57:"STYLE_SEPARATOR",58:"left_of",59:"right_of",60:"open_directive",61:"type_directive",62:"arg_directive",63:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[11,3],[11,3],[12,3],[6,3],[6,5],[32,1],[32,1],[32,1],[32,1],[54,1],[54,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1],[45,1],[46,1],[49,1],[47,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 4:return i.setRootDoc(s[o]),s[o];case 5:this.$=[];break;case 6:"nl"!=s[o]&&(s[o-1].push(s[o]),this.$=s[o-1]);break;case 7:case 8:case 12:this.$=s[o];break;case 9:this.$="nl";break;case 13:const t=s[o-1];t.description=i.trimColon(s[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:s[o-2],state2:s[o]};break;case 15:const e=i.trimColon(s[o]);this.$={stmt:"relation",state1:s[o-3],state2:s[o-1],description:e};break;case 19:this.$={stmt:"state",id:s[o-3],type:"default",description:"",doc:s[o-1]};break;case 20:var c=s[o],l=s[o-2].trim();if(s[o].match(":")){var h=s[o].split(":");c=h[0],l=[l,h[1]]}this.$={stmt:"state",id:c,type:"default",description:l};break;case 21:this.$={stmt:"state",id:s[o-3],type:"default",description:s[o-5],doc:s[o-1]};break;case 22:this.$={stmt:"state",id:s[o],type:"fork"};break;case 23:this.$={stmt:"state",id:s[o],type:"join"};break;case 24:this.$={stmt:"state",id:s[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:s[o-1].trim(),note:{position:s[o-2].trim(),text:s[o].trim()}};break;case 30:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 31:case 32:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 33:case 34:this.$={stmt:"classDef",id:s[o-1].trim(),classes:s[o].trim()};break;case 35:this.$={stmt:"applyClass",id:s[o-1].trim(),styleClass:s[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:s[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:s[o-2].trim(),classes:[s[o].trim()],type:"default",description:""};break;case 50:i.parseDirective("%%{","open_directive");break;case 51:i.parseDirective(s[o],"type_directive");break;case 52:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 53:i.parseDirective("}%%","close_directive","state")}},table:[{3:1,4:n,5:i,6:4,7:r,45:6,60:s},{1:[3]},{3:8,4:n,5:i,6:4,7:r,45:6,60:s},{3:9,4:n,5:i,6:4,7:r,45:6,60:s},{3:10,4:n,5:i,6:4,7:r,45:6,60:s},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,50,51,52,53,56,60],a,{8:11}),{46:12,61:[1,13]},{61:[2,50]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:c,6:30,9:14,10:16,11:18,12:19,13:20,16:l,17:h,19:u,22:d,24:f,25:p,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:s},{47:43,48:[1,44],63:D},e([48,63],[2,51]),e(L,[2,6]),{6:30,10:46,11:18,12:19,13:20,16:l,17:h,19:u,22:d,24:f,25:p,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:s},e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(L,[2,11]),e(L,[2,12],{14:[1,47],15:[1,48]}),e(L,[2,16]),{18:[1,49]},e(L,[2,18],{20:[1,50]}),{23:[1,51]},e(L,[2,22]),e(L,[2,23]),e(L,[2,24]),e(L,[2,25]),{30:52,31:[1,53],58:[1,54],59:[1,55]},e(L,[2,28]),e(L,[2,29]),{34:[1,56]},{36:[1,57]},e(L,[2,32]),{39:[1,58],41:[1,59]},{43:[1,60]},e(O,[2,44],{57:[1,61]}),e(O,[2,45],{57:[1,62]}),e(L,[2,38]),e(L,[2,39]),e(L,[2,40]),e(L,[2,41]),e(M,[2,36]),{49:63,62:[1,64]},e(M,[2,53]),e(L,[2,7]),e(L,[2,13]),{13:65,24:f,56:A},e(L,[2,17]),e(B,a,{8:66}),{24:[1,67]},{24:[1,68]},{23:[1,69]},{24:[2,48]},{24:[2,49]},e(L,[2,30]),e(L,[2,31]),{40:[1,70]},{40:[1,71]},{44:[1,72]},{24:[1,73]},{24:[1,74]},{47:75,63:D},{63:[2,52]},e(L,[2,14],{14:[1,76]}),{4:o,5:c,6:30,9:14,10:16,11:18,12:19,13:20,16:l,17:h,19:u,21:[1,77],22:d,24:f,25:p,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:s},e(L,[2,20],{20:[1,78]}),{31:[1,79]},{24:[1,80]},e(L,[2,33]),e(L,[2,34]),e(L,[2,35]),e(O,[2,46]),e(O,[2,47]),e(M,[2,37]),e(L,[2,15]),e(L,[2,19]),e(B,a,{8:81}),e(L,[2,26]),e(L,[2,27]),{4:o,5:c,6:30,9:14,10:16,11:18,12:19,13:20,16:l,17:h,19:u,21:[1,82],22:d,24:f,25:p,26:g,27:y,28:m,29:b,32:31,33:_,35:x,37:v,38:k,42:w,45:6,50:T,51:C,52:E,53:S,56:A,60:s},e(L,[2,21])],defaultActions:{7:[2,50],8:[2,1],9:[2,2],10:[2,3],54:[2,48],55:[2,49],64:[2,52]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},I=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return 41;case 1:case 44:return 50;case 2:case 45:return 51;case 3:case 46:return 52;case 4:case 47:return 53;case 5:return this.begin("open_directive"),60;case 6:return this.begin("type_directive"),61;case 7:return this.popState(),this.begin("arg_directive"),48;case 8:return this.popState(),this.popState(),63;case 9:return 62;case 10:case 11:case 13:case 14:case 15:case 16:case 56:case 58:case 64:break;case 12:case 79:return 5;case 17:case 34:return this.pushState("SCALE"),17;case 18:case 35:return 18;case 19:case 25:case 36:case 51:case 54:this.popState();break;case 20:return this.begin("acc_title"),33;case 21:return this.popState(),"acc_title_value";case 22:return this.begin("acc_descr"),35;case 23:return this.popState(),"acc_descr_value";case 24:this.begin("acc_descr_multiline");break;case 26:return"acc_descr_multiline_value";case 27:return this.pushState("CLASSDEF"),38;case 28:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 29:return this.popState(),this.pushState("CLASSDEFID"),39;case 30:return this.popState(),40;case 31:return this.pushState("CLASS"),42;case 32:return this.popState(),this.pushState("CLASS_STYLE"),43;case 33:return this.popState(),44;case 37:this.pushState("STATE");break;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 40:case 43:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 48:this.begin("STATE_STRING");break;case 49:return this.popState(),this.pushState("STATE_ID"),"AS";case 50:case 66:return this.popState(),"ID";case 52:return"STATE_DESCR";case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 57:return this.popState(),21;case 59:return this.begin("NOTE"),29;case 60:return this.popState(),this.pushState("NOTE_ID"),58;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:this.popState(),this.pushState("FLOATING_NOTE");break;case 63:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:return"NOTE_TEXT";case 67:return this.popState(),this.pushState("NOTE_TEXT"),24;case 68:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 69:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 70:case 71:return 7;case 72:return 16;case 73:return 56;case 74:return 24;case 75:return e.yytext=e.yytext.trim(),14;case 76:return 15;case 77:return 28;case 78:return 57;case 80:return"INVALID"}},rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\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,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/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,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/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]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[14,15],inclusive:!1},close_directive:{rules:[14,15],inclusive:!1},arg_directive:{rules:[8,9,14,15],inclusive:!1},type_directive:{rules:[7,8,14,15],inclusive:!1},open_directive:{rules:[6,14,15],inclusive:!1},struct:{rules:[14,15,27,31,37,44,45,46,47,56,57,58,59,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[66],inclusive:!1},FLOATING_NOTE:{rules:[63,64,65],inclusive:!1},NOTE_TEXT:{rules:[68,69],inclusive:!1},NOTE_ID:{rules:[67],inclusive:!1},NOTE:{rules:[60,61,62],inclusive:!1},CLASS_STYLE:{rules:[33],inclusive:!1},CLASS:{rules:[32],inclusive:!1},CLASSDEFID:{rules:[30],inclusive:!1},CLASSDEF:{rules:[28,29],inclusive:!1},acc_descr_multiline:{rules:[25,26],inclusive:!1},acc_descr:{rules:[23],inclusive:!1},acc_title:{rules:[21],inclusive:!1},SCALE:{rules:[18,19,35,36],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[50],inclusive:!1},STATE_STRING:{rules:[51,52],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[14,15,38,39,40,41,42,43,48,49,53,54,55],inclusive:!1},ID:{rules:[14,15],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,10,11,12,13,15,16,17,20,22,24,27,31,34,37,55,59,70,71,72,73,74,75,76,78,79,80],inclusive:!0}}},t);function F(){this.yy={}}return N.lexer=I,F.prototype=N,N.Parser=F,new F}();iS.parser=iS;const rS=iS,sS=(t,e)=>{var n;return"dagre-wrapper"!==(null==(n=null==e?void 0:e.state)?void 0:n.defaultRenderer)&&null!==t.match(/^\s*stateDiagram/)},aS=(t,e)=>{var n;return null!==t.match(/^\s*stateDiagram-v2/)||!(!t.match(/^\s*stateDiagram/)||"dagre-wrapper"!==(null==(n=null==e?void 0:e.state)?void 0:n.defaultRenderer))},oS="state",cS="relation",lS="default",hS="divider",uS="[*]",dS="start",fS="color",pS="fill";let gS="LR",yS=[],mS={};let bS={root:{relations:[],states:{},documents:{}}},_S=bS.root,xS=0,vS=0;const kS=t=>JSON.parse(JSON.stringify(t)),wS=(t,e,n)=>{if(e.stmt===cS)wS(t,e.state1,!0),wS(t,e.state2,!1);else if(e.stmt===oS&&"[*]"===e.id&&(e.id=n?t.id+"_start":t.id+"_end",e.start=n),e.doc){const t=[];let n,i=[];for(n=0;n<e.doc.length;n++)if(e.doc[n].type===hS){const r=kS(e.doc[n]);r.doc=kS(i),t.push(r),i=[]}else i.push(e.doc[n]);if(t.length>0&&i.length>0){const n={stmt:oS,id:N_(),type:"divider",doc:kS(i)};t.push(kS(n)),e.doc=t}e.doc.forEach((t=>wS(e,t,!0)))}},TS=function(t,e="default",n=null,i=null,r=null,s=null,a=null,o=null){if(void 0===_S.states[t]?(vm.info("Adding state ",t,i),_S.states[t]={id:t,descriptions:[],type:e,doc:n,note:r,classes:[],styles:[],textStyles:[]}):(_S.states[t].doc||(_S.states[t].doc=n),_S.states[t].type||(_S.states[t].type=e)),i&&(vm.info("Setting state description",t,i),"string"==typeof i&&LS(t,i.trim()),"object"==typeof i&&i.forEach((e=>LS(t,e.trim())))),r&&(_S.states[t].note=r,_S.states[t].note.text=Mm.sanitizeText(_S.states[t].note.text,nx())),s){vm.info("Setting state classes",t,s);("string"==typeof s?[s]:s).forEach((e=>MS(t,e.trim())))}if(a){vm.info("Setting state styles",t,a);("string"==typeof a?[a]:a).forEach((e=>BS(t,e.trim())))}if(o){vm.info("Setting state styles",t,a);("string"==typeof o?[o]:o).forEach((e=>NS(t,e.trim())))}},CS=function(t){bS={root:{relations:[],states:{},documents:{}}},_S=bS.root,xS=0,mS={},t||Yx()},ES=function(t){return _S.states[t]};function SS(t=""){let e=t;return t===uS&&(xS++,e=`start${xS}`),e}function AS(t="",e="default"){return t===uS?dS:e}const DS=function(t,e,n){if("object"==typeof t)!function(t,e,n){let i=SS(t.id),r=AS(t.id,t.type),s=SS(e.id),a=AS(e.id,e.type);TS(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),TS(s,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),_S.relations.push({id1:i,id2:s,relationTitle:Mm.sanitizeText(n,nx())})}(t,e,n);else{const i=SS(t),r=AS(t),s=function(t=""){let e=t;return"[*]"===t&&(xS++,e=`end${xS}`),e}(e),a=function(t="",e="default"){return"[*]"===t?"end":e}(e);TS(i,r),TS(s,a),_S.relations.push({id1:i,id2:s,title:Mm.sanitizeText(n,nx())})}},LS=function(t,e){const n=_S.states[t],i=e.startsWith(":")?e.replace(":","").trim():e;n.descriptions.push(Mm.sanitizeText(i,nx()))},OS=function(t,e=""){void 0===mS[t]&&(mS[t]={id:t,styles:[],textStyles:[]});const n=mS[t];null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(t.match(fS)){const t=e.replace(pS,"bgFill").replace(fS,pS);n.textStyles.push(t)}n.styles.push(e)}))},MS=function(t,e){t.split(",").forEach((function(t){let n=ES(t);if(void 0===n){const e=t.trim();TS(e),n=ES(e)}n.classes.push(e)}))},BS=function(t,e){const n=ES(t);void 0!==n&&n.textStyles.push(e)},NS=function(t,e){const n=ES(t);void 0!==n&&n.textStyles.push(e)},IS={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().state,addState:TS,clear:CS,getState:ES,getStates:function(){return _S.states},getRelations:function(){return _S.relations},getClasses:function(){return mS},getDirection:()=>gS,addRelation:DS,getDividerId:()=>(vS++,"divider-id-"+vS),setDirection:t=>{gS=t},cleanupLabel:function(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()},lineType:{LINE:0,DOTTED_LINE:1},relationType:{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},logDocuments:function(){vm.info("Documents = ",bS)},getRootDoc:()=>yS,setRootDoc:t=>{vm.info("Setting root doc",t),yS=t},getRootDocV2:()=>(wS({id:"root"},{id:"root",doc:yS},!0),{id:"root",doc:yS}),extract:t=>{let e;e=t.doc?t.doc:t,vm.info(e),CS(!0),vm.info("Extract",e),e.forEach((t=>{switch(t.stmt){case oS:TS(t.id,t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case cS:DS(t.state1,t.state2,t.description);break;case"classDef":OS(t.id,t.classes);break;case"applyClass":MS(t.id,t.styleClass)}}))},trimColon:t=>t&&":"===t[0]?t.substr(1).trim():t.trim(),getAccTitle:zx,setAccTitle:jx,getAccDescription:Wx,setAccDescription:Ux,addStyleClass:OS,setCssClass:MS,addDescription:LS,setDiagramTitle:Hx,getDiagramTitle:qx},FS={},RS=(t,e)=>{FS[t]=e},$S=(t,e)=>{const n=t.append("text").attr("x",2*nx().state.padding).attr("y",nx().state.textHeight+1.3*nx().state.padding).attr("font-size",nx().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,r=t.append("text").attr("x",nx().state.padding).attr("y",i+.4*nx().state.padding+nx().state.dividerMargin+nx().state.textHeight).attr("class","state-description");let s=!0,a=!0;e.descriptions.forEach((function(t){s||(!function(t,e,n){const i=t.append("tspan").attr("x",2*nx().state.padding).text(e);n||i.attr("dy",nx().state.textHeight)}(r,t,a),a=!1),s=!1}));const o=t.append("line").attr("x1",nx().state.padding).attr("y1",nx().state.padding+i+nx().state.dividerMargin/2).attr("y2",nx().state.padding+i+nx().state.dividerMargin/2).attr("class","descr-divider"),c=r.node().getBBox(),l=Math.max(c.width,n.width);return o.attr("x2",l+3*nx().state.padding),t.insert("rect",":first-child").attr("x",nx().state.padding).attr("y",nx().state.padding).attr("width",l+2*nx().state.padding).attr("height",c.height+i+2*nx().state.padding).attr("rx",nx().state.radius),t},PS=(t,e,n)=>{const i=nx().state.padding,r=2*nx().state.padding,s=t.node().getBBox(),a=s.width,o=s.x,c=t.append("text").attr("x",0).attr("y",nx().state.titleShift).attr("font-size",nx().state.fontSize).attr("class","state-title").text(e.id),l=c.node().getBBox().width+r;let h,u=Math.max(l,a);u===a&&(u+=r);const d=t.node().getBBox();e.doc,h=o-i,l>a&&(h=(a-u)/2+i),Math.abs(o-d.x)<i&&l>a&&(h=o-(l-a)/2);const f=1-nx().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",f).attr("class",n?"alt-composit":"composit").attr("width",u).attr("height",d.height+nx().state.textHeight+nx().state.titleShift+1).attr("rx","0"),c.attr("x",h+i),l<=a&&c.attr("x",o+(u-r)/2-l/2+i),t.insert("rect",":first-child").attr("x",h).attr("y",nx().state.titleShift-nx().state.textHeight-nx().state.padding).attr("width",u).attr("height",3*nx().state.textHeight).attr("rx",nx().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",nx().state.titleShift-nx().state.textHeight-nx().state.padding).attr("width",u).attr("height",d.height+3+2*nx().state.textHeight).attr("rx",nx().state.radius),t},YS=(t,e)=>{e.attr("class","state-note");const n=e.append("rect").attr("x",0).attr("y",nx().state.padding),i=e.append("g"),{textWidth:r,textHeight:s}=((t,e,n,i)=>{let r=0;const s=i.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let a=t.replace(/\r\n/g,"<br/>");a=a.replace(/\n/g,"<br/>");const o=a.split(Mm.lineBreakRegex);let c=1.25*nx().state.noteMargin;for(const t of o){const i=t.trim();if(i.length>0){const t=s.append("tspan");t.text(i),0===c&&(c+=t.node().getBBox().height),r+=c,t.attr("x",e+nx().state.noteMargin),t.attr("y",n+r+1.25*nx().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:r}})(t,0,0,i);return n.attr("height",s+2*nx().state.noteMargin),n.attr("width",r+2*nx().state.noteMargin),n},jS=function(t,e){const n=e.id,i={id:n,label:e.id,width:0,height:0},r=t.append("g").attr("id",n).attr("class","stateGroup");"start"===e.type&&(t=>{t.append("circle").attr("class","start-state").attr("r",nx().state.sizeUnit).attr("cx",nx().state.padding+nx().state.sizeUnit).attr("cy",nx().state.padding+nx().state.sizeUnit)})(r),"end"===e.type&&(t=>{t.append("circle").attr("class","end-state-outer").attr("r",nx().state.sizeUnit+nx().state.miniPadding).attr("cx",nx().state.padding+nx().state.sizeUnit+nx().state.miniPadding).attr("cy",nx().state.padding+nx().state.sizeUnit+nx().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",nx().state.sizeUnit).attr("cx",nx().state.padding+nx().state.sizeUnit+2).attr("cy",nx().state.padding+nx().state.sizeUnit+2)})(r),"fork"!==e.type&&"join"!==e.type||((t,e)=>{let n=nx().state.forkWidth,i=nx().state.forkHeight;if(e.parentId){let t=n;n=i,i=t}t.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",i).attr("x",nx().state.padding).attr("y",nx().state.padding)})(r,e),"note"===e.type&&YS(e.note.text,r),"divider"===e.type&&(t=>{t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",nx().state.textHeight).attr("class","divider").attr("x2",2*nx().state.textHeight).attr("y1",0).attr("y2",0)})(r),"default"===e.type&&0===e.descriptions.length&&((t,e)=>{const n=t.append("text").attr("x",2*nx().state.padding).attr("y",nx().state.textHeight+2*nx().state.padding).attr("font-size",nx().state.fontSize).attr("class","state-title").text(e.id),i=n.node().getBBox();t.insert("rect",":first-child").attr("x",nx().state.padding).attr("y",nx().state.padding).attr("width",i.width+2*nx().state.padding).attr("height",i.height+2*nx().state.padding).attr("rx",nx().state.radius)})(r,e),"default"===e.type&&e.descriptions.length>0&&$S(r,e);const s=r.node().getBBox();return i.width=s.width+2*nx().state.padding,i.height=s.height+2*nx().state.padding,RS(n,i),i};let zS=0;let US;const WS={},HS=(t,e,n,i,r,s,a)=>{const o=new Pf({compound:!0,multigraph:!0});let c,l=!0;for(c=0;c<t.length;c++)if("relation"===t[c].stmt){l=!1;break}n?o.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:l?1:US.edgeLengthFactor,nodeSep:l?1:50,isMultiGraph:!0}):o.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:l?1:US.edgeLengthFactor,nodeSep:l?1:50,ranker:"tight-tree",isMultiGraph:!0}),o.setDefaultEdgeLabel((function(){return{}})),a.db.extract(t);const h=a.db.getStates(),u=a.db.getRelations(),d=Object.keys(h);for(const t of d){const c=h[t];let l;if(n&&(c.parentId=n),c.doc){let t=e.append("g").attr("id",c.id).attr("class","stateGroup");l=HS(c.doc,t,c.id,!i,r,s,a);{t=PS(t,c,i);let e=t.node().getBBox();l.width=e.width,l.height=e.height+US.padding/2,WS[c.id]={y:US.compositTitleSize}}}else l=jS(e,c);if(c.note){const t={descriptions:[],id:c.id+"-note",note:c.note,type:"note"},n=jS(e,t);"left of"===c.note.position?(o.setNode(l.id+"-note",n),o.setNode(l.id,l)):(o.setNode(l.id,l),o.setNode(l.id+"-note",n)),o.setParent(l.id,l.id+"-group"),o.setParent(l.id+"-note",l.id+"-group")}else o.setNode(l.id,l)}vm.debug("Count=",o.nodeCount(),o);let f=0;u.forEach((function(t){var e;f++,vm.debug("Setting edge",t),o.setEdge(t.id1,t.id2,{relation:t,width:(e=t.title,e?e.length*US.fontSizeFactor:1),height:US.labelHeight*Mm.getRows(t.title).length,labelpos:"c"},"id"+f)})),by(o),vm.debug("Graph after layout",o.nodes());const p=e.node();o.nodes().forEach((function(t){if(void 0!==t&&void 0!==o.node(t)){vm.warn("Node "+t+": "+JSON.stringify(o.node(t))),r.select("#"+p.id+" #"+t).attr("transform","translate("+(o.node(t).x-o.node(t).width/2)+","+(o.node(t).y+(WS[t]?WS[t].y:0)-o.node(t).height/2)+" )"),r.select("#"+p.id+" #"+t).attr("data-x-shift",o.node(t).x-o.node(t).width/2);s.querySelectorAll("#"+p.id+" #"+t+" .divider").forEach((t=>{const e=t.parentElement;let n=0,i=0;e&&(e.parentElement&&(n=e.parentElement.getBBox().width),i=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(i)&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",n-i-8)}))}else vm.debug("No Node "+t+": "+JSON.stringify(o.node(t)))}));let g=p.getBBox();o.edges().forEach((function(t){void 0!==t&&void 0!==o.edge(t)&&(vm.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),function(t,e,n){e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,r=_o().x((function(t){return t.x})).y((function(t){return t.y})).curve(Co),s=t.append("path").attr("d",r(i)).attr("id","edge"+zS).attr("class","transition");let a="";if(nx().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),s.attr("marker-end","url("+a+"#"+function(t){switch(t){case IS.relationType.AGGREGATION:return"aggregation";case IS.relationType.EXTENSION:return"extension";case IS.relationType.COMPOSITION:return"composition";case IS.relationType.DEPENDENCY:return"dependency"}}(IS.relationType.DEPENDENCY)+"End)"),void 0!==n.title){const i=t.append("g").attr("class","stateLabel"),{x:r,y:s}=q_.calcLabelPosition(e.points),a=Mm.getRows(n.title);let o=0;const c=[];let l=0,h=0;for(let t=0;t<=a.length;t++){const e=i.append("text").attr("text-anchor","middle").text(a[t]).attr("x",r).attr("y",s+o),n=e.node().getBBox();if(l=Math.max(l,n.width),h=Math.min(h,n.x),vm.info(n.x,r,s+o),0===o){const t=e.node().getBBox();o=t.height,vm.info("Title height",o,s)}c.push(e)}let u=o*a.length;if(a.length>1){const t=(a.length-1)*o*.5;c.forEach(((e,n)=>e.attr("y",s+n*o-t))),u=o*a.length}const d=i.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",r-l/2-nx().state.padding/2).attr("y",s-u/2-nx().state.padding/2-3.5).attr("width",l+nx().state.padding).attr("height",u+nx().state.padding),vm.info(d)}zS++}(e,o.edge(t),o.edge(t).relation))})),g=p.getBBox();const y={id:n||"root",label:n||"root",width:0,height:0};return y.width=g.width+2*US.padding,y.height=g.height+2*US.padding,vm.debug("Doc rendered",y,o),y},qS={setConf:function(){},draw:function(t,e,n,i){US=nx().state;const r=nx().securityLevel;let s;"sandbox"===r&&(s=Fa("#i"+e));const a=Fa("sandbox"===r?s.nodes()[0].contentDocument.body:"body"),o="sandbox"===r?s.nodes()[0].contentDocument:document;vm.debug("Rendering diagram "+t);const c=a.select(`[id='${e}']`);c.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");new Pf({multigraph:!0,compound:!0,rankdir:"RL"}).setDefaultEdgeLabel((function(){return{}}));const l=i.db.getRootDoc();HS(l,c,void 0,!1,a,o,i);const h=US.padding,u=c.node().getBBox(),d=u.width+2*h,f=u.height+2*h;lx(c,f,1.75*d,US.useMaxWidth),c.attr("viewBox",`${u.x-US.padding}  ${u.y-US.padding} `+d+" "+f)}},VS="rect",GS="rectWithTitle",XS="statediagram",ZS="transition",QS="parent",KS="note",JS="----parent",tA="fill:none",eA="fill: #333",nA="text",iA="normal";let rA={},sA=0;function aA(t="",e=0,n="",i="----"){return`state-${t}${null!==n&&n.length>0?`${i}${n}`:""}-${e}`}const oA=(t,e,n,i,r,s)=>{const a=n.id,o=null==(c=i[a])?"":c.classes?c.classes.join(" "):"";var c;if("root"!==a){let e=VS;!0===n.start&&(e="start"),!1===n.start&&(e="end"),n.type!==lS&&(e=n.type),rA[a]||(rA[a]={id:a,shape:e,description:Mm.sanitizeText(a,nx()),classes:`${o} statediagram-state`});const i=rA[a];n.description&&(Array.isArray(i.description)?(i.shape=GS,i.description.push(n.description)):i.description.length>0?(i.shape=GS,i.description===a?i.description=[n.description]:i.description=[i.description,n.description]):(i.shape=VS,i.description=n.description),i.description=Mm.sanitizeTextOrArray(i.description,nx())),1===i.description.length&&i.shape===GS&&(i.shape=VS),!i.type&&n.doc&&(vm.info("Setting cluster for ",a,lA(n)),i.type="group",i.dir=lA(n),i.shape=n.type===hS?"divider":"roundedWithTitle",i.classes=i.classes+" statediagram-cluster "+(s?"statediagram-cluster-alt":""));const r={labelStyle:"",shape:i.shape,labelText:i.description,classes:i.classes,style:"",id:a,dir:i.dir,domId:aA(a,sA),type:i.type,padding:15};if(n.note){const e={labelStyle:"",shape:"note",labelText:n.note.text,classes:"statediagram-note",style:"",id:a+"----note-"+sA,domId:aA(a,sA,KS),type:i.type,padding:15},s={labelStyle:"",shape:"noteGroup",labelText:n.note.text,classes:i.classes,style:"",id:a+JS,domId:aA(a,sA,QS),type:"group",padding:0};sA++;const o=a+JS;t.setNode(o,s),t.setNode(e.id,e),t.setNode(a,r),t.setParent(a,o),t.setParent(e.id,o);let c=a,l=e.id;"left of"===n.note.position&&(c=e.id,l=a),t.setEdge(c,l,{arrowhead:"none",arrowType:"",style:tA,labelStyle:"",classes:"transition note-edge",arrowheadStyle:eA,labelpos:"c",labelType:nA,thickness:iA})}else t.setNode(a,r)}e&&"root"!==e.id&&(vm.trace("Setting node ",a," to be child of its parent ",e.id),t.setParent(a,e.id)),n.doc&&(vm.trace("Adding nodes children "),cA(t,n,n.doc,i,r,!s))},cA=(t,e,n,i,r,s)=>{vm.trace("items",n),n.forEach((n=>{switch(n.stmt){case oS:case lS:oA(t,e,n,i,r,s);break;case cS:{oA(t,e,n.state1,i,r,s),oA(t,e,n.state2,i,r,s);const a={id:"edge"+sA,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:tA,labelStyle:"",label:Mm.sanitizeText(n.description,nx()),arrowheadStyle:eA,labelpos:"c",labelType:nA,thickness:iA,classes:ZS};t.setEdge(n.state1.id,n.state2.id,a,sA),sA++}}}))},lA=(t,e="TB")=>{let n=e;if(t.doc)for(let e=0;e<t.doc.length;e++){const i=t.doc[e];"dir"===i.stmt&&(n=i.value)}return n},hA={setConf:function(t){const e=Object.keys(t);for(const n of e)t[n]},getClasses:function(t,e){vm.trace("Extracting classes"),e.db.clear();try{return e.parser.parse(t),e.db.extract(e.db.getRootDocV2()),e.db.getClasses()}catch(t){return t}},draw:function(t,e,n,i){vm.info("Drawing state diagram (v2)",e),rA={};let r=i.db.getDirection();void 0===r&&(r="LR");const{securityLevel:s,state:a}=nx(),o=a.nodeSpacing||50,c=a.rankSpacing||50;vm.info(i.db.getRootDocV2()),i.db.extract(i.db.getRootDocV2()),vm.info(i.db.getRootDocV2());const l=i.db.getStates(),h=new Pf({multigraph:!0,compound:!0}).setGraph({rankdir:lA(i.db.getRootDocV2()),nodesep:o,ranksep:c,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));let u;oA(h,void 0,i.db.getRootDocV2(),l,i.db,!0),"sandbox"===s&&(u=Fa("#i"+e));const d=Fa("sandbox"===s?u.nodes()[0].contentDocument.body:"body"),f=d.select(`[id="${e}"]`),p=d.select("#"+e+" g");Nw(p,h,["barb"],XS,e);q_.insertTitle(f,"statediagramTitleText",a.titleTopMargin,i.db.getDiagramTitle());const g=f.node().getBBox(),y=g.width+16,m=g.height+16;f.attr("class",XS);const b=f.node().getBBox();lx(f,m,y,a.useMaxWidth);const _=`${b.x-8} ${b.y-8} ${y} ${m}`;vm.debug(`viewBox ${_}`),f.attr("viewBox",_);const x=document.querySelectorAll('[id="'+e+'"] .edgeLabel .label');for(const t of x){const e=t.getBBox(),n=document.createElementNS("http://www.w3.org/2000/svg",VS);n.setAttribute("rx",0),n.setAttribute("ry",0),n.setAttribute("width",e.width),n.setAttribute("height",e.height),t.insertBefore(n,t.firstChild)}}};var uA=function(){var t,e=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},n=[1,2],i=[1,5],r=[6,9,11,17,18,20,22,23,24,26],s=[1,15],a=[1,16],o=[1,17],c=[1,18],l=[1,19],h=[1,20],u=[1,24],d=[4,6,9,11,17,18,20,22,23,24,26],f={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,taskName:24,taskData:25,open_directive:26,type_directive:27,arg_directive:28,close_directive:29,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,i,r,s,a){var o=s.length-1;switch(r){case 1:return s[o-1];case 3:case 7:case 8:this.$=[];break;case 4:s[o-1].push(s[o]),this.$=s[o-1];break;case 5:case 6:this.$=s[o];break;case 11:i.setDiagramTitle(s[o].substr(6)),this.$=s[o].substr(6);break;case 12:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 13:case 14:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 15:i.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 16:i.addTask(s[o-1],s[o]),this.$="task";break;case 18:i.parseDirective("%%{","open_directive");break;case 19:i.parseDirective(s[o],"type_directive");break;case 20:s[o]=s[o].trim().replace(/'/g,'"'),i.parseDirective(s[o],"arg_directive");break;case 21:i.parseDirective("}%%","close_directive","journey")}},table:[{3:1,4:n,7:3,12:4,26:i},{1:[3]},e(r,[2,3],{5:6}),{3:7,4:n,7:3,12:4,26:i},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:s,18:a,20:o,22:c,23:l,24:h,26:i},{1:[2,2]},{14:22,15:[1,23],29:u},e([15,29],[2,19]),e(r,[2,8],{1:[2,1]}),e(r,[2,4]),{7:21,10:25,12:4,17:s,18:a,20:o,22:c,23:l,24:h,26:i},e(r,[2,6]),e(r,[2,7]),e(r,[2,11]),{19:[1,26]},{21:[1,27]},e(r,[2,14]),e(r,[2,15]),{25:[1,28]},e(r,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},e(r,[2,5]),e(r,[2,12]),e(r,[2,13]),e(r,[2,16]),e(d,[2,9]),{14:32,29:u},{29:[2,20]},{11:[1,33]},e(d,[2,10])],defaultActions:{5:[2,18],7:[2,2],24:[2,21],31:[2,20]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,d=s.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);f.setInput(t,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;s.push(y);var m=f.options&&f.options.ranges;function b(){var t;return"number"!=typeof(t=i.pop()||f.lex()||u)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,v,k,w,T,C,E,S={};;){if(x=n[n.length-1],this.defaultActions[x]?v=this.defaultActions[x]:(null==_&&(_=b()),v=a[x]&&a[x][_]),void 0===v||!v.length||!v[0]){var A="";for(w in E=[],a[x])this.terminals_[w]&&w>h&&E.push("'"+this.terminals_[w]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:y,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(v[0]){case 1:n.push(_),r.push(f.yytext),s.push(f.yylloc),n.push(v[1]),_=null,l=f.yyleng,o=f.yytext,c=f.yylineno,y=f.yylloc;break;case 2:if(T=this.productions_[v[1]][1],S.$=r[r.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},m&&(S._$.range=[s[s.length-(T||1)].range[0],s[s.length-1].range[1]]),void 0!==(k=this.performAction.apply(S,[o,l,c,p.yy,v[1],r,s].concat(d))))return k;T&&(n=n.slice(0,-1*T*2),r=r.slice(0,-1*T),s=s.slice(0,-1*T)),n.push(this.productions_[v[1]][0]),r.push(S.$),s.push(S._$),C=a[n[n.length-2]][n[n.length-1]],n.push(C);break;case 3:return!0}}return!0}},p=(t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||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},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var r=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((n=this._input.match(this.rules[r[s]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:return this.begin("open_directive"),26;case 1:return this.begin("type_directive"),27;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),29;case 4:return 28;case 5:case 6:case 8:case 9:break;case 7:return 11;case 10:return 4;case 11:return 17;case 12:return this.begin("acc_title"),18;case 13:return this.popState(),"acc_title_value";case 14:return this.begin("acc_descr"),20;case 15:return this.popState(),"acc_descr_value";case 16:this.begin("acc_descr_multiline");break;case 17:this.popState();break;case 18:return"acc_descr_multiline_value";case 19:return 23;case 20:return 24;case 21:return 25;case 22:return 15;case 23:return 6;case 24:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\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:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},acc_descr_multiline:{rules:[17,18],inclusive:!1},acc_descr:{rules:[15],inclusive:!1},acc_title:{rules:[13],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],inclusive:!0}}},t);function g(){this.yy={}}return f.lexer=p,g.prototype=f,f.Parser=g,new g}();uA.parser=uA;const dA=uA,fA=t=>null!==t.match(/^\s*journey/);let pA="";const gA=[],yA=[],mA=[],bA=function(){let t=!0;for(const[e,n]of mA.entries())mA[e].processed,t=t&&n.processed;return t},_A={parseDirective:function(t,e,n){dD.parseDirective(this,t,e,n)},getConfig:()=>nx().journey,clear:function(){gA.length=0,yA.length=0,pA="",mA.length=0,Yx()},setDiagramTitle:Hx,getDiagramTitle:qx,setAccTitle:jx,getAccTitle:zx,setAccDescription:Ux,getAccDescription:Wx,addSection:function(t){pA=t,gA.push(t)},getSections:function(){return gA},getTasks:function(){let t=bA();let e=0;for(;!t&&e<100;)t=bA(),e++;return yA.push(...mA),yA},addTask:function(t,e){const n=e.substr(1).split(":");let i=0,r=[];1===n.length?(i=Number(n[0]),r=[]):(i=Number(n[0]),r=n[1].split(","));const s=r.map((t=>t.trim())),a={section:pA,type:pA,people:s,task:t,score:i};mA.push(a)},addTaskOrg:function(t){const e={section:pA,type:pA,description:t,task:t,classes:[]};yA.push(e)},getActors:function(){return function(){const t=[];return yA.forEach((e=>{e.people&&t.push(...e.people)})),[...new Set(t)].sort()}()}},xA=function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},vA=function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},kA=function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i};let wA=-1;const TA=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},CA=function(){function t(t,e,n,r,s,a,o,c){i(e.append("text").attr("x",n+s/2).attr("y",r+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function e(t,e,n,r,s,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,d=t.split(/<br\s*\/?>/gi);for(let t=0;t<d.length;t++){const c=t*h-h*(d.length-1)/2,f=e.append("text").attr("x",n+s/2).attr("y",r).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);f.append("tspan").attr("x",n+s/2).attr("dy",c).text(d[t]),f.attr("y",r+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(f,o)}}function n(t,n,r,s,a,o,c,l){const h=n.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",s).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,r,s,a,o,c,l),i(u,c)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),EA=vA,SA=function(t,e,n){const i=t.append("g"),r=TA();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,xA(i,r),CA(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},AA=kA,DA=function(t,e,n){const i=e.x+n.width/2,r=t.append("g");wA++;r.append("line").attr("id","task"+wA).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"),function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=t.append("g");r.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),e.score>3?function(t){const i=fo().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}(r):e.score<3?function(t){const i=fo().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}(r):r.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")}(r,{cx:i,cy:300+30*(5-e.score),score:e.score});const s=TA();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,xA(r,s);let a=e.x+14;e.people.forEach((t=>{const n=e.actors[t].color,i={cx:a,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};vA(r,i),a+=10})),CA(n)(e.task,r,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},LA=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},OA={};const MA=nx().journey,BA=MA.leftMargin,NA={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},updateBounds:function(t,e,n,i){const r=nx().journey,s=this;let a=0;var o;this.sequenceItems.forEach((function(c){a++;const l=s.sequenceItems.length-a+1;s.updateVal(c,"starty",e-l*r.boxMargin,Math.min),s.updateVal(c,"stopy",i+l*r.boxMargin,Math.max),s.updateVal(NA.data,"startx",t-l*r.boxMargin,Math.min),s.updateVal(NA.data,"stopx",n+l*r.boxMargin,Math.max),"activation"!==o&&(s.updateVal(c,"startx",t-l*r.boxMargin,Math.min),s.updateVal(c,"stopx",n+l*r.boxMargin,Math.max),s.updateVal(NA.data,"starty",e-l*r.boxMargin,Math.min),s.updateVal(NA.data,"stopy",i+l*r.boxMargin,Math.max))}))},insert:function(t,e,n,i){const r=Math.min(t,n),s=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(NA.data,"startx",r,Math.min),this.updateVal(NA.data,"starty",a,Math.min),this.updateVal(NA.data,"stopx",s,Math.max),this.updateVal(NA.data,"stopy",o,Math.max),this.updateBounds(r,a,s,o)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},IA=MA.sectionFills,FA=MA.sectionColours,RA=function(t,e,n){const i=nx().journey;let r="";const s=n+(2*i.height+i.diagramMarginY);let a=0,o="#CCC",c="black",l=0;for(const[n,h]of e.entries()){if(r!==h.section){o=IA[a%IA.length],l=a%IA.length,c=FA[a%FA.length];const e={x:n*i.taskMargin+n*i.width+BA,y:50,text:h.section,fill:o,num:l,colour:c};SA(t,e,i),r=h.section,a++}const e=h.people.reduce(((t,e)=>(OA[e]&&(t[e]=OA[e]),t)),{});h.x=n*i.taskMargin+n*i.width+BA,h.y=s,h.width=i.diagramMarginX,h.height=i.diagramMarginY,h.colour=c,h.fill=o,h.num=l,h.actors=e,DA(t,h,i),NA.insert(h.x,h.y,h.x+h.width+i.taskMargin,450)}},$A={setConf:function(t){Object.keys(t).forEach((function(e){MA[e]=t[e]}))},draw:function(t,e,n,i){const r=nx().journey;i.db.clear(),i.parser.parse(t+"\n");const s=nx().securityLevel;let a;"sandbox"===s&&(a=Fa("#i"+e));const o=Fa("sandbox"===s?a.nodes()[0].contentDocument.body:"body");NA.init();const c=o.select("#"+e);LA(c);const l=i.db.getTasks(),h=i.db.getDiagramTitle(),u=i.db.getActors();for(const t in OA)delete OA[t];let d=0;u.forEach((t=>{OA[t]={color:r.actorColours[d%r.actorColours.length],position:d},d++})),function(t){const e=nx().journey;let n=60;Object.keys(OA).forEach((i=>{const r=OA[i].color,s={cx:20,cy:n,r:7,fill:r,stroke:"#000",pos:OA[i].position};EA(t,s);const a={x:40,y:n+7,fill:"#666",text:i,textMargin:5|e.boxTextMargin};AA(t,a),n+=20}))}(c),NA.insert(0,0,BA,50*Object.keys(OA).length),RA(c,l,0);const f=NA.getBounds();h&&c.append("text").text(h).attr("x",BA).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const p=f.stopy-f.starty+2*r.diagramMarginY,g=BA+f.stopx+2*r.diagramMarginX;lx(c,p,g,r.useMaxWidth),c.append("line").attr("x1",BA).attr("y1",4*r.height).attr("x2",g-BA-4).attr("y2",4*r.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const y=h?70:0;c.attr("viewBox",`${f.startx} -25 ${g} ${p+y}`),c.attr("preserveAspectRatio","xMinYMin meet"),c.attr("height",p+y+25)}};let PA={};const YA={setConf:function(t){PA={...PA,...t}},draw:(t,e,n)=>{try{vm.debug("Renering svg for syntax error\n");const t=Fa("#"+e),i=t.append("g");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 graph"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+n),t.attr("height",100),t.attr("width",500),t.attr("viewBox","768 0 912 512")}catch(t){vm.error("Error while rendering info diagram"),vm.error((i=t)instanceof Error?i.message:String(i))}var i}};let jA=!1;const zA=()=>{jA||(jA=!0,Ox("error",{db:{clear:()=>{}},styles:fx,renderer:YA,parser:{parser:{yy:{}},parse:()=>{}},init:()=>{}},(t=>"error"===t.toLowerCase().trim())),Ox("c4",{parser:Sv,db:zv,renderer:xk,styles:kx,init:t=>{xk.setConf(t.c4)}},Av),Ox("class",{parser:kk,db:Yk,renderer:Jk,styles:ux,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Yk.clear()}},wk),Ox("classDiagram",{parser:kk,db:Yk,renderer:$w,styles:ux,init:t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Yk.clear()}},Tk),Ox("er",{parser:Yw,db:Hw,renderer:nT,styles:dx},jw),Ox("gantt",{parser:PT,db:bC,renderer:vC,styles:gx},YT),Ox("info",{parser:wC,db:EC,renderer:SC,styles:yx},AC),Ox("pie",{parser:LC,db:NC,renderer:$C,styles:mx},OC),Ox("requirement",{parser:YC,db:VC,renderer:rE,styles:bx},jC),Ox("sequence",{parser:aE,db:CE,renderer:nS,styles:_x,init:t=>{if(t.sequence||(t.sequence={}),t.sequence.arrowMarkerAbsolute=t.arrowMarkerAbsolute,"sequenceDiagram"in t)throw new Error("`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.");CE.setWrap(t.wrap),nS.setConf(t.sequence)}},oE),Ox("state",{parser:rS,db:IS,renderer:qS,styles:xx,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,IS.clear()}},sS),Ox("stateDiagram",{parser:rS,db:IS,renderer:hA,styles:xx,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,IS.clear()}},aS),Ox("journey",{parser:dA,db:_A,renderer:$A,styles:vx,init:t=>{$A.setConf(t.journey),_A.clear()}},fA),Ox("flowchart",{parser:rT,db:OT,renderer:RT,styles:px,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,BT(t.flowchart),OT.clear(),OT.setGen("gen-1")}},sT),Ox("flowchart-v2",{parser:rT,db:OT,renderer:RT,styles:px,init:t=>{t.flowchart||(t.flowchart={}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ex({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}}),RT.setConf(t.flowchart),OT.clear(),OT.setGen("gen-2")}},aT),Ox("gitGraph",{parser:Nx,db:lv,renderer:Tv,styles:Cv},Ix))};class UA{constructor(t,e){var n,i;_m(this,"type","graph"),_m(this,"parser"),_m(this,"renderer"),_m(this,"db"),_m(this,"detectTypeFailed",!1),this.txt=t;const r=nx();this.txt=t;try{this.type=k_(t,r)}catch(t){this.handleError(t,e),this.type="error",this.detectTypeFailed=!0}const s=Mx(this.type);vm.debug("Type "+this.type),this.db=s.db,null==(i=(n=this.db).clear)||i.call(n),this.renderer=s.renderer,this.parser=s.parser;const a=this.parser.parse.bind(this.parser);this.parser.parse=t=>a(function(t,e){var n;const i=t.match(b_);if(i){const r=m_(i[1],{schema:y_});return(null==r?void 0:r.title)&&(null==(n=e.setDiagramTitle)||n.call(e,r.title)),t.slice(i[0].length)}return t}(t,this.db)),this.parser.parser.yy=this.db,s.init&&(s.init(r),vm.debug("Initialized diagram "+this.type,r)),this.txt+="\n",this.parse(this.txt,e)}parse(t,e){var n,i;if(this.detectTypeFailed)return!1;try{return t+="\n",null==(i=(n=this.db).clear)||i.call(n),this.parser.parse(t),!0}catch(t){this.handleError(t,e)}return!1}handleError(t,e){if(void 0===e)throw t;H_(t)?e(t.str,t.hash):e(t)}getParser(){return this.parser}getType(){return this.type}}const WA=(t,e)=>{const n=k_(t,nx());try{Mx(n)}catch(i){const r=v_[n].loader;if(!r)throw new Error(`Diagram ${n} not found.`);return r().then((({diagram:i})=>(Ox(n,i,void 0),new UA(t,e))))}return new UA(t,e)},HA=UA;const qA=["graph","flowchart","flowchart-v2","stateDiagram","stateDiagram-v2"],VA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",GA="sandbox",XA="loose",ZA="http://www.w3.org/1999/xlink",QA="http://www.w3.org/1999/xhtml",KA=["foreignobject"],JA=["dominant-baseline"];const tD=function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)})),e=e.replace(/#\w+;/g,(function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"ﬂ°°"+e+"¶ß":"ﬂ°"+e+"¶ß"})),e},eD=function(t){let e=t;return e=e.replace(/ﬂ°°/g,"&#"),e=e.replace(/ﬂ°/g,"&"),e=e.replace(/¶ß/g,";"),e},nD=(t,e,n=[])=>`\n.${t} ${e} { ${n.join(" !important; ")} !important; }`,iD=(t,e,n,i)=>{const r=((t,e,n={})=>{var i;let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),!hf(n)&&qA.includes(e)){const e=["> *","span"],s=["rect","polygon","ellipse","circle","path"],a=t.htmlLabels||(null==(i=t.flowchart)?void 0:i.htmlLabels)?e:s;for(const t in n){const e=n[t];hf(e.styles)||a.forEach((t=>{r+=nD(e.id,t,e.styles)})),hf(e.textStyles)||(r+=nD(e.id,"tspan",e.textStyles))}}return r})(t,e,n);return Rl(ah(`${i}{${Tx(e,r,t.themeVariables)}}`),$l)},rD=(t="",e,n)=>{let i=t;return n||e||(i=i.replace(/marker-end="url\(.*?#/g,'marker-end="url(#')),i=eD(i),i=i.replace(/<br>/g,"<br/>"),i},sD=(t="",e)=>`<iframe style="width:100%;height:${e?e.viewBox.baseVal.height+"px":"100%"};border:0;margin:0;" src="data:text/html;base64,${btoa('<body style="margin:0">'+t+"</body>")}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n  The "iframe" tag is not supported by your browser.\n</iframe>`,aD=(t,e,n,i,r)=>{const s=t.append("div");s.attr("id",n),i&&s.attr("style",i);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return r&&a.attr("xmlns:xlink",r),a.append("g"),t};function oD(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}const cD=(t,e,n,i)=>{var r,s,a;null==(r=t.getElementById(e))||r.remove(),null==(s=t.getElementById(n))||s.remove(),null==(a=t.getElementById(i))||a.remove()};let lD={};const hD=function(t,e,n){switch(vm.debug(`Directive type=${e.type} with args:`,e.args),e.type){case"init":case"initialize":["config"].forEach((t=>{void 0!==e.args[t]&&("flowchart-v2"===n&&(n="flowchart"),e.args[n]=e.args[t],delete e.args[t])})),vm.debug("sanitize in handleDirective",e.args),U_(e.args),vm.debug("sanitize in handleDirective (done)",e.args),rx(e.args);break;case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap("wrap"===e.type);break;case"themeCss":vm.warn("themeCss encountered");break;default:vm.warn(`Unhandled directive: source: '%%{${e.type}: ${JSON.stringify(e.args?e.args:{})}}%%`,e)}};function uD(t,e,n,i){!function(t,e){hf(e)||t.attr("aria-roledescription",e)}(e,t),function(t,e,n,i){if(void 0!==t.insert&&(e||n)){if(n){const e="chart-desc-"+i;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(n)}if(e){const n="chart-title-"+i;t.attr("aria-labelledby",n),t.insert("title",":first-child").attr("id",n).text(e)}}}(e,n,i,e.attr("id"))}const dD=Object.freeze({render:function(t,e,n,i){var r,s,a,o,c;zA(),sx();const l=q_.detectInit(e);l&&(U_(l),rx(l));const h=nx();vm.debug(h),e.length>(null!=(r=null==h?void 0:h.maxTextSize)?r:5e4)&&(e=VA),e=e.replace(/\r\n?/g,"\n");const u="#"+t,d="i"+t,f="#"+d,p="d"+t,g="#"+p;let y=Fa("body");const m=h.securityLevel===GA,b=h.securityLevel===XA,_=h.fontFamily;if(void 0!==i){if(i&&(i.innerHTML=""),m){const t=oD(Fa(i),d);y=Fa(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=Fa(i);aD(y,t,p,`font-family: ${_}`,ZA)}else{if(cD(document,t,p,d),m){const t=oD(Fa("body"),d);y=Fa(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=Fa("body");aD(y,t,p)}let x,v;e=tD(e);try{if(x=WA(e),"then"in x)throw new Error("Diagram is a promise. Use renderAsync.")}catch(t){x=new HA("error"),v=t}const k=y.select(g).node(),w=x.type,T=k.firstChild,C=T.firstChild,E=qA.includes(w)?x.renderer.getClasses(e,x):{},S=iD(h,w,E,u),A=document.createElement("style");A.innerHTML=S,T.insertBefore(A,C);try{x.renderer.draw(e,t,V_,x)}catch(n){throw YA.draw(e,t,V_),n}uD(w,y.select(`${g} svg`),null==(a=(s=x.db).getAccTitle)?void 0:a.call(s),null==(c=(o=x.db).getAccDescription)?void 0:c.call(o)),y.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",QA);let D=y.select(g).node().innerHTML;if(vm.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),D=rD(D,m,Lm(h.arrowMarkerAbsolute)),m){const t=y.select(g+" svg").node();D=sD(D,t)}else b||(D=Yo.sanitize(D,{ADD_TAGS:KA,ADD_ATTR:JA}));if(void 0!==n)switch(w){case"flowchart":case"flowchart-v2":n(D,OT.bindFunctions);break;case"gantt":n(D,bC.bindFunctions);break;case"class":case"classDiagram":n(D,Yk.bindFunctions);break;default:n(D)}else vm.debug("CB = undefined!");SE();const L=Fa(m?f:g).node();if(L&&"remove"in L&&L.remove(),v)throw v;return D},renderAsync:async function(t,e,n,i){var r,s,a,o,c;zA(),sx();const l=q_.detectInit(e);l&&(U_(l),rx(l));const h=nx();vm.debug(h),e.length>(null!=(r=null==h?void 0:h.maxTextSize)?r:5e4)&&(e=VA),e=e.replace(/\r\n?/g,"\n");const u="#"+t,d="i"+t,f="#"+d,p="d"+t,g="#"+p;let y=Fa("body");const m=h.securityLevel===GA,b=h.securityLevel===XA,_=h.fontFamily;if(void 0!==i){if(i&&(i.innerHTML=""),m){const t=oD(Fa(i),d);y=Fa(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=Fa(i);aD(y,t,p,`font-family: ${_}`,ZA)}else{if(cD(document,t,p,d),m){const t=oD(Fa("body"),d);y=Fa(t.nodes()[0].contentDocument.body),y.node().style.margin=0}else y=Fa("body");aD(y,t,p)}let x,v;e=tD(e);try{x=await WA(e)}catch(t){x=new HA("error"),v=t}const k=y.select(g).node(),w=x.type,T=k.firstChild,C=T.firstChild,E=qA.includes(w)?x.renderer.getClasses(e,x):{},S=iD(h,w,E,u),A=document.createElement("style");A.innerHTML=S,T.insertBefore(A,C);try{await x.renderer.draw(e,t,V_,x)}catch(n){throw YA.draw(e,t,V_),n}uD(w,y.select(`${g} svg`),null==(a=(s=x.db).getAccTitle)?void 0:a.call(s),null==(c=(o=x.db).getAccDescription)?void 0:c.call(o)),y.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",QA);let D=y.select(g).node().innerHTML;if(vm.debug("config.arrowMarkerAbsolute",h.arrowMarkerAbsolute),D=rD(D,m,Lm(h.arrowMarkerAbsolute)),m){const t=y.select(g+" svg").node();D=sD(D,t)}else b||(D=Yo.sanitize(D,{ADD_TAGS:KA,ADD_ATTR:JA}));if(void 0!==n)switch(w){case"flowchart":case"flowchart-v2":n(D,OT.bindFunctions);break;case"gantt":n(D,bC.bindFunctions);break;case"class":case"classDiagram":n(D,Yk.bindFunctions);break;default:n(D)}else vm.debug("CB = undefined!");SE();const L=Fa(m?f:g).node();if(L&&"remove"in L&&L.remove(),v)throw v;return D},parse:function(t,e){return zA(),new HA(t,e).parse(t,e)},parseAsync:async function(t,e){return zA(),(await WA(t,e)).parse(t,e)},parseDirective:function(t,e,n,i){try{if(void 0!==e)switch(e=e.trim(),n){case"open_directive":lD={};break;case"type_directive":if(!lD)throw new Error("currentDirective is undefined");lD.type=e.toLowerCase();break;case"arg_directive":if(!lD)throw new Error("currentDirective is undefined");lD.args=JSON.parse(e);break;case"close_directive":hD(t,lD,i),lD=void 0}}catch(t){vm.error(`Error while rendering sequenceDiagram directive: ${e} jison context: ${n}`),vm.error(t.message)}},initialize:function(t={}){var e;(null==t?void 0:t.fontFamily)&&!(null==(e=t.themeVariables)?void 0:e.fontFamily)&&(t.themeVariables={fontFamily:t.fontFamily}),X_=C_({},t),(null==t?void 0:t.theme)&&t.theme in jm?t.themeVariables=jm[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=jm.default.getThemeVariables(t.themeVariables));const n="object"==typeof t?(t=>(Z_=C_({},G_),Z_=C_(Z_,t),t.theme&&jm[t.theme]&&(Z_.themeVariables=jm[t.theme].getThemeVariables(t.themeVariables)),J_(Z_,Q_),Z_))(t):tx();km(n.logLevel),zA()},getConfig:nx,setConfig:ex,getSiteConfig:tx,updateSiteConfig:t=>(Z_=C_(Z_,t),J_(Z_,Q_),Z_),reset:()=>{sx()},globalReset:()=>{sx(G_)},defaultConfig:G_});km(nx().logLevel),sx(nx());let fD=!1;const pD=(t,e,n)=>{vm.warn(t),H_(t)?(n&&n(t.str,t.hash),e.push({...t,message:t.str,error:t})):(n&&n(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},gD=function(t,e,n){const i=dD.getConfig();let r;if(t&&(vD.sequenceConfig=t),vm.debug((n?"":"No ")+"Callback function found"),void 0===e)r=document.querySelectorAll(".mermaid");else if("string"==typeof e)r=document.querySelectorAll(e);else if(e instanceof HTMLElement)r=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");r=e}vm.debug(`Found ${r.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(vm.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),dD.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const s=new q_.initIdGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const o=[];for(const t of Array.from(r)){if(vm.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const e=`mermaid-${s.next()}`;a=t.innerHTML,a=q_.entityDecode(a).trim().replace(/<br\s*\/?>/gi,"<br/>");const i=q_.detectInit(a);i&&vm.debug("Detected early reinit: ",i);try{dD.render(e,a,((i,r)=>{t.innerHTML=i,void 0!==n&&n(e),r&&r(t)}),t)}catch(t){pD(t,o,vD.parseError)}}if(o.length>0)throw o[0]},yD=async function(t,e,n){const i=dD.getConfig();let r;if(t&&(vD.sequenceConfig=t),vm.debug((n?"":"No ")+"Callback function found"),void 0===e)r=document.querySelectorAll(".mermaid");else if("string"==typeof e)r=document.querySelectorAll(e);else if(e instanceof HTMLElement)r=[e];else{if(!(e instanceof NodeList))throw new Error("Invalid argument nodes for mermaid.init");r=e}vm.debug(`Found ${r.length} diagrams`),void 0!==(null==t?void 0:t.startOnLoad)&&(vm.debug("Start On Load: "+(null==t?void 0:t.startOnLoad)),dD.updateSiteConfig({startOnLoad:null==t?void 0:t.startOnLoad}));const s=new q_.initIdGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const o=[];for(const t of Array.from(r)){if(vm.info("Rendering diagram: "+t.id),t.getAttribute("data-processed"))continue;t.setAttribute("data-processed","true");const e=`mermaid-${s.next()}`;a=t.innerHTML,a=q_.entityDecode(a).trim().replace(/<br\s*\/?>/gi,"<br/>");const i=q_.detectInit(a);i&&vm.debug("Detected early reinit: ",i);try{await dD.renderAsync(e,a,((i,r)=>{t.innerHTML=i,void 0!==n&&n(e),r&&r(t)}),t)}catch(t){pD(t,o,vD.parseError)}}if(o.length>0)throw o[0]},mD=function(){if(vD.startOnLoad){const{startOnLoad:t}=dD.getConfig();t&&vD.init()}};"undefined"!=typeof document&&window.addEventListener("load",mD,!1);const bD=[];let _D=!1;const xD=async()=>{if(!_D){for(_D=!0;bD.length>0;){const t=bD.shift();if(t)try{await t()}catch(t){vm.error("Error executing queue",t)}}_D=!1}},vD={startOnLoad:!0,diagrams:{},mermaidAPI:dD,parse:t=>dD.parse(t,vD.parseError),parseAsync:t=>new Promise(((e,n)=>{bD.push((()=>new Promise(((i,r)=>{dD.parseAsync(t,vD.parseError).then((t=>{i(t),e(t)}),(t=>{vm.error("Error parsing",t),r(t),n(t)}))})))),xD()})),render:dD.render,renderAsync:(t,e,n,i)=>new Promise(((r,s)=>{bD.push((()=>new Promise(((a,o)=>{dD.renderAsync(t,e,n,i).then((t=>{a(t),r(t)}),(t=>{vm.error("Error parsing",t),o(t),s(t)}))})))),xD()})),init:async function(t,e,n){try{fD?await yD(t,e,n):gD(t,e,n)}catch(t){vm.warn("Syntax Error rendering"),H_(t)&&vm.warn(t.str),vD.parseError&&vD.parseError(t)}},initThrowsErrors:gD,initThrowsErrorsAsync:yD,registerExternalDiagrams:async(t,{lazyLoad:e=!0}={})=>{e?(t=>{for(const{id:e,detector:n,loader:i}of t)w_(e,n,i)})(t):await(async t=>{vm.debug(`Loading ${t.length} external diagrams`);const e=await Promise.allSettled(t.map((async({id:t,detector:e,loader:n})=>{const{diagram:i}=await n();Ox(t,i,e)}))),n=e.filter((t=>"rejected"===t.status));if(n.length>0){vm.error(`Failed to load ${n.length} external diagrams`);for(const t of n)vm.error(t);throw new Error(`Failed to load ${n.length} external diagrams`)}})(t),fD=!0},initialize:function(t){dD.initialize(t)},parseError:void 0,contentLoaded:mD,setParseErrorHandler:function(t){vD.parseError=t}};function kD(t){for(const e of document.getElementsByTagName("svg")){const n=e.parentElement;n?.classList.contains("mermaid")&&t(n)}}function wD(){const t=document.getElementById("markdown-mermaid"),e=t?.dataset.darkModeTheme,n=t?.dataset.lightModeTheme,i={startOnLoad:!1,theme:document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast")?e??"dark":n??"default"};vD.initialize(i),function(t){kD((t=>{t.remove()}));for(const n of t.getElementsByClassName("mermaid")??[])e(n);function e(t){const e=`mermaid-${crypto.randomUUID()}`,n=t.textContent??"",i=document.createElement("div");i.id=e,t.innerHTML="",t.appendChild(i);try{vD.mermaidAPI.reset(),vD.render(e,n,(e=>{t.innerHTML=e}))}catch(t){if(t instanceof Error){const e=document.createElement("pre");e.innerText=t.message,kD((t=>{t.appendChild(e)}))}throw t}}}(document.body)}window.addEventListener("vscode.markdown.updateContent",wD),wD()})()})();
</script>

    </body>
    </html>