Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +12 -0
- README.md +6 -6
- __init__.py +0 -0
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +16 -0
- requirements.txt +1 -0
- src/.gitignore +9 -0
- src/README.md +10 -0
- src/backend/gradio_rich_textbox/__init__.py +4 -0
- src/backend/gradio_rich_textbox/richtextbox.py +96 -0
- src/backend/gradio_rich_textbox/richtextbox.pyi +209 -0
- src/backend/gradio_rich_textbox/templates/component/index.js +2469 -0
- src/backend/gradio_rich_textbox/templates/component/style.css +1 -0
- src/backend/gradio_rich_textbox/templates/example/index.js +112 -0
- src/backend/gradio_rich_textbox/templates/example/style.css +1 -0
- src/demo/__init__.py +0 -0
- src/demo/app.py +16 -0
- src/frontend/Example.svelte +46 -0
- src/frontend/Index.svelte +158 -0
- src/frontend/package-lock.json +918 -0
- src/frontend/package.json +21 -0
- src/frontend/utils.js +162 -0
- src/pyproject.toml +49 -0
Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
COPY --link --chown=1000 . .
|
7 |
+
|
8 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
+
|
10 |
+
ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
|
11 |
+
|
12 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
-
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
|
2 |
---
|
3 |
+
tags: [gradio-custom-component, gradio-template-SimpleTextbox]
|
4 |
+
title: gradio_rich_textbox V0.1.0
|
5 |
+
colorFrom: pink
|
6 |
+
colorTo: indigo
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
+
license: apache-2.0
|
10 |
---
|
|
|
|
__init__.py
ADDED
File without changes
|
__pycache__/app.cpython-311.pyc
ADDED
Binary file (688 Bytes). View file
|
|
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from gradio_rich_textbox import RichTextbox
|
4 |
+
|
5 |
+
|
6 |
+
example = RichTextbox().example_inputs()
|
7 |
+
|
8 |
+
demo = gr.Interface(
|
9 |
+
lambda x:x,
|
10 |
+
RichTextbox(), # interactive version of your component
|
11 |
+
RichTextbox(), # static version of your component
|
12 |
+
examples=[[example]], # uncomment this line to view the "example version" of your component
|
13 |
+
)
|
14 |
+
|
15 |
+
|
16 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio_rich_textbox-0.1.0-py3-none-any.whl
|
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,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# gradio_rich_textbox
|
3 |
+
A Custom Gradio component.
|
4 |
+
|
5 |
+
## Example usage
|
6 |
+
|
7 |
+
```python
|
8 |
+
import gradio as gr
|
9 |
+
from gradio_rich_textbox import RichTextbox
|
10 |
+
```
|
src/backend/gradio_rich_textbox/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from .richtextbox import RichTextbox
|
3 |
+
|
4 |
+
__all__ = ['RichTextbox']
|
src/backend/gradio_rich_textbox/richtextbox.py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
9 |
+
class RichTextbox(FormComponent):
|
10 |
+
"""
|
11 |
+
Creates a very simple textbox for user to enter string input or display string output.
|
12 |
+
Preprocessing: passes textbox value as a {str} into the function.
|
13 |
+
Postprocessing: expects a {str} returned from function and sets textbox value to it.
|
14 |
+
Examples-format: a {str} representing the textbox input.
|
15 |
+
"""
|
16 |
+
|
17 |
+
EVENTS = [
|
18 |
+
Events.change,
|
19 |
+
Events.input,
|
20 |
+
Events.submit,
|
21 |
+
]
|
22 |
+
|
23 |
+
def __init__(
|
24 |
+
self,
|
25 |
+
value: str | Callable | None = "",
|
26 |
+
*,
|
27 |
+
placeholder: str | None = None,
|
28 |
+
label: str | None = None,
|
29 |
+
every: float | None = None,
|
30 |
+
show_label: bool | None = None,
|
31 |
+
scale: int | None = None,
|
32 |
+
min_width: int = 160,
|
33 |
+
interactive: bool | None = None,
|
34 |
+
visible: bool = True,
|
35 |
+
rtl: bool = False,
|
36 |
+
elem_id: str | None = None,
|
37 |
+
elem_classes: list[str] | str | None = None,
|
38 |
+
render: bool = True,
|
39 |
+
):
|
40 |
+
"""
|
41 |
+
Parameters:
|
42 |
+
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.
|
43 |
+
placeholder: placeholder hint to provide behind textbox.
|
44 |
+
label: component name in interface.
|
45 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
46 |
+
show_label: if True, will display label.
|
47 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
48 |
+
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.
|
49 |
+
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.
|
50 |
+
visible: If False, component will be hidden.
|
51 |
+
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.
|
52 |
+
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.
|
53 |
+
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.
|
54 |
+
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.
|
55 |
+
"""
|
56 |
+
self.placeholder = placeholder
|
57 |
+
self.rtl = rtl
|
58 |
+
super().__init__(
|
59 |
+
label=label,
|
60 |
+
every=every,
|
61 |
+
show_label=show_label,
|
62 |
+
scale=scale,
|
63 |
+
min_width=min_width,
|
64 |
+
interactive=interactive,
|
65 |
+
visible=visible,
|
66 |
+
elem_id=elem_id,
|
67 |
+
elem_classes=elem_classes,
|
68 |
+
value=value,
|
69 |
+
render=render,
|
70 |
+
)
|
71 |
+
|
72 |
+
def preprocess(self, x: str | None) -> str | None:
|
73 |
+
"""
|
74 |
+
Preprocesses input (converts it to a string) before passing it to the function.
|
75 |
+
Parameters:
|
76 |
+
x: text
|
77 |
+
Returns:
|
78 |
+
text
|
79 |
+
"""
|
80 |
+
return None if x is None else str(x)
|
81 |
+
|
82 |
+
def postprocess(self, y: str | None) -> str | None:
|
83 |
+
"""
|
84 |
+
Postproccess the function output y by converting it to a str before passing it to the frontend.
|
85 |
+
Parameters:
|
86 |
+
y: function output to postprocess.
|
87 |
+
Returns:
|
88 |
+
text
|
89 |
+
"""
|
90 |
+
return None if y is None else str(y)
|
91 |
+
|
92 |
+
def api_info(self) -> dict[str, Any]:
|
93 |
+
return {"type": "string"}
|
94 |
+
|
95 |
+
def example_inputs(self) -> Any:
|
96 |
+
return "[b]Hello!![/b]"
|
src/backend/gradio_rich_textbox/richtextbox.pyi
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 RichTextbox(FormComponent):
|
11 |
+
"""
|
12 |
+
Creates a very simple textbox for user to enter string input or display string output.
|
13 |
+
Preprocessing: passes textbox value as a {str} into the function.
|
14 |
+
Postprocessing: expects a {str} returned from function and sets textbox value to it.
|
15 |
+
Examples-format: a {str} representing the textbox input.
|
16 |
+
"""
|
17 |
+
|
18 |
+
EVENTS = [
|
19 |
+
Events.change,
|
20 |
+
Events.input,
|
21 |
+
Events.submit,
|
22 |
+
]
|
23 |
+
|
24 |
+
def __init__(
|
25 |
+
self,
|
26 |
+
value: str | Callable | None = "",
|
27 |
+
*,
|
28 |
+
placeholder: str | None = None,
|
29 |
+
label: str | None = None,
|
30 |
+
every: float | None = None,
|
31 |
+
show_label: bool | None = None,
|
32 |
+
scale: int | None = None,
|
33 |
+
min_width: int = 160,
|
34 |
+
interactive: bool | None = None,
|
35 |
+
visible: bool = True,
|
36 |
+
rtl: bool = False,
|
37 |
+
elem_id: str | None = None,
|
38 |
+
elem_classes: list[str] | str | None = None,
|
39 |
+
render: bool = True,
|
40 |
+
):
|
41 |
+
"""
|
42 |
+
Parameters:
|
43 |
+
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.
|
44 |
+
placeholder: placeholder hint to provide behind textbox.
|
45 |
+
label: component name in interface.
|
46 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
47 |
+
show_label: if True, will display label.
|
48 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
49 |
+
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.
|
50 |
+
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.
|
51 |
+
visible: If False, component will be hidden.
|
52 |
+
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.
|
53 |
+
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.
|
54 |
+
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.
|
55 |
+
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.
|
56 |
+
"""
|
57 |
+
self.placeholder = placeholder
|
58 |
+
self.rtl = rtl
|
59 |
+
super().__init__(
|
60 |
+
label=label,
|
61 |
+
every=every,
|
62 |
+
show_label=show_label,
|
63 |
+
scale=scale,
|
64 |
+
min_width=min_width,
|
65 |
+
interactive=interactive,
|
66 |
+
visible=visible,
|
67 |
+
elem_id=elem_id,
|
68 |
+
elem_classes=elem_classes,
|
69 |
+
value=value,
|
70 |
+
render=render,
|
71 |
+
)
|
72 |
+
|
73 |
+
def preprocess(self, x: str | None) -> str | None:
|
74 |
+
"""
|
75 |
+
Preprocesses input (converts it to a string) before passing it to the function.
|
76 |
+
Parameters:
|
77 |
+
x: text
|
78 |
+
Returns:
|
79 |
+
text
|
80 |
+
"""
|
81 |
+
return None if x is None else str(x)
|
82 |
+
|
83 |
+
def postprocess(self, y: str | None) -> str | None:
|
84 |
+
"""
|
85 |
+
Postproccess the function output y by converting it to a str before passing it to the frontend.
|
86 |
+
Parameters:
|
87 |
+
y: function output to postprocess.
|
88 |
+
Returns:
|
89 |
+
text
|
90 |
+
"""
|
91 |
+
return None if y is None else str(y)
|
92 |
+
|
93 |
+
def api_info(self) -> dict[str, Any]:
|
94 |
+
return {"type": "string"}
|
95 |
+
|
96 |
+
def example_inputs(self) -> Any:
|
97 |
+
return "[b]Hello!![/b]"
|
98 |
+
|
99 |
+
|
100 |
+
def change(self,
|
101 |
+
fn: Callable | None,
|
102 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
103 |
+
outputs: Component | Sequence[Component] | None = None,
|
104 |
+
api_name: str | None | Literal[False] = None,
|
105 |
+
status_tracker: None = None,
|
106 |
+
scroll_to_output: bool = False,
|
107 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
108 |
+
queue: bool | None = None,
|
109 |
+
batch: bool = False,
|
110 |
+
max_batch_size: int = 4,
|
111 |
+
preprocess: bool = True,
|
112 |
+
postprocess: bool = True,
|
113 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
114 |
+
every: float | None = None,
|
115 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
116 |
+
js: str | None = None,) -> Dependency:
|
117 |
+
"""
|
118 |
+
Parameters:
|
119 |
+
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.
|
120 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
121 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
122 |
+
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.
|
123 |
+
scroll_to_output: If True, will scroll to output component on completion
|
124 |
+
show_progress: If True, will show progress animation while pending
|
125 |
+
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.
|
126 |
+
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.
|
127 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
128 |
+
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).
|
129 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
130 |
+
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.
|
131 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
132 |
+
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()` event) would allow a second submission after the pending event is complete.
|
133 |
+
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.
|
134 |
+
"""
|
135 |
+
...
|
136 |
+
|
137 |
+
def input(self,
|
138 |
+
fn: Callable | None,
|
139 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
140 |
+
outputs: Component | Sequence[Component] | None = None,
|
141 |
+
api_name: str | None | Literal[False] = None,
|
142 |
+
status_tracker: None = None,
|
143 |
+
scroll_to_output: bool = False,
|
144 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
145 |
+
queue: bool | None = None,
|
146 |
+
batch: bool = False,
|
147 |
+
max_batch_size: int = 4,
|
148 |
+
preprocess: bool = True,
|
149 |
+
postprocess: bool = True,
|
150 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
151 |
+
every: float | None = None,
|
152 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
153 |
+
js: str | None = None,) -> Dependency:
|
154 |
+
"""
|
155 |
+
Parameters:
|
156 |
+
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.
|
157 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
158 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
159 |
+
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.
|
160 |
+
scroll_to_output: If True, will scroll to output component on completion
|
161 |
+
show_progress: If True, will show progress animation while pending
|
162 |
+
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.
|
163 |
+
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.
|
164 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
165 |
+
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).
|
166 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
167 |
+
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.
|
168 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
169 |
+
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()` event) would allow a second submission after the pending event is complete.
|
170 |
+
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.
|
171 |
+
"""
|
172 |
+
...
|
173 |
+
|
174 |
+
def submit(self,
|
175 |
+
fn: Callable | None,
|
176 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
177 |
+
outputs: Component | Sequence[Component] | None = None,
|
178 |
+
api_name: str | None | Literal[False] = None,
|
179 |
+
status_tracker: None = None,
|
180 |
+
scroll_to_output: bool = False,
|
181 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
182 |
+
queue: bool | None = None,
|
183 |
+
batch: bool = False,
|
184 |
+
max_batch_size: int = 4,
|
185 |
+
preprocess: bool = True,
|
186 |
+
postprocess: bool = True,
|
187 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
188 |
+
every: float | None = None,
|
189 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
190 |
+
js: str | None = None,) -> Dependency:
|
191 |
+
"""
|
192 |
+
Parameters:
|
193 |
+
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.
|
194 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
195 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
196 |
+
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.
|
197 |
+
scroll_to_output: If True, will scroll to output component on completion
|
198 |
+
show_progress: If True, will show progress animation while pending
|
199 |
+
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.
|
200 |
+
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.
|
201 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
202 |
+
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).
|
203 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
204 |
+
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.
|
205 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
206 |
+
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()` event) would allow a second submission after the pending event is complete.
|
207 |
+
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.
|
208 |
+
"""
|
209 |
+
...
|
src/backend/gradio_rich_textbox/templates/component/index.js
ADDED
@@ -0,0 +1,2469 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const {
|
2 |
+
SvelteComponent: gt,
|
3 |
+
assign: ht,
|
4 |
+
create_slot: wt,
|
5 |
+
detach: pt,
|
6 |
+
element: vt,
|
7 |
+
get_all_dirty_from_scope: kt,
|
8 |
+
get_slot_changes: yt,
|
9 |
+
get_spread_update: Tt,
|
10 |
+
init: zt,
|
11 |
+
insert: qt,
|
12 |
+
safe_not_equal: Ct,
|
13 |
+
set_dynamic_element_data: Le,
|
14 |
+
set_style: L,
|
15 |
+
toggle_class: Z,
|
16 |
+
transition_in: nt,
|
17 |
+
transition_out: it,
|
18 |
+
update_slot_base: Ft
|
19 |
+
} = window.__gradio__svelte__internal;
|
20 |
+
function Lt(n) {
|
21 |
+
let e, t, l;
|
22 |
+
const s = (
|
23 |
+
/*#slots*/
|
24 |
+
n[17].default
|
25 |
+
), i = wt(
|
26 |
+
s,
|
27 |
+
n,
|
28 |
+
/*$$scope*/
|
29 |
+
n[16],
|
30 |
+
null
|
31 |
+
);
|
32 |
+
let o = [
|
33 |
+
{ "data-testid": (
|
34 |
+
/*test_id*/
|
35 |
+
n[7]
|
36 |
+
) },
|
37 |
+
{ id: (
|
38 |
+
/*elem_id*/
|
39 |
+
n[2]
|
40 |
+
) },
|
41 |
+
{
|
42 |
+
class: t = "block " + /*elem_classes*/
|
43 |
+
n[3].join(" ") + " svelte-1t38q2d"
|
44 |
+
}
|
45 |
+
], f = {};
|
46 |
+
for (let a = 0; a < o.length; a += 1)
|
47 |
+
f = ht(f, o[a]);
|
48 |
+
return {
|
49 |
+
c() {
|
50 |
+
e = vt(
|
51 |
+
/*tag*/
|
52 |
+
n[14]
|
53 |
+
), i && i.c(), Le(
|
54 |
+
/*tag*/
|
55 |
+
n[14]
|
56 |
+
)(e, f), Z(
|
57 |
+
e,
|
58 |
+
"hidden",
|
59 |
+
/*visible*/
|
60 |
+
n[10] === !1
|
61 |
+
), Z(
|
62 |
+
e,
|
63 |
+
"padded",
|
64 |
+
/*padding*/
|
65 |
+
n[6]
|
66 |
+
), Z(
|
67 |
+
e,
|
68 |
+
"border_focus",
|
69 |
+
/*border_mode*/
|
70 |
+
n[5] === "focus"
|
71 |
+
), Z(e, "hide-container", !/*explicit_call*/
|
72 |
+
n[8] && !/*container*/
|
73 |
+
n[9]), L(e, "height", typeof /*height*/
|
74 |
+
n[0] == "number" ? (
|
75 |
+
/*height*/
|
76 |
+
n[0] + "px"
|
77 |
+
) : void 0), L(e, "width", typeof /*width*/
|
78 |
+
n[1] == "number" ? `calc(min(${/*width*/
|
79 |
+
n[1]}px, 100%))` : void 0), L(
|
80 |
+
e,
|
81 |
+
"border-style",
|
82 |
+
/*variant*/
|
83 |
+
n[4]
|
84 |
+
), L(
|
85 |
+
e,
|
86 |
+
"overflow",
|
87 |
+
/*allow_overflow*/
|
88 |
+
n[11] ? "visible" : "hidden"
|
89 |
+
), L(
|
90 |
+
e,
|
91 |
+
"flex-grow",
|
92 |
+
/*scale*/
|
93 |
+
n[12]
|
94 |
+
), L(e, "min-width", `calc(min(${/*min_width*/
|
95 |
+
n[13]}px, 100%))`), L(e, "border-width", "var(--block-border-width)");
|
96 |
+
},
|
97 |
+
m(a, r) {
|
98 |
+
qt(a, e, r), i && i.m(e, null), l = !0;
|
99 |
+
},
|
100 |
+
p(a, r) {
|
101 |
+
i && i.p && (!l || r & /*$$scope*/
|
102 |
+
65536) && Ft(
|
103 |
+
i,
|
104 |
+
s,
|
105 |
+
a,
|
106 |
+
/*$$scope*/
|
107 |
+
a[16],
|
108 |
+
l ? yt(
|
109 |
+
s,
|
110 |
+
/*$$scope*/
|
111 |
+
a[16],
|
112 |
+
r,
|
113 |
+
null
|
114 |
+
) : kt(
|
115 |
+
/*$$scope*/
|
116 |
+
a[16]
|
117 |
+
),
|
118 |
+
null
|
119 |
+
), Le(
|
120 |
+
/*tag*/
|
121 |
+
a[14]
|
122 |
+
)(e, f = Tt(o, [
|
123 |
+
(!l || r & /*test_id*/
|
124 |
+
128) && { "data-testid": (
|
125 |
+
/*test_id*/
|
126 |
+
a[7]
|
127 |
+
) },
|
128 |
+
(!l || r & /*elem_id*/
|
129 |
+
4) && { id: (
|
130 |
+
/*elem_id*/
|
131 |
+
a[2]
|
132 |
+
) },
|
133 |
+
(!l || r & /*elem_classes*/
|
134 |
+
8 && t !== (t = "block " + /*elem_classes*/
|
135 |
+
a[3].join(" ") + " svelte-1t38q2d")) && { class: t }
|
136 |
+
])), Z(
|
137 |
+
e,
|
138 |
+
"hidden",
|
139 |
+
/*visible*/
|
140 |
+
a[10] === !1
|
141 |
+
), Z(
|
142 |
+
e,
|
143 |
+
"padded",
|
144 |
+
/*padding*/
|
145 |
+
a[6]
|
146 |
+
), Z(
|
147 |
+
e,
|
148 |
+
"border_focus",
|
149 |
+
/*border_mode*/
|
150 |
+
a[5] === "focus"
|
151 |
+
), Z(e, "hide-container", !/*explicit_call*/
|
152 |
+
a[8] && !/*container*/
|
153 |
+
a[9]), r & /*height*/
|
154 |
+
1 && L(e, "height", typeof /*height*/
|
155 |
+
a[0] == "number" ? (
|
156 |
+
/*height*/
|
157 |
+
a[0] + "px"
|
158 |
+
) : void 0), r & /*width*/
|
159 |
+
2 && L(e, "width", typeof /*width*/
|
160 |
+
a[1] == "number" ? `calc(min(${/*width*/
|
161 |
+
a[1]}px, 100%))` : void 0), r & /*variant*/
|
162 |
+
16 && L(
|
163 |
+
e,
|
164 |
+
"border-style",
|
165 |
+
/*variant*/
|
166 |
+
a[4]
|
167 |
+
), r & /*allow_overflow*/
|
168 |
+
2048 && L(
|
169 |
+
e,
|
170 |
+
"overflow",
|
171 |
+
/*allow_overflow*/
|
172 |
+
a[11] ? "visible" : "hidden"
|
173 |
+
), r & /*scale*/
|
174 |
+
4096 && L(
|
175 |
+
e,
|
176 |
+
"flex-grow",
|
177 |
+
/*scale*/
|
178 |
+
a[12]
|
179 |
+
), r & /*min_width*/
|
180 |
+
8192 && L(e, "min-width", `calc(min(${/*min_width*/
|
181 |
+
a[13]}px, 100%))`);
|
182 |
+
},
|
183 |
+
i(a) {
|
184 |
+
l || (nt(i, a), l = !0);
|
185 |
+
},
|
186 |
+
o(a) {
|
187 |
+
it(i, a), l = !1;
|
188 |
+
},
|
189 |
+
d(a) {
|
190 |
+
a && pt(e), i && i.d(a);
|
191 |
+
}
|
192 |
+
};
|
193 |
+
}
|
194 |
+
function Et(n) {
|
195 |
+
let e, t = (
|
196 |
+
/*tag*/
|
197 |
+
n[14] && Lt(n)
|
198 |
+
);
|
199 |
+
return {
|
200 |
+
c() {
|
201 |
+
t && t.c();
|
202 |
+
},
|
203 |
+
m(l, s) {
|
204 |
+
t && t.m(l, s), e = !0;
|
205 |
+
},
|
206 |
+
p(l, [s]) {
|
207 |
+
/*tag*/
|
208 |
+
l[14] && t.p(l, s);
|
209 |
+
},
|
210 |
+
i(l) {
|
211 |
+
e || (nt(t, l), e = !0);
|
212 |
+
},
|
213 |
+
o(l) {
|
214 |
+
it(t, l), e = !1;
|
215 |
+
},
|
216 |
+
d(l) {
|
217 |
+
t && t.d(l);
|
218 |
+
}
|
219 |
+
};
|
220 |
+
}
|
221 |
+
function Bt(n, e, t) {
|
222 |
+
let { $$slots: l = {}, $$scope: s } = e, { height: i = void 0 } = e, { width: o = void 0 } = e, { elem_id: f = "" } = e, { elem_classes: a = [] } = e, { variant: r = "solid" } = e, { border_mode: _ = "base" } = e, { padding: u = !0 } = e, { type: b = "normal" } = e, { test_id: c = void 0 } = e, { explicit_call: d = !1 } = e, { container: y = !0 } = e, { visible: v = !0 } = e, { allow_overflow: F = !0 } = e, { scale: q = null } = e, { min_width: m = 0 } = e, z = b === "fieldset" ? "fieldset" : "div";
|
223 |
+
return n.$$set = (h) => {
|
224 |
+
"height" in h && t(0, i = h.height), "width" in h && t(1, o = h.width), "elem_id" in h && t(2, f = h.elem_id), "elem_classes" in h && t(3, a = h.elem_classes), "variant" in h && t(4, r = h.variant), "border_mode" in h && t(5, _ = h.border_mode), "padding" in h && t(6, u = h.padding), "type" in h && t(15, b = h.type), "test_id" in h && t(7, c = h.test_id), "explicit_call" in h && t(8, d = h.explicit_call), "container" in h && t(9, y = h.container), "visible" in h && t(10, v = h.visible), "allow_overflow" in h && t(11, F = h.allow_overflow), "scale" in h && t(12, q = h.scale), "min_width" in h && t(13, m = h.min_width), "$$scope" in h && t(16, s = h.$$scope);
|
225 |
+
}, [
|
226 |
+
i,
|
227 |
+
o,
|
228 |
+
f,
|
229 |
+
a,
|
230 |
+
r,
|
231 |
+
_,
|
232 |
+
u,
|
233 |
+
c,
|
234 |
+
d,
|
235 |
+
y,
|
236 |
+
v,
|
237 |
+
F,
|
238 |
+
q,
|
239 |
+
m,
|
240 |
+
z,
|
241 |
+
b,
|
242 |
+
s,
|
243 |
+
l
|
244 |
+
];
|
245 |
+
}
|
246 |
+
class At extends gt {
|
247 |
+
constructor(e) {
|
248 |
+
super(), zt(this, e, Bt, Et, Ct, {
|
249 |
+
height: 0,
|
250 |
+
width: 1,
|
251 |
+
elem_id: 2,
|
252 |
+
elem_classes: 3,
|
253 |
+
variant: 4,
|
254 |
+
border_mode: 5,
|
255 |
+
padding: 6,
|
256 |
+
type: 15,
|
257 |
+
test_id: 7,
|
258 |
+
explicit_call: 8,
|
259 |
+
container: 9,
|
260 |
+
visible: 10,
|
261 |
+
allow_overflow: 11,
|
262 |
+
scale: 12,
|
263 |
+
min_width: 13
|
264 |
+
});
|
265 |
+
}
|
266 |
+
}
|
267 |
+
const {
|
268 |
+
SvelteComponent: Mt,
|
269 |
+
attr: Nt,
|
270 |
+
create_slot: St,
|
271 |
+
detach: Vt,
|
272 |
+
element: Xt,
|
273 |
+
get_all_dirty_from_scope: It,
|
274 |
+
get_slot_changes: Zt,
|
275 |
+
init: Ot,
|
276 |
+
insert: Pt,
|
277 |
+
safe_not_equal: Rt,
|
278 |
+
transition_in: jt,
|
279 |
+
transition_out: Dt,
|
280 |
+
update_slot_base: Ht
|
281 |
+
} = window.__gradio__svelte__internal;
|
282 |
+
function Ut(n) {
|
283 |
+
let e, t;
|
284 |
+
const l = (
|
285 |
+
/*#slots*/
|
286 |
+
n[1].default
|
287 |
+
), s = St(
|
288 |
+
l,
|
289 |
+
n,
|
290 |
+
/*$$scope*/
|
291 |
+
n[0],
|
292 |
+
null
|
293 |
+
);
|
294 |
+
return {
|
295 |
+
c() {
|
296 |
+
e = Xt("div"), s && s.c(), Nt(e, "class", "svelte-1hnfib2");
|
297 |
+
},
|
298 |
+
m(i, o) {
|
299 |
+
Pt(i, e, o), s && s.m(e, null), t = !0;
|
300 |
+
},
|
301 |
+
p(i, [o]) {
|
302 |
+
s && s.p && (!t || o & /*$$scope*/
|
303 |
+
1) && Ht(
|
304 |
+
s,
|
305 |
+
l,
|
306 |
+
i,
|
307 |
+
/*$$scope*/
|
308 |
+
i[0],
|
309 |
+
t ? Zt(
|
310 |
+
l,
|
311 |
+
/*$$scope*/
|
312 |
+
i[0],
|
313 |
+
o,
|
314 |
+
null
|
315 |
+
) : It(
|
316 |
+
/*$$scope*/
|
317 |
+
i[0]
|
318 |
+
),
|
319 |
+
null
|
320 |
+
);
|
321 |
+
},
|
322 |
+
i(i) {
|
323 |
+
t || (jt(s, i), t = !0);
|
324 |
+
},
|
325 |
+
o(i) {
|
326 |
+
Dt(s, i), t = !1;
|
327 |
+
},
|
328 |
+
d(i) {
|
329 |
+
i && Vt(e), s && s.d(i);
|
330 |
+
}
|
331 |
+
};
|
332 |
+
}
|
333 |
+
function Yt(n, e, t) {
|
334 |
+
let { $$slots: l = {}, $$scope: s } = e;
|
335 |
+
return n.$$set = (i) => {
|
336 |
+
"$$scope" in i && t(0, s = i.$$scope);
|
337 |
+
}, [s, l];
|
338 |
+
}
|
339 |
+
class Gt extends Mt {
|
340 |
+
constructor(e) {
|
341 |
+
super(), Ot(this, e, Yt, Ut, Rt, {});
|
342 |
+
}
|
343 |
+
}
|
344 |
+
const {
|
345 |
+
SvelteComponent: Kt,
|
346 |
+
attr: Ee,
|
347 |
+
check_outros: Jt,
|
348 |
+
create_component: Qt,
|
349 |
+
create_slot: Wt,
|
350 |
+
destroy_component: xt,
|
351 |
+
detach: ae,
|
352 |
+
element: $t,
|
353 |
+
empty: el,
|
354 |
+
get_all_dirty_from_scope: tl,
|
355 |
+
get_slot_changes: ll,
|
356 |
+
group_outros: nl,
|
357 |
+
init: il,
|
358 |
+
insert: re,
|
359 |
+
mount_component: sl,
|
360 |
+
safe_not_equal: fl,
|
361 |
+
set_data: ol,
|
362 |
+
space: al,
|
363 |
+
text: rl,
|
364 |
+
toggle_class: U,
|
365 |
+
transition_in: te,
|
366 |
+
transition_out: _e,
|
367 |
+
update_slot_base: _l
|
368 |
+
} = window.__gradio__svelte__internal;
|
369 |
+
function Be(n) {
|
370 |
+
let e, t;
|
371 |
+
return e = new Gt({
|
372 |
+
props: {
|
373 |
+
$$slots: { default: [ul] },
|
374 |
+
$$scope: { ctx: n }
|
375 |
+
}
|
376 |
+
}), {
|
377 |
+
c() {
|
378 |
+
Qt(e.$$.fragment);
|
379 |
+
},
|
380 |
+
m(l, s) {
|
381 |
+
sl(e, l, s), t = !0;
|
382 |
+
},
|
383 |
+
p(l, s) {
|
384 |
+
const i = {};
|
385 |
+
s & /*$$scope, info*/
|
386 |
+
10 && (i.$$scope = { dirty: s, ctx: l }), e.$set(i);
|
387 |
+
},
|
388 |
+
i(l) {
|
389 |
+
t || (te(e.$$.fragment, l), t = !0);
|
390 |
+
},
|
391 |
+
o(l) {
|
392 |
+
_e(e.$$.fragment, l), t = !1;
|
393 |
+
},
|
394 |
+
d(l) {
|
395 |
+
xt(e, l);
|
396 |
+
}
|
397 |
+
};
|
398 |
+
}
|
399 |
+
function ul(n) {
|
400 |
+
let e;
|
401 |
+
return {
|
402 |
+
c() {
|
403 |
+
e = rl(
|
404 |
+
/*info*/
|
405 |
+
n[1]
|
406 |
+
);
|
407 |
+
},
|
408 |
+
m(t, l) {
|
409 |
+
re(t, e, l);
|
410 |
+
},
|
411 |
+
p(t, l) {
|
412 |
+
l & /*info*/
|
413 |
+
2 && ol(
|
414 |
+
e,
|
415 |
+
/*info*/
|
416 |
+
t[1]
|
417 |
+
);
|
418 |
+
},
|
419 |
+
d(t) {
|
420 |
+
t && ae(e);
|
421 |
+
}
|
422 |
+
};
|
423 |
+
}
|
424 |
+
function cl(n) {
|
425 |
+
let e, t, l, s;
|
426 |
+
const i = (
|
427 |
+
/*#slots*/
|
428 |
+
n[2].default
|
429 |
+
), o = Wt(
|
430 |
+
i,
|
431 |
+
n,
|
432 |
+
/*$$scope*/
|
433 |
+
n[3],
|
434 |
+
null
|
435 |
+
);
|
436 |
+
let f = (
|
437 |
+
/*info*/
|
438 |
+
n[1] && Be(n)
|
439 |
+
);
|
440 |
+
return {
|
441 |
+
c() {
|
442 |
+
e = $t("span"), o && o.c(), t = al(), f && f.c(), l = el(), Ee(e, "data-testid", "block-info"), Ee(e, "class", "svelte-22c38v"), U(e, "sr-only", !/*show_label*/
|
443 |
+
n[0]), U(e, "hide", !/*show_label*/
|
444 |
+
n[0]), U(
|
445 |
+
e,
|
446 |
+
"has-info",
|
447 |
+
/*info*/
|
448 |
+
n[1] != null
|
449 |
+
);
|
450 |
+
},
|
451 |
+
m(a, r) {
|
452 |
+
re(a, e, r), o && o.m(e, null), re(a, t, r), f && f.m(a, r), re(a, l, r), s = !0;
|
453 |
+
},
|
454 |
+
p(a, [r]) {
|
455 |
+
o && o.p && (!s || r & /*$$scope*/
|
456 |
+
8) && _l(
|
457 |
+
o,
|
458 |
+
i,
|
459 |
+
a,
|
460 |
+
/*$$scope*/
|
461 |
+
a[3],
|
462 |
+
s ? ll(
|
463 |
+
i,
|
464 |
+
/*$$scope*/
|
465 |
+
a[3],
|
466 |
+
r,
|
467 |
+
null
|
468 |
+
) : tl(
|
469 |
+
/*$$scope*/
|
470 |
+
a[3]
|
471 |
+
),
|
472 |
+
null
|
473 |
+
), (!s || r & /*show_label*/
|
474 |
+
1) && U(e, "sr-only", !/*show_label*/
|
475 |
+
a[0]), (!s || r & /*show_label*/
|
476 |
+
1) && U(e, "hide", !/*show_label*/
|
477 |
+
a[0]), (!s || r & /*info*/
|
478 |
+
2) && U(
|
479 |
+
e,
|
480 |
+
"has-info",
|
481 |
+
/*info*/
|
482 |
+
a[1] != null
|
483 |
+
), /*info*/
|
484 |
+
a[1] ? f ? (f.p(a, r), r & /*info*/
|
485 |
+
2 && te(f, 1)) : (f = Be(a), f.c(), te(f, 1), f.m(l.parentNode, l)) : f && (nl(), _e(f, 1, 1, () => {
|
486 |
+
f = null;
|
487 |
+
}), Jt());
|
488 |
+
},
|
489 |
+
i(a) {
|
490 |
+
s || (te(o, a), te(f), s = !0);
|
491 |
+
},
|
492 |
+
o(a) {
|
493 |
+
_e(o, a), _e(f), s = !1;
|
494 |
+
},
|
495 |
+
d(a) {
|
496 |
+
a && (ae(e), ae(t), ae(l)), o && o.d(a), f && f.d(a);
|
497 |
+
}
|
498 |
+
};
|
499 |
+
}
|
500 |
+
function dl(n, e, t) {
|
501 |
+
let { $$slots: l = {}, $$scope: s } = e, { show_label: i = !0 } = e, { info: o = void 0 } = e;
|
502 |
+
return n.$$set = (f) => {
|
503 |
+
"show_label" in f && t(0, i = f.show_label), "info" in f && t(1, o = f.info), "$$scope" in f && t(3, s = f.$$scope);
|
504 |
+
}, [i, o, l, s];
|
505 |
+
}
|
506 |
+
class ml extends Kt {
|
507 |
+
constructor(e) {
|
508 |
+
super(), il(this, e, dl, cl, fl, { show_label: 0, info: 1 });
|
509 |
+
}
|
510 |
+
}
|
511 |
+
const bl = [
|
512 |
+
{ color: "red", primary: 600, secondary: 100 },
|
513 |
+
{ color: "green", primary: 600, secondary: 100 },
|
514 |
+
{ color: "blue", primary: 600, secondary: 100 },
|
515 |
+
{ color: "yellow", primary: 500, secondary: 100 },
|
516 |
+
{ color: "purple", primary: 600, secondary: 100 },
|
517 |
+
{ color: "teal", primary: 600, secondary: 100 },
|
518 |
+
{ color: "orange", primary: 600, secondary: 100 },
|
519 |
+
{ color: "cyan", primary: 600, secondary: 100 },
|
520 |
+
{ color: "lime", primary: 500, secondary: 100 },
|
521 |
+
{ color: "pink", primary: 600, secondary: 100 }
|
522 |
+
], Ae = {
|
523 |
+
inherit: "inherit",
|
524 |
+
current: "currentColor",
|
525 |
+
transparent: "transparent",
|
526 |
+
black: "#000",
|
527 |
+
white: "#fff",
|
528 |
+
slate: {
|
529 |
+
50: "#f8fafc",
|
530 |
+
100: "#f1f5f9",
|
531 |
+
200: "#e2e8f0",
|
532 |
+
300: "#cbd5e1",
|
533 |
+
400: "#94a3b8",
|
534 |
+
500: "#64748b",
|
535 |
+
600: "#475569",
|
536 |
+
700: "#334155",
|
537 |
+
800: "#1e293b",
|
538 |
+
900: "#0f172a",
|
539 |
+
950: "#020617"
|
540 |
+
},
|
541 |
+
gray: {
|
542 |
+
50: "#f9fafb",
|
543 |
+
100: "#f3f4f6",
|
544 |
+
200: "#e5e7eb",
|
545 |
+
300: "#d1d5db",
|
546 |
+
400: "#9ca3af",
|
547 |
+
500: "#6b7280",
|
548 |
+
600: "#4b5563",
|
549 |
+
700: "#374151",
|
550 |
+
800: "#1f2937",
|
551 |
+
900: "#111827",
|
552 |
+
950: "#030712"
|
553 |
+
},
|
554 |
+
zinc: {
|
555 |
+
50: "#fafafa",
|
556 |
+
100: "#f4f4f5",
|
557 |
+
200: "#e4e4e7",
|
558 |
+
300: "#d4d4d8",
|
559 |
+
400: "#a1a1aa",
|
560 |
+
500: "#71717a",
|
561 |
+
600: "#52525b",
|
562 |
+
700: "#3f3f46",
|
563 |
+
800: "#27272a",
|
564 |
+
900: "#18181b",
|
565 |
+
950: "#09090b"
|
566 |
+
},
|
567 |
+
neutral: {
|
568 |
+
50: "#fafafa",
|
569 |
+
100: "#f5f5f5",
|
570 |
+
200: "#e5e5e5",
|
571 |
+
300: "#d4d4d4",
|
572 |
+
400: "#a3a3a3",
|
573 |
+
500: "#737373",
|
574 |
+
600: "#525252",
|
575 |
+
700: "#404040",
|
576 |
+
800: "#262626",
|
577 |
+
900: "#171717",
|
578 |
+
950: "#0a0a0a"
|
579 |
+
},
|
580 |
+
stone: {
|
581 |
+
50: "#fafaf9",
|
582 |
+
100: "#f5f5f4",
|
583 |
+
200: "#e7e5e4",
|
584 |
+
300: "#d6d3d1",
|
585 |
+
400: "#a8a29e",
|
586 |
+
500: "#78716c",
|
587 |
+
600: "#57534e",
|
588 |
+
700: "#44403c",
|
589 |
+
800: "#292524",
|
590 |
+
900: "#1c1917",
|
591 |
+
950: "#0c0a09"
|
592 |
+
},
|
593 |
+
red: {
|
594 |
+
50: "#fef2f2",
|
595 |
+
100: "#fee2e2",
|
596 |
+
200: "#fecaca",
|
597 |
+
300: "#fca5a5",
|
598 |
+
400: "#f87171",
|
599 |
+
500: "#ef4444",
|
600 |
+
600: "#dc2626",
|
601 |
+
700: "#b91c1c",
|
602 |
+
800: "#991b1b",
|
603 |
+
900: "#7f1d1d",
|
604 |
+
950: "#450a0a"
|
605 |
+
},
|
606 |
+
orange: {
|
607 |
+
50: "#fff7ed",
|
608 |
+
100: "#ffedd5",
|
609 |
+
200: "#fed7aa",
|
610 |
+
300: "#fdba74",
|
611 |
+
400: "#fb923c",
|
612 |
+
500: "#f97316",
|
613 |
+
600: "#ea580c",
|
614 |
+
700: "#c2410c",
|
615 |
+
800: "#9a3412",
|
616 |
+
900: "#7c2d12",
|
617 |
+
950: "#431407"
|
618 |
+
},
|
619 |
+
amber: {
|
620 |
+
50: "#fffbeb",
|
621 |
+
100: "#fef3c7",
|
622 |
+
200: "#fde68a",
|
623 |
+
300: "#fcd34d",
|
624 |
+
400: "#fbbf24",
|
625 |
+
500: "#f59e0b",
|
626 |
+
600: "#d97706",
|
627 |
+
700: "#b45309",
|
628 |
+
800: "#92400e",
|
629 |
+
900: "#78350f",
|
630 |
+
950: "#451a03"
|
631 |
+
},
|
632 |
+
yellow: {
|
633 |
+
50: "#fefce8",
|
634 |
+
100: "#fef9c3",
|
635 |
+
200: "#fef08a",
|
636 |
+
300: "#fde047",
|
637 |
+
400: "#facc15",
|
638 |
+
500: "#eab308",
|
639 |
+
600: "#ca8a04",
|
640 |
+
700: "#a16207",
|
641 |
+
800: "#854d0e",
|
642 |
+
900: "#713f12",
|
643 |
+
950: "#422006"
|
644 |
+
},
|
645 |
+
lime: {
|
646 |
+
50: "#f7fee7",
|
647 |
+
100: "#ecfccb",
|
648 |
+
200: "#d9f99d",
|
649 |
+
300: "#bef264",
|
650 |
+
400: "#a3e635",
|
651 |
+
500: "#84cc16",
|
652 |
+
600: "#65a30d",
|
653 |
+
700: "#4d7c0f",
|
654 |
+
800: "#3f6212",
|
655 |
+
900: "#365314",
|
656 |
+
950: "#1a2e05"
|
657 |
+
},
|
658 |
+
green: {
|
659 |
+
50: "#f0fdf4",
|
660 |
+
100: "#dcfce7",
|
661 |
+
200: "#bbf7d0",
|
662 |
+
300: "#86efac",
|
663 |
+
400: "#4ade80",
|
664 |
+
500: "#22c55e",
|
665 |
+
600: "#16a34a",
|
666 |
+
700: "#15803d",
|
667 |
+
800: "#166534",
|
668 |
+
900: "#14532d",
|
669 |
+
950: "#052e16"
|
670 |
+
},
|
671 |
+
emerald: {
|
672 |
+
50: "#ecfdf5",
|
673 |
+
100: "#d1fae5",
|
674 |
+
200: "#a7f3d0",
|
675 |
+
300: "#6ee7b7",
|
676 |
+
400: "#34d399",
|
677 |
+
500: "#10b981",
|
678 |
+
600: "#059669",
|
679 |
+
700: "#047857",
|
680 |
+
800: "#065f46",
|
681 |
+
900: "#064e3b",
|
682 |
+
950: "#022c22"
|
683 |
+
},
|
684 |
+
teal: {
|
685 |
+
50: "#f0fdfa",
|
686 |
+
100: "#ccfbf1",
|
687 |
+
200: "#99f6e4",
|
688 |
+
300: "#5eead4",
|
689 |
+
400: "#2dd4bf",
|
690 |
+
500: "#14b8a6",
|
691 |
+
600: "#0d9488",
|
692 |
+
700: "#0f766e",
|
693 |
+
800: "#115e59",
|
694 |
+
900: "#134e4a",
|
695 |
+
950: "#042f2e"
|
696 |
+
},
|
697 |
+
cyan: {
|
698 |
+
50: "#ecfeff",
|
699 |
+
100: "#cffafe",
|
700 |
+
200: "#a5f3fc",
|
701 |
+
300: "#67e8f9",
|
702 |
+
400: "#22d3ee",
|
703 |
+
500: "#06b6d4",
|
704 |
+
600: "#0891b2",
|
705 |
+
700: "#0e7490",
|
706 |
+
800: "#155e75",
|
707 |
+
900: "#164e63",
|
708 |
+
950: "#083344"
|
709 |
+
},
|
710 |
+
sky: {
|
711 |
+
50: "#f0f9ff",
|
712 |
+
100: "#e0f2fe",
|
713 |
+
200: "#bae6fd",
|
714 |
+
300: "#7dd3fc",
|
715 |
+
400: "#38bdf8",
|
716 |
+
500: "#0ea5e9",
|
717 |
+
600: "#0284c7",
|
718 |
+
700: "#0369a1",
|
719 |
+
800: "#075985",
|
720 |
+
900: "#0c4a6e",
|
721 |
+
950: "#082f49"
|
722 |
+
},
|
723 |
+
blue: {
|
724 |
+
50: "#eff6ff",
|
725 |
+
100: "#dbeafe",
|
726 |
+
200: "#bfdbfe",
|
727 |
+
300: "#93c5fd",
|
728 |
+
400: "#60a5fa",
|
729 |
+
500: "#3b82f6",
|
730 |
+
600: "#2563eb",
|
731 |
+
700: "#1d4ed8",
|
732 |
+
800: "#1e40af",
|
733 |
+
900: "#1e3a8a",
|
734 |
+
950: "#172554"
|
735 |
+
},
|
736 |
+
indigo: {
|
737 |
+
50: "#eef2ff",
|
738 |
+
100: "#e0e7ff",
|
739 |
+
200: "#c7d2fe",
|
740 |
+
300: "#a5b4fc",
|
741 |
+
400: "#818cf8",
|
742 |
+
500: "#6366f1",
|
743 |
+
600: "#4f46e5",
|
744 |
+
700: "#4338ca",
|
745 |
+
800: "#3730a3",
|
746 |
+
900: "#312e81",
|
747 |
+
950: "#1e1b4b"
|
748 |
+
},
|
749 |
+
violet: {
|
750 |
+
50: "#f5f3ff",
|
751 |
+
100: "#ede9fe",
|
752 |
+
200: "#ddd6fe",
|
753 |
+
300: "#c4b5fd",
|
754 |
+
400: "#a78bfa",
|
755 |
+
500: "#8b5cf6",
|
756 |
+
600: "#7c3aed",
|
757 |
+
700: "#6d28d9",
|
758 |
+
800: "#5b21b6",
|
759 |
+
900: "#4c1d95",
|
760 |
+
950: "#2e1065"
|
761 |
+
},
|
762 |
+
purple: {
|
763 |
+
50: "#faf5ff",
|
764 |
+
100: "#f3e8ff",
|
765 |
+
200: "#e9d5ff",
|
766 |
+
300: "#d8b4fe",
|
767 |
+
400: "#c084fc",
|
768 |
+
500: "#a855f7",
|
769 |
+
600: "#9333ea",
|
770 |
+
700: "#7e22ce",
|
771 |
+
800: "#6b21a8",
|
772 |
+
900: "#581c87",
|
773 |
+
950: "#3b0764"
|
774 |
+
},
|
775 |
+
fuchsia: {
|
776 |
+
50: "#fdf4ff",
|
777 |
+
100: "#fae8ff",
|
778 |
+
200: "#f5d0fe",
|
779 |
+
300: "#f0abfc",
|
780 |
+
400: "#e879f9",
|
781 |
+
500: "#d946ef",
|
782 |
+
600: "#c026d3",
|
783 |
+
700: "#a21caf",
|
784 |
+
800: "#86198f",
|
785 |
+
900: "#701a75",
|
786 |
+
950: "#4a044e"
|
787 |
+
},
|
788 |
+
pink: {
|
789 |
+
50: "#fdf2f8",
|
790 |
+
100: "#fce7f3",
|
791 |
+
200: "#fbcfe8",
|
792 |
+
300: "#f9a8d4",
|
793 |
+
400: "#f472b6",
|
794 |
+
500: "#ec4899",
|
795 |
+
600: "#db2777",
|
796 |
+
700: "#be185d",
|
797 |
+
800: "#9d174d",
|
798 |
+
900: "#831843",
|
799 |
+
950: "#500724"
|
800 |
+
},
|
801 |
+
rose: {
|
802 |
+
50: "#fff1f2",
|
803 |
+
100: "#ffe4e6",
|
804 |
+
200: "#fecdd3",
|
805 |
+
300: "#fda4af",
|
806 |
+
400: "#fb7185",
|
807 |
+
500: "#f43f5e",
|
808 |
+
600: "#e11d48",
|
809 |
+
700: "#be123c",
|
810 |
+
800: "#9f1239",
|
811 |
+
900: "#881337",
|
812 |
+
950: "#4c0519"
|
813 |
+
}
|
814 |
+
};
|
815 |
+
bl.reduce(
|
816 |
+
(n, { color: e, primary: t, secondary: l }) => ({
|
817 |
+
...n,
|
818 |
+
[e]: {
|
819 |
+
primary: Ae[e][t],
|
820 |
+
secondary: Ae[e][l]
|
821 |
+
}
|
822 |
+
}),
|
823 |
+
{}
|
824 |
+
);
|
825 |
+
function G(n) {
|
826 |
+
let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
|
827 |
+
for (; n > 1e3 && t < e.length - 1; )
|
828 |
+
n /= 1e3, t++;
|
829 |
+
let l = e[t];
|
830 |
+
return (Number.isInteger(n) ? n : n.toFixed(1)) + l;
|
831 |
+
}
|
832 |
+
function ue() {
|
833 |
+
}
|
834 |
+
function gl(n, e) {
|
835 |
+
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
836 |
+
}
|
837 |
+
const st = typeof window < "u";
|
838 |
+
let Me = st ? () => window.performance.now() : () => Date.now(), ft = st ? (n) => requestAnimationFrame(n) : ue;
|
839 |
+
const J = /* @__PURE__ */ new Set();
|
840 |
+
function ot(n) {
|
841 |
+
J.forEach((e) => {
|
842 |
+
e.c(n) || (J.delete(e), e.f());
|
843 |
+
}), J.size !== 0 && ft(ot);
|
844 |
+
}
|
845 |
+
function hl(n) {
|
846 |
+
let e;
|
847 |
+
return J.size === 0 && ft(ot), {
|
848 |
+
promise: new Promise((t) => {
|
849 |
+
J.add(e = { c: n, f: t });
|
850 |
+
}),
|
851 |
+
abort() {
|
852 |
+
J.delete(e);
|
853 |
+
}
|
854 |
+
};
|
855 |
+
}
|
856 |
+
const Y = [];
|
857 |
+
function wl(n, e = ue) {
|
858 |
+
let t;
|
859 |
+
const l = /* @__PURE__ */ new Set();
|
860 |
+
function s(f) {
|
861 |
+
if (gl(n, f) && (n = f, t)) {
|
862 |
+
const a = !Y.length;
|
863 |
+
for (const r of l)
|
864 |
+
r[1](), Y.push(r, n);
|
865 |
+
if (a) {
|
866 |
+
for (let r = 0; r < Y.length; r += 2)
|
867 |
+
Y[r][0](Y[r + 1]);
|
868 |
+
Y.length = 0;
|
869 |
+
}
|
870 |
+
}
|
871 |
+
}
|
872 |
+
function i(f) {
|
873 |
+
s(f(n));
|
874 |
+
}
|
875 |
+
function o(f, a = ue) {
|
876 |
+
const r = [f, a];
|
877 |
+
return l.add(r), l.size === 1 && (t = e(s, i) || ue), f(n), () => {
|
878 |
+
l.delete(r), l.size === 0 && t && (t(), t = null);
|
879 |
+
};
|
880 |
+
}
|
881 |
+
return { set: s, update: i, subscribe: o };
|
882 |
+
}
|
883 |
+
function Ne(n) {
|
884 |
+
return Object.prototype.toString.call(n) === "[object Date]";
|
885 |
+
}
|
886 |
+
function we(n, e, t, l) {
|
887 |
+
if (typeof t == "number" || Ne(t)) {
|
888 |
+
const s = l - t, i = (t - e) / (n.dt || 1 / 60), o = n.opts.stiffness * s, f = n.opts.damping * i, a = (o - f) * n.inv_mass, r = (i + a) * n.dt;
|
889 |
+
return Math.abs(r) < n.opts.precision && Math.abs(s) < n.opts.precision ? l : (n.settled = !1, Ne(t) ? new Date(t.getTime() + r) : t + r);
|
890 |
+
} else {
|
891 |
+
if (Array.isArray(t))
|
892 |
+
return t.map(
|
893 |
+
(s, i) => we(n, e[i], t[i], l[i])
|
894 |
+
);
|
895 |
+
if (typeof t == "object") {
|
896 |
+
const s = {};
|
897 |
+
for (const i in t)
|
898 |
+
s[i] = we(n, e[i], t[i], l[i]);
|
899 |
+
return s;
|
900 |
+
} else
|
901 |
+
throw new Error(`Cannot spring ${typeof t} values`);
|
902 |
+
}
|
903 |
+
}
|
904 |
+
function Se(n, e = {}) {
|
905 |
+
const t = wl(n), { stiffness: l = 0.15, damping: s = 0.8, precision: i = 0.01 } = e;
|
906 |
+
let o, f, a, r = n, _ = n, u = 1, b = 0, c = !1;
|
907 |
+
function d(v, F = {}) {
|
908 |
+
_ = v;
|
909 |
+
const q = a = {};
|
910 |
+
return n == null || F.hard || y.stiffness >= 1 && y.damping >= 1 ? (c = !0, o = Me(), r = v, t.set(n = _), Promise.resolve()) : (F.soft && (b = 1 / ((F.soft === !0 ? 0.5 : +F.soft) * 60), u = 0), f || (o = Me(), c = !1, f = hl((m) => {
|
911 |
+
if (c)
|
912 |
+
return c = !1, f = null, !1;
|
913 |
+
u = Math.min(u + b, 1);
|
914 |
+
const z = {
|
915 |
+
inv_mass: u,
|
916 |
+
opts: y,
|
917 |
+
settled: !0,
|
918 |
+
dt: (m - o) * 60 / 1e3
|
919 |
+
}, h = we(z, r, n, _);
|
920 |
+
return o = m, r = n, t.set(n = h), z.settled && (f = null), !z.settled;
|
921 |
+
})), new Promise((m) => {
|
922 |
+
f.promise.then(() => {
|
923 |
+
q === a && m();
|
924 |
+
});
|
925 |
+
}));
|
926 |
+
}
|
927 |
+
const y = {
|
928 |
+
set: d,
|
929 |
+
update: (v, F) => d(v(_, n), F),
|
930 |
+
subscribe: t.subscribe,
|
931 |
+
stiffness: l,
|
932 |
+
damping: s,
|
933 |
+
precision: i
|
934 |
+
};
|
935 |
+
return y;
|
936 |
+
}
|
937 |
+
const {
|
938 |
+
SvelteComponent: pl,
|
939 |
+
append: M,
|
940 |
+
attr: T,
|
941 |
+
component_subscribe: Ve,
|
942 |
+
detach: vl,
|
943 |
+
element: kl,
|
944 |
+
init: yl,
|
945 |
+
insert: Tl,
|
946 |
+
noop: Xe,
|
947 |
+
safe_not_equal: zl,
|
948 |
+
set_style: fe,
|
949 |
+
svg_element: N,
|
950 |
+
toggle_class: Ie
|
951 |
+
} = window.__gradio__svelte__internal, { onMount: ql } = window.__gradio__svelte__internal;
|
952 |
+
function Cl(n) {
|
953 |
+
let e, t, l, s, i, o, f, a, r, _, u, b;
|
954 |
+
return {
|
955 |
+
c() {
|
956 |
+
e = kl("div"), t = N("svg"), l = N("g"), s = N("path"), i = N("path"), o = N("path"), f = N("path"), a = N("g"), r = N("path"), _ = N("path"), u = N("path"), b = N("path"), T(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), T(s, "fill", "#FF7C00"), T(s, "fill-opacity", "0.4"), T(s, "class", "svelte-43sxxs"), T(i, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), T(i, "fill", "#FF7C00"), T(i, "class", "svelte-43sxxs"), T(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), T(o, "fill", "#FF7C00"), T(o, "fill-opacity", "0.4"), T(o, "class", "svelte-43sxxs"), T(f, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), T(f, "fill", "#FF7C00"), T(f, "class", "svelte-43sxxs"), fe(l, "transform", "translate(" + /*$top*/
|
957 |
+
n[1][0] + "px, " + /*$top*/
|
958 |
+
n[1][1] + "px)"), T(r, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), T(r, "fill", "#FF7C00"), T(r, "fill-opacity", "0.4"), T(r, "class", "svelte-43sxxs"), T(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), T(_, "fill", "#FF7C00"), T(_, "class", "svelte-43sxxs"), T(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), T(u, "fill", "#FF7C00"), T(u, "fill-opacity", "0.4"), T(u, "class", "svelte-43sxxs"), T(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), T(b, "fill", "#FF7C00"), T(b, "class", "svelte-43sxxs"), fe(a, "transform", "translate(" + /*$bottom*/
|
959 |
+
n[2][0] + "px, " + /*$bottom*/
|
960 |
+
n[2][1] + "px)"), T(t, "viewBox", "-1200 -1200 3000 3000"), T(t, "fill", "none"), T(t, "xmlns", "http://www.w3.org/2000/svg"), T(t, "class", "svelte-43sxxs"), T(e, "class", "svelte-43sxxs"), Ie(
|
961 |
+
e,
|
962 |
+
"margin",
|
963 |
+
/*margin*/
|
964 |
+
n[0]
|
965 |
+
);
|
966 |
+
},
|
967 |
+
m(c, d) {
|
968 |
+
Tl(c, e, d), M(e, t), M(t, l), M(l, s), M(l, i), M(l, o), M(l, f), M(t, a), M(a, r), M(a, _), M(a, u), M(a, b);
|
969 |
+
},
|
970 |
+
p(c, [d]) {
|
971 |
+
d & /*$top*/
|
972 |
+
2 && fe(l, "transform", "translate(" + /*$top*/
|
973 |
+
c[1][0] + "px, " + /*$top*/
|
974 |
+
c[1][1] + "px)"), d & /*$bottom*/
|
975 |
+
4 && fe(a, "transform", "translate(" + /*$bottom*/
|
976 |
+
c[2][0] + "px, " + /*$bottom*/
|
977 |
+
c[2][1] + "px)"), d & /*margin*/
|
978 |
+
1 && Ie(
|
979 |
+
e,
|
980 |
+
"margin",
|
981 |
+
/*margin*/
|
982 |
+
c[0]
|
983 |
+
);
|
984 |
+
},
|
985 |
+
i: Xe,
|
986 |
+
o: Xe,
|
987 |
+
d(c) {
|
988 |
+
c && vl(e);
|
989 |
+
}
|
990 |
+
};
|
991 |
+
}
|
992 |
+
function Fl(n, e, t) {
|
993 |
+
let l, s, { margin: i = !0 } = e;
|
994 |
+
const o = Se([0, 0]);
|
995 |
+
Ve(n, o, (b) => t(1, l = b));
|
996 |
+
const f = Se([0, 0]);
|
997 |
+
Ve(n, f, (b) => t(2, s = b));
|
998 |
+
let a;
|
999 |
+
async function r() {
|
1000 |
+
await Promise.all([o.set([125, 140]), f.set([-125, -140])]), await Promise.all([o.set([-125, 140]), f.set([125, -140])]), await Promise.all([o.set([-125, 0]), f.set([125, -0])]), await Promise.all([o.set([125, 0]), f.set([-125, 0])]);
|
1001 |
+
}
|
1002 |
+
async function _() {
|
1003 |
+
await r(), a || _();
|
1004 |
+
}
|
1005 |
+
async function u() {
|
1006 |
+
await Promise.all([o.set([125, 0]), f.set([-125, 0])]), _();
|
1007 |
+
}
|
1008 |
+
return ql(() => (u(), () => a = !0)), n.$$set = (b) => {
|
1009 |
+
"margin" in b && t(0, i = b.margin);
|
1010 |
+
}, [i, l, s, o, f];
|
1011 |
+
}
|
1012 |
+
class Ll extends pl {
|
1013 |
+
constructor(e) {
|
1014 |
+
super(), yl(this, e, Fl, Cl, zl, { margin: 0 });
|
1015 |
+
}
|
1016 |
+
}
|
1017 |
+
const {
|
1018 |
+
SvelteComponent: El,
|
1019 |
+
append: H,
|
1020 |
+
attr: S,
|
1021 |
+
binding_callbacks: Ze,
|
1022 |
+
check_outros: at,
|
1023 |
+
create_component: Bl,
|
1024 |
+
create_slot: Al,
|
1025 |
+
destroy_component: Ml,
|
1026 |
+
destroy_each: rt,
|
1027 |
+
detach: w,
|
1028 |
+
element: X,
|
1029 |
+
empty: x,
|
1030 |
+
ensure_array_like: ce,
|
1031 |
+
get_all_dirty_from_scope: Nl,
|
1032 |
+
get_slot_changes: Sl,
|
1033 |
+
group_outros: _t,
|
1034 |
+
init: Vl,
|
1035 |
+
insert: p,
|
1036 |
+
mount_component: Xl,
|
1037 |
+
noop: pe,
|
1038 |
+
safe_not_equal: Il,
|
1039 |
+
set_data: A,
|
1040 |
+
set_style: P,
|
1041 |
+
space: V,
|
1042 |
+
text: C,
|
1043 |
+
toggle_class: B,
|
1044 |
+
transition_in: Q,
|
1045 |
+
transition_out: W,
|
1046 |
+
update_slot_base: Zl
|
1047 |
+
} = window.__gradio__svelte__internal, { tick: Ol } = window.__gradio__svelte__internal, { onDestroy: Pl } = window.__gradio__svelte__internal, Rl = (n) => ({}), Oe = (n) => ({});
|
1048 |
+
function Pe(n, e, t) {
|
1049 |
+
const l = n.slice();
|
1050 |
+
return l[38] = e[t], l[40] = t, l;
|
1051 |
+
}
|
1052 |
+
function Re(n, e, t) {
|
1053 |
+
const l = n.slice();
|
1054 |
+
return l[38] = e[t], l;
|
1055 |
+
}
|
1056 |
+
function jl(n) {
|
1057 |
+
let e, t = (
|
1058 |
+
/*i18n*/
|
1059 |
+
n[1]("common.error") + ""
|
1060 |
+
), l, s, i;
|
1061 |
+
const o = (
|
1062 |
+
/*#slots*/
|
1063 |
+
n[29].error
|
1064 |
+
), f = Al(
|
1065 |
+
o,
|
1066 |
+
n,
|
1067 |
+
/*$$scope*/
|
1068 |
+
n[28],
|
1069 |
+
Oe
|
1070 |
+
);
|
1071 |
+
return {
|
1072 |
+
c() {
|
1073 |
+
e = X("span"), l = C(t), s = V(), f && f.c(), S(e, "class", "error svelte-14miwb5");
|
1074 |
+
},
|
1075 |
+
m(a, r) {
|
1076 |
+
p(a, e, r), H(e, l), p(a, s, r), f && f.m(a, r), i = !0;
|
1077 |
+
},
|
1078 |
+
p(a, r) {
|
1079 |
+
(!i || r[0] & /*i18n*/
|
1080 |
+
2) && t !== (t = /*i18n*/
|
1081 |
+
a[1]("common.error") + "") && A(l, t), f && f.p && (!i || r[0] & /*$$scope*/
|
1082 |
+
268435456) && Zl(
|
1083 |
+
f,
|
1084 |
+
o,
|
1085 |
+
a,
|
1086 |
+
/*$$scope*/
|
1087 |
+
a[28],
|
1088 |
+
i ? Sl(
|
1089 |
+
o,
|
1090 |
+
/*$$scope*/
|
1091 |
+
a[28],
|
1092 |
+
r,
|
1093 |
+
Rl
|
1094 |
+
) : Nl(
|
1095 |
+
/*$$scope*/
|
1096 |
+
a[28]
|
1097 |
+
),
|
1098 |
+
Oe
|
1099 |
+
);
|
1100 |
+
},
|
1101 |
+
i(a) {
|
1102 |
+
i || (Q(f, a), i = !0);
|
1103 |
+
},
|
1104 |
+
o(a) {
|
1105 |
+
W(f, a), i = !1;
|
1106 |
+
},
|
1107 |
+
d(a) {
|
1108 |
+
a && (w(e), w(s)), f && f.d(a);
|
1109 |
+
}
|
1110 |
+
};
|
1111 |
+
}
|
1112 |
+
function Dl(n) {
|
1113 |
+
let e, t, l, s, i, o, f, a, r, _ = (
|
1114 |
+
/*variant*/
|
1115 |
+
n[8] === "default" && /*show_eta_bar*/
|
1116 |
+
n[18] && /*show_progress*/
|
1117 |
+
n[6] === "full" && je(n)
|
1118 |
+
);
|
1119 |
+
function u(m, z) {
|
1120 |
+
if (
|
1121 |
+
/*progress*/
|
1122 |
+
m[7]
|
1123 |
+
)
|
1124 |
+
return Yl;
|
1125 |
+
if (
|
1126 |
+
/*queue_position*/
|
1127 |
+
m[2] !== null && /*queue_size*/
|
1128 |
+
m[3] !== void 0 && /*queue_position*/
|
1129 |
+
m[2] >= 0
|
1130 |
+
)
|
1131 |
+
return Ul;
|
1132 |
+
if (
|
1133 |
+
/*queue_position*/
|
1134 |
+
m[2] === 0
|
1135 |
+
)
|
1136 |
+
return Hl;
|
1137 |
+
}
|
1138 |
+
let b = u(n), c = b && b(n), d = (
|
1139 |
+
/*timer*/
|
1140 |
+
n[5] && Ue(n)
|
1141 |
+
);
|
1142 |
+
const y = [Ql, Jl], v = [];
|
1143 |
+
function F(m, z) {
|
1144 |
+
return (
|
1145 |
+
/*last_progress_level*/
|
1146 |
+
m[15] != null ? 0 : (
|
1147 |
+
/*show_progress*/
|
1148 |
+
m[6] === "full" ? 1 : -1
|
1149 |
+
)
|
1150 |
+
);
|
1151 |
+
}
|
1152 |
+
~(i = F(n)) && (o = v[i] = y[i](n));
|
1153 |
+
let q = !/*timer*/
|
1154 |
+
n[5] && xe(n);
|
1155 |
+
return {
|
1156 |
+
c() {
|
1157 |
+
_ && _.c(), e = V(), t = X("div"), c && c.c(), l = V(), d && d.c(), s = V(), o && o.c(), f = V(), q && q.c(), a = x(), S(t, "class", "progress-text svelte-14miwb5"), B(
|
1158 |
+
t,
|
1159 |
+
"meta-text-center",
|
1160 |
+
/*variant*/
|
1161 |
+
n[8] === "center"
|
1162 |
+
), B(
|
1163 |
+
t,
|
1164 |
+
"meta-text",
|
1165 |
+
/*variant*/
|
1166 |
+
n[8] === "default"
|
1167 |
+
);
|
1168 |
+
},
|
1169 |
+
m(m, z) {
|
1170 |
+
_ && _.m(m, z), p(m, e, z), p(m, t, z), c && c.m(t, null), H(t, l), d && d.m(t, null), p(m, s, z), ~i && v[i].m(m, z), p(m, f, z), q && q.m(m, z), p(m, a, z), r = !0;
|
1171 |
+
},
|
1172 |
+
p(m, z) {
|
1173 |
+
/*variant*/
|
1174 |
+
m[8] === "default" && /*show_eta_bar*/
|
1175 |
+
m[18] && /*show_progress*/
|
1176 |
+
m[6] === "full" ? _ ? _.p(m, z) : (_ = je(m), _.c(), _.m(e.parentNode, e)) : _ && (_.d(1), _ = null), b === (b = u(m)) && c ? c.p(m, z) : (c && c.d(1), c = b && b(m), c && (c.c(), c.m(t, l))), /*timer*/
|
1177 |
+
m[5] ? d ? d.p(m, z) : (d = Ue(m), d.c(), d.m(t, null)) : d && (d.d(1), d = null), (!r || z[0] & /*variant*/
|
1178 |
+
256) && B(
|
1179 |
+
t,
|
1180 |
+
"meta-text-center",
|
1181 |
+
/*variant*/
|
1182 |
+
m[8] === "center"
|
1183 |
+
), (!r || z[0] & /*variant*/
|
1184 |
+
256) && B(
|
1185 |
+
t,
|
1186 |
+
"meta-text",
|
1187 |
+
/*variant*/
|
1188 |
+
m[8] === "default"
|
1189 |
+
);
|
1190 |
+
let h = i;
|
1191 |
+
i = F(m), i === h ? ~i && v[i].p(m, z) : (o && (_t(), W(v[h], 1, 1, () => {
|
1192 |
+
v[h] = null;
|
1193 |
+
}), at()), ~i ? (o = v[i], o ? o.p(m, z) : (o = v[i] = y[i](m), o.c()), Q(o, 1), o.m(f.parentNode, f)) : o = null), /*timer*/
|
1194 |
+
m[5] ? q && (q.d(1), q = null) : q ? q.p(m, z) : (q = xe(m), q.c(), q.m(a.parentNode, a));
|
1195 |
+
},
|
1196 |
+
i(m) {
|
1197 |
+
r || (Q(o), r = !0);
|
1198 |
+
},
|
1199 |
+
o(m) {
|
1200 |
+
W(o), r = !1;
|
1201 |
+
},
|
1202 |
+
d(m) {
|
1203 |
+
m && (w(e), w(t), w(s), w(f), w(a)), _ && _.d(m), c && c.d(), d && d.d(), ~i && v[i].d(m), q && q.d(m);
|
1204 |
+
}
|
1205 |
+
};
|
1206 |
+
}
|
1207 |
+
function je(n) {
|
1208 |
+
let e, t = `translateX(${/*eta_level*/
|
1209 |
+
(n[17] || 0) * 100 - 100}%)`;
|
1210 |
+
return {
|
1211 |
+
c() {
|
1212 |
+
e = X("div"), S(e, "class", "eta-bar svelte-14miwb5"), P(e, "transform", t);
|
1213 |
+
},
|
1214 |
+
m(l, s) {
|
1215 |
+
p(l, e, s);
|
1216 |
+
},
|
1217 |
+
p(l, s) {
|
1218 |
+
s[0] & /*eta_level*/
|
1219 |
+
131072 && t !== (t = `translateX(${/*eta_level*/
|
1220 |
+
(l[17] || 0) * 100 - 100}%)`) && P(e, "transform", t);
|
1221 |
+
},
|
1222 |
+
d(l) {
|
1223 |
+
l && w(e);
|
1224 |
+
}
|
1225 |
+
};
|
1226 |
+
}
|
1227 |
+
function Hl(n) {
|
1228 |
+
let e;
|
1229 |
+
return {
|
1230 |
+
c() {
|
1231 |
+
e = C("processing |");
|
1232 |
+
},
|
1233 |
+
m(t, l) {
|
1234 |
+
p(t, e, l);
|
1235 |
+
},
|
1236 |
+
p: pe,
|
1237 |
+
d(t) {
|
1238 |
+
t && w(e);
|
1239 |
+
}
|
1240 |
+
};
|
1241 |
+
}
|
1242 |
+
function Ul(n) {
|
1243 |
+
let e, t = (
|
1244 |
+
/*queue_position*/
|
1245 |
+
n[2] + 1 + ""
|
1246 |
+
), l, s, i, o;
|
1247 |
+
return {
|
1248 |
+
c() {
|
1249 |
+
e = C("queue: "), l = C(t), s = C("/"), i = C(
|
1250 |
+
/*queue_size*/
|
1251 |
+
n[3]
|
1252 |
+
), o = C(" |");
|
1253 |
+
},
|
1254 |
+
m(f, a) {
|
1255 |
+
p(f, e, a), p(f, l, a), p(f, s, a), p(f, i, a), p(f, o, a);
|
1256 |
+
},
|
1257 |
+
p(f, a) {
|
1258 |
+
a[0] & /*queue_position*/
|
1259 |
+
4 && t !== (t = /*queue_position*/
|
1260 |
+
f[2] + 1 + "") && A(l, t), a[0] & /*queue_size*/
|
1261 |
+
8 && A(
|
1262 |
+
i,
|
1263 |
+
/*queue_size*/
|
1264 |
+
f[3]
|
1265 |
+
);
|
1266 |
+
},
|
1267 |
+
d(f) {
|
1268 |
+
f && (w(e), w(l), w(s), w(i), w(o));
|
1269 |
+
}
|
1270 |
+
};
|
1271 |
+
}
|
1272 |
+
function Yl(n) {
|
1273 |
+
let e, t = ce(
|
1274 |
+
/*progress*/
|
1275 |
+
n[7]
|
1276 |
+
), l = [];
|
1277 |
+
for (let s = 0; s < t.length; s += 1)
|
1278 |
+
l[s] = He(Re(n, t, s));
|
1279 |
+
return {
|
1280 |
+
c() {
|
1281 |
+
for (let s = 0; s < l.length; s += 1)
|
1282 |
+
l[s].c();
|
1283 |
+
e = x();
|
1284 |
+
},
|
1285 |
+
m(s, i) {
|
1286 |
+
for (let o = 0; o < l.length; o += 1)
|
1287 |
+
l[o] && l[o].m(s, i);
|
1288 |
+
p(s, e, i);
|
1289 |
+
},
|
1290 |
+
p(s, i) {
|
1291 |
+
if (i[0] & /*progress*/
|
1292 |
+
128) {
|
1293 |
+
t = ce(
|
1294 |
+
/*progress*/
|
1295 |
+
s[7]
|
1296 |
+
);
|
1297 |
+
let o;
|
1298 |
+
for (o = 0; o < t.length; o += 1) {
|
1299 |
+
const f = Re(s, t, o);
|
1300 |
+
l[o] ? l[o].p(f, i) : (l[o] = He(f), l[o].c(), l[o].m(e.parentNode, e));
|
1301 |
+
}
|
1302 |
+
for (; o < l.length; o += 1)
|
1303 |
+
l[o].d(1);
|
1304 |
+
l.length = t.length;
|
1305 |
+
}
|
1306 |
+
},
|
1307 |
+
d(s) {
|
1308 |
+
s && w(e), rt(l, s);
|
1309 |
+
}
|
1310 |
+
};
|
1311 |
+
}
|
1312 |
+
function De(n) {
|
1313 |
+
let e, t = (
|
1314 |
+
/*p*/
|
1315 |
+
n[38].unit + ""
|
1316 |
+
), l, s, i = " ", o;
|
1317 |
+
function f(_, u) {
|
1318 |
+
return (
|
1319 |
+
/*p*/
|
1320 |
+
_[38].length != null ? Kl : Gl
|
1321 |
+
);
|
1322 |
+
}
|
1323 |
+
let a = f(n), r = a(n);
|
1324 |
+
return {
|
1325 |
+
c() {
|
1326 |
+
r.c(), e = V(), l = C(t), s = C(" | "), o = C(i);
|
1327 |
+
},
|
1328 |
+
m(_, u) {
|
1329 |
+
r.m(_, u), p(_, e, u), p(_, l, u), p(_, s, u), p(_, o, u);
|
1330 |
+
},
|
1331 |
+
p(_, u) {
|
1332 |
+
a === (a = f(_)) && r ? r.p(_, u) : (r.d(1), r = a(_), r && (r.c(), r.m(e.parentNode, e))), u[0] & /*progress*/
|
1333 |
+
128 && t !== (t = /*p*/
|
1334 |
+
_[38].unit + "") && A(l, t);
|
1335 |
+
},
|
1336 |
+
d(_) {
|
1337 |
+
_ && (w(e), w(l), w(s), w(o)), r.d(_);
|
1338 |
+
}
|
1339 |
+
};
|
1340 |
+
}
|
1341 |
+
function Gl(n) {
|
1342 |
+
let e = G(
|
1343 |
+
/*p*/
|
1344 |
+
n[38].index || 0
|
1345 |
+
) + "", t;
|
1346 |
+
return {
|
1347 |
+
c() {
|
1348 |
+
t = C(e);
|
1349 |
+
},
|
1350 |
+
m(l, s) {
|
1351 |
+
p(l, t, s);
|
1352 |
+
},
|
1353 |
+
p(l, s) {
|
1354 |
+
s[0] & /*progress*/
|
1355 |
+
128 && e !== (e = G(
|
1356 |
+
/*p*/
|
1357 |
+
l[38].index || 0
|
1358 |
+
) + "") && A(t, e);
|
1359 |
+
},
|
1360 |
+
d(l) {
|
1361 |
+
l && w(t);
|
1362 |
+
}
|
1363 |
+
};
|
1364 |
+
}
|
1365 |
+
function Kl(n) {
|
1366 |
+
let e = G(
|
1367 |
+
/*p*/
|
1368 |
+
n[38].index || 0
|
1369 |
+
) + "", t, l, s = G(
|
1370 |
+
/*p*/
|
1371 |
+
n[38].length
|
1372 |
+
) + "", i;
|
1373 |
+
return {
|
1374 |
+
c() {
|
1375 |
+
t = C(e), l = C("/"), i = C(s);
|
1376 |
+
},
|
1377 |
+
m(o, f) {
|
1378 |
+
p(o, t, f), p(o, l, f), p(o, i, f);
|
1379 |
+
},
|
1380 |
+
p(o, f) {
|
1381 |
+
f[0] & /*progress*/
|
1382 |
+
128 && e !== (e = G(
|
1383 |
+
/*p*/
|
1384 |
+
o[38].index || 0
|
1385 |
+
) + "") && A(t, e), f[0] & /*progress*/
|
1386 |
+
128 && s !== (s = G(
|
1387 |
+
/*p*/
|
1388 |
+
o[38].length
|
1389 |
+
) + "") && A(i, s);
|
1390 |
+
},
|
1391 |
+
d(o) {
|
1392 |
+
o && (w(t), w(l), w(i));
|
1393 |
+
}
|
1394 |
+
};
|
1395 |
+
}
|
1396 |
+
function He(n) {
|
1397 |
+
let e, t = (
|
1398 |
+
/*p*/
|
1399 |
+
n[38].index != null && De(n)
|
1400 |
+
);
|
1401 |
+
return {
|
1402 |
+
c() {
|
1403 |
+
t && t.c(), e = x();
|
1404 |
+
},
|
1405 |
+
m(l, s) {
|
1406 |
+
t && t.m(l, s), p(l, e, s);
|
1407 |
+
},
|
1408 |
+
p(l, s) {
|
1409 |
+
/*p*/
|
1410 |
+
l[38].index != null ? t ? t.p(l, s) : (t = De(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
|
1411 |
+
},
|
1412 |
+
d(l) {
|
1413 |
+
l && w(e), t && t.d(l);
|
1414 |
+
}
|
1415 |
+
};
|
1416 |
+
}
|
1417 |
+
function Ue(n) {
|
1418 |
+
let e, t = (
|
1419 |
+
/*eta*/
|
1420 |
+
n[0] ? `/${/*formatted_eta*/
|
1421 |
+
n[19]}` : ""
|
1422 |
+
), l, s;
|
1423 |
+
return {
|
1424 |
+
c() {
|
1425 |
+
e = C(
|
1426 |
+
/*formatted_timer*/
|
1427 |
+
n[20]
|
1428 |
+
), l = C(t), s = C("s");
|
1429 |
+
},
|
1430 |
+
m(i, o) {
|
1431 |
+
p(i, e, o), p(i, l, o), p(i, s, o);
|
1432 |
+
},
|
1433 |
+
p(i, o) {
|
1434 |
+
o[0] & /*formatted_timer*/
|
1435 |
+
1048576 && A(
|
1436 |
+
e,
|
1437 |
+
/*formatted_timer*/
|
1438 |
+
i[20]
|
1439 |
+
), o[0] & /*eta, formatted_eta*/
|
1440 |
+
524289 && t !== (t = /*eta*/
|
1441 |
+
i[0] ? `/${/*formatted_eta*/
|
1442 |
+
i[19]}` : "") && A(l, t);
|
1443 |
+
},
|
1444 |
+
d(i) {
|
1445 |
+
i && (w(e), w(l), w(s));
|
1446 |
+
}
|
1447 |
+
};
|
1448 |
+
}
|
1449 |
+
function Jl(n) {
|
1450 |
+
let e, t;
|
1451 |
+
return e = new Ll({
|
1452 |
+
props: { margin: (
|
1453 |
+
/*variant*/
|
1454 |
+
n[8] === "default"
|
1455 |
+
) }
|
1456 |
+
}), {
|
1457 |
+
c() {
|
1458 |
+
Bl(e.$$.fragment);
|
1459 |
+
},
|
1460 |
+
m(l, s) {
|
1461 |
+
Xl(e, l, s), t = !0;
|
1462 |
+
},
|
1463 |
+
p(l, s) {
|
1464 |
+
const i = {};
|
1465 |
+
s[0] & /*variant*/
|
1466 |
+
256 && (i.margin = /*variant*/
|
1467 |
+
l[8] === "default"), e.$set(i);
|
1468 |
+
},
|
1469 |
+
i(l) {
|
1470 |
+
t || (Q(e.$$.fragment, l), t = !0);
|
1471 |
+
},
|
1472 |
+
o(l) {
|
1473 |
+
W(e.$$.fragment, l), t = !1;
|
1474 |
+
},
|
1475 |
+
d(l) {
|
1476 |
+
Ml(e, l);
|
1477 |
+
}
|
1478 |
+
};
|
1479 |
+
}
|
1480 |
+
function Ql(n) {
|
1481 |
+
let e, t, l, s, i, o = `${/*last_progress_level*/
|
1482 |
+
n[15] * 100}%`, f = (
|
1483 |
+
/*progress*/
|
1484 |
+
n[7] != null && Ye(n)
|
1485 |
+
);
|
1486 |
+
return {
|
1487 |
+
c() {
|
1488 |
+
e = X("div"), t = X("div"), f && f.c(), l = V(), s = X("div"), i = X("div"), S(t, "class", "progress-level-inner svelte-14miwb5"), S(i, "class", "progress-bar svelte-14miwb5"), P(i, "width", o), S(s, "class", "progress-bar-wrap svelte-14miwb5"), S(e, "class", "progress-level svelte-14miwb5");
|
1489 |
+
},
|
1490 |
+
m(a, r) {
|
1491 |
+
p(a, e, r), H(e, t), f && f.m(t, null), H(e, l), H(e, s), H(s, i), n[30](i);
|
1492 |
+
},
|
1493 |
+
p(a, r) {
|
1494 |
+
/*progress*/
|
1495 |
+
a[7] != null ? f ? f.p(a, r) : (f = Ye(a), f.c(), f.m(t, null)) : f && (f.d(1), f = null), r[0] & /*last_progress_level*/
|
1496 |
+
32768 && o !== (o = `${/*last_progress_level*/
|
1497 |
+
a[15] * 100}%`) && P(i, "width", o);
|
1498 |
+
},
|
1499 |
+
i: pe,
|
1500 |
+
o: pe,
|
1501 |
+
d(a) {
|
1502 |
+
a && w(e), f && f.d(), n[30](null);
|
1503 |
+
}
|
1504 |
+
};
|
1505 |
+
}
|
1506 |
+
function Ye(n) {
|
1507 |
+
let e, t = ce(
|
1508 |
+
/*progress*/
|
1509 |
+
n[7]
|
1510 |
+
), l = [];
|
1511 |
+
for (let s = 0; s < t.length; s += 1)
|
1512 |
+
l[s] = We(Pe(n, t, s));
|
1513 |
+
return {
|
1514 |
+
c() {
|
1515 |
+
for (let s = 0; s < l.length; s += 1)
|
1516 |
+
l[s].c();
|
1517 |
+
e = x();
|
1518 |
+
},
|
1519 |
+
m(s, i) {
|
1520 |
+
for (let o = 0; o < l.length; o += 1)
|
1521 |
+
l[o] && l[o].m(s, i);
|
1522 |
+
p(s, e, i);
|
1523 |
+
},
|
1524 |
+
p(s, i) {
|
1525 |
+
if (i[0] & /*progress_level, progress*/
|
1526 |
+
16512) {
|
1527 |
+
t = ce(
|
1528 |
+
/*progress*/
|
1529 |
+
s[7]
|
1530 |
+
);
|
1531 |
+
let o;
|
1532 |
+
for (o = 0; o < t.length; o += 1) {
|
1533 |
+
const f = Pe(s, t, o);
|
1534 |
+
l[o] ? l[o].p(f, i) : (l[o] = We(f), l[o].c(), l[o].m(e.parentNode, e));
|
1535 |
+
}
|
1536 |
+
for (; o < l.length; o += 1)
|
1537 |
+
l[o].d(1);
|
1538 |
+
l.length = t.length;
|
1539 |
+
}
|
1540 |
+
},
|
1541 |
+
d(s) {
|
1542 |
+
s && w(e), rt(l, s);
|
1543 |
+
}
|
1544 |
+
};
|
1545 |
+
}
|
1546 |
+
function Ge(n) {
|
1547 |
+
let e, t, l, s, i = (
|
1548 |
+
/*i*/
|
1549 |
+
n[40] !== 0 && Wl()
|
1550 |
+
), o = (
|
1551 |
+
/*p*/
|
1552 |
+
n[38].desc != null && Ke(n)
|
1553 |
+
), f = (
|
1554 |
+
/*p*/
|
1555 |
+
n[38].desc != null && /*progress_level*/
|
1556 |
+
n[14] && /*progress_level*/
|
1557 |
+
n[14][
|
1558 |
+
/*i*/
|
1559 |
+
n[40]
|
1560 |
+
] != null && Je()
|
1561 |
+
), a = (
|
1562 |
+
/*progress_level*/
|
1563 |
+
n[14] != null && Qe(n)
|
1564 |
+
);
|
1565 |
+
return {
|
1566 |
+
c() {
|
1567 |
+
i && i.c(), e = V(), o && o.c(), t = V(), f && f.c(), l = V(), a && a.c(), s = x();
|
1568 |
+
},
|
1569 |
+
m(r, _) {
|
1570 |
+
i && i.m(r, _), p(r, e, _), o && o.m(r, _), p(r, t, _), f && f.m(r, _), p(r, l, _), a && a.m(r, _), p(r, s, _);
|
1571 |
+
},
|
1572 |
+
p(r, _) {
|
1573 |
+
/*p*/
|
1574 |
+
r[38].desc != null ? o ? o.p(r, _) : (o = Ke(r), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/
|
1575 |
+
r[38].desc != null && /*progress_level*/
|
1576 |
+
r[14] && /*progress_level*/
|
1577 |
+
r[14][
|
1578 |
+
/*i*/
|
1579 |
+
r[40]
|
1580 |
+
] != null ? f || (f = Je(), f.c(), f.m(l.parentNode, l)) : f && (f.d(1), f = null), /*progress_level*/
|
1581 |
+
r[14] != null ? a ? a.p(r, _) : (a = Qe(r), a.c(), a.m(s.parentNode, s)) : a && (a.d(1), a = null);
|
1582 |
+
},
|
1583 |
+
d(r) {
|
1584 |
+
r && (w(e), w(t), w(l), w(s)), i && i.d(r), o && o.d(r), f && f.d(r), a && a.d(r);
|
1585 |
+
}
|
1586 |
+
};
|
1587 |
+
}
|
1588 |
+
function Wl(n) {
|
1589 |
+
let e;
|
1590 |
+
return {
|
1591 |
+
c() {
|
1592 |
+
e = C(" /");
|
1593 |
+
},
|
1594 |
+
m(t, l) {
|
1595 |
+
p(t, e, l);
|
1596 |
+
},
|
1597 |
+
d(t) {
|
1598 |
+
t && w(e);
|
1599 |
+
}
|
1600 |
+
};
|
1601 |
+
}
|
1602 |
+
function Ke(n) {
|
1603 |
+
let e = (
|
1604 |
+
/*p*/
|
1605 |
+
n[38].desc + ""
|
1606 |
+
), t;
|
1607 |
+
return {
|
1608 |
+
c() {
|
1609 |
+
t = C(e);
|
1610 |
+
},
|
1611 |
+
m(l, s) {
|
1612 |
+
p(l, t, s);
|
1613 |
+
},
|
1614 |
+
p(l, s) {
|
1615 |
+
s[0] & /*progress*/
|
1616 |
+
128 && e !== (e = /*p*/
|
1617 |
+
l[38].desc + "") && A(t, e);
|
1618 |
+
},
|
1619 |
+
d(l) {
|
1620 |
+
l && w(t);
|
1621 |
+
}
|
1622 |
+
};
|
1623 |
+
}
|
1624 |
+
function Je(n) {
|
1625 |
+
let e;
|
1626 |
+
return {
|
1627 |
+
c() {
|
1628 |
+
e = C("-");
|
1629 |
+
},
|
1630 |
+
m(t, l) {
|
1631 |
+
p(t, e, l);
|
1632 |
+
},
|
1633 |
+
d(t) {
|
1634 |
+
t && w(e);
|
1635 |
+
}
|
1636 |
+
};
|
1637 |
+
}
|
1638 |
+
function Qe(n) {
|
1639 |
+
let e = (100 * /*progress_level*/
|
1640 |
+
(n[14][
|
1641 |
+
/*i*/
|
1642 |
+
n[40]
|
1643 |
+
] || 0)).toFixed(1) + "", t, l;
|
1644 |
+
return {
|
1645 |
+
c() {
|
1646 |
+
t = C(e), l = C("%");
|
1647 |
+
},
|
1648 |
+
m(s, i) {
|
1649 |
+
p(s, t, i), p(s, l, i);
|
1650 |
+
},
|
1651 |
+
p(s, i) {
|
1652 |
+
i[0] & /*progress_level*/
|
1653 |
+
16384 && e !== (e = (100 * /*progress_level*/
|
1654 |
+
(s[14][
|
1655 |
+
/*i*/
|
1656 |
+
s[40]
|
1657 |
+
] || 0)).toFixed(1) + "") && A(t, e);
|
1658 |
+
},
|
1659 |
+
d(s) {
|
1660 |
+
s && (w(t), w(l));
|
1661 |
+
}
|
1662 |
+
};
|
1663 |
+
}
|
1664 |
+
function We(n) {
|
1665 |
+
let e, t = (
|
1666 |
+
/*p*/
|
1667 |
+
(n[38].desc != null || /*progress_level*/
|
1668 |
+
n[14] && /*progress_level*/
|
1669 |
+
n[14][
|
1670 |
+
/*i*/
|
1671 |
+
n[40]
|
1672 |
+
] != null) && Ge(n)
|
1673 |
+
);
|
1674 |
+
return {
|
1675 |
+
c() {
|
1676 |
+
t && t.c(), e = x();
|
1677 |
+
},
|
1678 |
+
m(l, s) {
|
1679 |
+
t && t.m(l, s), p(l, e, s);
|
1680 |
+
},
|
1681 |
+
p(l, s) {
|
1682 |
+
/*p*/
|
1683 |
+
l[38].desc != null || /*progress_level*/
|
1684 |
+
l[14] && /*progress_level*/
|
1685 |
+
l[14][
|
1686 |
+
/*i*/
|
1687 |
+
l[40]
|
1688 |
+
] != null ? t ? t.p(l, s) : (t = Ge(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
|
1689 |
+
},
|
1690 |
+
d(l) {
|
1691 |
+
l && w(e), t && t.d(l);
|
1692 |
+
}
|
1693 |
+
};
|
1694 |
+
}
|
1695 |
+
function xe(n) {
|
1696 |
+
let e, t;
|
1697 |
+
return {
|
1698 |
+
c() {
|
1699 |
+
e = X("p"), t = C(
|
1700 |
+
/*loading_text*/
|
1701 |
+
n[9]
|
1702 |
+
), S(e, "class", "loading svelte-14miwb5");
|
1703 |
+
},
|
1704 |
+
m(l, s) {
|
1705 |
+
p(l, e, s), H(e, t);
|
1706 |
+
},
|
1707 |
+
p(l, s) {
|
1708 |
+
s[0] & /*loading_text*/
|
1709 |
+
512 && A(
|
1710 |
+
t,
|
1711 |
+
/*loading_text*/
|
1712 |
+
l[9]
|
1713 |
+
);
|
1714 |
+
},
|
1715 |
+
d(l) {
|
1716 |
+
l && w(e);
|
1717 |
+
}
|
1718 |
+
};
|
1719 |
+
}
|
1720 |
+
function xl(n) {
|
1721 |
+
let e, t, l, s, i;
|
1722 |
+
const o = [Dl, jl], f = [];
|
1723 |
+
function a(r, _) {
|
1724 |
+
return (
|
1725 |
+
/*status*/
|
1726 |
+
r[4] === "pending" ? 0 : (
|
1727 |
+
/*status*/
|
1728 |
+
r[4] === "error" ? 1 : -1
|
1729 |
+
)
|
1730 |
+
);
|
1731 |
+
}
|
1732 |
+
return ~(t = a(n)) && (l = f[t] = o[t](n)), {
|
1733 |
+
c() {
|
1734 |
+
e = X("div"), l && l.c(), S(e, "class", s = "wrap " + /*variant*/
|
1735 |
+
n[8] + " " + /*show_progress*/
|
1736 |
+
n[6] + " svelte-14miwb5"), B(e, "hide", !/*status*/
|
1737 |
+
n[4] || /*status*/
|
1738 |
+
n[4] === "complete" || /*show_progress*/
|
1739 |
+
n[6] === "hidden"), B(
|
1740 |
+
e,
|
1741 |
+
"translucent",
|
1742 |
+
/*variant*/
|
1743 |
+
n[8] === "center" && /*status*/
|
1744 |
+
(n[4] === "pending" || /*status*/
|
1745 |
+
n[4] === "error") || /*translucent*/
|
1746 |
+
n[11] || /*show_progress*/
|
1747 |
+
n[6] === "minimal"
|
1748 |
+
), B(
|
1749 |
+
e,
|
1750 |
+
"generating",
|
1751 |
+
/*status*/
|
1752 |
+
n[4] === "generating"
|
1753 |
+
), B(
|
1754 |
+
e,
|
1755 |
+
"border",
|
1756 |
+
/*border*/
|
1757 |
+
n[12]
|
1758 |
+
), P(
|
1759 |
+
e,
|
1760 |
+
"position",
|
1761 |
+
/*absolute*/
|
1762 |
+
n[10] ? "absolute" : "static"
|
1763 |
+
), P(
|
1764 |
+
e,
|
1765 |
+
"padding",
|
1766 |
+
/*absolute*/
|
1767 |
+
n[10] ? "0" : "var(--size-8) 0"
|
1768 |
+
);
|
1769 |
+
},
|
1770 |
+
m(r, _) {
|
1771 |
+
p(r, e, _), ~t && f[t].m(e, null), n[31](e), i = !0;
|
1772 |
+
},
|
1773 |
+
p(r, _) {
|
1774 |
+
let u = t;
|
1775 |
+
t = a(r), t === u ? ~t && f[t].p(r, _) : (l && (_t(), W(f[u], 1, 1, () => {
|
1776 |
+
f[u] = null;
|
1777 |
+
}), at()), ~t ? (l = f[t], l ? l.p(r, _) : (l = f[t] = o[t](r), l.c()), Q(l, 1), l.m(e, null)) : l = null), (!i || _[0] & /*variant, show_progress*/
|
1778 |
+
320 && s !== (s = "wrap " + /*variant*/
|
1779 |
+
r[8] + " " + /*show_progress*/
|
1780 |
+
r[6] + " svelte-14miwb5")) && S(e, "class", s), (!i || _[0] & /*variant, show_progress, status, show_progress*/
|
1781 |
+
336) && B(e, "hide", !/*status*/
|
1782 |
+
r[4] || /*status*/
|
1783 |
+
r[4] === "complete" || /*show_progress*/
|
1784 |
+
r[6] === "hidden"), (!i || _[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
|
1785 |
+
2384) && B(
|
1786 |
+
e,
|
1787 |
+
"translucent",
|
1788 |
+
/*variant*/
|
1789 |
+
r[8] === "center" && /*status*/
|
1790 |
+
(r[4] === "pending" || /*status*/
|
1791 |
+
r[4] === "error") || /*translucent*/
|
1792 |
+
r[11] || /*show_progress*/
|
1793 |
+
r[6] === "minimal"
|
1794 |
+
), (!i || _[0] & /*variant, show_progress, status*/
|
1795 |
+
336) && B(
|
1796 |
+
e,
|
1797 |
+
"generating",
|
1798 |
+
/*status*/
|
1799 |
+
r[4] === "generating"
|
1800 |
+
), (!i || _[0] & /*variant, show_progress, border*/
|
1801 |
+
4416) && B(
|
1802 |
+
e,
|
1803 |
+
"border",
|
1804 |
+
/*border*/
|
1805 |
+
r[12]
|
1806 |
+
), _[0] & /*absolute*/
|
1807 |
+
1024 && P(
|
1808 |
+
e,
|
1809 |
+
"position",
|
1810 |
+
/*absolute*/
|
1811 |
+
r[10] ? "absolute" : "static"
|
1812 |
+
), _[0] & /*absolute*/
|
1813 |
+
1024 && P(
|
1814 |
+
e,
|
1815 |
+
"padding",
|
1816 |
+
/*absolute*/
|
1817 |
+
r[10] ? "0" : "var(--size-8) 0"
|
1818 |
+
);
|
1819 |
+
},
|
1820 |
+
i(r) {
|
1821 |
+
i || (Q(l), i = !0);
|
1822 |
+
},
|
1823 |
+
o(r) {
|
1824 |
+
W(l), i = !1;
|
1825 |
+
},
|
1826 |
+
d(r) {
|
1827 |
+
r && w(e), ~t && f[t].d(), n[31](null);
|
1828 |
+
}
|
1829 |
+
};
|
1830 |
+
}
|
1831 |
+
let oe = [], me = !1;
|
1832 |
+
async function $l(n, e = !0) {
|
1833 |
+
if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
|
1834 |
+
if (oe.push(n), !me)
|
1835 |
+
me = !0;
|
1836 |
+
else
|
1837 |
+
return;
|
1838 |
+
await Ol(), requestAnimationFrame(() => {
|
1839 |
+
let t = [0, 0];
|
1840 |
+
for (let l = 0; l < oe.length; l++) {
|
1841 |
+
const i = oe[l].getBoundingClientRect();
|
1842 |
+
(l === 0 || i.top + window.scrollY <= t[0]) && (t[0] = i.top + window.scrollY, t[1] = l);
|
1843 |
+
}
|
1844 |
+
window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), me = !1, oe = [];
|
1845 |
+
});
|
1846 |
+
}
|
1847 |
+
}
|
1848 |
+
function en(n, e, t) {
|
1849 |
+
let l, { $$slots: s = {}, $$scope: i } = e, { i18n: o } = e, { eta: f = null } = e, { queue: a = !1 } = e, { queue_position: r } = e, { queue_size: _ } = e, { status: u } = e, { scroll_to_output: b = !1 } = e, { timer: c = !0 } = e, { show_progress: d = "full" } = e, { message: y = null } = e, { progress: v = null } = e, { variant: F = "default" } = e, { loading_text: q = "Loading..." } = e, { absolute: m = !0 } = e, { translucent: z = !1 } = e, { border: h = !1 } = e, { autoscroll: $ } = e, R, k = !1, se = 0, j = 0, de = null, Te = 0, D = null, ee, I = null, ze = !0;
|
1850 |
+
const dt = () => {
|
1851 |
+
t(25, se = performance.now()), t(26, j = 0), k = !0, qe();
|
1852 |
+
};
|
1853 |
+
function qe() {
|
1854 |
+
requestAnimationFrame(() => {
|
1855 |
+
t(26, j = (performance.now() - se) / 1e3), k && qe();
|
1856 |
+
});
|
1857 |
+
}
|
1858 |
+
function Ce() {
|
1859 |
+
t(26, j = 0), k && (k = !1);
|
1860 |
+
}
|
1861 |
+
Pl(() => {
|
1862 |
+
k && Ce();
|
1863 |
+
});
|
1864 |
+
let Fe = null;
|
1865 |
+
function mt(g) {
|
1866 |
+
Ze[g ? "unshift" : "push"](() => {
|
1867 |
+
I = g, t(16, I), t(7, v), t(14, D), t(15, ee);
|
1868 |
+
});
|
1869 |
+
}
|
1870 |
+
function bt(g) {
|
1871 |
+
Ze[g ? "unshift" : "push"](() => {
|
1872 |
+
R = g, t(13, R);
|
1873 |
+
});
|
1874 |
+
}
|
1875 |
+
return n.$$set = (g) => {
|
1876 |
+
"i18n" in g && t(1, o = g.i18n), "eta" in g && t(0, f = g.eta), "queue" in g && t(21, a = g.queue), "queue_position" in g && t(2, r = g.queue_position), "queue_size" in g && t(3, _ = g.queue_size), "status" in g && t(4, u = g.status), "scroll_to_output" in g && t(22, b = g.scroll_to_output), "timer" in g && t(5, c = g.timer), "show_progress" in g && t(6, d = g.show_progress), "message" in g && t(23, y = g.message), "progress" in g && t(7, v = g.progress), "variant" in g && t(8, F = g.variant), "loading_text" in g && t(9, q = g.loading_text), "absolute" in g && t(10, m = g.absolute), "translucent" in g && t(11, z = g.translucent), "border" in g && t(12, h = g.border), "autoscroll" in g && t(24, $ = g.autoscroll), "$$scope" in g && t(28, i = g.$$scope);
|
1877 |
+
}, n.$$.update = () => {
|
1878 |
+
n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
|
1879 |
+
169869313 && (f === null ? t(0, f = de) : a && t(0, f = (performance.now() - se) / 1e3 + f), f != null && (t(19, Fe = f.toFixed(1)), t(27, de = f))), n.$$.dirty[0] & /*eta, timer_diff*/
|
1880 |
+
67108865 && t(17, Te = f === null || f <= 0 || !j ? null : Math.min(j / f, 1)), n.$$.dirty[0] & /*progress*/
|
1881 |
+
128 && v != null && t(18, ze = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
|
1882 |
+
114816 && (v != null ? t(14, D = v.map((g) => {
|
1883 |
+
if (g.index != null && g.length != null)
|
1884 |
+
return g.index / g.length;
|
1885 |
+
if (g.progress != null)
|
1886 |
+
return g.progress;
|
1887 |
+
})) : t(14, D = null), D ? (t(15, ee = D[D.length - 1]), I && (ee === 0 ? t(16, I.style.transition = "0", I) : t(16, I.style.transition = "150ms", I))) : t(15, ee = void 0)), n.$$.dirty[0] & /*status*/
|
1888 |
+
16 && (u === "pending" ? dt() : Ce()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
|
1889 |
+
20979728 && R && b && (u === "pending" || u === "complete") && $l(R, $), n.$$.dirty[0] & /*status, message*/
|
1890 |
+
8388624, n.$$.dirty[0] & /*timer_diff*/
|
1891 |
+
67108864 && t(20, l = j.toFixed(1));
|
1892 |
+
}, [
|
1893 |
+
f,
|
1894 |
+
o,
|
1895 |
+
r,
|
1896 |
+
_,
|
1897 |
+
u,
|
1898 |
+
c,
|
1899 |
+
d,
|
1900 |
+
v,
|
1901 |
+
F,
|
1902 |
+
q,
|
1903 |
+
m,
|
1904 |
+
z,
|
1905 |
+
h,
|
1906 |
+
R,
|
1907 |
+
D,
|
1908 |
+
ee,
|
1909 |
+
I,
|
1910 |
+
Te,
|
1911 |
+
ze,
|
1912 |
+
Fe,
|
1913 |
+
l,
|
1914 |
+
a,
|
1915 |
+
b,
|
1916 |
+
y,
|
1917 |
+
$,
|
1918 |
+
se,
|
1919 |
+
j,
|
1920 |
+
de,
|
1921 |
+
i,
|
1922 |
+
s,
|
1923 |
+
mt,
|
1924 |
+
bt
|
1925 |
+
];
|
1926 |
+
}
|
1927 |
+
class tn extends El {
|
1928 |
+
constructor(e) {
|
1929 |
+
super(), Vl(
|
1930 |
+
this,
|
1931 |
+
e,
|
1932 |
+
en,
|
1933 |
+
xl,
|
1934 |
+
Il,
|
1935 |
+
{
|
1936 |
+
i18n: 1,
|
1937 |
+
eta: 0,
|
1938 |
+
queue: 21,
|
1939 |
+
queue_position: 2,
|
1940 |
+
queue_size: 3,
|
1941 |
+
status: 4,
|
1942 |
+
scroll_to_output: 22,
|
1943 |
+
timer: 5,
|
1944 |
+
show_progress: 6,
|
1945 |
+
message: 23,
|
1946 |
+
progress: 7,
|
1947 |
+
variant: 8,
|
1948 |
+
loading_text: 9,
|
1949 |
+
absolute: 10,
|
1950 |
+
translucent: 11,
|
1951 |
+
border: 12,
|
1952 |
+
autoscroll: 24
|
1953 |
+
},
|
1954 |
+
null,
|
1955 |
+
[-1, -1]
|
1956 |
+
);
|
1957 |
+
}
|
1958 |
+
}
|
1959 |
+
var ln = function() {
|
1960 |
+
var n = this, e = /{[A-Z_]+[0-9]*}/ig, t = {
|
1961 |
+
URL: "((?:(?:[a-z][a-z\\d+\\-.]*:\\/{2}(?:(?:[a-z0-9\\-._~\\!$&'*+,;=:@|]+|%[\\dA-F]{2})+|[0-9.]+|\\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\\])(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~\\!$&'*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~\\!$&'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?(?:#(?:[a-z0-9\\-._~\\!$&'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?)|(?:www\\.(?:[a-z0-9\\-._~\\!$&'*+,;=:@|]+|%[\\dA-F]{2})+(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~\\!$&'*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~\\!$&'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?(?:#(?:[a-z0-9\\-._~\\!$&'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?)))",
|
1962 |
+
LINK: `([a-z0-9-./]+[^"' ]*)`,
|
1963 |
+
EMAIL: "((?:[\\w!#$%&'*+-/=?^`{|}~]+.)*(?:[\\w!#$%'*+-/=?^`{|}~]|&)+@(?:(?:(?:(?:(?:[a-z0-9]{1}[a-z0-9-]{0,62}[a-z0-9]{1})|[a-z]).)+[a-z]{2,6})|(?:\\d{1,3}.){3}\\d{1,3}(?::\\d{1,5})?))",
|
1964 |
+
TEXT: "(.*?)",
|
1965 |
+
SIMPLETEXT: "([a-zA-Z0-9-+.,_ ]+)",
|
1966 |
+
INTTEXT: "([a-zA-Z0-9-+,_. ]+)",
|
1967 |
+
IDENTIFIER: "([a-zA-Z0-9-_]+)",
|
1968 |
+
COLOR: "([a-z]+|#[0-9abcdef]+)",
|
1969 |
+
NUMBER: "([0-9]+)"
|
1970 |
+
}, l = [], s = [], i = [], o = [], f = function(_) {
|
1971 |
+
var u = _.match(e), b = u.length, c = 0, d = "";
|
1972 |
+
if (b <= 0)
|
1973 |
+
return new RegExp(r(_), "g");
|
1974 |
+
for (; c < b; c += 1) {
|
1975 |
+
var y = u[c].replace(/[{}0-9]/g, "");
|
1976 |
+
t[y] && (d += r(_.substr(0, _.indexOf(u[c]))) + t[y], _ = _.substr(_.indexOf(u[c]) + u[c].length));
|
1977 |
+
}
|
1978 |
+
return d += r(_), new RegExp(d, "gi");
|
1979 |
+
}, a = function(_) {
|
1980 |
+
var u = _.match(e), b = u.length, c = 0, d = "", y = {}, v = 0;
|
1981 |
+
if (b <= 0)
|
1982 |
+
return _;
|
1983 |
+
for (; c < b; c += 1) {
|
1984 |
+
var F = u[c].replace(/[{}0-9]/g, ""), q;
|
1985 |
+
y[u[c]] ? q = y[u[c]] : (v += 1, q = v, y[u[c]] = q), t[F] && (d += _.substr(0, _.indexOf(u[c])) + "$" + q, _ = _.substr(_.indexOf(u[c]) + u[c].length));
|
1986 |
+
}
|
1987 |
+
return d += _, d;
|
1988 |
+
};
|
1989 |
+
n.addBBCode = function(_, u) {
|
1990 |
+
l.push(f(_)), s.push(a(u)), i.push(f(u)), o.push(a(_));
|
1991 |
+
}, n.bbcodeToHtml = function(_) {
|
1992 |
+
for (var u = l.length, b = 0; b < u; b += 1)
|
1993 |
+
_ = _.replace(l[b], s[b]);
|
1994 |
+
return _;
|
1995 |
+
}, n.htmlToBBCode = function(_) {
|
1996 |
+
for (var u = i.length, b = 0; b < u; b += 1)
|
1997 |
+
_ = _.replace(i[b], o[b]);
|
1998 |
+
return _;
|
1999 |
+
};
|
2000 |
+
function r(_, u) {
|
2001 |
+
return (_ + "").replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\" + (u || "") + "-]", "g"), "\\$&");
|
2002 |
+
}
|
2003 |
+
n.addBBCode("[b]{TEXT}[/b]", "<strong>{TEXT}</strong>"), n.addBBCode("[i]{TEXT}[/i]", "<em>{TEXT}</em>"), n.addBBCode("[u]{TEXT}[/u]", '<span style="text-decoration:underline;">{TEXT}</span>'), n.addBBCode("[s]{TEXT}[/s]", '<span style="text-decoration:line-through;">{TEXT}</span>'), n.addBBCode("[color={COLOR}]{TEXT}[/color]", '<span style="color:{COLOR}">{TEXT}</span>');
|
2004 |
+
}, nn = new ln();
|
2005 |
+
const {
|
2006 |
+
HtmlTag: sn,
|
2007 |
+
SvelteComponent: fn,
|
2008 |
+
append: $e,
|
2009 |
+
assign: on,
|
2010 |
+
attr: O,
|
2011 |
+
binding_callbacks: an,
|
2012 |
+
check_outros: rn,
|
2013 |
+
create_component: ve,
|
2014 |
+
destroy_component: ke,
|
2015 |
+
detach: ne,
|
2016 |
+
element: et,
|
2017 |
+
empty: _n,
|
2018 |
+
flush: E,
|
2019 |
+
get_spread_object: un,
|
2020 |
+
get_spread_update: cn,
|
2021 |
+
group_outros: dn,
|
2022 |
+
init: mn,
|
2023 |
+
insert: ie,
|
2024 |
+
listen: be,
|
2025 |
+
mount_component: ye,
|
2026 |
+
run_all: bn,
|
2027 |
+
safe_not_equal: gn,
|
2028 |
+
set_data: ut,
|
2029 |
+
space: tt,
|
2030 |
+
text: ct,
|
2031 |
+
toggle_class: ge,
|
2032 |
+
transition_in: K,
|
2033 |
+
transition_out: le
|
2034 |
+
} = window.__gradio__svelte__internal, { tick: he } = window.__gradio__svelte__internal;
|
2035 |
+
function lt(n) {
|
2036 |
+
let e, t;
|
2037 |
+
const l = [
|
2038 |
+
{ autoscroll: (
|
2039 |
+
/*gradio*/
|
2040 |
+
n[1].autoscroll
|
2041 |
+
) },
|
2042 |
+
{ i18n: (
|
2043 |
+
/*gradio*/
|
2044 |
+
n[1].i18n
|
2045 |
+
) },
|
2046 |
+
/*loading_status*/
|
2047 |
+
n[9]
|
2048 |
+
];
|
2049 |
+
let s = {};
|
2050 |
+
for (let i = 0; i < l.length; i += 1)
|
2051 |
+
s = on(s, l[i]);
|
2052 |
+
return e = new tn({ props: s }), {
|
2053 |
+
c() {
|
2054 |
+
ve(e.$$.fragment);
|
2055 |
+
},
|
2056 |
+
m(i, o) {
|
2057 |
+
ye(e, i, o), t = !0;
|
2058 |
+
},
|
2059 |
+
p(i, o) {
|
2060 |
+
const f = o & /*gradio, loading_status*/
|
2061 |
+
514 ? cn(l, [
|
2062 |
+
o & /*gradio*/
|
2063 |
+
2 && { autoscroll: (
|
2064 |
+
/*gradio*/
|
2065 |
+
i[1].autoscroll
|
2066 |
+
) },
|
2067 |
+
o & /*gradio*/
|
2068 |
+
2 && { i18n: (
|
2069 |
+
/*gradio*/
|
2070 |
+
i[1].i18n
|
2071 |
+
) },
|
2072 |
+
o & /*loading_status*/
|
2073 |
+
512 && un(
|
2074 |
+
/*loading_status*/
|
2075 |
+
i[9]
|
2076 |
+
)
|
2077 |
+
]) : {};
|
2078 |
+
e.$set(f);
|
2079 |
+
},
|
2080 |
+
i(i) {
|
2081 |
+
t || (K(e.$$.fragment, i), t = !0);
|
2082 |
+
},
|
2083 |
+
o(i) {
|
2084 |
+
le(e.$$.fragment, i), t = !1;
|
2085 |
+
},
|
2086 |
+
d(i) {
|
2087 |
+
ke(e, i);
|
2088 |
+
}
|
2089 |
+
};
|
2090 |
+
}
|
2091 |
+
function hn(n) {
|
2092 |
+
let e;
|
2093 |
+
return {
|
2094 |
+
c() {
|
2095 |
+
e = ct(
|
2096 |
+
/*label*/
|
2097 |
+
n[2]
|
2098 |
+
);
|
2099 |
+
},
|
2100 |
+
m(t, l) {
|
2101 |
+
ie(t, e, l);
|
2102 |
+
},
|
2103 |
+
p(t, l) {
|
2104 |
+
l & /*label*/
|
2105 |
+
4 && ut(
|
2106 |
+
e,
|
2107 |
+
/*label*/
|
2108 |
+
t[2]
|
2109 |
+
);
|
2110 |
+
},
|
2111 |
+
d(t) {
|
2112 |
+
t && ne(e);
|
2113 |
+
}
|
2114 |
+
};
|
2115 |
+
}
|
2116 |
+
function wn(n) {
|
2117 |
+
let e, t;
|
2118 |
+
return {
|
2119 |
+
c() {
|
2120 |
+
e = new sn(!1), t = _n(), e.a = t;
|
2121 |
+
},
|
2122 |
+
m(l, s) {
|
2123 |
+
e.m(
|
2124 |
+
/*_value*/
|
2125 |
+
n[14],
|
2126 |
+
l,
|
2127 |
+
s
|
2128 |
+
), ie(l, t, s);
|
2129 |
+
},
|
2130 |
+
p(l, s) {
|
2131 |
+
s & /*_value*/
|
2132 |
+
16384 && e.p(
|
2133 |
+
/*_value*/
|
2134 |
+
l[14]
|
2135 |
+
);
|
2136 |
+
},
|
2137 |
+
d(l) {
|
2138 |
+
l && (ne(t), e.d());
|
2139 |
+
}
|
2140 |
+
};
|
2141 |
+
}
|
2142 |
+
function pn(n) {
|
2143 |
+
let e;
|
2144 |
+
return {
|
2145 |
+
c() {
|
2146 |
+
e = ct(
|
2147 |
+
/*value*/
|
2148 |
+
n[0]
|
2149 |
+
);
|
2150 |
+
},
|
2151 |
+
m(t, l) {
|
2152 |
+
ie(t, e, l);
|
2153 |
+
},
|
2154 |
+
p(t, l) {
|
2155 |
+
l & /*value*/
|
2156 |
+
1 && ut(
|
2157 |
+
e,
|
2158 |
+
/*value*/
|
2159 |
+
t[0]
|
2160 |
+
);
|
2161 |
+
},
|
2162 |
+
d(t) {
|
2163 |
+
t && ne(e);
|
2164 |
+
}
|
2165 |
+
};
|
2166 |
+
}
|
2167 |
+
function vn(n) {
|
2168 |
+
let e, t, l, s, i, o, f, a, r, _ = (
|
2169 |
+
/*loading_status*/
|
2170 |
+
n[9] && lt(n)
|
2171 |
+
);
|
2172 |
+
l = new ml({
|
2173 |
+
props: {
|
2174 |
+
show_label: (
|
2175 |
+
/*show_label*/
|
2176 |
+
n[6]
|
2177 |
+
),
|
2178 |
+
info: void 0,
|
2179 |
+
$$slots: { default: [hn] },
|
2180 |
+
$$scope: { ctx: n }
|
2181 |
+
}
|
2182 |
+
});
|
2183 |
+
function u(d, y) {
|
2184 |
+
return (
|
2185 |
+
/*is_being_edited*/
|
2186 |
+
d[13] ? pn : wn
|
2187 |
+
);
|
2188 |
+
}
|
2189 |
+
let b = u(n), c = b(n);
|
2190 |
+
return {
|
2191 |
+
c() {
|
2192 |
+
_ && _.c(), e = tt(), t = et("label"), ve(l.$$.fragment), s = tt(), i = et("div"), c.c(), O(i, "data-testid", "textbox"), O(i, "contenteditable", "true"), O(i, "class", "text-container svelte-15aeqxz"), O(i, "role", "textbox"), O(i, "tabindex", "0"), O(i, "dir", o = /*rtl*/
|
2193 |
+
n[11] ? "rtl" : "ltr"), ge(
|
2194 |
+
i,
|
2195 |
+
"disabled",
|
2196 |
+
/*mode*/
|
2197 |
+
n[10] === "static"
|
2198 |
+
), O(t, "class", "svelte-15aeqxz"), ge(t, "container", yn);
|
2199 |
+
},
|
2200 |
+
m(d, y) {
|
2201 |
+
_ && _.m(d, y), ie(d, e, y), ie(d, t, y), ye(l, t, null), $e(t, s), $e(t, i), c.m(i, null), n[19](i), f = !0, a || (r = [
|
2202 |
+
be(
|
2203 |
+
i,
|
2204 |
+
"keypress",
|
2205 |
+
/*handle_keypress*/
|
2206 |
+
n[15]
|
2207 |
+
),
|
2208 |
+
be(
|
2209 |
+
i,
|
2210 |
+
"blur",
|
2211 |
+
/*handle_blur*/
|
2212 |
+
n[16]
|
2213 |
+
),
|
2214 |
+
be(
|
2215 |
+
i,
|
2216 |
+
"focus",
|
2217 |
+
/*handle_focus*/
|
2218 |
+
n[17]
|
2219 |
+
)
|
2220 |
+
], a = !0);
|
2221 |
+
},
|
2222 |
+
p(d, y) {
|
2223 |
+
/*loading_status*/
|
2224 |
+
d[9] ? _ ? (_.p(d, y), y & /*loading_status*/
|
2225 |
+
512 && K(_, 1)) : (_ = lt(d), _.c(), K(_, 1), _.m(e.parentNode, e)) : _ && (dn(), le(_, 1, 1, () => {
|
2226 |
+
_ = null;
|
2227 |
+
}), rn());
|
2228 |
+
const v = {};
|
2229 |
+
y & /*show_label*/
|
2230 |
+
64 && (v.show_label = /*show_label*/
|
2231 |
+
d[6]), y & /*$$scope, label*/
|
2232 |
+
2097156 && (v.$$scope = { dirty: y, ctx: d }), l.$set(v), b === (b = u(d)) && c ? c.p(d, y) : (c.d(1), c = b(d), c && (c.c(), c.m(i, null))), (!f || y & /*rtl*/
|
2233 |
+
2048 && o !== (o = /*rtl*/
|
2234 |
+
d[11] ? "rtl" : "ltr")) && O(i, "dir", o), (!f || y & /*mode*/
|
2235 |
+
1024) && ge(
|
2236 |
+
i,
|
2237 |
+
"disabled",
|
2238 |
+
/*mode*/
|
2239 |
+
d[10] === "static"
|
2240 |
+
);
|
2241 |
+
},
|
2242 |
+
i(d) {
|
2243 |
+
f || (K(_), K(l.$$.fragment, d), f = !0);
|
2244 |
+
},
|
2245 |
+
o(d) {
|
2246 |
+
le(_), le(l.$$.fragment, d), f = !1;
|
2247 |
+
},
|
2248 |
+
d(d) {
|
2249 |
+
d && (ne(e), ne(t)), _ && _.d(d), ke(l), c.d(), n[19](null), a = !1, bn(r);
|
2250 |
+
}
|
2251 |
+
};
|
2252 |
+
}
|
2253 |
+
function kn(n) {
|
2254 |
+
let e, t;
|
2255 |
+
return e = new At({
|
2256 |
+
props: {
|
2257 |
+
visible: (
|
2258 |
+
/*visible*/
|
2259 |
+
n[5]
|
2260 |
+
),
|
2261 |
+
elem_id: (
|
2262 |
+
/*elem_id*/
|
2263 |
+
n[3]
|
2264 |
+
),
|
2265 |
+
elem_classes: (
|
2266 |
+
/*elem_classes*/
|
2267 |
+
n[4]
|
2268 |
+
),
|
2269 |
+
scale: (
|
2270 |
+
/*scale*/
|
2271 |
+
n[7]
|
2272 |
+
),
|
2273 |
+
min_width: (
|
2274 |
+
/*min_width*/
|
2275 |
+
n[8]
|
2276 |
+
),
|
2277 |
+
allow_overflow: !1,
|
2278 |
+
padding: !0,
|
2279 |
+
$$slots: { default: [vn] },
|
2280 |
+
$$scope: { ctx: n }
|
2281 |
+
}
|
2282 |
+
}), {
|
2283 |
+
c() {
|
2284 |
+
ve(e.$$.fragment);
|
2285 |
+
},
|
2286 |
+
m(l, s) {
|
2287 |
+
ye(e, l, s), t = !0;
|
2288 |
+
},
|
2289 |
+
p(l, [s]) {
|
2290 |
+
const i = {};
|
2291 |
+
s & /*visible*/
|
2292 |
+
32 && (i.visible = /*visible*/
|
2293 |
+
l[5]), s & /*elem_id*/
|
2294 |
+
8 && (i.elem_id = /*elem_id*/
|
2295 |
+
l[3]), s & /*elem_classes*/
|
2296 |
+
16 && (i.elem_classes = /*elem_classes*/
|
2297 |
+
l[4]), s & /*scale*/
|
2298 |
+
128 && (i.scale = /*scale*/
|
2299 |
+
l[7]), s & /*min_width*/
|
2300 |
+
256 && (i.min_width = /*min_width*/
|
2301 |
+
l[8]), s & /*$$scope, rtl, el, mode, value, is_being_edited, _value, show_label, label, gradio, loading_status*/
|
2302 |
+
2129479 && (i.$$scope = { dirty: s, ctx: l }), e.$set(i);
|
2303 |
+
},
|
2304 |
+
i(l) {
|
2305 |
+
t || (K(e.$$.fragment, l), t = !0);
|
2306 |
+
},
|
2307 |
+
o(l) {
|
2308 |
+
le(e.$$.fragment, l), t = !1;
|
2309 |
+
},
|
2310 |
+
d(l) {
|
2311 |
+
ke(e, l);
|
2312 |
+
}
|
2313 |
+
};
|
2314 |
+
}
|
2315 |
+
const yn = !0;
|
2316 |
+
function Tn(n, e, t) {
|
2317 |
+
let { gradio: l } = e, { label: s = "Textbox" } = e, { elem_id: i = "" } = e, { elem_classes: o = [] } = e, { visible: f = !0 } = e, { value: a = "" } = e, { show_label: r } = e, { scale: _ = null } = e, { min_width: u = void 0 } = e, { loading_status: b = void 0 } = e, { value_is_output: c = !1 } = e, { mode: d } = e, { rtl: y = !1 } = e, v;
|
2318 |
+
function F() {
|
2319 |
+
l.dispatch("change"), c || l.dispatch("input");
|
2320 |
+
}
|
2321 |
+
async function q(k) {
|
2322 |
+
await he(), k.key === "Enter" && (k.preventDefault(), l.dispatch("submit"));
|
2323 |
+
}
|
2324 |
+
let m = !1, z = "";
|
2325 |
+
async function h() {
|
2326 |
+
await he(), d !== "static" && (t(0, a = v.innerText), t(13, m = !1), t(12, v.innerText = "", v));
|
2327 |
+
}
|
2328 |
+
async function $() {
|
2329 |
+
if (await he(), d === "static") {
|
2330 |
+
v.blur();
|
2331 |
+
return;
|
2332 |
+
}
|
2333 |
+
t(13, m = !0);
|
2334 |
+
}
|
2335 |
+
function R(k) {
|
2336 |
+
an[k ? "unshift" : "push"](() => {
|
2337 |
+
v = k, t(12, v);
|
2338 |
+
});
|
2339 |
+
}
|
2340 |
+
return n.$$set = (k) => {
|
2341 |
+
"gradio" in k && t(1, l = k.gradio), "label" in k && t(2, s = k.label), "elem_id" in k && t(3, i = k.elem_id), "elem_classes" in k && t(4, o = k.elem_classes), "visible" in k && t(5, f = k.visible), "value" in k && t(0, a = k.value), "show_label" in k && t(6, r = k.show_label), "scale" in k && t(7, _ = k.scale), "min_width" in k && t(8, u = k.min_width), "loading_status" in k && t(9, b = k.loading_status), "value_is_output" in k && t(18, c = k.value_is_output), "mode" in k && t(10, d = k.mode), "rtl" in k && t(11, y = k.rtl);
|
2342 |
+
}, n.$$.update = () => {
|
2343 |
+
n.$$.dirty & /*value*/
|
2344 |
+
1 && a === null && t(0, a = ""), n.$$.dirty & /*value*/
|
2345 |
+
1 && t(14, z = nn.bbcodeToHtml(a || "")), n.$$.dirty & /*value*/
|
2346 |
+
1 && F();
|
2347 |
+
}, [
|
2348 |
+
a,
|
2349 |
+
l,
|
2350 |
+
s,
|
2351 |
+
i,
|
2352 |
+
o,
|
2353 |
+
f,
|
2354 |
+
r,
|
2355 |
+
_,
|
2356 |
+
u,
|
2357 |
+
b,
|
2358 |
+
d,
|
2359 |
+
y,
|
2360 |
+
v,
|
2361 |
+
m,
|
2362 |
+
z,
|
2363 |
+
q,
|
2364 |
+
h,
|
2365 |
+
$,
|
2366 |
+
c,
|
2367 |
+
R
|
2368 |
+
];
|
2369 |
+
}
|
2370 |
+
class zn extends fn {
|
2371 |
+
constructor(e) {
|
2372 |
+
super(), mn(this, e, Tn, kn, gn, {
|
2373 |
+
gradio: 1,
|
2374 |
+
label: 2,
|
2375 |
+
elem_id: 3,
|
2376 |
+
elem_classes: 4,
|
2377 |
+
visible: 5,
|
2378 |
+
value: 0,
|
2379 |
+
show_label: 6,
|
2380 |
+
scale: 7,
|
2381 |
+
min_width: 8,
|
2382 |
+
loading_status: 9,
|
2383 |
+
value_is_output: 18,
|
2384 |
+
mode: 10,
|
2385 |
+
rtl: 11
|
2386 |
+
});
|
2387 |
+
}
|
2388 |
+
get gradio() {
|
2389 |
+
return this.$$.ctx[1];
|
2390 |
+
}
|
2391 |
+
set gradio(e) {
|
2392 |
+
this.$$set({ gradio: e }), E();
|
2393 |
+
}
|
2394 |
+
get label() {
|
2395 |
+
return this.$$.ctx[2];
|
2396 |
+
}
|
2397 |
+
set label(e) {
|
2398 |
+
this.$$set({ label: e }), E();
|
2399 |
+
}
|
2400 |
+
get elem_id() {
|
2401 |
+
return this.$$.ctx[3];
|
2402 |
+
}
|
2403 |
+
set elem_id(e) {
|
2404 |
+
this.$$set({ elem_id: e }), E();
|
2405 |
+
}
|
2406 |
+
get elem_classes() {
|
2407 |
+
return this.$$.ctx[4];
|
2408 |
+
}
|
2409 |
+
set elem_classes(e) {
|
2410 |
+
this.$$set({ elem_classes: e }), E();
|
2411 |
+
}
|
2412 |
+
get visible() {
|
2413 |
+
return this.$$.ctx[5];
|
2414 |
+
}
|
2415 |
+
set visible(e) {
|
2416 |
+
this.$$set({ visible: e }), E();
|
2417 |
+
}
|
2418 |
+
get value() {
|
2419 |
+
return this.$$.ctx[0];
|
2420 |
+
}
|
2421 |
+
set value(e) {
|
2422 |
+
this.$$set({ value: e }), E();
|
2423 |
+
}
|
2424 |
+
get show_label() {
|
2425 |
+
return this.$$.ctx[6];
|
2426 |
+
}
|
2427 |
+
set show_label(e) {
|
2428 |
+
this.$$set({ show_label: e }), E();
|
2429 |
+
}
|
2430 |
+
get scale() {
|
2431 |
+
return this.$$.ctx[7];
|
2432 |
+
}
|
2433 |
+
set scale(e) {
|
2434 |
+
this.$$set({ scale: e }), E();
|
2435 |
+
}
|
2436 |
+
get min_width() {
|
2437 |
+
return this.$$.ctx[8];
|
2438 |
+
}
|
2439 |
+
set min_width(e) {
|
2440 |
+
this.$$set({ min_width: e }), E();
|
2441 |
+
}
|
2442 |
+
get loading_status() {
|
2443 |
+
return this.$$.ctx[9];
|
2444 |
+
}
|
2445 |
+
set loading_status(e) {
|
2446 |
+
this.$$set({ loading_status: e }), E();
|
2447 |
+
}
|
2448 |
+
get value_is_output() {
|
2449 |
+
return this.$$.ctx[18];
|
2450 |
+
}
|
2451 |
+
set value_is_output(e) {
|
2452 |
+
this.$$set({ value_is_output: e }), E();
|
2453 |
+
}
|
2454 |
+
get mode() {
|
2455 |
+
return this.$$.ctx[10];
|
2456 |
+
}
|
2457 |
+
set mode(e) {
|
2458 |
+
this.$$set({ mode: e }), E();
|
2459 |
+
}
|
2460 |
+
get rtl() {
|
2461 |
+
return this.$$.ctx[11];
|
2462 |
+
}
|
2463 |
+
set rtl(e) {
|
2464 |
+
this.$$set({ rtl: e }), E();
|
2465 |
+
}
|
2466 |
+
}
|
2467 |
+
export {
|
2468 |
+
zn as default
|
2469 |
+
};
|
src/backend/gradio_rich_textbox/templates/component/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.block.svelte-1t38q2d{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-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{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-lkmj4t{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-1);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color);border-radius:var(--radius-sm);background:var(--background-fill-primary);padding:2px;color:var(--block-label-text-color)}button.svelte-lkmj4t:hover{cursor:pointer;border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lkmj4t{padding:0 1px;font-size:10px}div.svelte-lkmj4t{padding:2px;width:14px;height:14px}.pending.svelte-lkmj4t{animation:svelte-lkmj4t-flash .5s infinite}@keyframes svelte-lkmj4t-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.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-1in5nh4{fill:var(--body-text-color);margin-right:var(--size-2);width:var(--size-5)}.wrap.svelte-8ytugg{display:flex;flex-direction:column;justify-content:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md)}.or.svelte-8ytugg{color:var(--body-text-color-subdued)}@media (--screen-md){.wrap.svelte-8ytugg{font-size:var(--text-lg)}}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-14miwb5.svelte-14miwb5{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-5);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-14miwb5.svelte-14miwb5{top:0;right:0;left:0}.wrap.default.svelte-14miwb5.svelte-14miwb5{top:0;right:0;bottom:0;left:0}.hide.svelte-14miwb5.svelte-14miwb5{opacity:0;pointer-events:none}.generating.svelte-14miwb5.svelte-14miwb5{animation:svelte-14miwb5-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent}.translucent.svelte-14miwb5.svelte-14miwb5{background:none}@keyframes svelte-14miwb5-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-14miwb5.svelte-14miwb5{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-14miwb5.svelte-14miwb5{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-14miwb5.svelte-14miwb5{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-14miwb5.svelte-14miwb5{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-14miwb5.svelte-14miwb5{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-14miwb5.svelte-14miwb5{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-14miwb5.svelte-14miwb5{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-14miwb5.svelte-14miwb5{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-14miwb5.svelte-14miwb5{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-14miwb5 .progress-text.svelte-14miwb5{background:var(--block-background-fill)}.border.svelte-14miwb5.svelte-14miwb5{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))}}label.svelte-15aeqxz.svelte-15aeqxz{display:block;width:100%}.container.svelte-15aeqxz>div.text-container.svelte-15aeqxz{border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-radius)}div.text-container.svelte-15aeqxz.svelte-15aeqxz{display:block;position:relative;outline:none!important;box-shadow:var(--input-shadow);background:var(--input-background-fill);padding:var(--input-padding);width:100%;color:var(--body-text-color);font-weight:var(--input-text-weight);font-size:var(--input-text-size);line-height:var(--line-sm);border:none}div.text-container.svelte-15aeqxz.svelte-15aeqxz:disabled{-webkit-text-fill-color:var(--body-text-color);-webkit-opacity:1;opacity:1}div.text-container.svelte-15aeqxz.svelte-15aeqxz:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}
|
src/backend/gradio_rich_textbox/templates/example/index.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const {
|
2 |
+
SvelteComponent: y,
|
3 |
+
add_iframe_resize_listener: b,
|
4 |
+
add_render_callback: v,
|
5 |
+
append: m,
|
6 |
+
attr: h,
|
7 |
+
binding_callbacks: p,
|
8 |
+
detach: w,
|
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: _
|
17 |
+
} = window.__gradio__svelte__internal, { onMount: M } = window.__gradio__svelte__internal;
|
18 |
+
function P(t) {
|
19 |
+
let e, s, r;
|
20 |
+
return {
|
21 |
+
c() {
|
22 |
+
e = z("div"), s = C(
|
23 |
+
/*value*/
|
24 |
+
t[0]
|
25 |
+
), h(e, "class", "svelte-84cxb8"), v(() => (
|
26 |
+
/*div_elementresize_handler*/
|
27 |
+
t[5].call(e)
|
28 |
+
)), _(
|
29 |
+
e,
|
30 |
+
"table",
|
31 |
+
/*type*/
|
32 |
+
t[1] === "table"
|
33 |
+
), _(
|
34 |
+
e,
|
35 |
+
"gallery",
|
36 |
+
/*type*/
|
37 |
+
t[1] === "gallery"
|
38 |
+
), _(
|
39 |
+
e,
|
40 |
+
"selected",
|
41 |
+
/*selected*/
|
42 |
+
t[2]
|
43 |
+
);
|
44 |
+
},
|
45 |
+
m(l, i) {
|
46 |
+
E(l, e, i), m(e, s), r = b(
|
47 |
+
e,
|
48 |
+
/*div_elementresize_handler*/
|
49 |
+
t[5].bind(e)
|
50 |
+
), t[6](e);
|
51 |
+
},
|
52 |
+
p(l, [i]) {
|
53 |
+
i & /*value*/
|
54 |
+
1 && q(
|
55 |
+
s,
|
56 |
+
/*value*/
|
57 |
+
l[0]
|
58 |
+
), i & /*type*/
|
59 |
+
2 && _(
|
60 |
+
e,
|
61 |
+
"table",
|
62 |
+
/*type*/
|
63 |
+
l[1] === "table"
|
64 |
+
), i & /*type*/
|
65 |
+
2 && _(
|
66 |
+
e,
|
67 |
+
"gallery",
|
68 |
+
/*type*/
|
69 |
+
l[1] === "gallery"
|
70 |
+
), i & /*selected*/
|
71 |
+
4 && _(
|
72 |
+
e,
|
73 |
+
"selected",
|
74 |
+
/*selected*/
|
75 |
+
l[2]
|
76 |
+
);
|
77 |
+
},
|
78 |
+
i: f,
|
79 |
+
o: f,
|
80 |
+
d(l) {
|
81 |
+
l && w(e), r(), t[6](null);
|
82 |
+
}
|
83 |
+
};
|
84 |
+
}
|
85 |
+
function W(t, e, s) {
|
86 |
+
let { value: r } = e, { type: l } = e, { selected: i = !1 } = e, c, a;
|
87 |
+
function u(n, d) {
|
88 |
+
!n || !d || (a.style.setProperty("--local-text-width", `${d < 150 ? d : 200}px`), s(4, a.style.whiteSpace = "unset", a));
|
89 |
+
}
|
90 |
+
M(() => {
|
91 |
+
u(a, c);
|
92 |
+
});
|
93 |
+
function o() {
|
94 |
+
c = this.clientWidth, s(3, c);
|
95 |
+
}
|
96 |
+
function g(n) {
|
97 |
+
p[n ? "unshift" : "push"](() => {
|
98 |
+
a = n, s(4, a);
|
99 |
+
});
|
100 |
+
}
|
101 |
+
return t.$$set = (n) => {
|
102 |
+
"value" in n && s(0, r = n.value), "type" in n && s(1, l = n.type), "selected" in n && s(2, i = n.selected);
|
103 |
+
}, [r, l, i, c, a, o, g];
|
104 |
+
}
|
105 |
+
class j extends y {
|
106 |
+
constructor(e) {
|
107 |
+
super(), k(this, e, W, P, S, { value: 0, type: 1, selected: 2 });
|
108 |
+
}
|
109 |
+
}
|
110 |
+
export {
|
111 |
+
j as default
|
112 |
+
};
|
src/backend/gradio_rich_textbox/templates/example/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.gallery.svelte-84cxb8{padding:var(--size-1) var(--size-2)}div.svelte-84cxb8{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,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import gradio as gr
|
3 |
+
from gradio_rich_textbox import RichTextbox
|
4 |
+
|
5 |
+
|
6 |
+
example = RichTextbox().example_inputs()
|
7 |
+
|
8 |
+
demo = gr.Interface(
|
9 |
+
lambda x:x,
|
10 |
+
RichTextbox(), # interactive version of your component
|
11 |
+
RichTextbox(), # static version of your component
|
12 |
+
examples=[[example]], # uncomment this line to view the "example version" of your component
|
13 |
+
)
|
14 |
+
|
15 |
+
|
16 |
+
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;
|
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}
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<style>
|
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,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svelte:options accessors={true} />
|
2 |
+
|
3 |
+
<script lang="ts">
|
4 |
+
import type { Gradio } from "@gradio/utils";
|
5 |
+
import { BlockTitle } from "@gradio/atoms";
|
6 |
+
import { Block } from "@gradio/atoms";
|
7 |
+
import { StatusTracker } from "@gradio/statustracker";
|
8 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
9 |
+
import { tick } from "svelte";
|
10 |
+
import {bbcodeParser} from "./utils";
|
11 |
+
|
12 |
+
export let gradio: Gradio<{
|
13 |
+
change: never;
|
14 |
+
submit: never;
|
15 |
+
input: never;
|
16 |
+
}>;
|
17 |
+
export let label = "Textbox";
|
18 |
+
export let elem_id = "";
|
19 |
+
export let elem_classes: string[] = [];
|
20 |
+
export let visible = true;
|
21 |
+
export let value = "";
|
22 |
+
export let show_label: boolean;
|
23 |
+
export let scale: number | null = null;
|
24 |
+
export let min_width: number | undefined = undefined;
|
25 |
+
export let loading_status: LoadingStatus | undefined = undefined;
|
26 |
+
export let value_is_output = false;
|
27 |
+
export let mode: "static" | "interactive";
|
28 |
+
export let rtl = false;
|
29 |
+
|
30 |
+
let el: HTMLDivElement;
|
31 |
+
const container = true;
|
32 |
+
|
33 |
+
function handle_change(): void {
|
34 |
+
gradio.dispatch("change");
|
35 |
+
if (!value_is_output) {
|
36 |
+
gradio.dispatch("input");
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
async function handle_keypress(e: KeyboardEvent): Promise<void> {
|
41 |
+
await tick();
|
42 |
+
if (e.key === "Enter") {
|
43 |
+
e.preventDefault();
|
44 |
+
gradio.dispatch("submit");
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
let is_being_edited = false;
|
49 |
+
let _value = "";
|
50 |
+
$: {
|
51 |
+
_value = bbcodeParser.bbcodeToHtml(value || "");
|
52 |
+
}
|
53 |
+
|
54 |
+
async function handle_blur(): Promise<void> {
|
55 |
+
await tick();
|
56 |
+
if (mode === "static") {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
value = el.innerText
|
60 |
+
is_being_edited = false;
|
61 |
+
el.innerText = "";
|
62 |
+
}
|
63 |
+
|
64 |
+
async function handle_focus(): Promise<void> {
|
65 |
+
await tick();
|
66 |
+
if (mode === "static") {
|
67 |
+
el.blur();
|
68 |
+
return;
|
69 |
+
}
|
70 |
+
is_being_edited = true;
|
71 |
+
}
|
72 |
+
|
73 |
+
$: if (value === null) value = "";
|
74 |
+
|
75 |
+
// When the value changes, dispatch the change event via handle_change()
|
76 |
+
// See the docs for an explanation: https://svelte.dev/docs/svelte-components#script-3-$-marks-a-statement-as-reactive
|
77 |
+
$: value, handle_change();
|
78 |
+
</script>
|
79 |
+
|
80 |
+
<Block
|
81 |
+
{visible}
|
82 |
+
{elem_id}
|
83 |
+
{elem_classes}
|
84 |
+
{scale}
|
85 |
+
{min_width}
|
86 |
+
allow_overflow={false}
|
87 |
+
padding={true}
|
88 |
+
>
|
89 |
+
{#if loading_status}
|
90 |
+
<StatusTracker
|
91 |
+
autoscroll={gradio.autoscroll}
|
92 |
+
i18n={gradio.i18n}
|
93 |
+
{...loading_status}
|
94 |
+
/>
|
95 |
+
{/if}
|
96 |
+
|
97 |
+
<label class:container>
|
98 |
+
<BlockTitle {show_label} info={undefined}>{label}</BlockTitle>
|
99 |
+
|
100 |
+
<div
|
101 |
+
data-testid="textbox"
|
102 |
+
contenteditable=true
|
103 |
+
class="text-container"
|
104 |
+
class:disabled={mode === "static"}
|
105 |
+
bind:this={el}
|
106 |
+
on:keypress={handle_keypress}
|
107 |
+
on:blur={handle_blur}
|
108 |
+
on:focus={handle_focus}
|
109 |
+
role="textbox"
|
110 |
+
tabindex="0"
|
111 |
+
dir={rtl ? "rtl" : "ltr"}
|
112 |
+
>
|
113 |
+
{#if is_being_edited}
|
114 |
+
{value}
|
115 |
+
{:else}
|
116 |
+
{@html _value}
|
117 |
+
{/if}
|
118 |
+
</div>
|
119 |
+
</label>
|
120 |
+
</Block>
|
121 |
+
|
122 |
+
<style>
|
123 |
+
label {
|
124 |
+
display: block;
|
125 |
+
width: 100%;
|
126 |
+
}
|
127 |
+
.container > div.text-container
|
128 |
+
{
|
129 |
+
border: var(--input-border-width) solid var(--input-border-color);
|
130 |
+
border-radius: var(--input-radius);
|
131 |
+
}
|
132 |
+
|
133 |
+
div.text-container {
|
134 |
+
display: block;
|
135 |
+
position: relative;
|
136 |
+
outline: none !important;
|
137 |
+
box-shadow: var(--input-shadow);
|
138 |
+
background: var(--input-background-fill);
|
139 |
+
padding: var(--input-padding);
|
140 |
+
width: 100%;
|
141 |
+
color: var(--body-text-color);
|
142 |
+
font-weight: var(--input-text-weight);
|
143 |
+
font-size: var(--input-text-size);
|
144 |
+
line-height: var(--line-sm);
|
145 |
+
border: none;
|
146 |
+
}
|
147 |
+
div.text-container:disabled
|
148 |
+
{
|
149 |
+
-webkit-text-fill-color: var(--body-text-color);
|
150 |
+
-webkit-opacity: 1;
|
151 |
+
opacity: 1;
|
152 |
+
}
|
153 |
+
|
154 |
+
div.text-container:focus {
|
155 |
+
box-shadow: var(--input-shadow-focus);
|
156 |
+
border-color: var(--input-border-color-focus);
|
157 |
+
}
|
158 |
+
</style>
|
src/frontend/package-lock.json
ADDED
@@ -0,0 +1,918 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_richtextbox",
|
3 |
+
"version": "0.1.0-beta.1",
|
4 |
+
"lockfileVersion": 3,
|
5 |
+
"requires": true,
|
6 |
+
"packages": {
|
7 |
+
"": {
|
8 |
+
"name": "gradio_richtextbox",
|
9 |
+
"version": "0.1.0-beta.1",
|
10 |
+
"license": "ISC",
|
11 |
+
"dependencies": {
|
12 |
+
"@gradio/atoms": "0.2.0-beta.5",
|
13 |
+
"@gradio/icons": "0.2.0-beta.2",
|
14 |
+
"@gradio/statustracker": "0.3.0-beta.7",
|
15 |
+
"@gradio/utils": "0.2.0-beta.5"
|
16 |
+
}
|
17 |
+
},
|
18 |
+
"node_modules/@ampproject/remapping": {
|
19 |
+
"version": "2.2.1",
|
20 |
+
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
21 |
+
"integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
|
22 |
+
"peer": true,
|
23 |
+
"dependencies": {
|
24 |
+
"@jridgewell/gen-mapping": "^0.3.0",
|
25 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
26 |
+
},
|
27 |
+
"engines": {
|
28 |
+
"node": ">=6.0.0"
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"node_modules/@esbuild/android-arm": {
|
32 |
+
"version": "0.19.5",
|
33 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz",
|
34 |
+
"integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==",
|
35 |
+
"cpu": [
|
36 |
+
"arm"
|
37 |
+
],
|
38 |
+
"optional": true,
|
39 |
+
"os": [
|
40 |
+
"android"
|
41 |
+
],
|
42 |
+
"engines": {
|
43 |
+
"node": ">=12"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"node_modules/@esbuild/android-arm64": {
|
47 |
+
"version": "0.19.5",
|
48 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz",
|
49 |
+
"integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==",
|
50 |
+
"cpu": [
|
51 |
+
"arm64"
|
52 |
+
],
|
53 |
+
"optional": true,
|
54 |
+
"os": [
|
55 |
+
"android"
|
56 |
+
],
|
57 |
+
"engines": {
|
58 |
+
"node": ">=12"
|
59 |
+
}
|
60 |
+
},
|
61 |
+
"node_modules/@esbuild/android-x64": {
|
62 |
+
"version": "0.19.5",
|
63 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz",
|
64 |
+
"integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==",
|
65 |
+
"cpu": [
|
66 |
+
"x64"
|
67 |
+
],
|
68 |
+
"optional": true,
|
69 |
+
"os": [
|
70 |
+
"android"
|
71 |
+
],
|
72 |
+
"engines": {
|
73 |
+
"node": ">=12"
|
74 |
+
}
|
75 |
+
},
|
76 |
+
"node_modules/@esbuild/darwin-arm64": {
|
77 |
+
"version": "0.19.5",
|
78 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz",
|
79 |
+
"integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==",
|
80 |
+
"cpu": [
|
81 |
+
"arm64"
|
82 |
+
],
|
83 |
+
"optional": true,
|
84 |
+
"os": [
|
85 |
+
"darwin"
|
86 |
+
],
|
87 |
+
"engines": {
|
88 |
+
"node": ">=12"
|
89 |
+
}
|
90 |
+
},
|
91 |
+
"node_modules/@esbuild/darwin-x64": {
|
92 |
+
"version": "0.19.5",
|
93 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz",
|
94 |
+
"integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==",
|
95 |
+
"cpu": [
|
96 |
+
"x64"
|
97 |
+
],
|
98 |
+
"optional": true,
|
99 |
+
"os": [
|
100 |
+
"darwin"
|
101 |
+
],
|
102 |
+
"engines": {
|
103 |
+
"node": ">=12"
|
104 |
+
}
|
105 |
+
},
|
106 |
+
"node_modules/@esbuild/freebsd-arm64": {
|
107 |
+
"version": "0.19.5",
|
108 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz",
|
109 |
+
"integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==",
|
110 |
+
"cpu": [
|
111 |
+
"arm64"
|
112 |
+
],
|
113 |
+
"optional": true,
|
114 |
+
"os": [
|
115 |
+
"freebsd"
|
116 |
+
],
|
117 |
+
"engines": {
|
118 |
+
"node": ">=12"
|
119 |
+
}
|
120 |
+
},
|
121 |
+
"node_modules/@esbuild/freebsd-x64": {
|
122 |
+
"version": "0.19.5",
|
123 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz",
|
124 |
+
"integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==",
|
125 |
+
"cpu": [
|
126 |
+
"x64"
|
127 |
+
],
|
128 |
+
"optional": true,
|
129 |
+
"os": [
|
130 |
+
"freebsd"
|
131 |
+
],
|
132 |
+
"engines": {
|
133 |
+
"node": ">=12"
|
134 |
+
}
|
135 |
+
},
|
136 |
+
"node_modules/@esbuild/linux-arm": {
|
137 |
+
"version": "0.19.5",
|
138 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz",
|
139 |
+
"integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==",
|
140 |
+
"cpu": [
|
141 |
+
"arm"
|
142 |
+
],
|
143 |
+
"optional": true,
|
144 |
+
"os": [
|
145 |
+
"linux"
|
146 |
+
],
|
147 |
+
"engines": {
|
148 |
+
"node": ">=12"
|
149 |
+
}
|
150 |
+
},
|
151 |
+
"node_modules/@esbuild/linux-arm64": {
|
152 |
+
"version": "0.19.5",
|
153 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz",
|
154 |
+
"integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==",
|
155 |
+
"cpu": [
|
156 |
+
"arm64"
|
157 |
+
],
|
158 |
+
"optional": true,
|
159 |
+
"os": [
|
160 |
+
"linux"
|
161 |
+
],
|
162 |
+
"engines": {
|
163 |
+
"node": ">=12"
|
164 |
+
}
|
165 |
+
},
|
166 |
+
"node_modules/@esbuild/linux-ia32": {
|
167 |
+
"version": "0.19.5",
|
168 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz",
|
169 |
+
"integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==",
|
170 |
+
"cpu": [
|
171 |
+
"ia32"
|
172 |
+
],
|
173 |
+
"optional": true,
|
174 |
+
"os": [
|
175 |
+
"linux"
|
176 |
+
],
|
177 |
+
"engines": {
|
178 |
+
"node": ">=12"
|
179 |
+
}
|
180 |
+
},
|
181 |
+
"node_modules/@esbuild/linux-loong64": {
|
182 |
+
"version": "0.19.5",
|
183 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz",
|
184 |
+
"integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==",
|
185 |
+
"cpu": [
|
186 |
+
"loong64"
|
187 |
+
],
|
188 |
+
"optional": true,
|
189 |
+
"os": [
|
190 |
+
"linux"
|
191 |
+
],
|
192 |
+
"engines": {
|
193 |
+
"node": ">=12"
|
194 |
+
}
|
195 |
+
},
|
196 |
+
"node_modules/@esbuild/linux-mips64el": {
|
197 |
+
"version": "0.19.5",
|
198 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz",
|
199 |
+
"integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==",
|
200 |
+
"cpu": [
|
201 |
+
"mips64el"
|
202 |
+
],
|
203 |
+
"optional": true,
|
204 |
+
"os": [
|
205 |
+
"linux"
|
206 |
+
],
|
207 |
+
"engines": {
|
208 |
+
"node": ">=12"
|
209 |
+
}
|
210 |
+
},
|
211 |
+
"node_modules/@esbuild/linux-ppc64": {
|
212 |
+
"version": "0.19.5",
|
213 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz",
|
214 |
+
"integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==",
|
215 |
+
"cpu": [
|
216 |
+
"ppc64"
|
217 |
+
],
|
218 |
+
"optional": true,
|
219 |
+
"os": [
|
220 |
+
"linux"
|
221 |
+
],
|
222 |
+
"engines": {
|
223 |
+
"node": ">=12"
|
224 |
+
}
|
225 |
+
},
|
226 |
+
"node_modules/@esbuild/linux-riscv64": {
|
227 |
+
"version": "0.19.5",
|
228 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz",
|
229 |
+
"integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==",
|
230 |
+
"cpu": [
|
231 |
+
"riscv64"
|
232 |
+
],
|
233 |
+
"optional": true,
|
234 |
+
"os": [
|
235 |
+
"linux"
|
236 |
+
],
|
237 |
+
"engines": {
|
238 |
+
"node": ">=12"
|
239 |
+
}
|
240 |
+
},
|
241 |
+
"node_modules/@esbuild/linux-s390x": {
|
242 |
+
"version": "0.19.5",
|
243 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz",
|
244 |
+
"integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==",
|
245 |
+
"cpu": [
|
246 |
+
"s390x"
|
247 |
+
],
|
248 |
+
"optional": true,
|
249 |
+
"os": [
|
250 |
+
"linux"
|
251 |
+
],
|
252 |
+
"engines": {
|
253 |
+
"node": ">=12"
|
254 |
+
}
|
255 |
+
},
|
256 |
+
"node_modules/@esbuild/linux-x64": {
|
257 |
+
"version": "0.19.5",
|
258 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz",
|
259 |
+
"integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==",
|
260 |
+
"cpu": [
|
261 |
+
"x64"
|
262 |
+
],
|
263 |
+
"optional": true,
|
264 |
+
"os": [
|
265 |
+
"linux"
|
266 |
+
],
|
267 |
+
"engines": {
|
268 |
+
"node": ">=12"
|
269 |
+
}
|
270 |
+
},
|
271 |
+
"node_modules/@esbuild/netbsd-x64": {
|
272 |
+
"version": "0.19.5",
|
273 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz",
|
274 |
+
"integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==",
|
275 |
+
"cpu": [
|
276 |
+
"x64"
|
277 |
+
],
|
278 |
+
"optional": true,
|
279 |
+
"os": [
|
280 |
+
"netbsd"
|
281 |
+
],
|
282 |
+
"engines": {
|
283 |
+
"node": ">=12"
|
284 |
+
}
|
285 |
+
},
|
286 |
+
"node_modules/@esbuild/openbsd-x64": {
|
287 |
+
"version": "0.19.5",
|
288 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz",
|
289 |
+
"integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==",
|
290 |
+
"cpu": [
|
291 |
+
"x64"
|
292 |
+
],
|
293 |
+
"optional": true,
|
294 |
+
"os": [
|
295 |
+
"openbsd"
|
296 |
+
],
|
297 |
+
"engines": {
|
298 |
+
"node": ">=12"
|
299 |
+
}
|
300 |
+
},
|
301 |
+
"node_modules/@esbuild/sunos-x64": {
|
302 |
+
"version": "0.19.5",
|
303 |
+
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz",
|
304 |
+
"integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==",
|
305 |
+
"cpu": [
|
306 |
+
"x64"
|
307 |
+
],
|
308 |
+
"optional": true,
|
309 |
+
"os": [
|
310 |
+
"sunos"
|
311 |
+
],
|
312 |
+
"engines": {
|
313 |
+
"node": ">=12"
|
314 |
+
}
|
315 |
+
},
|
316 |
+
"node_modules/@esbuild/win32-arm64": {
|
317 |
+
"version": "0.19.5",
|
318 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz",
|
319 |
+
"integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==",
|
320 |
+
"cpu": [
|
321 |
+
"arm64"
|
322 |
+
],
|
323 |
+
"optional": true,
|
324 |
+
"os": [
|
325 |
+
"win32"
|
326 |
+
],
|
327 |
+
"engines": {
|
328 |
+
"node": ">=12"
|
329 |
+
}
|
330 |
+
},
|
331 |
+
"node_modules/@esbuild/win32-ia32": {
|
332 |
+
"version": "0.19.5",
|
333 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz",
|
334 |
+
"integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==",
|
335 |
+
"cpu": [
|
336 |
+
"ia32"
|
337 |
+
],
|
338 |
+
"optional": true,
|
339 |
+
"os": [
|
340 |
+
"win32"
|
341 |
+
],
|
342 |
+
"engines": {
|
343 |
+
"node": ">=12"
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"node_modules/@esbuild/win32-x64": {
|
347 |
+
"version": "0.19.5",
|
348 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz",
|
349 |
+
"integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==",
|
350 |
+
"cpu": [
|
351 |
+
"x64"
|
352 |
+
],
|
353 |
+
"optional": true,
|
354 |
+
"os": [
|
355 |
+
"win32"
|
356 |
+
],
|
357 |
+
"engines": {
|
358 |
+
"node": ">=12"
|
359 |
+
}
|
360 |
+
},
|
361 |
+
"node_modules/@formatjs/ecma402-abstract": {
|
362 |
+
"version": "1.11.4",
|
363 |
+
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
|
364 |
+
"integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
|
365 |
+
"dependencies": {
|
366 |
+
"@formatjs/intl-localematcher": "0.2.25",
|
367 |
+
"tslib": "^2.1.0"
|
368 |
+
}
|
369 |
+
},
|
370 |
+
"node_modules/@formatjs/fast-memoize": {
|
371 |
+
"version": "1.2.1",
|
372 |
+
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
|
373 |
+
"integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
|
374 |
+
"dependencies": {
|
375 |
+
"tslib": "^2.1.0"
|
376 |
+
}
|
377 |
+
},
|
378 |
+
"node_modules/@formatjs/icu-messageformat-parser": {
|
379 |
+
"version": "2.1.0",
|
380 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
|
381 |
+
"integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
|
382 |
+
"dependencies": {
|
383 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
384 |
+
"@formatjs/icu-skeleton-parser": "1.3.6",
|
385 |
+
"tslib": "^2.1.0"
|
386 |
+
}
|
387 |
+
},
|
388 |
+
"node_modules/@formatjs/icu-skeleton-parser": {
|
389 |
+
"version": "1.3.6",
|
390 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
|
391 |
+
"integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
|
392 |
+
"dependencies": {
|
393 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
394 |
+
"tslib": "^2.1.0"
|
395 |
+
}
|
396 |
+
},
|
397 |
+
"node_modules/@formatjs/intl-localematcher": {
|
398 |
+
"version": "0.2.25",
|
399 |
+
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
|
400 |
+
"integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
|
401 |
+
"dependencies": {
|
402 |
+
"tslib": "^2.1.0"
|
403 |
+
}
|
404 |
+
},
|
405 |
+
"node_modules/@gradio/atoms": {
|
406 |
+
"version": "0.2.0-beta.5",
|
407 |
+
"resolved": "https://registry.npmjs.org/@gradio/atoms/-/atoms-0.2.0-beta.5.tgz",
|
408 |
+
"integrity": "sha512-eKIylgLVTulFFzkjmjfYoC+pF3iAnytVYaHVie+G9rkiDYRN6/+bPd4wXx72AMI3EwixT4ghW34nbvsOSwaCEw==",
|
409 |
+
"dependencies": {
|
410 |
+
"@gradio/icons": "^0.2.0-beta.2",
|
411 |
+
"@gradio/utils": "^0.2.0-beta.5"
|
412 |
+
}
|
413 |
+
},
|
414 |
+
"node_modules/@gradio/column": {
|
415 |
+
"version": "0.1.0",
|
416 |
+
"resolved": "https://registry.npmjs.org/@gradio/column/-/column-0.1.0.tgz",
|
417 |
+
"integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
|
418 |
+
},
|
419 |
+
"node_modules/@gradio/icons": {
|
420 |
+
"version": "0.2.0-beta.2",
|
421 |
+
"resolved": "https://registry.npmjs.org/@gradio/icons/-/icons-0.2.0-beta.2.tgz",
|
422 |
+
"integrity": "sha512-5BHWcbuCk546OX2PmmNryTZ7ZXGNUr2ipzHpnLCE/8e9R1SQiCZuHWQCdTJIqh5aOfPa4beu7Pu/nvcz0yuPmw=="
|
423 |
+
},
|
424 |
+
"node_modules/@gradio/statustracker": {
|
425 |
+
"version": "0.3.0-beta.7",
|
426 |
+
"resolved": "https://registry.npmjs.org/@gradio/statustracker/-/statustracker-0.3.0-beta.7.tgz",
|
427 |
+
"integrity": "sha512-F8vRA1qnsV53HTwmvjSNz2n13NfMxHMgW5TmAFDBfs5HdPtYKXuc0ur+PitBs/IvXHHgGeDqtQpQRS3MokvmVA==",
|
428 |
+
"dependencies": {
|
429 |
+
"@gradio/atoms": "^0.2.0-beta.5",
|
430 |
+
"@gradio/column": "^0.1.0-beta.3",
|
431 |
+
"@gradio/icons": "^0.2.0-beta.2",
|
432 |
+
"@gradio/utils": "^0.2.0-beta.5"
|
433 |
+
}
|
434 |
+
},
|
435 |
+
"node_modules/@gradio/theme": {
|
436 |
+
"version": "0.2.0",
|
437 |
+
"resolved": "https://registry.npmjs.org/@gradio/theme/-/theme-0.2.0.tgz",
|
438 |
+
"integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
|
439 |
+
},
|
440 |
+
"node_modules/@gradio/utils": {
|
441 |
+
"version": "0.2.0-beta.5",
|
442 |
+
"resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.0-beta.5.tgz",
|
443 |
+
"integrity": "sha512-CXz9fpy08weaAnfGVh69aj1sQtPkPkeMw546F+YtZ0tnmmKbnDxWCP4NN6NA4OeiZPA+N0yl+Nqo6cX8G4UBhg==",
|
444 |
+
"dependencies": {
|
445 |
+
"@gradio/theme": "^0.2.0-beta.2",
|
446 |
+
"svelte-i18n": "^3.6.0"
|
447 |
+
}
|
448 |
+
},
|
449 |
+
"node_modules/@jridgewell/gen-mapping": {
|
450 |
+
"version": "0.3.3",
|
451 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
|
452 |
+
"integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
|
453 |
+
"peer": true,
|
454 |
+
"dependencies": {
|
455 |
+
"@jridgewell/set-array": "^1.0.1",
|
456 |
+
"@jridgewell/sourcemap-codec": "^1.4.10",
|
457 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
458 |
+
},
|
459 |
+
"engines": {
|
460 |
+
"node": ">=6.0.0"
|
461 |
+
}
|
462 |
+
},
|
463 |
+
"node_modules/@jridgewell/resolve-uri": {
|
464 |
+
"version": "3.1.1",
|
465 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
466 |
+
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
467 |
+
"peer": true,
|
468 |
+
"engines": {
|
469 |
+
"node": ">=6.0.0"
|
470 |
+
}
|
471 |
+
},
|
472 |
+
"node_modules/@jridgewell/set-array": {
|
473 |
+
"version": "1.1.2",
|
474 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
475 |
+
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
476 |
+
"peer": true,
|
477 |
+
"engines": {
|
478 |
+
"node": ">=6.0.0"
|
479 |
+
}
|
480 |
+
},
|
481 |
+
"node_modules/@jridgewell/sourcemap-codec": {
|
482 |
+
"version": "1.4.15",
|
483 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
484 |
+
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
485 |
+
"peer": true
|
486 |
+
},
|
487 |
+
"node_modules/@jridgewell/trace-mapping": {
|
488 |
+
"version": "0.3.20",
|
489 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
|
490 |
+
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
|
491 |
+
"peer": true,
|
492 |
+
"dependencies": {
|
493 |
+
"@jridgewell/resolve-uri": "^3.1.0",
|
494 |
+
"@jridgewell/sourcemap-codec": "^1.4.14"
|
495 |
+
}
|
496 |
+
},
|
497 |
+
"node_modules/@types/estree": {
|
498 |
+
"version": "1.0.4",
|
499 |
+
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz",
|
500 |
+
"integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==",
|
501 |
+
"peer": true
|
502 |
+
},
|
503 |
+
"node_modules/acorn": {
|
504 |
+
"version": "8.11.2",
|
505 |
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
506 |
+
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
|
507 |
+
"peer": true,
|
508 |
+
"bin": {
|
509 |
+
"acorn": "bin/acorn"
|
510 |
+
},
|
511 |
+
"engines": {
|
512 |
+
"node": ">=0.4.0"
|
513 |
+
}
|
514 |
+
},
|
515 |
+
"node_modules/aria-query": {
|
516 |
+
"version": "5.3.0",
|
517 |
+
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
518 |
+
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
519 |
+
"peer": true,
|
520 |
+
"dependencies": {
|
521 |
+
"dequal": "^2.0.3"
|
522 |
+
}
|
523 |
+
},
|
524 |
+
"node_modules/axobject-query": {
|
525 |
+
"version": "3.2.1",
|
526 |
+
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
527 |
+
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
528 |
+
"peer": true,
|
529 |
+
"dependencies": {
|
530 |
+
"dequal": "^2.0.3"
|
531 |
+
}
|
532 |
+
},
|
533 |
+
"node_modules/cli-color": {
|
534 |
+
"version": "2.0.3",
|
535 |
+
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz",
|
536 |
+
"integrity": "sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==",
|
537 |
+
"dependencies": {
|
538 |
+
"d": "^1.0.1",
|
539 |
+
"es5-ext": "^0.10.61",
|
540 |
+
"es6-iterator": "^2.0.3",
|
541 |
+
"memoizee": "^0.4.15",
|
542 |
+
"timers-ext": "^0.1.7"
|
543 |
+
},
|
544 |
+
"engines": {
|
545 |
+
"node": ">=0.10"
|
546 |
+
}
|
547 |
+
},
|
548 |
+
"node_modules/code-red": {
|
549 |
+
"version": "1.0.4",
|
550 |
+
"resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
|
551 |
+
"integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
|
552 |
+
"peer": true,
|
553 |
+
"dependencies": {
|
554 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
555 |
+
"@types/estree": "^1.0.1",
|
556 |
+
"acorn": "^8.10.0",
|
557 |
+
"estree-walker": "^3.0.3",
|
558 |
+
"periscopic": "^3.1.0"
|
559 |
+
}
|
560 |
+
},
|
561 |
+
"node_modules/css-tree": {
|
562 |
+
"version": "2.3.1",
|
563 |
+
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
|
564 |
+
"integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
|
565 |
+
"peer": true,
|
566 |
+
"dependencies": {
|
567 |
+
"mdn-data": "2.0.30",
|
568 |
+
"source-map-js": "^1.0.1"
|
569 |
+
},
|
570 |
+
"engines": {
|
571 |
+
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
|
572 |
+
}
|
573 |
+
},
|
574 |
+
"node_modules/d": {
|
575 |
+
"version": "1.0.1",
|
576 |
+
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
577 |
+
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
578 |
+
"dependencies": {
|
579 |
+
"es5-ext": "^0.10.50",
|
580 |
+
"type": "^1.0.1"
|
581 |
+
}
|
582 |
+
},
|
583 |
+
"node_modules/deepmerge": {
|
584 |
+
"version": "4.3.1",
|
585 |
+
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
586 |
+
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
587 |
+
"engines": {
|
588 |
+
"node": ">=0.10.0"
|
589 |
+
}
|
590 |
+
},
|
591 |
+
"node_modules/dequal": {
|
592 |
+
"version": "2.0.3",
|
593 |
+
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
594 |
+
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
595 |
+
"peer": true,
|
596 |
+
"engines": {
|
597 |
+
"node": ">=6"
|
598 |
+
}
|
599 |
+
},
|
600 |
+
"node_modules/es5-ext": {
|
601 |
+
"version": "0.10.62",
|
602 |
+
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
|
603 |
+
"integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
|
604 |
+
"hasInstallScript": true,
|
605 |
+
"dependencies": {
|
606 |
+
"es6-iterator": "^2.0.3",
|
607 |
+
"es6-symbol": "^3.1.3",
|
608 |
+
"next-tick": "^1.1.0"
|
609 |
+
},
|
610 |
+
"engines": {
|
611 |
+
"node": ">=0.10"
|
612 |
+
}
|
613 |
+
},
|
614 |
+
"node_modules/es6-iterator": {
|
615 |
+
"version": "2.0.3",
|
616 |
+
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
617 |
+
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
618 |
+
"dependencies": {
|
619 |
+
"d": "1",
|
620 |
+
"es5-ext": "^0.10.35",
|
621 |
+
"es6-symbol": "^3.1.1"
|
622 |
+
}
|
623 |
+
},
|
624 |
+
"node_modules/es6-symbol": {
|
625 |
+
"version": "3.1.3",
|
626 |
+
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
627 |
+
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
628 |
+
"dependencies": {
|
629 |
+
"d": "^1.0.1",
|
630 |
+
"ext": "^1.1.2"
|
631 |
+
}
|
632 |
+
},
|
633 |
+
"node_modules/es6-weak-map": {
|
634 |
+
"version": "2.0.3",
|
635 |
+
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
|
636 |
+
"integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
|
637 |
+
"dependencies": {
|
638 |
+
"d": "1",
|
639 |
+
"es5-ext": "^0.10.46",
|
640 |
+
"es6-iterator": "^2.0.3",
|
641 |
+
"es6-symbol": "^3.1.1"
|
642 |
+
}
|
643 |
+
},
|
644 |
+
"node_modules/esbuild": {
|
645 |
+
"version": "0.19.5",
|
646 |
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz",
|
647 |
+
"integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==",
|
648 |
+
"hasInstallScript": true,
|
649 |
+
"bin": {
|
650 |
+
"esbuild": "bin/esbuild"
|
651 |
+
},
|
652 |
+
"engines": {
|
653 |
+
"node": ">=12"
|
654 |
+
},
|
655 |
+
"optionalDependencies": {
|
656 |
+
"@esbuild/android-arm": "0.19.5",
|
657 |
+
"@esbuild/android-arm64": "0.19.5",
|
658 |
+
"@esbuild/android-x64": "0.19.5",
|
659 |
+
"@esbuild/darwin-arm64": "0.19.5",
|
660 |
+
"@esbuild/darwin-x64": "0.19.5",
|
661 |
+
"@esbuild/freebsd-arm64": "0.19.5",
|
662 |
+
"@esbuild/freebsd-x64": "0.19.5",
|
663 |
+
"@esbuild/linux-arm": "0.19.5",
|
664 |
+
"@esbuild/linux-arm64": "0.19.5",
|
665 |
+
"@esbuild/linux-ia32": "0.19.5",
|
666 |
+
"@esbuild/linux-loong64": "0.19.5",
|
667 |
+
"@esbuild/linux-mips64el": "0.19.5",
|
668 |
+
"@esbuild/linux-ppc64": "0.19.5",
|
669 |
+
"@esbuild/linux-riscv64": "0.19.5",
|
670 |
+
"@esbuild/linux-s390x": "0.19.5",
|
671 |
+
"@esbuild/linux-x64": "0.19.5",
|
672 |
+
"@esbuild/netbsd-x64": "0.19.5",
|
673 |
+
"@esbuild/openbsd-x64": "0.19.5",
|
674 |
+
"@esbuild/sunos-x64": "0.19.5",
|
675 |
+
"@esbuild/win32-arm64": "0.19.5",
|
676 |
+
"@esbuild/win32-ia32": "0.19.5",
|
677 |
+
"@esbuild/win32-x64": "0.19.5"
|
678 |
+
}
|
679 |
+
},
|
680 |
+
"node_modules/estree-walker": {
|
681 |
+
"version": "3.0.3",
|
682 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
683 |
+
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
684 |
+
"peer": true,
|
685 |
+
"dependencies": {
|
686 |
+
"@types/estree": "^1.0.0"
|
687 |
+
}
|
688 |
+
},
|
689 |
+
"node_modules/event-emitter": {
|
690 |
+
"version": "0.3.5",
|
691 |
+
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
692 |
+
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
693 |
+
"dependencies": {
|
694 |
+
"d": "1",
|
695 |
+
"es5-ext": "~0.10.14"
|
696 |
+
}
|
697 |
+
},
|
698 |
+
"node_modules/ext": {
|
699 |
+
"version": "1.7.0",
|
700 |
+
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
701 |
+
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
702 |
+
"dependencies": {
|
703 |
+
"type": "^2.7.2"
|
704 |
+
}
|
705 |
+
},
|
706 |
+
"node_modules/ext/node_modules/type": {
|
707 |
+
"version": "2.7.2",
|
708 |
+
"resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
|
709 |
+
"integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
|
710 |
+
},
|
711 |
+
"node_modules/globalyzer": {
|
712 |
+
"version": "0.1.0",
|
713 |
+
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
714 |
+
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
|
715 |
+
},
|
716 |
+
"node_modules/globrex": {
|
717 |
+
"version": "0.1.2",
|
718 |
+
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
719 |
+
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
|
720 |
+
},
|
721 |
+
"node_modules/intl-messageformat": {
|
722 |
+
"version": "9.13.0",
|
723 |
+
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
|
724 |
+
"integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
|
725 |
+
"dependencies": {
|
726 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
727 |
+
"@formatjs/fast-memoize": "1.2.1",
|
728 |
+
"@formatjs/icu-messageformat-parser": "2.1.0",
|
729 |
+
"tslib": "^2.1.0"
|
730 |
+
}
|
731 |
+
},
|
732 |
+
"node_modules/is-promise": {
|
733 |
+
"version": "2.2.2",
|
734 |
+
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
|
735 |
+
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
736 |
+
},
|
737 |
+
"node_modules/is-reference": {
|
738 |
+
"version": "3.0.2",
|
739 |
+
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
|
740 |
+
"integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
|
741 |
+
"peer": true,
|
742 |
+
"dependencies": {
|
743 |
+
"@types/estree": "*"
|
744 |
+
}
|
745 |
+
},
|
746 |
+
"node_modules/locate-character": {
|
747 |
+
"version": "3.0.0",
|
748 |
+
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
|
749 |
+
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
750 |
+
"peer": true
|
751 |
+
},
|
752 |
+
"node_modules/lru-queue": {
|
753 |
+
"version": "0.1.0",
|
754 |
+
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
|
755 |
+
"integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
|
756 |
+
"dependencies": {
|
757 |
+
"es5-ext": "~0.10.2"
|
758 |
+
}
|
759 |
+
},
|
760 |
+
"node_modules/magic-string": {
|
761 |
+
"version": "0.30.5",
|
762 |
+
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
|
763 |
+
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
|
764 |
+
"peer": true,
|
765 |
+
"dependencies": {
|
766 |
+
"@jridgewell/sourcemap-codec": "^1.4.15"
|
767 |
+
},
|
768 |
+
"engines": {
|
769 |
+
"node": ">=12"
|
770 |
+
}
|
771 |
+
},
|
772 |
+
"node_modules/mdn-data": {
|
773 |
+
"version": "2.0.30",
|
774 |
+
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
|
775 |
+
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
|
776 |
+
"peer": true
|
777 |
+
},
|
778 |
+
"node_modules/memoizee": {
|
779 |
+
"version": "0.4.15",
|
780 |
+
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
|
781 |
+
"integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
|
782 |
+
"dependencies": {
|
783 |
+
"d": "^1.0.1",
|
784 |
+
"es5-ext": "^0.10.53",
|
785 |
+
"es6-weak-map": "^2.0.3",
|
786 |
+
"event-emitter": "^0.3.5",
|
787 |
+
"is-promise": "^2.2.2",
|
788 |
+
"lru-queue": "^0.1.0",
|
789 |
+
"next-tick": "^1.1.0",
|
790 |
+
"timers-ext": "^0.1.7"
|
791 |
+
}
|
792 |
+
},
|
793 |
+
"node_modules/mri": {
|
794 |
+
"version": "1.2.0",
|
795 |
+
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
796 |
+
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
|
797 |
+
"engines": {
|
798 |
+
"node": ">=4"
|
799 |
+
}
|
800 |
+
},
|
801 |
+
"node_modules/next-tick": {
|
802 |
+
"version": "1.1.0",
|
803 |
+
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
804 |
+
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
805 |
+
},
|
806 |
+
"node_modules/periscopic": {
|
807 |
+
"version": "3.1.0",
|
808 |
+
"resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
|
809 |
+
"integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
|
810 |
+
"peer": true,
|
811 |
+
"dependencies": {
|
812 |
+
"@types/estree": "^1.0.0",
|
813 |
+
"estree-walker": "^3.0.0",
|
814 |
+
"is-reference": "^3.0.0"
|
815 |
+
}
|
816 |
+
},
|
817 |
+
"node_modules/sade": {
|
818 |
+
"version": "1.8.1",
|
819 |
+
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
820 |
+
"integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
|
821 |
+
"dependencies": {
|
822 |
+
"mri": "^1.1.0"
|
823 |
+
},
|
824 |
+
"engines": {
|
825 |
+
"node": ">=6"
|
826 |
+
}
|
827 |
+
},
|
828 |
+
"node_modules/source-map-js": {
|
829 |
+
"version": "1.0.2",
|
830 |
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
831 |
+
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
832 |
+
"peer": true,
|
833 |
+
"engines": {
|
834 |
+
"node": ">=0.10.0"
|
835 |
+
}
|
836 |
+
},
|
837 |
+
"node_modules/svelte": {
|
838 |
+
"version": "4.2.2",
|
839 |
+
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.2.tgz",
|
840 |
+
"integrity": "sha512-My2tytF2e2NnHSpn2M7/3VdXT4JdTglYVUuSuK/mXL2XtulPYbeBfl8Dm1QiaKRn0zoULRnL+EtfZHHP0k4H3A==",
|
841 |
+
"peer": true,
|
842 |
+
"dependencies": {
|
843 |
+
"@ampproject/remapping": "^2.2.1",
|
844 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
845 |
+
"@jridgewell/trace-mapping": "^0.3.18",
|
846 |
+
"acorn": "^8.9.0",
|
847 |
+
"aria-query": "^5.3.0",
|
848 |
+
"axobject-query": "^3.2.1",
|
849 |
+
"code-red": "^1.0.3",
|
850 |
+
"css-tree": "^2.3.1",
|
851 |
+
"estree-walker": "^3.0.3",
|
852 |
+
"is-reference": "^3.0.1",
|
853 |
+
"locate-character": "^3.0.0",
|
854 |
+
"magic-string": "^0.30.4",
|
855 |
+
"periscopic": "^3.1.0"
|
856 |
+
},
|
857 |
+
"engines": {
|
858 |
+
"node": ">=16"
|
859 |
+
}
|
860 |
+
},
|
861 |
+
"node_modules/svelte-i18n": {
|
862 |
+
"version": "3.7.4",
|
863 |
+
"resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
|
864 |
+
"integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
|
865 |
+
"dependencies": {
|
866 |
+
"cli-color": "^2.0.3",
|
867 |
+
"deepmerge": "^4.2.2",
|
868 |
+
"esbuild": "^0.19.2",
|
869 |
+
"estree-walker": "^2",
|
870 |
+
"intl-messageformat": "^9.13.0",
|
871 |
+
"sade": "^1.8.1",
|
872 |
+
"tiny-glob": "^0.2.9"
|
873 |
+
},
|
874 |
+
"bin": {
|
875 |
+
"svelte-i18n": "dist/cli.js"
|
876 |
+
},
|
877 |
+
"engines": {
|
878 |
+
"node": ">= 16"
|
879 |
+
},
|
880 |
+
"peerDependencies": {
|
881 |
+
"svelte": "^3 || ^4"
|
882 |
+
}
|
883 |
+
},
|
884 |
+
"node_modules/svelte-i18n/node_modules/estree-walker": {
|
885 |
+
"version": "2.0.2",
|
886 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
887 |
+
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
888 |
+
},
|
889 |
+
"node_modules/timers-ext": {
|
890 |
+
"version": "0.1.7",
|
891 |
+
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
|
892 |
+
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
|
893 |
+
"dependencies": {
|
894 |
+
"es5-ext": "~0.10.46",
|
895 |
+
"next-tick": "1"
|
896 |
+
}
|
897 |
+
},
|
898 |
+
"node_modules/tiny-glob": {
|
899 |
+
"version": "0.2.9",
|
900 |
+
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
901 |
+
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
902 |
+
"dependencies": {
|
903 |
+
"globalyzer": "0.1.0",
|
904 |
+
"globrex": "^0.1.2"
|
905 |
+
}
|
906 |
+
},
|
907 |
+
"node_modules/tslib": {
|
908 |
+
"version": "2.6.2",
|
909 |
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
910 |
+
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
|
911 |
+
},
|
912 |
+
"node_modules/type": {
|
913 |
+
"version": "1.2.0",
|
914 |
+
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
915 |
+
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
916 |
+
}
|
917 |
+
}
|
918 |
+
}
|
src/frontend/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_rich_textbox",
|
3 |
+
"version": "0.1.0-beta.1",
|
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.2.0-beta.5",
|
17 |
+
"@gradio/icons": "0.2.0-beta.2",
|
18 |
+
"@gradio/statustracker": "0.3.0-beta.7",
|
19 |
+
"@gradio/utils": "0.2.0-beta.5"
|
20 |
+
}
|
21 |
+
}
|
src/frontend/utils.js
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// JS function to convert BBCode and HTML code - http;//coursesweb.net/javascript/
|
2 |
+
var BBCodeHTML = function() {
|
3 |
+
var me = this; // stores the object instance
|
4 |
+
var token_match = /{[A-Z_]+[0-9]*}/ig;
|
5 |
+
|
6 |
+
// regular expressions for the different bbcode tokens
|
7 |
+
var tokens = {
|
8 |
+
'URL' : '((?:(?:[a-z][a-z\\d+\\-.]*:\\/{2}(?:(?:[a-z0-9\\-._~\\!$&\'*+,;=:@|]+|%[\\dA-F]{2})+|[0-9.]+|\\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\\])(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~\\!$&\'*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~\\!$&\'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?(?:#(?:[a-z0-9\\-._~\\!$&\'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?)|(?:www\\.(?:[a-z0-9\\-._~\\!$&\'*+,;=:@|]+|%[\\dA-F]{2})+(?::\\d*)?(?:\\/(?:[a-z0-9\\-._~\\!$&\'*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~\\!$&\'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?(?:#(?:[a-z0-9\\-._~\\!$&\'*+,;=:@\\/?|]+|%[\\dA-F]{2})*)?)))',
|
9 |
+
'LINK' : '([a-z0-9\-\./]+[^"\' ]*)',
|
10 |
+
'EMAIL' : '((?:[\\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@(?:(?:(?:(?:(?:[a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(?:\\d{1,3}\.){3}\\d{1,3}(?:\:\\d{1,5})?))',
|
11 |
+
'TEXT' : '(.*?)',
|
12 |
+
'SIMPLETEXT' : '([a-zA-Z0-9-+.,_ ]+)',
|
13 |
+
'INTTEXT' : '([a-zA-Z0-9-+,_. ]+)',
|
14 |
+
'IDENTIFIER' : '([a-zA-Z0-9-_]+)',
|
15 |
+
'COLOR' : '([a-z]+|#[0-9abcdef]+)',
|
16 |
+
'NUMBER' : '([0-9]+)'
|
17 |
+
};
|
18 |
+
|
19 |
+
var bbcode_matches = []; // matches for bbcode to html
|
20 |
+
|
21 |
+
var html_tpls = []; // html templates for html to bbcode
|
22 |
+
|
23 |
+
var html_matches = []; // matches for html to bbcode
|
24 |
+
|
25 |
+
var bbcode_tpls = []; // bbcode templates for bbcode to html
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Turns a bbcode into a regular rexpression by changing the tokens into
|
29 |
+
* their regex form
|
30 |
+
*/
|
31 |
+
var _getRegEx = function(str) {
|
32 |
+
var matches = str.match(token_match);
|
33 |
+
var nrmatches = matches.length;
|
34 |
+
var i = 0;
|
35 |
+
var replacement = '';
|
36 |
+
|
37 |
+
if (nrmatches <= 0) {
|
38 |
+
return new RegExp(preg_quote(str), 'g'); // no tokens so return the escaped string
|
39 |
+
}
|
40 |
+
|
41 |
+
for(; i < nrmatches; i += 1) {
|
42 |
+
// Remove {, } and numbers from the token so it can match the
|
43 |
+
// keys in tokens
|
44 |
+
var token = matches[i].replace(/[{}0-9]/g, '');
|
45 |
+
|
46 |
+
if (tokens[token]) {
|
47 |
+
// Escape everything before the token
|
48 |
+
replacement += preg_quote(str.substr(0, str.indexOf(matches[i]))) + tokens[token];
|
49 |
+
|
50 |
+
// Remove everything before the end of the token so it can be used
|
51 |
+
// with the next token. Doing this so that parts can be escaped
|
52 |
+
str = str.substr(str.indexOf(matches[i]) + matches[i].length);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
replacement += preg_quote(str); // add whatever is left to the string
|
57 |
+
|
58 |
+
return new RegExp(replacement, 'gi');
|
59 |
+
};
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Turns a bbcode template into the replacement form used in regular expressions
|
63 |
+
* by turning the tokens in $1, $2, etc.
|
64 |
+
*/
|
65 |
+
var _getTpls = function(str) {
|
66 |
+
var matches = str.match(token_match);
|
67 |
+
var nrmatches = matches.length;
|
68 |
+
var i = 0;
|
69 |
+
var replacement = '';
|
70 |
+
var positions = {};
|
71 |
+
var next_position = 0;
|
72 |
+
|
73 |
+
if (nrmatches <= 0) {
|
74 |
+
return str; // no tokens so return the string
|
75 |
+
}
|
76 |
+
|
77 |
+
for(; i < nrmatches; i += 1) {
|
78 |
+
// Remove {, } and numbers from the token so it can match the
|
79 |
+
// keys in tokens
|
80 |
+
var token = matches[i].replace(/[{}0-9]/g, '');
|
81 |
+
var position;
|
82 |
+
|
83 |
+
// figure out what $# to use ($1, $2)
|
84 |
+
if (positions[matches[i]]) {
|
85 |
+
position = positions[matches[i]]; // if the token already has a position then use that
|
86 |
+
} else {
|
87 |
+
// token doesn't have a position so increment the next position
|
88 |
+
// and record this token's position
|
89 |
+
next_position += 1;
|
90 |
+
position = next_position;
|
91 |
+
positions[matches[i]] = position;
|
92 |
+
}
|
93 |
+
|
94 |
+
if (tokens[token]) {
|
95 |
+
replacement += str.substr(0, str.indexOf(matches[i])) + '$' + position;
|
96 |
+
str = str.substr(str.indexOf(matches[i]) + matches[i].length);
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
replacement += str;
|
101 |
+
|
102 |
+
return replacement;
|
103 |
+
};
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Adds a bbcode to the list
|
107 |
+
*/
|
108 |
+
me.addBBCode = function(bbcode_match, bbcode_tpl) {
|
109 |
+
// add the regular expressions and templates for bbcode to html
|
110 |
+
bbcode_matches.push(_getRegEx(bbcode_match));
|
111 |
+
html_tpls.push(_getTpls(bbcode_tpl));
|
112 |
+
|
113 |
+
// add the regular expressions and templates for html to bbcode
|
114 |
+
html_matches.push(_getRegEx(bbcode_tpl));
|
115 |
+
bbcode_tpls.push(_getTpls(bbcode_match));
|
116 |
+
};
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Turns all of the added bbcodes into html
|
120 |
+
*/
|
121 |
+
me.bbcodeToHtml = function(str) {
|
122 |
+
var nrbbcmatches = bbcode_matches.length;
|
123 |
+
var i = 0;
|
124 |
+
|
125 |
+
for(; i < nrbbcmatches; i += 1) {
|
126 |
+
str = str.replace(bbcode_matches[i], html_tpls[i]);
|
127 |
+
}
|
128 |
+
|
129 |
+
return str;
|
130 |
+
};
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Turns html into bbcode
|
134 |
+
*/
|
135 |
+
me.htmlToBBCode = function(str) {
|
136 |
+
var nrhtmlmatches = html_matches.length;
|
137 |
+
var i = 0;
|
138 |
+
|
139 |
+
for(; i < nrhtmlmatches; i += 1) {
|
140 |
+
str = str.replace(html_matches[i], bbcode_tpls[i]);
|
141 |
+
}
|
142 |
+
|
143 |
+
return str;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Quote regular expression characters plus an optional character
|
148 |
+
* taken from phpjs.org
|
149 |
+
*/
|
150 |
+
function preg_quote (str, delimiter) {
|
151 |
+
return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
|
152 |
+
}
|
153 |
+
|
154 |
+
// adds BBCodes and their HTML
|
155 |
+
me.addBBCode('[b]{TEXT}[/b]', '<strong>{TEXT}</strong>');
|
156 |
+
me.addBBCode('[i]{TEXT}[/i]', '<em>{TEXT}</em>');
|
157 |
+
me.addBBCode('[u]{TEXT}[/u]', '<span style="text-decoration:underline;">{TEXT}</span>');
|
158 |
+
me.addBBCode('[s]{TEXT}[/s]', '<span style="text-decoration:line-through;">{TEXT}</span>');
|
159 |
+
me.addBBCode('[color={COLOR}]{TEXT}[/color]', '<span style="color:{COLOR}">{TEXT}</span>');
|
160 |
+
};
|
161 |
+
|
162 |
+
export var bbcodeParser = new BBCodeHTML(); // creates object instance of BBCodeHTML()
|
src/pyproject.toml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_rich_textbox"
|
11 |
+
version = "0.1.0"
|
12 |
+
description = "Gradio custom component for rich text input"
|
13 |
+
readme = "README.md"
|
14 |
+
license = "Apache-2.0"
|
15 |
+
requires-python = ">=3.8"
|
16 |
+
authors = [{ name = "YOUR NAME", email = "YOUREMAIL@domain.com" }]
|
17 |
+
keywords = [
|
18 |
+
"machine learning",
|
19 |
+
"reproducibility",
|
20 |
+
"visualization",
|
21 |
+
"gradio",
|
22 |
+
"gradio custom component",
|
23 |
+
"gradio-template-SimpleTextbox"
|
24 |
+
]
|
25 |
+
# Add dependencies here
|
26 |
+
dependencies = ["gradio>=4.0,<5.0"]
|
27 |
+
classifiers = [
|
28 |
+
'Development Status :: 3 - Alpha',
|
29 |
+
'License :: OSI Approved :: Apache Software License',
|
30 |
+
'Operating System :: OS Independent',
|
31 |
+
'Programming Language :: Python :: 3',
|
32 |
+
'Programming Language :: Python :: 3 :: Only',
|
33 |
+
'Programming Language :: Python :: 3.8',
|
34 |
+
'Programming Language :: Python :: 3.9',
|
35 |
+
'Programming Language :: Python :: 3.10',
|
36 |
+
'Programming Language :: Python :: 3.11',
|
37 |
+
'Topic :: Scientific/Engineering',
|
38 |
+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
39 |
+
'Topic :: Scientific/Engineering :: Visualization',
|
40 |
+
]
|
41 |
+
|
42 |
+
[project.optional-dependencies]
|
43 |
+
dev = ["build", "twine"]
|
44 |
+
|
45 |
+
[tool.hatch.build]
|
46 |
+
artifacts = ["/backend/gradio_richtextbox/templates", "*.pyi", "backend/gradio_rich_textbox/templates"]
|
47 |
+
|
48 |
+
[tool.hatch.build.targets.wheel]
|
49 |
+
packages = ["/backend/gradio_richtextbox"]
|