diff --git a/nereid/nereid/data/default_data/state/region/config.yml b/nereid/nereid/data/default_data/state/region/config.yml index b1446fb8..62bed8fd 100644 --- a/nereid/nereid/data/default_data/state/region/config.yml +++ b/nereid/nereid/data/default_data/state/region/config.yml @@ -338,3 +338,12 @@ project_reference_data: short_name: dwFC concentration_unit: MPN/_100mL load_unit: mpn +project_spatial_data: + design_storm: + name: 85_percentile_design_storm_depth + url: "https://ocgis.com/arcpub/rest/services/Environmental_Resources/Hydrologic_Response_Unit/FeatureServer/3/query?where=1%3D1&outFields=*&returnGeometry=true&f=geojson" + field: RainfallZo + ref_data_key: + name: ref_data_key_rainzone + url: "https://ocgis.com/arcpub/rest/services/Environmental_Resources/Hydrologic_Response_Unit/FeatureServer/7/query?where=1%3D1&outFields=*&returnGeometry=true&f=geojson" + field: MODEL_BASIN diff --git a/nereid/nereid/factory.py b/nereid/nereid/factory.py index c7ecaff5..7761022a 100644 --- a/nereid/nereid/factory.py +++ b/nereid/nereid/factory.py @@ -91,6 +91,12 @@ async def redoc_html() -> HTMLResponse: async def check_config(context=Depends(get_valid_context)): return context + app.mount( + "/app", + StaticFiles(directory=str(static_path / "frontend/dist"), html=True), + name="app", + ) + @app.get("/ping") @app.get("/") async def ping(): # pragma: no cover diff --git a/nereid/nereid/static/frontend/.gitignore b/nereid/nereid/static/frontend/.gitignore new file mode 100644 index 00000000..a772854d --- /dev/null +++ b/nereid/nereid/static/frontend/.gitignore @@ -0,0 +1,3 @@ +node_modules +!lib +!dist diff --git a/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css b/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css new file mode 100644 index 00000000..6542152c --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-lg{font-size:1.125rem;line-height:1.7777778}.prose-lg :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2222222em;line-height:1.4545455;margin-top:1.0909091em;margin-bottom:1.0909091em}.prose-lg :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6666667em;margin-bottom:1.6666667em;padding-left:1em}.prose-lg :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.6666667em;margin-top:0;margin-bottom:.8333333em;line-height:1}.prose-lg :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.6666667em;margin-top:1.8666667em;margin-bottom:1.0666667em;line-height:1.3333333}.prose-lg :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.3333333em;margin-top:1.6666667em;margin-bottom:.6666667em;line-height:1.5}.prose-lg :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:.4444444em;line-height:1.5555556}.prose-lg :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;border-radius:.3125rem;padding:.2222222em .4444444em}.prose-lg :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-lg :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8666667em}.prose-lg :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em}.prose-lg :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.75;margin-top:2em;margin-bottom:2em;border-radius:.375rem;padding:1em 1.5em}.prose-lg :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;margin-bottom:.6666667em}.prose-lg :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(.prose-lg>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(.prose-lg>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;padding-left:1.5555556em}.prose-lg :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:3.1111111em;margin-bottom:3.1111111em}.prose-lg :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5}.prose-lg :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:.75em;padding-bottom:.75em;padding-left:.75em}.prose-lg :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.75em}.prose-lg :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5;margin-top:1em}.prose-lg :where(.prose-lg>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(.prose-lg>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.btn{border-radius:.25rem;padding:.25rem .5rem;font-weight:700}.btn-blue{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-blue:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.btn-gray{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-gray:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.tab{flex:1 1 0%;cursor:pointer;padding-bottom:.75rem;text-align:center;font-weight:500}.tab:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab.active{flex:1 1 0%;cursor:pointer;padding-bottom:.75rem;text-align:center;font-weight:500;--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab.active:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab-slider{position:absolute;bottom:0;left:0;display:block;height:.25rem;width:100%;--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity));transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}.button-radio-label{display:flex;height:100%;cursor:pointer;flex-direction:column;border-radius:.5rem;border-width:2px;--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity));padding:.5rem;text-align:center;font-size:.75rem;line-height:1rem;font-weight:700;opacity:.5}.markdown ol{list-style-position:outside;list-style-type:decimal}@media (min-width: 768px){.markdown ol{list-style-position:inside}}.markdown ul{list-style-position:outside;list-style-type:disc}@media (min-width: 768px){.markdown ul{list-style-position:inside}}.markdown h1{padding-top:2rem;font-size:1.5rem;line-height:2rem;font-weight:700}.markdown h2{padding-top:1rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.markdown h3{padding-top:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;font-style:italic}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.left-0{left:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.top-1{top:.25rem}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-ml-8{margin-left:-2rem}.mb-2{margin-bottom:.5rem}.ml-3{margin-left:.75rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0px}.h-10{height:2.5rem}.h-12{height:3rem}.h-20{height:5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\[500px\]{height:500px}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:24rem}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-20{width:5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[200px\]{width:200px}.w-\[800px\]{width:800px}.w-full{width:100%}.w-screen{width:100vw}.min-w-\[700px\]{min-width:700px}.max-w-\[1000px\]{max-width:1000px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-screen-md{max-width:768px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-double{--tw-translate-x: 200%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-octa{--tw-translate-x: 800%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-pent{--tw-translate-x: 500%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-quad{--tw-translate-x: 400%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-sept{--tw-translate-x: 700%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-sext{--tw-translate-x: 600%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-triple{--tw-translate-x: 300%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-4{--tw-translate-y: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.content-center{align-content:center}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-y-2{row-gap:.5rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-dashed{border-style:dashed}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-\[\#32cd32\]{--tw-bg-opacity: 1;background-color:rgb(50 205 50 / var(--tw-bg-opacity))}.bg-\[\#4682b4\]{--tw-bg-opacity: 1;background-color:rgb(70 130 180 / var(--tw-bg-opacity))}.bg-\[\#ffa500\]{--tw-bg-opacity: 1;background-color:rgb(255 165 0 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity))}.bg-green-300{--tw-bg-opacity: 1;background-color:rgb(134 239 172 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-300{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.bg-yellow-300{--tw-bg-opacity: 1;background-color:rgb(253 224 71 / var(--tw-bg-opacity))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-75{--tw-bg-opacity: .75}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-24{padding-left:6rem;padding-right:6rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-10{padding-bottom:2.5rem}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-20{padding-top:5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-justify{text-align:justify}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.graph-editor path.link{fill:none;stroke:#222;stroke-width:5px;cursor:pointer}.graph-editor text{pointer-events:none}.graph-editor text.id{text-anchor:middle}.graph-editor path.link.selected{stroke-dasharray:10,2}.graph-editor path.link.dragline{pointer-events:none}.graph-editor circle.node{stroke-width:1.5px;cursor:pointer}.no-select{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}#type-form input:checked+label{border-color:#000;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;color:#fff;opacity:1}input:checked~.dot{transform:translate(100%);background-color:#48bb78}.form-group.required .control-label:before{content:"*";color:red;font-weight:700}@media (min-width: 768px){.md\:prose-2xl{font-size:1.5rem;line-height:1.6666667}.md\:prose-2xl :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.md\:prose-2xl :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.25em;line-height:1.4666667;margin-top:1.0666667em;margin-bottom:1.0666667em}.md\:prose-2xl :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em;padding-left:1.1111111em}.md\:prose-2xl :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.6666667em;margin-top:0;margin-bottom:.875em;line-height:1}.md\:prose-2xl :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2em;margin-top:1.5em;margin-bottom:.8333333em;line-height:1.0833333}.md\:prose-2xl :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.5em;margin-top:1.5555556em;margin-bottom:.6666667em;line-height:1.2222222}.md\:prose-2xl :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6666667em;margin-bottom:.6666667em;line-height:1.5}.md\:prose-2xl :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.md\:prose-2xl :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;border-radius:.375rem;padding:.25em .3333333em}.md\:prose-2xl :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em}.md\:prose-2xl :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em}.md\:prose-2xl :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.md\:prose-2xl :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.8;margin-top:2em;margin-bottom:2em;border-radius:.5rem;padding:1.2em 1.6em}.md\:prose-2xl :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5833333em}.md\:prose-2xl :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5833333em}.md\:prose-2xl :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.md\:prose-2xl :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4166667em}.md\:prose-2xl :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4166667em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8333333em;margin-bottom:.8333333em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.md\:prose-2xl :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;margin-bottom:.6666667em}.md\:prose-2xl :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.md\:prose-2xl :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.5833333em}.md\:prose-2xl :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:3em;margin-bottom:3em}.md\:prose-2xl :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.4}.md\:prose-2xl :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:.6em;padding-bottom:.8em;padding-left:.6em}.md\:prose-2xl :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.md\:prose-2xl :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.md\:prose-2xl :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.8em .6em}.md\:prose-2xl :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.md\:prose-2xl :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.md\:prose-2xl :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.md\:prose-2xl :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.6;margin-top:1em}.md\:prose-2xl :where(.md\:prose-2xl>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(.md\:prose-2xl>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.hover\:bg-yellow-700:hover{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-black:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-green-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity))}.focus\:ring-yellow-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 179 8 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}@media (min-width: 640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:my-8{margin-top:2rem;margin-bottom:2rem}.sm\:-ml-10{margin-left:-2.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:mt-0{margin-top:0}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:items-start{align-items:flex-start}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-4{padding-bottom:1rem}.sm\:pr-4{padding-right:1rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:duration-700{transition-duration:.7s}}@media (min-width: 768px){.md\:flex{display:flex}.md\:max-w-lg{max-width:32rem}}@media (min-width: 1024px){.lg\:max-w-lg{max-width:32rem}} diff --git a/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js b/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js new file mode 100644 index 00000000..70376eec --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js @@ -0,0 +1,707 @@ +var me=Object.defineProperty;var fe=(i,e,t)=>e in i?me(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var R=(i,e,t)=>(fe(i,typeof e!="symbol"?e+"":e,t),t);import{j as ye,D as he,s as ge,a as be,b as ve,e as we,f as ke,g as Se,c as xe,d as Te,h as $e,i as je,k as Re,q as Fe,l as De,t as Ee,m as Ne,n as Ae,o as qe,p as Oe,r as Le,z as Ce,u as Y,v as Ie,F as W}from"./vendor-QiQdsv75.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const n of s.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();class Me{constructor(){this.events={}}subscribe(e,t){let a=this;return a.events.hasOwnProperty(e)||(a.events[e]=[]),a.events[e].push(t),!0}publish(e,t={}){let a=this;return m.state.DEBUG&&console.log("published event: ",e),a.events.hasOwnProperty(e)?(a.events[e].map(r=>r(t)),!0):(m.state.DEBUG&&console.log(`no subscribers for event ${e}`),a.events[e]=[],!1)}}class z{constructor(e){let t=this;t.actions={},t.mutations={},t.state={},t.status="resting",t.events=new Me,t.state=new Proxy(e.state||{},{set:function(a,r,s){return a[r]=s,m.state.DEBUG&&console.log(`stateChange: ${r}`,s),t.status!=="mutation"&&(m.state.DEBUG&&console.warn(`You should use a mutation to set ${r}`),t.events.publish("stateChange",t.state)),!0}})}dispatch(e,t){let a=this;return typeof a.actions[e]!="function"&&(m.state.DEBUG&&console.log(`Action "${e} doesn't exist.`),a.actions[e]=(r,s)=>{r.commit(e,s)}),m.state.DEBUG&&console.groupCollapsed(`ACTION: ${e}`),a.status="action",a.actions[e](a,t),m.state.DEBUG&&console.groupEnd(),!0}commit(e,t){let a=this;typeof a.mutations[e]!="function"&&(m.state.DEBUG&&console.log(`Mutation "${e}" doesn't exist`),a.mutations[e]=(s,n)=>n),a.status="mutation";let r=a.mutations[e](a.state,t);return a.state=Object.assign(a.state,r),a.events.publish("stateChange",a.state),a.events.publish(e,a.state),a.status="resting",!0}}const Pe={DEBUG:!1,config:{},scenario_name:"New Scenario",nereid_host:"",nereid_api_latest:"/api/v1",nereid_state:"state",nereid_region:"region",facility_types:[],facility_type_map:{},initialScale:1<<20,initialCenter:[-116.9337,32.74337],staged_changes:{},default_nodesize:20,max_graph_size:100,map_mode:!0,show_states:!0,graph_edit_mode:!0,show_info_tooltip:!0,treatment_facility_fields:{state:{region:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type"]}},ca:{cosd:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type","ref_data_key","design_storm_depth_inches"]},soc:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type"]}}},node_types:{land_surface:{title:"Land Surface",color:"limegreen"},treatment_facility:{title:"Treatment Facility",color:"steelblue"},treatment_site:{title:"Treatment Site",color:"orangered",disabled:!0},none:{title:"None",color:"dimgrey"}},default_graph:{nodes:[{id:"0",node_type:"treatment_facility"},{id:"1",node_type:"land_surface"}],edges:[{source:"1",target:"0"}]}},m=new z({state:Pe}),Ve=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="land_surface"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),X=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="treatment_facility"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),We=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="treatment_site"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),Z=()=>({edges:(p(m,"state.graph.edges")||[]).map(e=>({source:e.source.id.toString(),target:e.target.id.toString()})),directed:!0,multigraph:!0}),ze=()=>({graph:Z(),land_surfaces:Ve()||[],treatment_facilities:X()||[],treatment_sites:We()||[]}),D={getOpenApi:async i=>{let e;try{return e=await A(`${i}/openapi.json`),e}catch(t){return console.error(t),Be}},getConfig:async(i,e,t)=>{var r,s;let a;try{return a=await A(`${i}/config?state=${e}®ion=${t}`),(s=(r=a==null?void 0:a.detail)==null?void 0:r.toLowerCase())!=null&&s.includes("no config")?(console.warn(`no config for ${e} ${t}`),G):a}catch(n){return console.error(n),G}},getReferenceData:async(i,e,t,a,r)=>{let s;try{return s=await A(`${i}${e}/reference_data_file?state=${t}®ion=${a}&filename=${r}`),s}catch(n){console.error(n)}},postValidateNetwork:async(i,e,t,a,r)=>{var c;let s=`${i}${e}/network/validate?state=${t}®ion=${a}`,n;try{return n=await C(s,r),(c=n==null?void 0:n.data)!=null&&c.isvalid?{title:"Validation Succeeded",msg:"Success",alert_type:"success"}:{title:"Validation Errors",msg:`
${JSON.stringify(n==null?void 0:n.data,void 0,2)}`,alert_type:"error"}}catch(_){return{title:"Validation Error",msg:`
${JSON.stringify(_,void 0,2)}`,alert_type:"error"}}},postValidateTreatmentFacilities:async(i,e,t,a,r)=>{var c,_;let s=`${i}${e}/treatment_facility/validate?state=${t}®ion=${a}`,n;try{n=await C(s,r);let u=[];for(let o of(c=n==null?void 0:n.data)==null?void 0:c.treatment_facilities)o!=null&&o.errors&&u.push(o==null?void 0:o.errors.replace(/\n/g," "));for(let o of(_=n==null?void 0:n.data)==null?void 0:_.errors)o.toLowerCase().substring(0,6).includes("error")&&u.push(o);return u.length==0?{title:"Validation Succeeded",msg:"",alert_type:"success"}:{title:"Validation Errors",msg:`
${JSON.stringify(u,void 0,2)}`,alert_type:"error"}}catch(u){return{title:"Validation Error",msg:`
${JSON.stringify(u,void 0,2)}`,alert_type:"error"}}},postSolveWatershed:async(i,e,t,a,r)=>{var c,_,u;let s=`${i}${e}/watershed/solve?state=${t}®ion=${a}`,n;try{if(n=await C(s,r),((_=(c=n==null?void 0:n.data)==null?void 0:c.errors)==null?void 0:_.length)==0)return n}catch(o){console.error(o)}return console.error(n,(u=n==null?void 0:n.data)==null?void 0:u.errors),n}},ee=async i=>{let{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.getReferenceData(e,t,a,r,i)}catch(n){console.error(n)}return s},te=async()=>{let i=Z(),{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postValidateNetwork(e,t,a,r,i)}catch(n){console.error(n)}return s},ae=async()=>{let i={treatment_facilities:X()},{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postValidateTreatmentFacilities(e,t,a,r,i)}catch(n){console.error(n)}return s},re=async()=>{let i=ze(),{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postSolveWatershed(e,t,a,r,i)}catch(n){console.error(n)}return s};function se(i,e){for(let t in i)if(typeof i[t]=="object"&&i[t]!==null)se(i[t],e);else if(t=="$ref"){let a=i[t].split("/").slice(-1).pop();a&&(delete i.$ref,i=Object.assign(i,e[a]))}}const ie=async({nereid_host:i,nereid_state:e,nereid_region:t})=>{i||(i=window.location.origin);const a=await D.getOpenApi(i),r=await D.getConfig(i,e,t),s=v(a.components.schemas);for(let l in s)se(s[l],s);const n=r.api_recognize.treatment_facility.facility_type,c={};for(const[l,d]of Object.entries(n))c[l]=d.validator;const _={};for(const[l,d]of Object.entries(n))if(d!=null&&d.alias)for(let f of d==null?void 0:d.alias)_[f]=l;else _[l]=l;const u={};for(const[l,d]of Object.entries(n))u[(d==null?void 0:d.label)||l]=l;const o=Object.keys(u);return{nereid_host:i,nereid_state:e,nereid_region:t,config:r,openapi:a,schema:s,facility_types:o,facility_type_map:c,facility_alias_map:_,facility_label_map:u}},G={default_data_directory:"default_data",project_data_directory:"project_data",version:"0.4.3",author:"Austin Orr",contact:"aorr@geosyntec.com",state:"state",region:"region",test:!0,pint_unit_registry:["MPN = count = mpn","_100ml = 100 * milliliter = _100mL"],api_recognize:{land_surfaces:{preprocess:[{expand_fields:[{field:"surface_key",sep:"-",new_column_names:["subbasin","land_use","soil","slope"]}]},{collapse_fields:[{new_column_name:"fuzzy_key",sep:"-",fields:["land_use"]}]},{joins:[{other:"land_surface_table",how:"left",left_on:"surface_key",right_on:"surface_id",validate:"many_to_one",indicator:!0,fuzzy_on:["fuzzy_key"]},{other:"land_surface_emc_table",how:"left",left_on:"land_use",right_on:"land_use",validate:"many_to_one",indicator:!0},{other:"dry_weather_land_surface_emc_table",how:"left",left_on:"land_use",right_on:"land_use",validate:"many_to_one",indicator:!0},{other:"met_table",how:"left",left_on:"subbasin",right_on:"subbasin",validate:"many_to_one",indicator:!0},{other:"dry_weather_flow_table",how:"left",left_on:"rain_gauge",right_on:"rain_gauge",validate:"many_to_one",indicator:!0}]},{remaps:[{left:"soil",right:"imp_pct",how:"addend",mapping:{water:100}},{left:"land_use",right:"is_developed",how:"left",fillna:!1,mapping:{COMM:!0,EDU:!0,IND:!0,UTIL:!0,RESSFH:!0,RESSFL:!0,RESMF:!0,TRFWY:!0,TRANS:!0,TROTH:!0}}]}]},treatment_facility:{preprocess:[{joins:[{other:"met_table",how:"left",left_on:"ref_data_key",right_on:"subbasin",validate:"many_to_one",indicator:!0}]},{remaps:[{left:"hsg",right:"inf_rate_inhr",how:"left",fillna:1e-6,mapping:{a:2.5,b:.8,c:.24,d:.024,lined:1e-6}}]}],facility_type:{no_treatment:{validator:"NTFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_extended_detention:{validator:"RetAndTmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Detention Basin"},infiltration:{validator:"RetentionFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},bioretention:{validator:"BioInfFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Biofiltration"},biofiltration:{validator:"TmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Biofiltration"},wet_detention:{validator:"PermPoolFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Wet Pond"},sand_filter:{validator:"TmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Sand Filter"},swale:{validator:"FlowAndRetFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Vegetated Swale"},hydrodynamic_separator:{validator:"FlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Hydrodynamic Separator"},dry_well:{validator:"DryWellFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},cistern:{validator:"CisternFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_weather_diversion:{validator:"DryWeatherDiversionLowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_weather_treatment:{validator:"DryWeatherTreatmentLowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Sand Filter"},low_flow_facility:{validator:"LowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"}}}},project_reference_data:{dry_weather_flow_table:{file:"dry_weather_flow.json",seasons:{winter:["oct","nov","dec","jan","feb","mar"],summer:["apr","may","jun","jul","aug","sep"]}},met_table:{file:"met_data.json",volume_nomo:{x_col:"size_fraction",t_col:"ddt_hr",y_col:"capture_fraction"},flow_nomo:{x_col:"intensity_inhr",t_col:"tc_minutes",y_col:"performance_frac"},preprocess:[{remaps:[{left:"rain_gauge",right:"volume_nomograph",how:"left",mapping:{"100_LAGUNABEACH":"nomographs/100_LAGUNABEACH_volume_nomo.csv","1130_LAGUNA_AUDUBON":"nomographs/1130_LAGUNA_AUDUBON_volume_nomo.csv"}},{left:"rain_gauge",right:"flow_nomograph",how:"left",mapping:{"100_LAGUNABEACH":"nomographs/100_LAGUNABEACH_flow_nomo.csv","1130_LAGUNA_AUDUBON":"nomographs/1130_LAGUNA_AUDUBON_flow_nomo.csv"}}]}]},dry_weather_tmnt_performance_table:{file:"dry_weather_bmp_params.json",facility_column:"facility_type",pollutant_column:"pollutant",preprocess:[{remaps:[{left:"unit",right:"--",how:"replace",mapping:{"MPN/100mL":"MPN/_100ml","MPN/100 mL":"MPN/_100ml"}}]}]},tmnt_performance_table:{file:"bmp_params.json",facility_column:"facility_type",pollutant_column:"pollutant",preprocess:[{remaps:[{left:"unit",right:"--",how:"replace",mapping:{"MPN/100mL":"MPN/_100ml","MPN/100 mL":"MPN/_100ml"}}]}]},land_surface_table:{file:"land_surface_data.json"},land_surface_emc_table:{file:"land_surface_emc.json",parameters:[{long_name:"Total Suspended Solids",short_name:"TSS",concentration_unit:"mg/L",load_unit:"lbs"},{long_name:"Total Copper",short_name:"TCu",concentration_unit:"ug/L",load_unit:"lbs"},{long_name:"Fecal Coliform",short_name:"FC",concentration_unit:"MPN/_100mL",load_unit:"mpn"}]},dry_weather_land_surface_emc_table:{file:"dry_weather_land_surface_emc.json",parameters:[{long_name:"Dry Weather Total Suspended Solids",short_name:"dwTSS",concentration_unit:"mg/L",load_unit:"lbs"},{long_name:"Dry Weather Total Copper",short_name:"dwTCu",concentration_unit:"ug/L",load_unit:"lbs"},{long_name:"Dry Weather Fecal Coliform",short_name:"dwFC",concentration_unit:"MPN/_100mL",load_unit:"mpn"}]}},data_path:"nereid/data/default_data/state/region"},Be={openapi:"3.0.2",info:{title:"nereid",version:"0.4.3"},paths:{"/api/v1/network/validate":{post:{tags:["network","validate"],summary:"Validate Network",operationId:"validate_network_api_v1_network_validate_post",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Graph"},example:{directed:!0,nodes:[{id:"A"},{id:"B"}],edges:[{source:"A",target:"B"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/NetworkValidationResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/validate/{task_id}":{get:{tags:["network","validate"],summary:"Get Validate Network Result",operationId:"get_validate_network_result_api_v1_network_validate__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/NetworkValidationResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph":{post:{tags:["network","subgraph"],summary:"Subgraph Network",operationId:"subgraph_network_api_v1_network_subgraph_post",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphRequest"},example:{graph:{directed:!0,edges:[{source:"3",target:"1"},{source:"5",target:"3"},{source:"7",target:"1"},{source:"9",target:"1"},{source:"11",target:"1"},{source:"13",target:"3"},{source:"15",target:"9"},{source:"17",target:"7"},{source:"19",target:"17"},{source:"21",target:"15"},{source:"23",target:"1"},{source:"25",target:"5"},{source:"27",target:"11"},{source:"29",target:"7"},{source:"31",target:"11"},{source:"33",target:"25"},{source:"35",target:"23"},{source:"4",target:"2"},{source:"6",target:"2"},{source:"8",target:"6"},{source:"10",target:"2"},{source:"12",target:"2"},{source:"14",target:"2"},{source:"16",target:"12"},{source:"18",target:"12"},{source:"20",target:"8"},{source:"22",target:"6"},{source:"24",target:"12"}]},nodes:[{id:"3"},{id:"29"},{id:"18"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph/{task_id}":{get:{tags:["network","subgraph"],summary:"Get Subgraph Network Result",operationId:"get_subgraph_network_result_api_v1_network_subgraph__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph/{task_id}/img":{get:{tags:["network","visualize"],summary:"Get Subgraph Network As Img",operationId:"get_subgraph_network_as_img_api_v1_network_subgraph__task_id__img_get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"},{required:!1,schema:{title:"Media Type",type:"string",default:"svg"},name:"media_type",in:"query"},{required:!1,schema:{title:"Npi",type:"number",default:4},name:"npi",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence":{post:{tags:["network","sequence"],summary:"Network Solution Sequence",operationId:"network_solution_sequence_api_v1_network_solution_sequence_post",parameters:[{required:!1,schema:{title:"Min Branch Size",type:"integer",default:4},name:"min_branch_size",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Graph"},example:{directed:!0,edges:[{source:"3",target:"1"},{source:"5",target:"3"},{source:"7",target:"1"},{source:"9",target:"1"},{source:"11",target:"1"},{source:"13",target:"3"},{source:"15",target:"9"},{source:"17",target:"7"},{source:"19",target:"17"},{source:"21",target:"15"},{source:"23",target:"1"},{source:"25",target:"5"},{source:"27",target:"11"},{source:"29",target:"7"},{source:"31",target:"11"},{source:"33",target:"25"},{source:"35",target:"23"},{source:"4",target:"2"},{source:"6",target:"2"},{source:"8",target:"6"},{source:"10",target:"2"},{source:"12",target:"2"},{source:"14",target:"2"},{source:"16",target:"12"},{source:"18",target:"12"},{source:"20",target:"8"},{source:"22",target:"6"},{source:"24",target:"12"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence/{task_id}":{get:{tags:["network","sequence"],summary:"Get Network Solution Sequence",operationId:"get_network_solution_sequence_api_v1_network_solution_sequence__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence/{task_id}/img":{get:{tags:["network","sequence","visualize"],summary:"Get Network Solution Sequence As Img",operationId:"get_network_solution_sequence_as_img_api_v1_network_solution_sequence__task_id__img_get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"},{required:!1,schema:{title:"Media Type",type:"string",default:"svg"},name:"media_type",in:"query"},{required:!1,schema:{title:"Npi",type:"number",default:4},name:"npi",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data":{get:{tags:["reference_data"],summary:"Get Reference Data Json",operationId:"get_reference_data_json_api_v1_reference_data_get",parameters:[{required:!1,schema:{title:"Filename",type:"string",default:""},name:"filename",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/ReferenceDataResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data/nomograph":{get:{tags:["reference_data"],summary:"Get Nomograph",operationId:"get_nomograph_api_v1_reference_data_nomograph_get",parameters:[{required:!1,schema:{title:"Filename",type:"string",default:""},name:"filename",in:"query"},{required:!1,schema:{title:"Type",type:"string"},name:"type",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data/{table}":{get:{tags:["reference_data"],summary:"Get Reference Data Table",operationId:"get_reference_data_table_api_v1_reference_data__table__get",parameters:[{required:!0,schema:{title:"Table",type:"string"},name:"table",in:"path"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/land_surface/loading":{post:{tags:["land_surface","loading"],summary:"Calculate Loading",operationId:"calculate_loading_api_v1_land_surface_loading_post",parameters:[{required:!1,schema:{title:"Details",type:"boolean",default:!1},name:"details",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaces"},example:{land_surfaces:[{node_id:"1",surface_key:"10101100-RESMF-A-5",area_acres:1.834347898661638,imp_area_acres:1.430224547955745},{node_id:"0",surface_key:"10101100-OSDEV-A-0",area_acres:4.458327528535912,imp_area_acres:.4457209193544626},{node_id:"0",surface_key:"10101000-IND-A-10",area_acres:3.337086111390218,imp_area_acres:.47675887386582366},{node_id:"0",surface_key:"10101100-COMM-C-0",area_acres:.5641157902710026,imp_area_acres:.40729090799199347},{node_id:"1",surface_key:"10101200-TRANS-C-5",area_acres:.007787658410143283,imp_area_acres:.007727004694355631}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/land_surface/loading/{task_id}":{get:{tags:["land_surface","loading"],summary:"Get Land Surface Loading Result",operationId:"get_land_surface_loading_result_api_v1_land_surface_loading__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_facility/validate":{post:{tags:["treatment_facility","validate"],summary:"Initialize Treatment Facility Parameters",operationId:"initialize_treatment_facility_parameters_api_v1_treatment_facility_validate_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{title:"Treatment Facilities",anyOf:[{$ref:"#/components/schemas/TreatmentFacilities"},{$ref:"#/components/schemas/TreatmentFacilitiesStrict"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentFacilitiesResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_facility/validate/{task_id}":{get:{tags:["treatment_facility","validate"],summary:"Get Treatment Facility Parameters",operationId:"get_treatment_facility_parameters_api_v1_treatment_facility_validate__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentFacilitiesResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_site/validate":{post:{tags:["treatment_site","validate"],summary:"Initialize Treatment Site",operationId:"initialize_treatment_site_api_v1_treatment_site_validate_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentSites"},example:{treatment_sites:[{node_id:"WQMP-1a-tmnt",facility_type:"bioretention",area_pct:75,captured_pct:80,retained_pct:10},{node_id:"WQMP-1a-tmnt",facility_type:"nt",area_pct:25,captured_pct:0,retained_pct:0},{node_id:"WQMP-1b-tmnt",facility_type:"bioretention",area_pct:75,captured_pct:50,retained_pct:10},{node_id:"WQMP-1b-tmnt",facility_type:"nt",area_pct:25,captured_pct:0,retained_pct:0}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentSiteResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/watershed/solve":{post:{tags:["watershed","main"],summary:"Post Solve Watershed",operationId:"post_solve_watershed_api_v1_watershed_solve_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Watershed"}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/WatershedResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/watershed/solve/{task_id}":{get:{tags:["watershed","main"],summary:"Get Watershed Result",operationId:"get_watershed_result_api_v1_watershed_solve__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/WatershedResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}}},components:{schemas:{BioInfFacility:{title:"BioInfFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","retention_volume_cuft","area_sqft","media_filtration_rate_inhr","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},retention_volume_cuft:{title:"Retention Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},media_filtration_rate_inhr:{title:"Media Filtration Rate Inhr",type:"number"},hsg:{title:"Hsg",type:"string"}}},CisternFacility:{title:"CisternFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","winter_demand_cfs","summer_demand_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},winter_demand_cfs:{title:"Winter Demand Cfs",type:"number"},summer_demand_cfs:{title:"Summer Demand Cfs",type:"number"}}},DryWeatherDiversionLowFlowFacility:{title:"DryWeatherDiversionLowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},DryWeatherTreatmentLowFlowFacility:{title:"DryWeatherTreatmentLowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},DryWellFacility:{title:"DryWellFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","treatment_rate_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"}}},Edge:{title:"Edge",required:["source","target"],type:"object",properties:{source:{title:"Source",type:"string"},target:{title:"Target",type:"string"},metadata:{title:"Metadata",type:"object",default:{}}}},FlowAndRetFacility:{title:"FlowAndRetFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","treatment_rate_cfs","area_sqft","depth_ft","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},depth_ft:{title:"Depth Ft",type:"number"},hsg:{title:"Hsg",type:"string"}}},FlowFacility:{title:"FlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","treatment_rate_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5}}},Graph:{title:"Graph",required:["edges"],type:"object",properties:{edges:{title:"Edges",type:"array",items:{$ref:"#/components/schemas/Edge"}},nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}},directed:{title:"Directed",type:"boolean",default:!0},multigraph:{title:"Multigraph",type:"boolean",default:!0},type:{title:"Type",type:"string"},label:{title:"Label",type:"string"},metadata:{title:"Metadata",type:"object"}}},HTTPValidationError:{title:"HTTPValidationError",type:"object",properties:{detail:{title:"Detail",type:"array",items:{$ref:"#/components/schemas/ValidationError"}}}},LandSurface:{title:"LandSurface",required:["node_id","surface_key","area_acres","imp_area_acres"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},surface_key:{title:"Surface Key",type:"string",example:"104506-RESSFH-B-5"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"}}},LandSurfaceDetails:{title:"LandSurfaceDetails",required:["node_id","surface_key","area_acres","imp_area_acres","surface_id","perv_ro_depth_inches","imp_ro_depth_inches","perv_ro_coeff","imp_ro_coeff","perv_area_acres","imp_area_sqft","perv_area_sqft","imp_ro_depth_feet","perv_ro_depth_feet","imp_ro_volume_cuft","perv_ro_volume_cuft","runoff_volume_cuft","imp_eff_area_acres","perv_eff_area_acres","eff_area_acres"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},surface_key:{title:"Surface Key",type:"string"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"},surface_id:{title:"Surface Id",type:"string"},perv_ro_depth_inches:{title:"Perv Ro Depth Inches",type:"number"},imp_ro_depth_inches:{title:"Imp Ro Depth Inches",type:"number"},perv_ro_coeff:{title:"Perv Ro Coeff",type:"number"},imp_ro_coeff:{title:"Imp Ro Coeff",type:"number"},perv_area_acres:{title:"Perv Area Acres",type:"number"},imp_area_sqft:{title:"Imp Area Sqft",type:"number"},perv_area_sqft:{title:"Perv Area Sqft",type:"number"},imp_ro_depth_feet:{title:"Imp Ro Depth Feet",type:"number"},perv_ro_depth_feet:{title:"Perv Ro Depth Feet",type:"number"},imp_ro_volume_cuft:{title:"Imp Ro Volume Cuft",type:"number"},perv_ro_volume_cuft:{title:"Perv Ro Volume Cuft",type:"number"},runoff_volume_cuft:{title:"Runoff Volume Cuft",type:"number"},imp_eff_area_acres:{title:"Imp Eff Area Acres",type:"number"},perv_eff_area_acres:{title:"Perv Eff Area Acres",type:"number"},eff_area_acres:{title:"Eff Area Acres",type:"number"}}},LandSurfaceResponse:{title:"LandSurfaceResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/LandSurfaceResults"}}},LandSurfaceResults:{title:"LandSurfaceResults",required:["summary"],type:"object",properties:{summary:{title:"Summary",type:"array",items:{$ref:"#/components/schemas/LandSurfaceSummary"}},details:{title:"Details",type:"array",items:{$ref:"#/components/schemas/LandSurfaceDetails"}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},LandSurfaceSummary:{title:"LandSurfaceSummary",required:["node_id","area_acres","imp_area_acres","perv_area_acres","imp_ro_volume_cuft","perv_ro_volume_cuft","runoff_volume_cuft","eff_area_acres","land_surfaces_count","imp_pct","ro_coeff"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"},perv_area_acres:{title:"Perv Area Acres",type:"number"},imp_ro_volume_cuft:{title:"Imp Ro Volume Cuft",type:"number"},perv_ro_volume_cuft:{title:"Perv Ro Volume Cuft",type:"number"},runoff_volume_cuft:{title:"Runoff Volume Cuft",type:"number"},eff_area_acres:{title:"Eff Area Acres",type:"number"},land_surfaces_count:{title:"Land Surfaces Count",type:"number"},imp_pct:{title:"Imp Pct",type:"number"},ro_coeff:{title:"Ro Coeff",type:"number"}}},LandSurfaces:{title:"LandSurfaces",required:["land_surfaces"],type:"object",properties:{land_surfaces:{title:"Land Surfaces",type:"array",items:{$ref:"#/components/schemas/LandSurface"}}}},LowFlowFacility:{title:"LowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},NTFacility:{title:"NTFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},NetworkValidation:{title:"NetworkValidation",required:["isvalid"],type:"object",properties:{isvalid:{title:"Isvalid",type:"boolean"},node_cycles:{title:"Node Cycles",type:"array",items:{type:"array",items:{type:"string"}}},edge_cycles:{title:"Edge Cycles",type:"array",items:{type:"array",items:{type:"string"}}},multiple_out_edges:{title:"Multiple Out Edges",type:"array",items:{type:"array",items:{type:"string"}}},duplicate_edges:{title:"Duplicate Edges",type:"array",items:{type:"array",items:{type:"string"}}}}},NetworkValidationResponse:{title:"NetworkValidationResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/NetworkValidation"}}},Node:{title:"Node",type:"object",properties:{id:{title:"Id",type:"string"},metadata:{title:"Metadata",type:"object",default:{}}}},Nodes:{title:"Nodes",required:["nodes"],type:"object",properties:{nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}}}},ParallelSeriesSequence:{title:"ParallelSeriesSequence",required:["parallel"],type:"object",properties:{parallel:{title:"Parallel",type:"array",items:{$ref:"#/components/schemas/SeriesSequence"}}}},PermPoolFacility:{title:"PermPoolFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","pool_volume_cuft","pool_drawdown_time_hr","treatment_volume_cuft","treatment_drawdown_time_hr","winter_demand_cfs","summer_demand_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},pool_volume_cuft:{title:"Pool Volume Cuft",type:"number"},pool_drawdown_time_hr:{title:"Pool Drawdown Time Hr",type:"number"},treatment_volume_cuft:{title:"Treatment Volume Cuft",type:"number"},treatment_drawdown_time_hr:{title:"Treatment Drawdown Time Hr",type:"number"},winter_demand_cfs:{title:"Winter Demand Cfs",type:"number"},summer_demand_cfs:{title:"Summer Demand Cfs",type:"number"}}},PreviousResult:{title:"PreviousResult",required:["node_id"],type:"object",properties:{node_id:{title:"Node Id",type:"string"}}},ReferenceData:{title:"ReferenceData",required:["state","region","file"],type:"object",properties:{state:{title:"State",type:"string"},region:{title:"Region",type:"string"},file:{title:"File",type:"string"},filedata:{title:"Filedata"}}},ReferenceDataResponse:{title:"ReferenceDataResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/ReferenceData"}}},Result:{title:"Result",required:["node_id"],type:"object",properties:{node_id:{title:"Node Id",type:"string"}}},RetAndTmntFacility:{title:"RetAndTmntFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","retention_volume_cuft","area_sqft","treatment_drawdown_time_hr","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},retention_volume_cuft:{title:"Retention Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},treatment_drawdown_time_hr:{title:"Treatment Drawdown Time Hr",type:"number"},hsg:{title:"Hsg",type:"string"}}},RetentionFacility:{title:"RetentionFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","area_sqft","inf_rate_inhr"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},inf_rate_inhr:{title:"Inf Rate Inhr",type:"number"}}},SeriesSequence:{title:"SeriesSequence",required:["series"],type:"object",properties:{series:{title:"Series",type:"array",items:{$ref:"#/components/schemas/Nodes"}}}},SolutionSequence:{title:"SolutionSequence",required:["solution_sequence"],type:"object",properties:{solution_sequence:{$ref:"#/components/schemas/ParallelSeriesSequence"}}},SolutionSequenceResponse:{title:"SolutionSequenceResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/SolutionSequence"}}},SubgraphNodes:{title:"SubgraphNodes",required:["subgraph_nodes"],type:"object",properties:{subgraph_nodes:{title:"Subgraph Nodes",type:"array",items:{$ref:"#/components/schemas/Nodes"}}}},SubgraphRequest:{title:"SubgraphRequest",required:["graph","nodes"],type:"object",properties:{graph:{$ref:"#/components/schemas/Graph"},nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}}}},SubgraphResponse:{title:"SubgraphResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/SubgraphNodes"}}},TmntFacility:{title:"TmntFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","area_sqft","media_filtration_rate_inhr"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},media_filtration_rate_inhr:{title:"Media Filtration Rate Inhr",type:"number"}}},TreatmentFacilities:{title:"TreatmentFacilities",required:["treatment_facilities"],type:"object",properties:{treatment_facilities:{title:"Treatment Facilities",type:"array",items:{type:"object"}},errors:{title:"Errors",type:"array",items:{type:"string"}}},example:{treatment_facilities:[{node_id:"1",facility_type:"no_treatment",ref_data_key:"10101200",design_storm_depth_inches:1.45},{node_id:"1",facility_type:"dry_extended_detention",ref_data_key:"10101200",design_storm_depth_inches:1.05,is_online:!0,tributary_area_tc_min:30,total_volume_cuft:5500,retention_volume_cuft:4400,area_sqft:1600,treatment_drawdown_time_hr:72,hsg:"d",offline_diversion_rate_cfs:2.9,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"infiltration",ref_data_key:"10101200",design_storm_depth_inches:.88,is_online:!0,tributary_area_tc_min:25,total_volume_cuft:6200,area_sqft:2e3,inf_rate_inhr:3.5,offline_diversion_rate_cfs:5,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"bioretention",ref_data_key:"10101200",design_storm_depth_inches:.85,is_online:!0,tributary_area_tc_min:15,total_volume_cuft:5800,retention_volume_cuft:3500,area_sqft:1300,media_filtration_rate_inhr:12,hsg:"a",offline_diversion_rate_cfs:6,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"biofiltration",ref_data_key:"10101200",design_storm_depth_inches:.95,is_online:!0,tributary_area_tc_min:40,total_volume_cuft:4400,area_sqft:1200,media_filtration_rate_inhr:15,offline_diversion_rate_cfs:6,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"wet_detention",ref_data_key:"10101200",design_storm_depth_inches:.78,is_online:!0,tributary_area_tc_min:45,pool_volume_cuft:5550,pool_drawdown_time_hr:720,treatment_volume_cuft:2500,treatment_drawdown_time_hr:12,winter_demand_cfs:.05,summer_demand_cfs:.88,offline_diversion_rate_cfs:4,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"sand_filter",ref_data_key:"10101200",design_storm_depth_inches:.78,total_volume_cuft:5e3,area_sqft:2700,media_filtration_rate_inhr:12,is_online:!0,offline_diversion_rate_cfs:2.1,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:20},{node_id:"1",facility_type:"swale",ref_data_key:"10101200",design_storm_depth_inches:1,treatment_rate_cfs:.55,area_sqft:15600,depth_ft:1.5,hsg:"b",is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:25},{node_id:"1",facility_type:"hydrodynamic_separator",ref_data_key:"10101200",design_storm_depth_inches:1.12,treatment_rate_cfs:.2,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:50,is_online:!0},{node_id:"1",facility_type:"dry_well",ref_data_key:"10101200",design_storm_depth_inches:.85,total_volume_cuft:800,treatment_rate_cfs:.5,is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:5},{node_id:"1",facility_type:"cistern",ref_data_key:"10101200",design_storm_depth_inches:1.3,total_volume_cuft:5500,winter_demand_cfs:.05,summer_demand_cfs:.25,is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:55},{node_id:"1",facility_type:"dry_weather_diversion",ref_data_key:"10101200",design_storm_depth_inches:1.43,design_capacity_cfs:3.5,months_operational:"summer",tributary_area_tc_min:30,treatment_rate_cfs:2.92,eliminate_all_dry_weather_flow_override:!1,is_online:!0},{node_id:"1",facility_type:"dry_weather_treatment",ref_data_key:"10101200",design_storm_depth_inches:1.32,design_capacity_cfs:6.1,months_operational:"summer",tributary_area_tc_min:10,treatment_rate_cfs:3.5,eliminate_all_dry_weather_flow_override:!1,is_online:!0},{node_id:"1",facility_type:"low_flow_facility",ref_data_key:"10101200",design_storm_depth_inches:.91,design_capacity_cfs:5.1,months_operational:"summer",tributary_area_tc_min:20,treatment_rate_cfs:5,eliminate_all_dry_weather_flow_override:!1,is_online:!0}]}},TreatmentFacilitiesResponse:{title:"TreatmentFacilitiesResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/TreatmentFacilities"}}},TreatmentFacilitiesStrict:{title:"TreatmentFacilitiesStrict",required:["treatment_facilities"],type:"object",properties:{treatment_facilities:{title:"Treatment Facilities",type:"array",items:{anyOf:[{$ref:"#/components/schemas/PermPoolFacility"},{$ref:"#/components/schemas/RetAndTmntFacility"},{$ref:"#/components/schemas/BioInfFacility"},{$ref:"#/components/schemas/FlowAndRetFacility"},{$ref:"#/components/schemas/RetentionFacility"},{$ref:"#/components/schemas/TmntFacility"},{$ref:"#/components/schemas/CisternFacility"},{$ref:"#/components/schemas/DryWellFacility"},{$ref:"#/components/schemas/DryWeatherTreatmentLowFlowFacility"},{$ref:"#/components/schemas/DryWeatherDiversionLowFlowFacility"},{$ref:"#/components/schemas/LowFlowFacility"},{$ref:"#/components/schemas/FlowFacility"},{$ref:"#/components/schemas/NTFacility"}]}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},TreatmentSite:{title:"TreatmentSite",required:["node_id","facility_type","area_pct","captured_pct","retained_pct"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},area_pct:{title:"Area Pct",type:"number"},captured_pct:{title:"Captured Pct",type:"number"},retained_pct:{title:"Retained Pct",type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},TreatmentSiteGroup:{title:"TreatmentSiteGroup",required:["node_id","node_type","treatment_facilities"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},node_type:{title:"Node Type",type:"string"},treatment_facilities:{title:"Treatment Facilities",type:"array",items:{$ref:"#/components/schemas/TreatmentSiteGroupBase"}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},TreatmentSiteGroupBase:{title:"TreatmentSiteGroupBase",required:["node_id","facility_type","area_pct","captured_pct","retained_pct"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},area_pct:{title:"Area Pct",type:"number"},captured_pct:{title:"Captured Pct",type:"number"},retained_pct:{title:"Retained Pct",type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},TreatmentSiteGroups:{title:"TreatmentSiteGroups",required:["treatment_sites"],type:"object",properties:{treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSiteGroup"}}}},TreatmentSiteResponse:{title:"TreatmentSiteResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/TreatmentSiteGroups"}}},TreatmentSites:{title:"TreatmentSites",required:["treatment_sites"],type:"object",properties:{treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSite"}}}},ValidationError:{title:"ValidationError",required:["loc","msg","type"],type:"object",properties:{loc:{title:"Location",type:"array",items:{type:"string"}},msg:{title:"Message",type:"string"},type:{title:"Error Type",type:"string"}}},Watershed:{title:"Watershed",required:["graph","land_surfaces"],type:"object",properties:{graph:{$ref:"#/components/schemas/Graph"},land_surfaces:{title:"Land Surfaces",type:"array",items:{$ref:"#/components/schemas/LandSurface"}},treatment_facilities:{title:"Treatment Facilities",anyOf:[{type:"array",items:{type:"object"}},{type:"array",items:{anyOf:[{$ref:"#/components/schemas/PermPoolFacility"},{$ref:"#/components/schemas/RetAndTmntFacility"},{$ref:"#/components/schemas/BioInfFacility"},{$ref:"#/components/schemas/FlowAndRetFacility"},{$ref:"#/components/schemas/RetentionFacility"},{$ref:"#/components/schemas/TmntFacility"},{$ref:"#/components/schemas/CisternFacility"},{$ref:"#/components/schemas/DryWellFacility"},{$ref:"#/components/schemas/DryWeatherTreatmentLowFlowFacility"},{$ref:"#/components/schemas/DryWeatherDiversionLowFlowFacility"},{$ref:"#/components/schemas/LowFlowFacility"},{$ref:"#/components/schemas/FlowFacility"},{$ref:"#/components/schemas/NTFacility"}]}}]},treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSite"}},previous_results:{title:"Previous Results",type:"array",items:{$ref:"#/components/schemas/PreviousResult"}}},example:{graph:{directed:!0,multigraph:!1,graph:{},nodes:[{metadata:{},id:"0"},{metadata:{},id:"1"},{metadata:{},id:"2"},{metadata:{},id:"3"},{metadata:{},id:"4"},{metadata:{},id:"5"},{metadata:{},id:"6"}],edges:[{metadata:{},source:"1",target:"0"},{metadata:{},source:"2",target:"1"},{metadata:{},source:"3",target:"2"},{metadata:{},source:"4",target:"2"},{metadata:{},source:"5",target:"2"},{metadata:{},source:"6",target:"1"}]},treatment_facilities:[{node_id:"0",facility_type:"sand_filter",ref_data_key:"10101200",design_storm_depth_inches:.85,total_volume_cuft:335,area_sqft:1532,media_filtration_rate_inhr:22.5,constructor:"treatment_facility_constructor",tributary_area_tc_min:30,is_online:!0},{node_id:"2",facility_type:"bioretention",ref_data_key:"10101000",design_storm_depth_inches:.85,total_volume_cuft:382,retention_volume_cuft:333,area_sqft:2658,media_filtration_rate_inhr:14.6,hsg:"a",constructor:"bioinfiltration_facility_constructor",tributary_area_tc_min:55,is_online:!0}],treatment_sites:[{facility_type:"wet_detention",node_id:"1",area_pct:6,captured_pct:57,retained_pct:38},{facility_type:"cistern",node_id:"1",area_pct:80,captured_pct:74,retained_pct:49},{facility_type:"swale",node_id:"1",area_pct:0,captured_pct:61,retained_pct:44},{facility_type:"dry_weather_diversion",node_id:"1",area_pct:12,captured_pct:80,retained_pct:56},{facility_type:"dry_extended_detention",node_id:"1",area_pct:1,captured_pct:40,retained_pct:0},{facility_type:"infiltration",node_id:"1",area_pct:1,captured_pct:73,retained_pct:59}],land_surfaces:[{node_id:"3",surface_key:"10101000-RESSFH-rock-5",area_acres:.3984569310124453,imp_area_acres:.009673489252693119},{node_id:"3",surface_key:"10101100-RESSFH-D-0",area_acres:8.065001059380828,imp_area_acres:2.16741977121951},{node_id:"3",surface_key:"10101100-EDU-D-5",area_acres:2.5839358997133957,imp_area_acres:2.55343628659585},{node_id:"3",surface_key:"10101100-UTIL-A-5",area_acres:4.312089428850966,imp_area_acres:4.131205425493061},{node_id:"3",surface_key:"10101200-RESSFL-D-5",area_acres:3.9337442224446297,imp_area_acres:.7661658366327859},{node_id:"4",surface_key:"10101200-COMM-A-0",area_acres:.28767325522239817,imp_area_acres:.08026707777353169},{node_id:"4",surface_key:"10101200-TRANS-rock-10",area_acres:6.9571538459344495,imp_area_acres:1.2273914932176564},{node_id:"4",surface_key:"10101200-OSLOW-rock-0",area_acres:2.403387703304852,imp_area_acres:.9959985713261311},{node_id:"4",surface_key:"10101200-OSWET-D-5",area_acres:2.79314881649118,imp_area_acres:.15499820430359323},{node_id:"4",surface_key:"10101100-OSFOR-D-5",area_acres:2.905930886150414,imp_area_acres:1.4925738336538064},{node_id:"4",surface_key:"10101000-TRANS-A-5",area_acres:9.350620373618705,imp_area_acres:5.232513213963891},{node_id:"4",surface_key:"10101200-COMM-C-0",area_acres:2.1979646924219196,imp_area_acres:.2053466380605771},{node_id:"4",surface_key:"10101000-OSWET-D-0",area_acres:9.316054897695937,imp_area_acres:8.379096506045641},{node_id:"4",surface_key:"10101200-TRFWY-A-0",area_acres:1.4272661923917718,imp_area_acres:1.2613822514526472},{node_id:"4",surface_key:"10101200-OSDEV-C-10",area_acres:4.221871721446085,imp_area_acres:.4549400198109034},{node_id:"4",surface_key:"10101100-RESSFH-C-0",area_acres:.26360615441130775,imp_area_acres:.13605449920172205},{node_id:"4",surface_key:"10101000-OSDEV-D-5",area_acres:7.289650539203478,imp_area_acres:6.077668638347337},{node_id:"5",surface_key:"10101000-IND-A-10",area_acres:4.930498275495615,imp_area_acres:4.450757471699112},{node_id:"5",surface_key:"10101200-OSLOW-rock-0",area_acres:7.814106399568224,imp_area_acres:1.078526163782842},{node_id:"5",surface_key:"10101200-RESSFL-D-5",area_acres:6.185417372804003,imp_area_acres:5.76250105686173},{node_id:"5",surface_key:"10101200-OSIRR-water-10",area_acres:.36715726648133273,imp_area_acres:.23531606583046188},{node_id:"5",surface_key:"10101200-RESMF-D-5",area_acres:5.3935429017017515,imp_area_acres:3.810512599072686},{node_id:"5",surface_key:"10101100-RESSFH-A-5",area_acres:2.3620796715469004,imp_area_acres:1.870944109794398},{node_id:"5",surface_key:"10101200-WATER-A-10",area_acres:5.506805596166197,imp_area_acres:2.0512411750860533},{node_id:"5",surface_key:"10101200-TRFWY-A-5",area_acres:2.2549267594382885,imp_area_acres:.059337765905655114},{node_id:"5",surface_key:"10101200-EDU-A-5",area_acres:6.945443095820329,imp_area_acres:2.426366435613679},{node_id:"5",surface_key:"10101100-IND-D-0",area_acres:3.8291536983619254,imp_area_acres:2.4237194475207304},{node_id:"5",surface_key:"10101000-RESSFH-D-10",area_acres:4.720854566650611,imp_area_acres:1.9563886575871627},{node_id:"5",surface_key:"10101000-EDU-C-10",area_acres:1.7804423698966843,imp_area_acres:.3371318723066817},{node_id:"6",surface_key:"10101200-TRANS-D-0",area_acres:2.2754330855140923,imp_area_acres:1.0211331313414405},{node_id:"6",surface_key:"10101100-OSLOW-D-5",area_acres:6.214500618686376,imp_area_acres:.6340460489422389},{node_id:"6",surface_key:"10101100-UTIL-A-10",area_acres:2.555615240745477,imp_area_acres:2.131208949421928},{node_id:"6",surface_key:"10101000-RESSFH-A-5",area_acres:8.175748802007071,imp_area_acres:1.8980919101830314},{node_id:"6",surface_key:"10101200-RESSFH-A-0",area_acres:3.860268456910725,imp_area_acres:1.9184629017741963},{node_id:"6",surface_key:"10101200-OSDEV-C-5",area_acres:.5748050245941472,imp_area_acres:.1411875823737466},{node_id:"6",surface_key:"10101000-RESSFH-D-0",area_acres:7.945535238259879,imp_area_acres:.6302494865328522},{node_id:"6",surface_key:"10101000-RESMF-D-0",area_acres:6.915337959629758,imp_area_acres:3.162694892687792},{node_id:"6",surface_key:"10101000-IND-A-5",area_acres:5.262089934922299,imp_area_acres:.012019588367122497},{node_id:"6",surface_key:"10101200-EDU-D-10",area_acres:9.142141560695912,imp_area_acres:8.229015560695975},{node_id:"6",surface_key:"10101200-OSAGIR-A-10",area_acres:1.1171651349206269,imp_area_acres:.5990037582520297},{node_id:"6",surface_key:"10101100-OSAGIR-C-0",area_acres:3.304545692925136,imp_area_acres:.36222350149989435},{node_id:"6",surface_key:"10101000-RESSFH-D-0",area_acres:9.63416946726306,imp_area_acres:7.1542071673930625},{node_id:"6",surface_key:"10101100-OSLOW-D-0",area_acres:4.8579106327541695,imp_area_acres:.25541389152635474},{node_id:"6",surface_key:"10101200-OSDEV-C-5",area_acres:6.798391444820259,imp_area_acres:2.2112485428708193},{node_id:"6",surface_key:"10101000-RESSFH-D-10",area_acres:3.4948300942486963,imp_area_acres:3.233078107164885},{node_id:"6",surface_key:"10101000-OSAGIR-A-10",area_acres:3.6289953644281625,imp_area_acres:.38263683466075843},{node_id:"6",surface_key:"10101100-OSDEV-D-0",area_acres:5.376760581619445,imp_area_acres:4.5257872671756365}]}},WatershedResponse:{title:"WatershedResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/WatershedResults"}}},WatershedResults:{title:"WatershedResults",type:"object",properties:{results:{title:"Results",type:"array",items:{$ref:"#/components/schemas/Result"}},leaf_results:{title:"Leaf Results",type:"array",items:{$ref:"#/components/schemas/Result"}},previous_results_keys:{title:"Previous Results Keys",type:"array",items:{type:"string"}},errors:{title:"Errors",type:"array",items:{type:"string"}},warnings:{title:"Warnings",type:"array",items:{type:"string"}}}}}}},Ue=Object.freeze(Object.defineProperty({__proto__:null,getConfig:ie,getReferenceData:ee,solveWatershed:re,validateNetwork:te,validateTreatmentFacilities:ae},Symbol.toStringTag,{value:"Module"})),p=(i,e="")=>e.split(".").reduce((t,a)=>t==null?t:t[a],i),x=(i,e="")=>{let t=p(i,e);return t===void 0?!1:t};function ne(i){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=t.length;for(let r=0;rObject.keys(i).filter(r=>e.length?e.includes(r):!0).filter(r=>!t.includes(r)).reduce((r,s)=>({...r,[s]:i[s]}),{});function q(i){return Object.entries(i).filter(([e,t])=>t!=""&&t!=null).reduce((e,[t,a])=>({...e,[t]:a===Object(a)?q(a):a}),{})}function v(i){return JSON.parse(JSON.stringify(i))}function B(i){return i.length?i.reduce((e,t)=>e+t)/i.length:void 0}function w(i){return Array.isArray(i)?[].concat(...i.map(w)):i}const O=()=>{let i=(p(m,"state.waiting")||0)+1;m.dispatch("Waiting",{waiting:i})},L=()=>{let i=(p(m,"state.waiting")||0)-1;i<0&&(console.error("waiting counter is negative"),i=0),m.dispatch("Waiting",{waiting:i})};async function A(i){return console.log("fetching with get",i),O(),await fetch(i,{method:"GET"}).then(t=>{if(console.log("getJsonResponse response:",t),t.status==200)return t.json();if(t.status==422)return t.json();throw new Error("got back "+t.content)}).then(t=>(console.log("getJsonResponse data returned:",t),t)).finally(L)}async function C(i,e){return console.log("fetching with post",i,e),O(),await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>{if(console.log("postJsonResponse response:",a),a.status==200)return a.json();if(a.status==422)return a.json();throw new Error("got back "+a)}).then(a=>(console.log("postJsonResponse data returned:",a),a)).finally(L)}const He=({fn:i,validate:e,interval:t,maxAttempts:a})=>{console.log("Start poll...");let r=0;const s=async(n,c)=>{console.log("- poll");const _=await i();if(r++,e(_))return n(_);if(a&&r===a)return c(new Error("Exceeded max attempts"));setTimeout(s,t,n,c)};return new Promise(s)};function U(i){var e,t,a,r,s,n;return n=i.data||null,n==null||!n.length?null:(r=i.columnDelimiter||",",s=i.lineDelimiter||` +`,a=i.keys||Object.keys(n[0]),e="",e+=a.map(c=>String(c).includes(",")?`"${c}"`:`${c}`).join(r),e+=s,n.forEach(function(c){t=0,a.forEach(function(_){t>0&&(e+=r);const u=String(c[_]);u.includes(",")?e+=`"${u}"`:e+=`${u}`,t++}),e+=s}),e)}const le=async()=>{const i=new URLSearchParams(window.location.search);let{state:e,region:t}=Object.fromEntries(i.entries());const a=await ie({nereid_state:e||m.state.nereid_state,nereid_region:t||m.state.nereid_region});return m.dispatch("updateConfig",a),console.log(a),!1},Ge=Object.freeze(Object.defineProperty({__proto__:null,cleanObject:q,convertArrayOfObjectsToCSV:U,decr_waiting:L,deepCopy:v,filter:oe,flatten:w,get:p,getConfigFromUrlQueryParams:le,getJsonResponse:A,getTruthy:x,incr_waiting:O,mean:B,poll:He,postJsonResponse:C,randomString:ne},Symbol.toStringTag,{value:"Module"}));class F{constructor(e,t,a){this.nodes=e||[],this.edges=t||[],this.options=a||{},this.resolve_links(),m.dispatch("newGraph",{graph:this})}resolve_links(){let e=this;e.nodes=e.nodes.filter(r=>r.id!=null),this.edges.forEach(function(r){let s=r.source,n=r.target;r.source=e.nodes.find(c=>c.id===s),r.target=e.nodes.find(c=>c.id===n)});let t=this.options.width||600,a=this.options.height||400;this.nodes.forEach(function(r){r.x||(r.x=t/2+t/3*(Math.random()-1)),r.y||(r.y=a/2+a/3*(Math.random()-1))})}spliceLinksForNode(e){const t=this.edges.filter(a=>a.source.id===e||a.target.id===e);for(const a of t)this.edges.splice(this.edges.indexOf(a),1)}}function M(){let{nodes:i,edges:e,scenario_name:t}=v(p(m,"state.staged_changes"));new F(i,e),m.dispatch("clearStagedChanges",{staged_changes:{}}),t&&m.dispatch("updateScenarioName",{scenario_name:t})}function de(){let i=v(p(m,"state.staged_changes.nodes")),e=v(p(m,"state.staged_changes.edges")),t=v(p(m,"state.graph.nodes")),a=v(p(m,"state.graph.edges")),r=[...a,...e].map(n=>{var c,_;return{source:((c=n.source)==null?void 0:c.id)||n.source,target:((_=n.target)==null?void 0:_.id)||n.target}}),s=i;for(let n of t)i.map(c=>c.id).includes(n.id)||s.push(n);new F(s,r),m.dispatch("clearStagedChanges",{staged_changes:{}})}const Je=()=>{let{graph:i,scenario_name:e}=p(m,"state");sessionStorage.setItem("autosave_graph",JSON.stringify({graph:i,scenario_name:e}))},Ke=()=>{var t;let i=sessionStorage.getItem("autosave_graph"),e=v(p(m,"state.default_graph"));if(i){const{graph:a,scenario_name:r}=JSON.parse(i);sessionStorage.removeItem("autosave_graph"),((t=a==null?void 0:a.nodes)==null?void 0:t.length)>0?new F(a.nodes,a.edges.map(s=>({source:s.source.id,target:s.target.id}))):new F(e.nodes,e.edges),r&&m.dispatch("restoreScenarioName",{scenario_name:r})}else new F(e.nodes,e.edges)};window.addEventListener("beforeunload",Je);window.addEventListener("load",i=>{const t=new URLSearchParams(window.location.search).get("tab");t&&m.dispatch("changedTab",{current_tab:t})});const y=Object.assign({json:ye,Delaunay:he},ge,be,ve,we,ke,Se,xe,Te,$e,je,Re,Fe,De,Ee,Ne,Ae,qe,Oe,Le,Ce);window.d3=y;class b{constructor(e={}){let t=this;this.element,this.element_string,this.id,this._render=this._render||e._render||function(){},e.store instanceof z&&(t.store=e.store),e.hasOwnProperty("events")&&e.store instanceof z&&e.events.forEach(a=>e.store.events.subscribe(a,()=>t.render())),e.hasOwnProperty("element")&&(t.element=e.element),e.hasOwnProperty("element_string")&&(t.element_string=e.element_string,t.element=y.select(element)),e.hasOwnProperty("id")&&(t.id=e.id,t.element_string=`#${t.id}`,t.element=y.select(t.element_string)),e.hasOwnProperty("children")&&(t.children=e.children)}render(){let e=this;this._render(),this!=null&&this.children&&this.children.forEach(t=>{t!=null&&t.parent_id||(t.parent_id=e.id),t.render()})}}class Qe extends b{constructor(e){super({store:m,id:e.id})}enter(){let e=this;e.element.classed("pointer-events-none",!1);let t;t=e.element.select(".background-overlay").node(),t.classList.remove("opacity-0"),t.classList.add("duration-300","opacity-40"),t=e.element.select(".modal-main").node(),t.classList.remove("opacity-0","translate-y-4"),t.classList.add("opacity-100","translate-y-0")}exit(){let e=this,t=e.element;e.element.classed("pointer-events-none",!0);let a;a=t.select(".background-overlay").node(),a.classList.remove("opacity-40","duration-300"),a.classList.add("opacity-0"),a=t.select(".modal-main").node(),a.classList.remove("opacity-100","translate-y-0"),a.classList.add("opacity-0","translate-y-4")}_base_template(){return` +
+ ${(e==null?void 0:e.msg)||""} +
+${JSON.stringify(n,void 0,2)}`;a.select(".info-tooltip-json").html(c)}_render(){let e=this,t=d3.select(`#${e.parent_id}`);e.element=t.append("div").attr("id",e.id||"").classed("transition-opacity opacity-0 tooltip rounded shadow-lg p-1 bg-gray-50",!0);let a=e.element.html("");a=a.append("div").classed("info-tooltip p-2",!0),a.append("div").classed("info-tooltip-header mt-2 uppercase text-lg font-bold",!0),a.append("div").classed("info-tooltip-content text-sm",!0).append("table"),a.select(".info-tooltip-content").append("div").classed("info-tooltip-json",!0),a.append("div").classed("info-tooltip-footer",!0),e.store.events.subscribe("stateChange",()=>this.update_contents())}}const ht=new yt({parent_id:"editor-info",id:"node-info-tooltip"});class gt extends b{constructor(e){super({store:m});let t=this;t.parent_id=e.parent_id,t.id=e.id||""}get show_tips(){return p(this,"store.state.graph_edit_mode")}hide(){let e=this.element;e.classed("opacity-100 h-auto",!1),e.classed("opacity-0 h-0",!0)}show(){let e=this.element;e.classed("opacity-100 h-auto",!0),e.classed("opacity-0 h-0",!1)}update_contents(){let e=this;if(!e.show_tips){e.hide();return}e.show()}_template(){return` +
${JSON.stringify(i,void 0,2)}`,alert_type:"error"};this.store.dispatch("raiseModal",{modal_content:e})})}}),Tt=new j({id:"run_scenario",title:"Run Scenario",icon:` +
${JSON.stringify(this.scenario,void 0,2)}`;this.element.select("#dump-scenario-text").html(e)}clearScenario(){this.element.select("#dump-scenario-text").html("")}_template(){return` +
d+P||x =f)return;(d.data!==t||d.next)&&(m===0&&(m=wt(e),y+=m*m),w===0&&(w=wt(e),y+=w*w),y=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function oi(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,r=n.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+n.slice(e+1)]}function se(n){return n=oi(Math.abs(n)),n?n[1]:NaN}function c2(n,t){return function(e,r){for(var i=e.length,o=[],a=0,f=n[0],c=0;i>0&&f>0&&(c+f+1>r&&(f=Math.max(1,r-c)),o.push(e.substring(i-=f,i+f)),!((c+=f+1)>r));)f=n[a=(a+1)%n.length];return o.reverse().join(t)}}function l2(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var s2=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function he(n){if(!(t=s2.exec(n)))throw new Error("invalid format: "+n);var t;return new Yi({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}he.prototype=Yi.prototype;function Yi(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}Yi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function h2(n){n:for(var t=n.length,e=1,r=-1,i;e t&&(e=n,n=t,t=e),function(r){return Math.max(n,Math.min(t,r))}}function z2(n,t,e){var r=n[0],i=n[1],o=t[0],a=t[1];return iT||T>57){O=(T===46?i+A.slice(_+1):A.slice(_))+O,A=A.slice(0,_);break}}}w&&!b&&(A=t(A,1/0));var I=D.length+A.length+O.length,R=I0?1:n<0?-1:0},gn=Math.sqrt,lf=Math.tan;function c0(n){return n>1?0:n<-1?G:Math.acos(n)}function An(n){return n>1?fn:n<-1?-fn:Math.asin(n)}function Fu(n){return(n=z(n/2))*n}function en(){}function li(n,t){n&&Lu.hasOwnProperty(n.type)&&Lu[n.type](n,t)}var Uu={Feature:function(n,t){li(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=U(t),a=z(t),f=ea*a,c=ta*o+f*U(i),u=f*r*z(i);si.add(Tn(u,c)),na=n,ta=o,ea=a}function N6(n){return hi=new sn,Xn(n,ot),hi*2}function di(n){return[Tn(n[1],n[0]),An(n[2])]}function Lt(n){var t=n[0],e=n[1],r=U(e);return[r*U(t),r*z(t),z(e)]}function Rr(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function be(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function $o(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Ir(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function gi(n){var t=gn(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var tn,Cn,an,On,$t,d0,g0,oe,He,yt,mt,ct={point:ra,lineStart:qu,lineEnd:Bu,polygonStart:function(){ct.point=m0,ct.lineStart=C6,ct.lineEnd=P6,He=new sn,ot.polygonStart()},polygonEnd:function(){ot.polygonEnd(),ct.point=ra,ct.lineStart=qu,ct.lineEnd=Bu,si<0?(tn=-(an=180),Cn=-(On=90)):He>Y?On=90:He<-Y&&(Cn=-90),mt[0]=tn,mt[1]=an},sphere:function(){tn=-(an=180),Cn=-(On=90)}};function ra(n,t){yt.push(mt=[tn=n,an=n]),t0^_[1]<(W(_[0]-S)
+ ${this.title}
+
+
+ ${this.title}
+
+ ${opts?.msg || ""} +
+${JSON.stringify(e, undefined, 2)}`, + alert_type: "error", + }; + + this.store.dispatch("raiseModal", { modal_content: opt }); + }); + }, +}); + +export const runScenarioOption = new EditorMenuOption({ + id: "run_scenario", + title: "Run Scenario", + icon: ` +
${JSON.stringify(this.scenario, undefined, 2)}`; + + this.element.select("#dump-scenario-text").html(contents); + } + + clearScenario() { + this.element.select("#dump-scenario-text").html(""); + } + + _template() { + return ` +
${JSON.stringify(d.data, undefined, 2)}`; + let datastring = `
${JSON.stringify(pp_obj, undefined, 2)}`; + ele.select(".info-tooltip-json").html(datastring); + } + + _render() { + let self = this; + + // console.log("rendering tooltip", self.parent_id); + + let parent = d3.select(`#${self.parent_id}`); //.classed("has-tooltip", true); + self.element = parent + .append("div") + .attr("id", self.id || "") + .classed( + "transition-opacity opacity-0 tooltip rounded shadow-lg p-1 bg-gray-50", + true + ); + + let tooltip = self.element.html(""); + + tooltip = tooltip.append("div").classed("info-tooltip p-2", true); + + tooltip + .append("div") + .classed("info-tooltip-header mt-2 uppercase text-lg font-bold", true); + + tooltip + .append("div") + .classed("info-tooltip-content text-sm", true) + .append("table"); + + tooltip + .select(".info-tooltip-content") + .append("div") + .classed("info-tooltip-json", true); + tooltip.append("div").classed("info-tooltip-footer", true); + + self.store.events.subscribe("stateChange", () => this.update_contents()); + + // parent.on("mousemove.node-info-tooltip", (event) => + // self.tooltip_move(event) + // ); + } +} + +export const node_info = new NodeInfoTooltip({ + parent_id: "editor-info", + id: "node-info-tooltip", +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js new file mode 100644 index 00000000..39a0d7ef --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js @@ -0,0 +1,58 @@ +import Component from "../../base/component.js"; +import store from "../../../lib/state.js"; +import d3 from "../../../lib/d3.js"; +import * as util from "../../../lib/util.js"; + +export class EditorTab extends Component { + constructor(options) { + super({ store, id: options.id, children: options.children }); + this.store.events.subscribe( + "updateScenarioName", + this._update_scenario_name.bind(this) + ); + } + + get scenario_name() { + return util.get(this.store, "state.scenario_name"); + } + + _update_scenario_name() { + let self = this; + d3.select(`#${self.id}`).select("#scenario-name").text(self.scenario_name); + return; + } + + _template() { + return ` +
${JSON.stringify(rsp?.data, undefined, 2)}`, + alert_type: "error", + }; + } catch (e) { + return { + title: "Validation Error", + msg: `
${JSON.stringify(e, undefined, 2)}`, + alert_type: "error", + }; + + // store.dispatch("raiseModal", { modal_content: opt }); + } + + // store.dispatch("raiseModal", { modal_content: opt }); + // return false; + }, + + postValidateTreatmentFacilities: async (host, api, state, region, data) => { + let route = `${host}${api}/treatment_facility/validate?state=${state}®ion=${region}`; + let rsp; + try { + rsp = await util.postJsonResponse(route, data); + + let errors = []; + for (let bmp of rsp?.data?.treatment_facilities) { + bmp?.errors ? errors.push(bmp?.errors.replace(/\n/g, " ")) : null; + } + + for (let error of rsp?.data?.errors) { + if (error.toLowerCase().substring(0, 6).includes("error")) { + errors.push(error); + } + } + + if (errors.length == 0) { + return { + title: "Validation Succeeded", + msg: "", + alert_type: "success", + }; + // return true; + } + + return { + title: "Validation Errors", + msg: `
${JSON.stringify(errors, undefined, 2)}`, + alert_type: "error", + }; + } catch (e) { + return { + title: "Validation Error", + msg: `
${JSON.stringify(e, undefined, 2)}`, + alert_type: "error", + }; + + // store.dispatch("raiseModal", { modal_content: opt }); + } + + // store.dispatch("raiseModal", { modal_content: opt }); + // return false; + }, + + postSolveWatershed: async (host, api, state, region, data) => { + let route = `${host}${api}/watershed/solve?state=${state}®ion=${region}`; + let rsp; + try { + rsp = await util.postJsonResponse(route, data); + if (rsp?.data?.errors?.length == 0) { + return rsp; + } + } catch (e) { + console.error(e); + } + console.error(rsp, rsp?.data?.errors); + return rsp; + }, +}; + +export const getReferenceData = async (filename) => { + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.getReferenceData( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + filename + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const validateNetwork = async () => { + let data = graph(); + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postValidateNetwork( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const validateTreatmentFacilities = async () => { + let data = { treatment_facilities: treatment_facilities() }; + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postValidateTreatmentFacilities( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const solveWatershed = async () => { + let data = watershed(); + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postSolveWatershed( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +function replace_refs(obj, schema) { + for (let k in obj) { + if (typeof obj[k] == "object" && obj[k] !== null) { + replace_refs(obj[k], schema); + } else if (k == "$ref") { + let refname = obj[k].split("/").slice(-1).pop(); + if (refname) { + delete obj.$ref; + obj = Object.assign(obj, schema[refname]); + } + } + } +} + +export const getConfig = async ({ + nereid_host, + nereid_state, + nereid_region, +}) => { + // console.log(nereid_host, nereid_state, nereid_region); + if (!nereid_host) { + nereid_host = window.location.origin; //await nereid.getHost(); + } + + const openapi = await nereid.getOpenApi(nereid_host); + + const config = await nereid.getConfig( + nereid_host, + nereid_state, + nereid_region + ); + + const schema = util.deepCopy(openapi["components"]["schemas"]); + for (let c in schema) { + replace_refs(schema[c], schema); + } + + const facility_objs = + config["api_recognize"]["treatment_facility"]["facility_type"]; + + const facility_type_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + facility_type_map[k] = v["validator"]; + } + + const facility_alias_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + if (v?.alias) { + for (let a of v?.alias) { + facility_alias_map[a] = k; + } + } else { + facility_alias_map[k] = k; + } + } + + const facility_label_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + facility_label_map[v?.label || k] = k; + } + + const facility_types = Object.keys(facility_label_map); + + return { + nereid_host, + nereid_state, + nereid_region, + config, + openapi, + schema, + facility_types, + facility_type_map, + facility_alias_map, + facility_label_map, + }; +}; + +const __config = { + default_data_directory: "default_data", + project_data_directory: "project_data", + version: "0.4.3", + author: "Austin Orr", + contact: "aorr@geosyntec.com", + state: "state", + region: "region", + test: true, + pint_unit_registry: [ + "MPN = count = mpn", + "_100ml = 100 * milliliter = _100mL", + ], + api_recognize: { + land_surfaces: { + preprocess: [ + { + expand_fields: [ + { + field: "surface_key", + sep: "-", + new_column_names: ["subbasin", "land_use", "soil", "slope"], + }, + ], + }, + { + collapse_fields: [ + { + new_column_name: "fuzzy_key", + sep: "-", + fields: ["land_use"], + }, + ], + }, + { + joins: [ + { + other: "land_surface_table", + how: "left", + left_on: "surface_key", + right_on: "surface_id", + validate: "many_to_one", + indicator: true, + fuzzy_on: ["fuzzy_key"], + }, + { + other: "land_surface_emc_table", + how: "left", + left_on: "land_use", + right_on: "land_use", + validate: "many_to_one", + indicator: true, + }, + { + other: "dry_weather_land_surface_emc_table", + how: "left", + left_on: "land_use", + right_on: "land_use", + validate: "many_to_one", + indicator: true, + }, + { + other: "met_table", + how: "left", + left_on: "subbasin", + right_on: "subbasin", + validate: "many_to_one", + indicator: true, + }, + { + other: "dry_weather_flow_table", + how: "left", + left_on: "rain_gauge", + right_on: "rain_gauge", + validate: "many_to_one", + indicator: true, + }, + ], + }, + { + remaps: [ + { + left: "soil", + right: "imp_pct", + how: "addend", + mapping: { + water: 100, + }, + }, + { + left: "land_use", + right: "is_developed", + how: "left", + fillna: false, + mapping: { + COMM: true, + EDU: true, + IND: true, + UTIL: true, + RESSFH: true, + RESSFL: true, + RESMF: true, + TRFWY: true, + TRANS: true, + TROTH: true, + }, + }, + ], + }, + ], + }, + treatment_facility: { + preprocess: [ + { + joins: [ + { + other: "met_table", + how: "left", + left_on: "ref_data_key", + right_on: "subbasin", + validate: "many_to_one", + indicator: true, + }, + ], + }, + { + remaps: [ + { + left: "hsg", + right: "inf_rate_inhr", + how: "left", + fillna: 0.000001, + mapping: { + a: 2.5, + b: 0.8, + c: 0.24, + d: 0.024, + lined: 0.000001, + }, + }, + ], + }, + ], + facility_type: { + no_treatment: { + validator: "NTFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_extended_detention: { + validator: "RetAndTmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Detention Basin", + }, + infiltration: { + validator: "RetentionFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + bioretention: { + validator: "BioInfFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Biofiltration", + }, + biofiltration: { + validator: "TmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Biofiltration", + }, + wet_detention: { + validator: "PermPoolFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Wet Pond", + }, + sand_filter: { + validator: "TmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Sand Filter", + }, + swale: { + validator: "FlowAndRetFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Vegetated Swale", + }, + hydrodynamic_separator: { + validator: "FlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Hydrodynamic Separator", + }, + dry_well: { + validator: "DryWellFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + cistern: { + validator: "CisternFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_weather_diversion: { + validator: "DryWeatherDiversionLowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_weather_treatment: { + validator: "DryWeatherTreatmentLowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Sand Filter", + }, + low_flow_facility: { + validator: "LowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + }, + }, + }, + project_reference_data: { + dry_weather_flow_table: { + file: "dry_weather_flow.json", + seasons: { + winter: ["oct", "nov", "dec", "jan", "feb", "mar"], + summer: ["apr", "may", "jun", "jul", "aug", "sep"], + }, + }, + met_table: { + file: "met_data.json", + volume_nomo: { + x_col: "size_fraction", + t_col: "ddt_hr", + y_col: "capture_fraction", + }, + flow_nomo: { + x_col: "intensity_inhr", + t_col: "tc_minutes", + y_col: "performance_frac", + }, + preprocess: [ + { + remaps: [ + { + left: "rain_gauge", + right: "volume_nomograph", + how: "left", + mapping: { + "100_LAGUNABEACH": "nomographs/100_LAGUNABEACH_volume_nomo.csv", + "1130_LAGUNA_AUDUBON": + "nomographs/1130_LAGUNA_AUDUBON_volume_nomo.csv", + }, + }, + { + left: "rain_gauge", + right: "flow_nomograph", + how: "left", + mapping: { + "100_LAGUNABEACH": "nomographs/100_LAGUNABEACH_flow_nomo.csv", + "1130_LAGUNA_AUDUBON": + "nomographs/1130_LAGUNA_AUDUBON_flow_nomo.csv", + }, + }, + ], + }, + ], + }, + dry_weather_tmnt_performance_table: { + file: "dry_weather_bmp_params.json", + facility_column: "facility_type", + pollutant_column: "pollutant", + preprocess: [ + { + remaps: [ + { + left: "unit", + right: "--", + how: "replace", + mapping: { + "MPN/100mL": "MPN/_100ml", + "MPN/100 mL": "MPN/_100ml", + }, + }, + ], + }, + ], + }, + tmnt_performance_table: { + file: "bmp_params.json", + facility_column: "facility_type", + pollutant_column: "pollutant", + preprocess: [ + { + remaps: [ + { + left: "unit", + right: "--", + how: "replace", + mapping: { + "MPN/100mL": "MPN/_100ml", + "MPN/100 mL": "MPN/_100ml", + }, + }, + ], + }, + ], + }, + land_surface_table: { + file: "land_surface_data.json", + }, + land_surface_emc_table: { + file: "land_surface_emc.json", + parameters: [ + { + long_name: "Total Suspended Solids", + short_name: "TSS", + concentration_unit: "mg/L", + load_unit: "lbs", + }, + { + long_name: "Total Copper", + short_name: "TCu", + concentration_unit: "ug/L", + load_unit: "lbs", + }, + { + long_name: "Fecal Coliform", + short_name: "FC", + concentration_unit: "MPN/_100mL", + load_unit: "mpn", + }, + ], + }, + dry_weather_land_surface_emc_table: { + file: "dry_weather_land_surface_emc.json", + parameters: [ + { + long_name: "Dry Weather Total Suspended Solids", + short_name: "dwTSS", + concentration_unit: "mg/L", + load_unit: "lbs", + }, + { + long_name: "Dry Weather Total Copper", + short_name: "dwTCu", + concentration_unit: "ug/L", + load_unit: "lbs", + }, + { + long_name: "Dry Weather Fecal Coliform", + short_name: "dwFC", + concentration_unit: "MPN/_100mL", + load_unit: "mpn", + }, + ], + }, + }, + data_path: "nereid/data/default_data/state/region", +}; + +const __openapi = { + openapi: "3.0.2", + info: { title: "nereid", version: "0.4.3" }, + paths: { + "/api/v1/network/validate": { + post: { + tags: ["network", "validate"], + summary: "Validate Network", + operationId: "validate_network_api_v1_network_validate_post", + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Graph" }, + example: { + directed: true, + nodes: [{ id: "A" }, { id: "B" }], + edges: [{ source: "A", target: "B" }], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/NetworkValidationResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/validate/{task_id}": { + get: { + tags: ["network", "validate"], + summary: "Get Validate Network Result", + operationId: + "get_validate_network_result_api_v1_network_validate__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/NetworkValidationResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph": { + post: { + tags: ["network", "subgraph"], + summary: "Subgraph Network", + operationId: "subgraph_network_api_v1_network_subgraph_post", + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphRequest" }, + example: { + graph: { + directed: true, + edges: [ + { source: "3", target: "1" }, + { source: "5", target: "3" }, + { source: "7", target: "1" }, + { source: "9", target: "1" }, + { source: "11", target: "1" }, + { source: "13", target: "3" }, + { source: "15", target: "9" }, + { source: "17", target: "7" }, + { source: "19", target: "17" }, + { source: "21", target: "15" }, + { source: "23", target: "1" }, + { source: "25", target: "5" }, + { source: "27", target: "11" }, + { source: "29", target: "7" }, + { source: "31", target: "11" }, + { source: "33", target: "25" }, + { source: "35", target: "23" }, + { source: "4", target: "2" }, + { source: "6", target: "2" }, + { source: "8", target: "6" }, + { source: "10", target: "2" }, + { source: "12", target: "2" }, + { source: "14", target: "2" }, + { source: "16", target: "12" }, + { source: "18", target: "12" }, + { source: "20", target: "8" }, + { source: "22", target: "6" }, + { source: "24", target: "12" }, + ], + }, + nodes: [{ id: "3" }, { id: "29" }, { id: "18" }], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph/{task_id}": { + get: { + tags: ["network", "subgraph"], + summary: "Get Subgraph Network Result", + operationId: + "get_subgraph_network_result_api_v1_network_subgraph__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph/{task_id}/img": { + get: { + tags: ["network", "visualize"], + summary: "Get Subgraph Network As Img", + operationId: + "get_subgraph_network_as_img_api_v1_network_subgraph__task_id__img_get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + { + required: false, + schema: { title: "Media Type", type: "string", default: "svg" }, + name: "media_type", + in: "query", + }, + { + required: false, + schema: { title: "Npi", type: "number", default: 4.0 }, + name: "npi", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence": { + post: { + tags: ["network", "sequence"], + summary: "Network Solution Sequence", + operationId: + "network_solution_sequence_api_v1_network_solution_sequence_post", + parameters: [ + { + required: false, + schema: { title: "Min Branch Size", type: "integer", default: 4 }, + name: "min_branch_size", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Graph" }, + example: { + directed: true, + edges: [ + { source: "3", target: "1" }, + { source: "5", target: "3" }, + { source: "7", target: "1" }, + { source: "9", target: "1" }, + { source: "11", target: "1" }, + { source: "13", target: "3" }, + { source: "15", target: "9" }, + { source: "17", target: "7" }, + { source: "19", target: "17" }, + { source: "21", target: "15" }, + { source: "23", target: "1" }, + { source: "25", target: "5" }, + { source: "27", target: "11" }, + { source: "29", target: "7" }, + { source: "31", target: "11" }, + { source: "33", target: "25" }, + { source: "35", target: "23" }, + { source: "4", target: "2" }, + { source: "6", target: "2" }, + { source: "8", target: "6" }, + { source: "10", target: "2" }, + { source: "12", target: "2" }, + { source: "14", target: "2" }, + { source: "16", target: "12" }, + { source: "18", target: "12" }, + { source: "20", target: "8" }, + { source: "22", target: "6" }, + { source: "24", target: "12" }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence/{task_id}": { + get: { + tags: ["network", "sequence"], + summary: "Get Network Solution Sequence", + operationId: + "get_network_solution_sequence_api_v1_network_solution_sequence__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence/{task_id}/img": { + get: { + tags: ["network", "sequence", "visualize"], + summary: "Get Network Solution Sequence As Img", + operationId: + "get_network_solution_sequence_as_img_api_v1_network_solution_sequence__task_id__img_get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + { + required: false, + schema: { title: "Media Type", type: "string", default: "svg" }, + name: "media_type", + in: "query", + }, + { + required: false, + schema: { title: "Npi", type: "number", default: 4.0 }, + name: "npi", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data": { + get: { + tags: ["reference_data"], + summary: "Get Reference Data Json", + operationId: "get_reference_data_json_api_v1_reference_data_get", + parameters: [ + { + required: false, + schema: { title: "Filename", type: "string", default: "" }, + name: "filename", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ReferenceDataResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data/nomograph": { + get: { + tags: ["reference_data"], + summary: "Get Nomograph", + operationId: "get_nomograph_api_v1_reference_data_nomograph_get", + parameters: [ + { + required: false, + schema: { title: "Filename", type: "string", default: "" }, + name: "filename", + in: "query", + }, + { + required: false, + schema: { title: "Type", type: "string" }, + name: "type", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { "application/json": { schema: {} } }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data/{table}": { + get: { + tags: ["reference_data"], + summary: "Get Reference Data Table", + operationId: + "get_reference_data_table_api_v1_reference_data__table__get", + parameters: [ + { + required: true, + schema: { title: "Table", type: "string" }, + name: "table", + in: "path", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { "application/json": { schema: {} } }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/land_surface/loading": { + post: { + tags: ["land_surface", "loading"], + summary: "Calculate Loading", + operationId: "calculate_loading_api_v1_land_surface_loading_post", + parameters: [ + { + required: false, + schema: { title: "Details", type: "boolean", default: false }, + name: "details", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaces" }, + example: { + land_surfaces: [ + { + node_id: "1", + surface_key: "10101100-RESMF-A-5", + area_acres: 1.834347898661638, + imp_area_acres: 1.430224547955745, + }, + { + node_id: "0", + surface_key: "10101100-OSDEV-A-0", + area_acres: 4.458327528535912, + imp_area_acres: 0.4457209193544626, + }, + { + node_id: "0", + surface_key: "10101000-IND-A-10", + area_acres: 3.337086111390218, + imp_area_acres: 0.47675887386582366, + }, + { + node_id: "0", + surface_key: "10101100-COMM-C-0", + area_acres: 0.5641157902710026, + imp_area_acres: 0.40729090799199347, + }, + { + node_id: "1", + surface_key: "10101200-TRANS-C-5", + area_acres: 0.007787658410143283, + imp_area_acres: 0.007727004694355631, + }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaceResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/land_surface/loading/{task_id}": { + get: { + tags: ["land_surface", "loading"], + summary: "Get Land Surface Loading Result", + operationId: + "get_land_surface_loading_result_api_v1_land_surface_loading__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaceResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_facility/validate": { + post: { + tags: ["treatment_facility", "validate"], + summary: "Initialize Treatment Facility Parameters", + operationId: + "initialize_treatment_facility_parameters_api_v1_treatment_facility_validate_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { + title: "Treatment Facilities", + anyOf: [ + { $ref: "#/components/schemas/TreatmentFacilities" }, + { $ref: "#/components/schemas/TreatmentFacilitiesStrict" }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/TreatmentFacilitiesResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_facility/validate/{task_id}": { + get: { + tags: ["treatment_facility", "validate"], + summary: "Get Treatment Facility Parameters", + operationId: + "get_treatment_facility_parameters_api_v1_treatment_facility_validate__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/TreatmentFacilitiesResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_site/validate": { + post: { + tags: ["treatment_site", "validate"], + summary: "Initialize Treatment Site", + operationId: + "initialize_treatment_site_api_v1_treatment_site_validate_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/TreatmentSites" }, + example: { + treatment_sites: [ + { + node_id: "WQMP-1a-tmnt", + facility_type: "bioretention", + area_pct: 75, + captured_pct: 80, + retained_pct: 10, + }, + { + node_id: "WQMP-1a-tmnt", + facility_type: "nt", + area_pct: 25, + captured_pct: 0, + retained_pct: 0, + }, + { + node_id: "WQMP-1b-tmnt", + facility_type: "bioretention", + area_pct: 75, + captured_pct: 50, + retained_pct: 10, + }, + { + node_id: "WQMP-1b-tmnt", + facility_type: "nt", + area_pct: 25, + captured_pct: 0, + retained_pct: 0, + }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/TreatmentSiteResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/watershed/solve": { + post: { + tags: ["watershed", "main"], + summary: "Post Solve Watershed", + operationId: "post_solve_watershed_api_v1_watershed_solve_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Watershed" }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/WatershedResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/watershed/solve/{task_id}": { + get: { + tags: ["watershed", "main"], + summary: "Get Watershed Result", + operationId: + "get_watershed_result_api_v1_watershed_solve__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/WatershedResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + }, + components: { + schemas: { + BioInfFacility: { + title: "BioInfFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "retention_volume_cuft", + "area_sqft", + "media_filtration_rate_inhr", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + retention_volume_cuft: { + title: "Retention Volume Cuft", + type: "number", + }, + area_sqft: { title: "Area Sqft", type: "number" }, + media_filtration_rate_inhr: { + title: "Media Filtration Rate Inhr", + type: "number", + }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + CisternFacility: { + title: "CisternFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "winter_demand_cfs", + "summer_demand_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + winter_demand_cfs: { title: "Winter Demand Cfs", type: "number" }, + summer_demand_cfs: { title: "Summer Demand Cfs", type: "number" }, + }, + }, + DryWeatherDiversionLowFlowFacility: { + title: "DryWeatherDiversionLowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + DryWeatherTreatmentLowFlowFacility: { + title: "DryWeatherTreatmentLowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + DryWellFacility: { + title: "DryWellFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "treatment_rate_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + }, + }, + Edge: { + title: "Edge", + required: ["source", "target"], + type: "object", + properties: { + source: { title: "Source", type: "string" }, + target: { title: "Target", type: "string" }, + metadata: { title: "Metadata", type: "object", default: {} }, + }, + }, + FlowAndRetFacility: { + title: "FlowAndRetFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "treatment_rate_cfs", + "area_sqft", + "depth_ft", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + depth_ft: { title: "Depth Ft", type: "number" }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + FlowFacility: { + title: "FlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "treatment_rate_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + }, + }, + Graph: { + title: "Graph", + required: ["edges"], + type: "object", + properties: { + edges: { + title: "Edges", + type: "array", + items: { $ref: "#/components/schemas/Edge" }, + }, + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + directed: { title: "Directed", type: "boolean", default: true }, + multigraph: { title: "Multigraph", type: "boolean", default: true }, + type: { title: "Type", type: "string" }, + label: { title: "Label", type: "string" }, + metadata: { title: "Metadata", type: "object" }, + }, + }, + HTTPValidationError: { + title: "HTTPValidationError", + type: "object", + properties: { + detail: { + title: "Detail", + type: "array", + items: { $ref: "#/components/schemas/ValidationError" }, + }, + }, + }, + LandSurface: { + title: "LandSurface", + required: ["node_id", "surface_key", "area_acres", "imp_area_acres"], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + surface_key: { + title: "Surface Key", + type: "string", + example: "104506-RESSFH-B-5", + }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + }, + }, + LandSurfaceDetails: { + title: "LandSurfaceDetails", + required: [ + "node_id", + "surface_key", + "area_acres", + "imp_area_acres", + "surface_id", + "perv_ro_depth_inches", + "imp_ro_depth_inches", + "perv_ro_coeff", + "imp_ro_coeff", + "perv_area_acres", + "imp_area_sqft", + "perv_area_sqft", + "imp_ro_depth_feet", + "perv_ro_depth_feet", + "imp_ro_volume_cuft", + "perv_ro_volume_cuft", + "runoff_volume_cuft", + "imp_eff_area_acres", + "perv_eff_area_acres", + "eff_area_acres", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + surface_key: { title: "Surface Key", type: "string" }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + surface_id: { title: "Surface Id", type: "string" }, + perv_ro_depth_inches: { + title: "Perv Ro Depth Inches", + type: "number", + }, + imp_ro_depth_inches: { title: "Imp Ro Depth Inches", type: "number" }, + perv_ro_coeff: { title: "Perv Ro Coeff", type: "number" }, + imp_ro_coeff: { title: "Imp Ro Coeff", type: "number" }, + perv_area_acres: { title: "Perv Area Acres", type: "number" }, + imp_area_sqft: { title: "Imp Area Sqft", type: "number" }, + perv_area_sqft: { title: "Perv Area Sqft", type: "number" }, + imp_ro_depth_feet: { title: "Imp Ro Depth Feet", type: "number" }, + perv_ro_depth_feet: { title: "Perv Ro Depth Feet", type: "number" }, + imp_ro_volume_cuft: { title: "Imp Ro Volume Cuft", type: "number" }, + perv_ro_volume_cuft: { title: "Perv Ro Volume Cuft", type: "number" }, + runoff_volume_cuft: { title: "Runoff Volume Cuft", type: "number" }, + imp_eff_area_acres: { title: "Imp Eff Area Acres", type: "number" }, + perv_eff_area_acres: { title: "Perv Eff Area Acres", type: "number" }, + eff_area_acres: { title: "Eff Area Acres", type: "number" }, + }, + }, + LandSurfaceResponse: { + title: "LandSurfaceResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/LandSurfaceResults" }, + }, + }, + LandSurfaceResults: { + title: "LandSurfaceResults", + required: ["summary"], + type: "object", + properties: { + summary: { + title: "Summary", + type: "array", + items: { $ref: "#/components/schemas/LandSurfaceSummary" }, + }, + details: { + title: "Details", + type: "array", + items: { $ref: "#/components/schemas/LandSurfaceDetails" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + LandSurfaceSummary: { + title: "LandSurfaceSummary", + required: [ + "node_id", + "area_acres", + "imp_area_acres", + "perv_area_acres", + "imp_ro_volume_cuft", + "perv_ro_volume_cuft", + "runoff_volume_cuft", + "eff_area_acres", + "land_surfaces_count", + "imp_pct", + "ro_coeff", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + perv_area_acres: { title: "Perv Area Acres", type: "number" }, + imp_ro_volume_cuft: { title: "Imp Ro Volume Cuft", type: "number" }, + perv_ro_volume_cuft: { title: "Perv Ro Volume Cuft", type: "number" }, + runoff_volume_cuft: { title: "Runoff Volume Cuft", type: "number" }, + eff_area_acres: { title: "Eff Area Acres", type: "number" }, + land_surfaces_count: { title: "Land Surfaces Count", type: "number" }, + imp_pct: { title: "Imp Pct", type: "number" }, + ro_coeff: { title: "Ro Coeff", type: "number" }, + }, + }, + LandSurfaces: { + title: "LandSurfaces", + required: ["land_surfaces"], + type: "object", + properties: { + land_surfaces: { + title: "Land Surfaces", + type: "array", + items: { $ref: "#/components/schemas/LandSurface" }, + }, + }, + }, + LowFlowFacility: { + title: "LowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + NTFacility: { + title: "NTFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + NetworkValidation: { + title: "NetworkValidation", + required: ["isvalid"], + type: "object", + properties: { + isvalid: { title: "Isvalid", type: "boolean" }, + node_cycles: { + title: "Node Cycles", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + edge_cycles: { + title: "Edge Cycles", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + multiple_out_edges: { + title: "Multiple Out Edges", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + duplicate_edges: { + title: "Duplicate Edges", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + }, + }, + NetworkValidationResponse: { + title: "NetworkValidationResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/NetworkValidation" }, + }, + }, + Node: { + title: "Node", + type: "object", + properties: { + id: { title: "Id", type: "string" }, + metadata: { title: "Metadata", type: "object", default: {} }, + }, + }, + Nodes: { + title: "Nodes", + required: ["nodes"], + type: "object", + properties: { + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + }, + }, + ParallelSeriesSequence: { + title: "ParallelSeriesSequence", + required: ["parallel"], + type: "object", + properties: { + parallel: { + title: "Parallel", + type: "array", + items: { $ref: "#/components/schemas/SeriesSequence" }, + }, + }, + }, + PermPoolFacility: { + title: "PermPoolFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "pool_volume_cuft", + "pool_drawdown_time_hr", + "treatment_volume_cuft", + "treatment_drawdown_time_hr", + "winter_demand_cfs", + "summer_demand_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + pool_volume_cuft: { title: "Pool Volume Cuft", type: "number" }, + pool_drawdown_time_hr: { + title: "Pool Drawdown Time Hr", + type: "number", + }, + treatment_volume_cuft: { + title: "Treatment Volume Cuft", + type: "number", + }, + treatment_drawdown_time_hr: { + title: "Treatment Drawdown Time Hr", + type: "number", + }, + winter_demand_cfs: { title: "Winter Demand Cfs", type: "number" }, + summer_demand_cfs: { title: "Summer Demand Cfs", type: "number" }, + }, + }, + PreviousResult: { + title: "PreviousResult", + required: ["node_id"], + type: "object", + properties: { node_id: { title: "Node Id", type: "string" } }, + }, + ReferenceData: { + title: "ReferenceData", + required: ["state", "region", "file"], + type: "object", + properties: { + state: { title: "State", type: "string" }, + region: { title: "Region", type: "string" }, + file: { title: "File", type: "string" }, + filedata: { title: "Filedata" }, + }, + }, + ReferenceDataResponse: { + title: "ReferenceDataResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/ReferenceData" }, + }, + }, + Result: { + title: "Result", + required: ["node_id"], + type: "object", + properties: { node_id: { title: "Node Id", type: "string" } }, + }, + RetAndTmntFacility: { + title: "RetAndTmntFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "retention_volume_cuft", + "area_sqft", + "treatment_drawdown_time_hr", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + retention_volume_cuft: { + title: "Retention Volume Cuft", + type: "number", + }, + area_sqft: { title: "Area Sqft", type: "number" }, + treatment_drawdown_time_hr: { + title: "Treatment Drawdown Time Hr", + type: "number", + }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + RetentionFacility: { + title: "RetentionFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "area_sqft", + "inf_rate_inhr", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + inf_rate_inhr: { title: "Inf Rate Inhr", type: "number" }, + }, + }, + SeriesSequence: { + title: "SeriesSequence", + required: ["series"], + type: "object", + properties: { + series: { + title: "Series", + type: "array", + items: { $ref: "#/components/schemas/Nodes" }, + }, + }, + }, + SolutionSequence: { + title: "SolutionSequence", + required: ["solution_sequence"], + type: "object", + properties: { + solution_sequence: { + $ref: "#/components/schemas/ParallelSeriesSequence", + }, + }, + }, + SolutionSequenceResponse: { + title: "SolutionSequenceResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/SolutionSequence" }, + }, + }, + SubgraphNodes: { + title: "SubgraphNodes", + required: ["subgraph_nodes"], + type: "object", + properties: { + subgraph_nodes: { + title: "Subgraph Nodes", + type: "array", + items: { $ref: "#/components/schemas/Nodes" }, + }, + }, + }, + SubgraphRequest: { + title: "SubgraphRequest", + required: ["graph", "nodes"], + type: "object", + properties: { + graph: { $ref: "#/components/schemas/Graph" }, + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + }, + }, + SubgraphResponse: { + title: "SubgraphResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/SubgraphNodes" }, + }, + }, + TmntFacility: { + title: "TmntFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "area_sqft", + "media_filtration_rate_inhr", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + media_filtration_rate_inhr: { + title: "Media Filtration Rate Inhr", + type: "number", + }, + }, + }, + TreatmentFacilities: { + title: "TreatmentFacilities", + required: ["treatment_facilities"], + type: "object", + properties: { + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { type: "object" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + example: { + treatment_facilities: [ + { + node_id: "1", + facility_type: "no_treatment", + ref_data_key: "10101200", + design_storm_depth_inches: 1.45, + }, + { + node_id: "1", + facility_type: "dry_extended_detention", + ref_data_key: "10101200", + design_storm_depth_inches: 1.05, + is_online: true, + tributary_area_tc_min: 30, + total_volume_cuft: 5500, + retention_volume_cuft: 4400, + area_sqft: 1600, + treatment_drawdown_time_hr: 72, + hsg: "d", + offline_diversion_rate_cfs: 2.9, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "infiltration", + ref_data_key: "10101200", + design_storm_depth_inches: 0.88, + is_online: true, + tributary_area_tc_min: 25, + total_volume_cuft: 6200, + area_sqft: 2000, + inf_rate_inhr: 3.5, + offline_diversion_rate_cfs: 5, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "bioretention", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + is_online: true, + tributary_area_tc_min: 15, + total_volume_cuft: 5800, + retention_volume_cuft: 3500, + area_sqft: 1300, + media_filtration_rate_inhr: 12, + hsg: "a", + offline_diversion_rate_cfs: 6, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "biofiltration", + ref_data_key: "10101200", + design_storm_depth_inches: 0.95, + is_online: true, + tributary_area_tc_min: 40, + total_volume_cuft: 4400, + area_sqft: 1200, + media_filtration_rate_inhr: 15, + offline_diversion_rate_cfs: 6, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "wet_detention", + ref_data_key: "10101200", + design_storm_depth_inches: 0.78, + is_online: true, + tributary_area_tc_min: 45, + pool_volume_cuft: 5550, + pool_drawdown_time_hr: 720, + treatment_volume_cuft: 2500, + treatment_drawdown_time_hr: 12, + winter_demand_cfs: 0.05, + summer_demand_cfs: 0.88, + offline_diversion_rate_cfs: 4, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "sand_filter", + ref_data_key: "10101200", + design_storm_depth_inches: 0.78, + total_volume_cuft: 5000, + area_sqft: 2700, + media_filtration_rate_inhr: 12, + is_online: true, + offline_diversion_rate_cfs: 2.1, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 20, + }, + { + node_id: "1", + facility_type: "swale", + ref_data_key: "10101200", + design_storm_depth_inches: 1.0, + treatment_rate_cfs: 0.55, + area_sqft: 15600, + depth_ft: 1.5, + hsg: "b", + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 25, + }, + { + node_id: "1", + facility_type: "hydrodynamic_separator", + ref_data_key: "10101200", + design_storm_depth_inches: 1.12, + treatment_rate_cfs: 0.2, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 50, + is_online: true, + }, + { + node_id: "1", + facility_type: "dry_well", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + total_volume_cuft: 800, + treatment_rate_cfs: 0.5, + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 5, + }, + { + node_id: "1", + facility_type: "cistern", + ref_data_key: "10101200", + design_storm_depth_inches: 1.3, + total_volume_cuft: 5500, + winter_demand_cfs: 0.05, + summer_demand_cfs: 0.25, + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 55, + }, + { + node_id: "1", + facility_type: "dry_weather_diversion", + ref_data_key: "10101200", + design_storm_depth_inches: 1.43, + design_capacity_cfs: 3.5, + months_operational: "summer", + tributary_area_tc_min: 30, + treatment_rate_cfs: 2.92, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + { + node_id: "1", + facility_type: "dry_weather_treatment", + ref_data_key: "10101200", + design_storm_depth_inches: 1.32, + design_capacity_cfs: 6.1, + months_operational: "summer", + tributary_area_tc_min: 10, + treatment_rate_cfs: 3.5, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + { + node_id: "1", + facility_type: "low_flow_facility", + ref_data_key: "10101200", + design_storm_depth_inches: 0.91, + design_capacity_cfs: 5.1, + months_operational: "summer", + tributary_area_tc_min: 20, + treatment_rate_cfs: 5.0, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + ], + }, + }, + TreatmentFacilitiesResponse: { + title: "TreatmentFacilitiesResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/TreatmentFacilities" }, + }, + }, + TreatmentFacilitiesStrict: { + title: "TreatmentFacilitiesStrict", + required: ["treatment_facilities"], + type: "object", + properties: { + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { + anyOf: [ + { $ref: "#/components/schemas/PermPoolFacility" }, + { $ref: "#/components/schemas/RetAndTmntFacility" }, + { $ref: "#/components/schemas/BioInfFacility" }, + { $ref: "#/components/schemas/FlowAndRetFacility" }, + { $ref: "#/components/schemas/RetentionFacility" }, + { $ref: "#/components/schemas/TmntFacility" }, + { $ref: "#/components/schemas/CisternFacility" }, + { $ref: "#/components/schemas/DryWellFacility" }, + { + $ref: "#/components/schemas/DryWeatherTreatmentLowFlowFacility", + }, + { + $ref: "#/components/schemas/DryWeatherDiversionLowFlowFacility", + }, + { $ref: "#/components/schemas/LowFlowFacility" }, + { $ref: "#/components/schemas/FlowFacility" }, + { $ref: "#/components/schemas/NTFacility" }, + ], + }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + TreatmentSite: { + title: "TreatmentSite", + required: [ + "node_id", + "facility_type", + "area_pct", + "captured_pct", + "retained_pct", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + area_pct: { title: "Area Pct", type: "number" }, + captured_pct: { title: "Captured Pct", type: "number" }, + retained_pct: { title: "Retained Pct", type: "number" }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + TreatmentSiteGroup: { + title: "TreatmentSiteGroup", + required: ["node_id", "node_type", "treatment_facilities"], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + node_type: { title: "Node Type", type: "string" }, + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSiteGroupBase" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + TreatmentSiteGroupBase: { + title: "TreatmentSiteGroupBase", + required: [ + "node_id", + "facility_type", + "area_pct", + "captured_pct", + "retained_pct", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + area_pct: { title: "Area Pct", type: "number" }, + captured_pct: { title: "Captured Pct", type: "number" }, + retained_pct: { title: "Retained Pct", type: "number" }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + TreatmentSiteGroups: { + title: "TreatmentSiteGroups", + required: ["treatment_sites"], + type: "object", + properties: { + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSiteGroup" }, + }, + }, + }, + TreatmentSiteResponse: { + title: "TreatmentSiteResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/TreatmentSiteGroups" }, + }, + }, + TreatmentSites: { + title: "TreatmentSites", + required: ["treatment_sites"], + type: "object", + properties: { + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSite" }, + }, + }, + }, + ValidationError: { + title: "ValidationError", + required: ["loc", "msg", "type"], + type: "object", + properties: { + loc: { title: "Location", type: "array", items: { type: "string" } }, + msg: { title: "Message", type: "string" }, + type: { title: "Error Type", type: "string" }, + }, + }, + Watershed: { + title: "Watershed", + required: ["graph", "land_surfaces"], + type: "object", + properties: { + graph: { $ref: "#/components/schemas/Graph" }, + land_surfaces: { + title: "Land Surfaces", + type: "array", + items: { $ref: "#/components/schemas/LandSurface" }, + }, + treatment_facilities: { + title: "Treatment Facilities", + anyOf: [ + { type: "array", items: { type: "object" } }, + { + type: "array", + items: { + anyOf: [ + { $ref: "#/components/schemas/PermPoolFacility" }, + { $ref: "#/components/schemas/RetAndTmntFacility" }, + { $ref: "#/components/schemas/BioInfFacility" }, + { $ref: "#/components/schemas/FlowAndRetFacility" }, + { $ref: "#/components/schemas/RetentionFacility" }, + { $ref: "#/components/schemas/TmntFacility" }, + { $ref: "#/components/schemas/CisternFacility" }, + { $ref: "#/components/schemas/DryWellFacility" }, + { + $ref: "#/components/schemas/DryWeatherTreatmentLowFlowFacility", + }, + { + $ref: "#/components/schemas/DryWeatherDiversionLowFlowFacility", + }, + { $ref: "#/components/schemas/LowFlowFacility" }, + { $ref: "#/components/schemas/FlowFacility" }, + { $ref: "#/components/schemas/NTFacility" }, + ], + }, + }, + ], + }, + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSite" }, + }, + previous_results: { + title: "Previous Results", + type: "array", + items: { $ref: "#/components/schemas/PreviousResult" }, + }, + }, + example: { + graph: { + directed: true, + multigraph: false, + graph: {}, + nodes: [ + { metadata: {}, id: "0" }, + { metadata: {}, id: "1" }, + { metadata: {}, id: "2" }, + { metadata: {}, id: "3" }, + { metadata: {}, id: "4" }, + { metadata: {}, id: "5" }, + { metadata: {}, id: "6" }, + ], + edges: [ + { metadata: {}, source: "1", target: "0" }, + { metadata: {}, source: "2", target: "1" }, + { metadata: {}, source: "3", target: "2" }, + { metadata: {}, source: "4", target: "2" }, + { metadata: {}, source: "5", target: "2" }, + { metadata: {}, source: "6", target: "1" }, + ], + }, + treatment_facilities: [ + { + node_id: "0", + facility_type: "sand_filter", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + total_volume_cuft: 335, + area_sqft: 1532, + media_filtration_rate_inhr: 22.5, + constructor: "treatment_facility_constructor", + tributary_area_tc_min: 30, + is_online: true, + }, + { + node_id: "2", + facility_type: "bioretention", + ref_data_key: "10101000", + design_storm_depth_inches: 0.85, + total_volume_cuft: 382, + retention_volume_cuft: 333, + area_sqft: 2658, + media_filtration_rate_inhr: 14.6, + hsg: "a", + constructor: "bioinfiltration_facility_constructor", + tributary_area_tc_min: 55, + is_online: true, + }, + ], + treatment_sites: [ + { + facility_type: "wet_detention", + node_id: "1", + area_pct: 6, + captured_pct: 57, + retained_pct: 38, + }, + { + facility_type: "cistern", + node_id: "1", + area_pct: 80, + captured_pct: 74, + retained_pct: 49, + }, + { + facility_type: "swale", + node_id: "1", + area_pct: 0, + captured_pct: 61, + retained_pct: 44, + }, + { + facility_type: "dry_weather_diversion", + node_id: "1", + area_pct: 12, + captured_pct: 80, + retained_pct: 56, + }, + { + facility_type: "dry_extended_detention", + node_id: "1", + area_pct: 1, + captured_pct: 40, + retained_pct: 0, + }, + { + facility_type: "infiltration", + node_id: "1", + area_pct: 1, + captured_pct: 73, + retained_pct: 59, + }, + ], + land_surfaces: [ + { + node_id: "3", + surface_key: "10101000-RESSFH-rock-5", + area_acres: 0.3984569310124453, + imp_area_acres: 0.009673489252693119, + }, + { + node_id: "3", + surface_key: "10101100-RESSFH-D-0", + area_acres: 8.065001059380828, + imp_area_acres: 2.16741977121951, + }, + { + node_id: "3", + surface_key: "10101100-EDU-D-5", + area_acres: 2.5839358997133957, + imp_area_acres: 2.55343628659585, + }, + { + node_id: "3", + surface_key: "10101100-UTIL-A-5", + area_acres: 4.312089428850966, + imp_area_acres: 4.131205425493061, + }, + { + node_id: "3", + surface_key: "10101200-RESSFL-D-5", + area_acres: 3.9337442224446297, + imp_area_acres: 0.7661658366327859, + }, + { + node_id: "4", + surface_key: "10101200-COMM-A-0", + area_acres: 0.28767325522239817, + imp_area_acres: 0.08026707777353169, + }, + { + node_id: "4", + surface_key: "10101200-TRANS-rock-10", + area_acres: 6.9571538459344495, + imp_area_acres: 1.2273914932176564, + }, + { + node_id: "4", + surface_key: "10101200-OSLOW-rock-0", + area_acres: 2.403387703304852, + imp_area_acres: 0.9959985713261311, + }, + { + node_id: "4", + surface_key: "10101200-OSWET-D-5", + area_acres: 2.79314881649118, + imp_area_acres: 0.15499820430359323, + }, + { + node_id: "4", + surface_key: "10101100-OSFOR-D-5", + area_acres: 2.905930886150414, + imp_area_acres: 1.4925738336538064, + }, + { + node_id: "4", + surface_key: "10101000-TRANS-A-5", + area_acres: 9.350620373618705, + imp_area_acres: 5.232513213963891, + }, + { + node_id: "4", + surface_key: "10101200-COMM-C-0", + area_acres: 2.1979646924219196, + imp_area_acres: 0.2053466380605771, + }, + { + node_id: "4", + surface_key: "10101000-OSWET-D-0", + area_acres: 9.316054897695937, + imp_area_acres: 8.379096506045641, + }, + { + node_id: "4", + surface_key: "10101200-TRFWY-A-0", + area_acres: 1.4272661923917718, + imp_area_acres: 1.2613822514526472, + }, + { + node_id: "4", + surface_key: "10101200-OSDEV-C-10", + area_acres: 4.221871721446085, + imp_area_acres: 0.4549400198109034, + }, + { + node_id: "4", + surface_key: "10101100-RESSFH-C-0", + area_acres: 0.26360615441130775, + imp_area_acres: 0.13605449920172205, + }, + { + node_id: "4", + surface_key: "10101000-OSDEV-D-5", + area_acres: 7.289650539203478, + imp_area_acres: 6.077668638347337, + }, + { + node_id: "5", + surface_key: "10101000-IND-A-10", + area_acres: 4.930498275495615, + imp_area_acres: 4.450757471699112, + }, + { + node_id: "5", + surface_key: "10101200-OSLOW-rock-0", + area_acres: 7.814106399568224, + imp_area_acres: 1.078526163782842, + }, + { + node_id: "5", + surface_key: "10101200-RESSFL-D-5", + area_acres: 6.185417372804003, + imp_area_acres: 5.76250105686173, + }, + { + node_id: "5", + surface_key: "10101200-OSIRR-water-10", + area_acres: 0.36715726648133273, + imp_area_acres: 0.23531606583046188, + }, + { + node_id: "5", + surface_key: "10101200-RESMF-D-5", + area_acres: 5.3935429017017515, + imp_area_acres: 3.810512599072686, + }, + { + node_id: "5", + surface_key: "10101100-RESSFH-A-5", + area_acres: 2.3620796715469004, + imp_area_acres: 1.870944109794398, + }, + { + node_id: "5", + surface_key: "10101200-WATER-A-10", + area_acres: 5.506805596166197, + imp_area_acres: 2.0512411750860533, + }, + { + node_id: "5", + surface_key: "10101200-TRFWY-A-5", + area_acres: 2.2549267594382885, + imp_area_acres: 0.059337765905655114, + }, + { + node_id: "5", + surface_key: "10101200-EDU-A-5", + area_acres: 6.945443095820329, + imp_area_acres: 2.426366435613679, + }, + { + node_id: "5", + surface_key: "10101100-IND-D-0", + area_acres: 3.8291536983619254, + imp_area_acres: 2.4237194475207304, + }, + { + node_id: "5", + surface_key: "10101000-RESSFH-D-10", + area_acres: 4.720854566650611, + imp_area_acres: 1.9563886575871627, + }, + { + node_id: "5", + surface_key: "10101000-EDU-C-10", + area_acres: 1.7804423698966843, + imp_area_acres: 0.3371318723066817, + }, + { + node_id: "6", + surface_key: "10101200-TRANS-D-0", + area_acres: 2.2754330855140923, + imp_area_acres: 1.0211331313414405, + }, + { + node_id: "6", + surface_key: "10101100-OSLOW-D-5", + area_acres: 6.214500618686376, + imp_area_acres: 0.6340460489422389, + }, + { + node_id: "6", + surface_key: "10101100-UTIL-A-10", + area_acres: 2.555615240745477, + imp_area_acres: 2.131208949421928, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-A-5", + area_acres: 8.175748802007071, + imp_area_acres: 1.8980919101830314, + }, + { + node_id: "6", + surface_key: "10101200-RESSFH-A-0", + area_acres: 3.860268456910725, + imp_area_acres: 1.9184629017741963, + }, + { + node_id: "6", + surface_key: "10101200-OSDEV-C-5", + area_acres: 0.5748050245941472, + imp_area_acres: 0.1411875823737466, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-0", + area_acres: 7.945535238259879, + imp_area_acres: 0.6302494865328522, + }, + { + node_id: "6", + surface_key: "10101000-RESMF-D-0", + area_acres: 6.915337959629758, + imp_area_acres: 3.162694892687792, + }, + { + node_id: "6", + surface_key: "10101000-IND-A-5", + area_acres: 5.262089934922299, + imp_area_acres: 0.012019588367122497, + }, + { + node_id: "6", + surface_key: "10101200-EDU-D-10", + area_acres: 9.142141560695912, + imp_area_acres: 8.229015560695975, + }, + { + node_id: "6", + surface_key: "10101200-OSAGIR-A-10", + area_acres: 1.1171651349206269, + imp_area_acres: 0.5990037582520297, + }, + { + node_id: "6", + surface_key: "10101100-OSAGIR-C-0", + area_acres: 3.304545692925136, + imp_area_acres: 0.36222350149989435, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-0", + area_acres: 9.63416946726306, + imp_area_acres: 7.1542071673930625, + }, + { + node_id: "6", + surface_key: "10101100-OSLOW-D-0", + area_acres: 4.8579106327541695, + imp_area_acres: 0.25541389152635474, + }, + { + node_id: "6", + surface_key: "10101200-OSDEV-C-5", + area_acres: 6.798391444820259, + imp_area_acres: 2.2112485428708193, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-10", + area_acres: 3.4948300942486963, + imp_area_acres: 3.233078107164885, + }, + { + node_id: "6", + surface_key: "10101000-OSAGIR-A-10", + area_acres: 3.6289953644281625, + imp_area_acres: 0.38263683466075843, + }, + { + node_id: "6", + surface_key: "10101100-OSDEV-D-0", + area_acres: 5.376760581619445, + imp_area_acres: 4.5257872671756365, + }, + ], + }, + }, + WatershedResponse: { + title: "WatershedResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/WatershedResults" }, + }, + }, + WatershedResults: { + title: "WatershedResults", + type: "object", + properties: { + results: { + title: "Results", + type: "array", + items: { $ref: "#/components/schemas/Result" }, + }, + leaf_results: { + title: "Leaf Results", + type: "array", + items: { $ref: "#/components/schemas/Result" }, + }, + previous_results_keys: { + title: "Previous Results Keys", + type: "array", + items: { type: "string" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + warnings: { + title: "Warnings", + type: "array", + items: { type: "string" }, + }, + }, + }, + }, + }, +}; diff --git a/nereid/nereid/static/frontend/src/js/lib/pubsub.js b/nereid/nereid/static/frontend/src/js/lib/pubsub.js new file mode 100644 index 00000000..60b2140b --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/pubsub.js @@ -0,0 +1,56 @@ +import store from "./state.js"; + +export default class PubSub { + constructor() { + this.events = {}; + } + + /** + * Either create a new event instance for passed `event` name + * or push a new callback into the existing collection + * + * @param {string} event + * @param {function} callback + * @returns {boolean} + * @memberof PubSub + */ + subscribe(event, callback) { + let self = this; + + // If there's not already an event with this name set in our collection + // go ahead and create a new one and set it with an empty array, so we don't + // have to type check it later down-the-line + if (!self.events.hasOwnProperty(event)) { + self.events[event] = []; + } + + // We know we've got an array for this event, so push our callback in there with no fuss + self.events[event].push(callback); + return true; + } + + /** + * If the passed event has callbacks attached to it, loop through each one + * and call it + * + * @param {string} event + * @param {object} [data={}] + * @returns {boolean} + * @memberof PubSub + */ + publish(event, data = {}) { + let self = this; + if (store.state.DEBUG) console.log("published event: ", event); + + // There's no event to publish to, so bail out + if (!self.events.hasOwnProperty(event)) { + if (store.state.DEBUG) console.log(`no subscribers for event ${event}`); + self.events[event] = []; + return false; + } + + // Get each subscription and call its callback with the passed data + self.events[event].map((callback) => callback(data)); + return true; + } +} diff --git a/nereid/nereid/static/frontend/src/js/lib/state.js b/nereid/nereid/static/frontend/src/js/lib/state.js new file mode 100644 index 00000000..380a81ab --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/state.js @@ -0,0 +1,94 @@ +import Store from "./store.js"; + +const state = { + DEBUG: false, + config: {}, + scenario_name: "New Scenario", + nereid_host: "", + nereid_api_latest: "/api/v1", + nereid_state: "state", + nereid_region: "region", + facility_types: [], + facility_type_map: {}, + initialScale: 1 << 20, + initialCenter: [-116.9337, 32.74337], + staged_changes: {}, + default_nodesize: 20, + max_graph_size: 100, + map_mode: true, + show_states: true, + graph_edit_mode: true, + show_info_tooltip: true, + treatment_facility_fields: { + state: { + region: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: ["facility_type"], + }, + }, + ca: { + cosd: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: [ + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + }, + soc: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: ["facility_type"], + }, + }, + }, + node_types: { + land_surface: { + title: "Land Surface", + color: "limegreen", + }, + treatment_facility: { + title: "Treatment Facility", + color: "steelblue", + }, + treatment_site: { + title: "Treatment Site", + color: "orangered", + disabled: true, + }, + none: { + title: "None", + color: "dimgrey", + }, + }, + default_graph: { + nodes: [ + { + id: "0", + node_type: "treatment_facility", + }, + { + id: "1", + node_type: "land_surface", + }, + ], + edges: [{ source: "1", target: "0" }], + }, +}; + +export default new Store({ + // actions, + // mutations, + state, +}); diff --git a/nereid/nereid/static/frontend/src/js/lib/store.js b/nereid/nereid/static/frontend/src/js/lib/store.js new file mode 100644 index 00000000..c77d1c96 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/store.js @@ -0,0 +1,138 @@ +import PubSub from "./pubsub.js"; +import store from "./state.js"; + +export default class Store { + constructor(params) { + let self = this; + + // Add some default objects to hold our actions, mutations and state + self.actions = {}; + self.mutations = {}; + self.state = {}; + + // A status enum to set during actions and mutations + self.status = "resting"; + + // Attach our PubSub module as an `events` element + self.events = new PubSub(); + + // Look in the passed params object for actions and mutations + // that might have been passed in + // if (params.hasOwnProperty("actions")) { + // self.actions = params.actions; + // } + + // if (params.hasOwnProperty("mutations")) { + // self.mutations = params.mutations; + // } + + // Set our state to be a Proxy. We are setting the default state by + // checking the params and defaulting to an empty object if no default + // state is passed in + self.state = new Proxy(params.state || {}, { + set: function (state, key, value) { + // console.log("status:", self.status); + // Set the value as we would normally + state[key] = value; + + // Trace out to the console. This will be grouped by the related action + if (store.state.DEBUG) console.log(`stateChange: ${key}`, value); + + // Give the user a little telling off if they set a value directly + if (self.status !== "mutation") { + if (store.state.DEBUG) + console.warn(`You should use a mutation to set ${key}`); + // Publish the change event for the components that are listening + self.events.publish("stateChange", self.state); + } + + // console.log(state); + + return true; + }, + }); + } + + /** + * A dispatcher for actions that looks in the actions + * collection and runs the action if it can find it + * + * @param {string} actionKey + * @param {mixed} payload + * @returns {boolean} + * @memberof Store + */ + dispatch(actionKey, payload) { + let self = this; + + // console.log("status:", self.status); + + // Run a quick check to see if the action actually exists + // before we try to run it + if (typeof self.actions[actionKey] !== "function") { + if (store.state.DEBUG) console.log(`Action "${actionKey} doesn't exist.`); + // return false; + self.actions[actionKey] = (context, payload) => { + context.commit(actionKey, payload); + }; + } + + // Create a console group which will contain the logs from our Proxy etc + if (store.state.DEBUG) console.groupCollapsed(`ACTION: ${actionKey}`); + + // Let anything that's watching the status know that we're dispatching an action + self.status = "action"; + + // Actually call the action and pass it the Store context and whatever payload was passed + self.actions[actionKey](self, payload); + + // Close our console group to keep things nice and neat + if (store.state.DEBUG) console.groupEnd(); + + return true; + } + + /** + * Look for a mutation and modify the state object + * if that mutation exists by calling it + * + * @param {string} mutationKey + * @param {mixed} payload + * @returns {boolean} + * @memberof Store + */ + commit(mutationKey, payload) { + let self = this; + // console.log("status:", self.status); + + // Run a quick check to see if this mutation actually exists + // before trying to run it + if (typeof self.mutations[mutationKey] !== "function") { + if (store.state.DEBUG) + console.log(`Mutation "${mutationKey}" doesn't exist`); + // return false; + + self.mutations[mutationKey] = (_, payload) => payload; + } + + // Let anything that's watching the status know that we're mutating state + self.status = "mutation"; + + // Get a new version of the state by running the mutation and storing the result of it + let newState = self.mutations[mutationKey](self.state, payload); + + // Merge the old and new together to create a new state and set it + self.state = Object.assign(self.state, newState); + + // Publish the change event for the components that are listening + self.events.publish("stateChange", self.state); + + // Publish the mutation event for the components that are listening + self.events.publish(mutationKey, self.state); + + // Reset the status ready for the next operation + self.status = "resting"; + + return true; + } +} diff --git a/nereid/nereid/static/frontend/src/js/lib/util.js b/nereid/nereid/static/frontend/src/js/lib/util.js new file mode 100644 index 00000000..cc5682fb --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/util.js @@ -0,0 +1,209 @@ +import store from "./state.js"; +import { getConfig } from "./nereid-api.js"; + +export const get = (object, path = "") => + path.split(".").reduce((o, x) => (o == undefined ? o : o[x]), object); + +export const getTruthy = (obj, path = "") => { + let m = get(obj, path); + return m === undefined ? false : m; +}; + +// https://stackoverflow.com/a/1349426/7486933 +export function randomString(length) { + let result = ""; + let characters = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + let charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +} + +export const filter = (obj, includes = [], excludes = []) => { + const filtered = Object.keys(obj) + .filter((key) => (includes.length ? includes.includes(key) : true)) + .filter((key) => !excludes.includes(key)) + .reduce((newobj, key) => { + return { + ...newobj, + [key]: obj[key], + }; + }, {}); + return filtered; +}; + +export function cleanObject(obj) { + return Object.entries(obj) + .filter(([_, v]) => v != "" && v != null) + .reduce( + (acc, [k, v]) => ({ ...acc, [k]: v === Object(v) ? cleanObject(v) : v }), + {} + ); +} + +export function deepCopy(object) { + return JSON.parse(JSON.stringify(object)); +} + +export function mean(array) { + return array.length + ? array.reduce((a, b) => a + b) / array.length + : undefined; +} + +export function flatten(a) { + return Array.isArray(a) ? [].concat(...a.map(flatten)) : a; +} + +export const incr_waiting = () => { + let v = (get(store, "state.waiting") || 0) + 1; + store.dispatch("Waiting", { waiting: v }); +}; + +export const decr_waiting = () => { + let v = (get(store, "state.waiting") || 0) - 1; + if (v < 0) { + console.error("waiting counter is negative"); + v = 0; + } + store.dispatch("Waiting", { waiting: v }); +}; + +// fetch API wrappers for json retrieval + +export async function getJsonResponse(url) { + console.log("fetching with get", url); + incr_waiting(); + const response = await fetch(url, { method: "GET" }) + // .catch((error) => { + // alert(error); + // return {}; + // }) + .then((resp) => { + console.log("getJsonResponse response:", resp); + if (resp.status == 200) { + return resp.json(); + } else if (resp.status == 422) { + // unprocessable entity + // alert(`Unprocessable data from get ${resp.json()}`); + // console.warn(resp.json()); + return resp.json(); + } else { + throw new Error("got back " + resp.content); + } + }) + .then((data) => { + console.log("getJsonResponse data returned:", data); + return data; + }) + .finally(decr_waiting); + + return response; +} + +export async function postJsonResponse(url, data) { + console.log("fetching with post", url, data); + incr_waiting(); + + const response = await fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(data), + }) + .then((resp) => { + console.log("postJsonResponse response:", resp); + if (resp.status == 200) { + return resp.json(); + } else if (resp.status == 422) { + // alert(`Unprocessable data from post ${resp.json()}`); + return resp.json(); + } else { + throw new Error("got back " + resp); + } + }) + .then((data) => { + console.log("postJsonResponse data returned:", data); + return data; + }) + .finally(decr_waiting); + return response; +} + +export const poll = ({ fn, validate, interval, maxAttempts }) => { + console.log("Start poll..."); + let attempts = 0; + + const executePoll = async (resolve, reject) => { + console.log("- poll"); + const result = await fn(); + attempts++; + + if (validate(result)) { + return resolve(result); + } else if (maxAttempts && attempts === maxAttempts) { + return reject(new Error("Exceeded max attempts")); + } else { + setTimeout(executePoll, interval, resolve, reject); + } + }; + + return new Promise(executePoll); +}; + +export function convertArrayOfObjectsToCSV(args) { + var result, ctr, keys, columnDelimiter, lineDelimiter, data; + + data = args.data || null; + if (data == null || !data.length) { + return null; + } + + columnDelimiter = args.columnDelimiter || ","; + lineDelimiter = args.lineDelimiter || "\n"; + + keys = args.keys || Object.keys(data[0]); + + result = ""; + result += keys + .map((x) => (String(x).includes(",") ? `"${x}"` : `${x}`)) + .join(columnDelimiter); + result += lineDelimiter; + + data.forEach(function (item) { + ctr = 0; + keys.forEach(function (key) { + if (ctr > 0) result += columnDelimiter; + + const value = String(item[key]); + + if (value.includes(",")) { + result += `"${value}"`; + } else { + result += `${value}`; + } + ctr++; + }); + result += lineDelimiter; + }); + + return result; +} + +export const getConfigFromUrlQueryParams = async () => { + const params = new URLSearchParams(window.location.search); + + let { state, region } = Object.fromEntries(params.entries()); + + const cfg = await getConfig({ + nereid_state: state || store.state.nereid_state, + nereid_region: region || store.state.nereid_region, + }); + store.dispatch("updateConfig", cfg); + console.log(cfg); + + return false; +}; diff --git a/nereid/nereid/static/frontend/tailwind.config.js b/nereid/nereid/static/frontend/tailwind.config.js new file mode 100644 index 00000000..98094f98 --- /dev/null +++ b/nereid/nereid/static/frontend/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./src/**/*.html", "./src/**/*.js"], + theme: { + extend: { + translate: { + double: "200%", + triple: "300%", + quad: "400%", + pent: "500%", + sext: "600%", + sept: "700%", + octa: "800%", + }, + }, + }, + plugins: [require("@tailwindcss/typography")], +}; diff --git a/nereid/nereid/static/frontend/vite.config.js b/nereid/nereid/static/frontend/vite.config.js new file mode 100644 index 00000000..7dc4cf45 --- /dev/null +++ b/nereid/nereid/static/frontend/vite.config.js @@ -0,0 +1,22 @@ +import { defineConfig, splitVendorChunkPlugin } from "vite"; +// import nodePolyfills from "rollup-plugin-polyfill-node"; +import analyze from "rollup-plugin-analyzer"; + +export default defineConfig({ + // plugins: [react()], + root: "src", + base: "/app", // makes assets relative rather than absolute + plugins: [splitVendorChunkPlugin()], + build: { + outDir: "../dist", + emptyOutDir: true, + rollupOptions: { + plugins: [ + // Enable rollup polyfills plugin + // used during production bundling + // nodePolyfills({ include: null }), + // analyze({ limit: 20 }), + ], + }, + }, +});