Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +16 -0
- README.md +12 -5
- __init__.py +0 -0
- __pycache__/__init__.cpython-310.pyc +0 -0
- __pycache__/app.cpython-310.pyc +0 -0
- app.py +46 -0
- css.css +157 -0
- requirements.txt +1 -0
- space.py +162 -0
- src/.gitignore +9 -0
- src/README.md +311 -0
- src/backend/gradio_promptweighting/__init__.py +4 -0
- src/backend/gradio_promptweighting/promptweighting.py +111 -0
- src/backend/gradio_promptweighting/promptweighting.pyi +238 -0
- src/backend/gradio_promptweighting/templates/component/index.js +3772 -0
- src/backend/gradio_promptweighting/templates/component/style.css +1 -0
- src/backend/gradio_promptweighting/templates/example/index.js +115 -0
- src/backend/gradio_promptweighting/templates/example/style.css +1 -0
- src/demo/__init__.py +0 -0
- src/demo/app.py +46 -0
- src/demo/css.css +157 -0
- src/demo/space.py +162 -0
- src/frontend/Example.svelte +46 -0
- src/frontend/Index.svelte +97 -0
- src/frontend/lib/Icons/Cross.svelte +15 -0
- src/frontend/lib/Icons/Minus.svelte +15 -0
- src/frontend/lib/Icons/Plus.svelte +15 -0
- src/frontend/lib/Icons/Undo.svelte +15 -0
- src/frontend/lib/Icons/UpDown.svelte +15 -0
- src/frontend/lib/Icons/UpDownLeftRight.svelte +15 -0
- src/frontend/lib/PrompstList.svelte +100 -0
- src/frontend/lib/Prompt.svelte +221 -0
- src/frontend/lib/constants.ts +0 -0
- src/frontend/lib/store.ts +3 -0
- src/frontend/package-lock.json +1096 -0
- src/frontend/package.json +26 -0
- src/frontend/types.ts +6 -0
- src/pyproject.toml +42 -0
Dockerfile
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
COPY --link --chown=1000 . .
|
7 |
+
|
8 |
+
RUN mkdir -p /tmp/cache/
|
9 |
+
RUN chmod a+rwx -R /tmp/cache/
|
10 |
+
ENV TRANSFORMERS_CACHE=/tmp/cache/
|
11 |
+
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
|
15 |
+
|
16 |
+
CMD ["python", "space.py"]
|
README.md
CHANGED
@@ -1,10 +1,17 @@
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
---
|
3 |
+
tags: [gradio-custom-component,diffusion model,UI,text-to-image,prompt weighting,editor]
|
4 |
+
title: gradio_promptweighting V0.0.1
|
5 |
+
colorFrom: gray
|
6 |
+
colorTo: indigo
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
+
license: apache-2.0
|
10 |
---
|
11 |
|
12 |
+
|
13 |
+
# Name: gradio_promptweighting
|
14 |
+
|
15 |
+
Description: Simple component for creating prompt weighting for real-time generation.
|
16 |
+
|
17 |
+
Install with: pip install gradio_promptweighting
|
__init__.py
ADDED
File without changes
|
__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (176 Bytes). View file
|
|
__pycache__/app.cpython-310.pyc
ADDED
Binary file (1.1 kB). View file
|
|
app.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_promptweighting import PromptWeighting
|
3 |
+
|
4 |
+
|
5 |
+
example = PromptWeighting().example_value()
|
6 |
+
|
7 |
+
|
8 |
+
def predict(input):
|
9 |
+
return (input, input)
|
10 |
+
|
11 |
+
|
12 |
+
with gr.Blocks() as demo:
|
13 |
+
with gr.Row():
|
14 |
+
with gr.Column():
|
15 |
+
prompt = PromptWeighting(
|
16 |
+
value=[
|
17 |
+
{"prompt": "a cat", "scale": 1.5},
|
18 |
+
{"prompt": "a dog", "scale": 1},
|
19 |
+
{"prompt": "a bird", "scale": 0.5},
|
20 |
+
],
|
21 |
+
step=0.001,
|
22 |
+
info="Please drag up or down to adjust the weight of the prompt.",
|
23 |
+
)
|
24 |
+
btn = gr.Button("Update Prompt")
|
25 |
+
with gr.Column():
|
26 |
+
text = gr.Textbox(
|
27 |
+
label="Prompt",
|
28 |
+
placeholder="",
|
29 |
+
)
|
30 |
+
prompt2 = PromptWeighting(min=0, max=10, step=0.001)
|
31 |
+
inputs = [prompt]
|
32 |
+
outputs = [text, prompt2]
|
33 |
+
|
34 |
+
btn.click(fn=predict, inputs=inputs, outputs=outputs, show_progress=False)
|
35 |
+
prompt.change(
|
36 |
+
fn=predict,
|
37 |
+
inputs=inputs,
|
38 |
+
outputs=outputs,
|
39 |
+
queue=False,
|
40 |
+
trigger_mode="always_last",
|
41 |
+
show_progress=False,
|
42 |
+
)
|
43 |
+
|
44 |
+
|
45 |
+
if __name__ == "__main__":
|
46 |
+
demo.launch()
|
css.css
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
html {
|
2 |
+
font-family: Inter;
|
3 |
+
font-size: 16px;
|
4 |
+
font-weight: 400;
|
5 |
+
line-height: 1.5;
|
6 |
+
-webkit-text-size-adjust: 100%;
|
7 |
+
background: #fff;
|
8 |
+
color: #323232;
|
9 |
+
-webkit-font-smoothing: antialiased;
|
10 |
+
-moz-osx-font-smoothing: grayscale;
|
11 |
+
text-rendering: optimizeLegibility;
|
12 |
+
}
|
13 |
+
|
14 |
+
:root {
|
15 |
+
--space: 1;
|
16 |
+
--vspace: calc(var(--space) * 1rem);
|
17 |
+
--vspace-0: calc(3 * var(--space) * 1rem);
|
18 |
+
--vspace-1: calc(2 * var(--space) * 1rem);
|
19 |
+
--vspace-2: calc(1.5 * var(--space) * 1rem);
|
20 |
+
--vspace-3: calc(0.5 * var(--space) * 1rem);
|
21 |
+
}
|
22 |
+
|
23 |
+
.app {
|
24 |
+
max-width: 748px !important;
|
25 |
+
}
|
26 |
+
|
27 |
+
.prose p {
|
28 |
+
margin: var(--vspace) 0;
|
29 |
+
line-height: var(--vspace * 2);
|
30 |
+
font-size: 1rem;
|
31 |
+
}
|
32 |
+
|
33 |
+
code {
|
34 |
+
font-family: "Inconsolata", sans-serif;
|
35 |
+
font-size: 16px;
|
36 |
+
}
|
37 |
+
|
38 |
+
h1,
|
39 |
+
h1 code {
|
40 |
+
font-weight: 400;
|
41 |
+
line-height: calc(2.5 / var(--space) * var(--vspace));
|
42 |
+
}
|
43 |
+
|
44 |
+
h1 code {
|
45 |
+
background: none;
|
46 |
+
border: none;
|
47 |
+
letter-spacing: 0.05em;
|
48 |
+
padding-bottom: 5px;
|
49 |
+
position: relative;
|
50 |
+
padding: 0;
|
51 |
+
}
|
52 |
+
|
53 |
+
h2 {
|
54 |
+
margin: var(--vspace-1) 0 var(--vspace-2) 0;
|
55 |
+
line-height: 1em;
|
56 |
+
}
|
57 |
+
|
58 |
+
h3,
|
59 |
+
h3 code {
|
60 |
+
margin: var(--vspace-1) 0 var(--vspace-2) 0;
|
61 |
+
line-height: 1em;
|
62 |
+
}
|
63 |
+
|
64 |
+
h4,
|
65 |
+
h5,
|
66 |
+
h6 {
|
67 |
+
margin: var(--vspace-3) 0 var(--vspace-3) 0;
|
68 |
+
line-height: var(--vspace);
|
69 |
+
}
|
70 |
+
|
71 |
+
.bigtitle,
|
72 |
+
h1,
|
73 |
+
h1 code {
|
74 |
+
font-size: calc(8px * 4.5);
|
75 |
+
word-break: break-word;
|
76 |
+
}
|
77 |
+
|
78 |
+
.title,
|
79 |
+
h2,
|
80 |
+
h2 code {
|
81 |
+
font-size: calc(8px * 3.375);
|
82 |
+
font-weight: lighter;
|
83 |
+
word-break: break-word;
|
84 |
+
border: none;
|
85 |
+
background: none;
|
86 |
+
}
|
87 |
+
|
88 |
+
.subheading1,
|
89 |
+
h3,
|
90 |
+
h3 code {
|
91 |
+
font-size: calc(8px * 1.8);
|
92 |
+
font-weight: 600;
|
93 |
+
border: none;
|
94 |
+
background: none;
|
95 |
+
letter-spacing: 0.1em;
|
96 |
+
text-transform: uppercase;
|
97 |
+
}
|
98 |
+
|
99 |
+
h2 code {
|
100 |
+
padding: 0;
|
101 |
+
position: relative;
|
102 |
+
letter-spacing: 0.05em;
|
103 |
+
}
|
104 |
+
|
105 |
+
blockquote {
|
106 |
+
font-size: calc(8px * 1.1667);
|
107 |
+
font-style: italic;
|
108 |
+
line-height: calc(1.1667 * var(--vspace));
|
109 |
+
margin: var(--vspace-2) var(--vspace-2);
|
110 |
+
}
|
111 |
+
|
112 |
+
.subheading2,
|
113 |
+
h4 {
|
114 |
+
font-size: calc(8px * 1.4292);
|
115 |
+
text-transform: uppercase;
|
116 |
+
font-weight: 600;
|
117 |
+
}
|
118 |
+
|
119 |
+
.subheading3,
|
120 |
+
h5 {
|
121 |
+
font-size: calc(8px * 1.2917);
|
122 |
+
line-height: calc(1.2917 * var(--vspace));
|
123 |
+
|
124 |
+
font-weight: lighter;
|
125 |
+
text-transform: uppercase;
|
126 |
+
letter-spacing: 0.15em;
|
127 |
+
}
|
128 |
+
|
129 |
+
h6 {
|
130 |
+
font-size: calc(8px * 1.1667);
|
131 |
+
font-size: 1.1667em;
|
132 |
+
font-weight: normal;
|
133 |
+
font-style: italic;
|
134 |
+
font-family: "le-monde-livre-classic-byol", serif !important;
|
135 |
+
letter-spacing: 0px !important;
|
136 |
+
}
|
137 |
+
|
138 |
+
#start .md > *:first-child {
|
139 |
+
margin-top: 0;
|
140 |
+
}
|
141 |
+
|
142 |
+
h2 + h3 {
|
143 |
+
margin-top: 0;
|
144 |
+
}
|
145 |
+
|
146 |
+
.md hr {
|
147 |
+
border: none;
|
148 |
+
border-top: 1px solid var(--block-border-color);
|
149 |
+
margin: var(--vspace-2) 0 var(--vspace-2) 0;
|
150 |
+
}
|
151 |
+
.prose ul {
|
152 |
+
margin: var(--vspace-2) 0 var(--vspace-1) 0;
|
153 |
+
}
|
154 |
+
|
155 |
+
.gap {
|
156 |
+
gap: 0;
|
157 |
+
}
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio_promptweighting==0.0.1
|
space.py
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from app import demo as app
|
4 |
+
import os
|
5 |
+
|
6 |
+
_docs = {'PromptWeighting': {'description': 'Creates a very simple textbox for user to enter string input or display string output.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
|
7 |
+
|
8 |
+
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
+
|
10 |
+
with gr.Blocks(
|
11 |
+
css=abs_path,
|
12 |
+
theme=gr.themes.Default(
|
13 |
+
font_mono=[
|
14 |
+
gr.themes.GoogleFont("Inconsolata"),
|
15 |
+
"monospace",
|
16 |
+
],
|
17 |
+
),
|
18 |
+
) as demo:
|
19 |
+
gr.Markdown(
|
20 |
+
"""
|
21 |
+
# `gradio_promptweighting`
|
22 |
+
|
23 |
+
<div style="display: flex; gap: 7px;">
|
24 |
+
<img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
|
25 |
+
</div>
|
26 |
+
|
27 |
+
Simple component for creating prompt weighting for real-time generation.
|
28 |
+
""", elem_classes=["md-custom"], header_links=True)
|
29 |
+
app.render()
|
30 |
+
gr.Markdown(
|
31 |
+
"""
|
32 |
+
## Installation
|
33 |
+
|
34 |
+
```bash
|
35 |
+
pip install gradio_promptweighting
|
36 |
+
```
|
37 |
+
|
38 |
+
## Usage
|
39 |
+
|
40 |
+
```python
|
41 |
+
import gradio as gr
|
42 |
+
from gradio_promptweighting import PromptWeighting
|
43 |
+
|
44 |
+
|
45 |
+
example = PromptWeighting().example_value()
|
46 |
+
|
47 |
+
|
48 |
+
def predict(input):
|
49 |
+
return (input, input)
|
50 |
+
|
51 |
+
|
52 |
+
with gr.Blocks() as demo:
|
53 |
+
with gr.Row():
|
54 |
+
with gr.Column():
|
55 |
+
prompt = PromptWeighting(
|
56 |
+
value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
|
57 |
+
)
|
58 |
+
btn = gr.Button("Update Prompt")
|
59 |
+
with gr.Column():
|
60 |
+
text = gr.Textbox(
|
61 |
+
label="Prompt",
|
62 |
+
placeholder="",
|
63 |
+
)
|
64 |
+
prompt2 = PromptWeighting(min=0, max=10, step=0.001)
|
65 |
+
inputs = [prompt]
|
66 |
+
outputs = [text, prompt2]
|
67 |
+
|
68 |
+
btn.click(fn=predict, inputs=inputs, outputs=outputs, show_progress=False)
|
69 |
+
prompt.change(
|
70 |
+
fn=predict,
|
71 |
+
inputs=inputs,
|
72 |
+
outputs=outputs,
|
73 |
+
queue=False,
|
74 |
+
trigger_mode="always_last",
|
75 |
+
show_progress=False,
|
76 |
+
)
|
77 |
+
|
78 |
+
|
79 |
+
if __name__ == "__main__":
|
80 |
+
demo.launch()
|
81 |
+
|
82 |
+
```
|
83 |
+
""", elem_classes=["md-custom"], header_links=True)
|
84 |
+
|
85 |
+
|
86 |
+
gr.Markdown("""
|
87 |
+
## `PromptWeighting`
|
88 |
+
|
89 |
+
### Initialization
|
90 |
+
""", elem_classes=["md-custom"], header_links=True)
|
91 |
+
|
92 |
+
gr.ParamViewer(value=_docs["PromptWeighting"]["members"]["__init__"], linkify=[])
|
93 |
+
|
94 |
+
|
95 |
+
gr.Markdown("### Events")
|
96 |
+
gr.ParamViewer(value=_docs["PromptWeighting"]["events"], linkify=['Event'])
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
gr.Markdown("""
|
102 |
+
|
103 |
+
### User function
|
104 |
+
|
105 |
+
The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
|
106 |
+
|
107 |
+
- When used as an Input, the component only impacts the input signature of the user function.
|
108 |
+
- When used as an output, the component only impacts the return signature of the user function.
|
109 |
+
|
110 |
+
The code snippet below is accurate in cases where the component is used as both an input and an output.
|
111 |
+
|
112 |
+
- **As input:** Is passed, passes text value as a {str} into the function.
|
113 |
+
- **As output:** Should return, expects a {str} returned from function and sets textarea value to it.
|
114 |
+
|
115 |
+
```python
|
116 |
+
def predict(
|
117 |
+
value: str | None
|
118 |
+
) -> str | None:
|
119 |
+
return value
|
120 |
+
```
|
121 |
+
""", elem_classes=["md-custom", "PromptWeighting-user-fn"], header_links=True)
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
demo.load(None, js=r"""function() {
|
127 |
+
const refs = {};
|
128 |
+
const user_fn_refs = {
|
129 |
+
PromptWeighting: [], };
|
130 |
+
requestAnimationFrame(() => {
|
131 |
+
|
132 |
+
Object.entries(user_fn_refs).forEach(([key, refs]) => {
|
133 |
+
if (refs.length > 0) {
|
134 |
+
const el = document.querySelector(`.${key}-user-fn`);
|
135 |
+
if (!el) return;
|
136 |
+
refs.forEach(ref => {
|
137 |
+
el.innerHTML = el.innerHTML.replace(
|
138 |
+
new RegExp("\\b"+ref+"\\b", "g"),
|
139 |
+
`<a href="#h-${ref.toLowerCase()}">${ref}</a>`
|
140 |
+
);
|
141 |
+
})
|
142 |
+
}
|
143 |
+
})
|
144 |
+
|
145 |
+
Object.entries(refs).forEach(([key, refs]) => {
|
146 |
+
if (refs.length > 0) {
|
147 |
+
const el = document.querySelector(`.${key}`);
|
148 |
+
if (!el) return;
|
149 |
+
refs.forEach(ref => {
|
150 |
+
el.innerHTML = el.innerHTML.replace(
|
151 |
+
new RegExp("\\b"+ref+"\\b", "g"),
|
152 |
+
`<a href="#h-${ref.toLowerCase()}">${ref}</a>`
|
153 |
+
);
|
154 |
+
})
|
155 |
+
}
|
156 |
+
})
|
157 |
+
})
|
158 |
+
}
|
159 |
+
|
160 |
+
""")
|
161 |
+
|
162 |
+
demo.launch()
|
src/.gitignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.eggs/
|
2 |
+
dist/
|
3 |
+
*.pyc
|
4 |
+
__pycache__/
|
5 |
+
*.py[cod]
|
6 |
+
*$py.class
|
7 |
+
__tmp/*
|
8 |
+
*.pyi
|
9 |
+
node_modules
|
src/README.md
ADDED
@@ -0,0 +1,311 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# `gradio_promptweighting`
|
3 |
+
<img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
|
4 |
+
|
5 |
+
Simple component for creating prompt weighting for real-time generation.
|
6 |
+
|
7 |
+
## Installation
|
8 |
+
|
9 |
+
```bash
|
10 |
+
pip install gradio_promptweighting
|
11 |
+
```
|
12 |
+
|
13 |
+
## Usage
|
14 |
+
|
15 |
+
```python
|
16 |
+
import gradio as gr
|
17 |
+
from gradio_promptweighting import PromptWeighting
|
18 |
+
|
19 |
+
|
20 |
+
example = PromptWeighting().example_value()
|
21 |
+
|
22 |
+
|
23 |
+
def predict(input):
|
24 |
+
return (input, input)
|
25 |
+
|
26 |
+
|
27 |
+
with gr.Blocks() as demo:
|
28 |
+
with gr.Row():
|
29 |
+
with gr.Column():
|
30 |
+
prompt = PromptWeighting(
|
31 |
+
value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
|
32 |
+
)
|
33 |
+
btn = gr.Button("Update Prompt")
|
34 |
+
with gr.Column():
|
35 |
+
text = gr.Textbox(
|
36 |
+
label="Prompt",
|
37 |
+
placeholder="",
|
38 |
+
)
|
39 |
+
prompt2 = PromptWeighting(min=0, max=10, step=0.001)
|
40 |
+
inputs = [prompt]
|
41 |
+
outputs = [text, prompt2]
|
42 |
+
|
43 |
+
btn.click(fn=predict, inputs=inputs, outputs=outputs, show_progress=False)
|
44 |
+
prompt.change(
|
45 |
+
fn=predict,
|
46 |
+
inputs=inputs,
|
47 |
+
outputs=outputs,
|
48 |
+
queue=False,
|
49 |
+
trigger_mode="always_last",
|
50 |
+
show_progress=False,
|
51 |
+
)
|
52 |
+
|
53 |
+
|
54 |
+
if __name__ == "__main__":
|
55 |
+
demo.launch()
|
56 |
+
|
57 |
+
```
|
58 |
+
|
59 |
+
## `PromptWeighting`
|
60 |
+
|
61 |
+
### Initialization
|
62 |
+
|
63 |
+
<table>
|
64 |
+
<thead>
|
65 |
+
<tr>
|
66 |
+
<th align="left">name</th>
|
67 |
+
<th align="left" style="width: 25%;">type</th>
|
68 |
+
<th align="left">default</th>
|
69 |
+
<th align="left">description</th>
|
70 |
+
</tr>
|
71 |
+
</thead>
|
72 |
+
<tbody>
|
73 |
+
<tr>
|
74 |
+
<td align="left"><code>value</code></td>
|
75 |
+
<td align="left" style="width: 25%;">
|
76 |
+
|
77 |
+
```python
|
78 |
+
str | dict | list | Callable | None
|
79 |
+
```
|
80 |
+
|
81 |
+
</td>
|
82 |
+
<td align="left"><code>None</code></td>
|
83 |
+
<td align="left">default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.</td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
<tr>
|
87 |
+
<td align="left"><code>placeholder</code></td>
|
88 |
+
<td align="left" style="width: 25%;">
|
89 |
+
|
90 |
+
```python
|
91 |
+
str | None
|
92 |
+
```
|
93 |
+
|
94 |
+
</td>
|
95 |
+
<td align="left"><code>None</code></td>
|
96 |
+
<td align="left">placeholder hint to provide behind textbox.</td>
|
97 |
+
</tr>
|
98 |
+
|
99 |
+
<tr>
|
100 |
+
<td align="left"><code>label</code></td>
|
101 |
+
<td align="left" style="width: 25%;">
|
102 |
+
|
103 |
+
```python
|
104 |
+
str | None
|
105 |
+
```
|
106 |
+
|
107 |
+
</td>
|
108 |
+
<td align="left"><code>None</code></td>
|
109 |
+
<td align="left">component name in interface.</td>
|
110 |
+
</tr>
|
111 |
+
|
112 |
+
<tr>
|
113 |
+
<td align="left"><code>every</code></td>
|
114 |
+
<td align="left" style="width: 25%;">
|
115 |
+
|
116 |
+
```python
|
117 |
+
float | None
|
118 |
+
```
|
119 |
+
|
120 |
+
</td>
|
121 |
+
<td align="left"><code>None</code></td>
|
122 |
+
<td align="left">If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.</td>
|
123 |
+
</tr>
|
124 |
+
|
125 |
+
<tr>
|
126 |
+
<td align="left"><code>show_label</code></td>
|
127 |
+
<td align="left" style="width: 25%;">
|
128 |
+
|
129 |
+
```python
|
130 |
+
bool | None
|
131 |
+
```
|
132 |
+
|
133 |
+
</td>
|
134 |
+
<td align="left"><code>None</code></td>
|
135 |
+
<td align="left">if True, will display label.</td>
|
136 |
+
</tr>
|
137 |
+
|
138 |
+
<tr>
|
139 |
+
<td align="left"><code>scale</code></td>
|
140 |
+
<td align="left" style="width: 25%;">
|
141 |
+
|
142 |
+
```python
|
143 |
+
int | None
|
144 |
+
```
|
145 |
+
|
146 |
+
</td>
|
147 |
+
<td align="left"><code>None</code></td>
|
148 |
+
<td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
|
149 |
+
</tr>
|
150 |
+
|
151 |
+
<tr>
|
152 |
+
<td align="left"><code>min_width</code></td>
|
153 |
+
<td align="left" style="width: 25%;">
|
154 |
+
|
155 |
+
```python
|
156 |
+
int
|
157 |
+
```
|
158 |
+
|
159 |
+
</td>
|
160 |
+
<td align="left"><code>160</code></td>
|
161 |
+
<td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
|
162 |
+
</tr>
|
163 |
+
|
164 |
+
<tr>
|
165 |
+
<td align="left"><code>interactive</code></td>
|
166 |
+
<td align="left" style="width: 25%;">
|
167 |
+
|
168 |
+
```python
|
169 |
+
bool | None
|
170 |
+
```
|
171 |
+
|
172 |
+
</td>
|
173 |
+
<td align="left"><code>None</code></td>
|
174 |
+
<td align="left">if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>
|
175 |
+
</tr>
|
176 |
+
|
177 |
+
<tr>
|
178 |
+
<td align="left"><code>visible</code></td>
|
179 |
+
<td align="left" style="width: 25%;">
|
180 |
+
|
181 |
+
```python
|
182 |
+
bool
|
183 |
+
```
|
184 |
+
|
185 |
+
</td>
|
186 |
+
<td align="left"><code>True</code></td>
|
187 |
+
<td align="left">If False, component will be hidden.</td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<tr>
|
191 |
+
<td align="left"><code>rtl</code></td>
|
192 |
+
<td align="left" style="width: 25%;">
|
193 |
+
|
194 |
+
```python
|
195 |
+
bool
|
196 |
+
```
|
197 |
+
|
198 |
+
</td>
|
199 |
+
<td align="left"><code>False</code></td>
|
200 |
+
<td align="left">If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.</td>
|
201 |
+
</tr>
|
202 |
+
|
203 |
+
<tr>
|
204 |
+
<td align="left"><code>elem_id</code></td>
|
205 |
+
<td align="left" style="width: 25%;">
|
206 |
+
|
207 |
+
```python
|
208 |
+
str | None
|
209 |
+
```
|
210 |
+
|
211 |
+
</td>
|
212 |
+
<td align="left"><code>None</code></td>
|
213 |
+
<td align="left">An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
|
214 |
+
</tr>
|
215 |
+
|
216 |
+
<tr>
|
217 |
+
<td align="left"><code>elem_classes</code></td>
|
218 |
+
<td align="left" style="width: 25%;">
|
219 |
+
|
220 |
+
```python
|
221 |
+
list[str] | str | None
|
222 |
+
```
|
223 |
+
|
224 |
+
</td>
|
225 |
+
<td align="left"><code>None</code></td>
|
226 |
+
<td align="left">An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
|
227 |
+
</tr>
|
228 |
+
|
229 |
+
<tr>
|
230 |
+
<td align="left"><code>render</code></td>
|
231 |
+
<td align="left" style="width: 25%;">
|
232 |
+
|
233 |
+
```python
|
234 |
+
bool
|
235 |
+
```
|
236 |
+
|
237 |
+
</td>
|
238 |
+
<td align="left"><code>True</code></td>
|
239 |
+
<td align="left">If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
|
240 |
+
</tr>
|
241 |
+
|
242 |
+
<tr>
|
243 |
+
<td align="left"><code>min</code></td>
|
244 |
+
<td align="left" style="width: 25%;">
|
245 |
+
|
246 |
+
```python
|
247 |
+
float | None
|
248 |
+
```
|
249 |
+
|
250 |
+
</td>
|
251 |
+
<td align="left"><code>None</code></td>
|
252 |
+
<td align="left">None</td>
|
253 |
+
</tr>
|
254 |
+
|
255 |
+
<tr>
|
256 |
+
<td align="left"><code>max</code></td>
|
257 |
+
<td align="left" style="width: 25%;">
|
258 |
+
|
259 |
+
```python
|
260 |
+
float | None
|
261 |
+
```
|
262 |
+
|
263 |
+
</td>
|
264 |
+
<td align="left"><code>None</code></td>
|
265 |
+
<td align="left">None</td>
|
266 |
+
</tr>
|
267 |
+
|
268 |
+
<tr>
|
269 |
+
<td align="left"><code>step</code></td>
|
270 |
+
<td align="left" style="width: 25%;">
|
271 |
+
|
272 |
+
```python
|
273 |
+
float | None
|
274 |
+
```
|
275 |
+
|
276 |
+
</td>
|
277 |
+
<td align="left"><code>None</code></td>
|
278 |
+
<td align="left">None</td>
|
279 |
+
</tr>
|
280 |
+
</tbody></table>
|
281 |
+
|
282 |
+
|
283 |
+
### Events
|
284 |
+
|
285 |
+
| name | description |
|
286 |
+
|:-----|:------------|
|
287 |
+
| `change` | Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input. |
|
288 |
+
| `input` | This listener is triggered when the user changes the value of the PromptWeighting. |
|
289 |
+
| `submit` | This listener is triggered when the user presses the Enter key while the PromptWeighting is focused. |
|
290 |
+
|
291 |
+
|
292 |
+
|
293 |
+
### User function
|
294 |
+
|
295 |
+
The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
|
296 |
+
|
297 |
+
- When used as an Input, the component only impacts the input signature of the user function.
|
298 |
+
- When used as an output, the component only impacts the return signature of the user function.
|
299 |
+
|
300 |
+
The code snippet below is accurate in cases where the component is used as both an input and an output.
|
301 |
+
|
302 |
+
- **As output:** Is passed, passes text value as a {str} into the function.
|
303 |
+
- **As input:** Should return, expects a {str} returned from function and sets textarea value to it.
|
304 |
+
|
305 |
+
```python
|
306 |
+
def predict(
|
307 |
+
value: str | None
|
308 |
+
) -> str | None:
|
309 |
+
return value
|
310 |
+
```
|
311 |
+
|
src/backend/gradio_promptweighting/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from .promptweighting import PromptWeighting
|
3 |
+
|
4 |
+
__all__ = ['PromptWeighting']
|
src/backend/gradio_promptweighting/promptweighting.py
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
from typing import Any, Callable
|
4 |
+
|
5 |
+
from gradio.components.base import FormComponent
|
6 |
+
from gradio.events import Events
|
7 |
+
import json
|
8 |
+
|
9 |
+
|
10 |
+
class PromptWeighting(FormComponent):
|
11 |
+
"""
|
12 |
+
Enables multi text input with a vertical drag to adjust the weight of each prompt.
|
13 |
+
"""
|
14 |
+
|
15 |
+
EVENTS = [
|
16 |
+
Events.change,
|
17 |
+
Events.input,
|
18 |
+
Events.submit,
|
19 |
+
]
|
20 |
+
|
21 |
+
def __init__(
|
22 |
+
self,
|
23 |
+
value: str | dict | list | Callable | None = None,
|
24 |
+
*,
|
25 |
+
placeholder: str | None = None,
|
26 |
+
label: str | None = None,
|
27 |
+
every: float | None = None,
|
28 |
+
show_label: bool | None = None,
|
29 |
+
info: str | None = None,
|
30 |
+
scale: int | None = None,
|
31 |
+
min_width: int = 160,
|
32 |
+
interactive: bool | None = None,
|
33 |
+
visible: bool = True,
|
34 |
+
rtl: bool = False,
|
35 |
+
elem_id: str | None = None,
|
36 |
+
elem_classes: list[str] | str | None = None,
|
37 |
+
render: bool = True,
|
38 |
+
min: float | None = None,
|
39 |
+
max: float | None = None,
|
40 |
+
step: float | None = None,
|
41 |
+
):
|
42 |
+
"""
|
43 |
+
Parameters:
|
44 |
+
value: default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
45 |
+
placeholder: placeholder hint to provide behind textbox.
|
46 |
+
label: component name in interface.
|
47 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
48 |
+
show_label: if True, will display label.
|
49 |
+
scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
|
50 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
51 |
+
interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
|
52 |
+
visible: If False, component will be hidden.
|
53 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
54 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
55 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
56 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
57 |
+
"""
|
58 |
+
self.placeholder = placeholder
|
59 |
+
self.rtl = rtl
|
60 |
+
self.min = min
|
61 |
+
self.max = max
|
62 |
+
self.step = step
|
63 |
+
super().__init__(
|
64 |
+
label=label,
|
65 |
+
info=info,
|
66 |
+
every=every,
|
67 |
+
show_label=show_label,
|
68 |
+
scale=scale,
|
69 |
+
min_width=min_width,
|
70 |
+
interactive=interactive,
|
71 |
+
visible=visible,
|
72 |
+
elem_id=elem_id,
|
73 |
+
elem_classes=elem_classes,
|
74 |
+
value=value,
|
75 |
+
render=render,
|
76 |
+
)
|
77 |
+
|
78 |
+
def preprocess(self, payload: str | None) -> str | None:
|
79 |
+
"""
|
80 |
+
Parameters:
|
81 |
+
payload: the text entered in the textarea.
|
82 |
+
Returns:
|
83 |
+
Passes text value as a {str} into the function.
|
84 |
+
"""
|
85 |
+
return payload
|
86 |
+
|
87 |
+
def postprocess(self, value: str | None) -> str | None:
|
88 |
+
"""
|
89 |
+
Parameters:
|
90 |
+
value: Expects a {str} returned from function and sets textarea value to it.
|
91 |
+
Returns:
|
92 |
+
The value to display in the textarea.
|
93 |
+
"""
|
94 |
+
if value is None:
|
95 |
+
return None
|
96 |
+
if isinstance(value, str):
|
97 |
+
return json.loads(value)
|
98 |
+
else:
|
99 |
+
return value
|
100 |
+
|
101 |
+
def api_info(self) -> dict[str, Any]:
|
102 |
+
return {"type": "string"}
|
103 |
+
|
104 |
+
def example_payload(self) -> Any:
|
105 |
+
return {"foo": "bar"}
|
106 |
+
|
107 |
+
def example_value(self) -> Any:
|
108 |
+
return {"foo": "bar"}
|
109 |
+
|
110 |
+
def api_info(self) -> dict[str, Any]:
|
111 |
+
return {"type": {}, "description": "any valid json"}
|
src/backend/gradio_promptweighting/promptweighting.pyi
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
from typing import Any, Callable
|
4 |
+
|
5 |
+
from gradio.components.base import FormComponent
|
6 |
+
from gradio.events import Events
|
7 |
+
|
8 |
+
from gradio.events import Dependency
|
9 |
+
|
10 |
+
class PromptWeighting(FormComponent):
|
11 |
+
"""
|
12 |
+
Enables multi text input with a vertical drag to adjust the weight of each prompt.
|
13 |
+
"""
|
14 |
+
|
15 |
+
EVENTS = [
|
16 |
+
Events.change,
|
17 |
+
Events.input,
|
18 |
+
Events.submit,
|
19 |
+
]
|
20 |
+
|
21 |
+
def __init__(
|
22 |
+
self,
|
23 |
+
value: str | dict | list | Callable | None = None,
|
24 |
+
*,
|
25 |
+
placeholder: str | None = None,
|
26 |
+
label: str | None = None,
|
27 |
+
every: float | None = None,
|
28 |
+
show_label: bool | None = None,
|
29 |
+
info: str | None = None,
|
30 |
+
scale: int | None = None,
|
31 |
+
min_width: int = 160,
|
32 |
+
interactive: bool | None = None,
|
33 |
+
visible: bool = True,
|
34 |
+
rtl: bool = False,
|
35 |
+
elem_id: str | None = None,
|
36 |
+
elem_classes: list[str] | str | None = None,
|
37 |
+
render: bool = True,
|
38 |
+
min: float | None = None,
|
39 |
+
max: float | None = None,
|
40 |
+
step: float | None = None,
|
41 |
+
):
|
42 |
+
"""
|
43 |
+
Parameters:
|
44 |
+
value: default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
45 |
+
placeholder: placeholder hint to provide behind textbox.
|
46 |
+
label: component name in interface.
|
47 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
48 |
+
show_label: if True, will display label.
|
49 |
+
scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
|
50 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
51 |
+
interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
|
52 |
+
visible: If False, component will be hidden.
|
53 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
54 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
55 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
56 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
57 |
+
"""
|
58 |
+
self.placeholder = placeholder
|
59 |
+
self.rtl = rtl
|
60 |
+
self.min = min
|
61 |
+
self.max = max
|
62 |
+
self.step = step
|
63 |
+
super().__init__(
|
64 |
+
label=label,
|
65 |
+
info=info,
|
66 |
+
every=every,
|
67 |
+
show_label=show_label,
|
68 |
+
scale=scale,
|
69 |
+
min_width=min_width,
|
70 |
+
interactive=interactive,
|
71 |
+
visible=visible,
|
72 |
+
elem_id=elem_id,
|
73 |
+
elem_classes=elem_classes,
|
74 |
+
value=value,
|
75 |
+
render=render,
|
76 |
+
)
|
77 |
+
|
78 |
+
def preprocess(self, payload: str | None) -> str | None:
|
79 |
+
"""
|
80 |
+
Parameters:
|
81 |
+
payload: the text entered in the textarea.
|
82 |
+
Returns:
|
83 |
+
Passes text value as a {str} into the function.
|
84 |
+
"""
|
85 |
+
return payload
|
86 |
+
|
87 |
+
def postprocess(self, value: str | None) -> str | None:
|
88 |
+
"""
|
89 |
+
Parameters:
|
90 |
+
value: Expects a {str} returned from function and sets textarea value to it.
|
91 |
+
Returns:
|
92 |
+
The value to display in the textarea.
|
93 |
+
"""
|
94 |
+
if value is None:
|
95 |
+
return None
|
96 |
+
if isinstance(value, str):
|
97 |
+
return json.loads(value)
|
98 |
+
else:
|
99 |
+
return value
|
100 |
+
|
101 |
+
def api_info(self) -> dict[str, Any]:
|
102 |
+
return {"type": "string"}
|
103 |
+
|
104 |
+
def example_payload(self) -> Any:
|
105 |
+
return {"foo": "bar"}
|
106 |
+
|
107 |
+
def example_value(self) -> Any:
|
108 |
+
return {"foo": "bar"}
|
109 |
+
|
110 |
+
def api_info(self) -> dict[str, Any]:
|
111 |
+
return {"type": {}, "description": "any valid json"}
|
112 |
+
|
113 |
+
|
114 |
+
def change(self,
|
115 |
+
fn: Callable | None,
|
116 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
117 |
+
outputs: Component | Sequence[Component] | None = None,
|
118 |
+
api_name: str | None | Literal[False] = None,
|
119 |
+
scroll_to_output: bool = False,
|
120 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
121 |
+
queue: bool | None = None,
|
122 |
+
batch: bool = False,
|
123 |
+
max_batch_size: int = 4,
|
124 |
+
preprocess: bool = True,
|
125 |
+
postprocess: bool = True,
|
126 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
127 |
+
every: float | None = None,
|
128 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
129 |
+
js: str | None = None,
|
130 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
131 |
+
concurrency_id: str | None = None,
|
132 |
+
show_api: bool = True) -> Dependency:
|
133 |
+
"""
|
134 |
+
Parameters:
|
135 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
136 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
137 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
138 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
139 |
+
scroll_to_output: If True, will scroll to output component on completion
|
140 |
+
show_progress: If True, will show progress animation while pending
|
141 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
142 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
143 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
144 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
145 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
146 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
147 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
148 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
149 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
150 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
151 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
152 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
153 |
+
"""
|
154 |
+
...
|
155 |
+
|
156 |
+
def input(self,
|
157 |
+
fn: Callable | None,
|
158 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
159 |
+
outputs: Component | Sequence[Component] | None = None,
|
160 |
+
api_name: str | None | Literal[False] = None,
|
161 |
+
scroll_to_output: bool = False,
|
162 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
163 |
+
queue: bool | None = None,
|
164 |
+
batch: bool = False,
|
165 |
+
max_batch_size: int = 4,
|
166 |
+
preprocess: bool = True,
|
167 |
+
postprocess: bool = True,
|
168 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
169 |
+
every: float | None = None,
|
170 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
171 |
+
js: str | None = None,
|
172 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
173 |
+
concurrency_id: str | None = None,
|
174 |
+
show_api: bool = True) -> Dependency:
|
175 |
+
"""
|
176 |
+
Parameters:
|
177 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
178 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
179 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
180 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
181 |
+
scroll_to_output: If True, will scroll to output component on completion
|
182 |
+
show_progress: If True, will show progress animation while pending
|
183 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
184 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
185 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
186 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
187 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
188 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
189 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
190 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
191 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
192 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
193 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
194 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
195 |
+
"""
|
196 |
+
...
|
197 |
+
|
198 |
+
def submit(self,
|
199 |
+
fn: Callable | None,
|
200 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
201 |
+
outputs: Component | Sequence[Component] | None = None,
|
202 |
+
api_name: str | None | Literal[False] = None,
|
203 |
+
scroll_to_output: bool = False,
|
204 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
205 |
+
queue: bool | None = None,
|
206 |
+
batch: bool = False,
|
207 |
+
max_batch_size: int = 4,
|
208 |
+
preprocess: bool = True,
|
209 |
+
postprocess: bool = True,
|
210 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
211 |
+
every: float | None = None,
|
212 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
213 |
+
js: str | None = None,
|
214 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
215 |
+
concurrency_id: str | None = None,
|
216 |
+
show_api: bool = True) -> Dependency:
|
217 |
+
"""
|
218 |
+
Parameters:
|
219 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
220 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
221 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
222 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
223 |
+
scroll_to_output: If True, will scroll to output component on completion
|
224 |
+
show_progress: If True, will show progress animation while pending
|
225 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
226 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
227 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
228 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
229 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
230 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
231 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds.
|
232 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.
|
233 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
234 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
235 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
236 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
237 |
+
"""
|
238 |
+
...
|
src/backend/gradio_promptweighting/templates/component/index.js
ADDED
@@ -0,0 +1,3772 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const on = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
2 |
+
let fn = (e = 21) => {
|
3 |
+
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
4 |
+
for (; e--; )
|
5 |
+
t += on[n[e] & 63];
|
6 |
+
return t;
|
7 |
+
};
|
8 |
+
const {
|
9 |
+
SvelteComponent: an,
|
10 |
+
assign: un,
|
11 |
+
create_slot: cn,
|
12 |
+
detach: _n,
|
13 |
+
element: dn,
|
14 |
+
get_all_dirty_from_scope: mn,
|
15 |
+
get_slot_changes: hn,
|
16 |
+
get_spread_update: pn,
|
17 |
+
init: gn,
|
18 |
+
insert: bn,
|
19 |
+
safe_not_equal: wn,
|
20 |
+
set_dynamic_element_data: Ge,
|
21 |
+
set_style: z,
|
22 |
+
toggle_class: K,
|
23 |
+
transition_in: zt,
|
24 |
+
transition_out: Bt,
|
25 |
+
update_slot_base: vn
|
26 |
+
} = window.__gradio__svelte__internal;
|
27 |
+
function yn(e) {
|
28 |
+
let t, n, l;
|
29 |
+
const i = (
|
30 |
+
/*#slots*/
|
31 |
+
e[18].default
|
32 |
+
), s = cn(
|
33 |
+
i,
|
34 |
+
e,
|
35 |
+
/*$$scope*/
|
36 |
+
e[17],
|
37 |
+
null
|
38 |
+
);
|
39 |
+
let f = [
|
40 |
+
{ "data-testid": (
|
41 |
+
/*test_id*/
|
42 |
+
e[7]
|
43 |
+
) },
|
44 |
+
{ id: (
|
45 |
+
/*elem_id*/
|
46 |
+
e[2]
|
47 |
+
) },
|
48 |
+
{
|
49 |
+
class: n = "block " + /*elem_classes*/
|
50 |
+
e[3].join(" ") + " svelte-nl1om8"
|
51 |
+
}
|
52 |
+
], r = {};
|
53 |
+
for (let o = 0; o < f.length; o += 1)
|
54 |
+
r = un(r, f[o]);
|
55 |
+
return {
|
56 |
+
c() {
|
57 |
+
t = dn(
|
58 |
+
/*tag*/
|
59 |
+
e[14]
|
60 |
+
), s && s.c(), Ge(
|
61 |
+
/*tag*/
|
62 |
+
e[14]
|
63 |
+
)(t, r), K(
|
64 |
+
t,
|
65 |
+
"hidden",
|
66 |
+
/*visible*/
|
67 |
+
e[10] === !1
|
68 |
+
), K(
|
69 |
+
t,
|
70 |
+
"padded",
|
71 |
+
/*padding*/
|
72 |
+
e[6]
|
73 |
+
), K(
|
74 |
+
t,
|
75 |
+
"border_focus",
|
76 |
+
/*border_mode*/
|
77 |
+
e[5] === "focus"
|
78 |
+
), K(
|
79 |
+
t,
|
80 |
+
"border_contrast",
|
81 |
+
/*border_mode*/
|
82 |
+
e[5] === "contrast"
|
83 |
+
), K(t, "hide-container", !/*explicit_call*/
|
84 |
+
e[8] && !/*container*/
|
85 |
+
e[9]), z(
|
86 |
+
t,
|
87 |
+
"height",
|
88 |
+
/*get_dimension*/
|
89 |
+
e[15](
|
90 |
+
/*height*/
|
91 |
+
e[0]
|
92 |
+
)
|
93 |
+
), z(t, "width", typeof /*width*/
|
94 |
+
e[1] == "number" ? `calc(min(${/*width*/
|
95 |
+
e[1]}px, 100%))` : (
|
96 |
+
/*get_dimension*/
|
97 |
+
e[15](
|
98 |
+
/*width*/
|
99 |
+
e[1]
|
100 |
+
)
|
101 |
+
)), z(
|
102 |
+
t,
|
103 |
+
"border-style",
|
104 |
+
/*variant*/
|
105 |
+
e[4]
|
106 |
+
), z(
|
107 |
+
t,
|
108 |
+
"overflow",
|
109 |
+
/*allow_overflow*/
|
110 |
+
e[11] ? "visible" : "hidden"
|
111 |
+
), z(
|
112 |
+
t,
|
113 |
+
"flex-grow",
|
114 |
+
/*scale*/
|
115 |
+
e[12]
|
116 |
+
), z(t, "min-width", `calc(min(${/*min_width*/
|
117 |
+
e[13]}px, 100%))`), z(t, "border-width", "var(--block-border-width)");
|
118 |
+
},
|
119 |
+
m(o, a) {
|
120 |
+
bn(o, t, a), s && s.m(t, null), l = !0;
|
121 |
+
},
|
122 |
+
p(o, a) {
|
123 |
+
s && s.p && (!l || a & /*$$scope*/
|
124 |
+
131072) && vn(
|
125 |
+
s,
|
126 |
+
i,
|
127 |
+
o,
|
128 |
+
/*$$scope*/
|
129 |
+
o[17],
|
130 |
+
l ? hn(
|
131 |
+
i,
|
132 |
+
/*$$scope*/
|
133 |
+
o[17],
|
134 |
+
a,
|
135 |
+
null
|
136 |
+
) : mn(
|
137 |
+
/*$$scope*/
|
138 |
+
o[17]
|
139 |
+
),
|
140 |
+
null
|
141 |
+
), Ge(
|
142 |
+
/*tag*/
|
143 |
+
o[14]
|
144 |
+
)(t, r = pn(f, [
|
145 |
+
(!l || a & /*test_id*/
|
146 |
+
128) && { "data-testid": (
|
147 |
+
/*test_id*/
|
148 |
+
o[7]
|
149 |
+
) },
|
150 |
+
(!l || a & /*elem_id*/
|
151 |
+
4) && { id: (
|
152 |
+
/*elem_id*/
|
153 |
+
o[2]
|
154 |
+
) },
|
155 |
+
(!l || a & /*elem_classes*/
|
156 |
+
8 && n !== (n = "block " + /*elem_classes*/
|
157 |
+
o[3].join(" ") + " svelte-nl1om8")) && { class: n }
|
158 |
+
])), K(
|
159 |
+
t,
|
160 |
+
"hidden",
|
161 |
+
/*visible*/
|
162 |
+
o[10] === !1
|
163 |
+
), K(
|
164 |
+
t,
|
165 |
+
"padded",
|
166 |
+
/*padding*/
|
167 |
+
o[6]
|
168 |
+
), K(
|
169 |
+
t,
|
170 |
+
"border_focus",
|
171 |
+
/*border_mode*/
|
172 |
+
o[5] === "focus"
|
173 |
+
), K(
|
174 |
+
t,
|
175 |
+
"border_contrast",
|
176 |
+
/*border_mode*/
|
177 |
+
o[5] === "contrast"
|
178 |
+
), K(t, "hide-container", !/*explicit_call*/
|
179 |
+
o[8] && !/*container*/
|
180 |
+
o[9]), a & /*height*/
|
181 |
+
1 && z(
|
182 |
+
t,
|
183 |
+
"height",
|
184 |
+
/*get_dimension*/
|
185 |
+
o[15](
|
186 |
+
/*height*/
|
187 |
+
o[0]
|
188 |
+
)
|
189 |
+
), a & /*width*/
|
190 |
+
2 && z(t, "width", typeof /*width*/
|
191 |
+
o[1] == "number" ? `calc(min(${/*width*/
|
192 |
+
o[1]}px, 100%))` : (
|
193 |
+
/*get_dimension*/
|
194 |
+
o[15](
|
195 |
+
/*width*/
|
196 |
+
o[1]
|
197 |
+
)
|
198 |
+
)), a & /*variant*/
|
199 |
+
16 && z(
|
200 |
+
t,
|
201 |
+
"border-style",
|
202 |
+
/*variant*/
|
203 |
+
o[4]
|
204 |
+
), a & /*allow_overflow*/
|
205 |
+
2048 && z(
|
206 |
+
t,
|
207 |
+
"overflow",
|
208 |
+
/*allow_overflow*/
|
209 |
+
o[11] ? "visible" : "hidden"
|
210 |
+
), a & /*scale*/
|
211 |
+
4096 && z(
|
212 |
+
t,
|
213 |
+
"flex-grow",
|
214 |
+
/*scale*/
|
215 |
+
o[12]
|
216 |
+
), a & /*min_width*/
|
217 |
+
8192 && z(t, "min-width", `calc(min(${/*min_width*/
|
218 |
+
o[13]}px, 100%))`);
|
219 |
+
},
|
220 |
+
i(o) {
|
221 |
+
l || (zt(s, o), l = !0);
|
222 |
+
},
|
223 |
+
o(o) {
|
224 |
+
Bt(s, o), l = !1;
|
225 |
+
},
|
226 |
+
d(o) {
|
227 |
+
o && _n(t), s && s.d(o);
|
228 |
+
}
|
229 |
+
};
|
230 |
+
}
|
231 |
+
function kn(e) {
|
232 |
+
let t, n = (
|
233 |
+
/*tag*/
|
234 |
+
e[14] && yn(e)
|
235 |
+
);
|
236 |
+
return {
|
237 |
+
c() {
|
238 |
+
n && n.c();
|
239 |
+
},
|
240 |
+
m(l, i) {
|
241 |
+
n && n.m(l, i), t = !0;
|
242 |
+
},
|
243 |
+
p(l, [i]) {
|
244 |
+
/*tag*/
|
245 |
+
l[14] && n.p(l, i);
|
246 |
+
},
|
247 |
+
i(l) {
|
248 |
+
t || (zt(n, l), t = !0);
|
249 |
+
},
|
250 |
+
o(l) {
|
251 |
+
Bt(n, l), t = !1;
|
252 |
+
},
|
253 |
+
d(l) {
|
254 |
+
n && n.d(l);
|
255 |
+
}
|
256 |
+
};
|
257 |
+
}
|
258 |
+
function Cn(e, t, n) {
|
259 |
+
let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: f = void 0 } = t, { elem_id: r = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: u = "base" } = t, { padding: m = !0 } = t, { type: h = "normal" } = t, { test_id: d = void 0 } = t, { explicit_call: p = !1 } = t, { container: b = !0 } = t, { visible: v = !0 } = t, { allow_overflow: w = !0 } = t, { scale: k = null } = t, { min_width: g = 0 } = t, _ = h === "fieldset" ? "fieldset" : "div";
|
260 |
+
const C = (c) => {
|
261 |
+
if (c !== void 0) {
|
262 |
+
if (typeof c == "number")
|
263 |
+
return c + "px";
|
264 |
+
if (typeof c == "string")
|
265 |
+
return c;
|
266 |
+
}
|
267 |
+
};
|
268 |
+
return e.$$set = (c) => {
|
269 |
+
"height" in c && n(0, s = c.height), "width" in c && n(1, f = c.width), "elem_id" in c && n(2, r = c.elem_id), "elem_classes" in c && n(3, o = c.elem_classes), "variant" in c && n(4, a = c.variant), "border_mode" in c && n(5, u = c.border_mode), "padding" in c && n(6, m = c.padding), "type" in c && n(16, h = c.type), "test_id" in c && n(7, d = c.test_id), "explicit_call" in c && n(8, p = c.explicit_call), "container" in c && n(9, b = c.container), "visible" in c && n(10, v = c.visible), "allow_overflow" in c && n(11, w = c.allow_overflow), "scale" in c && n(12, k = c.scale), "min_width" in c && n(13, g = c.min_width), "$$scope" in c && n(17, i = c.$$scope);
|
270 |
+
}, [
|
271 |
+
s,
|
272 |
+
f,
|
273 |
+
r,
|
274 |
+
o,
|
275 |
+
a,
|
276 |
+
u,
|
277 |
+
m,
|
278 |
+
d,
|
279 |
+
p,
|
280 |
+
b,
|
281 |
+
v,
|
282 |
+
w,
|
283 |
+
k,
|
284 |
+
g,
|
285 |
+
_,
|
286 |
+
C,
|
287 |
+
h,
|
288 |
+
i,
|
289 |
+
l
|
290 |
+
];
|
291 |
+
}
|
292 |
+
class An extends an {
|
293 |
+
constructor(t) {
|
294 |
+
super(), gn(this, t, Cn, kn, wn, {
|
295 |
+
height: 0,
|
296 |
+
width: 1,
|
297 |
+
elem_id: 2,
|
298 |
+
elem_classes: 3,
|
299 |
+
variant: 4,
|
300 |
+
border_mode: 5,
|
301 |
+
padding: 6,
|
302 |
+
type: 16,
|
303 |
+
test_id: 7,
|
304 |
+
explicit_call: 8,
|
305 |
+
container: 9,
|
306 |
+
visible: 10,
|
307 |
+
allow_overflow: 11,
|
308 |
+
scale: 12,
|
309 |
+
min_width: 13
|
310 |
+
});
|
311 |
+
}
|
312 |
+
}
|
313 |
+
const {
|
314 |
+
SvelteComponent: Sn,
|
315 |
+
attr: Nn,
|
316 |
+
create_slot: Ln,
|
317 |
+
detach: En,
|
318 |
+
element: qn,
|
319 |
+
get_all_dirty_from_scope: Fn,
|
320 |
+
get_slot_changes: Mn,
|
321 |
+
init: Pn,
|
322 |
+
insert: Vn,
|
323 |
+
safe_not_equal: Tn,
|
324 |
+
transition_in: zn,
|
325 |
+
transition_out: Bn,
|
326 |
+
update_slot_base: Dn
|
327 |
+
} = window.__gradio__svelte__internal;
|
328 |
+
function Rn(e) {
|
329 |
+
let t, n;
|
330 |
+
const l = (
|
331 |
+
/*#slots*/
|
332 |
+
e[1].default
|
333 |
+
), i = Ln(
|
334 |
+
l,
|
335 |
+
e,
|
336 |
+
/*$$scope*/
|
337 |
+
e[0],
|
338 |
+
null
|
339 |
+
);
|
340 |
+
return {
|
341 |
+
c() {
|
342 |
+
t = qn("div"), i && i.c(), Nn(t, "class", "svelte-1hnfib2");
|
343 |
+
},
|
344 |
+
m(s, f) {
|
345 |
+
Vn(s, t, f), i && i.m(t, null), n = !0;
|
346 |
+
},
|
347 |
+
p(s, [f]) {
|
348 |
+
i && i.p && (!n || f & /*$$scope*/
|
349 |
+
1) && Dn(
|
350 |
+
i,
|
351 |
+
l,
|
352 |
+
s,
|
353 |
+
/*$$scope*/
|
354 |
+
s[0],
|
355 |
+
n ? Mn(
|
356 |
+
l,
|
357 |
+
/*$$scope*/
|
358 |
+
s[0],
|
359 |
+
f,
|
360 |
+
null
|
361 |
+
) : Fn(
|
362 |
+
/*$$scope*/
|
363 |
+
s[0]
|
364 |
+
),
|
365 |
+
null
|
366 |
+
);
|
367 |
+
},
|
368 |
+
i(s) {
|
369 |
+
n || (zn(i, s), n = !0);
|
370 |
+
},
|
371 |
+
o(s) {
|
372 |
+
Bn(i, s), n = !1;
|
373 |
+
},
|
374 |
+
d(s) {
|
375 |
+
s && En(t), i && i.d(s);
|
376 |
+
}
|
377 |
+
};
|
378 |
+
}
|
379 |
+
function In(e, t, n) {
|
380 |
+
let { $$slots: l = {}, $$scope: i } = t;
|
381 |
+
return e.$$set = (s) => {
|
382 |
+
"$$scope" in s && n(0, i = s.$$scope);
|
383 |
+
}, [i, l];
|
384 |
+
}
|
385 |
+
class On extends Sn {
|
386 |
+
constructor(t) {
|
387 |
+
super(), Pn(this, t, In, Rn, Tn, {});
|
388 |
+
}
|
389 |
+
}
|
390 |
+
const {
|
391 |
+
SvelteComponent: Un,
|
392 |
+
attr: We,
|
393 |
+
check_outros: Zn,
|
394 |
+
create_component: Hn,
|
395 |
+
create_slot: Xn,
|
396 |
+
destroy_component: Yn,
|
397 |
+
detach: Le,
|
398 |
+
element: Kn,
|
399 |
+
empty: Gn,
|
400 |
+
get_all_dirty_from_scope: Wn,
|
401 |
+
get_slot_changes: Jn,
|
402 |
+
group_outros: Qn,
|
403 |
+
init: jn,
|
404 |
+
insert: Ee,
|
405 |
+
mount_component: xn,
|
406 |
+
safe_not_equal: $n,
|
407 |
+
set_data: el,
|
408 |
+
space: tl,
|
409 |
+
text: nl,
|
410 |
+
toggle_class: ie,
|
411 |
+
transition_in: ge,
|
412 |
+
transition_out: qe,
|
413 |
+
update_slot_base: ll
|
414 |
+
} = window.__gradio__svelte__internal;
|
415 |
+
function Je(e) {
|
416 |
+
let t, n;
|
417 |
+
return t = new On({
|
418 |
+
props: {
|
419 |
+
$$slots: { default: [il] },
|
420 |
+
$$scope: { ctx: e }
|
421 |
+
}
|
422 |
+
}), {
|
423 |
+
c() {
|
424 |
+
Hn(t.$$.fragment);
|
425 |
+
},
|
426 |
+
m(l, i) {
|
427 |
+
xn(t, l, i), n = !0;
|
428 |
+
},
|
429 |
+
p(l, i) {
|
430 |
+
const s = {};
|
431 |
+
i & /*$$scope, info*/
|
432 |
+
10 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
|
433 |
+
},
|
434 |
+
i(l) {
|
435 |
+
n || (ge(t.$$.fragment, l), n = !0);
|
436 |
+
},
|
437 |
+
o(l) {
|
438 |
+
qe(t.$$.fragment, l), n = !1;
|
439 |
+
},
|
440 |
+
d(l) {
|
441 |
+
Yn(t, l);
|
442 |
+
}
|
443 |
+
};
|
444 |
+
}
|
445 |
+
function il(e) {
|
446 |
+
let t;
|
447 |
+
return {
|
448 |
+
c() {
|
449 |
+
t = nl(
|
450 |
+
/*info*/
|
451 |
+
e[1]
|
452 |
+
);
|
453 |
+
},
|
454 |
+
m(n, l) {
|
455 |
+
Ee(n, t, l);
|
456 |
+
},
|
457 |
+
p(n, l) {
|
458 |
+
l & /*info*/
|
459 |
+
2 && el(
|
460 |
+
t,
|
461 |
+
/*info*/
|
462 |
+
n[1]
|
463 |
+
);
|
464 |
+
},
|
465 |
+
d(n) {
|
466 |
+
n && Le(t);
|
467 |
+
}
|
468 |
+
};
|
469 |
+
}
|
470 |
+
function sl(e) {
|
471 |
+
let t, n, l, i;
|
472 |
+
const s = (
|
473 |
+
/*#slots*/
|
474 |
+
e[2].default
|
475 |
+
), f = Xn(
|
476 |
+
s,
|
477 |
+
e,
|
478 |
+
/*$$scope*/
|
479 |
+
e[3],
|
480 |
+
null
|
481 |
+
);
|
482 |
+
let r = (
|
483 |
+
/*info*/
|
484 |
+
e[1] && Je(e)
|
485 |
+
);
|
486 |
+
return {
|
487 |
+
c() {
|
488 |
+
t = Kn("span"), f && f.c(), n = tl(), r && r.c(), l = Gn(), We(t, "data-testid", "block-info"), We(t, "class", "svelte-22c38v"), ie(t, "sr-only", !/*show_label*/
|
489 |
+
e[0]), ie(t, "hide", !/*show_label*/
|
490 |
+
e[0]), ie(
|
491 |
+
t,
|
492 |
+
"has-info",
|
493 |
+
/*info*/
|
494 |
+
e[1] != null
|
495 |
+
);
|
496 |
+
},
|
497 |
+
m(o, a) {
|
498 |
+
Ee(o, t, a), f && f.m(t, null), Ee(o, n, a), r && r.m(o, a), Ee(o, l, a), i = !0;
|
499 |
+
},
|
500 |
+
p(o, [a]) {
|
501 |
+
f && f.p && (!i || a & /*$$scope*/
|
502 |
+
8) && ll(
|
503 |
+
f,
|
504 |
+
s,
|
505 |
+
o,
|
506 |
+
/*$$scope*/
|
507 |
+
o[3],
|
508 |
+
i ? Jn(
|
509 |
+
s,
|
510 |
+
/*$$scope*/
|
511 |
+
o[3],
|
512 |
+
a,
|
513 |
+
null
|
514 |
+
) : Wn(
|
515 |
+
/*$$scope*/
|
516 |
+
o[3]
|
517 |
+
),
|
518 |
+
null
|
519 |
+
), (!i || a & /*show_label*/
|
520 |
+
1) && ie(t, "sr-only", !/*show_label*/
|
521 |
+
o[0]), (!i || a & /*show_label*/
|
522 |
+
1) && ie(t, "hide", !/*show_label*/
|
523 |
+
o[0]), (!i || a & /*info*/
|
524 |
+
2) && ie(
|
525 |
+
t,
|
526 |
+
"has-info",
|
527 |
+
/*info*/
|
528 |
+
o[1] != null
|
529 |
+
), /*info*/
|
530 |
+
o[1] ? r ? (r.p(o, a), a & /*info*/
|
531 |
+
2 && ge(r, 1)) : (r = Je(o), r.c(), ge(r, 1), r.m(l.parentNode, l)) : r && (Qn(), qe(r, 1, 1, () => {
|
532 |
+
r = null;
|
533 |
+
}), Zn());
|
534 |
+
},
|
535 |
+
i(o) {
|
536 |
+
i || (ge(f, o), ge(r), i = !0);
|
537 |
+
},
|
538 |
+
o(o) {
|
539 |
+
qe(f, o), qe(r), i = !1;
|
540 |
+
},
|
541 |
+
d(o) {
|
542 |
+
o && (Le(t), Le(n), Le(l)), f && f.d(o), r && r.d(o);
|
543 |
+
}
|
544 |
+
};
|
545 |
+
}
|
546 |
+
function rl(e, t, n) {
|
547 |
+
let { $$slots: l = {}, $$scope: i } = t, { show_label: s = !0 } = t, { info: f = void 0 } = t;
|
548 |
+
return e.$$set = (r) => {
|
549 |
+
"show_label" in r && n(0, s = r.show_label), "info" in r && n(1, f = r.info), "$$scope" in r && n(3, i = r.$$scope);
|
550 |
+
}, [s, f, l, i];
|
551 |
+
}
|
552 |
+
class ol extends Un {
|
553 |
+
constructor(t) {
|
554 |
+
super(), jn(this, t, rl, sl, $n, { show_label: 0, info: 1 });
|
555 |
+
}
|
556 |
+
}
|
557 |
+
const fl = [
|
558 |
+
{ color: "red", primary: 600, secondary: 100 },
|
559 |
+
{ color: "green", primary: 600, secondary: 100 },
|
560 |
+
{ color: "blue", primary: 600, secondary: 100 },
|
561 |
+
{ color: "yellow", primary: 500, secondary: 100 },
|
562 |
+
{ color: "purple", primary: 600, secondary: 100 },
|
563 |
+
{ color: "teal", primary: 600, secondary: 100 },
|
564 |
+
{ color: "orange", primary: 600, secondary: 100 },
|
565 |
+
{ color: "cyan", primary: 600, secondary: 100 },
|
566 |
+
{ color: "lime", primary: 500, secondary: 100 },
|
567 |
+
{ color: "pink", primary: 600, secondary: 100 }
|
568 |
+
], Qe = {
|
569 |
+
inherit: "inherit",
|
570 |
+
current: "currentColor",
|
571 |
+
transparent: "transparent",
|
572 |
+
black: "#000",
|
573 |
+
white: "#fff",
|
574 |
+
slate: {
|
575 |
+
50: "#f8fafc",
|
576 |
+
100: "#f1f5f9",
|
577 |
+
200: "#e2e8f0",
|
578 |
+
300: "#cbd5e1",
|
579 |
+
400: "#94a3b8",
|
580 |
+
500: "#64748b",
|
581 |
+
600: "#475569",
|
582 |
+
700: "#334155",
|
583 |
+
800: "#1e293b",
|
584 |
+
900: "#0f172a",
|
585 |
+
950: "#020617"
|
586 |
+
},
|
587 |
+
gray: {
|
588 |
+
50: "#f9fafb",
|
589 |
+
100: "#f3f4f6",
|
590 |
+
200: "#e5e7eb",
|
591 |
+
300: "#d1d5db",
|
592 |
+
400: "#9ca3af",
|
593 |
+
500: "#6b7280",
|
594 |
+
600: "#4b5563",
|
595 |
+
700: "#374151",
|
596 |
+
800: "#1f2937",
|
597 |
+
900: "#111827",
|
598 |
+
950: "#030712"
|
599 |
+
},
|
600 |
+
zinc: {
|
601 |
+
50: "#fafafa",
|
602 |
+
100: "#f4f4f5",
|
603 |
+
200: "#e4e4e7",
|
604 |
+
300: "#d4d4d8",
|
605 |
+
400: "#a1a1aa",
|
606 |
+
500: "#71717a",
|
607 |
+
600: "#52525b",
|
608 |
+
700: "#3f3f46",
|
609 |
+
800: "#27272a",
|
610 |
+
900: "#18181b",
|
611 |
+
950: "#09090b"
|
612 |
+
},
|
613 |
+
neutral: {
|
614 |
+
50: "#fafafa",
|
615 |
+
100: "#f5f5f5",
|
616 |
+
200: "#e5e5e5",
|
617 |
+
300: "#d4d4d4",
|
618 |
+
400: "#a3a3a3",
|
619 |
+
500: "#737373",
|
620 |
+
600: "#525252",
|
621 |
+
700: "#404040",
|
622 |
+
800: "#262626",
|
623 |
+
900: "#171717",
|
624 |
+
950: "#0a0a0a"
|
625 |
+
},
|
626 |
+
stone: {
|
627 |
+
50: "#fafaf9",
|
628 |
+
100: "#f5f5f4",
|
629 |
+
200: "#e7e5e4",
|
630 |
+
300: "#d6d3d1",
|
631 |
+
400: "#a8a29e",
|
632 |
+
500: "#78716c",
|
633 |
+
600: "#57534e",
|
634 |
+
700: "#44403c",
|
635 |
+
800: "#292524",
|
636 |
+
900: "#1c1917",
|
637 |
+
950: "#0c0a09"
|
638 |
+
},
|
639 |
+
red: {
|
640 |
+
50: "#fef2f2",
|
641 |
+
100: "#fee2e2",
|
642 |
+
200: "#fecaca",
|
643 |
+
300: "#fca5a5",
|
644 |
+
400: "#f87171",
|
645 |
+
500: "#ef4444",
|
646 |
+
600: "#dc2626",
|
647 |
+
700: "#b91c1c",
|
648 |
+
800: "#991b1b",
|
649 |
+
900: "#7f1d1d",
|
650 |
+
950: "#450a0a"
|
651 |
+
},
|
652 |
+
orange: {
|
653 |
+
50: "#fff7ed",
|
654 |
+
100: "#ffedd5",
|
655 |
+
200: "#fed7aa",
|
656 |
+
300: "#fdba74",
|
657 |
+
400: "#fb923c",
|
658 |
+
500: "#f97316",
|
659 |
+
600: "#ea580c",
|
660 |
+
700: "#c2410c",
|
661 |
+
800: "#9a3412",
|
662 |
+
900: "#7c2d12",
|
663 |
+
950: "#431407"
|
664 |
+
},
|
665 |
+
amber: {
|
666 |
+
50: "#fffbeb",
|
667 |
+
100: "#fef3c7",
|
668 |
+
200: "#fde68a",
|
669 |
+
300: "#fcd34d",
|
670 |
+
400: "#fbbf24",
|
671 |
+
500: "#f59e0b",
|
672 |
+
600: "#d97706",
|
673 |
+
700: "#b45309",
|
674 |
+
800: "#92400e",
|
675 |
+
900: "#78350f",
|
676 |
+
950: "#451a03"
|
677 |
+
},
|
678 |
+
yellow: {
|
679 |
+
50: "#fefce8",
|
680 |
+
100: "#fef9c3",
|
681 |
+
200: "#fef08a",
|
682 |
+
300: "#fde047",
|
683 |
+
400: "#facc15",
|
684 |
+
500: "#eab308",
|
685 |
+
600: "#ca8a04",
|
686 |
+
700: "#a16207",
|
687 |
+
800: "#854d0e",
|
688 |
+
900: "#713f12",
|
689 |
+
950: "#422006"
|
690 |
+
},
|
691 |
+
lime: {
|
692 |
+
50: "#f7fee7",
|
693 |
+
100: "#ecfccb",
|
694 |
+
200: "#d9f99d",
|
695 |
+
300: "#bef264",
|
696 |
+
400: "#a3e635",
|
697 |
+
500: "#84cc16",
|
698 |
+
600: "#65a30d",
|
699 |
+
700: "#4d7c0f",
|
700 |
+
800: "#3f6212",
|
701 |
+
900: "#365314",
|
702 |
+
950: "#1a2e05"
|
703 |
+
},
|
704 |
+
green: {
|
705 |
+
50: "#f0fdf4",
|
706 |
+
100: "#dcfce7",
|
707 |
+
200: "#bbf7d0",
|
708 |
+
300: "#86efac",
|
709 |
+
400: "#4ade80",
|
710 |
+
500: "#22c55e",
|
711 |
+
600: "#16a34a",
|
712 |
+
700: "#15803d",
|
713 |
+
800: "#166534",
|
714 |
+
900: "#14532d",
|
715 |
+
950: "#052e16"
|
716 |
+
},
|
717 |
+
emerald: {
|
718 |
+
50: "#ecfdf5",
|
719 |
+
100: "#d1fae5",
|
720 |
+
200: "#a7f3d0",
|
721 |
+
300: "#6ee7b7",
|
722 |
+
400: "#34d399",
|
723 |
+
500: "#10b981",
|
724 |
+
600: "#059669",
|
725 |
+
700: "#047857",
|
726 |
+
800: "#065f46",
|
727 |
+
900: "#064e3b",
|
728 |
+
950: "#022c22"
|
729 |
+
},
|
730 |
+
teal: {
|
731 |
+
50: "#f0fdfa",
|
732 |
+
100: "#ccfbf1",
|
733 |
+
200: "#99f6e4",
|
734 |
+
300: "#5eead4",
|
735 |
+
400: "#2dd4bf",
|
736 |
+
500: "#14b8a6",
|
737 |
+
600: "#0d9488",
|
738 |
+
700: "#0f766e",
|
739 |
+
800: "#115e59",
|
740 |
+
900: "#134e4a",
|
741 |
+
950: "#042f2e"
|
742 |
+
},
|
743 |
+
cyan: {
|
744 |
+
50: "#ecfeff",
|
745 |
+
100: "#cffafe",
|
746 |
+
200: "#a5f3fc",
|
747 |
+
300: "#67e8f9",
|
748 |
+
400: "#22d3ee",
|
749 |
+
500: "#06b6d4",
|
750 |
+
600: "#0891b2",
|
751 |
+
700: "#0e7490",
|
752 |
+
800: "#155e75",
|
753 |
+
900: "#164e63",
|
754 |
+
950: "#083344"
|
755 |
+
},
|
756 |
+
sky: {
|
757 |
+
50: "#f0f9ff",
|
758 |
+
100: "#e0f2fe",
|
759 |
+
200: "#bae6fd",
|
760 |
+
300: "#7dd3fc",
|
761 |
+
400: "#38bdf8",
|
762 |
+
500: "#0ea5e9",
|
763 |
+
600: "#0284c7",
|
764 |
+
700: "#0369a1",
|
765 |
+
800: "#075985",
|
766 |
+
900: "#0c4a6e",
|
767 |
+
950: "#082f49"
|
768 |
+
},
|
769 |
+
blue: {
|
770 |
+
50: "#eff6ff",
|
771 |
+
100: "#dbeafe",
|
772 |
+
200: "#bfdbfe",
|
773 |
+
300: "#93c5fd",
|
774 |
+
400: "#60a5fa",
|
775 |
+
500: "#3b82f6",
|
776 |
+
600: "#2563eb",
|
777 |
+
700: "#1d4ed8",
|
778 |
+
800: "#1e40af",
|
779 |
+
900: "#1e3a8a",
|
780 |
+
950: "#172554"
|
781 |
+
},
|
782 |
+
indigo: {
|
783 |
+
50: "#eef2ff",
|
784 |
+
100: "#e0e7ff",
|
785 |
+
200: "#c7d2fe",
|
786 |
+
300: "#a5b4fc",
|
787 |
+
400: "#818cf8",
|
788 |
+
500: "#6366f1",
|
789 |
+
600: "#4f46e5",
|
790 |
+
700: "#4338ca",
|
791 |
+
800: "#3730a3",
|
792 |
+
900: "#312e81",
|
793 |
+
950: "#1e1b4b"
|
794 |
+
},
|
795 |
+
violet: {
|
796 |
+
50: "#f5f3ff",
|
797 |
+
100: "#ede9fe",
|
798 |
+
200: "#ddd6fe",
|
799 |
+
300: "#c4b5fd",
|
800 |
+
400: "#a78bfa",
|
801 |
+
500: "#8b5cf6",
|
802 |
+
600: "#7c3aed",
|
803 |
+
700: "#6d28d9",
|
804 |
+
800: "#5b21b6",
|
805 |
+
900: "#4c1d95",
|
806 |
+
950: "#2e1065"
|
807 |
+
},
|
808 |
+
purple: {
|
809 |
+
50: "#faf5ff",
|
810 |
+
100: "#f3e8ff",
|
811 |
+
200: "#e9d5ff",
|
812 |
+
300: "#d8b4fe",
|
813 |
+
400: "#c084fc",
|
814 |
+
500: "#a855f7",
|
815 |
+
600: "#9333ea",
|
816 |
+
700: "#7e22ce",
|
817 |
+
800: "#6b21a8",
|
818 |
+
900: "#581c87",
|
819 |
+
950: "#3b0764"
|
820 |
+
},
|
821 |
+
fuchsia: {
|
822 |
+
50: "#fdf4ff",
|
823 |
+
100: "#fae8ff",
|
824 |
+
200: "#f5d0fe",
|
825 |
+
300: "#f0abfc",
|
826 |
+
400: "#e879f9",
|
827 |
+
500: "#d946ef",
|
828 |
+
600: "#c026d3",
|
829 |
+
700: "#a21caf",
|
830 |
+
800: "#86198f",
|
831 |
+
900: "#701a75",
|
832 |
+
950: "#4a044e"
|
833 |
+
},
|
834 |
+
pink: {
|
835 |
+
50: "#fdf2f8",
|
836 |
+
100: "#fce7f3",
|
837 |
+
200: "#fbcfe8",
|
838 |
+
300: "#f9a8d4",
|
839 |
+
400: "#f472b6",
|
840 |
+
500: "#ec4899",
|
841 |
+
600: "#db2777",
|
842 |
+
700: "#be185d",
|
843 |
+
800: "#9d174d",
|
844 |
+
900: "#831843",
|
845 |
+
950: "#500724"
|
846 |
+
},
|
847 |
+
rose: {
|
848 |
+
50: "#fff1f2",
|
849 |
+
100: "#ffe4e6",
|
850 |
+
200: "#fecdd3",
|
851 |
+
300: "#fda4af",
|
852 |
+
400: "#fb7185",
|
853 |
+
500: "#f43f5e",
|
854 |
+
600: "#e11d48",
|
855 |
+
700: "#be123c",
|
856 |
+
800: "#9f1239",
|
857 |
+
900: "#881337",
|
858 |
+
950: "#4c0519"
|
859 |
+
}
|
860 |
+
};
|
861 |
+
fl.reduce(
|
862 |
+
(e, { color: t, primary: n, secondary: l }) => ({
|
863 |
+
...e,
|
864 |
+
[t]: {
|
865 |
+
primary: Qe[t][n],
|
866 |
+
secondary: Qe[t][l]
|
867 |
+
}
|
868 |
+
}),
|
869 |
+
{}
|
870 |
+
);
|
871 |
+
function oe(e) {
|
872 |
+
let t = ["", "k", "M", "G", "T", "P", "E", "Z"], n = 0;
|
873 |
+
for (; e > 1e3 && n < t.length - 1; )
|
874 |
+
e /= 1e3, n++;
|
875 |
+
let l = t[n];
|
876 |
+
return (Number.isInteger(e) ? e : e.toFixed(1)) + l;
|
877 |
+
}
|
878 |
+
function Fe() {
|
879 |
+
}
|
880 |
+
function al(e, t) {
|
881 |
+
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
882 |
+
}
|
883 |
+
const Dt = typeof window < "u";
|
884 |
+
let je = Dt ? () => window.performance.now() : () => Date.now(), Rt = Dt ? (e) => requestAnimationFrame(e) : Fe;
|
885 |
+
const ae = /* @__PURE__ */ new Set();
|
886 |
+
function It(e) {
|
887 |
+
ae.forEach((t) => {
|
888 |
+
t.c(e) || (ae.delete(t), t.f());
|
889 |
+
}), ae.size !== 0 && Rt(It);
|
890 |
+
}
|
891 |
+
function ul(e) {
|
892 |
+
let t;
|
893 |
+
return ae.size === 0 && Rt(It), {
|
894 |
+
promise: new Promise((n) => {
|
895 |
+
ae.add(t = { c: e, f: n });
|
896 |
+
}),
|
897 |
+
abort() {
|
898 |
+
ae.delete(t);
|
899 |
+
}
|
900 |
+
};
|
901 |
+
}
|
902 |
+
const se = [];
|
903 |
+
function cl(e, t = Fe) {
|
904 |
+
let n;
|
905 |
+
const l = /* @__PURE__ */ new Set();
|
906 |
+
function i(r) {
|
907 |
+
if (al(e, r) && (e = r, n)) {
|
908 |
+
const o = !se.length;
|
909 |
+
for (const a of l)
|
910 |
+
a[1](), se.push(a, e);
|
911 |
+
if (o) {
|
912 |
+
for (let a = 0; a < se.length; a += 2)
|
913 |
+
se[a][0](se[a + 1]);
|
914 |
+
se.length = 0;
|
915 |
+
}
|
916 |
+
}
|
917 |
+
}
|
918 |
+
function s(r) {
|
919 |
+
i(r(e));
|
920 |
+
}
|
921 |
+
function f(r, o = Fe) {
|
922 |
+
const a = [r, o];
|
923 |
+
return l.add(a), l.size === 1 && (n = t(i, s) || Fe), r(e), () => {
|
924 |
+
l.delete(a), l.size === 0 && n && (n(), n = null);
|
925 |
+
};
|
926 |
+
}
|
927 |
+
return { set: i, update: s, subscribe: f };
|
928 |
+
}
|
929 |
+
function xe(e) {
|
930 |
+
return Object.prototype.toString.call(e) === "[object Date]";
|
931 |
+
}
|
932 |
+
function Oe(e, t, n, l) {
|
933 |
+
if (typeof n == "number" || xe(n)) {
|
934 |
+
const i = l - n, s = (n - t) / (e.dt || 1 / 60), f = e.opts.stiffness * i, r = e.opts.damping * s, o = (f - r) * e.inv_mass, a = (s + o) * e.dt;
|
935 |
+
return Math.abs(a) < e.opts.precision && Math.abs(i) < e.opts.precision ? l : (e.settled = !1, xe(n) ? new Date(n.getTime() + a) : n + a);
|
936 |
+
} else {
|
937 |
+
if (Array.isArray(n))
|
938 |
+
return n.map(
|
939 |
+
(i, s) => Oe(e, t[s], n[s], l[s])
|
940 |
+
);
|
941 |
+
if (typeof n == "object") {
|
942 |
+
const i = {};
|
943 |
+
for (const s in n)
|
944 |
+
i[s] = Oe(e, t[s], n[s], l[s]);
|
945 |
+
return i;
|
946 |
+
} else
|
947 |
+
throw new Error(`Cannot spring ${typeof n} values`);
|
948 |
+
}
|
949 |
+
}
|
950 |
+
function $e(e, t = {}) {
|
951 |
+
const n = cl(e), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
|
952 |
+
let f, r, o, a = e, u = e, m = 1, h = 0, d = !1;
|
953 |
+
function p(v, w = {}) {
|
954 |
+
u = v;
|
955 |
+
const k = o = {};
|
956 |
+
return e == null || w.hard || b.stiffness >= 1 && b.damping >= 1 ? (d = !0, f = je(), a = v, n.set(e = u), Promise.resolve()) : (w.soft && (h = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), m = 0), r || (f = je(), d = !1, r = ul((g) => {
|
957 |
+
if (d)
|
958 |
+
return d = !1, r = null, !1;
|
959 |
+
m = Math.min(m + h, 1);
|
960 |
+
const _ = {
|
961 |
+
inv_mass: m,
|
962 |
+
opts: b,
|
963 |
+
settled: !0,
|
964 |
+
dt: (g - f) * 60 / 1e3
|
965 |
+
}, C = Oe(_, a, e, u);
|
966 |
+
return f = g, a = e, n.set(e = C), _.settled && (r = null), !_.settled;
|
967 |
+
})), new Promise((g) => {
|
968 |
+
r.promise.then(() => {
|
969 |
+
k === o && g();
|
970 |
+
});
|
971 |
+
}));
|
972 |
+
}
|
973 |
+
const b = {
|
974 |
+
set: p,
|
975 |
+
update: (v, w) => p(v(u, e), w),
|
976 |
+
subscribe: n.subscribe,
|
977 |
+
stiffness: l,
|
978 |
+
damping: i,
|
979 |
+
precision: s
|
980 |
+
};
|
981 |
+
return b;
|
982 |
+
}
|
983 |
+
const {
|
984 |
+
SvelteComponent: _l,
|
985 |
+
append: O,
|
986 |
+
attr: L,
|
987 |
+
component_subscribe: et,
|
988 |
+
detach: dl,
|
989 |
+
element: ml,
|
990 |
+
init: hl,
|
991 |
+
insert: pl,
|
992 |
+
noop: tt,
|
993 |
+
safe_not_equal: gl,
|
994 |
+
set_style: Ce,
|
995 |
+
svg_element: U,
|
996 |
+
toggle_class: nt
|
997 |
+
} = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal;
|
998 |
+
function wl(e) {
|
999 |
+
let t, n, l, i, s, f, r, o, a, u, m, h;
|
1000 |
+
return {
|
1001 |
+
c() {
|
1002 |
+
t = ml("div"), n = U("svg"), l = U("g"), i = U("path"), s = U("path"), f = U("path"), r = U("path"), o = U("g"), a = U("path"), u = U("path"), m = U("path"), h = U("path"), L(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), L(i, "fill", "#FF7C00"), L(i, "fill-opacity", "0.4"), L(i, "class", "svelte-43sxxs"), L(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), L(s, "fill", "#FF7C00"), L(s, "class", "svelte-43sxxs"), L(f, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), L(f, "fill", "#FF7C00"), L(f, "fill-opacity", "0.4"), L(f, "class", "svelte-43sxxs"), L(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), L(r, "fill", "#FF7C00"), L(r, "class", "svelte-43sxxs"), Ce(l, "transform", "translate(" + /*$top*/
|
1003 |
+
e[1][0] + "px, " + /*$top*/
|
1004 |
+
e[1][1] + "px)"), L(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), L(a, "fill", "#FF7C00"), L(a, "fill-opacity", "0.4"), L(a, "class", "svelte-43sxxs"), L(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), L(u, "fill", "#FF7C00"), L(u, "class", "svelte-43sxxs"), L(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), L(m, "fill", "#FF7C00"), L(m, "fill-opacity", "0.4"), L(m, "class", "svelte-43sxxs"), L(h, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), L(h, "fill", "#FF7C00"), L(h, "class", "svelte-43sxxs"), Ce(o, "transform", "translate(" + /*$bottom*/
|
1005 |
+
e[2][0] + "px, " + /*$bottom*/
|
1006 |
+
e[2][1] + "px)"), L(n, "viewBox", "-1200 -1200 3000 3000"), L(n, "fill", "none"), L(n, "xmlns", "http://www.w3.org/2000/svg"), L(n, "class", "svelte-43sxxs"), L(t, "class", "svelte-43sxxs"), nt(
|
1007 |
+
t,
|
1008 |
+
"margin",
|
1009 |
+
/*margin*/
|
1010 |
+
e[0]
|
1011 |
+
);
|
1012 |
+
},
|
1013 |
+
m(d, p) {
|
1014 |
+
pl(d, t, p), O(t, n), O(n, l), O(l, i), O(l, s), O(l, f), O(l, r), O(n, o), O(o, a), O(o, u), O(o, m), O(o, h);
|
1015 |
+
},
|
1016 |
+
p(d, [p]) {
|
1017 |
+
p & /*$top*/
|
1018 |
+
2 && Ce(l, "transform", "translate(" + /*$top*/
|
1019 |
+
d[1][0] + "px, " + /*$top*/
|
1020 |
+
d[1][1] + "px)"), p & /*$bottom*/
|
1021 |
+
4 && Ce(o, "transform", "translate(" + /*$bottom*/
|
1022 |
+
d[2][0] + "px, " + /*$bottom*/
|
1023 |
+
d[2][1] + "px)"), p & /*margin*/
|
1024 |
+
1 && nt(
|
1025 |
+
t,
|
1026 |
+
"margin",
|
1027 |
+
/*margin*/
|
1028 |
+
d[0]
|
1029 |
+
);
|
1030 |
+
},
|
1031 |
+
i: tt,
|
1032 |
+
o: tt,
|
1033 |
+
d(d) {
|
1034 |
+
d && dl(t);
|
1035 |
+
}
|
1036 |
+
};
|
1037 |
+
}
|
1038 |
+
function vl(e, t, n) {
|
1039 |
+
let l, i, { margin: s = !0 } = t;
|
1040 |
+
const f = $e([0, 0]);
|
1041 |
+
et(e, f, (h) => n(1, l = h));
|
1042 |
+
const r = $e([0, 0]);
|
1043 |
+
et(e, r, (h) => n(2, i = h));
|
1044 |
+
let o;
|
1045 |
+
async function a() {
|
1046 |
+
await Promise.all([f.set([125, 140]), r.set([-125, -140])]), await Promise.all([f.set([-125, 140]), r.set([125, -140])]), await Promise.all([f.set([-125, 0]), r.set([125, -0])]), await Promise.all([f.set([125, 0]), r.set([-125, 0])]);
|
1047 |
+
}
|
1048 |
+
async function u() {
|
1049 |
+
await a(), o || u();
|
1050 |
+
}
|
1051 |
+
async function m() {
|
1052 |
+
await Promise.all([f.set([125, 0]), r.set([-125, 0])]), u();
|
1053 |
+
}
|
1054 |
+
return bl(() => (m(), () => o = !0)), e.$$set = (h) => {
|
1055 |
+
"margin" in h && n(0, s = h.margin);
|
1056 |
+
}, [s, l, i, f, r];
|
1057 |
+
}
|
1058 |
+
class yl extends _l {
|
1059 |
+
constructor(t) {
|
1060 |
+
super(), hl(this, t, vl, wl, gl, { margin: 0 });
|
1061 |
+
}
|
1062 |
+
}
|
1063 |
+
const {
|
1064 |
+
SvelteComponent: kl,
|
1065 |
+
append: ne,
|
1066 |
+
attr: G,
|
1067 |
+
binding_callbacks: lt,
|
1068 |
+
check_outros: Ot,
|
1069 |
+
create_component: Cl,
|
1070 |
+
create_slot: Al,
|
1071 |
+
destroy_component: Sl,
|
1072 |
+
destroy_each: Ut,
|
1073 |
+
detach: A,
|
1074 |
+
element: Q,
|
1075 |
+
empty: de,
|
1076 |
+
ensure_array_like: Ve,
|
1077 |
+
get_all_dirty_from_scope: Nl,
|
1078 |
+
get_slot_changes: Ll,
|
1079 |
+
group_outros: Zt,
|
1080 |
+
init: El,
|
1081 |
+
insert: S,
|
1082 |
+
mount_component: ql,
|
1083 |
+
noop: Ue,
|
1084 |
+
safe_not_equal: Fl,
|
1085 |
+
set_data: R,
|
1086 |
+
set_style: ee,
|
1087 |
+
space: W,
|
1088 |
+
text: q,
|
1089 |
+
toggle_class: D,
|
1090 |
+
transition_in: ce,
|
1091 |
+
transition_out: _e,
|
1092 |
+
update_slot_base: Ml
|
1093 |
+
} = window.__gradio__svelte__internal, { tick: Pl } = window.__gradio__svelte__internal, { onDestroy: Vl } = window.__gradio__svelte__internal, Tl = (e) => ({}), it = (e) => ({});
|
1094 |
+
function st(e, t, n) {
|
1095 |
+
const l = e.slice();
|
1096 |
+
return l[38] = t[n], l[40] = n, l;
|
1097 |
+
}
|
1098 |
+
function rt(e, t, n) {
|
1099 |
+
const l = e.slice();
|
1100 |
+
return l[38] = t[n], l;
|
1101 |
+
}
|
1102 |
+
function zl(e) {
|
1103 |
+
let t, n = (
|
1104 |
+
/*i18n*/
|
1105 |
+
e[1]("common.error") + ""
|
1106 |
+
), l, i, s;
|
1107 |
+
const f = (
|
1108 |
+
/*#slots*/
|
1109 |
+
e[29].error
|
1110 |
+
), r = Al(
|
1111 |
+
f,
|
1112 |
+
e,
|
1113 |
+
/*$$scope*/
|
1114 |
+
e[28],
|
1115 |
+
it
|
1116 |
+
);
|
1117 |
+
return {
|
1118 |
+
c() {
|
1119 |
+
t = Q("span"), l = q(n), i = W(), r && r.c(), G(t, "class", "error svelte-1yserjw");
|
1120 |
+
},
|
1121 |
+
m(o, a) {
|
1122 |
+
S(o, t, a), ne(t, l), S(o, i, a), r && r.m(o, a), s = !0;
|
1123 |
+
},
|
1124 |
+
p(o, a) {
|
1125 |
+
(!s || a[0] & /*i18n*/
|
1126 |
+
2) && n !== (n = /*i18n*/
|
1127 |
+
o[1]("common.error") + "") && R(l, n), r && r.p && (!s || a[0] & /*$$scope*/
|
1128 |
+
268435456) && Ml(
|
1129 |
+
r,
|
1130 |
+
f,
|
1131 |
+
o,
|
1132 |
+
/*$$scope*/
|
1133 |
+
o[28],
|
1134 |
+
s ? Ll(
|
1135 |
+
f,
|
1136 |
+
/*$$scope*/
|
1137 |
+
o[28],
|
1138 |
+
a,
|
1139 |
+
Tl
|
1140 |
+
) : Nl(
|
1141 |
+
/*$$scope*/
|
1142 |
+
o[28]
|
1143 |
+
),
|
1144 |
+
it
|
1145 |
+
);
|
1146 |
+
},
|
1147 |
+
i(o) {
|
1148 |
+
s || (ce(r, o), s = !0);
|
1149 |
+
},
|
1150 |
+
o(o) {
|
1151 |
+
_e(r, o), s = !1;
|
1152 |
+
},
|
1153 |
+
d(o) {
|
1154 |
+
o && (A(t), A(i)), r && r.d(o);
|
1155 |
+
}
|
1156 |
+
};
|
1157 |
+
}
|
1158 |
+
function Bl(e) {
|
1159 |
+
let t, n, l, i, s, f, r, o, a, u = (
|
1160 |
+
/*variant*/
|
1161 |
+
e[8] === "default" && /*show_eta_bar*/
|
1162 |
+
e[18] && /*show_progress*/
|
1163 |
+
e[6] === "full" && ot(e)
|
1164 |
+
);
|
1165 |
+
function m(g, _) {
|
1166 |
+
if (
|
1167 |
+
/*progress*/
|
1168 |
+
g[7]
|
1169 |
+
)
|
1170 |
+
return Il;
|
1171 |
+
if (
|
1172 |
+
/*queue_position*/
|
1173 |
+
g[2] !== null && /*queue_size*/
|
1174 |
+
g[3] !== void 0 && /*queue_position*/
|
1175 |
+
g[2] >= 0
|
1176 |
+
)
|
1177 |
+
return Rl;
|
1178 |
+
if (
|
1179 |
+
/*queue_position*/
|
1180 |
+
g[2] === 0
|
1181 |
+
)
|
1182 |
+
return Dl;
|
1183 |
+
}
|
1184 |
+
let h = m(e), d = h && h(e), p = (
|
1185 |
+
/*timer*/
|
1186 |
+
e[5] && ut(e)
|
1187 |
+
);
|
1188 |
+
const b = [Hl, Zl], v = [];
|
1189 |
+
function w(g, _) {
|
1190 |
+
return (
|
1191 |
+
/*last_progress_level*/
|
1192 |
+
g[15] != null ? 0 : (
|
1193 |
+
/*show_progress*/
|
1194 |
+
g[6] === "full" ? 1 : -1
|
1195 |
+
)
|
1196 |
+
);
|
1197 |
+
}
|
1198 |
+
~(s = w(e)) && (f = v[s] = b[s](e));
|
1199 |
+
let k = !/*timer*/
|
1200 |
+
e[5] && gt(e);
|
1201 |
+
return {
|
1202 |
+
c() {
|
1203 |
+
u && u.c(), t = W(), n = Q("div"), d && d.c(), l = W(), p && p.c(), i = W(), f && f.c(), r = W(), k && k.c(), o = de(), G(n, "class", "progress-text svelte-1yserjw"), D(
|
1204 |
+
n,
|
1205 |
+
"meta-text-center",
|
1206 |
+
/*variant*/
|
1207 |
+
e[8] === "center"
|
1208 |
+
), D(
|
1209 |
+
n,
|
1210 |
+
"meta-text",
|
1211 |
+
/*variant*/
|
1212 |
+
e[8] === "default"
|
1213 |
+
);
|
1214 |
+
},
|
1215 |
+
m(g, _) {
|
1216 |
+
u && u.m(g, _), S(g, t, _), S(g, n, _), d && d.m(n, null), ne(n, l), p && p.m(n, null), S(g, i, _), ~s && v[s].m(g, _), S(g, r, _), k && k.m(g, _), S(g, o, _), a = !0;
|
1217 |
+
},
|
1218 |
+
p(g, _) {
|
1219 |
+
/*variant*/
|
1220 |
+
g[8] === "default" && /*show_eta_bar*/
|
1221 |
+
g[18] && /*show_progress*/
|
1222 |
+
g[6] === "full" ? u ? u.p(g, _) : (u = ot(g), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null), h === (h = m(g)) && d ? d.p(g, _) : (d && d.d(1), d = h && h(g), d && (d.c(), d.m(n, l))), /*timer*/
|
1223 |
+
g[5] ? p ? p.p(g, _) : (p = ut(g), p.c(), p.m(n, null)) : p && (p.d(1), p = null), (!a || _[0] & /*variant*/
|
1224 |
+
256) && D(
|
1225 |
+
n,
|
1226 |
+
"meta-text-center",
|
1227 |
+
/*variant*/
|
1228 |
+
g[8] === "center"
|
1229 |
+
), (!a || _[0] & /*variant*/
|
1230 |
+
256) && D(
|
1231 |
+
n,
|
1232 |
+
"meta-text",
|
1233 |
+
/*variant*/
|
1234 |
+
g[8] === "default"
|
1235 |
+
);
|
1236 |
+
let C = s;
|
1237 |
+
s = w(g), s === C ? ~s && v[s].p(g, _) : (f && (Zt(), _e(v[C], 1, 1, () => {
|
1238 |
+
v[C] = null;
|
1239 |
+
}), Ot()), ~s ? (f = v[s], f ? f.p(g, _) : (f = v[s] = b[s](g), f.c()), ce(f, 1), f.m(r.parentNode, r)) : f = null), /*timer*/
|
1240 |
+
g[5] ? k && (k.d(1), k = null) : k ? k.p(g, _) : (k = gt(g), k.c(), k.m(o.parentNode, o));
|
1241 |
+
},
|
1242 |
+
i(g) {
|
1243 |
+
a || (ce(f), a = !0);
|
1244 |
+
},
|
1245 |
+
o(g) {
|
1246 |
+
_e(f), a = !1;
|
1247 |
+
},
|
1248 |
+
d(g) {
|
1249 |
+
g && (A(t), A(n), A(i), A(r), A(o)), u && u.d(g), d && d.d(), p && p.d(), ~s && v[s].d(g), k && k.d(g);
|
1250 |
+
}
|
1251 |
+
};
|
1252 |
+
}
|
1253 |
+
function ot(e) {
|
1254 |
+
let t, n = `translateX(${/*eta_level*/
|
1255 |
+
(e[17] || 0) * 100 - 100}%)`;
|
1256 |
+
return {
|
1257 |
+
c() {
|
1258 |
+
t = Q("div"), G(t, "class", "eta-bar svelte-1yserjw"), ee(t, "transform", n);
|
1259 |
+
},
|
1260 |
+
m(l, i) {
|
1261 |
+
S(l, t, i);
|
1262 |
+
},
|
1263 |
+
p(l, i) {
|
1264 |
+
i[0] & /*eta_level*/
|
1265 |
+
131072 && n !== (n = `translateX(${/*eta_level*/
|
1266 |
+
(l[17] || 0) * 100 - 100}%)`) && ee(t, "transform", n);
|
1267 |
+
},
|
1268 |
+
d(l) {
|
1269 |
+
l && A(t);
|
1270 |
+
}
|
1271 |
+
};
|
1272 |
+
}
|
1273 |
+
function Dl(e) {
|
1274 |
+
let t;
|
1275 |
+
return {
|
1276 |
+
c() {
|
1277 |
+
t = q("processing |");
|
1278 |
+
},
|
1279 |
+
m(n, l) {
|
1280 |
+
S(n, t, l);
|
1281 |
+
},
|
1282 |
+
p: Ue,
|
1283 |
+
d(n) {
|
1284 |
+
n && A(t);
|
1285 |
+
}
|
1286 |
+
};
|
1287 |
+
}
|
1288 |
+
function Rl(e) {
|
1289 |
+
let t, n = (
|
1290 |
+
/*queue_position*/
|
1291 |
+
e[2] + 1 + ""
|
1292 |
+
), l, i, s, f;
|
1293 |
+
return {
|
1294 |
+
c() {
|
1295 |
+
t = q("queue: "), l = q(n), i = q("/"), s = q(
|
1296 |
+
/*queue_size*/
|
1297 |
+
e[3]
|
1298 |
+
), f = q(" |");
|
1299 |
+
},
|
1300 |
+
m(r, o) {
|
1301 |
+
S(r, t, o), S(r, l, o), S(r, i, o), S(r, s, o), S(r, f, o);
|
1302 |
+
},
|
1303 |
+
p(r, o) {
|
1304 |
+
o[0] & /*queue_position*/
|
1305 |
+
4 && n !== (n = /*queue_position*/
|
1306 |
+
r[2] + 1 + "") && R(l, n), o[0] & /*queue_size*/
|
1307 |
+
8 && R(
|
1308 |
+
s,
|
1309 |
+
/*queue_size*/
|
1310 |
+
r[3]
|
1311 |
+
);
|
1312 |
+
},
|
1313 |
+
d(r) {
|
1314 |
+
r && (A(t), A(l), A(i), A(s), A(f));
|
1315 |
+
}
|
1316 |
+
};
|
1317 |
+
}
|
1318 |
+
function Il(e) {
|
1319 |
+
let t, n = Ve(
|
1320 |
+
/*progress*/
|
1321 |
+
e[7]
|
1322 |
+
), l = [];
|
1323 |
+
for (let i = 0; i < n.length; i += 1)
|
1324 |
+
l[i] = at(rt(e, n, i));
|
1325 |
+
return {
|
1326 |
+
c() {
|
1327 |
+
for (let i = 0; i < l.length; i += 1)
|
1328 |
+
l[i].c();
|
1329 |
+
t = de();
|
1330 |
+
},
|
1331 |
+
m(i, s) {
|
1332 |
+
for (let f = 0; f < l.length; f += 1)
|
1333 |
+
l[f] && l[f].m(i, s);
|
1334 |
+
S(i, t, s);
|
1335 |
+
},
|
1336 |
+
p(i, s) {
|
1337 |
+
if (s[0] & /*progress*/
|
1338 |
+
128) {
|
1339 |
+
n = Ve(
|
1340 |
+
/*progress*/
|
1341 |
+
i[7]
|
1342 |
+
);
|
1343 |
+
let f;
|
1344 |
+
for (f = 0; f < n.length; f += 1) {
|
1345 |
+
const r = rt(i, n, f);
|
1346 |
+
l[f] ? l[f].p(r, s) : (l[f] = at(r), l[f].c(), l[f].m(t.parentNode, t));
|
1347 |
+
}
|
1348 |
+
for (; f < l.length; f += 1)
|
1349 |
+
l[f].d(1);
|
1350 |
+
l.length = n.length;
|
1351 |
+
}
|
1352 |
+
},
|
1353 |
+
d(i) {
|
1354 |
+
i && A(t), Ut(l, i);
|
1355 |
+
}
|
1356 |
+
};
|
1357 |
+
}
|
1358 |
+
function ft(e) {
|
1359 |
+
let t, n = (
|
1360 |
+
/*p*/
|
1361 |
+
e[38].unit + ""
|
1362 |
+
), l, i, s = " ", f;
|
1363 |
+
function r(u, m) {
|
1364 |
+
return (
|
1365 |
+
/*p*/
|
1366 |
+
u[38].length != null ? Ul : Ol
|
1367 |
+
);
|
1368 |
+
}
|
1369 |
+
let o = r(e), a = o(e);
|
1370 |
+
return {
|
1371 |
+
c() {
|
1372 |
+
a.c(), t = W(), l = q(n), i = q(" | "), f = q(s);
|
1373 |
+
},
|
1374 |
+
m(u, m) {
|
1375 |
+
a.m(u, m), S(u, t, m), S(u, l, m), S(u, i, m), S(u, f, m);
|
1376 |
+
},
|
1377 |
+
p(u, m) {
|
1378 |
+
o === (o = r(u)) && a ? a.p(u, m) : (a.d(1), a = o(u), a && (a.c(), a.m(t.parentNode, t))), m[0] & /*progress*/
|
1379 |
+
128 && n !== (n = /*p*/
|
1380 |
+
u[38].unit + "") && R(l, n);
|
1381 |
+
},
|
1382 |
+
d(u) {
|
1383 |
+
u && (A(t), A(l), A(i), A(f)), a.d(u);
|
1384 |
+
}
|
1385 |
+
};
|
1386 |
+
}
|
1387 |
+
function Ol(e) {
|
1388 |
+
let t = oe(
|
1389 |
+
/*p*/
|
1390 |
+
e[38].index || 0
|
1391 |
+
) + "", n;
|
1392 |
+
return {
|
1393 |
+
c() {
|
1394 |
+
n = q(t);
|
1395 |
+
},
|
1396 |
+
m(l, i) {
|
1397 |
+
S(l, n, i);
|
1398 |
+
},
|
1399 |
+
p(l, i) {
|
1400 |
+
i[0] & /*progress*/
|
1401 |
+
128 && t !== (t = oe(
|
1402 |
+
/*p*/
|
1403 |
+
l[38].index || 0
|
1404 |
+
) + "") && R(n, t);
|
1405 |
+
},
|
1406 |
+
d(l) {
|
1407 |
+
l && A(n);
|
1408 |
+
}
|
1409 |
+
};
|
1410 |
+
}
|
1411 |
+
function Ul(e) {
|
1412 |
+
let t = oe(
|
1413 |
+
/*p*/
|
1414 |
+
e[38].index || 0
|
1415 |
+
) + "", n, l, i = oe(
|
1416 |
+
/*p*/
|
1417 |
+
e[38].length
|
1418 |
+
) + "", s;
|
1419 |
+
return {
|
1420 |
+
c() {
|
1421 |
+
n = q(t), l = q("/"), s = q(i);
|
1422 |
+
},
|
1423 |
+
m(f, r) {
|
1424 |
+
S(f, n, r), S(f, l, r), S(f, s, r);
|
1425 |
+
},
|
1426 |
+
p(f, r) {
|
1427 |
+
r[0] & /*progress*/
|
1428 |
+
128 && t !== (t = oe(
|
1429 |
+
/*p*/
|
1430 |
+
f[38].index || 0
|
1431 |
+
) + "") && R(n, t), r[0] & /*progress*/
|
1432 |
+
128 && i !== (i = oe(
|
1433 |
+
/*p*/
|
1434 |
+
f[38].length
|
1435 |
+
) + "") && R(s, i);
|
1436 |
+
},
|
1437 |
+
d(f) {
|
1438 |
+
f && (A(n), A(l), A(s));
|
1439 |
+
}
|
1440 |
+
};
|
1441 |
+
}
|
1442 |
+
function at(e) {
|
1443 |
+
let t, n = (
|
1444 |
+
/*p*/
|
1445 |
+
e[38].index != null && ft(e)
|
1446 |
+
);
|
1447 |
+
return {
|
1448 |
+
c() {
|
1449 |
+
n && n.c(), t = de();
|
1450 |
+
},
|
1451 |
+
m(l, i) {
|
1452 |
+
n && n.m(l, i), S(l, t, i);
|
1453 |
+
},
|
1454 |
+
p(l, i) {
|
1455 |
+
/*p*/
|
1456 |
+
l[38].index != null ? n ? n.p(l, i) : (n = ft(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1457 |
+
},
|
1458 |
+
d(l) {
|
1459 |
+
l && A(t), n && n.d(l);
|
1460 |
+
}
|
1461 |
+
};
|
1462 |
+
}
|
1463 |
+
function ut(e) {
|
1464 |
+
let t, n = (
|
1465 |
+
/*eta*/
|
1466 |
+
e[0] ? `/${/*formatted_eta*/
|
1467 |
+
e[19]}` : ""
|
1468 |
+
), l, i;
|
1469 |
+
return {
|
1470 |
+
c() {
|
1471 |
+
t = q(
|
1472 |
+
/*formatted_timer*/
|
1473 |
+
e[20]
|
1474 |
+
), l = q(n), i = q("s");
|
1475 |
+
},
|
1476 |
+
m(s, f) {
|
1477 |
+
S(s, t, f), S(s, l, f), S(s, i, f);
|
1478 |
+
},
|
1479 |
+
p(s, f) {
|
1480 |
+
f[0] & /*formatted_timer*/
|
1481 |
+
1048576 && R(
|
1482 |
+
t,
|
1483 |
+
/*formatted_timer*/
|
1484 |
+
s[20]
|
1485 |
+
), f[0] & /*eta, formatted_eta*/
|
1486 |
+
524289 && n !== (n = /*eta*/
|
1487 |
+
s[0] ? `/${/*formatted_eta*/
|
1488 |
+
s[19]}` : "") && R(l, n);
|
1489 |
+
},
|
1490 |
+
d(s) {
|
1491 |
+
s && (A(t), A(l), A(i));
|
1492 |
+
}
|
1493 |
+
};
|
1494 |
+
}
|
1495 |
+
function Zl(e) {
|
1496 |
+
let t, n;
|
1497 |
+
return t = new yl({
|
1498 |
+
props: { margin: (
|
1499 |
+
/*variant*/
|
1500 |
+
e[8] === "default"
|
1501 |
+
) }
|
1502 |
+
}), {
|
1503 |
+
c() {
|
1504 |
+
Cl(t.$$.fragment);
|
1505 |
+
},
|
1506 |
+
m(l, i) {
|
1507 |
+
ql(t, l, i), n = !0;
|
1508 |
+
},
|
1509 |
+
p(l, i) {
|
1510 |
+
const s = {};
|
1511 |
+
i[0] & /*variant*/
|
1512 |
+
256 && (s.margin = /*variant*/
|
1513 |
+
l[8] === "default"), t.$set(s);
|
1514 |
+
},
|
1515 |
+
i(l) {
|
1516 |
+
n || (ce(t.$$.fragment, l), n = !0);
|
1517 |
+
},
|
1518 |
+
o(l) {
|
1519 |
+
_e(t.$$.fragment, l), n = !1;
|
1520 |
+
},
|
1521 |
+
d(l) {
|
1522 |
+
Sl(t, l);
|
1523 |
+
}
|
1524 |
+
};
|
1525 |
+
}
|
1526 |
+
function Hl(e) {
|
1527 |
+
let t, n, l, i, s, f = `${/*last_progress_level*/
|
1528 |
+
e[15] * 100}%`, r = (
|
1529 |
+
/*progress*/
|
1530 |
+
e[7] != null && ct(e)
|
1531 |
+
);
|
1532 |
+
return {
|
1533 |
+
c() {
|
1534 |
+
t = Q("div"), n = Q("div"), r && r.c(), l = W(), i = Q("div"), s = Q("div"), G(n, "class", "progress-level-inner svelte-1yserjw"), G(s, "class", "progress-bar svelte-1yserjw"), ee(s, "width", f), G(i, "class", "progress-bar-wrap svelte-1yserjw"), G(t, "class", "progress-level svelte-1yserjw");
|
1535 |
+
},
|
1536 |
+
m(o, a) {
|
1537 |
+
S(o, t, a), ne(t, n), r && r.m(n, null), ne(t, l), ne(t, i), ne(i, s), e[30](s);
|
1538 |
+
},
|
1539 |
+
p(o, a) {
|
1540 |
+
/*progress*/
|
1541 |
+
o[7] != null ? r ? r.p(o, a) : (r = ct(o), r.c(), r.m(n, null)) : r && (r.d(1), r = null), a[0] & /*last_progress_level*/
|
1542 |
+
32768 && f !== (f = `${/*last_progress_level*/
|
1543 |
+
o[15] * 100}%`) && ee(s, "width", f);
|
1544 |
+
},
|
1545 |
+
i: Ue,
|
1546 |
+
o: Ue,
|
1547 |
+
d(o) {
|
1548 |
+
o && A(t), r && r.d(), e[30](null);
|
1549 |
+
}
|
1550 |
+
};
|
1551 |
+
}
|
1552 |
+
function ct(e) {
|
1553 |
+
let t, n = Ve(
|
1554 |
+
/*progress*/
|
1555 |
+
e[7]
|
1556 |
+
), l = [];
|
1557 |
+
for (let i = 0; i < n.length; i += 1)
|
1558 |
+
l[i] = pt(st(e, n, i));
|
1559 |
+
return {
|
1560 |
+
c() {
|
1561 |
+
for (let i = 0; i < l.length; i += 1)
|
1562 |
+
l[i].c();
|
1563 |
+
t = de();
|
1564 |
+
},
|
1565 |
+
m(i, s) {
|
1566 |
+
for (let f = 0; f < l.length; f += 1)
|
1567 |
+
l[f] && l[f].m(i, s);
|
1568 |
+
S(i, t, s);
|
1569 |
+
},
|
1570 |
+
p(i, s) {
|
1571 |
+
if (s[0] & /*progress_level, progress*/
|
1572 |
+
16512) {
|
1573 |
+
n = Ve(
|
1574 |
+
/*progress*/
|
1575 |
+
i[7]
|
1576 |
+
);
|
1577 |
+
let f;
|
1578 |
+
for (f = 0; f < n.length; f += 1) {
|
1579 |
+
const r = st(i, n, f);
|
1580 |
+
l[f] ? l[f].p(r, s) : (l[f] = pt(r), l[f].c(), l[f].m(t.parentNode, t));
|
1581 |
+
}
|
1582 |
+
for (; f < l.length; f += 1)
|
1583 |
+
l[f].d(1);
|
1584 |
+
l.length = n.length;
|
1585 |
+
}
|
1586 |
+
},
|
1587 |
+
d(i) {
|
1588 |
+
i && A(t), Ut(l, i);
|
1589 |
+
}
|
1590 |
+
};
|
1591 |
+
}
|
1592 |
+
function _t(e) {
|
1593 |
+
let t, n, l, i, s = (
|
1594 |
+
/*i*/
|
1595 |
+
e[40] !== 0 && Xl()
|
1596 |
+
), f = (
|
1597 |
+
/*p*/
|
1598 |
+
e[38].desc != null && dt(e)
|
1599 |
+
), r = (
|
1600 |
+
/*p*/
|
1601 |
+
e[38].desc != null && /*progress_level*/
|
1602 |
+
e[14] && /*progress_level*/
|
1603 |
+
e[14][
|
1604 |
+
/*i*/
|
1605 |
+
e[40]
|
1606 |
+
] != null && mt()
|
1607 |
+
), o = (
|
1608 |
+
/*progress_level*/
|
1609 |
+
e[14] != null && ht(e)
|
1610 |
+
);
|
1611 |
+
return {
|
1612 |
+
c() {
|
1613 |
+
s && s.c(), t = W(), f && f.c(), n = W(), r && r.c(), l = W(), o && o.c(), i = de();
|
1614 |
+
},
|
1615 |
+
m(a, u) {
|
1616 |
+
s && s.m(a, u), S(a, t, u), f && f.m(a, u), S(a, n, u), r && r.m(a, u), S(a, l, u), o && o.m(a, u), S(a, i, u);
|
1617 |
+
},
|
1618 |
+
p(a, u) {
|
1619 |
+
/*p*/
|
1620 |
+
a[38].desc != null ? f ? f.p(a, u) : (f = dt(a), f.c(), f.m(n.parentNode, n)) : f && (f.d(1), f = null), /*p*/
|
1621 |
+
a[38].desc != null && /*progress_level*/
|
1622 |
+
a[14] && /*progress_level*/
|
1623 |
+
a[14][
|
1624 |
+
/*i*/
|
1625 |
+
a[40]
|
1626 |
+
] != null ? r || (r = mt(), r.c(), r.m(l.parentNode, l)) : r && (r.d(1), r = null), /*progress_level*/
|
1627 |
+
a[14] != null ? o ? o.p(a, u) : (o = ht(a), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
|
1628 |
+
},
|
1629 |
+
d(a) {
|
1630 |
+
a && (A(t), A(n), A(l), A(i)), s && s.d(a), f && f.d(a), r && r.d(a), o && o.d(a);
|
1631 |
+
}
|
1632 |
+
};
|
1633 |
+
}
|
1634 |
+
function Xl(e) {
|
1635 |
+
let t;
|
1636 |
+
return {
|
1637 |
+
c() {
|
1638 |
+
t = q(" /");
|
1639 |
+
},
|
1640 |
+
m(n, l) {
|
1641 |
+
S(n, t, l);
|
1642 |
+
},
|
1643 |
+
d(n) {
|
1644 |
+
n && A(t);
|
1645 |
+
}
|
1646 |
+
};
|
1647 |
+
}
|
1648 |
+
function dt(e) {
|
1649 |
+
let t = (
|
1650 |
+
/*p*/
|
1651 |
+
e[38].desc + ""
|
1652 |
+
), n;
|
1653 |
+
return {
|
1654 |
+
c() {
|
1655 |
+
n = q(t);
|
1656 |
+
},
|
1657 |
+
m(l, i) {
|
1658 |
+
S(l, n, i);
|
1659 |
+
},
|
1660 |
+
p(l, i) {
|
1661 |
+
i[0] & /*progress*/
|
1662 |
+
128 && t !== (t = /*p*/
|
1663 |
+
l[38].desc + "") && R(n, t);
|
1664 |
+
},
|
1665 |
+
d(l) {
|
1666 |
+
l && A(n);
|
1667 |
+
}
|
1668 |
+
};
|
1669 |
+
}
|
1670 |
+
function mt(e) {
|
1671 |
+
let t;
|
1672 |
+
return {
|
1673 |
+
c() {
|
1674 |
+
t = q("-");
|
1675 |
+
},
|
1676 |
+
m(n, l) {
|
1677 |
+
S(n, t, l);
|
1678 |
+
},
|
1679 |
+
d(n) {
|
1680 |
+
n && A(t);
|
1681 |
+
}
|
1682 |
+
};
|
1683 |
+
}
|
1684 |
+
function ht(e) {
|
1685 |
+
let t = (100 * /*progress_level*/
|
1686 |
+
(e[14][
|
1687 |
+
/*i*/
|
1688 |
+
e[40]
|
1689 |
+
] || 0)).toFixed(1) + "", n, l;
|
1690 |
+
return {
|
1691 |
+
c() {
|
1692 |
+
n = q(t), l = q("%");
|
1693 |
+
},
|
1694 |
+
m(i, s) {
|
1695 |
+
S(i, n, s), S(i, l, s);
|
1696 |
+
},
|
1697 |
+
p(i, s) {
|
1698 |
+
s[0] & /*progress_level*/
|
1699 |
+
16384 && t !== (t = (100 * /*progress_level*/
|
1700 |
+
(i[14][
|
1701 |
+
/*i*/
|
1702 |
+
i[40]
|
1703 |
+
] || 0)).toFixed(1) + "") && R(n, t);
|
1704 |
+
},
|
1705 |
+
d(i) {
|
1706 |
+
i && (A(n), A(l));
|
1707 |
+
}
|
1708 |
+
};
|
1709 |
+
}
|
1710 |
+
function pt(e) {
|
1711 |
+
let t, n = (
|
1712 |
+
/*p*/
|
1713 |
+
(e[38].desc != null || /*progress_level*/
|
1714 |
+
e[14] && /*progress_level*/
|
1715 |
+
e[14][
|
1716 |
+
/*i*/
|
1717 |
+
e[40]
|
1718 |
+
] != null) && _t(e)
|
1719 |
+
);
|
1720 |
+
return {
|
1721 |
+
c() {
|
1722 |
+
n && n.c(), t = de();
|
1723 |
+
},
|
1724 |
+
m(l, i) {
|
1725 |
+
n && n.m(l, i), S(l, t, i);
|
1726 |
+
},
|
1727 |
+
p(l, i) {
|
1728 |
+
/*p*/
|
1729 |
+
l[38].desc != null || /*progress_level*/
|
1730 |
+
l[14] && /*progress_level*/
|
1731 |
+
l[14][
|
1732 |
+
/*i*/
|
1733 |
+
l[40]
|
1734 |
+
] != null ? n ? n.p(l, i) : (n = _t(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1735 |
+
},
|
1736 |
+
d(l) {
|
1737 |
+
l && A(t), n && n.d(l);
|
1738 |
+
}
|
1739 |
+
};
|
1740 |
+
}
|
1741 |
+
function gt(e) {
|
1742 |
+
let t, n;
|
1743 |
+
return {
|
1744 |
+
c() {
|
1745 |
+
t = Q("p"), n = q(
|
1746 |
+
/*loading_text*/
|
1747 |
+
e[9]
|
1748 |
+
), G(t, "class", "loading svelte-1yserjw");
|
1749 |
+
},
|
1750 |
+
m(l, i) {
|
1751 |
+
S(l, t, i), ne(t, n);
|
1752 |
+
},
|
1753 |
+
p(l, i) {
|
1754 |
+
i[0] & /*loading_text*/
|
1755 |
+
512 && R(
|
1756 |
+
n,
|
1757 |
+
/*loading_text*/
|
1758 |
+
l[9]
|
1759 |
+
);
|
1760 |
+
},
|
1761 |
+
d(l) {
|
1762 |
+
l && A(t);
|
1763 |
+
}
|
1764 |
+
};
|
1765 |
+
}
|
1766 |
+
function Yl(e) {
|
1767 |
+
let t, n, l, i, s;
|
1768 |
+
const f = [Bl, zl], r = [];
|
1769 |
+
function o(a, u) {
|
1770 |
+
return (
|
1771 |
+
/*status*/
|
1772 |
+
a[4] === "pending" ? 0 : (
|
1773 |
+
/*status*/
|
1774 |
+
a[4] === "error" ? 1 : -1
|
1775 |
+
)
|
1776 |
+
);
|
1777 |
+
}
|
1778 |
+
return ~(n = o(e)) && (l = r[n] = f[n](e)), {
|
1779 |
+
c() {
|
1780 |
+
t = Q("div"), l && l.c(), G(t, "class", i = "wrap " + /*variant*/
|
1781 |
+
e[8] + " " + /*show_progress*/
|
1782 |
+
e[6] + " svelte-1yserjw"), D(t, "hide", !/*status*/
|
1783 |
+
e[4] || /*status*/
|
1784 |
+
e[4] === "complete" || /*show_progress*/
|
1785 |
+
e[6] === "hidden"), D(
|
1786 |
+
t,
|
1787 |
+
"translucent",
|
1788 |
+
/*variant*/
|
1789 |
+
e[8] === "center" && /*status*/
|
1790 |
+
(e[4] === "pending" || /*status*/
|
1791 |
+
e[4] === "error") || /*translucent*/
|
1792 |
+
e[11] || /*show_progress*/
|
1793 |
+
e[6] === "minimal"
|
1794 |
+
), D(
|
1795 |
+
t,
|
1796 |
+
"generating",
|
1797 |
+
/*status*/
|
1798 |
+
e[4] === "generating"
|
1799 |
+
), D(
|
1800 |
+
t,
|
1801 |
+
"border",
|
1802 |
+
/*border*/
|
1803 |
+
e[12]
|
1804 |
+
), ee(
|
1805 |
+
t,
|
1806 |
+
"position",
|
1807 |
+
/*absolute*/
|
1808 |
+
e[10] ? "absolute" : "static"
|
1809 |
+
), ee(
|
1810 |
+
t,
|
1811 |
+
"padding",
|
1812 |
+
/*absolute*/
|
1813 |
+
e[10] ? "0" : "var(--size-8) 0"
|
1814 |
+
);
|
1815 |
+
},
|
1816 |
+
m(a, u) {
|
1817 |
+
S(a, t, u), ~n && r[n].m(t, null), e[31](t), s = !0;
|
1818 |
+
},
|
1819 |
+
p(a, u) {
|
1820 |
+
let m = n;
|
1821 |
+
n = o(a), n === m ? ~n && r[n].p(a, u) : (l && (Zt(), _e(r[m], 1, 1, () => {
|
1822 |
+
r[m] = null;
|
1823 |
+
}), Ot()), ~n ? (l = r[n], l ? l.p(a, u) : (l = r[n] = f[n](a), l.c()), ce(l, 1), l.m(t, null)) : l = null), (!s || u[0] & /*variant, show_progress*/
|
1824 |
+
320 && i !== (i = "wrap " + /*variant*/
|
1825 |
+
a[8] + " " + /*show_progress*/
|
1826 |
+
a[6] + " svelte-1yserjw")) && G(t, "class", i), (!s || u[0] & /*variant, show_progress, status, show_progress*/
|
1827 |
+
336) && D(t, "hide", !/*status*/
|
1828 |
+
a[4] || /*status*/
|
1829 |
+
a[4] === "complete" || /*show_progress*/
|
1830 |
+
a[6] === "hidden"), (!s || u[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
|
1831 |
+
2384) && D(
|
1832 |
+
t,
|
1833 |
+
"translucent",
|
1834 |
+
/*variant*/
|
1835 |
+
a[8] === "center" && /*status*/
|
1836 |
+
(a[4] === "pending" || /*status*/
|
1837 |
+
a[4] === "error") || /*translucent*/
|
1838 |
+
a[11] || /*show_progress*/
|
1839 |
+
a[6] === "minimal"
|
1840 |
+
), (!s || u[0] & /*variant, show_progress, status*/
|
1841 |
+
336) && D(
|
1842 |
+
t,
|
1843 |
+
"generating",
|
1844 |
+
/*status*/
|
1845 |
+
a[4] === "generating"
|
1846 |
+
), (!s || u[0] & /*variant, show_progress, border*/
|
1847 |
+
4416) && D(
|
1848 |
+
t,
|
1849 |
+
"border",
|
1850 |
+
/*border*/
|
1851 |
+
a[12]
|
1852 |
+
), u[0] & /*absolute*/
|
1853 |
+
1024 && ee(
|
1854 |
+
t,
|
1855 |
+
"position",
|
1856 |
+
/*absolute*/
|
1857 |
+
a[10] ? "absolute" : "static"
|
1858 |
+
), u[0] & /*absolute*/
|
1859 |
+
1024 && ee(
|
1860 |
+
t,
|
1861 |
+
"padding",
|
1862 |
+
/*absolute*/
|
1863 |
+
a[10] ? "0" : "var(--size-8) 0"
|
1864 |
+
);
|
1865 |
+
},
|
1866 |
+
i(a) {
|
1867 |
+
s || (ce(l), s = !0);
|
1868 |
+
},
|
1869 |
+
o(a) {
|
1870 |
+
_e(l), s = !1;
|
1871 |
+
},
|
1872 |
+
d(a) {
|
1873 |
+
a && A(t), ~n && r[n].d(), e[31](null);
|
1874 |
+
}
|
1875 |
+
};
|
1876 |
+
}
|
1877 |
+
let Ae = [], Re = !1;
|
1878 |
+
async function Kl(e, t = !0) {
|
1879 |
+
if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
|
1880 |
+
if (Ae.push(e), !Re)
|
1881 |
+
Re = !0;
|
1882 |
+
else
|
1883 |
+
return;
|
1884 |
+
await Pl(), requestAnimationFrame(() => {
|
1885 |
+
let n = [0, 0];
|
1886 |
+
for (let l = 0; l < Ae.length; l++) {
|
1887 |
+
const s = Ae[l].getBoundingClientRect();
|
1888 |
+
(l === 0 || s.top + window.scrollY <= n[0]) && (n[0] = s.top + window.scrollY, n[1] = l);
|
1889 |
+
}
|
1890 |
+
window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Re = !1, Ae = [];
|
1891 |
+
});
|
1892 |
+
}
|
1893 |
+
}
|
1894 |
+
function Gl(e, t, n) {
|
1895 |
+
let l, { $$slots: i = {}, $$scope: s } = t, { i18n: f } = t, { eta: r = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: u } = t, { scroll_to_output: m = !1 } = t, { timer: h = !0 } = t, { show_progress: d = "full" } = t, { message: p = null } = t, { progress: b = null } = t, { variant: v = "default" } = t, { loading_text: w = "Loading..." } = t, { absolute: k = !0 } = t, { translucent: g = !1 } = t, { border: _ = !1 } = t, { autoscroll: C } = t, c, E = !1, N = 0, F = 0, T = null, M = null, me = 0, H = null, X, Y = null, le = !0;
|
1896 |
+
const ye = () => {
|
1897 |
+
n(0, r = n(26, T = n(19, j = null))), n(24, N = performance.now()), n(25, F = 0), E = !0, ke();
|
1898 |
+
};
|
1899 |
+
function ke() {
|
1900 |
+
requestAnimationFrame(() => {
|
1901 |
+
n(25, F = (performance.now() - N) / 1e3), E && ke();
|
1902 |
+
});
|
1903 |
+
}
|
1904 |
+
function he() {
|
1905 |
+
n(25, F = 0), n(0, r = n(26, T = n(19, j = null))), E && (E = !1);
|
1906 |
+
}
|
1907 |
+
Vl(() => {
|
1908 |
+
E && he();
|
1909 |
+
});
|
1910 |
+
let j = null;
|
1911 |
+
function sn(y) {
|
1912 |
+
lt[y ? "unshift" : "push"](() => {
|
1913 |
+
Y = y, n(16, Y), n(7, b), n(14, H), n(15, X);
|
1914 |
+
});
|
1915 |
+
}
|
1916 |
+
function rn(y) {
|
1917 |
+
lt[y ? "unshift" : "push"](() => {
|
1918 |
+
c = y, n(13, c);
|
1919 |
+
});
|
1920 |
+
}
|
1921 |
+
return e.$$set = (y) => {
|
1922 |
+
"i18n" in y && n(1, f = y.i18n), "eta" in y && n(0, r = y.eta), "queue_position" in y && n(2, o = y.queue_position), "queue_size" in y && n(3, a = y.queue_size), "status" in y && n(4, u = y.status), "scroll_to_output" in y && n(21, m = y.scroll_to_output), "timer" in y && n(5, h = y.timer), "show_progress" in y && n(6, d = y.show_progress), "message" in y && n(22, p = y.message), "progress" in y && n(7, b = y.progress), "variant" in y && n(8, v = y.variant), "loading_text" in y && n(9, w = y.loading_text), "absolute" in y && n(10, k = y.absolute), "translucent" in y && n(11, g = y.translucent), "border" in y && n(12, _ = y.border), "autoscroll" in y && n(23, C = y.autoscroll), "$$scope" in y && n(28, s = y.$$scope);
|
1923 |
+
}, e.$$.update = () => {
|
1924 |
+
e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
|
1925 |
+
218103809 && (r === null && n(0, r = T), r != null && T !== r && (n(27, M = (performance.now() - N) / 1e3 + r), n(19, j = M.toFixed(1)), n(26, T = r))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/
|
1926 |
+
167772160 && n(17, me = M === null || M <= 0 || !F ? null : Math.min(F / M, 1)), e.$$.dirty[0] & /*progress*/
|
1927 |
+
128 && b != null && n(18, le = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
|
1928 |
+
114816 && (b != null ? n(14, H = b.map((y) => {
|
1929 |
+
if (y.index != null && y.length != null)
|
1930 |
+
return y.index / y.length;
|
1931 |
+
if (y.progress != null)
|
1932 |
+
return y.progress;
|
1933 |
+
})) : n(14, H = null), H ? (n(15, X = H[H.length - 1]), Y && (X === 0 ? n(16, Y.style.transition = "0", Y) : n(16, Y.style.transition = "150ms", Y))) : n(15, X = void 0)), e.$$.dirty[0] & /*status*/
|
1934 |
+
16 && (u === "pending" ? ye() : he()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
|
1935 |
+
10493968 && c && m && (u === "pending" || u === "complete") && Kl(c, C), e.$$.dirty[0] & /*status, message*/
|
1936 |
+
4194320, e.$$.dirty[0] & /*timer_diff*/
|
1937 |
+
33554432 && n(20, l = F.toFixed(1));
|
1938 |
+
}, [
|
1939 |
+
r,
|
1940 |
+
f,
|
1941 |
+
o,
|
1942 |
+
a,
|
1943 |
+
u,
|
1944 |
+
h,
|
1945 |
+
d,
|
1946 |
+
b,
|
1947 |
+
v,
|
1948 |
+
w,
|
1949 |
+
k,
|
1950 |
+
g,
|
1951 |
+
_,
|
1952 |
+
c,
|
1953 |
+
H,
|
1954 |
+
X,
|
1955 |
+
Y,
|
1956 |
+
me,
|
1957 |
+
le,
|
1958 |
+
j,
|
1959 |
+
l,
|
1960 |
+
m,
|
1961 |
+
p,
|
1962 |
+
C,
|
1963 |
+
N,
|
1964 |
+
F,
|
1965 |
+
T,
|
1966 |
+
M,
|
1967 |
+
s,
|
1968 |
+
i,
|
1969 |
+
sn,
|
1970 |
+
rn
|
1971 |
+
];
|
1972 |
+
}
|
1973 |
+
class Wl extends kl {
|
1974 |
+
constructor(t) {
|
1975 |
+
super(), El(
|
1976 |
+
this,
|
1977 |
+
t,
|
1978 |
+
Gl,
|
1979 |
+
Yl,
|
1980 |
+
Fl,
|
1981 |
+
{
|
1982 |
+
i18n: 1,
|
1983 |
+
eta: 0,
|
1984 |
+
queue_position: 2,
|
1985 |
+
queue_size: 3,
|
1986 |
+
status: 4,
|
1987 |
+
scroll_to_output: 21,
|
1988 |
+
timer: 5,
|
1989 |
+
show_progress: 6,
|
1990 |
+
message: 22,
|
1991 |
+
progress: 7,
|
1992 |
+
variant: 8,
|
1993 |
+
loading_text: 9,
|
1994 |
+
absolute: 10,
|
1995 |
+
translucent: 11,
|
1996 |
+
border: 12,
|
1997 |
+
autoscroll: 23
|
1998 |
+
},
|
1999 |
+
null,
|
2000 |
+
[-1, -1]
|
2001 |
+
);
|
2002 |
+
}
|
2003 |
+
}
|
2004 |
+
var Jl = { value: () => {
|
2005 |
+
} };
|
2006 |
+
function Ht() {
|
2007 |
+
for (var e = 0, t = arguments.length, n = {}, l; e < t; ++e) {
|
2008 |
+
if (!(l = arguments[e] + "") || l in n || /[\s.]/.test(l))
|
2009 |
+
throw new Error("illegal type: " + l);
|
2010 |
+
n[l] = [];
|
2011 |
+
}
|
2012 |
+
return new Me(n);
|
2013 |
+
}
|
2014 |
+
function Me(e) {
|
2015 |
+
this._ = e;
|
2016 |
+
}
|
2017 |
+
function Ql(e, t) {
|
2018 |
+
return e.trim().split(/^|\s+/).map(function(n) {
|
2019 |
+
var l = "", i = n.indexOf(".");
|
2020 |
+
if (i >= 0 && (l = n.slice(i + 1), n = n.slice(0, i)), n && !t.hasOwnProperty(n))
|
2021 |
+
throw new Error("unknown type: " + n);
|
2022 |
+
return { type: n, name: l };
|
2023 |
+
});
|
2024 |
+
}
|
2025 |
+
Me.prototype = Ht.prototype = {
|
2026 |
+
constructor: Me,
|
2027 |
+
on: function(e, t) {
|
2028 |
+
var n = this._, l = Ql(e + "", n), i, s = -1, f = l.length;
|
2029 |
+
if (arguments.length < 2) {
|
2030 |
+
for (; ++s < f; )
|
2031 |
+
if ((i = (e = l[s]).type) && (i = jl(n[i], e.name)))
|
2032 |
+
return i;
|
2033 |
+
return;
|
2034 |
+
}
|
2035 |
+
if (t != null && typeof t != "function")
|
2036 |
+
throw new Error("invalid callback: " + t);
|
2037 |
+
for (; ++s < f; )
|
2038 |
+
if (i = (e = l[s]).type)
|
2039 |
+
n[i] = bt(n[i], e.name, t);
|
2040 |
+
else if (t == null)
|
2041 |
+
for (i in n)
|
2042 |
+
n[i] = bt(n[i], e.name, null);
|
2043 |
+
return this;
|
2044 |
+
},
|
2045 |
+
copy: function() {
|
2046 |
+
var e = {}, t = this._;
|
2047 |
+
for (var n in t)
|
2048 |
+
e[n] = t[n].slice();
|
2049 |
+
return new Me(e);
|
2050 |
+
},
|
2051 |
+
call: function(e, t) {
|
2052 |
+
if ((i = arguments.length - 2) > 0)
|
2053 |
+
for (var n = new Array(i), l = 0, i, s; l < i; ++l)
|
2054 |
+
n[l] = arguments[l + 2];
|
2055 |
+
if (!this._.hasOwnProperty(e))
|
2056 |
+
throw new Error("unknown type: " + e);
|
2057 |
+
for (s = this._[e], l = 0, i = s.length; l < i; ++l)
|
2058 |
+
s[l].value.apply(t, n);
|
2059 |
+
},
|
2060 |
+
apply: function(e, t, n) {
|
2061 |
+
if (!this._.hasOwnProperty(e))
|
2062 |
+
throw new Error("unknown type: " + e);
|
2063 |
+
for (var l = this._[e], i = 0, s = l.length; i < s; ++i)
|
2064 |
+
l[i].value.apply(t, n);
|
2065 |
+
}
|
2066 |
+
};
|
2067 |
+
function jl(e, t) {
|
2068 |
+
for (var n = 0, l = e.length, i; n < l; ++n)
|
2069 |
+
if ((i = e[n]).name === t)
|
2070 |
+
return i.value;
|
2071 |
+
}
|
2072 |
+
function bt(e, t, n) {
|
2073 |
+
for (var l = 0, i = e.length; l < i; ++l)
|
2074 |
+
if (e[l].name === t) {
|
2075 |
+
e[l] = Jl, e = e.slice(0, l).concat(e.slice(l + 1));
|
2076 |
+
break;
|
2077 |
+
}
|
2078 |
+
return n != null && e.push({ name: t, value: n }), e;
|
2079 |
+
}
|
2080 |
+
var Ze = "http://www.w3.org/1999/xhtml";
|
2081 |
+
const wt = {
|
2082 |
+
svg: "http://www.w3.org/2000/svg",
|
2083 |
+
xhtml: Ze,
|
2084 |
+
xlink: "http://www.w3.org/1999/xlink",
|
2085 |
+
xml: "http://www.w3.org/XML/1998/namespace",
|
2086 |
+
xmlns: "http://www.w3.org/2000/xmlns/"
|
2087 |
+
};
|
2088 |
+
function Xt(e) {
|
2089 |
+
var t = e += "", n = t.indexOf(":");
|
2090 |
+
return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), wt.hasOwnProperty(t) ? { space: wt[t], local: e } : e;
|
2091 |
+
}
|
2092 |
+
function xl(e) {
|
2093 |
+
return function() {
|
2094 |
+
var t = this.ownerDocument, n = this.namespaceURI;
|
2095 |
+
return n === Ze && t.documentElement.namespaceURI === Ze ? t.createElement(e) : t.createElementNS(n, e);
|
2096 |
+
};
|
2097 |
+
}
|
2098 |
+
function $l(e) {
|
2099 |
+
return function() {
|
2100 |
+
return this.ownerDocument.createElementNS(e.space, e.local);
|
2101 |
+
};
|
2102 |
+
}
|
2103 |
+
function Yt(e) {
|
2104 |
+
var t = Xt(e);
|
2105 |
+
return (t.local ? $l : xl)(t);
|
2106 |
+
}
|
2107 |
+
function ei() {
|
2108 |
+
}
|
2109 |
+
function Kt(e) {
|
2110 |
+
return e == null ? ei : function() {
|
2111 |
+
return this.querySelector(e);
|
2112 |
+
};
|
2113 |
+
}
|
2114 |
+
function ti(e) {
|
2115 |
+
typeof e != "function" && (e = Kt(e));
|
2116 |
+
for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
|
2117 |
+
for (var s = t[i], f = s.length, r = l[i] = new Array(f), o, a, u = 0; u < f; ++u)
|
2118 |
+
(o = s[u]) && (a = e.call(o, o.__data__, u, s)) && ("__data__" in o && (a.__data__ = o.__data__), r[u] = a);
|
2119 |
+
return new I(l, this._parents);
|
2120 |
+
}
|
2121 |
+
function ni(e) {
|
2122 |
+
return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
|
2123 |
+
}
|
2124 |
+
function li() {
|
2125 |
+
return [];
|
2126 |
+
}
|
2127 |
+
function ii(e) {
|
2128 |
+
return e == null ? li : function() {
|
2129 |
+
return this.querySelectorAll(e);
|
2130 |
+
};
|
2131 |
+
}
|
2132 |
+
function si(e) {
|
2133 |
+
return function() {
|
2134 |
+
return ni(e.apply(this, arguments));
|
2135 |
+
};
|
2136 |
+
}
|
2137 |
+
function ri(e) {
|
2138 |
+
typeof e == "function" ? e = si(e) : e = ii(e);
|
2139 |
+
for (var t = this._groups, n = t.length, l = [], i = [], s = 0; s < n; ++s)
|
2140 |
+
for (var f = t[s], r = f.length, o, a = 0; a < r; ++a)
|
2141 |
+
(o = f[a]) && (l.push(e.call(o, o.__data__, a, f)), i.push(o));
|
2142 |
+
return new I(l, i);
|
2143 |
+
}
|
2144 |
+
function oi(e) {
|
2145 |
+
return function() {
|
2146 |
+
return this.matches(e);
|
2147 |
+
};
|
2148 |
+
}
|
2149 |
+
function Gt(e) {
|
2150 |
+
return function(t) {
|
2151 |
+
return t.matches(e);
|
2152 |
+
};
|
2153 |
+
}
|
2154 |
+
var fi = Array.prototype.find;
|
2155 |
+
function ai(e) {
|
2156 |
+
return function() {
|
2157 |
+
return fi.call(this.children, e);
|
2158 |
+
};
|
2159 |
+
}
|
2160 |
+
function ui() {
|
2161 |
+
return this.firstElementChild;
|
2162 |
+
}
|
2163 |
+
function ci(e) {
|
2164 |
+
return this.select(e == null ? ui : ai(typeof e == "function" ? e : Gt(e)));
|
2165 |
+
}
|
2166 |
+
var _i = Array.prototype.filter;
|
2167 |
+
function di() {
|
2168 |
+
return Array.from(this.children);
|
2169 |
+
}
|
2170 |
+
function mi(e) {
|
2171 |
+
return function() {
|
2172 |
+
return _i.call(this.children, e);
|
2173 |
+
};
|
2174 |
+
}
|
2175 |
+
function hi(e) {
|
2176 |
+
return this.selectAll(e == null ? di : mi(typeof e == "function" ? e : Gt(e)));
|
2177 |
+
}
|
2178 |
+
function pi(e) {
|
2179 |
+
typeof e != "function" && (e = oi(e));
|
2180 |
+
for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
|
2181 |
+
for (var s = t[i], f = s.length, r = l[i] = [], o, a = 0; a < f; ++a)
|
2182 |
+
(o = s[a]) && e.call(o, o.__data__, a, s) && r.push(o);
|
2183 |
+
return new I(l, this._parents);
|
2184 |
+
}
|
2185 |
+
function Wt(e) {
|
2186 |
+
return new Array(e.length);
|
2187 |
+
}
|
2188 |
+
function gi() {
|
2189 |
+
return new I(this._enter || this._groups.map(Wt), this._parents);
|
2190 |
+
}
|
2191 |
+
function Te(e, t) {
|
2192 |
+
this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
|
2193 |
+
}
|
2194 |
+
Te.prototype = {
|
2195 |
+
constructor: Te,
|
2196 |
+
appendChild: function(e) {
|
2197 |
+
return this._parent.insertBefore(e, this._next);
|
2198 |
+
},
|
2199 |
+
insertBefore: function(e, t) {
|
2200 |
+
return this._parent.insertBefore(e, t);
|
2201 |
+
},
|
2202 |
+
querySelector: function(e) {
|
2203 |
+
return this._parent.querySelector(e);
|
2204 |
+
},
|
2205 |
+
querySelectorAll: function(e) {
|
2206 |
+
return this._parent.querySelectorAll(e);
|
2207 |
+
}
|
2208 |
+
};
|
2209 |
+
function bi(e) {
|
2210 |
+
return function() {
|
2211 |
+
return e;
|
2212 |
+
};
|
2213 |
+
}
|
2214 |
+
function wi(e, t, n, l, i, s) {
|
2215 |
+
for (var f = 0, r, o = t.length, a = s.length; f < a; ++f)
|
2216 |
+
(r = t[f]) ? (r.__data__ = s[f], l[f] = r) : n[f] = new Te(e, s[f]);
|
2217 |
+
for (; f < o; ++f)
|
2218 |
+
(r = t[f]) && (i[f] = r);
|
2219 |
+
}
|
2220 |
+
function vi(e, t, n, l, i, s, f) {
|
2221 |
+
var r, o, a = /* @__PURE__ */ new Map(), u = t.length, m = s.length, h = new Array(u), d;
|
2222 |
+
for (r = 0; r < u; ++r)
|
2223 |
+
(o = t[r]) && (h[r] = d = f.call(o, o.__data__, r, t) + "", a.has(d) ? i[r] = o : a.set(d, o));
|
2224 |
+
for (r = 0; r < m; ++r)
|
2225 |
+
d = f.call(e, s[r], r, s) + "", (o = a.get(d)) ? (l[r] = o, o.__data__ = s[r], a.delete(d)) : n[r] = new Te(e, s[r]);
|
2226 |
+
for (r = 0; r < u; ++r)
|
2227 |
+
(o = t[r]) && a.get(h[r]) === o && (i[r] = o);
|
2228 |
+
}
|
2229 |
+
function yi(e) {
|
2230 |
+
return e.__data__;
|
2231 |
+
}
|
2232 |
+
function ki(e, t) {
|
2233 |
+
if (!arguments.length)
|
2234 |
+
return Array.from(this, yi);
|
2235 |
+
var n = t ? vi : wi, l = this._parents, i = this._groups;
|
2236 |
+
typeof e != "function" && (e = bi(e));
|
2237 |
+
for (var s = i.length, f = new Array(s), r = new Array(s), o = new Array(s), a = 0; a < s; ++a) {
|
2238 |
+
var u = l[a], m = i[a], h = m.length, d = Ci(e.call(u, u && u.__data__, a, l)), p = d.length, b = r[a] = new Array(p), v = f[a] = new Array(p), w = o[a] = new Array(h);
|
2239 |
+
n(u, m, b, v, w, d, t);
|
2240 |
+
for (var k = 0, g = 0, _, C; k < p; ++k)
|
2241 |
+
if (_ = b[k]) {
|
2242 |
+
for (k >= g && (g = k + 1); !(C = v[g]) && ++g < p; )
|
2243 |
+
;
|
2244 |
+
_._next = C || null;
|
2245 |
+
}
|
2246 |
+
}
|
2247 |
+
return f = new I(f, l), f._enter = r, f._exit = o, f;
|
2248 |
+
}
|
2249 |
+
function Ci(e) {
|
2250 |
+
return typeof e == "object" && "length" in e ? e : Array.from(e);
|
2251 |
+
}
|
2252 |
+
function Ai() {
|
2253 |
+
return new I(this._exit || this._groups.map(Wt), this._parents);
|
2254 |
+
}
|
2255 |
+
function Si(e, t, n) {
|
2256 |
+
var l = this.enter(), i = this, s = this.exit();
|
2257 |
+
return typeof e == "function" ? (l = e(l), l && (l = l.selection())) : l = l.append(e + ""), t != null && (i = t(i), i && (i = i.selection())), n == null ? s.remove() : n(s), l && i ? l.merge(i).order() : i;
|
2258 |
+
}
|
2259 |
+
function Ni(e) {
|
2260 |
+
for (var t = e.selection ? e.selection() : e, n = this._groups, l = t._groups, i = n.length, s = l.length, f = Math.min(i, s), r = new Array(i), o = 0; o < f; ++o)
|
2261 |
+
for (var a = n[o], u = l[o], m = a.length, h = r[o] = new Array(m), d, p = 0; p < m; ++p)
|
2262 |
+
(d = a[p] || u[p]) && (h[p] = d);
|
2263 |
+
for (; o < i; ++o)
|
2264 |
+
r[o] = n[o];
|
2265 |
+
return new I(r, this._parents);
|
2266 |
+
}
|
2267 |
+
function Li() {
|
2268 |
+
for (var e = this._groups, t = -1, n = e.length; ++t < n; )
|
2269 |
+
for (var l = e[t], i = l.length - 1, s = l[i], f; --i >= 0; )
|
2270 |
+
(f = l[i]) && (s && f.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(f, s), s = f);
|
2271 |
+
return this;
|
2272 |
+
}
|
2273 |
+
function Ei(e) {
|
2274 |
+
e || (e = qi);
|
2275 |
+
function t(m, h) {
|
2276 |
+
return m && h ? e(m.__data__, h.__data__) : !m - !h;
|
2277 |
+
}
|
2278 |
+
for (var n = this._groups, l = n.length, i = new Array(l), s = 0; s < l; ++s) {
|
2279 |
+
for (var f = n[s], r = f.length, o = i[s] = new Array(r), a, u = 0; u < r; ++u)
|
2280 |
+
(a = f[u]) && (o[u] = a);
|
2281 |
+
o.sort(t);
|
2282 |
+
}
|
2283 |
+
return new I(i, this._parents).order();
|
2284 |
+
}
|
2285 |
+
function qi(e, t) {
|
2286 |
+
return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
2287 |
+
}
|
2288 |
+
function Fi() {
|
2289 |
+
var e = arguments[0];
|
2290 |
+
return arguments[0] = this, e.apply(null, arguments), this;
|
2291 |
+
}
|
2292 |
+
function Mi() {
|
2293 |
+
return Array.from(this);
|
2294 |
+
}
|
2295 |
+
function Pi() {
|
2296 |
+
for (var e = this._groups, t = 0, n = e.length; t < n; ++t)
|
2297 |
+
for (var l = e[t], i = 0, s = l.length; i < s; ++i) {
|
2298 |
+
var f = l[i];
|
2299 |
+
if (f)
|
2300 |
+
return f;
|
2301 |
+
}
|
2302 |
+
return null;
|
2303 |
+
}
|
2304 |
+
function Vi() {
|
2305 |
+
let e = 0;
|
2306 |
+
for (const t of this)
|
2307 |
+
++e;
|
2308 |
+
return e;
|
2309 |
+
}
|
2310 |
+
function Ti() {
|
2311 |
+
return !this.node();
|
2312 |
+
}
|
2313 |
+
function zi(e) {
|
2314 |
+
for (var t = this._groups, n = 0, l = t.length; n < l; ++n)
|
2315 |
+
for (var i = t[n], s = 0, f = i.length, r; s < f; ++s)
|
2316 |
+
(r = i[s]) && e.call(r, r.__data__, s, i);
|
2317 |
+
return this;
|
2318 |
+
}
|
2319 |
+
function Bi(e) {
|
2320 |
+
return function() {
|
2321 |
+
this.removeAttribute(e);
|
2322 |
+
};
|
2323 |
+
}
|
2324 |
+
function Di(e) {
|
2325 |
+
return function() {
|
2326 |
+
this.removeAttributeNS(e.space, e.local);
|
2327 |
+
};
|
2328 |
+
}
|
2329 |
+
function Ri(e, t) {
|
2330 |
+
return function() {
|
2331 |
+
this.setAttribute(e, t);
|
2332 |
+
};
|
2333 |
+
}
|
2334 |
+
function Ii(e, t) {
|
2335 |
+
return function() {
|
2336 |
+
this.setAttributeNS(e.space, e.local, t);
|
2337 |
+
};
|
2338 |
+
}
|
2339 |
+
function Oi(e, t) {
|
2340 |
+
return function() {
|
2341 |
+
var n = t.apply(this, arguments);
|
2342 |
+
n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
|
2343 |
+
};
|
2344 |
+
}
|
2345 |
+
function Ui(e, t) {
|
2346 |
+
return function() {
|
2347 |
+
var n = t.apply(this, arguments);
|
2348 |
+
n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
|
2349 |
+
};
|
2350 |
+
}
|
2351 |
+
function Zi(e, t) {
|
2352 |
+
var n = Xt(e);
|
2353 |
+
if (arguments.length < 2) {
|
2354 |
+
var l = this.node();
|
2355 |
+
return n.local ? l.getAttributeNS(n.space, n.local) : l.getAttribute(n);
|
2356 |
+
}
|
2357 |
+
return this.each((t == null ? n.local ? Di : Bi : typeof t == "function" ? n.local ? Ui : Oi : n.local ? Ii : Ri)(n, t));
|
2358 |
+
}
|
2359 |
+
function Jt(e) {
|
2360 |
+
return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
|
2361 |
+
}
|
2362 |
+
function Hi(e) {
|
2363 |
+
return function() {
|
2364 |
+
this.style.removeProperty(e);
|
2365 |
+
};
|
2366 |
+
}
|
2367 |
+
function Xi(e, t, n) {
|
2368 |
+
return function() {
|
2369 |
+
this.style.setProperty(e, t, n);
|
2370 |
+
};
|
2371 |
+
}
|
2372 |
+
function Yi(e, t, n) {
|
2373 |
+
return function() {
|
2374 |
+
var l = t.apply(this, arguments);
|
2375 |
+
l == null ? this.style.removeProperty(e) : this.style.setProperty(e, l, n);
|
2376 |
+
};
|
2377 |
+
}
|
2378 |
+
function Ki(e, t, n) {
|
2379 |
+
return arguments.length > 1 ? this.each((t == null ? Hi : typeof t == "function" ? Yi : Xi)(e, t, n ?? "")) : Gi(this.node(), e);
|
2380 |
+
}
|
2381 |
+
function Gi(e, t) {
|
2382 |
+
return e.style.getPropertyValue(t) || Jt(e).getComputedStyle(e, null).getPropertyValue(t);
|
2383 |
+
}
|
2384 |
+
function Wi(e) {
|
2385 |
+
return function() {
|
2386 |
+
delete this[e];
|
2387 |
+
};
|
2388 |
+
}
|
2389 |
+
function Ji(e, t) {
|
2390 |
+
return function() {
|
2391 |
+
this[e] = t;
|
2392 |
+
};
|
2393 |
+
}
|
2394 |
+
function Qi(e, t) {
|
2395 |
+
return function() {
|
2396 |
+
var n = t.apply(this, arguments);
|
2397 |
+
n == null ? delete this[e] : this[e] = n;
|
2398 |
+
};
|
2399 |
+
}
|
2400 |
+
function ji(e, t) {
|
2401 |
+
return arguments.length > 1 ? this.each((t == null ? Wi : typeof t == "function" ? Qi : Ji)(e, t)) : this.node()[e];
|
2402 |
+
}
|
2403 |
+
function Qt(e) {
|
2404 |
+
return e.trim().split(/^|\s+/);
|
2405 |
+
}
|
2406 |
+
function Ke(e) {
|
2407 |
+
return e.classList || new jt(e);
|
2408 |
+
}
|
2409 |
+
function jt(e) {
|
2410 |
+
this._node = e, this._names = Qt(e.getAttribute("class") || "");
|
2411 |
+
}
|
2412 |
+
jt.prototype = {
|
2413 |
+
add: function(e) {
|
2414 |
+
var t = this._names.indexOf(e);
|
2415 |
+
t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
|
2416 |
+
},
|
2417 |
+
remove: function(e) {
|
2418 |
+
var t = this._names.indexOf(e);
|
2419 |
+
t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" ")));
|
2420 |
+
},
|
2421 |
+
contains: function(e) {
|
2422 |
+
return this._names.indexOf(e) >= 0;
|
2423 |
+
}
|
2424 |
+
};
|
2425 |
+
function xt(e, t) {
|
2426 |
+
for (var n = Ke(e), l = -1, i = t.length; ++l < i; )
|
2427 |
+
n.add(t[l]);
|
2428 |
+
}
|
2429 |
+
function $t(e, t) {
|
2430 |
+
for (var n = Ke(e), l = -1, i = t.length; ++l < i; )
|
2431 |
+
n.remove(t[l]);
|
2432 |
+
}
|
2433 |
+
function xi(e) {
|
2434 |
+
return function() {
|
2435 |
+
xt(this, e);
|
2436 |
+
};
|
2437 |
+
}
|
2438 |
+
function $i(e) {
|
2439 |
+
return function() {
|
2440 |
+
$t(this, e);
|
2441 |
+
};
|
2442 |
+
}
|
2443 |
+
function es(e, t) {
|
2444 |
+
return function() {
|
2445 |
+
(t.apply(this, arguments) ? xt : $t)(this, e);
|
2446 |
+
};
|
2447 |
+
}
|
2448 |
+
function ts(e, t) {
|
2449 |
+
var n = Qt(e + "");
|
2450 |
+
if (arguments.length < 2) {
|
2451 |
+
for (var l = Ke(this.node()), i = -1, s = n.length; ++i < s; )
|
2452 |
+
if (!l.contains(n[i]))
|
2453 |
+
return !1;
|
2454 |
+
return !0;
|
2455 |
+
}
|
2456 |
+
return this.each((typeof t == "function" ? es : t ? xi : $i)(n, t));
|
2457 |
+
}
|
2458 |
+
function ns() {
|
2459 |
+
this.textContent = "";
|
2460 |
+
}
|
2461 |
+
function ls(e) {
|
2462 |
+
return function() {
|
2463 |
+
this.textContent = e;
|
2464 |
+
};
|
2465 |
+
}
|
2466 |
+
function is(e) {
|
2467 |
+
return function() {
|
2468 |
+
var t = e.apply(this, arguments);
|
2469 |
+
this.textContent = t ?? "";
|
2470 |
+
};
|
2471 |
+
}
|
2472 |
+
function ss(e) {
|
2473 |
+
return arguments.length ? this.each(e == null ? ns : (typeof e == "function" ? is : ls)(e)) : this.node().textContent;
|
2474 |
+
}
|
2475 |
+
function rs() {
|
2476 |
+
this.innerHTML = "";
|
2477 |
+
}
|
2478 |
+
function os(e) {
|
2479 |
+
return function() {
|
2480 |
+
this.innerHTML = e;
|
2481 |
+
};
|
2482 |
+
}
|
2483 |
+
function fs(e) {
|
2484 |
+
return function() {
|
2485 |
+
var t = e.apply(this, arguments);
|
2486 |
+
this.innerHTML = t ?? "";
|
2487 |
+
};
|
2488 |
+
}
|
2489 |
+
function as(e) {
|
2490 |
+
return arguments.length ? this.each(e == null ? rs : (typeof e == "function" ? fs : os)(e)) : this.node().innerHTML;
|
2491 |
+
}
|
2492 |
+
function us() {
|
2493 |
+
this.nextSibling && this.parentNode.appendChild(this);
|
2494 |
+
}
|
2495 |
+
function cs() {
|
2496 |
+
return this.each(us);
|
2497 |
+
}
|
2498 |
+
function _s() {
|
2499 |
+
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
2500 |
+
}
|
2501 |
+
function ds() {
|
2502 |
+
return this.each(_s);
|
2503 |
+
}
|
2504 |
+
function ms(e) {
|
2505 |
+
var t = typeof e == "function" ? e : Yt(e);
|
2506 |
+
return this.select(function() {
|
2507 |
+
return this.appendChild(t.apply(this, arguments));
|
2508 |
+
});
|
2509 |
+
}
|
2510 |
+
function hs() {
|
2511 |
+
return null;
|
2512 |
+
}
|
2513 |
+
function ps(e, t) {
|
2514 |
+
var n = typeof e == "function" ? e : Yt(e), l = t == null ? hs : typeof t == "function" ? t : Kt(t);
|
2515 |
+
return this.select(function() {
|
2516 |
+
return this.insertBefore(n.apply(this, arguments), l.apply(this, arguments) || null);
|
2517 |
+
});
|
2518 |
+
}
|
2519 |
+
function gs() {
|
2520 |
+
var e = this.parentNode;
|
2521 |
+
e && e.removeChild(this);
|
2522 |
+
}
|
2523 |
+
function bs() {
|
2524 |
+
return this.each(gs);
|
2525 |
+
}
|
2526 |
+
function ws() {
|
2527 |
+
var e = this.cloneNode(!1), t = this.parentNode;
|
2528 |
+
return t ? t.insertBefore(e, this.nextSibling) : e;
|
2529 |
+
}
|
2530 |
+
function vs() {
|
2531 |
+
var e = this.cloneNode(!0), t = this.parentNode;
|
2532 |
+
return t ? t.insertBefore(e, this.nextSibling) : e;
|
2533 |
+
}
|
2534 |
+
function ys(e) {
|
2535 |
+
return this.select(e ? vs : ws);
|
2536 |
+
}
|
2537 |
+
function ks(e) {
|
2538 |
+
return arguments.length ? this.property("__data__", e) : this.node().__data__;
|
2539 |
+
}
|
2540 |
+
function Cs(e) {
|
2541 |
+
return function(t) {
|
2542 |
+
e.call(this, t, this.__data__);
|
2543 |
+
};
|
2544 |
+
}
|
2545 |
+
function As(e) {
|
2546 |
+
return e.trim().split(/^|\s+/).map(function(t) {
|
2547 |
+
var n = "", l = t.indexOf(".");
|
2548 |
+
return l >= 0 && (n = t.slice(l + 1), t = t.slice(0, l)), { type: t, name: n };
|
2549 |
+
});
|
2550 |
+
}
|
2551 |
+
function Ss(e) {
|
2552 |
+
return function() {
|
2553 |
+
var t = this.__on;
|
2554 |
+
if (t) {
|
2555 |
+
for (var n = 0, l = -1, i = t.length, s; n < i; ++n)
|
2556 |
+
s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++l] = s;
|
2557 |
+
++l ? t.length = l : delete this.__on;
|
2558 |
+
}
|
2559 |
+
};
|
2560 |
+
}
|
2561 |
+
function Ns(e, t, n) {
|
2562 |
+
return function() {
|
2563 |
+
var l = this.__on, i, s = Cs(t);
|
2564 |
+
if (l) {
|
2565 |
+
for (var f = 0, r = l.length; f < r; ++f)
|
2566 |
+
if ((i = l[f]).type === e.type && i.name === e.name) {
|
2567 |
+
this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t;
|
2568 |
+
return;
|
2569 |
+
}
|
2570 |
+
}
|
2571 |
+
this.addEventListener(e.type, s, n), i = { type: e.type, name: e.name, value: t, listener: s, options: n }, l ? l.push(i) : this.__on = [i];
|
2572 |
+
};
|
2573 |
+
}
|
2574 |
+
function Ls(e, t, n) {
|
2575 |
+
var l = As(e + ""), i, s = l.length, f;
|
2576 |
+
if (arguments.length < 2) {
|
2577 |
+
var r = this.node().__on;
|
2578 |
+
if (r) {
|
2579 |
+
for (var o = 0, a = r.length, u; o < a; ++o)
|
2580 |
+
for (i = 0, u = r[o]; i < s; ++i)
|
2581 |
+
if ((f = l[i]).type === u.type && f.name === u.name)
|
2582 |
+
return u.value;
|
2583 |
+
}
|
2584 |
+
return;
|
2585 |
+
}
|
2586 |
+
for (r = t ? Ns : Ss, i = 0; i < s; ++i)
|
2587 |
+
this.each(r(l[i], t, n));
|
2588 |
+
return this;
|
2589 |
+
}
|
2590 |
+
function en(e, t, n) {
|
2591 |
+
var l = Jt(e), i = l.CustomEvent;
|
2592 |
+
typeof i == "function" ? i = new i(t, n) : (i = l.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i);
|
2593 |
+
}
|
2594 |
+
function Es(e, t) {
|
2595 |
+
return function() {
|
2596 |
+
return en(this, e, t);
|
2597 |
+
};
|
2598 |
+
}
|
2599 |
+
function qs(e, t) {
|
2600 |
+
return function() {
|
2601 |
+
return en(this, e, t.apply(this, arguments));
|
2602 |
+
};
|
2603 |
+
}
|
2604 |
+
function Fs(e, t) {
|
2605 |
+
return this.each((typeof t == "function" ? qs : Es)(e, t));
|
2606 |
+
}
|
2607 |
+
function* Ms() {
|
2608 |
+
for (var e = this._groups, t = 0, n = e.length; t < n; ++t)
|
2609 |
+
for (var l = e[t], i = 0, s = l.length, f; i < s; ++i)
|
2610 |
+
(f = l[i]) && (yield f);
|
2611 |
+
}
|
2612 |
+
var Ps = [null];
|
2613 |
+
function I(e, t) {
|
2614 |
+
this._groups = e, this._parents = t;
|
2615 |
+
}
|
2616 |
+
function Vs() {
|
2617 |
+
return this;
|
2618 |
+
}
|
2619 |
+
I.prototype = {
|
2620 |
+
constructor: I,
|
2621 |
+
select: ti,
|
2622 |
+
selectAll: ri,
|
2623 |
+
selectChild: ci,
|
2624 |
+
selectChildren: hi,
|
2625 |
+
filter: pi,
|
2626 |
+
data: ki,
|
2627 |
+
enter: gi,
|
2628 |
+
exit: Ai,
|
2629 |
+
join: Si,
|
2630 |
+
merge: Ni,
|
2631 |
+
selection: Vs,
|
2632 |
+
order: Li,
|
2633 |
+
sort: Ei,
|
2634 |
+
call: Fi,
|
2635 |
+
nodes: Mi,
|
2636 |
+
node: Pi,
|
2637 |
+
size: Vi,
|
2638 |
+
empty: Ti,
|
2639 |
+
each: zi,
|
2640 |
+
attr: Zi,
|
2641 |
+
style: Ki,
|
2642 |
+
property: ji,
|
2643 |
+
classed: ts,
|
2644 |
+
text: ss,
|
2645 |
+
html: as,
|
2646 |
+
raise: cs,
|
2647 |
+
lower: ds,
|
2648 |
+
append: ms,
|
2649 |
+
insert: ps,
|
2650 |
+
remove: bs,
|
2651 |
+
clone: ys,
|
2652 |
+
datum: ks,
|
2653 |
+
on: Ls,
|
2654 |
+
dispatch: Fs,
|
2655 |
+
[Symbol.iterator]: Ms
|
2656 |
+
};
|
2657 |
+
function we(e) {
|
2658 |
+
return typeof e == "string" ? new I([[document.querySelector(e)]], [document.documentElement]) : new I([[e]], Ps);
|
2659 |
+
}
|
2660 |
+
function Ts(e) {
|
2661 |
+
let t;
|
2662 |
+
for (; t = e.sourceEvent; )
|
2663 |
+
e = t;
|
2664 |
+
return e;
|
2665 |
+
}
|
2666 |
+
function vt(e, t) {
|
2667 |
+
if (e = Ts(e), t === void 0 && (t = e.currentTarget), t) {
|
2668 |
+
var n = t.ownerSVGElement || t;
|
2669 |
+
if (n.createSVGPoint) {
|
2670 |
+
var l = n.createSVGPoint();
|
2671 |
+
return l.x = e.clientX, l.y = e.clientY, l = l.matrixTransform(t.getScreenCTM().inverse()), [l.x, l.y];
|
2672 |
+
}
|
2673 |
+
if (t.getBoundingClientRect) {
|
2674 |
+
var i = t.getBoundingClientRect();
|
2675 |
+
return [e.clientX - i.left - t.clientLeft, e.clientY - i.top - t.clientTop];
|
2676 |
+
}
|
2677 |
+
}
|
2678 |
+
return [e.pageX, e.pageY];
|
2679 |
+
}
|
2680 |
+
const zs = { passive: !1 }, ve = { capture: !0, passive: !1 };
|
2681 |
+
function Ie(e) {
|
2682 |
+
e.stopImmediatePropagation();
|
2683 |
+
}
|
2684 |
+
function ue(e) {
|
2685 |
+
e.preventDefault(), e.stopImmediatePropagation();
|
2686 |
+
}
|
2687 |
+
function Bs(e) {
|
2688 |
+
var t = e.document.documentElement, n = we(e).on("dragstart.drag", ue, ve);
|
2689 |
+
"onselectstart" in t ? n.on("selectstart.drag", ue, ve) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
|
2690 |
+
}
|
2691 |
+
function Ds(e, t) {
|
2692 |
+
var n = e.document.documentElement, l = we(e).on("dragstart.drag", null);
|
2693 |
+
t && (l.on("click.drag", ue, ve), setTimeout(function() {
|
2694 |
+
l.on("click.drag", null);
|
2695 |
+
}, 0)), "onselectstart" in n ? l.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
|
2696 |
+
}
|
2697 |
+
const Se = (e) => () => e;
|
2698 |
+
function He(e, {
|
2699 |
+
sourceEvent: t,
|
2700 |
+
subject: n,
|
2701 |
+
target: l,
|
2702 |
+
identifier: i,
|
2703 |
+
active: s,
|
2704 |
+
x: f,
|
2705 |
+
y: r,
|
2706 |
+
dx: o,
|
2707 |
+
dy: a,
|
2708 |
+
dispatch: u
|
2709 |
+
}) {
|
2710 |
+
Object.defineProperties(this, {
|
2711 |
+
type: { value: e, enumerable: !0, configurable: !0 },
|
2712 |
+
sourceEvent: { value: t, enumerable: !0, configurable: !0 },
|
2713 |
+
subject: { value: n, enumerable: !0, configurable: !0 },
|
2714 |
+
target: { value: l, enumerable: !0, configurable: !0 },
|
2715 |
+
identifier: { value: i, enumerable: !0, configurable: !0 },
|
2716 |
+
active: { value: s, enumerable: !0, configurable: !0 },
|
2717 |
+
x: { value: f, enumerable: !0, configurable: !0 },
|
2718 |
+
y: { value: r, enumerable: !0, configurable: !0 },
|
2719 |
+
dx: { value: o, enumerable: !0, configurable: !0 },
|
2720 |
+
dy: { value: a, enumerable: !0, configurable: !0 },
|
2721 |
+
_: { value: u }
|
2722 |
+
});
|
2723 |
+
}
|
2724 |
+
He.prototype.on = function() {
|
2725 |
+
var e = this._.on.apply(this._, arguments);
|
2726 |
+
return e === this._ ? this : e;
|
2727 |
+
};
|
2728 |
+
function Rs(e) {
|
2729 |
+
return !e.ctrlKey && !e.button;
|
2730 |
+
}
|
2731 |
+
function Is() {
|
2732 |
+
return this.parentNode;
|
2733 |
+
}
|
2734 |
+
function Os(e, t) {
|
2735 |
+
return t ?? { x: e.x, y: e.y };
|
2736 |
+
}
|
2737 |
+
function Us() {
|
2738 |
+
return navigator.maxTouchPoints || "ontouchstart" in this;
|
2739 |
+
}
|
2740 |
+
function Zs() {
|
2741 |
+
var e = Rs, t = Is, n = Os, l = Us, i = {}, s = Ht("start", "drag", "end"), f = 0, r, o, a, u, m = 0;
|
2742 |
+
function h(_) {
|
2743 |
+
_.on("mousedown.drag", d).filter(l).on("touchstart.drag", v).on("touchmove.drag", w, zs).on("touchend.drag touchcancel.drag", k).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
2744 |
+
}
|
2745 |
+
function d(_, C) {
|
2746 |
+
if (!(u || !e.call(this, _, C))) {
|
2747 |
+
var c = g(this, t.call(this, _, C), _, C, "mouse");
|
2748 |
+
c && (we(_.view).on("mousemove.drag", p, ve).on("mouseup.drag", b, ve), Bs(_.view), Ie(_), a = !1, r = _.clientX, o = _.clientY, c("start", _));
|
2749 |
+
}
|
2750 |
+
}
|
2751 |
+
function p(_) {
|
2752 |
+
if (ue(_), !a) {
|
2753 |
+
var C = _.clientX - r, c = _.clientY - o;
|
2754 |
+
a = C * C + c * c > m;
|
2755 |
+
}
|
2756 |
+
i.mouse("drag", _);
|
2757 |
+
}
|
2758 |
+
function b(_) {
|
2759 |
+
we(_.view).on("mousemove.drag mouseup.drag", null), Ds(_.view, a), ue(_), i.mouse("end", _);
|
2760 |
+
}
|
2761 |
+
function v(_, C) {
|
2762 |
+
if (e.call(this, _, C)) {
|
2763 |
+
var c = _.changedTouches, E = t.call(this, _, C), N = c.length, F, T;
|
2764 |
+
for (F = 0; F < N; ++F)
|
2765 |
+
(T = g(this, E, _, C, c[F].identifier, c[F])) && (Ie(_), T("start", _, c[F]));
|
2766 |
+
}
|
2767 |
+
}
|
2768 |
+
function w(_) {
|
2769 |
+
var C = _.changedTouches, c = C.length, E, N;
|
2770 |
+
for (E = 0; E < c; ++E)
|
2771 |
+
(N = i[C[E].identifier]) && (ue(_), N("drag", _, C[E]));
|
2772 |
+
}
|
2773 |
+
function k(_) {
|
2774 |
+
var C = _.changedTouches, c = C.length, E, N;
|
2775 |
+
for (u && clearTimeout(u), u = setTimeout(function() {
|
2776 |
+
u = null;
|
2777 |
+
}, 500), E = 0; E < c; ++E)
|
2778 |
+
(N = i[C[E].identifier]) && (Ie(_), N("end", _, C[E]));
|
2779 |
+
}
|
2780 |
+
function g(_, C, c, E, N, F) {
|
2781 |
+
var T = s.copy(), M = vt(F || c, C), me, H, X;
|
2782 |
+
if ((X = n.call(_, new He("beforestart", {
|
2783 |
+
sourceEvent: c,
|
2784 |
+
target: h,
|
2785 |
+
identifier: N,
|
2786 |
+
active: f,
|
2787 |
+
x: M[0],
|
2788 |
+
y: M[1],
|
2789 |
+
dx: 0,
|
2790 |
+
dy: 0,
|
2791 |
+
dispatch: T
|
2792 |
+
}), E)) != null)
|
2793 |
+
return me = X.x - M[0] || 0, H = X.y - M[1] || 0, function Y(le, ye, ke) {
|
2794 |
+
var he = M, j;
|
2795 |
+
switch (le) {
|
2796 |
+
case "start":
|
2797 |
+
i[N] = Y, j = f++;
|
2798 |
+
break;
|
2799 |
+
case "end":
|
2800 |
+
delete i[N], --f;
|
2801 |
+
case "drag":
|
2802 |
+
M = vt(ke || ye, C), j = f;
|
2803 |
+
break;
|
2804 |
+
}
|
2805 |
+
T.call(
|
2806 |
+
le,
|
2807 |
+
_,
|
2808 |
+
new He(le, {
|
2809 |
+
sourceEvent: ye,
|
2810 |
+
subject: X,
|
2811 |
+
target: h,
|
2812 |
+
identifier: N,
|
2813 |
+
active: j,
|
2814 |
+
x: M[0] + me,
|
2815 |
+
y: M[1] + H,
|
2816 |
+
dx: M[0] - he[0],
|
2817 |
+
dy: M[1] - he[1],
|
2818 |
+
dispatch: T
|
2819 |
+
}),
|
2820 |
+
E
|
2821 |
+
);
|
2822 |
+
};
|
2823 |
+
}
|
2824 |
+
return h.filter = function(_) {
|
2825 |
+
return arguments.length ? (e = typeof _ == "function" ? _ : Se(!!_), h) : e;
|
2826 |
+
}, h.container = function(_) {
|
2827 |
+
return arguments.length ? (t = typeof _ == "function" ? _ : Se(_), h) : t;
|
2828 |
+
}, h.subject = function(_) {
|
2829 |
+
return arguments.length ? (n = typeof _ == "function" ? _ : Se(_), h) : n;
|
2830 |
+
}, h.touchable = function(_) {
|
2831 |
+
return arguments.length ? (l = typeof _ == "function" ? _ : Se(!!_), h) : l;
|
2832 |
+
}, h.on = function() {
|
2833 |
+
var _ = s.on.apply(s, arguments);
|
2834 |
+
return _ === s ? h : _;
|
2835 |
+
}, h.clickDistance = function(_) {
|
2836 |
+
return arguments.length ? (m = (_ = +_) * _, h) : Math.sqrt(m);
|
2837 |
+
}, h;
|
2838 |
+
}
|
2839 |
+
const {
|
2840 |
+
SvelteComponent: Hs,
|
2841 |
+
append: Xs,
|
2842 |
+
attr: x,
|
2843 |
+
detach: Ys,
|
2844 |
+
init: Ks,
|
2845 |
+
insert: Gs,
|
2846 |
+
noop: yt,
|
2847 |
+
safe_not_equal: Ws,
|
2848 |
+
svg_element: kt
|
2849 |
+
} = window.__gradio__svelte__internal;
|
2850 |
+
function Js(e) {
|
2851 |
+
let t, n;
|
2852 |
+
return {
|
2853 |
+
c() {
|
2854 |
+
t = kt("svg"), n = kt("path"), x(n, "fill", "currentColor"), x(n, "d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"), x(t, "xmlns", "http://www.w3.org/2000/svg"), x(t, "width", "1em"), x(t, "height", "1em"), x(t, "viewBox", "0 0 512 512"), x(
|
2855 |
+
t,
|
2856 |
+
"class",
|
2857 |
+
/*classNames*/
|
2858 |
+
e[0]
|
2859 |
+
);
|
2860 |
+
},
|
2861 |
+
m(l, i) {
|
2862 |
+
Gs(l, t, i), Xs(t, n);
|
2863 |
+
},
|
2864 |
+
p(l, [i]) {
|
2865 |
+
i & /*classNames*/
|
2866 |
+
1 && x(
|
2867 |
+
t,
|
2868 |
+
"class",
|
2869 |
+
/*classNames*/
|
2870 |
+
l[0]
|
2871 |
+
);
|
2872 |
+
},
|
2873 |
+
i: yt,
|
2874 |
+
o: yt,
|
2875 |
+
d(l) {
|
2876 |
+
l && Ys(t);
|
2877 |
+
}
|
2878 |
+
};
|
2879 |
+
}
|
2880 |
+
function Qs(e, t, n) {
|
2881 |
+
let { classNames: l = "" } = t;
|
2882 |
+
return e.$$set = (i) => {
|
2883 |
+
"classNames" in i && n(0, l = i.classNames);
|
2884 |
+
}, [l];
|
2885 |
+
}
|
2886 |
+
class js extends Hs {
|
2887 |
+
constructor(t) {
|
2888 |
+
super(), Ks(this, t, Qs, Js, Ws, { classNames: 0 });
|
2889 |
+
}
|
2890 |
+
}
|
2891 |
+
const {
|
2892 |
+
SvelteComponent: xs,
|
2893 |
+
append: B,
|
2894 |
+
attr: V,
|
2895 |
+
binding_callbacks: Ct,
|
2896 |
+
create_component: $s,
|
2897 |
+
destroy_component: er,
|
2898 |
+
detach: tr,
|
2899 |
+
element: Z,
|
2900 |
+
init: nr,
|
2901 |
+
insert: lr,
|
2902 |
+
listen: J,
|
2903 |
+
mount_component: ir,
|
2904 |
+
run_all: sr,
|
2905 |
+
safe_not_equal: rr,
|
2906 |
+
set_data: or,
|
2907 |
+
set_input_value: At,
|
2908 |
+
set_style: St,
|
2909 |
+
space: Nt,
|
2910 |
+
text: fr,
|
2911 |
+
transition_in: ar,
|
2912 |
+
transition_out: ur
|
2913 |
+
} = window.__gradio__svelte__internal, { onMount: cr, createEventDispatcher: _r } = window.__gradio__svelte__internal;
|
2914 |
+
function dr(e) {
|
2915 |
+
let t, n, l, i, s, f, r, o, a = (
|
2916 |
+
/*prompt*/
|
2917 |
+
e[0].scale.toFixed(1) + ""
|
2918 |
+
), u, m, h, d, p, b, v, w, k, g, _, C;
|
2919 |
+
return w = new js({}), {
|
2920 |
+
c() {
|
2921 |
+
t = Z("div"), n = Z("div"), l = Z("div"), i = Z("div"), s = Z("div"), f = Z("span"), r = Z("span"), o = Z("span"), u = fr(a), m = Nt(), h = Z("div"), d = Z("input"), b = Nt(), v = Z("button"), $s(w.$$.fragment), V(o, "class", "text-black svelte-1wmphae"), V(r, "class", "text-black svelte-1wmphae"), V(f, "class", "flex text-[0.5rem] font-mono text-black dark:group-hover:text-white svelte-1wmphae"), V(s, "class", "bottom-full p-1 svelte-1wmphae"), V(i, "class", "relative svelte-1wmphae"), V(l, "class", "absolute z-10 flex items-center justify-center w-[2.5em] svelte-1wmphae"), V(d, "type", "text"), V(d, "placeholder", "Prompt"), V(d, "class", p = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
|
2922 |
+
(e[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae"), St(d, "width", "calc(" + Math.max(
|
2923 |
+
14,
|
2924 |
+
/*prompt*/
|
2925 |
+
e[0].prompt.length + 1
|
2926 |
+
) + "ch + 2em) "), V(h, "class", "relative flex z-0 svelte-1wmphae"), V(v, "class", "absolute z-1 right-1 text text-black hover:text-red-500 invisible group-hover:visible svelte-1wmphae"), V(v, "title", "Remove prompt"), V(n, "class", k = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
|
2927 |
+
(e[1] || /*isHovering*/
|
2928 |
+
e[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae"), V(t, "class", "w-min flex flex-col group relative svelte-1wmphae");
|
2929 |
+
},
|
2930 |
+
m(c, E) {
|
2931 |
+
lr(c, t, E), B(t, n), B(n, l), B(l, i), B(i, s), B(s, f), B(f, r), B(r, o), B(o, u), B(n, m), B(n, h), B(h, d), e[10](d), At(
|
2932 |
+
d,
|
2933 |
+
/*prompt*/
|
2934 |
+
e[0].prompt
|
2935 |
+
), B(n, b), B(n, v), ir(w, v, null), e[13](t), g = !0, _ || (C = [
|
2936 |
+
J(
|
2937 |
+
d,
|
2938 |
+
"keypress",
|
2939 |
+
/*onKeyPress*/
|
2940 |
+
e[6]
|
2941 |
+
),
|
2942 |
+
J(
|
2943 |
+
d,
|
2944 |
+
"input",
|
2945 |
+
/*input_input_handler*/
|
2946 |
+
e[11]
|
2947 |
+
),
|
2948 |
+
J(
|
2949 |
+
v,
|
2950 |
+
"click",
|
2951 |
+
/*click_handler*/
|
2952 |
+
e[12]
|
2953 |
+
),
|
2954 |
+
J(
|
2955 |
+
t,
|
2956 |
+
"pointerenter",
|
2957 |
+
/*pointerenter_handler*/
|
2958 |
+
e[14]
|
2959 |
+
),
|
2960 |
+
J(
|
2961 |
+
t,
|
2962 |
+
"pointerleave",
|
2963 |
+
/*pointerleave_handler*/
|
2964 |
+
e[15]
|
2965 |
+
),
|
2966 |
+
J(
|
2967 |
+
t,
|
2968 |
+
"pointercancel",
|
2969 |
+
/*pointercancel_handler*/
|
2970 |
+
e[16]
|
2971 |
+
),
|
2972 |
+
J(
|
2973 |
+
t,
|
2974 |
+
"pointerover",
|
2975 |
+
/*pointerover_handler*/
|
2976 |
+
e[17]
|
2977 |
+
),
|
2978 |
+
J(
|
2979 |
+
t,
|
2980 |
+
"pointerout",
|
2981 |
+
/*pointerout_handler*/
|
2982 |
+
e[18]
|
2983 |
+
),
|
2984 |
+
J(
|
2985 |
+
t,
|
2986 |
+
"pointerenter",
|
2987 |
+
/*pointerenter_handler_1*/
|
2988 |
+
e[19]
|
2989 |
+
)
|
2990 |
+
], _ = !0);
|
2991 |
+
},
|
2992 |
+
p(c, [E]) {
|
2993 |
+
(!g || E & /*prompt*/
|
2994 |
+
1) && a !== (a = /*prompt*/
|
2995 |
+
c[0].scale.toFixed(1) + "") && or(u, a), (!g || E & /*prompt*/
|
2996 |
+
1 && p !== (p = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
|
2997 |
+
(c[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae")) && V(d, "class", p), (!g || E & /*prompt*/
|
2998 |
+
1) && St(d, "width", "calc(" + Math.max(
|
2999 |
+
14,
|
3000 |
+
/*prompt*/
|
3001 |
+
c[0].prompt.length + 1
|
3002 |
+
) + "ch + 2em) "), E & /*prompt*/
|
3003 |
+
1 && d.value !== /*prompt*/
|
3004 |
+
c[0].prompt && At(
|
3005 |
+
d,
|
3006 |
+
/*prompt*/
|
3007 |
+
c[0].prompt
|
3008 |
+
), (!g || E & /*isDragging, isHovering*/
|
3009 |
+
10 && k !== (k = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
|
3010 |
+
(c[1] || /*isHovering*/
|
3011 |
+
c[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae")) && V(n, "class", k);
|
3012 |
+
},
|
3013 |
+
i(c) {
|
3014 |
+
g || (ar(w.$$.fragment, c), g = !0);
|
3015 |
+
},
|
3016 |
+
o(c) {
|
3017 |
+
ur(w.$$.fragment, c), g = !1;
|
3018 |
+
},
|
3019 |
+
d(c) {
|
3020 |
+
c && tr(t), e[10](null), er(w), e[13](null), _ = !1, sr(C);
|
3021 |
+
}
|
3022 |
+
};
|
3023 |
+
}
|
3024 |
+
function mr(e, t, n) {
|
3025 |
+
let { prompt: l } = t, { min: i = 0 } = t, { max: s = 2 } = t, { step: f = 0.01 } = t, r, o = !1, a = !1;
|
3026 |
+
const u = _r();
|
3027 |
+
let m = 0, h;
|
3028 |
+
cr(() => {
|
3029 |
+
const N = Zs().on("start", (F) => {
|
3030 |
+
m = l.scale, n(1, o = !0);
|
3031 |
+
}).on("drag", (F) => {
|
3032 |
+
const { dx: T, dy: M } = F;
|
3033 |
+
m -= M * f, m = Math.min(m, s), m = Math.max(m, i), n(0, l.scale = m, l);
|
3034 |
+
}).on("end", (F) => {
|
3035 |
+
n(1, o = !1);
|
3036 |
+
});
|
3037 |
+
we(h).call(N), r.focus();
|
3038 |
+
});
|
3039 |
+
function d(N) {
|
3040 |
+
N.key === "Enter" && u("add");
|
3041 |
+
}
|
3042 |
+
function p(N) {
|
3043 |
+
Ct[N ? "unshift" : "push"](() => {
|
3044 |
+
r = N, n(2, r);
|
3045 |
+
});
|
3046 |
+
}
|
3047 |
+
function b() {
|
3048 |
+
l.prompt = this.value, n(0, l);
|
3049 |
+
}
|
3050 |
+
const v = () => u("remove");
|
3051 |
+
function w(N) {
|
3052 |
+
Ct[N ? "unshift" : "push"](() => {
|
3053 |
+
h = N, n(4, h);
|
3054 |
+
});
|
3055 |
+
}
|
3056 |
+
const k = () => n(3, a = !0), g = () => n(3, a = !1), _ = () => n(3, a = !1), C = () => n(3, a = !0), c = () => n(3, a = !1), E = () => n(3, a = !0);
|
3057 |
+
return e.$$set = (N) => {
|
3058 |
+
"prompt" in N && n(0, l = N.prompt), "min" in N && n(7, i = N.min), "max" in N && n(8, s = N.max), "step" in N && n(9, f = N.step);
|
3059 |
+
}, e.$$.update = () => {
|
3060 |
+
e.$$.dirty & /*isDragging*/
|
3061 |
+
2 && (o ? document.body.classList.add("grabbing") : document.body.classList.remove("grabbing"));
|
3062 |
+
}, [
|
3063 |
+
l,
|
3064 |
+
o,
|
3065 |
+
r,
|
3066 |
+
a,
|
3067 |
+
h,
|
3068 |
+
u,
|
3069 |
+
d,
|
3070 |
+
i,
|
3071 |
+
s,
|
3072 |
+
f,
|
3073 |
+
p,
|
3074 |
+
b,
|
3075 |
+
v,
|
3076 |
+
w,
|
3077 |
+
k,
|
3078 |
+
g,
|
3079 |
+
_,
|
3080 |
+
C,
|
3081 |
+
c,
|
3082 |
+
E
|
3083 |
+
];
|
3084 |
+
}
|
3085 |
+
class hr extends xs {
|
3086 |
+
constructor(t) {
|
3087 |
+
super(), nr(this, t, mr, dr, rr, { prompt: 0, min: 7, max: 8, step: 9 });
|
3088 |
+
}
|
3089 |
+
}
|
3090 |
+
const {
|
3091 |
+
SvelteComponent: pr,
|
3092 |
+
append: gr,
|
3093 |
+
attr: $,
|
3094 |
+
detach: br,
|
3095 |
+
init: wr,
|
3096 |
+
insert: vr,
|
3097 |
+
noop: Lt,
|
3098 |
+
safe_not_equal: yr,
|
3099 |
+
svg_element: Et
|
3100 |
+
} = window.__gradio__svelte__internal;
|
3101 |
+
function kr(e) {
|
3102 |
+
let t, n;
|
3103 |
+
return {
|
3104 |
+
c() {
|
3105 |
+
t = Et("svg"), n = Et("path"), $(n, "fill", "currentColor"), $(n, "d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344V280H168c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"), $(t, "xmlns", "http://www.w3.org/2000/svg"), $(t, "width", "1em"), $(t, "height", "1em"), $(t, "viewBox", "0 0 512 512"), $(
|
3106 |
+
t,
|
3107 |
+
"class",
|
3108 |
+
/*classNames*/
|
3109 |
+
e[0]
|
3110 |
+
);
|
3111 |
+
},
|
3112 |
+
m(l, i) {
|
3113 |
+
vr(l, t, i), gr(t, n);
|
3114 |
+
},
|
3115 |
+
p(l, [i]) {
|
3116 |
+
i & /*classNames*/
|
3117 |
+
1 && $(
|
3118 |
+
t,
|
3119 |
+
"class",
|
3120 |
+
/*classNames*/
|
3121 |
+
l[0]
|
3122 |
+
);
|
3123 |
+
},
|
3124 |
+
i: Lt,
|
3125 |
+
o: Lt,
|
3126 |
+
d(l) {
|
3127 |
+
l && br(t);
|
3128 |
+
}
|
3129 |
+
};
|
3130 |
+
}
|
3131 |
+
function Cr(e, t, n) {
|
3132 |
+
let { classNames: l = "" } = t;
|
3133 |
+
return e.$$set = (i) => {
|
3134 |
+
"classNames" in i && n(0, l = i.classNames);
|
3135 |
+
}, [l];
|
3136 |
+
}
|
3137 |
+
class Ar extends pr {
|
3138 |
+
constructor(t) {
|
3139 |
+
super(), wr(this, t, Cr, kr, yr, { classNames: 0 });
|
3140 |
+
}
|
3141 |
+
}
|
3142 |
+
const {
|
3143 |
+
SvelteComponent: Sr,
|
3144 |
+
add_flush_callback: Nr,
|
3145 |
+
append: pe,
|
3146 |
+
attr: re,
|
3147 |
+
bind: Lr,
|
3148 |
+
binding_callbacks: Er,
|
3149 |
+
check_outros: qr,
|
3150 |
+
create_component: tn,
|
3151 |
+
destroy_component: nn,
|
3152 |
+
destroy_each: Fr,
|
3153 |
+
detach: Mr,
|
3154 |
+
element: Ne,
|
3155 |
+
ensure_array_like: qt,
|
3156 |
+
group_outros: Pr,
|
3157 |
+
init: Vr,
|
3158 |
+
insert: Tr,
|
3159 |
+
listen: zr,
|
3160 |
+
mount_component: ln,
|
3161 |
+
safe_not_equal: Br,
|
3162 |
+
space: Ft,
|
3163 |
+
transition_in: be,
|
3164 |
+
transition_out: Pe
|
3165 |
+
} = window.__gradio__svelte__internal, { createEventDispatcher: Dr } = window.__gradio__svelte__internal;
|
3166 |
+
function Mt(e, t, n) {
|
3167 |
+
const l = e.slice();
|
3168 |
+
return l[12] = t[n], l[13] = t, l[14] = n, l;
|
3169 |
+
}
|
3170 |
+
function Pt(e) {
|
3171 |
+
let t, n, l;
|
3172 |
+
function i(r) {
|
3173 |
+
e[7](
|
3174 |
+
r,
|
3175 |
+
/*prompt*/
|
3176 |
+
e[12],
|
3177 |
+
/*each_value*/
|
3178 |
+
e[13],
|
3179 |
+
/*prompt_index*/
|
3180 |
+
e[14]
|
3181 |
+
);
|
3182 |
+
}
|
3183 |
+
function s() {
|
3184 |
+
return (
|
3185 |
+
/*remove_handler*/
|
3186 |
+
e[8](
|
3187 |
+
/*prompt*/
|
3188 |
+
e[12]
|
3189 |
+
)
|
3190 |
+
);
|
3191 |
+
}
|
3192 |
+
let f = {
|
3193 |
+
min: (
|
3194 |
+
/*min*/
|
3195 |
+
e[2]
|
3196 |
+
),
|
3197 |
+
max: (
|
3198 |
+
/*max*/
|
3199 |
+
e[3]
|
3200 |
+
),
|
3201 |
+
step: (
|
3202 |
+
/*step*/
|
3203 |
+
e[4]
|
3204 |
+
)
|
3205 |
+
};
|
3206 |
+
return (
|
3207 |
+
/*prompt*/
|
3208 |
+
e[12] !== void 0 && (f.prompt = /*prompt*/
|
3209 |
+
e[12]), t = new hr({ props: f }), Er.push(() => Lr(t, "prompt", i)), t.$on("remove", s), t.$on(
|
3210 |
+
"add",
|
3211 |
+
/*add_handler*/
|
3212 |
+
e[9]
|
3213 |
+
), {
|
3214 |
+
c() {
|
3215 |
+
tn(t.$$.fragment);
|
3216 |
+
},
|
3217 |
+
m(r, o) {
|
3218 |
+
ln(t, r, o), l = !0;
|
3219 |
+
},
|
3220 |
+
p(r, o) {
|
3221 |
+
e = r;
|
3222 |
+
const a = {};
|
3223 |
+
o & /*min*/
|
3224 |
+
4 && (a.min = /*min*/
|
3225 |
+
e[2]), o & /*max*/
|
3226 |
+
8 && (a.max = /*max*/
|
3227 |
+
e[3]), o & /*step*/
|
3228 |
+
16 && (a.step = /*step*/
|
3229 |
+
e[4]), !n && o & /*promptsList*/
|
3230 |
+
1 && (n = !0, a.prompt = /*prompt*/
|
3231 |
+
e[12], Nr(() => n = !1)), t.$set(a);
|
3232 |
+
},
|
3233 |
+
i(r) {
|
3234 |
+
l || (be(t.$$.fragment, r), l = !0);
|
3235 |
+
},
|
3236 |
+
o(r) {
|
3237 |
+
Pe(t.$$.fragment, r), l = !1;
|
3238 |
+
},
|
3239 |
+
d(r) {
|
3240 |
+
nn(t, r);
|
3241 |
+
}
|
3242 |
+
}
|
3243 |
+
);
|
3244 |
+
}
|
3245 |
+
function Rr(e) {
|
3246 |
+
let t, n, l, i, s, f, r, o, a, u, m, h = qt(
|
3247 |
+
/*promptsList*/
|
3248 |
+
e[0]
|
3249 |
+
), d = [];
|
3250 |
+
for (let b = 0; b < h.length; b += 1)
|
3251 |
+
d[b] = Pt(Mt(e, h, b));
|
3252 |
+
const p = (b) => Pe(d[b], 1, 1, () => {
|
3253 |
+
d[b] = null;
|
3254 |
+
});
|
3255 |
+
return s = new Ar({}), {
|
3256 |
+
c() {
|
3257 |
+
t = Ne("div");
|
3258 |
+
for (let b = 0; b < d.length; b += 1)
|
3259 |
+
d[b].c();
|
3260 |
+
n = Ft(), l = Ne("div"), i = Ne("button"), tn(s.$$.fragment), f = Ft(), r = Ne("h2"), r.textContent = "Add Prompt", re(r, "class", "text-xs font-normal px-1 svelte-9vwpr1"), re(i, "title", "Add Concept"), re(i, "class", "flex items-center text-base text-black hover-text-cyan-500 dark:text-white svelte-9vwpr1"), re(l, "class", "flex flex-col gap-1 svelte-9vwpr1"), re(t, "class", o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3261 |
+
e[1] + " svelte-9vwpr1");
|
3262 |
+
},
|
3263 |
+
m(b, v) {
|
3264 |
+
Tr(b, t, v);
|
3265 |
+
for (let w = 0; w < d.length; w += 1)
|
3266 |
+
d[w] && d[w].m(t, null);
|
3267 |
+
pe(t, n), pe(t, l), pe(l, i), ln(s, i, null), pe(i, f), pe(i, r), a = !0, u || (m = zr(
|
3268 |
+
i,
|
3269 |
+
"click",
|
3270 |
+
/*click_handler*/
|
3271 |
+
e[10]
|
3272 |
+
), u = !0);
|
3273 |
+
},
|
3274 |
+
p(b, [v]) {
|
3275 |
+
if (v & /*min, max, step, promptsList, removeConcept, addPrompt*/
|
3276 |
+
125) {
|
3277 |
+
h = qt(
|
3278 |
+
/*promptsList*/
|
3279 |
+
b[0]
|
3280 |
+
);
|
3281 |
+
let w;
|
3282 |
+
for (w = 0; w < h.length; w += 1) {
|
3283 |
+
const k = Mt(b, h, w);
|
3284 |
+
d[w] ? (d[w].p(k, v), be(d[w], 1)) : (d[w] = Pt(k), d[w].c(), be(d[w], 1), d[w].m(t, n));
|
3285 |
+
}
|
3286 |
+
for (Pr(), w = h.length; w < d.length; w += 1)
|
3287 |
+
p(w);
|
3288 |
+
qr();
|
3289 |
+
}
|
3290 |
+
(!a || v & /*classNames*/
|
3291 |
+
2 && o !== (o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3292 |
+
b[1] + " svelte-9vwpr1")) && re(t, "class", o);
|
3293 |
+
},
|
3294 |
+
i(b) {
|
3295 |
+
if (!a) {
|
3296 |
+
for (let v = 0; v < h.length; v += 1)
|
3297 |
+
be(d[v]);
|
3298 |
+
be(s.$$.fragment, b), a = !0;
|
3299 |
+
}
|
3300 |
+
},
|
3301 |
+
o(b) {
|
3302 |
+
d = d.filter(Boolean);
|
3303 |
+
for (let v = 0; v < d.length; v += 1)
|
3304 |
+
Pe(d[v]);
|
3305 |
+
Pe(s.$$.fragment, b), a = !1;
|
3306 |
+
},
|
3307 |
+
d(b) {
|
3308 |
+
b && Mr(t), Fr(d, b), nn(s), u = !1, m();
|
3309 |
+
}
|
3310 |
+
};
|
3311 |
+
}
|
3312 |
+
function Ir(e, t, n) {
|
3313 |
+
let { classNames: l = "" } = t, { promptsList: i = [] } = t, { min: s } = t, { max: f } = t, { step: r } = t;
|
3314 |
+
function o(p) {
|
3315 |
+
n(0, i = i.filter((b) => b.id !== p.id));
|
3316 |
+
}
|
3317 |
+
function a(p = !1) {
|
3318 |
+
n(0, i = [
|
3319 |
+
...i,
|
3320 |
+
{
|
3321 |
+
id: fn(),
|
3322 |
+
prompt: "",
|
3323 |
+
scale: 1,
|
3324 |
+
negative: p
|
3325 |
+
}
|
3326 |
+
]);
|
3327 |
+
}
|
3328 |
+
Dr();
|
3329 |
+
function u(p, b, v, w) {
|
3330 |
+
v[w] = p, n(0, i);
|
3331 |
+
}
|
3332 |
+
const m = (p) => o(p), h = () => a(), d = () => a(!1);
|
3333 |
+
return e.$$set = (p) => {
|
3334 |
+
"classNames" in p && n(1, l = p.classNames), "promptsList" in p && n(0, i = p.promptsList), "min" in p && n(2, s = p.min), "max" in p && n(3, f = p.max), "step" in p && n(4, r = p.step);
|
3335 |
+
}, [
|
3336 |
+
i,
|
3337 |
+
l,
|
3338 |
+
s,
|
3339 |
+
f,
|
3340 |
+
r,
|
3341 |
+
o,
|
3342 |
+
a,
|
3343 |
+
u,
|
3344 |
+
m,
|
3345 |
+
h,
|
3346 |
+
d
|
3347 |
+
];
|
3348 |
+
}
|
3349 |
+
class Or extends Sr {
|
3350 |
+
constructor(t) {
|
3351 |
+
super(), Vr(this, t, Ir, Rr, Br, {
|
3352 |
+
classNames: 1,
|
3353 |
+
promptsList: 0,
|
3354 |
+
min: 2,
|
3355 |
+
max: 3,
|
3356 |
+
step: 4
|
3357 |
+
});
|
3358 |
+
}
|
3359 |
+
}
|
3360 |
+
const {
|
3361 |
+
SvelteComponent: Ur,
|
3362 |
+
add_flush_callback: Zr,
|
3363 |
+
append: Hr,
|
3364 |
+
assign: Xr,
|
3365 |
+
attr: Yr,
|
3366 |
+
bind: Kr,
|
3367 |
+
binding_callbacks: Gr,
|
3368 |
+
check_outros: Wr,
|
3369 |
+
create_component: ze,
|
3370 |
+
destroy_component: Be,
|
3371 |
+
detach: Xe,
|
3372 |
+
element: Jr,
|
3373 |
+
flush: P,
|
3374 |
+
get_spread_object: Qr,
|
3375 |
+
get_spread_update: jr,
|
3376 |
+
group_outros: xr,
|
3377 |
+
init: $r,
|
3378 |
+
insert: Ye,
|
3379 |
+
mount_component: De,
|
3380 |
+
safe_not_equal: eo,
|
3381 |
+
set_data: to,
|
3382 |
+
space: Vt,
|
3383 |
+
text: no,
|
3384 |
+
toggle_class: lo,
|
3385 |
+
transition_in: te,
|
3386 |
+
transition_out: fe
|
3387 |
+
} = window.__gradio__svelte__internal;
|
3388 |
+
function Tt(e) {
|
3389 |
+
let t, n;
|
3390 |
+
const l = [
|
3391 |
+
{ autoscroll: (
|
3392 |
+
/*gradio*/
|
3393 |
+
e[1].autoscroll
|
3394 |
+
) },
|
3395 |
+
{ i18n: (
|
3396 |
+
/*gradio*/
|
3397 |
+
e[1].i18n
|
3398 |
+
) },
|
3399 |
+
/*loading_status*/
|
3400 |
+
e[9]
|
3401 |
+
];
|
3402 |
+
let i = {};
|
3403 |
+
for (let s = 0; s < l.length; s += 1)
|
3404 |
+
i = Xr(i, l[s]);
|
3405 |
+
return t = new Wl({ props: i }), {
|
3406 |
+
c() {
|
3407 |
+
ze(t.$$.fragment);
|
3408 |
+
},
|
3409 |
+
m(s, f) {
|
3410 |
+
De(t, s, f), n = !0;
|
3411 |
+
},
|
3412 |
+
p(s, f) {
|
3413 |
+
const r = f & /*gradio, loading_status*/
|
3414 |
+
514 ? jr(l, [
|
3415 |
+
f & /*gradio*/
|
3416 |
+
2 && { autoscroll: (
|
3417 |
+
/*gradio*/
|
3418 |
+
s[1].autoscroll
|
3419 |
+
) },
|
3420 |
+
f & /*gradio*/
|
3421 |
+
2 && { i18n: (
|
3422 |
+
/*gradio*/
|
3423 |
+
s[1].i18n
|
3424 |
+
) },
|
3425 |
+
f & /*loading_status*/
|
3426 |
+
512 && Qr(
|
3427 |
+
/*loading_status*/
|
3428 |
+
s[9]
|
3429 |
+
)
|
3430 |
+
]) : {};
|
3431 |
+
t.$set(r);
|
3432 |
+
},
|
3433 |
+
i(s) {
|
3434 |
+
n || (te(t.$$.fragment, s), n = !0);
|
3435 |
+
},
|
3436 |
+
o(s) {
|
3437 |
+
fe(t.$$.fragment, s), n = !1;
|
3438 |
+
},
|
3439 |
+
d(s) {
|
3440 |
+
Be(t, s);
|
3441 |
+
}
|
3442 |
+
};
|
3443 |
+
}
|
3444 |
+
function io(e) {
|
3445 |
+
let t;
|
3446 |
+
return {
|
3447 |
+
c() {
|
3448 |
+
t = no(
|
3449 |
+
/*label*/
|
3450 |
+
e[2]
|
3451 |
+
);
|
3452 |
+
},
|
3453 |
+
m(n, l) {
|
3454 |
+
Ye(n, t, l);
|
3455 |
+
},
|
3456 |
+
p(n, l) {
|
3457 |
+
l & /*label*/
|
3458 |
+
4 && to(
|
3459 |
+
t,
|
3460 |
+
/*label*/
|
3461 |
+
n[2]
|
3462 |
+
);
|
3463 |
+
},
|
3464 |
+
d(n) {
|
3465 |
+
n && Xe(t);
|
3466 |
+
}
|
3467 |
+
};
|
3468 |
+
}
|
3469 |
+
function so(e) {
|
3470 |
+
let t, n, l, i, s, f, r, o = (
|
3471 |
+
/*loading_status*/
|
3472 |
+
e[9] && Tt(e)
|
3473 |
+
);
|
3474 |
+
l = new ol({
|
3475 |
+
props: {
|
3476 |
+
show_label: (
|
3477 |
+
/*show_label*/
|
3478 |
+
e[6]
|
3479 |
+
),
|
3480 |
+
info: void 0,
|
3481 |
+
$$slots: { default: [io] },
|
3482 |
+
$$scope: { ctx: e }
|
3483 |
+
}
|
3484 |
+
});
|
3485 |
+
function a(m) {
|
3486 |
+
e[17](m);
|
3487 |
+
}
|
3488 |
+
let u = {
|
3489 |
+
min: (
|
3490 |
+
/*min*/
|
3491 |
+
e[10]
|
3492 |
+
),
|
3493 |
+
max: (
|
3494 |
+
/*max*/
|
3495 |
+
e[11]
|
3496 |
+
),
|
3497 |
+
step: (
|
3498 |
+
/*step*/
|
3499 |
+
e[12]
|
3500 |
+
),
|
3501 |
+
classNames: "py-5"
|
3502 |
+
};
|
3503 |
+
return (
|
3504 |
+
/*value*/
|
3505 |
+
e[0] !== void 0 && (u.promptsList = /*value*/
|
3506 |
+
e[0]), s = new Or({ props: u }), Gr.push(() => Kr(s, "promptsList", a)), {
|
3507 |
+
c() {
|
3508 |
+
o && o.c(), t = Vt(), n = Jr("label"), ze(l.$$.fragment), i = Vt(), ze(s.$$.fragment), Yr(n, "class", "relative"), lo(n, "container", oo);
|
3509 |
+
},
|
3510 |
+
m(m, h) {
|
3511 |
+
o && o.m(m, h), Ye(m, t, h), Ye(m, n, h), De(l, n, null), Hr(n, i), De(s, n, null), r = !0;
|
3512 |
+
},
|
3513 |
+
p(m, h) {
|
3514 |
+
/*loading_status*/
|
3515 |
+
m[9] ? o ? (o.p(m, h), h & /*loading_status*/
|
3516 |
+
512 && te(o, 1)) : (o = Tt(m), o.c(), te(o, 1), o.m(t.parentNode, t)) : o && (xr(), fe(o, 1, 1, () => {
|
3517 |
+
o = null;
|
3518 |
+
}), Wr());
|
3519 |
+
const d = {};
|
3520 |
+
h & /*show_label*/
|
3521 |
+
64 && (d.show_label = /*show_label*/
|
3522 |
+
m[6]), h & /*$$scope, label*/
|
3523 |
+
4194308 && (d.$$scope = { dirty: h, ctx: m }), l.$set(d);
|
3524 |
+
const p = {};
|
3525 |
+
h & /*min*/
|
3526 |
+
1024 && (p.min = /*min*/
|
3527 |
+
m[10]), h & /*max*/
|
3528 |
+
2048 && (p.max = /*max*/
|
3529 |
+
m[11]), h & /*step*/
|
3530 |
+
4096 && (p.step = /*step*/
|
3531 |
+
m[12]), !f && h & /*value*/
|
3532 |
+
1 && (f = !0, p.promptsList = /*value*/
|
3533 |
+
m[0], Zr(() => f = !1)), s.$set(p);
|
3534 |
+
},
|
3535 |
+
i(m) {
|
3536 |
+
r || (te(o), te(l.$$.fragment, m), te(s.$$.fragment, m), r = !0);
|
3537 |
+
},
|
3538 |
+
o(m) {
|
3539 |
+
fe(o), fe(l.$$.fragment, m), fe(s.$$.fragment, m), r = !1;
|
3540 |
+
},
|
3541 |
+
d(m) {
|
3542 |
+
m && (Xe(t), Xe(n)), o && o.d(m), Be(l), Be(s);
|
3543 |
+
}
|
3544 |
+
}
|
3545 |
+
);
|
3546 |
+
}
|
3547 |
+
function ro(e) {
|
3548 |
+
let t, n;
|
3549 |
+
return t = new An({
|
3550 |
+
props: {
|
3551 |
+
visible: (
|
3552 |
+
/*visible*/
|
3553 |
+
e[5]
|
3554 |
+
),
|
3555 |
+
elem_id: (
|
3556 |
+
/*elem_id*/
|
3557 |
+
e[3]
|
3558 |
+
),
|
3559 |
+
elem_classes: (
|
3560 |
+
/*elem_classes*/
|
3561 |
+
e[4]
|
3562 |
+
),
|
3563 |
+
scale: (
|
3564 |
+
/*scale*/
|
3565 |
+
e[7]
|
3566 |
+
),
|
3567 |
+
min_width: (
|
3568 |
+
/*min_width*/
|
3569 |
+
e[8]
|
3570 |
+
),
|
3571 |
+
allow_overflow: !1,
|
3572 |
+
padding: !0,
|
3573 |
+
$$slots: { default: [so] },
|
3574 |
+
$$scope: { ctx: e }
|
3575 |
+
}
|
3576 |
+
}), {
|
3577 |
+
c() {
|
3578 |
+
ze(t.$$.fragment);
|
3579 |
+
},
|
3580 |
+
m(l, i) {
|
3581 |
+
De(t, l, i), n = !0;
|
3582 |
+
},
|
3583 |
+
p(l, [i]) {
|
3584 |
+
const s = {};
|
3585 |
+
i & /*visible*/
|
3586 |
+
32 && (s.visible = /*visible*/
|
3587 |
+
l[5]), i & /*elem_id*/
|
3588 |
+
8 && (s.elem_id = /*elem_id*/
|
3589 |
+
l[3]), i & /*elem_classes*/
|
3590 |
+
16 && (s.elem_classes = /*elem_classes*/
|
3591 |
+
l[4]), i & /*scale*/
|
3592 |
+
128 && (s.scale = /*scale*/
|
3593 |
+
l[7]), i & /*min_width*/
|
3594 |
+
256 && (s.min_width = /*min_width*/
|
3595 |
+
l[8]), i & /*$$scope, min, max, step, value, show_label, label, gradio, loading_status*/
|
3596 |
+
4202055 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
|
3597 |
+
},
|
3598 |
+
i(l) {
|
3599 |
+
n || (te(t.$$.fragment, l), n = !0);
|
3600 |
+
},
|
3601 |
+
o(l) {
|
3602 |
+
fe(t.$$.fragment, l), n = !1;
|
3603 |
+
},
|
3604 |
+
d(l) {
|
3605 |
+
Be(t, l);
|
3606 |
+
}
|
3607 |
+
};
|
3608 |
+
}
|
3609 |
+
const oo = !1;
|
3610 |
+
function fo(e, t, n) {
|
3611 |
+
let { gradio: l } = t, { label: i = "Prompt Weighting" } = t, { elem_id: s = "" } = t, { elem_classes: f = [] } = t, { visible: r = !0 } = t, { value: o = [] } = t, { placeholder: a = "" } = t, { show_label: u } = t, { scale: m = null } = t, { min_width: h = void 0 } = t, { loading_status: d = void 0 } = t, { value_is_output: p = !1 } = t, { interactive: b } = t, { rtl: v = !1 } = t, { min: w = 0 } = t, { max: k = 2 } = t, { step: g = 0.01 } = t;
|
3612 |
+
function _() {
|
3613 |
+
l.dispatch("change", o), p || (l.dispatch("input"), l.dispatch("submit"));
|
3614 |
+
}
|
3615 |
+
function C(c) {
|
3616 |
+
o = c, n(0, o);
|
3617 |
+
}
|
3618 |
+
return e.$$set = (c) => {
|
3619 |
+
"gradio" in c && n(1, l = c.gradio), "label" in c && n(2, i = c.label), "elem_id" in c && n(3, s = c.elem_id), "elem_classes" in c && n(4, f = c.elem_classes), "visible" in c && n(5, r = c.visible), "value" in c && n(0, o = c.value), "placeholder" in c && n(13, a = c.placeholder), "show_label" in c && n(6, u = c.show_label), "scale" in c && n(7, m = c.scale), "min_width" in c && n(8, h = c.min_width), "loading_status" in c && n(9, d = c.loading_status), "value_is_output" in c && n(14, p = c.value_is_output), "interactive" in c && n(15, b = c.interactive), "rtl" in c && n(16, v = c.rtl), "min" in c && n(10, w = c.min), "max" in c && n(11, k = c.max), "step" in c && n(12, g = c.step);
|
3620 |
+
}, e.$$.update = () => {
|
3621 |
+
e.$$.dirty & /*value*/
|
3622 |
+
1 && o === null && n(0, o = []), e.$$.dirty & /*value*/
|
3623 |
+
1 && _();
|
3624 |
+
}, [
|
3625 |
+
o,
|
3626 |
+
l,
|
3627 |
+
i,
|
3628 |
+
s,
|
3629 |
+
f,
|
3630 |
+
r,
|
3631 |
+
u,
|
3632 |
+
m,
|
3633 |
+
h,
|
3634 |
+
d,
|
3635 |
+
w,
|
3636 |
+
k,
|
3637 |
+
g,
|
3638 |
+
a,
|
3639 |
+
p,
|
3640 |
+
b,
|
3641 |
+
v,
|
3642 |
+
C
|
3643 |
+
];
|
3644 |
+
}
|
3645 |
+
class ao extends Ur {
|
3646 |
+
constructor(t) {
|
3647 |
+
super(), $r(this, t, fo, ro, eo, {
|
3648 |
+
gradio: 1,
|
3649 |
+
label: 2,
|
3650 |
+
elem_id: 3,
|
3651 |
+
elem_classes: 4,
|
3652 |
+
visible: 5,
|
3653 |
+
value: 0,
|
3654 |
+
placeholder: 13,
|
3655 |
+
show_label: 6,
|
3656 |
+
scale: 7,
|
3657 |
+
min_width: 8,
|
3658 |
+
loading_status: 9,
|
3659 |
+
value_is_output: 14,
|
3660 |
+
interactive: 15,
|
3661 |
+
rtl: 16,
|
3662 |
+
min: 10,
|
3663 |
+
max: 11,
|
3664 |
+
step: 12
|
3665 |
+
});
|
3666 |
+
}
|
3667 |
+
get gradio() {
|
3668 |
+
return this.$$.ctx[1];
|
3669 |
+
}
|
3670 |
+
set gradio(t) {
|
3671 |
+
this.$$set({ gradio: t }), P();
|
3672 |
+
}
|
3673 |
+
get label() {
|
3674 |
+
return this.$$.ctx[2];
|
3675 |
+
}
|
3676 |
+
set label(t) {
|
3677 |
+
this.$$set({ label: t }), P();
|
3678 |
+
}
|
3679 |
+
get elem_id() {
|
3680 |
+
return this.$$.ctx[3];
|
3681 |
+
}
|
3682 |
+
set elem_id(t) {
|
3683 |
+
this.$$set({ elem_id: t }), P();
|
3684 |
+
}
|
3685 |
+
get elem_classes() {
|
3686 |
+
return this.$$.ctx[4];
|
3687 |
+
}
|
3688 |
+
set elem_classes(t) {
|
3689 |
+
this.$$set({ elem_classes: t }), P();
|
3690 |
+
}
|
3691 |
+
get visible() {
|
3692 |
+
return this.$$.ctx[5];
|
3693 |
+
}
|
3694 |
+
set visible(t) {
|
3695 |
+
this.$$set({ visible: t }), P();
|
3696 |
+
}
|
3697 |
+
get value() {
|
3698 |
+
return this.$$.ctx[0];
|
3699 |
+
}
|
3700 |
+
set value(t) {
|
3701 |
+
this.$$set({ value: t }), P();
|
3702 |
+
}
|
3703 |
+
get placeholder() {
|
3704 |
+
return this.$$.ctx[13];
|
3705 |
+
}
|
3706 |
+
set placeholder(t) {
|
3707 |
+
this.$$set({ placeholder: t }), P();
|
3708 |
+
}
|
3709 |
+
get show_label() {
|
3710 |
+
return this.$$.ctx[6];
|
3711 |
+
}
|
3712 |
+
set show_label(t) {
|
3713 |
+
this.$$set({ show_label: t }), P();
|
3714 |
+
}
|
3715 |
+
get scale() {
|
3716 |
+
return this.$$.ctx[7];
|
3717 |
+
}
|
3718 |
+
set scale(t) {
|
3719 |
+
this.$$set({ scale: t }), P();
|
3720 |
+
}
|
3721 |
+
get min_width() {
|
3722 |
+
return this.$$.ctx[8];
|
3723 |
+
}
|
3724 |
+
set min_width(t) {
|
3725 |
+
this.$$set({ min_width: t }), P();
|
3726 |
+
}
|
3727 |
+
get loading_status() {
|
3728 |
+
return this.$$.ctx[9];
|
3729 |
+
}
|
3730 |
+
set loading_status(t) {
|
3731 |
+
this.$$set({ loading_status: t }), P();
|
3732 |
+
}
|
3733 |
+
get value_is_output() {
|
3734 |
+
return this.$$.ctx[14];
|
3735 |
+
}
|
3736 |
+
set value_is_output(t) {
|
3737 |
+
this.$$set({ value_is_output: t }), P();
|
3738 |
+
}
|
3739 |
+
get interactive() {
|
3740 |
+
return this.$$.ctx[15];
|
3741 |
+
}
|
3742 |
+
set interactive(t) {
|
3743 |
+
this.$$set({ interactive: t }), P();
|
3744 |
+
}
|
3745 |
+
get rtl() {
|
3746 |
+
return this.$$.ctx[16];
|
3747 |
+
}
|
3748 |
+
set rtl(t) {
|
3749 |
+
this.$$set({ rtl: t }), P();
|
3750 |
+
}
|
3751 |
+
get min() {
|
3752 |
+
return this.$$.ctx[10];
|
3753 |
+
}
|
3754 |
+
set min(t) {
|
3755 |
+
this.$$set({ min: t }), P();
|
3756 |
+
}
|
3757 |
+
get max() {
|
3758 |
+
return this.$$.ctx[11];
|
3759 |
+
}
|
3760 |
+
set max(t) {
|
3761 |
+
this.$$set({ max: t }), P();
|
3762 |
+
}
|
3763 |
+
get step() {
|
3764 |
+
return this.$$.ctx[12];
|
3765 |
+
}
|
3766 |
+
set step(t) {
|
3767 |
+
this.$$set({ step: t }), P();
|
3768 |
+
}
|
3769 |
+
}
|
3770 |
+
export {
|
3771 |
+
ao as default
|
3772 |
+
};
|
src/backend/gradio_promptweighting/templates/component/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.block.svelte-nl1om8{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-nl1om8{border-color:var(--color-accent)}.block.border_contrast.svelte-nl1om8{border-color:var(--body-text-color)}.padded.svelte-nl1om8{padding:var(--block-padding)}.hidden.svelte-nl1om8{display:none}.hide-container.svelte-nl1om8{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1yserjw.svelte-1yserjw{top:0;right:0;left:0}.wrap.default.svelte-1yserjw.svelte-1yserjw{top:0;right:0;bottom:0;left:0}.hide.svelte-1yserjw.svelte-1yserjw{opacity:0;pointer-events:none}.generating.svelte-1yserjw.svelte-1yserjw{animation:svelte-1yserjw-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent;z-index:var(--layer-1)}.translucent.svelte-1yserjw.svelte-1yserjw{background:none}@keyframes svelte-1yserjw-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1yserjw.svelte-1yserjw{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1yserjw.svelte-1yserjw{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1yserjw.svelte-1yserjw{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1yserjw.svelte-1yserjw{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1yserjw.svelte-1yserjw{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1yserjw .progress-text.svelte-1yserjw{background:var(--block-background-fill)}.border.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}.grabbing *{cursor:grabbing!important}.w-min.svelte-1wmphae.svelte-1wmphae{width:min-content}.flex.svelte-1wmphae.svelte-1wmphae{display:flex}.flex-col.svelte-1wmphae.svelte-1wmphae{flex-direction:column}.group.svelte-1wmphae:hover .group-hover\:visible.svelte-1wmphae{visibility:visible}.relative.svelte-1wmphae.svelte-1wmphae{position:relative}.justify-between.svelte-1wmphae.svelte-1wmphae{justify-content:space-between}.items-center.svelte-1wmphae.svelte-1wmphae{align-items:center}.overflow-hidden.svelte-1wmphae.svelte-1wmphae{overflow:hidden}.select-none.svelte-1wmphae.svelte-1wmphae{-webkit-user-select:none;user-select:none}.touch-manipulation.svelte-1wmphae.svelte-1wmphae{touch-action:manipulation}.absolute.svelte-1wmphae.svelte-1wmphae{position:absolute}.z-10.svelte-1wmphae.svelte-1wmphae{z-index:10}.p-1.svelte-1wmphae.svelte-1wmphae{padding:.125rem}.text-black.svelte-1wmphae.svelte-1wmphae{color:#000!important}.text-sm.svelte-1wmphae.svelte-1wmphae{font-size:.875rem;line-height:1.25rem}.bottom-full.svelte-1wmphae.svelte-1wmphae{bottom:100%}@media (prefers-color-scheme: dark){.dark\:group-hover\:text-white.svelte-1wmphae.svelte-1wmphae{color:#fff}}.text-\[0\.5rem\].svelte-1wmphae.svelte-1wmphae{font-size:.5rem}.font-mono.svelte-1wmphae.svelte-1wmphae{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.z-0.svelte-1wmphae.svelte-1wmphae{z-index:0}.pl.svelte-1wmphae.svelte-1wmphae{padding-left:1.5em}.pr.svelte-1wmphae.svelte-1wmphae{padding-right:.5em}.py-2.svelte-1wmphae.svelte-1wmphae{padding-top:.5rem;padding-bottom:.5rem}.outline-none.svelte-1wmphae.svelte-1wmphae{outline:2px solid transparent;outline-offset:2px}.line-through.svelte-1wmphae.svelte-1wmphae{text-decoration:line-through}.z-1.svelte-1wmphae.svelte-1wmphae{z-index:1}.right-1.svelte-1wmphae.svelte-1wmphae{right:.25rem}.hover\:text-red-500.svelte-1wmphae.svelte-1wmphae:hover{color:#ef4444!important}.invisible.svelte-1wmphae.svelte-1wmphae{visibility:hidden}.flex.svelte-9vwpr1{display:flex}.items-center.svelte-9vwpr1{align-items:center}.gap-1.svelte-9vwpr1{gap:.25rem}.flex-wrap.svelte-9vwpr1{flex-wrap:wrap}.flex-col.svelte-9vwpr1{flex-direction:column}.text-base.svelte-9vwpr1{font-size:1rem;line-height:1.5rem}.text-black.svelte-9vwpr1{color:#000}.hover-text-cyan-500.svelte-9vwpr1:hover{color:#06b6d4}@media (prefers-color-scheme: dark){.dark\:text-white.svelte-9vwpr1{color:#fff}}.text-xs.svelte-9vwpr1{font-size:.75rem;line-height:1rem}.font-normal.svelte-9vwpr1{font-weight:400}.px-1.svelte-9vwpr1{padding-left:.25rem;padding-right:.25rem}
|
src/backend/gradio_promptweighting/templates/example/index.js
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const {
|
2 |
+
SvelteComponent: y,
|
3 |
+
add_iframe_resize_listener: v,
|
4 |
+
add_render_callback: b,
|
5 |
+
append: m,
|
6 |
+
attr: h,
|
7 |
+
binding_callbacks: w,
|
8 |
+
detach: p,
|
9 |
+
element: z,
|
10 |
+
init: k,
|
11 |
+
insert: E,
|
12 |
+
noop: f,
|
13 |
+
safe_not_equal: S,
|
14 |
+
set_data: q,
|
15 |
+
text: C,
|
16 |
+
toggle_class: r
|
17 |
+
} = window.__gradio__svelte__internal, { onMount: M } = window.__gradio__svelte__internal;
|
18 |
+
function P(t) {
|
19 |
+
let e, n = (
|
20 |
+
/*value*/
|
21 |
+
(t[0] ? (
|
22 |
+
/*value*/
|
23 |
+
t[0]
|
24 |
+
) : "") + ""
|
25 |
+
), _, d;
|
26 |
+
return {
|
27 |
+
c() {
|
28 |
+
e = z("div"), _ = C(n), h(e, "class", "svelte-1r1gryw"), b(() => (
|
29 |
+
/*div_elementresize_handler*/
|
30 |
+
t[5].call(e)
|
31 |
+
)), r(
|
32 |
+
e,
|
33 |
+
"table",
|
34 |
+
/*type*/
|
35 |
+
t[1] === "table"
|
36 |
+
), r(
|
37 |
+
e,
|
38 |
+
"gallery",
|
39 |
+
/*type*/
|
40 |
+
t[1] === "gallery"
|
41 |
+
), r(
|
42 |
+
e,
|
43 |
+
"selected",
|
44 |
+
/*selected*/
|
45 |
+
t[2]
|
46 |
+
);
|
47 |
+
},
|
48 |
+
m(l, s) {
|
49 |
+
E(l, e, s), m(e, _), d = v(
|
50 |
+
e,
|
51 |
+
/*div_elementresize_handler*/
|
52 |
+
t[5].bind(e)
|
53 |
+
), t[6](e);
|
54 |
+
},
|
55 |
+
p(l, [s]) {
|
56 |
+
s & /*value*/
|
57 |
+
1 && n !== (n = /*value*/
|
58 |
+
(l[0] ? (
|
59 |
+
/*value*/
|
60 |
+
l[0]
|
61 |
+
) : "") + "") && q(_, n), s & /*type*/
|
62 |
+
2 && r(
|
63 |
+
e,
|
64 |
+
"table",
|
65 |
+
/*type*/
|
66 |
+
l[1] === "table"
|
67 |
+
), s & /*type*/
|
68 |
+
2 && r(
|
69 |
+
e,
|
70 |
+
"gallery",
|
71 |
+
/*type*/
|
72 |
+
l[1] === "gallery"
|
73 |
+
), s & /*selected*/
|
74 |
+
4 && r(
|
75 |
+
e,
|
76 |
+
"selected",
|
77 |
+
/*selected*/
|
78 |
+
l[2]
|
79 |
+
);
|
80 |
+
},
|
81 |
+
i: f,
|
82 |
+
o: f,
|
83 |
+
d(l) {
|
84 |
+
l && p(e), d(), t[6](null);
|
85 |
+
}
|
86 |
+
};
|
87 |
+
}
|
88 |
+
function W(t, e, n) {
|
89 |
+
let { value: _ } = e, { type: d } = e, { selected: l = !1 } = e, s, a;
|
90 |
+
function c(i, u) {
|
91 |
+
!i || !u || (a.style.setProperty("--local-text-width", `${u < 150 ? u : 200}px`), n(4, a.style.whiteSpace = "unset", a));
|
92 |
+
}
|
93 |
+
M(() => {
|
94 |
+
c(a, s);
|
95 |
+
});
|
96 |
+
function o() {
|
97 |
+
s = this.clientWidth, n(3, s);
|
98 |
+
}
|
99 |
+
function g(i) {
|
100 |
+
w[i ? "unshift" : "push"](() => {
|
101 |
+
a = i, n(4, a);
|
102 |
+
});
|
103 |
+
}
|
104 |
+
return t.$$set = (i) => {
|
105 |
+
"value" in i && n(0, _ = i.value), "type" in i && n(1, d = i.type), "selected" in i && n(2, l = i.selected);
|
106 |
+
}, [_, d, l, s, a, o, g];
|
107 |
+
}
|
108 |
+
class j extends y {
|
109 |
+
constructor(e) {
|
110 |
+
super(), k(this, e, W, P, S, { value: 0, type: 1, selected: 2 });
|
111 |
+
}
|
112 |
+
}
|
113 |
+
export {
|
114 |
+
j as default
|
115 |
+
};
|
src/backend/gradio_promptweighting/templates/example/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.gallery.svelte-1r1gryw{padding:var(--size-1) var(--size-2)}div.svelte-1r1gryw{overflow:hidden;min-width:var(--local-text-width);white-space:nowrap}
|
src/demo/__init__.py
ADDED
File without changes
|
src/demo/app.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_promptweighting import PromptWeighting
|
3 |
+
|
4 |
+
|
5 |
+
example = PromptWeighting().example_value()
|
6 |
+
|
7 |
+
|
8 |
+
def predict(input):
|
9 |
+
return (input, input)
|
10 |
+
|
11 |
+
|
12 |
+
with gr.Blocks() as demo:
|
13 |
+
with gr.Row():
|
14 |
+
with gr.Column():
|
15 |
+
prompt = PromptWeighting(
|
16 |
+
value=[
|
17 |
+
{"prompt": "a cat", "scale": 1.5},
|
18 |
+
{"prompt": "a dog", "scale": 1},
|
19 |
+
{"prompt": "a bird", "scale": 0.5},
|
20 |
+
],
|
21 |
+
step=0.001,
|
22 |
+
info="Please drag up or down to adjust the weight of the prompt.",
|
23 |
+
)
|
24 |
+
btn = gr.Button("Update Prompt")
|
25 |
+
with gr.Column():
|
26 |
+
text = gr.Textbox(
|
27 |
+
label="Prompt",
|
28 |
+
placeholder="",
|
29 |
+
)
|
30 |
+
prompt2 = PromptWeighting(min=0, max=10, step=0.001)
|
31 |
+
inputs = [prompt]
|
32 |
+
outputs = [text, prompt2]
|
33 |
+
|
34 |
+
btn.click(fn=predict, inputs=inputs, outputs=outputs, show_progress=False)
|
35 |
+
prompt.change(
|
36 |
+
fn=predict,
|
37 |
+
inputs=inputs,
|
38 |
+
outputs=outputs,
|
39 |
+
queue=False,
|
40 |
+
trigger_mode="always_last",
|
41 |
+
show_progress=False,
|
42 |
+
)
|
43 |
+
|
44 |
+
|
45 |
+
if __name__ == "__main__":
|
46 |
+
demo.launch()
|
src/demo/css.css
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
html {
|
2 |
+
font-family: Inter;
|
3 |
+
font-size: 16px;
|
4 |
+
font-weight: 400;
|
5 |
+
line-height: 1.5;
|
6 |
+
-webkit-text-size-adjust: 100%;
|
7 |
+
background: #fff;
|
8 |
+
color: #323232;
|
9 |
+
-webkit-font-smoothing: antialiased;
|
10 |
+
-moz-osx-font-smoothing: grayscale;
|
11 |
+
text-rendering: optimizeLegibility;
|
12 |
+
}
|
13 |
+
|
14 |
+
:root {
|
15 |
+
--space: 1;
|
16 |
+
--vspace: calc(var(--space) * 1rem);
|
17 |
+
--vspace-0: calc(3 * var(--space) * 1rem);
|
18 |
+
--vspace-1: calc(2 * var(--space) * 1rem);
|
19 |
+
--vspace-2: calc(1.5 * var(--space) * 1rem);
|
20 |
+
--vspace-3: calc(0.5 * var(--space) * 1rem);
|
21 |
+
}
|
22 |
+
|
23 |
+
.app {
|
24 |
+
max-width: 748px !important;
|
25 |
+
}
|
26 |
+
|
27 |
+
.prose p {
|
28 |
+
margin: var(--vspace) 0;
|
29 |
+
line-height: var(--vspace * 2);
|
30 |
+
font-size: 1rem;
|
31 |
+
}
|
32 |
+
|
33 |
+
code {
|
34 |
+
font-family: "Inconsolata", sans-serif;
|
35 |
+
font-size: 16px;
|
36 |
+
}
|
37 |
+
|
38 |
+
h1,
|
39 |
+
h1 code {
|
40 |
+
font-weight: 400;
|
41 |
+
line-height: calc(2.5 / var(--space) * var(--vspace));
|
42 |
+
}
|
43 |
+
|
44 |
+
h1 code {
|
45 |
+
background: none;
|
46 |
+
border: none;
|
47 |
+
letter-spacing: 0.05em;
|
48 |
+
padding-bottom: 5px;
|
49 |
+
position: relative;
|
50 |
+
padding: 0;
|
51 |
+
}
|
52 |
+
|
53 |
+
h2 {
|
54 |
+
margin: var(--vspace-1) 0 var(--vspace-2) 0;
|
55 |
+
line-height: 1em;
|
56 |
+
}
|
57 |
+
|
58 |
+
h3,
|
59 |
+
h3 code {
|
60 |
+
margin: var(--vspace-1) 0 var(--vspace-2) 0;
|
61 |
+
line-height: 1em;
|
62 |
+
}
|
63 |
+
|
64 |
+
h4,
|
65 |
+
h5,
|
66 |
+
h6 {
|
67 |
+
margin: var(--vspace-3) 0 var(--vspace-3) 0;
|
68 |
+
line-height: var(--vspace);
|
69 |
+
}
|
70 |
+
|
71 |
+
.bigtitle,
|
72 |
+
h1,
|
73 |
+
h1 code {
|
74 |
+
font-size: calc(8px * 4.5);
|
75 |
+
word-break: break-word;
|
76 |
+
}
|
77 |
+
|
78 |
+
.title,
|
79 |
+
h2,
|
80 |
+
h2 code {
|
81 |
+
font-size: calc(8px * 3.375);
|
82 |
+
font-weight: lighter;
|
83 |
+
word-break: break-word;
|
84 |
+
border: none;
|
85 |
+
background: none;
|
86 |
+
}
|
87 |
+
|
88 |
+
.subheading1,
|
89 |
+
h3,
|
90 |
+
h3 code {
|
91 |
+
font-size: calc(8px * 1.8);
|
92 |
+
font-weight: 600;
|
93 |
+
border: none;
|
94 |
+
background: none;
|
95 |
+
letter-spacing: 0.1em;
|
96 |
+
text-transform: uppercase;
|
97 |
+
}
|
98 |
+
|
99 |
+
h2 code {
|
100 |
+
padding: 0;
|
101 |
+
position: relative;
|
102 |
+
letter-spacing: 0.05em;
|
103 |
+
}
|
104 |
+
|
105 |
+
blockquote {
|
106 |
+
font-size: calc(8px * 1.1667);
|
107 |
+
font-style: italic;
|
108 |
+
line-height: calc(1.1667 * var(--vspace));
|
109 |
+
margin: var(--vspace-2) var(--vspace-2);
|
110 |
+
}
|
111 |
+
|
112 |
+
.subheading2,
|
113 |
+
h4 {
|
114 |
+
font-size: calc(8px * 1.4292);
|
115 |
+
text-transform: uppercase;
|
116 |
+
font-weight: 600;
|
117 |
+
}
|
118 |
+
|
119 |
+
.subheading3,
|
120 |
+
h5 {
|
121 |
+
font-size: calc(8px * 1.2917);
|
122 |
+
line-height: calc(1.2917 * var(--vspace));
|
123 |
+
|
124 |
+
font-weight: lighter;
|
125 |
+
text-transform: uppercase;
|
126 |
+
letter-spacing: 0.15em;
|
127 |
+
}
|
128 |
+
|
129 |
+
h6 {
|
130 |
+
font-size: calc(8px * 1.1667);
|
131 |
+
font-size: 1.1667em;
|
132 |
+
font-weight: normal;
|
133 |
+
font-style: italic;
|
134 |
+
font-family: "le-monde-livre-classic-byol", serif !important;
|
135 |
+
letter-spacing: 0px !important;
|
136 |
+
}
|
137 |
+
|
138 |
+
#start .md > *:first-child {
|
139 |
+
margin-top: 0;
|
140 |
+
}
|
141 |
+
|
142 |
+
h2 + h3 {
|
143 |
+
margin-top: 0;
|
144 |
+
}
|
145 |
+
|
146 |
+
.md hr {
|
147 |
+
border: none;
|
148 |
+
border-top: 1px solid var(--block-border-color);
|
149 |
+
margin: var(--vspace-2) 0 var(--vspace-2) 0;
|
150 |
+
}
|
151 |
+
.prose ul {
|
152 |
+
margin: var(--vspace-2) 0 var(--vspace-1) 0;
|
153 |
+
}
|
154 |
+
|
155 |
+
.gap {
|
156 |
+
gap: 0;
|
157 |
+
}
|
src/demo/space.py
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from app import demo as app
|
4 |
+
import os
|
5 |
+
|
6 |
+
_docs = {'PromptWeighting': {'description': 'Creates a very simple textbox for user to enter string input or display string output.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
|
7 |
+
|
8 |
+
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
+
|
10 |
+
with gr.Blocks(
|
11 |
+
css=abs_path,
|
12 |
+
theme=gr.themes.Default(
|
13 |
+
font_mono=[
|
14 |
+
gr.themes.GoogleFont("Inconsolata"),
|
15 |
+
"monospace",
|
16 |
+
],
|
17 |
+
),
|
18 |
+
) as demo:
|
19 |
+
gr.Markdown(
|
20 |
+
"""
|
21 |
+
# `gradio_promptweighting`
|
22 |
+
|
23 |
+
<div style="display: flex; gap: 7px;">
|
24 |
+
<img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
|
25 |
+
</div>
|
26 |
+
|
27 |
+
Simple component for creating prompt weighting for real-time generation.
|
28 |
+
""", elem_classes=["md-custom"], header_links=True)
|
29 |
+
app.render()
|
30 |
+
gr.Markdown(
|
31 |
+
"""
|
32 |
+
## Installation
|
33 |
+
|
34 |
+
```bash
|
35 |
+
pip install gradio_promptweighting
|
36 |
+
```
|
37 |
+
|
38 |
+
## Usage
|
39 |
+
|
40 |
+
```python
|
41 |
+
import gradio as gr
|
42 |
+
from gradio_promptweighting import PromptWeighting
|
43 |
+
|
44 |
+
|
45 |
+
example = PromptWeighting().example_value()
|
46 |
+
|
47 |
+
|
48 |
+
def predict(input):
|
49 |
+
return (input, input)
|
50 |
+
|
51 |
+
|
52 |
+
with gr.Blocks() as demo:
|
53 |
+
with gr.Row():
|
54 |
+
with gr.Column():
|
55 |
+
prompt = PromptWeighting(
|
56 |
+
value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
|
57 |
+
)
|
58 |
+
btn = gr.Button("Update Prompt")
|
59 |
+
with gr.Column():
|
60 |
+
text = gr.Textbox(
|
61 |
+
label="Prompt",
|
62 |
+
placeholder="",
|
63 |
+
)
|
64 |
+
prompt2 = PromptWeighting(min=0, max=10, step=0.001)
|
65 |
+
inputs = [prompt]
|
66 |
+
outputs = [text, prompt2]
|
67 |
+
|
68 |
+
btn.click(fn=predict, inputs=inputs, outputs=outputs, show_progress=False)
|
69 |
+
prompt.change(
|
70 |
+
fn=predict,
|
71 |
+
inputs=inputs,
|
72 |
+
outputs=outputs,
|
73 |
+
queue=False,
|
74 |
+
trigger_mode="always_last",
|
75 |
+
show_progress=False,
|
76 |
+
)
|
77 |
+
|
78 |
+
|
79 |
+
if __name__ == "__main__":
|
80 |
+
demo.launch()
|
81 |
+
|
82 |
+
```
|
83 |
+
""", elem_classes=["md-custom"], header_links=True)
|
84 |
+
|
85 |
+
|
86 |
+
gr.Markdown("""
|
87 |
+
## `PromptWeighting`
|
88 |
+
|
89 |
+
### Initialization
|
90 |
+
""", elem_classes=["md-custom"], header_links=True)
|
91 |
+
|
92 |
+
gr.ParamViewer(value=_docs["PromptWeighting"]["members"]["__init__"], linkify=[])
|
93 |
+
|
94 |
+
|
95 |
+
gr.Markdown("### Events")
|
96 |
+
gr.ParamViewer(value=_docs["PromptWeighting"]["events"], linkify=['Event'])
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
gr.Markdown("""
|
102 |
+
|
103 |
+
### User function
|
104 |
+
|
105 |
+
The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
|
106 |
+
|
107 |
+
- When used as an Input, the component only impacts the input signature of the user function.
|
108 |
+
- When used as an output, the component only impacts the return signature of the user function.
|
109 |
+
|
110 |
+
The code snippet below is accurate in cases where the component is used as both an input and an output.
|
111 |
+
|
112 |
+
- **As input:** Is passed, passes text value as a {str} into the function.
|
113 |
+
- **As output:** Should return, expects a {str} returned from function and sets textarea value to it.
|
114 |
+
|
115 |
+
```python
|
116 |
+
def predict(
|
117 |
+
value: str | None
|
118 |
+
) -> str | None:
|
119 |
+
return value
|
120 |
+
```
|
121 |
+
""", elem_classes=["md-custom", "PromptWeighting-user-fn"], header_links=True)
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
demo.load(None, js=r"""function() {
|
127 |
+
const refs = {};
|
128 |
+
const user_fn_refs = {
|
129 |
+
PromptWeighting: [], };
|
130 |
+
requestAnimationFrame(() => {
|
131 |
+
|
132 |
+
Object.entries(user_fn_refs).forEach(([key, refs]) => {
|
133 |
+
if (refs.length > 0) {
|
134 |
+
const el = document.querySelector(`.${key}-user-fn`);
|
135 |
+
if (!el) return;
|
136 |
+
refs.forEach(ref => {
|
137 |
+
el.innerHTML = el.innerHTML.replace(
|
138 |
+
new RegExp("\\b"+ref+"\\b", "g"),
|
139 |
+
`<a href="#h-${ref.toLowerCase()}">${ref}</a>`
|
140 |
+
);
|
141 |
+
})
|
142 |
+
}
|
143 |
+
})
|
144 |
+
|
145 |
+
Object.entries(refs).forEach(([key, refs]) => {
|
146 |
+
if (refs.length > 0) {
|
147 |
+
const el = document.querySelector(`.${key}`);
|
148 |
+
if (!el) return;
|
149 |
+
refs.forEach(ref => {
|
150 |
+
el.innerHTML = el.innerHTML.replace(
|
151 |
+
new RegExp("\\b"+ref+"\\b", "g"),
|
152 |
+
`<a href="#h-${ref.toLowerCase()}">${ref}</a>`
|
153 |
+
);
|
154 |
+
})
|
155 |
+
}
|
156 |
+
})
|
157 |
+
})
|
158 |
+
}
|
159 |
+
|
160 |
+
""")
|
161 |
+
|
162 |
+
demo.launch()
|
src/frontend/Example.svelte
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { onMount } from "svelte";
|
3 |
+
|
4 |
+
export let value: string | null;
|
5 |
+
export let type: "gallery" | "table";
|
6 |
+
export let selected = false;
|
7 |
+
|
8 |
+
let size: number;
|
9 |
+
let el: HTMLDivElement;
|
10 |
+
|
11 |
+
function set_styles(element: HTMLElement, el_width: number): void {
|
12 |
+
if (!element || !el_width) return;
|
13 |
+
el.style.setProperty(
|
14 |
+
"--local-text-width",
|
15 |
+
`${el_width < 150 ? el_width : 200}px`
|
16 |
+
);
|
17 |
+
el.style.whiteSpace = "unset";
|
18 |
+
}
|
19 |
+
|
20 |
+
onMount(() => {
|
21 |
+
set_styles(el, size);
|
22 |
+
});
|
23 |
+
</script>
|
24 |
+
|
25 |
+
<div
|
26 |
+
bind:clientWidth={size}
|
27 |
+
bind:this={el}
|
28 |
+
class:table={type === "table"}
|
29 |
+
class:gallery={type === "gallery"}
|
30 |
+
class:selected
|
31 |
+
>
|
32 |
+
{value ? value : ""}
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<style scoped>
|
36 |
+
.gallery {
|
37 |
+
padding: var(--size-1) var(--size-2);
|
38 |
+
}
|
39 |
+
|
40 |
+
div {
|
41 |
+
overflow: hidden;
|
42 |
+
min-width: var(--local-text-width);
|
43 |
+
|
44 |
+
white-space: nowrap;
|
45 |
+
}
|
46 |
+
</style>
|
src/frontend/Index.svelte
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svelte:options accessors={true} />
|
2 |
+
|
3 |
+
<script lang="ts">
|
4 |
+
import type { PromptType, SelectData } from "types";
|
5 |
+
import { nanoid } from "nanoid";
|
6 |
+
import type { Gradio } from "@gradio/utils";
|
7 |
+
import { BlockTitle } from "@gradio/atoms";
|
8 |
+
import { Block } from "@gradio/atoms";
|
9 |
+
import { StatusTracker } from "@gradio/statustracker";
|
10 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
11 |
+
import PrompstList from "./lib/PrompstList.svelte";
|
12 |
+
|
13 |
+
import { tick } from "svelte";
|
14 |
+
|
15 |
+
export let gradio: Gradio<{
|
16 |
+
change: PromptType[];
|
17 |
+
submit: never;
|
18 |
+
blur: never;
|
19 |
+
select: SelectData;
|
20 |
+
input: never;
|
21 |
+
focus: never;
|
22 |
+
}>;
|
23 |
+
export let info: string | undefined = undefined;
|
24 |
+
export let label = "Prompt Weighting";
|
25 |
+
export let elem_id = "";
|
26 |
+
export let elem_classes: string[] = [];
|
27 |
+
export let visible = true;
|
28 |
+
export let value: PromptType[] = [];
|
29 |
+
export let placeholder = "";
|
30 |
+
export let show_label: boolean;
|
31 |
+
export let scale: number | null = null;
|
32 |
+
export let min_width: number | undefined = undefined;
|
33 |
+
export let loading_status: LoadingStatus | undefined = undefined;
|
34 |
+
export let value_is_output = false;
|
35 |
+
export let interactive: boolean;
|
36 |
+
export let rtl = false;
|
37 |
+
export let min = 0;
|
38 |
+
export let max = 2;
|
39 |
+
export let step = 0.01;
|
40 |
+
let promptsList: PromptType[] = [];
|
41 |
+
|
42 |
+
let el: HTMLTextAreaElement | HTMLInputElement;
|
43 |
+
const container = false;
|
44 |
+
|
45 |
+
function handle_change(): void {
|
46 |
+
gradio.dispatch("change", value);
|
47 |
+
if (!value_is_output) {
|
48 |
+
gradio.dispatch("input");
|
49 |
+
gradio.dispatch("submit");
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
async function handle_keypress(e: KeyboardEvent): Promise<void> {
|
54 |
+
await tick();
|
55 |
+
if (e.key === "Enter") {
|
56 |
+
e.preventDefault();
|
57 |
+
gradio.dispatch("submit");
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
$: if (value === null) value = [];
|
62 |
+
|
63 |
+
$: value, handle_change();
|
64 |
+
</script>
|
65 |
+
|
66 |
+
<Block
|
67 |
+
{visible}
|
68 |
+
{elem_id}
|
69 |
+
{elem_classes}
|
70 |
+
{scale}
|
71 |
+
{min_width}
|
72 |
+
allow_overflow={false}
|
73 |
+
padding={true}
|
74 |
+
>
|
75 |
+
{#if loading_status}
|
76 |
+
<StatusTracker
|
77 |
+
autoscroll={gradio.autoscroll}
|
78 |
+
i18n={gradio.i18n}
|
79 |
+
{...loading_status}
|
80 |
+
/>
|
81 |
+
{/if}
|
82 |
+
|
83 |
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
84 |
+
<label class:container class="relative">
|
85 |
+
<BlockTitle {show_label} {info}>{label}</BlockTitle>
|
86 |
+
<PrompstList
|
87 |
+
{min}
|
88 |
+
{max}
|
89 |
+
{step}
|
90 |
+
classNames={"py-5"}
|
91 |
+
bind:promptsList={value}
|
92 |
+
/>
|
93 |
+
</label>
|
94 |
+
</Block>
|
95 |
+
|
96 |
+
<style>
|
97 |
+
</style>
|
src/frontend/lib/Icons/Cross.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
width="1em"
|
8 |
+
height="1em"
|
9 |
+
viewBox="0 0 512 512"
|
10 |
+
class={classNames}
|
11 |
+
><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path
|
12 |
+
fill="currentColor"
|
13 |
+
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"
|
14 |
+
/>
|
15 |
+
</svg>
|
src/frontend/lib/Icons/Minus.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
width="1em"
|
8 |
+
height="1em"
|
9 |
+
viewBox="0 0 512 512"
|
10 |
+
class={classNames}
|
11 |
+
><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path
|
12 |
+
fill="currentColor"
|
13 |
+
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232H328c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"
|
14 |
+
/></svg
|
15 |
+
>
|
src/frontend/lib/Icons/Plus.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
width="1em"
|
8 |
+
height="1em"
|
9 |
+
viewBox="0 0 512 512"
|
10 |
+
class={classNames}
|
11 |
+
><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path
|
12 |
+
fill="currentColor"
|
13 |
+
d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344V280H168c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H280v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"
|
14 |
+
/></svg
|
15 |
+
>
|
src/frontend/lib/Icons/Undo.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
width="1em"
|
8 |
+
height="1em"
|
9 |
+
viewBox="0 0 512 512"
|
10 |
+
class={classNames}
|
11 |
+
fill="currentColor"
|
12 |
+
><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path
|
13 |
+
d="M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z"
|
14 |
+
/></svg
|
15 |
+
>
|
src/frontend/lib/Icons/UpDown.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
height="1em"
|
8 |
+
width="1em"
|
9 |
+
viewBox="0 0 256 512"
|
10 |
+
class={classNames}
|
11 |
+
><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path
|
12 |
+
fill="currentColor"
|
13 |
+
d="M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160H80V352H24c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4H176V160h56c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"
|
14 |
+
/></svg
|
15 |
+
>
|
src/frontend/lib/Icons/UpDownLeftRight.svelte
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
export let classNames = "";
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<svg
|
6 |
+
xmlns="http://www.w3.org/2000/svg"
|
7 |
+
width="1em"
|
8 |
+
height="1em"
|
9 |
+
viewBox="0 0 512 512"
|
10 |
+
class={classNames}
|
11 |
+
>
|
12 |
+
<path
|
13 |
+
d="M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224V402.7l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288H402.7l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"
|
14 |
+
/>
|
15 |
+
</svg>
|
src/frontend/lib/PrompstList.svelte
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { nanoid } from "nanoid";
|
3 |
+
import { createEventDispatcher } from "svelte";
|
4 |
+
import type { PromptType } from "../types";
|
5 |
+
import Prompt from "./Prompt.svelte";
|
6 |
+
import Plus from "./Icons/Plus.svelte";
|
7 |
+
export let classNames = "";
|
8 |
+
export let promptsList: PromptType[] = [];
|
9 |
+
export let min: number;
|
10 |
+
export let max: number;
|
11 |
+
export let step: number;
|
12 |
+
|
13 |
+
function removeConcept(conceptToRemove: PromptType) {
|
14 |
+
promptsList = promptsList.filter(
|
15 |
+
(concept) => concept.id !== conceptToRemove.id
|
16 |
+
);
|
17 |
+
}
|
18 |
+
function addPrompt(negative = false) {
|
19 |
+
promptsList = [
|
20 |
+
...promptsList,
|
21 |
+
{
|
22 |
+
id: nanoid(),
|
23 |
+
prompt: "",
|
24 |
+
scale: 1,
|
25 |
+
negative: negative,
|
26 |
+
},
|
27 |
+
];
|
28 |
+
}
|
29 |
+
const dispatch = createEventDispatcher();
|
30 |
+
// $: promptsList,
|
31 |
+
// dispatch("change", promptsList),
|
32 |
+
// dispatch("input", promptsList);
|
33 |
+
</script>
|
34 |
+
|
35 |
+
<div class="flex items-center gap-1 flex-wrap {classNames}">
|
36 |
+
{#each promptsList as prompt}
|
37 |
+
<Prompt
|
38 |
+
{min}
|
39 |
+
{max}
|
40 |
+
{step}
|
41 |
+
bind:prompt
|
42 |
+
on:remove={() => removeConcept(prompt)}
|
43 |
+
on:add={() => addPrompt()}
|
44 |
+
/>
|
45 |
+
{/each}
|
46 |
+
<div class="flex flex-col gap-1">
|
47 |
+
<button
|
48 |
+
title="Add Concept"
|
49 |
+
class="flex items-center text-base text-black hover-text-cyan-500 dark:text-white"
|
50 |
+
on:click={() => addPrompt(false)}
|
51 |
+
><Plus />
|
52 |
+
<h2 class="text-xs font-normal px-1">Add Prompt</h2>
|
53 |
+
</button>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<style scoped>
|
58 |
+
.flex {
|
59 |
+
display: flex;
|
60 |
+
}
|
61 |
+
.items-center {
|
62 |
+
align-items: center;
|
63 |
+
}
|
64 |
+
.gap-1 {
|
65 |
+
gap: 0.25rem;
|
66 |
+
}
|
67 |
+
.flex-wrap {
|
68 |
+
flex-wrap: wrap;
|
69 |
+
}
|
70 |
+
.flex-col {
|
71 |
+
flex-direction: column;
|
72 |
+
}
|
73 |
+
.text-base {
|
74 |
+
font-size: 1rem;
|
75 |
+
line-height: 1.5rem;
|
76 |
+
}
|
77 |
+
.text-black {
|
78 |
+
color: #000;
|
79 |
+
}
|
80 |
+
.hover-text-cyan-500:hover {
|
81 |
+
color: #06b6d4;
|
82 |
+
}
|
83 |
+
@media (prefers-color-scheme: dark) {
|
84 |
+
.dark\:text-white {
|
85 |
+
color: #fff;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
.text-xs {
|
90 |
+
font-size: 0.75rem;
|
91 |
+
line-height: 1rem;
|
92 |
+
}
|
93 |
+
.font-normal {
|
94 |
+
font-weight: 400;
|
95 |
+
}
|
96 |
+
.px-1 {
|
97 |
+
padding-left: 0.25rem;
|
98 |
+
padding-right: 0.25rem;
|
99 |
+
}
|
100 |
+
</style>
|
src/frontend/lib/Prompt.svelte
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { onMount, createEventDispatcher } from "svelte";
|
3 |
+
import { drag } from "d3-drag";
|
4 |
+
import { select } from "d3-selection";
|
5 |
+
import Cross from "./Icons/Cross.svelte";
|
6 |
+
import type { PromptType } from "../types";
|
7 |
+
|
8 |
+
export let prompt: PromptType;
|
9 |
+
export let min = 0;
|
10 |
+
export let max = 2;
|
11 |
+
export let step = 0.01;
|
12 |
+
|
13 |
+
let inputEl: HTMLInputElement;
|
14 |
+
let isDragging = false;
|
15 |
+
let isHovering = false;
|
16 |
+
const dispatch = createEventDispatcher();
|
17 |
+
|
18 |
+
let wScale = 0;
|
19 |
+
|
20 |
+
let dragEl: HTMLElement;
|
21 |
+
|
22 |
+
onMount(() => {
|
23 |
+
const dragHandler = drag()
|
24 |
+
.on("start", (event) => {
|
25 |
+
wScale = prompt.scale;
|
26 |
+
isDragging = true;
|
27 |
+
})
|
28 |
+
.on("drag", (event) => {
|
29 |
+
const { dx, dy } = event;
|
30 |
+
|
31 |
+
wScale -= dy * step;
|
32 |
+
wScale = Math.min(wScale, max);
|
33 |
+
wScale = Math.max(wScale, min);
|
34 |
+
|
35 |
+
prompt.scale = wScale;
|
36 |
+
})
|
37 |
+
.on("end", (event) => {
|
38 |
+
isDragging = false;
|
39 |
+
});
|
40 |
+
|
41 |
+
select(dragEl).call(dragHandler);
|
42 |
+
inputEl.focus();
|
43 |
+
});
|
44 |
+
function onKeyPress(event: InputEvent) {
|
45 |
+
if (event.key === "Enter") {
|
46 |
+
dispatch("add");
|
47 |
+
}
|
48 |
+
}
|
49 |
+
$: if (isDragging) {
|
50 |
+
document.body.classList.add("grabbing");
|
51 |
+
} else {
|
52 |
+
document.body.classList.remove("grabbing");
|
53 |
+
}
|
54 |
+
</script>
|
55 |
+
|
56 |
+
<div
|
57 |
+
class="w-min flex flex-col group relative"
|
58 |
+
bind:this={dragEl}
|
59 |
+
on:pointerenter={() => (isHovering = true)}
|
60 |
+
on:pointerleave={() => (isHovering = false)}
|
61 |
+
on:pointercancel={() => (isHovering = false)}
|
62 |
+
on:pointerover={() => (isHovering = true)}
|
63 |
+
on:pointerout={() => (isHovering = false)}
|
64 |
+
on:pointerenter={() => (isHovering = true)}
|
65 |
+
>
|
66 |
+
<div
|
67 |
+
class="flex justify-between items-center rounded-md overflow-hidden
|
68 |
+
{isDragging || isHovering ? 'select-none touch-manipulation' : ''}"
|
69 |
+
>
|
70 |
+
<div class="absolute z-10 flex items-center justify-center w-[2.5em]">
|
71 |
+
<div class="relative">
|
72 |
+
<div class="bottom-full p-1">
|
73 |
+
<span
|
74 |
+
class="flex text-[0.5rem] font-mono text-black dark:group-hover:text-white"
|
75 |
+
>
|
76 |
+
<span class="text-black">
|
77 |
+
<span class="text-black">{prompt.scale.toFixed(1)}</span>
|
78 |
+
</span>
|
79 |
+
</span>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
<div class="relative flex z-0">
|
84 |
+
<input
|
85 |
+
bind:this={inputEl}
|
86 |
+
on:keypress={onKeyPress}
|
87 |
+
type="text"
|
88 |
+
placeholder="Prompt"
|
89 |
+
class="text-sm z-0 pl pr py-2 outline-none text-black {prompt.neg_guidance
|
90 |
+
? 'line-through'
|
91 |
+
: ''}"
|
92 |
+
style="width: calc({Math.max(14, prompt.prompt.length + 1)}ch + 2em) ;"
|
93 |
+
bind:value={prompt.prompt}
|
94 |
+
/>
|
95 |
+
</div>
|
96 |
+
<button
|
97 |
+
class="absolute z-1 right-1 text text-black hover:text-red-500 invisible group-hover:visible"
|
98 |
+
title="Remove prompt"
|
99 |
+
on:click={() => dispatch("remove")}
|
100 |
+
>
|
101 |
+
<Cross />
|
102 |
+
</button>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<style scoped>
|
107 |
+
:global(.grabbing *) {
|
108 |
+
cursor: grabbing !important;
|
109 |
+
}
|
110 |
+
|
111 |
+
.w-min {
|
112 |
+
width: min-content;
|
113 |
+
}
|
114 |
+
.flex {
|
115 |
+
display: flex;
|
116 |
+
}
|
117 |
+
.flex-col {
|
118 |
+
flex-direction: column;
|
119 |
+
}
|
120 |
+
.group:hover .group-hover\:block {
|
121 |
+
display: block;
|
122 |
+
}
|
123 |
+
.group:hover .group-hover\:text-white {
|
124 |
+
color: white;
|
125 |
+
}
|
126 |
+
.group:hover .group-hover\:visible {
|
127 |
+
visibility: visible;
|
128 |
+
}
|
129 |
+
.relative {
|
130 |
+
position: relative;
|
131 |
+
}
|
132 |
+
.justify-between {
|
133 |
+
justify-content: space-between;
|
134 |
+
}
|
135 |
+
.items-center {
|
136 |
+
align-items: center;
|
137 |
+
}
|
138 |
+
|
139 |
+
.overflow-hidden {
|
140 |
+
overflow: hidden;
|
141 |
+
}
|
142 |
+
.select-none {
|
143 |
+
user-select: none;
|
144 |
+
}
|
145 |
+
.touch-manipulation {
|
146 |
+
touch-action: manipulation;
|
147 |
+
}
|
148 |
+
.absolute {
|
149 |
+
position: absolute;
|
150 |
+
}
|
151 |
+
.z-10 {
|
152 |
+
z-index: 10;
|
153 |
+
}
|
154 |
+
.p-1 {
|
155 |
+
padding: 0.125rem;
|
156 |
+
}
|
157 |
+
.mx-3 {
|
158 |
+
margin-left: 0.5rem;
|
159 |
+
margin-right: 0.5rem;
|
160 |
+
}
|
161 |
+
.text-black {
|
162 |
+
color: black !important;
|
163 |
+
}
|
164 |
+
.text-sm {
|
165 |
+
font-size: 0.875rem;
|
166 |
+
line-height: 1.25rem;
|
167 |
+
}
|
168 |
+
.cursor-ns-resize {
|
169 |
+
cursor: ns-resize;
|
170 |
+
}
|
171 |
+
.bottom-full {
|
172 |
+
bottom: 100%;
|
173 |
+
}
|
174 |
+
.mb-2 {
|
175 |
+
margin-bottom: 0.5rem;
|
176 |
+
}
|
177 |
+
@media (prefers-color-scheme: dark) {
|
178 |
+
.dark\:group-hover\:text-white {
|
179 |
+
color: white;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
.text-\[0\.5rem\] {
|
183 |
+
font-size: 0.5rem;
|
184 |
+
}
|
185 |
+
.font-mono {
|
186 |
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
187 |
+
"Liberation Mono", "Courier New", monospace;
|
188 |
+
}
|
189 |
+
.z-0 {
|
190 |
+
z-index: 0;
|
191 |
+
}
|
192 |
+
.pl {
|
193 |
+
padding-left: 1.5em;
|
194 |
+
}
|
195 |
+
.pr {
|
196 |
+
padding-right: 0.5em;
|
197 |
+
}
|
198 |
+
.py-2 {
|
199 |
+
padding-top: 0.5rem;
|
200 |
+
padding-bottom: 0.5rem;
|
201 |
+
}
|
202 |
+
.outline-none {
|
203 |
+
outline: 2px solid transparent;
|
204 |
+
outline-offset: 2px;
|
205 |
+
}
|
206 |
+
.line-through {
|
207 |
+
text-decoration: line-through;
|
208 |
+
}
|
209 |
+
.z-1 {
|
210 |
+
z-index: 1;
|
211 |
+
}
|
212 |
+
.right-1 {
|
213 |
+
right: 0.25rem;
|
214 |
+
}
|
215 |
+
.hover\:text-red-500:hover {
|
216 |
+
color: #ef4444 !important;
|
217 |
+
}
|
218 |
+
.invisible {
|
219 |
+
visibility: hidden;
|
220 |
+
}
|
221 |
+
</style>
|
src/frontend/lib/constants.ts
ADDED
File without changes
|
src/frontend/lib/store.ts
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
import { writable } from 'svelte/store';
|
2 |
+
|
3 |
+
export const currentCanvas = writable<HTMLCanvasElement>();
|
src/frontend/package-lock.json
ADDED
@@ -0,0 +1,1096 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_promptweighting",
|
3 |
+
"version": "0.1.13",
|
4 |
+
"lockfileVersion": 3,
|
5 |
+
"requires": true,
|
6 |
+
"packages": {
|
7 |
+
"": {
|
8 |
+
"name": "gradio_promptweighting",
|
9 |
+
"version": "0.1.13",
|
10 |
+
"license": "ISC",
|
11 |
+
"dependencies": {
|
12 |
+
"@gradio/atoms": "0.6.1",
|
13 |
+
"@gradio/icons": "0.3.4",
|
14 |
+
"@gradio/statustracker": "0.4.10",
|
15 |
+
"@gradio/utils": "0.3.0",
|
16 |
+
"d3-drag": "^3.0.0",
|
17 |
+
"d3-scale": "^4.0.2",
|
18 |
+
"d3-scale-chromatic": "^3.1.0",
|
19 |
+
"d3-selection": "^3.0.0",
|
20 |
+
"nanoid": "^5.0.6"
|
21 |
+
}
|
22 |
+
},
|
23 |
+
"node_modules/@ampproject/remapping": {
|
24 |
+
"version": "2.3.0",
|
25 |
+
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
|
26 |
+
"integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
|
27 |
+
"peer": true,
|
28 |
+
"dependencies": {
|
29 |
+
"@jridgewell/gen-mapping": "^0.3.5",
|
30 |
+
"@jridgewell/trace-mapping": "^0.3.24"
|
31 |
+
},
|
32 |
+
"engines": {
|
33 |
+
"node": ">=6.0.0"
|
34 |
+
}
|
35 |
+
},
|
36 |
+
"node_modules/@esbuild/aix-ppc64": {
|
37 |
+
"version": "0.19.12",
|
38 |
+
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
|
39 |
+
"integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
|
40 |
+
"cpu": [
|
41 |
+
"ppc64"
|
42 |
+
],
|
43 |
+
"optional": true,
|
44 |
+
"os": [
|
45 |
+
"aix"
|
46 |
+
],
|
47 |
+
"engines": {
|
48 |
+
"node": ">=12"
|
49 |
+
}
|
50 |
+
},
|
51 |
+
"node_modules/@esbuild/android-arm": {
|
52 |
+
"version": "0.19.12",
|
53 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
|
54 |
+
"integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
|
55 |
+
"cpu": [
|
56 |
+
"arm"
|
57 |
+
],
|
58 |
+
"optional": true,
|
59 |
+
"os": [
|
60 |
+
"android"
|
61 |
+
],
|
62 |
+
"engines": {
|
63 |
+
"node": ">=12"
|
64 |
+
}
|
65 |
+
},
|
66 |
+
"node_modules/@esbuild/android-arm64": {
|
67 |
+
"version": "0.19.12",
|
68 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
|
69 |
+
"integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
|
70 |
+
"cpu": [
|
71 |
+
"arm64"
|
72 |
+
],
|
73 |
+
"optional": true,
|
74 |
+
"os": [
|
75 |
+
"android"
|
76 |
+
],
|
77 |
+
"engines": {
|
78 |
+
"node": ">=12"
|
79 |
+
}
|
80 |
+
},
|
81 |
+
"node_modules/@esbuild/android-x64": {
|
82 |
+
"version": "0.19.12",
|
83 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
|
84 |
+
"integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
|
85 |
+
"cpu": [
|
86 |
+
"x64"
|
87 |
+
],
|
88 |
+
"optional": true,
|
89 |
+
"os": [
|
90 |
+
"android"
|
91 |
+
],
|
92 |
+
"engines": {
|
93 |
+
"node": ">=12"
|
94 |
+
}
|
95 |
+
},
|
96 |
+
"node_modules/@esbuild/darwin-arm64": {
|
97 |
+
"version": "0.19.12",
|
98 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
|
99 |
+
"integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
|
100 |
+
"cpu": [
|
101 |
+
"arm64"
|
102 |
+
],
|
103 |
+
"optional": true,
|
104 |
+
"os": [
|
105 |
+
"darwin"
|
106 |
+
],
|
107 |
+
"engines": {
|
108 |
+
"node": ">=12"
|
109 |
+
}
|
110 |
+
},
|
111 |
+
"node_modules/@esbuild/darwin-x64": {
|
112 |
+
"version": "0.19.12",
|
113 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
|
114 |
+
"integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
|
115 |
+
"cpu": [
|
116 |
+
"x64"
|
117 |
+
],
|
118 |
+
"optional": true,
|
119 |
+
"os": [
|
120 |
+
"darwin"
|
121 |
+
],
|
122 |
+
"engines": {
|
123 |
+
"node": ">=12"
|
124 |
+
}
|
125 |
+
},
|
126 |
+
"node_modules/@esbuild/freebsd-arm64": {
|
127 |
+
"version": "0.19.12",
|
128 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
|
129 |
+
"integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
|
130 |
+
"cpu": [
|
131 |
+
"arm64"
|
132 |
+
],
|
133 |
+
"optional": true,
|
134 |
+
"os": [
|
135 |
+
"freebsd"
|
136 |
+
],
|
137 |
+
"engines": {
|
138 |
+
"node": ">=12"
|
139 |
+
}
|
140 |
+
},
|
141 |
+
"node_modules/@esbuild/freebsd-x64": {
|
142 |
+
"version": "0.19.12",
|
143 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
|
144 |
+
"integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
|
145 |
+
"cpu": [
|
146 |
+
"x64"
|
147 |
+
],
|
148 |
+
"optional": true,
|
149 |
+
"os": [
|
150 |
+
"freebsd"
|
151 |
+
],
|
152 |
+
"engines": {
|
153 |
+
"node": ">=12"
|
154 |
+
}
|
155 |
+
},
|
156 |
+
"node_modules/@esbuild/linux-arm": {
|
157 |
+
"version": "0.19.12",
|
158 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
|
159 |
+
"integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
|
160 |
+
"cpu": [
|
161 |
+
"arm"
|
162 |
+
],
|
163 |
+
"optional": true,
|
164 |
+
"os": [
|
165 |
+
"linux"
|
166 |
+
],
|
167 |
+
"engines": {
|
168 |
+
"node": ">=12"
|
169 |
+
}
|
170 |
+
},
|
171 |
+
"node_modules/@esbuild/linux-arm64": {
|
172 |
+
"version": "0.19.12",
|
173 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
|
174 |
+
"integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
|
175 |
+
"cpu": [
|
176 |
+
"arm64"
|
177 |
+
],
|
178 |
+
"optional": true,
|
179 |
+
"os": [
|
180 |
+
"linux"
|
181 |
+
],
|
182 |
+
"engines": {
|
183 |
+
"node": ">=12"
|
184 |
+
}
|
185 |
+
},
|
186 |
+
"node_modules/@esbuild/linux-ia32": {
|
187 |
+
"version": "0.19.12",
|
188 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
|
189 |
+
"integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
|
190 |
+
"cpu": [
|
191 |
+
"ia32"
|
192 |
+
],
|
193 |
+
"optional": true,
|
194 |
+
"os": [
|
195 |
+
"linux"
|
196 |
+
],
|
197 |
+
"engines": {
|
198 |
+
"node": ">=12"
|
199 |
+
}
|
200 |
+
},
|
201 |
+
"node_modules/@esbuild/linux-loong64": {
|
202 |
+
"version": "0.19.12",
|
203 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
|
204 |
+
"integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
|
205 |
+
"cpu": [
|
206 |
+
"loong64"
|
207 |
+
],
|
208 |
+
"optional": true,
|
209 |
+
"os": [
|
210 |
+
"linux"
|
211 |
+
],
|
212 |
+
"engines": {
|
213 |
+
"node": ">=12"
|
214 |
+
}
|
215 |
+
},
|
216 |
+
"node_modules/@esbuild/linux-mips64el": {
|
217 |
+
"version": "0.19.12",
|
218 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
|
219 |
+
"integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
|
220 |
+
"cpu": [
|
221 |
+
"mips64el"
|
222 |
+
],
|
223 |
+
"optional": true,
|
224 |
+
"os": [
|
225 |
+
"linux"
|
226 |
+
],
|
227 |
+
"engines": {
|
228 |
+
"node": ">=12"
|
229 |
+
}
|
230 |
+
},
|
231 |
+
"node_modules/@esbuild/linux-ppc64": {
|
232 |
+
"version": "0.19.12",
|
233 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
|
234 |
+
"integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
|
235 |
+
"cpu": [
|
236 |
+
"ppc64"
|
237 |
+
],
|
238 |
+
"optional": true,
|
239 |
+
"os": [
|
240 |
+
"linux"
|
241 |
+
],
|
242 |
+
"engines": {
|
243 |
+
"node": ">=12"
|
244 |
+
}
|
245 |
+
},
|
246 |
+
"node_modules/@esbuild/linux-riscv64": {
|
247 |
+
"version": "0.19.12",
|
248 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
|
249 |
+
"integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
|
250 |
+
"cpu": [
|
251 |
+
"riscv64"
|
252 |
+
],
|
253 |
+
"optional": true,
|
254 |
+
"os": [
|
255 |
+
"linux"
|
256 |
+
],
|
257 |
+
"engines": {
|
258 |
+
"node": ">=12"
|
259 |
+
}
|
260 |
+
},
|
261 |
+
"node_modules/@esbuild/linux-s390x": {
|
262 |
+
"version": "0.19.12",
|
263 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
|
264 |
+
"integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
|
265 |
+
"cpu": [
|
266 |
+
"s390x"
|
267 |
+
],
|
268 |
+
"optional": true,
|
269 |
+
"os": [
|
270 |
+
"linux"
|
271 |
+
],
|
272 |
+
"engines": {
|
273 |
+
"node": ">=12"
|
274 |
+
}
|
275 |
+
},
|
276 |
+
"node_modules/@esbuild/linux-x64": {
|
277 |
+
"version": "0.19.12",
|
278 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
|
279 |
+
"integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==",
|
280 |
+
"cpu": [
|
281 |
+
"x64"
|
282 |
+
],
|
283 |
+
"optional": true,
|
284 |
+
"os": [
|
285 |
+
"linux"
|
286 |
+
],
|
287 |
+
"engines": {
|
288 |
+
"node": ">=12"
|
289 |
+
}
|
290 |
+
},
|
291 |
+
"node_modules/@esbuild/netbsd-x64": {
|
292 |
+
"version": "0.19.12",
|
293 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
|
294 |
+
"integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
|
295 |
+
"cpu": [
|
296 |
+
"x64"
|
297 |
+
],
|
298 |
+
"optional": true,
|
299 |
+
"os": [
|
300 |
+
"netbsd"
|
301 |
+
],
|
302 |
+
"engines": {
|
303 |
+
"node": ">=12"
|
304 |
+
}
|
305 |
+
},
|
306 |
+
"node_modules/@esbuild/openbsd-x64": {
|
307 |
+
"version": "0.19.12",
|
308 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
|
309 |
+
"integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
|
310 |
+
"cpu": [
|
311 |
+
"x64"
|
312 |
+
],
|
313 |
+
"optional": true,
|
314 |
+
"os": [
|
315 |
+
"openbsd"
|
316 |
+
],
|
317 |
+
"engines": {
|
318 |
+
"node": ">=12"
|
319 |
+
}
|
320 |
+
},
|
321 |
+
"node_modules/@esbuild/sunos-x64": {
|
322 |
+
"version": "0.19.12",
|
323 |
+
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
|
324 |
+
"integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
|
325 |
+
"cpu": [
|
326 |
+
"x64"
|
327 |
+
],
|
328 |
+
"optional": true,
|
329 |
+
"os": [
|
330 |
+
"sunos"
|
331 |
+
],
|
332 |
+
"engines": {
|
333 |
+
"node": ">=12"
|
334 |
+
}
|
335 |
+
},
|
336 |
+
"node_modules/@esbuild/win32-arm64": {
|
337 |
+
"version": "0.19.12",
|
338 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
|
339 |
+
"integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
|
340 |
+
"cpu": [
|
341 |
+
"arm64"
|
342 |
+
],
|
343 |
+
"optional": true,
|
344 |
+
"os": [
|
345 |
+
"win32"
|
346 |
+
],
|
347 |
+
"engines": {
|
348 |
+
"node": ">=12"
|
349 |
+
}
|
350 |
+
},
|
351 |
+
"node_modules/@esbuild/win32-ia32": {
|
352 |
+
"version": "0.19.12",
|
353 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
|
354 |
+
"integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
|
355 |
+
"cpu": [
|
356 |
+
"ia32"
|
357 |
+
],
|
358 |
+
"optional": true,
|
359 |
+
"os": [
|
360 |
+
"win32"
|
361 |
+
],
|
362 |
+
"engines": {
|
363 |
+
"node": ">=12"
|
364 |
+
}
|
365 |
+
},
|
366 |
+
"node_modules/@esbuild/win32-x64": {
|
367 |
+
"version": "0.19.12",
|
368 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
|
369 |
+
"integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
|
370 |
+
"cpu": [
|
371 |
+
"x64"
|
372 |
+
],
|
373 |
+
"optional": true,
|
374 |
+
"os": [
|
375 |
+
"win32"
|
376 |
+
],
|
377 |
+
"engines": {
|
378 |
+
"node": ">=12"
|
379 |
+
}
|
380 |
+
},
|
381 |
+
"node_modules/@formatjs/ecma402-abstract": {
|
382 |
+
"version": "1.11.4",
|
383 |
+
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
|
384 |
+
"integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
|
385 |
+
"dependencies": {
|
386 |
+
"@formatjs/intl-localematcher": "0.2.25",
|
387 |
+
"tslib": "^2.1.0"
|
388 |
+
}
|
389 |
+
},
|
390 |
+
"node_modules/@formatjs/fast-memoize": {
|
391 |
+
"version": "1.2.1",
|
392 |
+
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
|
393 |
+
"integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
|
394 |
+
"dependencies": {
|
395 |
+
"tslib": "^2.1.0"
|
396 |
+
}
|
397 |
+
},
|
398 |
+
"node_modules/@formatjs/icu-messageformat-parser": {
|
399 |
+
"version": "2.1.0",
|
400 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
|
401 |
+
"integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
|
402 |
+
"dependencies": {
|
403 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
404 |
+
"@formatjs/icu-skeleton-parser": "1.3.6",
|
405 |
+
"tslib": "^2.1.0"
|
406 |
+
}
|
407 |
+
},
|
408 |
+
"node_modules/@formatjs/icu-skeleton-parser": {
|
409 |
+
"version": "1.3.6",
|
410 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
|
411 |
+
"integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
|
412 |
+
"dependencies": {
|
413 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
414 |
+
"tslib": "^2.1.0"
|
415 |
+
}
|
416 |
+
},
|
417 |
+
"node_modules/@formatjs/intl-localematcher": {
|
418 |
+
"version": "0.2.25",
|
419 |
+
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
|
420 |
+
"integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
|
421 |
+
"dependencies": {
|
422 |
+
"tslib": "^2.1.0"
|
423 |
+
}
|
424 |
+
},
|
425 |
+
"node_modules/@gradio/atoms": {
|
426 |
+
"version": "0.6.1",
|
427 |
+
"resolved": "https://registry.npmjs.org/@gradio/atoms/-/atoms-0.6.1.tgz",
|
428 |
+
"integrity": "sha512-u7+cleKA0Et6AhEq5xTiaGIAYPR2He7/JSYcM3Sg+vkFOXhbJTPUnHLub+y9HiseheEmnZDGddFBr+RL5Jaxbg==",
|
429 |
+
"dependencies": {
|
430 |
+
"@gradio/icons": "^0.3.4",
|
431 |
+
"@gradio/utils": "^0.3.0"
|
432 |
+
}
|
433 |
+
},
|
434 |
+
"node_modules/@gradio/column": {
|
435 |
+
"version": "0.1.0",
|
436 |
+
"resolved": "https://registry.npmjs.org/@gradio/column/-/column-0.1.0.tgz",
|
437 |
+
"integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
|
438 |
+
},
|
439 |
+
"node_modules/@gradio/icons": {
|
440 |
+
"version": "0.3.4",
|
441 |
+
"resolved": "https://registry.npmjs.org/@gradio/icons/-/icons-0.3.4.tgz",
|
442 |
+
"integrity": "sha512-rtH7u3OiYy9UuO1bnebXkTXgc+D62H6BILrMtM4EfsKGgQQICD0n7NPvbPtS0zpi/fz0ppCdlfFIKKIOeVaeFg=="
|
443 |
+
},
|
444 |
+
"node_modules/@gradio/statustracker": {
|
445 |
+
"version": "0.4.10",
|
446 |
+
"resolved": "https://registry.npmjs.org/@gradio/statustracker/-/statustracker-0.4.10.tgz",
|
447 |
+
"integrity": "sha512-1uM30C6L/E26czWZE+a8w1Y5g4FuVkfR59ZxhfL6KfWyERJmhlA8iFWrCCrS4uPZ6wFDXDsY6Im8jqL15uqPzg==",
|
448 |
+
"dependencies": {
|
449 |
+
"@gradio/atoms": "^0.6.1",
|
450 |
+
"@gradio/column": "^0.1.0",
|
451 |
+
"@gradio/icons": "^0.3.4",
|
452 |
+
"@gradio/utils": "^0.3.0"
|
453 |
+
}
|
454 |
+
},
|
455 |
+
"node_modules/@gradio/theme": {
|
456 |
+
"version": "0.2.0",
|
457 |
+
"resolved": "https://registry.npmjs.org/@gradio/theme/-/theme-0.2.0.tgz",
|
458 |
+
"integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
|
459 |
+
},
|
460 |
+
"node_modules/@gradio/utils": {
|
461 |
+
"version": "0.3.0",
|
462 |
+
"resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.3.0.tgz",
|
463 |
+
"integrity": "sha512-VxP0h7UoWazkdSB875ChvTXWamBwMguuRc+8OyQFZjdj14lcqLEQuj54es3FDBpXOp5GMLFh48Q5FLLjYxMgSg==",
|
464 |
+
"dependencies": {
|
465 |
+
"@gradio/theme": "^0.2.0",
|
466 |
+
"svelte-i18n": "^3.6.0"
|
467 |
+
}
|
468 |
+
},
|
469 |
+
"node_modules/@jridgewell/gen-mapping": {
|
470 |
+
"version": "0.3.5",
|
471 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
|
472 |
+
"integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
|
473 |
+
"peer": true,
|
474 |
+
"dependencies": {
|
475 |
+
"@jridgewell/set-array": "^1.2.1",
|
476 |
+
"@jridgewell/sourcemap-codec": "^1.4.10",
|
477 |
+
"@jridgewell/trace-mapping": "^0.3.24"
|
478 |
+
},
|
479 |
+
"engines": {
|
480 |
+
"node": ">=6.0.0"
|
481 |
+
}
|
482 |
+
},
|
483 |
+
"node_modules/@jridgewell/resolve-uri": {
|
484 |
+
"version": "3.1.2",
|
485 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
486 |
+
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
487 |
+
"peer": true,
|
488 |
+
"engines": {
|
489 |
+
"node": ">=6.0.0"
|
490 |
+
}
|
491 |
+
},
|
492 |
+
"node_modules/@jridgewell/set-array": {
|
493 |
+
"version": "1.2.1",
|
494 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
|
495 |
+
"integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
|
496 |
+
"peer": true,
|
497 |
+
"engines": {
|
498 |
+
"node": ">=6.0.0"
|
499 |
+
}
|
500 |
+
},
|
501 |
+
"node_modules/@jridgewell/sourcemap-codec": {
|
502 |
+
"version": "1.4.15",
|
503 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
504 |
+
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
505 |
+
"peer": true
|
506 |
+
},
|
507 |
+
"node_modules/@jridgewell/trace-mapping": {
|
508 |
+
"version": "0.3.25",
|
509 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
|
510 |
+
"integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
|
511 |
+
"peer": true,
|
512 |
+
"dependencies": {
|
513 |
+
"@jridgewell/resolve-uri": "^3.1.0",
|
514 |
+
"@jridgewell/sourcemap-codec": "^1.4.14"
|
515 |
+
}
|
516 |
+
},
|
517 |
+
"node_modules/@types/estree": {
|
518 |
+
"version": "1.0.5",
|
519 |
+
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
520 |
+
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
|
521 |
+
"peer": true
|
522 |
+
},
|
523 |
+
"node_modules/acorn": {
|
524 |
+
"version": "8.11.3",
|
525 |
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
526 |
+
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
|
527 |
+
"peer": true,
|
528 |
+
"bin": {
|
529 |
+
"acorn": "bin/acorn"
|
530 |
+
},
|
531 |
+
"engines": {
|
532 |
+
"node": ">=0.4.0"
|
533 |
+
}
|
534 |
+
},
|
535 |
+
"node_modules/aria-query": {
|
536 |
+
"version": "5.3.0",
|
537 |
+
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
538 |
+
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
539 |
+
"peer": true,
|
540 |
+
"dependencies": {
|
541 |
+
"dequal": "^2.0.3"
|
542 |
+
}
|
543 |
+
},
|
544 |
+
"node_modules/axobject-query": {
|
545 |
+
"version": "4.0.0",
|
546 |
+
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz",
|
547 |
+
"integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==",
|
548 |
+
"peer": true,
|
549 |
+
"dependencies": {
|
550 |
+
"dequal": "^2.0.3"
|
551 |
+
}
|
552 |
+
},
|
553 |
+
"node_modules/cli-color": {
|
554 |
+
"version": "2.0.4",
|
555 |
+
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.4.tgz",
|
556 |
+
"integrity": "sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==",
|
557 |
+
"dependencies": {
|
558 |
+
"d": "^1.0.1",
|
559 |
+
"es5-ext": "^0.10.64",
|
560 |
+
"es6-iterator": "^2.0.3",
|
561 |
+
"memoizee": "^0.4.15",
|
562 |
+
"timers-ext": "^0.1.7"
|
563 |
+
},
|
564 |
+
"engines": {
|
565 |
+
"node": ">=0.10"
|
566 |
+
}
|
567 |
+
},
|
568 |
+
"node_modules/code-red": {
|
569 |
+
"version": "1.0.4",
|
570 |
+
"resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
|
571 |
+
"integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
|
572 |
+
"peer": true,
|
573 |
+
"dependencies": {
|
574 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
575 |
+
"@types/estree": "^1.0.1",
|
576 |
+
"acorn": "^8.10.0",
|
577 |
+
"estree-walker": "^3.0.3",
|
578 |
+
"periscopic": "^3.1.0"
|
579 |
+
}
|
580 |
+
},
|
581 |
+
"node_modules/css-tree": {
|
582 |
+
"version": "2.3.1",
|
583 |
+
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
|
584 |
+
"integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
|
585 |
+
"peer": true,
|
586 |
+
"dependencies": {
|
587 |
+
"mdn-data": "2.0.30",
|
588 |
+
"source-map-js": "^1.0.1"
|
589 |
+
},
|
590 |
+
"engines": {
|
591 |
+
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
|
592 |
+
}
|
593 |
+
},
|
594 |
+
"node_modules/d": {
|
595 |
+
"version": "1.0.2",
|
596 |
+
"resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz",
|
597 |
+
"integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
|
598 |
+
"dependencies": {
|
599 |
+
"es5-ext": "^0.10.64",
|
600 |
+
"type": "^2.7.2"
|
601 |
+
},
|
602 |
+
"engines": {
|
603 |
+
"node": ">=0.12"
|
604 |
+
}
|
605 |
+
},
|
606 |
+
"node_modules/d3-array": {
|
607 |
+
"version": "3.2.4",
|
608 |
+
"resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
|
609 |
+
"integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
|
610 |
+
"dependencies": {
|
611 |
+
"internmap": "1 - 2"
|
612 |
+
},
|
613 |
+
"engines": {
|
614 |
+
"node": ">=12"
|
615 |
+
}
|
616 |
+
},
|
617 |
+
"node_modules/d3-color": {
|
618 |
+
"version": "3.1.0",
|
619 |
+
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
|
620 |
+
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
|
621 |
+
"engines": {
|
622 |
+
"node": ">=12"
|
623 |
+
}
|
624 |
+
},
|
625 |
+
"node_modules/d3-dispatch": {
|
626 |
+
"version": "3.0.1",
|
627 |
+
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
|
628 |
+
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
|
629 |
+
"engines": {
|
630 |
+
"node": ">=12"
|
631 |
+
}
|
632 |
+
},
|
633 |
+
"node_modules/d3-drag": {
|
634 |
+
"version": "3.0.0",
|
635 |
+
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
|
636 |
+
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
637 |
+
"dependencies": {
|
638 |
+
"d3-dispatch": "1 - 3",
|
639 |
+
"d3-selection": "3"
|
640 |
+
},
|
641 |
+
"engines": {
|
642 |
+
"node": ">=12"
|
643 |
+
}
|
644 |
+
},
|
645 |
+
"node_modules/d3-format": {
|
646 |
+
"version": "3.1.0",
|
647 |
+
"resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz",
|
648 |
+
"integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==",
|
649 |
+
"engines": {
|
650 |
+
"node": ">=12"
|
651 |
+
}
|
652 |
+
},
|
653 |
+
"node_modules/d3-interpolate": {
|
654 |
+
"version": "3.0.1",
|
655 |
+
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
|
656 |
+
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
|
657 |
+
"dependencies": {
|
658 |
+
"d3-color": "1 - 3"
|
659 |
+
},
|
660 |
+
"engines": {
|
661 |
+
"node": ">=12"
|
662 |
+
}
|
663 |
+
},
|
664 |
+
"node_modules/d3-scale": {
|
665 |
+
"version": "4.0.2",
|
666 |
+
"resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
|
667 |
+
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
|
668 |
+
"dependencies": {
|
669 |
+
"d3-array": "2.10.0 - 3",
|
670 |
+
"d3-format": "1 - 3",
|
671 |
+
"d3-interpolate": "1.2.0 - 3",
|
672 |
+
"d3-time": "2.1.1 - 3",
|
673 |
+
"d3-time-format": "2 - 4"
|
674 |
+
},
|
675 |
+
"engines": {
|
676 |
+
"node": ">=12"
|
677 |
+
}
|
678 |
+
},
|
679 |
+
"node_modules/d3-scale-chromatic": {
|
680 |
+
"version": "3.1.0",
|
681 |
+
"resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
|
682 |
+
"integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
|
683 |
+
"dependencies": {
|
684 |
+
"d3-color": "1 - 3",
|
685 |
+
"d3-interpolate": "1 - 3"
|
686 |
+
},
|
687 |
+
"engines": {
|
688 |
+
"node": ">=12"
|
689 |
+
}
|
690 |
+
},
|
691 |
+
"node_modules/d3-selection": {
|
692 |
+
"version": "3.0.0",
|
693 |
+
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
694 |
+
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
695 |
+
"engines": {
|
696 |
+
"node": ">=12"
|
697 |
+
}
|
698 |
+
},
|
699 |
+
"node_modules/d3-time": {
|
700 |
+
"version": "3.1.0",
|
701 |
+
"resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
|
702 |
+
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
|
703 |
+
"dependencies": {
|
704 |
+
"d3-array": "2 - 3"
|
705 |
+
},
|
706 |
+
"engines": {
|
707 |
+
"node": ">=12"
|
708 |
+
}
|
709 |
+
},
|
710 |
+
"node_modules/d3-time-format": {
|
711 |
+
"version": "4.1.0",
|
712 |
+
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
|
713 |
+
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
|
714 |
+
"dependencies": {
|
715 |
+
"d3-time": "1 - 3"
|
716 |
+
},
|
717 |
+
"engines": {
|
718 |
+
"node": ">=12"
|
719 |
+
}
|
720 |
+
},
|
721 |
+
"node_modules/deepmerge": {
|
722 |
+
"version": "4.3.1",
|
723 |
+
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
724 |
+
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
725 |
+
"engines": {
|
726 |
+
"node": ">=0.10.0"
|
727 |
+
}
|
728 |
+
},
|
729 |
+
"node_modules/dequal": {
|
730 |
+
"version": "2.0.3",
|
731 |
+
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
732 |
+
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
733 |
+
"peer": true,
|
734 |
+
"engines": {
|
735 |
+
"node": ">=6"
|
736 |
+
}
|
737 |
+
},
|
738 |
+
"node_modules/es5-ext": {
|
739 |
+
"version": "0.10.64",
|
740 |
+
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
|
741 |
+
"integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
|
742 |
+
"hasInstallScript": true,
|
743 |
+
"dependencies": {
|
744 |
+
"es6-iterator": "^2.0.3",
|
745 |
+
"es6-symbol": "^3.1.3",
|
746 |
+
"esniff": "^2.0.1",
|
747 |
+
"next-tick": "^1.1.0"
|
748 |
+
},
|
749 |
+
"engines": {
|
750 |
+
"node": ">=0.10"
|
751 |
+
}
|
752 |
+
},
|
753 |
+
"node_modules/es6-iterator": {
|
754 |
+
"version": "2.0.3",
|
755 |
+
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
756 |
+
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
757 |
+
"dependencies": {
|
758 |
+
"d": "1",
|
759 |
+
"es5-ext": "^0.10.35",
|
760 |
+
"es6-symbol": "^3.1.1"
|
761 |
+
}
|
762 |
+
},
|
763 |
+
"node_modules/es6-symbol": {
|
764 |
+
"version": "3.1.4",
|
765 |
+
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz",
|
766 |
+
"integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
|
767 |
+
"dependencies": {
|
768 |
+
"d": "^1.0.2",
|
769 |
+
"ext": "^1.7.0"
|
770 |
+
},
|
771 |
+
"engines": {
|
772 |
+
"node": ">=0.12"
|
773 |
+
}
|
774 |
+
},
|
775 |
+
"node_modules/es6-weak-map": {
|
776 |
+
"version": "2.0.3",
|
777 |
+
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
|
778 |
+
"integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
|
779 |
+
"dependencies": {
|
780 |
+
"d": "1",
|
781 |
+
"es5-ext": "^0.10.46",
|
782 |
+
"es6-iterator": "^2.0.3",
|
783 |
+
"es6-symbol": "^3.1.1"
|
784 |
+
}
|
785 |
+
},
|
786 |
+
"node_modules/esbuild": {
|
787 |
+
"version": "0.19.12",
|
788 |
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz",
|
789 |
+
"integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==",
|
790 |
+
"hasInstallScript": true,
|
791 |
+
"bin": {
|
792 |
+
"esbuild": "bin/esbuild"
|
793 |
+
},
|
794 |
+
"engines": {
|
795 |
+
"node": ">=12"
|
796 |
+
},
|
797 |
+
"optionalDependencies": {
|
798 |
+
"@esbuild/aix-ppc64": "0.19.12",
|
799 |
+
"@esbuild/android-arm": "0.19.12",
|
800 |
+
"@esbuild/android-arm64": "0.19.12",
|
801 |
+
"@esbuild/android-x64": "0.19.12",
|
802 |
+
"@esbuild/darwin-arm64": "0.19.12",
|
803 |
+
"@esbuild/darwin-x64": "0.19.12",
|
804 |
+
"@esbuild/freebsd-arm64": "0.19.12",
|
805 |
+
"@esbuild/freebsd-x64": "0.19.12",
|
806 |
+
"@esbuild/linux-arm": "0.19.12",
|
807 |
+
"@esbuild/linux-arm64": "0.19.12",
|
808 |
+
"@esbuild/linux-ia32": "0.19.12",
|
809 |
+
"@esbuild/linux-loong64": "0.19.12",
|
810 |
+
"@esbuild/linux-mips64el": "0.19.12",
|
811 |
+
"@esbuild/linux-ppc64": "0.19.12",
|
812 |
+
"@esbuild/linux-riscv64": "0.19.12",
|
813 |
+
"@esbuild/linux-s390x": "0.19.12",
|
814 |
+
"@esbuild/linux-x64": "0.19.12",
|
815 |
+
"@esbuild/netbsd-x64": "0.19.12",
|
816 |
+
"@esbuild/openbsd-x64": "0.19.12",
|
817 |
+
"@esbuild/sunos-x64": "0.19.12",
|
818 |
+
"@esbuild/win32-arm64": "0.19.12",
|
819 |
+
"@esbuild/win32-ia32": "0.19.12",
|
820 |
+
"@esbuild/win32-x64": "0.19.12"
|
821 |
+
}
|
822 |
+
},
|
823 |
+
"node_modules/esniff": {
|
824 |
+
"version": "2.0.1",
|
825 |
+
"resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
|
826 |
+
"integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
|
827 |
+
"dependencies": {
|
828 |
+
"d": "^1.0.1",
|
829 |
+
"es5-ext": "^0.10.62",
|
830 |
+
"event-emitter": "^0.3.5",
|
831 |
+
"type": "^2.7.2"
|
832 |
+
},
|
833 |
+
"engines": {
|
834 |
+
"node": ">=0.10"
|
835 |
+
}
|
836 |
+
},
|
837 |
+
"node_modules/estree-walker": {
|
838 |
+
"version": "3.0.3",
|
839 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
840 |
+
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
841 |
+
"peer": true,
|
842 |
+
"dependencies": {
|
843 |
+
"@types/estree": "^1.0.0"
|
844 |
+
}
|
845 |
+
},
|
846 |
+
"node_modules/event-emitter": {
|
847 |
+
"version": "0.3.5",
|
848 |
+
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
849 |
+
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
850 |
+
"dependencies": {
|
851 |
+
"d": "1",
|
852 |
+
"es5-ext": "~0.10.14"
|
853 |
+
}
|
854 |
+
},
|
855 |
+
"node_modules/ext": {
|
856 |
+
"version": "1.7.0",
|
857 |
+
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
858 |
+
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
859 |
+
"dependencies": {
|
860 |
+
"type": "^2.7.2"
|
861 |
+
}
|
862 |
+
},
|
863 |
+
"node_modules/globalyzer": {
|
864 |
+
"version": "0.1.0",
|
865 |
+
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
866 |
+
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
|
867 |
+
},
|
868 |
+
"node_modules/globrex": {
|
869 |
+
"version": "0.1.2",
|
870 |
+
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
871 |
+
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
|
872 |
+
},
|
873 |
+
"node_modules/internmap": {
|
874 |
+
"version": "2.0.3",
|
875 |
+
"resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
|
876 |
+
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
|
877 |
+
"engines": {
|
878 |
+
"node": ">=12"
|
879 |
+
}
|
880 |
+
},
|
881 |
+
"node_modules/intl-messageformat": {
|
882 |
+
"version": "9.13.0",
|
883 |
+
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
|
884 |
+
"integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
|
885 |
+
"dependencies": {
|
886 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
887 |
+
"@formatjs/fast-memoize": "1.2.1",
|
888 |
+
"@formatjs/icu-messageformat-parser": "2.1.0",
|
889 |
+
"tslib": "^2.1.0"
|
890 |
+
}
|
891 |
+
},
|
892 |
+
"node_modules/is-promise": {
|
893 |
+
"version": "2.2.2",
|
894 |
+
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
|
895 |
+
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
896 |
+
},
|
897 |
+
"node_modules/is-reference": {
|
898 |
+
"version": "3.0.2",
|
899 |
+
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
|
900 |
+
"integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
|
901 |
+
"peer": true,
|
902 |
+
"dependencies": {
|
903 |
+
"@types/estree": "*"
|
904 |
+
}
|
905 |
+
},
|
906 |
+
"node_modules/locate-character": {
|
907 |
+
"version": "3.0.0",
|
908 |
+
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
|
909 |
+
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
910 |
+
"peer": true
|
911 |
+
},
|
912 |
+
"node_modules/lru-queue": {
|
913 |
+
"version": "0.1.0",
|
914 |
+
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
|
915 |
+
"integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
|
916 |
+
"dependencies": {
|
917 |
+
"es5-ext": "~0.10.2"
|
918 |
+
}
|
919 |
+
},
|
920 |
+
"node_modules/magic-string": {
|
921 |
+
"version": "0.30.8",
|
922 |
+
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz",
|
923 |
+
"integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==",
|
924 |
+
"peer": true,
|
925 |
+
"dependencies": {
|
926 |
+
"@jridgewell/sourcemap-codec": "^1.4.15"
|
927 |
+
},
|
928 |
+
"engines": {
|
929 |
+
"node": ">=12"
|
930 |
+
}
|
931 |
+
},
|
932 |
+
"node_modules/mdn-data": {
|
933 |
+
"version": "2.0.30",
|
934 |
+
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
|
935 |
+
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
|
936 |
+
"peer": true
|
937 |
+
},
|
938 |
+
"node_modules/memoizee": {
|
939 |
+
"version": "0.4.15",
|
940 |
+
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
|
941 |
+
"integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
|
942 |
+
"dependencies": {
|
943 |
+
"d": "^1.0.1",
|
944 |
+
"es5-ext": "^0.10.53",
|
945 |
+
"es6-weak-map": "^2.0.3",
|
946 |
+
"event-emitter": "^0.3.5",
|
947 |
+
"is-promise": "^2.2.2",
|
948 |
+
"lru-queue": "^0.1.0",
|
949 |
+
"next-tick": "^1.1.0",
|
950 |
+
"timers-ext": "^0.1.7"
|
951 |
+
}
|
952 |
+
},
|
953 |
+
"node_modules/mri": {
|
954 |
+
"version": "1.2.0",
|
955 |
+
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
956 |
+
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
|
957 |
+
"engines": {
|
958 |
+
"node": ">=4"
|
959 |
+
}
|
960 |
+
},
|
961 |
+
"node_modules/nanoid": {
|
962 |
+
"version": "5.0.6",
|
963 |
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.6.tgz",
|
964 |
+
"integrity": "sha512-rRq0eMHoGZxlvaFOUdK1Ev83Bd1IgzzR+WJ3IbDJ7QOSdAxYjlurSPqFs9s4lJg29RT6nPwizFtJhQS6V5xgiA==",
|
965 |
+
"funding": [
|
966 |
+
{
|
967 |
+
"type": "github",
|
968 |
+
"url": "https://github.com/sponsors/ai"
|
969 |
+
}
|
970 |
+
],
|
971 |
+
"bin": {
|
972 |
+
"nanoid": "bin/nanoid.js"
|
973 |
+
},
|
974 |
+
"engines": {
|
975 |
+
"node": "^18 || >=20"
|
976 |
+
}
|
977 |
+
},
|
978 |
+
"node_modules/next-tick": {
|
979 |
+
"version": "1.1.0",
|
980 |
+
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
981 |
+
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
982 |
+
},
|
983 |
+
"node_modules/periscopic": {
|
984 |
+
"version": "3.1.0",
|
985 |
+
"resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
|
986 |
+
"integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
|
987 |
+
"peer": true,
|
988 |
+
"dependencies": {
|
989 |
+
"@types/estree": "^1.0.0",
|
990 |
+
"estree-walker": "^3.0.0",
|
991 |
+
"is-reference": "^3.0.0"
|
992 |
+
}
|
993 |
+
},
|
994 |
+
"node_modules/sade": {
|
995 |
+
"version": "1.8.1",
|
996 |
+
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
997 |
+
"integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
|
998 |
+
"dependencies": {
|
999 |
+
"mri": "^1.1.0"
|
1000 |
+
},
|
1001 |
+
"engines": {
|
1002 |
+
"node": ">=6"
|
1003 |
+
}
|
1004 |
+
},
|
1005 |
+
"node_modules/source-map-js": {
|
1006 |
+
"version": "1.2.0",
|
1007 |
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
1008 |
+
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
|
1009 |
+
"peer": true,
|
1010 |
+
"engines": {
|
1011 |
+
"node": ">=0.10.0"
|
1012 |
+
}
|
1013 |
+
},
|
1014 |
+
"node_modules/svelte": {
|
1015 |
+
"version": "4.2.12",
|
1016 |
+
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz",
|
1017 |
+
"integrity": "sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==",
|
1018 |
+
"peer": true,
|
1019 |
+
"dependencies": {
|
1020 |
+
"@ampproject/remapping": "^2.2.1",
|
1021 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
1022 |
+
"@jridgewell/trace-mapping": "^0.3.18",
|
1023 |
+
"@types/estree": "^1.0.1",
|
1024 |
+
"acorn": "^8.9.0",
|
1025 |
+
"aria-query": "^5.3.0",
|
1026 |
+
"axobject-query": "^4.0.0",
|
1027 |
+
"code-red": "^1.0.3",
|
1028 |
+
"css-tree": "^2.3.1",
|
1029 |
+
"estree-walker": "^3.0.3",
|
1030 |
+
"is-reference": "^3.0.1",
|
1031 |
+
"locate-character": "^3.0.0",
|
1032 |
+
"magic-string": "^0.30.4",
|
1033 |
+
"periscopic": "^3.1.0"
|
1034 |
+
},
|
1035 |
+
"engines": {
|
1036 |
+
"node": ">=16"
|
1037 |
+
}
|
1038 |
+
},
|
1039 |
+
"node_modules/svelte-i18n": {
|
1040 |
+
"version": "3.7.4",
|
1041 |
+
"resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
|
1042 |
+
"integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
|
1043 |
+
"dependencies": {
|
1044 |
+
"cli-color": "^2.0.3",
|
1045 |
+
"deepmerge": "^4.2.2",
|
1046 |
+
"esbuild": "^0.19.2",
|
1047 |
+
"estree-walker": "^2",
|
1048 |
+
"intl-messageformat": "^9.13.0",
|
1049 |
+
"sade": "^1.8.1",
|
1050 |
+
"tiny-glob": "^0.2.9"
|
1051 |
+
},
|
1052 |
+
"bin": {
|
1053 |
+
"svelte-i18n": "dist/cli.js"
|
1054 |
+
},
|
1055 |
+
"engines": {
|
1056 |
+
"node": ">= 16"
|
1057 |
+
},
|
1058 |
+
"peerDependencies": {
|
1059 |
+
"svelte": "^3 || ^4"
|
1060 |
+
}
|
1061 |
+
},
|
1062 |
+
"node_modules/svelte-i18n/node_modules/estree-walker": {
|
1063 |
+
"version": "2.0.2",
|
1064 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
1065 |
+
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
1066 |
+
},
|
1067 |
+
"node_modules/timers-ext": {
|
1068 |
+
"version": "0.1.7",
|
1069 |
+
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
|
1070 |
+
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
|
1071 |
+
"dependencies": {
|
1072 |
+
"es5-ext": "~0.10.46",
|
1073 |
+
"next-tick": "1"
|
1074 |
+
}
|
1075 |
+
},
|
1076 |
+
"node_modules/tiny-glob": {
|
1077 |
+
"version": "0.2.9",
|
1078 |
+
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
1079 |
+
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
1080 |
+
"dependencies": {
|
1081 |
+
"globalyzer": "0.1.0",
|
1082 |
+
"globrex": "^0.1.2"
|
1083 |
+
}
|
1084 |
+
},
|
1085 |
+
"node_modules/tslib": {
|
1086 |
+
"version": "2.6.2",
|
1087 |
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
1088 |
+
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
|
1089 |
+
},
|
1090 |
+
"node_modules/type": {
|
1091 |
+
"version": "2.7.2",
|
1092 |
+
"resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
|
1093 |
+
"integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
|
1094 |
+
}
|
1095 |
+
}
|
1096 |
+
}
|
src/frontend/package.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_promptweighting",
|
3 |
+
"version": "0.1.13",
|
4 |
+
"description": "Gradio UI packages",
|
5 |
+
"type": "module",
|
6 |
+
"author": "",
|
7 |
+
"license": "ISC",
|
8 |
+
"private": false,
|
9 |
+
"main_changeset": true,
|
10 |
+
"exports": {
|
11 |
+
".": "./Index.svelte",
|
12 |
+
"./example": "./Example.svelte",
|
13 |
+
"./package.json": "./package.json"
|
14 |
+
},
|
15 |
+
"dependencies": {
|
16 |
+
"@gradio/atoms": "0.6.1",
|
17 |
+
"@gradio/icons": "0.3.4",
|
18 |
+
"@gradio/statustracker": "0.4.10",
|
19 |
+
"@gradio/utils": "0.3.0",
|
20 |
+
"d3-drag": "^3.0.0",
|
21 |
+
"d3-scale": "^4.0.2",
|
22 |
+
"d3-scale-chromatic": "^3.1.0",
|
23 |
+
"d3-selection": "^3.0.0",
|
24 |
+
"nanoid": "^5.0.6"
|
25 |
+
}
|
26 |
+
}
|
src/frontend/types.ts
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export interface PromptType {
|
2 |
+
id: string;
|
3 |
+
prompt: string;
|
4 |
+
negative: boolean;
|
5 |
+
scale: number;
|
6 |
+
}
|
src/pyproject.toml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = [
|
3 |
+
"hatchling",
|
4 |
+
"hatch-requirements-txt",
|
5 |
+
"hatch-fancy-pypi-readme>=22.5.0",
|
6 |
+
]
|
7 |
+
build-backend = "hatchling.build"
|
8 |
+
|
9 |
+
[project]
|
10 |
+
name = "gradio_promptweighting"
|
11 |
+
version = "0.0.1"
|
12 |
+
description = "Simple component for creating prompt weighting for real-time generation."
|
13 |
+
readme = "README.md"
|
14 |
+
license = "MIT"
|
15 |
+
requires-python = ">=3.8"
|
16 |
+
authors = [{ name = "Radamés Ajna", email = "[email protected]" }]
|
17 |
+
keywords = ["gradio-custom-component", "diffusion model", "UI", "text-to-image", "prompt weighting", "editor"]
|
18 |
+
# Add dependencies here
|
19 |
+
dependencies = ["gradio>=4.0,<5.0"]
|
20 |
+
classifiers = [
|
21 |
+
'Development Status :: 3 - Alpha',
|
22 |
+
'License :: OSI Approved :: Apache Software License',
|
23 |
+
'Operating System :: OS Independent',
|
24 |
+
'Programming Language :: Python :: 3',
|
25 |
+
'Programming Language :: Python :: 3 :: Only',
|
26 |
+
'Programming Language :: Python :: 3.8',
|
27 |
+
'Programming Language :: Python :: 3.9',
|
28 |
+
'Programming Language :: Python :: 3.10',
|
29 |
+
'Programming Language :: Python :: 3.11',
|
30 |
+
'Topic :: Scientific/Engineering',
|
31 |
+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
32 |
+
'Topic :: Scientific/Engineering :: Visualization',
|
33 |
+
]
|
34 |
+
|
35 |
+
[project.optional-dependencies]
|
36 |
+
dev = ["build", "twine"]
|
37 |
+
|
38 |
+
[tool.hatch.build]
|
39 |
+
artifacts = ["/backend/gradio_promptweighting/templates", "*.pyi", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates"]
|
40 |
+
|
41 |
+
[tool.hatch.build.targets.wheel]
|
42 |
+
packages = ["/backend/gradio_promptweighting"]
|